@carbon/vue 3.0.4-alpha.0 → 3.0.6-alpha.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.
Files changed (41) hide show
  1. package/README.md +16 -0
  2. package/dist/carbon-vue-3.common.js +11782 -2709
  3. package/dist/carbon-vue-3.common.js.map +1 -1
  4. package/dist/carbon-vue-3.css +1 -0
  5. package/dist/carbon-vue-3.umd.js +11782 -2709
  6. package/dist/carbon-vue-3.umd.js.map +1 -1
  7. package/dist/carbon-vue-3.umd.min.js +30 -2
  8. package/dist/carbon-vue-3.umd.min.js.map +1 -1
  9. package/package.json +3 -2
  10. package/src/components/CvCheckbox/CvCheckbox.vue +0 -2
  11. package/src/components/CvDatePicker/CvDatePicker-notes.md +86 -0
  12. package/src/components/CvDatePicker/CvDatePicker.stories.js +241 -0
  13. package/src/components/CvDatePicker/CvDatePicker.vue +402 -0
  14. package/src/components/CvDatePicker/CvDatePickerSkeleton.vue +106 -0
  15. package/src/components/CvDatePicker/index.js +4 -0
  16. package/src/components/CvDatePicker/plugins/appendToPlugin.js +64 -0
  17. package/src/components/CvDatePicker/plugins/fixEventsPlugin.js +79 -0
  18. package/src/components/CvDatePicker/plugins/monthSelectPlugin.js +86 -0
  19. package/src/components/CvDatePicker/plugins/rangePlugin.js +47 -0
  20. package/src/components/CvForm/CvForm.stories.mdx +193 -0
  21. package/src/components/CvForm/CvForm.vue +9 -0
  22. package/src/components/CvForm/CvFormGroup.vue +27 -0
  23. package/src/components/CvForm/CvFormItem.vue +9 -0
  24. package/src/components/CvForm/index.js +5 -0
  25. package/src/components/CvModal/CvModal.stories.mdx +234 -0
  26. package/src/components/CvModal/CvModal.vue +403 -0
  27. package/src/components/CvModal/index.js +3 -0
  28. package/src/components/CvTextArea/CvTextArea.stories.js +174 -0
  29. package/src/components/CvTextArea/CvTextArea.vue +107 -0
  30. package/src/components/CvTextArea/index.js +4 -0
  31. package/src/components/CvTextInput/CvTextInput.stories.js +245 -0
  32. package/src/components/CvTextInput/CvTextInput.vue +217 -0
  33. package/src/components/CvTextInput/const.js +2 -0
  34. package/src/components/CvTextInput/index.js +4 -0
  35. package/src/components/CvTile/CvTile.stories.mdx +156 -0
  36. package/src/components/CvTile/CvTile.vue +67 -0
  37. package/src/components/CvTile/CvTileClickable.vue +23 -0
  38. package/src/components/CvTile/CvTileExpandable.vue +103 -0
  39. package/src/components/CvTile/CvTileSelectable.vue +52 -0
  40. package/src/components/CvTile/CvTileStandard.vue +7 -0
  41. package/src/components/CvTile/index.js +4 -0
