tide-design-system 2.4.5 → 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.
Files changed (66) hide show
  1. package/.storybook/main.ts +1 -0
  2. package/dist/css/reset.css +1 -1
  3. package/dist/css/utilities-responsive.css +0 -546
  4. package/dist/style.css +1 -1
  5. package/dist/tide-design-system.cjs +2 -2
  6. package/dist/tide-design-system.esm.d.ts +171 -73
  7. package/dist/tide-design-system.esm.js +1725 -1594
  8. package/dist/utilities/storybook.ts +6 -2
  9. package/dist/utilities/validation.ts +1 -1
  10. package/docs/upgrading.md +79 -0
  11. package/index.ts +8 -5
  12. package/package.json +1 -1
  13. package/src/assets/css/reset.css +1 -1
  14. package/src/assets/css/utilities-responsive.css +0 -546
  15. package/src/components/InternalBaseLink.vue +11 -0
  16. package/src/components/TideAccordionItem.vue +21 -13
  17. package/src/components/TideBreadCrumbs.vue +3 -2
  18. package/src/components/TideButton.vue +17 -4
  19. package/src/components/TideButtonIcon.vue +15 -2
  20. package/src/components/TideButtonPagination.vue +16 -16
  21. package/src/components/TideButtonSegmented.vue +15 -15
  22. package/src/components/TideCard.vue +12 -2
  23. package/src/components/TideCarousel.vue +10 -5
  24. package/src/components/TideChipAction.vue +7 -1
  25. package/src/components/TideChipFilter.vue +14 -7
  26. package/src/components/TideChipInput.vue +1 -0
  27. package/src/components/TideIcon.vue +8 -9
  28. package/src/components/TideImage.vue +9 -9
  29. package/src/components/TideInputCheckbox.vue +0 -1
  30. package/src/components/TideInputText.vue +2 -0
  31. package/src/components/TideInputTextDeprecated.vue +2 -0
  32. package/src/components/TideInputTextarea.vue +2 -2
  33. package/src/components/TideLink.vue +7 -1
  34. package/src/components/TideMenuItem.vue +83 -0
  35. package/src/components/TideModal.vue +120 -101
  36. package/src/components/TidePagination.vue +17 -19
  37. package/src/components/TideSeoLinks.vue +3 -2
  38. package/src/components/TideSheet.vue +28 -23
  39. package/src/components/TideSwitch.vue +24 -20
  40. package/src/composables/useTideConfig.ts +23 -0
  41. package/src/stories/TideAccordionItem.stories.ts +33 -34
  42. package/src/stories/TideButtonPagination.stories.ts +6 -6
  43. package/src/stories/TideButtonSegmented.stories.ts +33 -25
  44. package/src/stories/TideCarousel.stories.ts +0 -1
  45. package/src/stories/TideChipFilter.stories.ts +33 -23
  46. package/src/stories/TideInputCheckbox.stories.ts +66 -23
  47. package/src/stories/TideInputRadio.stories.ts +39 -30
  48. package/src/stories/TideInputSelect.stories.ts +51 -27
  49. package/src/stories/TideInputText.stories.ts +83 -23
  50. package/src/stories/TideInputTextarea.stories.ts +66 -17
  51. package/src/stories/TideLink.stories.ts +1 -14
  52. package/src/stories/TideMenuItem.stories.ts +117 -0
  53. package/src/stories/TideModal.stories.ts +33 -37
  54. package/src/stories/TidePagination.stories.ts +33 -22
  55. package/src/stories/TidePopover.stories.ts +1 -1
  56. package/src/stories/TideSheet.stories.ts +33 -28
  57. package/src/stories/TideSwitch.stories.ts +33 -34
  58. package/src/types/Badge.ts +4 -0
  59. package/src/types/Element.ts +2 -2
  60. package/src/types/Formatted.ts +1 -0
  61. package/src/types/Storybook.ts +4 -6
  62. package/src/types/Type.ts +6 -0
  63. package/src/types/Validation.ts +1 -0
  64. package/src/utilities/storybook.ts +6 -2
  65. package/src/utilities/validation.ts +1 -1
  66. package/tests/InternalBaseLink.spec.ts +61 -0
@@ -1,4 +1,4 @@
1
- import { ELEMENT, ELEMENT_TEXT_AS_ICON } from '@/types/Element';
1
+ import { ELEMENT, ELEMENT_BROAD } from '@/types/Element';
2
2
  import { BOOLEAN, BOOLEAN_UNREQUIRED, NoneAsEmpty, NoneAsUndefined } from '@/types/Storybook';
3
3
  import { CSS } from '@/types/Styles';
4
4
  import { formatKebabCase } from '@/utilities/format';
