@telus-uds/theme-allium 0.0.2-prerelease.4 → 1.0.0-prerelease.0

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.
@@ -1,25 +0,0 @@
1
- import palette from '@telus-uds/palette-allium'
2
-
3
- export default {
4
- appearances: {
5
- size: {
6
- values: ['large'],
7
- description: 'used for full-screen spinners',
8
- type: 'variant'
9
- }
10
- },
11
- tokens: {
12
- size: palette.size.size20,
13
- thickness: palette.border.border2,
14
- color: palette.color.greenAccessible
15
- },
16
- rules: [
17
- {
18
- if: { size: 'large' },
19
- tokens: {
20
- thickness: palette.border.border4,
21
- size: palette.size.size40
22
- }
23
- }
24
- ]
25
- }
@@ -1,41 +0,0 @@
1
- import palette from '@telus-uds/palette-allium'
2
- import { getBoxSchema, validateComponentTheme } from '@telus-uds/tools-theme'
3
-
4
- const Box = {
5
- appearances: {
6
- background: {
7
- description: 'Background colour of box. Transparent if not specified.',
8
- values: [
9
- 'light',
10
- 'lightest',
11
- 'dark',
12
- 'darkest',
13
- 'critical',
14
- 'danger',
15
- 'warning',
16
- 'positive',
17
- 'brand'
18
- ]
19
- }
20
- },
21
- tokens: {
22
- backgroundColor: null
23
- },
24
- rules: [
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 } }
34
- ]
35
- }
36
-
37
- // TODO: replace this with a build step similar to Palettes
38
- // https://github.com/telus/universal-design-system/issues/167
39
- validateComponentTheme(Box, getBoxSchema(palette), 'box')
40
-
41
- export default Box
@@ -1,219 +0,0 @@
1
- import { getButtonSchema, validateComponentTheme, buttonAppearances } from '@telus-uds/tools-theme'
2
- import palette from '@telus-uds/palette-allium'
3
-
4
- const Button = {
5
- appearances: {
6
- priority: {
7
- description:
8
- 'Indicates the importance of the call-to-action. Limit the amount of high priority buttons on a page to proritize meaningful user flows. Low priority styles are applied by default.',
9
- values: ['high'],
10
- type: 'variant'
11
- },
12
- danger: {
13
- description:
14
- 'Indicates a user action that is destructive and will result in loss of information or cause significant monetary charges. Limit the use of the danger button whenever possible.',
15
- values: [true],
16
- type: 'variant'
17
- },
18
- inverse: {
19
- description:
20
- 'Use inverse buttons on darker backgrounds. High and low priority buttons, and danger buttons, are available in inverse.',
21
- values: [true],
22
- type: 'variant'
23
- },
24
- size: {
25
- values: ['small'],
26
- type: 'variant'
27
- },
28
- width: {
29
- description:
30
- 'Available in default or full-width. Default-width expands based on content Full-width expands to width of the container.',
31
- values: ['full'],
32
- type: 'variant'
33
- },
34
- component: buttonAppearances.component,
35
- hover: buttonAppearances.hover,
36
- focus: buttonAppearances.focus,
37
- pressed: buttonAppearances.pressed,
38
- inactive: {
39
- ...buttonAppearances.inactive,
40
- description:
41
- // Based on https://tds.telus.com/components/index.html#/Forms
42
- '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.'
43
- }
44
- },
45
- tokens: {
46
- borderColor: palette.color.greenAccessible,
47
- borderWidth: palette.border.border1,
48
- borderRadius: palette.radius.pill32,
49
- shadow: null,
50
-
51
- fontSize: palette.fontSize.size16,
52
- color: palette.color.greenAccessible,
53
- lineHeight: palette.lineHeight.ratio3to2,
54
- fontName: Object.keys(palette.font)[0],
55
- textAlign: 'center',
56
- alignSelf: 'flex-start',
57
- fontWeight: '700',
58
-
59
- backgroundColor: palette.color.white,
60
- opacity: 1,
61
- paddingLeft: palette.size.size32,
62
- paddingRight: palette.size.size32,
63
- paddingTop: palette.size.size12,
64
- paddingBottom: palette.size.size12,
65
- width: null,
66
-
67
- outerBorderColor: palette.color.transparent,
68
- outerBorderWidth: palette.border.border2,
69
- outerBorderGap: palette.border.border2,
70
- outerBorderRadius: palette.radius.pill32,
71
- outerBackgroundColor: palette.color.transparent
72
- },
73
- rules: [
74
- { if: { hover: true }, tokens: { borderWidth: palette.border.border3 } },
75
-
76
- {
77
- if: { priority: 'high' },
78
- tokens: {
79
- backgroundColor: palette.color.greenAccessible,
80
- color: palette.color.white,
81
- borderWidth: palette.border.none
82
- }
83
- },
84
- {
85
- if: { priority: 'high', hover: true },
86
- tokens: { backgroundColor: palette.color.greenSanFelix }
87
- },
88
-
89
- // pressed and focus apply the same tokens to both high and low priority
90
- {
91
- if: { pressed: true },
92
- tokens: {
93
- borderWidth: 0,
94
- backgroundColor: palette.color.greenDarkFern,
95
- color: palette.color.white
96
- }
97
- },
98
- { if: { focus: true }, tokens: { outerBorderColor: palette.color.greenAccessible } },
99
- {
100
- if: { focus: true, pressed: true },
101
- tokens: { outerBorderColor: palette.color.greenDarkFern }
102
- },
103
-
104
- {
105
- if: { inverse: true },
106
- tokens: {
107
- backgroundColor: null,
108
- borderColor: palette.color.white,
109
- color: palette.color.white
110
- }
111
- },
112
- {
113
- if: { inverse: true, priority: 'high' },
114
- tokens: { backgroundColor: palette.color.white, color: palette.color.greyCharcoal }
115
- },
116
- {
117
- if: { inverse: true, priority: 'high', hover: true },
118
- tokens: { backgroundColor: palette.color.light80 }
119
- },
120
- {
121
- if: { inverse: true, pressed: true },
122
- tokens: {
123
- color: palette.color.greyCharcoal,
124
- backgroundColor: palette.color.light60
125
- }
126
- },
127
- { if: { inverse: true, focus: true }, tokens: { outerBorderColor: palette.color.white } },
128
-
129
- {
130
- if: { danger: true, priority: null },
131
- tokens: { color: palette.color.red, borderColor: palette.color.red }
132
- },
133
- {
134
- if: { danger: true, priority: null, inverse: true },
135
- tokens: { backgroundColor: palette.color.white }
136
- },
137
- {
138
- if: { danger: true, priority: null, focus: true },
139
- tokens: { outerBorderColor: palette.color.red }
140
- },
141
- {
142
- if: { danger: true, priority: null, pressed: true },
143
- tokens: { backgroundColor: palette.color.redDark, color: palette.color.white }
144
- },
145
- {
146
- if: { danger: true, priority: null, pressed: true, focus: true },
147
- tokens: { outerBorderColor: palette.color.redDark }
148
- },
149
-
150
- { if: { width: 'full' }, tokens: { width: '100%' } },
151
- {
152
- if: { size: 'small' },
153
- tokens: { paddingTop: palette.size.size4, paddingBottom: palette.size.size4 }
154
- },
155
- {
156
- if: { component: 'ButtonGroup' },
157
- tokens: {
158
- paddingLeft: palette.size.size16,
159
- paddingRight: palette.size.size16,
160
- paddingTop: palette.size.size8,
161
- paddingBottom: palette.size.size8,
162
- color: palette.color.greyShuttle,
163
- fontSize: palette.fontSize.size14,
164
- borderColor: palette.color.greyCloud
165
- }
166
- },
167
- {
168
- if: { component: 'ButtonGroup', pressed: true },
169
- tokens: {
170
- borderWidth: palette.border.none,
171
- backgroundColor: palette.color.greyShuttle,
172
- color: palette.color.white
173
- }
174
- },
175
- {
176
- if: { component: 'ButtonGroup', focus: true },
177
- tokens: {
178
- borderColor: palette.color.purpleTelus,
179
- borderWidth: palette.border.border3,
180
- color: palette.color.greyCharcoal,
181
- outerBorderColor: palette.color.transparent
182
- }
183
- },
184
- {
185
- if: { component: 'ButtonGroup', selected: true },
186
- tokens: {
187
- borderWidth: palette.border.none,
188
- backgroundColor: palette.color.purpleTelus,
189
- color: palette.color.white
190
- }
191
- },
192
- {
193
- if: { component: 'ButtonGroup', focus: true, pressed: true },
194
- tokens: {
195
- borderWidth: palette.border.none,
196
- backgroundColor: palette.color.purpleTelus,
197
- color: palette.color.white
198
- }
199
- },
200
- {
201
- if: { inactive: true },
202
- tokens: {
203
- backgroundColor: palette.color.greyCloud,
204
- color: palette.color.white,
205
- borderWidth: 0
206
- }
207
- },
208
- {
209
- if: { inactive: true, inverse: true },
210
- tokens: { backgroundColor: palette.color.light60, color: palette.color.greyCharcoal }
211
- }
212
- ]
213
- }
214
-
215
- // TODO: replace this with a build step similar to Palettes
216
- // https://github.com/telus/universal-design-system/issues/167
217
- validateComponentTheme(Button, getButtonSchema(palette), 'button')
218
-
219
- export default Button
@@ -1,23 +0,0 @@
1
- import { getButtonGroupSchema, validateComponentTheme } from '@telus-uds/tools-theme'
2
- import palette from '@telus-uds/palette-allium'
3
- import { appearances } from '@telus-uds/system-constants'
4
-
5
- const ButtonGroup = {
6
- appearances: {
7
- viewport: appearances.viewport
8
- },
9
- tokens: {
10
- space: 1,
11
- direction: 'row',
12
- alignItems: 'center',
13
- justifyContent: 'flex-start',
14
- flexGrow: 0
15
- },
16
- rules: [{ if: { viewport: ['lg', 'xl'] }, tokens: { space: 3 } }]
17
- }
18
-
19
- // TODO: replace this with a build step similar to Palettes
20
- // https://github.com/telus/universal-design-system/issues/167
21
- validateComponentTheme(ButtonGroup, getButtonGroupSchema(palette), 'button-group')
22
-
23
- export default ButtonGroup
@@ -1,98 +0,0 @@
1
- import palette from '@telus-uds/palette-allium'
2
- import { appearances } from '@telus-uds/system-constants'
3
-
4
- export default {
5
- appearances: {
6
- background: {
7
- values: ['alternative'],
8
- type: 'variant'
9
- },
10
- padding: {
11
- values: ['narrow', 'intermediate', 'compact', 'custom'],
12
- type: 'variant'
13
- },
14
- viewport: appearances.viewport
15
- },
16
- tokens: {
17
- backgroundColor: palette.color.white,
18
- borderColor: palette.color.greyMystic,
19
- borderRadius: palette.radius.radius6,
20
- borderWidth: palette.border.border1,
21
- paddingBottom: palette.size.size32,
22
- paddingLeft: palette.size.size24,
23
- paddingRight: palette.size.size24,
24
- paddingTop: palette.size.size32,
25
- shadow: null
26
- },
27
- rules: [
28
- {
29
- if: { background: 'alternative' },
30
- tokens: {
31
- backgroundColor: palette.color.greyAthens
32
- }
33
- },
34
- {
35
- if: { viewport: ['md', 'lg', 'xl'] },
36
- tokens: {
37
- paddingBottom: palette.size.size48,
38
- paddingLeft: palette.size.size32,
39
- paddingRight: palette.size.size32,
40
- paddingTop: palette.size.size48
41
- }
42
- },
43
- {
44
- if: { padding: 'narrow' },
45
- tokens: {
46
- paddingBottom: palette.size.size24,
47
- paddingLeft: palette.size.size16,
48
- paddingRight: palette.size.size16,
49
- paddingTop: palette.size.size24
50
- }
51
- },
52
- {
53
- if: { padding: 'narrow', viewport: ['md', 'lg', 'xl'] },
54
- tokens: {
55
- paddingBottom: palette.size.size32,
56
- paddingLeft: palette.size.size16,
57
- paddingRight: palette.size.size16,
58
- paddingTop: palette.size.size32
59
- }
60
- },
61
- {
62
- if: { padding: 'intermediate' },
63
- tokens: {
64
- paddingBottom: palette.size.size24,
65
- paddingLeft: palette.size.size24,
66
- paddingRight: palette.size.size24,
67
- paddingTop: palette.size.size24
68
- }
69
- },
70
- {
71
- if: { padding: 'intermediate', viewport: ['md', 'lg', 'xl'] },
72
- tokens: {
73
- paddingBottom: palette.size.size32,
74
- paddingLeft: palette.size.size32,
75
- paddingRight: palette.size.size32,
76
- paddingTop: palette.size.size32
77
- }
78
- },
79
- {
80
- if: { padding: 'compact' },
81
- tokens: {
82
- paddingBottom: palette.size.size16,
83
- paddingLeft: palette.size.size16,
84
- paddingRight: palette.size.size16,
85
- paddingTop: palette.size.size16
86
- }
87
- },
88
- {
89
- if: { padding: 'custom' },
90
- tokens: {
91
- paddingBottom: palette.size.size0,
92
- paddingLeft: palette.size.size0,
93
- paddingRight: palette.size.size0,
94
- paddingTop: palette.size.size0
95
- }
96
- }
97
- ]
98
- }
@@ -1,20 +0,0 @@
1
- import palette from '@telus-uds/palette-allium'
2
- import { getChevronLinkSchema, validateComponentTheme } from '@telus-uds/tools-theme'
3
-
4
- import leftArrowIcon from '@telus-uds/palette-allium/build/rn/icons/arrow-left.icon.svg'
5
- import rightArrowIcon from '@telus-uds/palette-allium/build/rn/icons/arrow-right.icon.svg'
6
-
7
- const ChevronLink = {
8
- appearances: {},
9
- tokens: {
10
- leftIcon: leftArrowIcon,
11
- rightIcon: rightArrowIcon,
12
- iconDisplace: palette.size.size4
13
- }
14
- }
15
-
16
- // TODO: replace this with a build step similar to Palettes
17
- // https://github.com/telus/universal-design-system/issues/167
18
- validateComponentTheme(ChevronLink, getChevronLinkSchema(palette), 'ChevronLink')
19
-
20
- export default ChevronLink
@@ -1,34 +0,0 @@
1
- import palette from '@telus-uds/palette-allium'
2
-
3
- export default {
4
- appearances: {
5
- weight: {
6
- values: ['thick'],
7
- type: 'variant'
8
- },
9
- decorative: {
10
- description:
11
- 'Use a decorative divider to highlight an element. Non-decorative dividers are for clearly identifying separation of content.',
12
- values: [true],
13
- type: 'variant'
14
- }
15
- },
16
- tokens: {
17
- width: palette.border.border1,
18
- color: palette.color.greyShuttle
19
- },
20
- rules: [
21
- {
22
- if: { weight: 'thick' },
23
- tokens: {
24
- width: palette.border.border2
25
- }
26
- },
27
- {
28
- if: { decorative: true },
29
- tokens: {
30
- color: palette.color.greyCloud
31
- }
32
- }
33
- ]
34
- }
@@ -1,18 +0,0 @@
1
- import palette from '@telus-uds/palette-allium'
2
- import { getExpandCollapseSchema, validateComponentTheme } from '@telus-uds/tools-theme'
3
-
4
- const ExpandCollapse = {
5
- appearances: {},
6
- tokens: {
7
- borderColor: palette.color.greyCloud,
8
- borderWidth: palette.border.border1,
9
- borderStyle: 'solid'
10
- },
11
- rules: []
12
- }
13
-
14
- // TODO: replace this with a build step similar to Palettes
15
- // https://github.com/telus/universal-design-system/issues/167
16
- validateComponentTheme(ExpandCollapse, getExpandCollapseSchema(palette), 'expand-collapse')
17
-
18
- export default ExpandCollapse
@@ -1,42 +0,0 @@
1
- import palette from '@telus-uds/palette-allium'
2
- import {
3
- getExpandCollapseControlSchema,
4
- validateComponentTheme,
5
- expandCollapseControlAppearances
6
- } from '@telus-uds/tools-theme'
7
-
8
- import CaretUp from '@telus-uds/palette-allium/build/rn/icons/caret-up.icon.svg'
9
- import CaretDown from '@telus-uds/palette-allium/build/rn/icons/caret-down.icon.svg'
10
-
11
- const ExpandCollapseControl = {
12
- appearances: {
13
- expanded: expandCollapseControlAppearances.expanded
14
- },
15
- tokens: {
16
- icon: CaretDown,
17
- iconColor: palette.color.greenAccessible,
18
- iconSize: palette.size.size24,
19
- iconGap: palette.size.size8,
20
- iconPosition: 'left',
21
- verticalAlign: 'top',
22
- justifyContent: 'flex-start',
23
- paddingLeft: palette.size.size8,
24
- paddingRight: palette.size.size16,
25
- paddingTop: palette.size.size16,
26
- paddingBottom: palette.size.size16,
27
- borderWidth: palette.border.border0,
28
- borderColor: palette.color.transparent,
29
- backgroundColor: palette.color.transparent
30
- },
31
- rules: [{ if: { expanded: true }, tokens: { icon: CaretUp } }]
32
- }
33
-
34
- // TODO: replace this with a build step similar to Palettes
35
- // https://github.com/telus/universal-design-system/issues/167
36
- validateComponentTheme(
37
- ExpandCollapseControl,
38
- getExpandCollapseControlSchema(palette),
39
- 'expand-collapse-control'
40
- )
41
-
42
- export default ExpandCollapseControl
@@ -1,26 +0,0 @@
1
- import palette from '@telus-uds/palette-allium'
2
- import { getExpandCollapsePanelSchema, validateComponentTheme } from '@telus-uds/tools-theme'
3
-
4
- const ExpandCollapsePanel = {
5
- appearances: {},
6
- tokens: {
7
- // animate slightly faster when closing
8
- expandDuration: 300,
9
- collapseDuration: 250,
10
- contentPaddingLeft: palette.size.size40,
11
- contentPaddingRight: palette.size.size16,
12
- contentPaddingTop: palette.size.size0,
13
- contentPaddingBottom: palette.size.size16
14
- },
15
- rules: []
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(
21
- ExpandCollapsePanel,
22
- getExpandCollapsePanelSchema(palette),
23
- 'expand-collapse-panel'
24
- )
25
-
26
- export default ExpandCollapsePanel
@@ -1,74 +0,0 @@
1
- import palette from '@telus-uds/palette-allium'
2
-
3
- import errorIcon from '@telus-uds/palette-allium/build/rn/icons/notification-error.icon.svg'
4
- import successIcon from '@telus-uds/palette-allium/build/rn/icons/notification-success.icon.svg'
5
- import {
6
- feedbackAppearances,
7
- getFeedbackSchema,
8
- validateComponentTheme
9
- } from '@telus-uds/tools-theme'
10
-
11
- const Feedback = {
12
- appearances: feedbackAppearances,
13
- tokens: {
14
- backgroundColor: palette.color.greyAthens,
15
- borderColor: palette.color.greyMystic,
16
- borderWidth: palette.border.border1,
17
- borderRadius: palette.radius.radius4,
18
- paddingTop: palette.size.size12,
19
- paddingBottom: palette.size.size12,
20
- paddingLeft: palette.size.size16,
21
- paddingRight: palette.size.size16,
22
- space: 2,
23
-
24
- color: palette.color.greyThunder,
25
- fontName: Object.keys(palette.font)[0],
26
- fontWeight: '400',
27
- lineHeight: palette.lineHeight.ratio3to2,
28
- titleFontSize: palette.fontSize.size16,
29
- contentFontSize: palette.fontSize.size14,
30
-
31
- icon: null,
32
- iconSize: palette.fontSize.size24,
33
- iconColor: palette.color.transparent,
34
- iconGap: palette.size.size8
35
- },
36
- rules: [
37
- {
38
- if: { state: 'success' },
39
- tokens: {
40
- backgroundColor: palette.color.greenPanache,
41
- borderColor: palette.color.greenPanache,
42
- color: palette.color.greenDarkFern
43
- }
44
- },
45
- {
46
- if: { state: 'error' },
47
- tokens: {
48
- backgroundColor: palette.color.redLight,
49
- borderColor: palette.color.redLight,
50
- color: palette.color.red
51
- }
52
- },
53
- {
54
- if: { state: 'success', icon: true },
55
- tokens: {
56
- icon: successIcon,
57
- iconColor: palette.color.greenAccessible
58
- }
59
- },
60
- {
61
- if: { state: 'error', icon: true },
62
- tokens: {
63
- icon: errorIcon,
64
- iconColor: palette.color.red
65
- }
66
- }
67
- ]
68
- }
69
-
70
- // TODO: replace this with a build step similar to Palettes
71
- // https://github.com/telus/universal-design-system/issues/167
72
- validateComponentTheme(Feedback, getFeedbackSchema(palette))
73
-
74
- export default Feedback
@@ -1,32 +0,0 @@
1
- import palette from '@telus-uds/palette-allium'
2
-
3
- export default {
4
- appearances: {
5
- size: {
6
- values: ['small'],
7
- type: 'variant'
8
- },
9
- rank: {
10
- values: ['primary'],
11
- type: 'variant'
12
- }
13
- },
14
- tokens: {
15
- size: 24,
16
- color: palette.color.greyCharcoal
17
- },
18
- rules: [
19
- {
20
- if: { size: 'small' },
21
- tokens: {
22
- size: 20
23
- }
24
- },
25
- {
26
- if: { rank: 'primary' },
27
- tokens: {
28
- color: palette.color.purpleTelus
29
- }
30
- }
31
- ]
32
- }
@@ -1,28 +0,0 @@
1
- import palette from '@telus-uds/palette-allium'
2
- import { getInputLabelSchema, validateComponentTheme } from '@telus-uds/tools-theme'
3
-
4
- const InputLabel = {
5
- appearances: {},
6
- tokens: {
7
- gap: palette.size.size8,
8
-
9
- color: palette.color.greyCharcoal,
10
- fontName: Object.keys(palette.font)[0],
11
- fontWeight: '700',
12
- fontSize: palette.fontSize.size16,
13
- lineHeight: palette.lineHeight.ratio3to2,
14
-
15
- hintColor: palette.color.greyCharcoal,
16
- hintFontName: Object.keys(palette.font)[0],
17
- hintFontWeight: '400',
18
- hintFontSize: palette.fontSize.size14,
19
- hintLineHeight: palette.lineHeight.ratio7to5
20
- },
21
- rules: []
22
- }
23
-
24
- // TODO: replace this with a build step similar to Palettes
25
- // https://github.com/telus/universal-design-system/issues/167
26
- validateComponentTheme(InputLabel, getInputLabelSchema(palette), 'input-label')
27
-
28
- export default InputLabel