@@ -0,0 +1,86 @@
1
+ /*
2
+ * COPIED FROM carbon-components-react
3
+ */
4
+
5
+ /**
6
+ * @param {number} monthNumber The month number.
7
+ * @param {boolean} shorthand `true` to use shorthand month.
8
+ * @param {Locale} locale The Flatpickr locale data.
9
+ * @returns {string} The month string.
10
+ */
11
+ const monthToStr = (monthNumber, shorthand, locale) =>
12
+ locale.months[shorthand ? 'shorthand' : 'longhand'][monthNumber];
13
+
14
+ /**
15
+ * @param {object} config Plugin configuration.
16
+ * @param {boolean} [config.shorthand] `true` to use shorthand month.
17
+ * @param {string} config.selectorFlatpickrMonthYearContainer The CSS selector for the container of month/year selection UI.
18
+ * @param {string} config.selectorFlatpickrYearContainer The CSS selector for the container of year selection UI.
19
+ * @param {string} config.selectorFlatpickrCurrentMonth The CSS selector for the text-based month selection UI.
20
+ * @param {string} config.classFlatpickrCurrentMonth The CSS class for the text-based month selection UI.
21
+ * @returns {Plugin} A Flatpickr plugin to use text instead of `<select>` for month picker.
22
+ */
23
+ export default config => fp => {
24
+ const setupElements = () => {
25
+ if (!fp.monthElements || fp.monthElements.length < 1) {
26
+ return;
27
+ }
28
+ fp.monthElements.forEach(elem => {
29
+ if (!elem.parentNode) return;
30
+ elem.parentNode.removeChild(elem);
31
+ });
32
+ fp.monthElements.splice(
33
+ 0,
34
+ fp.monthElements.length,
35
+ ...fp.monthElements.map(() => {
36
+ // eslint-disable-next-line no-underscore-dangle
37
+ const monthElement = fp._createElement(
38
+ 'span',
39
+ config.classFlatpickrCurrentMonth
40
+ );
41
+ monthElement.textContent = monthToStr(
42
+ fp.currentMonth,
43
+ config.shorthand === true,
44
+ fp.l10n
45
+ );
46
+ fp.yearElements[0]
47
+ .closest(config.selectorFlatpickrMonthYearContainer)
48
+ .insertBefore(
49
+ monthElement,
50
+ fp.yearElements[0].closest(config.selectorFlatpickrYearContainer)
51
+ );
52
+ return monthElement;
53
+ })
54
+ );
55
+ };
56
+
57
+ const updateCurrentMonth = () => {
58
+ const monthStr = monthToStr(
59
+ fp.currentMonth,
60
+ config.shorthand === true,
61
+ fp.l10n
62
+ );
63
+ fp.yearElements.forEach(elem => {
64
+ const currentMonthContainer = elem.closest(
65
+ config.selectorFlatpickrMonthYearContainer
66
+ );
67
+ Array.prototype.forEach.call(
68
+ currentMonthContainer.querySelectorAll('.cur-month'),
69
+ monthElement => {
70
+ monthElement.textContent = monthStr;
71
+ }
72
+ );
73
+ });
74
+ };
75
+
76
+ const register = () => {
77
+ fp.loadedPlugins.push('carbonFlatpickrMonthSelectPlugin');
78
+ };
79
+
80
+ return {
81
+ onMonthChange: updateCurrentMonth,
82
+ onValueUpdate: updateCurrentMonth,
83
+ onOpen: updateCurrentMonth,
84
+ onReady: [setupElements, updateCurrentMonth, register],
85
+ };
86
+ };
@@ -0,0 +1,47 @@
1
+ import rangePlugin from 'flatpickr/dist/plugins/rangePlugin';
2
+
3
+ /*
4
+ * COPIED FROM carbon-components-react
5
+ */
6
+
7
+ /**
8
+ * @param {object} config Plugin configuration.
9
+ * @returns {Plugin} An extension of Flatpickr `rangePlugin` that does the following:
10
+ * * Better ensures the calendar dropdown is always aligned to the `<input>` for the starting date.
11
+ * Workaround for: https://github.com/flatpickr/flatpickr/issues/1944
12
+ * * A logic to ensure `fp.setDate()` call won't end up with "startDate to endDate" set to the first `<input>`
13
+ */
14
+ export default config => {
15
+ const factory = rangePlugin(Object.assign({ position: 'left' }, config));
16
+
17
+ return fp => {
18
+ const origSetDate = fp.setDate;
19
+
20
+ const init = () => {
21
+ fp.setDate = function setDate(dates, triggerChange, format) {
22
+ origSetDate.call(this, dates, triggerChange, format);
23
+ // If `triggerChange` is `true`, `onValueUpdate` Flatpickr event is fired
24
+ // where Flatpickr's range plugin takes care of fixing the first `<input>`
25
+ if (!triggerChange) {
26
+ const { _input: inputFrom } = fp;
27
+ const { input: inputTo } = config;
28
+ [inputFrom, inputTo].forEach((input, i) => {
29
+ if (input) {
30
+ input.value = !dates[i]
31
+ ? ''
32
+ : fp.formatDate(new Date(dates[i]), fp.config.dateFormat);
33
+ }
34
+ });
35
+ }
36
+ };
37
+ };
38
+
39
+ const origRangePlugin = factory(fp);
40
+ const { onReady: origOnReady } = origRangePlugin;
41
+
42
+ return Object.assign(origRangePlugin, {
43
+ onReady: [init, origOnReady],
44
+ onPreCalendarPosition() {},
45
+ });
46
+ };
47
+ };
@@ -0,0 +1,193 @@
1
+ import { Canvas, Meta, Story } from '@storybook/addon-docs';
2
+ import { action } from '@storybook/addon-actions';
3
+ import { sbCompPrefix } from '../../global/storybook-utils';
4
+ import CvButton from '../CvButton';
5
+ import CvTextInput from '../CvTextInput';
6
+ import CvTextArea from '../CvTextArea';
7
+ import { CvForm, CvFormGroup, CvFormItem } from '.';
8
+
9
+ <Meta title={`${sbCompPrefix}/CvForm`} component={CvForm} />
10
+
11
+ export const Template = args => ({
12
+ components: {
13
+ CvForm,
14
+ CvFormGroup,
15
+ CvFormItem,
16
+ CvButton,
17
+ CvTextInput,
18
+ CvTextArea,
19
+ },
20
+ setup: () => {
21
+ const doSubmit = action('cv-form -submit event');
22
+ return {
23
+ args: { ...args, template: undefined },
24
+ onSubmit(ev) {
25
+ console.dir([].slice.call(ev.target, [0, ev.target.length]));
26
+ doSubmit(ev);
27
+ },
28
+ }
29
+ },
30
+ template: args.template,
31
+ });
32
+
33
+ export const defaultTemplate = `
34
+ <cv-form @submit.prevent="onSubmit">
35
+ <cv-text-input
36
+ label="Text input label"
37
+ placeholder="Optional placeholder text"
38
+ helperText="Optional helper text here; if message is more than one line text should wrap (~100 character count maximum)"
39
+ />
40
+ <cv-text-area
41
+ label="Text area label"
42
+ placeholder="Optional placeholder text"
43
+ helperText="Optional helper text here; if message is more than one line text should wrap (~100 character count maximum)"
44
+ />
45
+ <cv-button>Submit</cv-button>
46
+ </cv-form>
47
+ `;
48
+
49
+ export const formGroupTemplate = `
50
+ <cv-form-group v-bind="args">
51
+ <template #label>
52
+ FormGroup label-legend
53
+ </template>
54
+ <template #content>
55
+ <cv-text-input label="First name" />
56
+ <cv-text-input label="Last name" />
57
+ </template>
58
+ </cv-form-group>
59
+ `;
60
+
61
+ export const formItemTemplate = `
62
+ <cv-form-item>
63
+ <label for="text-input-3" class="bx--label">Text Input label</label>
64
+ <input id="text-input-3" type="text" class="bx--text-input" placeholder="Optional placeholder text" />
65
+ </cv-form-item>
66
+ `;
67
+
68
+ # CvForm
69
+
70
+ These components are purely wrapper elements for use in creating forms.
71
+
72
+ ## Usage CvForm
73
+
74
+ CvForm has no properties and a single default slot
75
+
76
+ <Canvas>
77
+ <Story
78
+ name="Default"
79
+ parameters={{
80
+ controls: {
81
+ exclude: ['template']
82
+ },
83
+ docs: { source: { code: defaultTemplate } },
84
+ }}
85
+ args={{
86
+ template: defaultTemplate,
87
+ }}
88
+ argTypes={{
89
+ default: {
90
+ control: 'none',
91
+ table: {
92
+ type: { summary: 'text | html | Component' },
93
+ category: 'slots',
94
+ }
95
+ },
96
+ }}
97
+ >
98
+ {Template.bind({})}
99
+ </Story>
100
+ </Canvas>
101
+
102
+
103
+ ## CvFormGroup
104
+
105
+ Used inside a form to group components such as checkboxes and radio buttons.
106
+
107
+ <Canvas>
108
+ <Story
109
+ name="FormGroup-Default"
110
+ parameters={{
111
+ controls: {
112
+ exclude: ['template', 'default']
113
+ },
114
+ docs: { source: { code: formGroupTemplate.replace('v-bind="args"', '') } },
115
+ }}
116
+ args={{
117
+ template: formGroupTemplate,
118
+ }}
119
+ argTypes={{
120
+ content: {
121
+ control: 'none',
122
+ table: {
123
+ type: { summary: 'text | html | Component' },
124
+ category: 'slots',
125
+ },
126
+ },
127
+ label: {
128
+ control: 'none',
129
+ table: {
130
+ type: { summary: 'text | html | Component' },
131
+ category: 'slots',
132
+ },
133
+ description: 'Legend element content',
134
+ },
135
+ invalid: {
136
+ type: 'boolean',
137
+ table: {
138
+ type: { summary: 'boolean' },
139
+ category: 'props',
140
+ },
141
+ description: 'Specify whether the `FormGroup` is invalid',
142
+ },
143
+ message: {
144
+ type: 'string',
145
+ table: {
146
+ type: { summary: 'string' },
147
+ category: 'props',
148
+ },
149
+ description: 'Specify a message to be placed at the end of the `FormGroup`',
150
+ },
151
+ noMargin: {
152
+ type: 'boolean',
153
+ table: {
154
+ type: { summary: 'boolean' },
155
+ category: 'props',
156
+ },
157
+ description: 'Remove default margins set on `FormGroup`',
158
+ },
159
+ }}
160
+ >
161
+ {Template.bind({})}
162
+ </Story>
163
+ </Canvas>
164
+
165
+ ## CvFormItem
166
+
167
+ Used inside a form to provide positional styling.
168
+
169
+ <Canvas>
170
+ <Story
171
+ name="FormItem-Default"
172
+ parameters={{
173
+ controls: {
174
+ exclude: ['template']
175
+ },
176
+ docs: { source: { code: formItemTemplate } },
177
+ }}
178
+ args={{
179
+ template: formItemTemplate,
180
+ }}
181
+ argTypes={{
182
+ default: {
183
+ control: 'none',
184
+ table: {
185
+ type: { summary: 'text | html | Component' },
186
+ category: 'slots',
187
+ }
188
+ },
189
+ }}
190
+ >
191
+ {Template.bind({})}
192
+ </Story>
193
+ </Canvas>
@@ -0,0 +1,9 @@
1
+ <template>
2
+ <form :class="`cv-form ${carbonPrefix}--form`">
3
+ <slot></slot>
4
+ </form>
5
+ </template>
6
+
7
+ <script setup>
8
+ import { carbonPrefix } from '../../global/settings';
9
+ </script>
@@ -0,0 +1,27 @@
1
+ <template>
2
+ <fieldset
3
+ :class="[
4
+ `cv-form-group ${carbonPrefix}--fieldset`,
5
+ { [`${carbonPrefix}--fieldset--no-margin`]: noMargin },
6
+ ]"
7
+ :data-invalid="invalid"
8
+ >
9
+ <legend :class="`${carbonPrefix}--label`">
10
+ <slot name="label"></slot>
11
+ </legend>
12
+ <slot name="content"></slot>
13
+ <div v-if="message" :class="`${carbonPrefix}--form__requirements`">
14
+ {{ message }}
15
+ </div>
16
+ </fieldset>
17
+ </template>
18
+
19
+ <script setup>
20
+ import { carbonPrefix } from '../../global/settings';
21
+
22
+ const props = defineProps({
23
+ invalid: Boolean,
24
+ message: String,
25
+ noMargin: Boolean,
26
+ });
27
+ </script>
@@ -0,0 +1,9 @@
1
+ <template>
2
+ <div :class="`cv-form-item ${carbonPrefix}--form-item`">
3
+ <slot></slot>
4
+ </div>
5
+ </template>
6
+
7
+ <script setup>
8
+ import { carbonPrefix } from '../../global/settings';
9
+ </script>
@@ -0,0 +1,5 @@
1
+ import CvForm from './CvForm';
2
+ import CvFormGroup from './CvFormGroup';
3
+ import CvFormItem from './CvFormItem';
4
+
5
+ export { CvForm, CvFormGroup, CvFormItem };
@@ -0,0 +1,234 @@
1
+ import { Canvas, Meta, Story } from '@storybook/addon-docs';
2
+ import { sbCompPrefix } from '../../global/storybook-utils';
3
+ import CvModal from './CvModal.vue';
4
+ import { action } from '@storybook/addon-actions';
5
+ import { nextTick, ref } from 'vue';
6
+ const visible = ref(false);
7
+ const visible3btn = ref(false);
8
+
9
+ <Meta title={`${sbCompPrefix}/CvModal`} component={CvModal} />
10
+
11
+ export const Template = args => ({
12
+ // Components used in your story `template` are defined in the `components` object
13
+ components: {
14
+ CvModal,
15
+ },
16
+ // The story's `args` need to be mapped into the template through the `setup()` method
17
+ setup() {
18
+ return {
19
+ ...args,
20
+ props: args.props,
21
+ onModalHidden: action('modal-hidden'),
22
+ onModalHideRequest: action('modal-hide-request'),
23
+ onModalShown: action('modal-shown'),
24
+ onOtherBtnClick: action('other-btn-click'),
25
+ onPrimaryClick: action('primary-click'),
26
+ onSecondaryClick: action('secondary-click'),
27
+ visible,
28
+ visible3btn,
29
+ kind: args.kind,
30
+ size: args.size,
31
+ autoHideOff: args.autoHideOff,
32
+ primaryButtonDisabled: args.primaryButtonDisabled,
33
+ disableTeleport: args.disableTeleport,
34
+ show: () => {
35
+ if (visible.value) visible.value = false;
36
+ nextTick(() => {
37
+ visible.value = true;
38
+ }).catch(() => console.warn('cannot show'));
39
+ },
40
+ show3btn: () => {
41
+ if (visible3btn.value) visible3btn.value = false;
42
+ nextTick(() => {
43
+ visible3btn.value = true;
44
+ }).catch(() => console.warn('cannot show'));
45
+ },
46
+ onAfterModalHidden() {
47
+ action('after-modal-hidden')();
48
+ visible.value = false;
49
+ visible3btn.value = false;
50
+ },
51
+ };
52
+ },
53
+ // And then the `args` are bound to your component with `v-bind="args"`
54
+ template: args.template,
55
+ });
56
+ const defaultTemplate = `
57
+ <div>
58
+ <cv-modal v-bind="props"
59
+ :visible="visible"
60
+ :kind="kind"
61
+ :size="size"
62
+ :autoHideOff="autoHideOff"
63
+ :primaryButtonDisabled="primaryButtonDisabled"
64
+ :disableTeleport="disableTeleport"
65
+ @after-modal-hidden="onAfterModalHidden"
66
+ @modal-hidden="onModalHidden"
67
+ @modal-hide-request="onModalHideRequest"
68
+ @modal-shown="onModalShown"
69
+ @other-btn-click="onOtherBtnClick"
70
+ @primary-click="onPrimaryClick"
71
+ @secondary-click="onSecondaryClick">
72
+ <template v-slot:label>Label of modal</template>
73
+ <template v-slot:title>Title of modal</template>
74
+ <template v-slot:content><p>Space: the final frontier. These are the voyages of the starship Enterprise. Its five-year mission: to explore strange new worlds; to seek out new life and new civilizations; to boldly go where no one has gone before!</p></template>
75
+ </cv-modal>
76
+ <!-- The show function sets the visible property to true -->
77
+ <button @click="show">show</button>
78
+ </div>
79
+ `;
80
+ const buttonTemplate = `
81
+ <div>
82
+ <cv-modal v-bind="props"
83
+ :visible="visible3btn"
84
+ :kind="kind"
85
+ :size="size"
86
+ :autoHideOff="autoHideOff"
87
+ :primaryButtonDisabled="primaryButtonDisabled"
88
+ :disableTeleport="disableTeleport"
89
+ @after-modal-hidden="onAfterModalHidden"
90
+ @modal-hidden="onModalHidden"
91
+ @modal-hide-request="onModalHideRequest"
92
+ @modal-shown="onModalShown"
93
+ @other-btn-click="onOtherBtnClick"
94
+ @primary-click="onPrimaryClick"
95
+ @secondary-click="onSecondaryClick">
96
+ <template v-slot:label>Label of modal</template>
97
+ <template v-slot:title>Title of modal</template>
98
+ <template v-slot:content>
99
+ <p>The term 'shields' first appears in the Star Trek episode "Balance of Terror", in which they were deployed, albeit to little effect, by a Federation outpost under attack from a Romulan Warbird. The first depicted use by a starship was in the Star Trek episode "Arena", in which the USS Enterprise raises its 'screens' after being attacked by an alien warship although the term 'shields' is not used in this episode. Shields are not mentioned during the earlier seasons of the Star Trek: Enterprise series, starships instead using "polarized hull plating" to make their hull more resistant to damage.</p>
100
+ <br />
101
+ <p>Like most technologies in the Star Trek fictional universe, the exact operation of shield technology is never precisely described. Characters discuss its existence and manipulation, while only superficially describing its exact physics, which result in a field being projected around a ship or other body, deflecting or dispersing projectiles and energy weapons. Shields are not shown unless struck, and are then often shown briefly for dramatic effect as a translucent bubble of energy.</p>
102
+ <br />
103
+ <p>Shields are said to be made of a screen of gravitons that can deflect beam and projectile weaponry.</p>
104
+ <br />
105
+ <p>https://en.wikipedia.org/wiki/Shields_(Star_Trek)</p>
106
+ </template>
107
+ <template v-slot:other-button>other</template>
108
+ <template v-slot:secondary-button>secondary</template>
109
+ <template v-slot:primary-button>primary</template>
110
+ </cv-modal>
111
+ <!-- The show function sets the visible property to true -->
112
+ <button @click="show3btn">show</button>
113
+ </div>
114
+ `;
115
+
116
+ # CvModal
117
+
118
+ Migration notes:
119
+
120
+ - The modal uses the Vue [teleport](https://vuejs.org/guide/built-ins/teleport.html#basic-usage) to move the modal to the document body. This resolves some scrolling issues seen in the Vue 2 implementation.
121
+ Set `disableTeleport` to true to revert to the Vue 2 behaviour.
122
+ - The `v-model` is different in Vue 3 than Vue 2. You can still specify the `v-model=something` to control the visibility but
123
+ if you specify it like this you will see a deprecation message in the log. Please use `v-model:visible=something` instead.
124
+ - For the `size` attribute please use of the standard sizes 'xs', 'sm', 'md', or 'lg'. The 'large' and 'small' values still
125
+ work but avoid using them.
126
+ - The `arial-label` was derived from the title slot but in this version it is an additional property with a default of 'Information modal'
127
+ - The `show` and `hide` methods can no longer be called directly. Use the `visible` property to control visability.
128
+ - The `modal-hide-request` no longer emits a `PointerEvent` instead just the reason is emitted. i.e. `{cv:reason: "external-click"}`
129
+
130
+ <Canvas>
131
+ <Story
132
+ name="Default"
133
+ parameters={{
134
+ controls: {
135
+ exclude: [
136
+ 'props',
137
+ 'default',
138
+ 'template',
139
+ 'content',
140
+ 'label',
141
+ 'other-button',
142
+ 'primary-button',
143
+ 'secondary-button',
144
+ 'title',
145
+ 'after-modal-hidden',
146
+ 'modal-hidden',
147
+ 'modal-hide-request',
148
+ 'modal-shown',
149
+ 'other-btn-click',
150
+ 'primary-click',
151
+ 'secondary-click',
152
+ 'update:modelValue',
153
+ 'update:visible',
154
+ 'modelValue',
155
+ 'visible',
156
+ 'onOtherBtnClick',
157
+ 'onPrimaryClick',
158
+ 'onSecondaryClick',
159
+ ],
160
+ },
161
+ docs: { source: { code: defaultTemplate } },
162
+ }}
163
+ args={{
164
+ template: defaultTemplate,
165
+ props: {
166
+ modelValue: undefined,
167
+ },
168
+ }}
169
+ argTypes={{
170
+ kind: { control: 'select', default: '', options: ['', 'danger'] },
171
+ size: {
172
+ control: 'select',
173
+ default: 'md',
174
+ options: ['xs', 'sm', 'md', 'lg'],
175
+ },
176
+ }}
177
+ >
178
+ {Template.bind({})}
179
+ </Story>
180
+ </Canvas>
181
+
182
+ # CvModal with three buttons
183
+
184
+ <Canvas>
185
+ <Story
186
+ name="Three buttons"
187
+ parameters={{
188
+ controls: {
189
+ exclude: [
190
+ 'props',
191
+ 'default',
192
+ 'template',
193
+ 'content',
194
+ 'label',
195
+ 'other-button',
196
+ 'primary-button',
197
+ 'secondary-button',
198
+ 'title',
199
+ 'after-modal-hidden',
200
+ 'modal-hidden',
201
+ 'modal-hide-request',
202
+ 'modal-shown',
203
+ 'other-btn-click',
204
+ 'primary-click',
205
+ 'secondary-click',
206
+ 'update:modelValue',
207
+ 'update:visible',
208
+ 'modelValue',
209
+ 'visible',
210
+ 'onOtherBtnClick',
211
+ 'onPrimaryClick',
212
+ 'onSecondaryClick',
213
+ ],
214
+ },
215
+ docs: { source: { code: buttonTemplate } },
216
+ }}
217
+ args={{
218
+ template: buttonTemplate,
219
+ props: {
220
+ modelValue: undefined,
221
+ },
222
+ }}
223
+ argTypes={{
224
+ kind: { control: 'select', default: '', options: ['', 'danger'] },
225
+ size: {
226
+ control: 'select',
227
+ default: 'md',
228
+ options: ['xs', 'sm', 'md', 'lg'],
229
+ },
230
+ }}
231
+ >
232
+ {Template.bind({})}
233
+ </Story>
234
+ </Canvas>