@telus-uds/theme-allium 0.0.2-prerelease.4 → 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 +19 -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 +7 -7
  42. package/src/components/Box.js +3 -9
  43. package/src/components/Button.js +27 -72
  44. package/src/components/ButtonGroup.js +10 -17
  45. package/src/components/ButtonGroupItem.js +88 -0
  46. package/src/components/Card.js +4 -3
  47. package/src/components/Checkbox.js +65 -0
  48. package/src/components/ChevronLink.js +10 -11
  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 +20 -19
  53. package/src/components/Icon.js +6 -3
  54. package/src/components/InputLabel.js +9 -8
  55. package/src/components/InputSupports.js +9 -0
  56. package/src/components/Link.js +39 -23
  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 +22 -32
  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 +5 -12
  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 +14 -17
  72. package/src/components/ToggleSwitch.js +16 -23
  73. package/src/components/Tooltip.js +4 -8
  74. package/src/components/TooltipButton.js +8 -14
  75. package/src/components/Typography.js +58 -13
  76. package/src/components/index.js +37 -57
  77. package/src/components/spacingScale.js +4 -14
  78. package/src/index.js +1 -1
@@ -1,15 +1,14 @@
1
1
  import palette from '@telus-uds/palette-allium'
2
- import {
3
- buttonAppearances,
4
- getTooltipButtonSchema,
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'
7
4
 
8
5
  import questionIcon from '@telus-uds/palette-allium/build/rn/icons/question.icon.svg'
9
6
 
10
- const TooltipButton = {
7
+ export default {
11
8
  appearances: {
12
- ...buttonAppearances,
9
+ focus: appearances.TooltipButton.focus,
10
+ hover: appearances.TooltipButton.hover,
11
+ pressed: appearances.TooltipButton.pressed,
13
12
  inverse: {
14
13
  values: [true],
15
14
  type: 'variant'
@@ -24,6 +23,7 @@ const TooltipButton = {
24
23
  width: palette.size.size16,
25
24
 
26
25
  icon: questionIcon,
26
+ iconScale: system.iconScale.scale1,
27
27
  iconSize: palette.size.size16,
28
28
  iconColor: palette.color.greyThunder
29
29
  },
@@ -37,7 +37,7 @@ const TooltipButton = {
37
37
  {
38
38
  if: { hover: true },
39
39
  tokens: {
40
- iconScale: 1.25
40
+ iconScale: system.iconScale.scale1_25
41
41
  }
42
42
  },
43
43
  {
@@ -66,9 +66,3 @@ const TooltipButton = {
66
66
  }
67
67
  ]
68
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(TooltipButton, getTooltipButtonSchema(palette), 'tooltip-button')
73
-
74
- export default TooltipButton
@@ -1,8 +1,8 @@
1
1
  import palette from '@telus-uds/palette-allium'
2
- import { getTypographySchema, validateComponentTheme } from '@telus-uds/tools-theme'
3
- import { appearances } from '@telus-uds/system-constants'
2
+ import system from '@telus-uds/system-themes/src/tokens/rn'
3
+ import { appearances } from '@telus-uds/system-themes/schema'
4
4
 
5
- const Typography = {
5
+ export default {
6
6
  appearances: {
7
7
  size: {
8
8
  description: `Styles text as body or heading text with a given size. Smaller numbers indicate larger sizes,
@@ -12,6 +12,7 @@ accessibility or SEO-related properties; use the heading prop if text should be
12
12
  'micro',
13
13
  'small',
14
14
  'large',
15
+ 'eyebrow',
15
16
  'h1',
16
17
  'h2',
17
18
  'h3',
@@ -46,15 +47,19 @@ accessibility or SEO-related properties; use the heading prop if text should be
46
47
  values: [true],
47
48
  type: 'variant'
48
49
  },
49
- viewport: appearances.viewport
50
+ viewport: appearances.system.viewport
50
51
  },
51
52
  tokens: {
53
+ // TODO: replace with font token
54
+ fontName: Object.keys(palette.font)[0],
52
55
  fontWeight: '400',
56
+ // font: palette.font.HelveticaNow[400]
57
+
53
58
  fontSize: palette.fontSize.size16,
54
59
  color: palette.color.greyThunder,
55
60
  lineHeight: palette.lineHeight.ratio3to2,
56
- textTransform: 'none',
57
- fontName: Object.keys(palette.font)[0],
61
+ letterSpacing: system.letterSpacing.none,
62
+ textTransform: system.textTransform.none,
58
63
  fontScaleCap: palette.fontSize.size64
59
64
  },
60
65
  rules: [
@@ -113,7 +118,11 @@ accessibility or SEO-related properties; use the heading prop if text should be
113
118
  if: { size: 'display1' },
114
119
  tokens: {
115
120
  fontSize: palette.fontSize.size40,
121
+
122
+ // TODO: replace with font token
116
123
  fontWeight: '300',
124
+ // font: palette.font.HelveticaNow[300]
125
+
117
126
  lineHeight: palette.lineHeight.ratio6to5,
118
127
  letterSpacing: palette.letterSpacing.medium
119
128
  }
@@ -131,7 +140,11 @@ accessibility or SEO-related properties; use the heading prop if text should be
131
140
  if: { size: 'display2' },
132
141
  tokens: {
133
142
  fontSize: palette.fontSize.size36,
143
+
144
+ // TODO: replace with font token
134
145
  fontWeight: '400',
146
+ // font: palette.font.HelveticaNow[400]
147
+
135
148
  letterSpacing: palette.letterSpacing.medium,
136
149
  lineHeight: palette.lineHeight.ratio11to9
137
150
  }
@@ -140,7 +153,11 @@ accessibility or SEO-related properties; use the heading prop if text should be
140
153
  if: { size: 'display2', viewport: ['lg', 'xl'] },
141
154
  tokens: {
142
155
  fontSize: palette.fontSize.size56,
156
+
157
+ // TODO: replace with font token
143
158
  fontWeight: '300',
159
+ // font: palette.font.HelveticaNow[300]
160
+
144
161
  lineHeight: palette.lineHeight.ratio8to7,
145
162
  letterSpacing: palette.letterSpacing.condensed
146
163
  }
@@ -159,7 +176,11 @@ accessibility or SEO-related properties; use the heading prop if text should be
159
176
  if: { size: 'h1', viewport: ['lg', 'xl'] },
160
177
  tokens: {
161
178
  fontSize: palette.fontSize.size40,
179
+
180
+ // TODO: replace with font token
162
181
  fontWeight: '300',
182
+ // font: palette.font.HelveticaNow[300]
183
+
163
184
  lineHeight: palette.lineHeight.ratio6to5,
164
185
  letterSpacing: palette.letterSpacing.medium
165
186
  }
@@ -170,7 +191,11 @@ accessibility or SEO-related properties; use the heading prop if text should be
170
191
  if: { size: 'h2' },
171
192
  tokens: {
172
193
  fontSize: palette.fontSize.size24,
194
+
195
+ // TODO: replace with font token
173
196
  fontWeight: '500',
197
+ // font: palette.font.HelveticaNow[500]
198
+
174
199
  lineHeight: palette.lineHeight.ratio4to3
175
200
  }
176
201
  },
@@ -188,7 +213,11 @@ accessibility or SEO-related properties; use the heading prop if text should be
188
213
  if: { size: 'h3' },
189
214
  tokens: {
190
215
  fontSize: palette.fontSize.size20,
216
+
217
+ // TODO: replace with font token
191
218
  fontWeight: '500',
219
+ // font: palette.font.HelveticaNow[500]
220
+
192
221
  lineHeight: palette.lineHeight.ratio7to5
193
222
  }
194
223
  },
@@ -205,7 +234,11 @@ accessibility or SEO-related properties; use the heading prop if text should be
205
234
  if: { size: 'h4' },
206
235
  tokens: {
207
236
  fontSize: palette.fontSize.size16,
237
+
238
+ // TODO: replace with font token
208
239
  fontWeight: '500',
240
+ // font: palette.font.HelveticaNow[500]
241
+
209
242
  lineHeight: palette.lineHeight.ratio3to2
210
243
  }
211
244
  },
@@ -215,7 +248,11 @@ accessibility or SEO-related properties; use the heading prop if text should be
215
248
  if: { size: 'h5' },
216
249
  tokens: {
217
250
  fontSize: palette.fontSize.size14,
251
+
252
+ // TODO: replace with font token
218
253
  fontWeight: '500',
254
+ // font: palette.font.HelveticaNow[500]
255
+
219
256
  lineHeight: palette.lineHeight.ratio9to7
220
257
  }
221
258
  },
@@ -225,7 +262,11 @@ accessibility or SEO-related properties; use the heading prop if text should be
225
262
  if: { size: 'h6' },
226
263
  tokens: {
227
264
  fontSize: palette.fontSize.size12,
265
+
266
+ // TODO: replace with font token
228
267
  fontWeight: '700',
268
+ // font: palette.font.HelveticaNow[700]
269
+
229
270
  lineHeight: palette.lineHeight.ratio4to3
230
271
  }
231
272
  },
@@ -274,7 +315,11 @@ accessibility or SEO-related properties; use the heading prop if text should be
274
315
  if: { size: 'micro' },
275
316
  tokens: {
276
317
  fontSize: palette.fontSize.size12,
318
+
319
+ // TODO: replace with font token
277
320
  fontWeight: '500',
321
+ // font: palette.font.HelveticaNow[500]
322
+
278
323
  lineHeight: palette.lineHeight.ratio4to3
279
324
  }
280
325
  },
@@ -284,8 +329,12 @@ accessibility or SEO-related properties; use the heading prop if text should be
284
329
  if: { size: 'eyebrow' },
285
330
  tokens: {
286
331
  fontSize: palette.fontSize.size14,
332
+
333
+ // TODO: replace with font token
287
334
  fontWeight: '700',
288
- textTransform: 'uppercase',
335
+ // font: palette.font.HelveticaNow[700]
336
+
337
+ textTransform: system.textTransform.uppercase,
289
338
  lineHeight: palette.lineHeight.ratio9to7
290
339
  }
291
340
  },
@@ -297,14 +346,10 @@ accessibility or SEO-related properties; use the heading prop if text should be
297
346
  if: { size: ['large', null, 'small', 'micro'], bold: true },
298
347
  description: 'Bold is only available on body text styles, not headings',
299
348
  tokens: {
349
+ // TODO: replace with font token
300
350
  fontWeight: '700'
351
+ // font: palette.font.HelveticaNow[700]
301
352
  }
302
353
  }
303
354
  ]
304
355
  }
305
-
306
- // TODO: replace this with a build step similar to Palettes
307
- // https://github.com/telus/universal-design-system/issues/167
308
- validateComponentTheme(Typography, getTypographySchema(palette))
309
-
310
- export default Typography
@@ -1,57 +1,37 @@
1
- import ActivityIndicator from './ActivityIndicator'
2
- import Box from './Box'
3
- import Button from './Button'
4
- import ButtonGroup from './ButtonGroup'
5
- import Card from './Card'
6
- import ChevronLink from './ChevronLink'
7
- import Divider from './Divider'
8
- import ExpandCollapse from './ExpandCollapse'
9
- import ExpandCollapseControl from './ExpandCollapseControl'
10
- import ExpandCollapsePanel from './ExpandCollapsePanel'
11
- import Feedback from './Feedback'
12
- import Icon from './Icon'
13
- import InputLabel from './InputLabel'
14
- import Link from './Link'
15
- import TextInput from './TextInput'
16
- import ToggleSwitch from './ToggleSwitch'
17
- import Tooltip from './Tooltip'
18
- import TooltipButton from './TooltipButton'
19
- import Typography from './Typography'
20
- import SideNav from './SideNav'
21
- import SideNavItem from './SideNavItem'
22
- import SideNavItemsGroup from './SideNavItemsGroup'
23
- import Pagination from './Pagination'
24
- import PaginationPageButton from './PaginationPageButton'
25
- import PaginationSideButton from './PaginationSideButton'
26
- import StackView from './StackView'
27
- import spacingScale from './spacingScale'
28
-
29
- export default {
30
- ActivityIndicator,
31
- Box,
32
- Button,
33
- ButtonGroup,
34
- Card,
35
- ChevronLink,
36
- Divider,
37
- ExpandCollapse,
38
- ExpandCollapseControl,
39
- ExpandCollapsePanel,
40
- Feedback,
41
- Icon,
42
- InputLabel,
43
- Link,
44
- Pagination,
45
- PaginationPageButton,
46
- PaginationSideButton,
47
- SideNav,
48
- SideNavItem,
49
- SideNavItemsGroup,
50
- StackView,
51
- TextInput,
52
- ToggleSwitch,
53
- Tooltip,
54
- TooltipButton,
55
- Typography,
56
- spacingScale
57
- }
1
+ export { default as ActivityIndicator } from './ActivityIndicator'
2
+ export { default as Box } from './Box'
3
+ export { default as Button } from './Button'
4
+ export { default as ButtonGroup } from './ButtonGroup'
5
+ export { default as ButtonGroupItem } from './ButtonGroupItem'
6
+ export { default as Card } from './Card'
7
+ export { default as Checkbox } from './Checkbox'
8
+ export { default as ChevronLink } from './ChevronLink'
9
+ export { default as Divider } from './Divider'
10
+ export { default as ExpandCollapse } from './ExpandCollapse'
11
+ export { default as ExpandCollapseControl } from './ExpandCollapseControl'
12
+ export { default as ExpandCollapsePanel } from './ExpandCollapsePanel'
13
+ export { default as Feedback } from './Feedback'
14
+ export { default as Icon } from './Icon'
15
+ export { default as InputLabel } from './InputLabel'
16
+ export { default as InputSupports } from './InputSupports'
17
+ export { default as Link } from './Link'
18
+ export { default as List } from './List'
19
+ export { default as Pagination } from './Pagination'
20
+ export { default as PaginationPageButton } from './PaginationPageButton'
21
+ export { default as PaginationSideButton } from './PaginationSideButton'
22
+ export { default as Radio } from './Radio'
23
+ export { default as Select } from './Select'
24
+ export { default as SideNav } from './SideNav'
25
+ export { default as SideNavItem } from './SideNavItem'
26
+ export { default as SideNavItemsGroup } from './SideNavItemsGroup'
27
+ export { default as Skeleton } from './Skeleton'
28
+ export { default as StackView } from './StackView'
29
+ export { default as Tags } from './Tags'
30
+ export { default as TagsItem } from './TagsItem'
31
+ export { default as TextArea } from './TextArea'
32
+ export { default as TextInput } from './TextInput'
33
+ export { default as ToggleSwitch } from './ToggleSwitch'
34
+ export { default as Tooltip } from './Tooltip'
35
+ export { default as TooltipButton } from './TooltipButton'
36
+ export { default as Typography } from './Typography'
37
+ export { default as spacingScale } from './spacingScale'
@@ -1,14 +1,10 @@
1
- import {
2
- getSpacingScaleSchema,
3
- validateComponentTheme,
4
- spacingScaleAppearances
5
- } from '@telus-uds/tools-theme'
6
1
  import palette from '@telus-uds/palette-allium'
2
+ import { appearances } from '@telus-uds/system-themes/schema'
7
3
 
8
- const spacingScale = {
4
+ export default {
9
5
  appearances: {
10
- space: spacingScaleAppearances.space,
11
- viewport: spacingScaleAppearances.viewport
6
+ space: appearances.spacingScale.space,
7
+ viewport: appearances.system.viewport
12
8
  },
13
9
  // Largest spacings first, so they apply any time space >= highest index'
14
10
  tokens: { size: palette.size.size96 },
@@ -38,9 +34,3 @@ const spacingScale = {
38
34
  { if: { space: 0 }, tokens: { size: palette.size.size0 } }
39
35
  ]
40
36
  }
41
-
42
- // TODO: replace this with a build step similar to Palettes
43
- // https://github.com/telus/universal-design-system/issues/167
44
- validateComponentTheme(spacingScale, getSpacingScaleSchema(palette), 'spacingScale')
45
-
46
- export default spacingScale
package/src/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import packageJson from '../package.json'
2
- import components from './components'
2
+ import * as components from './components'
3
3
 
4
4
  // TODO: replace this with theme build tooling and schema checks as part of
5
5
  // https://github.com/telus/universal-design-system/issues/92