tide-design-system 2.4.7 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/style.css +1 -1
- package/dist/tide-design-system.cjs +2 -2
- package/dist/tide-design-system.esm.d.ts +109 -67
- package/dist/tide-design-system.esm.js +1288 -1258
- package/docs/upgrading.md +79 -0
- package/package.json +1 -1
- package/src/components/TideAccordionItem.vue +21 -13
- package/src/components/TideButtonSegmented.vue +14 -15
- package/src/components/TideChipFilter.vue +13 -7
- package/src/components/TideInputCheckbox.vue +0 -1
- package/src/components/TideModal.vue +32 -19
- package/src/components/TidePagination.vue +17 -19
- package/src/components/TideSheet.vue +23 -20
- package/src/components/TideSwitch.vue +23 -20
- package/src/stories/TideAccordionItem.stories.ts +33 -34
- package/src/stories/TideButtonSegmented.stories.ts +33 -25
- package/src/stories/TideChipFilter.stories.ts +33 -23
- package/src/stories/TideInputCheckbox.stories.ts +18 -10
- package/src/stories/TideModal.stories.ts +33 -37
- package/src/stories/TidePagination.stories.ts +31 -20
- package/src/stories/TideSheet.stories.ts +33 -28
- package/src/stories/TideSwitch.stories.ts +33 -34
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { action } from '@storybook/addon-actions';
|
|
2
|
+
import { ref, watch } from 'vue';
|
|
2
3
|
|
|
3
4
|
import TideButton from '@/components/TideButton.vue';
|
|
4
5
|
import TideSheet from '@/components/TideSheet.vue';
|
|
@@ -17,6 +18,7 @@ type Args = InstanceType<typeof TideSheet>['$props'] & {
|
|
|
17
18
|
default: string;
|
|
18
19
|
handleBack: string;
|
|
19
20
|
handleClose: string;
|
|
21
|
+
vModel: boolean;
|
|
20
22
|
};
|
|
21
23
|
|
|
22
24
|
const formatSnippet = (code: string, context: StoryContext) => {
|
|
@@ -59,28 +61,32 @@ const render = (args: Args, context: StoryContext) => ({
|
|
|
59
61
|
alert('Please specify a valid handler in the "back" control.');
|
|
60
62
|
}
|
|
61
63
|
},
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
handleIsOpenChange: (value: boolean) => {
|
|
65
|
+
context.updateArgs({ ...args, vModel: value });
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
setup: () => {
|
|
69
|
+
const isOpen = ref(args.vModel);
|
|
65
70
|
|
|
66
|
-
|
|
67
|
-
|
|
71
|
+
watch(isOpen, () => {
|
|
72
|
+
args.vModel = isOpen.value;
|
|
73
|
+
});
|
|
68
74
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
alert('Please specify a valid handler in the "close" control.');
|
|
75
|
+
watch(
|
|
76
|
+
() => args.vModel,
|
|
77
|
+
(newValue) => {
|
|
78
|
+
isOpen.value = newValue;
|
|
74
79
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
return {
|
|
83
|
+
args,
|
|
84
|
+
isOpen,
|
|
85
|
+
};
|
|
79
86
|
},
|
|
80
|
-
setup: () => ({ args }),
|
|
81
87
|
template: `
|
|
82
|
-
<TideButton label="Open sheet" @click="
|
|
83
|
-
<TideSheet v-bind="args"
|
|
88
|
+
<TideButton label="Open sheet" @click="handleIsOpenChange(true)" />
|
|
89
|
+
<TideSheet v-bind="args" v-model="isOpen" @back="handleBack" @update:modelValue="handleIsOpenChange">
|
|
84
90
|
${args.default}
|
|
85
91
|
</TideSheet>`,
|
|
86
92
|
});
|
|
@@ -107,16 +113,6 @@ export default {
|
|
|
107
113
|
type: { summary: '() => void' },
|
|
108
114
|
},
|
|
109
115
|
},
|
|
110
|
-
handleClose: {
|
|
111
|
-
control: 'text',
|
|
112
|
-
description: 'JS function to execute when sheet is closed',
|
|
113
|
-
name: 'close',
|
|
114
|
-
table: {
|
|
115
|
-
category: 'Events',
|
|
116
|
-
defaultValue: { summary: 'None' },
|
|
117
|
-
type: { summary: '() => void' },
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
116
|
isBackButton: {
|
|
121
117
|
...argTypeBooleanUnrequired,
|
|
122
118
|
description: 'Determines whether the back button is displayed',
|
|
@@ -130,13 +126,22 @@ export default {
|
|
|
130
126
|
defaultValue: { summary: 'False' },
|
|
131
127
|
},
|
|
132
128
|
},
|
|
129
|
+
vModel: {
|
|
130
|
+
control: 'boolean',
|
|
131
|
+
description: 'Data binding to Vue ref',
|
|
132
|
+
table: {
|
|
133
|
+
category: 'Native',
|
|
134
|
+
defaultValue: { summary: 'None' },
|
|
135
|
+
type: { summary: 'Ref<boolean>' },
|
|
136
|
+
},
|
|
137
|
+
},
|
|
133
138
|
},
|
|
134
139
|
args: {
|
|
135
140
|
default: `<div>${lineBreak}${tab}Default Slot Demo${lineBreak}</div>`,
|
|
136
141
|
handleBack: 'doSomething',
|
|
137
142
|
handleClose: 'doSomethingElse',
|
|
138
143
|
isBackButton: undefined,
|
|
139
|
-
|
|
144
|
+
vModel: false,
|
|
140
145
|
},
|
|
141
146
|
component: TideSheet,
|
|
142
147
|
parameters,
|
|
@@ -1,70 +1,69 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ref, watch } from 'vue';
|
|
2
2
|
|
|
3
3
|
import TideSwitch from '@/components/TideSwitch.vue';
|
|
4
|
-
import {
|
|
5
|
-
argTypeBooleanUnrequired,
|
|
6
|
-
change,
|
|
7
|
-
dataTrack,
|
|
8
|
-
disabledArgType,
|
|
9
|
-
doSomething,
|
|
10
|
-
parameters,
|
|
11
|
-
} from '@/utilities/storybook';
|
|
4
|
+
import { argTypeBooleanUnrequired, dataTrack, doSomething, parameters } from '@/utilities/storybook';
|
|
12
5
|
|
|
13
6
|
import type { StoryContext } from '@storybook/vue3';
|
|
14
7
|
|
|
15
8
|
type Args = InstanceType<typeof TideSwitch>['$props'] & {
|
|
16
|
-
|
|
9
|
+
vModel: true;
|
|
17
10
|
};
|
|
18
11
|
|
|
19
12
|
const render = (args: Args, context: StoryContext) => ({
|
|
20
13
|
components: { TideSwitch },
|
|
21
14
|
methods: {
|
|
22
15
|
doSomething,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
handleIsActiveChange: (value: boolean) => {
|
|
17
|
+
context.updateArgs({ ...args, vModel: value });
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
setup: () => {
|
|
21
|
+
const isActive = ref(args.vModel);
|
|
26
22
|
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
watch(isActive, () => {
|
|
24
|
+
args.vModel = isActive.value;
|
|
25
|
+
});
|
|
29
26
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
alert('Please specify a valid handler in the "change" control.');
|
|
27
|
+
watch(
|
|
28
|
+
() => args.vModel,
|
|
29
|
+
(newValue) => {
|
|
30
|
+
isActive.value = newValue;
|
|
35
31
|
}
|
|
36
|
-
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
return {
|
|
35
|
+
args,
|
|
36
|
+
isActive,
|
|
37
|
+
};
|
|
37
38
|
},
|
|
38
|
-
|
|
39
|
-
template: `<TideSwitch @change="handleChange" v-bind="args" />`,
|
|
39
|
+
template: `<TideSwitch v-bind="args" v-model="isActive" @update:modelValue="handleIsActiveChange" />`,
|
|
40
40
|
});
|
|
41
41
|
|
|
42
42
|
export default {
|
|
43
43
|
argTypes: {
|
|
44
|
-
change: disabledArgType,
|
|
45
44
|
dataTrack,
|
|
46
45
|
disabled: {
|
|
47
46
|
...argTypeBooleanUnrequired,
|
|
48
47
|
description: 'Determines clickability',
|
|
49
48
|
},
|
|
50
|
-
handleChange: {
|
|
51
|
-
...change,
|
|
52
|
-
table: {
|
|
53
|
-
category: 'Events',
|
|
54
|
-
defaultValue: { summary: 'None' },
|
|
55
|
-
type: { summary: '() => void' },
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
49
|
isActive: {
|
|
59
50
|
...argTypeBooleanUnrequired,
|
|
60
51
|
description: 'Determines whether toggle is active',
|
|
61
52
|
},
|
|
53
|
+
vModel: {
|
|
54
|
+
control: 'boolean',
|
|
55
|
+
description: 'Data binding to Vue ref',
|
|
56
|
+
table: {
|
|
57
|
+
category: 'Native',
|
|
58
|
+
defaultValue: { summary: 'None' },
|
|
59
|
+
type: { summary: 'Ref<boolean>' },
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
62
|
},
|
|
63
63
|
args: {
|
|
64
64
|
dataTrack: '',
|
|
65
65
|
disabled: undefined,
|
|
66
|
-
|
|
67
|
-
isActive: undefined,
|
|
66
|
+
vModel: false,
|
|
68
67
|
},
|
|
69
68
|
component: TideSwitch,
|
|
70
69
|
parameters,
|