Skip to content

Commit 0651cc3

Browse files
committed
Allow changing the background color of ipl-dialog-title
1 parent a26cfc2 commit 0651cc3

File tree

5 files changed

+34
-8
lines changed

5 files changed

+34
-8
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 3.2.0
2+
3+
- Allow changing the background color of ipl-dialog-title
4+
15
# 3.1.0
26

37
- Allow adding labels to ipl-button through its default slot

docs/examples/DialogTitleExample.vue

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
<template>
22
<event-log>
3-
<div class="resizable alt-background">
3+
<div class="resizable gray-background vertical-layout">
44
<!-- #region example -->
55
<ipl-dialog-title
66
title="Dialog Title"
77
:closing-disabled="disableClosing"
88
/>
9+
<ipl-dialog-title
10+
title="Dialog Title (Secondary Color)"
11+
color="secondary"
12+
:closing-disabled="disableClosing"
13+
/>
14+
<ipl-dialog-title
15+
title="Dialog Title (Blue)"
16+
color="blue"
17+
:closing-disabled="disableClosing"
18+
/>
919
<!-- #endregion example -->
1020
</div>
1121
<template #extra>

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@iplsplatoon/vue-components",
3-
"version": "3.1.0",
3+
"version": "3.2.0",
44
"description": "Vue components for internal Inkling Performance Labs utilities.",
55
"homepage": "https://github.com/IPLSplatoon/vue-components",
66
"repository": "https://github.com/IPLSplatoon/vue-components",
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`IplDialogTitle matches snapshot 1`] = `
4-
"<div class="ipl-dialog-title"><span class="ipl-dialog-title__title-text">Cool Dialog</span>
4+
"<div class="ipl-dialog-title color-primary"><span class="ipl-dialog-title__title-text">Cool Dialog</span>
55
<ipl-button-stub icon="[object Object]" color="transparent" disabled="false" async="false" progressmessage="Working..." successmessage="Done!" requiresconfirmation="false" shortconfirmationmessage="false" small="true" disableonsuccess="false" inline="true" data-test="close-button" class="close-button"></ipl-button-stub>
66
</div>"
77
`;
88

99
exports[`IplDialogTitle matches snapshot when closing is disabled 1`] = `
10-
"<div class="ipl-dialog-title"><span class="ipl-dialog-title__title-text">Cool Dialog</span>
10+
"<div class="ipl-dialog-title color-primary"><span class="ipl-dialog-title__title-text">Cool Dialog</span>
1111
<ipl-button-stub icon="[object Object]" color="transparent" disabled="true" async="false" progressmessage="Working..." successmessage="Done!" requiresconfirmation="false" shortconfirmationmessage="false" small="true" disableonsuccess="false" inline="true" data-test="close-button" class="close-button"></ipl-button-stub>
1212
</div>"
1313
`;

src/components/iplDialogTitle.vue

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<template>
2-
<div class="ipl-dialog-title">
2+
<div
3+
class="ipl-dialog-title"
4+
:class="`color-${color}`"
5+
>
36
<span class="ipl-dialog-title__title-text">{{ title }}</span>
47
<ipl-button
58
data-test="close-button"
@@ -15,9 +18,10 @@
1518
</template>
1619

1720
<script lang="ts">
18-
import { defineComponent } from 'vue';
21+
import { defineComponent, PropType } from 'vue';
1922
import { faTimes } from '@fortawesome/free-solid-svg-icons';
2023
import IplButton from './iplButton.vue';
24+
import { isValidSpaceColor, SpaceColor } from '../helpers/spaceColorHelper';
2125
2226
export default defineComponent({
2327
name: 'IplDialogTitle',
@@ -32,6 +36,13 @@ export default defineComponent({
3236
closingDisabled: {
3337
type: Boolean,
3438
default: false
39+
},
40+
color: {
41+
type: String as PropType<SpaceColor>,
42+
default: 'primary',
43+
validator: (value: string): boolean => {
44+
return isValidSpaceColor(value);
45+
}
3546
}
3647
},
3748
@@ -50,15 +61,16 @@ export default defineComponent({
5061

5162
<style lang="scss" scoped>
5263
@use 'src/styles/constants';
64+
@use 'src/styles/space';
5365
5466
.ipl-dialog-title {
67+
@include space.space-colors();
68+
5569
display: flex;
5670
flex-direction: row;
5771
align-items: center;
58-
background-color: var(--ipl-bg-primary);
5972
padding: 4px 8px;
6073
border-radius: constants.$border-radius-outer;
61-
color: var(--ipl-body-text-color);
6274
6375
.ipl-dialog-title__title-text {
6476
flex-grow: 1;

0 commit comments

Comments
 (0)