@strapi/design-system 2.0.0-rc.7 → 2.0.0-rc.8
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/dist/components/Accordion/Accordion.d.ts +1 -1
- package/dist/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/components/Alert/Alert.d.ts +1 -1
- package/dist/components/Alert/Alert.d.ts.map +1 -1
- package/dist/components/Avatar/Avatar.d.ts +1 -1
- package/dist/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/components/Badge/Badge.d.ts +4 -4
- package/dist/components/Badge/Badge.d.ts.map +1 -1
- package/dist/components/BaseLink/BaseLink.d.ts +1 -1
- package/dist/components/BaseLink/BaseLink.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/Crumb.d.ts +1 -1
- package/dist/components/Breadcrumbs/Crumb.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/CrumbSimpleMenu.d.ts +33 -3
- package/dist/components/Breadcrumbs/CrumbSimpleMenu.d.ts.map +1 -1
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Card/Card.d.ts +1 -1
- package/dist/components/Card/Card.d.ts.map +1 -1
- package/dist/components/Card/CardAction.d.ts +1 -1
- package/dist/components/Card/CardAction.d.ts.map +1 -1
- package/dist/components/Card/CardBody.d.ts +1 -1
- package/dist/components/Card/CardBody.d.ts.map +1 -1
- package/dist/components/Card/CardContent.d.ts +1 -1
- package/dist/components/Card/CardContent.d.ts.map +1 -1
- package/dist/components/Card/CardHeader.d.ts +1 -1
- package/dist/components/Card/CardHeader.d.ts.map +1 -1
- package/dist/components/Card/CardTimer.d.ts +1 -1
- package/dist/components/Card/CardTimer.d.ts.map +1 -1
- package/dist/components/Card/CardTitle.d.ts +1 -1
- package/dist/components/Card/CardTitle.d.ts.map +1 -1
- package/dist/components/CarouselInput/Carousel.d.ts +1 -1
- package/dist/components/CarouselInput/Carousel.d.ts.map +1 -1
- package/dist/components/CarouselInput/CarouselActions.d.ts +1 -1
- package/dist/components/CarouselInput/CarouselActions.d.ts.map +1 -1
- package/dist/components/CarouselInput/CarouselImage.d.ts +1 -1
- package/dist/components/CarouselInput/CarouselImage.d.ts.map +1 -1
- package/dist/components/CarouselInput/CarouselInput.d.ts.map +1 -1
- package/dist/components/CarouselInput/CarouselSlide.d.ts +1 -1
- package/dist/components/CarouselInput/CarouselSlide.d.ts.map +1 -1
- package/dist/components/Combobox/Combobox.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DateTimePicker/DateTimePicker.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.d.ts +2 -2
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Divider/Divider.d.ts +1 -1
- package/dist/components/Divider/Divider.d.ts.map +1 -1
- package/dist/components/EmptyStateLayout/EmptyStateLayout.d.ts +1 -1
- package/dist/components/EmptyStateLayout/EmptyStateLayout.d.ts.map +1 -1
- package/dist/components/Field/Field.d.ts +2 -2
- package/dist/components/Field/Field.d.ts.map +1 -1
- package/dist/components/IconButton/IconButton.d.ts +1 -1
- package/dist/components/IconButton/IconButton.d.ts.map +1 -1
- package/dist/components/JSONInput/JSONInput.d.ts +1 -1
- package/dist/components/JSONInput/JSONInput.d.ts.map +1 -1
- package/dist/components/Link/Link.d.ts.map +1 -1
- package/dist/components/Main/Main.d.ts +1 -1
- package/dist/components/Main/Main.d.ts.map +1 -1
- package/dist/components/Modal/Modal.d.ts +2 -2
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/components/Pagination/components.d.ts +1 -1
- package/dist/components/Pagination/components.d.ts.map +1 -1
- package/dist/components/Popover/Popover.d.ts.map +1 -1
- package/dist/components/RawTable/RawCell.d.ts +1 -1
- package/dist/components/RawTable/RawCell.d.ts.map +1 -1
- package/dist/components/RawTable/RawTr.d.ts +1 -1
- package/dist/components/RawTable/RawTr.d.ts.map +1 -1
- package/dist/components/Select/SelectParts.d.ts +2 -2
- package/dist/components/Select/SelectParts.d.ts.map +1 -1
- package/dist/components/SimpleMenu/Menu.d.ts +19 -7
- package/dist/components/SimpleMenu/Menu.d.ts.map +1 -1
- package/dist/components/SimpleMenu/SimpleMenu.d.ts +31 -4
- package/dist/components/SimpleMenu/SimpleMenu.d.ts.map +1 -1
- package/dist/components/Status/Status.d.ts +1 -1
- package/dist/components/Status/Status.d.ts.map +1 -1
- package/dist/components/SubNav/SubNav.d.ts +1 -1
- package/dist/components/SubNav/SubNav.d.ts.map +1 -1
- package/dist/components/SubNav/SubNavHeader.d.ts +3 -3
- package/dist/components/SubNav/SubNavHeader.d.ts.map +1 -1
- package/dist/components/SubNav/SubNavLink.d.ts.map +1 -1
- package/dist/components/SubNav/SubNavSections.d.ts +1 -1
- package/dist/components/SubNav/SubNavSections.d.ts.map +1 -1
- package/dist/components/Table/TFooter.d.ts +1 -1
- package/dist/components/Table/TFooter.d.ts.map +1 -1
- package/dist/components/Tag/Tag.d.ts +1 -1
- package/dist/components/Tag/Tag.d.ts.map +1 -1
- package/dist/components/TextButton/TextButton.d.ts +1 -1
- package/dist/components/TextButton/TextButton.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.d.ts +1 -1
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/Toggle/Toggle.d.ts.map +1 -1
- package/dist/components/index.d.ts +0 -5
- package/dist/components/index.d.ts.map +1 -1
- package/dist/helpers/handleResponsiveValues.d.ts +30 -15
- package/dist/helpers/handleResponsiveValues.d.ts.map +1 -1
- package/dist/helpers/theme.d.ts +1 -1
- package/dist/helpers/theme.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +615 -497
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +615 -497
- package/dist/index.mjs.map +1 -1
- package/dist/primitives/Box/Box.d.ts +84 -0
- package/dist/primitives/Box/Box.d.ts.map +1 -0
- package/dist/primitives/Box/index.d.ts.map +1 -0
- package/dist/{components → primitives}/Flex/Flex.d.ts +7 -8
- package/dist/primitives/Flex/Flex.d.ts.map +1 -0
- package/dist/primitives/Flex/index.d.ts.map +1 -0
- package/dist/{components → primitives}/Grid/Grid.d.ts +4 -3
- package/dist/primitives/Grid/Grid.d.ts.map +1 -0
- package/dist/primitives/Grid/index.d.ts.map +1 -0
- package/dist/{components → primitives}/Typography/Typography.d.ts +5 -9
- package/dist/primitives/Typography/Typography.d.ts.map +1 -0
- package/dist/primitives/Typography/index.d.ts.map +1 -0
- package/dist/primitives/index.d.ts +5 -0
- package/dist/primitives/index.d.ts.map +1 -0
- package/dist/themes/common-theme.d.ts +8 -4
- package/dist/themes/common-theme.d.ts.map +1 -1
- package/dist/utilities/KeyboardNavigable/KeyboardNavigable.d.ts +1 -1
- package/dist/utilities/KeyboardNavigable/KeyboardNavigable.d.ts.map +1 -1
- package/dist/utilities/Portal/Portal.d.ts +1 -1
- package/package.json +3 -3
- package/dist/components/Box/Box.d.ts +0 -102
- package/dist/components/Box/Box.d.ts.map +0 -1
- package/dist/components/Box/index.d.ts.map +0 -1
- package/dist/components/Flex/Flex.d.ts.map +0 -1
- package/dist/components/Flex/index.d.ts.map +0 -1
- package/dist/components/Grid/Grid.d.ts.map +0 -1
- package/dist/components/Grid/index.d.ts.map +0 -1
- package/dist/components/Typography/Typography.d.ts.map +0 -1
- package/dist/components/Typography/index.d.ts.map +0 -1
- /package/dist/{components → primitives}/Box/index.d.ts +0 -0
- /package/dist/{components → primitives}/Flex/index.d.ts +0 -0
- /package/dist/{components → primitives}/Grid/index.d.ts +0 -0
- /package/dist/{components → primitives}/Typography/index.d.ts +0 -0
package/dist/index.mjs
CHANGED
|
@@ -48,32 +48,6 @@ const createContext = (rootComponentName, defaultContext) => {
|
|
|
48
48
|
Provider2.displayName = `${rootComponentName}Provider`;
|
|
49
49
|
return [Provider2, useContext];
|
|
50
50
|
};
|
|
51
|
-
const handleResponsiveValues = (property, value, theme) => {
|
|
52
|
-
if (!value) {
|
|
53
|
-
return void 0;
|
|
54
|
-
}
|
|
55
|
-
if (typeof value === "object") {
|
|
56
|
-
const transformedArray = Array.isArray(value) ? value : [value?.desktop, value?.tablet, value?.mobile];
|
|
57
|
-
const spaces = transformedArray.reduce((acc, curr, index) => {
|
|
58
|
-
if (curr) {
|
|
59
|
-
switch (index) {
|
|
60
|
-
case 0:
|
|
61
|
-
return `${acc}${property}: ${theme.spaces[curr]};`;
|
|
62
|
-
case 1:
|
|
63
|
-
return `${acc}${theme.mediaQueries.tablet}{${property}: ${theme.spaces[curr]};}`;
|
|
64
|
-
case 2:
|
|
65
|
-
return `${acc}${theme.mediaQueries.mobile}{${property}: ${theme.spaces[curr]};}`;
|
|
66
|
-
default:
|
|
67
|
-
return acc;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return acc;
|
|
71
|
-
}, "");
|
|
72
|
-
return spaces;
|
|
73
|
-
}
|
|
74
|
-
const realValue = theme.spaces[value] ?? value;
|
|
75
|
-
return `${property}: ${realValue};`;
|
|
76
|
-
};
|
|
77
51
|
function isKeyOf(o, s) {
|
|
78
52
|
if (typeof o === "string") {
|
|
79
53
|
return false;
|
|
@@ -84,11 +58,166 @@ function isObject(item) {
|
|
|
84
58
|
return item && typeof item === "object" && !Array.isArray(item);
|
|
85
59
|
}
|
|
86
60
|
function extractStyleFromTheme(themeSection, key, defaultValue) {
|
|
87
|
-
if (key && isKeyOf(themeSection, key)) {
|
|
61
|
+
if (themeSection && key && isKeyOf(themeSection, key)) {
|
|
88
62
|
return themeSection[key];
|
|
89
63
|
}
|
|
90
64
|
return defaultValue;
|
|
91
65
|
}
|
|
66
|
+
const mappedCSSProps = {
|
|
67
|
+
padding: ["padding-block-start", "padding-inline-end", "padding-block-end", "padding-inline-start"],
|
|
68
|
+
paddingTop: "padding-block-start",
|
|
69
|
+
paddingRight: "padding-inline-end",
|
|
70
|
+
paddingBottom: "padding-block-end",
|
|
71
|
+
paddingLeft: "padding-inline-start",
|
|
72
|
+
margin: ["margin-block-start", "margin-inline-end", "margin-block-end", "margin-inline-start"],
|
|
73
|
+
marginLeft: "margin-inline-start",
|
|
74
|
+
marginRight: "margin-inline-end",
|
|
75
|
+
marginTop: "margin-block-start",
|
|
76
|
+
marginBottom: "margin-block-end",
|
|
77
|
+
borderRadius: "border-radius",
|
|
78
|
+
borderStyle: "border-style",
|
|
79
|
+
borderWidth: "border-width",
|
|
80
|
+
borderColor: "border-color",
|
|
81
|
+
fontSize: "font-size",
|
|
82
|
+
fontWeight: "font-weight",
|
|
83
|
+
lineHeight: "line-height",
|
|
84
|
+
zIndex: "z-index",
|
|
85
|
+
boxShadow: "box-shadow",
|
|
86
|
+
pointerEvents: "pointer-events",
|
|
87
|
+
textAlign: "text-align",
|
|
88
|
+
textTransform: "text-transform",
|
|
89
|
+
textDecoration: "text-decoration",
|
|
90
|
+
flexGrow: "flex-grow",
|
|
91
|
+
flexShrink: "flex-shrink",
|
|
92
|
+
flexBasis: "flex-basis",
|
|
93
|
+
minWidth: "min-width",
|
|
94
|
+
maxWidth: "max-width",
|
|
95
|
+
minHeight: "min-height",
|
|
96
|
+
maxHeight: "max-height",
|
|
97
|
+
flexDirection: "flex-direction",
|
|
98
|
+
flexWrap: "flex-wrap",
|
|
99
|
+
justifyContent: "justify-content",
|
|
100
|
+
alignItems: "align-items"
|
|
101
|
+
};
|
|
102
|
+
const fillCssValues = (value) => {
|
|
103
|
+
const [top, right, bottom, left] = value;
|
|
104
|
+
const rightValue = right ?? top;
|
|
105
|
+
const bottomValue = bottom ?? top;
|
|
106
|
+
const leftValue = left ?? rightValue;
|
|
107
|
+
return [top, rightValue, bottomValue, leftValue];
|
|
108
|
+
};
|
|
109
|
+
function getThemeSection(key, theme) {
|
|
110
|
+
switch (key) {
|
|
111
|
+
case "gap":
|
|
112
|
+
case "padding":
|
|
113
|
+
case "margin":
|
|
114
|
+
case "paddingTop":
|
|
115
|
+
case "paddingLeft":
|
|
116
|
+
case "paddingRight":
|
|
117
|
+
case "paddingBottom":
|
|
118
|
+
case "marginTop":
|
|
119
|
+
case "marginLeft":
|
|
120
|
+
case "marginRight":
|
|
121
|
+
case "marginBottom":
|
|
122
|
+
case "left":
|
|
123
|
+
case "right":
|
|
124
|
+
case "top":
|
|
125
|
+
case "bottom":
|
|
126
|
+
case "width":
|
|
127
|
+
case "maxWidth":
|
|
128
|
+
case "minWidth":
|
|
129
|
+
case "height":
|
|
130
|
+
case "maxHeight":
|
|
131
|
+
case "minHeight":
|
|
132
|
+
case "borderRadius":
|
|
133
|
+
case "borderWidth":
|
|
134
|
+
return theme.spaces;
|
|
135
|
+
case "color":
|
|
136
|
+
case "background":
|
|
137
|
+
case "borderColor":
|
|
138
|
+
return theme.colors;
|
|
139
|
+
case "fontSize":
|
|
140
|
+
return theme.fontSizes;
|
|
141
|
+
case "fontWeight":
|
|
142
|
+
return theme.fontWeights;
|
|
143
|
+
case "lineHeight":
|
|
144
|
+
return theme.lineHeights;
|
|
145
|
+
case "zIndex":
|
|
146
|
+
return theme.zIndices;
|
|
147
|
+
case "boxShadow":
|
|
148
|
+
return theme.shadows;
|
|
149
|
+
default:
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
const handleResponsiveValues = (values, theme) => {
|
|
154
|
+
const stylesByBreakpoint = Object.entries(values).reduce(
|
|
155
|
+
(acc, curr) => {
|
|
156
|
+
const [key, value] = curr;
|
|
157
|
+
const themeSection = getThemeSection(key, theme);
|
|
158
|
+
const cssProperty = Object.prototype.hasOwnProperty.call(mappedCSSProps, key) ? mappedCSSProps[key] : key;
|
|
159
|
+
if (cssProperty && (value || value === 0)) {
|
|
160
|
+
if (typeof value === "object" && !Array.isArray(value)) {
|
|
161
|
+
Object.entries(value).forEach(([breakpointName, breakpointValue]) => {
|
|
162
|
+
acc[breakpointName] = {
|
|
163
|
+
...acc[breakpointName],
|
|
164
|
+
...convertCssPropertiesToCssValues(cssProperty, breakpointValue, themeSection)
|
|
165
|
+
};
|
|
166
|
+
});
|
|
167
|
+
} else {
|
|
168
|
+
acc.initial = {
|
|
169
|
+
...acc.initial,
|
|
170
|
+
...convertCssPropertiesToCssValues(cssProperty, value, themeSection)
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return acc;
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
initial: {},
|
|
178
|
+
small: {},
|
|
179
|
+
medium: {},
|
|
180
|
+
large: {}
|
|
181
|
+
}
|
|
182
|
+
);
|
|
183
|
+
return Object.entries(stylesByBreakpoint).reduce((acc, [key, value]) => {
|
|
184
|
+
if (value && Object.keys(value).length > 0) {
|
|
185
|
+
const breakpointStyles = Object.entries(value).reduce((arr, [property, value2]) => {
|
|
186
|
+
arr.push(`${property}: ${value2};`);
|
|
187
|
+
return arr;
|
|
188
|
+
}, []).join("\n");
|
|
189
|
+
if (key === "initial") {
|
|
190
|
+
acc.push(breakpointStyles);
|
|
191
|
+
} else {
|
|
192
|
+
acc.push(`${theme.breakpoints[key]}{ ${breakpointStyles} }`);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return acc;
|
|
196
|
+
}, []).join("\n");
|
|
197
|
+
};
|
|
198
|
+
const convertCssPropertiesToCssValues = (property, value, themeSection) => {
|
|
199
|
+
if (Array.isArray(property) && Array.isArray(value)) {
|
|
200
|
+
const shorthandValues = fillCssValues(value);
|
|
201
|
+
return property.reduce((acc, prop, index) => {
|
|
202
|
+
acc[prop] = extractStyleFromTheme(themeSection, shorthandValues[index], shorthandValues[index]);
|
|
203
|
+
return acc;
|
|
204
|
+
}, {});
|
|
205
|
+
} else if (Array.isArray(property) && !Array.isArray(value)) {
|
|
206
|
+
return property.reduce((acc, prop) => {
|
|
207
|
+
acc[prop] = extractStyleFromTheme(themeSection, value, value);
|
|
208
|
+
return acc;
|
|
209
|
+
}, {});
|
|
210
|
+
} else if (!Array.isArray(property) && !Array.isArray(value)) {
|
|
211
|
+
return {
|
|
212
|
+
[property]: extractStyleFromTheme(themeSection, value, value)
|
|
213
|
+
};
|
|
214
|
+
} else {
|
|
215
|
+
console.warn(
|
|
216
|
+
"You've passed an array of values to a property that does not support it. Please check the property and value you're passing."
|
|
217
|
+
);
|
|
218
|
+
return {};
|
|
219
|
+
}
|
|
220
|
+
};
|
|
92
221
|
const forwardRef = React.forwardRef;
|
|
93
222
|
const Box = forwardRef((props, ref) => {
|
|
94
223
|
const {
|
|
@@ -100,8 +229,6 @@ const Box = forwardRef((props, ref) => {
|
|
|
100
229
|
fontSize,
|
|
101
230
|
grow,
|
|
102
231
|
hasRadius,
|
|
103
|
-
hiddenS,
|
|
104
|
-
hiddenXS,
|
|
105
232
|
padding,
|
|
106
233
|
paddingBottom,
|
|
107
234
|
paddingLeft,
|
|
@@ -115,6 +242,7 @@ const Box = forwardRef((props, ref) => {
|
|
|
115
242
|
shadow,
|
|
116
243
|
shrink,
|
|
117
244
|
lineHeight,
|
|
245
|
+
fontWeight,
|
|
118
246
|
width,
|
|
119
247
|
minWidth,
|
|
120
248
|
maxWidth,
|
|
@@ -152,8 +280,6 @@ const Box = forwardRef((props, ref) => {
|
|
|
152
280
|
$fontSize: fontSize,
|
|
153
281
|
$grow: grow,
|
|
154
282
|
$hasRadius: hasRadius,
|
|
155
|
-
$hiddenS: hiddenS,
|
|
156
|
-
$hiddenXS: hiddenXS,
|
|
157
283
|
$padding: padding,
|
|
158
284
|
$paddingBottom: paddingBottom,
|
|
159
285
|
$paddingLeft: paddingLeft,
|
|
@@ -167,6 +293,7 @@ const Box = forwardRef((props, ref) => {
|
|
|
167
293
|
$shadow: shadow,
|
|
168
294
|
$shrink: shrink,
|
|
169
295
|
$lineHeight: lineHeight,
|
|
296
|
+
$fontWeight: fontWeight,
|
|
170
297
|
$width: width,
|
|
171
298
|
$minWidth: minWidth,
|
|
172
299
|
$maxWidth: maxWidth,
|
|
@@ -195,110 +322,83 @@ const Box = forwardRef((props, ref) => {
|
|
|
195
322
|
return /* @__PURE__ */ jsx(StyledBox, { as: AsComponent, ref, ...mappedProps, ...rest });
|
|
196
323
|
});
|
|
197
324
|
const StyledBox = styled.div`
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
325
|
+
${({ theme, ...props }) => {
|
|
326
|
+
return handleResponsiveValues(
|
|
327
|
+
{
|
|
328
|
+
padding: props.$padding,
|
|
329
|
+
paddingTop: props.$paddingTop,
|
|
330
|
+
paddingBottom: props.$paddingBottom,
|
|
331
|
+
paddingLeft: props.$paddingLeft,
|
|
332
|
+
paddingRight: props.$paddingRight,
|
|
333
|
+
margin: props.$margin,
|
|
334
|
+
marginTop: props.$marginTop,
|
|
335
|
+
marginBottom: props.$marginBottom,
|
|
336
|
+
marginLeft: props.$marginLeft,
|
|
337
|
+
marginRight: props.$marginRight,
|
|
338
|
+
top: props.$top,
|
|
339
|
+
left: props.$left,
|
|
340
|
+
bottom: props.$bottom,
|
|
341
|
+
right: props.$right,
|
|
342
|
+
width: props.$width,
|
|
343
|
+
minWidth: props.$minWidth,
|
|
344
|
+
maxWidth: props.$maxWidth,
|
|
345
|
+
height: props.$height,
|
|
346
|
+
minHeight: props.$minHeight,
|
|
347
|
+
maxHeight: props.$maxHeight,
|
|
348
|
+
color: props.$color,
|
|
349
|
+
background: props.$background,
|
|
350
|
+
fontSize: props.$fontSize,
|
|
351
|
+
fontWeight: props.$fontWeight,
|
|
352
|
+
lineHeight: props.$lineHeight,
|
|
353
|
+
borderRadius: props.$hasRadius ? theme.borderRadius : props.$borderRadius,
|
|
354
|
+
borderStyle: props.$borderColor && !props.$borderStyle ? "solid" : props.$borderStyle,
|
|
355
|
+
borderWidth: props.$borderColor && !props.$borderWidth ? "1px" : props.$borderWidth,
|
|
356
|
+
borderColor: props.$borderColor,
|
|
357
|
+
zIndex: props.$zIndex,
|
|
358
|
+
boxShadow: props.$shadow,
|
|
359
|
+
display: props.$display,
|
|
360
|
+
pointerEvents: props.$pointerEvents,
|
|
361
|
+
cursor: props.$cursor,
|
|
362
|
+
textAlign: props.$textAlign,
|
|
363
|
+
textTransform: props.$textTransform,
|
|
364
|
+
transition: props.$transition,
|
|
365
|
+
transform: props.$transform,
|
|
366
|
+
animation: props.$animation,
|
|
367
|
+
position: props.$position,
|
|
368
|
+
overflow: props.$overflow,
|
|
369
|
+
flex: props.$flex,
|
|
370
|
+
flexShrink: props.$shrink,
|
|
371
|
+
flexGrow: props.$grow,
|
|
372
|
+
flexBasis: props.$basis
|
|
373
|
+
},
|
|
374
|
+
theme
|
|
375
|
+
);
|
|
235
376
|
}};
|
|
236
|
-
|
|
237
|
-
// Shadows
|
|
238
|
-
box-shadow: ${({ theme, $shadow }) => extractStyleFromTheme(theme.shadows, $shadow, void 0)};
|
|
239
|
-
|
|
240
|
-
// Handlers
|
|
241
|
-
pointer-events: ${({ $pointerEvents }) => $pointerEvents};
|
|
242
|
-
|
|
243
|
-
// Display
|
|
244
|
-
display: ${({ $display }) => $display};
|
|
245
|
-
|
|
246
|
-
// Position
|
|
247
|
-
position: ${({ $position }) => $position};
|
|
248
|
-
left: ${({ $left, theme }) => extractStyleFromTheme(theme.spaces, $left, $left)};
|
|
249
|
-
right: ${({ $right, theme }) => extractStyleFromTheme(theme.spaces, $right, $right)};
|
|
250
|
-
top: ${({ $top, theme }) => extractStyleFromTheme(theme.spaces, $top, $top)};
|
|
251
|
-
bottom: ${({ $bottom, theme }) => extractStyleFromTheme(theme.spaces, $bottom, $bottom)};
|
|
252
|
-
z-index: ${({ $zIndex, theme }) => extractStyleFromTheme(theme.zIndices, $zIndex, $zIndex)};
|
|
253
|
-
overflow: ${({ $overflow }) => $overflow};
|
|
254
|
-
|
|
255
|
-
// Size
|
|
256
|
-
width: ${({ $width, theme }) => extractStyleFromTheme(theme.spaces, $width, $width)};
|
|
257
|
-
max-width: ${({ $maxWidth, theme }) => extractStyleFromTheme(theme.spaces, $maxWidth, $maxWidth)};
|
|
258
|
-
min-width: ${({ $minWidth, theme }) => extractStyleFromTheme(theme.spaces, $minWidth, $minWidth)};
|
|
259
|
-
height: ${({ $height, theme }) => extractStyleFromTheme(theme.spaces, $height, $height)};
|
|
260
|
-
max-height: ${({ $maxHeight, theme }) => extractStyleFromTheme(theme.spaces, $maxHeight, $maxHeight)};
|
|
261
|
-
min-height: ${({ $minHeight, theme }) => extractStyleFromTheme(theme.spaces, $minHeight, $minHeight)};
|
|
262
|
-
|
|
263
|
-
// Animation
|
|
264
|
-
transition: ${({ $transition }) => $transition};
|
|
265
|
-
transform: ${({ $transform }) => $transform};
|
|
266
|
-
animation: ${({ $animation }) => $animation};
|
|
267
|
-
|
|
268
|
-
//Flexbox children props
|
|
269
|
-
flex-shrink: ${({ $shrink }) => $shrink};
|
|
270
|
-
flex-grow: ${({ $grow }) => $grow};
|
|
271
|
-
flex-basis: ${({ $basis }) => $basis};
|
|
272
|
-
flex: ${({ $flex }) => $flex};
|
|
273
|
-
|
|
274
|
-
// Text
|
|
275
|
-
text-align: ${({ $textAlign }) => $textAlign};
|
|
276
|
-
text-transform: ${({ $textTransform }) => $textTransform};
|
|
277
|
-
line-height: ${({ theme, $lineHeight }) => extractStyleFromTheme(theme.lineHeights, $lineHeight, $lineHeight)};
|
|
278
|
-
|
|
279
|
-
// Cursor
|
|
280
|
-
cursor: ${({ $cursor }) => $cursor};
|
|
281
377
|
`;
|
|
282
378
|
const Flex = forwardRef((props, ref) => {
|
|
283
|
-
const { className, alignItems, direction,
|
|
379
|
+
const { className, alignItems, direction, inline, gap, justifyContent, wrap, ...rest } = props;
|
|
284
380
|
const mappedProps = {
|
|
285
381
|
$alignItems: alignItems,
|
|
286
382
|
$direction: direction,
|
|
287
383
|
$gap: gap,
|
|
288
|
-
$inline: inline,
|
|
289
384
|
$justifyContent: justifyContent,
|
|
290
|
-
$wrap: wrap
|
|
385
|
+
$wrap: wrap,
|
|
386
|
+
$inline: inline
|
|
291
387
|
};
|
|
292
388
|
return /* @__PURE__ */ jsx(StyledFlex, { className, ref, ...mappedProps, ...rest });
|
|
293
389
|
});
|
|
294
390
|
const StyledFlex = styled(Box)`
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
391
|
+
${({ theme, $display = "flex", $alignItems = "center", $direction = "row", ...props }) => handleResponsiveValues(
|
|
392
|
+
{
|
|
393
|
+
gap: props.$gap,
|
|
394
|
+
alignItems: $alignItems,
|
|
395
|
+
justifyContent: props.$justifyContent,
|
|
396
|
+
flexWrap: props.$wrap,
|
|
397
|
+
flexDirection: $direction,
|
|
398
|
+
display: props.$inline ? "inline-flex" : $display
|
|
399
|
+
},
|
|
400
|
+
theme
|
|
401
|
+
)};
|
|
302
402
|
`;
|
|
303
403
|
const ALPHA = "alpha";
|
|
304
404
|
const BETA = "beta";
|
|
@@ -373,26 +473,24 @@ const Typography = forwardRef(
|
|
|
373
473
|
(props, ref) => {
|
|
374
474
|
const {
|
|
375
475
|
ellipsis: ellipsis2,
|
|
376
|
-
fontSize,
|
|
377
|
-
fontWeight,
|
|
378
|
-
lineHeight,
|
|
379
|
-
textAlign,
|
|
380
476
|
textColor = "currentcolor",
|
|
381
477
|
textDecoration,
|
|
382
478
|
textTransform,
|
|
383
479
|
variant: variant2,
|
|
480
|
+
lineHeight,
|
|
481
|
+
fontWeight,
|
|
482
|
+
fontSize,
|
|
384
483
|
...rest
|
|
385
484
|
} = props;
|
|
386
485
|
const mappedProps = {
|
|
387
486
|
$ellipsis: ellipsis2,
|
|
388
|
-
$fontSize: fontSize,
|
|
389
|
-
$fontWeight: fontWeight,
|
|
390
|
-
$lineHeight: lineHeight,
|
|
391
|
-
$textAlign: textAlign,
|
|
392
487
|
$textColor: textColor,
|
|
393
488
|
$textDecoration: textDecoration,
|
|
394
489
|
$textTransform: textTransform,
|
|
395
|
-
$variant: variant2
|
|
490
|
+
$variant: variant2,
|
|
491
|
+
$lineHeight: lineHeight,
|
|
492
|
+
$fontWeight: fontWeight,
|
|
493
|
+
$fontSize: fontSize
|
|
396
494
|
};
|
|
397
495
|
return /* @__PURE__ */ jsx(StyledTypography, { ref, tag: "span", ...mappedProps, ...rest });
|
|
398
496
|
}
|
|
@@ -401,15 +499,19 @@ const StyledTypography = styled(Box)`
|
|
|
401
499
|
${variant}
|
|
402
500
|
${({ $ellipsis }) => $ellipsis ? ellipsis : ""}
|
|
403
501
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
502
|
+
${({ theme, ...props }) => {
|
|
503
|
+
return handleResponsiveValues(
|
|
504
|
+
{
|
|
505
|
+
color: props.$textColor,
|
|
506
|
+
textDecoration: props.$textDecoration,
|
|
507
|
+
textTransform: props.$textTransform,
|
|
508
|
+
lineHeight: props.$lineHeight,
|
|
509
|
+
fontWeight: props.$fontWeight,
|
|
510
|
+
fontSize: props.$fontSize
|
|
511
|
+
},
|
|
512
|
+
theme
|
|
513
|
+
);
|
|
514
|
+
}}
|
|
413
515
|
`;
|
|
414
516
|
const [AccordionProvider, useAccordion] = createContext("Accordion");
|
|
415
517
|
const Root$8 = React.forwardRef(({ children, size = "S", ...props }, forwardedRef) => {
|
|
@@ -1354,7 +1456,7 @@ const getActiveStyle = ({ theme, $variant }) => {
|
|
|
1354
1456
|
color: ${theme.colors[`${getVariantColorName($variant)}600`]};
|
|
1355
1457
|
`;
|
|
1356
1458
|
}
|
|
1357
|
-
if ($variant === TERTIARY) {
|
|
1459
|
+
if ($variant === TERTIARY || $variant === GHOST) {
|
|
1358
1460
|
return css`
|
|
1359
1461
|
background-color: ${theme.colors.neutral150};
|
|
1360
1462
|
`;
|
|
@@ -1494,6 +1596,153 @@ const ButtonWrapper = styled(Flex)`
|
|
|
1494
1596
|
border-color ${(props) => props.theme.motion.timings["200"]} ${(props) => props.theme.motion.easings.easeOutQuad};
|
|
1495
1597
|
}
|
|
1496
1598
|
`;
|
|
1599
|
+
const TooltipImpl = React.forwardRef(
|
|
1600
|
+
({
|
|
1601
|
+
children,
|
|
1602
|
+
description,
|
|
1603
|
+
label,
|
|
1604
|
+
defaultOpen,
|
|
1605
|
+
open,
|
|
1606
|
+
onOpenChange,
|
|
1607
|
+
delayDuration = 500,
|
|
1608
|
+
disableHoverableContent,
|
|
1609
|
+
...restProps
|
|
1610
|
+
}, forwardedRef) => {
|
|
1611
|
+
return /* @__PURE__ */ jsxs(
|
|
1612
|
+
Tooltip.Root,
|
|
1613
|
+
{
|
|
1614
|
+
defaultOpen,
|
|
1615
|
+
open,
|
|
1616
|
+
onOpenChange,
|
|
1617
|
+
delayDuration,
|
|
1618
|
+
disableHoverableContent,
|
|
1619
|
+
children: [
|
|
1620
|
+
/* @__PURE__ */ jsx(Tooltip.Trigger, { asChild: true, children }),
|
|
1621
|
+
/* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(TooltipContent, { ref: forwardedRef, sideOffset: 8, ...restProps, children: /* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", children: label || description }) }) })
|
|
1622
|
+
]
|
|
1623
|
+
}
|
|
1624
|
+
);
|
|
1625
|
+
}
|
|
1626
|
+
);
|
|
1627
|
+
const TooltipContent = styled(Tooltip.Content)`
|
|
1628
|
+
background-color: ${(props) => props.theme.colors.neutral900};
|
|
1629
|
+
color: ${(props) => props.theme.colors.neutral0};
|
|
1630
|
+
padding-inline: ${(props) => props.theme.spaces[2]};
|
|
1631
|
+
padding-block: ${(props) => props.theme.spaces[2]};
|
|
1632
|
+
border-radius: ${(props) => props.theme.borderRadius};
|
|
1633
|
+
z-index: ${(props) => props.theme.zIndices.tooltip};
|
|
1634
|
+
will-change: opacity;
|
|
1635
|
+
transform-origin: var(--radix-tooltip-content-transform-origin);
|
|
1636
|
+
|
|
1637
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1638
|
+
animation: ${ANIMATIONS.fadeIn} ${(props) => props.theme.motion.timings["200"]}
|
|
1639
|
+
${(props) => props.theme.motion.easings.authenticMotion};
|
|
1640
|
+
}
|
|
1641
|
+
`;
|
|
1642
|
+
const IconButton = forwardRef(
|
|
1643
|
+
({
|
|
1644
|
+
label,
|
|
1645
|
+
background,
|
|
1646
|
+
children,
|
|
1647
|
+
disabled = false,
|
|
1648
|
+
onClick,
|
|
1649
|
+
size = "S",
|
|
1650
|
+
variant: variant2 = "tertiary",
|
|
1651
|
+
withTooltip = true,
|
|
1652
|
+
...restProps
|
|
1653
|
+
}, ref) => {
|
|
1654
|
+
const handleClick = (e) => {
|
|
1655
|
+
if (!disabled && onClick) {
|
|
1656
|
+
onClick(e);
|
|
1657
|
+
}
|
|
1658
|
+
};
|
|
1659
|
+
const component = /* @__PURE__ */ jsx(
|
|
1660
|
+
IconButtonWrapper,
|
|
1661
|
+
{
|
|
1662
|
+
"aria-disabled": disabled,
|
|
1663
|
+
background: disabled ? "neutral150" : background,
|
|
1664
|
+
tag: "button",
|
|
1665
|
+
display: "inline-flex",
|
|
1666
|
+
justifyContent: "center",
|
|
1667
|
+
hasRadius: true,
|
|
1668
|
+
cursor: "pointer",
|
|
1669
|
+
...restProps,
|
|
1670
|
+
ref,
|
|
1671
|
+
$size: size,
|
|
1672
|
+
onClick: handleClick,
|
|
1673
|
+
$variant: variant2,
|
|
1674
|
+
children: /* @__PURE__ */ jsx(AccessibleIcon, { label, children })
|
|
1675
|
+
}
|
|
1676
|
+
);
|
|
1677
|
+
return withTooltip ? /* @__PURE__ */ jsx(TooltipImpl, { label, children: component }) : component;
|
|
1678
|
+
}
|
|
1679
|
+
);
|
|
1680
|
+
const IconButtonWrapper = styled(Flex)`
|
|
1681
|
+
text-decoration: none;
|
|
1682
|
+
|
|
1683
|
+
${(props) => {
|
|
1684
|
+
switch (props.$size) {
|
|
1685
|
+
case "S": {
|
|
1686
|
+
return css`
|
|
1687
|
+
padding-block: 0.7rem;
|
|
1688
|
+
padding-inline: 0.7rem;
|
|
1689
|
+
`;
|
|
1690
|
+
}
|
|
1691
|
+
case "M": {
|
|
1692
|
+
return css`
|
|
1693
|
+
padding-block: 0.9rem;
|
|
1694
|
+
padding-inline: 0.9rem;
|
|
1695
|
+
`;
|
|
1696
|
+
}
|
|
1697
|
+
case "L": {
|
|
1698
|
+
return css`
|
|
1699
|
+
padding-block: 1.1rem;
|
|
1700
|
+
padding-inline: 1.1rem;
|
|
1701
|
+
`;
|
|
1702
|
+
}
|
|
1703
|
+
}
|
|
1704
|
+
}}
|
|
1705
|
+
${getVariantStyle}
|
|
1706
|
+
${(props) => props.$variant === "tertiary" ? css`
|
|
1707
|
+
color: ${props.theme.colors.neutral600};
|
|
1708
|
+
` : ""}
|
|
1709
|
+
|
|
1710
|
+
&:hover {
|
|
1711
|
+
${getHoverStyle}
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
&:active {
|
|
1715
|
+
${getActiveStyle}
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
&[aria-disabled='true'] {
|
|
1719
|
+
${getDisabledStyle}
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1723
|
+
transition:
|
|
1724
|
+
${(props) => props.theme.transitions.backgroundColor},
|
|
1725
|
+
${(props) => props.theme.transitions.color},
|
|
1726
|
+
border-color ${(props) => props.theme.motion.timings["200"]} ${(props) => props.theme.motion.easings.easeOutQuad};
|
|
1727
|
+
}
|
|
1728
|
+
`;
|
|
1729
|
+
const IconButtonGroup = styled(Flex)`
|
|
1730
|
+
& ${IconButtonWrapper}:first-child {
|
|
1731
|
+
border-radius: ${({ theme }) => `${theme.borderRadius} 0 0 ${theme.borderRadius}`};
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1734
|
+
& ${IconButtonWrapper}:last-child {
|
|
1735
|
+
border-radius: ${({ theme }) => `0 ${theme.borderRadius} ${theme.borderRadius} 0`};
|
|
1736
|
+
}
|
|
1737
|
+
|
|
1738
|
+
& ${IconButtonWrapper} {
|
|
1739
|
+
border-radius: 0;
|
|
1740
|
+
|
|
1741
|
+
& + ${IconButtonWrapper} {
|
|
1742
|
+
border-left: none;
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
`;
|
|
1497
1746
|
const Link = forwardRef(
|
|
1498
1747
|
({ children, href, disabled = false, startIcon, endIcon, isExternal = false, ...props }, ref) => {
|
|
1499
1748
|
return /* @__PURE__ */ jsxs(LinkWrapper$1, { ref, href, disabled, isExternal, ...props, children: [
|
|
@@ -1520,7 +1769,7 @@ const LinkWrapper$1 = styled(BaseLinkImpl)`
|
|
|
1520
1769
|
}
|
|
1521
1770
|
|
|
1522
1771
|
&:hover {
|
|
1523
|
-
span {
|
|
1772
|
+
& > span {
|
|
1524
1773
|
color: ${({ theme }) => theme.colors.primary500};
|
|
1525
1774
|
}
|
|
1526
1775
|
}
|
|
@@ -1533,21 +1782,18 @@ const LinkWrapper$1 = styled(BaseLinkImpl)`
|
|
|
1533
1782
|
`;
|
|
1534
1783
|
const MenuRoot = DropdownMenu.Root;
|
|
1535
1784
|
const MenuTrigger = React.forwardRef(
|
|
1536
|
-
({ size, endIcon = /* @__PURE__ */ jsx(CaretDown, { width: "
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
...props
|
|
1549
|
-
}
|
|
1550
|
-
) });
|
|
1785
|
+
({ label, size, endIcon = /* @__PURE__ */ jsx(CaretDown, { width: "1.2rem", height: "1.2rem", "aria-hidden": true }), tag = Button, icon, ...rest }, ref) => {
|
|
1786
|
+
const props = {
|
|
1787
|
+
...rest,
|
|
1788
|
+
ref,
|
|
1789
|
+
type: "button",
|
|
1790
|
+
variant: "ghost",
|
|
1791
|
+
paddingTop: size === "S" ? 1 : 2,
|
|
1792
|
+
paddingBottom: size === "S" ? 1 : 2,
|
|
1793
|
+
paddingLeft: size === "S" ? 3 : 4,
|
|
1794
|
+
paddingRight: size === "S" ? 3 : 4
|
|
1795
|
+
};
|
|
1796
|
+
return /* @__PURE__ */ jsx(DropdownMenu.Trigger, { asChild: true, children: tag === IconButton ? /* @__PURE__ */ jsx(IconButton, { label, ...props, children: icon }) : /* @__PURE__ */ jsx(Button, { endIcon, ...props }) });
|
|
1551
1797
|
}
|
|
1552
1798
|
);
|
|
1553
1799
|
const MenuContent = React.forwardRef(
|
|
@@ -1558,8 +1804,6 @@ const MenuContent = React.forwardRef(
|
|
|
1558
1804
|
{
|
|
1559
1805
|
ref,
|
|
1560
1806
|
direction: "column",
|
|
1561
|
-
borderStyle: "solid",
|
|
1562
|
-
borderWidth: "1px",
|
|
1563
1807
|
borderColor: "neutral150",
|
|
1564
1808
|
hasRadius: true,
|
|
1565
1809
|
background: "neutral0",
|
|
@@ -1596,7 +1840,7 @@ const getOptionStyle = ({ theme }) => css`
|
|
|
1596
1840
|
border-radius: ${theme.borderRadius};
|
|
1597
1841
|
padding: ${theme.spaces[2]} ${theme.spaces[4]};
|
|
1598
1842
|
|
|
1599
|
-
&[aria-disabled] {
|
|
1843
|
+
&[aria-disabled='true'] {
|
|
1600
1844
|
cursor: not-allowed;
|
|
1601
1845
|
color: ${theme.colors.neutral500};
|
|
1602
1846
|
}
|
|
@@ -1963,49 +2207,6 @@ const KeyboardKeys = {
|
|
|
1963
2207
|
BACKSPACE: "Backspace",
|
|
1964
2208
|
CLEAR: "Clear"
|
|
1965
2209
|
};
|
|
1966
|
-
const TooltipImpl = React.forwardRef(
|
|
1967
|
-
({
|
|
1968
|
-
children,
|
|
1969
|
-
description,
|
|
1970
|
-
label,
|
|
1971
|
-
defaultOpen,
|
|
1972
|
-
open,
|
|
1973
|
-
onOpenChange,
|
|
1974
|
-
delayDuration = 500,
|
|
1975
|
-
disableHoverableContent,
|
|
1976
|
-
...restProps
|
|
1977
|
-
}, forwardedRef) => {
|
|
1978
|
-
return /* @__PURE__ */ jsxs(
|
|
1979
|
-
Tooltip.Root,
|
|
1980
|
-
{
|
|
1981
|
-
defaultOpen,
|
|
1982
|
-
open,
|
|
1983
|
-
onOpenChange,
|
|
1984
|
-
delayDuration,
|
|
1985
|
-
disableHoverableContent,
|
|
1986
|
-
children: [
|
|
1987
|
-
/* @__PURE__ */ jsx(Tooltip.Trigger, { asChild: true, children }),
|
|
1988
|
-
/* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(TooltipContent, { ref: forwardedRef, sideOffset: 8, ...restProps, children: /* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", children: label || description }) }) })
|
|
1989
|
-
]
|
|
1990
|
-
}
|
|
1991
|
-
);
|
|
1992
|
-
}
|
|
1993
|
-
);
|
|
1994
|
-
const TooltipContent = styled(Tooltip.Content)`
|
|
1995
|
-
background-color: ${(props) => props.theme.colors.neutral900};
|
|
1996
|
-
color: ${(props) => props.theme.colors.neutral0};
|
|
1997
|
-
padding-inline: ${(props) => props.theme.spaces[2]};
|
|
1998
|
-
padding-block: ${(props) => props.theme.spaces[2]};
|
|
1999
|
-
border-radius: ${(props) => props.theme.borderRadius};
|
|
2000
|
-
z-index: ${(props) => props.theme.zIndices.tooltip};
|
|
2001
|
-
will-change: opacity;
|
|
2002
|
-
transform-origin: var(--radix-tooltip-content-transform-origin);
|
|
2003
|
-
|
|
2004
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
2005
|
-
animation: ${ANIMATIONS.fadeIn} ${(props) => props.theme.motion.timings["200"]}
|
|
2006
|
-
${(props) => props.theme.motion.easings.authenticMotion};
|
|
2007
|
-
}
|
|
2008
|
-
`;
|
|
2009
2210
|
const CarouselGrid = styled(Box)`
|
|
2010
2211
|
grid-template-columns: auto 1fr auto;
|
|
2011
2212
|
grid-template-areas: 'startAction slides endAction';
|
|
@@ -2100,9 +2301,11 @@ const commonTheme = {
|
|
|
2100
2301
|
},
|
|
2101
2302
|
spaces: ["0px", "4px", "8px", "12px", "16px", "20px", "24px", "32px", "40px", "48px", "56px", "64px"],
|
|
2102
2303
|
borderRadius: "4px",
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2304
|
+
breakpoints: {
|
|
2305
|
+
initial: "@media(min-width: 0px)",
|
|
2306
|
+
small: "@media(min-width: 520px)",
|
|
2307
|
+
medium: "@media(min-width: 768px)",
|
|
2308
|
+
large: "@media(min-width: 1280px)"
|
|
2106
2309
|
},
|
|
2107
2310
|
fontSizes: [`1.1rem`, `1.2rem`, `1.4rem`, "1.6rem", `1.8rem`, `3.2rem`],
|
|
2108
2311
|
lineHeights: [1.14, 1.22, 1.25, 1.33, 1.43, 1.45, 1.5],
|
|
@@ -7817,6 +8020,7 @@ const Label = React.forwardRef(({ children, action, ...props }, ref) => {
|
|
|
7817
8020
|
id: `${id}-label`,
|
|
7818
8021
|
htmlFor: id,
|
|
7819
8022
|
tag: "label",
|
|
8023
|
+
ellipsis: true,
|
|
7820
8024
|
children: [
|
|
7821
8025
|
children,
|
|
7822
8026
|
required && /* @__PURE__ */ jsx(Typography, { "aria-hidden": true, lineHeight: "1em", textColor: "danger600", children: "*" }),
|
|
@@ -7849,11 +8053,24 @@ const Input$2 = React.forwardRef(
|
|
|
7849
8053
|
ariaDescription = `${id}-hint`;
|
|
7850
8054
|
}
|
|
7851
8055
|
const hasError = Boolean(error);
|
|
8056
|
+
const endActionRef = React.useRef(null);
|
|
8057
|
+
const inputElementRef = React.useRef(null);
|
|
8058
|
+
const inputRef = useComposedRefs(inputElementRef, ref);
|
|
7852
8059
|
const handleChange = (e) => {
|
|
7853
8060
|
if (!disabled && onChange) {
|
|
7854
8061
|
onChange(e);
|
|
7855
8062
|
}
|
|
7856
8063
|
};
|
|
8064
|
+
React.useLayoutEffect(() => {
|
|
8065
|
+
if (endActionRef.current && inputElementRef.current) {
|
|
8066
|
+
const endActionWidth = endActionRef.current.offsetWidth;
|
|
8067
|
+
const inputElement = inputElementRef.current;
|
|
8068
|
+
if (inputElement) {
|
|
8069
|
+
const inputPadding = endActionWidth + 8 + 16;
|
|
8070
|
+
inputElement.style.paddingRight = `${inputPadding}px`;
|
|
8071
|
+
}
|
|
8072
|
+
}
|
|
8073
|
+
}, [endAction]);
|
|
7857
8074
|
return /* @__PURE__ */ jsxs(
|
|
7858
8075
|
InputWrapper,
|
|
7859
8076
|
{
|
|
@@ -7872,7 +8089,7 @@ const Input$2 = React.forwardRef(
|
|
|
7872
8089
|
{
|
|
7873
8090
|
id,
|
|
7874
8091
|
name,
|
|
7875
|
-
ref,
|
|
8092
|
+
ref: inputRef,
|
|
7876
8093
|
$size: size,
|
|
7877
8094
|
"aria-describedby": ariaDescription,
|
|
7878
8095
|
"aria-invalid": hasError || hasErrorProp,
|
|
@@ -7881,10 +8098,12 @@ const Input$2 = React.forwardRef(
|
|
|
7881
8098
|
"data-disabled": disabled ? "" : void 0,
|
|
7882
8099
|
onChange: handleChange,
|
|
7883
8100
|
"aria-required": required || requiredProp,
|
|
8101
|
+
$hasLeftAction: Boolean(startAction),
|
|
8102
|
+
$hasRightAction: Boolean(endAction),
|
|
7884
8103
|
...props
|
|
7885
8104
|
}
|
|
7886
8105
|
),
|
|
7887
|
-
endAction
|
|
8106
|
+
endAction && /* @__PURE__ */ jsx(EndAction, { ref: endActionRef, children: endAction })
|
|
7888
8107
|
]
|
|
7889
8108
|
}
|
|
7890
8109
|
);
|
|
@@ -7903,19 +8122,6 @@ const InputElement = styled.input`
|
|
|
7903
8122
|
width: 100%;
|
|
7904
8123
|
background: inherit;
|
|
7905
8124
|
|
|
7906
|
-
${(props) => {
|
|
7907
|
-
switch (props.$size) {
|
|
7908
|
-
case "S":
|
|
7909
|
-
return css`
|
|
7910
|
-
padding-block: ${props.theme.spaces[1]};
|
|
7911
|
-
`;
|
|
7912
|
-
default:
|
|
7913
|
-
return css`
|
|
7914
|
-
padding-block: ${props.theme.spaces[2]};
|
|
7915
|
-
`;
|
|
7916
|
-
}
|
|
7917
|
-
}};
|
|
7918
|
-
|
|
7919
8125
|
::placeholder {
|
|
7920
8126
|
color: ${({ theme }) => theme.colors.neutral500};
|
|
7921
8127
|
opacity: 1;
|
|
@@ -7930,32 +8136,42 @@ const InputElement = styled.input`
|
|
|
7930
8136
|
outline: none;
|
|
7931
8137
|
box-shadow: none;
|
|
7932
8138
|
}
|
|
7933
|
-
`;
|
|
7934
|
-
const InputWrapper = styled(Flex)`
|
|
7935
|
-
border: 1px solid ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral200};
|
|
7936
|
-
border-radius: ${({ theme }) => theme.borderRadius};
|
|
7937
|
-
background: ${({ theme }) => theme.colors.neutral0};
|
|
7938
|
-
${inputFocusStyle()}
|
|
7939
8139
|
|
|
7940
8140
|
${(props) => {
|
|
7941
8141
|
switch (props.$size) {
|
|
7942
8142
|
case "S":
|
|
7943
8143
|
return css`
|
|
7944
|
-
padding-inline-start: ${props.$hasLeftAction ?
|
|
7945
|
-
padding-inline-end: ${props.$hasRightAction ?
|
|
8144
|
+
padding-inline-start: ${props.$hasLeftAction ? 0 : props.theme.spaces[4]};
|
|
8145
|
+
padding-inline-end: ${props.$hasRightAction ? 0 : props.theme.spaces[4]};
|
|
8146
|
+
padding-block: ${props.theme.spaces[1]};
|
|
7946
8147
|
`;
|
|
7947
8148
|
default:
|
|
7948
8149
|
return css`
|
|
7949
|
-
padding-inline-start: ${props.$hasLeftAction ?
|
|
7950
|
-
padding-inline-end: ${props.$hasRightAction ?
|
|
8150
|
+
padding-inline-start: ${props.$hasLeftAction ? 0 : props.theme.spaces[4]};
|
|
8151
|
+
padding-inline-end: ${props.$hasRightAction ? 0 : props.theme.spaces[4]};
|
|
8152
|
+
padding-block: ${props.theme.spaces[2]};
|
|
7951
8153
|
`;
|
|
7952
8154
|
}
|
|
7953
8155
|
}}
|
|
8156
|
+
`;
|
|
8157
|
+
const EndAction = styled(Flex)`
|
|
8158
|
+
position: absolute;
|
|
8159
|
+
right: ${({ theme }) => theme.spaces[4]};
|
|
8160
|
+
top: 50%;
|
|
8161
|
+
transform: translateY(-50%);
|
|
8162
|
+
`;
|
|
8163
|
+
const InputWrapper = styled(Flex)`
|
|
8164
|
+
border: 1px solid ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral200};
|
|
8165
|
+
border-radius: ${({ theme }) => theme.borderRadius};
|
|
8166
|
+
background: ${({ theme }) => theme.colors.neutral0};
|
|
8167
|
+
padding-inline-start: ${({ $hasLeftAction, theme }) => $hasLeftAction ? theme.spaces[4] : 0};
|
|
8168
|
+
position: relative;
|
|
7954
8169
|
|
|
8170
|
+
${inputFocusStyle()}
|
|
7955
8171
|
${({ theme, $disabled }) => $disabled ? css`
|
|
7956
8172
|
color: ${theme.colors.neutral600};
|
|
7957
8173
|
background: ${theme.colors.neutral150};
|
|
7958
|
-
` : void 0}
|
|
8174
|
+
` : void 0};
|
|
7959
8175
|
`;
|
|
7960
8176
|
const Hint = () => {
|
|
7961
8177
|
const { id, hint, error } = useField("Hint");
|
|
@@ -10032,266 +10248,60 @@ const DateTimePicker = React.forwardRef(
|
|
|
10032
10248
|
) })
|
|
10033
10249
|
] });
|
|
10034
10250
|
}
|
|
10035
|
-
);
|
|
10036
|
-
const convertUTCDateToCalendarDateTime = (date, resetTime = true) => {
|
|
10037
|
-
const utcDateString = date.toISOString();
|
|
10038
|
-
let zonedDateTime = parseAbsoluteToLocal(utcDateString);
|
|
10039
|
-
if (resetTime) {
|
|
10040
|
-
zonedDateTime = zonedDateTime.set({ hour: 0, minute: 0 });
|
|
10041
|
-
}
|
|
10042
|
-
return toCalendarDateTime(zonedDateTime);
|
|
10043
|
-
};
|
|
10044
|
-
const Divider = React.forwardRef((props, forwardedRef) => {
|
|
10045
|
-
return /* @__PURE__ */ jsx(
|
|
10046
|
-
DividerImpl,
|
|
10047
|
-
{
|
|
10048
|
-
ref: forwardedRef,
|
|
10049
|
-
background: "neutral150",
|
|
10050
|
-
...props,
|
|
10051
|
-
"data-orientation": "horizontal",
|
|
10052
|
-
role: "separator",
|
|
10053
|
-
tag: "div"
|
|
10054
|
-
}
|
|
10055
|
-
);
|
|
10056
|
-
});
|
|
10057
|
-
const DividerImpl = styled(Box)`
|
|
10058
|
-
height: 1px;
|
|
10059
|
-
border: none;
|
|
10060
|
-
/* If contained in a Flex parent we want to prevent the Divider to shink */
|
|
10061
|
-
flex-shrink: 0;
|
|
10062
|
-
`;
|
|
10063
|
-
const EmptyStateIconWrapper = styled(Box)`
|
|
10064
|
-
svg {
|
|
10065
|
-
height: 8.8rem;
|
|
10066
|
-
}
|
|
10067
|
-
`;
|
|
10068
|
-
const EmptyStateLayout = React.forwardRef(
|
|
10069
|
-
({ icon, content, action, hasRadius = true, shadow = "tableShadow" }, forwardedRef) => {
|
|
10070
|
-
return /* @__PURE__ */ jsxs(
|
|
10071
|
-
Flex,
|
|
10072
|
-
{
|
|
10073
|
-
ref: forwardedRef,
|
|
10074
|
-
alignItems: "center",
|
|
10075
|
-
direction: "column",
|
|
10076
|
-
padding: 11,
|
|
10077
|
-
background: "neutral0",
|
|
10078
|
-
hasRadius,
|
|
10079
|
-
shadow,
|
|
10080
|
-
children: [
|
|
10081
|
-
icon ? /* @__PURE__ */ jsx(EmptyStateIconWrapper, { paddingBottom: 6, "aria-hidden": true, children: icon }) : null,
|
|
10082
|
-
/* @__PURE__ */ jsx(Box, { paddingBottom: 4, children: /* @__PURE__ */ jsx(Typography, { variant: "delta", tag: "p", textAlign: "center", textColor: "neutral600", children: content }) }),
|
|
10083
|
-
action
|
|
10084
|
-
]
|
|
10085
|
-
}
|
|
10086
|
-
);
|
|
10087
|
-
}
|
|
10088
|
-
);
|
|
10089
|
-
const getFocusableNodes = (node, includeNegativeTabIndex) => {
|
|
10090
|
-
const nodes = [
|
|
10091
|
-
...node.querySelectorAll(
|
|
10092
|
-
'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
|
|
10093
|
-
)
|
|
10094
|
-
];
|
|
10095
|
-
const focusables = nodes.filter((node2) => {
|
|
10096
|
-
if (node2.hasAttribute("disabled"))
|
|
10097
|
-
return false;
|
|
10098
|
-
if (includeNegativeTabIndex)
|
|
10099
|
-
return true;
|
|
10100
|
-
return node2.getAttribute("tabindex") !== "-1";
|
|
10101
|
-
});
|
|
10102
|
-
return focusables;
|
|
10103
|
-
};
|
|
10104
|
-
const getFocusableNodesWithKeyboardNav = (nodes) => {
|
|
10105
|
-
return nodes.filter((node) => {
|
|
10106
|
-
if (node.tagName === "INPUT") {
|
|
10107
|
-
return node.type !== "checkbox" && node.type !== "radio";
|
|
10108
|
-
}
|
|
10109
|
-
return false;
|
|
10110
|
-
});
|
|
10111
|
-
};
|
|
10112
|
-
const FocusTrap = ({ onEscape, restoreFocus = true, skipAutoFocus = false, ...props }) => {
|
|
10113
|
-
const trappedRef = React.useRef(null);
|
|
10114
|
-
React.useEffect(() => {
|
|
10115
|
-
let currentFocus = null;
|
|
10116
|
-
if (restoreFocus) {
|
|
10117
|
-
currentFocus = document.activeElement;
|
|
10118
|
-
}
|
|
10119
|
-
return () => {
|
|
10120
|
-
if (currentFocus) {
|
|
10121
|
-
currentFocus.focus();
|
|
10122
|
-
}
|
|
10123
|
-
};
|
|
10124
|
-
}, [restoreFocus]);
|
|
10125
|
-
React.useEffect(() => {
|
|
10126
|
-
if (!trappedRef.current || skipAutoFocus)
|
|
10127
|
-
return;
|
|
10128
|
-
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
10129
|
-
if (focusableChildren.length > 0) {
|
|
10130
|
-
const firstElement = focusableChildren[0];
|
|
10131
|
-
firstElement.focus();
|
|
10132
|
-
} else {
|
|
10133
|
-
console.warn(
|
|
10134
|
-
"[FocusTrap]: it seems there are no focusable elements in the focus trap tree. Make sure there s at least one."
|
|
10135
|
-
);
|
|
10136
|
-
}
|
|
10137
|
-
}, [skipAutoFocus]);
|
|
10138
|
-
const handleKeyDown = (e) => {
|
|
10139
|
-
if (e.key === KeyboardKeys.ESCAPE && onEscape) {
|
|
10140
|
-
onEscape();
|
|
10141
|
-
return;
|
|
10142
|
-
}
|
|
10143
|
-
if (e.key !== KeyboardKeys.TAB)
|
|
10144
|
-
return;
|
|
10145
|
-
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
10146
|
-
if (focusableChildren.length > 0) {
|
|
10147
|
-
const firstElement = focusableChildren[0];
|
|
10148
|
-
const lastElement = focusableChildren[focusableChildren.length - 1];
|
|
10149
|
-
if (e.shiftKey) {
|
|
10150
|
-
if (firstElement === document.activeElement) {
|
|
10151
|
-
e.preventDefault();
|
|
10152
|
-
lastElement.focus();
|
|
10153
|
-
}
|
|
10154
|
-
} else if (lastElement === document.activeElement) {
|
|
10155
|
-
e.preventDefault();
|
|
10156
|
-
firstElement.focus();
|
|
10157
|
-
}
|
|
10158
|
-
}
|
|
10159
|
-
};
|
|
10160
|
-
return /* @__PURE__ */ jsx("div", { ref: trappedRef, onKeyDown: handleKeyDown, ...props });
|
|
10251
|
+
);
|
|
10252
|
+
const convertUTCDateToCalendarDateTime = (date, resetTime = true) => {
|
|
10253
|
+
const utcDateString = date.toISOString();
|
|
10254
|
+
let zonedDateTime = parseAbsoluteToLocal(utcDateString);
|
|
10255
|
+
if (resetTime) {
|
|
10256
|
+
zonedDateTime = zonedDateTime.set({ hour: 0, minute: 0 });
|
|
10257
|
+
}
|
|
10258
|
+
return toCalendarDateTime(zonedDateTime);
|
|
10161
10259
|
};
|
|
10162
|
-
const
|
|
10163
|
-
|
|
10164
|
-
|
|
10260
|
+
const Divider = React.forwardRef((props, forwardedRef) => {
|
|
10261
|
+
return /* @__PURE__ */ jsx(
|
|
10262
|
+
DividerImpl,
|
|
10263
|
+
{
|
|
10264
|
+
ref: forwardedRef,
|
|
10265
|
+
background: "neutral150",
|
|
10266
|
+
...props,
|
|
10267
|
+
"data-orientation": "horizontal",
|
|
10268
|
+
role: "separator",
|
|
10269
|
+
tag: "div"
|
|
10270
|
+
}
|
|
10271
|
+
);
|
|
10165
10272
|
});
|
|
10166
|
-
const
|
|
10167
|
-
|
|
10168
|
-
|
|
10169
|
-
|
|
10273
|
+
const DividerImpl = styled(Box)`
|
|
10274
|
+
height: 1px;
|
|
10275
|
+
border: none;
|
|
10276
|
+
/* If contained in a Flex parent we want to prevent the Divider to shink */
|
|
10277
|
+
flex-shrink: 0;
|
|
10170
10278
|
`;
|
|
10171
|
-
const
|
|
10172
|
-
|
|
10173
|
-
|
|
10174
|
-
const Item$1 = styled(Flex)`
|
|
10175
|
-
grid-column: span ${({ $col }) => $col ?? 1};
|
|
10176
|
-
max-width: 100%;
|
|
10177
|
-
|
|
10178
|
-
${({ theme }) => theme.mediaQueries.tablet} {
|
|
10179
|
-
grid-column: span ${({ $s }) => $s};
|
|
10180
|
-
}
|
|
10181
|
-
|
|
10182
|
-
${({ theme }) => theme.mediaQueries.mobile} {
|
|
10183
|
-
grid-column: span ${({ $xs }) => $xs};
|
|
10279
|
+
const EmptyStateIconWrapper = styled(Box)`
|
|
10280
|
+
svg {
|
|
10281
|
+
height: 8.8rem;
|
|
10184
10282
|
}
|
|
10185
10283
|
`;
|
|
10186
|
-
const
|
|
10187
|
-
|
|
10188
|
-
|
|
10189
|
-
|
|
10190
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
10191
|
-
const IconButton = forwardRef(
|
|
10192
|
-
({
|
|
10193
|
-
label,
|
|
10194
|
-
background,
|
|
10195
|
-
children,
|
|
10196
|
-
disabled = false,
|
|
10197
|
-
onClick,
|
|
10198
|
-
size = "M",
|
|
10199
|
-
variant: variant2 = "tertiary",
|
|
10200
|
-
withTooltip = true,
|
|
10201
|
-
...restProps
|
|
10202
|
-
}, ref) => {
|
|
10203
|
-
const handleClick = (e) => {
|
|
10204
|
-
if (!disabled && onClick) {
|
|
10205
|
-
onClick(e);
|
|
10206
|
-
}
|
|
10207
|
-
};
|
|
10208
|
-
const component = /* @__PURE__ */ jsx(
|
|
10209
|
-
IconButtonWrapper,
|
|
10284
|
+
const EmptyStateLayout = React.forwardRef(
|
|
10285
|
+
({ icon, content, action, hasRadius = true, shadow = "tableShadow" }, forwardedRef) => {
|
|
10286
|
+
return /* @__PURE__ */ jsxs(
|
|
10287
|
+
Flex,
|
|
10210
10288
|
{
|
|
10211
|
-
|
|
10212
|
-
|
|
10213
|
-
|
|
10214
|
-
|
|
10215
|
-
|
|
10216
|
-
hasRadius
|
|
10217
|
-
|
|
10218
|
-
|
|
10219
|
-
|
|
10220
|
-
|
|
10221
|
-
|
|
10222
|
-
|
|
10223
|
-
children: /* @__PURE__ */ jsx(AccessibleIcon, { label, children })
|
|
10289
|
+
ref: forwardedRef,
|
|
10290
|
+
alignItems: "center",
|
|
10291
|
+
direction: "column",
|
|
10292
|
+
padding: 11,
|
|
10293
|
+
background: "neutral0",
|
|
10294
|
+
hasRadius,
|
|
10295
|
+
shadow,
|
|
10296
|
+
children: [
|
|
10297
|
+
icon ? /* @__PURE__ */ jsx(EmptyStateIconWrapper, { paddingBottom: 6, "aria-hidden": true, children: icon }) : null,
|
|
10298
|
+
/* @__PURE__ */ jsx(Box, { paddingBottom: 4, children: /* @__PURE__ */ jsx(Typography, { variant: "delta", tag: "p", textAlign: "center", textColor: "neutral600", children: content }) }),
|
|
10299
|
+
action
|
|
10300
|
+
]
|
|
10224
10301
|
}
|
|
10225
10302
|
);
|
|
10226
|
-
return withTooltip ? /* @__PURE__ */ jsx(TooltipImpl, { label, children: component }) : component;
|
|
10227
10303
|
}
|
|
10228
10304
|
);
|
|
10229
|
-
const IconButtonWrapper = styled(Flex)`
|
|
10230
|
-
text-decoration: none;
|
|
10231
|
-
|
|
10232
|
-
${(props) => {
|
|
10233
|
-
switch (props.$size) {
|
|
10234
|
-
case "S": {
|
|
10235
|
-
return css`
|
|
10236
|
-
padding-block: 0.6rem;
|
|
10237
|
-
padding-inline: 0.6rem;
|
|
10238
|
-
`;
|
|
10239
|
-
}
|
|
10240
|
-
case "M": {
|
|
10241
|
-
return css`
|
|
10242
|
-
padding-block: 0.9rem;
|
|
10243
|
-
padding-inline: 0.9rem;
|
|
10244
|
-
`;
|
|
10245
|
-
}
|
|
10246
|
-
case "L": {
|
|
10247
|
-
return css`
|
|
10248
|
-
padding-block: 1.1rem;
|
|
10249
|
-
padding-inline: 1.1rem;
|
|
10250
|
-
`;
|
|
10251
|
-
}
|
|
10252
|
-
}
|
|
10253
|
-
}}
|
|
10254
|
-
${getVariantStyle}
|
|
10255
|
-
${(props) => props.$variant === "tertiary" ? css`
|
|
10256
|
-
color: ${props.theme.colors.neutral600};
|
|
10257
|
-
` : ""}
|
|
10258
|
-
|
|
10259
|
-
&:hover {
|
|
10260
|
-
${getHoverStyle}
|
|
10261
|
-
}
|
|
10262
|
-
|
|
10263
|
-
&:active {
|
|
10264
|
-
${getActiveStyle}
|
|
10265
|
-
}
|
|
10266
|
-
|
|
10267
|
-
&[aria-disabled='true'] {
|
|
10268
|
-
${getDisabledStyle}
|
|
10269
|
-
}
|
|
10270
|
-
|
|
10271
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
10272
|
-
transition:
|
|
10273
|
-
${(props) => props.theme.transitions.backgroundColor},
|
|
10274
|
-
${(props) => props.theme.transitions.color},
|
|
10275
|
-
border-color ${(props) => props.theme.motion.timings["200"]} ${(props) => props.theme.motion.easings.easeOutQuad};
|
|
10276
|
-
}
|
|
10277
|
-
`;
|
|
10278
|
-
const IconButtonGroup = styled(Flex)`
|
|
10279
|
-
& ${IconButtonWrapper}:first-child {
|
|
10280
|
-
border-radius: ${({ theme }) => `${theme.borderRadius} 0 0 ${theme.borderRadius}`};
|
|
10281
|
-
}
|
|
10282
|
-
|
|
10283
|
-
& ${IconButtonWrapper}:last-child {
|
|
10284
|
-
border-radius: ${({ theme }) => `0 ${theme.borderRadius} ${theme.borderRadius} 0`};
|
|
10285
|
-
}
|
|
10286
|
-
|
|
10287
|
-
& ${IconButtonWrapper} {
|
|
10288
|
-
border-radius: 0;
|
|
10289
|
-
|
|
10290
|
-
& + ${IconButtonWrapper} {
|
|
10291
|
-
border-left: none;
|
|
10292
|
-
}
|
|
10293
|
-
}
|
|
10294
|
-
`;
|
|
10295
10305
|
const addMarks = StateEffect.define();
|
|
10296
10306
|
const filterMarks = StateEffect.define();
|
|
10297
10307
|
const lineHighlightMark = Decoration.mark({
|
|
@@ -10572,7 +10582,7 @@ const Thumb = styled(ScrollArea.Thumb)`
|
|
|
10572
10582
|
min-height: 44px;
|
|
10573
10583
|
}
|
|
10574
10584
|
`;
|
|
10575
|
-
const Root$
|
|
10585
|
+
const Root$3 = Dialog$1.Root;
|
|
10576
10586
|
const Trigger$2 = React.forwardRef((props, forwardedRef) => {
|
|
10577
10587
|
return /* @__PURE__ */ jsx(Dialog$1.Trigger, { ...props, asChild: true, ref: forwardedRef });
|
|
10578
10588
|
});
|
|
@@ -10592,8 +10602,8 @@ const Overlay = styled(Dialog$1.Overlay)`
|
|
|
10592
10602
|
`;
|
|
10593
10603
|
const ContentImpl = styled(Dialog$1.Content)`
|
|
10594
10604
|
max-width: 83rem;
|
|
10595
|
-
max-height:
|
|
10596
|
-
height:
|
|
10605
|
+
max-height: 90vh;
|
|
10606
|
+
height: auto;
|
|
10597
10607
|
width: 60%;
|
|
10598
10608
|
overflow: hidden;
|
|
10599
10609
|
margin: 0 auto;
|
|
@@ -10695,7 +10705,7 @@ const Modal = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
10695
10705
|
Content: Content$2,
|
|
10696
10706
|
Footer,
|
|
10697
10707
|
Header,
|
|
10698
|
-
Root: Root$
|
|
10708
|
+
Root: Root$3,
|
|
10699
10709
|
Title,
|
|
10700
10710
|
Trigger: Trigger$2
|
|
10701
10711
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -10931,7 +10941,7 @@ const Dots = ({ children, ...props }) => /* @__PURE__ */ jsxs(Box, { ...props, c
|
|
|
10931
10941
|
/* @__PURE__ */ jsx(VisuallyHidden, { children }),
|
|
10932
10942
|
/* @__PURE__ */ jsx(Typography, { "aria-hidden": true, lineHeight: "revert", textColor: "neutral800", variant: "pi", children: "…" })
|
|
10933
10943
|
] });
|
|
10934
|
-
const Root$
|
|
10944
|
+
const Root$2 = Popover$1.Root;
|
|
10935
10945
|
const Trigger$1 = React.forwardRef((props, forwardedRef) => {
|
|
10936
10946
|
return /* @__PURE__ */ jsx(Popover$1.Trigger, { ...props, asChild: true, ref: forwardedRef });
|
|
10937
10947
|
});
|
|
@@ -10943,6 +10953,7 @@ const PopoverContent = styled(Popover$1.Content)`
|
|
|
10943
10953
|
z-index: ${({ theme }) => theme.zIndices.popover};
|
|
10944
10954
|
background-color: ${(props) => props.theme.colors.neutral0};
|
|
10945
10955
|
border: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
10956
|
+
border-radius: ${({ theme }) => theme.borderRadius};
|
|
10946
10957
|
|
|
10947
10958
|
@media (prefers-reduced-motion: no-preference) {
|
|
10948
10959
|
animation-duration: ${(props) => props.theme.motion.timings["200"]};
|
|
@@ -10994,7 +11005,7 @@ const PopoverScrollArea = styled(ScrollAreaImpl$1)`
|
|
|
10994
11005
|
const Popover = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10995
11006
|
__proto__: null,
|
|
10996
11007
|
Content: Content$1,
|
|
10997
|
-
Root: Root$
|
|
11008
|
+
Root: Root$2,
|
|
10998
11009
|
ScrollArea: ScrollAreaImpl,
|
|
10999
11010
|
Trigger: Trigger$1
|
|
11000
11011
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -11034,7 +11045,7 @@ const RadioGroupRoot = styled(RadioGroup.Root)`
|
|
|
11034
11045
|
flex-direction: column;
|
|
11035
11046
|
gap: ${(props) => props.theme.spaces[3]};
|
|
11036
11047
|
`;
|
|
11037
|
-
const Item = React.forwardRef(({ children, id: idProp, ...restProps }, forwardedRef) => {
|
|
11048
|
+
const Item$1 = React.forwardRef(({ children, id: idProp, ...restProps }, forwardedRef) => {
|
|
11038
11049
|
const id = useId(idProp);
|
|
11039
11050
|
return /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
|
11040
11051
|
/* @__PURE__ */ jsx(RadioGroupItem, { id, ref: forwardedRef, ...restProps, children: /* @__PURE__ */ jsx(RadioGroupIndicator, {}) }),
|
|
@@ -11103,7 +11114,7 @@ const RadioGroupIndicator = styled(RadioGroup.Indicator)`
|
|
|
11103
11114
|
const Radio = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11104
11115
|
__proto__: null,
|
|
11105
11116
|
Group,
|
|
11106
|
-
Item
|
|
11117
|
+
Item: Item$1
|
|
11107
11118
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
11108
11119
|
const focusFocusable = (node) => {
|
|
11109
11120
|
const nextNode = node.querySelector('[tabindex="0"]');
|
|
@@ -11202,6 +11213,29 @@ const RawTable = React.forwardRef(
|
|
|
11202
11213
|
) });
|
|
11203
11214
|
}
|
|
11204
11215
|
);
|
|
11216
|
+
const getFocusableNodes = (node, includeNegativeTabIndex) => {
|
|
11217
|
+
const nodes = [
|
|
11218
|
+
...node.querySelectorAll(
|
|
11219
|
+
'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
|
|
11220
|
+
)
|
|
11221
|
+
];
|
|
11222
|
+
const focusables = nodes.filter((node2) => {
|
|
11223
|
+
if (node2.hasAttribute("disabled"))
|
|
11224
|
+
return false;
|
|
11225
|
+
if (includeNegativeTabIndex)
|
|
11226
|
+
return true;
|
|
11227
|
+
return node2.getAttribute("tabindex") !== "-1";
|
|
11228
|
+
});
|
|
11229
|
+
return focusables;
|
|
11230
|
+
};
|
|
11231
|
+
const getFocusableNodesWithKeyboardNav = (nodes) => {
|
|
11232
|
+
return nodes.filter((node) => {
|
|
11233
|
+
if (node.tagName === "INPUT") {
|
|
11234
|
+
return node.type !== "checkbox" && node.type !== "radio";
|
|
11235
|
+
}
|
|
11236
|
+
return false;
|
|
11237
|
+
});
|
|
11238
|
+
};
|
|
11205
11239
|
const RawTd = React.forwardRef(
|
|
11206
11240
|
({ coords = { col: 0, row: 0 }, tag = "td", ...props }, forwardedRef) => {
|
|
11207
11241
|
const tdRef = React.useRef(null);
|
|
@@ -11651,7 +11685,8 @@ const SubNavHeader = ({
|
|
|
11651
11685
|
},
|
|
11652
11686
|
onSubmit = () => {
|
|
11653
11687
|
},
|
|
11654
|
-
id
|
|
11688
|
+
id,
|
|
11689
|
+
placeholder
|
|
11655
11690
|
}) => {
|
|
11656
11691
|
const [isSearchOpen, setSearchOpen] = React.useState(false);
|
|
11657
11692
|
const previousSearchOpenValue = usePrev(isSearchOpen);
|
|
@@ -11691,7 +11726,7 @@ const SubNavHeader = ({
|
|
|
11691
11726
|
name: "searchbar",
|
|
11692
11727
|
value,
|
|
11693
11728
|
onChange,
|
|
11694
|
-
placeholder
|
|
11729
|
+
placeholder,
|
|
11695
11730
|
onKeyDown: handleKeyDown,
|
|
11696
11731
|
ref: searchRef,
|
|
11697
11732
|
onBlur: handleBlur,
|
|
@@ -11980,7 +12015,7 @@ const LabelTypography = styled(Typography)`
|
|
|
11980
12015
|
}
|
|
11981
12016
|
`;
|
|
11982
12017
|
const [TabsProvider, useTabs] = createContext("Tabs");
|
|
11983
|
-
const Root = React.forwardRef(
|
|
12018
|
+
const Root$1 = React.forwardRef(
|
|
11984
12019
|
({ disabled = false, variant: variant2 = "regular", hasError, ...props }, forwardedRef) => {
|
|
11985
12020
|
return /* @__PURE__ */ jsx(TabsProvider, { disabled, hasError, variant: variant2, children: /* @__PURE__ */ jsx(TabsRoot, { ref: forwardedRef, ...props }) });
|
|
11986
12021
|
}
|
|
@@ -12106,7 +12141,7 @@ const Tabs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
|
|
|
12106
12141
|
__proto__: null,
|
|
12107
12142
|
Content,
|
|
12108
12143
|
List,
|
|
12109
|
-
Root,
|
|
12144
|
+
Root: Root$1,
|
|
12110
12145
|
Trigger
|
|
12111
12146
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
12112
12147
|
const TableContainer = styled(Box)`
|
|
@@ -12328,7 +12363,7 @@ const Textarea = React.forwardRef(
|
|
|
12328
12363
|
} else if (field.hint) {
|
|
12329
12364
|
ariaDescription = `${id}-hint`;
|
|
12330
12365
|
}
|
|
12331
|
-
return /* @__PURE__ */ jsx(Wrapper, { borderColor: hasError ? "danger600" : "neutral200", $hasError: hasError, hasRadius: true, children: /* @__PURE__ */ jsx(
|
|
12366
|
+
return /* @__PURE__ */ jsx(Wrapper$1, { borderColor: hasError ? "danger600" : "neutral200", $hasError: hasError, hasRadius: true, children: /* @__PURE__ */ jsx(
|
|
12332
12367
|
TextareaElement,
|
|
12333
12368
|
{
|
|
12334
12369
|
"aria-invalid": hasError,
|
|
@@ -12352,7 +12387,7 @@ const Textarea = React.forwardRef(
|
|
|
12352
12387
|
) });
|
|
12353
12388
|
}
|
|
12354
12389
|
);
|
|
12355
|
-
const Wrapper = styled(Box)`
|
|
12390
|
+
const Wrapper$1 = styled(Box)`
|
|
12356
12391
|
${inputFocusStyle()}
|
|
12357
12392
|
`;
|
|
12358
12393
|
const TextareaElement = styled(Box)`
|
|
@@ -12497,6 +12532,39 @@ const Input = styled.input`
|
|
|
12497
12532
|
z-index: 0;
|
|
12498
12533
|
width: 100%;
|
|
12499
12534
|
`;
|
|
12535
|
+
const Root = forwardRef((props, forwardedRef) => {
|
|
12536
|
+
const { gap = 0, gridCols = 12, ...rest } = props;
|
|
12537
|
+
return /* @__PURE__ */ jsx(Wrapper, { ref: forwardedRef, $gap: gap, $gridCols: gridCols, ...rest });
|
|
12538
|
+
});
|
|
12539
|
+
const Wrapper = styled(Box)`
|
|
12540
|
+
display: grid;
|
|
12541
|
+
grid-template-columns: repeat(${({ $gridCols }) => $gridCols}, 1fr);
|
|
12542
|
+
${({ theme, $gap }) => handleResponsiveValues({ gap: $gap }, theme)}
|
|
12543
|
+
`;
|
|
12544
|
+
const ItemImpl = forwardRef(
|
|
12545
|
+
({ col, s, xs, ...props }, forwardedRef) => /* @__PURE__ */ jsx(Item, { ref: forwardedRef, $col: col, $s: s, $xs: xs, ...props })
|
|
12546
|
+
);
|
|
12547
|
+
const Item = styled(Flex)`
|
|
12548
|
+
grid-column: span ${({ $xs }) => $xs ?? 12};
|
|
12549
|
+
max-width: 100%;
|
|
12550
|
+
|
|
12551
|
+
${({ theme }) => theme.breakpoints.small} {
|
|
12552
|
+
grid-column: span ${({ $s, $xs }) => $s ?? $xs ?? 12};
|
|
12553
|
+
}
|
|
12554
|
+
|
|
12555
|
+
${({ theme }) => theme.breakpoints.medium} {
|
|
12556
|
+
grid-column: span ${({ $m, $s, $xs }) => $m ?? $s ?? $xs ?? 12};
|
|
12557
|
+
}
|
|
12558
|
+
|
|
12559
|
+
${({ theme }) => theme.breakpoints.large} {
|
|
12560
|
+
grid-column: span ${({ $col, $m, $s, $xs }) => $col ?? $m ?? $s ?? $xs ?? 12};
|
|
12561
|
+
}
|
|
12562
|
+
`;
|
|
12563
|
+
const Grid = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
12564
|
+
__proto__: null,
|
|
12565
|
+
Item: ItemImpl,
|
|
12566
|
+
Root
|
|
12567
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
12500
12568
|
const defaultState = {
|
|
12501
12569
|
x: 0,
|
|
12502
12570
|
y: 0,
|
|
@@ -12529,6 +12597,56 @@ function useMeasure() {
|
|
|
12529
12597
|
}, [element, observer]);
|
|
12530
12598
|
return [ref, rect];
|
|
12531
12599
|
}
|
|
12600
|
+
const FocusTrap = ({ onEscape, restoreFocus = true, skipAutoFocus = false, ...props }) => {
|
|
12601
|
+
const trappedRef = React.useRef(null);
|
|
12602
|
+
React.useEffect(() => {
|
|
12603
|
+
let currentFocus = null;
|
|
12604
|
+
if (restoreFocus) {
|
|
12605
|
+
currentFocus = document.activeElement;
|
|
12606
|
+
}
|
|
12607
|
+
return () => {
|
|
12608
|
+
if (currentFocus) {
|
|
12609
|
+
currentFocus.focus();
|
|
12610
|
+
}
|
|
12611
|
+
};
|
|
12612
|
+
}, [restoreFocus]);
|
|
12613
|
+
React.useEffect(() => {
|
|
12614
|
+
if (!trappedRef.current || skipAutoFocus)
|
|
12615
|
+
return;
|
|
12616
|
+
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
12617
|
+
if (focusableChildren.length > 0) {
|
|
12618
|
+
const firstElement = focusableChildren[0];
|
|
12619
|
+
firstElement.focus();
|
|
12620
|
+
} else {
|
|
12621
|
+
console.warn(
|
|
12622
|
+
"[FocusTrap]: it seems there are no focusable elements in the focus trap tree. Make sure there s at least one."
|
|
12623
|
+
);
|
|
12624
|
+
}
|
|
12625
|
+
}, [skipAutoFocus]);
|
|
12626
|
+
const handleKeyDown = (e) => {
|
|
12627
|
+
if (e.key === KeyboardKeys.ESCAPE && onEscape) {
|
|
12628
|
+
onEscape();
|
|
12629
|
+
return;
|
|
12630
|
+
}
|
|
12631
|
+
if (e.key !== KeyboardKeys.TAB)
|
|
12632
|
+
return;
|
|
12633
|
+
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
12634
|
+
if (focusableChildren.length > 0) {
|
|
12635
|
+
const firstElement = focusableChildren[0];
|
|
12636
|
+
const lastElement = focusableChildren[focusableChildren.length - 1];
|
|
12637
|
+
if (e.shiftKey) {
|
|
12638
|
+
if (firstElement === document.activeElement) {
|
|
12639
|
+
e.preventDefault();
|
|
12640
|
+
lastElement.focus();
|
|
12641
|
+
}
|
|
12642
|
+
} else if (lastElement === document.activeElement) {
|
|
12643
|
+
e.preventDefault();
|
|
12644
|
+
firstElement.focus();
|
|
12645
|
+
}
|
|
12646
|
+
}
|
|
12647
|
+
};
|
|
12648
|
+
return /* @__PURE__ */ jsx("div", { ref: trappedRef, onKeyDown: handleKeyDown, ...props });
|
|
12649
|
+
};
|
|
12532
12650
|
const KeyboardNavigable = ({ tagName, attributeName = "", ...props }) => {
|
|
12533
12651
|
const isValidFocusedElement = () => {
|
|
12534
12652
|
const focused = document.activeElement;
|