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/package.json CHANGED
@@ -61,7 +61,7 @@
61
61
  "main": "dist/tide-design-system.cjs",
62
62
  "module": "dist/tide-design-system.esm.js",
63
63
  "types": "dist/tide-design-system.esm.d.ts",
64
- "version": "2.4.0",
64
+ "version": "2.4.1",
65
65
  "dependencies": {
66
66
  "@floating-ui/vue": "^1.1.6"
67
67
  }
@@ -12,7 +12,7 @@
12
12
  heading: string;
13
13
  icon?: Icon;
14
14
  selected?: boolean;
15
- type: CardType;
15
+ type?: CardType;
16
16
  href?: string;
17
17
  };
18
18
 
@@ -8,7 +8,7 @@
8
8
  import type { Source } from '@/types/Source';
9
9
 
10
10
  type Props = {
11
- alt: string;
11
+ alt?: string;
12
12
  height?: string;
13
13
  isLazy?: boolean;
14
14
  objectFit?: ObjectFit;
@@ -1,8 +1,10 @@
1
1
  import * as STYLES from '@/types/Storybook';
2
- import { formatArgType, getConstantsByValues, prependNoneAsEmpty } from '@/utilities/storybook';
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
- if (args.borderSide === BORDER_SIDE.Full && args.borderWidth && args.borderRadius) {
21
- classNames.push(args.borderRadius);
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
- if (args.borderSide && args.borderWidth) {
25
- classNames.push(`${args.borderSide}-${args.borderWidth}`);
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.borderSide && args.borderWidth && args.borderStyle) {
29
- classNames.push(args.borderStyle);
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 1px',
215
+ name: 'Border Full Dashed 2px',
204
216
  };
205
217
 
206
218
  export const RadiusQuarter = {