@telus-uds/components-web 2.12.0 → 2.13.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 +22 -2
- package/component-docs.json +59 -24
- package/lib/Autocomplete/Loading.js +5 -10
- package/lib/Autocomplete/dictionary.js +2 -2
- package/lib/DatePicker/DatePicker.js +6 -0
- package/lib/NavigationBar/NavigationSubMenu.js +4 -8
- package/lib/Spinner/Spinner.js +10 -1
- package/lib/Spinner/SpinnerContent.js +8 -0
- package/lib/Table/Cell.js +62 -91
- package/lib/Table/Header.js +4 -1
- package/lib/Table/SubHeading.js +4 -1
- package/lib/Table/Table.js +2 -1
- package/lib/TermsAndConditions/ExpandCollapse.js +31 -13
- package/lib/TermsAndConditions/TermsAndConditions.js +21 -6
- package/lib/VideoPicker/VideoPickerPlayer.js +4 -2
- package/lib/VideoPicker/VideoPickerThumbnail.js +103 -60
- package/lib/VideoPicker/VideoSlider.js +2 -2
- package/lib-module/Autocomplete/Loading.js +6 -12
- package/lib-module/Autocomplete/dictionary.js +2 -2
- package/lib-module/DatePicker/DatePicker.js +7 -1
- package/lib-module/NavigationBar/NavigationSubMenu.js +5 -9
- package/lib-module/Spinner/Spinner.js +10 -1
- package/lib-module/Spinner/SpinnerContent.js +8 -0
- package/lib-module/Table/Cell.js +65 -90
- package/lib-module/Table/Header.js +4 -1
- package/lib-module/Table/SubHeading.js +4 -1
- package/lib-module/Table/Table.js +2 -1
- package/lib-module/TermsAndConditions/ExpandCollapse.js +33 -15
- package/lib-module/TermsAndConditions/TermsAndConditions.js +22 -7
- package/lib-module/VideoPicker/VideoPickerPlayer.js +4 -2
- package/lib-module/VideoPicker/VideoPickerThumbnail.js +103 -61
- package/lib-module/VideoPicker/VideoSlider.js +2 -2
- package/package.json +3 -3
- package/src/Autocomplete/Loading.jsx +2 -5
- package/src/Autocomplete/dictionary.js +2 -2
- package/src/DatePicker/DatePicker.jsx +8 -1
- package/src/NavigationBar/NavigationSubMenu.jsx +3 -4
- package/src/Spinner/Spinner.jsx +9 -1
- package/src/Spinner/SpinnerContent.jsx +13 -1
- package/src/Table/Cell.jsx +58 -78
- package/src/Table/Header.jsx +6 -1
- package/src/Table/SubHeading.jsx +4 -1
- package/src/Table/Table.jsx +10 -2
- package/src/TermsAndConditions/ExpandCollapse.jsx +36 -14
- package/src/TermsAndConditions/TermsAndConditions.jsx +18 -6
- package/src/VideoPicker/VideoPickerPlayer.jsx +2 -2
- package/src/VideoPicker/VideoPickerThumbnail.jsx +51 -30
- package/src/VideoPicker/VideoSlider.jsx +2 -2
- package/types/BaseProvider.d.ts +25 -0
- package/types/index.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,32 @@
|
|
|
1
1
|
# Change Log - @telus-uds/components-web
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 07 Jul 2023 19:17:02 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 2.13.0
|
|
8
|
+
|
|
9
|
+
Fri, 07 Jul 2023 19:17:02 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- Refactored Table for proper standardization (wlsdud194@hotmail.com)
|
|
14
|
+
- New prop labelPosition added to the Spinner and SpinnerContent components (35577399+JoshHC@users.noreply.github.com)
|
|
15
|
+
- standardization for terms and conditions (mauricio.batresmontejo@telus.com)
|
|
16
|
+
- Loading component updated inside autocomplete to use the label as a prop of spinner (35577399+JoshHC@users.noreply.github.com)
|
|
17
|
+
- Navigation bar item tokenized (akshay.pandey1@telus.com)
|
|
18
|
+
- add state to videopickerthumbnail (evander.owusu@telus.com)
|
|
19
|
+
- added types for BaseProvider (kyle.king2@telus.com)
|
|
20
|
+
- Bump @telus-uds/components-base to v1.54.0
|
|
21
|
+
- Bump @telus-uds/system-theme-tokens to v2.37.0
|
|
22
|
+
|
|
23
|
+
### Patches
|
|
24
|
+
|
|
25
|
+
- Fix an issue where `DatePicker` is unable to reset `date` programmatically (shahzaibkhalidmalik@outlook.com)
|
|
26
|
+
|
|
7
27
|
## 2.12.0
|
|
8
28
|
|
|
9
|
-
Wed, 28 Jun 2023 23:
|
|
29
|
+
Wed, 28 Jun 2023 23:27:23 GMT
|
|
10
30
|
|
|
11
31
|
### Minor changes
|
|
12
32
|
|
package/component-docs.json
CHANGED
|
@@ -3067,6 +3067,13 @@
|
|
|
3067
3067
|
},
|
|
3068
3068
|
"required": true,
|
|
3069
3069
|
"description": "Communicates a message to assistive technology while visible. This same message\nwill appear underneath the spinner when its `size` is `large`."
|
|
3070
|
+
},
|
|
3071
|
+
"labelPosition": {
|
|
3072
|
+
"type": {
|
|
3073
|
+
"name": "string"
|
|
3074
|
+
},
|
|
3075
|
+
"required": false,
|
|
3076
|
+
"description": "Determine where the label of the spinner should be placed, left, right, bottom or top."
|
|
3070
3077
|
}
|
|
3071
3078
|
},
|
|
3072
3079
|
"attributes": {}
|
|
@@ -3155,6 +3162,13 @@
|
|
|
3155
3162
|
"docs": {
|
|
3156
3163
|
"description": "Use `Table` to display tabular data.\n\n- Takes an optional `spacing` variant (compact)\n- Available in 2 text styles (medium, small)\n- When `Table` exceeds viewport, the first column becomes sticky, enabling horizontal scrolling\n- Right-align prices and numbers that display decimal points\n\n### Building up a `Table`\n- Use `Table.Header` and `Table.Body` as direct children of `Table`\n- Use `Table.SubHeading` to render an intermediate data heading row\n- Use `Table.Row` and `Table.Cell` to build up the tabular data\n- Use `Cell`'s `type` prop to visually mark it as a row heading (`type=\"rowHeading\"`)",
|
|
3157
3164
|
"props": {
|
|
3165
|
+
"spacing": {
|
|
3166
|
+
"defaultValue": {
|
|
3167
|
+
"value": "'default'",
|
|
3168
|
+
"computed": false
|
|
3169
|
+
},
|
|
3170
|
+
"required": false
|
|
3171
|
+
},
|
|
3158
3172
|
"fullWidth": {
|
|
3159
3173
|
"defaultValue": {
|
|
3160
3174
|
"value": "true",
|
|
@@ -3257,59 +3271,55 @@
|
|
|
3257
3271
|
"docs": {
|
|
3258
3272
|
"description": "",
|
|
3259
3273
|
"props": {
|
|
3260
|
-
"
|
|
3274
|
+
"align": {
|
|
3261
3275
|
"defaultValue": {
|
|
3262
|
-
"value": "'
|
|
3276
|
+
"value": "'left'",
|
|
3263
3277
|
"computed": false
|
|
3264
3278
|
},
|
|
3265
3279
|
"type": {
|
|
3266
3280
|
"name": "enum",
|
|
3267
3281
|
"value": [
|
|
3268
3282
|
{
|
|
3269
|
-
"value": "'
|
|
3270
|
-
"computed": false
|
|
3271
|
-
},
|
|
3272
|
-
{
|
|
3273
|
-
"value": "'heading'",
|
|
3283
|
+
"value": "'left'",
|
|
3274
3284
|
"computed": false
|
|
3275
3285
|
},
|
|
3276
3286
|
{
|
|
3277
|
-
"value": "'
|
|
3287
|
+
"value": "'center'",
|
|
3278
3288
|
"computed": false
|
|
3279
3289
|
},
|
|
3280
3290
|
{
|
|
3281
|
-
"value": "'
|
|
3291
|
+
"value": "'right'",
|
|
3282
3292
|
"computed": false
|
|
3283
3293
|
}
|
|
3284
3294
|
]
|
|
3285
3295
|
},
|
|
3286
3296
|
"required": false,
|
|
3287
|
-
"description": "Defines the
|
|
3297
|
+
"description": "Defines the text alignment within the cell"
|
|
3288
3298
|
},
|
|
3289
|
-
"
|
|
3290
|
-
"defaultValue": {
|
|
3291
|
-
"value": "'left'",
|
|
3292
|
-
"computed": false
|
|
3293
|
-
},
|
|
3299
|
+
"type": {
|
|
3294
3300
|
"type": {
|
|
3295
3301
|
"name": "enum",
|
|
3296
3302
|
"value": [
|
|
3297
3303
|
{
|
|
3298
|
-
"value": "'
|
|
3304
|
+
"value": "'default'",
|
|
3299
3305
|
"computed": false
|
|
3300
3306
|
},
|
|
3301
3307
|
{
|
|
3302
|
-
"value": "'
|
|
3308
|
+
"value": "'heading'",
|
|
3303
3309
|
"computed": false
|
|
3304
3310
|
},
|
|
3305
3311
|
{
|
|
3306
|
-
"value": "'
|
|
3312
|
+
"value": "'subHeading'",
|
|
3313
|
+
"computed": false
|
|
3314
|
+
},
|
|
3315
|
+
{
|
|
3316
|
+
"value": "'rowHeading'",
|
|
3307
3317
|
"computed": false
|
|
3308
3318
|
}
|
|
3309
3319
|
]
|
|
3310
3320
|
},
|
|
3311
3321
|
"required": false,
|
|
3312
|
-
"description": "
|
|
3322
|
+
"description": ""
|
|
3313
3323
|
},
|
|
3314
3324
|
"tokens": {
|
|
3315
3325
|
"type": {
|
|
@@ -6952,7 +6962,19 @@
|
|
|
6952
6962
|
"borderRadius": "radius",
|
|
6953
6963
|
"borderWidth": "border",
|
|
6954
6964
|
"expandDividerColor": "color",
|
|
6955
|
-
"expandDividerWidth": "size"
|
|
6965
|
+
"expandDividerWidth": "size",
|
|
6966
|
+
"contentPanelBackgroundColor": "color",
|
|
6967
|
+
"contentPanelPaddingLeft": "size",
|
|
6968
|
+
"contentPanelPaddingRight": "size",
|
|
6969
|
+
"contentPanelPaddingTop": "size",
|
|
6970
|
+
"contentPanelPaddingBottom": "size",
|
|
6971
|
+
"contentPanelBorderWidth": "border",
|
|
6972
|
+
"contentPanelBorderColor": "color",
|
|
6973
|
+
"contentPanelFontName": "fontName",
|
|
6974
|
+
"contentPanelFontSize": "fontSize",
|
|
6975
|
+
"contentPanelFontColor": "color",
|
|
6976
|
+
"contentPanelFontWeight": "fontWeight",
|
|
6977
|
+
"contentPanelLineHeight": "lineHeight"
|
|
6956
6978
|
}
|
|
6957
6979
|
},
|
|
6958
6980
|
"required": false,
|
|
@@ -6969,7 +6991,7 @@
|
|
|
6969
6991
|
"type": {
|
|
6970
6992
|
"name": "func"
|
|
6971
6993
|
},
|
|
6972
|
-
"required":
|
|
6994
|
+
"required": false,
|
|
6973
6995
|
"description": "Function to call on pressing the panel's control, which should open or close the panel.\nIf Panel is a direct child of `ExpandCollapse`, this prop will be provided by the ExpandCollapse parent."
|
|
6974
6996
|
},
|
|
6975
6997
|
"onPress": {
|
|
@@ -6997,10 +7019,10 @@
|
|
|
6997
7019
|
"control": {
|
|
6998
7020
|
"type": {
|
|
6999
7021
|
"name": "custom",
|
|
7000
|
-
"raw": "ExpandCollapseControl.propTypes.children
|
|
7022
|
+
"raw": "ExpandCollapseControl.propTypes.children"
|
|
7001
7023
|
},
|
|
7002
7024
|
"required": false,
|
|
7003
|
-
"description": "The content inside the
|
|
7025
|
+
"description": "The content inside the control element that opens and closes the ExpandCollapse when pressed."
|
|
7004
7026
|
},
|
|
7005
7027
|
"controlTokens": {
|
|
7006
7028
|
"type": {
|
|
@@ -7038,6 +7060,13 @@
|
|
|
7038
7060
|
},
|
|
7039
7061
|
"required": false,
|
|
7040
7062
|
"description": "An optional ref to be attached to the control"
|
|
7063
|
+
},
|
|
7064
|
+
"content": {
|
|
7065
|
+
"type": {
|
|
7066
|
+
"name": "bool"
|
|
7067
|
+
},
|
|
7068
|
+
"required": false,
|
|
7069
|
+
"description": "A boolean prop to determine if the panel is a content panel or not. If true, the panel will not have a control"
|
|
7041
7070
|
}
|
|
7042
7071
|
},
|
|
7043
7072
|
"attributes": {
|
|
@@ -11255,7 +11284,12 @@
|
|
|
11255
11284
|
"outlineWidth": "border",
|
|
11256
11285
|
"paddingHorizontal": "size",
|
|
11257
11286
|
"paddingVertical": "size",
|
|
11258
|
-
"borderRadius": "radius"
|
|
11287
|
+
"borderRadius": "radius",
|
|
11288
|
+
"textLine": "textLine",
|
|
11289
|
+
"fontName": "fontName",
|
|
11290
|
+
"fontWeight": "fontWeight",
|
|
11291
|
+
"fontSize": "fontSize",
|
|
11292
|
+
"lineHeight": "lineHeight"
|
|
11259
11293
|
}
|
|
11260
11294
|
},
|
|
11261
11295
|
"required": false,
|
|
@@ -13517,6 +13551,7 @@
|
|
|
13517
13551
|
"name": "custom",
|
|
13518
13552
|
"raw": {
|
|
13519
13553
|
"fontName": "fontName",
|
|
13554
|
+
"superScriptFontSize": "fontSize",
|
|
13520
13555
|
"fontWeight": "fontWeight",
|
|
13521
13556
|
"fontSize": "fontSize",
|
|
13522
13557
|
"color": "color",
|
|
@@ -23,23 +23,18 @@ const Loading = _ref => {
|
|
|
23
23
|
} = _ref;
|
|
24
24
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Box, {
|
|
25
25
|
space: 3,
|
|
26
|
-
children: /*#__PURE__*/(0, _jsxRuntime.
|
|
26
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.StackView, {
|
|
27
27
|
direction: "row",
|
|
28
28
|
space: 2,
|
|
29
29
|
tokens: {
|
|
30
30
|
alignItems: 'center'
|
|
31
31
|
},
|
|
32
|
-
children:
|
|
32
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Spinner.default, {
|
|
33
33
|
inline: true,
|
|
34
34
|
show: true,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
size: 'small'
|
|
39
|
-
},
|
|
40
|
-
accessibilityLiveRegion: "polite",
|
|
41
|
-
children: label
|
|
42
|
-
})]
|
|
35
|
+
label: label,
|
|
36
|
+
labelPosition: "right"
|
|
37
|
+
})
|
|
43
38
|
})
|
|
44
39
|
});
|
|
45
40
|
};
|
|
@@ -7,12 +7,12 @@ exports.default = void 0;
|
|
|
7
7
|
var _default = {
|
|
8
8
|
en: {
|
|
9
9
|
hasResults: 'Some results are available',
|
|
10
|
-
loading: '
|
|
10
|
+
loading: 'Searching...',
|
|
11
11
|
noResults: 'No results found'
|
|
12
12
|
},
|
|
13
13
|
fr: {
|
|
14
14
|
hasResults: 'Quelques suggestions sont disponible',
|
|
15
|
-
loading: '
|
|
15
|
+
loading: 'Recherche...',
|
|
16
16
|
noResults: 'Aucun résultat trouvé'
|
|
17
17
|
}
|
|
18
18
|
};
|
|
@@ -136,6 +136,12 @@ const DatePicker = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
136
136
|
dictionary: _dictionary.default,
|
|
137
137
|
copy
|
|
138
138
|
});
|
|
139
|
+
(0, _react.useEffect)(() => {
|
|
140
|
+
if (!(0, _moment.default)(date).isSame(inputDate)) {
|
|
141
|
+
setInputDate(date);
|
|
142
|
+
setInputText(date instanceof _moment.default ? date.format(dateFormat) : '');
|
|
143
|
+
}
|
|
144
|
+
}, [date, inputDate]);
|
|
139
145
|
|
|
140
146
|
const onFocusChange = _ref2 => {
|
|
141
147
|
let {
|
|
@@ -115,22 +115,18 @@ const NavigationSubMenu = _ref => {
|
|
|
115
115
|
onClick: handleClick,
|
|
116
116
|
icon: icoMenu,
|
|
117
117
|
children: _ref2 => {
|
|
118
|
-
var _textStyles
|
|
118
|
+
var _textStyles$;
|
|
119
119
|
|
|
120
120
|
let {
|
|
121
121
|
textStyles
|
|
122
122
|
} = _ref2;
|
|
123
|
-
return [children, /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.
|
|
124
|
-
space: 1,
|
|
125
|
-
direction: "row"
|
|
126
|
-
}, `${id}_spacer`), /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Icon, {
|
|
123
|
+
return [children, /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Icon, {
|
|
127
124
|
icon: icoMenu,
|
|
128
125
|
variant: {
|
|
129
|
-
size: '
|
|
126
|
+
size: 'micro'
|
|
130
127
|
},
|
|
131
128
|
tokens: {
|
|
132
|
-
color: (_textStyles$ = textStyles[0]) === null || _textStyles$ === void 0 ? void 0 : _textStyles$.color
|
|
133
|
-
size: (_textStyles$2 = textStyles[0]) === null || _textStyles$2 === void 0 ? void 0 : _textStyles$2.fontSize
|
|
129
|
+
color: (_textStyles$ = textStyles[0]) === null || _textStyles$ === void 0 ? void 0 : _textStyles$.color
|
|
134
130
|
}
|
|
135
131
|
}, `${id}_icon`)];
|
|
136
132
|
}
|
package/lib/Spinner/Spinner.js
CHANGED
|
@@ -109,6 +109,7 @@ const Spinner = _ref3 => {
|
|
|
109
109
|
fullScreen = false,
|
|
110
110
|
inline = false,
|
|
111
111
|
label,
|
|
112
|
+
labelPosition,
|
|
112
113
|
show = false,
|
|
113
114
|
isStatic = false,
|
|
114
115
|
tokens,
|
|
@@ -141,6 +142,7 @@ const Spinner = _ref3 => {
|
|
|
141
142
|
...selectProps(rest),
|
|
142
143
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SpinnerContent.default, {
|
|
143
144
|
label: label,
|
|
145
|
+
labelPosition: labelPosition,
|
|
144
146
|
overlay: true,
|
|
145
147
|
size: size,
|
|
146
148
|
thickness: thickness,
|
|
@@ -160,6 +162,7 @@ const Spinner = _ref3 => {
|
|
|
160
162
|
...selectProps(rest),
|
|
161
163
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_SpinnerContent.default, {
|
|
162
164
|
label: label,
|
|
165
|
+
labelPosition: labelPosition,
|
|
163
166
|
overlay: true,
|
|
164
167
|
size: size,
|
|
165
168
|
thickness: thickness,
|
|
@@ -185,6 +188,7 @@ const Spinner = _ref3 => {
|
|
|
185
188
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(SpinnerContainer, { ...selectProps(rest),
|
|
186
189
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SpinnerContent.default, {
|
|
187
190
|
label: label,
|
|
191
|
+
labelPosition: labelPosition,
|
|
188
192
|
size: size,
|
|
189
193
|
thickness: thickness,
|
|
190
194
|
sizeVariant: sizeVariant,
|
|
@@ -232,7 +236,12 @@ Spinner.propTypes = { ...selectedSystemPropTypes,
|
|
|
232
236
|
/**
|
|
233
237
|
* If true, it should render a static spinner
|
|
234
238
|
*/
|
|
235
|
-
isStatic: _propTypes.default.bool
|
|
239
|
+
isStatic: _propTypes.default.bool,
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Determine where the label of the spinner should be placed, left, right, bottom or top.
|
|
243
|
+
*/
|
|
244
|
+
labelPosition: _propTypes.default.string
|
|
236
245
|
};
|
|
237
246
|
var _default = Spinner;
|
|
238
247
|
exports.default = _default;
|
|
@@ -47,6 +47,7 @@ const Container = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
|
47
47
|
const SpinnerContent = _ref2 => {
|
|
48
48
|
let {
|
|
49
49
|
label,
|
|
50
|
+
labelPosition,
|
|
50
51
|
overlay = false,
|
|
51
52
|
sizeVariant,
|
|
52
53
|
size,
|
|
@@ -54,6 +55,12 @@ const SpinnerContent = _ref2 => {
|
|
|
54
55
|
isStatic,
|
|
55
56
|
...rest
|
|
56
57
|
} = _ref2;
|
|
58
|
+
const labelMapping = {
|
|
59
|
+
top: 'column-reverse',
|
|
60
|
+
bottom: 'column',
|
|
61
|
+
left: 'row-reverse',
|
|
62
|
+
right: 'row'
|
|
63
|
+
};
|
|
57
64
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Container, {
|
|
58
65
|
overlay: overlay,
|
|
59
66
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_componentsBase.StackView, {
|
|
@@ -61,6 +68,7 @@ const SpinnerContent = _ref2 => {
|
|
|
61
68
|
tokens: {
|
|
62
69
|
alignItems: 'center'
|
|
63
70
|
},
|
|
71
|
+
direction: labelMapping[labelPosition],
|
|
64
72
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.ActivityIndicator, {
|
|
65
73
|
label: label,
|
|
66
74
|
tokens: {
|
package/lib/Table/Cell.js
CHANGED
|
@@ -23,94 +23,77 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
23
23
|
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
25
|
|
|
26
|
-
const
|
|
26
|
+
const HEADER_TYPE = {
|
|
27
|
+
HEADING: 'heading',
|
|
28
|
+
SUBHEADING: 'subHeading',
|
|
29
|
+
ROWHEADING: 'rowHeading'
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const stickyStyles = _ref => {
|
|
27
33
|
let {
|
|
28
|
-
cellStickyShadow
|
|
34
|
+
cellStickyShadow,
|
|
35
|
+
stickyBackgroundColor,
|
|
36
|
+
type
|
|
29
37
|
} = _ref;
|
|
30
|
-
return cellStickyShadow;
|
|
31
|
-
}
|
|
38
|
+
return (0, _styledComponents.css)(["position:sticky;left:0;z-index:2;clip-path:inset(0 -8px 0 0);", " &::before{content:'';box-shadow:", ";position:absolute;top:0;left:0;right:0;bottom:0;pointer-events:none;}"], type !== HEADER_TYPE.SUBHEADING && type !== HEADER_TYPE.HEADING ? `background-color: ${stickyBackgroundColor};` : undefined, cellStickyShadow);
|
|
39
|
+
};
|
|
40
|
+
|
|
32
41
|
const sharedStyles = /*#__PURE__*/(0, _styledComponents.css)(["", ""], _ref2 => {
|
|
33
42
|
let {
|
|
34
43
|
isSticky,
|
|
35
|
-
cellBoxShadowColor,
|
|
36
44
|
align,
|
|
37
45
|
cellPaddingTop,
|
|
38
46
|
cellPaddingRight,
|
|
39
47
|
cellPaddingBottom,
|
|
40
48
|
cellPaddingLeft,
|
|
41
|
-
cellMinWidth
|
|
49
|
+
cellMinWidth,
|
|
50
|
+
cellBackground,
|
|
51
|
+
cellStickyShadow,
|
|
52
|
+
stickyBackgroundColor,
|
|
53
|
+
type
|
|
42
54
|
} = _ref2;
|
|
43
|
-
return (0, _styledComponents.css)(["
|
|
55
|
+
return (0, _styledComponents.css)(["text-align:", ";min-width:", "px;padding:", "px ", "px ", "px ", "px;background-color:", ";", ";"], align, cellMinWidth, cellPaddingTop, cellPaddingRight, cellPaddingBottom, cellPaddingLeft, cellBackground, isSticky && stickyStyles({
|
|
56
|
+
type,
|
|
57
|
+
cellStickyShadow,
|
|
58
|
+
stickyBackgroundColor
|
|
59
|
+
}));
|
|
44
60
|
});
|
|
45
61
|
|
|
46
|
-
const
|
|
47
|
-
displayName: "
|
|
62
|
+
const createStyledCell = htmlElement => _styledComponents.default[htmlElement].withConfig({
|
|
63
|
+
displayName: "Cell__createStyledCell",
|
|
48
64
|
componentId: "components-web__sc-ltgfic-0"
|
|
49
|
-
})(["", ";", ""], sharedStyles, _ref3 => {
|
|
65
|
+
})(["", ";box-shadow:", ";"], sharedStyles, _ref3 => {
|
|
50
66
|
let {
|
|
51
|
-
|
|
52
|
-
|
|
67
|
+
cellBoxShadowColor,
|
|
68
|
+
type
|
|
53
69
|
} = _ref3;
|
|
54
|
-
return `
|
|
55
|
-
background-color: ${cellHeadingBackground};
|
|
56
|
-
box-shadow: inset 0 1px 0 ${cellHeadingBoxShadowColor}, inset 0 -1px 0 ${cellHeadingBoxShadowColor};`;
|
|
70
|
+
return type === HEADER_TYPE.HEADING ? `inset 0 1px 0 ${cellBoxShadowColor}, inset 0 -1px 0 ${cellBoxShadowColor}` : `inset 0 1px 0 ${cellBoxShadowColor}`;
|
|
57
71
|
});
|
|
58
72
|
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
componentId: "components-web__sc-ltgfic-1"
|
|
62
|
-
})(["", ";background-color:", ";"], sharedStyles, _ref4 => {
|
|
63
|
-
let {
|
|
64
|
-
cellSubheadingBackground
|
|
65
|
-
} = _ref4;
|
|
66
|
-
return cellSubheadingBackground;
|
|
67
|
-
});
|
|
73
|
+
const StyledHeaderCell = createStyledCell('th');
|
|
74
|
+
const StyledDataCell = createStyledCell('td');
|
|
68
75
|
|
|
69
|
-
const
|
|
70
|
-
displayName: "Cell__StyledCell",
|
|
71
|
-
componentId: "components-web__sc-ltgfic-2"
|
|
72
|
-
})(["", ";background-color:", ";"], sharedStyles, _ref5 => {
|
|
73
|
-
let {
|
|
74
|
-
cellBackground
|
|
75
|
-
} = _ref5;
|
|
76
|
-
return cellBackground;
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
const StyledRowHeading = /*#__PURE__*/_styledComponents.default.th.withConfig({
|
|
80
|
-
displayName: "Cell__StyledRowHeading",
|
|
81
|
-
componentId: "components-web__sc-ltgfic-3"
|
|
82
|
-
})(["", ";background-color:", ";"], sharedStyles, _ref6 => {
|
|
83
|
-
let {
|
|
84
|
-
cellRowHeadingBackground
|
|
85
|
-
} = _ref6;
|
|
86
|
-
return cellRowHeadingBackground;
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
const Cell = _ref7 => {
|
|
76
|
+
const Cell = _ref4 => {
|
|
90
77
|
let {
|
|
91
78
|
children,
|
|
92
|
-
type = 'default',
|
|
93
79
|
isFirstInRow,
|
|
94
80
|
align = 'left',
|
|
95
|
-
tokens: cellTokens
|
|
96
|
-
|
|
81
|
+
tokens: cellTokens,
|
|
82
|
+
type
|
|
83
|
+
} = _ref4;
|
|
97
84
|
const {
|
|
98
85
|
text,
|
|
99
86
|
isScrollable: isTableScrollable,
|
|
100
|
-
|
|
101
|
-
|
|
87
|
+
tokens: tableTokens,
|
|
88
|
+
spacing
|
|
102
89
|
} = (0, _Table.useTableContext)();
|
|
103
90
|
const themeTokens = { ...tableTokens,
|
|
104
91
|
...cellTokens
|
|
105
92
|
};
|
|
106
93
|
const {
|
|
107
94
|
cellMinWidth,
|
|
108
|
-
cellHeadingBackground,
|
|
109
|
-
cellHeadingBoxShadowColor,
|
|
110
95
|
cellBoxShadowColor,
|
|
111
|
-
cellSubheadingBackground,
|
|
112
96
|
cellBackground,
|
|
113
|
-
cellRowHeadingBackground,
|
|
114
97
|
cellStickyShadow,
|
|
115
98
|
cellPaddingTop,
|
|
116
99
|
cellPaddingRight,
|
|
@@ -118,80 +101,72 @@ const Cell = _ref7 => {
|
|
|
118
101
|
cellPaddingBottom,
|
|
119
102
|
fontName,
|
|
120
103
|
fontWeight,
|
|
121
|
-
fontSize
|
|
122
|
-
|
|
104
|
+
fontSize,
|
|
105
|
+
lineHeight,
|
|
106
|
+
stickyBackgroundColor
|
|
107
|
+
} = (0, _componentsBase.useThemeTokens)('Table', themeTokens, {
|
|
108
|
+
spacing,
|
|
109
|
+
type,
|
|
110
|
+
text
|
|
111
|
+
});
|
|
123
112
|
const sharedProps = {
|
|
124
113
|
align,
|
|
125
114
|
isSticky: isTableScrollable && isFirstInRow,
|
|
115
|
+
cellBackground,
|
|
126
116
|
cellMinWidth,
|
|
127
|
-
cellStickyShadow,
|
|
117
|
+
cellStickyShadow: (0, _componentsBase.applyShadowToken)(cellStickyShadow).boxShadow,
|
|
128
118
|
cellPaddingTop,
|
|
129
119
|
cellPaddingRight,
|
|
130
120
|
cellPaddingLeft,
|
|
131
121
|
cellPaddingBottom,
|
|
122
|
+
stickyBackgroundColor,
|
|
132
123
|
cellBoxShadowColor
|
|
133
124
|
};
|
|
134
125
|
const typographyTokens = {
|
|
135
126
|
fontName,
|
|
136
127
|
fontWeight,
|
|
137
|
-
fontSize
|
|
128
|
+
fontSize,
|
|
129
|
+
lineHeight
|
|
138
130
|
};
|
|
139
131
|
|
|
140
132
|
switch (type) {
|
|
141
|
-
case
|
|
142
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
133
|
+
case HEADER_TYPE.HEADING:
|
|
134
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledHeaderCell, {
|
|
143
135
|
scope: "col",
|
|
144
|
-
cellHeadingBackground: cellHeadingBackground,
|
|
145
|
-
cellHeadingBoxShadowColor: cellHeadingBoxShadowColor,
|
|
146
136
|
...sharedProps,
|
|
137
|
+
type: type,
|
|
147
138
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
148
139
|
tokens: typographyTokens,
|
|
149
|
-
variant: {
|
|
150
|
-
size: 'h4'
|
|
151
|
-
},
|
|
152
140
|
children: children
|
|
153
141
|
})
|
|
154
142
|
});
|
|
155
143
|
|
|
156
|
-
case
|
|
157
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
144
|
+
case HEADER_TYPE.SUBHEADING:
|
|
145
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledHeaderCell, {
|
|
158
146
|
scope: "col",
|
|
159
|
-
cellSubheadingBackground: cellSubheadingBackground,
|
|
160
147
|
...sharedProps,
|
|
148
|
+
type: type,
|
|
161
149
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
162
150
|
tokens: typographyTokens,
|
|
163
|
-
variant: {
|
|
164
|
-
size: 'h5'
|
|
165
|
-
},
|
|
166
151
|
children: children
|
|
167
152
|
})
|
|
168
153
|
});
|
|
169
154
|
|
|
170
|
-
case
|
|
171
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
155
|
+
case HEADER_TYPE.ROWHEADING:
|
|
156
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledHeaderCell, {
|
|
172
157
|
scope: "row",
|
|
173
|
-
cellRowHeadingBackground: cellRowHeadingBackground,
|
|
174
158
|
...sharedProps,
|
|
159
|
+
type: type,
|
|
175
160
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
176
161
|
tokens: typographyTokens,
|
|
177
|
-
variant: {
|
|
178
|
-
size: text === 'small' ? 'h5' : 'h4'
|
|
179
|
-
},
|
|
180
162
|
children: children
|
|
181
163
|
})
|
|
182
164
|
});
|
|
183
165
|
|
|
184
166
|
default:
|
|
185
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
186
|
-
cellBackground: cellBackground,
|
|
187
|
-
...sharedProps,
|
|
167
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledDataCell, { ...sharedProps,
|
|
188
168
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
189
|
-
tokens:
|
|
190
|
-
fontSize
|
|
191
|
-
},
|
|
192
|
-
variant: {
|
|
193
|
-
size: text
|
|
194
|
-
},
|
|
169
|
+
tokens: typographyTokens,
|
|
195
170
|
children: children
|
|
196
171
|
})
|
|
197
172
|
});
|
|
@@ -199,14 +174,10 @@ const Cell = _ref7 => {
|
|
|
199
174
|
};
|
|
200
175
|
|
|
201
176
|
Cell.propTypes = {
|
|
177
|
+
type: _propTypes.default.oneOf(['default', 'heading', 'subHeading', 'rowHeading']),
|
|
202
178
|
tokens: _propTypes.default.object,
|
|
203
179
|
children: _propTypes.default.node,
|
|
204
180
|
|
|
205
|
-
/**
|
|
206
|
-
* Defines the visual styles of a cell, and whether it should be a `td` or `th` element
|
|
207
|
-
*/
|
|
208
|
-
type: _propTypes.default.oneOf(['default', 'heading', 'subHeading', 'rowHeading']),
|
|
209
|
-
|
|
210
181
|
/**
|
|
211
182
|
* @ignore
|
|
212
183
|
* Used internally for making the first column sticky
|
package/lib/Table/Header.js
CHANGED
|
@@ -25,7 +25,10 @@ const Header = _ref => {
|
|
|
25
25
|
} = _ref;
|
|
26
26
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("thead", {
|
|
27
27
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Row.default, {
|
|
28
|
-
children: _react.default.Children.map(children, child =>
|
|
28
|
+
children: _react.default.Children.map(children, child =>
|
|
29
|
+
/*#__PURE__*/
|
|
30
|
+
// TO DO: pass type as a variant instead of prop
|
|
31
|
+
(0, _react.cloneElement)(child, {
|
|
29
32
|
type: 'heading'
|
|
30
33
|
}))
|
|
31
34
|
})
|
package/lib/Table/SubHeading.js
CHANGED
|
@@ -24,7 +24,10 @@ const Header = _ref => {
|
|
|
24
24
|
children
|
|
25
25
|
} = _ref;
|
|
26
26
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Row.default, {
|
|
27
|
-
children: _react.default.Children.map(children, child =>
|
|
27
|
+
children: _react.default.Children.map(children, child =>
|
|
28
|
+
/*#__PURE__*/
|
|
29
|
+
// TO DO: pass type as a variant instead of prop
|
|
30
|
+
(0, _react.cloneElement)(child, {
|
|
28
31
|
type: 'subHeading'
|
|
29
32
|
}))
|
|
30
33
|
});
|
package/lib/Table/Table.js
CHANGED
|
@@ -66,6 +66,7 @@ exports.useTableContext = useTableContext;
|
|
|
66
66
|
const Table = _ref2 => {
|
|
67
67
|
let {
|
|
68
68
|
children,
|
|
69
|
+
spacing = 'default',
|
|
69
70
|
fullWidth = true,
|
|
70
71
|
text = 'medium',
|
|
71
72
|
tokens,
|
|
@@ -110,7 +111,7 @@ const Table = _ref2 => {
|
|
|
110
111
|
text,
|
|
111
112
|
isScrollable,
|
|
112
113
|
tokens,
|
|
113
|
-
|
|
114
|
+
spacing
|
|
114
115
|
},
|
|
115
116
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledTable, {
|
|
116
117
|
tableWidth: tableWidth,
|