@carbon/vue 3.0.9 → 3.0.10

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 (88) hide show
  1. package/dist/carbon-vue-3.common.js +19590 -19300
  2. package/dist/carbon-vue-3.common.js.map +1 -1
  3. package/dist/carbon-vue-3.css +1 -1
  4. package/dist/carbon-vue-3.umd.js +19541 -19251
  5. package/dist/carbon-vue-3.umd.js.map +1 -1
  6. package/dist/carbon-vue-3.umd.min.js +3 -3
  7. package/dist/carbon-vue-3.umd.min.js.map +1 -1
  8. package/dist/web-types.json +5477 -0
  9. package/package.json +10 -42
  10. package/src/components/CvAccordion/CvAccordionItem.vue +1 -1
  11. package/src/components/CvButton/CvButton.stories.js +1 -1
  12. package/src/components/CvButton/CvButton.vue +2 -2
  13. package/src/components/CvButton/CvIconButton.stories.js +14 -17
  14. package/src/components/CvButton/CvIconButton.vue +8 -7
  15. package/src/components/CvCheckbox/CvCheckbox.vue +4 -3
  16. package/src/components/CvCodeSnippet/CvCodeSnippet.vue +5 -5
  17. package/src/components/CvCodeSnippet/_CviCodeSnippetInline.vue +2 -2
  18. package/src/components/CvCodeSnippet/_CviCodeSnippetMultiline.vue +6 -6
  19. package/src/components/CvCodeSnippet/_CviCodeSnippetOneline.vue +3 -3
  20. package/src/components/CvComboBox/CvComboBox.vue +8 -8
  21. package/src/components/CvContentSwitcher/CvContentSwitcher.vue +1 -1
  22. package/src/components/CvContentSwitcher/CvContentSwitcherButton.vue +1 -1
  23. package/src/components/CvCopyButton/CvCopyButton.vue +1 -1
  24. package/src/components/CvCopyButton/_CviCopyButton.vue +2 -2
  25. package/src/components/CvDataTable/CvDataTable.vue +29 -27
  26. package/src/components/CvDataTable/CvDataTableHeading.vue +9 -9
  27. package/src/components/CvDataTable/CvDataTableRow.vue +6 -6
  28. package/src/components/CvDataTable/CvDataTableSkeleton.vue +3 -3
  29. package/src/components/CvDataTable/_CvDataTableRowInner.vue +9 -9
  30. package/src/components/CvDatePicker/CvDatePicker.vue +10 -10
  31. package/src/components/CvDatePicker/CvDatePickerSkeleton.vue +3 -3
  32. package/src/components/CvDropdown/CvDropdown.vue +7 -9
  33. package/src/components/CvDropdown/CvDropdownItem.vue +1 -1
  34. package/src/components/CvFileUploader/CvFileUploader.vue +7 -7
  35. package/src/components/CvFileUploader/CvFileUploaderItem.vue +1 -1
  36. package/src/components/CvForm/CvFormGroup.vue +2 -2
  37. package/src/components/CvGrid/CvColumn.vue +5 -0
  38. package/src/components/CvLink/CvLink.vue +1 -1
  39. package/src/components/CvLoading/CvLoading.stories.js +1 -1
  40. package/src/components/CvLoading/CvLoading.vue +1 -1
  41. package/src/components/CvModal/CvModal.vue +19 -19
  42. package/src/components/CvMultiSelect/CvMultiSelect.vue +4 -4
  43. package/src/components/CvNotification/CvToastNotification.stories.js +12 -15
  44. package/src/components/CvNotification/CvToastNotification.vue +1 -1
  45. package/src/components/CvNumberInput/CvNumberInput.vue +3 -6
  46. package/src/components/CvOverflowMenu/CvOverflowMenu.vue +11 -10
  47. package/src/components/CvOverflowMenu/CvOverflowMenuItem.vue +1 -1
  48. package/src/components/CvPagination/CvPagination.vue +11 -15
  49. package/src/components/CvProgress/CvProgress.vue +1 -1
  50. package/src/components/CvProgress/CvProgressStep.vue +5 -5
  51. package/src/components/CvRadioButton/CvRadioButton.vue +3 -3
  52. package/src/components/CvSearch/CvSearch.vue +11 -10
  53. package/src/components/CvSelect/CvSelect.vue +1 -1
  54. package/src/components/CvSlider/CvSlider.vue +7 -7
  55. package/src/components/CvSlider/__tests__/__snapshots__/CvSlider.spec.js.snap +1 -1
  56. package/src/components/CvStructuredList/CvStructuredListItem.vue +3 -3
  57. package/src/components/CvStructuredList/CvStructuredListItemSelectable.vue +1 -1
  58. package/src/components/CvStructuredList/__tests__/__snapshots__/CvStructuredListItem.spec.js.snap +3 -3
  59. package/src/components/CvSvg/__tests__/_TestIcon.vue +2 -2
  60. package/src/components/CvTabs/CvTab.vue +1 -1
  61. package/src/components/CvTabs/CvTabs.vue +12 -12
  62. package/src/components/CvTabs/__tests__/__snapshots__/CvTabs.spec.js.snap +6 -6
  63. package/src/components/CvTag/CvTag.stories.js +1 -1
  64. package/src/components/CvTag/CvTag.vue +1 -1
  65. package/src/components/CvTextArea/CvTextArea.vue +6 -6
  66. package/src/components/CvTextInput/CvTextInput.stories.js +28 -16
  67. package/src/components/CvTextInput/CvTextInput.vue +37 -7
  68. package/src/components/CvTextInput/CvTextInputSkeleton.vue +17 -0
  69. package/src/components/CvTextInput/index.js +2 -1
  70. package/src/components/CvTile/CvTile.vue +3 -3
  71. package/src/components/CvTile/CvTileExpandable.vue +7 -7
  72. package/src/components/CvTile/CvTileSelectable.vue +2 -2
  73. package/src/components/CvTimePicker/CvTimePicker.vue +1 -1
  74. package/src/components/CvTooltip/CvDefinitionTooltip.vue +2 -2
  75. package/src/components/CvTooltip/CvInteractiveTooltip.vue +6 -6
  76. package/src/components/CvTooltip/__tests__/__snapshots__/CvTooltip.spec.js.snap +14 -14
  77. package/src/components/CvUIShell/CvHeader.vue +1 -1
  78. package/src/components/CvUIShell/CvHeaderGlobalAction.vue +7 -7
  79. package/src/components/CvUIShell/CvHeaderMenu.vue +3 -3
  80. package/src/components/CvUIShell/CvHeaderMenuButton.vue +2 -2
  81. package/src/components/CvUIShell/CvHeaderMenuItem.vue +2 -2
  82. package/src/components/CvUIShell/CvHeaderName.vue +1 -1
  83. package/src/components/CvUIShell/CvHeaderNav.vue +1 -1
  84. package/src/components/CvUIShell/CvHeaderPanel.vue +3 -2
  85. package/src/components/CvUIShell/CvSideNav.vue +5 -4
  86. package/src/components/CvUIShell/CvSideNavItems.vue +1 -1
  87. package/src/components/CvUIShell/CvSideNavLink.vue +1 -1
  88. package/src/components/CvUIShell/_CvSideNavFooter.vue +2 -1
