@telus-uds/theme-allium 0.0.2-prerelease.2 → 0.0.2-prerelease.6
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/CHANGELOG.md +62 -0
- package/build/theme.js +2841 -0
- package/package.json +12 -9
- package/src/components/ActivityIndicator.js +6 -8
- package/src/components/Box.js +11 -22
- package/src/components/Button.js +77 -115
- package/src/components/ButtonGroup.js +8 -17
- package/src/components/ButtonGroupItem.js +98 -0
- package/src/components/Card.js +42 -43
- package/src/components/Checkbox.js +59 -0
- package/src/components/CheckboxGroup.js +8 -0
- package/src/components/ChevronLink.js +12 -0
- package/src/components/Divider.js +5 -7
- package/src/components/ExpandCollapse.js +4 -13
- package/src/components/ExpandCollapseControl.js +17 -37
- package/src/components/ExpandCollapsePanel.js +7 -20
- package/src/components/Feedback.js +66 -0
- package/src/components/Icon.js +8 -7
- package/src/components/InputLabel.js +23 -0
- package/src/components/InputSupports.js +7 -0
- package/src/components/Link.js +67 -96
- package/src/components/List.js +68 -0
- package/src/components/Modal.js +57 -0
- package/src/components/Notification.js +90 -0
- package/src/components/Pagination.js +11 -20
- package/src/components/PaginationPageButton.js +35 -51
- package/src/components/PaginationSideButton.js +46 -76
- package/src/components/Progress.js +13 -0
- package/src/components/ProgressBar.js +31 -0
- package/src/components/Radio.js +69 -0
- package/src/components/RadioCard.js +123 -0
- package/src/components/RadioCardGroup.js +24 -0
- package/src/components/RadioGroup.js +8 -0
- package/src/components/Search.js +57 -0
- package/src/components/SearchButton.js +71 -0
- package/src/components/Select.js +78 -0
- package/src/components/SideNav.js +4 -13
- package/src/components/SideNavItem.js +49 -54
- package/src/components/SideNavItemsGroup.js +18 -32
- package/src/components/Skeleton.js +14 -0
- package/src/components/StackView.js +10 -0
- package/src/components/StepTracker.js +59 -0
- package/src/components/Tabs.js +13 -0
- package/src/components/TabsItem.js +81 -0
- package/src/components/TabsScrollButton.js +34 -0
- package/src/components/Tags.js +13 -0
- package/src/components/TagsItem.js +126 -0
- package/src/components/TextArea.js +8 -0
- package/src/components/TextInput.js +73 -0
- package/src/components/ToggleSwitch.js +53 -67
- package/src/components/Tooltip.js +37 -0
- package/src/components/TooltipButton.js +61 -0
- package/src/components/Typography.js +109 -93
- package/src/components/index.js +52 -42
- package/src/components/spacingScale.js +23 -36
- package/src/index.js +3 -3
package/package.json
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telus-uds/theme-allium",
|
|
3
|
-
"version": "0.0.2-prerelease.
|
|
3
|
+
"version": "0.0.2-prerelease.6",
|
|
4
4
|
"description": "Allium theme",
|
|
5
5
|
"author": "TELUS Digital",
|
|
6
6
|
"homepage": "https://github.com/telus/universal-design-system#readme",
|
|
7
7
|
"license": "ISC",
|
|
8
|
-
"main": "
|
|
9
|
-
"react-native": "
|
|
8
|
+
"main": "build/theme.js",
|
|
9
|
+
"react-native": "build/theme.js",
|
|
10
10
|
"directories": {
|
|
11
11
|
"lib": "lib",
|
|
12
12
|
"test": "__tests__"
|
|
13
13
|
},
|
|
14
|
-
"dependencies": {
|
|
15
|
-
|
|
16
|
-
"@telus-uds/
|
|
14
|
+
"dependencies": {},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@telus-uds/palette-allium": "^1.0.0-prerelease.0",
|
|
17
|
+
"@telus-uds/system-themes": "^0.0.2-prerelease.1"
|
|
17
18
|
},
|
|
18
19
|
"peerDependencies": {
|
|
19
|
-
"@telus-uds/palette-allium": "^
|
|
20
|
+
"@telus-uds/palette-allium": "^1.0.0-prerelease.0"
|
|
20
21
|
},
|
|
21
22
|
"files": [
|
|
22
23
|
"lib",
|
|
@@ -27,8 +28,10 @@
|
|
|
27
28
|
"url": "git+https://github.com/telus/universal-design-system.git"
|
|
28
29
|
},
|
|
29
30
|
"scripts": {
|
|
30
|
-
"test": "
|
|
31
|
-
"release": "standard-version"
|
|
31
|
+
"test": "jest",
|
|
32
|
+
"release": "standard-version",
|
|
33
|
+
"build": "THEME_PATH=./src/index.js UDS_THEME_MODULE_PALETTE=@telus-uds/palette-allium UDS_THEME_MODULE_SYSTEM=@telus-uds/system-themes/src/tokens/rn UDS_THEME_MODULE_APPEARANCES=@telus-uds/system-themes/schema/appearances system-themes-build",
|
|
34
|
+
"dev": "nodemon -w src -x 'yarn build'"
|
|
32
35
|
},
|
|
33
36
|
"bugs": {
|
|
34
37
|
"url": "https://github.com/telus/universal-design-system/issues"
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export default {
|
|
1
|
+
module.exports = {
|
|
4
2
|
appearances: {
|
|
5
3
|
size: {
|
|
6
4
|
values: ['large'],
|
|
@@ -9,16 +7,16 @@ export default {
|
|
|
9
7
|
}
|
|
10
8
|
},
|
|
11
9
|
tokens: {
|
|
12
|
-
size: palette.size.size20,
|
|
13
|
-
thickness: palette.border.border2,
|
|
14
|
-
color: palette.color.greenAccessible
|
|
10
|
+
size: '{palette.size.size20}',
|
|
11
|
+
thickness: '{palette.border.border2}',
|
|
12
|
+
color: '{palette.color.greenAccessible}'
|
|
15
13
|
},
|
|
16
14
|
rules: [
|
|
17
15
|
{
|
|
18
16
|
if: { size: 'large' },
|
|
19
17
|
tokens: {
|
|
20
|
-
thickness: palette.border.border4,
|
|
21
|
-
size: palette.size.size40
|
|
18
|
+
thickness: '{palette.border.border4}',
|
|
19
|
+
size: '{palette.size.size40}'
|
|
22
20
|
}
|
|
23
21
|
}
|
|
24
22
|
]
|
package/src/components/Box.js
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { getBoxSchema, validateComponentTheme } from '@telus-uds/tools-theme'
|
|
3
|
-
|
|
4
|
-
const { color } = palette
|
|
5
|
-
|
|
6
|
-
const Box = {
|
|
1
|
+
module.exports = {
|
|
7
2
|
appearances: {
|
|
8
3
|
background: {
|
|
9
4
|
description: 'Background colour of box. Transparent if not specified.',
|
|
@@ -21,23 +16,17 @@ const Box = {
|
|
|
21
16
|
}
|
|
22
17
|
},
|
|
23
18
|
tokens: {
|
|
24
|
-
backgroundColor:
|
|
19
|
+
backgroundColor: '{system.color.none}'
|
|
25
20
|
},
|
|
26
21
|
rules: [
|
|
27
|
-
{ if: { background: 'lightest' }, tokens: { backgroundColor: color.white } },
|
|
28
|
-
{ if: { background: 'light' }, tokens: { backgroundColor: color.greyAthens } },
|
|
29
|
-
{ if: { background: 'dark' }, tokens: { backgroundColor: color.greyCharcoal } },
|
|
30
|
-
{ if: { background: 'darkest' }, tokens: { backgroundColor: color.greyThunder } },
|
|
31
|
-
{ if: { background: 'critical' }, tokens: { backgroundColor: color.redDark } },
|
|
32
|
-
{ if: { background: 'danger' }, tokens: { backgroundColor: color.redLight } },
|
|
33
|
-
{ if: { background: 'warning' }, tokens: { backgroundColor: color.amberLight } },
|
|
34
|
-
{ if: { background: 'positive' }, tokens: { backgroundColor: color.greenPanache } },
|
|
35
|
-
{ if: { background: 'brand' }, tokens: { backgroundColor: color.purpleTelus } }
|
|
22
|
+
{ if: { background: 'lightest' }, tokens: { backgroundColor: '{palette.color.white}' } },
|
|
23
|
+
{ if: { background: 'light' }, tokens: { backgroundColor: '{palette.color.greyAthens}' } },
|
|
24
|
+
{ if: { background: 'dark' }, tokens: { backgroundColor: '{palette.color.greyCharcoal}' } },
|
|
25
|
+
{ if: { background: 'darkest' }, tokens: { backgroundColor: '{palette.color.greyThunder}' } },
|
|
26
|
+
{ if: { background: 'critical' }, tokens: { backgroundColor: '{palette.color.redDark}' } },
|
|
27
|
+
{ if: { background: 'danger' }, tokens: { backgroundColor: '{palette.color.redLight}' } },
|
|
28
|
+
{ if: { background: 'warning' }, tokens: { backgroundColor: '{palette.color.amberLight}' } },
|
|
29
|
+
{ if: { background: 'positive' }, tokens: { backgroundColor: '{palette.color.greenPanache}' } },
|
|
30
|
+
{ if: { background: 'brand' }, tokens: { backgroundColor: '{palette.color.purpleTelus}' } }
|
|
36
31
|
]
|
|
37
32
|
}
|
|
38
|
-
|
|
39
|
-
// TODO: replace this with a build step similar to Palettes
|
|
40
|
-
// https://github.com/telus/universal-design-system/issues/167
|
|
41
|
-
validateComponentTheme(Box, getBoxSchema(palette))
|
|
42
|
-
|
|
43
|
-
export default Box
|
package/src/components/Button.js
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import palette from '@telus-uds/palette-allium'
|
|
3
|
-
|
|
4
|
-
const { color, border, font, fontSize, lineHeight, radius, size } = palette
|
|
5
|
-
|
|
6
|
-
const Button = {
|
|
1
|
+
module.exports = {
|
|
7
2
|
appearances: {
|
|
8
3
|
priority: {
|
|
9
4
|
description:
|
|
10
|
-
'Indicates the importance of the call-to-action. Limit the amount of high priority buttons on a page to
|
|
5
|
+
'Indicates the importance of the call-to-action. Limit the amount of high priority buttons on a page to prioritize meaningful user flows. Low priority styles are applied by default.',
|
|
11
6
|
values: ['high'],
|
|
12
7
|
type: 'variant'
|
|
13
8
|
},
|
|
@@ -33,173 +28,140 @@ const Button = {
|
|
|
33
28
|
values: ['full'],
|
|
34
29
|
type: 'variant'
|
|
35
30
|
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
inactive: {
|
|
41
|
-
...buttonAppearances.inactive,
|
|
42
|
-
description:
|
|
43
|
-
// Based on https://tds.telus.com/components/index.html#/Forms
|
|
44
|
-
'Buttons should not be disabled or set as inactive. Use inline (on blur) error messaging to provide feedback when the form is invalid. In exceptional instances where disabled buttons are needed, it must be clear to the user why the button is disabled and what they need to do to enable it.'
|
|
45
|
-
}
|
|
31
|
+
hover: '{appearances.Button.hover}',
|
|
32
|
+
focus: '{appearances.Button.focus}',
|
|
33
|
+
pressed: '{appearances.Button.pressed}',
|
|
34
|
+
inactive: '{appearances.Button.inactive}'
|
|
46
35
|
},
|
|
47
36
|
tokens: {
|
|
48
|
-
borderColor: color.greenAccessible,
|
|
49
|
-
borderWidth: border.border1,
|
|
50
|
-
borderRadius: radius.pill32,
|
|
51
|
-
shadow:
|
|
37
|
+
borderColor: '{palette.color.greenAccessible}',
|
|
38
|
+
borderWidth: '{palette.border.border1}',
|
|
39
|
+
borderRadius: '{palette.radius.pill32}',
|
|
40
|
+
shadow: '{system.shadow.none}',
|
|
52
41
|
|
|
53
|
-
fontSize: fontSize.size16,
|
|
54
|
-
color: color.greenAccessible,
|
|
55
|
-
lineHeight: lineHeight.ratio3to2,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
42
|
+
fontSize: '{palette.fontSize.size16}',
|
|
43
|
+
color: '{palette.color.greenAccessible}',
|
|
44
|
+
lineHeight: '{palette.lineHeight.ratio3to2}',
|
|
45
|
+
textAlign: '{system.flexJustifyContent.center}',
|
|
46
|
+
alignSelf: '{system.flexAlign.flexStart}',
|
|
47
|
+
fontName: '{palette.fontName.HelveticaNow}',
|
|
48
|
+
fontWeight: '{palette.fontWeight.weight700}',
|
|
59
49
|
|
|
60
|
-
backgroundColor: color.white,
|
|
61
|
-
opacity:
|
|
62
|
-
paddingLeft: size.size32,
|
|
63
|
-
paddingRight: size.size32,
|
|
64
|
-
paddingTop: size.size12,
|
|
65
|
-
paddingBottom: size.size12,
|
|
66
|
-
width:
|
|
50
|
+
backgroundColor: '{palette.color.white}',
|
|
51
|
+
opacity: '{system.opacity.opaque}',
|
|
52
|
+
paddingLeft: '{palette.size.size32}',
|
|
53
|
+
paddingRight: '{palette.size.size32}',
|
|
54
|
+
paddingTop: '{palette.size.size12}',
|
|
55
|
+
paddingBottom: '{palette.size.size12}',
|
|
56
|
+
width: '{system.size.none}',
|
|
57
|
+
minWidth: '{palette.size.size144}',
|
|
67
58
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
outerBorderColor: color.transparent,
|
|
74
|
-
outerBorderWidth: border.border2,
|
|
75
|
-
outerBorderGap: border.border2,
|
|
76
|
-
outerBorderRadius: radius.pill32,
|
|
77
|
-
outerBackgroundColor: color.transparent
|
|
59
|
+
outerBorderColor: '{palette.color.transparent}',
|
|
60
|
+
outerBorderWidth: '{palette.border.border2}',
|
|
61
|
+
outerBorderGap: '{palette.border.border2}',
|
|
62
|
+
outerBackgroundColor: '{palette.color.transparent}'
|
|
78
63
|
},
|
|
79
64
|
rules: [
|
|
80
|
-
{ if: { hover: true }, tokens: { borderWidth: border.border3 } },
|
|
65
|
+
{ if: { hover: true }, tokens: { borderWidth: '{palette.border.border3}' } },
|
|
81
66
|
|
|
82
67
|
{
|
|
83
68
|
if: { priority: 'high' },
|
|
84
69
|
tokens: {
|
|
85
|
-
backgroundColor: color.greenAccessible,
|
|
86
|
-
color: color.white,
|
|
87
|
-
borderWidth: border.none
|
|
70
|
+
backgroundColor: '{palette.color.greenAccessible}',
|
|
71
|
+
color: '{palette.color.white}',
|
|
72
|
+
borderWidth: '{palette.border.none}'
|
|
88
73
|
}
|
|
89
74
|
},
|
|
90
75
|
{
|
|
91
76
|
if: { priority: 'high', hover: true },
|
|
92
|
-
tokens: { backgroundColor: color.greenSanFelix }
|
|
77
|
+
tokens: { backgroundColor: '{palette.color.greenSanFelix}' }
|
|
93
78
|
},
|
|
94
79
|
|
|
95
80
|
// pressed and focus apply the same tokens to both high and low priority
|
|
96
81
|
{
|
|
97
82
|
if: { pressed: true },
|
|
98
83
|
tokens: {
|
|
99
|
-
borderWidth:
|
|
100
|
-
backgroundColor: color.greenDarkFern,
|
|
101
|
-
color: color.white
|
|
84
|
+
borderWidth: '{system.size.zero}',
|
|
85
|
+
backgroundColor: '{palette.color.greenDarkFern}',
|
|
86
|
+
color: '{palette.color.white}'
|
|
102
87
|
}
|
|
103
88
|
},
|
|
104
|
-
{ if: { focus: true }, tokens: { outerBorderColor: color.greenAccessible } },
|
|
105
|
-
{
|
|
89
|
+
{ if: { focus: true }, tokens: { outerBorderColor: '{palette.color.greenAccessible}' } },
|
|
90
|
+
{
|
|
91
|
+
if: { focus: true, pressed: true },
|
|
92
|
+
tokens: { outerBorderColor: '{palette.color.greenDarkFern}' }
|
|
93
|
+
},
|
|
106
94
|
|
|
107
95
|
{
|
|
108
96
|
if: { inverse: true },
|
|
109
|
-
tokens: {
|
|
97
|
+
tokens: {
|
|
98
|
+
backgroundColor: '{system.color.none}',
|
|
99
|
+
borderColor: '{palette.color.white}',
|
|
100
|
+
color: '{palette.color.white}'
|
|
101
|
+
}
|
|
110
102
|
},
|
|
111
103
|
{
|
|
112
104
|
if: { inverse: true, priority: 'high' },
|
|
113
|
-
tokens: { backgroundColor: color.white, color: color.greyCharcoal }
|
|
105
|
+
tokens: { backgroundColor: '{palette.color.white}', color: '{palette.color.greyCharcoal}' }
|
|
114
106
|
},
|
|
115
107
|
{
|
|
116
108
|
if: { inverse: true, priority: 'high', hover: true },
|
|
117
|
-
tokens: { backgroundColor: color.light80 }
|
|
109
|
+
tokens: { backgroundColor: '{palette.color.light80}' }
|
|
118
110
|
},
|
|
119
111
|
{
|
|
120
112
|
if: { inverse: true, pressed: true },
|
|
121
113
|
tokens: {
|
|
122
|
-
color: color.greyCharcoal,
|
|
123
|
-
backgroundColor: color.light60
|
|
114
|
+
color: '{palette.color.greyCharcoal}',
|
|
115
|
+
backgroundColor: '{palette.color.light60}'
|
|
124
116
|
}
|
|
125
117
|
},
|
|
126
|
-
{ if: { inverse: true, focus: true }, tokens: { outerBorderColor: color.white } },
|
|
118
|
+
{ if: { inverse: true, focus: true }, tokens: { outerBorderColor: '{palette.color.white}' } },
|
|
127
119
|
|
|
128
|
-
{ if: { danger: true, priority: null }, tokens: { color: color.red, borderColor: color.red } },
|
|
129
120
|
{
|
|
130
|
-
if: { danger: true, priority: null
|
|
131
|
-
tokens: {
|
|
121
|
+
if: { danger: true, priority: null },
|
|
122
|
+
tokens: { color: '{palette.color.red}', borderColor: '{palette.color.red}' }
|
|
132
123
|
},
|
|
133
|
-
{ if: { danger: true, priority: null, focus: true }, tokens: { outerBorderColor: color.red } },
|
|
134
124
|
{
|
|
135
|
-
if: { danger: true, priority: null,
|
|
136
|
-
tokens: { backgroundColor:
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
if: { danger: true, priority: null, pressed: true, focus: true },
|
|
140
|
-
tokens: { outerBorderColor: color.redDark }
|
|
125
|
+
if: { danger: true, priority: null, inverse: true },
|
|
126
|
+
tokens: { backgroundColor: '{palette.color.white}' }
|
|
141
127
|
},
|
|
142
|
-
|
|
143
|
-
{ if: { width: 'full' }, tokens: { width: '100%' } },
|
|
144
|
-
{ if: { size: 'small' }, tokens: { paddingTop: size.size4, paddingBottom: size.size4 } },
|
|
145
128
|
{
|
|
146
|
-
if: {
|
|
147
|
-
tokens: {
|
|
148
|
-
paddingLeft: size.size16,
|
|
149
|
-
paddingRight: size.size16,
|
|
150
|
-
paddingTop: size.size8,
|
|
151
|
-
paddingBottom: size.size8,
|
|
152
|
-
color: color.greyShuttle,
|
|
153
|
-
fontSize: fontSize.size14,
|
|
154
|
-
borderColor: color.greyCloud
|
|
155
|
-
}
|
|
129
|
+
if: { danger: true, priority: null, focus: true },
|
|
130
|
+
tokens: { outerBorderColor: '{palette.color.red}' }
|
|
156
131
|
},
|
|
157
132
|
{
|
|
158
|
-
if: {
|
|
159
|
-
tokens: {
|
|
160
|
-
borderWidth: border.none,
|
|
161
|
-
backgroundColor: color.greyShuttle,
|
|
162
|
-
color: color.white
|
|
163
|
-
}
|
|
133
|
+
if: { danger: true, priority: null, pressed: true },
|
|
134
|
+
tokens: { backgroundColor: '{palette.color.redDark}', color: '{palette.color.white}' }
|
|
164
135
|
},
|
|
165
136
|
{
|
|
166
|
-
if: {
|
|
167
|
-
tokens: {
|
|
168
|
-
borderColor: color.purpleTelus,
|
|
169
|
-
borderWidth: border.border3,
|
|
170
|
-
color: color.greyCharcoal,
|
|
171
|
-
outerBorderColor: color.transparent
|
|
172
|
-
}
|
|
137
|
+
if: { danger: true, priority: null, pressed: true, focus: true },
|
|
138
|
+
tokens: { outerBorderColor: '{palette.color.redDark}' }
|
|
173
139
|
},
|
|
140
|
+
|
|
141
|
+
{ if: { width: 'full' }, tokens: { width: '{system.size.full}' } },
|
|
174
142
|
{
|
|
175
|
-
if: {
|
|
143
|
+
if: { size: 'small' },
|
|
176
144
|
tokens: {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
145
|
+
paddingTop: '{palette.size.size4}',
|
|
146
|
+
paddingBottom: '{palette.size.size4}',
|
|
147
|
+
minWidth: '{system.size.zero}'
|
|
180
148
|
}
|
|
181
149
|
},
|
|
182
150
|
{
|
|
183
|
-
|
|
151
|
+
description:
|
|
152
|
+
'Buttons should not be disabled or set as inactive. Use inline (on blur) error messaging to provide feedback when the form is invalid. In exceptional instances where disabled buttons are needed, it must be clear to the user why the button is disabled and what they need to do to enable it.',
|
|
153
|
+
if: {
|
|
154
|
+
inactive: true
|
|
155
|
+
},
|
|
184
156
|
tokens: {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
157
|
+
backgroundColor: '{palette.color.greyCloud}',
|
|
158
|
+
color: '{palette.color.white}',
|
|
159
|
+
borderWidth: '{system.size.zero}'
|
|
188
160
|
}
|
|
189
161
|
},
|
|
190
|
-
{
|
|
191
|
-
if: { inactive: true },
|
|
192
|
-
tokens: { backgroundColor: color.greyCloud, color: color.white, borderWidth: 0 }
|
|
193
|
-
},
|
|
194
162
|
{
|
|
195
163
|
if: { inactive: true, inverse: true },
|
|
196
|
-
tokens: { backgroundColor: color.light60, color: color.greyCharcoal }
|
|
164
|
+
tokens: { backgroundColor: '{palette.color.light60}', color: '{palette.color.greyCharcoal}' }
|
|
197
165
|
}
|
|
198
166
|
]
|
|
199
167
|
}
|
|
200
|
-
|
|
201
|
-
// TODO: replace this with a build step similar to Palettes
|
|
202
|
-
// https://github.com/telus/universal-design-system/issues/167
|
|
203
|
-
validateComponentTheme(Button, getButtonSchema(palette))
|
|
204
|
-
|
|
205
|
-
export default Button
|
|
@@ -1,22 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import palette from '@telus-uds/palette-allium'
|
|
3
|
-
import { appearances } from '@telus-uds/system-constants'
|
|
4
|
-
|
|
5
|
-
const { size } = palette
|
|
6
|
-
|
|
7
|
-
const ButtonGroup = {
|
|
1
|
+
module.exports = {
|
|
8
2
|
appearances: {
|
|
9
|
-
viewport: appearances.viewport
|
|
3
|
+
viewport: '{appearances.system.viewport}'
|
|
10
4
|
},
|
|
11
5
|
tokens: {
|
|
12
|
-
|
|
13
|
-
direction: 'row'
|
|
6
|
+
space: '{system.integer.1}',
|
|
7
|
+
direction: '{system.direction.row}',
|
|
8
|
+
alignItems: '{system.flexAlign.center}',
|
|
9
|
+
justifyContent: '{system.flexJustifyContent.flexStart}',
|
|
10
|
+
flexGrow: '{system.integer.0}'
|
|
14
11
|
},
|
|
15
|
-
rules: [{ if: { viewport: ['lg', 'xl'] }, tokens: {
|
|
12
|
+
rules: [{ if: { viewport: ['lg', 'xl'] }, tokens: { space: '{system.integer.3}' } }]
|
|
16
13
|
}
|
|
17
|
-
|
|
18
|
-
// TODO: replace this with a build step similar to Palettes
|
|
19
|
-
// https://github.com/telus/universal-design-system/issues/167
|
|
20
|
-
validateComponentTheme(ButtonGroup, getButtonGroupSchema(palette))
|
|
21
|
-
|
|
22
|
-
export default ButtonGroup
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
appearances: {
|
|
3
|
+
hover: '{appearances.ButtonGroupItem.hover}',
|
|
4
|
+
focus: '{appearances.ButtonGroupItem.focus}',
|
|
5
|
+
pressed: '{appearances.ButtonGroupItem.pressed}',
|
|
6
|
+
selected: '{appearances.ButtonGroupItem.selected}',
|
|
7
|
+
inactive: '{appearances.ButtonGroupItem.inactive}'
|
|
8
|
+
},
|
|
9
|
+
tokens: {
|
|
10
|
+
borderColor: '{palette.color.greyCloud}',
|
|
11
|
+
borderWidth: '{palette.border.border1}',
|
|
12
|
+
borderRadius: '{palette.radius.pill32}',
|
|
13
|
+
shadow: '{system.shadow.none}',
|
|
14
|
+
|
|
15
|
+
fontSize: '{palette.fontSize.size14}',
|
|
16
|
+
color: '{palette.color.greyShuttle}',
|
|
17
|
+
lineHeight: '{palette.lineHeight.ratio3to2}',
|
|
18
|
+
textAlign: '{system.flexJustifyContent.center}',
|
|
19
|
+
alignSelf: '{system.flexAlign.flexStart}',
|
|
20
|
+
fontName: '{palette.fontName.HelveticaNow}',
|
|
21
|
+
fontWeight: '{palette.fontWeight.weight700}',
|
|
22
|
+
|
|
23
|
+
backgroundColor: '{palette.color.white}',
|
|
24
|
+
opacity: '{system.opacity.opaque}',
|
|
25
|
+
paddingLeft: '{palette.size.size16}',
|
|
26
|
+
paddingRight: '{palette.size.size16}',
|
|
27
|
+
paddingTop: '{palette.size.size8}',
|
|
28
|
+
paddingBottom: '{palette.size.size8}',
|
|
29
|
+
width: '{system.size.none}',
|
|
30
|
+
minWidth: '{system.size.zero}',
|
|
31
|
+
|
|
32
|
+
outerBorderColor: '{palette.color.transparent}',
|
|
33
|
+
outerBorderWidth: '{palette.border.border2}',
|
|
34
|
+
outerBorderGap: '{palette.border.border2}',
|
|
35
|
+
outerBackgroundColor: '{palette.color.transparent}'
|
|
36
|
+
},
|
|
37
|
+
rules: [
|
|
38
|
+
{
|
|
39
|
+
if: { pressed: true },
|
|
40
|
+
tokens: {
|
|
41
|
+
borderWidth: '{palette.border.none}',
|
|
42
|
+
backgroundColor: '{palette.color.greyShuttle}',
|
|
43
|
+
borderColor: '{palette.color.greyShuttle}',
|
|
44
|
+
color: '{palette.color.white}'
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
if: { focus: true },
|
|
49
|
+
tokens: {
|
|
50
|
+
borderColor: '{palette.color.greyShuttle}',
|
|
51
|
+
outerBorderColor: '{palette.color.greyShuttle}',
|
|
52
|
+
outerBorderGap: '{palette.size.size2}',
|
|
53
|
+
outerBorderWidth: '{palette.size.size2}'
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
{ if: { hover: true }, tokens: { borderWidth: '{palette.border.border3}' } },
|
|
57
|
+
{
|
|
58
|
+
if: { selected: true },
|
|
59
|
+
tokens: {
|
|
60
|
+
borderWidth: '{palette.border.none}',
|
|
61
|
+
backgroundColor: '{palette.color.purpleTelus}',
|
|
62
|
+
color: '{palette.color.white}'
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
if: { selected: true, hover: true },
|
|
67
|
+
tokens: {
|
|
68
|
+
backgroundColor: '{palette.color.purpleDeluge}'
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
if: { selected: true, pressed: true },
|
|
73
|
+
tokens: {
|
|
74
|
+
backgroundColor: '{palette.color.purpleDark}'
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
if: { selected: true, focus: true },
|
|
79
|
+
tokens: {
|
|
80
|
+
outerBorderColor: '{palette.color.purpleTelus}'
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
if: { selected: true, focus: true, pressed: true },
|
|
85
|
+
tokens: {
|
|
86
|
+
outerBorderColor: '{palette.color.purpleDark}'
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
if: { inactive: true },
|
|
91
|
+
tokens: {
|
|
92
|
+
backgroundColor: '{palette.color.greyCloud}',
|
|
93
|
+
color: '{palette.color.white}',
|
|
94
|
+
borderWidth: '{system.border.zero}'
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
}
|
package/src/components/Card.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { appearances } from '@telus-uds/system-constants'
|
|
3
|
-
|
|
4
|
-
export default {
|
|
1
|
+
module.exports = {
|
|
5
2
|
appearances: {
|
|
6
3
|
background: {
|
|
7
4
|
values: ['alternative'],
|
|
@@ -11,87 +8,89 @@ export default {
|
|
|
11
8
|
values: ['narrow', 'intermediate', 'compact', 'custom'],
|
|
12
9
|
type: 'variant'
|
|
13
10
|
},
|
|
14
|
-
viewport: appearances.viewport
|
|
11
|
+
viewport: '{appearances.system.viewport}'
|
|
15
12
|
},
|
|
16
13
|
tokens: {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
14
|
+
flex: '{system.integer.1}',
|
|
15
|
+
backgroundColor: '{palette.color.white}',
|
|
16
|
+
borderColor: '{palette.color.greyMystic}',
|
|
17
|
+
borderRadius: '{palette.radius.radius6}',
|
|
18
|
+
borderWidth: '{palette.border.border1}',
|
|
19
|
+
paddingBottom: '{palette.size.size32}',
|
|
20
|
+
paddingLeft: '{palette.size.size24}',
|
|
21
|
+
paddingRight: '{palette.size.size24}',
|
|
22
|
+
paddingTop: '{palette.size.size32}',
|
|
23
|
+
minWidth: '{system.size.none}',
|
|
24
|
+
shadow: '{system.shadow.none}'
|
|
26
25
|
},
|
|
27
26
|
rules: [
|
|
28
27
|
{
|
|
29
28
|
if: { background: 'alternative' },
|
|
30
29
|
tokens: {
|
|
31
|
-
backgroundColor: palette.color.greyAthens
|
|
30
|
+
backgroundColor: '{palette.color.greyAthens}'
|
|
32
31
|
}
|
|
33
32
|
},
|
|
34
33
|
{
|
|
35
34
|
if: { viewport: ['md', 'lg', 'xl'] },
|
|
36
35
|
tokens: {
|
|
37
|
-
paddingBottom: palette.size.size48,
|
|
38
|
-
paddingLeft: palette.size.size32,
|
|
39
|
-
paddingRight: palette.size.size32,
|
|
40
|
-
paddingTop: palette.size.size48
|
|
36
|
+
paddingBottom: '{palette.size.size48}',
|
|
37
|
+
paddingLeft: '{palette.size.size32}',
|
|
38
|
+
paddingRight: '{palette.size.size32}',
|
|
39
|
+
paddingTop: '{palette.size.size48}'
|
|
41
40
|
}
|
|
42
41
|
},
|
|
43
42
|
{
|
|
44
43
|
if: { padding: 'narrow' },
|
|
45
44
|
tokens: {
|
|
46
|
-
paddingBottom: palette.size.size24,
|
|
47
|
-
paddingLeft: palette.size.size16,
|
|
48
|
-
paddingRight: palette.size.size16,
|
|
49
|
-
paddingTop: palette.size.size24
|
|
45
|
+
paddingBottom: '{palette.size.size24}',
|
|
46
|
+
paddingLeft: '{palette.size.size16}',
|
|
47
|
+
paddingRight: '{palette.size.size16}',
|
|
48
|
+
paddingTop: '{palette.size.size24}'
|
|
50
49
|
}
|
|
51
50
|
},
|
|
52
51
|
{
|
|
53
52
|
if: { padding: 'narrow', viewport: ['md', 'lg', 'xl'] },
|
|
54
53
|
tokens: {
|
|
55
|
-
paddingBottom: palette.size.size32,
|
|
56
|
-
paddingLeft: palette.size.size16,
|
|
57
|
-
paddingRight: palette.size.size16,
|
|
58
|
-
paddingTop: palette.size.size32
|
|
54
|
+
paddingBottom: '{palette.size.size32}',
|
|
55
|
+
paddingLeft: '{palette.size.size16}',
|
|
56
|
+
paddingRight: '{palette.size.size16}',
|
|
57
|
+
paddingTop: '{palette.size.size32}'
|
|
59
58
|
}
|
|
60
59
|
},
|
|
61
60
|
{
|
|
62
61
|
if: { padding: 'intermediate' },
|
|
63
62
|
tokens: {
|
|
64
|
-
paddingBottom: palette.size.size24,
|
|
65
|
-
paddingLeft: palette.size.size24,
|
|
66
|
-
paddingRight: palette.size.size24,
|
|
67
|
-
paddingTop: palette.size.size24
|
|
63
|
+
paddingBottom: '{palette.size.size24}',
|
|
64
|
+
paddingLeft: '{palette.size.size24}',
|
|
65
|
+
paddingRight: '{palette.size.size24}',
|
|
66
|
+
paddingTop: '{palette.size.size24}'
|
|
68
67
|
}
|
|
69
68
|
},
|
|
70
69
|
{
|
|
71
70
|
if: { padding: 'intermediate', viewport: ['md', 'lg', 'xl'] },
|
|
72
71
|
tokens: {
|
|
73
|
-
paddingBottom: palette.size.size32,
|
|
74
|
-
paddingLeft: palette.size.size32,
|
|
75
|
-
paddingRight: palette.size.size32,
|
|
76
|
-
paddingTop: palette.size.size32
|
|
72
|
+
paddingBottom: '{palette.size.size32}',
|
|
73
|
+
paddingLeft: '{palette.size.size32}',
|
|
74
|
+
paddingRight: '{palette.size.size32}',
|
|
75
|
+
paddingTop: '{palette.size.size32}'
|
|
77
76
|
}
|
|
78
77
|
},
|
|
79
78
|
{
|
|
80
79
|
if: { padding: 'compact' },
|
|
81
80
|
tokens: {
|
|
82
|
-
paddingBottom: palette.size.size16,
|
|
83
|
-
paddingLeft: palette.size.size16,
|
|
84
|
-
paddingRight: palette.size.size16,
|
|
85
|
-
paddingTop: palette.size.size16
|
|
81
|
+
paddingBottom: '{palette.size.size16}',
|
|
82
|
+
paddingLeft: '{palette.size.size16}',
|
|
83
|
+
paddingRight: '{palette.size.size16}',
|
|
84
|
+
paddingTop: '{palette.size.size16}'
|
|
86
85
|
}
|
|
87
86
|
},
|
|
88
87
|
{
|
|
89
88
|
if: { padding: 'custom' },
|
|
90
89
|
tokens: {
|
|
91
|
-
paddingBottom: palette.size.size0,
|
|
92
|
-
paddingLeft: palette.size.size0,
|
|
93
|
-
paddingRight: palette.size.size0,
|
|
94
|
-
paddingTop: palette.size.size0
|
|
90
|
+
paddingBottom: '{palette.size.size0}',
|
|
91
|
+
paddingLeft: '{palette.size.size0}',
|
|
92
|
+
paddingRight: '{palette.size.size0}',
|
|
93
|
+
paddingTop: '{palette.size.size0}'
|
|
95
94
|
}
|
|
96
95
|
}
|
|
97
96
|
]
|