@telus-uds/components-web 2.16.1 → 2.17.1

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.
package/CHANGELOG.md CHANGED
@@ -1,12 +1,34 @@
1
1
  # Change Log - @telus-uds/components-web
2
2
 
3
- This log was last generated on Wed, 02 Aug 2023 18:10:10 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 21 Aug 2023 19:02:53 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 2.17.1
8
+
9
+ Mon, 21 Aug 2023 19:02:53 GMT
10
+
11
+ ### Patches
12
+
13
+ - Synced up event propagation to the relevant element taking `id` (shahzaibkhalidmalik@outlook.com)
14
+ - Bump @telus-uds/components-base to v1.59.1
15
+
16
+ ## 2.17.0
17
+
18
+ Wed, 09 Aug 2023 00:02:59 GMT
19
+
20
+ ### Minor changes
21
+
22
+ - Assign default type to Cell (wlsdud194@hotmail.com)
23
+ - Fix linting in QuantitySelector (kyle.king2@telus.com)
24
+ - Koodo rebranding for PriceLockup (wlsdud194@hotmail.com)
25
+ - Koodo rebrand for OptimizeImage (wlsdud194@hotmail.com)
26
+ - Bump @telus-uds/components-base to v1.59.0
27
+ - Bump @telus-uds/system-theme-tokens to v2.41.0
28
+
7
29
  ## 2.16.1
8
30
 
9
- Wed, 02 Aug 2023 18:10:10 GMT
31
+ Wed, 02 Aug 2023 18:13:48 GMT
10
32
 
11
33
  ### Patches
12
34
 
@@ -847,6 +847,17 @@
847
847
  "required": false,
848
848
  "description": "Function to call on pressing the panel's control, which should open or close the panel."
849
849
  },
850
+ "nativeID": {
851
+ "defaultValue": {
852
+ "value": "''",
853
+ "computed": false
854
+ },
855
+ "type": {
856
+ "name": "string"
857
+ },
858
+ "required": false,
859
+ "description": "ID for DOM element on web"
860
+ },
850
861
  "onPress": {
851
862
  "type": {
852
863
  "name": "func"
@@ -2404,7 +2415,8 @@
2404
2415
  "footnoteLinkColor": "color",
2405
2416
  "footnoteLinkFontName": "fontName",
2406
2417
  "footnoteLinkFontWeight": "fontWeight",
2407
- "footnoteLinkFontSize": "fontSize"
2418
+ "footnoteLinkFontSize": "fontSize",
2419
+ "footnoteLinkLineHeight": "lineHeight"
2408
2420
  }
2409
2421
  },
2410
2422
  "required": false,
@@ -3309,6 +3321,10 @@
3309
3321
  "description": "Defines the text alignment within the cell"
3310
3322
  },
