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.
- package/.storybook/main.ts +1 -0
- package/dist/css/reset.css +1 -1
- package/dist/css/utilities-responsive.css +0 -546
- package/dist/style.css +1 -1
- package/dist/tide-design-system.cjs +2 -2
- package/dist/tide-design-system.esm.d.ts +171 -73
- package/dist/tide-design-system.esm.js +1725 -1594
- package/dist/utilities/storybook.ts +6 -2
- package/dist/utilities/validation.ts +1 -1
- package/docs/upgrading.md +79 -0
- package/index.ts +8 -5
- package/package.json +1 -1
- package/src/assets/css/reset.css +1 -1
- package/src/assets/css/utilities-responsive.css +0 -546
- package/src/components/InternalBaseLink.vue +11 -0
- package/src/components/TideAccordionItem.vue +21 -13
- package/src/components/TideBreadCrumbs.vue +3 -2
- package/src/components/TideButton.vue +17 -4
- package/src/components/TideButtonIcon.vue +15 -2
- package/src/components/TideButtonPagination.vue +16 -16
- package/src/components/TideButtonSegmented.vue +15 -15
- package/src/components/TideCard.vue +12 -2
- package/src/components/TideCarousel.vue +10 -5
- package/src/components/TideChipAction.vue +7 -1
- package/src/components/TideChipFilter.vue +14 -7
- package/src/components/TideChipInput.vue +1 -0
- package/src/components/TideIcon.vue +8 -9
- package/src/components/TideImage.vue +9 -9
- package/src/components/TideInputCheckbox.vue +0 -1
- package/src/components/TideInputText.vue +2 -0
- package/src/components/TideInputTextDeprecated.vue +2 -0
- package/src/components/TideInputTextarea.vue +2 -2
- package/src/components/TideLink.vue +7 -1
- package/src/components/TideMenuItem.vue +83 -0
- package/src/components/TideModal.vue +120 -101
- package/src/components/TidePagination.vue +17 -19
- package/src/components/TideSeoLinks.vue +3 -2
- package/src/components/TideSheet.vue +28 -23
- package/src/components/TideSwitch.vue +24 -20
- package/src/composables/useTideConfig.ts +23 -0
- package/src/stories/TideAccordionItem.stories.ts +33 -34
- package/src/stories/TideButtonPagination.stories.ts +6 -6
- package/src/stories/TideButtonSegmented.stories.ts +33 -25
- package/src/stories/TideCarousel.stories.ts +0 -1
- package/src/stories/TideChipFilter.stories.ts +33 -23
- package/src/stories/TideInputCheckbox.stories.ts +66 -23
- package/src/stories/TideInputRadio.stories.ts +39 -30
- package/src/stories/TideInputSelect.stories.ts +51 -27
- package/src/stories/TideInputText.stories.ts +83 -23
- package/src/stories/TideInputTextarea.stories.ts +66 -17
- package/src/stories/TideLink.stories.ts +1 -14
- package/src/stories/TideMenuItem.stories.ts +117 -0
- package/src/stories/TideModal.stories.ts +33 -37
- package/src/stories/TidePagination.stories.ts +33 -22
- package/src/stories/TidePopover.stories.ts +1 -1
- package/src/stories/TideSheet.stories.ts +33 -28
- package/src/stories/TideSwitch.stories.ts +33 -34
- package/src/types/Badge.ts +4 -0
- package/src/types/Element.ts +2 -2
- package/src/types/Formatted.ts +1 -0
- package/src/types/Storybook.ts +4 -6
- package/src/types/Type.ts +6 -0
- package/src/types/Validation.ts +1 -0
- package/src/utilities/storybook.ts +6 -2
- package/src/utilities/validation.ts +1 -1
- package/tests/InternalBaseLink.spec.ts +61 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { 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 ===
|
|
259
|
+
(!args.element || args.element === ELEMENT.BUTTON || args.element === ELEMENT_BROAD.BUTTON)
|
|
256
260
|
) {
|
|
257
261
|
return `@click="${value}"`;
|
|
258
262
|
}
|
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,
|
|
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,
|
|
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
|
-
|
|
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
|
-
|
|
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
package/src/assets/css/reset.css
CHANGED