@telus-uds/theme-allium 0.0.2-prerelease.1 → 0.0.2-prerelease.5
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 +47 -0
- package/lib/components/ActivityIndicator.js +35 -0
- package/lib/components/Box.js +89 -0
- package/lib/components/Button.js +252 -0
- package/lib/components/ButtonGroup.js +34 -0
- package/lib/components/ButtonGroupItem.js +108 -0
- package/lib/components/Card.js +120 -0
- package/lib/components/Checkbox.js +80 -0
- package/lib/components/ChevronLink.js +39 -0
- package/lib/components/Divider.js +44 -0
- package/lib/components/ExpandCollapse.js +23 -0
- package/lib/components/ExpandCollapseControl.js +49 -0
- package/lib/components/ExpandCollapsePanel.js +25 -0
- package/lib/components/Feedback.js +89 -0
- package/lib/components/Icon.js +47 -0
- package/lib/components/InputLabel.js +33 -0
- package/lib/components/InputSupports.js +19 -0
- package/lib/components/Link.js +241 -0
- package/lib/components/List.js +86 -0
- package/lib/components/Pagination.js +40 -0
- package/lib/components/PaginationPageButton.js +82 -0
- package/lib/components/PaginationSideButton.js +113 -0
- package/lib/components/Radio.js +78 -0
- package/lib/components/Select.js +102 -0
- package/lib/components/SideNav.js +23 -0
- package/lib/components/SideNavItem.js +118 -0
- package/lib/components/SideNavItemsGroup.js +49 -0
- package/lib/components/Skeleton.js +26 -0
- package/lib/components/StackView.js +22 -0
- package/lib/components/Tags.js +34 -0
- package/lib/components/TagsItem.js +133 -0
- package/lib/components/TextArea.js +20 -0
- package/lib/components/TextInput.js +97 -0
- package/lib/components/ToggleSwitch.js +144 -0
- package/lib/components/Tooltip.js +48 -0
- package/lib/components/TooltipButton.js +86 -0
- package/lib/components/Typography.js +370 -0
- package/lib/components/index.js +303 -0
- package/lib/components/spacingScale.js +163 -0
- package/lib/index.js +30 -0
- package/package.json +10 -7
- package/src/components/Box.js +12 -94
- package/src/components/Button.js +80 -111
- package/src/components/ButtonGroup.js +10 -16
- package/src/components/ButtonGroupItem.js +88 -0
- package/src/components/Card.js +99 -0
- package/src/components/Checkbox.js +65 -0
- package/src/components/ChevronLink.js +19 -0
- package/src/components/ExpandCollapse.js +3 -9
- package/src/components/ExpandCollapseControl.js +8 -21
- package/src/components/ExpandCollapsePanel.js +3 -14
- package/src/components/Feedback.js +75 -0
- package/src/components/Icon.js +6 -3
- package/src/components/InputLabel.js +29 -0
- package/src/components/InputSupports.js +9 -0
- package/src/components/Link.js +71 -92
- package/src/components/List.js +70 -0
- package/src/components/Pagination.js +10 -13
- package/src/components/PaginationPageButton.js +15 -25
- package/src/components/PaginationSideButton.js +23 -44
- package/src/components/Radio.js +64 -0
- package/src/components/Select.js +88 -0
- package/src/components/SideNav.js +3 -9
- package/src/components/SideNavItem.js +21 -22
- package/src/components/SideNavItemsGroup.js +11 -18
- package/src/components/Skeleton.js +16 -0
- package/src/components/StackView.js +12 -0
- package/src/components/Tags.js +16 -0
- package/src/components/TagsItem.js +118 -0
- package/src/components/TextArea.js +10 -0
- package/src/components/TextInput.js +83 -0
- package/src/components/ToggleSwitch.js +16 -23
- package/src/components/Tooltip.js +41 -0
- package/src/components/TooltipButton.js +68 -0
- package/src/components/Typography.js +112 -78
- package/src/components/index.js +37 -39
- package/src/components/spacingScale.js +36 -0
- package/src/index.js +1 -1
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _paletteAllium = _interopRequireDefault(require("@telus-uds/palette-allium"));
|
|
9
|
+
|
|
10
|
+
var _schema = require("@telus-uds/system-themes/schema");
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
var _default = {
|
|
15
|
+
appearances: {
|
|
16
|
+
space: _schema.appearances.spacingScale.space,
|
|
17
|
+
viewport: _schema.appearances.system.viewport
|
|
18
|
+
},
|
|
19
|
+
// Largest spacings first, so they apply any time space >= highest index'
|
|
20
|
+
tokens: {
|
|
21
|
+
size: _paletteAllium.default.size.size96
|
|
22
|
+
},
|
|
23
|
+
rules: [{
|
|
24
|
+
if: {
|
|
25
|
+
viewport: ['lg', 'xl']
|
|
26
|
+
},
|
|
27
|
+
tokens: {
|
|
28
|
+
size: _paletteAllium.default.size.size120
|
|
29
|
+
}
|
|
30
|
+
}, {
|
|
31
|
+
if: {
|
|
32
|
+
space: 11
|
|
33
|
+
},
|
|
34
|
+
tokens: {
|
|
35
|
+
size: _paletteAllium.default.size.size96
|
|
36
|
+
}
|
|
37
|
+
}, {
|
|
38
|
+
if: {
|
|
39
|
+
space: 10
|
|
40
|
+
},
|
|
41
|
+
tokens: {
|
|
42
|
+
size: _paletteAllium.default.size.size80
|
|
43
|
+
}
|
|
44
|
+
}, {
|
|
45
|
+
if: {
|
|
46
|
+
space: 9
|
|
47
|
+
},
|
|
48
|
+
tokens: {
|
|
49
|
+
size: _paletteAllium.default.size.size64
|
|
50
|
+
}
|
|
51
|
+
}, {
|
|
52
|
+
if: {
|
|
53
|
+
space: 8
|
|
54
|
+
},
|
|
55
|
+
tokens: {
|
|
56
|
+
size: _paletteAllium.default.size.size48
|
|
57
|
+
}
|
|
58
|
+
}, {
|
|
59
|
+
if: {
|
|
60
|
+
space: 7
|
|
61
|
+
},
|
|
62
|
+
tokens: {
|
|
63
|
+
size: _paletteAllium.default.size.size40
|
|
64
|
+
}
|
|
65
|
+
}, {
|
|
66
|
+
if: {
|
|
67
|
+
space: 6
|
|
68
|
+
},
|
|
69
|
+
tokens: {
|
|
70
|
+
size: _paletteAllium.default.size.size36
|
|
71
|
+
}
|
|
72
|
+
}, {
|
|
73
|
+
if: {
|
|
74
|
+
space: 5
|
|
75
|
+
},
|
|
76
|
+
tokens: {
|
|
77
|
+
size: _paletteAllium.default.size.size32
|
|
78
|
+
}
|
|
79
|
+
}, {
|
|
80
|
+
if: {
|
|
81
|
+
space: 4
|
|
82
|
+
},
|
|
83
|
+
tokens: {
|
|
84
|
+
size: _paletteAllium.default.size.size24
|
|
85
|
+
}
|
|
86
|
+
}, {
|
|
87
|
+
if: {
|
|
88
|
+
space: 3
|
|
89
|
+
},
|
|
90
|
+
tokens: {
|
|
91
|
+
size: _paletteAllium.default.size.size16
|
|
92
|
+
}
|
|
93
|
+
}, {
|
|
94
|
+
if: {
|
|
95
|
+
space: 2
|
|
96
|
+
},
|
|
97
|
+
tokens: {
|
|
98
|
+
size: _paletteAllium.default.size.size8
|
|
99
|
+
}
|
|
100
|
+
}, {
|
|
101
|
+
if: {
|
|
102
|
+
space: 1
|
|
103
|
+
},
|
|
104
|
+
tokens: {
|
|
105
|
+
size: _paletteAllium.default.size.size4
|
|
106
|
+
}
|
|
107
|
+
}, {
|
|
108
|
+
if: {
|
|
109
|
+
space: 11,
|
|
110
|
+
viewport: ['lg', 'xl']
|
|
111
|
+
},
|
|
112
|
+
tokens: {
|
|
113
|
+
size: _paletteAllium.default.size.size120
|
|
114
|
+
}
|
|
115
|
+
}, {
|
|
116
|
+
if: {
|
|
117
|
+
space: 10,
|
|
118
|
+
viewport: ['lg', 'xl']
|
|
119
|
+
},
|
|
120
|
+
tokens: {
|
|
121
|
+
size: _paletteAllium.default.size.size96
|
|
122
|
+
}
|
|
123
|
+
}, {
|
|
124
|
+
if: {
|
|
125
|
+
space: 9,
|
|
126
|
+
viewport: ['lg', 'xl']
|
|
127
|
+
},
|
|
128
|
+
tokens: {
|
|
129
|
+
size: _paletteAllium.default.size.size72
|
|
130
|
+
}
|
|
131
|
+
}, {
|
|
132
|
+
if: {
|
|
133
|
+
space: 8,
|
|
134
|
+
viewport: ['lg', 'xl']
|
|
135
|
+
},
|
|
136
|
+
tokens: {
|
|
137
|
+
size: _paletteAllium.default.size.size64
|
|
138
|
+
}
|
|
139
|
+
}, {
|
|
140
|
+
if: {
|
|
141
|
+
space: 7
|
|
142
|
+
},
|
|
143
|
+
tokens: {
|
|
144
|
+
size: _paletteAllium.default.size.size48
|
|
145
|
+
}
|
|
146
|
+
}, {
|
|
147
|
+
if: {
|
|
148
|
+
space: 6
|
|
149
|
+
},
|
|
150
|
+
tokens: {
|
|
151
|
+
size: _paletteAllium.default.size.size40
|
|
152
|
+
}
|
|
153
|
+
}, // Zero spacing last; overrides all other rules when space === 0
|
|
154
|
+
{
|
|
155
|
+
if: {
|
|
156
|
+
space: 0
|
|
157
|
+
},
|
|
158
|
+
tokens: {
|
|
159
|
+
size: _paletteAllium.default.size.size0
|
|
160
|
+
}
|
|
161
|
+
}]
|
|
162
|
+
};
|
|
163
|
+
exports.default = _default;
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _package = _interopRequireDefault(require("../package.json"));
|
|
9
|
+
|
|
10
|
+
var components = _interopRequireWildcard(require("./components"));
|
|
11
|
+
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
|
|
14
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
// TODO: replace this with theme build tooling and schema checks as part of
|
|
19
|
+
// https://github.com/telus/universal-design-system/issues/92
|
|
20
|
+
const metadata = {
|
|
21
|
+
name: 'allium',
|
|
22
|
+
package: _package.default.name,
|
|
23
|
+
version: _package.default.version
|
|
24
|
+
};
|
|
25
|
+
const alliumTheme = {
|
|
26
|
+
metadata,
|
|
27
|
+
components
|
|
28
|
+
};
|
|
29
|
+
var _default = alliumTheme;
|
|
30
|
+
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telus-uds/theme-allium",
|
|
3
|
-
"version": "0.0.2-prerelease.
|
|
3
|
+
"version": "0.0.2-prerelease.5",
|
|
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": "
|
|
8
|
+
"main": "lib/index.js",
|
|
9
9
|
"react-native": "src/index.js",
|
|
10
10
|
"directories": {
|
|
11
11
|
"lib": "lib",
|
|
12
12
|
"test": "__tests__"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@telus-uds/
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
"@telus-uds/system-themes": "^0.0.2-prerelease.0"
|
|
16
|
+
},
|
|
17
|
+
"peerDependencies": {
|
|
18
|
+
"@telus-uds/palette-allium": "^0.1.0-prerelease.6"
|
|
18
19
|
},
|
|
19
20
|
"files": [
|
|
20
21
|
"lib",
|
|
@@ -25,8 +26,10 @@
|
|
|
25
26
|
"url": "git+https://github.com/telus/universal-design-system.git"
|
|
26
27
|
},
|
|
27
28
|
"scripts": {
|
|
28
|
-
"test": "
|
|
29
|
-
"release": "standard-version"
|
|
29
|
+
"test": "jest",
|
|
30
|
+
"release": "standard-version",
|
|
31
|
+
"build": "babel src -d lib",
|
|
32
|
+
"dev": "nodemon -w src -x 'yarn build'"
|
|
30
33
|
},
|
|
31
34
|
"bugs": {
|
|
32
35
|
"url": "https://github.com/telus/universal-design-system/issues"
|
package/src/components/Box.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import palette from '@telus-uds/palette-allium'
|
|
2
|
-
import
|
|
2
|
+
import system from '@telus-uds/system-themes/src/tokens/rn'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const Box = {
|
|
4
|
+
export default {
|
|
7
5
|
appearances: {
|
|
8
6
|
background: {
|
|
9
7
|
description: 'Background colour of box. Transparent if not specified.',
|
|
@@ -20,98 +18,18 @@ const Box = {
|
|
|
20
18
|
]
|
|
21
19
|
}
|
|
22
20
|
},
|
|
23
|
-
// TODO: integrate box levels into normal token resolution system as part of
|
|
24
|
-
// https://github.com/telus/universal-design-system/issues/267
|
|
25
|
-
levels: {
|
|
26
|
-
xs: {
|
|
27
|
-
0: size.size0,
|
|
28
|
-
1: size.size4,
|
|
29
|
-
2: size.size8,
|
|
30
|
-
3: size.size16,
|
|
31
|
-
4: size.size24,
|
|
32
|
-
5: size.size32,
|
|
33
|
-
6: size.size36,
|
|
34
|
-
7: size.size40,
|
|
35
|
-
8: size.size48,
|
|
36
|
-
9: size.size64,
|
|
37
|
-
10: size.size80,
|
|
38
|
-
11: size.size96
|
|
39
|
-
},
|
|
40
|
-
sm: {
|
|
41
|
-
0: size.size0,
|
|
42
|
-
1: size.size4,
|
|
43
|
-
2: size.size8,
|
|
44
|
-
3: size.size16,
|
|
45
|
-
4: size.size24,
|
|
46
|
-
5: size.size32,
|
|
47
|
-
6: size.size36,
|
|
48
|
-
7: size.size40,
|
|
49
|
-
8: size.size48,
|
|
50
|
-
9: size.size64,
|
|
51
|
-
10: size.size80,
|
|
52
|
-
11: size.size96
|
|
53
|
-
},
|
|
54
|
-
md: {
|
|
55
|
-
0: size.size0,
|
|
56
|
-
1: size.size4,
|
|
57
|
-
2: size.size8,
|
|
58
|
-
3: size.size16,
|
|
59
|
-
4: size.size24,
|
|
60
|
-
5: size.size32,
|
|
61
|
-
6: size.size36,
|
|
62
|
-
7: size.size40,
|
|
63
|
-
8: size.size48,
|
|
64
|
-
9: size.size64,
|
|
65
|
-
10: size.size80,
|
|
66
|
-
11: size.size96
|
|
67
|
-
},
|
|
68
|
-
lg: {
|
|
69
|
-
0: size.size0,
|
|
70
|
-
1: size.size4,
|
|
71
|
-
2: size.size8,
|
|
72
|
-
3: size.size16,
|
|
73
|
-
4: size.size24,
|
|
74
|
-
5: size.size32,
|
|
75
|
-
6: size.size40,
|
|
76
|
-
7: size.size48,
|
|
77
|
-
8: size.size64,
|
|
78
|
-
9: size.size72,
|
|
79
|
-
10: size.size96,
|
|
80
|
-
11: size.size120
|
|
81
|
-
},
|
|
82
|
-
xl: {
|
|
83
|
-
0: size.size0,
|
|
84
|
-
1: size.size4,
|
|
85
|
-
2: size.size8,
|
|
86
|
-
3: size.size16,
|
|
87
|
-
4: size.size24,
|
|
88
|
-
5: size.size32,
|
|
89
|
-
6: size.size40,
|
|
90
|
-
7: size.size48,
|
|
91
|
-
8: size.size64,
|
|
92
|
-
9: size.size72,
|
|
93
|
-
10: size.size96,
|
|
94
|
-
11: size.size120
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
21
|
tokens: {
|
|
98
|
-
backgroundColor:
|
|
22
|
+
backgroundColor: system.color.none
|
|
99
23
|
},
|
|
100
24
|
rules: [
|
|
101
|
-
{ if: { background: 'lightest' }, tokens: { backgroundColor: color.white } },
|
|
102
|
-
{ if: { background: 'light' }, tokens: { backgroundColor: color.greyAthens } },
|
|
103
|
-
{ if: { background: 'dark' }, tokens: { backgroundColor: color.greyCharcoal } },
|
|
104
|
-
{ if: { background: 'darkest' }, tokens: { backgroundColor: color.greyThunder } },
|
|
105
|
-
{ if: { background: 'critical' }, tokens: { backgroundColor: color.redDark } },
|
|
106
|
-
{ if: { background: 'danger' }, tokens: { backgroundColor: color.redLight } },
|
|
107
|
-
{ if: { background: 'warning' }, tokens: { backgroundColor: color.amberLight } },
|
|
108
|
-
{ if: { background: 'positive' }, tokens: { backgroundColor: color.greenPanache } },
|
|
109
|
-
{ if: { background: 'brand' }, tokens: { backgroundColor: color.purpleTelus } }
|
|
25
|
+
{ if: { background: 'lightest' }, tokens: { backgroundColor: palette.color.white } },
|
|
26
|
+
{ if: { background: 'light' }, tokens: { backgroundColor: palette.color.greyAthens } },
|
|
27
|
+
{ if: { background: 'dark' }, tokens: { backgroundColor: palette.color.greyCharcoal } },
|
|
28
|
+
{ if: { background: 'darkest' }, tokens: { backgroundColor: palette.color.greyThunder } },
|
|
29
|
+
{ if: { background: 'critical' }, tokens: { backgroundColor: palette.color.redDark } },
|
|
30
|
+
{ if: { background: 'danger' }, tokens: { backgroundColor: palette.color.redLight } },
|
|
31
|
+
{ if: { background: 'warning' }, tokens: { backgroundColor: palette.color.amberLight } },
|
|
32
|
+
{ if: { background: 'positive' }, tokens: { backgroundColor: palette.color.greenPanache } },
|
|
33
|
+
{ if: { background: 'brand' }, tokens: { backgroundColor: palette.color.purpleTelus } }
|
|
110
34
|
]
|
|
111
35
|
}
|
|
112
|
-
|
|
113
|
-
// TODO: replace this with a build step similar to Palettes
|
|
114
|
-
// https://github.com/telus/universal-design-system/issues/167
|
|
115
|
-
validateComponentTheme(Box, getBoxSchema(palette))
|
|
116
|
-
|
|
117
|
-
export default Box
|
package/src/components/Button.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { getButtonSchema, validateComponentTheme, buttonAppearances } from '@telus-uds/tools-theme'
|
|
2
1
|
import palette from '@telus-uds/palette-allium'
|
|
2
|
+
import system from '@telus-uds/system-themes/src/tokens/rn'
|
|
3
|
+
import { appearances } from '@telus-uds/system-themes/schema'
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const Button = {
|
|
5
|
+
export default {
|
|
7
6
|
appearances: {
|
|
8
7
|
priority: {
|
|
9
8
|
description:
|
|
@@ -33,173 +32,143 @@ const Button = {
|
|
|
33
32
|
values: ['full'],
|
|
34
33
|
type: 'variant'
|
|
35
34
|
},
|
|
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
|
-
}
|
|
35
|
+
hover: appearances.Button.hover,
|
|
36
|
+
focus: appearances.Button.focus,
|
|
37
|
+
pressed: appearances.Button.pressed,
|
|
38
|
+
inactive: appearances.Button.inactive
|
|
46
39
|
},
|
|
47
40
|
tokens: {
|
|
48
|
-
borderColor: color.greenAccessible,
|
|
49
|
-
borderWidth: border.border1,
|
|
50
|
-
borderRadius: radius.pill32,
|
|
51
|
-
shadow:
|
|
41
|
+
borderColor: palette.color.greenAccessible,
|
|
42
|
+
borderWidth: palette.border.border1,
|
|
43
|
+
borderRadius: palette.radius.pill32,
|
|
44
|
+
shadow: system.shadow.none,
|
|
52
45
|
|
|
53
|
-
fontSize: fontSize.size16,
|
|
54
|
-
color: color.greenAccessible,
|
|
55
|
-
lineHeight: lineHeight.ratio3to2,
|
|
56
|
-
|
|
57
|
-
|
|
46
|
+
fontSize: palette.fontSize.size16,
|
|
47
|
+
color: palette.color.greenAccessible,
|
|
48
|
+
lineHeight: palette.lineHeight.ratio3to2,
|
|
49
|
+
textAlign: system.flexJustifyContent.center,
|
|
50
|
+
alignSelf: system.flexAlign.flexStart,
|
|
51
|
+
// TODO: replace these with font for theme building
|
|
52
|
+
fontName: Object.keys(palette.font)[0],
|
|
58
53
|
fontWeight: '700',
|
|
54
|
+
// font: palette.font.HelveticaNow['700'],
|
|
59
55
|
|
|
60
|
-
backgroundColor: color.white,
|
|
61
|
-
opacity:
|
|
62
|
-
paddingLeft: size.size32,
|
|
63
|
-
paddingRight: size.size32,
|
|
64
|
-
paddingTop: size.size12,
|
|
65
|
-
paddingBottom: size.size12,
|
|
66
|
-
width:
|
|
67
|
-
|
|
68
|
-
marginLeft: size.size0,
|
|
69
|
-
marginRight: size.size0,
|
|
70
|
-
marginTop: size.size0,
|
|
71
|
-
marginBottom: size.size0,
|
|
56
|
+
backgroundColor: palette.color.white,
|
|
57
|
+
opacity: system.opacity.opaque,
|
|
58
|
+
paddingLeft: palette.size.size32,
|
|
59
|
+
paddingRight: palette.size.size32,
|
|
60
|
+
paddingTop: palette.size.size12,
|
|
61
|
+
paddingBottom: palette.size.size12,
|
|
62
|
+
width: system.size.none,
|
|
63
|
+
minWidth: palette.size.size144,
|
|
72
64
|
|
|
73
|
-
outerBorderColor: color.transparent,
|
|
74
|
-
outerBorderWidth: border.border2,
|
|
75
|
-
outerBorderGap: border.border2,
|
|
76
|
-
outerBorderRadius: radius.pill32,
|
|
77
|
-
outerBackgroundColor: color.transparent
|
|
65
|
+
outerBorderColor: palette.color.transparent,
|
|
66
|
+
outerBorderWidth: palette.border.border2,
|
|
67
|
+
outerBorderGap: palette.border.border2,
|
|
68
|
+
outerBorderRadius: palette.radius.pill32,
|
|
69
|
+
outerBackgroundColor: palette.color.transparent
|
|
78
70
|
},
|
|
79
71
|
rules: [
|
|
80
|
-
{ if: { hover: true }, tokens: { borderWidth: border.border3 } },
|
|
72
|
+
{ if: { hover: true }, tokens: { borderWidth: palette.border.border3 } },
|
|
81
73
|
|
|
82
74
|
{
|
|
83
75
|
if: { priority: 'high' },
|
|
84
76
|
tokens: {
|
|
85
|
-
backgroundColor: color.greenAccessible,
|
|
86
|
-
color: color.white,
|
|
87
|
-
borderWidth: border.none
|
|
77
|
+
backgroundColor: palette.color.greenAccessible,
|
|
78
|
+
color: palette.color.white,
|
|
79
|
+
borderWidth: palette.border.none
|
|
88
80
|
}
|
|
89
81
|
},
|
|
90
82
|
{
|
|
91
83
|
if: { priority: 'high', hover: true },
|
|
92
|
-
tokens: { backgroundColor: color.greenSanFelix }
|
|
84
|
+
tokens: { backgroundColor: palette.color.greenSanFelix }
|
|
93
85
|
},
|
|
94
86
|
|
|
95
87
|
// pressed and focus apply the same tokens to both high and low priority
|
|
96
88
|
{
|
|
97
89
|
if: { pressed: true },
|
|
98
90
|
tokens: {
|
|
99
|
-
borderWidth:
|
|
100
|
-
backgroundColor: color.greenDarkFern,
|
|
101
|
-
color: color.white
|
|
91
|
+
borderWidth: system.size.zero,
|
|
92
|
+
backgroundColor: palette.color.greenDarkFern,
|
|
93
|
+
color: palette.color.white
|
|
102
94
|
}
|
|
103
95
|
},
|
|
104
|
-
{ if: { focus: true }, tokens: { outerBorderColor: color.greenAccessible } },
|
|
105
|
-
{
|
|
96
|
+
{ if: { focus: true }, tokens: { outerBorderColor: palette.color.greenAccessible } },
|
|
97
|
+
{
|
|
98
|
+
if: { focus: true, pressed: true },
|
|
99
|
+
tokens: { outerBorderColor: palette.color.greenDarkFern }
|
|
100
|
+
},
|
|
106
101
|
|
|
107
102
|
{
|
|
108
103
|
if: { inverse: true },
|
|
109
|
-
tokens: {
|
|
104
|
+
tokens: {
|
|
105
|
+
backgroundColor: system.color.none,
|
|
106
|
+
borderColor: palette.color.white,
|
|
107
|
+
color: palette.color.white
|
|
108
|
+
}
|
|
110
109
|
},
|
|
111
110
|
{
|
|
112
111
|
if: { inverse: true, priority: 'high' },
|
|
113
|
-
tokens: { backgroundColor: color.white, color: color.greyCharcoal }
|
|
112
|
+
tokens: { backgroundColor: palette.color.white, color: palette.color.greyCharcoal }
|
|
114
113
|
},
|
|
115
114
|
{
|
|
116
115
|
if: { inverse: true, priority: 'high', hover: true },
|
|
117
|
-
tokens: { backgroundColor: color.light80 }
|
|
116
|
+
tokens: { backgroundColor: palette.color.light80 }
|
|
118
117
|
},
|
|
119
118
|
{
|
|
120
119
|
if: { inverse: true, pressed: true },
|
|
121
120
|
tokens: {
|
|
122
|
-
color: color.greyCharcoal,
|
|
123
|
-
backgroundColor: color.light60
|
|
121
|
+
color: palette.color.greyCharcoal,
|
|
122
|
+
backgroundColor: palette.color.light60
|
|
124
123
|
}
|
|
125
124
|
},
|
|
126
|
-
{ if: { inverse: true, focus: true }, tokens: { outerBorderColor: color.white } },
|
|
125
|
+
{ if: { inverse: true, focus: true }, tokens: { outerBorderColor: palette.color.white } },
|
|
127
126
|
|
|
128
|
-
{ if: { danger: true, priority: null }, tokens: { color: color.red, borderColor: color.red } },
|
|
129
127
|
{
|
|
130
|
-
if: { danger: true, priority: null
|
|
131
|
-
tokens: {
|
|
128
|
+
if: { danger: true, priority: null },
|
|
129
|
+
tokens: { color: palette.color.red, borderColor: palette.color.red }
|
|
132
130
|
},
|
|
133
|
-
{ if: { danger: true, priority: null, focus: true }, tokens: { outerBorderColor: color.red } },
|
|
134
131
|
{
|
|
135
|
-
if: { danger: true, priority: null,
|
|
136
|
-
tokens: { backgroundColor:
|
|
132
|
+
if: { danger: true, priority: null, inverse: true },
|
|
133
|
+
tokens: { backgroundColor: palette.color.white }
|
|
137
134
|
},
|
|
138
135
|
{
|
|
139
|
-
if: { danger: true, priority: null,
|
|
140
|
-
tokens: { outerBorderColor: color.
|
|
136
|
+
if: { danger: true, priority: null, focus: true },
|
|
137
|
+
tokens: { outerBorderColor: palette.color.red }
|
|
141
138
|
},
|
|
142
|
-
|
|
143
|
-
{ if: { width: 'full' }, tokens: { width: '100%' } },
|
|
144
|
-
{ if: { size: 'small' }, tokens: { paddingTop: size.size4, paddingBottom: size.size4 } },
|
|
145
139
|
{
|
|
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
|
-
}
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
if: { component: 'ButtonGroup', pressed: true },
|
|
159
|
-
tokens: {
|
|
160
|
-
borderWidth: border.none,
|
|
161
|
-
backgroundColor: color.greyShuttle,
|
|
162
|
-
color: color.white
|
|
163
|
-
}
|
|
140
|
+
if: { danger: true, priority: null, pressed: true },
|
|
141
|
+
tokens: { backgroundColor: palette.color.redDark, color: palette.color.white }
|
|
164
142
|
},
|
|
165
143
|
{
|
|
166
|
-
if: {
|
|
167
|
-
tokens: {
|
|
168
|
-
borderColor: color.purpleTelus,
|
|
169
|
-
borderWidth: border.border3,
|
|
170
|
-
color: color.greyCharcoal,
|
|
171
|
-
outerBorderColor: color.transparent
|
|
172
|
-
}
|
|
144
|
+
if: { danger: true, priority: null, pressed: true, focus: true },
|
|
145
|
+
tokens: { outerBorderColor: palette.color.redDark }
|
|
173
146
|
},
|
|
147
|
+
|
|
148
|
+
{ if: { width: 'full' }, tokens: { width: system.size.full } },
|
|
174
149
|
{
|
|
175
|
-
if: {
|
|
150
|
+
if: { size: 'small' },
|
|
176
151
|
tokens: {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
152
|
+
paddingTop: palette.size.size4,
|
|
153
|
+
paddingBottom: palette.size.size4,
|
|
154
|
+
minWidth: system.size.zero
|
|
180
155
|
}
|
|
181
156
|
},
|
|
182
157
|
{
|
|
183
|
-
|
|
158
|
+
description:
|
|
159
|
+
'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.',
|
|
160
|
+
if: {
|
|
161
|
+
inactive: true
|
|
162
|
+
},
|
|
184
163
|
tokens: {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
164
|
+
backgroundColor: palette.color.greyCloud,
|
|
165
|
+
color: palette.color.white,
|
|
166
|
+
borderWidth: system.size.zero
|
|
188
167
|
}
|
|
189
168
|
},
|
|
190
|
-
{
|
|
191
|
-
if: { inactive: true },
|
|
192
|
-
tokens: { backgroundColor: color.greyCloud, color: color.white, borderWidth: 0 }
|
|
193
|
-
},
|
|
194
169
|
{
|
|
195
170
|
if: { inactive: true, inverse: true },
|
|
196
|
-
tokens: { backgroundColor: color.light60, color: color.greyCharcoal }
|
|
171
|
+
tokens: { backgroundColor: palette.color.light60, color: palette.color.greyCharcoal }
|
|
197
172
|
}
|
|
198
173
|
]
|
|
199
174
|
}
|
|
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,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { appearances } from '@telus-uds/system-constants'
|
|
1
|
+
import system from '@telus-uds/system-themes/src/tokens/rn'
|
|
2
|
+
import { appearances } from '@telus-uds/system-themes/schema'
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const ButtonGroup = {
|
|
4
|
+
export default {
|
|
8
5
|
appearances: {
|
|
9
|
-
viewport: appearances.viewport
|
|
6
|
+
viewport: appearances.system.viewport
|
|
10
7
|
},
|
|
11
8
|
tokens: {
|
|
12
|
-
|
|
13
|
-
direction:
|
|
9
|
+
space: system.integer[1],
|
|
10
|
+
direction: system.direction.row,
|
|
11
|
+
alignItems: system.flexAlign.center,
|
|
12
|
+
justifyContent: system.flexJustifyContent.flexStart,
|
|
13
|
+
flexGrow: system.integer[0]
|
|
14
14
|
},
|
|
15
|
-
rules: [{ if: { viewport: ['lg', 'xl'] }, tokens: {
|
|
15
|
+
rules: [{ if: { viewport: ['lg', 'xl'] }, tokens: { space: system.integer[3] } }]
|
|
16
16
|
}
|
|
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
|