@@ -1,7 +1,7 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`CvSlider should match snapshot 1`] = `
4
- <div class="cv-slider bx--form-item"><label for="abc" class="bx--label" id="abc-label" style="display: none;"></label>
4
+ <div class="cv-slider bx--form-item"><label id="abc-label" for="abc" class="bx--label" style="display: none;"></label>
5
5
  <div class="bx--slider-container"><span class="bx--slider__range-label">0</span>
6
6
  <div class="bx--slider" data-slider="" data-slider-input-box="#slider-input-box">
7
7
  <div class="bx--slider__track"></div>
@@ -4,7 +4,7 @@
4
4
  v-bind="$attrs"
5
5
  class="cv-structured-list-item"
6
6
  :value="value"
7
- :modelValue="modelValue"
7
+ :model-value="modelValue"
8
8
  >
9
9
  <slot></slot>
10
10
  </component>
@@ -30,8 +30,8 @@ defineProps({
30
30
  },
31
31
  });
32
32
 
33
- const selectable = inject('selectable');
34
- const change = inject('change');
33
+ const selectable = inject('selectable', false);
34
+ const change = inject('change', () => {});
35
35
  const emit = defineEmits(['change']);
36
36
 
37
37
  provide('onRadioItemChange', clickedItemCvId => {
@@ -11,8 +11,8 @@
11
11
  <slot></slot>
12
12
  <input
13
13
  v-bind="$attrs"
14
- tabindex="-1"
15
14
  :id="cvId"
15
+ tabindex="-1"
16
16
  :class="`${carbonPrefix}--structured-list-input`"
17
17
  :checked="isChecked"
18
18
  :value="value"
@@ -1,7 +1,7 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`CvStructuredListItem should render correctly when \`value\` is default 1`] = `<cv-structured-list-item-standard-stub id="test-2" class="cv-structured-list-item" modelvalue="test"></cv-structured-list-item-standard-stub>`;
3
+ exports[`CvStructuredListItem should render correctly when \`value\` is default 1`] = `<cv-structured-list-item-standard-stub id="test-2" class="cv-structured-list-item" model-value="test"></cv-structured-list-item-standard-stub>`;
4
4
 
