@telus-uds/components-web 2.16.1 → 2.17.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.
- package/CHANGELOG.md +15 -2
- package/component-docs.json +51 -1
- package/lib/Footnote/FootnoteLink.js +1 -1
- package/lib/PriceLockup/PriceLockup.js +4 -2
- package/lib/QuantitySelector/QuantitySelector.js +6 -6
- package/lib/Table/Cell.js +5 -3
- package/lib/Table/Table.js +9 -5
- package/lib-module/Footnote/FootnoteLink.js +1 -1
- package/lib-module/PriceLockup/PriceLockup.js +4 -2
- package/lib-module/QuantitySelector/QuantitySelector.js +6 -6
- package/lib-module/Table/Cell.js +5 -3
- package/lib-module/Table/Table.js +9 -5
- package/package.json +3 -3
- package/src/Footnote/FootnoteLink.jsx +1 -1
- package/src/PriceLockup/PriceLockup.jsx +4 -2
- package/src/QuantitySelector/QuantitySelector.jsx +4 -2
- package/src/Table/Cell.jsx +7 -3
- package/src/Table/Table.jsx +11 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
# Change Log - @telus-uds/components-web
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 08 Aug 2023 23:51:39 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 2.17.0
|
|
8
|
+
|
|
9
|
+
Tue, 08 Aug 2023 23:51:39 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- Assign default type to Cell (wlsdud194@hotmail.com)
|
|
14
|
+
- Fix linting in QuantitySelector (kyle.king2@telus.com)
|
|
15
|
+
- Koodo rebranding for PriceLockup (wlsdud194@hotmail.com)
|
|
16
|
+
- Koodo rebrand for OptimizeImage (wlsdud194@hotmail.com)
|
|
17
|
+
- Bump @telus-uds/components-base to v1.59.0
|
|
18
|
+
- Bump @telus-uds/system-theme-tokens to v2.41.0
|
|
19
|
+
|
|
7
20
|
## 2.16.1
|
|
8
21
|
|
|
9
|
-
Wed, 02 Aug 2023 18:
|
|
22
|
+
Wed, 02 Aug 2023 18:13:48 GMT
|
|
10
23
|
|
|
11
24
|
### Patches
|
|
12
25
|
|
package/component-docs.json
CHANGED
|
@@ -2404,7 +2404,8 @@
|
|
|
2404
2404
|
"footnoteLinkColor": "color",
|
|
2405
2405
|
"footnoteLinkFontName": "fontName",
|
|
2406
2406
|
"footnoteLinkFontWeight": "fontWeight",
|
|
2407
|
-
"footnoteLinkFontSize": "fontSize"
|
|
2407
|
+
"footnoteLinkFontSize": "fontSize",
|
|
2408
|
+
"footnoteLinkLineHeight": "lineHeight"
|
|
2408
2409
|
}
|
|
2409
2410
|
},
|
|
2410
2411
|
"required": false,
|
|
@@ -3309,6 +3310,10 @@
|
|
|
3309
3310
|
"description": "Defines the text alignment within the cell"
|
|
3310
3311
|
},
|
|
3311
3312
|
"type": {
|
|
3313
|
+
"defaultValue": {
|
|
3314
|
+
"value": "'default'",
|
|
3315
|
+
"computed": false
|
|
3316
|
+
},
|
|
3312
3317
|
"type": {
|
|
3313
3318
|
"name": "enum",
|
|
3314
3319
|
"value": [
|
|
@@ -8561,6 +8566,28 @@
|
|
|
8561
8566
|
"required": false,
|
|
8562
8567
|
"description": "If provided sets maxHeight to be active"
|
|
8563
8568
|
},
|
|
8569
|
+
"onConfirm": {
|
|
8570
|
+
"defaultValue": {
|
|
8571
|
+
"value": "() => {}",
|
|
8572
|
+
"computed": false
|
|
8573
|
+
},
|
|
8574
|
+
"type": {
|
|
8575
|
+
"name": "func"
|
|
8576
|
+
},
|
|
8577
|
+
"required": false,
|
|
8578
|
+
"description": "If provided, this function is called when the selection is confirmed."
|
|
8579
|
+
},
|
|
8580
|
+
"onCancel": {
|
|
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 `MultiSelectFilter` is closed."
|
|
8590
|
+
},
|
|
8564
8591
|
"copy": {
|
|
8565
8592
|
"defaultValue": {
|
|
8566
8593
|
"value": "'en'",
|
|
@@ -8615,6 +8642,29 @@
|
|
|
8615
8642
|
"required": false,
|
|
8616
8643
|
"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
8644
|
},
|
|
8645
|
+
"dictionary": {
|
|
8646
|
+
"defaultValue": {
|
|
8647
|
+
"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}",
|
|
8648
|
+
"computed": false
|
|
8649
|
+
},
|
|
8650
|
+
"type": {
|
|
8651
|
+
"name": "shape",
|
|
8652
|
+
"value": {
|
|
8653
|
+
"en": {
|
|
8654
|
+
"name": "custom",
|
|
8655
|
+
"raw": "dictionaryContentShape",
|
|
8656
|
+
"required": false
|
|
8657
|
+
},
|
|
8658
|
+
"fr": {
|
|
8659
|
+
"name": "custom",
|
|
8660
|
+
"raw": "dictionaryContentShape",
|
|
8661
|
+
"required": false
|
|
8662
|
+
}
|
|
8663
|
+
}
|
|
8664
|
+
},
|
|
8665
|
+
"required": false,
|
|
8666
|
+
"description": "Custom dictionary containing the labels"
|
|
8667
|
+
},
|
|
8618
8668
|
"label": {
|
|
8619
8669
|
"type": {
|
|
8620
8670
|
"name": "string"
|
|
@@ -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) {
|
package/lib/Table/Table.js
CHANGED
|
@@ -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,7 +106,7 @@ const Table = _ref2 => {
|
|
|
104
106
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledContainer, {
|
|
105
107
|
ref: containerRef,
|
|
106
108
|
isScrollable: isScrollable,
|
|
107
|
-
tablePaddingBottom:
|
|
109
|
+
tablePaddingBottom: tablePaddingBottom,
|
|
108
110
|
...selectProps(rest),
|
|
109
111
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(TableContext.Provider, {
|
|
110
112
|
value: {
|
|
@@ -114,6 +116,8 @@ const Table = _ref2 => {
|
|
|
114
116
|
spacing
|
|
115
117
|
},
|
|
116
118
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledTable, {
|
|
119
|
+
borderColor: borderColor,
|
|
120
|
+
borderWidth: borderWidth,
|
|
117
121
|
tableWidth: tableWidth,
|
|
118
122
|
cellSpacing: 0,
|
|
119
123
|
ref: tableRef,
|
|
@@ -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),
|
package/lib-module/Table/Cell.js
CHANGED
|
@@ -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,7 +79,7 @@ const Table = _ref2 => {
|
|
|
77
79
|
return /*#__PURE__*/_jsx(StyledContainer, {
|
|
78
80
|
ref: containerRef,
|
|
79
81
|
isScrollable: isScrollable,
|
|
80
|
-
tablePaddingBottom:
|
|
82
|
+
tablePaddingBottom: tablePaddingBottom,
|
|
81
83
|
...selectProps(rest),
|
|
82
84
|
children: /*#__PURE__*/_jsx(TableContext.Provider, {
|
|
83
85
|
value: {
|
|
@@ -87,6 +89,8 @@ const Table = _ref2 => {
|
|
|
87
89
|
spacing
|
|
88
90
|
},
|
|
89
91
|
children: /*#__PURE__*/_jsx(StyledTable, {
|
|
92
|
+
borderColor: borderColor,
|
|
93
|
+
borderWidth: borderWidth,
|
|
90
94
|
tableWidth: tableWidth,
|
|
91
95
|
cellSpacing: 0,
|
|
92
96
|
ref: tableRef,
|
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.
|
|
8
|
+
"@telus-uds/components-base": "1.59.0",
|
|
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.
|
|
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.
|
|
66
|
+
"version": "2.17.0"
|
|
67
67
|
}
|
|
@@ -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={
|
|
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={
|
|
157
|
+
<div style={flexOrder(2)}>
|
|
156
158
|
<SideButton
|
|
157
159
|
isEnabled={isIncreaseEnabled}
|
|
158
160
|
onPress={() => updateNumber(number + 1)}
|
package/src/Table/Cell.jsx
CHANGED
|
@@ -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
|
*/
|
package/src/Table/Table.jsx
CHANGED
|
@@ -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={
|
|
83
|
+
tablePaddingBottom={tablePaddingBottom}
|
|
84
84
|
{...selectProps(rest)}
|
|
85
85
|
>
|
|
86
86
|
<TableContext.Provider value={{ text, isScrollable, tokens, spacing }}>
|
|
87
|
-
<StyledTable
|
|
87
|
+
<StyledTable
|
|
88
|
+
borderColor={borderColor}
|
|
89
|
+
borderWidth={borderWidth}
|
|
90
|
+
tableWidth={tableWidth}
|
|
91
|
+
cellSpacing={0}
|
|
92
|
+
ref={tableRef}
|
|
93
|
+
>
|
|
88
94
|
{children}
|
|
89
95
|
</StyledTable>
|
|
90
96
|
</TableContext.Provider>
|