@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.
Files changed (78) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/lib/components/ActivityIndicator.js +35 -0
  3. package/lib/components/Box.js +89 -0
  4. package/lib/components/Button.js +252 -0
  5. package/lib/components/ButtonGroup.js +34 -0
  6. package/lib/components/ButtonGroupItem.js +108 -0
  7. package/lib/components/Card.js +120 -0
  8. package/lib/components/Checkbox.js +80 -0
  9. package/lib/components/ChevronLink.js +39 -0
  10. package/lib/components/Divider.js +44 -0
  11. package/lib/components/ExpandCollapse.js +23 -0
  12. package/lib/components/ExpandCollapseControl.js +49 -0
  13. package/lib/components/ExpandCollapsePanel.js +25 -0
  14. package/lib/components/Feedback.js +89 -0
  15. package/lib/components/Icon.js +47 -0
  16. package/lib/components/InputLabel.js +33 -0
  17. package/lib/components/InputSupports.js +19 -0
  18. package/lib/components/Link.js +241 -0
  19. package/lib/components/List.js +86 -0
  20. package/lib/components/Pagination.js +40 -0
  21. package/lib/components/PaginationPageButton.js +82 -0
  22. package/lib/components/PaginationSideButton.js +113 -0
  23. package/lib/components/Radio.js +78 -0
  24. package/lib/components/Select.js +102 -0
  25. package/lib/components/SideNav.js +23 -0
  26. package/lib/components/SideNavItem.js +118 -0
  27. package/lib/components/SideNavItemsGroup.js +49 -0
  28. package/lib/components/Skeleton.js +26 -0
  29. package/lib/components/StackView.js +22 -0
  30. package/lib/components/Tags.js +34 -0
  31. package/lib/components/TagsItem.js +133 -0
  32. package/lib/components/TextArea.js +20 -0
  33. package/lib/components/TextInput.js +97 -0
  34. package/lib/components/ToggleSwitch.js +144 -0
  35. package/lib/components/Tooltip.js +48 -0
  36. package/lib/components/TooltipButton.js +86 -0
  37. package/lib/components/Typography.js +370 -0
  38. package/lib/components/index.js +303 -0
  39. package/lib/components/spacingScale.js +163 -0
  40. package/lib/index.js +30 -0
  41. package/package.json +10 -7
  42. package/src/components/Box.js +12 -94
  43. package/src/components/Button.js +80 -111
  44. package/src/components/ButtonGroup.js +10 -16
  45. package/src/components/ButtonGroupItem.js +88 -0
  46. package/src/components/Card.js +99 -0
  47. package/src/components/Checkbox.js +65 -0
  48. package/src/components/ChevronLink.js +19 -0
  49. package/src/components/ExpandCollapse.js +3 -9
  50. package/src/components/ExpandCollapseControl.js +8 -21
  51. package/src/components/ExpandCollapsePanel.js +3 -14
  52. package/src/components/Feedback.js +75 -0
  53. package/src/components/Icon.js +6 -3
  54. package/src/components/InputLabel.js +29 -0
  55. package/src/components/InputSupports.js +9 -0
  56. package/src/components/Link.js +71 -92
  57. package/src/components/List.js +70 -0
  58. package/src/components/Pagination.js +10 -13
  59. package/src/components/PaginationPageButton.js +15 -25
  60. package/src/components/PaginationSideButton.js +23 -44
  61. package/src/components/Radio.js +64 -0
  62. package/src/components/Select.js +88 -0
  63. package/src/components/SideNav.js +3 -9
  64. package/src/components/SideNavItem.js +21 -22
  65. package/src/components/SideNavItemsGroup.js +11 -18
  66. package/src/components/Skeleton.js +16 -0
  67. package/src/components/StackView.js +12 -0
  68. package/src/components/Tags.js +16 -0
  69. package/src/components/TagsItem.js +118 -0
  70. package/src/components/TextArea.js +10 -0
  71. package/src/components/TextInput.js +83 -0
  72. package/src/components/ToggleSwitch.js +16 -23
  73. package/src/components/Tooltip.js +41 -0
  74. package/src/components/TooltipButton.js +68 -0
  75. package/src/components/Typography.js +112 -78
  76. package/src/components/index.js +37 -39
  77. package/src/components/spacingScale.js +36 -0
  78. package/src/index.js +1 -1
