tide-design-system 2.0.38 → 2.0.40
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/dist/css/main.css +1 -0
- package/dist/css/storybook.css +9 -1
- package/dist/style.css +1 -1
- package/dist/tide-design-system.cjs +2 -2
- package/dist/tide-design-system.esm.d.ts +6 -0
- package/dist/tide-design-system.esm.js +8 -2
- package/package.json +1 -1
- package/src/assets/css/main.css +1 -0
- package/src/assets/css/storybook.css +9 -1
- package/src/components/TideImage.vue +1 -1
- package/src/stories/FoundationsTransparency.stories.ts +114 -0
- package/src/types/Storybook.ts +18 -0
- package/src/types/Styles.ts +6 -0
package/package.json
CHANGED
package/src/assets/css/main.css
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
/* Styles used for Storybook demonstration purposes only. Not bundled into distribution package. */
|
|
2
2
|
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');
|
|
3
3
|
|
|
4
|
+
.sb-border-black {border: 1px solid #000000;}
|
|
4
5
|
.sb-border-blue-light {border: 1px solid #CCDEF3;}
|
|
6
|
+
.sb-border-white {border: 1px solid #FFFFFF;}
|
|
5
7
|
|
|
8
|
+
.sb-bg-black {background-color: #000000;}
|
|
9
|
+
.sb-bg-blue {background-color: #0000FF;}
|
|
6
10
|
.sb-bg-blue-light {background-color: #CCDEF3;}
|
|
7
|
-
.sb-bg-
|
|
11
|
+
.sb-bg-green {background-color: #00FF00;}
|
|
12
|
+
.sb-bg-red {background-color: #FF0000;}
|
|
13
|
+
.sb-bg-white {background-color: #FFFFFF;}
|
|
8
14
|
|
|
15
|
+
.sb-font-black {color: #000000;}
|
|
9
16
|
.sb-font-blue-light {color: #CCDEF3;}
|
|
17
|
+
.sb-font-white {color: #FFFFFF;}
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
|
|
47
47
|
<img
|
|
48
48
|
:alt="alt"
|
|
49
|
-
:class="[CSS.OBJECT.CENTER, CSS.OBJECT.COVER]"
|
|
49
|
+
:class="[CSS.WIDTH.FULL, CSS.HEIGHT.FULL, CSS.OBJECT.CENTER, CSS.OBJECT.COVER]"
|
|
50
50
|
:fetchpriority="isLazy ? undefined : 'high'"
|
|
51
51
|
:loading="props.isLazy ? 'lazy' : 'eager'"
|
|
52
52
|
ref="tideImage"
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { StoryContext } from '@storybook/vue3';
|
|
2
|
+
|
|
3
|
+
import * as STYLES from '@/types/Storybook';
|
|
4
|
+
import { formatArgType, getConstantsByValues, prependNoneAsEmpty } from '@/utilities/storybook';
|
|
5
|
+
|
|
6
|
+
const BG = prependNoneAsEmpty(STYLES.BG);
|
|
7
|
+
const FONT_COLOR = prependNoneAsEmpty(STYLES.FONT_COLOR);
|
|
8
|
+
const TRANSPARENT = prependNoneAsEmpty(STYLES.TRANSPARENT);
|
|
9
|
+
|
|
10
|
+
const formatArgs = (args: any) => {
|
|
11
|
+
args.class = formatClassNames(args).join(' ');
|
|
12
|
+
|
|
13
|
+
return { args };
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const formatClassNames = (args: any) => {
|
|
17
|
+
const classNames: string[] = [];
|
|
18
|
+
|
|
19
|
+
if (args.bg) classNames.push(args.bg);
|
|
20
|
+
if (args.color) classNames.push(args.color);
|
|
21
|
+
if (args.transparent) classNames.push(args.transparent);
|
|
22
|
+
|
|
23
|
+
return classNames;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const formatClassNamesSnippet = (args: any) => {
|
|
27
|
+
const classNames: string[] = [];
|
|
28
|
+
|
|
29
|
+
if (args.transparent) classNames.push(args.transparent);
|
|
30
|
+
|
|
31
|
+
return getConstantsByValues(classNames);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const formatSnippet = (code: string, context: StoryContext) => {
|
|
35
|
+
const { args } = context;
|
|
36
|
+
const classNames = formatClassNamesSnippet(args);
|
|
37
|
+
|
|
38
|
+
return classNames.length ? `<div :class="[${classNames.join(', ')}]">Demo</div>` : '<div>Demo</div>';
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const parameters = {
|
|
42
|
+
docs: {
|
|
43
|
+
source: {
|
|
44
|
+
format: false,
|
|
45
|
+
language: 'html',
|
|
46
|
+
transform: formatSnippet,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const render = (args: any) => ({
|
|
52
|
+
setup() {
|
|
53
|
+
return formatArgs(args);
|
|
54
|
+
},
|
|
55
|
+
template: `<div :class="[args.bg]"><div class="tide-display-inline-block tide-padding-1 tide-width-full tide-height-full" :class="[args.transparent, args.color]">Demo</div></div>`,
|
|
56
|
+
updated() {
|
|
57
|
+
return formatArgs(args);
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
export default {
|
|
62
|
+
argTypes: {
|
|
63
|
+
bg: {
|
|
64
|
+
...formatArgType({ BG }),
|
|
65
|
+
description: `Applies a background color<br />(For demonstration purposes only).`,
|
|
66
|
+
name: 'Background color',
|
|
67
|
+
},
|
|
68
|
+
color: {
|
|
69
|
+
...formatArgType({ FONT_COLOR }),
|
|
70
|
+
description: `Applies a text color<br />(For demonstration purposes only).`,
|
|
71
|
+
name: 'Text color',
|
|
72
|
+
},
|
|
73
|
+
transparent: {
|
|
74
|
+
...formatArgType({ TRANSPARENT }),
|
|
75
|
+
description: `Applies a semi-transparent overlay.`,
|
|
76
|
+
name: 'Transparent',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
args: {
|
|
80
|
+
bg: FONT_COLOR.None,
|
|
81
|
+
color: BG.None,
|
|
82
|
+
transparent: TRANSPARENT.None,
|
|
83
|
+
},
|
|
84
|
+
parameters,
|
|
85
|
+
render,
|
|
86
|
+
tags: ['autodocs'],
|
|
87
|
+
title: 'Foundations/Transparency',
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export const Default = {};
|
|
91
|
+
|
|
92
|
+
export const Transparent100 = {
|
|
93
|
+
args: {
|
|
94
|
+
transparent: TRANSPARENT['100: 90% White'],
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export const Transparent200 = {
|
|
99
|
+
args: {
|
|
100
|
+
transparent: TRANSPARENT['100: 75% White'],
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export const Transparent300 = {
|
|
105
|
+
args: {
|
|
106
|
+
transparent: TRANSPARENT['300: 10% Black'],
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export const Transparent400 = {
|
|
111
|
+
args: {
|
|
112
|
+
transparent: TRANSPARENT['400: 50% Black'],
|
|
113
|
+
},
|
|
114
|
+
};
|
package/src/types/Storybook.ts
CHANGED
|
@@ -24,6 +24,12 @@ export const BADGE_TRUSTED = {
|
|
|
24
24
|
YEARS_15: '15',
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
+
export const BG = {
|
|
28
|
+
Red: 'sb-bg-red',
|
|
29
|
+
Green: 'sb-bg-green',
|
|
30
|
+
Blue: 'sb-bg-blue',
|
|
31
|
+
};
|
|
32
|
+
|
|
27
33
|
export const BORDER_RADIUS = {
|
|
28
34
|
'0.25 REM': CSS.BORDER.RADIUS.QUARTER,
|
|
29
35
|
'0.5 REM': CSS.BORDER.RADIUS.HALF,
|
|
@@ -75,6 +81,11 @@ export const FLEX_DIRECTION = {
|
|
|
75
81
|
Row: CSS.FLEX.DIRECTION.ROW,
|
|
76
82
|
};
|
|
77
83
|
|
|
84
|
+
export const FONT_COLOR = {
|
|
85
|
+
Black: 'sb-font-black',
|
|
86
|
+
White: 'sb-font-white',
|
|
87
|
+
};
|
|
88
|
+
|
|
78
89
|
export const FONT_SIZE = {
|
|
79
90
|
'12px': CSS.FONT.SIZE.TWELVE,
|
|
80
91
|
'14px': CSS.FONT.SIZE.FOURTEEN,
|
|
@@ -233,6 +244,13 @@ export const SHADOW = {
|
|
|
233
244
|
Top: CSS.SHADOW.TOP,
|
|
234
245
|
};
|
|
235
246
|
|
|
247
|
+
export const TRANSPARENT = {
|
|
248
|
+
'100: 90% White': CSS.BG.TRANSPARENT.ONE_HUNDRED,
|
|
249
|
+
'200: 75% White': CSS.BG.TRANSPARENT.TWO_HUNDRED,
|
|
250
|
+
'300: 10% Black': CSS.BG.TRANSPARENT.THREE_HUNDRED,
|
|
251
|
+
'400: 50% Black': CSS.BG.TRANSPARENT.FOUR_HUNDRED,
|
|
252
|
+
};
|
|
253
|
+
|
|
236
254
|
export const TYPOGRAPHY = {
|
|
237
255
|
'Display 1': CSS.FONT.ROLE.DISPLAY_1,
|
|
238
256
|
'Headline 1': CSS.FONT.ROLE.HEADLINE_1,
|
package/src/types/Styles.ts
CHANGED
|
@@ -51,6 +51,12 @@ export const CSS = {
|
|
|
51
51
|
VARIANT: 'tide-bg-surface-variant',
|
|
52
52
|
WARNING: 'tide-bg-surface-warning',
|
|
53
53
|
},
|
|
54
|
+
TRANSPARENT: {
|
|
55
|
+
ONE_HUNDRED: 'tide-transparent-100',
|
|
56
|
+
TWO_HUNDRED: 'tide-transparent-200',
|
|
57
|
+
THREE_HUNDRED: 'tide-transparent-300',
|
|
58
|
+
FOUR_HUNDRED: 'tide-transparent-400',
|
|
59
|
+
},
|
|
54
60
|
WARNING: 'tide-bg-warning',
|
|
55
61
|
},
|
|
56
62
|
BORDER: {
|