3311
3323
  "type": {
3324
+ "defaultValue": {
3325
+ "value": "'default'",
3326
+ "computed": false
3327
+ },
3312
3328
  "type": {
3313
3329
  "name": "enum",
3314
3330
  "value": [
@@ -8561,6 +8577,28 @@
8561
8577
  "required": false,
8562
8578
  "description": "If provided sets maxHeight to be active"
8563
8579
  },
8580
+ "onConfirm": {
8581
+ "defaultValue": {
8582
+ "value": "() => {}",
8583
+ "computed": false
8584
+ },
8585
+ "type": {
8586
+ "name": "func"
8587
+ },
8588
+ "required": false,
8589
+ "description": "If provided, this function is called when the selection is confirmed."
8590
+ },
8591
+ "onCancel": {
8592
+ "defaultValue": {
8593
+ "value": "() => {}",
8594
+ "computed": false
8595
+ },
8596
+ "type": {
8597
+ "name": "func"
8598
+ },
8599
+ "required": false,
8600
+ "description": "If provided, this function is called when `MultiSelectFilter` is closed."
8601
+ },
8564
8602
  "copy": {
8565
8603
  "defaultValue": {
8566
8604
  "value": "'en'",
@@ -8615,6 +8653,29 @@
8615
8653
  "required": false,
8616
8654
  "description": "Sets the maximum number of items in one column. If number of items are more\nthan the `rowLimit`, they will be rendered in 2 columns."
8617
8655
  },
8656
+ "dictionary": {
8657
+ "defaultValue": {
8658
+ "value": "{\n en: {\n filterByLabel: 'Filter by %{filterCategory}:',\n applyButtonLabel: 'Apply',\n clearButtonLabel: 'Clear'\n },\n fr: {\n filterByLabel: 'Filtrer par %{filterCategory}:',\n applyButtonLabel: 'Appliquer',\n clearButtonLabel: 'Effacer'\n }\n}",
8659
+ "computed": false
8660
+ },
8661
+ "type": {
8662
+ "name": "shape",
8663
+ "value": {
8664
+ "en": {
8665
+ "name": "custom",
8666
+ "raw": "dictionaryContentShape",
8667
+ "required": false
8668
+ },
8669
+ "fr": {
8670
+ "name": "custom",
8671
+ "raw": "dictionaryContentShape",
8672
+ "required": false
8673
+ }
8674
+ }
8675
+ },
8676
+ "required": false,
8677
+ "description": "Custom dictionary containing the labels"
8678
+ },
8618
8679
  "label": {
8619
8680
  "type": {
8620
8681
  "name": "string"
@@ -10646,6 +10707,13 @@
10646
10707
  },
10647
10708
  "required": false,
10648
10709
  "description": ""
10710
+ },
10711
+ "nativeSubmitBtnID": {
10712
+ "type": {
10713
+ "name": "string"
10714
+ },
10715
+ "required": false,
10716
+ "description": "ID for Submit button element on web"
10649
10717
  }
10650
10718
  },
10651
10719
  "attributes": {
@@ -26,6 +26,7 @@ const ExpandCollapseMini = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
26
26
  children,
27
27
  onToggle,
28
28
  tokens,
29
+ nativeID,
29
30
  ...rest
30
31
  } = _ref;
31
32
 
@@ -57,6 +58,7 @@ const ExpandCollapseMini = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
57
58
  ...rest
58
59
  }),
59
60
  controlRef: ref,
61
+ nativeID: nativeID,
60
62
  children: children
61
63
  })
62
64
  });
@@ -68,10 +70,16 @@ ExpandCollapseMini.propTypes = { ..._ExpandCollapseMiniControl.default.propTypes
68
70
  * Function to call on pressing the panel's control, which should open or close the panel.
69
71
  */
70
72
  onToggle: _propTypes.default.func,
73
+
74
+ /**
75
+ * ID for DOM element on web
76
+ */
77
+ nativeID: _propTypes.default.string,
71
78
  children: _propTypes.default.node.isRequired
72
79
  };
73
80
  ExpandCollapseMini.defaultProps = {
74
- onToggle: () => {}
81
+ onToggle: () => {},
82
+ nativeID: ''
75
83
  };
76
84
  var _default = ExpandCollapseMini;
77
85
  exports.default = _default;
