orcs-design-system 3.3.2 → 3.3.3
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/es/components/Badge/Badge.stories.js +102 -68
- package/es/components/Badge/index.js +87 -38
- package/package.json +2 -2
|
@@ -12,82 +12,116 @@ export const defaultBadge = () => /*#__PURE__*/_jsx(Badge, {
|
|
|
12
12
|
children: "Default"
|
|
13
13
|
});
|
|
14
14
|
defaultBadge.storyName = "Default";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
15
|
+
|
|
16
|
+
// eslint-disable-next-line react/prop-types
|
|
17
|
+
export const ColourVariants = function () {
|
|
18
|
+
let {
|
|
19
|
+
altStyle = false
|
|
20
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
21
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
22
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
23
|
+
p: "r",
|
|
24
|
+
children: /*#__PURE__*/_jsx(Flex, {
|
|
25
|
+
flexWrap: "wrap",
|
|
26
|
+
children: /*#__PURE__*/_jsxs(Spacer, {
|
|
27
|
+
m: "1",
|
|
28
|
+
children: [/*#__PURE__*/_jsx(Badge, {
|
|
29
|
+
altStyle: altStyle,
|
|
30
|
+
children: "Default"
|
|
31
|
+
}), /*#__PURE__*/_jsx(Badge, {
|
|
32
|
+
altStyle: altStyle,
|
|
33
|
+
variant: "success",
|
|
34
|
+
children: "Success"
|
|
35
|
+
}), /*#__PURE__*/_jsx(Badge, {
|
|
36
|
+
altStyle: altStyle,
|
|
37
|
+
variant: "warning",
|
|
38
|
+
children: "Warning"
|
|
39
|
+
}), /*#__PURE__*/_jsx(Badge, {
|
|
40
|
+
altStyle: altStyle,
|
|
41
|
+
variant: "danger",
|
|
42
|
+
children: "Danger"
|
|
43
|
+
}), /*#__PURE__*/_jsx(Badge, {
|
|
44
|
+
altStyle: altStyle,
|
|
45
|
+
variant: "primaryLight",
|
|
46
|
+
children: "Low priority"
|
|
47
|
+
}), /*#__PURE__*/_jsx(Badge, {
|
|
48
|
+
altStyle: altStyle,
|
|
49
|
+
variant: "primary",
|
|
50
|
+
children: "Medium priority"
|
|
51
|
+
}), /*#__PURE__*/_jsx(Badge, {
|
|
52
|
+
altStyle: altStyle,
|
|
53
|
+
variant: "primaryDark",
|
|
54
|
+
children: "High priority"
|
|
55
|
+
}), /*#__PURE__*/_jsx(Badge, {
|
|
56
|
+
altStyle: altStyle,
|
|
57
|
+
variant: "secondary",
|
|
58
|
+
children: "Secondary"
|
|
59
|
+
})]
|
|
60
|
+
})
|
|
46
61
|
})
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
62
|
+
}), !altStyle && /*#__PURE__*/_jsx(Box, {
|
|
63
|
+
p: "r",
|
|
64
|
+
bg: "greyDarkest",
|
|
65
|
+
children: /*#__PURE__*/_jsx(Flex, {
|
|
66
|
+
flexWrap: "wrap",
|
|
67
|
+
children: /*#__PURE__*/_jsxs(Spacer, {
|
|
68
|
+
m: "1",
|
|
69
|
+
children: [/*#__PURE__*/_jsx(Badge, {
|
|
70
|
+
altStyle: altStyle,
|
|
71
|
+
children: "Default"
|
|
72
|
+
}), /*#__PURE__*/_jsx(Badge, {
|
|
73
|
+
altStyle: altStyle,
|
|
74
|
+
variant: "success",
|
|
75
|
+
children: "Success"
|
|
76
|
+
}), /*#__PURE__*/_jsx(Badge, {
|
|
77
|
+
altStyle: altStyle,
|
|
78
|
+
variant: "warning",
|
|
79
|
+
children: "Warning"
|
|
80
|
+
}), /*#__PURE__*/_jsx(Badge, {
|
|
81
|
+
altStyle: altStyle,
|
|
82
|
+
variant: "danger",
|
|
83
|
+
children: "Danger"
|
|
84
|
+
}), /*#__PURE__*/_jsx(Badge, {
|
|
85
|
+
altStyle: altStyle,
|
|
86
|
+
variant: "primaryLight",
|
|
87
|
+
children: "Low priority"
|
|
88
|
+
}), /*#__PURE__*/_jsx(Badge, {
|
|
89
|
+
altStyle: altStyle,
|
|
90
|
+
variant: "primary",
|
|
91
|
+
children: "Medium priority"
|
|
92
|
+
}), /*#__PURE__*/_jsx(Badge, {
|
|
93
|
+
altStyle: altStyle,
|
|
94
|
+
variant: "primaryDark",
|
|
95
|
+
children: "High priority"
|
|
96
|
+
}), /*#__PURE__*/_jsx(Badge, {
|
|
97
|
+
altStyle: altStyle,
|
|
98
|
+
variant: "secondary",
|
|
99
|
+
children: "Secondary"
|
|
100
|
+
})]
|
|
101
|
+
})
|
|
79
102
|
})
|
|
80
|
-
})
|
|
81
|
-
})
|
|
103
|
+
})]
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
// eslint-disable-next-line react/no-unknown-property
|
|
108
|
+
export const altStyleColourVariants = () => /*#__PURE__*/_jsx(ColourVariants, {
|
|
109
|
+
altStyle: true
|
|
82
110
|
});
|
|
83
|
-
|
|
111
|
+
altStyleColourVariants.storyName = "Alt style colour variants";
|
|
112
|
+
ColourVariants.storyName = "Colour variants";
|
|
84
113
|
defaultBadge.__docgenInfo = {
|
|
85
114
|
"description": "",
|
|
86
115
|
"methods": [],
|
|
87
116
|
"displayName": "defaultBadge"
|
|
88
117
|
};
|
|
89
|
-
|
|
118
|
+
ColourVariants.__docgenInfo = {
|
|
119
|
+
"description": "",
|
|
120
|
+
"methods": [],
|
|
121
|
+
"displayName": "ColourVariants"
|
|
122
|
+
};
|
|
123
|
+
altStyleColourVariants.__docgenInfo = {
|
|
90
124
|
"description": "",
|
|
91
125
|
"methods": [],
|
|
92
|
-
"displayName": "
|
|
126
|
+
"displayName": "altStyleColourVariants"
|
|
93
127
|
};
|
|
@@ -26,53 +26,93 @@ const Item = styled("span").withConfig({
|
|
|
26
26
|
borderRadius: 1,
|
|
27
27
|
color: themeGet("colors.greyDarkest")(props),
|
|
28
28
|
bg: themeGet("colors.greyLighter")(props),
|
|
29
|
-
whiteSpace: props.noWrap ? "nowrap" : "normal"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
29
|
+
whiteSpace: props.noWrap ? "nowrap" : "normal",
|
|
30
|
+
...(props.altStyle ? {
|
|
31
|
+
bg: themeGet("colors.white")(props),
|
|
32
|
+
p: "1px"
|
|
33
|
+
} : {})
|
|
34
|
+
}), props => {
|
|
35
|
+
if (props.altStyle) {
|
|
36
|
+
return variant({
|
|
37
|
+
variants: {
|
|
38
|
+
default: {},
|
|
39
|
+
success: {
|
|
40
|
+
color: themeGet("colors.success")(props)
|
|
41
|
+
},
|
|
42
|
+
successPending: {
|
|
43
|
+
color: themeGet("colors.success")(props)
|
|
44
|
+
},
|
|
45
|
+
warning: {
|
|
46
|
+
color: themeGet("colors.warningDark")(props)
|
|
47
|
+
},
|
|
48
|
+
danger: {
|
|
49
|
+
color: themeGet("colors.danger")(props)
|
|
50
|
+
},
|
|
51
|
+
primaryLight: {
|
|
52
|
+
color: themeGet("colors.primaryLight")(props)
|
|
53
|
+
},
|
|
54
|
+
primary: {
|
|
55
|
+
color: themeGet("colors.primary")(props)
|
|
56
|
+
},
|
|
57
|
+
primaryDark: {
|
|
58
|
+
color: themeGet("colors.primaryDark")(props)
|
|
59
|
+
},
|
|
60
|
+
secondary: {
|
|
61
|
+
color: themeGet("colors.secondary")(props)
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
} else {
|
|
66
|
+
return variant({
|
|
67
|
+
variants: {
|
|
68
|
+
default: {},
|
|
69
|
+
success: {
|
|
70
|
+
color: themeGet("colors.successDarkest")(props),
|
|
71
|
+
bg: themeGet("colors.successLightest")(props)
|
|
72
|
+
},
|
|
73
|
+
successPending: {
|
|
74
|
+
color: themeGet("colors.successDark")(props),
|
|
75
|
+
bg: themeGet("colors.successEvenLighter")(props)
|
|
76
|
+
},
|
|
77
|
+
warning: {
|
|
78
|
+
color: themeGet("colors.warningDarkest")(props),
|
|
79
|
+
bg: themeGet("colors.warningLighter")(props)
|
|
80
|
+
},
|
|
81
|
+
danger: {
|
|
82
|
+
color: themeGet("colors.dangerDarkest")(props),
|
|
83
|
+
bg: themeGet("colors.dangerLightest")(props)
|
|
84
|
+
},
|
|
85
|
+
primaryLight: {
|
|
86
|
+
color: themeGet("colors.primaryDarker")(props),
|
|
87
|
+
bg: themeGet("colors.primaryLightest")(props)
|
|
88
|
+
},
|
|
89
|
+
primary: {
|
|
90
|
+
color: themeGet("colors.primaryDarkest")(props),
|
|
91
|
+
bg: themeGet("colors.primaryLighter")(props)
|
|
92
|
+
},
|
|
93
|
+
primaryDark: {
|
|
94
|
+
color: themeGet("colors.primaryDarkest")(props),
|
|
95
|
+
bg: themeGet("colors.primaryLight")(props)
|
|
96
|
+
},
|
|
97
|
+
secondary: {
|
|
98
|
+
color: themeGet("colors.secondaryDarkest")(props),
|
|
99
|
+
bg: themeGet("colors.secondaryEvenLighter")(props)
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
});
|
|
65
103
|
}
|
|
66
|
-
}
|
|
104
|
+
}, BadgeStyles);
|
|
67
105
|
export default function Badge(_ref) {
|
|
68
106
|
let {
|
|
69
107
|
noWrap,
|
|
70
108
|
children,
|
|
71
109
|
theme,
|
|
110
|
+
altStyle,
|
|
72
111
|
...props
|
|
73
112
|
} = _ref;
|
|
74
113
|
const component = /*#__PURE__*/_jsx(Item, {
|
|
75
114
|
noWrap: noWrap,
|
|
115
|
+
altStyle: altStyle,
|
|
76
116
|
...props,
|
|
77
117
|
children: children
|
|
78
118
|
});
|
|
@@ -89,7 +129,9 @@ Badge.propTypes = {
|
|
|
89
129
|
/** The label text on the badge is passed as a child element. */
|
|
90
130
|
children: PropTypes.node,
|
|
91
131
|
/** Specifies the system theme. */
|
|
92
|
-
theme: PropTypes.object
|
|
132
|
+
theme: PropTypes.object,
|
|
133
|
+
/** Specifies use the alternative style */
|
|
134
|
+
altStyle: PropTypes.bool
|
|
93
135
|
};
|
|
94
136
|
Badge.__docgenInfo = {
|
|
95
137
|
"description": "",
|
|
@@ -145,6 +187,13 @@ Badge.__docgenInfo = {
|
|
|
145
187
|
"name": "object"
|
|
146
188
|
},
|
|
147
189
|
"required": false
|
|
190
|
+
},
|
|
191
|
+
"altStyle": {
|
|
192
|
+
"description": "Specifies use the alternative style",
|
|
193
|
+
"type": {
|
|
194
|
+
"name": "bool"
|
|
195
|
+
},
|
|
196
|
+
"required": false
|
|
148
197
|
}
|
|
149
198
|
}
|
|
150
199
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "orcs-design-system",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.3",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": "20.12.2"
|
|
6
6
|
},
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"module": "BABEL_ENV=es babel lib -d es",
|
|
37
37
|
"deploy-stack": "serverless deploy",
|
|
38
38
|
"deploy-client": "serverless client deploy --no-confirm",
|
|
39
|
-
"storybook": "storybook dev",
|
|
39
|
+
"storybook": "storybook dev -p 1337",
|
|
40
40
|
"build-storybook": "storybook build -o .build_storybook",
|
|
41
41
|
"deploy-storybook": "storybook-to-ghpages",
|
|
42
42
|
"playroom": "playroom start",
|