@carbon/vue 3.0.10 → 3.0.11

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 (29) hide show
  1. package/README.md +1 -1
  2. package/dist/carbon-vue-3.common.js +162 -120
  3. package/dist/carbon-vue-3.common.js.map +1 -1
  4. package/dist/carbon-vue-3.umd.js +162 -120
  5. package/dist/carbon-vue-3.umd.js.map +1 -1
  6. package/dist/carbon-vue-3.umd.min.js +2 -2
  7. package/dist/carbon-vue-3.umd.min.js.map +1 -1
  8. package/package.json +3 -3
  9. package/src/components/CvComboBox/CvComboBox.vue +1 -1
  10. package/src/components/CvDataTable/CvDataTable.vue +1 -1
  11. package/src/components/CvDropdown/CvDropdown.stories.mdx +7 -66
  12. package/src/components/CvDropdown/CvDropdown.vue +7 -18
  13. package/src/components/CvDropdown/CvDropdownItem.vue +1 -1
  14. package/src/components/CvFileUploader/CvFileUploader.stories.mdx +79 -14
  15. package/src/components/CvFileUploader/CvFileUploaderItem.vue +8 -7
  16. package/src/components/CvLink/CvLink.vue +6 -1
  17. package/src/components/CvLoading/CvLoading.vue +1 -1
  18. package/src/components/CvMultiSelect/CvMultiSelect.stories.mdx +8 -18
  19. package/src/components/CvMultiSelect/CvMultiSelect.vue +13 -18
  20. package/src/components/CvProgress/CvProgress.stories.mdx +23 -1
  21. package/src/components/CvProgress/CvProgressSkeleton.vue +37 -0
  22. package/src/components/CvProgress/CvProgressStep.vue +1 -1
  23. package/src/components/CvProgress/index.js +3 -1
  24. package/src/components/CvSearch/CvSearch.stories.mdx +4 -13
  25. package/src/components/CvSearch/CvSearch.vue +7 -19
  26. package/src/components/CvTabs/CvTabs.vue +1 -1
  27. package/src/components/CvTabs/__tests__/__snapshots__/CvTabs.spec.js.snap +3 -3
  28. package/src/components/CvTooltip/CvInteractiveTooltip.vue +1 -1
  29. package/dist/web-types.json +0 -5477
@@ -1,5 +1,5 @@
1
1
  import { Canvas, Meta, Story } from '@storybook/addon-docs';
2
- import { CvProgress, CvProgressStep } from '.';
2
+ import { CvProgress, CvProgressStep, CvProgressSkeleton } from '.';
3
3
  import { Time20 as TimeIcon } from '@carbon/icons-vue';
4
4
  // noinspection ES6PreferShortImport
5
5
  import { sbCompPrefix } from '../../global/storybook-utils';
@@ -13,6 +13,7 @@ export const Template = args => ({
13
13
  CvProgress,
14
14
  CvProgressStep,
15
15
  TimeIcon,
16
+ CvProgressSkeleton
16
17
  },
17
18
  // The story's `args` need to be mapped into the template through the `setup()` method
18
19
  setup() {
@@ -106,6 +107,7 @@ const slotTemplate = `
106
107
  </cv-progress-step>
107
108
  </cv-progress>
108
109
  `;
110
+ const skeletonTemplate = `<cv-progress-skeleton :vertical="vertical" />`;
109
111
 
110
112
  # CvProgress
111
113
 
@@ -200,3 +202,23 @@ Use `cv-progress-step` for more control over the display.
200
202
  {Template.bind({})}
201
203
  </Story>
202
204
  </Canvas>
205
+
206
+ # Skeleton
207
+
208
+ <Canvas>
209
+ <Story
210
+ name="skeleton"
211
+ parameters={{
212
+ controls: {
213
+ include: ['vertical']
214
+ },
215
+ docs: { source: { code: skeletonTemplate } },
216
+ }}
217
+ args={{
218
+ template: skeletonTemplate,
219
+ vertical: false,
220
+ }}
221
+ >
222
+ {Template.bind({})}
223
+ </Story>
224
+ </Canvas>
@@ -0,0 +1,37 @@
1
+ <template>
2
+ <ul
3
+ :class="[
4
+ `${carbonPrefix}--progress`,
5
+ `${carbonPrefix}--skeleton`,
6
+ { [`${carbonPrefix}--progress--vertical`]: vertical },
7
+ ]"
8
+ >
9
+ <li
10
+ v-for="n in 4"
11
+ :key="n"
12
+ :class="[
13
+ `${carbonPrefix}--progress-step`,
14
+ `${carbonPrefix}--progress-step--incomplete`,
15
+ ]"
16
+ >
17
+ <div
18
+ :class="[
19
+ `${carbonPrefix}--progress-step-button`,
20
+ `${carbonPrefix}--progress-step-button--unclickable`,
21
+ ]"
22
+ >
23
+ <CircleDash16 />
24
+ <p :class="[`${carbonPrefix}--progress-label`]" />
25
+ <span :class="[`${carbonPrefix}--progress-line`]" />
26
+ </div>
27
+ </li>
28
+ </ul>
29
+ </template>
30
+ <script setup>
31
+ import { carbonPrefix } from '../../global/settings';
32
+ import { CircleDash16 } from '@carbon/icons-vue';
33
+
34
+ defineProps({
35
+ vertical: { type: Boolean, default: false },
36
+ });
37
+ </script>
@@ -6,7 +6,7 @@
6
6
  `cv-progress-step ${carbonPrefix}--progress-step`,