5
- exports[`CvStructuredListItem should render correctly when \`value\` is set 1`] = `<cv-structured-list-item-standard-stub id="test-2" class="cv-structured-list-item" modelvalue="test" value="strictured list item value test"></cv-structured-list-item-standard-stub>`;
5
+ exports[`CvStructuredListItem should render correctly when \`value\` is set 1`] = `<cv-structured-list-item-standard-stub id="test-2" class="cv-structured-list-item" model-value="test" value="strictured list item value test"></cv-structured-list-item-standard-stub>`;
6
6
 
7
- exports[`CvStructuredListItem should render correctly when slot is specified 1`] = `<cv-structured-list-item-standard-stub id="test-2" class="cv-structured-list-item" modelvalue="test"></cv-structured-list-item-standard-stub>`;
7
+ exports[`CvStructuredListItem should render correctly when slot is specified 1`] = `<cv-structured-list-item-standard-stub id="test-2" class="cv-structured-list-item" model-value="test"></cv-structured-list-item-standard-stub>`;
@@ -1,6 +1,6 @@
1
1
  <template>
2
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" id="root">
3
- <g fill-rule="evenodd" id="g">
2
+ <svg id="root" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
3
+ <g id="g" fill-rule="evenodd">
4
4
  <path
5
5
  id="path"
6
6
  d="M7 7H4v2h3v3h2V9h3V7H9V4H7v3zm1 9A8 8 0 1 1 8 0a8 8 0 0 1 0 16z"
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div
3
- :class="`cv-tab ${carbonPrefix}--tab-content`"
4
3
  :id="uid"
4
+ :class="`cv-tab ${carbonPrefix}--tab-content`"
5
5
  role="tabpanel"
6
6
  :aria-labelledby="`${uid}-link`"
7
7
  :aria-hidden="!dataSelected ? 'true' : 'false'"
@@ -16,6 +16,7 @@
16
16
  @keydown.left.prevent.stop="onLeft"
17
17
  >
18
18
  <button
19
+ ref="elLeftOverflow"
19
20
  aria-hidden="true"
20
21
  aria-label="scroll left"
21
22
  :class="[
@@ -25,12 +26,11 @@
25
26
  leftOverflowNavButtonHidden,
26
27
  },
27
28
  ]"
29
+ tabIndex="-1"
30
+ type="button"
28
31
  @click.stop.prevent="e => onOverflowClick(e, { direction: -1 })"
29
32
  @mousedown.stop.prevent="e => onOverflowMouseDown(e, { direction: -1 })"
30
33
  @mouseup.stop.prevent="onOverflowMouseUp"
31
- tabIndex="-1"
32
- type="button"
33
- ref="elLeftOverflow"
34
34
  >
35
35
  <ChevronLeft16 />
36
36
  </button>
@@ -40,9 +40,9 @@
40
40
  />
41
41
 
42
42
  <ul
43
+ ref="elTabList"
43
44
  :class="`${carbonPrefix}--tabs--scrollable__nav`"
44
45
  role="tablist"
45
- ref="elTabList"
46
46
  >
47
47
  <li
48
48
  v-for="tab in tabs"
@@ -65,16 +65,16 @@
65
65
  role="presentation"
66
66
  >
67
67
  <button
