@strapi/design-system 2.0.0-beta.6 → 2.0.0-rc.11
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/Select/SingleSelect.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 +1143 -1009
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1145 -1011
- 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) => {
|
|
@@ -463,30 +565,48 @@ const AccordionRoot = styledComponents.styled(RadixAccordion__namespace.Root)`
|
|
|
463
565
|
`;
|
|
464
566
|
const Item$5 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
465
567
|
const { size } = useAccordion("Item");
|
|
466
|
-
return /* @__PURE__ */ jsxRuntime.jsx(AccordionItem, { $size: size, ref: forwardedRef, ...props });
|
|
568
|
+
return /* @__PURE__ */ jsxRuntime.jsx(AccordionItem, { $size: size, "data-size": size, ref: forwardedRef, ...props });
|
|
467
569
|
});
|
|
468
570
|
const AccordionItem = styledComponents.styled(RadixAccordion__namespace.Item)`
|
|
469
571
|
overflow: hidden;
|
|
572
|
+
margin: 1px 0;
|
|
470
573
|
|
|
471
574
|
&:first-child {
|
|
472
|
-
border-top-left-radius:
|
|
473
|
-
border-top-right-radius:
|
|
575
|
+
border-top-left-radius: 0.3rem;
|
|
576
|
+
border-top-right-radius: 0.3rem;
|
|
577
|
+
margin-top: 0;
|
|
474
578
|
}
|
|
475
579
|
|
|
476
580
|
&:last-child {
|
|
477
|
-
border-bottom-left-radius:
|
|
478
|
-
border-bottom-right-radius:
|
|
581
|
+
border-bottom-left-radius: 0.3rem;
|
|
582
|
+
border-bottom-right-radius: 0.3rem;
|
|
583
|
+
margin-bottom: 0;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
&[data-size='S'] {
|
|
587
|
+
& + & {
|
|
588
|
+
border-top: solid 1px ${(props) => props.theme.colors.neutral200};
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
&[data-state='open'] {
|
|
593
|
+
box-shadow: 0 0 0 1px ${(props) => props.theme.colors.primary600};
|
|
479
594
|
}
|
|
480
595
|
|
|
481
|
-
|
|
482
|
-
|
|
596
|
+
&:not([data-disabled]):hover {
|
|
597
|
+
box-shadow: 0 0 0 1px ${(props) => props.theme.colors.primary600};
|
|
483
598
|
}
|
|
484
599
|
|
|
485
600
|
/* This applies our desired focus effect correctly. */
|
|
486
601
|
&:focus-within {
|
|
487
602
|
position: relative;
|
|
488
603
|
z-index: 1;
|
|
489
|
-
box-shadow: 0 0 0
|
|
604
|
+
box-shadow: 0 0 0 1px ${(props) => props.theme.colors.primary600};
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
608
|
+
transition: box-shadow ${(props) => props.theme.motion.timings["120"]}
|
|
609
|
+
${(props) => props.theme.motion.easings.easeOutQuad};
|
|
490
610
|
}
|
|
491
611
|
`;
|
|
492
612
|
const Trigger$7 = React__namespace.forwardRef(
|
|
@@ -495,7 +615,7 @@ const Trigger$7 = React__namespace.forwardRef(
|
|
|
495
615
|
return /* @__PURE__ */ jsxRuntime.jsxs(AccordionTrigger, { $caretPosition: caretPosition, $size: size, ref: forwardedRef, ...restProps, children: [
|
|
496
616
|
caretPosition === "left" ? /* @__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,
|
|
497
617
|
/* @__PURE__ */ jsxRuntime.jsxs(Flex, { tag: "span", gap: 2, children: [
|
|
498
|
-
Icon ? /* @__PURE__ */ jsxRuntime.jsx(IconBox$4, { children: /* @__PURE__ */ jsxRuntime.jsx(Icon, {}) }) : null,
|
|
618
|
+
Icon && size === "S" ? /* @__PURE__ */ jsxRuntime.jsx(IconBox$4, { children: /* @__PURE__ */ jsxRuntime.jsx(Icon, {}) }) : null,
|
|
499
619
|
/* @__PURE__ */ jsxRuntime.jsxs(Flex, { alignItems: "flex-start", direction: "column", tag: "span", ref: forwardedRef, children: [
|
|
500
620
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
501
621
|
Typography,
|
|
@@ -503,10 +623,11 @@ const Trigger$7 = React__namespace.forwardRef(
|
|
|
503
623
|
fontWeight: size === "S" ? "bold" : void 0,
|
|
504
624
|
ellipsis: true,
|
|
505
625
|
variant: size === "M" ? "delta" : void 0,
|
|
626
|
+
textAlign: "left",
|
|
506
627
|
children
|
|
507
628
|
}
|
|
508
629
|
),
|
|
509
|
-
description && size === "M" ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { children: description }) : null
|
|
630
|
+
description && size === "M" ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { textAlign: "left", children: description }) : null
|
|
510
631
|
] })
|
|
511
632
|
] }),
|
|
512
633
|
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
|
|
@@ -515,6 +636,7 @@ const Trigger$7 = React__namespace.forwardRef(
|
|
|
515
636
|
);
|
|
516
637
|
const IconBox$4 = styledComponents.styled(Box)`
|
|
517
638
|
color: ${(props) => props.theme.colors.neutral500};
|
|
639
|
+
display: flex;
|
|
518
640
|
|
|
519
641
|
@media (prefers-reduced-motion: no-preference) {
|
|
520
642
|
transition: ${(props) => props.theme.transitions.color};
|
|
@@ -1170,51 +1292,32 @@ const Base = styledComponents.styled(Flex)`
|
|
|
1170
1292
|
`;
|
|
1171
1293
|
}};
|
|
1172
1294
|
`;
|
|
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) => {
|
|
1295
|
+
const BaseLinkImpl = forwardRef(
|
|
1296
|
+
({ href, disabled = false, isExternal = false, ...props }, ref) => {
|
|
1203
1297
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1204
|
-
|
|
1298
|
+
BaseLink,
|
|
1205
1299
|
{
|
|
1206
1300
|
tag: "a",
|
|
1207
1301
|
ref,
|
|
1208
|
-
target: isExternal ? "_blank" :
|
|
1209
|
-
rel: isExternal ?
|
|
1210
|
-
href
|
|
1302
|
+
target: isExternal ? "_blank" : void 0,
|
|
1303
|
+
rel: isExternal ? "noreferrer noopener" : void 0,
|
|
1304
|
+
href,
|
|
1305
|
+
tabIndex: disabled ? -1 : void 0,
|
|
1211
1306
|
"aria-disabled": disabled,
|
|
1212
|
-
|
|
1307
|
+
pointerEvents: disabled ? "none" : void 0,
|
|
1308
|
+
cursor: disabled ? void 0 : "pointer",
|
|
1213
1309
|
...props
|
|
1214
1310
|
}
|
|
1215
1311
|
);
|
|
1216
1312
|
}
|
|
1217
1313
|
);
|
|
1314
|
+
const BaseLink = styledComponents.styled(Box)`
|
|
1315
|
+
text-decoration: none;
|
|
1316
|
+
|
|
1317
|
+
&:visited {
|
|
1318
|
+
color: inherit;
|
|
1319
|
+
}
|
|
1320
|
+
`;
|
|
1218
1321
|
const Divider$1 = () => {
|
|
1219
1322
|
return /* @__PURE__ */ jsxRuntime.jsx(Box, { "aria-hidden": true, paddingLeft: 1, paddingRight: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "pi", textColor: "neutral500", children: "/" }) });
|
|
1220
1323
|
};
|
|
@@ -1228,30 +1331,34 @@ const AlignedList = styledComponents.styled(Flex)`
|
|
|
1228
1331
|
margin-left: ${({ theme }) => `calc(-1*${theme.spaces[2]})`};
|
|
1229
1332
|
}
|
|
1230
1333
|
`;
|
|
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
|
|
1334
|
+
const Breadcrumbs = React__namespace.forwardRef(
|
|
1335
|
+
({ label, children, ...props }, forwardedRef) => {
|
|
1336
|
+
const childrenArray = React__namespace.Children.toArray(children);
|
|
1337
|
+
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) => {
|
|
1338
|
+
const shouldDisplayDivider = childrenArray.length > 1 && index + 1 < childrenArray.length;
|
|
1339
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Flex, { inline: true, tag: "li", children: [
|
|
1340
|
+
child,
|
|
1341
|
+
shouldDisplayDivider && /* @__PURE__ */ jsxRuntime.jsx(Divider$1, {})
|
|
1342
|
+
] });
|
|
1343
|
+
}) }) });
|
|
1251
1344
|
}
|
|
1252
|
-
)
|
|
1345
|
+
);
|
|
1346
|
+
Breadcrumbs.displayName = "Breadcrumbs";
|
|
1347
|
+
const Crumb = React__namespace.forwardRef(
|
|
1348
|
+
({ children, isCurrent = false, ...props }, forwardedRef) => /* @__PURE__ */ jsxRuntime.jsx(Box, { paddingLeft: 2, paddingRight: 2, paddingTop: 1, paddingBottom: 1, ref: forwardedRef, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1349
|
+
Typography,
|
|
1350
|
+
{
|
|
1351
|
+
variant: "pi",
|
|
1352
|
+
textColor: "neutral800",
|
|
1353
|
+
fontWeight: isCurrent ? "bold" : "regular",
|
|
1354
|
+
"aria-current": isCurrent,
|
|
1355
|
+
...props,
|
|
1356
|
+
children
|
|
1357
|
+
}
|
|
1358
|
+
) })
|
|
1359
|
+
);
|
|
1253
1360
|
Crumb.displayName = "Crumb";
|
|
1254
|
-
const StyledLink = styledComponents.styled(
|
|
1361
|
+
const StyledLink = styledComponents.styled(BaseLinkImpl)`
|
|
1255
1362
|
border-radius: ${({ theme }) => theme.borderRadius};
|
|
1256
1363
|
color: ${({ theme }) => theme.colors.neutral600};
|
|
1257
1364
|
font-size: ${({ theme }) => theme.fontSizes[1]};
|
|
@@ -1265,9 +1372,22 @@ const StyledLink = styledComponents.styled(BaseLink)`
|
|
|
1265
1372
|
color: ${({ theme }) => theme.colors.neutral700};
|
|
1266
1373
|
}
|
|
1267
1374
|
`;
|
|
1268
|
-
const CrumbLink = ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(StyledLink, { ...props, children });
|
|
1375
|
+
const CrumbLink = React__namespace.forwardRef(({ children, ...props }, forwardedRef) => /* @__PURE__ */ jsxRuntime.jsx(StyledLink, { ref: forwardedRef, ...props, children }));
|
|
1269
1376
|
CrumbLink.displayName = "CrumbLink";
|
|
1270
1377
|
const stripReactIdOfColon = (str) => str.replaceAll(":", "");
|
|
1378
|
+
function setRef(ref, value) {
|
|
1379
|
+
if (typeof ref === "function") {
|
|
1380
|
+
ref(value);
|
|
1381
|
+
} else if (ref !== null && ref !== void 0) {
|
|
1382
|
+
ref.current = value;
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1385
|
+
function composeRefs(...refs) {
|
|
1386
|
+
return (node) => refs.forEach((ref) => setRef(ref, node));
|
|
1387
|
+
}
|
|
1388
|
+
function useComposedRefs(...refs) {
|
|
1389
|
+
return React__namespace.useCallback(composeRefs(...refs), refs);
|
|
1390
|
+
}
|
|
1271
1391
|
const isSSR = () => typeof window === "undefined" || !window.navigator || /ServerSideRendering|^Deno\//.test(window.navigator.userAgent);
|
|
1272
1392
|
const useIsomorphicLayoutEffect = isSSR() ? React.useEffect : React.useLayoutEffect;
|
|
1273
1393
|
const useReactId = React__namespace["useId".toString()] || (() => void 0);
|
|
@@ -1317,7 +1437,7 @@ const DANGER = "danger";
|
|
|
1317
1437
|
const SUCCESS = "success";
|
|
1318
1438
|
const GHOST = "ghost";
|
|
1319
1439
|
const LIGHT_VARIANTS = [SUCCESS_LIGHT, DANGER_LIGHT];
|
|
1320
|
-
const VARIANTS
|
|
1440
|
+
const VARIANTS = [DEFAULT, TERTIARY, SECONDARY, DANGER, SUCCESS, GHOST, ...LIGHT_VARIANTS];
|
|
1321
1441
|
const BUTTON_SIZES = ["S", "M", "L"];
|
|
1322
1442
|
const getVariantColorName = (variant2) => {
|
|
1323
1443
|
if (variant2 === SUCCESS_LIGHT || variant2 === DANGER_LIGHT) {
|
|
@@ -1326,7 +1446,7 @@ const getVariantColorName = (variant2) => {
|
|
|
1326
1446
|
if (variant2 === TERTIARY) {
|
|
1327
1447
|
return "neutral";
|
|
1328
1448
|
}
|
|
1329
|
-
if (variant2 === DEFAULT || variant2 === SECONDARY || VARIANTS
|
|
1449
|
+
if (variant2 === DEFAULT || variant2 === SECONDARY || VARIANTS.every((vari) => vari !== variant2)) {
|
|
1330
1450
|
return "primary";
|
|
1331
1451
|
}
|
|
1332
1452
|
return `${variant2}`;
|
|
@@ -1336,6 +1456,7 @@ const getDisabledStyle = ({ theme }) => {
|
|
|
1336
1456
|
border: 1px solid ${theme.colors.neutral200};
|
|
1337
1457
|
background: ${theme.colors.neutral150};
|
|
1338
1458
|
color: ${theme.colors.neutral600};
|
|
1459
|
+
cursor: default;
|
|
1339
1460
|
`;
|
|
1340
1461
|
};
|
|
1341
1462
|
const getHoverStyle = ({ theme, $variant }) => {
|
|
@@ -1373,7 +1494,7 @@ const getActiveStyle = ({ theme, $variant }) => {
|
|
|
1373
1494
|
color: ${theme.colors[`${getVariantColorName($variant)}600`]};
|
|
1374
1495
|
`;
|
|
1375
1496
|
}
|
|
1376
|
-
if ($variant === TERTIARY) {
|
|
1497
|
+
if ($variant === TERTIARY || $variant === GHOST) {
|
|
1377
1498
|
return styledComponents.css`
|
|
1378
1499
|
background-color: ${theme.colors.neutral150};
|
|
1379
1500
|
`;
|
|
@@ -1422,6 +1543,8 @@ const getVariantStyle = ({ theme, $variant }) => {
|
|
|
1422
1543
|
}
|
|
1423
1544
|
default: {
|
|
1424
1545
|
return styledComponents.css`
|
|
1546
|
+
border: 1px solid ${theme.colors.buttonPrimary600};
|
|
1547
|
+
background: ${theme.colors.buttonPrimary600};
|
|
1425
1548
|
color: ${theme.colors.buttonNeutral0};
|
|
1426
1549
|
`;
|
|
1427
1550
|
}
|
|
@@ -1454,21 +1577,22 @@ const Button = forwardRef(
|
|
|
1454
1577
|
disabled: isDisabled,
|
|
1455
1578
|
$size: size,
|
|
1456
1579
|
$variant: variant2,
|
|
1580
|
+
tag: "button",
|
|
1457
1581
|
onClick: handleClick,
|
|
1458
|
-
|
|
1459
|
-
background: "buttonPrimary600",
|
|
1460
|
-
borderColor: "buttonPrimary600",
|
|
1582
|
+
hasRadius: true,
|
|
1461
1583
|
gap: 2,
|
|
1462
|
-
inline:
|
|
1463
|
-
|
|
1584
|
+
inline: true,
|
|
1585
|
+
alignItems: "center",
|
|
1586
|
+
justifyContent: "center",
|
|
1587
|
+
width: fullWidth ? "100%" : void 0,
|
|
1464
1588
|
paddingLeft: 4,
|
|
1465
1589
|
paddingRight: 4,
|
|
1466
|
-
|
|
1590
|
+
cursor: "pointer",
|
|
1467
1591
|
...props,
|
|
1468
1592
|
children: [
|
|
1469
|
-
(startIcon || loading) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1593
|
+
(startIcon || loading) && /* @__PURE__ */ jsxRuntime.jsx(Flex, { tag: "span", "aria-hidden": true, children: loading ? /* @__PURE__ */ jsxRuntime.jsx(LoaderAnimated, {}) : startIcon }),
|
|
1470
1594
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: size === "S" ? "pi" : void 0, fontWeight: "bold", children }),
|
|
1471
|
-
endIcon && /* @__PURE__ */ jsxRuntime.jsx(Flex, { "aria-hidden": true, children: endIcon })
|
|
1595
|
+
endIcon && /* @__PURE__ */ jsxRuntime.jsx(Flex, { tag: "span", "aria-hidden": true, children: endIcon })
|
|
1472
1596
|
]
|
|
1473
1597
|
}
|
|
1474
1598
|
);
|
|
@@ -1486,20 +1610,10 @@ const LoaderAnimated = styledComponents.styled(icons.Loader)`
|
|
|
1486
1610
|
animation: ${rotation$2} 2s infinite linear;
|
|
1487
1611
|
will-change: transform;
|
|
1488
1612
|
`;
|
|
1489
|
-
const ButtonWrapper = styledComponents.styled(
|
|
1613
|
+
const ButtonWrapper = styledComponents.styled(Flex)`
|
|
1490
1614
|
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
|
-
}
|
|
1615
|
+
text-decoration: none;
|
|
1616
|
+
${getVariantStyle}
|
|
1503
1617
|
|
|
1504
1618
|
&:hover {
|
|
1505
1619
|
${getHoverStyle}
|
|
@@ -1509,7 +1623,9 @@ const ButtonWrapper = styledComponents.styled(BaseButton)`
|
|
|
1509
1623
|
${getActiveStyle}
|
|
1510
1624
|
}
|
|
1511
1625
|
|
|
1512
|
-
|
|
1626
|
+
&[aria-disabled='true'] {
|
|
1627
|
+
${getDisabledStyle}
|
|
1628
|
+
}
|
|
1513
1629
|
|
|
1514
1630
|
@media (prefers-reduced-motion: no-preference) {
|
|
1515
1631
|
transition:
|
|
@@ -1518,76 +1634,220 @@ const ButtonWrapper = styledComponents.styled(BaseButton)`
|
|
|
1518
1634
|
border-color ${(props) => props.theme.motion.timings["200"]} ${(props) => props.theme.motion.easings.easeOutQuad};
|
|
1519
1635
|
}
|
|
1520
1636
|
`;
|
|
1521
|
-
const
|
|
1522
|
-
({
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1637
|
+
const TooltipImpl = React__namespace.forwardRef(
|
|
1638
|
+
({
|
|
1639
|
+
children,
|
|
1640
|
+
description,
|
|
1641
|
+
label,
|
|
1642
|
+
defaultOpen,
|
|
1643
|
+
open,
|
|
1644
|
+
onOpenChange,
|
|
1645
|
+
delayDuration = 500,
|
|
1646
|
+
disableHoverableContent,
|
|
1647
|
+
...restProps
|
|
1648
|
+
}, forwardedRef) => {
|
|
1649
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1650
|
+
Tooltip__namespace.Root,
|
|
1651
|
+
{
|
|
1652
|
+
defaultOpen,
|
|
1653
|
+
open,
|
|
1654
|
+
onOpenChange,
|
|
1655
|
+
delayDuration,
|
|
1656
|
+
disableHoverableContent,
|
|
1657
|
+
children: [
|
|
1658
|
+
/* @__PURE__ */ jsxRuntime.jsx(Tooltip__namespace.Trigger, { asChild: true, children }),
|
|
1659
|
+
/* @__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 }) }) })
|
|
1660
|
+
]
|
|
1661
|
+
}
|
|
1662
|
+
);
|
|
1529
1663
|
}
|
|
1530
1664
|
);
|
|
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
|
-
}
|
|
1665
|
+
const TooltipContent = styledComponents.styled(Tooltip__namespace.Content)`
|
|
1666
|
+
background-color: ${(props) => props.theme.colors.neutral900};
|
|
1667
|
+
color: ${(props) => props.theme.colors.neutral0};
|
|
1668
|
+
padding-inline: ${(props) => props.theme.spaces[2]};
|
|
1669
|
+
padding-block: ${(props) => props.theme.spaces[2]};
|
|
1670
|
+
border-radius: ${(props) => props.theme.borderRadius};
|
|
1671
|
+
z-index: ${(props) => props.theme.zIndices.tooltip};
|
|
1672
|
+
will-change: opacity;
|
|
1673
|
+
transform-origin: var(--radix-tooltip-content-transform-origin);
|
|
1549
1674
|
|
|
1550
|
-
|
|
1551
|
-
|
|
1675
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1676
|
+
animation: ${ANIMATIONS.fadeIn} ${(props) => props.theme.motion.timings["200"]}
|
|
1677
|
+
${(props) => props.theme.motion.easings.authenticMotion};
|
|
1552
1678
|
}
|
|
1553
|
-
|
|
1554
|
-
${focus};
|
|
1555
1679
|
`;
|
|
1556
|
-
const
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1680
|
+
const IconButton = forwardRef(
|
|
1681
|
+
({
|
|
1682
|
+
label,
|
|
1683
|
+
background,
|
|
1684
|
+
children,
|
|
1685
|
+
disabled = false,
|
|
1686
|
+
onClick,
|
|
1687
|
+
size = "S",
|
|
1688
|
+
variant: variant2 = "tertiary",
|
|
1689
|
+
withTooltip = true,
|
|
1690
|
+
...restProps
|
|
1691
|
+
}, ref) => {
|
|
1692
|
+
const handleClick = (e) => {
|
|
1693
|
+
if (!disabled && onClick) {
|
|
1694
|
+
onClick(e);
|
|
1695
|
+
}
|
|
1696
|
+
};
|
|
1697
|
+
const component = /* @__PURE__ */ jsxRuntime.jsx(
|
|
1698
|
+
IconButtonWrapper,
|
|
1561
1699
|
{
|
|
1700
|
+
"aria-disabled": disabled,
|
|
1701
|
+
background: disabled ? "neutral150" : background,
|
|
1702
|
+
tag: "button",
|
|
1703
|
+
display: "inline-flex",
|
|
1704
|
+
justifyContent: "center",
|
|
1705
|
+
hasRadius: true,
|
|
1706
|
+
cursor: "pointer",
|
|
1707
|
+
...restProps,
|
|
1562
1708
|
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
|
|
1709
|
+
$size: size,
|
|
1710
|
+
onClick: handleClick,
|
|
1711
|
+
$variant: variant2,
|
|
1712
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(AccessibleIcon, { label, children })
|
|
1571
1713
|
}
|
|
1572
|
-
)
|
|
1714
|
+
);
|
|
1715
|
+
return withTooltip ? /* @__PURE__ */ jsxRuntime.jsx(TooltipImpl, { label, children: component }) : component;
|
|
1716
|
+
}
|
|
1717
|
+
);
|
|
1718
|
+
const IconButtonWrapper = styledComponents.styled(Flex)`
|
|
1719
|
+
text-decoration: none;
|
|
1720
|
+
|
|
1721
|
+
${(props) => {
|
|
1722
|
+
switch (props.$size) {
|
|
1723
|
+
case "S": {
|
|
1724
|
+
return styledComponents.css`
|
|
1725
|
+
padding-block: 0.7rem;
|
|
1726
|
+
padding-inline: 0.7rem;
|
|
1727
|
+
`;
|
|
1728
|
+
}
|
|
1729
|
+
case "M": {
|
|
1730
|
+
return styledComponents.css`
|
|
1731
|
+
padding-block: 0.9rem;
|
|
1732
|
+
padding-inline: 0.9rem;
|
|
1733
|
+
`;
|
|
1734
|
+
}
|
|
1735
|
+
case "L": {
|
|
1736
|
+
return styledComponents.css`
|
|
1737
|
+
padding-block: 1.1rem;
|
|
1738
|
+
padding-inline: 1.1rem;
|
|
1739
|
+
`;
|
|
1740
|
+
}
|
|
1741
|
+
}
|
|
1742
|
+
}}
|
|
1743
|
+
${getVariantStyle}
|
|
1744
|
+
${(props) => props.$variant === "tertiary" ? styledComponents.css`
|
|
1745
|
+
color: ${props.theme.colors.neutral500};
|
|
1746
|
+
` : ""}
|
|
1747
|
+
|
|
1748
|
+
&:hover {
|
|
1749
|
+
${getHoverStyle}
|
|
1750
|
+
${(props) => props.$variant === "tertiary" ? styledComponents.css`
|
|
1751
|
+
color: ${props.theme.colors.neutral600};
|
|
1752
|
+
` : ""}
|
|
1753
|
+
}
|
|
1754
|
+
|
|
1755
|
+
&:active {
|
|
1756
|
+
${getActiveStyle}
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
&[aria-disabled='true'] {
|
|
1760
|
+
${getDisabledStyle}
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1763
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1764
|
+
transition:
|
|
1765
|
+
${(props) => props.theme.transitions.backgroundColor},
|
|
1766
|
+
${(props) => props.theme.transitions.color},
|
|
1767
|
+
border-color ${(props) => props.theme.motion.timings["200"]} ${(props) => props.theme.motion.easings.easeOutQuad};
|
|
1768
|
+
}
|
|
1769
|
+
`;
|
|
1770
|
+
const IconButtonGroup = styledComponents.styled(Flex)`
|
|
1771
|
+
& ${IconButtonWrapper}:first-child {
|
|
1772
|
+
border-radius: ${({ theme }) => `${theme.borderRadius} 0 0 ${theme.borderRadius}`};
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
& ${IconButtonWrapper}:last-child {
|
|
1776
|
+
border-radius: ${({ theme }) => `0 ${theme.borderRadius} ${theme.borderRadius} 0`};
|
|
1777
|
+
}
|
|
1778
|
+
|
|
1779
|
+
& ${IconButtonWrapper} {
|
|
1780
|
+
border-radius: 0;
|
|
1781
|
+
|
|
1782
|
+
& + ${IconButtonWrapper} {
|
|
1783
|
+
border-left: none;
|
|
1784
|
+
}
|
|
1785
|
+
}
|
|
1786
|
+
`;
|
|
1787
|
+
const Link = forwardRef(
|
|
1788
|
+
({ children, href, disabled = false, startIcon, endIcon, isExternal = false, ...props }, ref) => {
|
|
1789
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(LinkWrapper$1, { ref, href, disabled, isExternal, ...props, children: [
|
|
1790
|
+
startIcon,
|
|
1791
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { textColor: disabled ? "neutral600" : "primary600", children }),
|
|
1792
|
+
endIcon,
|
|
1793
|
+
href && !endIcon && isExternal && /* @__PURE__ */ jsxRuntime.jsx(icons.ExternalLink, {})
|
|
1794
|
+
] });
|
|
1795
|
+
}
|
|
1796
|
+
);
|
|
1797
|
+
const LinkWrapper$1 = styledComponents.styled(BaseLinkImpl)`
|
|
1798
|
+
display: inline-flex;
|
|
1799
|
+
align-items: center;
|
|
1800
|
+
text-decoration: none;
|
|
1801
|
+
gap: ${({ theme }) => theme.spaces[2]};
|
|
1802
|
+
pointer-events: ${({ disabled }) => disabled ? "none" : void 0};
|
|
1803
|
+
|
|
1804
|
+
svg {
|
|
1805
|
+
font-size: 1rem;
|
|
1806
|
+
|
|
1807
|
+
path {
|
|
1808
|
+
fill: ${({ disabled, theme }) => disabled ? theme.colors.neutral600 : theme.colors.primary600};
|
|
1809
|
+
}
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
&:hover {
|
|
1813
|
+
& > span {
|
|
1814
|
+
color: ${({ theme }) => theme.colors.primary500};
|
|
1815
|
+
}
|
|
1816
|
+
}
|
|
1817
|
+
|
|
1818
|
+
&:active {
|
|
1819
|
+
color: ${({ theme }) => theme.colors.primary700};
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1822
|
+
${focus};
|
|
1823
|
+
`;
|
|
1824
|
+
const MenuRoot = DropdownMenu__namespace.Root;
|
|
1825
|
+
const MenuTrigger = React__namespace.forwardRef(
|
|
1826
|
+
({ label, endIcon = /* @__PURE__ */ jsxRuntime.jsx(icons.CaretDown, { width: "1.2rem", height: "1.2rem", "aria-hidden": true }), tag = Button, icon, ...rest }, ref) => {
|
|
1827
|
+
const props = {
|
|
1828
|
+
...rest,
|
|
1829
|
+
ref,
|
|
1830
|
+
type: "button"
|
|
1831
|
+
};
|
|
1832
|
+
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 }) });
|
|
1573
1833
|
}
|
|
1574
1834
|
);
|
|
1575
1835
|
const MenuContent = React__namespace.forwardRef(
|
|
1576
1836
|
({ children, intersectionId, popoverPlacement = "bottom-start", ...props }, ref) => {
|
|
1577
1837
|
const [side, align] = popoverPlacement.split("-");
|
|
1578
|
-
return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1838
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuContent, { align, side, loop: true, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1579
1839
|
Viewport$2,
|
|
1580
1840
|
{
|
|
1581
1841
|
ref,
|
|
1582
1842
|
direction: "column",
|
|
1583
|
-
borderStyle: "solid",
|
|
1584
|
-
borderWidth: "1px",
|
|
1585
1843
|
borderColor: "neutral150",
|
|
1586
1844
|
hasRadius: true,
|
|
1587
1845
|
background: "neutral0",
|
|
1588
1846
|
shadow: "filterShadow",
|
|
1589
1847
|
maxHeight: "15rem",
|
|
1590
1848
|
padding: 1,
|
|
1849
|
+
marginTop: 1,
|
|
1850
|
+
marginBottom: 1,
|
|
1591
1851
|
alignItems: "flex-start",
|
|
1592
1852
|
position: "relative",
|
|
1593
1853
|
overflow: "auto",
|
|
@@ -1609,6 +1869,23 @@ const Viewport$2 = styledComponents.styled(Flex)`
|
|
|
1609
1869
|
display: none;
|
|
1610
1870
|
}
|
|
1611
1871
|
`;
|
|
1872
|
+
const DropdownMenuContent = styledComponents.styled(DropdownMenu__namespace.Content)`
|
|
1873
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1874
|
+
animation-duration: ${(props) => props.theme.motion.timings["200"]};
|
|
1875
|
+
|
|
1876
|
+
&[data-state='open'] {
|
|
1877
|
+
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
1878
|
+
|
|
1879
|
+
&[data-side='top'] {
|
|
1880
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
1881
|
+
}
|
|
1882
|
+
|
|
1883
|
+
&[data-side='bottom'] {
|
|
1884
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1887
|
+
}
|
|
1888
|
+
`;
|
|
1612
1889
|
const MenuItem$1 = ({ onSelect, disabled = false, isLink, ...props }) => {
|
|
1613
1890
|
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
1891
|
};
|
|
@@ -1618,7 +1895,7 @@ const getOptionStyle = ({ theme }) => styledComponents.css`
|
|
|
1618
1895
|
border-radius: ${theme.borderRadius};
|
|
1619
1896
|
padding: ${theme.spaces[2]} ${theme.spaces[4]};
|
|
1620
1897
|
|
|
1621
|
-
&[aria-disabled] {
|
|
1898
|
+
&[aria-disabled='true'] {
|
|
1622
1899
|
cursor: not-allowed;
|
|
1623
1900
|
color: ${theme.colors.neutral500};
|
|
1624
1901
|
}
|
|
@@ -1723,37 +2000,41 @@ const Menu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
|
|
|
1723
2000
|
SubTrigger,
|
|
1724
2001
|
Trigger: Trigger$6
|
|
1725
2002
|
}, 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
|
-
}
|
|
2003
|
+
const SimpleMenu = React__namespace.forwardRef(
|
|
2004
|
+
({ children, onOpen, onClose, popoverPlacement, onReachEnd, ...props }, forwardedRef) => {
|
|
2005
|
+
const triggerRef = React__namespace.useRef(null);
|
|
2006
|
+
const composedRef = useComposedRefs(forwardedRef, triggerRef);
|
|
2007
|
+
const contentRef = React__namespace.useRef(null);
|
|
2008
|
+
const [internalIsOpen, setInternalIsOpen] = React__namespace.useState(false);
|
|
2009
|
+
const handleReachEnd = (entry) => {
|
|
2010
|
+
if (onReachEnd) {
|
|
2011
|
+
onReachEnd(entry);
|
|
2012
|
+
}
|
|
2013
|
+
};
|
|
2014
|
+
const handleOpenChange = (isOpen) => {
|
|
2015
|
+
if (isOpen && typeof onOpen === "function") {
|
|
2016
|
+
onOpen();
|
|
2017
|
+
} else if (!isOpen && typeof onClose === "function") {
|
|
2018
|
+
onClose();
|
|
2019
|
+
}
|
|
2020
|
+
setInternalIsOpen(isOpen);
|
|
2021
|
+
};
|
|
2022
|
+
const generatedId = useId();
|
|
2023
|
+
const intersectionId = `intersection-${stripReactIdOfColon(generatedId)}`;
|
|
2024
|
+
useIntersection(contentRef, handleReachEnd, {
|
|
2025
|
+
selectorToWatch: `#${intersectionId}`,
|
|
2026
|
+
/**
|
|
2027
|
+
* We need to know when the select is open because only then will viewportRef
|
|
2028
|
+
* not be null. Because it uses a portal that (sensibly) is not mounted 24/7.
|
|
2029
|
+
*/
|
|
2030
|
+
skipWhen: !internalIsOpen
|
|
2031
|
+
});
|
|
2032
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Root$7, { onOpenChange: handleOpenChange, children: [
|
|
2033
|
+
/* @__PURE__ */ jsxRuntime.jsx(Trigger$6, { ref: composedRef, ...props, children: props.label }),
|
|
2034
|
+
/* @__PURE__ */ jsxRuntime.jsx(Content$6, { ref: contentRef, intersectionId, popoverPlacement, children })
|
|
2035
|
+
] });
|
|
2036
|
+
}
|
|
2037
|
+
);
|
|
1757
2038
|
const MenuItem = Item$3;
|
|
1758
2039
|
const StyledButton = styledComponents.styled(SimpleMenu)`
|
|
1759
2040
|
padding: ${({ theme }) => `${theme.spaces[1]} ${theme.spaces[2]}`};
|
|
@@ -1764,16 +2045,19 @@ const StyledButton = styledComponents.styled(SimpleMenu)`
|
|
|
1764
2045
|
background-color: ${({ theme }) => theme.colors.neutral200};
|
|
1765
2046
|
}
|
|
1766
2047
|
`;
|
|
1767
|
-
const CrumbSimpleMenu =
|
|
2048
|
+
const CrumbSimpleMenu = React__namespace.forwardRef(
|
|
2049
|
+
({ children, ...props }, forwardedRef) => /* @__PURE__ */ jsxRuntime.jsx(StyledButton, { ref: forwardedRef, endIcon: null, size: "S", ...props, children })
|
|
2050
|
+
);
|
|
1768
2051
|
CrumbSimpleMenu.displayName = "CrumbSimpleMenu";
|
|
1769
2052
|
const CardContext = React__namespace.createContext({ id: "" });
|
|
1770
2053
|
const useCard = () => React__namespace.useContext(CardContext);
|
|
1771
|
-
const Card = ({ id, ...props }) => {
|
|
2054
|
+
const Card = React__namespace.forwardRef(({ id, ...props }, forwardedRef) => {
|
|
1772
2055
|
const generatedId = useId(id);
|
|
1773
2056
|
const context = React__namespace.useMemo(() => ({ id: generatedId }), [generatedId]);
|
|
1774
2057
|
return /* @__PURE__ */ jsxRuntime.jsx(CardContext.Provider, { value: context, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1775
2058
|
Box,
|
|
1776
2059
|
{
|
|
2060
|
+
ref: forwardedRef,
|
|
1777
2061
|
id,
|
|
1778
2062
|
tabIndex: 0,
|
|
1779
2063
|
hasRadius: true,
|
|
@@ -1787,10 +2071,10 @@ const Card = ({ id, ...props }) => {
|
|
|
1787
2071
|
...props
|
|
1788
2072
|
}
|
|
1789
2073
|
) });
|
|
1790
|
-
};
|
|
1791
|
-
const CardActionImpl = ({ position, ...restProps }) => {
|
|
1792
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CardAction, { $position: position, ...restProps, direction: "row", gap: 2 });
|
|
1793
|
-
};
|
|
2074
|
+
});
|
|
2075
|
+
const CardActionImpl = React__namespace.forwardRef(({ position, ...restProps }, forwardedRef) => {
|
|
2076
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CardAction, { ref: forwardedRef, $position: position, ...restProps, direction: "row", gap: 2 });
|
|
2077
|
+
});
|
|
1794
2078
|
const CardAction = styledComponents.styled(Flex)`
|
|
1795
2079
|
position: absolute;
|
|
1796
2080
|
top: ${({ theme }) => theme.spaces[3]};
|
|
@@ -1841,30 +2125,17 @@ const CardBadge = (props) => /* @__PURE__ */ jsxRuntime.jsx(CardBadgeWrapper, {
|
|
|
1841
2125
|
const CardBody = (props) => {
|
|
1842
2126
|
return /* @__PURE__ */ jsxRuntime.jsx(Box, { paddingLeft: 3, paddingRight: 3, paddingTop: 2, paddingBottom: 2, children: /* @__PURE__ */ jsxRuntime.jsx(Flex, { ...props, alignItems: "flex-start" }) });
|
|
1843
2127
|
};
|
|
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
2128
|
const CheckIcon = ({ fill, ...props }) => {
|
|
1858
2129
|
const { colors } = styledComponents.useTheme();
|
|
1859
2130
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1860
2131
|
Box,
|
|
1861
2132
|
{
|
|
1862
2133
|
tag: "svg",
|
|
1863
|
-
viewBox: "0 0
|
|
2134
|
+
viewBox: "0 0 32 32",
|
|
1864
2135
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1865
2136
|
fill: fill ? colors[fill] : void 0,
|
|
1866
2137
|
...props,
|
|
1867
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "
|
|
2138
|
+
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
2139
|
}
|
|
1869
2140
|
);
|
|
1870
2141
|
};
|
|
@@ -1877,9 +2148,9 @@ const CheckboxEl = React__namespace.forwardRef(
|
|
|
1877
2148
|
onChange: onCheckedChange
|
|
1878
2149
|
});
|
|
1879
2150
|
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(
|
|
2151
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CheckboxRoot, { ref: composedRefs, checked, onCheckedChange: setChecked, ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(Checkbox__namespace.Indicator, { style: { display: "inline-flex" }, children: [
|
|
2152
|
+
checked === true ? /* @__PURE__ */ jsxRuntime.jsx(CheckIcon, { width: "1.6rem", fill: "neutral0" }) : null,
|
|
2153
|
+
checked === "indeterminate" ? /* @__PURE__ */ jsxRuntime.jsx(icons.Minus, { fill: "neutral0" }) : null
|
|
1883
2154
|
] }) });
|
|
1884
2155
|
}
|
|
1885
2156
|
);
|
|
@@ -1897,12 +2168,6 @@ const CheckboxRoot = styledComponents.styled(Checkbox__namespace.Root)`
|
|
|
1897
2168
|
// this ensures the checkbox is always a square even in flex-containers.
|
|
1898
2169
|
flex: 0 0 2rem;
|
|
1899
2170
|
|
|
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
2171
|
&[data-state='checked'],
|
|
1907
2172
|
&[data-state='indeterminate'] {
|
|
1908
2173
|
border: 1px solid ${(props) => props.theme.colors.primary600};
|
|
@@ -1936,10 +2201,10 @@ const CheckboxImpl = React__namespace.forwardRef(({ children, ...restProps }, fo
|
|
|
1936
2201
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { tag: "label", textColor: "neutral800", htmlFor: labelId, children })
|
|
1937
2202
|
] });
|
|
1938
2203
|
});
|
|
1939
|
-
const CardCheckbox = (props) => {
|
|
2204
|
+
const CardCheckbox = React__namespace.forwardRef((props, forwardedRef) => {
|
|
1940
2205
|
const { id } = useCard();
|
|
1941
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CardActionImpl, { position: "start", children: /* @__PURE__ */ jsxRuntime.jsx(CheckboxImpl, { "aria-labelledby": `${id}-title`, ...props }) });
|
|
1942
|
-
};
|
|
2206
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CardActionImpl, { position: "start", children: /* @__PURE__ */ jsxRuntime.jsx(CheckboxImpl, { "aria-labelledby": `${id}-title`, ...props, ref: forwardedRef }) });
|
|
2207
|
+
});
|
|
1943
2208
|
const BreakBox = styledComponents.styled(Box)`
|
|
1944
2209
|
word-break: break-all;
|
|
1945
2210
|
`;
|
|
@@ -1991,49 +2256,6 @@ const KeyboardKeys = {
|
|
|
1991
2256
|
BACKSPACE: "Backspace",
|
|
1992
2257
|
CLEAR: "Clear"
|
|
1993
2258
|
};
|
|
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
2259
|
const CarouselGrid = styledComponents.styled(Box)`
|
|
2038
2260
|
grid-template-columns: auto 1fr auto;
|
|
2039
2261
|
grid-template-areas: 'startAction slides endAction';
|
|
@@ -2092,8 +2314,8 @@ const Carousel = React__namespace.forwardRef(
|
|
|
2092
2314
|
position: "relative",
|
|
2093
2315
|
children: [
|
|
2094
2316
|
childrenArray && childrenArray.length > 1 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2095
|
-
/* @__PURE__ */ jsxRuntime.jsx(CarouselAction, { tag: "button", onClick: onPrevious, $area: "startAction", ref: prevActionRef, type: "button", children: /* @__PURE__ */ jsxRuntime.jsx(AccessibleIcon, { label: previousLabel, children: /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronLeft, { width: "
|
|
2096
|
-
/* @__PURE__ */ jsxRuntime.jsx(CarouselAction, { tag: "button", onClick: onNext, $area: "endAction", ref: nextActionRef, type: "button", children: /* @__PURE__ */ jsxRuntime.jsx(AccessibleIcon, { label: nextLabel, children: /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronRight, { width: "
|
|
2317
|
+
/* @__PURE__ */ jsxRuntime.jsx(CarouselAction, { tag: "button", onClick: onPrevious, $area: "startAction", ref: prevActionRef, type: "button", children: /* @__PURE__ */ jsxRuntime.jsx(AccessibleIcon, { label: previousLabel, children: /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronLeft, { width: "1.6rem", height: "1.6rem", fill: "neutral600" }) }) }),
|
|
2318
|
+
/* @__PURE__ */ jsxRuntime.jsx(CarouselAction, { tag: "button", onClick: onNext, $area: "endAction", ref: nextActionRef, type: "button", children: /* @__PURE__ */ jsxRuntime.jsx(AccessibleIcon, { label: nextLabel, children: /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronRight, { width: "1.6rem", height: "1.6rem", fill: "neutral600" }) }) })
|
|
2097
2319
|
] }),
|
|
2098
2320
|
/* @__PURE__ */ jsxRuntime.jsx(CarouselSlides, { "aria-live": "polite", paddingLeft: 2, paddingRight: 2, width: "100%", overflow: "hidden", children: childrenArray }),
|
|
2099
2321
|
actions
|
|
@@ -2128,9 +2350,11 @@ const commonTheme = {
|
|
|
2128
2350
|
},
|
|
2129
2351
|
spaces: ["0px", "4px", "8px", "12px", "16px", "20px", "24px", "32px", "40px", "48px", "56px", "64px"],
|
|
2130
2352
|
borderRadius: "4px",
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2353
|
+
breakpoints: {
|
|
2354
|
+
initial: "@media(min-width: 0px)",
|
|
2355
|
+
small: "@media(min-width: 520px)",
|
|
2356
|
+
medium: "@media(min-width: 768px)",
|
|
2357
|
+
large: "@media(min-width: 1080px)"
|
|
2134
2358
|
},
|
|
2135
2359
|
fontSizes: [`1.1rem`, `1.2rem`, `1.4rem`, "1.6rem", `1.8rem`, `3.2rem`],
|
|
2136
2360
|
lineHeights: [1.14, 1.22, 1.25, 1.33, 1.43, 1.45, 1.5],
|
|
@@ -2971,7 +3195,7 @@ lodash.exports;
|
|
|
2971
3195
|
}
|
|
2972
3196
|
var runInContext = function runInContext2(context) {
|
|
2973
3197
|
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,
|
|
3198
|
+
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
3199
|
var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
|
|
2976
3200
|
var coreJsData = context["__core-js_shared__"];
|
|
2977
3201
|
var funcToString = funcProto.toString;
|
|
@@ -2997,7 +3221,7 @@ lodash.exports;
|
|
|
2997
3221
|
}
|
|
2998
3222
|
}();
|
|
2999
3223
|
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 =
|
|
3224
|
+
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
3225
|
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
3226
|
var metaMap = WeakMap && new WeakMap();
|
|
3003
3227
|
var realNames = {};
|
|
@@ -4743,7 +4967,7 @@ lodash.exports;
|
|
|
4743
4967
|
return setWrapToString(result2, func, bitmask);
|
|
4744
4968
|
}
|
|
4745
4969
|
function createRound(methodName) {
|
|
4746
|
-
var func =
|
|
4970
|
+
var func = Math2[methodName];
|
|
4747
4971
|
return function(number2, precision) {
|
|
4748
4972
|
number2 = toNumber(number2);
|
|
4749
4973
|
precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
|
|
@@ -7834,10 +8058,9 @@ const Label = React__namespace.forwardRef(({ children, action, ...props }, ref)
|
|
|
7834
8058
|
return null;
|
|
7835
8059
|
}
|
|
7836
8060
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7837
|
-
|
|
8061
|
+
TypographyLabel,
|
|
7838
8062
|
{
|
|
7839
8063
|
ref: composedRefs,
|
|
7840
|
-
display: "flex",
|
|
7841
8064
|
variant: "pi",
|
|
7842
8065
|
textColor: "neutral800",
|
|
7843
8066
|
fontWeight: "bold",
|
|
@@ -7845,6 +8068,7 @@ const Label = React__namespace.forwardRef(({ children, action, ...props }, ref)
|
|
|
7845
8068
|
id: `${id}-label`,
|
|
7846
8069
|
htmlFor: id,
|
|
7847
8070
|
tag: "label",
|
|
8071
|
+
ellipsis: true,
|
|
7848
8072
|
children: [
|
|
7849
8073
|
children,
|
|
7850
8074
|
required && /* @__PURE__ */ jsxRuntime.jsx(Typography, { "aria-hidden": true, lineHeight: "1em", textColor: "danger600", children: "*" }),
|
|
@@ -7853,6 +8077,9 @@ const Label = React__namespace.forwardRef(({ children, action, ...props }, ref)
|
|
|
7853
8077
|
}
|
|
7854
8078
|
);
|
|
7855
8079
|
});
|
|
8080
|
+
const TypographyLabel = styledComponents.styled(Typography)`
|
|
8081
|
+
display: flex;
|
|
8082
|
+
`;
|
|
7856
8083
|
const LabelAction = styledComponents.styled(Flex)`
|
|
7857
8084
|
line-height: 0;
|
|
7858
8085
|
color: ${({ theme }) => theme.colors.neutral500};
|
|
@@ -7877,11 +8104,24 @@ const Input$2 = React__namespace.forwardRef(
|
|
|
7877
8104
|
ariaDescription = `${id}-hint`;
|
|
7878
8105
|
}
|
|
7879
8106
|
const hasError = Boolean(error);
|
|
8107
|
+
const endActionRef = React__namespace.useRef(null);
|
|
8108
|
+
const inputElementRef = React__namespace.useRef(null);
|
|
8109
|
+
const inputRef = useComposedRefs(inputElementRef, ref);
|
|
7880
8110
|
const handleChange = (e) => {
|
|
7881
8111
|
if (!disabled && onChange) {
|
|
7882
8112
|
onChange(e);
|
|
7883
8113
|
}
|
|
7884
8114
|
};
|
|
8115
|
+
React__namespace.useLayoutEffect(() => {
|
|
8116
|
+
if (endActionRef.current && inputElementRef.current) {
|
|
8117
|
+
const endActionWidth = endActionRef.current.offsetWidth;
|
|
8118
|
+
const inputElement = inputElementRef.current;
|
|
8119
|
+
if (inputElement) {
|
|
8120
|
+
const inputPadding = endActionWidth + 8 + 16;
|
|
8121
|
+
inputElement.style.paddingRight = `${inputPadding}px`;
|
|
8122
|
+
}
|
|
8123
|
+
}
|
|
8124
|
+
}, [endAction]);
|
|
7885
8125
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7886
8126
|
InputWrapper,
|
|
7887
8127
|
{
|
|
@@ -7889,6 +8129,9 @@ const Input$2 = React__namespace.forwardRef(
|
|
|
7889
8129
|
justifyContent: "space-between",
|
|
7890
8130
|
$hasError: hasError || hasErrorProp,
|
|
7891
8131
|
$disabled: disabled,
|
|
8132
|
+
$size: size,
|
|
8133
|
+
$hasLeftAction: Boolean(startAction),
|
|
8134
|
+
$hasRightAction: Boolean(endAction),
|
|
7892
8135
|
className,
|
|
7893
8136
|
children: [
|
|
7894
8137
|
startAction,
|
|
@@ -7897,9 +8140,7 @@ const Input$2 = React__namespace.forwardRef(
|
|
|
7897
8140
|
{
|
|
7898
8141
|
id,
|
|
7899
8142
|
name,
|
|
7900
|
-
ref,
|
|
7901
|
-
$hasLeftAction: Boolean(startAction),
|
|
7902
|
-
$hasRightAction: Boolean(endAction),
|
|
8143
|
+
ref: inputRef,
|
|
7903
8144
|
$size: size,
|
|
7904
8145
|
"aria-describedby": ariaDescription,
|
|
7905
8146
|
"aria-invalid": hasError || hasErrorProp,
|
|
@@ -7908,10 +8149,12 @@ const Input$2 = React__namespace.forwardRef(
|
|
|
7908
8149
|
"data-disabled": disabled ? "" : void 0,
|
|
7909
8150
|
onChange: handleChange,
|
|
7910
8151
|
"aria-required": required || requiredProp,
|
|
8152
|
+
$hasLeftAction: Boolean(startAction),
|
|
8153
|
+
$hasRightAction: Boolean(endAction),
|
|
7911
8154
|
...props
|
|
7912
8155
|
}
|
|
7913
8156
|
),
|
|
7914
|
-
endAction
|
|
8157
|
+
endAction && /* @__PURE__ */ jsxRuntime.jsx(EndAction, { ref: endActionRef, children: endAction })
|
|
7915
8158
|
]
|
|
7916
8159
|
}
|
|
7917
8160
|
);
|
|
@@ -7930,23 +8173,6 @@ const InputElement = styledComponents.styled.input`
|
|
|
7930
8173
|
width: 100%;
|
|
7931
8174
|
background: inherit;
|
|
7932
8175
|
|
|
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
8176
|
::placeholder {
|
|
7951
8177
|
color: ${({ theme }) => theme.colors.neutral500};
|
|
7952
8178
|
opacity: 1;
|
|
@@ -7961,17 +8187,42 @@ const InputElement = styledComponents.styled.input`
|
|
|
7961
8187
|
outline: none;
|
|
7962
8188
|
box-shadow: none;
|
|
7963
8189
|
}
|
|
8190
|
+
|
|
8191
|
+
${(props) => {
|
|
8192
|
+
switch (props.$size) {
|
|
8193
|
+
case "S":
|
|
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[1]};
|
|
8198
|
+
`;
|
|
8199
|
+
default:
|
|
8200
|
+
return styledComponents.css`
|
|
8201
|
+
padding-inline-start: ${props.$hasLeftAction ? 0 : props.theme.spaces[4]};
|
|
8202
|
+
padding-inline-end: ${props.$hasRightAction ? 0 : props.theme.spaces[4]};
|
|
8203
|
+
padding-block: ${props.theme.spaces[2]};
|
|
8204
|
+
`;
|
|
8205
|
+
}
|
|
8206
|
+
}}
|
|
8207
|
+
`;
|
|
8208
|
+
const EndAction = styledComponents.styled(Flex)`
|
|
8209
|
+
position: absolute;
|
|
8210
|
+
right: ${({ theme }) => theme.spaces[4]};
|
|
8211
|
+
top: 50%;
|
|
8212
|
+
transform: translateY(-50%);
|
|
7964
8213
|
`;
|
|
7965
8214
|
const InputWrapper = styledComponents.styled(Flex)`
|
|
7966
8215
|
border: 1px solid ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral200};
|
|
7967
8216
|
border-radius: ${({ theme }) => theme.borderRadius};
|
|
7968
8217
|
background: ${({ theme }) => theme.colors.neutral0};
|
|
7969
|
-
${
|
|
8218
|
+
padding-inline-start: ${({ $hasLeftAction, theme }) => $hasLeftAction ? theme.spaces[4] : 0};
|
|
8219
|
+
position: relative;
|
|
7970
8220
|
|
|
8221
|
+
${inputFocusStyle()}
|
|
7971
8222
|
${({ theme, $disabled }) => $disabled ? styledComponents.css`
|
|
7972
8223
|
color: ${theme.colors.neutral600};
|
|
7973
8224
|
background: ${theme.colors.neutral150};
|
|
7974
|
-
` : void 0}
|
|
8225
|
+
` : void 0};
|
|
7975
8226
|
`;
|
|
7976
8227
|
const Hint = () => {
|
|
7977
8228
|
const { id, hint, error } = useField("Hint");
|
|
@@ -8066,6 +8317,7 @@ const CarouselActions = ({ horizontal = true, ...props }) => /* @__PURE__ */ jsx
|
|
|
8066
8317
|
position: "absolute",
|
|
8067
8318
|
width: "100%",
|
|
8068
8319
|
bottom: 1,
|
|
8320
|
+
gap: 1,
|
|
8069
8321
|
...props
|
|
8070
8322
|
}
|
|
8071
8323
|
);
|
|
@@ -8252,7 +8504,7 @@ const Combobox = React__namespace.forwardRef(
|
|
|
8252
8504
|
children: [
|
|
8253
8505
|
/* @__PURE__ */ jsxRuntime.jsxs(Trigger$5, { $hasError: hasError, $size: size, className, children: [
|
|
8254
8506
|
/* @__PURE__ */ jsxRuntime.jsxs(Flex, { flex: "1", tag: "span", gap: 3, children: [
|
|
8255
|
-
startIcon ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
8507
|
+
startIcon ? /* @__PURE__ */ jsxRuntime.jsx(Flex, { flex: "0 0 1.6rem", tag: "span", "aria-hidden": true, children: startIcon }) : null,
|
|
8256
8508
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8257
8509
|
TextInput$1,
|
|
8258
8510
|
{
|
|
@@ -8286,7 +8538,7 @@ const Combobox = React__namespace.forwardRef(
|
|
|
8286
8538
|
children: /* @__PURE__ */ jsxRuntime.jsx(icons.Cross, {})
|
|
8287
8539
|
}
|
|
8288
8540
|
) : null,
|
|
8289
|
-
/* @__PURE__ */ jsxRuntime.jsx(DownIcon$1, { children: /* @__PURE__ */ jsxRuntime.jsx(icons.CaretDown, {}) })
|
|
8541
|
+
/* @__PURE__ */ jsxRuntime.jsx(DownIcon$1, { children: /* @__PURE__ */ jsxRuntime.jsx(icons.CaretDown, { fill: "neutral500" }) })
|
|
8290
8542
|
] })
|
|
8291
8543
|
] }),
|
|
8292
8544
|
/* @__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 +8627,7 @@ const DownIcon$1 = styledComponents.styled(uiPrimitives.Combobox.Icon)`
|
|
|
8375
8627
|
background: transparent;
|
|
8376
8628
|
padding: 0;
|
|
8377
8629
|
color: ${({ theme }) => theme.colors.neutral600};
|
|
8630
|
+
display: flex;
|
|
8378
8631
|
|
|
8379
8632
|
&[aria-disabled='true'] {
|
|
8380
8633
|
cursor: inherit;
|
|
@@ -8398,11 +8651,11 @@ const Content$5 = styledComponents.styled(uiPrimitives.Combobox.Content)`
|
|
|
8398
8651
|
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
8399
8652
|
|
|
8400
8653
|
&[data-side='top'] {
|
|
8401
|
-
animation-name: ${ANIMATIONS.
|
|
8654
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
8402
8655
|
}
|
|
8403
8656
|
|
|
8404
8657
|
&[data-side='bottom'] {
|
|
8405
|
-
animation-name: ${ANIMATIONS.
|
|
8658
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
8406
8659
|
}
|
|
8407
8660
|
}
|
|
8408
8661
|
}
|
|
@@ -8498,19 +8751,7 @@ const ContentImpl$1 = styledComponents.styled(AlertDialog__namespace.Content)`
|
|
|
8498
8751
|
}
|
|
8499
8752
|
`;
|
|
8500
8753
|
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
|
-
) });
|
|
8754
|
+
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
8755
|
});
|
|
8515
8756
|
const Title$1 = styledComponents.styled(Typography)`
|
|
8516
8757
|
display: flex;
|
|
@@ -8684,8 +8925,7 @@ ${styledComponents.css`
|
|
|
8684
8925
|
img,
|
|
8685
8926
|
picture,
|
|
8686
8927
|
video,
|
|
8687
|
-
canvas
|
|
8688
|
-
svg {
|
|
8928
|
+
canvas {
|
|
8689
8929
|
display: block;
|
|
8690
8930
|
max-width: 100%;
|
|
8691
8931
|
}
|
|
@@ -8830,7 +9070,7 @@ const SelectTrigger = React__namespace.forwardRef(
|
|
|
8830
9070
|
...restProps,
|
|
8831
9071
|
children: [
|
|
8832
9072
|
/* @__PURE__ */ jsxRuntime.jsxs(Flex, { flex: "1", tag: "span", gap: 3, children: [
|
|
8833
|
-
startIcon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
9073
|
+
startIcon && /* @__PURE__ */ jsxRuntime.jsx(Flex, { tag: "span", "aria-hidden": true, children: startIcon }),
|
|
8834
9074
|
children
|
|
8835
9075
|
] }),
|
|
8836
9076
|
/* @__PURE__ */ jsxRuntime.jsxs(Flex, { tag: "span", gap: 3, children: [
|
|
@@ -8859,6 +9099,7 @@ const SelectTrigger = React__namespace.forwardRef(
|
|
|
8859
9099
|
);
|
|
8860
9100
|
const IconBox$2 = styledComponents.styled(Box)`
|
|
8861
9101
|
border: none;
|
|
9102
|
+
display: flex;
|
|
8862
9103
|
|
|
8863
9104
|
svg {
|
|
8864
9105
|
height: 1.1rem;
|
|
@@ -8866,7 +9107,7 @@ const IconBox$2 = styledComponents.styled(Box)`
|
|
|
8866
9107
|
}
|
|
8867
9108
|
|
|
8868
9109
|
svg path {
|
|
8869
|
-
fill: ${({ theme }) => theme.colors.
|
|
9110
|
+
fill: ${({ theme }) => theme.colors.neutral500};
|
|
8870
9111
|
}
|
|
8871
9112
|
`;
|
|
8872
9113
|
const StyledTrigger = styledComponents.styled(Flex)`
|
|
@@ -8889,7 +9130,7 @@ const StyledTrigger = styledComponents.styled(Flex)`
|
|
|
8889
9130
|
}}
|
|
8890
9131
|
|
|
8891
9132
|
&[aria-disabled='true'] {
|
|
8892
|
-
color: ${(props) => props.theme.colors.
|
|
9133
|
+
color: ${(props) => props.theme.colors.neutral500};
|
|
8893
9134
|
}
|
|
8894
9135
|
|
|
8895
9136
|
/* Required to ensure the below inputFocusStyles are adhered too */
|
|
@@ -8900,8 +9141,9 @@ const StyledTrigger = styledComponents.styled(Flex)`
|
|
|
8900
9141
|
${({ theme, $hasError }) => inputFocusStyle()({ theme, $hasError })};
|
|
8901
9142
|
`;
|
|
8902
9143
|
const DownIcon = styledComponents.styled(uiPrimitives.Select.Icon)`
|
|
9144
|
+
display: flex;
|
|
8903
9145
|
& > svg {
|
|
8904
|
-
fill: ${({ theme }) => theme.colors.
|
|
9146
|
+
fill: ${({ theme }) => theme.colors.neutral500};
|
|
8905
9147
|
}
|
|
8906
9148
|
`;
|
|
8907
9149
|
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 +9163,7 @@ const SelectContent = styledComponents.styled(uiPrimitives.Select.Content)`
|
|
|
8921
9163
|
border: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
8922
9164
|
border-radius: ${({ theme }) => theme.borderRadius};
|
|
8923
9165
|
min-width: var(--radix-select-trigger-width);
|
|
8924
|
-
|
|
8925
|
-
max-height: 15rem;
|
|
9166
|
+
max-height: 15.6rem;
|
|
8926
9167
|
z-index: ${({ theme }) => theme.zIndices.popover};
|
|
8927
9168
|
|
|
8928
9169
|
@media (prefers-reduced-motion: no-preference) {
|
|
@@ -8933,11 +9174,11 @@ const SelectContent = styledComponents.styled(uiPrimitives.Select.Content)`
|
|
|
8933
9174
|
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
8934
9175
|
|
|
8935
9176
|
&[data-side='top'] {
|
|
8936
|
-
animation-name: ${ANIMATIONS.
|
|
9177
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
8937
9178
|
}
|
|
8938
9179
|
|
|
8939
9180
|
&[data-side='bottom'] {
|
|
8940
|
-
animation-name: ${ANIMATIONS.
|
|
9181
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
8941
9182
|
}
|
|
8942
9183
|
}
|
|
8943
9184
|
}
|
|
@@ -9098,8 +9339,8 @@ const SingleSelect = React__namespace.forwardRef(
|
|
|
9098
9339
|
const SingleSelectOption = React__namespace.forwardRef(
|
|
9099
9340
|
({ value, startIcon, children, ...restProps }, ref) => {
|
|
9100
9341
|
return /* @__PURE__ */ jsxRuntime.jsxs(Item$2, { ref, value: value.toString(), ...restProps, children: [
|
|
9101
|
-
startIcon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
9102
|
-
/* @__PURE__ */ jsxRuntime.jsx(Typography, { children: /* @__PURE__ */ jsxRuntime.jsx(ItemText, { children }) })
|
|
9342
|
+
startIcon && /* @__PURE__ */ jsxRuntime.jsx(Flex, { tag: "span", "aria-hidden": true, children: startIcon }),
|
|
9343
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { lineHeight: "20px", width: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(ItemText, { children }) })
|
|
9103
9344
|
] });
|
|
9104
9345
|
}
|
|
9105
9346
|
);
|
|
@@ -9595,7 +9836,7 @@ const DatePickerContentImpl = React__namespace.forwardRef(
|
|
|
9595
9836
|
(props, forwardedRef) => {
|
|
9596
9837
|
const { label = "Choose date", ...restProps } = props;
|
|
9597
9838
|
const { onOpenChange, ...context } = useDatePickerContext(CONTENT_IMPL_NAME);
|
|
9598
|
-
const { x, y, refs, strategy } = reactDom$1.useFloating({
|
|
9839
|
+
const { x, y, refs, strategy, placement } = reactDom$1.useFloating({
|
|
9599
9840
|
strategy: "fixed",
|
|
9600
9841
|
placement: "bottom-start",
|
|
9601
9842
|
middleware: [
|
|
@@ -9642,6 +9883,7 @@ const DatePickerContentImpl = React__namespace.forwardRef(
|
|
|
9642
9883
|
{
|
|
9643
9884
|
ref: composedRefs,
|
|
9644
9885
|
"data-state": context.open ? "open" : "closed",
|
|
9886
|
+
"data-side": placement.includes("top") ? "top" : "bottom",
|
|
9645
9887
|
onContextMenu: (event) => event.preventDefault(),
|
|
9646
9888
|
id: context.contentId,
|
|
9647
9889
|
role: "dialog",
|
|
@@ -9666,6 +9908,22 @@ const ContentElement = styledComponents.styled(Box)`
|
|
|
9666
9908
|
box-shadow: ${({ theme }) => theme.shadows.filterShadow};
|
|
9667
9909
|
z-index: ${({ theme }) => theme.zIndices.popover};
|
|
9668
9910
|
border: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
9911
|
+
|
|
9912
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
9913
|
+
animation-duration: ${(props) => props.theme.motion.timings["200"]};
|
|
9914
|
+
|
|
9915
|
+
&[data-state='open'] {
|
|
9916
|
+
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
9917
|
+
|
|
9918
|
+
&[data-side='top'] {
|
|
9919
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
9920
|
+
}
|
|
9921
|
+
|
|
9922
|
+
&[data-side='bottom'] {
|
|
9923
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
9924
|
+
}
|
|
9925
|
+
}
|
|
9926
|
+
}
|
|
9669
9927
|
`;
|
|
9670
9928
|
const DATE_PICKER_CALENDAR_NAME = "DatePickerCalendar";
|
|
9671
9929
|
const DatePickerCalendar = React__namespace.forwardRef(
|
|
@@ -10095,238 +10353,27 @@ const EmptyStateIconWrapper = styledComponents.styled(Box)`
|
|
|
10095
10353
|
height: 8.8rem;
|
|
10096
10354
|
}
|
|
10097
10355
|
`;
|
|
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,
|
|
10356
|
+
const EmptyStateLayout = React__namespace.forwardRef(
|
|
10357
|
+
({ icon, content, action, hasRadius = true, shadow = "tableShadow" }, forwardedRef) => {
|
|
10358
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10359
|
+
Flex,
|
|
10247
10360
|
{
|
|
10248
|
-
|
|
10249
|
-
|
|
10250
|
-
|
|
10251
|
-
|
|
10252
|
-
|
|
10253
|
-
|
|
10254
|
-
|
|
10255
|
-
|
|
10256
|
-
|
|
10361
|
+
ref: forwardedRef,
|
|
10362
|
+
alignItems: "center",
|
|
10363
|
+
direction: "column",
|
|
10364
|
+
padding: 11,
|
|
10365
|
+
background: "neutral0",
|
|
10366
|
+
hasRadius,
|
|
10367
|
+
shadow,
|
|
10368
|
+
children: [
|
|
10369
|
+
icon ? /* @__PURE__ */ jsxRuntime.jsx(EmptyStateIconWrapper, { paddingBottom: 6, "aria-hidden": true, children: icon }) : null,
|
|
10370
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { paddingBottom: 4, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "delta", tag: "p", textAlign: "center", textColor: "neutral600", children: content }) }),
|
|
10371
|
+
action
|
|
10372
|
+
]
|
|
10257
10373
|
}
|
|
10258
10374
|
);
|
|
10259
|
-
return withTooltip ? /* @__PURE__ */ jsxRuntime.jsx(TooltipImpl, { label, children: component }) : component;
|
|
10260
10375
|
}
|
|
10261
10376
|
);
|
|
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
10377
|
const addMarks = state.StateEffect.define();
|
|
10331
10378
|
const filterMarks = state.StateEffect.define();
|
|
10332
10379
|
const lineHighlightMark = view.Decoration.mark({
|
|
@@ -10504,72 +10551,29 @@ const JSONInputContainer = styledComponents.styled(Flex)`
|
|
|
10504
10551
|
}
|
|
10505
10552
|
`;
|
|
10506
10553
|
const LinkButton = forwardRef(
|
|
10507
|
-
({
|
|
10508
|
-
|
|
10509
|
-
|
|
10510
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10511
|
-
LinkWrapper$1,
|
|
10554
|
+
({ disabled, ...restProps }, ref) => {
|
|
10555
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10556
|
+
Button,
|
|
10512
10557
|
{
|
|
10513
10558
|
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
|
-
]
|
|
10559
|
+
tag: BaseLinkImpl,
|
|
10560
|
+
tabIndex: disabled ? -1 : void 0,
|
|
10561
|
+
disabled,
|
|
10562
|
+
...restProps
|
|
10531
10563
|
}
|
|
10532
10564
|
);
|
|
10533
10565
|
}
|
|
10534
10566
|
);
|
|
10535
|
-
const
|
|
10536
|
-
|
|
10537
|
-
|
|
10538
|
-
|
|
10539
|
-
|
|
10540
|
-
&[aria-disabled='true'] {
|
|
10541
|
-
pointer-events: none;
|
|
10567
|
+
const MainWrapper = styledComponents.styled(Box)`
|
|
10568
|
+
// To prevent global outline on focus visible to force an outline when Main is focused
|
|
10569
|
+
&:focus-visible {
|
|
10570
|
+
outline: none;
|
|
10542
10571
|
}
|
|
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)`
|
|
10572
|
+
`;
|
|
10573
|
+
const Main = ({ labelledBy = "main-content-title", ...props }) => {
|
|
10574
|
+
return /* @__PURE__ */ jsxRuntime.jsx(MainWrapper, { "aria-labelledby": labelledBy, tag: "main", id: "main-content", tabIndex: -1, ...props });
|
|
10575
|
+
};
|
|
10576
|
+
const AnchorBox = styledComponents.styled(Box)`
|
|
10573
10577
|
text-decoration: none;
|
|
10574
10578
|
|
|
10575
10579
|
&:focus {
|
|
@@ -10595,6 +10599,7 @@ const SkipToContent = ({ children }) => {
|
|
|
10595
10599
|
}
|
|
10596
10600
|
);
|
|
10597
10601
|
};
|
|
10602
|
+
const setOpacity = (hex, alpha) => `${hex}${Math.floor(alpha * 255).toString(16).padStart(2, "0")}`;
|
|
10598
10603
|
const ScrollAreaImpl$1 = React__namespace.forwardRef(
|
|
10599
10604
|
({ children, viewportRef, ...restProps }, forwardedRef) => {
|
|
10600
10605
|
return /* @__PURE__ */ jsxRuntime.jsxs(ScrollAreaRoot, { ref: forwardedRef, ...restProps, children: [
|
|
@@ -10649,22 +10654,18 @@ const Thumb = styledComponents.styled(ScrollArea__namespace.Thumb)`
|
|
|
10649
10654
|
min-height: 44px;
|
|
10650
10655
|
}
|
|
10651
10656
|
`;
|
|
10652
|
-
const Root$
|
|
10657
|
+
const Root$3 = Dialog__namespace.Root;
|
|
10653
10658
|
const Trigger$2 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
10654
10659
|
return /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.Trigger, { ...props, asChild: true, ref: forwardedRef });
|
|
10655
10660
|
});
|
|
10656
10661
|
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
|
-
] });
|
|
10662
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(Overlay, { children: /* @__PURE__ */ jsxRuntime.jsx(ContentImpl, { ref: forwardedRef, ...props }) }) });
|
|
10661
10663
|
});
|
|
10662
10664
|
const Overlay = styledComponents.styled(Dialog__namespace.Overlay)`
|
|
10663
|
-
background
|
|
10665
|
+
background: ${(props) => setOpacity(props.theme.colors.neutral800, 0.2)};
|
|
10664
10666
|
position: fixed;
|
|
10665
10667
|
inset: 0;
|
|
10666
10668
|
z-index: ${(props) => props.theme.zIndices.overlay};
|
|
10667
|
-
opacity: 0.2;
|
|
10668
10669
|
|
|
10669
10670
|
@media (prefers-reduced-motion: no-preference) {
|
|
10670
10671
|
animation: ${ANIMATIONS.overlayFadeIn} ${(props) => props.theme.motion.timings["200"]}
|
|
@@ -10673,8 +10674,8 @@ const Overlay = styledComponents.styled(Dialog__namespace.Overlay)`
|
|
|
10673
10674
|
`;
|
|
10674
10675
|
const ContentImpl = styledComponents.styled(Dialog__namespace.Content)`
|
|
10675
10676
|
max-width: 83rem;
|
|
10676
|
-
max-height:
|
|
10677
|
-
height:
|
|
10677
|
+
max-height: 90vh;
|
|
10678
|
+
height: auto;
|
|
10678
10679
|
width: 60%;
|
|
10679
10680
|
overflow: hidden;
|
|
10680
10681
|
margin: 0 auto;
|
|
@@ -10776,7 +10777,7 @@ const Modal = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
10776
10777
|
Content: Content$2,
|
|
10777
10778
|
Footer,
|
|
10778
10779
|
Header,
|
|
10779
|
-
Root: Root$
|
|
10780
|
+
Root: Root$3,
|
|
10780
10781
|
Title,
|
|
10781
10782
|
Trigger: Trigger$2
|
|
10782
10783
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -10963,7 +10964,7 @@ const NextLink = forwardRef(
|
|
|
10963
10964
|
] });
|
|
10964
10965
|
}
|
|
10965
10966
|
);
|
|
10966
|
-
const LinkWrapper = styledComponents.styled(
|
|
10967
|
+
const LinkWrapper = styledComponents.styled(BaseLinkImpl)`
|
|
10967
10968
|
padding: ${({ theme }) => theme.spaces[3]};
|
|
10968
10969
|
border-radius: ${({ theme }) => theme.borderRadius};
|
|
10969
10970
|
box-shadow: ${({ $active, theme }) => $active ? theme.shadows.filterShadow : void 0};
|
|
@@ -11012,7 +11013,7 @@ const Dots = ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsxs(Box, {
|
|
|
11012
11013
|
/* @__PURE__ */ jsxRuntime.jsx(VisuallyHidden, { children }),
|
|
11013
11014
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { "aria-hidden": true, lineHeight: "revert", textColor: "neutral800", variant: "pi", children: "…" })
|
|
11014
11015
|
] });
|
|
11015
|
-
const Root$
|
|
11016
|
+
const Root$2 = Popover__namespace.Root;
|
|
11016
11017
|
const Trigger$1 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
11017
11018
|
return /* @__PURE__ */ jsxRuntime.jsx(Popover__namespace.Trigger, { ...props, asChild: true, ref: forwardedRef });
|
|
11018
11019
|
});
|
|
@@ -11024,6 +11025,7 @@ const PopoverContent = styledComponents.styled(Popover__namespace.Content)`
|
|
|
11024
11025
|
z-index: ${({ theme }) => theme.zIndices.popover};
|
|
11025
11026
|
background-color: ${(props) => props.theme.colors.neutral0};
|
|
11026
11027
|
border: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
11028
|
+
border-radius: ${({ theme }) => theme.borderRadius};
|
|
11027
11029
|
|
|
11028
11030
|
@media (prefers-reduced-motion: no-preference) {
|
|
11029
11031
|
animation-duration: ${(props) => props.theme.motion.timings["200"]};
|
|
@@ -11032,11 +11034,11 @@ const PopoverContent = styledComponents.styled(Popover__namespace.Content)`
|
|
|
11032
11034
|
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
11033
11035
|
|
|
11034
11036
|
&[data-side='top'] {
|
|
11035
|
-
animation-name: ${ANIMATIONS.
|
|
11037
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
11036
11038
|
}
|
|
11037
11039
|
|
|
11038
11040
|
&[data-side='bottom'] {
|
|
11039
|
-
animation-name: ${ANIMATIONS.
|
|
11041
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
11040
11042
|
}
|
|
11041
11043
|
}
|
|
11042
11044
|
|
|
@@ -11044,35 +11046,38 @@ const PopoverContent = styledComponents.styled(Popover__namespace.Content)`
|
|
|
11044
11046
|
animation-timing-function: ${(props) => props.theme.motion.easings.easeOutQuad};
|
|
11045
11047
|
|
|
11046
11048
|
&[data-side='top'] {
|
|
11047
|
-
animation-name: ${ANIMATIONS.
|
|
11049
|
+
animation-name: ${ANIMATIONS.slideUpOut};
|
|
11048
11050
|
}
|
|
11049
11051
|
|
|
11050
11052
|
&[data-side='bottom'] {
|
|
11051
|
-
animation-name: ${ANIMATIONS.
|
|
11053
|
+
animation-name: ${ANIMATIONS.slideDownOut};
|
|
11052
11054
|
}
|
|
11053
11055
|
}
|
|
11054
11056
|
}
|
|
11055
11057
|
`;
|
|
11056
|
-
const ScrollAreaImpl = (
|
|
11057
|
-
|
|
11058
|
-
|
|
11059
|
-
|
|
11060
|
-
|
|
11061
|
-
|
|
11062
|
-
|
|
11063
|
-
|
|
11064
|
-
|
|
11065
|
-
|
|
11066
|
-
|
|
11067
|
-
|
|
11068
|
-
}
|
|
11058
|
+
const ScrollAreaImpl = React__namespace.forwardRef(
|
|
11059
|
+
({ children, intersectionId, onReachEnd, ...props }, forwardedRef) => {
|
|
11060
|
+
const popoverRef = React__namespace.useRef(null);
|
|
11061
|
+
const composedRef = useComposedRefs(popoverRef, forwardedRef);
|
|
11062
|
+
const generatedIntersectionId = useId();
|
|
11063
|
+
useIntersection(popoverRef, onReachEnd ?? (() => {
|
|
11064
|
+
}), {
|
|
11065
|
+
selectorToWatch: `#${stripReactIdOfColon(generatedIntersectionId)}`,
|
|
11066
|
+
skipWhen: !intersectionId || !onReachEnd
|
|
11067
|
+
});
|
|
11068
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(PopoverScrollArea, { ref: composedRef, ...props, children: [
|
|
11069
|
+
children,
|
|
11070
|
+
intersectionId && onReachEnd && /* @__PURE__ */ jsxRuntime.jsx(Box, { id: stripReactIdOfColon(generatedIntersectionId), width: "100%", height: "1px" })
|
|
11071
|
+
] });
|
|
11072
|
+
}
|
|
11073
|
+
);
|
|
11069
11074
|
const PopoverScrollArea = styledComponents.styled(ScrollAreaImpl$1)`
|
|
11070
11075
|
height: 20rem;
|
|
11071
11076
|
`;
|
|
11072
11077
|
const Popover = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11073
11078
|
__proto__: null,
|
|
11074
11079
|
Content: Content$1,
|
|
11075
|
-
Root: Root$
|
|
11080
|
+
Root: Root$2,
|
|
11076
11081
|
ScrollArea: ScrollAreaImpl,
|
|
11077
11082
|
Trigger: Trigger$1
|
|
11078
11083
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -11112,7 +11117,7 @@ const RadioGroupRoot = styledComponents.styled(RadioGroup__namespace.Root)`
|
|
|
11112
11117
|
flex-direction: column;
|
|
11113
11118
|
gap: ${(props) => props.theme.spaces[3]};
|
|
11114
11119
|
`;
|
|
11115
|
-
const Item = React__namespace.forwardRef(({ children, id: idProp, ...restProps }, forwardedRef) => {
|
|
11120
|
+
const Item$1 = React__namespace.forwardRef(({ children, id: idProp, ...restProps }, forwardedRef) => {
|
|
11116
11121
|
const id = useId(idProp);
|
|
11117
11122
|
return /* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap: 2, children: [
|
|
11118
11123
|
/* @__PURE__ */ jsxRuntime.jsx(RadioGroupItem, { id, ref: forwardedRef, ...restProps, children: /* @__PURE__ */ jsxRuntime.jsx(RadioGroupIndicator, {}) }),
|
|
@@ -11181,7 +11186,7 @@ const RadioGroupIndicator = styledComponents.styled(RadioGroup__namespace.Indica
|
|
|
11181
11186
|
const Radio = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11182
11187
|
__proto__: null,
|
|
11183
11188
|
Group,
|
|
11184
|
-
Item
|
|
11189
|
+
Item: Item$1
|
|
11185
11190
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
11186
11191
|
const focusFocusable = (node) => {
|
|
11187
11192
|
const nextNode = node.querySelector('[tabindex="0"]');
|
|
@@ -11197,172 +11202,194 @@ const RawTableContext = React__namespace.createContext({
|
|
|
11197
11202
|
}
|
|
11198
11203
|
});
|
|
11199
11204
|
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;
|
|
11205
|
+
const RawTable = React__namespace.forwardRef(
|
|
11206
|
+
({ colCount, rowCount, jumpStep = 3, initialCol = 0, initialRow = 0, ...props }, forwardedRef) => {
|
|
11207
|
+
const tableRef = React__namespace.useRef(null);
|
|
11208
|
+
const mountedRef = React__namespace.useRef(false);
|
|
11209
|
+
const composedRef = useComposedRefs(tableRef, forwardedRef);
|
|
11210
|
+
const [rowIndex, setRowIndex] = React__namespace.useState(initialRow);
|
|
11211
|
+
const [colIndex, setColIndex] = React__namespace.useState(initialCol);
|
|
11212
|
+
const setTableValues = React__namespace.useCallback(({ colIndex: colIndex2, rowIndex: rowIndex2 }) => {
|
|
11213
|
+
setColIndex(colIndex2);
|
|
11214
|
+
setRowIndex(rowIndex2);
|
|
11215
|
+
}, []);
|
|
11216
|
+
React__namespace.useEffect(() => {
|
|
11217
|
+
if (mountedRef.current) {
|
|
11218
|
+
focusFocusable(tableRef.current);
|
|
11240
11219
|
}
|
|
11241
|
-
|
|
11242
|
-
|
|
11243
|
-
setRowIndex((prevRowIndex) => prevRowIndex < rowCount - 1 ? prevRowIndex + 1 : prevRowIndex);
|
|
11244
|
-
break;
|
|
11220
|
+
if (!mountedRef.current) {
|
|
11221
|
+
mountedRef.current = true;
|
|
11245
11222
|
}
|
|
11246
|
-
|
|
11247
|
-
|
|
11248
|
-
|
|
11249
|
-
|
|
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;
|
|
11250
11230
|
}
|
|
11251
|
-
|
|
11252
|
-
|
|
11253
|
-
|
|
11254
|
-
|
|
11255
|
-
|
|
11256
|
-
|
|
11257
|
-
|
|
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;
|
|
11240
|
+
}
|
|
11241
|
+
case KeyboardKeys.DOWN: {
|
|
11242
|
+
e.preventDefault();
|
|
11243
|
+
setRowIndex((prevRowIndex) => prevRowIndex < rowCount - 1 ? prevRowIndex + 1 : prevRowIndex);
|
|
11244
|
+
break;
|
|
11245
|
+
}
|
|
11246
|
+
case KeyboardKeys.HOME: {
|
|
11247
|
+
e.preventDefault();
|
|
11248
|
+
if (e.ctrlKey) {
|
|
11249
|
+
setRowIndex(0);
|
|
11250
|
+
}
|
|
11251
|
+
setColIndex(0);
|
|
11252
|
+
break;
|
|
11253
|
+
}
|
|
11254
|
+
case KeyboardKeys.END: {
|
|
11255
|
+
e.preventDefault();
|
|
11256
|
+
if (e.ctrlKey) {
|
|
11257
|
+
setRowIndex(rowCount - 1);
|
|
11258
|
+
}
|
|
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
|
+
}
|
|
11267
|
+
case KeyboardKeys.PAGE_UP: {
|
|
11268
|
+
e.preventDefault();
|
|
11269
|
+
setRowIndex((prevRowIndex) => prevRowIndex - jumpStep > 0 ? prevRowIndex - jumpStep : 0);
|
|
11270
|
+
break;
|
|
11258
11271
|
}
|
|
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
11272
|
}
|
|
11267
|
-
|
|
11268
|
-
|
|
11269
|
-
|
|
11270
|
-
|
|
11273
|
+
};
|
|
11274
|
+
const context = React__namespace.useMemo(() => ({ rowIndex, colIndex, setTableValues }), [colIndex, rowIndex, setTableValues]);
|
|
11275
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RawTableContext.Provider, { value: context, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11276
|
+
"table",
|
|
11277
|
+
{
|
|
11278
|
+
role: "grid",
|
|
11279
|
+
ref: composedRef,
|
|
11280
|
+
"aria-rowcount": rowCount,
|
|
11281
|
+
"aria-colcount": colCount,
|
|
11282
|
+
onKeyDown: handleKeyDown,
|
|
11283
|
+
...props
|
|
11271
11284
|
}
|
|
11272
|
-
}
|
|
11273
|
-
}
|
|
11274
|
-
|
|
11275
|
-
|
|
11276
|
-
|
|
11277
|
-
|
|
11278
|
-
|
|
11279
|
-
|
|
11280
|
-
|
|
11281
|
-
|
|
11282
|
-
|
|
11283
|
-
|
|
11284
|
-
|
|
11285
|
-
|
|
11285
|
+
) });
|
|
11286
|
+
}
|
|
11287
|
+
);
|
|
11288
|
+
const getFocusableNodes = (node, includeNegativeTabIndex) => {
|
|
11289
|
+
const nodes = [
|
|
11290
|
+
...node.querySelectorAll(
|
|
11291
|
+
'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
|
|
11292
|
+
)
|
|
11293
|
+
];
|
|
11294
|
+
const focusables = nodes.filter((node2) => {
|
|
11295
|
+
if (node2.hasAttribute("disabled"))
|
|
11296
|
+
return false;
|
|
11297
|
+
if (includeNegativeTabIndex)
|
|
11298
|
+
return true;
|
|
11299
|
+
return node2.getAttribute("tabindex") !== "-1";
|
|
11300
|
+
});
|
|
11301
|
+
return focusables;
|
|
11286
11302
|
};
|
|
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;
|
|
11303
|
+
const getFocusableNodesWithKeyboardNav = (nodes) => {
|
|
11304
|
+
return nodes.filter((node) => {
|
|
11305
|
+
if (node.tagName === "INPUT") {
|
|
11306
|
+
return node.type !== "checkbox" && node.type !== "radio";
|
|
11295
11307
|
}
|
|
11296
|
-
|
|
11297
|
-
|
|
11298
|
-
|
|
11299
|
-
|
|
11300
|
-
|
|
11301
|
-
|
|
11302
|
-
|
|
11303
|
-
|
|
11304
|
-
|
|
11305
|
-
|
|
11306
|
-
|
|
11307
|
-
|
|
11308
|
-
|
|
11309
|
-
nextNode.focus();
|
|
11310
|
-
}
|
|
11308
|
+
return false;
|
|
11309
|
+
});
|
|
11310
|
+
};
|
|
11311
|
+
const RawTd = React__namespace.forwardRef(
|
|
11312
|
+
({ coords = { col: 0, row: 0 }, tag = "td", ...props }, forwardedRef) => {
|
|
11313
|
+
const tdRef = React__namespace.useRef(null);
|
|
11314
|
+
const composedRef = useComposedRefs(forwardedRef, tdRef);
|
|
11315
|
+
const { rowIndex, colIndex, setTableValues } = useTable();
|
|
11316
|
+
const [isActive, setIsActive] = React__namespace.useState(false);
|
|
11317
|
+
const handleKeyDown = (e) => {
|
|
11318
|
+
const focusableNodes = getFocusableNodes(tdRef.current, true);
|
|
11319
|
+
if (focusableNodes.length === 0 || focusableNodes.length === 1 && getFocusableNodesWithKeyboardNav(focusableNodes).length === 0) {
|
|
11320
|
+
return;
|
|
11311
11321
|
}
|
|
11312
|
-
|
|
11313
|
-
|
|
11314
|
-
|
|
11315
|
-
|
|
11316
|
-
|
|
11317
|
-
|
|
11318
|
-
|
|
11322
|
+
if (focusableNodes.length > 1 && !focusableNodes.find((node) => node.tagName !== "BUTTON")) {
|
|
11323
|
+
e.preventDefault();
|
|
11324
|
+
const focussedButtonIndex = focusableNodes.findIndex((node) => node === document.activeElement);
|
|
11325
|
+
if (e.key === KeyboardKeys.RIGHT) {
|
|
11326
|
+
const nextNode = focusableNodes[focussedButtonIndex + 1];
|
|
11327
|
+
if (nextNode) {
|
|
11328
|
+
e.stopPropagation();
|
|
11329
|
+
nextNode.focus();
|
|
11330
|
+
}
|
|
11331
|
+
} else if (e.key === KeyboardKeys.LEFT) {
|
|
11332
|
+
const nextNode = focusableNodes[focussedButtonIndex - 1];
|
|
11333
|
+
if (nextNode) {
|
|
11334
|
+
e.stopPropagation();
|
|
11335
|
+
nextNode.focus();
|
|
11336
|
+
}
|
|
11337
|
+
}
|
|
11319
11338
|
return;
|
|
11320
11339
|
}
|
|
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();
|
|
11340
|
+
const isEnterKey = e.key === KeyboardKeys.ENTER;
|
|
11341
|
+
if (isEnterKey && !isActive) {
|
|
11342
|
+
setIsActive(true);
|
|
11343
|
+
} else if ((e.key === KeyboardKeys.ESCAPE || isEnterKey) && isActive) {
|
|
11344
|
+
if (isEnterKey && document.activeElement?.tagName === "A") {
|
|
11345
|
+
return;
|
|
11336
11346
|
}
|
|
11337
|
-
|
|
11338
|
-
|
|
11347
|
+
setIsActive(false);
|
|
11348
|
+
tdRef.current.focus();
|
|
11349
|
+
} else if (isActive) {
|
|
11350
|
+
e.stopPropagation();
|
|
11351
|
+
}
|
|
11352
|
+
};
|
|
11353
|
+
const isFocused = rowIndex === coords.row - 1 && colIndex === coords.col - 1;
|
|
11354
|
+
useIsomorphicLayoutEffect(() => {
|
|
11355
|
+
const focusableNodes = getFocusableNodes(tdRef.current, true);
|
|
11356
|
+
if (focusableNodes.length === 0 || focusableNodes.length === 1 && getFocusableNodesWithKeyboardNav(focusableNodes).length !== 0 || focusableNodes.length > 1 && Boolean(focusableNodes.find((node) => node.tagName !== "BUTTON"))) {
|
|
11357
|
+
tdRef.current.setAttribute("tabIndex", !isActive && isFocused ? "0" : "-1");
|
|
11358
|
+
focusableNodes.forEach((node, index) => {
|
|
11359
|
+
node.setAttribute("tabIndex", isActive ? "0" : "-1");
|
|
11360
|
+
if (isActive && index === 0) {
|
|
11361
|
+
node.focus();
|
|
11362
|
+
}
|
|
11363
|
+
});
|
|
11364
|
+
} else {
|
|
11365
|
+
focusableNodes.forEach((node) => {
|
|
11366
|
+
node.setAttribute("tabIndex", isFocused ? "0" : "-1");
|
|
11367
|
+
});
|
|
11368
|
+
}
|
|
11369
|
+
}, [isActive, isFocused]);
|
|
11370
|
+
const handleFocusableNodeFocus = React__namespace.useCallback(() => {
|
|
11371
|
+
const focusableNodes = getFocusableNodes(tdRef.current, true);
|
|
11372
|
+
if (focusableNodes.length >= 1 && (getFocusableNodesWithKeyboardNav(focusableNodes).length !== 0 || !focusableNodes.find((node) => node.tagName !== "BUTTON"))) {
|
|
11373
|
+
setIsActive(true);
|
|
11374
|
+
}
|
|
11375
|
+
setTableValues({ rowIndex: coords.row - 1, colIndex: coords.col - 1 });
|
|
11376
|
+
}, [coords, setTableValues]);
|
|
11377
|
+
useIsomorphicLayoutEffect(() => {
|
|
11378
|
+
const cell = tdRef.current;
|
|
11379
|
+
const focusableNodes = getFocusableNodes(cell, true);
|
|
11339
11380
|
focusableNodes.forEach((node) => {
|
|
11340
|
-
node.
|
|
11381
|
+
node.addEventListener("focus", handleFocusableNodeFocus);
|
|
11341
11382
|
});
|
|
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
|
-
};
|
|
11383
|
+
return () => {
|
|
11384
|
+
const focusableNodes2 = getFocusableNodes(cell, true);
|
|
11385
|
+
focusableNodes2.forEach((node) => {
|
|
11386
|
+
node.removeEventListener("focus", handleFocusableNodeFocus);
|
|
11387
|
+
});
|
|
11388
|
+
};
|
|
11389
|
+
}, [handleFocusableNodeFocus]);
|
|
11390
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { role: "gridcell", tag, ref: composedRef, onKeyDown: handleKeyDown, ...props });
|
|
11391
|
+
}
|
|
11392
|
+
);
|
|
11366
11393
|
const RawTh = (props) => /* @__PURE__ */ jsxRuntime.jsx(RawTd, { ...props, tag: "th" });
|
|
11367
11394
|
const RawThead = ({ children, ...props }) => {
|
|
11368
11395
|
const childrenClone = React__namespace.Children.toArray(children).map((child) => {
|
|
@@ -11413,14 +11440,18 @@ const SearchbarWrapper = styledComponents.styled.div`
|
|
|
11413
11440
|
&:focus-within {
|
|
11414
11441
|
${SearchIcon} {
|
|
11415
11442
|
fill: ${({ theme }) => theme.colors.primary600};
|
|
11416
|
-
path {
|
|
11417
|
-
}
|
|
11418
11443
|
}
|
|
11419
11444
|
}
|
|
11420
11445
|
`;
|
|
11421
11446
|
const SearchbarInput = styledComponents.styled(Input$2)`
|
|
11422
11447
|
border: 1px solid transparent;
|
|
11423
11448
|
|
|
11449
|
+
&:hover {
|
|
11450
|
+
button {
|
|
11451
|
+
cursor: pointer;
|
|
11452
|
+
}
|
|
11453
|
+
}
|
|
11454
|
+
|
|
11424
11455
|
${inputFocusStyle()}
|
|
11425
11456
|
`;
|
|
11426
11457
|
const Searchbar = React__namespace.forwardRef(
|
|
@@ -11440,7 +11471,17 @@ const Searchbar = React__namespace.forwardRef(
|
|
|
11440
11471
|
ref: actualRef,
|
|
11441
11472
|
value,
|
|
11442
11473
|
startAction: /* @__PURE__ */ jsxRuntime.jsx(SearchIcon, { "aria-hidden": true }),
|
|
11443
|
-
endAction: isCompleting ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11474
|
+
endAction: isCompleting ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11475
|
+
Action$1,
|
|
11476
|
+
{
|
|
11477
|
+
label: clearLabel,
|
|
11478
|
+
onClick: handleClear,
|
|
11479
|
+
onMouseDown: (e) => {
|
|
11480
|
+
e.preventDefault();
|
|
11481
|
+
},
|
|
11482
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, {})
|
|
11483
|
+
}
|
|
11484
|
+
) : void 0,
|
|
11444
11485
|
...props
|
|
11445
11486
|
}
|
|
11446
11487
|
)
|
|
@@ -11448,47 +11489,60 @@ const Searchbar = React__namespace.forwardRef(
|
|
|
11448
11489
|
}
|
|
11449
11490
|
);
|
|
11450
11491
|
const SearchForm = (props) => /* @__PURE__ */ jsxRuntime.jsx("form", { ...props, role: "search" });
|
|
11451
|
-
const
|
|
11492
|
+
const ButtonBox$1 = styledComponents.styled(Box)`
|
|
11493
|
+
display: inline-flex;
|
|
11494
|
+
border: none;
|
|
11495
|
+
|
|
11496
|
+
& > svg {
|
|
11497
|
+
height: 1.2rem;
|
|
11498
|
+
width: 1.2rem;
|
|
11499
|
+
}
|
|
11500
|
+
|
|
11501
|
+
& > svg path {
|
|
11502
|
+
fill: ${({ theme, ...p }) => p["aria-disabled"] ? theme.colors.neutral600 : theme.colors.primary600};
|
|
11503
|
+
}
|
|
11504
|
+
|
|
11505
|
+
&:hover {
|
|
11506
|
+
cursor: ${({ $iconAction }) => $iconAction ? "pointer" : "initial"};
|
|
11507
|
+
}
|
|
11508
|
+
`;
|
|
11509
|
+
const Tag = ({ children, icon, label, disabled = false, onClick, ...props }) => {
|
|
11452
11510
|
const handleClick = (e) => {
|
|
11453
11511
|
if (disabled || !onClick)
|
|
11454
11512
|
return;
|
|
11455
11513
|
onClick(e);
|
|
11456
11514
|
};
|
|
11457
11515
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11458
|
-
|
|
11516
|
+
Flex,
|
|
11459
11517
|
{
|
|
11460
|
-
|
|
11518
|
+
inline: true,
|
|
11461
11519
|
background: disabled ? "neutral200" : "primary100",
|
|
11462
11520
|
color: disabled ? "neutral700" : "primary600",
|
|
11463
11521
|
paddingLeft: 3,
|
|
11464
|
-
paddingRight:
|
|
11465
|
-
onClick: handleClick,
|
|
11466
|
-
"aria-disabled": disabled,
|
|
11467
|
-
disabled,
|
|
11468
|
-
borderWidth: "1px",
|
|
11469
|
-
borderStyle: "solid",
|
|
11522
|
+
paddingRight: 1,
|
|
11470
11523
|
borderColor: disabled ? "neutral300" : "primary200",
|
|
11471
11524
|
hasRadius: true,
|
|
11472
11525
|
height: "3.2rem",
|
|
11473
|
-
gap: 2,
|
|
11474
11526
|
...props,
|
|
11475
11527
|
children: [
|
|
11476
11528
|
/* @__PURE__ */ jsxRuntime.jsx(TagText, { $disabled: disabled, variant: "pi", fontWeight: "bold", children }),
|
|
11477
|
-
|
|
11529
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11530
|
+
ButtonBox$1,
|
|
11531
|
+
{
|
|
11532
|
+
tag: "button",
|
|
11533
|
+
disabled,
|
|
11534
|
+
"aria-disabled": disabled,
|
|
11535
|
+
"aria-label": label,
|
|
11536
|
+
padding: 2,
|
|
11537
|
+
onClick: handleClick,
|
|
11538
|
+
$iconAction: !!onClick,
|
|
11539
|
+
children: icon
|
|
11540
|
+
}
|
|
11541
|
+
)
|
|
11478
11542
|
]
|
|
11479
11543
|
}
|
|
11480
11544
|
);
|
|
11481
11545
|
};
|
|
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
11546
|
const TagText = styledComponents.styled(Typography)`
|
|
11493
11547
|
color: inherit;
|
|
11494
11548
|
border-right: 1px solid ${({ theme, $disabled }) => $disabled ? theme.colors.neutral300 : theme.colors.primary200};
|
|
@@ -11554,7 +11608,17 @@ const MultiSelect = React__namespace.forwardRef(
|
|
|
11554
11608
|
const value = typeof passedValue !== "undefined" && passedValue !== null ? passedValue : internalValue;
|
|
11555
11609
|
const renderTags = (arg) => {
|
|
11556
11610
|
if (arg && typeof arg === "object" && arg.value) {
|
|
11557
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11611
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11612
|
+
Tag,
|
|
11613
|
+
{
|
|
11614
|
+
tabIndex: -1,
|
|
11615
|
+
disabled,
|
|
11616
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.Cross, { width: `${14 / 16}rem`, height: `${14 / 16}rem` }),
|
|
11617
|
+
onClick: handleTagClick(arg.value),
|
|
11618
|
+
children: arg.textValue
|
|
11619
|
+
},
|
|
11620
|
+
arg.value
|
|
11621
|
+
);
|
|
11558
11622
|
}
|
|
11559
11623
|
return null;
|
|
11560
11624
|
};
|
|
@@ -11703,7 +11767,8 @@ const SubNavHeader = ({
|
|
|
11703
11767
|
},
|
|
11704
11768
|
onSubmit = () => {
|
|
11705
11769
|
},
|
|
11706
|
-
id
|
|
11770
|
+
id,
|
|
11771
|
+
placeholder
|
|
11707
11772
|
}) => {
|
|
11708
11773
|
const [isSearchOpen, setSearchOpen] = React__namespace.useState(false);
|
|
11709
11774
|
const previousSearchOpenValue = uiPrimitives.usePrev(isSearchOpen);
|
|
@@ -11743,7 +11808,7 @@ const SubNavHeader = ({
|
|
|
11743
11808
|
name: "searchbar",
|
|
11744
11809
|
value,
|
|
11745
11810
|
onChange,
|
|
11746
|
-
placeholder
|
|
11811
|
+
placeholder,
|
|
11747
11812
|
onKeyDown: handleKeyDown,
|
|
11748
11813
|
ref: searchRef,
|
|
11749
11814
|
onBlur: handleBlur,
|
|
@@ -11757,7 +11822,7 @@ const SubNavHeader = ({
|
|
|
11757
11822
|
] });
|
|
11758
11823
|
}
|
|
11759
11824
|
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: [
|
|
11825
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Flex, { justifyContent: "space-between", alignItems: "flex-start", width: "100%", gap: 2, children: [
|
|
11761
11826
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "beta", tag, children: label }),
|
|
11762
11827
|
searchable && /* @__PURE__ */ jsxRuntime.jsx(IconButton, { ref: searchButtonRef, onClick: toggleSearch, label: searchLabel, children: /* @__PURE__ */ jsxRuntime.jsx(icons.Search, {}) })
|
|
11763
11828
|
] }),
|
|
@@ -11792,7 +11857,7 @@ const CustomBullet = styledComponents.styled.span`
|
|
|
11792
11857
|
background-color: ${({ theme, $active }) => $active ? theme.colors.primary600 : theme.colors.neutral600};
|
|
11793
11858
|
border-radius: 50%;
|
|
11794
11859
|
`;
|
|
11795
|
-
const SubNavLinkWrapper = styledComponents.styled(
|
|
11860
|
+
const SubNavLinkWrapper = styledComponents.styled(BaseLinkImpl)`
|
|
11796
11861
|
display: flex;
|
|
11797
11862
|
align-items: center;
|
|
11798
11863
|
justify-content: space-between;
|
|
@@ -12032,7 +12097,7 @@ const LabelTypography = styledComponents.styled(Typography)`
|
|
|
12032
12097
|
}
|
|
12033
12098
|
`;
|
|
12034
12099
|
const [TabsProvider, useTabs] = createContext("Tabs");
|
|
12035
|
-
const Root = React__namespace.forwardRef(
|
|
12100
|
+
const Root$1 = React__namespace.forwardRef(
|
|
12036
12101
|
({ disabled = false, variant: variant2 = "regular", hasError, ...props }, forwardedRef) => {
|
|
12037
12102
|
return /* @__PURE__ */ jsxRuntime.jsx(TabsProvider, { disabled, hasError, variant: variant2, children: /* @__PURE__ */ jsxRuntime.jsx(TabsRoot, { ref: forwardedRef, ...props }) });
|
|
12038
12103
|
}
|
|
@@ -12071,10 +12136,6 @@ const TabBar = styledComponents.styled.span`
|
|
|
12071
12136
|
left: 0;
|
|
12072
12137
|
opacity: 0;
|
|
12073
12138
|
height: 0.2rem;
|
|
12074
|
-
|
|
12075
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
12076
|
-
transition: ${(props) => `opacity 200ms ${props.theme.motion.easings.authenticMotion}`};
|
|
12077
|
-
}
|
|
12078
12139
|
`;
|
|
12079
12140
|
const TriggerTypography = styledComponents.styled(Typography)``;
|
|
12080
12141
|
const TabsTrigger = styledComponents.styled(Tabs__namespace.Trigger)`
|
|
@@ -12128,10 +12189,6 @@ const TabsTrigger = styledComponents.styled(Tabs__namespace.Trigger)`
|
|
|
12128
12189
|
}
|
|
12129
12190
|
}}
|
|
12130
12191
|
|
|
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
12192
|
&[data-disabled] {
|
|
12136
12193
|
cursor: not-allowed;
|
|
12137
12194
|
color: ${(props) => props.theme.colors.neutral400};
|
|
@@ -12158,7 +12215,7 @@ const Tabs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
|
|
|
12158
12215
|
__proto__: null,
|
|
12159
12216
|
Content,
|
|
12160
12217
|
List,
|
|
12161
|
-
Root,
|
|
12218
|
+
Root: Root$1,
|
|
12162
12219
|
Trigger
|
|
12163
12220
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
12164
12221
|
const TableContainer = styledComponents.styled(Box)`
|
|
@@ -12198,7 +12255,7 @@ const TableBox = styledComponents.styled(Box)`
|
|
|
12198
12255
|
const ScrollContainer = styledComponents.styled(Box)`
|
|
12199
12256
|
overflow-x: auto;
|
|
12200
12257
|
`;
|
|
12201
|
-
const Table = ({ footer, ...props }) => {
|
|
12258
|
+
const Table = React__namespace.forwardRef(({ footer, ...props }, forwardedRef) => {
|
|
12202
12259
|
const tableRef = React__namespace.useRef(null);
|
|
12203
12260
|
const [overflowing, setOverflowing] = React__namespace.useState();
|
|
12204
12261
|
const handleScroll = (e) => {
|
|
@@ -12221,10 +12278,10 @@ const Table = ({ footer, ...props }) => {
|
|
|
12221
12278
|
}
|
|
12222
12279
|
}, []);
|
|
12223
12280
|
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 }) }) }),
|
|
12281
|
+
/* @__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
12282
|
footer
|
|
12226
12283
|
] });
|
|
12227
|
-
};
|
|
12284
|
+
});
|
|
12228
12285
|
const TbodyWrapper = styledComponents.styled(RawTbody)`
|
|
12229
12286
|
& tr:last-of-type {
|
|
12230
12287
|
border-bottom: none;
|
|
@@ -12265,7 +12322,6 @@ const Tr = (props) => {
|
|
|
12265
12322
|
const CellWrapper = styledComponents.styled(RawTd)`
|
|
12266
12323
|
vertical-align: middle;
|
|
12267
12324
|
text-align: left;
|
|
12268
|
-
color: ${({ theme }) => theme.colors.neutral600};
|
|
12269
12325
|
outline-offset: -4px;
|
|
12270
12326
|
|
|
12271
12327
|
/**
|
|
@@ -12275,15 +12331,15 @@ const CellWrapper = styledComponents.styled(RawTd)`
|
|
|
12275
12331
|
vertical-align: sub;
|
|
12276
12332
|
}
|
|
12277
12333
|
`;
|
|
12278
|
-
const Th = ({ children, action, ...props }) => {
|
|
12279
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CellWrapper, { as: RawTh, ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { children: [
|
|
12334
|
+
const Th = React__namespace.forwardRef(({ children, action, ...props }, forwardedRef) => {
|
|
12335
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CellWrapper, { color: "neutral600", as: RawTh, ref: forwardedRef, ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { children: [
|
|
12280
12336
|
children,
|
|
12281
12337
|
action
|
|
12282
12338
|
] }) });
|
|
12283
|
-
};
|
|
12284
|
-
const Td = ({ children, ...props }) => {
|
|
12285
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CellWrapper, { ...props, children });
|
|
12286
|
-
};
|
|
12339
|
+
});
|
|
12340
|
+
const Td = React__namespace.forwardRef(({ children, ...props }, forwardedRef) => {
|
|
12341
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CellWrapper, { color: "neutral800", ref: forwardedRef, ...props, children });
|
|
12342
|
+
});
|
|
12287
12343
|
const IconBox = styledComponents.styled(Box)`
|
|
12288
12344
|
height: 2.4rem;
|
|
12289
12345
|
width: 2.4rem;
|
|
@@ -12316,6 +12372,28 @@ const TFooter = ({ children, icon, ...props }) => {
|
|
|
12316
12372
|
] }) })
|
|
12317
12373
|
] });
|
|
12318
12374
|
};
|
|
12375
|
+
const TextButton = forwardRef(
|
|
12376
|
+
({ children, startIcon, endIcon, disabled = false, loading = false, ...props }, ref) => {
|
|
12377
|
+
const isDisabled = disabled || loading;
|
|
12378
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12379
|
+
TextButtonWrapper,
|
|
12380
|
+
{
|
|
12381
|
+
ref,
|
|
12382
|
+
disabled: isDisabled,
|
|
12383
|
+
"aria-disabled": isDisabled,
|
|
12384
|
+
tag: "button",
|
|
12385
|
+
type: "button",
|
|
12386
|
+
gap: 2,
|
|
12387
|
+
...props,
|
|
12388
|
+
children: [
|
|
12389
|
+
loading ? /* @__PURE__ */ jsxRuntime.jsx(LoadingWrapper, { "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx(icons.Loader, {}) }) : startIcon,
|
|
12390
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "pi", children }),
|
|
12391
|
+
endIcon
|
|
12392
|
+
]
|
|
12393
|
+
}
|
|
12394
|
+
);
|
|
12395
|
+
}
|
|
12396
|
+
);
|
|
12319
12397
|
const rotation = styledComponents.keyframes`
|
|
12320
12398
|
from {
|
|
12321
12399
|
transform: rotate(0deg);
|
|
@@ -12324,51 +12402,24 @@ const rotation = styledComponents.keyframes`
|
|
|
12324
12402
|
transform: rotate(359deg);
|
|
12325
12403
|
}
|
|
12326
12404
|
`;
|
|
12327
|
-
const LoadingWrapper = styledComponents.styled.
|
|
12405
|
+
const LoadingWrapper = styledComponents.styled.span`
|
|
12406
|
+
display: flex;
|
|
12328
12407
|
animation: ${rotation} 2s infinite linear;
|
|
12329
12408
|
will-change: transform;
|
|
12330
12409
|
`;
|
|
12331
12410
|
const TextButtonWrapper = styledComponents.styled(Flex)`
|
|
12332
12411
|
border: none;
|
|
12412
|
+
background-color: transparent;
|
|
12413
|
+
color: ${(props) => props.theme.colors.primary600};
|
|
12414
|
+
cursor: pointer;
|
|
12333
12415
|
|
|
12334
12416
|
&[aria-disabled='true'] {
|
|
12335
12417
|
pointer-events: none;
|
|
12336
|
-
|
|
12337
|
-
fill: ${({ theme }) => theme.colors.neutral600};
|
|
12338
|
-
}
|
|
12339
|
-
}
|
|
12340
|
-
|
|
12341
|
-
svg path {
|
|
12342
|
-
fill: ${({ theme }) => theme.colors.primary600};
|
|
12418
|
+
color: ${(props) => props.theme.colors.neutral600};
|
|
12343
12419
|
}
|
|
12344
12420
|
|
|
12345
12421
|
${focus}
|
|
12346
12422
|
`;
|
|
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
12423
|
const TextInput = React__namespace.forwardRef((props, ref) => {
|
|
12373
12424
|
return /* @__PURE__ */ jsxRuntime.jsx(Input$2, { ref, ...props });
|
|
12374
12425
|
});
|
|
@@ -12386,7 +12437,7 @@ const Textarea = React__namespace.forwardRef(
|
|
|
12386
12437
|
} else if (field.hint) {
|
|
12387
12438
|
ariaDescription = `${id}-hint`;
|
|
12388
12439
|
}
|
|
12389
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Wrapper, { borderColor: hasError ? "danger600" : "neutral200", $hasError: hasError, hasRadius: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12440
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Wrapper$1, { borderColor: hasError ? "danger600" : "neutral200", $hasError: hasError, hasRadius: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12390
12441
|
TextareaElement,
|
|
12391
12442
|
{
|
|
12392
12443
|
"aria-invalid": hasError,
|
|
@@ -12397,11 +12448,11 @@ const Textarea = React__namespace.forwardRef(
|
|
|
12397
12448
|
disabled,
|
|
12398
12449
|
fontSize: 2,
|
|
12399
12450
|
hasRadius: true,
|
|
12400
|
-
height: "10.5rem",
|
|
12401
12451
|
ref,
|
|
12402
12452
|
lineHeight: 4,
|
|
12403
12453
|
padding: 4,
|
|
12404
12454
|
width: "100%",
|
|
12455
|
+
height: "100%",
|
|
12405
12456
|
id,
|
|
12406
12457
|
name,
|
|
12407
12458
|
"aria-describedby": ariaDescription,
|
|
@@ -12410,7 +12461,8 @@ const Textarea = React__namespace.forwardRef(
|
|
|
12410
12461
|
) });
|
|
12411
12462
|
}
|
|
12412
12463
|
);
|
|
12413
|
-
const Wrapper = styledComponents.styled(Box)`
|
|
12464
|
+
const Wrapper$1 = styledComponents.styled(Box)`
|
|
12465
|
+
height: 10.5rem;
|
|
12414
12466
|
${inputFocusStyle()}
|
|
12415
12467
|
`;
|
|
12416
12468
|
const TextareaElement = styledComponents.styled(Box)`
|
|
@@ -12555,6 +12607,39 @@ const Input = styledComponents.styled.input`
|
|
|
12555
12607
|
z-index: 0;
|
|
12556
12608
|
width: 100%;
|
|
12557
12609
|
`;
|
|
12610
|
+
const Root = forwardRef((props, forwardedRef) => {
|
|
12611
|
+
const { gap = 0, gridCols = 12, ...rest } = props;
|
|
12612
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Wrapper, { ref: forwardedRef, $gap: gap, $gridCols: gridCols, ...rest });
|
|
12613
|
+
});
|
|
12614
|
+
const Wrapper = styledComponents.styled(Box)`
|
|
12615
|
+
display: grid;
|
|
12616
|
+
grid-template-columns: repeat(${({ $gridCols }) => $gridCols}, 1fr);
|
|
12617
|
+
${({ theme, $gap }) => handleResponsiveValues({ gap: $gap }, theme)}
|
|
12618
|
+
`;
|
|
12619
|
+
const ItemImpl = forwardRef(
|
|
12620
|
+
({ col, s, xs, m, ...props }, forwardedRef) => /* @__PURE__ */ jsxRuntime.jsx(Item, { ref: forwardedRef, $col: col, $s: s, $xs: xs, $m: m, ...props })
|
|
12621
|
+
);
|
|
12622
|
+
const Item = styledComponents.styled(Flex)`
|
|
12623
|
+
grid-column: span ${({ $xs }) => $xs ?? 12};
|
|
12624
|
+
max-width: 100%;
|
|
12625
|
+
|
|
12626
|
+
${({ theme }) => theme.breakpoints.small} {
|
|
12627
|
+
grid-column: span ${({ $s, $xs }) => $s ?? $xs ?? 12};
|
|
12628
|
+
}
|
|
12629
|
+
|
|
12630
|
+
${({ theme }) => theme.breakpoints.medium} {
|
|
12631
|
+
grid-column: span ${({ $m, $s, $xs }) => $m ?? $s ?? $xs ?? 12};
|
|
12632
|
+
}
|
|
12633
|
+
|
|
12634
|
+
${({ theme }) => theme.breakpoints.large} {
|
|
12635
|
+
grid-column: span ${({ $col, $m, $s, $xs }) => $col ?? $m ?? $s ?? $xs ?? 12};
|
|
12636
|
+
}
|
|
12637
|
+
`;
|
|
12638
|
+
const Grid = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
12639
|
+
__proto__: null,
|
|
12640
|
+
Item: ItemImpl,
|
|
12641
|
+
Root
|
|
12642
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
12558
12643
|
const defaultState = {
|
|
12559
12644
|
x: 0,
|
|
12560
12645
|
y: 0,
|
|
@@ -12587,6 +12672,56 @@ function useMeasure() {
|
|
|
12587
12672
|
}, [element, observer]);
|
|
12588
12673
|
return [ref, rect];
|
|
12589
12674
|
}
|
|
12675
|
+
const FocusTrap = ({ onEscape, restoreFocus = true, skipAutoFocus = false, ...props }) => {
|
|
12676
|
+
const trappedRef = React__namespace.useRef(null);
|
|
12677
|
+
React__namespace.useEffect(() => {
|
|
12678
|
+
let currentFocus = null;
|
|
12679
|
+
if (restoreFocus) {
|
|
12680
|
+
currentFocus = document.activeElement;
|
|
12681
|
+
}
|
|
12682
|
+
return () => {
|
|
12683
|
+
if (currentFocus) {
|
|
12684
|
+
currentFocus.focus();
|
|
12685
|
+
}
|
|
12686
|
+
};
|
|
12687
|
+
}, [restoreFocus]);
|
|
12688
|
+
React__namespace.useEffect(() => {
|
|
12689
|
+
if (!trappedRef.current || skipAutoFocus)
|
|
12690
|
+
return;
|
|
12691
|
+
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
12692
|
+
if (focusableChildren.length > 0) {
|
|
12693
|
+
const firstElement = focusableChildren[0];
|
|
12694
|
+
firstElement.focus();
|
|
12695
|
+
} else {
|
|
12696
|
+
console.warn(
|
|
12697
|
+
"[FocusTrap]: it seems there are no focusable elements in the focus trap tree. Make sure there s at least one."
|
|
12698
|
+
);
|
|
12699
|
+
}
|
|
12700
|
+
}, [skipAutoFocus]);
|
|
12701
|
+
const handleKeyDown = (e) => {
|
|
12702
|
+
if (e.key === KeyboardKeys.ESCAPE && onEscape) {
|
|
12703
|
+
onEscape();
|
|
12704
|
+
return;
|
|
12705
|
+
}
|
|
12706
|
+
if (e.key !== KeyboardKeys.TAB)
|
|
12707
|
+
return;
|
|
12708
|
+
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
12709
|
+
if (focusableChildren.length > 0) {
|
|
12710
|
+
const firstElement = focusableChildren[0];
|
|
12711
|
+
const lastElement = focusableChildren[focusableChildren.length - 1];
|
|
12712
|
+
if (e.shiftKey) {
|
|
12713
|
+
if (firstElement === document.activeElement) {
|
|
12714
|
+
e.preventDefault();
|
|
12715
|
+
lastElement.focus();
|
|
12716
|
+
}
|
|
12717
|
+
} else if (lastElement === document.activeElement) {
|
|
12718
|
+
e.preventDefault();
|
|
12719
|
+
firstElement.focus();
|
|
12720
|
+
}
|
|
12721
|
+
}
|
|
12722
|
+
};
|
|
12723
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: trappedRef, onKeyDown: handleKeyDown, ...props });
|
|
12724
|
+
};
|
|
12590
12725
|
const KeyboardNavigable = ({ tagName, attributeName = "", ...props }) => {
|
|
12591
12726
|
const isValidFocusedElement = () => {
|
|
12592
12727
|
const focused = document.activeElement;
|
|
@@ -12673,8 +12808,7 @@ exports.Accordion = Accordion;
|
|
|
12673
12808
|
exports.Alert = Alert;
|
|
12674
12809
|
exports.Avatar = Avatar;
|
|
12675
12810
|
exports.Badge = Badge;
|
|
12676
|
-
exports.
|
|
12677
|
-
exports.BaseLink = BaseLink;
|
|
12811
|
+
exports.BaseLink = BaseLinkImpl;
|
|
12678
12812
|
exports.Box = Box;
|
|
12679
12813
|
exports.Breadcrumbs = Breadcrumbs;
|
|
12680
12814
|
exports.Button = Button;
|