@telus-uds/components-base 1.71.0 → 1.73.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.
Files changed (115) hide show
  1. package/CHANGELOG.md +37 -2
  2. package/lib/Box/Box.js +17 -6
  3. package/lib/ColourToggle/ColourBubble.js +135 -0
  4. package/lib/ColourToggle/ColourToggle.js +101 -0
  5. package/lib/ColourToggle/index.js +10 -0
  6. package/lib/FlexGrid/Col/Col.js +42 -19
  7. package/lib/FlexGrid/FlexGrid.js +40 -17
  8. package/lib/FlexGrid/Row/Row.js +45 -22
  9. package/lib/Listbox/ListboxGroup.js +7 -1
  10. package/lib/Modal/ModalContent.js +4 -6
  11. package/lib/MultiSelectFilter/MultiSelectFilter.js +1 -0
  12. package/lib/Notification/Notification.js +13 -5
  13. package/lib/OrderedList/Item.js +180 -0
  14. package/lib/OrderedList/ItemBase.js +54 -0
  15. package/lib/OrderedList/OrderedList.js +71 -0
  16. package/lib/OrderedList/OrderedListBase.js +47 -0
  17. package/lib/OrderedList/index.js +10 -0
  18. package/lib/Responsive/Responsive.js +24 -14
  19. package/lib/Responsive/ResponsiveProp.js +46 -0
  20. package/lib/Responsive/ResponsiveWithMediaQueryStyleSheet.js +72 -0
  21. package/lib/ThemeProvider/ThemeProvider.js +5 -2
  22. package/lib/ThemeProvider/index.js +9 -1
  23. package/lib/ThemeProvider/useResponsiveThemeTokens.js +89 -0
  24. package/lib/Typography/Typography.js +48 -22
  25. package/lib/index.js +16 -0
  26. package/lib/server.js +40 -0
  27. package/lib/utils/ssr-media-query/create-stylesheet/create-stylesheet-mobile.js +56 -0
  28. package/lib/utils/ssr-media-query/create-stylesheet/index.android.js +10 -0
  29. package/lib/utils/ssr-media-query/create-stylesheet/index.ios.js +10 -0
  30. package/lib/utils/ssr-media-query/create-stylesheet/index.js +44 -0
  31. package/lib/utils/ssr-media-query/utils/create-media-query-styles.js +39 -6
  32. package/lib-module/Box/Box.js +17 -6
  33. package/lib-module/ColourToggle/ColourBubble.js +125 -0
  34. package/lib-module/ColourToggle/ColourToggle.js +92 -0
  35. package/lib-module/ColourToggle/index.js +2 -0
  36. package/lib-module/FlexGrid/Col/Col.js +42 -19
  37. package/lib-module/FlexGrid/FlexGrid.js +40 -17
  38. package/lib-module/FlexGrid/Row/Row.js +45 -22
  39. package/lib-module/Listbox/ListboxGroup.js +7 -1
  40. package/lib-module/Modal/ModalContent.js +4 -6
  41. package/lib-module/MultiSelectFilter/MultiSelectFilter.js +1 -0
  42. package/lib-module/Notification/Notification.js +13 -5
  43. package/lib-module/OrderedList/Item.js +171 -0
  44. package/lib-module/OrderedList/ItemBase.js +43 -0
  45. package/lib-module/OrderedList/OrderedList.js +61 -0
  46. package/lib-module/OrderedList/OrderedListBase.js +36 -0
  47. package/lib-module/OrderedList/index.js +2 -0
  48. package/lib-module/Responsive/Responsive.js +24 -15
  49. package/lib-module/Responsive/ResponsiveProp.js +39 -0
  50. package/lib-module/Responsive/ResponsiveWithMediaQueryStyleSheet.js +64 -0
  51. package/lib-module/ThemeProvider/ThemeProvider.js +5 -2
  52. package/lib-module/ThemeProvider/index.js +1 -0
  53. package/lib-module/ThemeProvider/useResponsiveThemeTokens.js +81 -0
  54. package/lib-module/Typography/Typography.js +50 -24
  55. package/lib-module/index.js +2 -0
  56. package/lib-module/server.js +4 -0
  57. package/lib-module/utils/ssr-media-query/create-stylesheet/create-stylesheet-mobile.js +48 -0
  58. package/lib-module/utils/ssr-media-query/create-stylesheet/index.android.js +2 -0
  59. package/lib-module/utils/ssr-media-query/create-stylesheet/index.ios.js +2 -0
  60. package/lib-module/utils/ssr-media-query/create-stylesheet/index.js +36 -0
  61. package/lib-module/utils/ssr-media-query/utils/create-media-query-styles.js +36 -6
  62. package/package.json +13 -2
  63. package/src/Box/Box.jsx +35 -17
  64. package/src/ColourToggle/ColourBubble.jsx +111 -0
  65. package/src/ColourToggle/ColourToggle.jsx +83 -0
  66. package/src/ColourToggle/index.js +3 -0
  67. package/src/FlexGrid/Col/Col.jsx +42 -13
  68. package/src/FlexGrid/FlexGrid.jsx +40 -11
  69. package/src/FlexGrid/Row/Row.jsx +40 -16
  70. package/src/Listbox/ListboxGroup.jsx +9 -2
  71. package/src/Modal/ModalContent.jsx +4 -6
  72. package/src/MultiSelectFilter/MultiSelectFilter.jsx +2 -0
  73. package/src/Notification/Notification.jsx +15 -3
  74. package/src/OrderedList/Item.jsx +152 -0
  75. package/src/OrderedList/ItemBase.jsx +43 -0
  76. package/src/OrderedList/OrderedList.jsx +61 -0
  77. package/src/OrderedList/OrderedListBase.jsx +33 -0
  78. package/src/OrderedList/index.js +3 -0
  79. package/src/Responsive/Responsive.jsx +24 -11
  80. package/src/Responsive/ResponsiveProp.jsx +33 -0
  81. package/src/Responsive/ResponsiveWithMediaQueryStyleSheet.jsx +58 -0
  82. package/src/ThemeProvider/ThemeProvider.jsx +5 -2
  83. package/src/ThemeProvider/index.js +1 -0
  84. package/src/ThemeProvider/useResponsiveThemeTokens.js +85 -0
  85. package/src/Typography/Typography.jsx +72 -24
  86. package/src/index.js +2 -0
  87. package/src/server.js +4 -0
  88. package/src/utils/ssr-media-query/create-stylesheet/create-stylesheet-mobile.js +41 -0
  89. package/src/utils/ssr-media-query/create-stylesheet/index.android.js +3 -0
  90. package/src/utils/ssr-media-query/create-stylesheet/index.ios.js +3 -0
  91. package/src/utils/ssr-media-query/create-stylesheet/index.js +33 -0
  92. package/src/utils/ssr-media-query/utils/create-media-query-styles.js +21 -6
  93. package/types/Badge.d.ts +28 -0
  94. package/types/Box.d.ts +52 -0
  95. package/types/ChevronLink.d.ts +47 -0
  96. package/types/Common.d.ts +106 -0
  97. package/types/Divider.d.ts +19 -0
  98. package/types/ExpandCollapse.d.ts +65 -0
  99. package/types/HorizontalScrollButton.d.ts +16 -0
  100. package/types/Icon.d.ts +21 -0
  101. package/types/Link.d.ts +48 -0
  102. package/types/List.d.ts +48 -0
  103. package/types/Search.d.ts +38 -0
  104. package/types/Select.d.ts +57 -0
  105. package/types/Spacer.d.ts +5 -0
  106. package/types/StackView.d.ts +28 -0
  107. package/types/Tabs.d.ts +46 -0
  108. package/types/TextButton.d.ts +11 -0
  109. package/types/ToggleSwitch.d.ts +54 -0
  110. package/types/ToolTip.d.ts +40 -0
  111. package/types/Typography.d.ts +39 -0
  112. package/types/index.d.ts +62 -0
  113. package/lib/utils/ssr-media-query/create-stylesheet.js +0 -76
  114. package/lib-module/utils/ssr-media-query/create-stylesheet.js +0 -68
  115. package/src/utils/ssr-media-query/create-stylesheet.js +0 -61