68
+ :id="`${tab.uid}-link`"
69
+ ref="elLink"
68
70
  :class="`${carbonPrefix}--tabs--scrollable__nav-link`"
69
71
  role="tab"
70
72
  :aria-controls="tab.uid"
71
73
  :aria-disabled="disabledTabs.has(tab.uid)"
72
74
  :aria-selected="selectedId === tab.uid"
73
- :id="`${tab.uid}-link`"
74
- @click="onTabClick(tab.uid)"
75
- ref="elLink"
76
75
  :tabindex="selectedId === tab.uid ? 0 : -1"
77
76
  type="button"
77
+ @click="onTabClick(tab.uid)"
78
78
  >
79
79
  <slot :name="tab.uid" v-bind="tab">
80
80
  {{ tab.label }}
@@ -88,6 +88,7 @@
88
88
  :class="`${carbonPrefix}--tabs__overflow-indicator--right`"
89
89
  />
90
90
  <button
91
+ ref="elRightOverflow"
91
92
  aria-hidden="true"
92
93
  aria-label="scroll right"
93
94
  :class="[
@@ -97,12 +98,11 @@
97
98
  rightOverflowNavButtonHidden,
98
99
  },
99
100
  ]"
101
+ tabIndex="-1"
102
+ type="button"
100
103
  @click="e => onOverflowClick(e, { direction: 1 })"
101
104
  @mousedown="e => onOverflowMouseDown(e, { direction: 1 })"
102
105
  @mouseup="onOverflowMouseUp"
103
- tabIndex="-1"
104
- type="button"
105
- ref="elRightOverflow"
106
106
  >
107
107
  <ChevronRight16 />
108
108
  </button>