@@ -61,6 +61,7 @@ export const change = {
61
61
  isEmit: true,
62
62
  name: 'change',
63
63
  table: {
64
+ category: 'Events',
64
65
  defaultValue: { summary: 'None' },
65
66
  type: { summary: '() => void' },
66
67
  },
@@ -71,6 +72,7 @@ export const click = {
71
72
  description: 'JS code or function to execute on click event',
72
73
  isEmit: true,
73
74
  table: {
75
+ category: 'Events',
74
76
  defaultValue: { summary: 'None' },
75
77
  type: { summary: '() => void' },
76
78
  },
@@ -81,6 +83,7 @@ export const close = {
81
83
  description: 'JS code or function to execute on close event',
82
84
  isEmit: true,
83
85
  table: {
86
+ category: 'Events',
84
87
  defaultValue: { summary: 'None' },
85
88
  type: { summary: '() => void' },
86
89
  },
@@ -90,6 +93,7 @@ export const dataTrack = {
90
93
  control: 'text',
91
94
  description: 'Data attribute for external tracking',
92
95
  table: {
96
+ category: 'Native',
93
97
  defaultValue: { summary: 'None' },
94
98
  type: { summary: 'string' },
95
99
  },
@@ -252,7 +256,7 @@ export const formatSnippet = (code: string, context: StoryContext) => {
252
256
  if (
253
257
  isClick &&
254
258
  value &&
255
- (!args.element || args.element === ELEMENT.BUTTON || args.element === ELEMENT_TEXT_AS_ICON.BUTTON)
259
+ (!args.element || args.element === ELEMENT.BUTTON || args.element === ELEMENT_BROAD.BUTTON)
256
260
  ) {
257
261
  return `@click="${value}"`;
258
262
  }
@@ -70,7 +70,7 @@ export const getFieldValidationResult = ({
70
70
  }
71
71
 
72
72
  // all other prop-based errors come last
73
- if (required && value.value.trim() === '') {
73
+ if (required && value.value?.trim() === '') {
74
74
  return VALIDATION_RESULT.REQUIRED;
75
75
  }
76
76
 
package/docs/upgrading.md CHANGED
@@ -4,6 +4,85 @@ This document provides step-by-step instructions for upgrading from previous ver
4
4
 
5
5
  ---
6
6
 
7
+ ## Upgrading from 2.4 → 2.5
8
+
9
+ ### What changed?
10
+
11
+ TIDE **2.5** updates several *stateful* components to use Vue’s `v-model` for two-way binding. This replaces each component’s old “value prop + change emit” pattern.
12
+
13
+ Affected components:
14
+
15
+ - `TideAccordionItem`
16
+ - `TideButtonSegmented`
17
+ - `TideChipFilter`
18
+ - `TideModal`
19
+ - `TideSheet`
20
+ - `TideSwitch`
21
+
22
+ ### How to migrate
23
+
24
+ #### 1. Replace old props with `v-model`
25
+
26
+ | Component | v2.4 prop | v2.5+ |
27
+ |---|---|---|
28
+ | TideAccordionItem | `:is-expanded` | `v-model` |
29
+ | TideButtonSegmented | `:active-tab` | `v-model` |
30
+ | TideChipFilter | `:is-active` | `v-model` |
31
+ | TideModal | `:is-open` | `v-model` |
32
+ | TideSheet | `:is-open` | `v-model` |
33
+ | TideSwitch | `:is-active` | `v-model` |
34
+
35
+ ##### 2.4 example
36
+
37
+ ```
38
+ <TideButtonSegmented
39
+ :active-tab="active"
40
+ @change="active = $event"
41
+ />
42
+ ```
43
+
44
+ ##### 2.5+
45
+
46
+ ``` vue
47
+ <TideButtonSegmented v-model="active" />
48
+ ```
49
+
50
+ #### 2. Replace old emits with `@update:modelValue`
51
+
52
+ | Component | Old emit | New emit |
53
+ |---|---|---|
54
+ | TideAccordionItem | `@toggle` | `@update:modelValue` |
55
+ | TideButtonSegmented | `@change` | `@update:modelValue` |
56
+ | TideChipFilter | `@click` | `@update:modelValue` |
57
+ | TideModal | `@close` | `@update:modelValue` |
58
+ | TideSheet | `@close` | `@update:modelValue` |
59
+ | TideSwitch | `@change` | `@update:modelValue` |
60
+
61
+ Use this only for **side effects**, not basic value updates.
62
+
63
+ Or use Vue’s `watch()`:
64
+
65
+ ``` ts
66
+ watch(active, doSomething);
67
+ ```
68
+
69
+ ### Handling cancellable modals (new API)
70
+
71
+ **2.4** used `@close` + manual logic.
72
+
73
+ **2.5+** introduces `:before-close`, which cancels dismissal if it returns `false`.
74
+
75
+ ```
76
+ <TideModal
77
+ v-model="isOpen"
78
+ :before-close="() => {
79
+ if (!confirm('Close modal?')) return false;
80
+ }"
81
+ >
82
+ ```
83
+
84
+ ✅ After these changes your project should be compatible with **TIDE 2.5**.
85
+
7
86
  ## Upgrading from 2.3 → 2.4
8
87
 
9
88
  ### Summary
package/index.ts CHANGED
@@ -31,18 +31,20 @@ import TideInputTextDeprecated from '@/components/TideInputTextDeprecated.vue';
31
31
  import TideInputTextarea from '@/components/TideInputTextarea.vue';
32
32
  import TideInputTextareaDeprecated from '@/components/TideInputTextareaDeprecated.vue';
33
33
  import TideLink from '@/components/TideLink.vue';
34
+ import TideMenuItem from '@/components/TideMenuItem.vue';
34
35
  import TideModal from '@/components/TideModal.vue';
35
36
  import TidePagination from '@/components/TidePagination.vue';
36
37
  import TidePopover from '@/components/TidePopover.vue';
37
38
  import TideSeoLinks from '@/components/TideSeoLinks.vue';
38
39
  import TideSheet from '@/components/TideSheet.vue';
39
40
  import TideSwitch from '@/components/TideSwitch.vue';
41
+ import { provideTideConfig } from '@/composables/useTideConfig';
40
42
  import { useTideForm } from '@/composables/useTideForm';
41
43
  import { ALERT } from '@/types/Alert';
42
44
  import { BADGE_COLOR, BADGE_COLOR_DETAILS, BADGE_TRUSTED } from '@/types/Badge';
43
45
  import { BREAKPOINT, MEDIA } from '@/types/Breakpoint';
44
46
  import { TYPE_CARD } from '@/types/Card';
45
- import { ELEMENT, ELEMENT_TEXT_AS_ICON } from '@/types/Element';
47
+ import { ELEMENT, ELEMENT_BROAD } from '@/types/Element';
46
48
  import { FORMAT, FORMAT_REGEX } from '@/types/Formatted';
47
49
  import { ICON, ICON_REALM } from '@/types/Icon';
48
50
  import { OBJECT_FIT } from '@/types/Image';
@@ -60,7 +62,7 @@ import type { BadgeTrustedYears } from '@/types/Badge';
60
62
  import type { BreadCrumb } from '@/types/BreadCrumb';
61
63
  import type { Breakpoint, Media } from '@/types/Breakpoint';
62
64
  import type { CardType } from '@/types/Card';
63
- import type { Element, ElementTextAsIcon } from '@/types/Element';
65
+ import type { Element, ElementBroad } from '@/types/Element';
64
66
  import type { FormValueTransformer } from '@/types/Form';
65
67
  import type { TextInput } from '@/types/FormDeprecated';
66
68
  import type { Formatted } from '@/types/Formatted';
@@ -87,7 +89,7 @@ export type {
87
89
  Breakpoint,
88
90
  CardType,
89
91
  Element,
90
- ElementTextAsIcon,
92
+ ElementBroad,
91
93
  FormValueTransformer,
92
94
  Formatted,
93
95
  Icon,
@@ -121,7 +123,7 @@ export {
121
123
  BREAKPOINT,
122
124
  CSS,
123
125
  ELEMENT,
124
- ELEMENT_TEXT_AS_ICON,
126
+ ELEMENT_BROAD,
125
127
  FORMAT,
126
128
  FORMAT_REGEX,
127
129
  ICON,
@@ -140,7 +142,7 @@ export {
140
142
  VALIDATOR,
141
143
  };
142
144
 
143
- export { useTideForm };
145
+ export { useTideForm, provideTideConfig };
144
146
 
145
147
  export {
146
148
  TideAccordionItem,
@@ -176,6 +178,7 @@ export {
176
178
  TideInputTextarea,
177
179
  TideInputTextareaDeprecated,
178
180
  TideLink,
181
+ TideMenuItem,
179
182
  TideModal,
180
183
  TidePagination,
181
184
  TidePopover,
package/package.json CHANGED
@@ -63,7 +63,7 @@
63
63
  "main": "dist/tide-design-system.cjs",
64
64
  "module": "dist/tide-design-system.esm.js",
65
65
  "types": "dist/tide-design-system.esm.d.ts",
66
- "version": "2.4.5",
66
+ "version": "2.5.0",
67
67
  "dependencies": {
68
68
  "@floating-ui/vue": "^1.1.6"
69
69
  }
@@ -25,7 +25,7 @@ body {
25
25
  border: 0;
26
26
  padding: 0;
27
27
  color: inherit;
28
- font-family: Montserrat;
28
+ font-family: Montserrat, system-ui, sans-serif;
29
29
  font-weight: inherit;
30
30
  line-height: inherit;
31
31
  -webkit-font-smoothing: antialiased;