@workday/canvas-kit-react 7.1.0-next.0 → 7.1.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/action-bar/lib/ActionBarItem.tsx +1 -6
- package/checkbox/lib/Checkbox.tsx +106 -54
- package/collection/lib/useOverflowListModel.tsx +11 -2
- package/common/lib/utils/index.ts +1 -0
- package/common/lib/utils/useModalityType.ts +65 -0
- package/dist/commonjs/action-bar/lib/ActionBar.d.ts +2 -4
- package/dist/commonjs/action-bar/lib/ActionBar.d.ts.map +1 -1
- package/dist/commonjs/action-bar/lib/ActionBarItem.d.ts +1 -4
- package/dist/commonjs/action-bar/lib/ActionBarItem.d.ts.map +1 -1
- package/dist/commonjs/action-bar/lib/ActionBarItem.js +0 -5
- package/dist/commonjs/action-bar/lib/useActionBarModel.d.ts +2 -0
- package/dist/commonjs/action-bar/lib/useActionBarModel.d.ts.map +1 -1
- package/dist/commonjs/checkbox/lib/Checkbox.d.ts +4 -0
- package/dist/commonjs/checkbox/lib/Checkbox.d.ts.map +1 -1
- package/dist/commonjs/checkbox/lib/Checkbox.js +65 -34
- package/dist/commonjs/collection/lib/useOverflowListModel.d.ts +10 -0
- package/dist/commonjs/collection/lib/useOverflowListModel.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/useOverflowListModel.js +10 -4
- package/dist/commonjs/common/lib/utils/index.d.ts +1 -0
- package/dist/commonjs/common/lib/utils/index.d.ts.map +1 -1
- package/dist/commonjs/common/lib/utils/index.js +1 -0
- package/dist/commonjs/common/lib/utils/useModalityType.d.ts +17 -0
- package/dist/commonjs/common/lib/utils/useModalityType.d.ts.map +1 -0
- package/dist/commonjs/common/lib/utils/useModalityType.js +63 -0
- package/dist/commonjs/pagination/lib/Pagination/PageButton.d.ts.map +1 -1
- package/dist/commonjs/pagination/lib/Pagination/PageButton.js +8 -6
- package/dist/commonjs/radio/lib/Radio.d.ts +1 -0
- package/dist/commonjs/radio/lib/Radio.d.ts.map +1 -1
- package/dist/commonjs/radio/lib/Radio.js +74 -26
- package/dist/commonjs/tabs/lib/Tabs.d.ts +1 -0
- package/dist/commonjs/tabs/lib/Tabs.d.ts.map +1 -1
- package/dist/commonjs/tabs/lib/TabsItem.d.ts.map +1 -1
- package/dist/commonjs/tabs/lib/TabsItem.js +4 -3
- package/dist/commonjs/tabs/lib/TabsList.d.ts.map +1 -1
- package/dist/commonjs/tabs/lib/TabsList.js +17 -2
- package/dist/commonjs/tabs/lib/useTabsModel.d.ts +55 -159
- package/dist/commonjs/tabs/lib/useTabsModel.d.ts.map +1 -1
- package/dist/commonjs/tabs/lib/useTabsModel.js +2 -0
- package/dist/es6/action-bar/lib/ActionBar.d.ts +2 -4
- package/dist/es6/action-bar/lib/ActionBar.d.ts.map +1 -1
- package/dist/es6/action-bar/lib/ActionBarItem.d.ts +1 -4
- package/dist/es6/action-bar/lib/ActionBarItem.d.ts.map +1 -1
- package/dist/es6/action-bar/lib/ActionBarItem.js +1 -6
- package/dist/es6/action-bar/lib/useActionBarModel.d.ts +2 -0
- package/dist/es6/action-bar/lib/useActionBarModel.d.ts.map +1 -1
- package/dist/es6/checkbox/lib/Checkbox.d.ts +4 -0
- package/dist/es6/checkbox/lib/Checkbox.d.ts.map +1 -1
- package/dist/es6/checkbox/lib/Checkbox.js +65 -34
- package/dist/es6/collection/lib/useOverflowListModel.d.ts +10 -0
- package/dist/es6/collection/lib/useOverflowListModel.d.ts.map +1 -1
- package/dist/es6/collection/lib/useOverflowListModel.js +10 -4
- package/dist/es6/common/lib/utils/index.d.ts +1 -0
- package/dist/es6/common/lib/utils/index.d.ts.map +1 -1
- package/dist/es6/common/lib/utils/index.js +1 -0
- package/dist/es6/common/lib/utils/useModalityType.d.ts +17 -0
- package/dist/es6/common/lib/utils/useModalityType.d.ts.map +1 -0
- package/dist/es6/common/lib/utils/useModalityType.js +56 -0
- package/dist/es6/pagination/lib/Pagination/PageButton.d.ts.map +1 -1
- package/dist/es6/pagination/lib/Pagination/PageButton.js +9 -7
- package/dist/es6/radio/lib/Radio.d.ts +1 -0
- package/dist/es6/radio/lib/Radio.d.ts.map +1 -1
- package/dist/es6/radio/lib/Radio.js +74 -26
- package/dist/es6/tabs/lib/Tabs.d.ts +1 -0
- package/dist/es6/tabs/lib/Tabs.d.ts.map +1 -1
- package/dist/es6/tabs/lib/TabsItem.d.ts.map +1 -1
- package/dist/es6/tabs/lib/TabsItem.js +5 -4
- package/dist/es6/tabs/lib/TabsList.d.ts.map +1 -1
- package/dist/es6/tabs/lib/TabsList.js +18 -3
- package/dist/es6/tabs/lib/useTabsModel.d.ts +55 -159
- package/dist/es6/tabs/lib/useTabsModel.d.ts.map +1 -1
- package/dist/es6/tabs/lib/useTabsModel.js +3 -1
- package/package.json +8 -7
- package/pagination/lib/Pagination/PageButton.tsx +13 -7
- package/radio/lib/Radio.tsx +98 -29
- package/tabs/lib/TabsItem.tsx +4 -3
- package/tabs/lib/TabsList.tsx +23 -4
- package/tabs/lib/useTabsModel.tsx +3 -1
|
@@ -55,7 +55,11 @@ var RadioRipple = styled('span')({
|
|
|
55
55
|
width: radioWidth,
|
|
56
56
|
position: 'absolute',
|
|
57
57
|
pointerEvents: 'none',
|
|
58
|
-
|
|
58
|
+
}, function (_a) {
|
|
59
|
+
var variant = _a.variant;
|
|
60
|
+
return ({
|
|
61
|
+
opacity: variant === 'inverse' ? '0.4' : '1',
|
|
62
|
+
});
|
|
59
63
|
});
|
|
60
64
|
var RadioInput = styled('input')({
|
|
61
65
|
borderRadius: radioBorderRadius,
|
|
@@ -70,7 +74,7 @@ var RadioInput = styled('input')({
|
|
|
70
74
|
outline: 'none',
|
|
71
75
|
},
|
|
72
76
|
}, function (_a) {
|
|
73
|
-
var checked = _a.checked, disabled = _a.disabled, _b = _a.theme.canvas.palette, themePrimary = _b.primary, themeFocusOutline = _b.common.focusOutline;
|
|
77
|
+
var checked = _a.checked, disabled = _a.disabled, variant = _a.variant, _b = _a.theme.canvas.palette, themePrimary = _b.primary, themeFocusOutline = _b.common.focusOutline;
|
|
74
78
|
return (__assign({ cursor: disabled ? undefined : 'pointer',
|
|
75
79
|
/**
|
|
76
80
|
* These selectors are targetting various sibling elements (~) here because
|
|
@@ -89,25 +93,52 @@ var RadioInput = styled('input')({
|
|
|
89
93
|
// input (which is visually hidden)
|
|
90
94
|
'&:hover ~ div:first-of-type': {
|
|
91
95
|
backgroundColor: checked
|
|
92
|
-
?
|
|
96
|
+
? variant === 'inverse'
|
|
97
|
+
? colors.frenchVanilla100
|
|
98
|
+
: themePrimary.main
|
|
93
99
|
: disabled
|
|
94
100
|
? inputColors.disabled.background
|
|
95
101
|
: 'white',
|
|
96
102
|
borderColor: checked
|
|
97
|
-
?
|
|
103
|
+
? variant === 'inverse'
|
|
104
|
+
? colors.soap300
|
|
105
|
+
: themePrimary.main
|
|
98
106
|
: disabled
|
|
99
107
|
? inputColors.disabled.border
|
|
100
|
-
:
|
|
108
|
+
: variant === 'inverse'
|
|
109
|
+
? colors.soap300
|
|
110
|
+
: inputColors.hoverBorder,
|
|
101
111
|
borderWidth: '1px',
|
|
102
112
|
}, '&:focus, &focus:hover': {
|
|
103
|
-
'& ~ div:first-of-type': {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
113
|
+
'& ~ div:first-of-type': __assign({ borderWidth: '2px', borderColor: variant === 'inverse' ? colors.blackPepper400 : themeFocusOutline, boxShadow: 'none' }, focusRing({
|
|
114
|
+
width: variant === 'inverse' ? 2 : 0,
|
|
115
|
+
separation: 0,
|
|
116
|
+
animate: false,
|
|
117
|
+
innerColor: variant === 'inverse' ? colors.blackPepper400 : undefined,
|
|
118
|
+
outerColor: variant === 'inverse' ? colors.frenchVanilla100 : undefined,
|
|
119
|
+
})),
|
|
120
|
+
}, '&:checked:focus ~ div:first-of-type': __assign(__assign({}, focusRing({
|
|
121
|
+
separation: 2,
|
|
122
|
+
width: 2,
|
|
123
|
+
innerColor: variant === 'inverse' ? colors.blackPepper400 : undefined,
|
|
124
|
+
outerColor: variant === 'inverse' ? colors.frenchVanilla100 : themeFocusOutline,
|
|
125
|
+
})), { borderColor: variant === 'inverse' ? colors.frenchVanilla100 : themePrimary.main, borderWidth: '2px' }) }, mouseFocusBehavior({
|
|
126
|
+
'&:focus ~ div:first-of-type': __assign(__assign({}, focusRing({
|
|
127
|
+
width: 0,
|
|
128
|
+
outerColor: variant === 'inverse' ? colors.frenchVanilla100 : themeFocusOutline,
|
|
129
|
+
})), { borderWidth: '1px', borderColor: checked
|
|
130
|
+
? variant === 'inverse'
|
|
131
|
+
? colors.soap300
|
|
132
|
+
: themePrimary.main
|
|
133
|
+
: inputColors.border }),
|
|
109
134
|
'&:focus:hover ~ div:first-of-type, &:focus:active ~ div:first-of-type': {
|
|
110
|
-
borderColor: checked
|
|
135
|
+
borderColor: checked
|
|
136
|
+
? variant === 'inverse'
|
|
137
|
+
? colors.soap300
|
|
138
|
+
: themePrimary.main
|
|
139
|
+
: variant === 'inverse'
|
|
140
|
+
? colors.soap300
|
|
141
|
+
: inputColors.hoverBorder,
|
|
111
142
|
},
|
|
112
143
|
})));
|
|
113
144
|
});
|
|
@@ -127,18 +158,25 @@ var RadioBackground = styled('div')({
|
|
|
127
158
|
transition: 'border 200ms ease, background 200ms',
|
|
128
159
|
width: radioWidth,
|
|
129
160
|
}, function (_a) {
|
|
130
|
-
var checked = _a.checked, disabled = _a.disabled, themePrimary = _a.theme.canvas.palette.primary;
|
|
161
|
+
var checked = _a.checked, disabled = _a.disabled, variant = _a.variant, themePrimary = _a.theme.canvas.palette.primary;
|
|
131
162
|
return ({
|
|
132
163
|
borderColor: checked
|
|
133
|
-
?
|
|
164
|
+
? variant === 'inverse'
|
|
165
|
+
? colors.soap300
|
|
166
|
+
: themePrimary.main
|
|
134
167
|
: disabled
|
|
135
168
|
? inputColors.disabled.border
|
|
136
|
-
:
|
|
169
|
+
: variant === 'inverse'
|
|
170
|
+
? colors.soap300
|
|
171
|
+
: inputColors.border,
|
|
137
172
|
backgroundColor: checked
|
|
138
|
-
?
|
|
173
|
+
? variant === 'inverse'
|
|
174
|
+
? colors.frenchVanilla100
|
|
175
|
+
: themePrimary.main
|
|
139
176
|
: disabled
|
|
140
177
|
? inputColors.disabled.background
|
|
141
178
|
: 'white',
|
|
179
|
+
opacity: disabled && variant === 'inverse' ? '.4' : '1',
|
|
142
180
|
});
|
|
143
181
|
});
|
|
144
182
|
var RadioCheck = styled('div')({
|
|
@@ -150,9 +188,11 @@ var RadioCheck = styled('div')({
|
|
|
150
188
|
transition: 'transform 200ms ease, opacity 200ms ease',
|
|
151
189
|
width: radioDot,
|
|
152
190
|
}, function (_a) {
|
|
153
|
-
var theme = _a.theme;
|
|
191
|
+
var theme = _a.theme, variant = _a.variant;
|
|
154
192
|
return ({
|
|
155
|
-
backgroundColor:
|
|
193
|
+
backgroundColor: variant === 'inverse'
|
|
194
|
+
? theme.canvas.palette.primary.main
|
|
195
|
+
: theme.canvas.palette.primary.contrast,
|
|
156
196
|
});
|
|
157
197
|
}, function (_a) {
|
|
158
198
|
var checked = _a.checked;
|
|
@@ -162,21 +202,29 @@ var RadioCheck = styled('div')({
|
|
|
162
202
|
});
|
|
163
203
|
});
|
|
164
204
|
var RadioLabel = styled('label')(__assign(__assign({}, canvas.type.levels.subtext.large), { paddingLeft: radioLabelDistance }), function (_a) {
|
|
165
|
-
var
|
|
166
|
-
return (
|
|
205
|
+
var variant = _a.variant;
|
|
206
|
+
return (variant === 'inverse' ? { color: colors.frenchVanilla100 } : undefined);
|
|
207
|
+
}, function (_a) {
|
|
208
|
+
var disabled = _a.disabled, variant = _a.variant;
|
|
209
|
+
return disabled
|
|
210
|
+
? {
|
|
211
|
+
color: variant === 'inverse' ? colors.frenchVanilla100 : inputColors.disabled.text,
|
|
212
|
+
opacity: variant === 'inverse' ? '.4' : '1',
|
|
213
|
+
}
|
|
214
|
+
: { cursor: 'pointer' };
|
|
167
215
|
});
|
|
168
216
|
export var Radio = createComponent('input')({
|
|
169
217
|
displayName: 'Radio',
|
|
170
218
|
Component: function (_a, ref, Element) {
|
|
171
|
-
var _b = _a.checked, checked = _b === void 0 ? false : _b, id = _a.id, _c = _a.label, label = _c === void 0 ? '' : _c, disabled = _a.disabled, name = _a.name, onChange = _a.onChange, value = _a.value, elemProps = __rest(_a, ["checked", "id", "label", "disabled", "name", "onChange", "value"]);
|
|
219
|
+
var _b = _a.checked, checked = _b === void 0 ? false : _b, id = _a.id, _c = _a.label, label = _c === void 0 ? '' : _c, disabled = _a.disabled, name = _a.name, onChange = _a.onChange, value = _a.value, variant = _a.variant, elemProps = __rest(_a, ["checked", "id", "label", "disabled", "name", "onChange", "value", "variant"]);
|
|
172
220
|
var inputId = useUniqueId(id);
|
|
173
221
|
return (React.createElement(RadioContainer, null,
|
|
174
222
|
React.createElement(RadioInputWrapper, { disabled: disabled },
|
|
175
|
-
React.createElement(RadioInput, __assign({ as: Element, checked: checked, disabled: disabled, id: inputId, ref: ref, name: name, onChange: onChange, type: "radio", value: value, "aria-checked": checked }, elemProps)),
|
|
176
|
-
React.createElement(RadioRipple,
|
|
177
|
-
React.createElement(RadioBackground, { checked: checked, disabled: disabled },
|
|
178
|
-
React.createElement(RadioCheck, { checked: checked }))),
|
|
179
|
-
label && (React.createElement(RadioLabel, { htmlFor: inputId, disabled: disabled }, label))));
|
|
223
|
+
React.createElement(RadioInput, __assign({ as: Element, checked: checked, disabled: disabled, id: inputId, ref: ref, name: name, onChange: onChange, type: "radio", value: value, "aria-checked": checked, variant: variant }, elemProps)),
|
|
224
|
+
React.createElement(RadioRipple, { variant: variant }),
|
|
225
|
+
React.createElement(RadioBackground, { checked: checked, disabled: disabled, variant: variant },
|
|
226
|
+
React.createElement(RadioCheck, { checked: checked, variant: variant }))),
|
|
227
|
+
label && (React.createElement(RadioLabel, { htmlFor: inputId, disabled: disabled, variant: variant }, label))));
|
|
180
228
|
},
|
|
181
229
|
});
|
|
182
230
|
export default Radio;
|
|
@@ -31,6 +31,7 @@ export declare const Tabs: import("../../common").ComponentM<TabsProps & Partial
|
|
|
31
31
|
}>;
|
|
32
32
|
initialHiddenIds: string[];
|
|
33
33
|
containerWidth: number;
|
|
34
|
+
shouldCalculateOverflow: boolean;
|
|
34
35
|
initialSelectedIds: import("../../collection/lib/useSelectionListModel").SelectedIds;
|
|
35
36
|
initialUnselectedIds: string[];
|
|
36
37
|
selection: import("../../collection/lib/useSelectionListModel").SelectionManager;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../../tabs/lib/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,IAAI
|
|
1
|
+
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../../tabs/lib/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabsItem.d.ts","sourceRoot":"","sources":["../../../../tabs/lib/TabsItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAIL,UAAU,EAGV,YAAY,
|
|
1
|
+
{"version":3,"file":"TabsItem.d.ts","sourceRoot":"","sources":["../../../../tabs/lib/TabsItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAIL,UAAU,EAGV,YAAY,EAKb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,GAAG,EAAE,UAAU,EAAC,MAAM,kCAAkC,CAAC;AAYjE,MAAM,WAAW,aACf,SAAQ,YAAY,CAAC,OAAO,GAAG,EAAE,KAAK,CAAC,EACrC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IACtC;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;;;;;;;OAaG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,aAAa;;;;wDAwFzB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoBvB,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiBnB,CAAC"}
|
|
@@ -22,7 +22,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
};
|
|
23
23
|
import * as React from 'react';
|
|
24
24
|
import { colors, space, type, borderRadius, iconColors } from '@workday/canvas-kit-react/tokens';
|
|
25
|
-
import { focusRing, hideMouseFocus, styled, createElemPropsHook, composeHooks, ellipsisStyles, EllipsisText, createSubcomponent, } from '@workday/canvas-kit-react/common';
|
|
25
|
+
import { focusRing, hideMouseFocus, styled, createElemPropsHook, composeHooks, ellipsisStyles, EllipsisText, createSubcomponent, useModalityType, } from '@workday/canvas-kit-react/common';
|
|
26
26
|
import { Box } from '@workday/canvas-kit-react/layout';
|
|
27
27
|
import { OverflowTooltip } from '@workday/canvas-kit-react/tooltip';
|
|
28
28
|
import { SystemIcon } from '@workday/canvas-kit-react/icon';
|
|
@@ -32,7 +32,7 @@ export var StyledTabItem = styled(Box.as('button'))(function (_a) {
|
|
|
32
32
|
var theme = _a.theme, spacing = _a.spacing;
|
|
33
33
|
return (__assign(__assign(__assign(__assign({}, type.levels.subtext.large), { '& > *:not(style) ~ *:not(style)': {
|
|
34
34
|
marginLeft: spacing || space.xxs,
|
|
35
|
-
}, fontWeight: type.properties.fontWeights.medium, border: 'none', backgroundColor: 'transparent', flex: '0 0 auto', alignItems: 'center',
|
|
35
|
+
}, fontWeight: type.properties.fontWeights.medium, border: 'none', backgroundColor: 'transparent', flex: '0 0 auto', alignItems: 'center', padding: space.xs + " " + space.s, height: 52, boxSizing: 'border-box', cursor: 'pointer', color: colors.licorice300, position: 'relative', borderRadius: borderRadius.m + " " + borderRadius.m + " 0px 0px", transition: 'background 150ms ease, color 150ms ease' }), hideMouseFocus), { '.wd-icon-background ~ .wd-icon-accent, .wd-icon-background ~ .wd-icon-accent2': {
|
|
36
36
|
fill: iconColors.active,
|
|
37
37
|
}, '&:hover, &:focus': {
|
|
38
38
|
backgroundColor: colors.soap200,
|
|
@@ -109,8 +109,9 @@ export var TabsItem = createSubcomponent('button')({
|
|
|
109
109
|
Icon: SystemIcon,
|
|
110
110
|
Text: EllipsisText,
|
|
111
111
|
},
|
|
112
|
-
})(function (_a, Element
|
|
112
|
+
})(function (_a, Element) {
|
|
113
113
|
var children = _a.children, elemProps = __rest(_a, ["children"]);
|
|
114
|
+
var modality = useModalityType();
|
|
114
115
|
return (React.createElement(OverflowTooltip, null,
|
|
115
|
-
React.createElement(StyledTabItem, __assign({ as: Element }, elemProps), children)));
|
|
116
|
+
React.createElement(StyledTabItem, __assign({ as: Element, maxWidth: modality === 'touch' ? undefined : 280 }, elemProps), children)));
|
|
116
117
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabsList.d.ts","sourceRoot":"","sources":["../../../../tabs/lib/TabsList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAIL,YAAY,
|
|
1
|
+
{"version":3,"file":"TabsList.d.ts","sourceRoot":"","sources":["../../../../tabs/lib/TabsList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAIL,YAAY,EAIb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,KAAK,EAAC,MAAM,kCAAkC,CAAC;AAUvD,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,OAAO,CAAE,SAAQ,OAAO,CAAC,YAAY,CAAC,OAAO,KAAK,EAAE,KAAK,CAAC,CAAC;IAC3F;;;;;;;;OAQG;IACH,QAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC;IAC3D,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAClC;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAOvB,CAAC;AAgBF,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBnB,CAAC"}
|
|
@@ -22,20 +22,35 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
};
|
|
23
23
|
import * as React from 'react';
|
|
24
24
|
import { commonColors } from '@workday/canvas-kit-react/tokens';
|
|
25
|
-
import { composeHooks, createSubcomponent, createElemPropsHook, } from '@workday/canvas-kit-react/common';
|
|
25
|
+
import { composeHooks, createSubcomponent, createElemPropsHook, useModalityType, styled, } from '@workday/canvas-kit-react/common';
|
|
26
26
|
import { Stack } from '@workday/canvas-kit-react/layout';
|
|
27
27
|
import { useOverflowListMeasure, useListRenderItems, useListResetCursorOnBlur, } from '@workday/canvas-kit-react/collection';
|
|
28
28
|
import { useTabsModel } from './useTabsModel';
|
|
29
29
|
export var useTabsList = composeHooks(createElemPropsHook(useTabsModel)(function () {
|
|
30
|
-
|
|
30
|
+
var modality = useModalityType();
|
|
31
|
+
return { role: 'tablist', overflowX: modality === 'touch' ? 'auto' : undefined };
|
|
31
32
|
}), useOverflowListMeasure, useListResetCursorOnBlur);
|
|
33
|
+
var StyledStack = styled(Stack)({
|
|
34
|
+
'::after': {
|
|
35
|
+
content: '""',
|
|
36
|
+
position: 'sticky',
|
|
37
|
+
height: 52,
|
|
38
|
+
minWidth: 30,
|
|
39
|
+
background: "linear-gradient(to right,rgba(255,255,255,0),white);",
|
|
40
|
+
zIndex: 1,
|
|
41
|
+
right: 0,
|
|
42
|
+
top: 0,
|
|
43
|
+
pointerEvents: 'none',
|
|
44
|
+
},
|
|
45
|
+
});
|
|
32
46
|
export var TabsList = createSubcomponent('div')({
|
|
33
47
|
displayName: 'Tabs.List',
|
|
34
48
|
modelHook: useTabsModel,
|
|
35
49
|
elemPropsHook: useTabsList,
|
|
36
50
|
})(function (_a, Element, model) {
|
|
37
51
|
var children = _a.children, overflowButton = _a.overflowButton, elemProps = __rest(_a, ["children", "overflowButton"]);
|
|
38
|
-
|
|
52
|
+
var modality = useModalityType();
|
|
53
|
+
return (React.createElement(StyledStack, __assign({ as: Element, position: "relative", borderBottom: "1px solid " + commonColors.divider, paddingX: modality === 'touch' ? 'zero' : 'm', spacing: "xxxs" }, elemProps),
|
|
39
54
|
useListRenderItems(model, children),
|
|
40
55
|
overflowButton));
|
|
41
56
|
});
|