tide-design-system 2.0.34 → 2.0.36

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.
@@ -1,23 +1,33 @@
1
1
  import type { StoryContext } from '@storybook/vue3';
2
2
 
3
- import { TYPOGRAPHY } from '@/types/Storybook';
4
- import { formatArgType, getConstantsByValues } from '@/utilities/storybook';
3
+ import * as STYLES from '@/types/Storybook';
4
+ import { formatArgType, getConstantsByValues, prependNoneAsEmpty } from '@/utilities/storybook';
5
+
6
+ const TYPOGRAPHY = prependNoneAsEmpty(STYLES.TYPOGRAPHY);
5
7
 
6
8
  const formatArgs = (args: any) => {
7
- args.class = args.type.join(' ');
9
+ args.class = formatClassNames(args).join(' ');
8
10
 
9
11
  return { args };
10
12
  };
11
13
 
12
14
  const formatClassNames = (args: any) => {
13
- const classNames: string[] = args.type;
15
+ const classNames: string[] = [];
16
+
17
+ if (args.type) classNames.push(args.type);
18
+
19
+ return classNames;
20
+ };
21
+
22
+ const formatClassNamesSnippet = (args: any) => {
23
+ const classNames = formatClassNames(args);
14
24
 
15
25
  return getConstantsByValues(classNames);
16
26
  };
17
27
 
18
28
  const formatSnippet = (code: string, context: StoryContext) => {
19
29
  const { args } = context;
20
- const classNames = formatClassNames(args);
30
+ const classNames = formatClassNamesSnippet(args);
21
31
 
22
32
  return `<div :class="[${classNames.join(', ')}]">${args.label}</div>`;
23
33
  };
@@ -57,11 +67,15 @@ export default {
57
67
  ...formatArgType({ TYPOGRAPHY }),
58
68
  description: `Applies font rules`,
59
69
  name: 'Type',
70
+ table: {
71
+ defaultValue: { summary: 'None' },
72
+ type: { summary: 'CSS.FONT.ROLE' },
73
+ },
60
74
  },
61
75
  },
62
76
  args: {
63
77
  label: 'Aa',
64
- type: TYPOGRAPHY.BODY_1,
78
+ type: TYPOGRAPHY.None,
65
79
  },
66
80
  parameters,
67
81
  render,
@@ -69,104 +83,106 @@ export default {
69
83
  title: 'Foundations/Typography',
70
84
  };
71
85
 
86
+ export const Default = {};
87
+
72
88
  export const Display1 = {
73
89
  args: {
74
- type: TYPOGRAPHY.DISPLAY_1,
90
+ type: TYPOGRAPHY['Display 1'],
75
91
  },
76
92
  };
77
93
 
78
94
  export const Headline1 = {
79
95
  args: {
80
- type: TYPOGRAPHY.HEADLINE_1,
96
+ type: TYPOGRAPHY['Headline 1'],
81
97
  },
82
98
  };
83
99
 
84
100
  export const Headline2 = {
85
101
  args: {
86
- type: TYPOGRAPHY.HEADLINE_2,
102
+ type: TYPOGRAPHY['Headline 2'],
87
103
  },
88
104
  };
89
105
 
90
106
  export const Headline3 = {
91
107
  args: {
92
- type: TYPOGRAPHY.HEADLINE_1,
108
+ type: TYPOGRAPHY['Headline 1'],
93
109
  },
94
110
  };
95
111
 
96
112
  export const Title1 = {
97
113
  args: {
98
- type: TYPOGRAPHY.TITLE_1,
114
+ type: TYPOGRAPHY['Title 1'],
99
115
  },
100
116
  };
101
117
 
102
118
  export const Title2 = {
103
119
  args: {
104
- type: TYPOGRAPHY.TITLE_1,
120
+ type: TYPOGRAPHY['Title 1'],
105
121
  },
106
122
  };
107
123
 
108
124
  export const Body1 = {
109
125
  args: {
110
- type: TYPOGRAPHY.BODY_1,
126
+ type: TYPOGRAPHY['Body 1'],
111
127
  },
112
128
  };
113
129
 
114
130
  export const Body2 = {
115
131
  args: {
116
- type: TYPOGRAPHY.BODY_1,
132
+ type: TYPOGRAPHY['Body 1'],
117
133
  },
118
134
  };
119
135
 
120
136
  export const Label1 = {
121
137
  args: {
122
- type: TYPOGRAPHY.LABEL_1,
138
+ type: TYPOGRAPHY['Label 1'],
123
139
  },
124
140
  };
125
141
 
126
142
  export const Label1Semibold = {
127
143
  args: {
128
- type: TYPOGRAPHY.LABEL_1_SEMIBOLD,
144
+ type: TYPOGRAPHY['Label 1 Semibold'],
129
145
  },
130
146
  };