@@ -0,0 +1,88 @@
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'
4
+
5
+ import errorIcon from '@telus-uds/palette-allium/build/rn/icons/notification-error.icon.svg'
6
+ import successIcon from '@telus-uds/palette-allium/build/rn/icons/notification-success.icon.svg'
7
+ import caretDownIcon from '@telus-uds/palette-allium/build/rn/icons/caret-down.icon.svg'
8
+
9
+ const Select = {
10
+ appearances: {
11
+ validation: appearances.Select.validation,
12
+ hover: appearances.Select.hover,
13
+ focus: appearances.Select.focus,
14
+ inactive: appearances.Select.inactive
15
+ },
16
+ tokens: {
17
+ backgroundColor: palette.color.white,
18
+ color: palette.color.greyCharcoal,
19
+ borderWidth: palette.border.border1,
20
+ borderColor: palette.color.greyShuttle,
21
+ borderRadius: palette.radius.radius4,
22
+ paddingTop: palette.size.size12,
23
+ paddingBottom: palette.size.size12,
24
+ paddingLeft: palette.size.size16,
25
+ paddingRight: palette.size.size16,
26
+ height: palette.size.size48,
27
+
28
+ outerBackgroundColor: palette.color.transparent,
29
+ outerBorderWidth: palette.border.border2,
30
+ outerBorderColor: palette.color.transparent,
31
+ outerBorderRadius: palette.radius.radius4,
32
+
33
+ fontSize: palette.fontSize.size16,
34
+ // TODO replace with font token
35
+ fontName: Object.keys(palette.font)[0],
36
+ fontWeight: '400',
37
+
38
+ icon: caretDownIcon,
39
+ iconSize: palette.fontSize.size24,
40
+ iconColor: palette.color.greenAccessible,
41
+
42
+ validationIcon: system.icon.none,
43
+ validationIconSize: palette.fontSize.size24,
44
+ validationIconColor: palette.color.transparent
45
+ },
46
+ rules: [
47
+ {
48
+ if: { hover: true, inactive: null },
49
+ tokens: {
50
+ outerBorderColor: palette.color.greyMystic,
51
+ outerBackgroundColor: palette.color.greyMystic
52
+ }
53
+ },
54
+ {
55
+ if: { validation: 'success' },
56
+ tokens: {
57
+ borderColor: palette.color.greenAccessible,
58
+ validationIcon: successIcon,
59
+ validationIconColor: palette.color.greenAccessible
60
+ }
61
+ },
62
+ {
63
+ if: { validation: 'error' },
64
+ tokens: {
65
+ borderColor: palette.color.red,
66
+ validationIcon: errorIcon,
67
+ validationIconColor: palette.color.red
68
+ }
69
+ },
70
+ {
71
+ if: { focus: true },
72
+ tokens: {
73
+ borderColor: palette.color.purpleDeluge,
74
+ borderWidth: palette.border.border3,
75
+ validationIcon: system.icon.none
76
+ }
77
+ },
78
+ {
79
+ if: { inactive: true },
80
+ tokens: {
81
+ backgroundColor: palette.color.greyAthens,
82
+ borderColor: palette.color.greyAthens
83
+ }
84
+ }
85
+ ]
86
+ }
87
+
88
+ export default Select
@@ -1,18 +1,12 @@
1
1
  import palette from '@telus-uds/palette-allium'
2
- import { getSideNavSchema, validateComponentTheme } from '@telus-uds/tools-theme'
2
+ import system from '@telus-uds/system-themes/src/tokens/rn'
3
3
 