@@ -40,7 +40,7 @@ const StyledSup = /*#__PURE__*/_styledComponents.default.sup.withConfig({
40
40
  cursor: 'pointer',
41
41
  // we want to fallback on 'smaller' but have a valid size when a custom font size is provided.
42
42
  fontSize: fontSize ? `${fontSize}px` : 'smaller',
43
- lineHeight,
43
+ lineHeight: `${fontSize * lineHeight}px`,
44
44
  margin: 0,
45
45
  paddingVertical: 0,
46
46
  paddingLeft,
@@ -114,12 +114,14 @@ const selectFootnoteLinkStyles = _ref10 => {
114
114
  let {
115
115
  footnoteLinkColor,
116
116
  footnoteLinkFontName,
117
- footnoteLinkFontWeight
117
+ footnoteLinkFontWeight,
118
+ footnoteLinkLineHeight
118
119
  } = _ref10;
119
120
  return {
120
121
  color: footnoteLinkColor,
121
122
  fontName: footnoteLinkFontName,
122
- fontWeight: footnoteLinkFontWeight
123
+ fontWeight: footnoteLinkFontWeight,
124
+ lineHeight: footnoteLinkLineHeight
123
125
  };
124
126
  };
125
127
 
@@ -147,6 +147,10 @@ const QuantitySelector = _ref => {
147
147
  accessibilityValueNow: number
148
148
  });
149
149
 
150
+ const flexOrder = order => ({
151
+ order
152
+ });
153
+
150
154
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_componentsBase.Box, {
151
155
  space: 2,
152
156
  testID: testID,
@@ -156,9 +160,7 @@ const QuantitySelector = _ref => {
156
160
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.InputField, {
157
161
  children: renderTextInput()
158
162
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
159
- style: {
160
- order: 0
161
- },
163
+ style: flexOrder(0),
162
164
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SideButton.default, {
163
165
  isEnabled: isDecreaseEnabled,
164
166
  onPress: () => updateNumber(number - 1),
@@ -172,9 +174,7 @@ const QuantitySelector = _ref => {
172
174
  accessibilityDisabled: !isDecreaseEnabled
173
175
  })
174
176
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
175
- style: {
176
- order: 2
177
- },
177
+ style: flexOrder(2),
178
178
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SideButton.default, {
179
179
  isEnabled: isIncreaseEnabled,
180
180
  onPress: () => updateNumber(number + 1),
package/lib/Table/Cell.js CHANGED
@@ -79,7 +79,7 @@ const Cell = _ref4 => {
79
79
  isFirstInRow,
80
80
  align = 'left',
81
81
  tokens: cellTokens,
82
- type
82
+ type = 'default'
83
83
  } = _ref4;
84
84
  const {
85
85
  text,
@@ -103,7 +103,8 @@ const Cell = _ref4 => {
103
103
  fontWeight,
104
104
  fontSize,
105
105
  lineHeight,
106
- stickyBackgroundColor
106
+ stickyBackgroundColor,
107
+ fontColor
107
108
  } = (0, _componentsBase.useThemeTokens)('Table', themeTokens, {
108
109
  spacing,
109
110
  type,
@@ -126,7 +127,8 @@ const Cell = _ref4 => {
126
127
  fontName,
127
128
  fontWeight,
128
129
  fontSize,
129
- lineHeight
130
+ lineHeight,
131
+ color: fontColor
130
132
  };
131
133
 
132
134
  switch (type) {
@@ -30,17 +30,17 @@ const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemP
30
30
  const StyledContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
31
31
  displayName: "Table__StyledContainer",
32
32
  componentId: "components-web__sc-10d9q3m-0"
33
- })(["overflow:auto;padding-bottom:", ";"], props => props.isScrollable ? props.tablePaddingBottom : 0);
33
+ })(["overflow:auto;padding-bottom:", ";"], props => props.isScrollable ? `${props.tablePaddingBottom}px` : 0);
34
34
 
35
35
  const StyledTable = /*#__PURE__*/_styledComponents.default.table.withConfig({
36
36
  displayName: "Table__StyledTable",
37
37
  componentId: "components-web__sc-10d9q3m-1"
38
- })(["margin:0;padding:0;width:", ";"], _ref => {
38
+ })(["margin:0;padding:0;width:", ";border:", ";"], _ref => {
39
39
  let {
40
40
  tableWidth
41
41
  } = _ref;
42
42
  return `${tableWidth}px`;
43
- });
43
+ }, props => `${props.borderWidth}px solid ${props.borderColor}`);
44
44
 
45
45
  const TableContext = /*#__PURE__*/_react.default.createContext({});
46
46
 
@@ -74,7 +74,9 @@ const Table = _ref2 => {
74
74
  ...rest
75
75
  } = _ref2;
76
76
  const {
77
- tablePaddingBottom
77
+ tablePaddingBottom,
78
+ borderColor,
79
+ borderWidth
78
80
  } = (0, _componentsBase.useThemeTokens)('Table', tokens, variant);
79
81
  const containerRef = (0, _react.useRef)();
80
82
  const tableRef = (0, _react.useRef)();
@@ -104,8 +106,7 @@ const Table = _ref2 => {
104
106
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledContainer, {
105
107
  ref: containerRef,
106
108
  isScrollable: isScrollable,
107
- tablePaddingBottom: `${tablePaddingBottom}px`,
108
- ...selectProps(rest),
109
+ tablePaddingBottom: tablePaddingBottom,
109
110
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(TableContext.Provider, {
110
111
  value: {
111
112
  text,
@@ -114,9 +115,12 @@ const Table = _ref2 => {
114
115
  spacing
115
116
  },
116
117
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledTable, {
118
+ borderColor: borderColor,
119
+ borderWidth: borderWidth,
117
120
  tableWidth: tableWidth,
118
121
  cellSpacing: 0,
119
122
  ref: tableRef,
123
+ ...selectProps(rest),
120
124
  children: children
121
125
  })
122
126
  })
@@ -8,6 +8,7 @@ const ExpandCollapseMini = /*#__PURE__*/forwardRef((_ref, ref) => {
8
8
  children,
9
9
  onToggle,
10
10
  tokens,
11
+ nativeID,
11
12
  ...rest
12
13
  } = _ref;
13
14
 
@@ -39,6 +40,7 @@ const ExpandCollapseMini = /*#__PURE__*/forwardRef((_ref, ref) => {
39
40
  ...rest
40
41
  }),
41
42
  controlRef: ref,
43
+ nativeID: nativeID,
42
44
  children: children
43
45
  })
44
46
  });
@@ -50,9 +52,15 @@ ExpandCollapseMini.propTypes = { ...ExpandCollapseMiniControl.propTypes,
50
52
  * Function to call on pressing the panel's control, which should open or close the panel.
51
53
  */
52
54
  onToggle: PropTypes.func,
55
+
56
+ /**
57
+ * ID for DOM element on web
58
+ */
59
+ nativeID: PropTypes.string,
53
60
  children: PropTypes.node.isRequired
54
61
  };
55
62
  ExpandCollapseMini.defaultProps = {
56
- onToggle: () => {}
63
+ onToggle: () => {},
64
+ nativeID: ''
57
65
  };
58
66
  export default ExpandCollapseMini;
@@ -24,7 +24,7 @@ const StyledSup = /*#__PURE__*/styled.sup.withConfig({
24
24
  cursor: 'pointer',
25
25
  // we want to fallback on 'smaller' but have a valid size when a custom font size is provided.
26
26
  fontSize: fontSize ? `${fontSize}px` : 'smaller',
27
- lineHeight,
27
+ lineHeight: `${fontSize * lineHeight}px`,
28
28
  margin: 0,
29
29
  paddingVertical: 0,
30
30
  paddingLeft,
@@ -91,12 +91,14 @@ const selectFootnoteLinkStyles = _ref10 => {
91
91
  let {
92
92
  footnoteLinkColor,
93
93
  footnoteLinkFontName,
94
- footnoteLinkFontWeight
94
+ footnoteLinkFontWeight,
95
+ footnoteLinkLineHeight
95
96
  } = _ref10;
96
97
  return {
97
98
  color: footnoteLinkColor,
98
99
  fontName: footnoteLinkFontName,
99
- fontWeight: footnoteLinkFontWeight
100
+ fontWeight: footnoteLinkFontWeight,
101
+ lineHeight: footnoteLinkLineHeight
100
102
  };
101
103
  };
102
104
 
@@ -128,6 +128,10 @@ const QuantitySelector = _ref => {
128
128
  accessibilityValueNow: number
129
129
  });
130
130
 
131
+ const flexOrder = order => ({
132
+ order
133
+ });
134
+
131
135
  return /*#__PURE__*/_jsxs(Box, {
132
136
  space: 2,
133
137
  testID: testID,
@@ -137,9 +141,7 @@ const QuantitySelector = _ref => {
137
141
  children: [/*#__PURE__*/_jsx(InputField, {
138
142
  children: renderTextInput()
139
143
  }), /*#__PURE__*/_jsx("div", {
140
- style: {
141
- order: 0
142
- },
144
+ style: flexOrder(0),
143
145
  children: /*#__PURE__*/_jsx(SideButton, {
144
146
  isEnabled: isDecreaseEnabled,
145
147
  onPress: () => updateNumber(number - 1),
@@ -153,9 +155,7 @@ const QuantitySelector = _ref => {
153
155
  accessibilityDisabled: !isDecreaseEnabled
154
156
  })
155
157
  }), /*#__PURE__*/_jsx("div", {
156
- style: {
157
- order: 2
158
- },
158
+ style: flexOrder(2),
159
159
  children: /*#__PURE__*/_jsx(SideButton, {
160
160
  isEnabled: isIncreaseEnabled,
161
161
  onPress: () => updateNumber(number + 1),
@@ -60,7 +60,7 @@ const Cell = _ref4 => {
60
60
  isFirstInRow,
61
61
  align = 'left',
62
62
  tokens: cellTokens,
63
- type
63
+ type = 'default'
64
64
  } = _ref4;
65
65
  const {
66
66
  text,
@@ -84,7 +84,8 @@ const Cell = _ref4 => {
84
84
  fontWeight,
85
85
  fontSize,
86
86
  lineHeight,
87
- stickyBackgroundColor
87
+ stickyBackgroundColor,
88
+ fontColor
88
89
  } = useThemeTokens('Table', themeTokens, {
89
90
  spacing,
90
91
  type,
@@ -107,7 +108,8 @@ const Cell = _ref4 => {
107
108
  fontName,
108
109
  fontWeight,
109
110
  fontSize,
110
- lineHeight
111
+ lineHeight,
112
+ color: fontColor
111
113
  };
112
114
 
113
115
  switch (type) {
@@ -9,16 +9,16 @@ const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
9
9
  const StyledContainer = /*#__PURE__*/styled.div.withConfig({
10
10
  displayName: "Table__StyledContainer",
11
11
  componentId: "components-web__sc-10d9q3m-0"
12
- })(["overflow:auto;padding-bottom:", ";"], props => props.isScrollable ? props.tablePaddingBottom : 0);
12
+ })(["overflow:auto;padding-bottom:", ";"], props => props.isScrollable ? `${props.tablePaddingBottom}px` : 0);
13
13
  const StyledTable = /*#__PURE__*/styled.table.withConfig({
14
14
  displayName: "Table__StyledTable",
15
15
  componentId: "components-web__sc-10d9q3m-1"
16
- })(["margin:0;padding:0;width:", ";"], _ref => {
16
+ })(["margin:0;padding:0;width:", ";border:", ";"], _ref => {
17
17
  let {
18
18
  tableWidth
19
19
  } = _ref;
20
20
  return `${tableWidth}px`;
21
- });
21
+ }, props => `${props.borderWidth}px solid ${props.borderColor}`);
22
22
  const TableContext = /*#__PURE__*/React.createContext({});
23
23
  export const useTableContext = () => useContext(TableContext);
24
24
  /**
@@ -47,7 +47,9 @@ const Table = _ref2 => {
47
47
  ...rest
48
48
  } = _ref2;
49
49
  const {
50
- tablePaddingBottom
50
+ tablePaddingBottom,
51
+ borderColor,
52
+ borderWidth
51
53
  } = useThemeTokens('Table', tokens, variant);
52
54
  const containerRef = useRef();
53
55
  const tableRef = useRef();
@@ -77,8 +79,7 @@ const Table = _ref2 => {
77
79
  return /*#__PURE__*/_jsx(StyledContainer, {
78
80
  ref: containerRef,
79
81
  isScrollable: isScrollable,
80
- tablePaddingBottom: `${tablePaddingBottom}px`,
81
- ...selectProps(rest),
82
+ tablePaddingBottom: tablePaddingBottom,
82
83
  children: /*#__PURE__*/_jsx(TableContext.Provider, {
83
84
  value: {
84
85
  text,
@@ -87,9 +88,12 @@ const Table = _ref2 => {
87
88
  spacing
88
89
  },
89
90
  children: /*#__PURE__*/_jsx(StyledTable, {
91
+ borderColor: borderColor,
92
+ borderWidth: borderWidth,
90
93
  tableWidth: tableWidth,
91
94
  cellSpacing: 0,
92
95
  ref: tableRef,
96
+ ...selectProps(rest),
93
97
  children: children
94
98
  })
95
99
  })
package/package.json CHANGED
@@ -5,14 +5,14 @@
5
5
  ],
6
6
  "dependencies": {
7
7
  "@gorhom/portal": "^1.0.14",
8
- "@telus-uds/components-base": "1.58.0",
8
+ "@telus-uds/components-base": "1.59.1",
9
9
  "@telus-uds/system-constants": "^1.3.0",
10
10
  "fscreen": "^1.2.0",
11
11
  "lodash.omit": "^4.5.0",
12
12
  "react-dates": "^21.8.0",
13
13
  "react-helmet-async": "^1.3.0",
14
14
  "react-moment-proptypes": "^1.8.1",
15
- "@telus-uds/system-theme-tokens": "^2.40.0",
15
+ "@telus-uds/system-theme-tokens": "^2.41.0",
16
16
  "prop-types": "^15.7.2",
17
17
  "lodash.throttle": "^4.1.1",
18
18
  "react-youtube": "^10.1.0",
@@ -63,5 +63,5 @@
63
63
  "skip": true
64
64
  },
65
65
  "types": "types/index.d.ts",
66
- "version": "2.16.1"
66
+ "version": "2.17.1"
67
67
  }
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
3
3
  import { ExpandCollapse } from '@telus-uds/components-base'
4
4
  import ExpandCollapseMiniControl from './ExpandCollapseMiniControl'
5
5
 
6
- const ExpandCollapseMini = forwardRef(({ children, onToggle, tokens, ...rest }, ref) => {
6
+ const ExpandCollapseMini = forwardRef(({ children, onToggle, tokens, nativeID, ...rest }, ref) => {
7
7
  const handleChange = (openPanels, event) => {
8
8
  if (typeof onToggle === 'function') {
9
9
  const isOpen = openPanels.length > 0
@@ -31,6 +31,7 @@ const ExpandCollapseMini = forwardRef(({ children, onToggle, tokens, ...rest },
31
31
  <ExpandCollapseMiniControl pressableState={pressableState} {...rest} />
32
32
  )}
33
33
  controlRef={ref}
34
+ nativeID={nativeID}
34
35
  >
35
36
  {children}
36
37
  </ExpandCollapse.Panel>
@@ -46,10 +47,15 @@ ExpandCollapseMini.propTypes = {
46
47
  * Function to call on pressing the panel's control, which should open or close the panel.
47
48
  */
48
49
  onToggle: PropTypes.func,
50
+ /**
51
+ * ID for DOM element on web
52
+ */
53
+ nativeID: PropTypes.string,
49
54
  children: PropTypes.node.isRequired
50
55
  }
51
56
  ExpandCollapseMini.defaultProps = {
52
- onToggle: () => {}
57
+ onToggle: () => {},
58
+ nativeID: ''
53
59
  }
54
60
 
55
61
  export default ExpandCollapseMini
@@ -20,7 +20,7 @@ const StyledSup = styled.sup(
20
20
  cursor: 'pointer',
21
21
  // we want to fallback on 'smaller' but have a valid size when a custom font size is provided.
22
22
  fontSize: fontSize ? `${fontSize}px` : 'smaller',
23
- lineHeight,
23
+ lineHeight: `${fontSize * lineHeight}px`,
24
24
  margin: 0,
25
25
  paddingVertical: 0,
26
26
  paddingLeft,
@@ -67,12 +67,14 @@ const StrikeThroughContainer = styled.div`
67
67
  const selectFootnoteLinkStyles = ({
68
68
  footnoteLinkColor,
69
69
  footnoteLinkFontName,
70
- footnoteLinkFontWeight
70
+ footnoteLinkFontWeight,
71
+ footnoteLinkLineHeight
71
72
  }) => {
72
73
  return {
73
74
  color: footnoteLinkColor,
74
75
  fontName: footnoteLinkFontName,
75
- fontWeight: footnoteLinkFontWeight
76
+ fontWeight: footnoteLinkFontWeight,
77
+ lineHeight: footnoteLinkLineHeight
76
78
  }
77
79
  }
78
80
 
@@ -135,13 +135,15 @@ const QuantitySelector = ({
135
135
  />
136
136
  )
137
137
 
138
+ const flexOrder = (order) => ({ order })
139
+
138
140
  return (
139
141
  <Box space={2} testID={testID}>
140
142
  {renderLabel()}
141
143
  <Spacer space={2} />
142
144
  <InputWrapper>
143
145
  <InputField>{renderTextInput()}</InputField>
144
- <div style={{ order: 0 }}>
146
+ <div style={flexOrder(0)}>
145
147
  <SideButton
146
148
  isEnabled={isDecreaseEnabled}
147
149
  onPress={() => updateNumber(number - 1)}
@@ -152,7 +154,7 @@ const QuantitySelector = ({
152
154
  accessibilityDisabled={!isDecreaseEnabled}
153
155
  />
154
156
  </div>
155
- <div style={{ order: 2 }}>
157
+ <div style={flexOrder(2)}>
156
158
  <SideButton
157
159
  isEnabled={isIncreaseEnabled}
158
160
  onPress={() => updateNumber(number + 1)}
@@ -63,7 +63,7 @@ const createStyledCell = (htmlElement) => styled[htmlElement]`
63
63
  const StyledHeaderCell = createStyledCell('th')
64
64
  const StyledDataCell = createStyledCell('td')
65
65
 
66
- const Cell = ({ children, isFirstInRow, align = 'left', tokens: cellTokens, type }) => {
66
+ const Cell = ({ children, isFirstInRow, align = 'left', tokens: cellTokens, type = 'default' }) => {
67
67
  const { text, isScrollable: isTableScrollable, tokens: tableTokens, spacing } = useTableContext()
68
68
  const themeTokens = { ...tableTokens, ...cellTokens }
69
69
 
@@ -80,7 +80,8 @@ const Cell = ({ children, isFirstInRow, align = 'left', tokens: cellTokens, type
80
80
  fontWeight,
81
81
  fontSize,
82
82
  lineHeight,
83
- stickyBackgroundColor
83
+ stickyBackgroundColor,
84
+ fontColor
84
85
  } = useThemeTokens('Table', themeTokens, { spacing, type, text })
85
86
 
86
87
  const sharedProps = {
@@ -96,11 +97,13 @@ const Cell = ({ children, isFirstInRow, align = 'left', tokens: cellTokens, type
96
97
  stickyBackgroundColor,
97
98
  cellBoxShadowColor
98
99
  }
100
+
99
101
  const typographyTokens = {
100
102
  fontName,
101
103
  fontWeight,
102
104
  fontSize,
103
- lineHeight
105
+ lineHeight,
106
+ color: fontColor
104
107
  }
105
108
 
106
109
  switch (type) {
@@ -144,6 +147,7 @@ Cell.propTypes = {
144
147
  * Used internally for making the first column sticky
145
148
  */
146
149
  isFirstInRow: PropTypes.bool,
150
+
147
151
  /**
148
152
  * Defines the text alignment within the cell
149
153
  */
@@ -9,13 +9,14 @@ const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs])
9
9
 
10
10
  const StyledContainer = styled.div`
11
11
  overflow: auto;
12
- padding-bottom: ${(props) => (props.isScrollable ? props.tablePaddingBottom : 0)};
12
+ padding-bottom: ${(props) => (props.isScrollable ? `${props.tablePaddingBottom}px` : 0)};
13
13
  `
14
14
 
15
15
  const StyledTable = styled.table`
16
16
  margin: 0;
17
17
  padding: 0;
18
18
  width: ${({ tableWidth }) => `${tableWidth}px`};
19
+ border: ${(props) => `${props.borderWidth}px solid ${props.borderColor}`};
19
20
  `
20
21
 
21
22
  const TableContext = React.createContext({})
@@ -45,7 +46,7 @@ const Table = ({
45
46
  variant,
46
47
  ...rest
47
48
  }) => {
48
- const { tablePaddingBottom } = useThemeTokens('Table', tokens, variant)
49
+ const { tablePaddingBottom, borderColor, borderWidth } = useThemeTokens('Table', tokens, variant)
49
50
  const containerRef = useRef()
50
51
  const tableRef = useRef()
51
52
 
@@ -75,16 +76,21 @@ const Table = ({
75
76
  }, [])
76
77
 
77
78
  const isScrollable = tableWidth > containerWidth
78
-
79
79
  return (
80
80
  <StyledContainer
81
81
  ref={containerRef}
82
82
  isScrollable={isScrollable}
83
- tablePaddingBottom={`${tablePaddingBottom}px`}
84
- {...selectProps(rest)}
83
+ tablePaddingBottom={tablePaddingBottom}
85
84
  >
86
85
  <TableContext.Provider value={{ text, isScrollable, tokens, spacing }}>
87
- <StyledTable tableWidth={tableWidth} cellSpacing={0} ref={tableRef}>
86
+ <StyledTable
87
+ borderColor={borderColor}
88
+ borderWidth={borderWidth}
89
+ tableWidth={tableWidth}
90
+ cellSpacing={0}
91
+ ref={tableRef}
92
+ {...selectProps(rest)}
93
+ >
88
94
  {children}
89
95
  </StyledTable>
90
96
  </TableContext.Provider>
package/types/common.d.ts CHANGED
@@ -145,7 +145,7 @@ export type Tokens = Record<string, any>
145
145
 
146
146
  export type CopyLang = 'en' | 'fr'
147
147
 
148
- export type Variant = Record<string, string | number | boolean>
148
+ export type Variant = Record<string, string | number | boolean | undefined>
149
149
 
150
150
  export interface PressableState {
151
151
  pressed: boolean