@strapi/design-system 2.0.0-beta.6 → 2.0.0-rc.10
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 +3 -3
- package/dist/components/BaseLink/BaseLink.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +3 -5
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/Crumb.d.ts +3 -5
- package/dist/components/Breadcrumbs/Crumb.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/CrumbLink.d.ts +2 -4
- package/dist/components/Breadcrumbs/CrumbLink.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/CrumbSimpleMenu.d.ts +33 -6
- package/dist/components/Breadcrumbs/CrumbSimpleMenu.d.ts.map +1 -1
- package/dist/components/Button/Button.d.ts +3 -2
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/utils.d.ts.map +1 -1
- package/dist/components/Card/Card.d.ts +3 -2
- package/dist/components/Card/Card.d.ts.map +1 -1
- package/dist/components/Card/CardAction.d.ts +3 -2
- 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/CardCheckbox.d.ts +2 -1
- package/dist/components/Card/CardCheckbox.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/Checkbox/Checkbox.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 +3 -3
- 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 +7 -18
- 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/LinkButton/LinkButton.d.ts +4 -10
- package/dist/components/LinkButton/LinkButton.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 +1 -1
- package/dist/components/Popover/Popover.d.ts.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.d.ts +1 -2
- package/dist/components/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/components/RawTable/RawCell.d.ts +2 -2
- package/dist/components/RawTable/RawCell.d.ts.map +1 -1
- package/dist/components/RawTable/RawTable.d.ts +1 -1
- package/dist/components/RawTable/RawTable.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/Searchbar/Searchbar.d.ts.map +1 -1
- package/dist/components/Select/MultiSelect.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/Cell.d.ts +2 -2
- package/dist/components/Table/Cell.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/Table/Table.d.ts +1 -1
- package/dist/components/Table/Table.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Tag/Tag.d.ts +6 -3
- package/dist/components/Tag/Tag.d.ts.map +1 -1
- package/dist/components/TextButton/TextButton.d.ts +9 -4
- 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 -6
- 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 +1129 -1002
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1129 -1002
- 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 +6 -4
- 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/styles/global.d.ts.map +1 -1
- 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 +7 -7
- package/dist/components/BaseButton/BaseButton.d.ts +0 -10
- package/dist/components/BaseButton/BaseButton.d.ts.map +0 -1
- package/dist/components/BaseButton/index.d.ts +0 -2
- package/dist/components/BaseButton/index.d.ts.map +0 -1
- 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.js
CHANGED
|
@@ -80,32 +80,6 @@ const createContext = (rootComponentName, defaultContext) => {
|
|
|
80
80
|
Provider2.displayName = `${rootComponentName}Provider`;
|
|
81
81
|
return [Provider2, useContext];
|
|
82
82
|
};
|
|
83
|
-
const handleResponsiveValues = (property, value, theme) => {
|
|
84
|
-
if (!value) {
|
|
85
|
-
return void 0;
|
|
86
|
-
}
|
|
87
|
-
if (typeof value === "object") {
|
|
88
|
-
const transformedArray = Array.isArray(value) ? value : [value?.desktop, value?.tablet, value?.mobile];
|
|
89
|
-
const spaces = transformedArray.reduce((acc, curr, index) => {
|
|
90
|
-
if (curr) {
|
|
91
|
-
switch (index) {
|
|
92
|
-
case 0:
|
|
93
|
-
return `${acc}${property}: ${theme.spaces[curr]};`;
|
|
94
|
-
case 1:
|
|
95
|
-
return `${acc}${theme.mediaQueries.tablet}{${property}: ${theme.spaces[curr]};}`;
|
|
96
|
-
case 2:
|
|
97
|
-
return `${acc}${theme.mediaQueries.mobile}{${property}: ${theme.spaces[curr]};}`;
|
|
98
|
-
default:
|
|
99
|
-
return acc;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
return acc;
|
|
103
|
-
}, "");
|
|
104
|
-
return spaces;
|
|
105
|
-
}
|
|
106
|
-
const realValue = theme.spaces[value] ?? value;
|
|
107
|
-
return `${property}: ${realValue};`;
|
|
108
|
-
};
|
|
109
83
|
function isKeyOf(o, s) {
|
|
110
84
|
if (typeof o === "string") {
|
|
111
85
|
return false;
|
|
@@ -116,11 +90,166 @@ function isObject(item) {
|
|
|
116
90
|
return item && typeof item === "object" && !Array.isArray(item);
|
|
117
91
|
}
|
|
118
92
|
function extractStyleFromTheme(themeSection, key, defaultValue) {
|
|
119
|
-
if (key && isKeyOf(themeSection, key)) {
|
|
93
|
+
if (themeSection && key && isKeyOf(themeSection, key)) {
|
|
120
94
|
return themeSection[key];
|
|
121
95
|
}
|
|
122
96
|
return defaultValue;
|
|
123
97
|
}
|
|
98
|
+
const mappedCSSProps = {
|
|
99
|
+
padding: ["padding-block-start", "padding-inline-end", "padding-block-end", "padding-inline-start"],
|
|
100
|
+
paddingTop: "padding-block-start",
|
|
101
|
+
paddingRight: "padding-inline-end",
|
|
102
|
+
paddingBottom: "padding-block-end",
|
|
103
|
+
paddingLeft: "padding-inline-start",
|
|
104
|
+
margin: ["margin-block-start", "margin-inline-end", "margin-block-end", "margin-inline-start"],
|
|
105
|
+
marginLeft: "margin-inline-start",
|
|
106
|
+
marginRight: "margin-inline-end",
|
|
107
|
+
marginTop: "margin-block-start",
|
|
108
|
+
marginBottom: "margin-block-end",
|
|
109
|
+
borderRadius: "border-radius",
|
|
110
|
+
borderStyle: "border-style",
|
|
111
|
+
borderWidth: "border-width",
|
|
112
|
+
borderColor: "border-color",
|
|
113
|
+
fontSize: "font-size",
|
|
114
|
+
fontWeight: "font-weight",
|
|
115
|
+
lineHeight: "line-height",
|
|
116
|
+
zIndex: "z-index",
|
|
117
|
+
boxShadow: "box-shadow",
|
|
118
|
+
pointerEvents: "pointer-events",
|
|
119
|
+
textAlign: "text-align",
|
|
120
|
+
textTransform: "text-transform",
|
|
121
|
+
textDecoration: "text-decoration",
|
|
122
|
+
flexGrow: "flex-grow",
|
|
123
|
+
flexShrink: "flex-shrink",
|
|
124
|
+
flexBasis: "flex-basis",
|
|
125
|
+
minWidth: "min-width",
|
|
126
|
+
maxWidth: "max-width",
|
|
127
|
+
minHeight: "min-height",
|
|
128
|
+
maxHeight: "max-height",
|
|
129
|
+
flexDirection: "flex-direction",
|
|
130
|
+
flexWrap: "flex-wrap",
|
|
131
|
+
justifyContent: "justify-content",
|
|
132
|
+
alignItems: "align-items"
|
|
133
|
+
};
|
|
134
|
+
const fillCssValues = (value) => {
|
|
135
|
+
const [top, right, bottom, left] = value;
|
|
136
|
+
const rightValue = right ?? top;
|
|
137
|
+
const bottomValue = bottom ?? top;
|
|
138
|
+
const leftValue = left ?? rightValue;
|
|
139
|
+
return [top, rightValue, bottomValue, leftValue];
|
|
140
|
+
};
|
|
141
|
+
function getThemeSection(key, theme) {
|
|
142
|
+
switch (key) {
|
|
143
|
+
case "gap":
|
|
144
|
+
case "padding":
|
|
145
|
+
case "margin":
|
|
146
|
+
case "paddingTop":
|
|
147
|
+
case "paddingLeft":
|
|
148
|
+
case "paddingRight":
|
|
149
|
+
case "paddingBottom":
|
|
150
|
+
case "marginTop":
|
|
151
|
+
case "marginLeft":
|
|
152
|
+
case "marginRight":
|
|
153
|
+
case "marginBottom":
|
|
154
|
+
case "left":
|
|
155
|
+
case "right":
|
|
156
|
+
case "top":
|
|
157
|
+
case "bottom":
|
|
158
|
+
case "width":
|
|
159
|
+
case "maxWidth":
|
|
160
|
+
case "minWidth":
|
|
161
|
+
case "height":
|
|
162
|
+
case "maxHeight":
|
|
163
|
+
case "minHeight":
|
|
164
|
+
case "borderRadius":
|
|
165
|
+
case "borderWidth":
|
|
166
|
+
return theme.spaces;
|
|
167
|
+
case "color":
|
|
168
|
+
case "background":
|
|
169
|
+
case "borderColor":
|
|
170
|
+
return theme.colors;
|
|
171
|
+
case "fontSize":
|
|
172
|
+
return theme.fontSizes;
|
|
173
|
+
case "fontWeight":
|
|
174
|
+
return theme.fontWeights;
|
|
175
|
+
case "lineHeight":
|
|
176
|
+
return theme.lineHeights;
|
|
177
|
+
case "zIndex":
|
|
178
|
+
return theme.zIndices;
|
|
179
|
+
case "boxShadow":
|
|
180
|
+
return theme.shadows;
|
|
181
|
+
default:
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
const handleResponsiveValues = (values, theme) => {
|
|
186
|
+
const stylesByBreakpoint = Object.entries(values).reduce(
|
|
187
|
+
(acc, curr) => {
|
|
188
|
+
const [key, value] = curr;
|
|
189
|
+
const themeSection = getThemeSection(key, theme);
|
|
190
|
+
const cssProperty = Object.prototype.hasOwnProperty.call(mappedCSSProps, key) ? mappedCSSProps[key] : key;
|
|
191
|
+
if (cssProperty && (value || value === 0)) {
|
|
192
|
+
if (typeof value === "object" && !Array.isArray(value)) {
|
|
193
|
+
Object.entries(value).forEach(([breakpointName, breakpointValue]) => {
|
|
194
|
+
acc[breakpointName] = {
|
|
195
|
+
...acc[breakpointName],
|
|
196
|
+
...convertCssPropertiesToCssValues(cssProperty, breakpointValue, themeSection)
|
|
197
|
+
};
|
|
198
|
+
});
|
|
199
|
+
} else {
|
|
200
|
+
acc.initial = {
|
|
201
|
+
...acc.initial,
|
|
202
|
+
...convertCssPropertiesToCssValues(cssProperty, value, themeSection)
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return acc;
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
initial: {},
|
|
210
|
+
small: {},
|
|
211
|
+
medium: {},
|
|
212
|
+
large: {}
|
|
213
|
+
}
|
|
214
|
+
);
|
|
215
|
+
return Object.entries(stylesByBreakpoint).reduce((acc, [key, value]) => {
|
|
216
|
+
if (value && Object.keys(value).length > 0) {
|
|
217
|
+
const breakpointStyles = Object.entries(value).reduce((arr, [property, value2]) => {
|
|
218
|
+
arr.push(`${property}: ${value2};`);
|
|
219
|
+
return arr;
|
|
220
|
+
}, []).join("\n");
|
|
221
|
+
if (key === "initial") {
|
|
222
|
+
acc.push(breakpointStyles);
|
|
223
|
+
} else {
|
|
224
|
+
acc.push(`${theme.breakpoints[key]}{ ${breakpointStyles} }`);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return acc;
|
|
228
|
+
}, []).join("\n");
|
|
229
|
+
};
|
|
230
|
+
const convertCssPropertiesToCssValues = (property, value, themeSection) => {
|
|
231
|
+
if (Array.isArray(property) && Array.isArray(value)) {
|
|
232
|
+
const shorthandValues = fillCssValues(value);
|
|
233
|
+
return property.reduce((acc, prop, index) => {
|
|
234
|
+
acc[prop] = extractStyleFromTheme(themeSection, shorthandValues[index], shorthandValues[index]);
|
|
235
|
+
return acc;
|
|
236
|
+
}, {});
|
|
237
|
+
} else if (Array.isArray(property) && !Array.isArray(value)) {
|
|
238
|
+
return property.reduce((acc, prop) => {
|
|
239
|
+
acc[prop] = extractStyleFromTheme(themeSection, value, value);
|
|
240
|
+
return acc;
|
|
241
|
+
}, {});
|
|
242
|
+
} else if (!Array.isArray(property) && !Array.isArray(value)) {
|
|
243
|
+
return {
|
|
244
|
+
[property]: extractStyleFromTheme(themeSection, value, value)
|
|
245
|
+
};
|
|
246
|
+
} else {
|
|
247
|
+
console.warn(
|
|
248
|
+
"You've passed an array of values to a property that does not support it. Please check the property and value you're passing."
|
|
249
|
+
);
|
|
250
|
+
return {};
|
|
251
|
+
}
|
|
252
|
+
};
|
|
124
253
|
const forwardRef = React__namespace.forwardRef;
|
|
125
254
|
const Box = forwardRef((props, ref) => {
|
|
126
255
|
const {
|
|
@@ -132,8 +261,6 @@ const Box = forwardRef((props, ref) => {
|
|
|
132
261
|
fontSize,
|
|
133
262
|
grow,
|
|
134
263
|
hasRadius,
|
|
135
|
-
hiddenS,
|
|
136
|
-
hiddenXS,
|
|
137
264
|
padding,
|
|
138
265
|
paddingBottom,
|
|
139
266
|
paddingLeft,
|
|
@@ -147,6 +274,7 @@ const Box = forwardRef((props, ref) => {
|
|
|
147
274
|
shadow,
|
|
148
275
|
shrink,
|
|
149
276
|
lineHeight,
|
|
277
|
+
fontWeight,
|
|
150
278
|
width,
|
|
151
279
|
minWidth,
|
|
152
280
|
maxWidth,
|
|
@@ -184,8 +312,6 @@ const Box = forwardRef((props, ref) => {
|
|
|
184
312
|
$fontSize: fontSize,
|
|
185
313
|
$grow: grow,
|
|
186
314
|
$hasRadius: hasRadius,
|
|
187
|
-
$hiddenS: hiddenS,
|
|
188
|
-
$hiddenXS: hiddenXS,
|
|
189
315
|
$padding: padding,
|
|
190
316
|
$paddingBottom: paddingBottom,
|
|
191
317
|
$paddingLeft: paddingLeft,
|
|
@@ -199,6 +325,7 @@ const Box = forwardRef((props, ref) => {
|
|
|
199
325
|
$shadow: shadow,
|
|
200
326
|
$shrink: shrink,
|
|
201
327
|
$lineHeight: lineHeight,
|
|
328
|
+
$fontWeight: fontWeight,
|
|
202
329
|
$width: width,
|
|
203
330
|
$minWidth: minWidth,
|
|
204
331
|
$maxWidth: maxWidth,
|
|
@@ -227,110 +354,83 @@ const Box = forwardRef((props, ref) => {
|
|
|
227
354
|
return /* @__PURE__ */ jsxRuntime.jsx(StyledBox, { as: AsComponent, ref, ...mappedProps, ...rest });
|
|
228
355
|
});
|
|
229
356
|
const StyledBox = styledComponents.styled.div`
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
357
|
+
${({ theme, ...props }) => {
|
|
358
|
+
return handleResponsiveValues(
|
|
359
|
+
{
|
|
360
|
+
padding: props.$padding,
|
|
361
|
+
paddingTop: props.$paddingTop,
|
|
362
|
+
paddingBottom: props.$paddingBottom,
|
|
363
|
+
paddingLeft: props.$paddingLeft,
|
|
364
|
+
paddingRight: props.$paddingRight,
|
|
365
|
+
margin: props.$margin,
|
|
366
|
+
marginTop: props.$marginTop,
|
|
367
|
+
marginBottom: props.$marginBottom,
|
|
368
|
+
marginLeft: props.$marginLeft,
|
|
369
|
+
marginRight: props.$marginRight,
|
|
370
|
+
top: props.$top,
|
|
371
|
+
left: props.$left,
|
|
372
|
+
bottom: props.$bottom,
|
|
373
|
+
right: props.$right,
|
|
374
|
+
width: props.$width,
|
|
375
|
+
minWidth: props.$minWidth,
|
|
376
|
+
maxWidth: props.$maxWidth,
|
|
377
|
+
height: props.$height,
|
|
378
|
+
minHeight: props.$minHeight,
|
|
379
|
+
maxHeight: props.$maxHeight,
|
|
380
|
+
color: props.$color,
|
|
381
|
+
background: props.$background,
|
|
382
|
+
fontSize: props.$fontSize,
|
|
383
|
+
fontWeight: props.$fontWeight,
|
|
384
|
+
lineHeight: props.$lineHeight,
|
|
385
|
+
borderRadius: props.$hasRadius ? theme.borderRadius : props.$borderRadius,
|
|
386
|
+
borderStyle: props.$borderColor && !props.$borderStyle ? "solid" : props.$borderStyle,
|
|
387
|
+
borderWidth: props.$borderColor && !props.$borderWidth ? "1px" : props.$borderWidth,
|
|
388
|
+
borderColor: props.$borderColor,
|
|
389
|
+
zIndex: props.$zIndex,
|
|
390
|
+
boxShadow: props.$shadow,
|
|
391
|
+
display: props.$display,
|
|
392
|
+
pointerEvents: props.$pointerEvents,
|
|
393
|
+
cursor: props.$cursor,
|
|
394
|
+
textAlign: props.$textAlign,
|
|
395
|
+
textTransform: props.$textTransform,
|
|
396
|
+
transition: props.$transition,
|
|
397
|
+
transform: props.$transform,
|
|
398
|
+
animation: props.$animation,
|
|
399
|
+
position: props.$position,
|
|
400
|
+
overflow: props.$overflow,
|
|
401
|
+
flex: props.$flex,
|
|
402
|
+
flexShrink: props.$shrink,
|
|
403
|
+
flexGrow: props.$grow,
|
|
404
|
+
flexBasis: props.$basis
|
|
405
|
+
},
|
|
406
|
+
theme
|
|
407
|
+
);
|
|
267
408
|
}};
|
|
268
|
-
|
|
269
|
-
// Shadows
|
|
270
|
-
box-shadow: ${({ theme, $shadow }) => extractStyleFromTheme(theme.shadows, $shadow, void 0)};
|
|
271
|
-
|
|
272
|
-
// Handlers
|
|
273
|
-
pointer-events: ${({ $pointerEvents }) => $pointerEvents};
|
|
274
|
-
|
|
275
|
-
// Display
|
|
276
|
-
display: ${({ $display }) => $display};
|
|
277
|
-
|
|
278
|
-
// Position
|
|
279
|
-
position: ${({ $position }) => $position};
|
|
280
|
-
left: ${({ $left, theme }) => extractStyleFromTheme(theme.spaces, $left, $left)};
|
|
281
|
-
right: ${({ $right, theme }) => extractStyleFromTheme(theme.spaces, $right, $right)};
|
|
282
|
-
top: ${({ $top, theme }) => extractStyleFromTheme(theme.spaces, $top, $top)};
|
|
283
|
-
bottom: ${({ $bottom, theme }) => extractStyleFromTheme(theme.spaces, $bottom, $bottom)};
|
|
284
|
-
z-index: ${({ $zIndex, theme }) => extractStyleFromTheme(theme.zIndices, $zIndex, $zIndex)};
|
|
285
|
-
overflow: ${({ $overflow }) => $overflow};
|
|
286
|
-
|
|
287
|
-
// Size
|
|
288
|
-
width: ${({ $width, theme }) => extractStyleFromTheme(theme.spaces, $width, $width)};
|
|
289
|
-
max-width: ${({ $maxWidth, theme }) => extractStyleFromTheme(theme.spaces, $maxWidth, $maxWidth)};
|
|
290
|
-
min-width: ${({ $minWidth, theme }) => extractStyleFromTheme(theme.spaces, $minWidth, $minWidth)};
|
|
291
|
-
height: ${({ $height, theme }) => extractStyleFromTheme(theme.spaces, $height, $height)};
|
|
292
|
-
max-height: ${({ $maxHeight, theme }) => extractStyleFromTheme(theme.spaces, $maxHeight, $maxHeight)};
|
|
293
|
-
min-height: ${({ $minHeight, theme }) => extractStyleFromTheme(theme.spaces, $minHeight, $minHeight)};
|
|
294
|
-
|
|
295
|
-
// Animation
|
|
296
|
-
transition: ${({ $transition }) => $transition};
|
|
297
|
-
transform: ${({ $transform }) => $transform};
|
|
298
|
-
animation: ${({ $animation }) => $animation};
|
|
299
|
-
|
|
300
|
-
//Flexbox children props
|
|
301
|
-
flex-shrink: ${({ $shrink }) => $shrink};
|
|
302
|
-
flex-grow: ${({ $grow }) => $grow};
|
|
303
|
-
flex-basis: ${({ $basis }) => $basis};
|
|
304
|
-
flex: ${({ $flex }) => $flex};
|
|
305
|
-
|
|
306
|
-
// Text
|
|
307
|
-
text-align: ${({ $textAlign }) => $textAlign};
|
|
308
|
-
text-transform: ${({ $textTransform }) => $textTransform};
|
|
309
|
-
line-height: ${({ theme, $lineHeight }) => extractStyleFromTheme(theme.lineHeights, $lineHeight, $lineHeight)};
|
|
310
|
-
|
|
311
|
-
// Cursor
|
|
312
|
-
cursor: ${({ $cursor }) => $cursor};
|
|
313
409
|
`;
|
|
314
410
|
const Flex = forwardRef((props, ref) => {
|
|
315
|
-
const { className, alignItems, direction,
|
|
411
|
+
const { className, alignItems, direction, inline, gap, justifyContent, wrap, ...rest } = props;
|
|
316
412
|
const mappedProps = {
|
|
317
413
|
$alignItems: alignItems,
|
|
318
414
|
$direction: direction,
|
|
319
415
|
$gap: gap,
|
|
320
|
-
$inline: inline,
|
|
321
416
|
$justifyContent: justifyContent,
|
|
322
|
-
$wrap: wrap
|
|
417
|
+
$wrap: wrap,
|
|
418
|
+
$inline: inline
|
|
323
419
|
};
|
|
324
420
|
return /* @__PURE__ */ jsxRuntime.jsx(StyledFlex, { className, ref, ...mappedProps, ...rest });
|
|
325
421
|
});
|
|
326
422
|
const StyledFlex = styledComponents.styled(Box)`
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
423
|
+
${({ theme, $display = "flex", $alignItems = "center", $direction = "row", ...props }) => handleResponsiveValues(
|
|
424
|
+
{
|
|
425
|
+
gap: props.$gap,
|
|
426
|
+
alignItems: $alignItems,
|
|
427
|
+
justifyContent: props.$justifyContent,
|
|
428
|
+
flexWrap: props.$wrap,
|
|
429
|
+
flexDirection: $direction,
|
|
430
|
+
display: props.$inline ? "inline-flex" : $display
|
|
431
|
+
},
|
|
432
|
+
theme
|
|
433
|
+
)};
|
|
334
434
|
`;
|
|
335
435
|
const ALPHA = "alpha";
|
|
336
436
|
const BETA = "beta";
|
|
@@ -405,26 +505,24 @@ const Typography = forwardRef(
|
|
|
405
505
|
(props, ref) => {
|
|
406
506
|
const {
|
|
407
507
|
ellipsis: ellipsis2,
|
|
408
|
-
fontSize,
|
|
409
|
-
fontWeight,
|
|
410
|
-
lineHeight,
|
|
411
|
-
textAlign,
|
|
412
508
|
textColor = "currentcolor",
|
|
413
509
|
textDecoration,
|
|
414
510
|
textTransform,
|
|
415
511
|
variant: variant2,
|
|
512
|
+
lineHeight,
|
|
513
|
+
fontWeight,
|
|
514
|
+
fontSize,
|
|
416
515
|
...rest
|
|
417
516
|
} = props;
|
|
418
517
|
const mappedProps = {
|
|
419
518
|
$ellipsis: ellipsis2,
|
|
420
|
-
$fontSize: fontSize,
|
|
421
|
-
$fontWeight: fontWeight,
|
|
422
|
-
$lineHeight: lineHeight,
|
|
423
|
-
$textAlign: textAlign,
|
|
424
519
|
$textColor: textColor,
|
|
425
520
|
$textDecoration: textDecoration,
|
|
426
521
|
$textTransform: textTransform,
|
|
427
|
-
$variant: variant2
|
|
522
|
+
$variant: variant2,
|
|
523
|
+
$lineHeight: lineHeight,
|
|
524
|
+
$fontWeight: fontWeight,
|
|
525
|
+
$fontSize: fontSize
|
|
428
526
|
};
|
|
429
527
|
return /* @__PURE__ */ jsxRuntime.jsx(StyledTypography, { ref, tag: "span", ...mappedProps, ...rest });
|
|
430
528
|
}
|
|
@@ -433,15 +531,19 @@ const StyledTypography = styledComponents.styled(Box)`
|
|
|
433
531
|
${variant}
|
|
434
532
|
${({ $ellipsis }) => $ellipsis ? ellipsis : ""}
|
|
435
533
|
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
534
|
+
${({ theme, ...props }) => {
|
|
535
|
+
return handleResponsiveValues(
|
|
536
|
+
{
|
|
537
|
+
color: props.$textColor,
|
|
538
|
+
textDecoration: props.$textDecoration,
|
|
539
|
+
textTransform: props.$textTransform,
|
|
540
|
+
lineHeight: props.$lineHeight,
|
|
541
|
+
fontWeight: props.$fontWeight,
|
|
542
|
+
fontSize: props.$fontSize
|
|
543
|
+
},
|
|
544
|
+
theme
|
|
545
|
+
);
|
|
546
|
+
}}
|
|
445
547
|
`;
|
|
446
548
|
const [AccordionProvider, useAccordion] = createContext("Accordion");
|
|
447
549
|
const Root$8 = React__namespace.forwardRef(({ children, size = "S", ...props }, forwardedRef) => {
|
|
@@ -469,25 +571,38 @@ const AccordionItem = styledComponents.styled(RadixAccordion__namespace.Item)`
|
|
|
469
571
|
overflow: hidden;
|
|
470
572
|
|
|
471
573
|
&:first-child {
|
|
472
|
-
border-top-left-radius:
|
|
473
|
-
border-top-right-radius:
|
|
574
|
+
border-top-left-radius: 0.3rem;
|
|
575
|
+
border-top-right-radius: 0.3rem;
|
|
474
576
|
}
|
|
475
577
|
|
|
476
578
|
&:last-child {
|
|
477
|
-
border-bottom-left-radius:
|
|
478
|
-
border-bottom-right-radius:
|
|
579
|
+
border-bottom-left-radius: 0.3rem;
|
|
580
|
+
border-bottom-right-radius: 0.3rem;
|
|
479
581
|
}
|
|
480
582
|
|
|
481
583
|
& + & {
|
|
482
584
|
border-top: ${(props) => props.$size === "S" ? `solid 1px ${props.theme.colors.neutral200}` : "unset"};
|
|
483
585
|
}
|
|
484
586
|
|
|
587
|
+
&[data-state='open'] {
|
|
588
|
+
box-shadow: 0 0 0 2px ${(props) => props.theme.colors.primary600};
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
&:hover {
|
|
592
|
+
box-shadow: 0 0 0 2px ${(props) => props.theme.colors.primary600};
|
|
593
|
+
}
|
|
594
|
+
|
|
485
595
|
/* This applies our desired focus effect correctly. */
|
|
486
596
|
&:focus-within {
|
|
487
597
|
position: relative;
|
|
488
598
|
z-index: 1;
|
|
489
599
|
box-shadow: 0 0 0 2px ${(props) => props.theme.colors.primary600};
|
|
490
600
|
}
|
|
601
|
+
|
|
602
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
603
|
+
transition: box-shadow ${(props) => props.theme.motion.timings["120"]}
|
|
604
|
+
${(props) => props.theme.motion.easings.easeOutQuad};
|
|
605
|
+
}
|
|
491
606
|
`;
|
|
492
607
|
const Trigger$7 = React__namespace.forwardRef(
|
|
493
608
|
({ caretPosition = "left", description, icon: Icon, children, ...restProps }, forwardedRef) => {
|
|
@@ -503,10 +618,11 @@ const Trigger$7 = React__namespace.forwardRef(
|
|
|
503
618
|
fontWeight: size === "S" ? "bold" : void 0,
|
|
504
619
|
ellipsis: true,
|
|
505
620
|
variant: size === "M" ? "delta" : void 0,
|
|
621
|
+
textAlign: "left",
|
|
506
622
|
children
|
|
507
623
|
}
|
|
508
624
|
),
|
|
509
|
-
description && size === "M" ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { children: description }) : null
|
|
625
|
+
description && size === "M" ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { textAlign: "left", children: description }) : null
|
|
510
626
|
] })
|
|
511
627
|
] }),
|
|
512
628
|
caretPosition === "right" ? /* @__PURE__ */ jsxRuntime.jsx(TriggerIcon, { $size: size, children: /* @__PURE__ */ jsxRuntime.jsx(icons.CaretDown, { width: size === "S" ? "1.2rem" : "1.6rem", height: size === "S" ? "1.2rem" : "1.6rem" }) }) : null
|
|
@@ -1170,51 +1286,32 @@ const Base = styledComponents.styled(Flex)`
|
|
|
1170
1286
|
`;
|
|
1171
1287
|
}};
|
|
1172
1288
|
`;
|
|
1173
|
-
const
|
|
1174
|
-
({ disabled,
|
|
1175
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1176
|
-
BaseButtonWrapper,
|
|
1177
|
-
{
|
|
1178
|
-
ref,
|
|
1179
|
-
"aria-disabled": disabled,
|
|
1180
|
-
disabled,
|
|
1181
|
-
tag: "button",
|
|
1182
|
-
type: "button",
|
|
1183
|
-
padding: 2,
|
|
1184
|
-
hasRadius: true,
|
|
1185
|
-
background: "neutral0",
|
|
1186
|
-
borderColor: "neutral200",
|
|
1187
|
-
cursor: "pointer",
|
|
1188
|
-
...props,
|
|
1189
|
-
children
|
|
1190
|
-
}
|
|
1191
|
-
);
|
|
1192
|
-
}
|
|
1193
|
-
);
|
|
1194
|
-
const BaseButtonWrapper = styledComponents.styled(Flex)`
|
|
1195
|
-
&[aria-disabled='true'] {
|
|
1196
|
-
pointer-events: none;
|
|
1197
|
-
}
|
|
1198
|
-
|
|
1199
|
-
${focus}
|
|
1200
|
-
`;
|
|
1201
|
-
const BaseLink = forwardRef(
|
|
1202
|
-
({ href, rel = "noreferrer noopener", target = "_self", disabled = false, isExternal = false, ...props }, ref) => {
|
|
1289
|
+
const BaseLinkImpl = forwardRef(
|
|
1290
|
+
({ href, disabled = false, isExternal = false, ...props }, ref) => {
|
|
1203
1291
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1204
|
-
|
|
1292
|
+
BaseLink,
|
|
1205
1293
|
{
|
|
1206
1294
|
tag: "a",
|
|
1207
1295
|
ref,
|
|
1208
|
-
target: isExternal ? "_blank" :
|
|
1209
|
-
rel: isExternal ?
|
|
1210
|
-
href
|
|
1296
|
+
target: isExternal ? "_blank" : void 0,
|
|
1297
|
+
rel: isExternal ? "noreferrer noopener" : void 0,
|
|
1298
|
+
href,
|
|
1299
|
+
tabIndex: disabled ? -1 : void 0,
|
|
1211
1300
|
"aria-disabled": disabled,
|
|
1212
|
-
|
|
1301
|
+
pointerEvents: disabled ? "none" : void 0,
|
|
1302
|
+
cursor: disabled ? void 0 : "pointer",
|
|
1213
1303
|
...props
|
|
1214
1304
|
}
|
|
1215
1305
|
);
|
|
1216
1306
|
}
|
|
1217
1307
|
);
|
|
1308
|
+
const BaseLink = styledComponents.styled(Box)`
|
|
1309
|
+
text-decoration: none;
|
|
1310
|
+
|
|
1311
|
+
&:visited {
|
|
1312
|
+
color: inherit;
|
|
1313
|
+
}
|
|
1314
|
+
`;
|
|
1218
1315
|
const Divider$1 = () => {
|
|
1219
1316
|
return /* @__PURE__ */ jsxRuntime.jsx(Box, { "aria-hidden": true, paddingLeft: 1, paddingRight: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "pi", textColor: "neutral500", children: "/" }) });
|
|
1220
1317
|
};
|
|
@@ -1228,30 +1325,34 @@ const AlignedList = styledComponents.styled(Flex)`
|
|
|
1228
1325
|
margin-left: ${({ theme }) => `calc(-1*${theme.spaces[2]})`};
|
|
1229
1326
|
}
|
|
1230
1327
|
`;
|
|
1231
|
-
const Breadcrumbs = (
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
};
|
|
1241
|
-
Breadcrumbs.displayName = "Breadcrumbs";
|
|
1242
|
-
const Crumb = ({ children, isCurrent = false, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(Box, { paddingLeft: 2, paddingRight: 2, paddingTop: 1, paddingBottom: 1, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1243
|
-
Typography,
|
|
1244
|
-
{
|
|
1245
|
-
variant: "pi",
|
|
1246
|
-
textColor: "neutral800",
|
|
1247
|
-
fontWeight: isCurrent ? "bold" : "regular",
|
|
1248
|
-
"aria-current": isCurrent,
|
|
1249
|
-
...props,
|
|
1250
|
-
children
|
|
1328
|
+
const Breadcrumbs = React__namespace.forwardRef(
|
|
1329
|
+
({ label, children, ...props }, forwardedRef) => {
|
|
1330
|
+
const childrenArray = React__namespace.Children.toArray(children);
|
|
1331
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { "aria-label": label, tag: "nav", ...props, ref: forwardedRef, children: /* @__PURE__ */ jsxRuntime.jsx(AlignedList, { tag: "ol", children: React__namespace.Children.map(childrenArray, (child, index) => {
|
|
1332
|
+
const shouldDisplayDivider = childrenArray.length > 1 && index + 1 < childrenArray.length;
|
|
1333
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Flex, { inline: true, tag: "li", children: [
|
|
1334
|
+
child,
|
|
1335
|
+
shouldDisplayDivider && /* @__PURE__ */ jsxRuntime.jsx(Divider$1, {})
|
|
1336
|
+
] });
|
|
1337
|
+
}) }) });
|
|
1251
1338
|
}
|
|
1252
|
-
)
|
|
1339
|
+
);
|
|
1340
|
+
Breadcrumbs.displayName = "Breadcrumbs";
|
|
1341
|
+
const Crumb = React__namespace.forwardRef(
|
|
1342
|
+
({ children, isCurrent = false, ...props }, forwardedRef) => /* @__PURE__ */ jsxRuntime.jsx(Box, { paddingLeft: 2, paddingRight: 2, paddingTop: 1, paddingBottom: 1, ref: forwardedRef, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1343
|
+
Typography,
|
|
1344
|
+
{
|
|
1345
|
+
variant: "pi",
|
|
1346
|
+
textColor: "neutral800",
|
|
1347
|
+
fontWeight: isCurrent ? "bold" : "regular",
|
|
1348
|
+
"aria-current": isCurrent,
|
|
1349
|
+
...props,
|
|
1350
|
+
children
|
|
1351
|
+
}
|
|
1352
|
+
) })
|
|
1353
|
+
);
|
|
1253
1354
|
Crumb.displayName = "Crumb";
|
|
1254
|
-
const StyledLink = styledComponents.styled(
|
|
1355
|
+
const StyledLink = styledComponents.styled(BaseLinkImpl)`
|
|
1255
1356
|
border-radius: ${({ theme }) => theme.borderRadius};
|
|
1256
1357
|
color: ${({ theme }) => theme.colors.neutral600};
|
|
1257
1358
|
font-size: ${({ theme }) => theme.fontSizes[1]};
|
|
@@ -1265,9 +1366,22 @@ const StyledLink = styledComponents.styled(BaseLink)`
|
|
|
1265
1366
|
color: ${({ theme }) => theme.colors.neutral700};
|
|
1266
1367
|
}
|
|
1267
1368
|
`;
|
|
1268
|
-
const CrumbLink = ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(StyledLink, { ...props, children });
|
|
1369
|
+
const CrumbLink = React__namespace.forwardRef(({ children, ...props }, forwardedRef) => /* @__PURE__ */ jsxRuntime.jsx(StyledLink, { ref: forwardedRef, ...props, children }));
|
|
1269
1370
|
CrumbLink.displayName = "CrumbLink";
|
|
1270
1371
|
const stripReactIdOfColon = (str) => str.replaceAll(":", "");
|
|
1372
|
+
function setRef(ref, value) {
|
|
1373
|
+
if (typeof ref === "function") {
|
|
1374
|
+
ref(value);
|
|
1375
|
+
} else if (ref !== null && ref !== void 0) {
|
|
1376
|
+
ref.current = value;
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
function composeRefs(...refs) {
|
|
1380
|
+
return (node) => refs.forEach((ref) => setRef(ref, node));
|
|
1381
|
+
}
|
|
1382
|
+
function useComposedRefs(...refs) {
|
|
1383
|
+
return React__namespace.useCallback(composeRefs(...refs), refs);
|
|
1384
|
+
}
|
|
1271
1385
|
const isSSR = () => typeof window === "undefined" || !window.navigator || /ServerSideRendering|^Deno\//.test(window.navigator.userAgent);
|
|
1272
1386
|
const useIsomorphicLayoutEffect = isSSR() ? React.useEffect : React.useLayoutEffect;
|
|
1273
1387
|
const useReactId = React__namespace["useId".toString()] || (() => void 0);
|
|
@@ -1317,7 +1431,7 @@ const DANGER = "danger";
|
|
|
1317
1431
|
const SUCCESS = "success";
|
|
1318
1432
|
const GHOST = "ghost";
|
|
1319
1433
|
const LIGHT_VARIANTS = [SUCCESS_LIGHT, DANGER_LIGHT];
|
|
1320
|
-
const VARIANTS
|
|
1434
|
+
const VARIANTS = [DEFAULT, TERTIARY, SECONDARY, DANGER, SUCCESS, GHOST, ...LIGHT_VARIANTS];
|
|
1321
1435
|
const BUTTON_SIZES = ["S", "M", "L"];
|
|
1322
1436
|
const getVariantColorName = (variant2) => {
|
|
1323
1437
|
if (variant2 === SUCCESS_LIGHT || variant2 === DANGER_LIGHT) {
|
|
@@ -1326,7 +1440,7 @@ const getVariantColorName = (variant2) => {
|
|
|
1326
1440
|
if (variant2 === TERTIARY) {
|
|
1327
1441
|
return "neutral";
|
|
1328
1442
|
}
|
|
1329
|
-
if (variant2 === DEFAULT || variant2 === SECONDARY || VARIANTS
|
|
1443
|
+
if (variant2 === DEFAULT || variant2 === SECONDARY || VARIANTS.every((vari) => vari !== variant2)) {
|
|
1330
1444
|
return "primary";
|
|
1331
1445
|
}
|
|
1332
1446
|
return `${variant2}`;
|
|
@@ -1336,6 +1450,7 @@ const getDisabledStyle = ({ theme }) => {
|
|
|
1336
1450
|
border: 1px solid ${theme.colors.neutral200};
|
|
1337
1451
|
background: ${theme.colors.neutral150};
|
|
1338
1452
|
color: ${theme.colors.neutral600};
|
|
1453
|
+
cursor: default;
|
|
1339
1454
|
`;
|
|
1340
1455
|
};
|
|
1341
1456
|
const getHoverStyle = ({ theme, $variant }) => {
|
|
@@ -1373,7 +1488,7 @@ const getActiveStyle = ({ theme, $variant }) => {
|
|
|
1373
1488
|
color: ${theme.colors[`${getVariantColorName($variant)}600`]};
|
|
1374
1489
|
`;
|
|
1375
1490
|
}
|
|
1376
|
-
if ($variant === TERTIARY) {
|
|
1491
|
+
if ($variant === TERTIARY || $variant === GHOST) {
|
|
1377
1492
|
return styledComponents.css`
|
|
1378
1493
|
background-color: ${theme.colors.neutral150};
|
|
1379
1494
|
`;
|
|
@@ -1422,6 +1537,8 @@ const getVariantStyle = ({ theme, $variant }) => {
|
|
|
1422
1537
|
}
|
|
1423
1538
|
default: {
|
|
1424
1539
|
return styledComponents.css`
|
|
1540
|
+
border: 1px solid ${theme.colors.buttonPrimary600};
|
|
1541
|
+
background: ${theme.colors.buttonPrimary600};
|
|
1425
1542
|
color: ${theme.colors.buttonNeutral0};
|
|
1426
1543
|
`;
|
|
1427
1544
|
}
|
|
@@ -1454,21 +1571,22 @@ const Button = forwardRef(
|
|
|
1454
1571
|
disabled: isDisabled,
|
|
1455
1572
|
$size: size,
|
|
1456
1573
|
$variant: variant2,
|
|
1574
|
+
tag: "button",
|
|
1457
1575
|
onClick: handleClick,
|
|
1458
|
-
|
|
1459
|
-
background: "buttonPrimary600",
|
|
1460
|
-
borderColor: "buttonPrimary600",
|
|
1576
|
+
hasRadius: true,
|
|
1461
1577
|
gap: 2,
|
|
1462
|
-
inline:
|
|
1463
|
-
|
|
1578
|
+
inline: true,
|
|
1579
|
+
alignItems: "center",
|
|
1580
|
+
justifyContent: "center",
|
|
1581
|
+
width: fullWidth ? "100%" : void 0,
|
|
1464
1582
|
paddingLeft: 4,
|
|
1465
1583
|
paddingRight: 4,
|
|
1466
|
-
|
|
1584
|
+
cursor: "pointer",
|
|
1467
1585
|
...props,
|
|
1468
1586
|
children: [
|
|
1469
|
-
(startIcon || loading) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1587
|
+
(startIcon || loading) && /* @__PURE__ */ jsxRuntime.jsx(Flex, { tag: "span", "aria-hidden": true, children: loading ? /* @__PURE__ */ jsxRuntime.jsx(LoaderAnimated, {}) : startIcon }),
|
|
1470
1588
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: size === "S" ? "pi" : void 0, fontWeight: "bold", children }),
|
|
1471
|
-
endIcon && /* @__PURE__ */ jsxRuntime.jsx(Flex, { "aria-hidden": true, children: endIcon })
|
|
1589
|
+
endIcon && /* @__PURE__ */ jsxRuntime.jsx(Flex, { tag: "span", "aria-hidden": true, children: endIcon })
|
|
1472
1590
|
]
|
|
1473
1591
|
}
|
|
1474
1592
|
);
|
|
@@ -1486,20 +1604,10 @@ const LoaderAnimated = styledComponents.styled(icons.Loader)`
|
|
|
1486
1604
|
animation: ${rotation$2} 2s infinite linear;
|
|
1487
1605
|
will-change: transform;
|
|
1488
1606
|
`;
|
|
1489
|
-
const ButtonWrapper = styledComponents.styled(
|
|
1607
|
+
const ButtonWrapper = styledComponents.styled(Flex)`
|
|
1490
1608
|
height: ${({ theme, $size }) => theme.sizes.button[$size]};
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
height: 1.2rem;
|
|
1494
|
-
}
|
|
1495
|
-
|
|
1496
|
-
&[aria-disabled='true'] {
|
|
1497
|
-
${getDisabledStyle}
|
|
1498
|
-
|
|
1499
|
-
&:active {
|
|
1500
|
-
${getDisabledStyle}
|
|
1501
|
-
}
|
|
1502
|
-
}
|
|
1609
|
+
text-decoration: none;
|
|
1610
|
+
${getVariantStyle}
|
|
1503
1611
|
|
|
1504
1612
|
&:hover {
|
|
1505
1613
|
${getHoverStyle}
|
|
@@ -1509,7 +1617,9 @@ const ButtonWrapper = styledComponents.styled(BaseButton)`
|
|
|
1509
1617
|
${getActiveStyle}
|
|
1510
1618
|
}
|
|
1511
1619
|
|
|
1512
|
-
|
|
1620
|
+
&[aria-disabled='true'] {
|
|
1621
|
+
${getDisabledStyle}
|
|
1622
|
+
}
|
|
1513
1623
|
|
|
1514
1624
|
@media (prefers-reduced-motion: no-preference) {
|
|
1515
1625
|
transition:
|
|
@@ -1518,76 +1628,220 @@ const ButtonWrapper = styledComponents.styled(BaseButton)`
|
|
|
1518
1628
|
border-color ${(props) => props.theme.motion.timings["200"]} ${(props) => props.theme.motion.easings.easeOutQuad};
|
|
1519
1629
|
}
|
|
1520
1630
|
`;
|
|
1521
|
-
const
|
|
1522
|
-
({
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1631
|
+
const TooltipImpl = React__namespace.forwardRef(
|
|
1632
|
+
({
|
|
1633
|
+
children,
|
|
1634
|
+
description,
|
|
1635
|
+
label,
|
|
1636
|
+
defaultOpen,
|
|
1637
|
+
open,
|
|
1638
|
+
onOpenChange,
|
|
1639
|
+
delayDuration = 500,
|
|
1640
|
+
disableHoverableContent,
|
|
1641
|
+
...restProps
|
|
1642
|
+
}, forwardedRef) => {
|
|
1643
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1644
|
+
Tooltip__namespace.Root,
|
|
1645
|
+
{
|
|
1646
|
+
defaultOpen,
|
|
1647
|
+
open,
|
|
1648
|
+
onOpenChange,
|
|
1649
|
+
delayDuration,
|
|
1650
|
+
disableHoverableContent,
|
|
1651
|
+
children: [
|
|
1652
|
+
/* @__PURE__ */ jsxRuntime.jsx(Tooltip__namespace.Trigger, { asChild: true, children }),
|
|
1653
|
+
/* @__PURE__ */ jsxRuntime.jsx(Tooltip__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { ref: forwardedRef, sideOffset: 8, ...restProps, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "pi", fontWeight: "bold", children: label || description }) }) })
|
|
1654
|
+
]
|
|
1655
|
+
}
|
|
1656
|
+
);
|
|
1529
1657
|
}
|
|
1530
1658
|
);
|
|
1531
|
-
const
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
path {
|
|
1542
|
-
fill: ${({ disabled, theme }) => disabled ? theme.colors.neutral600 : theme.colors.primary600};
|
|
1543
|
-
}
|
|
1544
|
-
}
|
|
1545
|
-
|
|
1546
|
-
&:hover {
|
|
1547
|
-
color: ${({ theme }) => theme.colors.primary500};
|
|
1548
|
-
}
|
|
1659
|
+
const TooltipContent = styledComponents.styled(Tooltip__namespace.Content)`
|
|
1660
|
+
background-color: ${(props) => props.theme.colors.neutral900};
|
|
1661
|
+
color: ${(props) => props.theme.colors.neutral0};
|
|
1662
|
+
padding-inline: ${(props) => props.theme.spaces[2]};
|
|
1663
|
+
padding-block: ${(props) => props.theme.spaces[2]};
|
|
1664
|
+
border-radius: ${(props) => props.theme.borderRadius};
|
|
1665
|
+
z-index: ${(props) => props.theme.zIndices.tooltip};
|
|
1666
|
+
will-change: opacity;
|
|
1667
|
+
transform-origin: var(--radix-tooltip-content-transform-origin);
|
|
1549
1668
|
|
|
1550
|
-
|
|
1551
|
-
|
|
1669
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1670
|
+
animation: ${ANIMATIONS.fadeIn} ${(props) => props.theme.motion.timings["200"]}
|
|
1671
|
+
${(props) => props.theme.motion.easings.authenticMotion};
|
|
1552
1672
|
}
|
|
1553
|
-
|
|
1554
|
-
${focus};
|
|
1555
1673
|
`;
|
|
1556
|
-
const
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1674
|
+
const IconButton = forwardRef(
|
|
1675
|
+
({
|
|
1676
|
+
label,
|
|
1677
|
+
background,
|
|
1678
|
+
children,
|
|
1679
|
+
disabled = false,
|
|
1680
|
+
onClick,
|
|
1681
|
+
size = "S",
|
|
1682
|
+
variant: variant2 = "tertiary",
|
|
1683
|
+
withTooltip = true,
|
|
1684
|
+
...restProps
|
|
1685
|
+
}, ref) => {
|
|
1686
|
+
const handleClick = (e) => {
|
|
1687
|
+
if (!disabled && onClick) {
|
|
1688
|
+
onClick(e);
|
|
1689
|
+
}
|
|
1690
|
+
};
|
|
1691
|
+
const component = /* @__PURE__ */ jsxRuntime.jsx(
|
|
1692
|
+
IconButtonWrapper,
|
|
1561
1693
|
{
|
|
1694
|
+
"aria-disabled": disabled,
|
|
1695
|
+
background: disabled ? "neutral150" : background,
|
|
1696
|
+
tag: "button",
|
|
1697
|
+
display: "inline-flex",
|
|
1698
|
+
justifyContent: "center",
|
|
1699
|
+
hasRadius: true,
|
|
1700
|
+
cursor: "pointer",
|
|
1701
|
+
...restProps,
|
|
1562
1702
|
ref,
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
paddingBottom: size === "S" ? 1 : 2,
|
|
1568
|
-
paddingLeft: size === "S" ? 3 : 4,
|
|
1569
|
-
paddingRight: size === "S" ? 3 : 4,
|
|
1570
|
-
...props
|
|
1703
|
+
$size: size,
|
|
1704
|
+
onClick: handleClick,
|
|
1705
|
+
$variant: variant2,
|
|
1706
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(AccessibleIcon, { label, children })
|
|
1571
1707
|
}
|
|
1572
|
-
)
|
|
1573
|
-
|
|
1708
|
+
);
|
|
1709
|
+
return withTooltip ? /* @__PURE__ */ jsxRuntime.jsx(TooltipImpl, { label, children: component }) : component;
|
|
1710
|
+
}
|
|
1711
|
+
);
|
|
1712
|
+
const IconButtonWrapper = styledComponents.styled(Flex)`
|
|
1713
|
+
text-decoration: none;
|
|
1714
|
+
|
|
1715
|
+
${(props) => {
|
|
1716
|
+
switch (props.$size) {
|
|
1717
|
+
case "S": {
|
|
1718
|
+
return styledComponents.css`
|
|
1719
|
+
padding-block: 0.7rem;
|
|
1720
|
+
padding-inline: 0.7rem;
|
|
1721
|
+
`;
|
|
1722
|
+
}
|
|
1723
|
+
case "M": {
|
|
1724
|
+
return styledComponents.css`
|
|
1725
|
+
padding-block: 0.9rem;
|
|
1726
|
+
padding-inline: 0.9rem;
|
|
1727
|
+
`;
|
|
1728
|
+
}
|
|
1729
|
+
case "L": {
|
|
1730
|
+
return styledComponents.css`
|
|
1731
|
+
padding-block: 1.1rem;
|
|
1732
|
+
padding-inline: 1.1rem;
|
|
1733
|
+
`;
|
|
1734
|
+
}
|
|
1735
|
+
}
|
|
1736
|
+
}}
|
|
1737
|
+
${getVariantStyle}
|
|
1738
|
+
${(props) => props.$variant === "tertiary" ? styledComponents.css`
|
|
1739
|
+
color: ${props.theme.colors.neutral500};
|
|
1740
|
+
` : ""}
|
|
1741
|
+
|
|
1742
|
+
&:hover {
|
|
1743
|
+
${getHoverStyle}
|
|
1744
|
+
${(props) => props.$variant === "tertiary" ? styledComponents.css`
|
|
1745
|
+
color: ${props.theme.colors.neutral600};
|
|
1746
|
+
` : ""}
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1749
|
+
&:active {
|
|
1750
|
+
${getActiveStyle}
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
&[aria-disabled='true'] {
|
|
1754
|
+
${getDisabledStyle}
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1757
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1758
|
+
transition:
|
|
1759
|
+
${(props) => props.theme.transitions.backgroundColor},
|
|
1760
|
+
${(props) => props.theme.transitions.color},
|
|
1761
|
+
border-color ${(props) => props.theme.motion.timings["200"]} ${(props) => props.theme.motion.easings.easeOutQuad};
|
|
1762
|
+
}
|
|
1763
|
+
`;
|
|
1764
|
+
const IconButtonGroup = styledComponents.styled(Flex)`
|
|
1765
|
+
& ${IconButtonWrapper}:first-child {
|
|
1766
|
+
border-radius: ${({ theme }) => `${theme.borderRadius} 0 0 ${theme.borderRadius}`};
|
|
1767
|
+
}
|
|
1768
|
+
|
|
1769
|
+
& ${IconButtonWrapper}:last-child {
|
|
1770
|
+
border-radius: ${({ theme }) => `0 ${theme.borderRadius} ${theme.borderRadius} 0`};
|
|
1771
|
+
}
|
|
1772
|
+
|
|
1773
|
+
& ${IconButtonWrapper} {
|
|
1774
|
+
border-radius: 0;
|
|
1775
|
+
|
|
1776
|
+
& + ${IconButtonWrapper} {
|
|
1777
|
+
border-left: none;
|
|
1778
|
+
}
|
|
1779
|
+
}
|
|
1780
|
+
`;
|
|
1781
|
+
const Link = forwardRef(
|
|
1782
|
+
({ children, href, disabled = false, startIcon, endIcon, isExternal = false, ...props }, ref) => {
|
|
1783
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(LinkWrapper$1, { ref, href, disabled, isExternal, ...props, children: [
|
|
1784
|
+
startIcon,
|
|
1785
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { textColor: disabled ? "neutral600" : "primary600", children }),
|
|
1786
|
+
endIcon,
|
|
1787
|
+
href && !endIcon && isExternal && /* @__PURE__ */ jsxRuntime.jsx(icons.ExternalLink, {})
|
|
1788
|
+
] });
|
|
1789
|
+
}
|
|
1790
|
+
);
|
|
1791
|
+
const LinkWrapper$1 = styledComponents.styled(BaseLinkImpl)`
|
|
1792
|
+
display: inline-flex;
|
|
1793
|
+
align-items: center;
|
|
1794
|
+
text-decoration: none;
|
|
1795
|
+
gap: ${({ theme }) => theme.spaces[2]};
|
|
1796
|
+
pointer-events: ${({ disabled }) => disabled ? "none" : void 0};
|
|
1797
|
+
|
|
1798
|
+
svg {
|
|
1799
|
+
font-size: 1rem;
|
|
1800
|
+
|
|
1801
|
+
path {
|
|
1802
|
+
fill: ${({ disabled, theme }) => disabled ? theme.colors.neutral600 : theme.colors.primary600};
|
|
1803
|
+
}
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
&:hover {
|
|
1807
|
+
& > span {
|
|
1808
|
+
color: ${({ theme }) => theme.colors.primary500};
|
|
1809
|
+
}
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
&:active {
|
|
1813
|
+
color: ${({ theme }) => theme.colors.primary700};
|
|
1814
|
+
}
|
|
1815
|
+
|
|
1816
|
+
${focus};
|
|
1817
|
+
`;
|
|
1818
|
+
const MenuRoot = DropdownMenu__namespace.Root;
|
|
1819
|
+
const MenuTrigger = React__namespace.forwardRef(
|
|
1820
|
+
({ label, endIcon = /* @__PURE__ */ jsxRuntime.jsx(icons.CaretDown, { width: "1.2rem", height: "1.2rem", "aria-hidden": true }), tag = Button, icon, ...rest }, ref) => {
|
|
1821
|
+
const props = {
|
|
1822
|
+
...rest,
|
|
1823
|
+
ref,
|
|
1824
|
+
type: "button"
|
|
1825
|
+
};
|
|
1826
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Trigger, { asChild: true, children: tag === IconButton ? /* @__PURE__ */ jsxRuntime.jsx(IconButton, { label, variant: "tertiary", ...props, children: icon }) : /* @__PURE__ */ jsxRuntime.jsx(Button, { endIcon, variant: "ghost", ...props }) });
|
|
1827
|
+
}
|
|
1574
1828
|
);
|
|
1575
1829
|
const MenuContent = React__namespace.forwardRef(
|
|
1576
1830
|
({ children, intersectionId, popoverPlacement = "bottom-start", ...props }, ref) => {
|
|
1577
1831
|
const [side, align] = popoverPlacement.split("-");
|
|
1578
|
-
return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1832
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuContent, { align, side, loop: true, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1579
1833
|
Viewport$2,
|
|
1580
1834
|
{
|
|
1581
1835
|
ref,
|
|
1582
1836
|
direction: "column",
|
|
1583
|
-
borderStyle: "solid",
|
|
1584
|
-
borderWidth: "1px",
|
|
1585
1837
|
borderColor: "neutral150",
|
|
1586
1838
|
hasRadius: true,
|
|
1587
1839
|
background: "neutral0",
|
|
1588
1840
|
shadow: "filterShadow",
|
|
1589
1841
|
maxHeight: "15rem",
|
|
1590
1842
|
padding: 1,
|
|
1843
|
+
marginTop: 1,
|
|
1844
|
+
marginBottom: 1,
|
|
1591
1845
|
alignItems: "flex-start",
|
|
1592
1846
|
position: "relative",
|
|
1593
1847
|
overflow: "auto",
|
|
@@ -1609,6 +1863,23 @@ const Viewport$2 = styledComponents.styled(Flex)`
|
|
|
1609
1863
|
display: none;
|
|
1610
1864
|
}
|
|
1611
1865
|
`;
|
|
1866
|
+
const DropdownMenuContent = styledComponents.styled(DropdownMenu__namespace.Content)`
|
|
1867
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1868
|
+
animation-duration: ${(props) => props.theme.motion.timings["200"]};
|
|
1869
|
+
|
|
1870
|
+
&[data-state='open'] {
|
|
1871
|
+
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
1872
|
+
|
|
1873
|
+
&[data-side='top'] {
|
|
1874
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
1875
|
+
}
|
|
1876
|
+
|
|
1877
|
+
&[data-side='bottom'] {
|
|
1878
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
1879
|
+
}
|
|
1880
|
+
}
|
|
1881
|
+
}
|
|
1882
|
+
`;
|
|
1612
1883
|
const MenuItem$1 = ({ onSelect, disabled = false, isLink, ...props }) => {
|
|
1613
1884
|
return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Item, { asChild: true, onSelect, disabled, children: isLink || props.isExternal ? /* @__PURE__ */ jsxRuntime.jsx(OptionLink, { color: "neutral800", ...props, isExternal: props.isExternal ?? false, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { children: props.children }) }) : /* @__PURE__ */ jsxRuntime.jsx(OptionButton, { cursor: "pointer", color: "neutral800", background: "transparent", borderStyle: "none", ...props, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { children: props.children }) }) });
|
|
1614
1885
|
};
|
|
@@ -1618,7 +1889,7 @@ const getOptionStyle = ({ theme }) => styledComponents.css`
|
|
|
1618
1889
|
border-radius: ${theme.borderRadius};
|
|
1619
1890
|
padding: ${theme.spaces[2]} ${theme.spaces[4]};
|
|
1620
1891
|
|
|
1621
|
-
&[aria-disabled] {
|
|
1892
|
+
&[aria-disabled='true'] {
|
|
1622
1893
|
cursor: not-allowed;
|
|
1623
1894
|
color: ${theme.colors.neutral500};
|
|
1624
1895
|
}
|
|
@@ -1723,37 +1994,41 @@ const Menu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
|
|
|
1723
1994
|
SubTrigger,
|
|
1724
1995
|
Trigger: Trigger$6
|
|
1725
1996
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1726
|
-
const SimpleMenu = (
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
}
|
|
1997
|
+
const SimpleMenu = React__namespace.forwardRef(
|
|
1998
|
+
({ children, onOpen, onClose, popoverPlacement, onReachEnd, ...props }, forwardedRef) => {
|
|
1999
|
+
const triggerRef = React__namespace.useRef(null);
|
|
2000
|
+
const composedRef = useComposedRefs(forwardedRef, triggerRef);
|
|
2001
|
+
const contentRef = React__namespace.useRef(null);
|
|
2002
|
+
const [internalIsOpen, setInternalIsOpen] = React__namespace.useState(false);
|
|
2003
|
+
const handleReachEnd = (entry) => {
|
|
2004
|
+
if (onReachEnd) {
|
|
2005
|
+
onReachEnd(entry);
|
|
2006
|
+
}
|
|
2007
|
+
};
|
|
2008
|
+
const handleOpenChange = (isOpen) => {
|
|
2009
|
+
if (isOpen && typeof onOpen === "function") {
|
|
2010
|
+
onOpen();
|
|
2011
|
+
} else if (!isOpen && typeof onClose === "function") {
|
|
2012
|
+
onClose();
|
|
2013
|
+
}
|
|
2014
|
+
setInternalIsOpen(isOpen);
|
|
2015
|
+
};
|
|
2016
|
+
const generatedId = useId();
|
|
2017
|
+
const intersectionId = `intersection-${stripReactIdOfColon(generatedId)}`;
|
|
2018
|
+
useIntersection(contentRef, handleReachEnd, {
|
|
2019
|
+
selectorToWatch: `#${intersectionId}`,
|
|
2020
|
+
/**
|
|
2021
|
+
* We need to know when the select is open because only then will viewportRef
|
|
2022
|
+
* not be null. Because it uses a portal that (sensibly) is not mounted 24/7.
|
|
2023
|
+
*/
|
|
2024
|
+
skipWhen: !internalIsOpen
|
|
2025
|
+
});
|
|
2026
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Root$7, { onOpenChange: handleOpenChange, children: [
|
|
2027
|
+
/* @__PURE__ */ jsxRuntime.jsx(Trigger$6, { ref: composedRef, ...props, children: props.label }),
|
|
2028
|
+
/* @__PURE__ */ jsxRuntime.jsx(Content$6, { ref: contentRef, intersectionId, popoverPlacement, children })
|
|
2029
|
+
] });
|
|
2030
|
+
}
|
|
2031
|
+
);
|
|
1757
2032
|
const MenuItem = Item$3;
|
|
1758
2033
|
const StyledButton = styledComponents.styled(SimpleMenu)`
|
|
1759
2034
|
padding: ${({ theme }) => `${theme.spaces[1]} ${theme.spaces[2]}`};
|
|
@@ -1764,16 +2039,19 @@ const StyledButton = styledComponents.styled(SimpleMenu)`
|
|
|
1764
2039
|
background-color: ${({ theme }) => theme.colors.neutral200};
|
|
1765
2040
|
}
|
|
1766
2041
|
`;
|
|
1767
|
-
const CrumbSimpleMenu =
|
|
2042
|
+
const CrumbSimpleMenu = React__namespace.forwardRef(
|
|
2043
|
+
({ children, ...props }, forwardedRef) => /* @__PURE__ */ jsxRuntime.jsx(StyledButton, { ref: forwardedRef, endIcon: null, size: "S", ...props, children })
|
|
2044
|
+
);
|
|
1768
2045
|
CrumbSimpleMenu.displayName = "CrumbSimpleMenu";
|
|
1769
2046
|
const CardContext = React__namespace.createContext({ id: "" });
|
|
1770
2047
|
const useCard = () => React__namespace.useContext(CardContext);
|
|
1771
|
-
const Card = ({ id, ...props }) => {
|
|
2048
|
+
const Card = React__namespace.forwardRef(({ id, ...props }, forwardedRef) => {
|
|
1772
2049
|
const generatedId = useId(id);
|
|
1773
2050
|
const context = React__namespace.useMemo(() => ({ id: generatedId }), [generatedId]);
|
|
1774
2051
|
return /* @__PURE__ */ jsxRuntime.jsx(CardContext.Provider, { value: context, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1775
2052
|
Box,
|
|
1776
2053
|
{
|
|
2054
|
+
ref: forwardedRef,
|
|
1777
2055
|
id,
|
|
1778
2056
|
tabIndex: 0,
|
|
1779
2057
|
hasRadius: true,
|
|
@@ -1787,10 +2065,10 @@ const Card = ({ id, ...props }) => {
|
|
|
1787
2065
|
...props
|
|
1788
2066
|
}
|
|
1789
2067
|
) });
|
|
1790
|
-
};
|
|
1791
|
-
const CardActionImpl = ({ position, ...restProps }) => {
|
|
1792
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CardAction, { $position: position, ...restProps, direction: "row", gap: 2 });
|
|
1793
|
-
};
|
|
2068
|
+
});
|
|
2069
|
+
const CardActionImpl = React__namespace.forwardRef(({ position, ...restProps }, forwardedRef) => {
|
|
2070
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CardAction, { ref: forwardedRef, $position: position, ...restProps, direction: "row", gap: 2 });
|
|
2071
|
+
});
|
|
1794
2072
|
const CardAction = styledComponents.styled(Flex)`
|
|
1795
2073
|
position: absolute;
|
|
1796
2074
|
top: ${({ theme }) => theme.spaces[3]};
|
|
@@ -1841,30 +2119,17 @@ const CardBadge = (props) => /* @__PURE__ */ jsxRuntime.jsx(CardBadgeWrapper, {
|
|
|
1841
2119
|
const CardBody = (props) => {
|
|
1842
2120
|
return /* @__PURE__ */ jsxRuntime.jsx(Box, { paddingLeft: 3, paddingRight: 3, paddingTop: 2, paddingBottom: 2, children: /* @__PURE__ */ jsxRuntime.jsx(Flex, { ...props, alignItems: "flex-start" }) });
|
|
1843
2121
|
};
|
|
1844
|
-
function setRef(ref, value) {
|
|
1845
|
-
if (typeof ref === "function") {
|
|
1846
|
-
ref(value);
|
|
1847
|
-
} else if (ref !== null && ref !== void 0) {
|
|
1848
|
-
ref.current = value;
|
|
1849
|
-
}
|
|
1850
|
-
}
|
|
1851
|
-
function composeRefs(...refs) {
|
|
1852
|
-
return (node) => refs.forEach((ref) => setRef(ref, node));
|
|
1853
|
-
}
|
|
1854
|
-
function useComposedRefs(...refs) {
|
|
1855
|
-
return React__namespace.useCallback(composeRefs(...refs), refs);
|
|
1856
|
-
}
|
|
1857
2122
|
const CheckIcon = ({ fill, ...props }) => {
|
|
1858
2123
|
const { colors } = styledComponents.useTheme();
|
|
1859
2124
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1860
2125
|
Box,
|
|
1861
2126
|
{
|
|
1862
2127
|
tag: "svg",
|
|
1863
|
-
viewBox: "0 0
|
|
2128
|
+
viewBox: "0 0 32 32",
|
|
1864
2129
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1865
2130
|
fill: fill ? colors[fill] : void 0,
|
|
1866
2131
|
...props,
|
|
1867
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "
|
|
2132
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M29.0613 10.0613L13.0613 26.0613C12.9219 26.2011 12.7563 26.3121 12.574 26.3878C12.3917 26.4635 12.1962 26.5024 11.9988 26.5024C11.8013 26.5024 11.6059 26.4635 11.4235 26.3878C11.2412 26.3121 11.0756 26.2011 10.9363 26.0613L3.93626 19.0613C3.79673 18.9217 3.68605 18.7561 3.61053 18.5738C3.53502 18.3915 3.49615 18.1961 3.49615 17.9988C3.49615 17.8014 3.53502 17.606 3.61053 17.4237C3.68605 17.2414 3.79673 17.0758 3.93626 16.9363C4.07579 16.7967 4.24143 16.686 4.42374 16.6105C4.60604 16.535 4.80143 16.4962 4.99876 16.4962C5.19608 16.4962 5.39147 16.535 5.57378 16.6105C5.75608 16.686 5.92173 16.7967 6.06126 16.9363L12 22.875L26.9388 7.93876C27.2205 7.65697 27.6027 7.49866 28.0013 7.49866C28.3998 7.49866 28.782 7.65697 29.0638 7.93876C29.3455 8.22055 29.5039 8.60274 29.5039 9.00126C29.5039 9.39977 29.3455 9.78197 29.0638 10.0638L29.0613 10.0613Z" })
|
|
1868
2133
|
}
|
|
1869
2134
|
);
|
|
1870
2135
|
};
|
|
@@ -1877,9 +2142,9 @@ const CheckboxEl = React__namespace.forwardRef(
|
|
|
1877
2142
|
onChange: onCheckedChange
|
|
1878
2143
|
});
|
|
1879
2144
|
const composedRefs = useComposedRefs(checkboxRef, forwardedRef);
|
|
1880
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CheckboxRoot, { ref: composedRefs, checked, onCheckedChange: setChecked, ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(Checkbox__namespace.Indicator, { children: [
|
|
1881
|
-
checked === true ? /* @__PURE__ */ jsxRuntime.jsx(CheckIcon, { width: "
|
|
1882
|
-
checked === "indeterminate" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2145
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CheckboxRoot, { ref: composedRefs, checked, onCheckedChange: setChecked, ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(Checkbox__namespace.Indicator, { style: { display: "inline-flex" }, children: [
|
|
2146
|
+
checked === true ? /* @__PURE__ */ jsxRuntime.jsx(CheckIcon, { width: "1.6rem", fill: "neutral0" }) : null,
|
|
2147
|
+
checked === "indeterminate" ? /* @__PURE__ */ jsxRuntime.jsx(icons.Minus, { fill: "neutral0" }) : null
|
|
1883
2148
|
] }) });
|
|
1884
2149
|
}
|
|
1885
2150
|
);
|
|
@@ -1897,12 +2162,6 @@ const CheckboxRoot = styledComponents.styled(Checkbox__namespace.Root)`
|
|
|
1897
2162
|
// this ensures the checkbox is always a square even in flex-containers.
|
|
1898
2163
|
flex: 0 0 2rem;
|
|
1899
2164
|
|
|
1900
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
1901
|
-
transition:
|
|
1902
|
-
border-color ${(props) => props.theme.motion.timings["120"]} ${(props) => props.theme.motion.easings.easeOutQuad},
|
|
1903
|
-
${(props) => props.theme.transitions.backgroundColor};
|
|
1904
|
-
}
|
|
1905
|
-
|
|
1906
2165
|
&[data-state='checked'],
|
|
1907
2166
|
&[data-state='indeterminate'] {
|
|
1908
2167
|
border: 1px solid ${(props) => props.theme.colors.primary600};
|
|
@@ -1936,10 +2195,10 @@ const CheckboxImpl = React__namespace.forwardRef(({ children, ...restProps }, fo
|
|
|
1936
2195
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { tag: "label", textColor: "neutral800", htmlFor: labelId, children })
|
|
1937
2196
|
] });
|
|
1938
2197
|
});
|
|
1939
|
-
const CardCheckbox = (props) => {
|
|
2198
|
+
const CardCheckbox = React__namespace.forwardRef((props, forwardedRef) => {
|
|
1940
2199
|
const { id } = useCard();
|
|
1941
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CardActionImpl, { position: "start", children: /* @__PURE__ */ jsxRuntime.jsx(CheckboxImpl, { "aria-labelledby": `${id}-title`, ...props }) });
|
|
1942
|
-
};
|
|
2200
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CardActionImpl, { position: "start", children: /* @__PURE__ */ jsxRuntime.jsx(CheckboxImpl, { "aria-labelledby": `${id}-title`, ...props, ref: forwardedRef }) });
|
|
2201
|
+
});
|
|
1943
2202
|
const BreakBox = styledComponents.styled(Box)`
|
|
1944
2203
|
word-break: break-all;
|
|
1945
2204
|
`;
|
|
@@ -1991,49 +2250,6 @@ const KeyboardKeys = {
|
|
|
1991
2250
|
BACKSPACE: "Backspace",
|
|
1992
2251
|
CLEAR: "Clear"
|
|
1993
2252
|
};
|
|
1994
|
-
const TooltipImpl = React__namespace.forwardRef(
|
|
1995
|
-
({
|
|
1996
|
-
children,
|
|
1997
|
-
description,
|
|
1998
|
-
label,
|
|
1999
|
-
defaultOpen,
|
|
2000
|
-
open,
|
|
2001
|
-
onOpenChange,
|
|
2002
|
-
delayDuration = 500,
|
|
2003
|
-
disableHoverableContent,
|
|
2004
|
-
...restProps
|
|
2005
|
-
}, forwardedRef) => {
|
|
2006
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2007
|
-
Tooltip__namespace.Root,
|
|
2008
|
-
{
|
|
2009
|
-
defaultOpen,
|
|
2010
|
-
open,
|
|
2011
|
-
onOpenChange,
|
|
2012
|
-
delayDuration,
|
|
2013
|
-
disableHoverableContent,
|
|
2014
|
-
children: [
|
|
2015
|
-
/* @__PURE__ */ jsxRuntime.jsx(Tooltip__namespace.Trigger, { asChild: true, children }),
|
|
2016
|
-
/* @__PURE__ */ jsxRuntime.jsx(Tooltip__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { ref: forwardedRef, sideOffset: 8, ...restProps, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "pi", fontWeight: "bold", children: label || description }) }) })
|
|
2017
|
-
]
|
|
2018
|
-
}
|
|
2019
|
-
);
|
|
2020
|
-
}
|
|
2021
|
-
);
|
|
2022
|
-
const TooltipContent = styledComponents.styled(Tooltip__namespace.Content)`
|
|
2023
|
-
background-color: ${(props) => props.theme.colors.neutral900};
|
|
2024
|
-
color: ${(props) => props.theme.colors.neutral0};
|
|
2025
|
-
padding-inline: ${(props) => props.theme.spaces[2]};
|
|
2026
|
-
padding-block: ${(props) => props.theme.spaces[2]};
|
|
2027
|
-
border-radius: ${(props) => props.theme.borderRadius};
|
|
2028
|
-
z-index: ${(props) => props.theme.zIndices.tooltip};
|
|
2029
|
-
will-change: opacity;
|
|
2030
|
-
transform-origin: var(--radix-tooltip-content-transform-origin);
|
|
2031
|
-
|
|
2032
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
2033
|
-
animation: ${ANIMATIONS.fadeIn} ${(props) => props.theme.motion.timings["200"]}
|
|
2034
|
-
${(props) => props.theme.motion.easings.authenticMotion};
|
|
2035
|
-
}
|
|
2036
|
-
`;
|
|
2037
2253
|
const CarouselGrid = styledComponents.styled(Box)`
|
|
2038
2254
|
grid-template-columns: auto 1fr auto;
|
|
2039
2255
|
grid-template-areas: 'startAction slides endAction';
|
|
@@ -2128,9 +2344,11 @@ const commonTheme = {
|
|
|
2128
2344
|
},
|
|
2129
2345
|
spaces: ["0px", "4px", "8px", "12px", "16px", "20px", "24px", "32px", "40px", "48px", "56px", "64px"],
|
|
2130
2346
|
borderRadius: "4px",
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2347
|
+
breakpoints: {
|
|
2348
|
+
initial: "@media(min-width: 0px)",
|
|
2349
|
+
small: "@media(min-width: 520px)",
|
|
2350
|
+
medium: "@media(min-width: 768px)",
|
|
2351
|
+
large: "@media(min-width: 1080px)"
|
|
2134
2352
|
},
|
|
2135
2353
|
fontSizes: [`1.1rem`, `1.2rem`, `1.4rem`, "1.6rem", `1.8rem`, `3.2rem`],
|
|
2136
2354
|
lineHeights: [1.14, 1.22, 1.25, 1.33, 1.43, 1.45, 1.5],
|
|
@@ -2971,7 +3189,7 @@ lodash.exports;
|
|
|
2971
3189
|
}
|
|
2972
3190
|
var runInContext = function runInContext2(context) {
|
|
2973
3191
|
context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
|
|
2974
|
-
var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function,
|
|
3192
|
+
var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function, Math2 = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String2 = context.String, TypeError = context.TypeError;
|
|
2975
3193
|
var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
|
|
2976
3194
|
var coreJsData = context["__core-js_shared__"];
|
|
2977
3195
|
var funcToString = funcProto.toString;
|
|
@@ -2997,7 +3215,7 @@ lodash.exports;
|
|
|
2997
3215
|
}
|
|
2998
3216
|
}();
|
|
2999
3217
|
var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date2 && Date2.now !== root.Date.now && Date2.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
|
|
3000
|
-
var nativeCeil =
|
|
3218
|
+
var nativeCeil = Math2.ceil, nativeFloor = Math2.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined$1, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math2.max, nativeMin = Math2.min, nativeNow = Date2.now, nativeParseInt = context.parseInt, nativeRandom = Math2.random, nativeReverse = arrayProto.reverse;
|
|
3001
3219
|
var DataView = getNative(context, "DataView"), Map = getNative(context, "Map"), Promise2 = getNative(context, "Promise"), Set = getNative(context, "Set"), WeakMap = getNative(context, "WeakMap"), nativeCreate = getNative(Object2, "create");
|
|
3002
3220
|
var metaMap = WeakMap && new WeakMap();
|
|
3003
3221
|
var realNames = {};
|
|
@@ -4743,7 +4961,7 @@ lodash.exports;
|
|
|
4743
4961
|
return setWrapToString(result2, func, bitmask);
|
|
4744
4962
|
}
|
|
4745
4963
|
function createRound(methodName) {
|
|
4746
|
-
var func =
|
|
4964
|
+
var func = Math2[methodName];
|
|
4747
4965
|
return function(number2, precision) {
|
|
4748
4966
|
number2 = toNumber(number2);
|
|
4749
4967
|
precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
|
|
@@ -7834,10 +8052,9 @@ const Label = React__namespace.forwardRef(({ children, action, ...props }, ref)
|
|
|
7834
8052
|
return null;
|
|
7835
8053
|
}
|
|
7836
8054
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7837
|
-
|
|
8055
|
+
TypographyLabel,
|
|
7838
8056
|
{
|
|
7839
8057
|
ref: composedRefs,
|
|
7840
|
-
display: "flex",
|
|
7841
8058
|
variant: "pi",
|
|
7842
8059
|
textColor: "neutral800",
|
|
7843
8060
|
fontWeight: "bold",
|
|
@@ -7845,6 +8062,7 @@ const Label = React__namespace.forwardRef(({ children, action, ...props }, ref)
|
|
|
7845
8062
|
id: `${id}-label`,
|
|
7846
8063
|
htmlFor: id,
|
|
7847
8064
|
tag: "label",
|
|
8065
|
+
ellipsis: true,
|
|
7848
8066
|
children: [
|
|
7849
8067
|
children,
|
|
7850
8068
|
required && /* @__PURE__ */ jsxRuntime.jsx(Typography, { "aria-hidden": true, lineHeight: "1em", textColor: "danger600", children: "*" }),
|
|
@@ -7853,6 +8071,9 @@ const Label = React__namespace.forwardRef(({ children, action, ...props }, ref)
|
|
|
7853
8071
|
}
|
|
7854
8072
|
);
|
|
7855
8073
|
});
|
|
8074
|
+
const TypographyLabel = styledComponents.styled(Typography)`
|
|
8075
|
+
display: flex;
|
|
8076
|
+
`;
|
|
7856
8077
|
const LabelAction = styledComponents.styled(Flex)`
|
|
7857
8078
|
line-height: 0;
|
|
7858
8079
|
color: ${({ theme }) => theme.colors.neutral500};
|
|
@@ -7877,11 +8098,24 @@ const Input$2 = React__namespace.forwardRef(
|
|
|
7877
8098
|
ariaDescription = `${id}-hint`;
|
|
7878
8099
|
}
|
|
7879
8100
|
const hasError = Boolean(error);
|
|
8101
|
+
const endActionRef = React__namespace.useRef(null);
|
|
8102
|
+
const inputElementRef = React__namespace.useRef(null);
|
|
8103
|
+
const inputRef = useComposedRefs(inputElementRef, ref);
|
|
7880
8104
|
const handleChange = (e) => {
|
|
7881
8105
|
if (!disabled && onChange) {
|
|
7882
8106
|
onChange(e);
|
|
7883
8107
|
}
|
|
7884
8108
|
};
|
|
8109
|
+
React__namespace.useLayoutEffect(() => {
|
|
8110
|
+
if (endActionRef.current && inputElementRef.current) {
|
|
8111
|
+
const endActionWidth = endActionRef.current.offsetWidth;
|
|
8112
|
+
const inputElement = inputElementRef.current;
|
|
8113
|
+
if (inputElement) {
|
|
8114
|
+
const inputPadding = endActionWidth + 8 + 16;
|
|
8115
|
+
inputElement.style.paddingRight = `${inputPadding}px`;
|
|
8116
|
+
}
|
|
8117
|
+
}
|
|
8118
|
+
}, [endAction]);
|
|
7885
8119
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7886
8120
|
InputWrapper,
|
|
7887
8121
|
{
|
|
@@ -7889,6 +8123,9 @@ const Input$2 = React__namespace.forwardRef(
|
|
|
7889
8123
|
justifyContent: "space-between",
|
|
7890
8124
|
$hasError: hasError || hasErrorProp,
|
|
7891
8125
|
$disabled: disabled,
|
|
8126
|
+
$size: size,
|
|
8127
|
+
$hasLeftAction: Boolean(startAction),
|
|
8128
|
+
$hasRightAction: Boolean(endAction),
|
|
7892
8129
|
className,
|
|
7893
8130
|
children: [
|
|
7894
8131
|
startAction,
|
|
@@ -7897,9 +8134,7 @@ const Input$2 = React__namespace.forwardRef(
|
|
|
7897
8134
|
{
|
|
7898
8135
|
id,
|
|
7899
8136
|
name,
|
|
7900
|
-
ref,
|
|
7901
|
-
$hasLeftAction: Boolean(startAction),
|
|
7902
|
-
$hasRightAction: Boolean(endAction),
|
|
8137
|
+
ref: inputRef,
|
|
7903
8138
|
$size: size,
|
|
7904
8139
|
"aria-describedby": ariaDescription,
|
|
7905
8140
|
"aria-invalid": hasError || hasErrorProp,
|
|
@@ -7908,10 +8143,12 @@ const Input$2 = React__namespace.forwardRef(
|
|
|
7908
8143
|
"data-disabled": disabled ? "" : void 0,
|
|
7909
8144
|
onChange: handleChange,
|
|
7910
8145
|
"aria-required": required || requiredProp,
|
|
8146
|
+
$hasLeftAction: Boolean(startAction),
|
|
8147
|
+
$hasRightAction: Boolean(endAction),
|
|
7911
8148
|
...props
|
|
7912
8149
|
}
|
|
7913
8150
|
),
|
|
7914
|
-
endAction
|
|
8151
|
+
endAction && /* @__PURE__ */ jsxRuntime.jsx(EndAction, { ref: endActionRef, children: endAction })
|
|
7915
8152
|
]
|
|
7916
8153
|
}
|
|
7917
8154
|
);
|
|
@@ -7930,23 +8167,6 @@ const InputElement = styledComponents.styled.input`
|
|
|
7930
8167
|
width: 100%;
|
|
7931
8168
|
background: inherit;
|
|
7932
8169
|
|
|
7933
|
-
${(props) => {
|
|
7934
|
-
switch (props.$size) {
|
|
7935
|
-
case "S":
|
|
7936
|
-
return styledComponents.css`
|
|
7937
|
-
padding-inline-start: ${props.$hasLeftAction ? props.theme.spaces[3] : props.theme.spaces[4]};
|
|
7938
|
-
padding-inline-end: ${props.$hasRightAction ? props.theme.spaces[3] : props.theme.spaces[4]};
|
|
7939
|
-
padding-block: ${props.theme.spaces[1]};
|
|
7940
|
-
`;
|
|
7941
|
-
default:
|
|
7942
|
-
return styledComponents.css`
|
|
7943
|
-
padding-inline-start: ${props.$hasLeftAction ? props.theme.spaces[3] : props.theme.spaces[4]};
|
|
7944
|
-
padding-inline-end: ${props.$hasRightAction ? props.theme.spaces[3] : props.theme.spaces[4]};
|
|
7945
|
-
padding-block: ${props.theme.spaces[2]};
|
|
7946
|
-
`;
|
|
7947
|
-
}
|
|
7948
|
-
}};
|
|
7949
|
-
|
|
7950
8170
|
::placeholder {
|
|
7951
8171
|
color: ${({ theme }) => theme.colors.neutral500};
|
|
7952
8172
|
opacity: 1;
|
|
@@ -7961,17 +8181,42 @@ const InputElement = styledComponents.styled.input`
|
|
|
7961
8181
|
outline: none;
|
|
7962
8182
|
box-shadow: none;
|
|
7963
8183
|
}
|
|
8184
|
+
|
|
8185
|
+
${(props) => {
|
|
8186
|
+
switch (props.$size) {
|
|
8187
|
+
case "S":
|
|
8188
|
+
return styledComponents.css`
|
|
8189
|
+
padding-inline-start: ${props.$hasLeftAction ? 0 : props.theme.spaces[4]};
|
|
8190
|
+
padding-inline-end: ${props.$hasRightAction ? 0 : props.theme.spaces[4]};
|
|
8191
|
+
padding-block: ${props.theme.spaces[1]};
|
|
8192
|
+
`;
|
|
8193
|
+
default:
|
|
8194
|
+
return styledComponents.css`
|
|
8195
|
+
padding-inline-start: ${props.$hasLeftAction ? 0 : props.theme.spaces[4]};
|
|
8196
|
+
padding-inline-end: ${props.$hasRightAction ? 0 : props.theme.spaces[4]};
|
|
8197
|
+
padding-block: ${props.theme.spaces[2]};
|
|
8198
|
+
`;
|
|
8199
|
+
}
|
|
8200
|
+
}}
|
|
8201
|
+
`;
|
|
8202
|
+
const EndAction = styledComponents.styled(Flex)`
|
|
8203
|
+
position: absolute;
|
|
8204
|
+
right: ${({ theme }) => theme.spaces[4]};
|
|
8205
|
+
top: 50%;
|
|
8206
|
+
transform: translateY(-50%);
|
|
7964
8207
|
`;
|
|
7965
8208
|
const InputWrapper = styledComponents.styled(Flex)`
|
|
7966
8209
|
border: 1px solid ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral200};
|
|
7967
8210
|
border-radius: ${({ theme }) => theme.borderRadius};
|
|
7968
8211
|
background: ${({ theme }) => theme.colors.neutral0};
|
|
7969
|
-
${
|
|
8212
|
+
padding-inline-start: ${({ $hasLeftAction, theme }) => $hasLeftAction ? theme.spaces[4] : 0};
|
|
8213
|
+
position: relative;
|
|
7970
8214
|
|
|
8215
|
+
${inputFocusStyle()}
|
|
7971
8216
|
${({ theme, $disabled }) => $disabled ? styledComponents.css`
|
|
7972
8217
|
color: ${theme.colors.neutral600};
|
|
7973
8218
|
background: ${theme.colors.neutral150};
|
|
7974
|
-
` : void 0}
|
|
8219
|
+
` : void 0};
|
|
7975
8220
|
`;
|
|
7976
8221
|
const Hint = () => {
|
|
7977
8222
|
const { id, hint, error } = useField("Hint");
|
|
@@ -8252,7 +8497,7 @@ const Combobox = React__namespace.forwardRef(
|
|
|
8252
8497
|
children: [
|
|
8253
8498
|
/* @__PURE__ */ jsxRuntime.jsxs(Trigger$5, { $hasError: hasError, $size: size, className, children: [
|
|
8254
8499
|
/* @__PURE__ */ jsxRuntime.jsxs(Flex, { flex: "1", tag: "span", gap: 3, children: [
|
|
8255
|
-
startIcon ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
8500
|
+
startIcon ? /* @__PURE__ */ jsxRuntime.jsx(Flex, { flex: "0 0 1.6rem", tag: "span", "aria-hidden": true, children: startIcon }) : null,
|
|
8256
8501
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8257
8502
|
TextInput$1,
|
|
8258
8503
|
{
|
|
@@ -8286,7 +8531,7 @@ const Combobox = React__namespace.forwardRef(
|
|
|
8286
8531
|
children: /* @__PURE__ */ jsxRuntime.jsx(icons.Cross, {})
|
|
8287
8532
|
}
|
|
8288
8533
|
) : null,
|
|
8289
|
-
/* @__PURE__ */ jsxRuntime.jsx(DownIcon$1, { children: /* @__PURE__ */ jsxRuntime.jsx(icons.CaretDown, {}) })
|
|
8534
|
+
/* @__PURE__ */ jsxRuntime.jsx(DownIcon$1, { children: /* @__PURE__ */ jsxRuntime.jsx(icons.CaretDown, { fill: "neutral500" }) })
|
|
8290
8535
|
] })
|
|
8291
8536
|
] }),
|
|
8292
8537
|
/* @__PURE__ */ jsxRuntime.jsx(uiPrimitives.Combobox.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(Content$5, { sideOffset: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(Viewport$1, { ref: viewportRef, children: [
|
|
@@ -8375,6 +8620,7 @@ const DownIcon$1 = styledComponents.styled(uiPrimitives.Combobox.Icon)`
|
|
|
8375
8620
|
background: transparent;
|
|
8376
8621
|
padding: 0;
|
|
8377
8622
|
color: ${({ theme }) => theme.colors.neutral600};
|
|
8623
|
+
display: flex;
|
|
8378
8624
|
|
|
8379
8625
|
&[aria-disabled='true'] {
|
|
8380
8626
|
cursor: inherit;
|
|
@@ -8398,11 +8644,11 @@ const Content$5 = styledComponents.styled(uiPrimitives.Combobox.Content)`
|
|
|
8398
8644
|
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
8399
8645
|
|
|
8400
8646
|
&[data-side='top'] {
|
|
8401
|
-
animation-name: ${ANIMATIONS.
|
|
8647
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
8402
8648
|
}
|
|
8403
8649
|
|
|
8404
8650
|
&[data-side='bottom'] {
|
|
8405
|
-
animation-name: ${ANIMATIONS.
|
|
8651
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
8406
8652
|
}
|
|
8407
8653
|
}
|
|
8408
8654
|
}
|
|
@@ -8498,19 +8744,7 @@ const ContentImpl$1 = styledComponents.styled(AlertDialog__namespace.Content)`
|
|
|
8498
8744
|
}
|
|
8499
8745
|
`;
|
|
8500
8746
|
const Header$1 = React__namespace.forwardRef(({ children, ...restProps }, forwardedRef) => {
|
|
8501
|
-
return /* @__PURE__ */ jsxRuntime.jsx(AlertDialog__namespace.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8502
|
-
Title$1,
|
|
8503
|
-
{
|
|
8504
|
-
tag: "h2",
|
|
8505
|
-
ref: forwardedRef,
|
|
8506
|
-
padding: 6,
|
|
8507
|
-
justifyContent: "center",
|
|
8508
|
-
variant: "h2",
|
|
8509
|
-
fontWeight: "bold",
|
|
8510
|
-
...restProps,
|
|
8511
|
-
children
|
|
8512
|
-
}
|
|
8513
|
-
) });
|
|
8747
|
+
return /* @__PURE__ */ jsxRuntime.jsx(AlertDialog__namespace.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Title$1, { tag: "h2", variant: "beta", ref: forwardedRef, padding: 6, fontWeight: "bold", ...restProps, children }) });
|
|
8514
8748
|
});
|
|
8515
8749
|
const Title$1 = styledComponents.styled(Typography)`
|
|
8516
8750
|
display: flex;
|
|
@@ -8684,8 +8918,7 @@ ${styledComponents.css`
|
|
|
8684
8918
|
img,
|
|
8685
8919
|
picture,
|
|
8686
8920
|
video,
|
|
8687
|
-
canvas
|
|
8688
|
-
svg {
|
|
8921
|
+
canvas {
|
|
8689
8922
|
display: block;
|
|
8690
8923
|
max-width: 100%;
|
|
8691
8924
|
}
|
|
@@ -8830,7 +9063,7 @@ const SelectTrigger = React__namespace.forwardRef(
|
|
|
8830
9063
|
...restProps,
|
|
8831
9064
|
children: [
|
|
8832
9065
|
/* @__PURE__ */ jsxRuntime.jsxs(Flex, { flex: "1", tag: "span", gap: 3, children: [
|
|
8833
|
-
startIcon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
9066
|
+
startIcon && /* @__PURE__ */ jsxRuntime.jsx(Flex, { tag: "span", "aria-hidden": true, children: startIcon }),
|
|
8834
9067
|
children
|
|
8835
9068
|
] }),
|
|
8836
9069
|
/* @__PURE__ */ jsxRuntime.jsxs(Flex, { tag: "span", gap: 3, children: [
|
|
@@ -8859,6 +9092,7 @@ const SelectTrigger = React__namespace.forwardRef(
|
|
|
8859
9092
|
);
|
|
8860
9093
|
const IconBox$2 = styledComponents.styled(Box)`
|
|
8861
9094
|
border: none;
|
|
9095
|
+
display: flex;
|
|
8862
9096
|
|
|
8863
9097
|
svg {
|
|
8864
9098
|
height: 1.1rem;
|
|
@@ -8866,7 +9100,7 @@ const IconBox$2 = styledComponents.styled(Box)`
|
|
|
8866
9100
|
}
|
|
8867
9101
|
|
|
8868
9102
|
svg path {
|
|
8869
|
-
fill: ${({ theme }) => theme.colors.
|
|
9103
|
+
fill: ${({ theme }) => theme.colors.neutral500};
|
|
8870
9104
|
}
|
|
8871
9105
|
`;
|
|
8872
9106
|
const StyledTrigger = styledComponents.styled(Flex)`
|
|
@@ -8889,7 +9123,7 @@ const StyledTrigger = styledComponents.styled(Flex)`
|
|
|
8889
9123
|
}}
|
|
8890
9124
|
|
|
8891
9125
|
&[aria-disabled='true'] {
|
|
8892
|
-
color: ${(props) => props.theme.colors.
|
|
9126
|
+
color: ${(props) => props.theme.colors.neutral500};
|
|
8893
9127
|
}
|
|
8894
9128
|
|
|
8895
9129
|
/* Required to ensure the below inputFocusStyles are adhered too */
|
|
@@ -8900,8 +9134,9 @@ const StyledTrigger = styledComponents.styled(Flex)`
|
|
|
8900
9134
|
${({ theme, $hasError }) => inputFocusStyle()({ theme, $hasError })};
|
|
8901
9135
|
`;
|
|
8902
9136
|
const DownIcon = styledComponents.styled(uiPrimitives.Select.Icon)`
|
|
9137
|
+
display: flex;
|
|
8903
9138
|
& > svg {
|
|
8904
|
-
fill: ${({ theme }) => theme.colors.
|
|
9139
|
+
fill: ${({ theme }) => theme.colors.neutral500};
|
|
8905
9140
|
}
|
|
8906
9141
|
`;
|
|
8907
9142
|
const SelectValue = React__namespace.forwardRef(({ children, placeholder, ...restProps }, ref) => /* @__PURE__ */ jsxRuntime.jsx(ValueType, { ref, ellipsis: true, ...restProps, children: /* @__PURE__ */ jsxRuntime.jsx(StyledValue, { placeholder, children }) }));
|
|
@@ -8921,8 +9156,7 @@ const SelectContent = styledComponents.styled(uiPrimitives.Select.Content)`
|
|
|
8921
9156
|
border: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
8922
9157
|
border-radius: ${({ theme }) => theme.borderRadius};
|
|
8923
9158
|
min-width: var(--radix-select-trigger-width);
|
|
8924
|
-
|
|
8925
|
-
max-height: 15rem;
|
|
9159
|
+
max-height: 15.6rem;
|
|
8926
9160
|
z-index: ${({ theme }) => theme.zIndices.popover};
|
|
8927
9161
|
|
|
8928
9162
|
@media (prefers-reduced-motion: no-preference) {
|
|
@@ -8933,11 +9167,11 @@ const SelectContent = styledComponents.styled(uiPrimitives.Select.Content)`
|
|
|
8933
9167
|
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
8934
9168
|
|
|
8935
9169
|
&[data-side='top'] {
|
|
8936
|
-
animation-name: ${ANIMATIONS.
|
|
9170
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
8937
9171
|
}
|
|
8938
9172
|
|
|
8939
9173
|
&[data-side='bottom'] {
|
|
8940
|
-
animation-name: ${ANIMATIONS.
|
|
9174
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
8941
9175
|
}
|
|
8942
9176
|
}
|
|
8943
9177
|
}
|
|
@@ -9099,7 +9333,7 @@ const SingleSelectOption = React__namespace.forwardRef(
|
|
|
9099
9333
|
({ value, startIcon, children, ...restProps }, ref) => {
|
|
9100
9334
|
return /* @__PURE__ */ jsxRuntime.jsxs(Item$2, { ref, value: value.toString(), ...restProps, children: [
|
|
9101
9335
|
startIcon && /* @__PURE__ */ jsxRuntime.jsx(Box, { tag: "span", "aria-hidden": true, children: startIcon }),
|
|
9102
|
-
/* @__PURE__ */ jsxRuntime.jsx(Typography, { children: /* @__PURE__ */ jsxRuntime.jsx(ItemText, { children }) })
|
|
9336
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { lineHeight: "20px", children: /* @__PURE__ */ jsxRuntime.jsx(ItemText, { children }) })
|
|
9103
9337
|
] });
|
|
9104
9338
|
}
|
|
9105
9339
|
);
|
|
@@ -9595,7 +9829,7 @@ const DatePickerContentImpl = React__namespace.forwardRef(
|
|
|
9595
9829
|
(props, forwardedRef) => {
|
|
9596
9830
|
const { label = "Choose date", ...restProps } = props;
|
|
9597
9831
|
const { onOpenChange, ...context } = useDatePickerContext(CONTENT_IMPL_NAME);
|
|
9598
|
-
const { x, y, refs, strategy } = reactDom$1.useFloating({
|
|
9832
|
+
const { x, y, refs, strategy, placement } = reactDom$1.useFloating({
|
|
9599
9833
|
strategy: "fixed",
|
|
9600
9834
|
placement: "bottom-start",
|
|
9601
9835
|
middleware: [
|
|
@@ -9642,6 +9876,7 @@ const DatePickerContentImpl = React__namespace.forwardRef(
|
|
|
9642
9876
|
{
|
|
9643
9877
|
ref: composedRefs,
|
|
9644
9878
|
"data-state": context.open ? "open" : "closed",
|
|
9879
|
+
"data-side": placement.includes("top") ? "top" : "bottom",
|
|
9645
9880
|
onContextMenu: (event) => event.preventDefault(),
|
|
9646
9881
|
id: context.contentId,
|
|
9647
9882
|
role: "dialog",
|
|
@@ -9666,6 +9901,22 @@ const ContentElement = styledComponents.styled(Box)`
|
|
|
9666
9901
|
box-shadow: ${({ theme }) => theme.shadows.filterShadow};
|
|
9667
9902
|
z-index: ${({ theme }) => theme.zIndices.popover};
|
|
9668
9903
|
border: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
9904
|
+
|
|
9905
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
9906
|
+
animation-duration: ${(props) => props.theme.motion.timings["200"]};
|
|
9907
|
+
|
|
9908
|
+
&[data-state='open'] {
|
|
9909
|
+
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
9910
|
+
|
|
9911
|
+
&[data-side='top'] {
|
|
9912
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
9913
|
+
}
|
|
9914
|
+
|
|
9915
|
+
&[data-side='bottom'] {
|
|
9916
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
9917
|
+
}
|
|
9918
|
+
}
|
|
9919
|
+
}
|
|
9669
9920
|
`;
|
|
9670
9921
|
const DATE_PICKER_CALENDAR_NAME = "DatePickerCalendar";
|
|
9671
9922
|
const DatePickerCalendar = React__namespace.forwardRef(
|
|
@@ -10095,238 +10346,27 @@ const EmptyStateIconWrapper = styledComponents.styled(Box)`
|
|
|
10095
10346
|
height: 8.8rem;
|
|
10096
10347
|
}
|
|
10097
10348
|
`;
|
|
10098
|
-
const EmptyStateLayout = (
|
|
10099
|
-
icon,
|
|
10100
|
-
|
|
10101
|
-
|
|
10102
|
-
hasRadius = true,
|
|
10103
|
-
shadow = "tableShadow"
|
|
10104
|
-
}) => {
|
|
10105
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10106
|
-
Flex,
|
|
10107
|
-
{
|
|
10108
|
-
alignItems: "center",
|
|
10109
|
-
direction: "column",
|
|
10110
|
-
padding: 11,
|
|
10111
|
-
background: "neutral0",
|
|
10112
|
-
hasRadius,
|
|
10113
|
-
shadow,
|
|
10114
|
-
children: [
|
|
10115
|
-
icon ? /* @__PURE__ */ jsxRuntime.jsx(EmptyStateIconWrapper, { paddingBottom: 6, "aria-hidden": true, children: icon }) : null,
|
|
10116
|
-
/* @__PURE__ */ jsxRuntime.jsx(Box, { paddingBottom: 4, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "delta", tag: "p", textAlign: "center", textColor: "neutral600", children: content }) }),
|
|
10117
|
-
action
|
|
10118
|
-
]
|
|
10119
|
-
}
|
|
10120
|
-
);
|
|
10121
|
-
};
|
|
10122
|
-
const getFocusableNodes = (node, includeNegativeTabIndex) => {
|
|
10123
|
-
const nodes = [
|
|
10124
|
-
...node.querySelectorAll(
|
|
10125
|
-
'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
|
|
10126
|
-
)
|
|
10127
|
-
];
|
|
10128
|
-
const focusables = nodes.filter((node2) => {
|
|
10129
|
-
if (node2.hasAttribute("disabled"))
|
|
10130
|
-
return false;
|
|
10131
|
-
if (includeNegativeTabIndex)
|
|
10132
|
-
return true;
|
|
10133
|
-
return node2.getAttribute("tabindex") !== "-1";
|
|
10134
|
-
});
|
|
10135
|
-
return focusables;
|
|
10136
|
-
};
|
|
10137
|
-
const getFocusableNodesWithKeyboardNav = (nodes) => {
|
|
10138
|
-
return nodes.filter((node) => {
|
|
10139
|
-
if (node.tagName === "INPUT") {
|
|
10140
|
-
return node.type !== "checkbox" && node.type !== "radio";
|
|
10141
|
-
}
|
|
10142
|
-
return false;
|
|
10143
|
-
});
|
|
10144
|
-
};
|
|
10145
|
-
const FocusTrap = ({ onEscape, restoreFocus = true, skipAutoFocus = false, ...props }) => {
|
|
10146
|
-
const trappedRef = React__namespace.useRef(null);
|
|
10147
|
-
React__namespace.useEffect(() => {
|
|
10148
|
-
let currentFocus = null;
|
|
10149
|
-
if (restoreFocus) {
|
|
10150
|
-
currentFocus = document.activeElement;
|
|
10151
|
-
}
|
|
10152
|
-
return () => {
|
|
10153
|
-
if (currentFocus) {
|
|
10154
|
-
currentFocus.focus();
|
|
10155
|
-
}
|
|
10156
|
-
};
|
|
10157
|
-
}, [restoreFocus]);
|
|
10158
|
-
React__namespace.useEffect(() => {
|
|
10159
|
-
if (!trappedRef.current || skipAutoFocus)
|
|
10160
|
-
return;
|
|
10161
|
-
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
10162
|
-
if (focusableChildren.length > 0) {
|
|
10163
|
-
const firstElement = focusableChildren[0];
|
|
10164
|
-
firstElement.focus();
|
|
10165
|
-
} else {
|
|
10166
|
-
console.warn(
|
|
10167
|
-
"[FocusTrap]: it seems there are no focusable elements in the focus trap tree. Make sure there s at least one."
|
|
10168
|
-
);
|
|
10169
|
-
}
|
|
10170
|
-
}, [skipAutoFocus]);
|
|
10171
|
-
const handleKeyDown = (e) => {
|
|
10172
|
-
if (e.key === KeyboardKeys.ESCAPE && onEscape) {
|
|
10173
|
-
onEscape();
|
|
10174
|
-
return;
|
|
10175
|
-
}
|
|
10176
|
-
if (e.key !== KeyboardKeys.TAB)
|
|
10177
|
-
return;
|
|
10178
|
-
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
10179
|
-
if (focusableChildren.length > 0) {
|
|
10180
|
-
const firstElement = focusableChildren[0];
|
|
10181
|
-
const lastElement = focusableChildren[focusableChildren.length - 1];
|
|
10182
|
-
if (e.shiftKey) {
|
|
10183
|
-
if (firstElement === document.activeElement) {
|
|
10184
|
-
e.preventDefault();
|
|
10185
|
-
lastElement.focus();
|
|
10186
|
-
}
|
|
10187
|
-
} else if (lastElement === document.activeElement) {
|
|
10188
|
-
e.preventDefault();
|
|
10189
|
-
firstElement.focus();
|
|
10190
|
-
}
|
|
10191
|
-
}
|
|
10192
|
-
};
|
|
10193
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: trappedRef, onKeyDown: handleKeyDown, ...props });
|
|
10194
|
-
};
|
|
10195
|
-
const Root$3 = forwardRef((props, forwardedRef) => {
|
|
10196
|
-
const { gap = 0, gridCols = 12, ...rest } = props;
|
|
10197
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Wrapper$1, { ref: forwardedRef, $gap: gap, $gridCols: gridCols, ...rest });
|
|
10198
|
-
});
|
|
10199
|
-
const Wrapper$1 = styledComponents.styled(Box)`
|
|
10200
|
-
display: grid;
|
|
10201
|
-
grid-template-columns: repeat(${({ $gridCols }) => $gridCols}, 1fr);
|
|
10202
|
-
${({ theme, $gap }) => handleResponsiveValues("gap", $gap, theme)}
|
|
10203
|
-
`;
|
|
10204
|
-
const ItemImpl = forwardRef(
|
|
10205
|
-
({ col, s, xs, ...props }, forwardedRef) => /* @__PURE__ */ jsxRuntime.jsx(Item$1, { ref: forwardedRef, $col: col, $s: s, $xs: xs, ...props })
|
|
10206
|
-
);
|
|
10207
|
-
const Item$1 = styledComponents.styled(Box)`
|
|
10208
|
-
grid-column: span ${({ $col }) => $col ?? 1};
|
|
10209
|
-
max-width: 100%;
|
|
10210
|
-
|
|
10211
|
-
${({ theme }) => theme.mediaQueries.tablet} {
|
|
10212
|
-
grid-column: span ${({ $s }) => $s};
|
|
10213
|
-
}
|
|
10214
|
-
|
|
10215
|
-
${({ theme }) => theme.mediaQueries.mobile} {
|
|
10216
|
-
grid-column: span ${({ $xs }) => $xs};
|
|
10217
|
-
}
|
|
10218
|
-
`;
|
|
10219
|
-
const Grid = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10220
|
-
__proto__: null,
|
|
10221
|
-
Item: ItemImpl,
|
|
10222
|
-
Root: Root$3
|
|
10223
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
10224
|
-
const VARIANT_DEFAULT = "tertiary";
|
|
10225
|
-
const VARIANT_SECONDARY = "secondary";
|
|
10226
|
-
const SIZES = ["S", "M", "L"];
|
|
10227
|
-
const VARIANTS = [VARIANT_DEFAULT, VARIANT_SECONDARY];
|
|
10228
|
-
const IconButton = forwardRef(
|
|
10229
|
-
({
|
|
10230
|
-
label,
|
|
10231
|
-
background,
|
|
10232
|
-
children,
|
|
10233
|
-
disabled = false,
|
|
10234
|
-
onClick,
|
|
10235
|
-
size = SIZES[0],
|
|
10236
|
-
variant: variant2 = VARIANTS[0],
|
|
10237
|
-
withTooltip = true,
|
|
10238
|
-
...restProps
|
|
10239
|
-
}, ref) => {
|
|
10240
|
-
const handleClick = (e) => {
|
|
10241
|
-
if (!disabled && onClick) {
|
|
10242
|
-
onClick(e);
|
|
10243
|
-
}
|
|
10244
|
-
};
|
|
10245
|
-
const component = /* @__PURE__ */ jsxRuntime.jsx(
|
|
10246
|
-
IconButtonWrapper,
|
|
10349
|
+
const EmptyStateLayout = React__namespace.forwardRef(
|
|
10350
|
+
({ icon, content, action, hasRadius = true, shadow = "tableShadow" }, forwardedRef) => {
|
|
10351
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10352
|
+
Flex,
|
|
10247
10353
|
{
|
|
10248
|
-
|
|
10249
|
-
|
|
10250
|
-
|
|
10251
|
-
|
|
10252
|
-
|
|
10253
|
-
|
|
10254
|
-
|
|
10255
|
-
|
|
10256
|
-
|
|
10354
|
+
ref: forwardedRef,
|
|
10355
|
+
alignItems: "center",
|
|
10356
|
+
direction: "column",
|
|
10357
|
+
padding: 11,
|
|
10358
|
+
background: "neutral0",
|
|
10359
|
+
hasRadius,
|
|
10360
|
+
shadow,
|
|
10361
|
+
children: [
|
|
10362
|
+
icon ? /* @__PURE__ */ jsxRuntime.jsx(EmptyStateIconWrapper, { paddingBottom: 6, "aria-hidden": true, children: icon }) : null,
|
|
10363
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { paddingBottom: 4, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "delta", tag: "p", textAlign: "center", textColor: "neutral600", children: content }) }),
|
|
10364
|
+
action
|
|
10365
|
+
]
|
|
10257
10366
|
}
|
|
10258
10367
|
);
|
|
10259
|
-
return withTooltip ? /* @__PURE__ */ jsxRuntime.jsx(TooltipImpl, { label, children: component }) : component;
|
|
10260
10368
|
}
|
|
10261
10369
|
);
|
|
10262
|
-
const IconButtonWrapper = styledComponents.styled(BaseButton)`
|
|
10263
|
-
background-color: ${({ theme, $variant }) => {
|
|
10264
|
-
if ($variant === VARIANT_SECONDARY) {
|
|
10265
|
-
return theme.colors.primary100;
|
|
10266
|
-
}
|
|
10267
|
-
return void 0;
|
|
10268
|
-
}};
|
|
10269
|
-
border-color: ${({ theme, $variant }) => {
|
|
10270
|
-
if ($variant === VARIANT_SECONDARY) {
|
|
10271
|
-
return theme.colors.primary200;
|
|
10272
|
-
}
|
|
10273
|
-
return theme.colors.neutral200;
|
|
10274
|
-
}};
|
|
10275
|
-
height: ${({ theme, $size }) => theme.sizes.button[$size]};
|
|
10276
|
-
width: ${({ theme, $size }) => theme.sizes.button[$size]};
|
|
10277
|
-
color: ${({ theme, $variant }) => {
|
|
10278
|
-
if ($variant === VARIANT_SECONDARY) {
|
|
10279
|
-
return theme.colors.primary500;
|
|
10280
|
-
}
|
|
10281
|
-
return theme.colors.neutral500;
|
|
10282
|
-
}};
|
|
10283
|
-
|
|
10284
|
-
&:hover,
|
|
10285
|
-
&:focus {
|
|
10286
|
-
color: ${({ theme, $variant }) => {
|
|
10287
|
-
if ($variant === VARIANT_SECONDARY) {
|
|
10288
|
-
return theme.colors.primary600;
|
|
10289
|
-
}
|
|
10290
|
-
return theme.colors.neutral600;
|
|
10291
|
-
}};
|
|
10292
|
-
}
|
|
10293
|
-
|
|
10294
|
-
&[aria-disabled='true'] {
|
|
10295
|
-
color: ${({ theme }) => theme.colors.neutral600};
|
|
10296
|
-
}
|
|
10297
|
-
`;
|
|
10298
|
-
const IconButtonGroup = styledComponents.styled(Flex)`
|
|
10299
|
-
& ${IconButtonWrapper}:first-child {
|
|
10300
|
-
border-radius: ${({ theme }) => `${theme.borderRadius} 0 0 ${theme.borderRadius}`};
|
|
10301
|
-
}
|
|
10302
|
-
|
|
10303
|
-
& ${IconButtonWrapper}:last-child {
|
|
10304
|
-
border-radius: ${({ theme }) => `0 ${theme.borderRadius} ${theme.borderRadius} 0`};
|
|
10305
|
-
}
|
|
10306
|
-
|
|
10307
|
-
& ${IconButtonWrapper} {
|
|
10308
|
-
border-radius: 0;
|
|
10309
|
-
color: ${({ theme }) => theme.colors.neutral700};
|
|
10310
|
-
|
|
10311
|
-
& + ${IconButtonWrapper} {
|
|
10312
|
-
border-left: none;
|
|
10313
|
-
}
|
|
10314
|
-
|
|
10315
|
-
&:hover {
|
|
10316
|
-
background-color: ${({ theme }) => theme.colors.neutral100};
|
|
10317
|
-
color: ${({ theme }) => theme.colors.neutral800};
|
|
10318
|
-
}
|
|
10319
|
-
|
|
10320
|
-
&:active {
|
|
10321
|
-
background-color: ${({ theme }) => theme.colors.neutral150};
|
|
10322
|
-
color: ${({ theme }) => theme.colors.neutral900};
|
|
10323
|
-
}
|
|
10324
|
-
|
|
10325
|
-
&[aria-disabled='true'] {
|
|
10326
|
-
color: ${({ theme }) => theme.colors.neutral600};
|
|
10327
|
-
}
|
|
10328
|
-
}
|
|
10329
|
-
`;
|
|
10330
10370
|
const addMarks = state.StateEffect.define();
|
|
10331
10371
|
const filterMarks = state.StateEffect.define();
|
|
10332
10372
|
const lineHighlightMark = view.Decoration.mark({
|
|
@@ -10504,72 +10544,29 @@ const JSONInputContainer = styledComponents.styled(Flex)`
|
|
|
10504
10544
|
}
|
|
10505
10545
|
`;
|
|
10506
10546
|
const LinkButton = forwardRef(
|
|
10507
|
-
({
|
|
10508
|
-
|
|
10509
|
-
|
|
10510
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10511
|
-
LinkWrapper$1,
|
|
10547
|
+
({ disabled, ...restProps }, ref) => {
|
|
10548
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10549
|
+
Button,
|
|
10512
10550
|
{
|
|
10513
10551
|
ref,
|
|
10514
|
-
|
|
10515
|
-
|
|
10516
|
-
|
|
10517
|
-
|
|
10518
|
-
hasRadius: true,
|
|
10519
|
-
display: "inline-flex",
|
|
10520
|
-
paddingBottom: paddingX,
|
|
10521
|
-
paddingLeft: paddingY,
|
|
10522
|
-
paddingRight: paddingY,
|
|
10523
|
-
paddingTop: paddingX,
|
|
10524
|
-
pointerEvents: disabled ? "none" : void 0,
|
|
10525
|
-
...props,
|
|
10526
|
-
children: [
|
|
10527
|
-
startIcon && /* @__PURE__ */ jsxRuntime.jsx(Flex, { "aria-hidden": true, children: startIcon }),
|
|
10528
|
-
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: size === "S" ? "pi" : void 0, fontWeight: "bold", children }),
|
|
10529
|
-
endIcon && /* @__PURE__ */ jsxRuntime.jsx(Flex, { "aria-hidden": true, children: endIcon })
|
|
10530
|
-
]
|
|
10552
|
+
tag: BaseLinkImpl,
|
|
10553
|
+
tabIndex: disabled ? -1 : void 0,
|
|
10554
|
+
disabled,
|
|
10555
|
+
...restProps
|
|
10531
10556
|
}
|
|
10532
10557
|
);
|
|
10533
10558
|
}
|
|
10534
10559
|
);
|
|
10535
|
-
const
|
|
10536
|
-
|
|
10537
|
-
|
|
10538
|
-
|
|
10539
|
-
|
|
10540
|
-
&[aria-disabled='true'] {
|
|
10541
|
-
pointer-events: none;
|
|
10560
|
+
const MainWrapper = styledComponents.styled(Box)`
|
|
10561
|
+
// To prevent global outline on focus visible to force an outline when Main is focused
|
|
10562
|
+
&:focus-visible {
|
|
10563
|
+
outline: none;
|
|
10542
10564
|
}
|
|
10543
|
-
|
|
10544
|
-
|
|
10545
|
-
|
|
10546
|
-
|
|
10547
|
-
|
|
10548
|
-
&:active {
|
|
10549
|
-
${getDisabledStyle}
|
|
10550
|
-
}
|
|
10551
|
-
}
|
|
10552
|
-
|
|
10553
|
-
&:hover {
|
|
10554
|
-
${getHoverStyle}
|
|
10555
|
-
}
|
|
10556
|
-
|
|
10557
|
-
&:active {
|
|
10558
|
-
${getActiveStyle}
|
|
10559
|
-
}
|
|
10560
|
-
|
|
10561
|
-
${getVariantStyle}
|
|
10562
|
-
`;
|
|
10563
|
-
const MainWrapper = styledComponents.styled(Box)`
|
|
10564
|
-
// To prevent global outline on focus visible to force an outline when Main is focused
|
|
10565
|
-
&:focus-visible {
|
|
10566
|
-
outline: none;
|
|
10567
|
-
}
|
|
10568
|
-
`;
|
|
10569
|
-
const Main = ({ labelledBy = "main-content-title", ...props }) => {
|
|
10570
|
-
return /* @__PURE__ */ jsxRuntime.jsx(MainWrapper, { "aria-labelledby": labelledBy, tag: "main", id: "main-content", tabIndex: -1, ...props });
|
|
10571
|
-
};
|
|
10572
|
-
const AnchorBox = styledComponents.styled(Box)`
|
|
10565
|
+
`;
|
|
10566
|
+
const Main = ({ labelledBy = "main-content-title", ...props }) => {
|
|
10567
|
+
return /* @__PURE__ */ jsxRuntime.jsx(MainWrapper, { "aria-labelledby": labelledBy, tag: "main", id: "main-content", tabIndex: -1, ...props });
|
|
10568
|
+
};
|
|
10569
|
+
const AnchorBox = styledComponents.styled(Box)`
|
|
10573
10570
|
text-decoration: none;
|
|
10574
10571
|
|
|
10575
10572
|
&:focus {
|
|
@@ -10595,6 +10592,7 @@ const SkipToContent = ({ children }) => {
|
|
|
10595
10592
|
}
|
|
10596
10593
|
);
|
|
10597
10594
|
};
|
|
10595
|
+
const setOpacity = (hex, alpha) => `${hex}${Math.floor(alpha * 255).toString(16).padStart(2, "0")}`;
|
|
10598
10596
|
const ScrollAreaImpl$1 = React__namespace.forwardRef(
|
|
10599
10597
|
({ children, viewportRef, ...restProps }, forwardedRef) => {
|
|
10600
10598
|
return /* @__PURE__ */ jsxRuntime.jsxs(ScrollAreaRoot, { ref: forwardedRef, ...restProps, children: [
|
|
@@ -10649,22 +10647,18 @@ const Thumb = styledComponents.styled(ScrollArea__namespace.Thumb)`
|
|
|
10649
10647
|
min-height: 44px;
|
|
10650
10648
|
}
|
|
10651
10649
|
`;
|
|
10652
|
-
const Root$
|
|
10650
|
+
const Root$3 = Dialog__namespace.Root;
|
|
10653
10651
|
const Trigger$2 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
10654
10652
|
return /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.Trigger, { ...props, asChild: true, ref: forwardedRef });
|
|
10655
10653
|
});
|
|
10656
10654
|
const Content$2 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
10657
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
10658
|
-
/* @__PURE__ */ jsxRuntime.jsx(Overlay, {}),
|
|
10659
|
-
/* @__PURE__ */ jsxRuntime.jsx(ContentImpl, { ref: forwardedRef, ...props })
|
|
10660
|
-
] });
|
|
10655
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(Overlay, { children: /* @__PURE__ */ jsxRuntime.jsx(ContentImpl, { ref: forwardedRef, ...props }) }) });
|
|
10661
10656
|
});
|
|
10662
10657
|
const Overlay = styledComponents.styled(Dialog__namespace.Overlay)`
|
|
10663
|
-
background
|
|
10658
|
+
background: ${(props) => setOpacity(props.theme.colors.neutral800, 0.2)};
|
|
10664
10659
|
position: fixed;
|
|
10665
10660
|
inset: 0;
|
|
10666
10661
|
z-index: ${(props) => props.theme.zIndices.overlay};
|
|
10667
|
-
opacity: 0.2;
|
|
10668
10662
|
|
|
10669
10663
|
@media (prefers-reduced-motion: no-preference) {
|
|
10670
10664
|
animation: ${ANIMATIONS.overlayFadeIn} ${(props) => props.theme.motion.timings["200"]}
|
|
@@ -10673,8 +10667,8 @@ const Overlay = styledComponents.styled(Dialog__namespace.Overlay)`
|
|
|
10673
10667
|
`;
|
|
10674
10668
|
const ContentImpl = styledComponents.styled(Dialog__namespace.Content)`
|
|
10675
10669
|
max-width: 83rem;
|
|
10676
|
-
max-height:
|
|
10677
|
-
height:
|
|
10670
|
+
max-height: 90vh;
|
|
10671
|
+
height: auto;
|
|
10678
10672
|
width: 60%;
|
|
10679
10673
|
overflow: hidden;
|
|
10680
10674
|
margin: 0 auto;
|
|
@@ -10776,7 +10770,7 @@ const Modal = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
10776
10770
|
Content: Content$2,
|
|
10777
10771
|
Footer,
|
|
10778
10772
|
Header,
|
|
10779
|
-
Root: Root$
|
|
10773
|
+
Root: Root$3,
|
|
10780
10774
|
Title,
|
|
10781
10775
|
Trigger: Trigger$2
|
|
10782
10776
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -10963,7 +10957,7 @@ const NextLink = forwardRef(
|
|
|
10963
10957
|
] });
|
|
10964
10958
|
}
|
|
10965
10959
|
);
|
|
10966
|
-
const LinkWrapper = styledComponents.styled(
|
|
10960
|
+
const LinkWrapper = styledComponents.styled(BaseLinkImpl)`
|
|
10967
10961
|
padding: ${({ theme }) => theme.spaces[3]};
|
|
10968
10962
|
border-radius: ${({ theme }) => theme.borderRadius};
|
|
10969
10963
|
box-shadow: ${({ $active, theme }) => $active ? theme.shadows.filterShadow : void 0};
|
|
@@ -11012,7 +11006,7 @@ const Dots = ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsxs(Box, {
|
|
|
11012
11006
|
/* @__PURE__ */ jsxRuntime.jsx(VisuallyHidden, { children }),
|
|
11013
11007
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { "aria-hidden": true, lineHeight: "revert", textColor: "neutral800", variant: "pi", children: "…" })
|
|
11014
11008
|
] });
|
|
11015
|
-
const Root$
|
|
11009
|
+
const Root$2 = Popover__namespace.Root;
|
|
11016
11010
|
const Trigger$1 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
11017
11011
|
return /* @__PURE__ */ jsxRuntime.jsx(Popover__namespace.Trigger, { ...props, asChild: true, ref: forwardedRef });
|
|
11018
11012
|
});
|
|
@@ -11024,6 +11018,7 @@ const PopoverContent = styledComponents.styled(Popover__namespace.Content)`
|
|
|
11024
11018
|
z-index: ${({ theme }) => theme.zIndices.popover};
|
|
11025
11019
|
background-color: ${(props) => props.theme.colors.neutral0};
|
|
11026
11020
|
border: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
11021
|
+
border-radius: ${({ theme }) => theme.borderRadius};
|
|
11027
11022
|
|
|
11028
11023
|
@media (prefers-reduced-motion: no-preference) {
|
|
11029
11024
|
animation-duration: ${(props) => props.theme.motion.timings["200"]};
|
|
@@ -11032,11 +11027,11 @@ const PopoverContent = styledComponents.styled(Popover__namespace.Content)`
|
|
|
11032
11027
|
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
11033
11028
|
|
|
11034
11029
|
&[data-side='top'] {
|
|
11035
|
-
animation-name: ${ANIMATIONS.
|
|
11030
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
11036
11031
|
}
|
|
11037
11032
|
|
|
11038
11033
|
&[data-side='bottom'] {
|
|
11039
|
-
animation-name: ${ANIMATIONS.
|
|
11034
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
11040
11035
|
}
|
|
11041
11036
|
}
|
|
11042
11037
|
|
|
@@ -11044,35 +11039,38 @@ const PopoverContent = styledComponents.styled(Popover__namespace.Content)`
|
|
|
11044
11039
|
animation-timing-function: ${(props) => props.theme.motion.easings.easeOutQuad};
|
|
11045
11040
|
|
|
11046
11041
|
&[data-side='top'] {
|
|
11047
|
-
animation-name: ${ANIMATIONS.
|
|
11042
|
+
animation-name: ${ANIMATIONS.slideUpOut};
|
|
11048
11043
|
}
|
|
11049
11044
|
|
|
11050
11045
|
&[data-side='bottom'] {
|
|
11051
|
-
animation-name: ${ANIMATIONS.
|
|
11046
|
+
animation-name: ${ANIMATIONS.slideDownOut};
|
|
11052
11047
|
}
|
|
11053
11048
|
}
|
|
11054
11049
|
}
|
|
11055
11050
|
`;
|
|
11056
|
-
const ScrollAreaImpl = (
|
|
11057
|
-
|
|
11058
|
-
|
|
11059
|
-
|
|
11060
|
-
|
|
11061
|
-
|
|
11062
|
-
|
|
11063
|
-
|
|
11064
|
-
|
|
11065
|
-
|
|
11066
|
-
|
|
11067
|
-
|
|
11068
|
-
}
|
|
11051
|
+
const ScrollAreaImpl = React__namespace.forwardRef(
|
|
11052
|
+
({ children, intersectionId, onReachEnd, ...props }, forwardedRef) => {
|
|
11053
|
+
const popoverRef = React__namespace.useRef(null);
|
|
11054
|
+
const composedRef = useComposedRefs(popoverRef, forwardedRef);
|
|
11055
|
+
const generatedIntersectionId = useId();
|
|
11056
|
+
useIntersection(popoverRef, onReachEnd ?? (() => {
|
|
11057
|
+
}), {
|
|
11058
|
+
selectorToWatch: `#${stripReactIdOfColon(generatedIntersectionId)}`,
|
|
11059
|
+
skipWhen: !intersectionId || !onReachEnd
|
|
11060
|
+
});
|
|
11061
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(PopoverScrollArea, { ref: composedRef, ...props, children: [
|
|
11062
|
+
children,
|
|
11063
|
+
intersectionId && onReachEnd && /* @__PURE__ */ jsxRuntime.jsx(Box, { id: stripReactIdOfColon(generatedIntersectionId), width: "100%", height: "1px" })
|
|
11064
|
+
] });
|
|
11065
|
+
}
|
|
11066
|
+
);
|
|
11069
11067
|
const PopoverScrollArea = styledComponents.styled(ScrollAreaImpl$1)`
|
|
11070
11068
|
height: 20rem;
|
|
11071
11069
|
`;
|
|
11072
11070
|
const Popover = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11073
11071
|
__proto__: null,
|
|
11074
11072
|
Content: Content$1,
|
|
11075
|
-
Root: Root$
|
|
11073
|
+
Root: Root$2,
|
|
11076
11074
|
ScrollArea: ScrollAreaImpl,
|
|
11077
11075
|
Trigger: Trigger$1
|
|
11078
11076
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -11112,7 +11110,7 @@ const RadioGroupRoot = styledComponents.styled(RadioGroup__namespace.Root)`
|
|
|
11112
11110
|
flex-direction: column;
|
|
11113
11111
|
gap: ${(props) => props.theme.spaces[3]};
|
|
11114
11112
|
`;
|
|
11115
|
-
const Item = React__namespace.forwardRef(({ children, id: idProp, ...restProps }, forwardedRef) => {
|
|
11113
|
+
const Item$1 = React__namespace.forwardRef(({ children, id: idProp, ...restProps }, forwardedRef) => {
|
|
11116
11114
|
const id = useId(idProp);
|
|
11117
11115
|
return /* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap: 2, children: [
|
|
11118
11116
|
/* @__PURE__ */ jsxRuntime.jsx(RadioGroupItem, { id, ref: forwardedRef, ...restProps, children: /* @__PURE__ */ jsxRuntime.jsx(RadioGroupIndicator, {}) }),
|
|
@@ -11181,7 +11179,7 @@ const RadioGroupIndicator = styledComponents.styled(RadioGroup__namespace.Indica
|
|
|
11181
11179
|
const Radio = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11182
11180
|
__proto__: null,
|
|
11183
11181
|
Group,
|
|
11184
|
-
Item
|
|
11182
|
+
Item: Item$1
|
|
11185
11183
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
11186
11184
|
const focusFocusable = (node) => {
|
|
11187
11185
|
const nextNode = node.querySelector('[tabindex="0"]');
|
|
@@ -11197,172 +11195,194 @@ const RawTableContext = React__namespace.createContext({
|
|
|
11197
11195
|
}
|
|
11198
11196
|
});
|
|
11199
11197
|
const useTable = () => React__namespace.useContext(RawTableContext);
|
|
11200
|
-
const RawTable = (
|
|
11201
|
-
colCount,
|
|
11202
|
-
|
|
11203
|
-
|
|
11204
|
-
|
|
11205
|
-
|
|
11206
|
-
|
|
11207
|
-
}) => {
|
|
11208
|
-
|
|
11209
|
-
|
|
11210
|
-
|
|
11211
|
-
|
|
11212
|
-
|
|
11213
|
-
|
|
11214
|
-
setRowIndex(rowIndex2);
|
|
11215
|
-
}, []);
|
|
11216
|
-
React__namespace.useEffect(() => {
|
|
11217
|
-
if (mountedRef.current) {
|
|
11218
|
-
focusFocusable(tableRef.current);
|
|
11219
|
-
}
|
|
11220
|
-
if (!mountedRef.current) {
|
|
11221
|
-
mountedRef.current = true;
|
|
11222
|
-
}
|
|
11223
|
-
}, [colIndex, rowIndex]);
|
|
11224
|
-
const handleKeyDown = (e) => {
|
|
11225
|
-
switch (e.key) {
|
|
11226
|
-
case KeyboardKeys.RIGHT: {
|
|
11227
|
-
e.preventDefault();
|
|
11228
|
-
setColIndex((prevColIndex) => prevColIndex < colCount - 1 ? prevColIndex + 1 : prevColIndex);
|
|
11229
|
-
break;
|
|
11230
|
-
}
|
|
11231
|
-
case KeyboardKeys.LEFT: {
|
|
11232
|
-
e.preventDefault();
|
|
11233
|
-
setColIndex((prevColIndex) => prevColIndex > 0 ? prevColIndex - 1 : prevColIndex);
|
|
11234
|
-
break;
|
|
11235
|
-
}
|
|
11236
|
-
case KeyboardKeys.UP: {
|
|
11237
|
-
e.preventDefault();
|
|
11238
|
-
setRowIndex((prevRowIndex) => prevRowIndex > 0 ? prevRowIndex - 1 : prevRowIndex);
|
|
11239
|
-
break;
|
|
11198
|
+
const RawTable = React__namespace.forwardRef(
|
|
11199
|
+
({ colCount, rowCount, jumpStep = 3, initialCol = 0, initialRow = 0, ...props }, forwardedRef) => {
|
|
11200
|
+
const tableRef = React__namespace.useRef(null);
|
|
11201
|
+
const mountedRef = React__namespace.useRef(false);
|
|
11202
|
+
const composedRef = useComposedRefs(tableRef, forwardedRef);
|
|
11203
|
+
const [rowIndex, setRowIndex] = React__namespace.useState(initialRow);
|
|
11204
|
+
const [colIndex, setColIndex] = React__namespace.useState(initialCol);
|
|
11205
|
+
const setTableValues = React__namespace.useCallback(({ colIndex: colIndex2, rowIndex: rowIndex2 }) => {
|
|
11206
|
+
setColIndex(colIndex2);
|
|
11207
|
+
setRowIndex(rowIndex2);
|
|
11208
|
+
}, []);
|
|
11209
|
+
React__namespace.useEffect(() => {
|
|
11210
|
+
if (mountedRef.current) {
|
|
11211
|
+
focusFocusable(tableRef.current);
|
|
11240
11212
|
}
|
|
11241
|
-
|
|
11242
|
-
|
|
11243
|
-
setRowIndex((prevRowIndex) => prevRowIndex < rowCount - 1 ? prevRowIndex + 1 : prevRowIndex);
|
|
11244
|
-
break;
|
|
11213
|
+
if (!mountedRef.current) {
|
|
11214
|
+
mountedRef.current = true;
|
|
11245
11215
|
}
|
|
11246
|
-
|
|
11247
|
-
|
|
11248
|
-
|
|
11249
|
-
|
|
11216
|
+
}, [colIndex, rowIndex]);
|
|
11217
|
+
const handleKeyDown = (e) => {
|
|
11218
|
+
switch (e.key) {
|
|
11219
|
+
case KeyboardKeys.RIGHT: {
|
|
11220
|
+
e.preventDefault();
|
|
11221
|
+
setColIndex((prevColIndex) => prevColIndex < colCount - 1 ? prevColIndex + 1 : prevColIndex);
|
|
11222
|
+
break;
|
|
11250
11223
|
}
|
|
11251
|
-
|
|
11252
|
-
|
|
11253
|
-
|
|
11254
|
-
|
|
11255
|
-
|
|
11256
|
-
|
|
11257
|
-
|
|
11224
|
+
case KeyboardKeys.LEFT: {
|
|
11225
|
+
e.preventDefault();
|
|
11226
|
+
setColIndex((prevColIndex) => prevColIndex > 0 ? prevColIndex - 1 : prevColIndex);
|
|
11227
|
+
break;
|
|
11228
|
+
}
|
|
11229
|
+
case KeyboardKeys.UP: {
|
|
11230
|
+
e.preventDefault();
|
|
11231
|
+
setRowIndex((prevRowIndex) => prevRowIndex > 0 ? prevRowIndex - 1 : prevRowIndex);
|
|
11232
|
+
break;
|
|
11233
|
+
}
|
|
11234
|
+
case KeyboardKeys.DOWN: {
|
|
11235
|
+
e.preventDefault();
|
|
11236
|
+
setRowIndex((prevRowIndex) => prevRowIndex < rowCount - 1 ? prevRowIndex + 1 : prevRowIndex);
|
|
11237
|
+
break;
|
|
11238
|
+
}
|
|
11239
|
+
case KeyboardKeys.HOME: {
|
|
11240
|
+
e.preventDefault();
|
|
11241
|
+
if (e.ctrlKey) {
|
|
11242
|
+
setRowIndex(0);
|
|
11243
|
+
}
|
|
11244
|
+
setColIndex(0);
|
|
11245
|
+
break;
|
|
11246
|
+
}
|
|
11247
|
+
case KeyboardKeys.END: {
|
|
11248
|
+
e.preventDefault();
|
|
11249
|
+
if (e.ctrlKey) {
|
|
11250
|
+
setRowIndex(rowCount - 1);
|
|
11251
|
+
}
|
|
11252
|
+
setColIndex(colCount - 1);
|
|
11253
|
+
break;
|
|
11254
|
+
}
|
|
11255
|
+
case KeyboardKeys.PAGE_DOWN: {
|
|
11256
|
+
e.preventDefault();
|
|
11257
|
+
setRowIndex((prevRowIndex) => prevRowIndex + jumpStep < rowCount ? prevRowIndex + jumpStep : rowCount - 1);
|
|
11258
|
+
break;
|
|
11259
|
+
}
|
|
11260
|
+
case KeyboardKeys.PAGE_UP: {
|
|
11261
|
+
e.preventDefault();
|
|
11262
|
+
setRowIndex((prevRowIndex) => prevRowIndex - jumpStep > 0 ? prevRowIndex - jumpStep : 0);
|
|
11263
|
+
break;
|
|
11258
11264
|
}
|
|
11259
|
-
setColIndex(colCount - 1);
|
|
11260
|
-
break;
|
|
11261
|
-
}
|
|
11262
|
-
case KeyboardKeys.PAGE_DOWN: {
|
|
11263
|
-
e.preventDefault();
|
|
11264
|
-
setRowIndex((prevRowIndex) => prevRowIndex + jumpStep < rowCount ? prevRowIndex + jumpStep : rowCount - 1);
|
|
11265
|
-
break;
|
|
11266
11265
|
}
|
|
11267
|
-
|
|
11268
|
-
|
|
11269
|
-
|
|
11270
|
-
|
|
11266
|
+
};
|
|
11267
|
+
const context = React__namespace.useMemo(() => ({ rowIndex, colIndex, setTableValues }), [colIndex, rowIndex, setTableValues]);
|
|
11268
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RawTableContext.Provider, { value: context, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11269
|
+
"table",
|
|
11270
|
+
{
|
|
11271
|
+
role: "grid",
|
|
11272
|
+
ref: composedRef,
|
|
11273
|
+
"aria-rowcount": rowCount,
|
|
11274
|
+
"aria-colcount": colCount,
|
|
11275
|
+
onKeyDown: handleKeyDown,
|
|
11276
|
+
...props
|
|
11271
11277
|
}
|
|
11272
|
-
}
|
|
11273
|
-
}
|
|
11274
|
-
|
|
11275
|
-
|
|
11276
|
-
|
|
11277
|
-
|
|
11278
|
-
|
|
11279
|
-
|
|
11280
|
-
|
|
11281
|
-
|
|
11282
|
-
|
|
11283
|
-
|
|
11284
|
-
|
|
11285
|
-
|
|
11278
|
+
) });
|
|
11279
|
+
}
|
|
11280
|
+
);
|
|
11281
|
+
const getFocusableNodes = (node, includeNegativeTabIndex) => {
|
|
11282
|
+
const nodes = [
|
|
11283
|
+
...node.querySelectorAll(
|
|
11284
|
+
'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
|
|
11285
|
+
)
|
|
11286
|
+
];
|
|
11287
|
+
const focusables = nodes.filter((node2) => {
|
|
11288
|
+
if (node2.hasAttribute("disabled"))
|
|
11289
|
+
return false;
|
|
11290
|
+
if (includeNegativeTabIndex)
|
|
11291
|
+
return true;
|
|
11292
|
+
return node2.getAttribute("tabindex") !== "-1";
|
|
11293
|
+
});
|
|
11294
|
+
return focusables;
|
|
11286
11295
|
};
|
|
11287
|
-
const
|
|
11288
|
-
|
|
11289
|
-
|
|
11290
|
-
|
|
11291
|
-
const handleKeyDown = (e) => {
|
|
11292
|
-
const focusableNodes = getFocusableNodes(tdRef.current, true);
|
|
11293
|
-
if (focusableNodes.length === 0 || focusableNodes.length === 1 && getFocusableNodesWithKeyboardNav(focusableNodes).length === 0) {
|
|
11294
|
-
return;
|
|
11296
|
+
const getFocusableNodesWithKeyboardNav = (nodes) => {
|
|
11297
|
+
return nodes.filter((node) => {
|
|
11298
|
+
if (node.tagName === "INPUT") {
|
|
11299
|
+
return node.type !== "checkbox" && node.type !== "radio";
|
|
11295
11300
|
}
|
|
11296
|
-
|
|
11297
|
-
|
|
11298
|
-
|
|
11299
|
-
|
|
11300
|
-
|
|
11301
|
-
|
|
11302
|
-
|
|
11303
|
-
|
|
11304
|
-
|
|
11305
|
-
|
|
11306
|
-
|
|
11307
|
-
|
|
11308
|
-
|
|
11309
|
-
nextNode.focus();
|
|
11310
|
-
}
|
|
11301
|
+
return false;
|
|
11302
|
+
});
|
|
11303
|
+
};
|
|
11304
|
+
const RawTd = React__namespace.forwardRef(
|
|
11305
|
+
({ coords = { col: 0, row: 0 }, tag = "td", ...props }, forwardedRef) => {
|
|
11306
|
+
const tdRef = React__namespace.useRef(null);
|
|
11307
|
+
const composedRef = useComposedRefs(forwardedRef, tdRef);
|
|
11308
|
+
const { rowIndex, colIndex, setTableValues } = useTable();
|
|
11309
|
+
const [isActive, setIsActive] = React__namespace.useState(false);
|
|
11310
|
+
const handleKeyDown = (e) => {
|
|
11311
|
+
const focusableNodes = getFocusableNodes(tdRef.current, true);
|
|
11312
|
+
if (focusableNodes.length === 0 || focusableNodes.length === 1 && getFocusableNodesWithKeyboardNav(focusableNodes).length === 0) {
|
|
11313
|
+
return;
|
|
11311
11314
|
}
|
|
11312
|
-
|
|
11313
|
-
|
|
11314
|
-
|
|
11315
|
-
|
|
11316
|
-
|
|
11317
|
-
|
|
11318
|
-
|
|
11315
|
+
if (focusableNodes.length > 1 && !focusableNodes.find((node) => node.tagName !== "BUTTON")) {
|
|
11316
|
+
e.preventDefault();
|
|
11317
|
+
const focussedButtonIndex = focusableNodes.findIndex((node) => node === document.activeElement);
|
|
11318
|
+
if (e.key === KeyboardKeys.RIGHT) {
|
|
11319
|
+
const nextNode = focusableNodes[focussedButtonIndex + 1];
|
|
11320
|
+
if (nextNode) {
|
|
11321
|
+
e.stopPropagation();
|
|
11322
|
+
nextNode.focus();
|
|
11323
|
+
}
|
|
11324
|
+
} else if (e.key === KeyboardKeys.LEFT) {
|
|
11325
|
+
const nextNode = focusableNodes[focussedButtonIndex - 1];
|
|
11326
|
+
if (nextNode) {
|
|
11327
|
+
e.stopPropagation();
|
|
11328
|
+
nextNode.focus();
|
|
11329
|
+
}
|
|
11330
|
+
}
|
|
11319
11331
|
return;
|
|
11320
11332
|
}
|
|
11321
|
-
|
|
11322
|
-
|
|
11323
|
-
|
|
11324
|
-
e.
|
|
11325
|
-
|
|
11326
|
-
|
|
11327
|
-
const isFocused = rowIndex === coords.row - 1 && colIndex === coords.col - 1;
|
|
11328
|
-
useIsomorphicLayoutEffect(() => {
|
|
11329
|
-
const focusableNodes = getFocusableNodes(tdRef.current, true);
|
|
11330
|
-
if (focusableNodes.length === 0 || focusableNodes.length === 1 && getFocusableNodesWithKeyboardNav(focusableNodes).length !== 0 || focusableNodes.length > 1 && Boolean(focusableNodes.find((node) => node.tagName !== "BUTTON"))) {
|
|
11331
|
-
tdRef.current.setAttribute("tabIndex", !isActive && isFocused ? "0" : "-1");
|
|
11332
|
-
focusableNodes.forEach((node, index) => {
|
|
11333
|
-
node.setAttribute("tabIndex", isActive ? "0" : "-1");
|
|
11334
|
-
if (isActive && index === 0) {
|
|
11335
|
-
node.focus();
|
|
11333
|
+
const isEnterKey = e.key === KeyboardKeys.ENTER;
|
|
11334
|
+
if (isEnterKey && !isActive) {
|
|
11335
|
+
setIsActive(true);
|
|
11336
|
+
} else if ((e.key === KeyboardKeys.ESCAPE || isEnterKey) && isActive) {
|
|
11337
|
+
if (isEnterKey && document.activeElement?.tagName === "A") {
|
|
11338
|
+
return;
|
|
11336
11339
|
}
|
|
11337
|
-
|
|
11338
|
-
|
|
11340
|
+
setIsActive(false);
|
|
11341
|
+
tdRef.current.focus();
|
|
11342
|
+
} else if (isActive) {
|
|
11343
|
+
e.stopPropagation();
|
|
11344
|
+
}
|
|
11345
|
+
};
|
|
11346
|
+
const isFocused = rowIndex === coords.row - 1 && colIndex === coords.col - 1;
|
|
11347
|
+
useIsomorphicLayoutEffect(() => {
|
|
11348
|
+
const focusableNodes = getFocusableNodes(tdRef.current, true);
|
|
11349
|
+
if (focusableNodes.length === 0 || focusableNodes.length === 1 && getFocusableNodesWithKeyboardNav(focusableNodes).length !== 0 || focusableNodes.length > 1 && Boolean(focusableNodes.find((node) => node.tagName !== "BUTTON"))) {
|
|
11350
|
+
tdRef.current.setAttribute("tabIndex", !isActive && isFocused ? "0" : "-1");
|
|
11351
|
+
focusableNodes.forEach((node, index) => {
|
|
11352
|
+
node.setAttribute("tabIndex", isActive ? "0" : "-1");
|
|
11353
|
+
if (isActive && index === 0) {
|
|
11354
|
+
node.focus();
|
|
11355
|
+
}
|
|
11356
|
+
});
|
|
11357
|
+
} else {
|
|
11358
|
+
focusableNodes.forEach((node) => {
|
|
11359
|
+
node.setAttribute("tabIndex", isFocused ? "0" : "-1");
|
|
11360
|
+
});
|
|
11361
|
+
}
|
|
11362
|
+
}, [isActive, isFocused]);
|
|
11363
|
+
const handleFocusableNodeFocus = React__namespace.useCallback(() => {
|
|
11364
|
+
const focusableNodes = getFocusableNodes(tdRef.current, true);
|
|
11365
|
+
if (focusableNodes.length >= 1 && (getFocusableNodesWithKeyboardNav(focusableNodes).length !== 0 || !focusableNodes.find((node) => node.tagName !== "BUTTON"))) {
|
|
11366
|
+
setIsActive(true);
|
|
11367
|
+
}
|
|
11368
|
+
setTableValues({ rowIndex: coords.row - 1, colIndex: coords.col - 1 });
|
|
11369
|
+
}, [coords, setTableValues]);
|
|
11370
|
+
useIsomorphicLayoutEffect(() => {
|
|
11371
|
+
const cell = tdRef.current;
|
|
11372
|
+
const focusableNodes = getFocusableNodes(cell, true);
|
|
11339
11373
|
focusableNodes.forEach((node) => {
|
|
11340
|
-
node.
|
|
11374
|
+
node.addEventListener("focus", handleFocusableNodeFocus);
|
|
11341
11375
|
});
|
|
11342
|
-
|
|
11343
|
-
|
|
11344
|
-
|
|
11345
|
-
|
|
11346
|
-
|
|
11347
|
-
|
|
11348
|
-
}
|
|
11349
|
-
|
|
11350
|
-
}
|
|
11351
|
-
|
|
11352
|
-
const cell = tdRef.current;
|
|
11353
|
-
const focusableNodes = getFocusableNodes(cell, true);
|
|
11354
|
-
focusableNodes.forEach((node) => {
|
|
11355
|
-
node.addEventListener("focus", handleFocusableNodeFocus);
|
|
11356
|
-
});
|
|
11357
|
-
return () => {
|
|
11358
|
-
const focusableNodes2 = getFocusableNodes(cell, true);
|
|
11359
|
-
focusableNodes2.forEach((node) => {
|
|
11360
|
-
node.removeEventListener("focus", handleFocusableNodeFocus);
|
|
11361
|
-
});
|
|
11362
|
-
};
|
|
11363
|
-
}, [handleFocusableNodeFocus]);
|
|
11364
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Box, { role: "gridcell", tag, ref: tdRef, onKeyDown: handleKeyDown, ...props });
|
|
11365
|
-
};
|
|
11376
|
+
return () => {
|
|
11377
|
+
const focusableNodes2 = getFocusableNodes(cell, true);
|
|
11378
|
+
focusableNodes2.forEach((node) => {
|
|
11379
|
+
node.removeEventListener("focus", handleFocusableNodeFocus);
|
|
11380
|
+
});
|
|
11381
|
+
};
|
|
11382
|
+
}, [handleFocusableNodeFocus]);
|
|
11383
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { role: "gridcell", tag, ref: composedRef, onKeyDown: handleKeyDown, ...props });
|
|
11384
|
+
}
|
|
11385
|
+
);
|
|
11366
11386
|
const RawTh = (props) => /* @__PURE__ */ jsxRuntime.jsx(RawTd, { ...props, tag: "th" });
|
|
11367
11387
|
const RawThead = ({ children, ...props }) => {
|
|
11368
11388
|
const childrenClone = React__namespace.Children.toArray(children).map((child) => {
|
|
@@ -11413,14 +11433,18 @@ const SearchbarWrapper = styledComponents.styled.div`
|
|
|
11413
11433
|
&:focus-within {
|
|
11414
11434
|
${SearchIcon} {
|
|
11415
11435
|
fill: ${({ theme }) => theme.colors.primary600};
|
|
11416
|
-
path {
|
|
11417
|
-
}
|
|
11418
11436
|
}
|
|
11419
11437
|
}
|
|
11420
11438
|
`;
|
|
11421
11439
|
const SearchbarInput = styledComponents.styled(Input$2)`
|
|
11422
11440
|
border: 1px solid transparent;
|
|
11423
11441
|
|
|
11442
|
+
&:hover {
|
|
11443
|
+
button {
|
|
11444
|
+
cursor: pointer;
|
|
11445
|
+
}
|
|
11446
|
+
}
|
|
11447
|
+
|
|
11424
11448
|
${inputFocusStyle()}
|
|
11425
11449
|
`;
|
|
11426
11450
|
const Searchbar = React__namespace.forwardRef(
|
|
@@ -11440,7 +11464,17 @@ const Searchbar = React__namespace.forwardRef(
|
|
|
11440
11464
|
ref: actualRef,
|
|
11441
11465
|
value,
|
|
11442
11466
|
startAction: /* @__PURE__ */ jsxRuntime.jsx(SearchIcon, { "aria-hidden": true }),
|
|
11443
|
-
endAction: isCompleting ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11467
|
+
endAction: isCompleting ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11468
|
+
Action$1,
|
|
11469
|
+
{
|
|
11470
|
+
label: clearLabel,
|
|
11471
|
+
onClick: handleClear,
|
|
11472
|
+
onMouseDown: (e) => {
|
|
11473
|
+
e.preventDefault();
|
|
11474
|
+
},
|
|
11475
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, {})
|
|
11476
|
+
}
|
|
11477
|
+
) : void 0,
|
|
11444
11478
|
...props
|
|
11445
11479
|
}
|
|
11446
11480
|
)
|
|
@@ -11448,47 +11482,60 @@ const Searchbar = React__namespace.forwardRef(
|
|
|
11448
11482
|
}
|
|
11449
11483
|
);
|
|
11450
11484
|
const SearchForm = (props) => /* @__PURE__ */ jsxRuntime.jsx("form", { ...props, role: "search" });
|
|
11451
|
-
const
|
|
11485
|
+
const ButtonBox$1 = styledComponents.styled(Box)`
|
|
11486
|
+
display: inline-flex;
|
|
11487
|
+
border: none;
|
|
11488
|
+
|
|
11489
|
+
& > svg {
|
|
11490
|
+
height: 1.2rem;
|
|
11491
|
+
width: 1.2rem;
|
|
11492
|
+
}
|
|
11493
|
+
|
|
11494
|
+
& > svg path {
|
|
11495
|
+
fill: ${({ theme, ...p }) => p["aria-disabled"] ? theme.colors.neutral600 : theme.colors.primary600};
|
|
11496
|
+
}
|
|
11497
|
+
|
|
11498
|
+
&:hover {
|
|
11499
|
+
cursor: ${({ $iconAction }) => $iconAction ? "pointer" : "initial"};
|
|
11500
|
+
}
|
|
11501
|
+
`;
|
|
11502
|
+
const Tag = ({ children, icon, label, disabled = false, onClick, ...props }) => {
|
|
11452
11503
|
const handleClick = (e) => {
|
|
11453
11504
|
if (disabled || !onClick)
|
|
11454
11505
|
return;
|
|
11455
11506
|
onClick(e);
|
|
11456
11507
|
};
|
|
11457
11508
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11458
|
-
|
|
11509
|
+
Flex,
|
|
11459
11510
|
{
|
|
11460
|
-
|
|
11511
|
+
inline: true,
|
|
11461
11512
|
background: disabled ? "neutral200" : "primary100",
|
|
11462
11513
|
color: disabled ? "neutral700" : "primary600",
|
|
11463
11514
|
paddingLeft: 3,
|
|
11464
|
-
paddingRight:
|
|
11465
|
-
onClick: handleClick,
|
|
11466
|
-
"aria-disabled": disabled,
|
|
11467
|
-
disabled,
|
|
11468
|
-
borderWidth: "1px",
|
|
11469
|
-
borderStyle: "solid",
|
|
11515
|
+
paddingRight: 1,
|
|
11470
11516
|
borderColor: disabled ? "neutral300" : "primary200",
|
|
11471
11517
|
hasRadius: true,
|
|
11472
11518
|
height: "3.2rem",
|
|
11473
|
-
gap: 2,
|
|
11474
11519
|
...props,
|
|
11475
11520
|
children: [
|
|
11476
11521
|
/* @__PURE__ */ jsxRuntime.jsx(TagText, { $disabled: disabled, variant: "pi", fontWeight: "bold", children }),
|
|
11477
|
-
|
|
11522
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11523
|
+
ButtonBox$1,
|
|
11524
|
+
{
|
|
11525
|
+
tag: "button",
|
|
11526
|
+
disabled,
|
|
11527
|
+
"aria-disabled": disabled,
|
|
11528
|
+
"aria-label": label,
|
|
11529
|
+
padding: 2,
|
|
11530
|
+
onClick: handleClick,
|
|
11531
|
+
$iconAction: !!onClick,
|
|
11532
|
+
children: icon
|
|
11533
|
+
}
|
|
11534
|
+
)
|
|
11478
11535
|
]
|
|
11479
11536
|
}
|
|
11480
11537
|
);
|
|
11481
11538
|
};
|
|
11482
|
-
const TagWrapper = styledComponents.styled(Flex)`
|
|
11483
|
-
& > svg {
|
|
11484
|
-
height: 0.8rem;
|
|
11485
|
-
width: 0.8rem;
|
|
11486
|
-
}
|
|
11487
|
-
|
|
11488
|
-
& > svg path {
|
|
11489
|
-
fill: ${({ theme, ...p }) => p["aria-disabled"] ? theme.colors.neutral600 : theme.colors.primary600};
|
|
11490
|
-
}
|
|
11491
|
-
`;
|
|
11492
11539
|
const TagText = styledComponents.styled(Typography)`
|
|
11493
11540
|
color: inherit;
|
|
11494
11541
|
border-right: 1px solid ${({ theme, $disabled }) => $disabled ? theme.colors.neutral300 : theme.colors.primary200};
|
|
@@ -11554,7 +11601,17 @@ const MultiSelect = React__namespace.forwardRef(
|
|
|
11554
11601
|
const value = typeof passedValue !== "undefined" && passedValue !== null ? passedValue : internalValue;
|
|
11555
11602
|
const renderTags = (arg) => {
|
|
11556
11603
|
if (arg && typeof arg === "object" && arg.value) {
|
|
11557
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11604
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11605
|
+
Tag,
|
|
11606
|
+
{
|
|
11607
|
+
tabIndex: -1,
|
|
11608
|
+
disabled,
|
|
11609
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.Cross, { width: `${14 / 16}rem`, height: `${14 / 16}rem` }),
|
|
11610
|
+
onClick: handleTagClick(arg.value),
|
|
11611
|
+
children: arg.textValue
|
|
11612
|
+
},
|
|
11613
|
+
arg.value
|
|
11614
|
+
);
|
|
11558
11615
|
}
|
|
11559
11616
|
return null;
|
|
11560
11617
|
};
|
|
@@ -11703,7 +11760,8 @@ const SubNavHeader = ({
|
|
|
11703
11760
|
},
|
|
11704
11761
|
onSubmit = () => {
|
|
11705
11762
|
},
|
|
11706
|
-
id
|
|
11763
|
+
id,
|
|
11764
|
+
placeholder
|
|
11707
11765
|
}) => {
|
|
11708
11766
|
const [isSearchOpen, setSearchOpen] = React__namespace.useState(false);
|
|
11709
11767
|
const previousSearchOpenValue = uiPrimitives.usePrev(isSearchOpen);
|
|
@@ -11743,7 +11801,7 @@ const SubNavHeader = ({
|
|
|
11743
11801
|
name: "searchbar",
|
|
11744
11802
|
value,
|
|
11745
11803
|
onChange,
|
|
11746
|
-
placeholder
|
|
11804
|
+
placeholder,
|
|
11747
11805
|
onKeyDown: handleKeyDown,
|
|
11748
11806
|
ref: searchRef,
|
|
11749
11807
|
onBlur: handleBlur,
|
|
@@ -11757,7 +11815,7 @@ const SubNavHeader = ({
|
|
|
11757
11815
|
] });
|
|
11758
11816
|
}
|
|
11759
11817
|
return /* @__PURE__ */ jsxRuntime.jsxs(Flex, { direction: "column", alignItems: "flex-start", paddingLeft: 6, paddingTop: 6, paddingBottom: 2, paddingRight: 4, children: [
|
|
11760
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Flex, { justifyContent: "space-between", alignItems: "flex-start", children: [
|
|
11818
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Flex, { justifyContent: "space-between", alignItems: "flex-start", width: "100%", gap: 2, children: [
|
|
11761
11819
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "beta", tag, children: label }),
|
|
11762
11820
|
searchable && /* @__PURE__ */ jsxRuntime.jsx(IconButton, { ref: searchButtonRef, onClick: toggleSearch, label: searchLabel, children: /* @__PURE__ */ jsxRuntime.jsx(icons.Search, {}) })
|
|
11763
11821
|
] }),
|
|
@@ -11792,7 +11850,7 @@ const CustomBullet = styledComponents.styled.span`
|
|
|
11792
11850
|
background-color: ${({ theme, $active }) => $active ? theme.colors.primary600 : theme.colors.neutral600};
|
|
11793
11851
|
border-radius: 50%;
|
|
11794
11852
|
`;
|
|
11795
|
-
const SubNavLinkWrapper = styledComponents.styled(
|
|
11853
|
+
const SubNavLinkWrapper = styledComponents.styled(BaseLinkImpl)`
|
|
11796
11854
|
display: flex;
|
|
11797
11855
|
align-items: center;
|
|
11798
11856
|
justify-content: space-between;
|
|
@@ -12032,7 +12090,7 @@ const LabelTypography = styledComponents.styled(Typography)`
|
|
|
12032
12090
|
}
|
|
12033
12091
|
`;
|
|
12034
12092
|
const [TabsProvider, useTabs] = createContext("Tabs");
|
|
12035
|
-
const Root = React__namespace.forwardRef(
|
|
12093
|
+
const Root$1 = React__namespace.forwardRef(
|
|
12036
12094
|
({ disabled = false, variant: variant2 = "regular", hasError, ...props }, forwardedRef) => {
|
|
12037
12095
|
return /* @__PURE__ */ jsxRuntime.jsx(TabsProvider, { disabled, hasError, variant: variant2, children: /* @__PURE__ */ jsxRuntime.jsx(TabsRoot, { ref: forwardedRef, ...props }) });
|
|
12038
12096
|
}
|
|
@@ -12071,10 +12129,6 @@ const TabBar = styledComponents.styled.span`
|
|
|
12071
12129
|
left: 0;
|
|
12072
12130
|
opacity: 0;
|
|
12073
12131
|
height: 0.2rem;
|
|
12074
|
-
|
|
12075
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
12076
|
-
transition: ${(props) => `opacity 200ms ${props.theme.motion.easings.authenticMotion}`};
|
|
12077
|
-
}
|
|
12078
12132
|
`;
|
|
12079
12133
|
const TriggerTypography = styledComponents.styled(Typography)``;
|
|
12080
12134
|
const TabsTrigger = styledComponents.styled(Tabs__namespace.Trigger)`
|
|
@@ -12128,10 +12182,6 @@ const TabsTrigger = styledComponents.styled(Tabs__namespace.Trigger)`
|
|
|
12128
12182
|
}
|
|
12129
12183
|
}}
|
|
12130
12184
|
|
|
12131
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
12132
|
-
transition: ${(props) => `${props.theme.transitions.color}, ${props.theme.transitions.backgroundColor}, box-shadow ${props.theme.motion.timings["120"]} ${props.theme.motion.easings.easeOutQuad}`};
|
|
12133
|
-
}
|
|
12134
|
-
|
|
12135
12185
|
&[data-disabled] {
|
|
12136
12186
|
cursor: not-allowed;
|
|
12137
12187
|
color: ${(props) => props.theme.colors.neutral400};
|
|
@@ -12158,7 +12208,7 @@ const Tabs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
|
|
|
12158
12208
|
__proto__: null,
|
|
12159
12209
|
Content,
|
|
12160
12210
|
List,
|
|
12161
|
-
Root,
|
|
12211
|
+
Root: Root$1,
|
|
12162
12212
|
Trigger
|
|
12163
12213
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
12164
12214
|
const TableContainer = styledComponents.styled(Box)`
|
|
@@ -12198,7 +12248,7 @@ const TableBox = styledComponents.styled(Box)`
|
|
|
12198
12248
|
const ScrollContainer = styledComponents.styled(Box)`
|
|
12199
12249
|
overflow-x: auto;
|
|
12200
12250
|
`;
|
|
12201
|
-
const Table = ({ footer, ...props }) => {
|
|
12251
|
+
const Table = React__namespace.forwardRef(({ footer, ...props }, forwardedRef) => {
|
|
12202
12252
|
const tableRef = React__namespace.useRef(null);
|
|
12203
12253
|
const [overflowing, setOverflowing] = React__namespace.useState();
|
|
12204
12254
|
const handleScroll = (e) => {
|
|
@@ -12221,10 +12271,10 @@ const Table = ({ footer, ...props }) => {
|
|
|
12221
12271
|
}
|
|
12222
12272
|
}, []);
|
|
12223
12273
|
return /* @__PURE__ */ jsxRuntime.jsxs(TableContainer, { shadow: "tableShadow", hasRadius: true, background: "neutral0", children: [
|
|
12224
|
-
/* @__PURE__ */ jsxRuntime.jsx(TableBox, { $overflowing: overflowing, position: "relative", children: /* @__PURE__ */ jsxRuntime.jsx(ScrollContainer, { ref: tableRef, onScroll: handleScroll, paddingLeft: 6, paddingRight: 6, children: /* @__PURE__ */ jsxRuntime.jsx(TableWrapper, { ...props }) }) }),
|
|
12274
|
+
/* @__PURE__ */ jsxRuntime.jsx(TableBox, { $overflowing: overflowing, position: "relative", children: /* @__PURE__ */ jsxRuntime.jsx(ScrollContainer, { ref: tableRef, onScroll: handleScroll, paddingLeft: 6, paddingRight: 6, children: /* @__PURE__ */ jsxRuntime.jsx(TableWrapper, { ref: forwardedRef, ...props }) }) }),
|
|
12225
12275
|
footer
|
|
12226
12276
|
] });
|
|
12227
|
-
};
|
|
12277
|
+
});
|
|
12228
12278
|
const TbodyWrapper = styledComponents.styled(RawTbody)`
|
|
12229
12279
|
& tr:last-of-type {
|
|
12230
12280
|
border-bottom: none;
|
|
@@ -12265,7 +12315,6 @@ const Tr = (props) => {
|
|
|
12265
12315
|
const CellWrapper = styledComponents.styled(RawTd)`
|
|
12266
12316
|
vertical-align: middle;
|
|
12267
12317
|
text-align: left;
|
|
12268
|
-
color: ${({ theme }) => theme.colors.neutral600};
|
|
12269
12318
|
outline-offset: -4px;
|
|
12270
12319
|
|
|
12271
12320
|
/**
|
|
@@ -12275,15 +12324,15 @@ const CellWrapper = styledComponents.styled(RawTd)`
|
|
|
12275
12324
|
vertical-align: sub;
|
|
12276
12325
|
}
|
|
12277
12326
|
`;
|
|
12278
|
-
const Th = ({ children, action, ...props }) => {
|
|
12279
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CellWrapper, { as: RawTh, ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { children: [
|
|
12327
|
+
const Th = React__namespace.forwardRef(({ children, action, ...props }, forwardedRef) => {
|
|
12328
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CellWrapper, { color: "neutral600", as: RawTh, ref: forwardedRef, ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { children: [
|
|
12280
12329
|
children,
|
|
12281
12330
|
action
|
|
12282
12331
|
] }) });
|
|
12283
|
-
};
|
|
12284
|
-
const Td = ({ children, ...props }) => {
|
|
12285
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CellWrapper, { ...props, children });
|
|
12286
|
-
};
|
|
12332
|
+
});
|
|
12333
|
+
const Td = React__namespace.forwardRef(({ children, ...props }, forwardedRef) => {
|
|
12334
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CellWrapper, { color: "neutral800", ref: forwardedRef, ...props, children });
|
|
12335
|
+
});
|
|
12287
12336
|
const IconBox = styledComponents.styled(Box)`
|
|
12288
12337
|
height: 2.4rem;
|
|
12289
12338
|
width: 2.4rem;
|
|
@@ -12316,6 +12365,28 @@ const TFooter = ({ children, icon, ...props }) => {
|
|
|
12316
12365
|
] }) })
|
|
12317
12366
|
] });
|
|
12318
12367
|
};
|
|
12368
|
+
const TextButton = forwardRef(
|
|
12369
|
+
({ children, startIcon, endIcon, disabled = false, loading = false, ...props }, ref) => {
|
|
12370
|
+
const isDisabled = disabled || loading;
|
|
12371
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12372
|
+
TextButtonWrapper,
|
|
12373
|
+
{
|
|
12374
|
+
ref,
|
|
12375
|
+
disabled: isDisabled,
|
|
12376
|
+
"aria-disabled": isDisabled,
|
|
12377
|
+
tag: "button",
|
|
12378
|
+
type: "button",
|
|
12379
|
+
gap: 2,
|
|
12380
|
+
...props,
|
|
12381
|
+
children: [
|
|
12382
|
+
loading ? /* @__PURE__ */ jsxRuntime.jsx(LoadingWrapper, { "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx(icons.Loader, {}) }) : startIcon,
|
|
12383
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "pi", children }),
|
|
12384
|
+
endIcon
|
|
12385
|
+
]
|
|
12386
|
+
}
|
|
12387
|
+
);
|
|
12388
|
+
}
|
|
12389
|
+
);
|
|
12319
12390
|
const rotation = styledComponents.keyframes`
|
|
12320
12391
|
from {
|
|
12321
12392
|
transform: rotate(0deg);
|
|
@@ -12324,51 +12395,24 @@ const rotation = styledComponents.keyframes`
|
|
|
12324
12395
|
transform: rotate(359deg);
|
|
12325
12396
|
}
|
|
12326
12397
|
`;
|
|
12327
|
-
const LoadingWrapper = styledComponents.styled.
|
|
12398
|
+
const LoadingWrapper = styledComponents.styled.span`
|
|
12399
|
+
display: flex;
|
|
12328
12400
|
animation: ${rotation} 2s infinite linear;
|
|
12329
12401
|
will-change: transform;
|
|
12330
12402
|
`;
|
|
12331
12403
|
const TextButtonWrapper = styledComponents.styled(Flex)`
|
|
12332
12404
|
border: none;
|
|
12405
|
+
background-color: transparent;
|
|
12406
|
+
color: ${(props) => props.theme.colors.primary600};
|
|
12407
|
+
cursor: pointer;
|
|
12333
12408
|
|
|
12334
12409
|
&[aria-disabled='true'] {
|
|
12335
12410
|
pointer-events: none;
|
|
12336
|
-
|
|
12337
|
-
fill: ${({ theme }) => theme.colors.neutral600};
|
|
12338
|
-
}
|
|
12339
|
-
}
|
|
12340
|
-
|
|
12341
|
-
svg path {
|
|
12342
|
-
fill: ${({ theme }) => theme.colors.primary600};
|
|
12411
|
+
color: ${(props) => props.theme.colors.neutral600};
|
|
12343
12412
|
}
|
|
12344
12413
|
|
|
12345
12414
|
${focus}
|
|
12346
12415
|
`;
|
|
12347
|
-
const TextButton = React__namespace.forwardRef(
|
|
12348
|
-
({ children, startIcon, endIcon, onClick, disabled = false, loading = false, ...props }, ref) => {
|
|
12349
|
-
const handleClick = onClick && !disabled ? onClick : void 0;
|
|
12350
|
-
const isDisabled = disabled || loading;
|
|
12351
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12352
|
-
TextButtonWrapper,
|
|
12353
|
-
{
|
|
12354
|
-
ref,
|
|
12355
|
-
"aria-disabled": isDisabled,
|
|
12356
|
-
onClick: handleClick,
|
|
12357
|
-
tag: "button",
|
|
12358
|
-
type: "button",
|
|
12359
|
-
background: "transparent",
|
|
12360
|
-
gap: 2,
|
|
12361
|
-
...props,
|
|
12362
|
-
children: [
|
|
12363
|
-
loading ? /* @__PURE__ */ jsxRuntime.jsx(LoadingWrapper, { "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx(icons.Loader, {}) }) : startIcon,
|
|
12364
|
-
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "pi", textColor: isDisabled ? "neutral600" : "primary600", children }),
|
|
12365
|
-
endIcon
|
|
12366
|
-
]
|
|
12367
|
-
}
|
|
12368
|
-
);
|
|
12369
|
-
}
|
|
12370
|
-
);
|
|
12371
|
-
TextButton.displayName = "TextButton";
|
|
12372
12416
|
const TextInput = React__namespace.forwardRef((props, ref) => {
|
|
12373
12417
|
return /* @__PURE__ */ jsxRuntime.jsx(Input$2, { ref, ...props });
|
|
12374
12418
|
});
|
|
@@ -12386,7 +12430,7 @@ const Textarea = React__namespace.forwardRef(
|
|
|
12386
12430
|
} else if (field.hint) {
|
|
12387
12431
|
ariaDescription = `${id}-hint`;
|
|
12388
12432
|
}
|
|
12389
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Wrapper, { borderColor: hasError ? "danger600" : "neutral200", $hasError: hasError, hasRadius: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12433
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Wrapper$1, { borderColor: hasError ? "danger600" : "neutral200", $hasError: hasError, hasRadius: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12390
12434
|
TextareaElement,
|
|
12391
12435
|
{
|
|
12392
12436
|
"aria-invalid": hasError,
|
|
@@ -12397,11 +12441,11 @@ const Textarea = React__namespace.forwardRef(
|
|
|
12397
12441
|
disabled,
|
|
12398
12442
|
fontSize: 2,
|
|
12399
12443
|
hasRadius: true,
|
|
12400
|
-
height: "10.5rem",
|
|
12401
12444
|
ref,
|
|
12402
12445
|
lineHeight: 4,
|
|
12403
12446
|
padding: 4,
|
|
12404
12447
|
width: "100%",
|
|
12448
|
+
height: "100%",
|
|
12405
12449
|
id,
|
|
12406
12450
|
name,
|
|
12407
12451
|
"aria-describedby": ariaDescription,
|
|
@@ -12410,7 +12454,8 @@ const Textarea = React__namespace.forwardRef(
|
|
|
12410
12454
|
) });
|
|
12411
12455
|
}
|
|
12412
12456
|
);
|
|
12413
|
-
const Wrapper = styledComponents.styled(Box)`
|
|
12457
|
+
const Wrapper$1 = styledComponents.styled(Box)`
|
|
12458
|
+
height: 10.5rem;
|
|
12414
12459
|
${inputFocusStyle()}
|
|
12415
12460
|
`;
|
|
12416
12461
|
const TextareaElement = styledComponents.styled(Box)`
|
|
@@ -12555,6 +12600,39 @@ const Input = styledComponents.styled.input`
|
|
|
12555
12600
|
z-index: 0;
|
|
12556
12601
|
width: 100%;
|
|
12557
12602
|
`;
|
|
12603
|
+
const Root = forwardRef((props, forwardedRef) => {
|
|
12604
|
+
const { gap = 0, gridCols = 12, ...rest } = props;
|
|
12605
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Wrapper, { ref: forwardedRef, $gap: gap, $gridCols: gridCols, ...rest });
|
|
12606
|
+
});
|
|
12607
|
+
const Wrapper = styledComponents.styled(Box)`
|
|
12608
|
+
display: grid;
|
|
12609
|
+
grid-template-columns: repeat(${({ $gridCols }) => $gridCols}, 1fr);
|
|
12610
|
+
${({ theme, $gap }) => handleResponsiveValues({ gap: $gap }, theme)}
|
|
12611
|
+
`;
|
|
12612
|
+
const ItemImpl = forwardRef(
|
|
12613
|
+
({ col, s, xs, m, ...props }, forwardedRef) => /* @__PURE__ */ jsxRuntime.jsx(Item, { ref: forwardedRef, $col: col, $s: s, $xs: xs, $m: m, ...props })
|
|
12614
|
+
);
|
|
12615
|
+
const Item = styledComponents.styled(Flex)`
|
|
12616
|
+
grid-column: span ${({ $xs }) => $xs ?? 12};
|
|
12617
|
+
max-width: 100%;
|
|
12618
|
+
|
|
12619
|
+
${({ theme }) => theme.breakpoints.small} {
|
|
12620
|
+
grid-column: span ${({ $s, $xs }) => $s ?? $xs ?? 12};
|
|
12621
|
+
}
|
|
12622
|
+
|
|
12623
|
+
${({ theme }) => theme.breakpoints.medium} {
|
|
12624
|
+
grid-column: span ${({ $m, $s, $xs }) => $m ?? $s ?? $xs ?? 12};
|
|
12625
|
+
}
|
|
12626
|
+
|
|
12627
|
+
${({ theme }) => theme.breakpoints.large} {
|
|
12628
|
+
grid-column: span ${({ $col, $m, $s, $xs }) => $col ?? $m ?? $s ?? $xs ?? 12};
|
|
12629
|
+
}
|
|
12630
|
+
`;
|
|
12631
|
+
const Grid = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
12632
|
+
__proto__: null,
|
|
12633
|
+
Item: ItemImpl,
|
|
12634
|
+
Root
|
|
12635
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
12558
12636
|
const defaultState = {
|
|
12559
12637
|
x: 0,
|
|
12560
12638
|
y: 0,
|
|
@@ -12587,6 +12665,56 @@ function useMeasure() {
|
|
|
12587
12665
|
}, [element, observer]);
|
|
12588
12666
|
return [ref, rect];
|
|
12589
12667
|
}
|
|
12668
|
+
const FocusTrap = ({ onEscape, restoreFocus = true, skipAutoFocus = false, ...props }) => {
|
|
12669
|
+
const trappedRef = React__namespace.useRef(null);
|
|
12670
|
+
React__namespace.useEffect(() => {
|
|
12671
|
+
let currentFocus = null;
|
|
12672
|
+
if (restoreFocus) {
|
|
12673
|
+
currentFocus = document.activeElement;
|
|
12674
|
+
}
|
|
12675
|
+
return () => {
|
|
12676
|
+
if (currentFocus) {
|
|
12677
|
+
currentFocus.focus();
|
|
12678
|
+
}
|
|
12679
|
+
};
|
|
12680
|
+
}, [restoreFocus]);
|
|
12681
|
+
React__namespace.useEffect(() => {
|
|
12682
|
+
if (!trappedRef.current || skipAutoFocus)
|
|
12683
|
+
return;
|
|
12684
|
+
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
12685
|
+
if (focusableChildren.length > 0) {
|
|
12686
|
+
const firstElement = focusableChildren[0];
|
|
12687
|
+
firstElement.focus();
|
|
12688
|
+
} else {
|
|
12689
|
+
console.warn(
|
|
12690
|
+
"[FocusTrap]: it seems there are no focusable elements in the focus trap tree. Make sure there s at least one."
|
|
12691
|
+
);
|
|
12692
|
+
}
|
|
12693
|
+
}, [skipAutoFocus]);
|
|
12694
|
+
const handleKeyDown = (e) => {
|
|
12695
|
+
if (e.key === KeyboardKeys.ESCAPE && onEscape) {
|
|
12696
|
+
onEscape();
|
|
12697
|
+
return;
|
|
12698
|
+
}
|
|
12699
|
+
if (e.key !== KeyboardKeys.TAB)
|
|
12700
|
+
return;
|
|
12701
|
+
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
12702
|
+
if (focusableChildren.length > 0) {
|
|
12703
|
+
const firstElement = focusableChildren[0];
|
|
12704
|
+
const lastElement = focusableChildren[focusableChildren.length - 1];
|
|
12705
|
+
if (e.shiftKey) {
|
|
12706
|
+
if (firstElement === document.activeElement) {
|
|
12707
|
+
e.preventDefault();
|
|
12708
|
+
lastElement.focus();
|
|
12709
|
+
}
|
|
12710
|
+
} else if (lastElement === document.activeElement) {
|
|
12711
|
+
e.preventDefault();
|
|
12712
|
+
firstElement.focus();
|
|
12713
|
+
}
|
|
12714
|
+
}
|
|
12715
|
+
};
|
|
12716
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: trappedRef, onKeyDown: handleKeyDown, ...props });
|
|
12717
|
+
};
|
|
12590
12718
|
const KeyboardNavigable = ({ tagName, attributeName = "", ...props }) => {
|
|
12591
12719
|
const isValidFocusedElement = () => {
|
|
12592
12720
|
const focused = document.activeElement;
|
|
@@ -12673,8 +12801,7 @@ exports.Accordion = Accordion;
|
|
|
12673
12801
|
exports.Alert = Alert;
|
|
12674
12802
|
exports.Avatar = Avatar;
|
|
12675
12803
|
exports.Badge = Badge;
|
|
12676
|
-
exports.
|
|
12677
|
-
exports.BaseLink = BaseLink;
|
|
12804
|
+
exports.BaseLink = BaseLinkImpl;
|
|
12678
12805
|
exports.Box = Box;
|
|
12679
12806
|
exports.Breadcrumbs = Breadcrumbs;
|
|
12680
12807
|
exports.Button = Button;
|