4
- const SideNav = {
4
+ export default {
5
5
  appearances: {},
6
6
  tokens: {
7
7
  borderColor: palette.color.greyCloud,
8
8
  borderWidth: palette.border.border1,
9
- borderStyle: 'solid'
9
+ borderStyle: system.borderStyle.solid
10
10
  },
11
11
  rules: []
12
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,30 +1,32 @@
1
1
  import palette from '@telus-uds/palette-allium'
2
- import {
3
- getSideNavItemSchema,
4
- sideNavItemAppearances,
5
- linkAppearances,
6
- validateComponentTheme
7
- } from '@telus-uds/tools-theme'
2
+ import system from '@telus-uds/system-themes/src/tokens/rn'
3
+ import { appearances } from '@telus-uds/system-themes/schema'
8
4
 
9
- const SideNavItem = {
5
+ export default {
10
6
  appearances: {
11
- ...sideNavItemAppearances,
12
- hover: linkAppearances.hover
7
+ active: appearances.SideNavItem.active,
8
+ type: appearances.SideNavItem.type,
9
+ expanded: appearances.SideNavItem.expanded,
10
+ hover: appearances.SideNavItem.hover
13
11
  },
14
12
  tokens: {
15
13
  borderColor: palette.color.greyCloud,
16
14
  borderWidth: palette.border.border1,
17
- borderStyle: 'solid',
15
+ borderStyle: system.borderStyle.solid,
18
16
  paddingLeft: palette.size.size16,
19
17
  paddingRight: palette.size.size16,
20
18
  paddingTop: palette.size.size16,
21
19
  paddingBottom: palette.size.size16,
22
- justifyContent: 'space-between',
20
+ justifyContent: system.flexJustifyContent.spaceBetween,
23
21
  color: palette.color.greyCharcoal,
24
- accentOffset: 0,
25
- accentPadding: 0,
22
+ accentOffset: system.size.zero,
23
+ accentPadding: system.size.zero,
26
24
  accentWidth: palette.size.size4,
27
- accentBackgroundColor: palette.color.transparent
25
+ accentBackgroundColor: palette.color.transparent,
26
+ fontSize: palette.fontSize.size16,
27
+ fontWeight: '400',
28
+ lineHeight: palette.lineHeight.ratio3to2,
29
+ backgroundColor: palette.color.transparent
28
30
  },
29
31
  rules: [
30
32
  {
@@ -35,7 +37,10 @@ const SideNavItem = {
35
37
  paddingLeft: palette.size.size12,
36
38
  accentBackgroundColor: palette.color.purpleTelus,
37
39
  color: palette.color.purpleTelus,
40
+
41
+ // TODO: replace with font token
38
42
  fontWeight: '700'
43
+ // font: palette.font.HelveticaNow[700]
39
44
  }
40
45
  },
41
46
  {
@@ -48,7 +53,7 @@ const SideNavItem = {
48
53
  accentBackgroundColor: palette.color.greyAthens,
49
54
  accentOffset: palette.size.size16,
50
55
  fontSize: palette.fontSize.size14,
51
- lineHeight: palette.lineHeight.multiply140
56
+ lineHeight: palette.lineHeight.ratio7to5
52
57
  }
53
58
  },
54
59
  {
@@ -102,15 +107,9 @@ const SideNavItem = {
102
107
  tokens: {
103
108
  accentBackgroundColor: palette.color.white,
104
109
  color: palette.color.greyCharcoal,
105
- accentOffset: 0,
110
+ accentOffset: system.size.zero,
106
111
  accentWidth: palette.size.size16
107
112
  }
108
113
  }
109
114
  ]
110
115
  }
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,15 +1,18 @@
1
1
  import palette from '@telus-uds/palette-allium'
2
- import { getSideNavItemsGroupSchema, validateComponentTheme } from '@telus-uds/tools-theme'
2
+ import system from '@telus-uds/system-themes/src/tokens/rn'
3
+ import { appearances } from '@telus-uds/system-themes/schema'
3
4
 
4
5
  import CaretUp from '@telus-uds/palette-allium/build/rn/icons/caret-up.icon.svg'
5
6
  import CaretDown from '@telus-uds/palette-allium/build/rn/icons/caret-down.icon.svg'
6
7
 
7
- const SideNavItemsGroup = {
8
- appearances: {},
8
+ export default {
9
+ appearances: {
10
+ expanded: appearances.SideNavItemGroup.expanded
11
+ },
9
12
  tokens: {
10
13
  // animate slightly faster when closing
11
- expandDuration: 300,
12
- collapseDuration: 250,
14
+ expandDuration: palette.duration.duration300,
15
+ collapseDuration: palette.duration.duration250,
13
16
  contentPaddingLeft: palette.size.size0,
14
17
  contentPaddingRight: palette.size.size0,
15
18
  contentPaddingTop: palette.size.size0,
@@ -18,9 +21,9 @@ const SideNavItemsGroup = {
18
21
  iconColor: palette.color.purpleTelus,
19
22
  iconGap: palette.size.size8,
20
23
  iconSize: palette.size.size24,
21
- iconPosition: 'right',
22
- verticalAlign: 'middle',
23
- justifyContent: 'space-between'
24
+ iconPosition: system.position.right,
25
+ verticalAlign: system.verticalAlign.middle,
26
+ justifyContent: system.flexJustifyContent.spaceBetween
24
27
  },
25
28
  rules: [
26
29
  {
@@ -29,13 +32,3 @@ const SideNavItemsGroup = {
29
32
  }
30
33
  ]
31
34
  }
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
@@ -0,0 +1,16 @@
1
+ import palette from '@telus-uds/palette-allium'
2
+
3
+ const Skeleton = {
4
+ appearances: {},
5
+ tokens: {
6
+ color: palette.color.greyCloud,
7
+ size: palette.border.border3,
8
+ radius: palette.size.size120,
9
+ baseWidth: palette.size.size40,
10
+ characters: palette.size.size10,
11
+ spaceBetweenLines: palette.size.size2,
12
+ squareRadius: palette.size.size4
13
+ },
14
+ rules: []
15
+ }
16
+ export default Skeleton
@@ -0,0 +1,12 @@
1
+ import system from '@telus-uds/system-themes/src/tokens/rn'
2
+
3
+ // This makes the React Native defaults explicit and allows them to be overridden with tokens
4
+ export default {
5
+ appearances: {},
6
+ tokens: {
7
+ alignItems: system.flexAlign.stretch,
8
+ justifyContent: system.flexJustifyContent.flexStart,
9
+ flexGrow: system.integer[0]
10
+ },
11
+ rules: []
12
+ }
@@ -0,0 +1,16 @@
1
+ import system from '@telus-uds/system-themes/src/tokens/rn'
2
+ import { appearances } from '@telus-uds/system-themes/schema'
3
+
4
+ export default {
5
+ appearances: {
6
+ viewport: appearances.system.viewport
7
+ },
8
+ tokens: {
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
+ },
15
+ rules: [{ if: { viewport: ['lg', 'xl'] }, tokens: { space: system.integer[3] } }]
16
+ }
@@ -0,0 +1,118 @@
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'
4
+
5
+ import addIcon from '@telus-uds/palette-allium/build/rn/icons/add.icon.svg'
6
+ import closeIcon from '@telus-uds/palette-allium/build/rn/icons/close.icon.svg'
7
+
8
+ // console.log({ addIcon, closeIcon, size16: palette.size.size16 })
9
+
10
+ export default {
11
+ appearances: {
12
+ hover: appearances.TagsItem.hover,
13
+ focus: appearances.TagsItem.focus,
14
+ pressed: appearances.TagsItem.pressed,
15
+ selected: appearances.TagsItem.selected,
16
+ inactive: appearances.TagsItem.inactive
17
+ },
18
+ tokens: {
19
+ // Icon tokens
20
+ iconSize: palette.size.size16,
21
+ iconColor: palette.color.greyThunder,
22
+ iconTranslateX: system.integer[0],
23
+ iconTranslateY: system.integer[0],
24
+
25
+ icon: addIcon,
26
+ iconPosition: system.position.right,
27
+ iconSpace: system.integer[2],
28
+ iconBackground: palette.color.greyAthens,
29
+ iconBorderRadius: palette.radius.pill32,
30
+ iconAlignSelf: system.flexAlign.center,
31
+ iconPadding: palette.size.size2,
32
+
33
+ // Button tokens, very similar to ButtonGroup
34
+ borderColor: palette.color.greyCloud,
35
+ borderWidth: palette.border.border1,
36
+ borderRadius: palette.radius.pill32,
37
+ shadow: system.shadow.none,
38
+
39
+ fontSize: palette.fontSize.size14,
40
+ color: palette.color.greyShuttle,
41
+ lineHeight: palette.lineHeight.ratio10to7,
42
+ textAlign: system.flexJustifyContent.center,
43
+ alignSelf: system.flexAlign.center,
44
+ // TODO: replace with font token
45
+ fontName: Object.keys(palette.font)[0],
46
+ fontWeight: '700',
47
+ // font: palette.font.HelveticaNow['700'],
48
+
49
+ backgroundColor: palette.color.white,
50
+ opacity: system.opacity.opaque,
51
+ paddingLeft: palette.size.size16,
52
+ paddingRight: palette.size.size8,
53
+ paddingTop: palette.size.size8,
54
+ paddingBottom: palette.size.size8,
55
+ width: system.size.none,
56
+ minWidth: system.size.zero,
57
+
58
+ outerBorderColor: palette.color.transparent,
59
+ outerBorderWidth: palette.border.border2,
60
+ outerBorderGap: palette.border.border2,
61
+ outerBorderRadius: palette.radius.pill32,
62
+ outerBackgroundColor: palette.color.transparent
63
+ },
64
+ rules: [
65
+ {
66
+ if: { focus: true },
67
+ tokens: {
68
+ borderColor: palette.color.purpleTelus,
69
+ borderWidth: palette.border.border3,
70
+ color: palette.color.greyCharcoal,
71
+ outerBorderColor: palette.color.transparent
72
+ }
73
+ },
74
+ { if: { hover: true }, tokens: { borderWidth: palette.border.border3 } },
75
+ {
76
+ if: { selected: true },
77
+ tokens: {
78
+ borderWidth: palette.border.none,
79
+ backgroundColor: palette.color.purpleTelus,
80
+ color: palette.color.white,
81
+
82
+ icon: closeIcon,
83
+ iconColor: palette.color.white,
84
+ iconBackground: palette.color.purpleDeluge
85
+ }
86
+ },
87
+ {
88
+ if: { pressed: true },
89
+ tokens: {
90
+ borderWidth: palette.border.none,
91
+ backgroundColor: palette.color.greyShuttle,
92
+ color: palette.color.white,
93
+
94
+ iconColor: palette.color.white,
95
+ iconBackground: palette.color.greyCharcoal
96
+ }
97
+ },
98
+ {
99
+ if: { focus: true, pressed: true },
100
+ tokens: {
101
+ borderWidth: palette.border.none,
102
+ backgroundColor: palette.color.purpleTelus,
103
+ color: palette.color.white,
104
+
105
+ iconColor: palette.color.white,
106
+ iconBackground: palette.color.purpleDark
107
+ }
108
+ },
109
+ {
110
+ if: { inactive: true },
111
+ tokens: {
112
+ backgroundColor: palette.color.greyCloud,
113
+ color: palette.color.white,
114
+ borderWidth: system.border.zero
115
+ }
116
+ }
117
+ ]
118
+ }
@@ -0,0 +1,10 @@
1
+ import system from '@telus-uds/system-themes/src/tokens/rn'
2
+
3
+ export default {
4
+ appearances: {},
5
+ tokens: {
6
+ minLines: system.integer[5],
7
+ maxLines: system.integer[8]
8
+ },
9
+ rules: []
10
+ }
@@ -0,0 +1,83 @@
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'
4
+
5
+ import errorIcon from '@telus-uds/palette-allium/build/rn/icons/notification-error.icon.svg'
6
+ import successIcon from '@telus-uds/palette-allium/build/rn/icons/notification-success.icon.svg'
7
+
8
+ export default {
9
+ appearances: {
10
+ validation: appearances.TextInput.validation,
11
+ hover: appearances.TextInput.hover,
12
+ focus: appearances.TextInput.focus,
13
+ inactive: appearances.TextInput.inactive
14
+ },
15
+ tokens: {
16
+ backgroundColor: palette.color.white,
17
+ color: palette.color.greyCharcoal,
18
+ borderWidth: palette.border.border1,
19
+ borderColor: palette.color.greyShuttle,
20
+ borderRadius: palette.radius.radius4,
21
+ paddingTop: palette.size.size12,
22
+ paddingBottom: palette.size.size12,
23
+ paddingLeft: palette.size.size16,
24
+ paddingRight: palette.size.size16,
25
+
26
+ outerBackgroundColor: palette.color.transparent,
27
+ outerBorderWidth: palette.border.border2,
28
+ outerBorderColor: palette.color.transparent,
29
+ outerBorderRadius: palette.radius.radius4,
30
+
31
+ // TODO: replace this with font token
32
+ fontName: Object.keys(palette.font)[0],
33
+ fontWeight: '400',
34
+ // font: palette.font.HelveticaNow[400]
35
+
36
+ fontSize: palette.fontSize.size16,
37
+ lineHeight: palette.lineHeight.ratio3to2,
38
+
39
+ icon: system.icon.none,
40
+ iconSize: palette.fontSize.size24,
41
+ iconColor: palette.color.transparent
42
+ },
43
+ rules: [
44
+ {
45
+ if: { hover: true, inactive: null },
46
+ tokens: {
47
+ outerBorderColor: palette.color.greyMystic,
48
+ outerBackgroundColor: palette.color.greyMystic
49
+ }
50
+ },
51
+ {
52
+ if: { validation: 'success' },
53
+ tokens: {
54
+ borderColor: palette.color.greenAccessible,
55
+ icon: successIcon,
56
+ iconColor: palette.color.greenAccessible
57
+ }
58
+ },
59
+ {
60
+ if: { validation: 'error' },
61
+ tokens: {
62
+ borderColor: palette.color.red,
63
+ icon: errorIcon,
64
+ iconColor: palette.color.red
65
+ }
66
+ },
67
+ {
68
+ if: { focus: true },
69
+ tokens: {
70
+ borderColor: palette.color.purpleDeluge,
71
+ borderWidth: palette.border.border3,
72
+ icon: system.icon.none
73
+ }
74
+ },
75
+ {
76
+ if: { inactive: true },
77
+ tokens: {
78
+ backgroundColor: palette.color.greyAthens,
79
+ borderColor: palette.color.greyAthens
80
+ }
81
+ }
82
+ ]
83
+ }
@@ -1,18 +1,16 @@
1
1
  import palette from '@telus-uds/palette-allium'
2
- import {
3
- toggleSwitchAppearances,
4
- getToggleSwitchSchema,
5
- validateComponentTheme
6
- } from '@telus-uds/tools-theme'
2
+ import system from '@telus-uds/system-themes/src/tokens/rn'
3
+ import { appearances } from '@telus-uds/system-themes/schema'
4
+
7
5
  import checkmarkIcon from '@telus-uds/palette-allium/build/rn/icons/checkmark.icon.svg'
8
6
 
9
- const ToggleSwitch = {
7
+ export default {
10
8
  appearances: {
11
- focus: toggleSwitchAppearances.focus,
12
- hover: toggleSwitchAppearances.hover,
13
- pressed: toggleSwitchAppearances.pressed,
14
- inactive: toggleSwitchAppearances.inactive,
15
- selected: toggleSwitchAppearances.selected
9
+ focus: appearances.ToggleSwitch.focus,
10
+ hover: appearances.ToggleSwitch.hover,
11
+ pressed: appearances.ToggleSwitch.pressed,
12
+ inactive: appearances.ToggleSwitch.inactive,
13
+ selected: appearances.ToggleSwitch.selected
16
14
  },
17
15
  tokens: {
18
16
  borderColor: palette.color.transparent,
@@ -24,14 +22,15 @@ const ToggleSwitch = {
24
22
  outerBorderRadius: palette.radius.pill32,
25
23
  outerBackgroundColor: palette.color.transparent,
26
24
  backgroundColor: palette.color.greyShuttle,
27
- opacity: 1,
28
- paddingLeft: 0,
29
- paddingRight: 0,
30
- paddingTop: 0,
31
- paddingBottom: 0,
25
+ opacity: system.opacity.opaque,
26
+ paddingLeft: system.size.zero,
27
+ paddingRight: system.size.zero,
28
+ paddingTop: system.size.zero,
29
+ paddingBottom: system.size.zero,
32
30
  shadow: palette.shadow.surfaceInset,
31
+ alignSelf: 'flex-start',
33
32
 
34
- icon: null,
33
+ icon: system.icon.none,
35
34
  width: palette.size.size40,
36
35
  trackBorderWidth: palette.border.border3,
37
36
  trackBorderColor: palette.color.transparent,
@@ -117,9 +116,3 @@ const ToggleSwitch = {
117
116
  }
118
117
  ]
119
118
  }
120
-
121
- // TODO: replace this with a build step similar to Palettes
122
- // https://github.com/telus/universal-design-system/issues/167
123
- validateComponentTheme(ToggleSwitch, getToggleSwitchSchema(palette), 'ToggleSwitch')
124
-
125
- export default ToggleSwitch
@@ -0,0 +1,41 @@
1
+ import palette from '@telus-uds/palette-allium'
2
+
3
+ export default {
4
+ appearances: {
5
+ inverse: {
6
+ values: [true],
7
+ type: 'variant'
8
+ }
9
+ },
10
+ tokens: {
11
+ backgroundColor: palette.color.greyThunder,
12
+ paddingTop: palette.size.size8,
13
+ paddingBottom: palette.size.size8,
14
+ paddingLeft: palette.size.size16,
15
+ paddingRight: palette.size.size16,
16
+ borderRadius: palette.radius.radius8,
17
+ shadow: palette.shadow.elevation1,
18
+
19
+ color: palette.color.white,
20
+ fontSize: palette.fontSize.size14,
21
+ lineHeight: palette.lineHeight.ratio3to2,
22
+
23
+ // TODO: replace with font token
24
+ fontName: Object.keys(palette.font)[0],
25
+ fontWeight: '400',
26
+ // font: palette.font.HelveticaNow[400]
27
+
28
+ arrowWidth: palette.size.size16,
29
+ arrowBorderRadius: palette.radius.radius1,
30
+ arrowOffset: palette.size.size4
31
+ },
32
+ rules: [
33
+ {
34
+ if: { inverse: true },
35
+ tokens: {
36
+ backgroundColor: palette.color.white,
37
+ color: palette.color.greyCharcoal
38
+ }
39
+ }
40
+ ]
41
+ }
@@ -0,0 +1,68 @@
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'
4
+
5
+ import questionIcon from '@telus-uds/palette-allium/build/rn/icons/question.icon.svg'
6
+
7
+ export default {
8
+ appearances: {
9
+ focus: appearances.TooltipButton.focus,
10
+ hover: appearances.TooltipButton.hover,
11
+ pressed: appearances.TooltipButton.pressed,
12
+ inverse: {
13
+ values: [true],
14
+ type: 'variant'
15
+ }
16
+ },
17
+ tokens: {
18
+ outerBorderColor: palette.color.transparent,
19
+ outerBorderWidth: palette.border.border1,
20
+ outerBorderGap: palette.size.size4,
21
+ outerBorderRadius: palette.radius.pill32,
22
+ borderRadius: palette.radius.pill32,
23
+ width: palette.size.size16,
24
+
25
+ icon: questionIcon,
26
+ iconScale: system.iconScale.scale1,
27
+ iconSize: palette.size.size16,
28
+ iconColor: palette.color.greyThunder
29
+ },
30
+ rules: [
31
+ {
32
+ if: { inverse: true },
33
+ tokens: {
34
+ iconColor: palette.color.white
35
+ }
36
+ },
37
+ {
38
+ if: { hover: true },
39
+ tokens: {
40
+ iconScale: system.iconScale.scale1_25
41
+ }
42
+ },
43
+ {
44
+ if: { pressed: true },
45
+ tokens: {
46
+ iconColor: palette.color.greyShuttle
47
+ }
48
+ },
49
+ {
50
+ if: { inverse: true, pressed: true },
51
+ tokens: {
52
+ iconColor: palette.color.greyCloud
53
+ }
54
+ },
55
+ {
56
+ if: { focus: true },
57
+ tokens: {
58
+ outerBorderColor: palette.color.greyShuttle
59
+ }
60
+ },
61
+ {
62
+ if: { inverse: true, focus: true },
63
+ tokens: {
64
+ outerBorderColor: palette.color.greyCloud
65
+ }
66
+ }
67
+ ]
68
+ }