7
7
  `${carbonPrefix}--progress-step--${internalState}`,
8
8
  ]"
9
- :aria-disabled="disabled"
9
+ :aria-disabled="disabled || null"
10
10
  >
11
11
  <button
12
12
  type="button"
@@ -1,4 +1,6 @@
1
1
  import CvProgress from './CvProgress.vue';
2
2
  import CvProgressStep from './CvProgressStep.vue';
3
3
 
4
- export { CvProgress, CvProgressStep };
4
+ import CvProgressSkeleton from './CvProgressSkeleton.vue';
5
+
6
+ export { CvProgress, CvProgressStep, CvProgressSkeleton };
@@ -25,7 +25,7 @@ export const Template = args => ({
25
25
  clearAriaLabel: args.clearAriaLabel,
26
26
  formItem: args.formItem,
27
27
  expandable: args.expandable,
28
- value: args.value,
28
+ modelValue: args.modelValue,
29
29
  myValue: myValue,
30
30
  onInput: action('input'),
31
31
  };
@@ -40,7 +40,7 @@ const defaultTemplate = `
40
40
  :disabled="disabled"
41
41
  :size="size"
42
42
  :expandable="expandable"
43
- :value="value"
43
+ :modelValue="modelValue"
44
44
  :form-item="formItem"
45
45
  :aria-label="ariaLabel"
46
46
  :clear-aria-label="clearAriaLabel"
@@ -51,7 +51,7 @@ const defaultTemplate = `
51
51
  const vModelTemplate = `
52
52
  <div>
53
53
  <cv-search
54
- v-model:value="myValue"
54
+ v-model="myValue"
55
55
  :light="light"
56
56
  :label="label"
57
57
  :placeholder="placeholder"
@@ -64,7 +64,7 @@ const vModelTemplate = `
64
64
  >
65
65
  </cv-search>
66
66
  <div style="margin-top:1rem; background-color: #888888; padding:1rem">
67
- <div style="padding:1rem">v-model value: {{ myValue }}</div>
67
+ <div style="padding:1rem">v-model: {{ myValue }}</div>
68
68
  <input type="search" v-model="myValue"/>
69
69
  </div>
70
70
  </div>
@@ -74,8 +74,6 @@ const vModelTemplate = `
74
74
 
75
75
  Migration notes:
76
76
 
77
- - The `v-model` is different in Vue 3 than Vue 2. If you specify it you will see an error deprecation message in the log.
78
- Please use `v-model:value=something` instead.
79
77
  - The "toolbar" mode is removed in this version. Please use the `expandable` mode instead.
80
78
 
81
79
  <Canvas>
@@ -85,10 +83,8 @@ Migration notes:
85
83
  controls: {
86
84
  exclude: [
87
85
  'input',
88
- 'modelValue',
89
86
  'template',
90
87
  'update:modelValue',
91
- 'update:value',
92
88
  'large',
93
89
  'small',
94
90
  'toolbarAriaLabel',
@@ -122,9 +118,6 @@ Migration notes:
122
118
 
123
119
  # v-model
124
120
 
125
- - The `v-model` is different in Vue 3 than Vue 2.If you specify it you will see an error deprecation message in the log.
126
- Please use `v-model:value=something` instead.
127
-
128
121
  <Canvas>
129
122
  <Story
130
123
  name="v-model"
@@ -132,10 +125,8 @@ Migration notes:
132
125
  controls: {
133
126
  exclude: [
134
127
  'input',
135
- 'modelValue',
136
128
  'template',
137
129
  'update:modelValue',
138
- 'update:value',
139
130
  'large',
140
131
  'small',
141
132
  'toolbarAriaLabel',
@@ -151,17 +151,9 @@ const props = defineProps({
151
151
  /**
152
152
  * Optionally provide the default value of the `<input>`
153
153
  */
154
- value: { type: String, default: undefined },
155
- /**
156
- * @deprecated use value
157
- */
158
154
  modelValue: {
159
155
  type: String,
160
156
  default: undefined,
161
- validator: () => {
162
- console.warn('Deprecated: use v-model:value instead');
163
- return true;
164
- },
165
157
  },
166
158
  /**
167
159
  * Provide an optional placeholder text for the Search. Note: if the label and placeholder differ, VoiceOver on Mac will read both
@@ -184,14 +176,14 @@ const props = defineProps({
184
176
  const uid = useCvId(props, true);
185
177
  const isLight = useIsLight(props);
186
178
 
187
- const clearVisible = ref(props.value ? props.value.length : false);
188
- const internalSearchText = ref(props.value || props.modelValue);
179
+ const clearVisible = ref(props.modelValue ? props.modelValue.length : false);
180
+ const internalSearchText = ref(props.modelValue);
189
181
  const searchActive = ref(false);
190
182
  watch(
191
- () => props.value,
183
+ () => props.modelValue,
192
184
  () => {
193
- clearVisible.value = props.value ? props.value.length : false;
194
- internalSearchText.value = props.value;
185
+ clearVisible.value = props.modelValue ? props.modelValue.length : false;
186
+ internalSearchText.value = props.modelValue;
195
187
  }
196
188
  );
197
189
 
@@ -204,14 +196,10 @@ const internalAriaLabelBy = computed(() => {
204
196
  else return undefined;
205
197
  });
206
198
 
207
- const emit = defineEmits(['input', 'update:value', 'update:modelValue']);
199
+ const emit = defineEmits(['input', 'update:modelValue']);
208
200
  watch(internalSearchText, () => {
209
201
  emit('input', internalSearchText.value);
210
- emit('update:value', internalSearchText.value);
211
- if (props.modelValue) {
212
- console.warn('Deprecated: use v-model:value instead');
213
- emit('update:modelValue', internalSearchText.value);
214
- }
202
+ emit('update:modelValue', internalSearchText.value);
215
203
  });
216
204
  function onClearClick() {
217
205
  internalSearchText.value = '';
@@ -70,7 +70,7 @@
70
70
  :class="`${carbonPrefix}--tabs--scrollable__nav-link`"
71
71
  role="tab"
72
72
  :aria-controls="tab.uid"
73
- :aria-disabled="disabledTabs.has(tab.uid)"
73
+ :aria-disabled="disabledTabs.has(tab.uid) || null"
74
74
  :aria-selected="selectedId === tab.uid"
75
75
  :tabindex="selectedId === tab.uid ? 0 : -1"
76
76
  type="button"
@@ -7,9 +7,9 @@ exports[`CvTabs CvTabs - test slotted tab buttons to match snapshot 1`] = `
7
7
  </svg></button>
8
8
  <!--v-if-->
9
9
  <ul class="bx--tabs--scrollable__nav" role="tablist">
10
- <li class="cv-tabs-button bx--tabs--scrollable__nav-item bx--tabs__nav-item--selected bx--tabs--scrollable__nav-item--selected" role="presentation"><button id="tab-1-link" class="bx--tabs--scrollable__nav-link" role="tab" aria-controls="tab-1" aria-disabled="false" aria-selected="true" tabindex="0" type="button">Hello <strong style="color: red;">(*)</strong></button></li>
11
- <li class="cv-tabs-button bx--tabs--scrollable__nav-item" role="presentation"><button id="tab-2-link" class="bx--tabs--scrollable__nav-link" role="tab" aria-controls="tab-2" aria-disabled="false" aria-selected="false" tabindex="-1" type="button">Origin<strong style="color: orange;">(!)</strong></button></li>
12
- <li class="cv-tabs-button bx--tabs--scrollable__nav-item" role="presentation"><button id="tab-3-link" class="bx--tabs--scrollable__nav-link" role="tab" aria-controls="tab-3" aria-disabled="false" aria-selected="false" tabindex="-1" type="button">Tab 3 label</button></li>
10
+ <li class="cv-tabs-button bx--tabs--scrollable__nav-item bx--tabs__nav-item--selected bx--tabs--scrollable__nav-item--selected" role="presentation"><button id="tab-1-link" class="bx--tabs--scrollable__nav-link" role="tab" aria-controls="tab-1" aria-selected="true" tabindex="0" type="button">Hello <strong style="color: red;">(*)</strong></button></li>
11
+ <li class="cv-tabs-button bx--tabs--scrollable__nav-item" role="presentation"><button id="tab-2-link" class="bx--tabs--scrollable__nav-link" role="tab" aria-controls="tab-2" aria-selected="false" tabindex="-1" type="button">Origin<strong style="color: orange;">(!)</strong></button></li>
12
+ <li class="cv-tabs-button bx--tabs--scrollable__nav-item" role="presentation"><button id="tab-3-link" class="bx--tabs--scrollable__nav-link" role="tab" aria-controls="tab-3" aria-selected="false" tabindex="-1" type="button">Tab 3 label</button></li>
13
13
  </ul>
14
14
  <!--v-if--><button aria-hidden="true" aria-label="scroll right" class="bx--tab--overflow-nav-button--hidden" tabindex="-1" type="button"><svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="currentColor" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true">
15
15
  <path d="M11 8L6 13 5.3 12.3 9.6 8 5.3 3.7 6 3z"></path>
@@ -24,7 +24,7 @@
24
24
  <div
25
25
  :id="cvId"
26
26
  ref="popup"
27
- :aria-hidden="!dataVisible"
27
+ :aria-hidden="`${!dataVisible}`"
28
28
  :data-floating-menu-direction="direction"
29
29
  :class="[
30
30
  `${carbonPrefix}--tooltip`,