@carbon/vue 3.0.8-alpha.0 → 3.0.9

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 (37) hide show
  1. package/README.md +60 -21
  2. package/dist/carbon-vue-3.common.js +539 -69
  3. package/dist/carbon-vue-3.common.js.map +1 -1
  4. package/dist/carbon-vue-3.umd.js +539 -69
  5. package/dist/carbon-vue-3.umd.js.map +1 -1
  6. package/dist/carbon-vue-3.umd.min.js +4 -4
  7. package/dist/carbon-vue-3.umd.min.js.map +1 -1
  8. package/package.json +2 -2
  9. package/src/components/CvFileUploader/CvFileUploader.stories.mdx +24 -6
  10. package/src/components/CvFileUploader/CvFileUploader.vue +58 -19
  11. package/src/components/CvNotification/CvToastNotification.stories.js +71 -1
  12. package/src/components/CvNotification/CvToastNotification.vue +6 -4
  13. package/src/components/CvOverflowMenu/CvOverflowMenu.stories.mdx +68 -12
  14. package/src/components/CvOverflowMenu/CvOverflowMenu.vue +39 -45
  15. package/src/components/CvOverflowMenu/CvOverflowMenuItem.vue +6 -11
  16. package/src/components/CvOverflowMenu/index.js +2 -1
  17. package/src/components/CvStructuredList/CvStructuredList.stories.js +141 -0
  18. package/src/components/CvStructuredList/CvStructuredList.vue +44 -0
  19. package/src/components/CvStructuredList/CvStructuredListData.vue +19 -0
  20. package/src/components/CvStructuredList/CvStructuredListHeading.vue +11 -0
  21. package/src/components/CvStructuredList/CvStructuredListItem.vue +47 -0
  22. package/src/components/CvStructuredList/CvStructuredListItemSelectable.vue +56 -0
  23. package/src/components/CvStructuredList/CvStructuredListItemStandard.vue +11 -0
  24. package/src/components/CvStructuredList/__tests__/__snapshots__/CvStructuredList.spec.js.snap +73 -0
  25. package/src/components/CvStructuredList/__tests__/__snapshots__/CvStructuredListData.spec.js.snap +5 -0
  26. package/src/components/CvStructuredList/__tests__/__snapshots__/CvStructuredListHeading.spec.js.snap +9 -0
  27. package/src/components/CvStructuredList/__tests__/__snapshots__/CvStructuredListItem.spec.js.snap +7 -0
  28. package/src/components/CvStructuredList/index.js +12 -0
  29. package/src/components/CvTabs/CvTabs.stories.mdx +84 -3
  30. package/src/components/CvTabs/CvTabs.vue +3 -1
  31. package/src/components/CvTabs/__tests__/__snapshots__/CvTabs.spec.js.snap +24 -0
  32. package/src/components/CvTag/CvTag.stories.js +2 -1
  33. package/src/components/CvTag/CvTag.vue +10 -5
  34. package/src/components/CvTag/CvTagSkeleton.stories.js +39 -0
  35. package/src/components/CvTag/CvTagSkeleton.vue +20 -0
  36. package/src/components/CvTag/index.js +2 -1
  37. package/src/use/useRadio.js +0 -1
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div v-if="skeleton" :class="tagClasses" />
2
+ <div v-if="skeleton" :class="tagClasses"></div>
3
3
  <div v-else :class="tagClasses" role="listitem" :title="title">
4
4
  <span :class="`${carbonPrefix}--tag__label`">
5
5
  {{ label }}
@@ -56,6 +56,10 @@ export default {
56
56
  * skeleton used when loading
57
57
  */
58
58
  skeleton: Boolean,
59
+ /**
60
+ * tag size small
61
+ */
62
+ small: Boolean,
59
63
  },
60
64
  emits: [
61
65
  /**
@@ -69,14 +73,15 @@ export default {
69
73
  });
70
74
 
71
75
  const tagClasses = computed(() => {
72
- const classes = [
73
- `${carbonPrefix}--tag`,
74
- `${carbonPrefix}--tag--${props.kind}`,
75
- ];
76
+ const classes = [`${carbonPrefix}--tag`];
77
+
78
+ if (props.small) classes.push(`${carbonPrefix}--tag--sm`);
76
79
 
77
80
  if (props.skeleton) {
78
81
  classes.push(`${carbonPrefix}--skeleton`);
79
82
  } else {
83
+ classes.push(`${carbonPrefix}--tag--${props.kind}`);
84
+
80
85
  if (props.filter) {
81
86
  classes.push(`${carbonPrefix}--tag--filter`);
82
87
  }
@@ -0,0 +1,39 @@
1
+ import {
2
+ sbCompPrefix,
3
+ storyParametersObject,
4
+ } from '../../global/storybook-utils';
5
+ import CvTagSkeleton from './CvTagSkeleton.vue';
6
+
7
+ export default {
8
+ title: `${sbCompPrefix}/CvTagSkeleton`,
9
+ component: CvTagSkeleton,
10
+ };
11
+
12
+ const template = `<cv-tag-skeleton v-bind="args"></cv-tag-skeleton>`;
13
+ const Template = (args, { argTypes }) => {
14
+ return {
15
+ props: Object.keys(argTypes),
16
+ components: { CvTagSkeleton },
17
+ template,
18
+ setup() {
19
+ return { args };
20
+ },
21
+ };
22
+ };
23
+
24
+ export const Default = Template.bind({});
25
+ Default.parameters = storyParametersObject(
26
+ Default.parameters,
27
+ template,
28
+ Default.args
29
+ );
30
+
31
+ export const Small = Template.bind({});
32
+ Small.args = {
33
+ small: true,
34
+ };
35
+ Small.parameters = storyParametersObject(
36
+ Small.parameters,
37
+ template,
38
+ Small.args
39
+ );
@@ -0,0 +1,20 @@
1
+ <template>
2
+ <CvTag skeleton :small="small" :label="''" />
3
+ </template>
4
+
5
+ <script>
6
+ import CvTag from './CvTag.vue';
7
+
8
+ export default {
9
+ name: 'CvTagSkeleton',
10
+ components: { CvTag },
11
+ props: {
12
+ /**
13
+ * tag size small
14
+ */
15
+ small: {
16
+ type: Boolean,
17
+ },
18
+ },
19
+ };
20
+ </script>
@@ -1,5 +1,6 @@
1
1
  import CvTag from './CvTag.vue';
2
2
  import CvTagConsts from './consts';
3
+ import CvTagSkeleton from './CvTagSkeleton.vue';
3
4
 
4
- export { CvTag, CvTagConsts };
5
+ export { CvTag, CvTagConsts, CvTagSkeleton };
5
6
  export default CvTag;
@@ -13,7 +13,6 @@ export const useRadio = (props, emit) => {
13
13
 
14
14
  const onChange = () => {
15
15
  onRadioItemChange(props.value); // emit to parent
16
-
17
16
  emit('update:modelValue', props.value); // emit for v-model
18
17
  emit('change', props.value);
19
18
  };