tide-design-system 2.0.33 → 2.0.35
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 -1
- package/.storybook/preview.ts +2 -0
- package/dist/css/grid-layout.css +12 -10
- package/dist/css/reset.css +2 -2
- package/dist/css/utilities.css +277 -72
- package/dist/css/variables.css +9 -14
- package/dist/style.css +1 -1
- package/dist/tide-design-system.cjs +2 -2
- package/dist/tide-design-system.esm.d.ts +56 -11
- package/dist/tide-design-system.esm.js +291 -240
- package/dist/utilities/storybook.ts +11 -1
- package/package.json +4 -2
- package/src/assets/css/grid-layout.css +12 -10
- package/src/assets/css/reset.css +2 -2
- package/src/assets/css/utilities.css +277 -72
- package/src/assets/css/variables.css +9 -14
- package/src/components/TideImage.vue +2 -6
- package/src/stories/FoundationsGrid.stories.ts +309 -0
- package/src/stories/FoundationsTypography.stories.ts +39 -23
- package/src/stories/TideImage.stories.ts +38 -0
- package/src/types/Storybook.ts +55 -20
- package/src/types/Styles.ts +70 -3
- package/src/utilities/storybook.ts +11 -1
- /package/dist/css/realm/{equip.css → equipment.css} +0 -0
- /package/src/assets/css/realm/{equip.css → equipment.css} +0 -0
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
/*.CSS Variables */
|
|
2
2
|
:root {
|
|
3
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-
|
|
9
|
-
--tide-font-
|
|
10
|
-
--tide-font-
|
|
11
|
-
--tide-font-
|
|
12
|
-
|
|
13
|
-
/* Font Weight */
|
|
14
|
-
--tide-font-400: 400;
|
|
15
|
-
--tide-font-500: 500;
|
|
16
|
-
--tide-font-600: 600;
|
|
17
|
-
--tide-font-700: 700;
|
|
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;
|
|
18
13
|
|
|
19
14
|
/* Animation */
|
|
20
15
|
--tide-animate: 300ms ease-in-out;
|
|
@@ -5,23 +5,19 @@
|
|
|
5
5
|
|
|
6
6
|
type Props = {
|
|
7
7
|
alt?: string;
|
|
8
|
-
cdn?: string;
|
|
9
8
|
isLazy?: boolean;
|
|
10
|
-
offset?: number;
|
|
11
9
|
src?: string;
|
|
12
10
|
};
|
|
13
11
|
|
|
14
12
|
const props = withDefaults(defineProps<Props>(), {
|
|
15
13
|
alt: '',
|
|
16
|
-
cdn: undefined,
|
|
17
14
|
isLazy: true,
|
|
18
|
-
offset: 0,
|
|
19
15
|
src: undefined,
|
|
20
16
|
});
|
|
21
17
|
|
|
22
18
|
const tideImage = ref();
|
|
23
19
|
|
|
24
|
-
const imageDefault =
|
|
20
|
+
const imageDefault = 'https://cdn-static-rec.tilabs.io/image-coming-soon-512.png';
|
|
25
21
|
|
|
26
22
|
const setImageFromDefault = () => {
|
|
27
23
|
tideImage.value.src = imageDefault;
|
|
@@ -34,7 +30,7 @@
|
|
|
34
30
|
<img
|
|
35
31
|
:alt="alt"
|
|
36
32
|
:class="['tide-image', CSS.OBJECT.CENTER, CSS.OBJECT.COVER]"
|
|
37
|
-
:loading="isLazy ? 'lazy' : 'eager'"
|
|
33
|
+
:loading="props.isLazy ? 'lazy' : 'eager'"
|
|
38
34
|
ref="tideImage"
|
|
39
35
|
:src="src ?? imageDefault"
|
|
40
36
|
@error="setImageFromDefault"
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import type { StoryContext } from '@storybook/vue3';
|
|
2
|
+
|
|
3
|
+
import * as STYLES from '@/types/Storybook';
|
|
4
|
+
import { CSS } from '@/types/Styles';
|
|
5
|
+
import {
|
|
6
|
+
argTypeBoolean,
|
|
7
|
+
formatArgType,
|
|
8
|
+
getConstantsByValues,
|
|
9
|
+
lineBreak,
|
|
10
|
+
prependNoneAsEmpty,
|
|
11
|
+
tab,
|
|
12
|
+
} from '@/utilities/storybook';
|
|
13
|
+
|
|
14
|
+
const GRID_END = prependNoneAsEmpty(STYLES.GRID_END);
|
|
15
|
+
const GRID_START = prependNoneAsEmpty(STYLES.GRID_START);
|
|
16
|
+
|
|
17
|
+
const formatArgs = (args: any) => {
|
|
18
|
+
args.class = formatClassNames(args).join(' ');
|
|
19
|
+
|
|
20
|
+
return { args };
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const formatClassNames = (args: any) => {
|
|
24
|
+
const classNames: string[] = [];
|
|
25
|
+
|
|
26
|
+
if (args.fluid) classNames.push(CSS.GRID.FLUID);
|
|
27
|
+
if (args.item) classNames.push(CSS.GRID.ITEM);
|
|
28
|
+
if (args.start) classNames.push(args.start);
|
|
29
|
+
if (args.end) classNames.push(args.end);
|
|
30
|
+
|
|
31
|
+
return classNames;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const formatClassNamesSnippet = (args: any) => {
|
|
35
|
+
const classNames = formatClassNames(args);
|
|
36
|
+
|
|
37
|
+
return getConstantsByValues(classNames);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const formatClassNamesParentSnippet = (args: any) => {
|
|
41
|
+
const classNamesParent: string[] = [CSS.GRID.LAYOUT];
|
|
42
|
+
|
|
43
|
+
if (args.xl) classNamesParent.push(CSS.GRID.XL);
|
|
44
|
+
|
|
45
|
+
return getConstantsByValues(classNamesParent);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const formatSnippet = (code: string, context: StoryContext) => {
|
|
49
|
+
const { args } = context;
|
|
50
|
+
const classNames = formatClassNamesSnippet(args);
|
|
51
|
+
const attribute = classNames.length ? ` :class="[${classNames.join(', ')}]"` : '';
|
|
52
|
+
|
|
53
|
+
if (args.item) {
|
|
54
|
+
return (
|
|
55
|
+
`<div :class="[${formatClassNamesParentSnippet(args).join(', ')}]">${lineBreak}` +
|
|
56
|
+
`${tab}<span :class="[CSS.DISPLAY.CONTENTS]">${lineBreak}` +
|
|
57
|
+
`${tab}${tab}<span${attribute}>Demo</span>${lineBreak}` +
|
|
58
|
+
`${tab}</span>${lineBreak}` +
|
|
59
|
+
`</div>`
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
`<div :class="[${formatClassNamesParentSnippet(args).join(', ')}]">${lineBreak}` +
|
|
65
|
+
`${tab}<span${attribute}>Demo</span>${lineBreak}` +
|
|
66
|
+
`</div>`
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const parameters = {
|
|
71
|
+
docs: {
|
|
72
|
+
source: {
|
|
73
|
+
format: false,
|
|
74
|
+
language: 'html',
|
|
75
|
+
transform: formatSnippet,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const render = (args: any) => ({
|
|
81
|
+
setup() {
|
|
82
|
+
return formatArgs(args);
|
|
83
|
+
},
|
|
84
|
+
template: `<div class="tide-grid-layout tide-padding-top-2"><div class="tide-border-1 tide-padding-1 sb-bg-white tide-xy-hidden" v-bind="args">Demo</div></div>`,
|
|
85
|
+
updated() {
|
|
86
|
+
return formatArgs(args);
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
export default {
|
|
91
|
+
argTypes: {
|
|
92
|
+
end: {
|
|
93
|
+
...formatArgType({ GRID_END }),
|
|
94
|
+
description: `Ending column of grid item`,
|
|
95
|
+
if: { arg: 'fluid', neq: true },
|
|
96
|
+
name: 'End',
|
|
97
|
+
},
|
|
98
|
+
fluid: {
|
|
99
|
+
...argTypeBoolean,
|
|
100
|
+
description: `Determines whether grid item should extend to parent bounds`,
|
|
101
|
+
if: { arg: 'item', neq: true },
|
|
102
|
+
name: 'Fluid',
|
|
103
|
+
},
|
|
104
|
+
item: {
|
|
105
|
+
...argTypeBoolean,
|
|
106
|
+
description: `Forces a non-direct descendant to adhere to the grid`,
|
|
107
|
+
if: { arg: 'fluid', neq: true },
|
|
108
|
+
name: 'Item',
|
|
109
|
+
},
|
|
110
|
+
start: {
|
|
111
|
+
...formatArgType({ GRID_START }),
|
|
112
|
+
description: `Starting column of grid item`,
|
|
113
|
+
if: { arg: 'fluid', neq: true },
|
|
114
|
+
name: 'Start',
|
|
115
|
+
},
|
|
116
|
+
xl: {
|
|
117
|
+
...argTypeBoolean,
|
|
118
|
+
description: `Increases the maximum content width`,
|
|
119
|
+
name: 'XL',
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
args: {
|
|
123
|
+
end: GRID_END.None,
|
|
124
|
+
fluid: false,
|
|
125
|
+
item: false,
|
|
126
|
+
start: GRID_START.None,
|
|
127
|
+
xl: false,
|
|
128
|
+
},
|
|
129
|
+
parameters,
|
|
130
|
+
render,
|
|
131
|
+
tags: ['autodocs'],
|
|
132
|
+
title: 'Foundations/Grid',
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export const Default = {};
|
|
136
|
+
|
|
137
|
+
export const Fluid = {
|
|
138
|
+
args: {
|
|
139
|
+
fluid: true,
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export const Item = {
|
|
144
|
+
args: {
|
|
145
|
+
item: true,
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
export const XL = {
|
|
150
|
+
args: {
|
|
151
|
+
xl: true,
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
export const Start0 = {
|
|
156
|
+
args: {
|
|
157
|
+
start: GRID_START['Column 0'],
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export const Start1 = {
|
|
162
|
+
args: {
|
|
163
|
+
start: GRID_START['Column 1'],
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
export const Start2 = {
|
|
168
|
+
args: {
|
|
169
|
+
start: GRID_START['Column 2'],
|
|
170
|
+
},
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export const Start3 = {
|
|
174
|
+
args: {
|
|
175
|
+
start: GRID_START['Column 3'],
|
|
176
|
+
},
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
export const Start4 = {
|
|
180
|
+
args: {
|
|
181
|
+
start: GRID_START['Column 4'],
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
export const Start5 = {
|
|
186
|
+
args: {
|
|
187
|
+
start: GRID_START['Column 5'],
|
|
188
|
+
},
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
export const Start6 = {
|
|
192
|
+
args: {
|
|
193
|
+
start: GRID_START['Column 6'],
|
|
194
|
+
},
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
export const Start7 = {
|
|
198
|
+
args: {
|
|
199
|
+
start: GRID_START['Column 7'],
|
|
200
|
+
},
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
export const Start8 = {
|
|
204
|
+
args: {
|
|
205
|
+
start: GRID_START['Column 8'],
|
|
206
|
+
},
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
export const Start9 = {
|
|
210
|
+
args: {
|
|
211
|
+
start: GRID_START['Column 9'],
|
|
212
|
+
},
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
export const Start10 = {
|
|
216
|
+
args: {
|
|
217
|
+
start: GRID_START['Column 10'],
|
|
218
|
+
},
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
export const Start11 = {
|
|
222
|
+
args: {
|
|
223
|
+
start: GRID_START['Column 11'],
|
|
224
|
+
},
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
export const Start12 = {
|
|
228
|
+
args: {
|
|
229
|
+
start: GRID_START['Column 12'],
|
|
230
|
+
},
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
export const End1 = {
|
|
234
|
+
args: {
|
|
235
|
+
end: GRID_END['Column 1'],
|
|
236
|
+
},
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
export const End2 = {
|
|
240
|
+
args: {
|
|
241
|
+
end: GRID_END['Column 2'],
|
|
242
|
+
},
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
export const End3 = {
|
|
246
|
+
args: {
|
|
247
|
+
end: GRID_END['Column 3'],
|
|
248
|
+
},
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
export const End4 = {
|
|
252
|
+
args: {
|
|
253
|
+
end: GRID_END['Column 4'],
|
|
254
|
+
},
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
export const End5 = {
|
|
258
|
+
args: {
|
|
259
|
+
end: GRID_END['Column 5'],
|
|
260
|
+
},
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
export const End6 = {
|
|
264
|
+
args: {
|
|
265
|
+
end: GRID_END['Column 6'],
|
|
266
|
+
},
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
export const End7 = {
|
|
270
|
+
args: {
|
|
271
|
+
end: GRID_END['Column 7'],
|
|
272
|
+
},
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
export const End8 = {
|
|
276
|
+
args: {
|
|
277
|
+
end: GRID_END['Column 8'],
|
|
278
|
+
},
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
export const End9 = {
|
|
282
|
+
args: {
|
|
283
|
+
end: GRID_END['Column 9'],
|
|
284
|
+
},
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
export const End10 = {
|
|
288
|
+
args: {
|
|
289
|
+
end: GRID_END['Column 10'],
|
|
290
|
+
},
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
export const End11 = {
|
|
294
|
+
args: {
|
|
295
|
+
end: GRID_END['Column 11'],
|
|
296
|
+
},
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
export const End12 = {
|
|
300
|
+
args: {
|
|
301
|
+
end: GRID_END['Column 12'],
|
|
302
|
+
},
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
export const End13 = {
|
|
306
|
+
args: {
|
|
307
|
+
end: GRID_END['Column 13'],
|
|
308
|
+
},
|
|
309
|
+
};
|
|
@@ -1,23 +1,33 @@
|
|
|
1
1
|
import type { StoryContext } from '@storybook/vue3';
|
|
2
2
|
|
|
3
|
-
import
|
|
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.
|
|
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[] =
|
|
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 =
|
|
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.
|
|
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
|
|
90
|
+
type: TYPOGRAPHY['Display 1'],
|
|
75
91
|
},
|
|
76
92
|
};
|
|
77
93
|
|
|
78
94
|
export const Headline1 = {
|
|
79
95
|
args: {
|
|
80
|
-
type: TYPOGRAPHY
|
|
96
|
+
type: TYPOGRAPHY['Headline 1'],
|
|
81
97
|
},
|
|
82
98
|
};
|
|
83
99
|
|
|
84
100
|
export const Headline2 = {
|
|
85
101
|
args: {
|
|
86
|
-
type: TYPOGRAPHY
|
|
102
|
+
type: TYPOGRAPHY['Headline 2'],
|
|
87
103
|
},
|
|
88
104
|
};
|
|
89
105
|
|
|
90
106
|
export const Headline3 = {
|
|
91
107
|
args: {
|
|
92
|
-
type: TYPOGRAPHY
|
|
108
|
+
type: TYPOGRAPHY['Headline 1'],
|
|
93
109
|
},
|
|
94
110
|
};
|
|
95
111
|
|
|
96
112
|
export const Title1 = {
|
|
97
113
|
args: {
|
|
98
|
-
type: TYPOGRAPHY
|
|
114
|
+
type: TYPOGRAPHY['Title 1'],
|
|
99
115
|
},
|
|
100
116
|
};
|
|
101
117
|
|
|
102
118
|
export const Title2 = {
|
|
103
119
|
args: {
|
|
104
|
-
type: TYPOGRAPHY
|
|
120
|
+
type: TYPOGRAPHY['Title 1'],
|
|
105
121
|
},
|
|
106
122
|
};
|
|
107
123
|
|
|
108
124
|
export const Body1 = {
|
|
109
125
|
args: {
|
|
110
|
-
type: TYPOGRAPHY
|
|
126
|
+
type: TYPOGRAPHY['Body 1'],
|
|
111
127
|
},
|
|
112
128
|
};
|
|
113
129
|
|
|
114
130
|
export const Body2 = {
|
|
115
131
|
args: {
|
|
116
|
-
type: TYPOGRAPHY
|
|
132
|
+
type: TYPOGRAPHY['Body 1'],
|
|
117
133
|
},
|
|
118
134
|
};
|
|
119
135
|
|
|
120
136
|
export const Label1 = {
|
|
121
137
|
args: {
|
|
122
|
-
type: TYPOGRAPHY
|
|
138
|
+
type: TYPOGRAPHY['Label 1'],
|
|
123
139
|
},
|
|
124
140
|
};
|
|
125
141
|
|
|
126
142
|
export const Label1Semibold = {
|
|
127
143
|
args: {
|
|
128
|
-
type: TYPOGRAPHY
|
|
144
|
+
type: TYPOGRAPHY['Label 1 Semibold'],
|
|
129
145
|
},
|
|
130
146
|
};
|
|
131
147
|
|
|
132
148
|
export const Label2 = {
|
|
133
149
|
args: {
|
|
134
|
-
type: TYPOGRAPHY
|
|
150
|
+
type: TYPOGRAPHY['Label 2'],
|
|
135
151
|
},
|
|
136
152
|
};
|
|
137
153
|
|
|
138
154
|
export const Label2Semibold = {
|
|
139
155
|
args: {
|
|
140
|
-
type: TYPOGRAPHY
|
|
156
|
+
type: TYPOGRAPHY['Label 2 Semibold'],
|
|
141
157
|
},
|
|
142
158
|
};
|
|
143
159
|
|
|
144
160
|
export const Label3 = {
|
|
145
161
|
args: {
|
|
146
|
-
type: TYPOGRAPHY
|
|
162
|
+
type: TYPOGRAPHY['Label 3'],
|
|
147
163
|
},
|
|
148
164
|
};
|
|
149
165
|
|
|
150
166
|
export const Link1 = {
|
|
151
167
|
args: {
|
|
152
|
-
type: TYPOGRAPHY
|
|
168
|
+
type: TYPOGRAPHY['Link 1'],
|
|
153
169
|
},
|
|
154
170
|
};
|
|
155
171
|
|
|
156
172
|
export const Link2 = {
|
|
157
173
|
args: {
|
|
158
|
-
type: TYPOGRAPHY
|
|
174
|
+
type: TYPOGRAPHY['Link 2'],
|
|
159
175
|
},
|
|
160
176
|
};
|
|
161
177
|
|
|
162
178
|
export const Link3 = {
|
|
163
179
|
args: {
|
|
164
|
-
type: TYPOGRAPHY
|
|
180
|
+
type: TYPOGRAPHY['Link 3'],
|
|
165
181
|
},
|
|
166
182
|
};
|
|
167
183
|
|
|
168
184
|
export const Button1 = {
|
|
169
185
|
args: {
|
|
170
|
-
type: TYPOGRAPHY
|
|
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 = {};
|
package/src/types/Storybook.ts
CHANGED
|
@@ -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
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
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
|
+
};
|