tide-design-system 2.4.0 → 2.4.1
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/style.css +1 -1
- package/dist/tide-design-system.cjs +2 -2
- package/dist/tide-design-system.esm.d.ts +2 -2
- package/dist/tide-design-system.esm.js +3 -3
- package/package.json +1 -1
- package/src/components/TideCard.vue +1 -1
- package/src/components/TideImage.vue +1 -1
- package/src/stories/FoundationsBorder.stories.ts +25 -13
package/package.json
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as STYLES from '@/types/Storybook';
|
|
2
|
-
import {
|
|
2
|
+
import { CSS } from '@/types/Styles';
|
|
3
|
+
import { flatten, formatArgType, getConstantsByValues, prependNoneAsEmpty } from '@/utilities/storybook';
|
|
3
4
|
|
|
4
5
|
import type { StoryContext } from '@storybook/vue3';
|
|
5
6
|
|
|
7
|
+
const BORDER_COLOR = prependNoneAsEmpty(flatten(CSS.BORDER.COLOR));
|
|
6
8
|
const BORDER_RADIUS = prependNoneAsEmpty(STYLES.BORDER_RADIUS);
|
|
7
9
|
const BORDER_SIDE = prependNoneAsEmpty(STYLES.BORDER_SIDE);
|
|
8
10
|
const BORDER_STYLE = prependNoneAsEmpty(STYLES.BORDER_STYLE);
|
|
@@ -16,18 +18,21 @@ const formatArgs = (args: any) => {
|
|
|
16
18
|
|
|
17
19
|
const formatClassNames = (args: any) => {
|
|
18
20
|
const classNames: string[] = [];
|
|
21
|
+
const hasBorder = args.borderSide || args.borderWidth;
|
|
19
22
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
// Any selection for any property should also add a side and width or nothing will be visible.
|
|
24
|
+
if (hasBorder) {
|
|
25
|
+
const side = args.borderSide || BORDER_SIDE.Full;
|
|
26
|
+
const width = args.borderWidth || BORDER_WIDTH['1px'];
|
|
23
27
|
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
classNames.push(`${side}-${width}`);
|
|
29
|
+
} else if (args.borderStyle || args.borderColor || args.borderRadius) {
|
|
30
|
+
classNames.push(CSS.BORDER.FULL.ONE);
|
|
26
31
|
}
|
|
27
32
|
|
|
28
|
-
if (args.
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
if (args.borderStyle) classNames.push(args.borderStyle);
|
|
34
|
+
if (args.borderColor) classNames.push(args.borderColor);
|
|
35
|
+
if (args.borderRadius) classNames.push(args.borderRadius);
|
|
31
36
|
|
|
32
37
|
return classNames;
|
|
33
38
|
};
|
|
@@ -67,22 +72,28 @@ const render = (args: any) => ({
|
|
|
67
72
|
|
|
68
73
|
export default {
|
|
69
74
|
argTypes: {
|
|
75
|
+
borderColor: {
|
|
76
|
+
...formatArgType({ BORDER_COLOR }),
|
|
77
|
+
description: 'Applies a border color',
|
|
78
|
+
name: 'Border Color',
|
|
79
|
+
table: {
|
|
80
|
+
defaultValue: { summary: 'None' },
|
|
81
|
+
type: { summary: 'CSS.BORDER.COLOR' },
|
|
82
|
+
},
|
|
83
|
+
},
|
|
70
84
|
borderRadius: {
|
|
71
85
|
...formatArgType({ BORDER_RADIUS }),
|
|
72
86
|
description: 'Dictates severity of rounded corners',
|
|
73
|
-
if: { arg: 'borderSide', eq: BORDER_SIDE.Full },
|
|
74
87
|
name: 'Border Radius',
|
|
75
88
|
},
|
|
76
89
|
borderSide: {
|
|
77
90
|
...formatArgType({ BORDER_SIDE }),
|
|
78
91
|
description: 'Dictates to which edge(s) the border applies',
|
|
79
|
-
if: { arg: 'borderWidth', neq: BORDER_WIDTH.None },
|
|
80
92
|
name: 'Border Side',
|
|
81
93
|
},
|
|
82
94
|
borderStyle: {
|
|
83
95
|
...formatArgType({ BORDER_STYLE }),
|
|
84
96
|
description: 'Applies a border style',
|
|
85
|
-
if: { arg: 'borderWidth', neq: BORDER_STYLE.None },
|
|
86
97
|
name: 'Border Style',
|
|
87
98
|
},
|
|
88
99
|
borderWidth: {
|
|
@@ -92,6 +103,7 @@ export default {
|
|
|
92
103
|
},
|
|
93
104
|
},
|
|
94
105
|
args: {
|
|
106
|
+
borderColor: BORDER_COLOR.None,
|
|
95
107
|
borderRadius: BORDER_RADIUS.None,
|
|
96
108
|
borderSide: BORDER_SIDE.None,
|
|
97
109
|
borderStyle: BORDER_STYLE.None,
|
|
@@ -200,7 +212,7 @@ export const BorderFullDashed2px = {
|
|
|
200
212
|
borderStyle: BORDER_STYLE.Dashed,
|
|
201
213
|
borderWidth: BORDER_WIDTH['2px'],
|
|
202
214
|
},
|
|
203
|
-
name: 'Border Full Dashed
|
|
215
|
+
name: 'Border Full Dashed 2px',
|
|
204
216
|
};
|
|
205
217
|
|
|
206
218
|
export const RadiusQuarter = {
|