tide-design-system 2.4.0 → 2.4.2

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 (42) hide show
  1. package/dist/style.css +1 -1
  2. package/dist/tide-design-system.cjs +2 -2
  3. package/dist/tide-design-system.esm.d.ts +17 -17
  4. package/dist/tide-design-system.esm.js +8 -8
  5. package/netlify.toml +3 -0
  6. package/package.json +5 -3
  7. package/src/components/TideCard.vue +1 -1
  8. package/src/components/TideChipAction.vue +1 -1
  9. package/src/components/TideImage.vue +1 -1
  10. package/src/components/TideImageBackground.vue +2 -2
  11. package/src/components/TideInputCheckboxDeprecated.vue +2 -2
  12. package/src/components/TideInputRadioDeprecated.vue +2 -2
  13. package/src/components/TideInputTextDeprecated.vue +2 -2
  14. package/src/stories/FoundationsBorder.stories.ts +25 -13
  15. package/src/stories/FoundationsTypography.stories.ts +24 -0
  16. package/src/types/Storybook.ts +10 -0
  17. package/vite.config.sandbox.ts +29 -0
  18. package/dist/css/fonts.css +0 -36
  19. package/dist/css/grid-layout.css +0 -34
  20. package/dist/css/main.css +0 -5
  21. package/dist/css/realm/aero.css +0 -25
  22. package/dist/css/realm/atv.css +0 -25
  23. package/dist/css/realm/boatmart.css +0 -25
  24. package/dist/css/realm/cycle.css +0 -24
  25. package/dist/css/realm/equipment.css +0 -25
  26. package/dist/css/realm/pwc.css +0 -25
  27. package/dist/css/realm/rv.css +0 -25
  28. package/dist/css/realm/snow.css +0 -25
  29. package/dist/css/realm/truck.css +0 -25
  30. package/dist/css/reset.css +0 -95
  31. package/dist/css/storybook.css +0 -17
  32. package/dist/css/utilities-base.css +0 -545
  33. package/dist/css/utilities-responsive.css +0 -2737
  34. package/dist/css/utilities.css +0 -16
  35. package/dist/css/variables.css +0 -205
  36. package/dist/utilities/event.ts +0 -4
  37. package/dist/utilities/format.ts +0 -184
  38. package/dist/utilities/forms.ts +0 -22
  39. package/dist/utilities/storybook.ts +0 -352
  40. package/dist/utilities/validation-deprecated.ts +0 -252
  41. package/dist/utilities/validation.ts +0 -132
  42. package/dist/utilities/viewport.ts +0 -63