@@ -136,7 +136,7 @@ const props = defineProps({
136
136
  /**
137
137
  * @deprecated not used in component
138
138
  */
139
- leftOverflowIconButtonProps: Object,
139
+ leftOverflowIconButtonProps: { type: Object, default: undefined },
140
140
  /**
141
141
  * This is an edge use case. By default, if no tab is explicitly selected, the first non-disabled tab is selected.
142
142
  */
@@ -144,7 +144,7 @@ const props = defineProps({
144
144
  /**
145
145
  * @deprecated not used in component
146
146
  */
147
- rightOverflowIconButtonProps: Object,
147
+ rightOverflowIconButtonProps: { type: Object, default: undefined },
148
148
  /**
149
149
  * @deprecated not used in component
150
150
  */
@@ -7,18 +7,18 @@ 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 class="bx--tabs--scrollable__nav-link" role="tab" aria-controls="tab-1" aria-disabled="false" aria-selected="true" id="tab-1-link" 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 class="bx--tabs--scrollable__nav-link" role="tab" aria-controls="tab-2" aria-disabled="false" aria-selected="false" id="tab-2-link" 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 class="bx--tabs--scrollable__nav-link" role="tab" aria-controls="tab-3" aria-disabled="false" aria-selected="false" id="tab-3-link" 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-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>
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>
16
16
  </svg></button>
17
17
  </div>
18
18
  <div class="cv-tabs__panels">
19
- <div class="cv-tab bx--tab-content" id="tab-1" role="tabpanel" aria-labelledby="tab-1-link" aria-hidden="false">Tab 1 content</div>
20
- <div class="cv-tab bx--tab-content" id="tab-2" role="tabpanel" aria-labelledby="tab-2-link" aria-hidden="true" hidden="">Tab 2 content</div>
21
- <div class="cv-tab bx--tab-content" id="tab-3" role="tabpanel" aria-labelledby="tab-3-link" aria-hidden="true" hidden="">Tab 3 content</div>
19
+ <div id="tab-1" class="cv-tab bx--tab-content" role="tabpanel" aria-labelledby="tab-1-link" aria-hidden="false">Tab 1 content</div>
20
+ <div id="tab-2" class="cv-tab bx--tab-content" role="tabpanel" aria-labelledby="tab-2-link" aria-hidden="true" hidden="">Tab 2 content</div>
21
+ <div id="tab-3" class="cv-tab bx--tab-content" role="tabpanel" aria-labelledby="tab-3-link" aria-hidden="true" hidden="">Tab 3 content</div>
22
22
  </div>
23
23
  </div>
24
24
  `;
@@ -10,7 +10,7 @@ export default {
10
10
  title: `${sbCompPrefix}/CvTag`,
11
11
  component: CvTag,
12
12
  argTypes: {
13
- kind: { control: { type: 'select', options: tagKinds } },
13
+ kind: { control: 'select', options: tagKinds },
14
14
  },
15
15
  };
16
16
 
@@ -8,8 +8,8 @@
8
8
  v-if="filter"
9
9
  :class="`${carbonPrefix}--tag__close-icon`"
10
10
  :aria-label="clearAriaLabel"
11
- @click.stop.prevent="onRemove"
12
11
  :disabled="disabled"
12
+ @click.stop.prevent="onRemove"
13
13
  >
14
14
  <Close16 />
15
15
  </button>
@@ -14,16 +14,16 @@
14
14
  </label>
15
15
  <div
16
16
  :class="`${carbonPrefix}--text-area__wrapper`"
17
- :data-invalid="isInvalid"
17
+ :data-invalid="isInvalid || null"
18
18
  >
19
19
  <WarningFilled16
20
20
  v-if="isInvalid"
21
21
  :class="`${carbonPrefix}--text-area__invalid-icon`"
22
22
  />
23
23
  <textarea
24
- :aria-invalid="isInvalid"
25
- :aria-describedby="isInvalid ? errorId : undefined"
26
24
  :id="cvId"
25
+ :aria-invalid="isInvalid || null"
26
+ :aria-describedby="isInvalid ? errorId : undefined"
27
27
  :class="[
28
28
  `${carbonPrefix}--text-area`,
29
29
  {
@@ -66,12 +66,12 @@ const props = defineProps({
66
66
  helperText: { type: String, default: undefined },
67
67
  hideLabel: { type: Boolean, default: false },
68
68
  invalidMessage: { type: String, default: undefined },
69
- label: String,
70
- modelValue: String,
69
+ label: { type: String, default: undefined },
70
+ modelValue: { type: String, default: undefined },
71
71
  ...propsCvId,
72
72
  ...propsTheme,
73
73
  });
74
-
74
+ defineEmits(['update:modelValue']);
75
75
  const cvId = useCvId(props);
76
76
 
77
77
  // DOM
@@ -3,7 +3,7 @@ import {
3
3
  storyParametersObject,
4
4
  } from '../../global/storybook-utils';
5
5
 
6
- import CvTextInput from '.';
6
+ import { CvTextInput, CvTextInputSkeleton } from '.';
7
7
  import { ref } from 'vue';
8
8
 
9
9
  export default {
@@ -34,8 +34,6 @@ export default {
34
34
  type: { summary: 'string' },
35
35
  category: 'props',
36
36
  },
37
- description:
38
- 'Provide text that is used alongside the control label for additional help',
39
37
  },
40
38
  hideLabel: {
41
39
  type: 'boolean',
@@ -44,8 +42,6 @@ export default {
44
42
  category: 'props',
45
43
  defaultValue: false,
46
44
  },
47
- description:
48
- 'Specify whether you want the underlying label to be visually hidden',
49
45
  },
50
46
  invalidMessage: {
51
47
  type: 'string',
@@ -53,8 +49,6 @@ export default {
53
49
  type: { summary: 'string' },
54
50
  category: 'props',
55
51
  },
56
- description:
57
- 'Provide the text that is displayed when the control is in an invalid state',
58
52
  },
59
53
  label: {
60
54
  type: 'string',
@@ -62,7 +56,6 @@ export default {
62
56
  type: { summary: 'string' },
63
57
  category: 'props',
64
58
  },
65
- description: "Input's label",
66
59
  },
67
60
  light: {
68
61
  type: 'boolean',
@@ -80,8 +73,6 @@ export default {
80
73
  type: { summary: 'string' },
81
74
  category: 'props',
82
75
  },
83
- description:
84
- "Input's value, modelValue is the vue3 default 'prop' for two-way data binding with v-model",
85
76
  },
86
77
  passwordHideLabel: {
87
78
  type: 'string',
@@ -89,7 +80,6 @@ export default {
89
80
  type: { summary: 'string' },
90
81
  category: 'props',
91
82
  },
92
- description: '"Hide password" tooltip text on password visibility toggle',
93
83
  },
94
84
  passwordShowLabel: {
95
85
  type: 'string',
@@ -97,7 +87,6 @@ export default {
97
87
  type: { summary: 'string' },
98
88
  category: 'props',
99
89
  },
100
- description: '"Show password" tooltip text on password visibility toggle',
101
90
  },
102
91
  passwordVisible: {
103
92
  type: 'boolean',
@@ -105,7 +94,6 @@ export default {
105
94
  type: { summary: 'boolean' },
106
95
  category: 'props',
107
96
  },
108
- description: 'Toggle password visibility.',
109
97
  },
110
98
  type: {
111
99
  type: 'string',
@@ -118,7 +106,6 @@ export default {
118
106
  control: {
119
107
  type: 'select',
120
108
  },
121
- description: 'Input type, only `text` and `password` are available',
122
109
  },
123
110
  warnText: {
124
111
  type: 'string',
@@ -126,8 +113,6 @@ export default {
126
113
  type: { summary: 'string' },
127
114
  category: 'props',
128
115
  },
129
- description:
130
- 'Provide the text that is displayed when the control is in warning state',
131
116
  },
132
117
  // slots
133
118
  'helper-text': {
@@ -171,11 +156,13 @@ export default {
171
156
  };
172
157
 
173
158
  const template = `
159
+ <form @submit.prevent='()=>{}'>
174
160
  <cv-text-input v-bind="args">
175
161
  <template v-if="args['helper-text']" v-slot:helper-text />
176
162
  <template v-if="args['warn-text']" v-slot:warn-text />
177
163
  <template v-if="args['invalid-message']" v-slot:invalid-message />
178
164
  </cv-text-input>
165
+ </form>
179
166
  `;
180
167
  const Template = args => {
181
168
  return {
@@ -191,6 +178,7 @@ Default.args = {
191
178
  label: 'Text input label',
192
179
  placeholder: 'Sample placeholder',
193
180
  };
181
+
194
182
  Default.parameters = storyParametersObject(
195
183
  Default.parameters,
196
184
  template,
@@ -237,9 +225,33 @@ export const Password = Template.bind({});
237
225
  Password.args = {
238
226
  label: 'Password input label',
239
227
  type: 'password',
228
+ autocomplete: 'password',
240
229
  };
241
230
  Password.parameters = storyParametersObject(
242
231
  Password.parameters,
243
232
  template,
244
233
  Password.args
245
234
  );
235
+
236
+ const templateSkeleton = `<cv-text-input-skeleton v-bind='args'/>`;
237
+ const TemplateSkeleton = args => {
238
+ return {
239
+ components: { CvTextInputSkeleton },
240
+ setup: () => ({ args }),
241
+ template: templateSkeleton,
242
+ };
243
+ };
244
+
245
+ export const Skeleton = TemplateSkeleton.bind({});
246
+
247
+ Skeleton.parameters = {
248
+ controls: {
249
+ include: ['hideLabel'],
250
+ },
251
+ };
252
+
253
+ Skeleton.parameters = storyParametersObject(
254
+ Skeleton.parameters,
255
+ templateSkeleton,
256
+ Skeleton.args
257
+ );
@@ -24,7 +24,7 @@
24
24
  `${carbonPrefix}--text-input__field-wrapper`,
25
25
  { [`${carbonPrefix}--text-input__field-wrapper--warning`]: isWarn },
26
26
  ]"
27
- :data-invalid="isInvalid"
27
+ :data-invalid="isInvalid || null"
28
28
  >
29
29
  <WarningFilled16
30
30
  v-if="isInvalid"
@@ -35,8 +35,8 @@
35
35
  :class="`${carbonPrefix}--text-input__invalid-icon ${carbonPrefix}--text-input__invalid-icon--warning`"
36
36
  />
37
37
  <input
38
- ref="input"
39
38
  :id="cvId"
39
+ ref="input"
40
40
  :class="[
41
41
  `${carbonPrefix}--text-input`,
42
42
  {
@@ -49,7 +49,7 @@
49
49
  v-bind="$attrs"
50
50
  :type="dataType"
51
51
  :value="modelValue"
52
- :data-toggle-password-visibility="isPassword"
52
+ :data-toggle-password-visibility="isPassword || null"
53
53
  @input="$event => $emit('update:modelValue', $event.target.value)"
54
54
  />
55
55
  <button
@@ -64,9 +64,9 @@
64
64
  `${carbonPrefix}--tooltip--align-center`,
65
65
  { [`${carbonPrefix}--btn--disabled`]: $attrs.disabled },
66
66
  ]"
67
- @click="togglePasswordVisibility"
68
67
  type="button"
69
68
  :disabled="$attrs.disabled"
69
+ @click="togglePasswordVisibility"
70
70
  >
71
71
  <span :class="`${carbonPrefix}--assistive-text`">
72
72
  {{ passwordHideShowLabel }}
@@ -118,24 +118,54 @@ import { useIsLight, props as propsTheme } from '../../use/cvTheme';
118
118
  import { inputTypes } from './const';
119
119
 
120
120
  const props = defineProps({
121
+ /**
122
+ * Provide text that is used alongside the control label for additional help
123
+ */
121
124
  helperText: { type: String, default: undefined },
125
+ /**
126
+ * Specify whether you want the underlying label to be visually hidden
127
+ */
122
128
  hideLabel: { type: Boolean, default: false },
129
+ /**
130
+ * Provide the text that is displayed when the control is in an invalid state
131
+ */
123
132
  invalidMessage: { type: String, default: undefined },
124
- label: String,
125
- modelValue: String,
133
+ /**
134
+ * Input's label
135
+ */
136
+ label: { type: String, default: undefined },
137
+ /**
138
+ * Input's value, modelValue is the vue3 default 'prop' for two-way data binding with v-model
139
+ */
140
+ modelValue: { type: String, default: undefined },
141
+ /**
142
+ * Hide password" tooltip text on password visibility toggle
143
+ */
126
144
  passwordHideLabel: { type: String, default: 'Hide password' },
145
+ /**
146
+ * Show password tooltip text on password visibility toggle
147
+ */
127
148
  passwordShowLabel: { type: String, default: 'Show password' },
149
+ /**
150
+ * Toggle password visibility
151
+ */
128
152
  passwordVisible: { type: Boolean, default: undefined },
153
+ /**
154
+ * Input type, only `text` and `password` are available
155
+ */
129
156
  type: {
130
157
  type: String,
131
158
  default: 'text',
132
159
  validator: value => inputTypes.has(value),
133
160
  },
161
+ /**
162
+ * Provide the text that is displayed when the control is in warning state
163
+ */
134
164
  warnText: { type: String, default: undefined },
135
165
  ...propsCvId,
136
166
  ...propsTheme,
137
167
  });
138
-
168
+ defineEmits(['update:modelValue']);
139
169
  const cvId = useCvId(props);
140
170
 
141
171
  // DOM Elements
@@ -0,0 +1,17 @@
1
+ <template>
2
+ <div :class="[`${carbonPrefix}--form-item`]">
3
+ <span
4
+ v-if="!hideLabel"
5
+ :class="[`${carbonPrefix}--label`, `${carbonPrefix}--skeleton`]"
6
+ ></span>
7
+ <div
8
+ :class="[`${carbonPrefix}--text-input`, `${carbonPrefix}--skeleton`]"
9
+ ></div>
10
+ </div>
11
+ </template>
12
+
13
+ <script setup>
14
+ import { carbonPrefix } from '../../global/settings';
15
+
16
+ defineProps({ hideLabel: { type: Boolean, default: false } });
17
+ </script>
@@ -1,4 +1,5 @@
1
1
  import CvTextInput from './CvTextInput.vue';
2
+ import CvTextInputSkeleton from './CvTextInputSkeleton.vue';
2
3
 
3
- export { CvTextInput };
4
+ export { CvTextInput, CvTextInputSkeleton };
4
5
  export default CvTextInput;
@@ -3,14 +3,14 @@
3
3
  :is="tagType"
4
4
  :checked="checkProp('checked', selected)"
5
5
  :expanded="checkProp('expanded', expanded)"
6
- :tileCollapsedLabel="checkProp('tileCollapsedLabel', tileCollapsedLabel)"
7
- :tileExpandedLabel="checkProp('tileCollapsedLabel', tileExpandedLabel)"
6
+ :tile-collapsed-label="checkProp('tileCollapsedLabel', tileCollapsedLabel)"
7
+ :tile-expanded-label="checkProp('tileCollapsedLabel', tileExpandedLabel)"
8
8
  :class="[
9
9
  `cv-tile ${carbonPrefix}--tile`,
10
10
  { [`${carbonPrefix}--tile--light`]: isLight },
11
11
  ]"
12
12
  >
13
- <template v-for="(_, name) in $slots" v-slot:[name]="slotData"
13
+ <template v-for="(_, name) in $slots" #[name]="slotData"
14
14
  ><slot :name="name" v-bind="slotData"
15
15
  /></template>
16
16
  </component>
@@ -1,19 +1,19 @@
1
1
  <template>
2
2
  <button
3
+ ref="el"
3
4
  type="button"
4
5
  :style="data.styleObject"
5
- @click="toggle"
6
6
  :class="[
7
7
  `cv-tile-expandable ${carbonPrefix}--tile--expandable`,
8
8
  { [`${carbonPrefix}--tile--is-expanded`]: data.internalExpanded },
9
9
  ]"
10
- ref="el"
10
+ @click="toggle"
11
11
  >
12
12
  <div :class="`${carbonPrefix}--tile-content`">
13
13
  <span
14
+ ref="aboveFold"
14
15
  data-tile-atf
15
16
  :class="`${carbonPrefix}--tile-content__above-the-fold`"
16
- ref="aboveFold"
17
17
  >
18
18
  <slot>
19
19
  <!-- Above the fold content here -->
@@ -24,9 +24,9 @@
24
24
  <ChevronDown16 />
25
25
  </div>
26
26
  <span
27
- :class="`${carbonPrefix}--tile-content__below-the-fold`"
28
- ref="belowFold"
29
27
  v-show="data.internalExpanded || data.initialized"
28
+ ref="belowFold"
29
+ :class="`${carbonPrefix}--tile-content__below-the-fold`"
30
30
  >
31
31
  <slot name="below">
32
32
  <!-- Rest of the content here -->
@@ -43,8 +43,8 @@ import { computed, nextTick, reactive, ref, watch } from 'vue';
43
43
 
44
44
  const props = defineProps({
45
45
  expanded: Boolean,
46
- tileCollapsedLabel: String,
47
- tileExpandedLabel: String,
46
+ tileCollapsedLabel: { type: String, default: undefined },
47
+ tileExpandedLabel: { type: String, default: undefined },
48
48
  });
49
49
  const data = reactive({
50
50
  styleObject: {
@@ -8,12 +8,12 @@
8
8
  ]"
9
9
  data-tile="selectable"
10
10
  tabindex="0"
11
- :data-contained-checkbox-state="isChecked"
11
+ :data-contained-checkbox-state="isChecked || null"
12
12
  >
13
13
  <input
14
+ :id="uid"
14
15
  tabindex="-1"
15
16
  data-tile-input
16
- :id="uid"
17
17
  type="checkbox"
18
18
  :checked="isChecked === true"
19
19
  :aria-checked="`${isChecked}`"
@@ -7,7 +7,7 @@
7
7
  `${carbonPrefix}--time-picker--${fieldSize}`,
8
8
  { [`${carbonPrefix}--time-picker--light`]: isLight },
9
9
  ]"
10
- :data-invalid="isInvalid"
10
+ :data-invalid="isInvalid || null"
11
11
  >
12
12
  <div :class="`${carbonPrefix}--time-picker__input`">
13
13
  <label :for="uid" :class="`${carbonPrefix}--label`">{{ label }}</label>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div
3
- :class="`cv-definition-tooltip ${carbonPrefix}--tooltip--definition ${carbonPrefix}--tooltip--a11y`"
4
3
  :id="cvId"
4
+ :class="`cv-definition-tooltip ${carbonPrefix}--tooltip--definition ${carbonPrefix}--tooltip--a11y`"
5
5
  >
6
6
  <button
7
7
  :aria-describedby="`${cvId}-label`"
@@ -19,8 +19,8 @@
19
19
  </slot>
20
20
  </button>
21
21
  <div
22
- :class="`${carbonPrefix}--assistive-text`"
23
22
  :id="`${cvId}-label`"
23
+ :class="`${carbonPrefix}--assistive-text`"
24
24
  role="tooltip"
25
25
  >
26
26
  <slot name="definition">