131
147
 
132
148
  export const Label2 = {
133
149
  args: {
134
- type: TYPOGRAPHY.LABEL_2,
150
+ type: TYPOGRAPHY['Label 2'],
135
151
  },
136
152
  };
137
153
 
138
154
  export const Label2Semibold = {
139
155
  args: {
140
- type: TYPOGRAPHY.LABEL_2_SEMIBOLD,
156
+ type: TYPOGRAPHY['Label 2 Semibold'],
141
157
  },
142
158
  };
143
159
 
144
160
  export const Label3 = {
145
161
  args: {
146
- type: TYPOGRAPHY.LABEL_3,
162
+ type: TYPOGRAPHY['Label 3'],
147
163
  },
148
164
  };
149
165
 
150
166
  export const Link1 = {
151
167
  args: {
152
- type: TYPOGRAPHY.LINK_1,
168
+ type: TYPOGRAPHY['Link 1'],
153
169
  },
154
170
  };
155
171
 
156
172
  export const Link2 = {
157
173
  args: {
158
- type: TYPOGRAPHY.LINK_2,
174
+ type: TYPOGRAPHY['Link 2'],
159
175
  },
160
176
  };
161
177
 
162
178
  export const Link3 = {
163
179
  args: {
164
- type: TYPOGRAPHY.LINK_3,
180
+ type: TYPOGRAPHY['Link 3'],
165
181
  },
166
182
  };
167
183
 
168
184
  export const Button1 = {
169
185
  args: {
170
- type: TYPOGRAPHY.BUTTON_1,
186
+ type: TYPOGRAPHY['Button 1'],
171
187
  },
172
188
  };
@@ -0,0 +1,38 @@
1
+ import TideImage from '@/components/TideImage.vue';
2
+ import { argTypeBooleanUnrequired, parameters } from '@/utilities/storybook';
3
+
4
+ export default {
5
+ argTypes: {
6
+ alt: {
7
+ control: 'text',
8
+ description: `Text display when image can't be loaded.`,
9
+ table: {
10
+ defaultValue: { summary: 'None' },
11
+ type: { summary: 'string' },
12
+ },
13
+ },
14
+ isLazy: {
15
+ ...argTypeBooleanUnrequired,
16
+ description: `Determines whether to delay loading until image is in viewport.`,
17
+ },
18
+ src: {
19
+ control: 'text',
20
+ description: `Image URL.`,
21
+ table: {
22
+ defaultValue: { summary: 'None' },
23
+ type: { summary: 'string' },
24
+ },
25
+ },
26
+ },
27
+ args: {
28
+ alt: '',
29
+ isLazy: undefined,
30
+ src: '',
31
+ },
32
+ component: TideImage,
33
+ parameters,
34
+ tags: ['autodocs'],
35
+ title: 'Basic Components/TideImage',
36
+ };
37
+
38
+ export const Demo = {};
@@ -7,6 +7,11 @@ export const NoneAsEmpty = { None: '' };
7
7
  export const NoneAsUndefined = { None: undefined };
8
8
 
9
9
  // These objects are intended exclusively for use in demonstrating the Storybook UI.