@@ -0,0 +1,62 @@
1
+ export { default as Badge } from './Badge'
2
+ export type { BadgeProps, BadgeVariants, BadgeTokens } from './Badge'
3
+
4
+ export { default as Box } from './Box'
5
+ export type { BoxVariants, BoxTokens, BoxProps } from './Box'
6
+
7
+ export { default as ChevronLink } from './ChevronLink'
8
+ export { ChevronLinkTokens, ChevronLinkProps, HrefProps } from './ChevronLink'
9
+
10
+ export { default as Divider } from './Divider'
11
+ export { DividerVariants, DividerProps, DividerTokens } from './Divider'
12
+
13
+ export { default as ExpandCollapse } from './ExpandCollapse'
14
+ export {
15
+ ExpandCollapseVariants,
16
+ ExpandCollapseTokens,
17
+ ExpandCollapseControlTokens,
18
+ ExpandFnProps,
19
+ ExpandCollapseProps,
20
+ ExpandCollapsePanelProps
21
+ } from './ExpandCollapse'
22
+
23
+ export { default as HorizontalScrollButton } from './HorizontalScrollButton'
24
+ export { HorizontalScrollButtonTokens } from './HorizontalScrollButton'
25
+
26
+ export { default as Icon } from './Icon'
27
+ export { IconProps, IconTokens, IconVariant, IconPositionLeftRight } from './Icon'
28
+
29
+ export { default as Link } from './Link'
30
+ export { LinkProps, LinkSize, LinkAndTextButtonVariants, LinkTokens } from './Link'
31
+
32
+ export { default as List } from './List'
33
+ export { ListVariants, ListTokens, ListProps, ListItemProps, ListItemTokens } from './List'
34
+
35
+ export { default as Search } from './Search'
36
+ export { SearchTokens, SearchProps } from './Search'
37
+
38
+ export { default as Select } from './Select'
39
+ export { SelectTokens, SelectProps, SelectItemProps, SelectGroupProps } from './Select'
40
+
41
+ export { default as Spacer } from './Spacer'
42
+ export { SpacerProps } from './Spacer'
43
+
44
+ export { default as StackView } from './StackView'
45
+ export { StackViewTokens, StackViewProps } from './StackView'
46
+
47
+ export { default as Tabs } from './Tabs'
48
+ export { TabsProps, TabsTokens, TabSelectorProps, TabsVariant, TabsItem } from './Tabs'
49
+
50
+ export { default as TextButton } from './TextButton'
51
+ export { TextButtonProps } from './TextButton'
52
+
53
+ export { default as ToggleSwitch } from './ToggleSwitch'
54
+ export { ToggleSwitchTokens, ToggleSwitchProps } from './ToggleSwitch'
55
+
56
+ export { default as Tooltip } from './ToolTip'
57
+ export { TooltipTokens, TooltipVariants, TooltipProps } from './ToolTip'
58
+
59
+ export { default as Typography } from './Typography'
60
+ export { TypographyProps, TypographyVariants, TypographyTokens } from './Typography'
61
+
62
+ export * from './Common'
@@ -1,76 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _cssMediaquery = _interopRequireDefault(require("css-mediaquery"));
8
- var _Dimensions = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Dimensions"));
9
- var _Platform = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Platform"));
10
- var _inject = require("./utils/inject");
11
- var _createDeclarationBlock = _interopRequireDefault(require("./utils/create-declaration-block"));
12
- var _hash = _interopRequireDefault(require("./hash"));
13
- var _common = require("./utils/common");
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
- const createStyleSheet = stylesWithQuery => {
16
- if (!stylesWithQuery) return {
17
- ids: {},
18
- styles: {},
19
- fullStyles: {}
20
- };
21
- let cleanStyles;
22
- let ids = {};
23
- Object.keys(stylesWithQuery).forEach(key => {
24
- if (!(stylesWithQuery !== null && stylesWithQuery !== void 0 && stylesWithQuery[key])) return;
25
- const mediaQueriesAndPseudoClasses = Object.keys(stylesWithQuery[key]).filter(_common.isMediaOrPseudo);
26
- if (_Platform.default.OS === 'web') {
27
- cleanStyles = (0, _common.deepClone)(stylesWithQuery);
28
- mediaQueriesAndPseudoClasses.forEach(query => {
29
- var _ids;
30
- const css = (0, _createDeclarationBlock.default)(stylesWithQuery[key][query]);
31
- const stringHash = `rnmq-${(0, _hash.default)(`${key}${query}${css}`)}`;
32
- const rule = (0, _common.createCssRule)(query, stringHash, css);
33
- (0, _inject.addCss)(`${stringHash}`, rule);
34
- delete cleanStyles[key][query];
35
- ids = {
36
- ...ids,
37
- [key]: `${(_ids = ids) !== null && _ids !== void 0 && _ids[key] ? `${ids[key]} ` : ''}${stringHash}`
38
- };
39
- });
40
- } else {
41
- cleanStyles = JSON.parse(JSON.stringify(stylesWithQuery));
42
- mediaQueriesAndPseudoClasses.forEach(str => {
43
- if ((0, _common.isMedia)(str)) {
44
- const mqStr = str.replace('@media', '');
45
- const {
46
- width,
47
- height
48
- } = _Dimensions.default.get('window');
49
- const isMatchingMediaQuery = _cssMediaquery.default.match(mqStr, {
50
- width,
51
- height,
52
- orientation: width > height ? 'landscape' : 'portrait',
53
- 'aspect-ratio': width / height
54
- });
55
- if (isMatchingMediaQuery) {
56
- cleanStyles = {
57
- ...cleanStyles,
58
- [key]: {
59
- ...cleanStyles[key],
60
- ...stylesWithQuery[key][str]
61
- }
62
- };
63
- }
64
- }
65
- delete cleanStyles[key][str];
66
- });
67
- }
68
- });
69
- return {
70
- ids,
71
- styles: cleanStyles,
72
- fullStyles: stylesWithQuery
73
- };
74
- };
75
- var _default = createStyleSheet;
76
- exports.default = _default;
@@ -1,68 +0,0 @@
1
- import mediaQuery from 'css-mediaquery';
2
- import Dimensions from "react-native-web/dist/exports/Dimensions";
3
- import Platform from "react-native-web/dist/exports/Platform";
4
- import { addCss } from './utils/inject';
5
- import createDeclarationBlock from './utils/create-declaration-block';
6
- import hash from './hash';
7
- import { isMediaOrPseudo, isMedia, deepClone, createCssRule } from './utils/common';
8
- const createStyleSheet = stylesWithQuery => {
9
- if (!stylesWithQuery) return {
10
- ids: {},
11
- styles: {},
12
- fullStyles: {}
13
- };
14
- let cleanStyles;
15
- let ids = {};
16
- Object.keys(stylesWithQuery).forEach(key => {
17
- if (!(stylesWithQuery !== null && stylesWithQuery !== void 0 && stylesWithQuery[key])) return;
18
- const mediaQueriesAndPseudoClasses = Object.keys(stylesWithQuery[key]).filter(isMediaOrPseudo);
19
- if (Platform.OS === 'web') {
20
- cleanStyles = deepClone(stylesWithQuery);
21
- mediaQueriesAndPseudoClasses.forEach(query => {
22
- var _ids;
23
- const css = createDeclarationBlock(stylesWithQuery[key][query]);
24
- const stringHash = `rnmq-${hash(`${key}${query}${css}`)}`;
25
- const rule = createCssRule(query, stringHash, css);
26
- addCss(`${stringHash}`, rule);
27
- delete cleanStyles[key][query];
28
- ids = {
29
- ...ids,
30
- [key]: `${(_ids = ids) !== null && _ids !== void 0 && _ids[key] ? `${ids[key]} ` : ''}${stringHash}`
31
- };
32
- });
33
- } else {
34
- cleanStyles = JSON.parse(JSON.stringify(stylesWithQuery));
35
- mediaQueriesAndPseudoClasses.forEach(str => {
36
- if (isMedia(str)) {
37
- const mqStr = str.replace('@media', '');
38
- const {
39
- width,
40
- height
41
- } = Dimensions.get('window');
42
- const isMatchingMediaQuery = mediaQuery.match(mqStr, {
43
- width,
44
- height,
45
- orientation: width > height ? 'landscape' : 'portrait',
46
- 'aspect-ratio': width / height
47
- });
48
- if (isMatchingMediaQuery) {
49
- cleanStyles = {
50
- ...cleanStyles,
51
- [key]: {
52
- ...cleanStyles[key],
53
- ...stylesWithQuery[key][str]
54
- }
55
- };
56
- }
57
- }
58
- delete cleanStyles[key][str];
59
- });
60
- }
61
- });
62
- return {
63
- ids,
64
- styles: cleanStyles,
65
- fullStyles: stylesWithQuery
66
- };
67
- };
68
- export default createStyleSheet;
@@ -1,61 +0,0 @@
1
- import mediaQuery from 'css-mediaquery'
2
- import { Dimensions, Platform } from 'react-native'
3
- import { addCss } from './utils/inject'
4
- import createDeclarationBlock from './utils/create-declaration-block'
5
- import hash from './hash'
6
- import { isMediaOrPseudo, isMedia, deepClone, createCssRule } from './utils/common'
7
-
8
- const createStyleSheet = (stylesWithQuery) => {
9
- if (!stylesWithQuery) return { ids: {}, styles: {}, fullStyles: {} }
10
- let cleanStyles
11
- let ids = {}
12
- Object.keys(stylesWithQuery).forEach((key) => {
13
- if (!stylesWithQuery?.[key]) return
14
-
15
- const mediaQueriesAndPseudoClasses = Object.keys(stylesWithQuery[key]).filter(isMediaOrPseudo)
16
- if (Platform.OS === 'web') {
17
- cleanStyles = deepClone(stylesWithQuery)
18
- mediaQueriesAndPseudoClasses.forEach((query) => {
19
- const css = createDeclarationBlock(stylesWithQuery[key][query])
20
- const stringHash = `rnmq-${hash(`${key}${query}${css}`)}`
21
- const rule = createCssRule(query, stringHash, css)
22
-
23
- addCss(`${stringHash}`, rule)
24
- delete cleanStyles[key][query]
25
-
26
- ids = {
27
- ...ids,
28
- [key]: `${ids?.[key] ? `${ids[key]} ` : ''}${stringHash}`
29
- }
30
- })
31
- } else {
32
- cleanStyles = JSON.parse(JSON.stringify(stylesWithQuery))
33
- mediaQueriesAndPseudoClasses.forEach((str) => {
34
- if (isMedia(str)) {
35
- const mqStr = str.replace('@media', '')
36
- const { width, height } = Dimensions.get('window')
37
-
38
- const isMatchingMediaQuery = mediaQuery.match(mqStr, {
39
- width,
40
- height,
41
- orientation: width > height ? 'landscape' : 'portrait',
42
- 'aspect-ratio': width / height
43
- })
44
-
45
- if (isMatchingMediaQuery) {
46
- cleanStyles = {
47
- ...cleanStyles,
48
- [key]: { ...cleanStyles[key], ...stylesWithQuery[key][str] }
49
- }
50
- }
51
- }
52
-
53
- delete cleanStyles[key][str]
54
- })
55
- }
56
- })
57
-
58
- return { ids, styles: cleanStyles, fullStyles: stylesWithQuery }
59
- }
60
-
61
- export default createStyleSheet