@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,195 +0,0 @@
1
- import palette from '@telus-uds/palette-allium'
2
- import { getLinkSchema, validateComponentTheme, linkAppearances } from '@telus-uds/tools-theme'
3
-
4
- const Link = {
5
- appearances: {
6
- size: {
7
- description:
8
- 'Text sizes for block links; similar but not always identical to Typography sizes.',
9
- values: ['large', 'small', 'micro'],
10
- type: 'variant'
11
- },
12
- alternative: {
13
- description: 'Replaces the default green colour with a more subtle grey.',
14
- values: [true],
15
- type: 'variant'
16
- },
17
- inverse: {
18
- description: 'Styles the link white for use on dark backgrounds.',
19
- values: [true],
20
- type: 'variant'
21
- },
22
- light: {
23
- description:
24
- 'A lighter grey variant, used to lower the emphasis on a given Link (e.g. in Breadcrumbs)',
25
- values: [true],
26
- type: 'variant'
27
- },
28
- iconPosition: linkAppearances.iconPosition,
29
- focus: linkAppearances.focus,
30
- hover: linkAppearances.hover
31
- },
32
- tokens: {
33
- color: palette.color.greenAccessible,
34
-
35
- textLine: 'underline',
36
- textLineStyle: 'solid',
37
-
38
- outerBorderColor: palette.color.transparent,
39
- outerBorderWidth: palette.border.border2,
40
- outerBorderGap: palette.border.border2,
41
- outerBorderRadius: palette.radius.radius4,
42
-
43
- // Same as default size Typography
44
- blockFontWeight: '400',
45
- blockFontSize: palette.fontSize.size16,
46
- blockLineHeight: palette.lineHeight.ratio3to2,
47
- blockFontName: Object.keys(palette.font)[0],
48
- alignSelf: 'flex-start',
49
-
50
- icon: null,
51
- iconSize: palette.fontSize.size24,
52
- iconGapBefore: palette.size.size4,
53
- iconGapAfter: palette.size.size8,
54
- iconTranslateX: 0,
55
- iconTranslateY: 0
56
- },
57
- rules: [
58
- // Initial interaction states
59
- {
60
- if: { focus: true },
61
- tokens: {
62
- outerBorderColor: palette.color.greenAccessible,
63
- outerBorderOutline: 'none'
64
- }
65
- },
66
- {
67
- if: { pressed: true },
68
- tokens: {
69
- color: palette.color.greenDarkFern
70
- }
71
- },
72
- {
73
- if: { pressed: true, focus: true },
74
- tokens: {
75
- outerBorderColor: palette.color.greenDarkFern
76
- }
77
- },
78
-
79
- // block link sizes
80
- {
81
- if: { size: 'large' },
82
- tokens: {
83
- blockFontSize: palette.fontSize.size20,
84
- iconSize: palette.fontSize.size24,
85
- blockLineHeight: palette.lineHeight.ratio8to5
86
- }
87
- },
88
- {
89
- if: { size: 'small' },
90
- tokens: {
91
- blockFontSize: palette.fontSize.size14,
92
- iconSize: palette.fontSize.size20,
93
- blockLineHeight: palette.lineHeight.ratio10to7
94
- }
95
- },
96
- {
97
- if: { size: 'micro' },
98
- tokens: {
99
- blockFontSize: palette.fontSize.size12,
100
- blockFontWeight: '500',
101
- iconSize: palette.fontSize.size16,
102
- blockLineHeight: palette.lineHeight.ratio4to3
103
- }
104
- },
105
-
106
- // "alternative" variant
107
- {
108
- if: { alternative: true },
109
- tokens: {
110
- color: palette.color.greyThunder
111
- }
112
- },
113
- {
114
- if: { alternative: true, focus: true },
115
- tokens: {
116
- color: palette.color.greyCharcoal,
117
- outerBorderColor: palette.color.greyCharcoal
118
- }
119
- },
120
- {
121
- if: { alternative: true, hover: true },
122
- tokens: {
123
- color: palette.color.greyThunder
124
- }
125
- },
126
- {
127
- if: { alternative: true, pressed: true },
128
- tokens: {
129
- color: palette.color.greyThunder
130
- }
131
- },
132
-
133
- // "inverse" variant
134
- {
135
- if: { inverse: true },
136
- tokens: {
137
- color: palette.color.white
138
- }
139
- },
140
- {
141
- if: { inverse: true, hover: true },
142
- tokens: {
143
- color: palette.color.greyAthens
144
- }
145
- },
146
- {
147
- if: { inverse: true, focus: true },
148
- tokens: {
149
- outerBorderColor: palette.color.white,
150
- outerBorderOutline: 'none'
151
- }
152
- },
153
- {
154
- if: { inverse: true, pressed: true },
155
- tokens: {
156
- color: palette.color.greyMystic
157
- }
158
- },
159
- {
160
- if: { inverse: true, pressed: true, focus: true },
161
- tokens: {
162
- color: palette.color.greyMystic,
163
- outerBorderColor: palette.color.greyMystic
164
- }
165
- },
166
-
167
- // "light" variant
168
- {
169
- if: { light: true },
170
- tokens: {
171
- color: palette.color.greyShuttle
172
- }
173
- },
174
- {
175
- if: { light: true, focus: true },
176
- tokens: {
177
- color: palette.color.greyShuttle,
178
- outerBorderColor: palette.color.greyShuttle
179
- }
180
- },
181
- {
182
- if: { light: true, hover: true },
183
- tokens: {
184
- color: palette.color.greyCharcoal,
185
- textLine: 'none'
186
- }
187
- }
188
- ]
189
- }
190
-
191
- // TODO: replace this with a build step similar to Palettes
192
- // https://github.com/telus/universal-design-system/issues/167
193
- validateComponentTheme(Link, getLinkSchema(palette), 'Link')
194
-
195
- 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,109 +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
- iconDisplace: 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
- iconDisplace: palette.size.size4
62
- }
63
- },
64
- {
65
- if: { focus: true },
66
- tokens: {
67
- borderColor: palette.color.greyShuttle,
68
- borderWidth: palette.border.border3
69
- }
70
- },
71
- {
72
- if: { selected: true },
73
- tokens: {
74
- backgroundColor: palette.color.greyShuttle,
75
- color: palette.color.white,
76
- textLine: lineOptions.none
77
- }
78
- },
79
- {
80
- if: { pressed: true },
81
- tokens: {
82
- backgroundColor: palette.color.greyShuttle,
83
- color: palette.color.white
84
- }
85
- },
86
- {
87
- if: { direction: 'previous' },
88
- tokens: {
89
- icon: leftArrowIcon
90
- }
91
- },
92
- {
93
- if: { direction: 'next' },
94
- tokens: {
95
- icon: rightArrowIcon
96
- }
97
- }
98
- ]
99
- }
100
-
101
- // TODO: replace this with a build step similar to Palettes
102
- // https://github.com/telus/universal-design-system/issues/167
103
- validateComponentTheme(
104
- PaginationSideButton,
105
- getPaginationSideButtonSchema(palette),
106
- 'pagination-side-button'
107
- )
108
-
109
- 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
@@ -1,86 +0,0 @@
1
- import palette from '@telus-uds/palette-allium'
2
- import {
3
- getTextInputSchema,
4
- textInputAppearances,
5
- validateComponentTheme
6
- } from '@telus-uds/tools-theme'
7
- import errorIcon from '@telus-uds/palette-allium/build/rn/icons/notification-error.icon.svg'
8
- import successIcon from '@telus-uds/palette-allium/build/rn/icons/notification-success.icon.svg'
9
-
10
- const TextInput = {
11
- appearances: {
12
- ...textInputAppearances
13
- },
14
- tokens: {
15
- backgroundColor: palette.color.white,
16
- color: palette.color.greyCharcoal,
17
- borderWidth: palette.border.border1,
18
- borderColor: palette.color.greyShuttle,
19
- borderRadius: palette.radius.radius4,
20
- paddingTop: palette.size.size12,
21
- paddingBottom: palette.size.size12,
22
- paddingLeft: palette.size.size16,
23
- paddingRight: palette.size.size16,
24
- space: 1,
25
-
26
- outerBackgroundColor: palette.color.transparent,
27
- outerBorderWidth: palette.border.border2,
28
- outerBorderColor: palette.color.transparent,
29
- outerBorderRadius: palette.radius.radius4,
30
-
31
- fontName: Object.keys(palette.font)[0],
32
- fontSize: palette.fontSize.size16,
33
- fontWeight: '400',
34
- lineHeight: palette.lineHeight.ratio3to2,
35
-
36
- icon: null,
37
- iconSize: palette.fontSize.size24,
38
- iconColor: palette.color.transparent
39
- },
40
- rules: [
41
- {
42
- if: { hover: true, inactive: null },
43
- tokens: {
44
- outerBorderColor: palette.color.greyMystic,
45
- outerBackgroundColor: palette.color.greyMystic
46
- }
47
- },
48
- {
49
- if: { validation: 'success' },
50
- tokens: {
51
- borderColor: palette.color.greenAccessible,
52
- icon: successIcon,
53
- iconColor: palette.color.greenAccessible
54
- }
55
- },
56
- {
57
- if: { validation: 'error' },
58
- tokens: {
59
- borderColor: palette.color.red,
60
- icon: errorIcon,
61
- iconColor: palette.color.red
62
- }
63
- },
64
- {
65
- if: { focus: true },
66
- tokens: {
67
- borderColor: palette.color.purpleDeluge,
68
- borderWidth: palette.border.border3,
69
- icon: null
70
- }
71
- },
72
- {
73
- if: { inactive: true },
74
- tokens: {
75
- backgroundColor: palette.color.greyAthens,
76
- borderColor: palette.color.greyAthens
77
- }
78
- }
79
- ]
80
- }
81
-
82
- // TODO: replace this with a build step similar to Palettes
83
- // https://github.com/telus/universal-design-system/issues/167
84
- validateComponentTheme(TextInput, getTextInputSchema(palette), 'text-input')
85
-
86
- export default TextInput