@telus-uds/theme-allium 0.0.2-prerelease.3 → 0.1.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,232 +0,0 @@
1
- import palette from '@telus-uds/palette-allium'
2
- import { getLinkSchema, validateComponentTheme, linkAppearances } 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 Link = {
8
- appearances: {
9
- size: {
10
- description:
11
- 'Text sizes for block links; similar but not always identical to Typography sizes.',
12
- values: ['large', 'small', 'micro'],
13
- type: 'variant'
14
- },
15
- alternative: {
16
- description: 'Replaces the default green colour with a more subtle grey.',
17
- values: [true],
18
- type: 'variant'
19
- },
20
- inverse: {
21
- description: 'Styles the link white for use on dark backgrounds.',
22
- values: [true],
23
- type: 'variant'
24
- },
25
- light: {
26
- description:
27
- 'A lighter grey variant, used to lower the emphasis on a given Link (e.g. in Breadcrumbs)',
28
- values: [true]
29
- },
30
- component: linkAppearances.component,
31
- iconPosition: linkAppearances.iconPosition,
32
- focus: linkAppearances.focus,
33
- hover: linkAppearances.hover
34
- },
35
- tokens: {
36
- color: palette.color.greenAccessible,
37
-
38
- textLine: 'underline',
39
- textLineStyle: 'solid',
40
-
41
- outerBorderColor: palette.color.transparent,
42
- outerBorderWidth: palette.border.border2,
43
- outerBorderGap: palette.border.border2,
44
- outerBorderRadius: palette.radius.radius4,
45
-
46
- // Same as default size Typography
47
- blockFontWeight: '400',
48
- blockFontSize: palette.fontSize.size16,
49
- blockLineHeight: palette.lineHeight.ratio3to2,
50
- blockFontName: Object.keys(palette.font)[0],
51
- alignSelf: 'flex-start',
52
-
53
- icon: null,
54
- iconSize: palette.fontSize.size24,
55
- iconGapBefore: palette.size.size4,
56
- iconGapAfter: palette.size.size8,
57
- iconScale: 1,
58
- iconTranslateX: 0,
59
- iconTranslateY: 0
60
- },
61
- rules: [
62
- // Initial interaction states
63
- {
64
- if: { focus: true },
65
- tokens: {
66
- outerBorderColor: palette.color.greenAccessible,
67
- outerBorderOutline: 'none'
68
- }
69
- },
70
- {
71
- if: { hover: true },
72
- tokens: {
73
- color: palette.color.greenSanFelix,
74
- iconScale: 1.1
75
- }
76
- },
77
- {
78
- if: { pressed: true },
79
- tokens: {
80
- color: palette.color.greenDarkFern
81
- }
82
- },
83
- {
84
- if: { pressed: true, focus: true },
85
- tokens: {
86
- outerBorderColor: palette.color.greenDarkFern
87
- }
88
- },
89
-
90
- // block link sizes
91
- {
92
- if: { size: 'large' },
93
- tokens: {
94
- blockFontSize: palette.fontSize.size20,
95
- iconSize: palette.fontSize.size24,
96
- blockLineHeight: palette.lineHeight.ratio8to5
97
- }
98
- },
99
- {
100
- if: { size: 'small' },
101
- tokens: {
102
- blockFontSize: palette.fontSize.size14,
103
- iconSize: palette.fontSize.size20,
104
- blockLineHeight: palette.lineHeight.ratio10to7
105
- }
106
- },
107
- {
108
- if: { size: 'micro' },
109
- tokens: {
110
- blockFontSize: palette.fontSize.size12,
111
- blockFontWeight: '500',
112
- iconSize: palette.fontSize.size16,
113
- blockLineHeight: palette.lineHeight.ratio4to3
114
- }
115
- },
116
-
117
- // "alternative" variant
118
- {
119
- if: { alternative: true },
120
- tokens: {
121
- color: palette.color.greyThunder
122
- }
123
- },
124
- {
125
- if: { alternative: true, focus: true },
126
- tokens: {
127
- color: palette.color.greyCharcoal,
128
- outerBorderColor: palette.color.greyCharcoal
129
- }
130
- },
131
- {
132
- if: { alternative: true, hover: true },
133
- tokens: {
134
- color: palette.color.greyThunder
135
- }
136
- },
137
- {
138
- if: { alternative: true, pressed: true },
139
- tokens: {
140
- color: palette.color.greyThunder
141
- }
142
- },
143
-
144
- // "inverse" variant
145
- {
146
- if: { inverse: true },
147
- tokens: {
148
- color: palette.color.white
149
- }
150
- },
151
- {
152
- if: { inverse: true, hover: true },
153
- tokens: {
154
- color: palette.color.greyAthens
155
- }
156
- },
157
- {
158
- if: { inverse: true, focus: true },
159
- tokens: {
160
- outerBorderColor: palette.color.white,
161
- outerBorderOutline: 'none'
162
- }
163
- },
164
- {
165
- if: { inverse: true, pressed: true },
166
- tokens: {
167
- color: palette.color.greyMystic
168
- }
169
- },
170
- {
171
- if: { inverse: true, pressed: true, focus: true },
172
- tokens: {
173
- color: palette.color.greyMystic,
174
- outerBorderColor: palette.color.greyMystic
175
- }
176
- },
177
-
178
- // "light" variant
179
- {
180
- if: { light: true },
181
- tokens: {
182
- color: palette.color.greyShuttle
183
- }
184
- },
185
- {
186
- if: { light: true, focus: true },
187
- tokens: {
188
- color: palette.color.greyShuttle,
189
- outerBorderColor: palette.color.greyShuttle
190
- }
191
- },
192
- {
193
- if: { light: true, hover: true },
194
- tokens: {
195
- color: palette.color.greyCharcoal,
196
- textLine: 'none'
197
- }
198
- },
199
- {
200
- if: { component: 'ChevronLink' },
201
- tokens: { iconGapAfter: 0, iconGapBefore: 0 }
202
- },
203
- {
204
- if: { component: 'ChevronLink', iconPosition: 'left' },
205
- tokens: { icon: leftArrowIcon }
206
- },
207
- {
208
- if: { component: 'ChevronLink', iconPosition: 'right' },
209
- tokens: { icon: rightArrowIcon }
210
- },
211
- {
212
- if: { component: 'ChevronLink', iconPosition: 'left', hover: true },
213
- tokens: {
214
- iconTranslateX: -1 * palette.size.size4,
215
- iconScale: 1
216
- }
217
- },
218
- {
219
- if: { component: 'ChevronLink', iconPosition: 'right', hover: true },
220
- tokens: {
221
- iconTranslateX: palette.size.size4,
222
- iconScale: 1
223
- }
224
- }
225
- ]
226
- }
227
-
228
- // TODO: replace this with a build step similar to Palettes
229
- // https://github.com/telus/universal-design-system/issues/167
230
- validateComponentTheme(Link, getLinkSchema(palette), 'Link')
231
-
232
- export default Link
@@ -1,33 +0,0 @@
1
- import palette from '@telus-uds/palette-allium'
2
- import { getPaginationSchema, validateComponentTheme } from '@telus-uds/tools-theme'
3
- import { appearances } from '@telus-uds/system-constants'
4
-
5
- const Pagination = {
6
- appearances: {
7
- viewport: appearances.viewport
8
- },
9
- tokens: {
10
- gap: 2,
11
- truncateAbove: 4,
12
-
13
- color: palette.color.greyShuttle,
14
- fontName: Object.keys(palette.font)[0],
15
- fontWeight: '400',
16
- fontSize: palette.fontSize.size16,
17
- lineHeight: palette.lineHeight.ratio3to2
18
- },
19
- rules: [
20
- {
21
- if: { viewport: ['md', 'lg', 'xl'] },
22
- tokens: {
23
- truncateAbove: 6
24
- }
25
- }
26
- ]
27
- }
28
-
29
- // TODO: replace this with a build step similar to Palettes
30
- // https://github.com/telus/universal-design-system/issues/167
31
- validateComponentTheme(Pagination, getPaginationSchema(palette), 'pagination')
32
-
33
- export default Pagination
@@ -1,81 +0,0 @@
1
- import palette from '@telus-uds/palette-allium'
2
- import {
3
- buttonAppearances,
4
- getPaginationPageButtonSchema,
5
- lineOptions,
6
- validateComponentTheme
7
- } from '@telus-uds/tools-theme'
8
-
9
- const { focus, hover, pressed } = buttonAppearances
10
-
11
- const PaginationPageButton = {
12
- appearances: {
13
- focus,
14
- hover,
15
- pressed
16
- },
17
- tokens: {
18
- borderColor: palette.color.transparent,
19
- borderWidth: palette.border.border1,
20
- borderRadius: palette.radius.pill32,
21
- backgroundColor: palette.color.transparent,
22
- paddingLeft: palette.size.size8,
23
- paddingRight: palette.size.size8,
24
- paddingTop: palette.size.size4,
25
- paddingBottom: palette.size.size4,
26
- width: palette.size.size32,
27
-
28
- // never visible - used only to increase the click area size
29
- outerBorderColor: palette.color.transparent,
30
- outerBorderWidth: palette.border.border4,
31
- outerBorderGap: palette.border.border4,
32
-
33
- color: palette.color.greyShuttle,
34
- fontName: Object.keys(palette.font)[0],
35
- fontWeight: '400',
36
- fontSize: palette.fontSize.size16,
37
- lineHeight: palette.lineHeight.ratio3to2,
38
- textLine: lineOptions.underline
39
- },
40
- rules: [
41
- {
42
- if: { hover: true },
43
- tokens: {
44
- borderColor: palette.color.greyShuttle,
45
- textLine: lineOptions.none
46
- }
47
- },
48
- {
49
- if: { focus: true },
50
- tokens: {
51
- borderColor: palette.color.greyShuttle,
52
- borderWidth: palette.border.border3
53
- }
54
- },
55
- {
56
- if: { selected: true },
57
- tokens: {
58
- backgroundColor: palette.color.greyShuttle,
59
- color: palette.color.white,
60
- textLine: lineOptions.none
61
- }
62
- },
63
- {
64
- if: { pressed: true },
65
- tokens: {
66
- backgroundColor: palette.color.greyShuttle,
67
- color: palette.color.white
68
- }
69
- }
70
- ]
71
- }
72
-
73
- // TODO: replace this with a build step similar to Palettes
74
- // https://github.com/telus/universal-design-system/issues/167
75
- validateComponentTheme(
76
- PaginationPageButton,
77
- getPaginationPageButtonSchema(palette),
78
- 'pagination-page-button'
79
- )
80
-
81
- export default PaginationPageButton
@@ -1,120 +0,0 @@
1
- import palette from '@telus-uds/palette-allium'
2
- import {
3
- buttonAppearances,
4
- getPaginationSideButtonSchema,
5
- lineOptions,
6
- paginationSideButtonAppearances,
7
- validateComponentTheme
8
- } from '@telus-uds/tools-theme'
9
-
10
- import leftArrowIcon from '@telus-uds/palette-allium/build/rn/icons/arrow-left.icon.svg'
11
- import rightArrowIcon from '@telus-uds/palette-allium/build/rn/icons/arrow-right.icon.svg'
12
- import { appearances } from '@telus-uds/system-constants'
13
-
14
- const { focus, hover, pressed } = buttonAppearances
15
-
16
- const PaginationSideButton = {
17
- appearances: {
18
- viewport: appearances.viewport,
19
- focus,
20
- hover,
21
- pressed,
22
- ...paginationSideButtonAppearances
23
- },
24
- tokens: {
25
- borderColor: palette.color.transparent,
26
- borderWidth: palette.border.border1,
27
- borderRadius: palette.radius.radius4,
28
- backgroundColor: palette.color.transparent,
29
- paddingLeft: palette.size.size8,
30
- paddingRight: palette.size.size8,
31
- paddingTop: palette.size.size12,
32
- paddingBottom: palette.size.size12,
33
- outerBorderColor: palette.color.transparent,
34
-
35
- color: palette.color.greyShuttle,
36
- fontName: Object.keys(palette.font)[0],
37
- fontWeight: '400',
38
- fontSize: palette.fontSize.size16,
39
- lineHeight: palette.lineHeight.ratio3to2,
40
- textLine: lineOptions.underline,
41
-
42
- icon: null,
43
- iconSize: palette.fontSize.size24,
44
- iconTranslateX: palette.size.size0
45
- },
46
- rules: [
47
- {
48
- if: { viewport: ['xs', 'sm'] },
49
- tokens: {
50
- borderRadius: palette.radius.pill32,
51
- paddingTop: palette.size.size4,
52
- paddingBottom: palette.size.size4,
53
- width: 32
54
- }
55
- },
56
- {
57
- if: { hover: true },
58
- tokens: {
59
- borderColor: palette.color.greyShuttle,
60
- textLine: lineOptions.none
61
- }
62
- },
63
- {
64
- if: { focus: true },
65
- tokens: {
66
- borderColor: palette.color.greyShuttle,
67
- borderWidth: palette.border.border3
68
- }
69
- },
70
- {
71
- if: { selected: true },
72
- tokens: {
73
- backgroundColor: palette.color.greyShuttle,
74
- color: palette.color.white,
75
- textLine: lineOptions.none
76
- }
77
- },
78
- {
79
- if: { pressed: true },
80
- tokens: {
81
- backgroundColor: palette.color.greyShuttle,
82
- color: palette.color.white
83
- }
84
- },
85
- {
86
- if: { direction: 'previous' },
87
- tokens: {
88
- icon: leftArrowIcon
89
- }
90
- },
91
- {
92
- if: { direction: 'next' },
93
- tokens: {
94
- icon: rightArrowIcon
95
- }
96
- },
97
- {
98
- if: { direction: 'previous', hover: true },
99
- tokens: {
100
- iconTranslateX: -1 * palette.size.size4
101
- }
102
- },
103
- {
104
- if: { direction: 'next', hover: true },
105
- tokens: {
106
- iconTranslateX: palette.size.size4
107
- }
108
- }
109
- ]
110
- }
111
-
112
- // TODO: replace this with a build step similar to Palettes
113
- // https://github.com/telus/universal-design-system/issues/167
114
- validateComponentTheme(
115
- PaginationSideButton,
116
- getPaginationSideButtonSchema(palette),
117
- 'pagination-side-button'
118
- )
119
-
120
- export default PaginationSideButton
@@ -1,18 +0,0 @@
1
- import palette from '@telus-uds/palette-allium'
2
- import { getSideNavSchema, validateComponentTheme } from '@telus-uds/tools-theme'
3
-
4
- const SideNav = {
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(SideNav, getSideNavSchema(palette), 'side-nav')
17
-
18
- export default SideNav
@@ -1,116 +0,0 @@
1
- import palette from '@telus-uds/palette-allium'
2
- import {
3
- getSideNavItemSchema,
4
- sideNavItemAppearances,
5
- linkAppearances,
6
- validateComponentTheme
7
- } from '@telus-uds/tools-theme'
8
-
9
- const SideNavItem = {
10
- appearances: {
11
- ...sideNavItemAppearances,
12
- hover: linkAppearances.hover
13
- },
14
- tokens: {
15
- borderColor: palette.color.greyCloud,
16
- borderWidth: palette.border.border1,
17
- borderStyle: 'solid',
18
- paddingLeft: palette.size.size16,
19
- paddingRight: palette.size.size16,
20
- paddingTop: palette.size.size16,
21
- paddingBottom: palette.size.size16,
22
- justifyContent: 'space-between',
23
- color: palette.color.greyCharcoal,
24
- accentOffset: 0,
25
- accentPadding: 0,
26
- accentWidth: palette.size.size4,
27
- accentBackgroundColor: palette.color.transparent
28
- },
29
- rules: [
30
- {
31
- if: {
32
- active: true
33
- },
34
- tokens: {
35
- paddingLeft: palette.size.size12,
36
- accentBackgroundColor: palette.color.purpleTelus,
37
- color: palette.color.purpleTelus,
38
- fontWeight: '700'
39
- }
40
- },
41
- {
42
- if: {
43
- type: 'child'
44
- },
45
- tokens: {
46
- paddingLeft: palette.size.size36,
47
- borderWidth: palette.border.none,
48
- accentBackgroundColor: palette.color.greyAthens,
49
- accentOffset: palette.size.size16,
50
- fontSize: palette.fontSize.size14,
51
- lineHeight: palette.lineHeight.multiply140
52
- }
53
- },
54
- {
55
- if: {
56
- type: 'parent',
57
- active: true
58
- },
59
- tokens: {
60
- paddingLeft: palette.size.size12
61
- }
62
- },
63
- {
64
- if: {
65
- type: 'parent',
66
- active: true,
67
- expanded: true
68
- },
69
- tokens: {
70
- paddingLeft: palette.size.size16,
71
- accentBackgroundColor: palette.color.transparent,
72
- color: palette.color.greyCharcoal
73
- }
74
- },
75
- {
76
- if: {
77
- hover: true
78
- },
79
- tokens: {
80
- backgroundColor: palette.color.greyAthens,
81
- color: palette.color.purpleTelus
82
- }
83
- },
84
- {
85
- if: {
86
- type: 'child',
87
- active: true
88
- },
89
- tokens: {
90
- backgroundColor: palette.color.greyAthens,
91
- color: palette.color.purpleTelus,
92
- accentPadding: palette.size.size16,
93
- accentBackgroundColor: palette.color.purpleTelus
94
- }
95
- },
96
- {
97
- if: {
98
- type: 'child',
99
- active: false,
100
- hover: true
101
- },
102
- tokens: {
103
- accentBackgroundColor: palette.color.white,
104
- color: palette.color.greyCharcoal,
105
- accentOffset: 0,
106
- accentWidth: palette.size.size16
107
- }
108
- }
109
- ]
110
- }
111
-
112
- // TODO: replace this with a build step similar to Palettes
113
- // https://github.com/telus/universal-design-system/issues/167
114
- validateComponentTheme(SideNavItem, getSideNavItemSchema(palette), 'side-nav-item')
115
-
116
- export default SideNavItem
@@ -1,41 +0,0 @@
1
- import palette from '@telus-uds/palette-allium'
2
- import { getSideNavItemsGroupSchema, validateComponentTheme } from '@telus-uds/tools-theme'
3
-
4
- import CaretUp from '@telus-uds/palette-allium/build/rn/icons/caret-up.icon.svg'
5
- import CaretDown from '@telus-uds/palette-allium/build/rn/icons/caret-down.icon.svg'
6
-
7
- const SideNavItemsGroup = {
8
- appearances: {},
9
- tokens: {
10
- // animate slightly faster when closing
11
- expandDuration: 300,
12
- collapseDuration: 250,
13
- contentPaddingLeft: palette.size.size0,
14
- contentPaddingRight: palette.size.size0,
15
- contentPaddingTop: palette.size.size0,
16
- contentPaddingBottom: palette.size.size0,
17
- icon: CaretDown,
18
- iconColor: palette.color.purpleTelus,
19
- iconGap: palette.size.size8,
20
- iconSize: palette.size.size24,
21
- iconPosition: 'right',
22
- verticalAlign: 'middle',
23
- justifyContent: 'space-between'
24
- },
25
- rules: [
26
- {
27
- if: { expanded: true },
28
- tokens: { icon: CaretUp }
29
- }
30
- ]
31
- }
32
-
33
- // TODO: replace this with a build step similar to Palettes
34
- // https://github.com/telus/universal-design-system/issues/167
35
- validateComponentTheme(
36
- SideNavItemsGroup,
37
- getSideNavItemsGroupSchema(palette),
38
- 'side-nav-items-group'
39
- )
40
-
41
- export default SideNavItemsGroup
@@ -1,19 +0,0 @@
1
- import palette from '@telus-uds/palette-allium'
2
- import { getStackViewSchema, validateComponentTheme } from '@telus-uds/tools-theme'
3
-
4
- // This makes the React Native defaults explicit and allows them to be overridden with tokens
5
- const StackView = {
6
- appearances: {},
7
- tokens: {
8
- alignItems: 'stretch',
9
- justifyContent: 'flex-start',
10
- flexGrow: 0
11
- },
12
- rules: []
13
- }
14
-
15
- // TODO: replace this with a build step similar to Palettes
16
- // https://github.com/telus/universal-design-system/issues/167
17
- validateComponentTheme(StackView, getStackViewSchema(palette), 'stack-view')
18
-
19
- export default StackView