10
+ export const BOOLEAN = {
11
+ True: true,
12
+ False: false,
13
+ };
14
+
10
15
  export const BOOLEAN_UNREQUIRED = {
11
16
  None: undefined,
12
17
  True: true,
@@ -94,6 +99,38 @@ export const GAP = {
94
99
  '0.25 REM': CSS.GAP.QUARTER,
95
100
  };
96
101
 
102
+ export const GRID_END = {
103
+ 'Column 1': CSS.GRID.END.ONE,
104
+ 'Column 2': CSS.GRID.END.TWO,
105
+ 'Column 3': CSS.GRID.END.THREE,
106
+ 'Column 4': CSS.GRID.END.FOUR,
107
+ 'Column 5': CSS.GRID.END.FIVE,
108
+ 'Column 6': CSS.GRID.END.SIX,
109
+ 'Column 7': CSS.GRID.END.SEVEN,
110
+ 'Column 8': CSS.GRID.END.EIGHT,
111
+ 'Column 9': CSS.GRID.END.NINE,
112
+ 'Column 10': CSS.GRID.END.TEN,
113
+ 'Column 11': CSS.GRID.END.ELEVEN,
114
+ 'Column 12': CSS.GRID.END.TWELVE,
115
+ 'Column 13': CSS.GRID.END.THIRTEEN,
116
+ };
117
+
118
+ export const GRID_START = {
119
+ 'Column 0': CSS.GRID.START.ZERO,
120
+ 'Column 1': CSS.GRID.START.ONE,
121
+ 'Column 2': CSS.GRID.START.TWO,
122
+ 'Column 3': CSS.GRID.START.THREE,
123
+ 'Column 4': CSS.GRID.START.FOUR,
124
+ 'Column 5': CSS.GRID.START.FIVE,
125
+ 'Column 6': CSS.GRID.START.SIX,
126
+ 'Column 7': CSS.GRID.START.SEVEN,
127
+ 'Column 8': CSS.GRID.START.EIGHT,
128
+ 'Column 9': CSS.GRID.START.NINE,
129
+ 'Column 10': CSS.GRID.START.TEN,
130
+ 'Column 11': CSS.GRID.START.ELEVEN,
131
+ 'Column 12': CSS.GRID.START.TWELVE,
132
+ };
133
+
97
134
  export const LINK_SIZE = {
98
135
  TWELVE: CSS.FONT.SIZE.TWELVE,
99
136
  FOURTEEN: CSS.FONT.SIZE.FOURTEEN,
@@ -197,23 +234,21 @@ export const SHADOW = {
197
234
  };
198
235
 
199
236
  export const TYPOGRAPHY = {
200
- DISPLAY_1: [CSS.FONT.SIZE.THIRTY_TWO, CSS.FONT.WEIGHT.SEVEN_HUNDRED],
201
- HEADLINE_1: [CSS.FONT.SIZE.TWENTY_FOUR, CSS.FONT.WEIGHT.SEVEN_HUNDRED],
202
- HEADLINE_2: [CSS.FONT.SIZE.TWENTY, CSS.FONT.WEIGHT.SEVEN_HUNDRED],
203
- HEADLINE_3: [CSS.FONT.SIZE.SIXTEEN, CSS.FONT.WEIGHT.SEVEN_HUNDRED],
204
- TITLE_1: [CSS.FONT.SIZE.TWENTY, CSS.FONT.WEIGHT.SIX_HUNDRED],
205
- TITLE_2: [CSS.FONT.SIZE.SIXTEEN, CSS.FONT.WEIGHT.SIX_HUNDRED],
206
- BODY_1: [CSS.FONT.SIZE.SIXTEEN, CSS.FONT.WEIGHT.FOUR_HUNDRED],
207
- BODY_2: [CSS.FONT.SIZE.FOURTEEN, CSS.FONT.WEIGHT.FOUR_HUNDRED],
208
- LABEL_1: [CSS.FONT.SIZE.SIXTEEN, CSS.FONT.WEIGHT.FIVE_HUNDRED],
209
- LABEL_1_SEMIBOLD: [CSS.FONT.SIZE.SIXTEEN, CSS.FONT.WEIGHT.SIX_HUNDRED],
210
- LABEL_2: [CSS.FONT.SIZE.FOURTEEN, CSS.FONT.WEIGHT.FIVE_HUNDRED],
211
- LABEL_2_SEMIBOLD: [CSS.FONT.SIZE.FOURTEEN, CSS.FONT.WEIGHT.SIX_HUNDRED],
212
- LABEL_3: [CSS.FONT.SIZE.TWELVE, CSS.FONT.WEIGHT.FIVE_HUNDRED],
213
- LINK_1: [CSS.FONT.SIZE.SIXTEEN, CSS.FONT.WEIGHT.SEVEN_HUNDRED],
214
- LINK_2: [CSS.FONT.SIZE.FOURTEEN, CSS.FONT.WEIGHT.SEVEN_HUNDRED],
215
- LINK_3: [CSS.FONT.SIZE.TWELVE, CSS.FONT.WEIGHT.SEVEN_HUNDRED],
216
- BUTTON_1: [CSS.FONT.SIZE.SIXTEEN, CSS.FONT.WEIGHT.SIX_HUNDRED],
217
- };
218
-
219
- export type Typography = (typeof TYPOGRAPHY)[keyof typeof TYPOGRAPHY];
237
+ 'Display 1': CSS.FONT.ROLE.DISPLAY_1,
238
+ 'Headline 1': CSS.FONT.ROLE.HEADLINE_1,
239
+ 'Headline 2': CSS.FONT.ROLE.HEADLINE_2,
240
+ 'Headline 3': CSS.FONT.ROLE.HEADLINE_3,
241
+ 'Title 1': CSS.FONT.ROLE.TITLE_1,
242
+ 'Title 2': CSS.FONT.ROLE.TITLE_2,
243
+ 'Body 1': CSS.FONT.ROLE.BODY_1,
244
+ 'Body 2': CSS.FONT.ROLE.BODY_2,
245
+ 'Label 1': CSS.FONT.ROLE.LABEL_1,
246
+ 'Label 1 Semibold': CSS.FONT.ROLE.LABEL_1_SEMIBOLD,
247
+ 'Label 2': CSS.FONT.ROLE.LABEL_2,
248
+ 'Label 2 Semibold': CSS.FONT.ROLE.LABEL_2_SEMIBOLD,
249
+ 'Label 3': CSS.FONT.ROLE.LABEL_3,
250
+ 'Link 1': CSS.FONT.ROLE.LINK_1,
251
+ 'Link 2': CSS.FONT.ROLE.LINK_2,
252
+ 'Link 3': CSS.FONT.ROLE.LINK_3,
253
+ 'Button 1': CSS.FONT.ROLE.BUTTON_1,
254
+ };
@@ -166,6 +166,26 @@ export const CSS = {
166
166
  VARIANT_INVERSE: 'tide-font-on-surface-variant-inverse',
167
167
  },
168
168
  },