@@ -1,16 +0,0 @@
1
- @import './utilities-base.css';
2
- @import './utilities-responsive.css';
3
-
4
- /* Non-responsive utility classes */
5
-
6
- .tide-screen-reader-only {
7
- position: absolute;
8
- width: 1px;
9
- height: 1px;
10
- margin: -1px;
11
- padding: 0;
12
- overflow: hidden;
13
- clip: rect(0, 0, 0, 0);
14
- white-space: nowrap;
15
- border: 0;
16
- }
@@ -1,205 +0,0 @@
1
- /*.CSS Variables */
2
- :root {
3
- /* Font Size */
4
- --tide-font-10: 0.625rem;
5
- --tide-font-12: 0.75rem;
6
- --tide-font-14: 0.875rem;
7
- --tide-font-16: 1rem;
8
- --tide-font-18: 1.125rem;
9
- --tide-font-20: 1.25rem;
10
- --tide-font-24: 1.5rem;
11
- --tide-font-28: 1.75rem;
12
- --tide-font-32: 2rem;
13
-
14
- /* Animation */
15
- --tide-animate: 300ms ease-in-out;
16
-
17
- /* Spacing */
18
- --tide-spacing-0: 0rem;
19
- --tide-spacing-1\/4: 0.25rem;
20
- --tide-spacing-1\/2: 0.5rem;
21
- --tide-spacing-1: 1rem;
22
- --tide-spacing-2: 2rem;
23
- --tide-spacing-4: 4rem;
24
-
25
- /* Border */
26
- --tide-border-width-1: 1px;
27
- --tide-border-width-2: 2px;
28
-
29
- --tide-border-1: var(--tide-border-width-1) solid var(--tide-black);
30
- --tide-border-2: var(--tide-border-width-2) solid var(--tide-black);
31
-
32
- /* Border Radius */
33
- --tide-radius-1\/4: 4px;
34
- --tide-radius-1\/2: 8px;
35
- --tide-radius-1: 16px;
36
- --tide-radius-full: 99999px;
37
-
38
- --tide-black: var(--tide-gray-900);
39
- --tide-white: var(--tide-gray-100);
40
-
41
- /* Opacity */
42
- --tide-disabled: 0.333;
43
-
44
- /* Shadow */
45
- --tide-shadow-bottom: 0px 2px 8px 2px rgba(0, 0, 0, 0.07);
46
- --tide-shadow-top: 0px -2px 8px 2px rgba(0, 0, 0, 0.07);
47
- --tide-shadow-text: 0px 0px 5px rgba(0, 0, 0, 0.6);
48
-
49
- /* Transparency */
50
- --tide-transparent-100: color-mix(in srgb, white 90%, transparent);
51
- --tide-transparent-200: color-mix(in srgb, white 75%, transparent);
52
- --tide-transparent-300: color-mix(in srgb, black 10%, transparent);
53
- --tide-transparent-400: color-mix(in srgb, black 50%, transparent);
54
-
55
- /* Blur */
56
- --tide-bg-blur: blur(8px);
57
-
58
- /* Global tonal palette */
59
- --tide-gray-100: #FFFFFF;
60
- --tide-gray-200: #F5F5F5;
61
- --tide-gray-300: #E4E4E4;
62
- --tide-gray-400: #C9CACB;
63
- --tide-gray-500: #AEAFB2;
64
- --tide-gray-600: #939598;
65
- --tide-gray-700: #6E7072;
66
- --tide-gray-800: #494A4C;
67
- --tide-gray-900: #252526;
68
- --tide-gray-1000: #000000;
69
-
70
- --tide-blue-100: #EBF1FD;
71
- --tide-blue-200: #3870E9;
72
- --tide-blue-300: #22438C;
73
-
74
- --tide-green-100: #E7F6ED;
75
- --tide-green-200: #11A94E;
76
- --tide-green-300: #0A652F;
77
-
78
- --tide-lime-100: #F7FAE9;
79
- --tide-lime-200: #ACC821;
80
- --tide-lime-300: #677814;
81
-
82
- --tide-orange-100: #FFF2EA;
83
- --tide-orange-200: #FA8131;
84
- --tide-orange-300: #964D1D;
85
-
86
- --tide-purple-100: #F1F0F8;
87
- --tide-purple-200: #756CB7;
88
- --tide-purple-300: #46416E;
89
-
90
- --tide-red-100: #FBE9EA;
91
- --tide-red-200: #D8202E;
92
- --tide-red-300: #82131C;
93
-
94
- --tide-salmon-100: #FDF1F0;
95
- --tide-salmon-200: #EE706B;
96
- --tide-salmon-300: #8F4340;
97
-
98
- --tide-teal-100: #E6F7F8;
99
- --tide-teal-200: #21B1B2;
100
- --tide-teal-300: #036C6C;
101
-
102
- --tide-yellow-100: #FEF2CC;
103
- --tide-yellow-200: #FACA33;
104
- --tide-yellow-300: #90731D;
105
-
106
- /* Global color roles */
107
- --tide-blue-primary: var(--tide-blue-200);
108
- --tide-blue-surface: var(--tide-blue-100);
109
- --tide-blue-border: var(--tide-blue-200);
110
- --tide-blue-on-surface: var(--tide-blue-300);
111
-
112
- --tide-green-primary: var(--tide-green-200);
113
- --tide-green-surface: var(--tide-green-100);
114
- --tide-green-border: var(--tide-green-200);
115
- --tide-green-on-surface: var(--tide-green-300);
116
-
117
- --tide-lime-primary: var(--tide-lime-200);
118
- --tide-lime-surface: var(--tide-lime-100);
119
- --tide-lime-border: var(--tide-lime-200);
120
- --tide-lime-on-surface: var(--tide-lime-300);
121
-
122
- --tide-orange-primary: var(--tide-orange-200);
123
- --tide-orange-surface: var(--tide-orange-100);
124
- --tide-orange-border: var(--tide-orange-200);
125
- --tide-orange-on-surface: var(--tide-orange-300);
126
-
127
- --tide-purple-primary: var(--tide-purple-200);
128
- --tide-purple-surface: var(--tide-purple-100);
129
- --tide-purple-border: var(--tide-purple-200);
130
- --tide-purple-on-surface: var(--tide-purple-300);
131
-
132
- --tide-red-primary: var(--tide-red-200);
133
- --tide-red-surface: var(--tide-red-100);
134
- --tide-red-border: var(--tide-red-200);
135
- --tide-red-on-surface: var(--tide-red-300);
136
-
137
- --tide-salmon-primary: var(--tide-salmon-200);
138
- --tide-salmon-surface: var(--tide-salmon-100);
139
- --tide-salmon-border: var(--tide-salmon-200);
140
- --tide-salmon-on-surface: var(--tide-salmon-300);
141
-
142
- --tide-teal-primary: var(--tide-teal-200);
143
- --tide-teal-surface: var(--tide-teal-100);
144
- --tide-teal-border: var(--tide-teal-200);
145
- --tide-teal-on-surface: var(--tide-teal-300);
146
-
147
- --tide-yellow-primary: var(--tide-yellow-200);
148
- --tide-yellow-surface: var(--tide-yellow-100);
149
- --tide-yellow-border: var(--tide-yellow-200);
150
- --tide-yellow-on-surface: var(--tide-yellow-300);
151
-
152
- /* Status color roles */
153
- --tide-error-primary: var(--tide-red-200);
154
- --tide-error-surface: var(--tide-red-100);
155
- --tide-error-border: var(--tide-red-200);
156
-
157
- --tide-info-primary: var(--tide-blue-200);
158
- --tide-info-surface: var(--tide-blue-100);
159
- --tide-info-border: var(--tide-blue-200);
160
-
161
- --tide-success-primary: var(--tide-green-200);
162
- --tide-success-surface: var(--tide-green-100);
163
- --tide-success-border: var(--tide-green-200);
164
-
165
- --tide-warning-primary: var(--tide-yellow-200);
166
- --tide-warning-surface: var(--tide-yellow-100);
167
- --tide-warning-border: var(--tide-yellow-200);
168
-
169
- /* Global color roles (defined in realm tonal palettes in Figma) */
170
- --tide-secondary: var(--tide-gray-900);
171
- --tide-on-secondary: var(--tide-gray-100);
172
-
173
- --tide-surface: var(--tide-gray-100);
174
- --tide-surface-variant: var(--tide-gray-200);
175
- --tide-surface-floating: var(--tide-transparent-100);
176
-
177
- --tide-on-surface: var(--tide-gray-900);
178
- --tide-on-surface-variant: var(--tide-gray-700);
179
- --tide-on-surface-inverse: var(--tide-gray-100);
180
- --tide-on-surface-inverse-variant: var(--tide-transparent-200);
181
-
182
- --tide-border-low: var(--tide-gray-300);
183
- --tide-border: var(--tide-gray-600);
184
- --tide-border-high: var(--tide-gray-900);
185
- --tide-border-floating: var(--tide-transparent-300);
186
-
187
- --tide-surface-gradient:
188
- radial-gradient(
189
- 57.27% 60.26% at 100% 103.53%,
190
- color-mix(in srgb, var(--tide-gradient-bottom-right-color) var(--tide-gradient-bottom-right-opacity), transparent) 0%,
191
- color-mix(in srgb, var(--tide-gradient-bottom-right-color) 0%, transparent) 100%
192
- ),
193
- radial-gradient(
194
- 157.36% 151.94% at 19.69% -3.53%,
195
- color-mix(in srgb, var(--tide-gradient-top-color) var(--tide-gradient-top-opacity), transparent) 28.37%,
196
- color-mix(in srgb, var(--tide-gradient-top-color) 0%, transparent) 100%
197
- ),
198
- radial-gradient(
199
- 41.93% 63.48% at -2.12% 103.9%,
200
- color-mix(in srgb, var(--tide-gradient-bottom-left-color) var(--tide-gradient-bottom-left-opacity), transparent) 0%,
201
- color-mix(in srgb, var(--tide-gradient-bottom-left-color) 0%, transparent) 100%
202
- );
203
- }
204
-
205
-
@@ -1,4 +0,0 @@
1
- export const isClickOutside = (event: MouseEvent, elements: HTMLElement | HTMLElement[]): boolean => {
2
- const targets = Array.isArray(elements) ? elements : [elements];
3
- return !targets.some((el) => el.contains(event.target as Node));
4
- };
@@ -1,184 +0,0 @@
1
- const capitalizeFirst = (string: string) => {
2
- return string.charAt(0).toUpperCase() + string.slice(1);
3
- };
4
-
5
- const formatCamelCase = (input: string): string => {
6
- return input && typeof input === 'string'
7
- ? input
8
- .replace(/^[\s_-]/, '')
9
- .replace(/([a-z]{1})([A-Z]{1})/g, '$1 $2')
10
- .replace(/[\s_-]/g, ' ')
11
- .toLowerCase()
12
- .split(' ')
13
- .map((word, index) => (index === 0 ? word : word.slice(0, 1).toUpperCase() + word.slice(1)))
14
- .join('')
15
- : input;
16
- };
17
-
18
- const formatKebabCase = (input: string): string => {
19
- return input && typeof input === 'string'
20
- ? input
21
- .replace(/([a-z]{1})([A-Z]{1})/g, '$1 $2')
22
- .toLowerCase()
23
- .replace(/[\s_-]/g, '-')
24
- : input;
25
- };
26
-
27
- const formatLabel = (value: string) => {
28
- const labelMap: { [key: string]: string } = {
29
- false: 'No',
30
- true: 'Yes',
31
- };
32
- return Object.hasOwn(labelMap, value) ? labelMap[value] : value;
33
- };
34
-
35
- const formatNumber = (input: number | string): string => {
36
- let output = input && typeof input === 'number' ? new Intl.NumberFormat().format(input) : String(input || '');
37
- let digits = output;
38
-
39
- if (input && typeof input === 'string') {
40
- digits = digits.replace(/\D/g, '');
41
- if (Number(digits)) {
42
- output = new Intl.NumberFormat().format(Number(digits));
43
- } else {
44
- output = '0';
45
- }
46
- }
47
-
48
- return output;
49
- };
50
-
51
- const formatPascalCase = (input: string): string => {
52
- return input && typeof input === 'string'
53
- ? input
54
- .replace(/([a-z]{1})([A-Z]{1})/g, '$1 $2')
55
- .replace(/[\s_-]/g, ' ')
56
- .toLowerCase()
57
- .split(' ')
58
- .map((word) => word.slice(0, 1).toUpperCase() + word.slice(1))
59
- .join('')
60
- : input;
61
- };
62
-
63
- const formatPhone = (input: number | string): string => {
64
- let output = input && typeof input === 'number' ? String(input) : String(input || '');
65
- let digits = output;
66
- digits = digits.replace(/\D/g, '');
67
-
68
- switch (digits.length) {
69
- case 7:
70
- output = `${digits.slice(0, 3)}-${digits.slice(3)}`;
71
- break;
72
- case 10:
73
- output = `${digits.slice(0, 3)}-${digits.slice(3, 6)}-${digits.slice(6)}`;
74
- break;
75
- case 11:
76
- output = `${digits.slice(0, 1)}-${digits.slice(1, 4)}-${digits.slice(4, 7)}-${digits.slice(7)}`;
77
- break;
78
- default:
79
- output = digits;
80
- break;
81
- }
82
-
83
- return output;
84
- };
85
-
86
- const formatPrice = (input: number | string): string => {
87
- const output = input ? formatNumber(input) : String(input || '0');
88
- return `$${output}`;
89
- };
90
-
91
- const formatQuotes = (value: string) => {
92
- if (value.startsWith('"') && value.endsWith('"')) {
93
- return value.slice(1, -1);
94
- } else {
95
- return value;
96
- }
97
- };
98
-
99
- const formatSentenceCase = (input: string): string => {
100
- let sentenceCase = input;
101
-
102
- if (input && typeof input === 'string') {
103
- const lowerCase = input
104
- .replace(/([a-z]{1})([A-Z]{1})/g, '$1 $2')
105
- .toLowerCase()
106
- .replace(/[\s_-]/g, ' ');
107
-
108
- sentenceCase = lowerCase.slice(0, 1).toUpperCase() + lowerCase.slice(1);
109
- }
110
-
111
- return sentenceCase;
112
- };
113
-
114
- const formatSnakeCase = (input: string): string => {
115
- return input && typeof input === 'string'
116
- ? input
117
- .replace(/([a-z]{1})([A-Z]{1})/g, '$1 $2')
118
- .toLowerCase()
119
- .replace(/[\s_-]/g, '_')
120
- : input;
121
- };
122
-
123
- const formatTitleCase = (input: string): string => {
124
- return input && typeof input === 'string'
125
- ? input
126
- .replace(/([a-z]{1})([A-Z]{1})/g, '$1 $2')
127
- .toLowerCase()
128
- .replace(/[\s_-]/g, ' ')
129
- .split(' ')
130
- .map((word) => word.slice(0, 1).toUpperCase() + word.slice(1))
131
- .join(' ')
132
- : input;
133
- };
134
-
135
- const formatUrlFromRoot = (url: string) => {
136
- const urlFormatted = url.split('.com/');
137
-
138
- return urlFormatted.length > 1 ? `/${urlFormatted[1]}` : url;
139
- };
140
-
141
- const formatWeight = (input: number | string): string => {
142
- const output = input ? formatNumber(input) : String(input || '0');
143
- return `${output} lbs`;
144
- };
145
-
146
- const getArticle = (noun: string, isPlural = false, isDefinite = false) => {
147
- const vowels = ['a', 'e', 'i', 'o', 'u'];
148
- const isVowelLeading = vowels.includes(noun.charAt(0));
149
-
150
- return isDefinite ? 'the' : isPlural ? 'some' : isVowelLeading ? 'an' : 'a';
151
- };
152
-
153
- const priceToNumber = (value: string) => {
154
- if (Number.isNaN(Number(value))) {
155
- value = value.replace('$', '');
156
- value = value.replace(/,/g, '');
157
- }
158
- return parseInt(value, 10);
159
- };
160
-
161
- const unformatPrice = (input: string): string => {
162
- const output = input.replace(/\$/g, '').replace(/,/g, '');
163
- return `${output}`;
164
- };
165
-
166
- export {
167
- capitalizeFirst,
168
- formatCamelCase,
169
- formatKebabCase,
170
- formatLabel,
171
- formatNumber,
172
- formatPascalCase,
173
- formatPhone,
174
- formatPrice,
175
- formatQuotes,
176
- formatSentenceCase,
177
- formatSnakeCase,
178
- formatTitleCase,
179
- formatUrlFromRoot,
180
- formatWeight,
181
- getArticle,
182
- priceToNumber,
183
- unformatPrice,
184
- };
@@ -1,22 +0,0 @@
1
- import { INPUT_MODE, TEXT_INPUT_TYPE } from '@/types/TextInput';
2
-
3
- import type { InputMode, TextInputType } from '@/types/TextInput';
4
-
5
- export const getTextInputMode = (type: TextInputType, inputmode?: InputMode): InputMode | undefined => {
6
- if (inputmode) return inputmode;
7
-
8
- switch (type) {
9
- case TEXT_INPUT_TYPE.TEL:
10
- return INPUT_MODE.TEL;
11
- case TEXT_INPUT_TYPE.SEARCH:
12
- return INPUT_MODE.SEARCH;
13
- case TEXT_INPUT_TYPE.NUMBER:
14
- return INPUT_MODE.NUMERIC;
15
- case TEXT_INPUT_TYPE.EMAIL:
16
- return INPUT_MODE.EMAIL;
17
- case TEXT_INPUT_TYPE.URL:
18
- return INPUT_MODE.URL;
19
- }
20
-
21
- return undefined;
22
- };