169
+ ROLE: {
170
+ DISPLAY_1: 'tide-typography-display-1',
171
+ HEADLINE_1: 'tide-typography-headline-1',
172
+ HEADLINE_2: 'tide-typography-headline-2',
173
+ HEADLINE_3: 'tide-typography-headline-3',
174
+ TITLE_1: 'tide-typography-title-1',
175
+ TITLE_2: 'tide-typography-title-2',
176
+ BODY_1: 'tide-typography-body-1',
177
+ BODY_2: 'tide-typography-body-2',
178
+ LABEL_1: 'tide-typography-label-1',
179
+ LABEL_1_SEMIBOLD: 'tide-typography-label-1-semibold',
180
+ LABEL_2: 'tide-typography-label-2',
181
+ LABEL_2_SEMIBOLD: 'tide-typography-label-2-semibold',
182
+ LABEL_3: 'tide-typography-label-3',
183
+ LINK_1: 'tide-typography-link-1',
184
+ LINK_2: 'tide-typography-link-2',
185
+ LINK_3: 'tide-typography-link-3',
186
+ BUTTON_1: 'tide-typography-button-1',
187
+ BUTTON_2: 'tide-typography-button-2',
188
+ },
169
189
  SIZE: {
170
190
  TWELVE: 'tide-font-12',
171
191
  FOURTEEN: 'tide-font-14',
@@ -206,6 +226,7 @@ export const CSS = {
206
226
  THIRTEEN: 'tide-end-13',
207
227
  },
208
228
  FLUID: 'tide-fluid',
229
+ ITEM: 'tide-grid-item',
209
230
  LAYOUT: 'tide-grid-layout',
210
231
  START: {
211
232
  ZERO: 'tide-start-0',
@@ -387,8 +408,8 @@ export const CSS = {
387
408
  ABSOLUTE: 'tide-position-absolute',
388
409
  FIXED: 'tide-position-fixed',
389
410
  RELATIVE: 'tide-position-relative',
390
- STATIC: 'tide-static',
391
- STICKY: 'tide-sticky',
411
+ STATIC: 'tide-position-static',
412
+ STICKY: 'tide-position-sticky',
392
413
  },
393
414
  POSITIONING: {
394
415
  BOTTOM: 'tide-bottom-0',
@@ -405,7 +426,7 @@ export const CSS = {
405
426
  TOP: 'tide-shadow-top',
406
427
  },
407
428
  SNAP: {
408
- ON: 'tide-snap',
429
+ ON: 'tide-scroll-snap',
409
430
  },
410
431
  SNAP_ALIGN: {
411
432
  START: 'tide-snap-start',
@@ -1,6 +1,6 @@
1
1
  import type { ArgTypes } from '@storybook/vue3';
2
2
 
3
- import { BOOLEAN_UNREQUIRED } from '@/types/Storybook';
3
+ import { BOOLEAN, BOOLEAN_UNREQUIRED } from '@/types/Storybook';
4
4
  import { CSS } from '@/types/Styles';
5
5
  import { ELEMENT, ELEMENT_TEXT_AS_ICON } from '@/types/Element';
6
6
 
@@ -20,6 +20,16 @@ import { NoneAsEmpty, NoneAsUndefined } from '@/types/Storybook';
20
20
  export const lineBreak = '\r';
21
21
  export const tab = ' ';
22
22
 
23
+ export const argTypeBoolean = {
24
+ control: 'select',
25
+ description: 'Determines whether CSS utility is present',
26
+ options: BOOLEAN,
27
+ table: {
28
+ defaultValue: { summary: 'False' },
29
+ type: { summary: 'boolean' },
30
+ },
31
+ };
32
+
23
33
  export const argTypeBooleanUnrequired = {
24
34
  control: 'select',
25
35
  description: 'True, False, or undefined<br />(for demonstration purposes)',