@strapi/design-system 2.0.0-beta.6 → 2.0.0-rc.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/dist/components/Accordion/Accordion.d.ts +1 -1
  2. package/dist/components/Accordion/Accordion.d.ts.map +1 -1
  3. package/dist/components/Alert/Alert.d.ts +1 -1
  4. package/dist/components/Alert/Alert.d.ts.map +1 -1
  5. package/dist/components/Avatar/Avatar.d.ts +1 -1
  6. package/dist/components/Avatar/Avatar.d.ts.map +1 -1
  7. package/dist/components/Badge/Badge.d.ts +4 -4
  8. package/dist/components/Badge/Badge.d.ts.map +1 -1
  9. package/dist/components/BaseLink/BaseLink.d.ts +3 -3
  10. package/dist/components/BaseLink/BaseLink.d.ts.map +1 -1
  11. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +3 -5
  12. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
  13. package/dist/components/Breadcrumbs/Crumb.d.ts +3 -5
  14. package/dist/components/Breadcrumbs/Crumb.d.ts.map +1 -1
  15. package/dist/components/Breadcrumbs/CrumbLink.d.ts +2 -4
  16. package/dist/components/Breadcrumbs/CrumbLink.d.ts.map +1 -1
  17. package/dist/components/Breadcrumbs/CrumbSimpleMenu.d.ts +33 -6
  18. package/dist/components/Breadcrumbs/CrumbSimpleMenu.d.ts.map +1 -1
  19. package/dist/components/Button/Button.d.ts +3 -2
  20. package/dist/components/Button/Button.d.ts.map +1 -1
  21. package/dist/components/Button/utils.d.ts.map +1 -1
  22. package/dist/components/Card/Card.d.ts +3 -2
  23. package/dist/components/Card/Card.d.ts.map +1 -1
  24. package/dist/components/Card/CardAction.d.ts +3 -2
  25. package/dist/components/Card/CardAction.d.ts.map +1 -1
  26. package/dist/components/Card/CardBody.d.ts +1 -1
  27. package/dist/components/Card/CardBody.d.ts.map +1 -1
  28. package/dist/components/Card/CardCheckbox.d.ts +2 -1
  29. package/dist/components/Card/CardCheckbox.d.ts.map +1 -1
  30. package/dist/components/Card/CardContent.d.ts +1 -1
  31. package/dist/components/Card/CardContent.d.ts.map +1 -1
  32. package/dist/components/Card/CardHeader.d.ts +1 -1
  33. package/dist/components/Card/CardHeader.d.ts.map +1 -1
  34. package/dist/components/Card/CardTimer.d.ts +1 -1
  35. package/dist/components/Card/CardTimer.d.ts.map +1 -1
  36. package/dist/components/Card/CardTitle.d.ts +1 -1
  37. package/dist/components/Card/CardTitle.d.ts.map +1 -1
  38. package/dist/components/CarouselInput/Carousel.d.ts +1 -1
  39. package/dist/components/CarouselInput/Carousel.d.ts.map +1 -1
  40. package/dist/components/CarouselInput/CarouselActions.d.ts +1 -1
  41. package/dist/components/CarouselInput/CarouselActions.d.ts.map +1 -1
  42. package/dist/components/CarouselInput/CarouselImage.d.ts +1 -1
  43. package/dist/components/CarouselInput/CarouselImage.d.ts.map +1 -1
  44. package/dist/components/CarouselInput/CarouselInput.d.ts.map +1 -1
  45. package/dist/components/CarouselInput/CarouselSlide.d.ts +1 -1
  46. package/dist/components/CarouselInput/CarouselSlide.d.ts.map +1 -1
  47. package/dist/components/Combobox/Combobox.d.ts.map +1 -1
  48. package/dist/components/DatePicker/DatePicker.d.ts +1 -1
  49. package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
  50. package/dist/components/DateTimePicker/DateTimePicker.d.ts.map +1 -1
  51. package/dist/components/Dialog/Dialog.d.ts +2 -2
  52. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  53. package/dist/components/Divider/Divider.d.ts +1 -1
  54. package/dist/components/Divider/Divider.d.ts.map +1 -1
  55. package/dist/components/EmptyStateLayout/EmptyStateLayout.d.ts +3 -3
  56. package/dist/components/EmptyStateLayout/EmptyStateLayout.d.ts.map +1 -1
  57. package/dist/components/Field/Field.d.ts +2 -2
  58. package/dist/components/Field/Field.d.ts.map +1 -1
  59. package/dist/components/IconButton/IconButton.d.ts +7 -18
  60. package/dist/components/IconButton/IconButton.d.ts.map +1 -1
  61. package/dist/components/JSONInput/JSONInput.d.ts +1 -1
  62. package/dist/components/JSONInput/JSONInput.d.ts.map +1 -1
  63. package/dist/components/Link/Link.d.ts.map +1 -1
  64. package/dist/components/LinkButton/LinkButton.d.ts +4 -10
  65. package/dist/components/LinkButton/LinkButton.d.ts.map +1 -1
  66. package/dist/components/Main/Main.d.ts +1 -1
  67. package/dist/components/Main/Main.d.ts.map +1 -1
  68. package/dist/components/Modal/Modal.d.ts +2 -2
  69. package/dist/components/Modal/Modal.d.ts.map +1 -1
  70. package/dist/components/NumberInput/NumberInput.d.ts.map +1 -1
  71. package/dist/components/Pagination/components.d.ts +1 -1
  72. package/dist/components/Pagination/components.d.ts.map +1 -1
  73. package/dist/components/Popover/Popover.d.ts +1 -1
  74. package/dist/components/Popover/Popover.d.ts.map +1 -1
  75. package/dist/components/ProgressBar/ProgressBar.d.ts +1 -2
  76. package/dist/components/ProgressBar/ProgressBar.d.ts.map +1 -1
  77. package/dist/components/RawTable/RawCell.d.ts +2 -2
  78. package/dist/components/RawTable/RawCell.d.ts.map +1 -1
  79. package/dist/components/RawTable/RawTable.d.ts +1 -1
  80. package/dist/components/RawTable/RawTable.d.ts.map +1 -1
  81. package/dist/components/RawTable/RawTr.d.ts +1 -1
  82. package/dist/components/RawTable/RawTr.d.ts.map +1 -1
  83. package/dist/components/Searchbar/Searchbar.d.ts.map +1 -1
  84. package/dist/components/Select/SelectParts.d.ts +2 -2
  85. package/dist/components/Select/SelectParts.d.ts.map +1 -1
  86. package/dist/components/SimpleMenu/Menu.d.ts +19 -7
  87. package/dist/components/SimpleMenu/Menu.d.ts.map +1 -1
  88. package/dist/components/SimpleMenu/SimpleMenu.d.ts +31 -4
  89. package/dist/components/SimpleMenu/SimpleMenu.d.ts.map +1 -1
  90. package/dist/components/Status/Status.d.ts +1 -1
  91. package/dist/components/Status/Status.d.ts.map +1 -1
  92. package/dist/components/SubNav/SubNav.d.ts +1 -1
  93. package/dist/components/SubNav/SubNav.d.ts.map +1 -1
  94. package/dist/components/SubNav/SubNavHeader.d.ts +3 -3
  95. package/dist/components/SubNav/SubNavHeader.d.ts.map +1 -1
  96. package/dist/components/SubNav/SubNavLink.d.ts.map +1 -1
  97. package/dist/components/SubNav/SubNavSections.d.ts +1 -1
  98. package/dist/components/SubNav/SubNavSections.d.ts.map +1 -1
  99. package/dist/components/Table/Cell.d.ts +2 -2
  100. package/dist/components/Table/Cell.d.ts.map +1 -1
  101. package/dist/components/Table/TFooter.d.ts +1 -1
  102. package/dist/components/Table/TFooter.d.ts.map +1 -1
  103. package/dist/components/Table/Table.d.ts +1 -1
  104. package/dist/components/Table/Table.d.ts.map +1 -1
  105. package/dist/components/Tag/Tag.d.ts +6 -3
  106. package/dist/components/Tag/Tag.d.ts.map +1 -1
  107. package/dist/components/TextButton/TextButton.d.ts +9 -4
  108. package/dist/components/TextButton/TextButton.d.ts.map +1 -1
  109. package/dist/components/Textarea/Textarea.d.ts +1 -1
  110. package/dist/components/Textarea/Textarea.d.ts.map +1 -1
  111. package/dist/components/Toggle/Toggle.d.ts.map +1 -1
  112. package/dist/components/index.d.ts +0 -6
  113. package/dist/components/index.d.ts.map +1 -1
  114. package/dist/helpers/handleResponsiveValues.d.ts +30 -15
  115. package/dist/helpers/handleResponsiveValues.d.ts.map +1 -1
  116. package/dist/helpers/theme.d.ts +1 -1
  117. package/dist/helpers/theme.d.ts.map +1 -1
  118. package/dist/index.d.ts +1 -0
  119. package/dist/index.d.ts.map +1 -1
  120. package/dist/index.js +1044 -953
  121. package/dist/index.js.map +1 -1
  122. package/dist/index.mjs +1045 -954
  123. package/dist/index.mjs.map +1 -1
  124. package/dist/primitives/Box/Box.d.ts +84 -0
  125. package/dist/primitives/Box/Box.d.ts.map +1 -0
  126. package/dist/primitives/Box/index.d.ts.map +1 -0
  127. package/dist/{components → primitives}/Flex/Flex.d.ts +7 -8
  128. package/dist/primitives/Flex/Flex.d.ts.map +1 -0
  129. package/dist/primitives/Flex/index.d.ts.map +1 -0
  130. package/dist/{components → primitives}/Grid/Grid.d.ts +6 -4
  131. package/dist/primitives/Grid/Grid.d.ts.map +1 -0
  132. package/dist/primitives/Grid/index.d.ts.map +1 -0
  133. package/dist/{components → primitives}/Typography/Typography.d.ts +5 -9
  134. package/dist/primitives/Typography/Typography.d.ts.map +1 -0
  135. package/dist/primitives/Typography/index.d.ts.map +1 -0
  136. package/dist/primitives/index.d.ts +5 -0
  137. package/dist/primitives/index.d.ts.map +1 -0
  138. package/dist/styles/global.d.ts.map +1 -1
  139. package/dist/themes/common-theme.d.ts +8 -4
  140. package/dist/themes/common-theme.d.ts.map +1 -1
  141. package/dist/utilities/KeyboardNavigable/KeyboardNavigable.d.ts +1 -1
  142. package/dist/utilities/KeyboardNavigable/KeyboardNavigable.d.ts.map +1 -1
  143. package/dist/utilities/Portal/Portal.d.ts +1 -1
  144. package/package.json +7 -7
  145. package/dist/components/BaseButton/BaseButton.d.ts +0 -10
  146. package/dist/components/BaseButton/BaseButton.d.ts.map +0 -1
  147. package/dist/components/BaseButton/index.d.ts +0 -2
  148. package/dist/components/BaseButton/index.d.ts.map +0 -1
  149. package/dist/components/Box/Box.d.ts +0 -102
  150. package/dist/components/Box/Box.d.ts.map +0 -1
  151. package/dist/components/Box/index.d.ts.map +0 -1
  152. package/dist/components/Flex/Flex.d.ts.map +0 -1
  153. package/dist/components/Flex/index.d.ts.map +0 -1
  154. package/dist/components/Grid/Grid.d.ts.map +0 -1
  155. package/dist/components/Grid/index.d.ts.map +0 -1
  156. package/dist/components/Typography/Typography.d.ts.map +0 -1
  157. package/dist/components/Typography/index.d.ts.map +0 -1
  158. /package/dist/{components → primitives}/Box/index.d.ts +0 -0
  159. /package/dist/{components → primitives}/Flex/index.d.ts +0 -0
  160. /package/dist/{components → primitives}/Grid/index.d.ts +0 -0
  161. /package/dist/{components → primitives}/Typography/index.d.ts +0 -0
package/dist/index.mjs CHANGED
@@ -48,32 +48,6 @@ const createContext = (rootComponentName, defaultContext) => {
48
48
  Provider2.displayName = `${rootComponentName}Provider`;
49
49
  return [Provider2, useContext];
50
50
  };
51
- const handleResponsiveValues = (property, value, theme) => {
52
- if (!value) {
53
- return void 0;
54
- }
55
- if (typeof value === "object") {
56
- const transformedArray = Array.isArray(value) ? value : [value?.desktop, value?.tablet, value?.mobile];
57
- const spaces = transformedArray.reduce((acc, curr, index) => {
58
- if (curr) {
59
- switch (index) {
60
- case 0:
61
- return `${acc}${property}: ${theme.spaces[curr]};`;
62
- case 1:
63
- return `${acc}${theme.mediaQueries.tablet}{${property}: ${theme.spaces[curr]};}`;
64
- case 2:
65
- return `${acc}${theme.mediaQueries.mobile}{${property}: ${theme.spaces[curr]};}`;
66
- default:
67
- return acc;
68
- }
69
- }
70
- return acc;
71
- }, "");
72
- return spaces;
73
- }
74
- const realValue = theme.spaces[value] ?? value;
75
- return `${property}: ${realValue};`;
76
- };
77
51
  function isKeyOf(o, s) {
78
52
  if (typeof o === "string") {
79
53
  return false;
@@ -84,11 +58,166 @@ function isObject(item) {
84
58
  return item && typeof item === "object" && !Array.isArray(item);
85
59
  }
86
60
  function extractStyleFromTheme(themeSection, key, defaultValue) {
87
- if (key && isKeyOf(themeSection, key)) {
61
+ if (themeSection && key && isKeyOf(themeSection, key)) {
88
62
  return themeSection[key];
89
63
  }
90
64
  return defaultValue;
91
65
  }
66
+ const mappedCSSProps = {
67
+ padding: ["padding-block-start", "padding-inline-end", "padding-block-end", "padding-inline-start"],
68
+ paddingTop: "padding-block-start",
69
+ paddingRight: "padding-inline-end",
70
+ paddingBottom: "padding-block-end",
71
+ paddingLeft: "padding-inline-start",
72
+ margin: ["margin-block-start", "margin-inline-end", "margin-block-end", "margin-inline-start"],
73
+ marginLeft: "margin-inline-start",
74
+ marginRight: "margin-inline-end",
75
+ marginTop: "margin-block-start",
76
+ marginBottom: "margin-block-end",
77
+ borderRadius: "border-radius",
78
+ borderStyle: "border-style",
79
+ borderWidth: "border-width",
80
+ borderColor: "border-color",
81
+ fontSize: "font-size",
82
+ fontWeight: "font-weight",
83
+ lineHeight: "line-height",
84
+ zIndex: "z-index",
85
+ boxShadow: "box-shadow",
86
+ pointerEvents: "pointer-events",
87
+ textAlign: "text-align",
88
+ textTransform: "text-transform",
89
+ textDecoration: "text-decoration",
90
+ flexGrow: "flex-grow",
91
+ flexShrink: "flex-shrink",
92
+ flexBasis: "flex-basis",
93
+ minWidth: "min-width",
94
+ maxWidth: "max-width",
95
+ minHeight: "min-height",
96
+ maxHeight: "max-height",
97
+ flexDirection: "flex-direction",
98
+ flexWrap: "flex-wrap",
99
+ justifyContent: "justify-content",
100
+ alignItems: "align-items"
101
+ };
102
+ const fillCssValues = (value) => {
103
+ const [top, right, bottom, left] = value;
104
+ const rightValue = right ?? top;
105
+ const bottomValue = bottom ?? top;
106
+ const leftValue = left ?? rightValue;
107
+ return [top, rightValue, bottomValue, leftValue];
108
+ };
109
+ function getThemeSection(key, theme) {
110
+ switch (key) {
111
+ case "gap":
112
+ case "padding":
113
+ case "margin":
114
+ case "paddingTop":
115
+ case "paddingLeft":
116
+ case "paddingRight":
117
+ case "paddingBottom":
118
+ case "marginTop":
119
+ case "marginLeft":
120
+ case "marginRight":
121
+ case "marginBottom":
122
+ case "left":
123
+ case "right":
124
+ case "top":
125
+ case "bottom":
126
+ case "width":
127
+ case "maxWidth":
128
+ case "minWidth":
129
+ case "height":
130
+ case "maxHeight":
131
+ case "minHeight":
132
+ case "borderRadius":
133
+ case "borderWidth":
134
+ return theme.spaces;
135
+ case "color":
136
+ case "background":
137
+ case "borderColor":
138
+ return theme.colors;
139
+ case "fontSize":
140
+ return theme.fontSizes;
141
+ case "fontWeight":
142
+ return theme.fontWeights;
143
+ case "lineHeight":
144
+ return theme.lineHeights;
145
+ case "zIndex":
146
+ return theme.zIndices;
147
+ case "boxShadow":
148
+ return theme.shadows;
149
+ default:
150
+ return null;
151
+ }
152
+ }
153
+ const handleResponsiveValues = (values, theme) => {
154
+ const stylesByBreakpoint = Object.entries(values).reduce(
155
+ (acc, curr) => {
156
+ const [key, value] = curr;
157
+ const themeSection = getThemeSection(key, theme);
158
+ const cssProperty = Object.prototype.hasOwnProperty.call(mappedCSSProps, key) ? mappedCSSProps[key] : key;
159
+ if (cssProperty && (value || value === 0)) {
160
+ if (typeof value === "object" && !Array.isArray(value)) {
161
+ Object.entries(value).forEach(([breakpointName, breakpointValue]) => {
162
+ acc[breakpointName] = {
163
+ ...acc[breakpointName],
164
+ ...convertCssPropertiesToCssValues(cssProperty, breakpointValue, themeSection)
165
+ };
166
+ });
167
+ } else {
168
+ acc.initial = {
169
+ ...acc.initial,
170
+ ...convertCssPropertiesToCssValues(cssProperty, value, themeSection)
171
+ };
172
+ }
173
+ }
174
+ return acc;
175
+ },
176
+ {
177
+ initial: {},
178
+ small: {},
179
+ medium: {},
180
+ large: {}
181
+ }
182
+ );
183
+ return Object.entries(stylesByBreakpoint).reduce((acc, [key, value]) => {
184
+ if (value && Object.keys(value).length > 0) {
185
+ const breakpointStyles = Object.entries(value).reduce((arr, [property, value2]) => {
186
+ arr.push(`${property}: ${value2};`);
187
+ return arr;
188
+ }, []).join("\n");
189
+ if (key === "initial") {
190
+ acc.push(breakpointStyles);
191
+ } else {
192
+ acc.push(`${theme.breakpoints[key]}{ ${breakpointStyles} }`);
193
+ }
194
+ }
195
+ return acc;
196
+ }, []).join("\n");
197
+ };
198
+ const convertCssPropertiesToCssValues = (property, value, themeSection) => {
199
+ if (Array.isArray(property) && Array.isArray(value)) {
200
+ const shorthandValues = fillCssValues(value);
201
+ return property.reduce((acc, prop, index) => {
202
+ acc[prop] = extractStyleFromTheme(themeSection, shorthandValues[index], shorthandValues[index]);
203
+ return acc;
204
+ }, {});
205
+ } else if (Array.isArray(property) && !Array.isArray(value)) {
206
+ return property.reduce((acc, prop) => {
207
+ acc[prop] = extractStyleFromTheme(themeSection, value, value);
208
+ return acc;
209
+ }, {});
210
+ } else if (!Array.isArray(property) && !Array.isArray(value)) {
211
+ return {
212
+ [property]: extractStyleFromTheme(themeSection, value, value)
213
+ };
214
+ } else {
215
+ console.warn(
216
+ "You've passed an array of values to a property that does not support it. Please check the property and value you're passing."
217
+ );
218
+ return {};
219
+ }
220
+ };
92
221
  const forwardRef = React.forwardRef;
93
222
  const Box = forwardRef((props, ref) => {
94
223
  const {
@@ -100,8 +229,6 @@ const Box = forwardRef((props, ref) => {
100
229
  fontSize,
101
230
  grow,
102
231
  hasRadius,
103
- hiddenS,
104
- hiddenXS,
105
232
  padding,
106
233
  paddingBottom,
107
234
  paddingLeft,
@@ -115,6 +242,7 @@ const Box = forwardRef((props, ref) => {
115
242
  shadow,
116
243
  shrink,
117
244
  lineHeight,
245
+ fontWeight,
118
246
  width,
119
247
  minWidth,
120
248
  maxWidth,
@@ -152,8 +280,6 @@ const Box = forwardRef((props, ref) => {
152
280
  $fontSize: fontSize,
153
281
  $grow: grow,
154
282
  $hasRadius: hasRadius,
155
- $hiddenS: hiddenS,
156
- $hiddenXS: hiddenXS,
157
283
  $padding: padding,
158
284
  $paddingBottom: paddingBottom,
159
285
  $paddingLeft: paddingLeft,
@@ -167,6 +293,7 @@ const Box = forwardRef((props, ref) => {
167
293
  $shadow: shadow,
168
294
  $shrink: shrink,
169
295
  $lineHeight: lineHeight,
296
+ $fontWeight: fontWeight,
170
297
  $width: width,
171
298
  $minWidth: minWidth,
172
299
  $maxWidth: maxWidth,
@@ -195,110 +322,83 @@ const Box = forwardRef((props, ref) => {
195
322
  return /* @__PURE__ */ jsx(StyledBox, { as: AsComponent, ref, ...mappedProps, ...rest });
196
323
  });
197
324
  const StyledBox = styled.div`
198
- // Font
199
- font-size: ${({ $fontSize, theme }) => extractStyleFromTheme(theme.fontSizes, $fontSize, $fontSize)};
200
-
201
- // Colors
202
- background: ${({ theme, $background }) => extractStyleFromTheme(theme.colors, $background, $background)};
203
- color: ${({ theme, $color }) => extractStyleFromTheme(theme.colors, $color, $color)};
204
-
205
- // Spaces
206
- ${({ theme, $padding }) => handleResponsiveValues("padding-block", $padding, theme)}
207
- ${({ theme, $padding }) => handleResponsiveValues("padding-inline", $padding, theme)}
208
- ${({ theme, $paddingTop }) => handleResponsiveValues("padding-block-start", $paddingTop, theme)}
209
- ${({ theme, $paddingRight }) => handleResponsiveValues("padding-inline-end", $paddingRight, theme)}
210
- ${({ theme, $paddingBottom }) => handleResponsiveValues("padding-block-end", $paddingBottom, theme)}
211
- ${({ theme, $paddingLeft }) => handleResponsiveValues("padding-inline-start", $paddingLeft, theme)}
212
-
213
- ${({ theme, $margin }) => handleResponsiveValues("margin-block", $margin, theme)}
214
- ${({ theme, $margin }) => handleResponsiveValues("margin-inline", $margin, theme)}
215
- ${({ theme, $marginLeft }) => handleResponsiveValues("margin-inline-start", $marginLeft, theme)}
216
- ${({ theme, $marginRight }) => handleResponsiveValues("margin-inline-end", $marginRight, theme)}
217
- ${({ theme, $marginTop }) => handleResponsiveValues("margin-block-start", $marginTop, theme)}
218
- ${({ theme, $marginBottom }) => handleResponsiveValues("margin-block-end", $marginBottom, theme)}
219
-
220
- // Responsive hiding
221
- ${({ theme, $hiddenS }) => $hiddenS ? `${theme.mediaQueries.tablet} { display: none; }` : void 0}
222
- ${({ theme, $hiddenXS }) => $hiddenXS ? `${theme.mediaQueries.mobile} { display: none; }` : void 0}
223
-
224
-
225
- // Borders
226
- border-radius: ${({ theme, $hasRadius, $borderRadius }) => $hasRadius ? theme.borderRadius : $borderRadius};
227
- border-style: ${({ $borderStyle }) => $borderStyle};
228
- border-width: ${({ $borderWidth }) => $borderWidth};
229
- border-color: ${({ $borderColor, theme }) => extractStyleFromTheme(theme.colors, $borderColor, void 0)};
230
- border: ${({ theme, $borderColor, $borderStyle, $borderWidth }) => {
231
- if ($borderColor && !$borderStyle && typeof $borderWidth === "undefined") {
232
- return `1px solid ${theme.colors[$borderColor]}`;
233
- }
234
- return void 0;
325
+ ${({ theme, ...props }) => {
326
+ return handleResponsiveValues(
327
+ {
328
+ padding: props.$padding,
329
+ paddingTop: props.$paddingTop,
330
+ paddingBottom: props.$paddingBottom,
331
+ paddingLeft: props.$paddingLeft,
332
+ paddingRight: props.$paddingRight,
333
+ margin: props.$margin,
334
+ marginTop: props.$marginTop,
335
+ marginBottom: props.$marginBottom,
336
+ marginLeft: props.$marginLeft,
337
+ marginRight: props.$marginRight,
338
+ top: props.$top,
339
+ left: props.$left,
340
+ bottom: props.$bottom,
341
+ right: props.$right,
342
+ width: props.$width,
343
+ minWidth: props.$minWidth,
344
+ maxWidth: props.$maxWidth,
345
+ height: props.$height,
346
+ minHeight: props.$minHeight,
347
+ maxHeight: props.$maxHeight,
348
+ color: props.$color,
349
+ background: props.$background,
350
+ fontSize: props.$fontSize,
351
+ fontWeight: props.$fontWeight,
352
+ lineHeight: props.$lineHeight,
353
+ borderRadius: props.$hasRadius ? theme.borderRadius : props.$borderRadius,
354
+ borderStyle: props.$borderColor && !props.$borderStyle ? "solid" : props.$borderStyle,
355
+ borderWidth: props.$borderColor && !props.$borderWidth ? "1px" : props.$borderWidth,
356
+ borderColor: props.$borderColor,
357
+ zIndex: props.$zIndex,
358
+ boxShadow: props.$shadow,
359
+ display: props.$display,
360
+ pointerEvents: props.$pointerEvents,
361
+ cursor: props.$cursor,
362
+ textAlign: props.$textAlign,
363
+ textTransform: props.$textTransform,
364
+ transition: props.$transition,
365
+ transform: props.$transform,
366
+ animation: props.$animation,
367
+ position: props.$position,
368
+ overflow: props.$overflow,
369
+ flex: props.$flex,
370
+ flexShrink: props.$shrink,
371
+ flexGrow: props.$grow,
372
+ flexBasis: props.$basis
373
+ },
374
+ theme
375
+ );
235
376
  }};
236
-
237
- // Shadows
238
- box-shadow: ${({ theme, $shadow }) => extractStyleFromTheme(theme.shadows, $shadow, void 0)};
239
-
240
- // Handlers
241
- pointer-events: ${({ $pointerEvents }) => $pointerEvents};
242
-
243
- // Display
244
- display: ${({ $display }) => $display};
245
-
246
- // Position
247
- position: ${({ $position }) => $position};
248
- left: ${({ $left, theme }) => extractStyleFromTheme(theme.spaces, $left, $left)};
249
- right: ${({ $right, theme }) => extractStyleFromTheme(theme.spaces, $right, $right)};
250
- top: ${({ $top, theme }) => extractStyleFromTheme(theme.spaces, $top, $top)};
251
- bottom: ${({ $bottom, theme }) => extractStyleFromTheme(theme.spaces, $bottom, $bottom)};
252
- z-index: ${({ $zIndex, theme }) => extractStyleFromTheme(theme.zIndices, $zIndex, $zIndex)};
253
- overflow: ${({ $overflow }) => $overflow};
254
-
255
- // Size
256
- width: ${({ $width, theme }) => extractStyleFromTheme(theme.spaces, $width, $width)};
257
- max-width: ${({ $maxWidth, theme }) => extractStyleFromTheme(theme.spaces, $maxWidth, $maxWidth)};
258
- min-width: ${({ $minWidth, theme }) => extractStyleFromTheme(theme.spaces, $minWidth, $minWidth)};
259
- height: ${({ $height, theme }) => extractStyleFromTheme(theme.spaces, $height, $height)};
260
- max-height: ${({ $maxHeight, theme }) => extractStyleFromTheme(theme.spaces, $maxHeight, $maxHeight)};
261
- min-height: ${({ $minHeight, theme }) => extractStyleFromTheme(theme.spaces, $minHeight, $minHeight)};
262
-
263
- // Animation
264
- transition: ${({ $transition }) => $transition};
265
- transform: ${({ $transform }) => $transform};
266
- animation: ${({ $animation }) => $animation};
267
-
268
- //Flexbox children props
269
- flex-shrink: ${({ $shrink }) => $shrink};
270
- flex-grow: ${({ $grow }) => $grow};
271
- flex-basis: ${({ $basis }) => $basis};
272
- flex: ${({ $flex }) => $flex};
273
-
274
- // Text
275
- text-align: ${({ $textAlign }) => $textAlign};
276
- text-transform: ${({ $textTransform }) => $textTransform};
277
- line-height: ${({ theme, $lineHeight }) => extractStyleFromTheme(theme.lineHeights, $lineHeight, $lineHeight)};
278
-
279
- // Cursor
280
- cursor: ${({ $cursor }) => $cursor};
281
377
  `;
282
378
  const Flex = forwardRef((props, ref) => {
283
- const { className, alignItems, direction, gap, inline, justifyContent, wrap, ...rest } = props;
379
+ const { className, alignItems, direction, inline, gap, justifyContent, wrap, ...rest } = props;
284
380
  const mappedProps = {
285
381
  $alignItems: alignItems,
286
382
  $direction: direction,
287
383
  $gap: gap,
288
- $inline: inline,
289
384
  $justifyContent: justifyContent,
290
- $wrap: wrap
385
+ $wrap: wrap,
386
+ $inline: inline
291
387
  };
292
388
  return /* @__PURE__ */ jsx(StyledFlex, { className, ref, ...mappedProps, ...rest });
293
389
  });
294
390
  const StyledFlex = styled(Box)`
295
- align-items: ${({ $alignItems = "center" }) => $alignItems};
296
- display: ${({ display = "flex", $inline }) => $inline ? "inline-flex" : display};
297
- flex-direction: ${({ $direction = "row" }) => $direction};
298
- flex-shrink: ${({ shrink }) => shrink};
299
- flex-wrap: ${({ $wrap }) => $wrap};
300
- ${({ $gap, theme }) => handleResponsiveValues("gap", $gap, theme)};
301
- justify-content: ${({ $justifyContent }) => $justifyContent};
391
+ ${({ theme, $display = "flex", $alignItems = "center", $direction = "row", ...props }) => handleResponsiveValues(
392
+ {
393
+ gap: props.$gap,
394
+ alignItems: $alignItems,
395
+ justifyContent: props.$justifyContent,
396
+ flexWrap: props.$wrap,
397
+ flexDirection: $direction,
398
+ display: props.$inline ? "inline-flex" : $display
399
+ },
400
+ theme
401
+ )};
302
402
  `;
303
403
  const ALPHA = "alpha";
304
404
  const BETA = "beta";
@@ -373,26 +473,24 @@ const Typography = forwardRef(
373
473
  (props, ref) => {
374
474
  const {
375
475
  ellipsis: ellipsis2,
376
- fontSize,
377
- fontWeight,
378
- lineHeight,
379
- textAlign,
380
476
  textColor = "currentcolor",
381
477
  textDecoration,
382
478
  textTransform,
383
479
  variant: variant2,
480
+ lineHeight,
481
+ fontWeight,
482
+ fontSize,
384
483
  ...rest
385
484
  } = props;
386
485
  const mappedProps = {
387
486
  $ellipsis: ellipsis2,
388
- $fontSize: fontSize,
389
- $fontWeight: fontWeight,
390
- $lineHeight: lineHeight,
391
- $textAlign: textAlign,
392
487
  $textColor: textColor,
393
488
  $textDecoration: textDecoration,
394
489
  $textTransform: textTransform,
395
- $variant: variant2
490
+ $variant: variant2,
491
+ $lineHeight: lineHeight,
492
+ $fontWeight: fontWeight,
493
+ $fontSize: fontSize
396
494
  };
397
495
  return /* @__PURE__ */ jsx(StyledTypography, { ref, tag: "span", ...mappedProps, ...rest });
398
496
  }
@@ -401,15 +499,19 @@ const StyledTypography = styled(Box)`
401
499
  ${variant}
402
500
  ${({ $ellipsis }) => $ellipsis ? ellipsis : ""}
403
501
 
404
- // These properties need to come after {variantStyle}, because they might
405
- // overwrite a variant attribute
406
- font-weight: ${({ theme, $fontWeight }) => extractStyleFromTheme(theme.fontWeights, $fontWeight, void 0)};
407
- font-size: ${({ theme, $fontSize }) => extractStyleFromTheme(theme.fontSizes, $fontSize, void 0)};
408
- line-height: ${({ theme, $lineHeight }) => extractStyleFromTheme(theme.lineHeights, $lineHeight, $lineHeight)};
409
- color: ${({ theme, $textColor }) => extractStyleFromTheme(theme.colors, $textColor, $textColor)};
410
- text-align: ${({ $textAlign }) => $textAlign};
411
- text-decoration: ${({ $textDecoration }) => $textDecoration};
412
- text-transform: ${({ $textTransform }) => $textTransform};
502
+ ${({ theme, ...props }) => {
503
+ return handleResponsiveValues(
504
+ {
505
+ color: props.$textColor,
506
+ textDecoration: props.$textDecoration,
507
+ textTransform: props.$textTransform,
508
+ lineHeight: props.$lineHeight,
509
+ fontWeight: props.$fontWeight,
510
+ fontSize: props.$fontSize
511
+ },
512
+ theme
513
+ );
514
+ }}
413
515
  `;
414
516
  const [AccordionProvider, useAccordion] = createContext("Accordion");
415
517
  const Root$8 = React.forwardRef(({ children, size = "S", ...props }, forwardedRef) => {
@@ -437,25 +539,38 @@ const AccordionItem = styled(RadixAccordion.Item)`
437
539
  overflow: hidden;
438
540
 
439
541
  &:first-child {
440
- border-top-left-radius: ${(props) => props.$size === "S" ? "0.3rem" : ""};
441
- border-top-right-radius: ${(props) => props.$size === "S" ? "0.3rem" : ""};
542
+ border-top-left-radius: 0.3rem;
543
+ border-top-right-radius: 0.3rem;
442
544
  }
443
545
 
444
546
  &:last-child {
445
- border-bottom-left-radius: ${(props) => props.$size === "S" ? "0.3rem" : ""};
446
- border-bottom-right-radius: ${(props) => props.$size === "S" ? "0.3rem" : ""};
547
+ border-bottom-left-radius: 0.3rem;
548
+ border-bottom-right-radius: 0.3rem;
447
549
  }
448
550
 
449
551
  & + & {
450
552
  border-top: ${(props) => props.$size === "S" ? `solid 1px ${props.theme.colors.neutral200}` : "unset"};
451
553
  }
452
554
 
555
+ &[data-state='open'] {
556
+ box-shadow: 0 0 0 2px ${(props) => props.theme.colors.primary600};
557
+ }
558
+
559
+ &:hover {
560
+ box-shadow: 0 0 0 2px ${(props) => props.theme.colors.primary600};
561
+ }
562
+
453
563
  /* This applies our desired focus effect correctly. */
454
564
  &:focus-within {
455
565
  position: relative;
456
566
  z-index: 1;
457
567
  box-shadow: 0 0 0 2px ${(props) => props.theme.colors.primary600};
458
568
  }
569
+
570
+ @media (prefers-reduced-motion: no-preference) {
571
+ transition: box-shadow ${(props) => props.theme.motion.timings["120"]}
572
+ ${(props) => props.theme.motion.easings.easeOutQuad};
573
+ }
459
574
  `;
460
575
  const Trigger$7 = React.forwardRef(
461
576
  ({ caretPosition = "left", description, icon: Icon, children, ...restProps }, forwardedRef) => {
@@ -471,10 +586,11 @@ const Trigger$7 = React.forwardRef(
471
586
  fontWeight: size === "S" ? "bold" : void 0,
472
587
  ellipsis: true,
473
588
  variant: size === "M" ? "delta" : void 0,
589
+ textAlign: "left",
474
590
  children
475
591
  }
476
592
  ),
477
- description && size === "M" ? /* @__PURE__ */ jsx(Typography, { children: description }) : null
593
+ description && size === "M" ? /* @__PURE__ */ jsx(Typography, { textAlign: "left", children: description }) : null
478
594
  ] })
479
595
  ] }),
480
596
  caretPosition === "right" ? /* @__PURE__ */ jsx(TriggerIcon, { $size: size, children: /* @__PURE__ */ jsx(CaretDown, { width: size === "S" ? "1.2rem" : "1.6rem", height: size === "S" ? "1.2rem" : "1.6rem" }) }) : null
@@ -1138,51 +1254,32 @@ const Base = styled(Flex)`
1138
1254
  `;
1139
1255
  }};
1140
1256
  `;
1141
- const BaseButton = forwardRef(
1142
- ({ disabled, children, ...props }, ref) => {
1143
- return /* @__PURE__ */ jsx(
1144
- BaseButtonWrapper,
1145
- {
1146
- ref,
1147
- "aria-disabled": disabled,
1148
- disabled,
1149
- tag: "button",
1150
- type: "button",
1151
- padding: 2,
1152
- hasRadius: true,
1153
- background: "neutral0",
1154
- borderColor: "neutral200",
1155
- cursor: "pointer",
1156
- ...props,
1157
- children
1158
- }
1159
- );
1160
- }
1161
- );
1162
- const BaseButtonWrapper = styled(Flex)`
1163
- &[aria-disabled='true'] {
1164
- pointer-events: none;
1165
- }
1166
-
1167
- ${focus}
1168
- `;
1169
- const BaseLink = forwardRef(
1170
- ({ href, rel = "noreferrer noopener", target = "_self", disabled = false, isExternal = false, ...props }, ref) => {
1257
+ const BaseLinkImpl = forwardRef(
1258
+ ({ href, disabled = false, isExternal = false, ...props }, ref) => {
1171
1259
  return /* @__PURE__ */ jsx(
1172
- Box,
1260
+ BaseLink,
1173
1261
  {
1174
1262
  tag: "a",
1175
1263
  ref,
1176
- target: isExternal ? "_blank" : target,
1177
- rel: isExternal ? rel : void 0,
1178
- href: disabled ? "#" : href,
1264
+ target: isExternal ? "_blank" : void 0,
1265
+ rel: isExternal ? "noreferrer noopener" : void 0,
1266
+ href,
1267
+ tabIndex: disabled ? -1 : void 0,
1179
1268
  "aria-disabled": disabled,
1180
- cursor: "pointer",
1269
+ pointerEvents: disabled ? "none" : void 0,
1270
+ cursor: disabled ? void 0 : "pointer",
1181
1271
  ...props
1182
1272
  }
1183
1273
  );
1184
1274
  }
1185
1275
  );
1276
+ const BaseLink = styled(Box)`
1277
+ text-decoration: none;
1278
+
1279
+ &:visited {
1280
+ color: inherit;
1281
+ }
1282
+ `;
1186
1283
  const Divider$1 = () => {
1187
1284
  return /* @__PURE__ */ jsx(Box, { "aria-hidden": true, paddingLeft: 1, paddingRight: 1, children: /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral500", children: "/" }) });
1188
1285
  };
@@ -1196,30 +1293,34 @@ const AlignedList = styled(Flex)`
1196
1293
  margin-left: ${({ theme }) => `calc(-1*${theme.spaces[2]})`};
1197
1294
  }
1198
1295
  `;
1199
- const Breadcrumbs = ({ label, children, ...props }) => {
1200
- const childrenArray = React.Children.toArray(children);
1201
- return /* @__PURE__ */ jsx(Box, { "aria-label": label, tag: "nav", ...props, children: /* @__PURE__ */ jsx(AlignedList, { tag: "ol", children: React.Children.map(childrenArray, (child, index) => {
1202
- const shouldDisplayDivider = childrenArray.length > 1 && index + 1 < childrenArray.length;
1203
- return /* @__PURE__ */ jsxs(Flex, { inline: true, tag: "li", children: [
1204
- child,
1205
- shouldDisplayDivider && /* @__PURE__ */ jsx(Divider$1, {})
1206
- ] });
1207
- }) }) });
1208
- };
1209
- Breadcrumbs.displayName = "Breadcrumbs";
1210
- const Crumb = ({ children, isCurrent = false, ...props }) => /* @__PURE__ */ jsx(Box, { paddingLeft: 2, paddingRight: 2, paddingTop: 1, paddingBottom: 1, children: /* @__PURE__ */ jsx(
1211
- Typography,
1212
- {
1213
- variant: "pi",
1214
- textColor: "neutral800",
1215
- fontWeight: isCurrent ? "bold" : "regular",
1216
- "aria-current": isCurrent,
1217
- ...props,
1218
- children
1296
+ const Breadcrumbs = React.forwardRef(
1297
+ ({ label, children, ...props }, forwardedRef) => {
1298
+ const childrenArray = React.Children.toArray(children);
1299
+ return /* @__PURE__ */ jsx(Box, { "aria-label": label, tag: "nav", ...props, ref: forwardedRef, children: /* @__PURE__ */ jsx(AlignedList, { tag: "ol", children: React.Children.map(childrenArray, (child, index) => {
1300
+ const shouldDisplayDivider = childrenArray.length > 1 && index + 1 < childrenArray.length;
1301
+ return /* @__PURE__ */ jsxs(Flex, { inline: true, tag: "li", children: [
1302
+ child,
1303
+ shouldDisplayDivider && /* @__PURE__ */ jsx(Divider$1, {})
1304
+ ] });
1305
+ }) }) });
1219
1306
  }
1220
- ) });
1307
+ );
1308
+ Breadcrumbs.displayName = "Breadcrumbs";
1309
+ const Crumb = React.forwardRef(
1310
+ ({ children, isCurrent = false, ...props }, forwardedRef) => /* @__PURE__ */ jsx(Box, { paddingLeft: 2, paddingRight: 2, paddingTop: 1, paddingBottom: 1, ref: forwardedRef, children: /* @__PURE__ */ jsx(
1311
+ Typography,
1312
+ {
1313
+ variant: "pi",
1314
+ textColor: "neutral800",
1315
+ fontWeight: isCurrent ? "bold" : "regular",
1316
+ "aria-current": isCurrent,
1317
+ ...props,
1318
+ children
1319
+ }
1320
+ ) })
1321
+ );
1221
1322
  Crumb.displayName = "Crumb";
1222
- const StyledLink = styled(BaseLink)`
1323
+ const StyledLink = styled(BaseLinkImpl)`
1223
1324
  border-radius: ${({ theme }) => theme.borderRadius};
1224
1325
  color: ${({ theme }) => theme.colors.neutral600};
1225
1326
  font-size: ${({ theme }) => theme.fontSizes[1]};
@@ -1233,9 +1334,22 @@ const StyledLink = styled(BaseLink)`
1233
1334
  color: ${({ theme }) => theme.colors.neutral700};
1234
1335
  }
1235
1336
  `;
1236
- const CrumbLink = ({ children, ...props }) => /* @__PURE__ */ jsx(StyledLink, { ...props, children });
1337
+ const CrumbLink = React.forwardRef(({ children, ...props }, forwardedRef) => /* @__PURE__ */ jsx(StyledLink, { ref: forwardedRef, ...props, children }));
1237
1338
  CrumbLink.displayName = "CrumbLink";
1238
1339
  const stripReactIdOfColon = (str) => str.replaceAll(":", "");
1340
+ function setRef(ref, value) {
1341
+ if (typeof ref === "function") {
1342
+ ref(value);
1343
+ } else if (ref !== null && ref !== void 0) {
1344
+ ref.current = value;
1345
+ }
1346
+ }
1347
+ function composeRefs(...refs) {
1348
+ return (node) => refs.forEach((ref) => setRef(ref, node));
1349
+ }
1350
+ function useComposedRefs(...refs) {
1351
+ return React.useCallback(composeRefs(...refs), refs);
1352
+ }
1239
1353
  const isSSR = () => typeof window === "undefined" || !window.navigator || /ServerSideRendering|^Deno\//.test(window.navigator.userAgent);
1240
1354
  const useIsomorphicLayoutEffect = isSSR() ? useEffect : useLayoutEffect;
1241
1355
  const useReactId = React["useId".toString()] || (() => void 0);
@@ -1285,7 +1399,7 @@ const DANGER = "danger";
1285
1399
  const SUCCESS = "success";
1286
1400
  const GHOST = "ghost";
1287
1401
  const LIGHT_VARIANTS = [SUCCESS_LIGHT, DANGER_LIGHT];
1288
- const VARIANTS$1 = [DEFAULT, TERTIARY, SECONDARY, DANGER, SUCCESS, GHOST, ...LIGHT_VARIANTS];
1402
+ const VARIANTS = [DEFAULT, TERTIARY, SECONDARY, DANGER, SUCCESS, GHOST, ...LIGHT_VARIANTS];
1289
1403
  const BUTTON_SIZES = ["S", "M", "L"];
1290
1404
  const getVariantColorName = (variant2) => {
1291
1405
  if (variant2 === SUCCESS_LIGHT || variant2 === DANGER_LIGHT) {
@@ -1294,7 +1408,7 @@ const getVariantColorName = (variant2) => {
1294
1408
  if (variant2 === TERTIARY) {
1295
1409
  return "neutral";
1296
1410
  }
1297
- if (variant2 === DEFAULT || variant2 === SECONDARY || VARIANTS$1.every((vari) => vari !== variant2)) {
1411
+ if (variant2 === DEFAULT || variant2 === SECONDARY || VARIANTS.every((vari) => vari !== variant2)) {
1298
1412
  return "primary";
1299
1413
  }
1300
1414
  return `${variant2}`;
@@ -1304,6 +1418,7 @@ const getDisabledStyle = ({ theme }) => {
1304
1418
  border: 1px solid ${theme.colors.neutral200};
1305
1419
  background: ${theme.colors.neutral150};
1306
1420
  color: ${theme.colors.neutral600};
1421
+ cursor: default;
1307
1422
  `;
1308
1423
  };
1309
1424
  const getHoverStyle = ({ theme, $variant }) => {
@@ -1341,7 +1456,7 @@ const getActiveStyle = ({ theme, $variant }) => {
1341
1456
  color: ${theme.colors[`${getVariantColorName($variant)}600`]};
1342
1457
  `;
1343
1458
  }
1344
- if ($variant === TERTIARY) {
1459
+ if ($variant === TERTIARY || $variant === GHOST) {
1345
1460
  return css`
1346
1461
  background-color: ${theme.colors.neutral150};
1347
1462
  `;
@@ -1390,6 +1505,8 @@ const getVariantStyle = ({ theme, $variant }) => {
1390
1505
  }
1391
1506
  default: {
1392
1507
  return css`
1508
+ border: 1px solid ${theme.colors.buttonPrimary600};
1509
+ background: ${theme.colors.buttonPrimary600};
1393
1510
  color: ${theme.colors.buttonNeutral0};
1394
1511
  `;
1395
1512
  }
@@ -1422,21 +1539,22 @@ const Button = forwardRef(
1422
1539
  disabled: isDisabled,
1423
1540
  $size: size,
1424
1541
  $variant: variant2,
1542
+ tag: "button",
1425
1543
  onClick: handleClick,
1426
- alignItems: "center",
1427
- background: "buttonPrimary600",
1428
- borderColor: "buttonPrimary600",
1544
+ hasRadius: true,
1429
1545
  gap: 2,
1430
- inline: fullWidth,
1431
- justifyContent: fullWidth ? "center" : void 0,
1546
+ inline: true,
1547
+ alignItems: "center",
1548
+ justifyContent: "center",
1549
+ width: fullWidth ? "100%" : void 0,
1432
1550
  paddingLeft: 4,
1433
1551
  paddingRight: 4,
1434
- width: fullWidth ? "100%" : void 0,
1552
+ cursor: "pointer",
1435
1553
  ...props,
1436
1554
  children: [
1437
- (startIcon || loading) && /* @__PURE__ */ jsx(Box, { "aria-hidden": true, children: loading ? /* @__PURE__ */ jsx(LoaderAnimated, {}) : startIcon }),
1555
+ (startIcon || loading) && /* @__PURE__ */ jsx(Flex, { tag: "span", "aria-hidden": true, flex: "1 0 1.2rem", children: loading ? /* @__PURE__ */ jsx(LoaderAnimated, {}) : startIcon }),
1438
1556
  /* @__PURE__ */ jsx(Typography, { variant: size === "S" ? "pi" : void 0, fontWeight: "bold", children }),
1439
- endIcon && /* @__PURE__ */ jsx(Flex, { "aria-hidden": true, children: endIcon })
1557
+ endIcon && /* @__PURE__ */ jsx(Flex, { tag: "span", "aria-hidden": true, flex: "1 0 1.2rem", children: endIcon })
1440
1558
  ]
1441
1559
  }
1442
1560
  );
@@ -1454,20 +1572,10 @@ const LoaderAnimated = styled(Loader$1)`
1454
1572
  animation: ${rotation$2} 2s infinite linear;
1455
1573
  will-change: transform;
1456
1574
  `;
1457
- const ButtonWrapper = styled(BaseButton)`
1575
+ const ButtonWrapper = styled(Flex)`
1458
1576
  height: ${({ theme, $size }) => theme.sizes.button[$size]};
1459
-
1460
- svg {
1461
- height: 1.2rem;
1462
- }
1463
-
1464
- &[aria-disabled='true'] {
1465
- ${getDisabledStyle}
1466
-
1467
- &:active {
1468
- ${getDisabledStyle}
1469
- }
1470
- }
1577
+ text-decoration: none;
1578
+ ${getVariantStyle}
1471
1579
 
1472
1580
  &:hover {
1473
1581
  ${getHoverStyle}
@@ -1477,7 +1585,9 @@ const ButtonWrapper = styled(BaseButton)`
1477
1585
  ${getActiveStyle}
1478
1586
  }
1479
1587
 
1480
- ${getVariantStyle}
1588
+ &[aria-disabled='true'] {
1589
+ ${getDisabledStyle}
1590
+ }
1481
1591
 
1482
1592
  @media (prefers-reduced-motion: no-preference) {
1483
1593
  transition:
@@ -1486,59 +1596,205 @@ const ButtonWrapper = styled(BaseButton)`
1486
1596
  border-color ${(props) => props.theme.motion.timings["200"]} ${(props) => props.theme.motion.easings.easeOutQuad};
1487
1597
  }
1488
1598
  `;
1489
- const Link = forwardRef(
1490
- ({ children, href, disabled = false, startIcon, endIcon, isExternal = false, ...props }, ref) => {
1491
- return /* @__PURE__ */ jsxs(LinkWrapper$2, { ref, href, disabled, isExternal, ...props, children: [
1492
- startIcon,
1493
- /* @__PURE__ */ jsx(Typography, { textColor: disabled ? "neutral600" : "primary600", children }),
1494
- endIcon,
1495
- href && !endIcon && isExternal && /* @__PURE__ */ jsx(ExternalLink, {})
1496
- ] });
1599
+ const TooltipImpl = React.forwardRef(
1600
+ ({
1601
+ children,
1602
+ description,
1603
+ label,
1604
+ defaultOpen,
1605
+ open,
1606
+ onOpenChange,
1607
+ delayDuration = 500,
1608
+ disableHoverableContent,
1609
+ ...restProps
1610
+ }, forwardedRef) => {
1611
+ return /* @__PURE__ */ jsxs(
1612
+ Tooltip.Root,
1613
+ {
1614
+ defaultOpen,
1615
+ open,
1616
+ onOpenChange,
1617
+ delayDuration,
1618
+ disableHoverableContent,
1619
+ children: [
1620
+ /* @__PURE__ */ jsx(Tooltip.Trigger, { asChild: true, children }),
1621
+ /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(TooltipContent, { ref: forwardedRef, sideOffset: 8, ...restProps, children: /* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", children: label || description }) }) })
1622
+ ]
1623
+ }
1624
+ );
1497
1625
  }
1498
1626
  );
1499
- const LinkWrapper$2 = styled(BaseLink)`
1500
- display: inline-flex;
1501
- align-items: center;
1502
- text-decoration: none;
1503
- gap: ${({ theme }) => theme.spaces[2]};
1504
- pointer-events: ${({ disabled }) => disabled ? "none" : void 0};
1505
-
1506
- svg {
1507
- font-size: 1rem;
1508
-
1509
- path {
1510
- fill: ${({ disabled, theme }) => disabled ? theme.colors.neutral600 : theme.colors.primary600};
1511
- }
1512
- }
1513
-
1514
- &:hover {
1515
- color: ${({ theme }) => theme.colors.primary500};
1516
- }
1627
+ const TooltipContent = styled(Tooltip.Content)`
1628
+ background-color: ${(props) => props.theme.colors.neutral900};
1629
+ color: ${(props) => props.theme.colors.neutral0};
1630
+ padding-inline: ${(props) => props.theme.spaces[2]};
1631
+ padding-block: ${(props) => props.theme.spaces[2]};
1632
+ border-radius: ${(props) => props.theme.borderRadius};
1633
+ z-index: ${(props) => props.theme.zIndices.tooltip};
1634
+ will-change: opacity;
1635
+ transform-origin: var(--radix-tooltip-content-transform-origin);
1517
1636
 
1518
- &:active {
1519
- color: ${({ theme }) => theme.colors.primary700};
1637
+ @media (prefers-reduced-motion: no-preference) {
1638
+ animation: ${ANIMATIONS.fadeIn} ${(props) => props.theme.motion.timings["200"]}
1639
+ ${(props) => props.theme.motion.easings.authenticMotion};
1520
1640
  }
1521
-
1522
- ${focus};
1523
1641
  `;
1524
- const MenuRoot = DropdownMenu.Root;
1525
- const MenuTrigger = React.forwardRef(
1526
- ({ size, endIcon = /* @__PURE__ */ jsx(CaretDown, { width: "0.6rem", height: "0.4rem", "aria-hidden": true }), ...props }, ref) => {
1527
- return /* @__PURE__ */ jsx(DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(
1528
- Button,
1642
+ const IconButton = forwardRef(
1643
+ ({
1644
+ label,
1645
+ background,
1646
+ children,
1647
+ disabled = false,
1648
+ onClick,
1649
+ size = "S",
1650
+ variant: variant2 = "tertiary",
1651
+ withTooltip = true,
1652
+ ...restProps
1653
+ }, ref) => {
1654
+ const handleClick = (e) => {
1655
+ if (!disabled && onClick) {
1656
+ onClick(e);
1657
+ }
1658
+ };
1659
+ const component = /* @__PURE__ */ jsx(
1660
+ IconButtonWrapper,
1529
1661
  {
1662
+ "aria-disabled": disabled,
1663
+ background: disabled ? "neutral150" : background,
1664
+ tag: "button",
1665
+ display: "inline-flex",
1666
+ justifyContent: "center",
1667
+ hasRadius: true,
1668
+ cursor: "pointer",
1669
+ ...restProps,
1530
1670
  ref,
1531
- type: "button",
1532
- variant: "ghost",
1533
- endIcon,
1534
- paddingTop: size === "S" ? 1 : 2,
1535
- paddingBottom: size === "S" ? 1 : 2,
1536
- paddingLeft: size === "S" ? 3 : 4,
1537
- paddingRight: size === "S" ? 3 : 4,
1538
- ...props
1671
+ $size: size,
1672
+ onClick: handleClick,
1673
+ $variant: variant2,
1674
+ children: /* @__PURE__ */ jsx(AccessibleIcon, { label, children })
1539
1675
  }
1540
- ) });
1541
- }
1676
+ );
1677
+ return withTooltip ? /* @__PURE__ */ jsx(TooltipImpl, { label, children: component }) : component;
1678
+ }
1679
+ );
1680
+ const IconButtonWrapper = styled(Flex)`
1681
+ text-decoration: none;
1682
+
1683
+ ${(props) => {
1684
+ switch (props.$size) {
1685
+ case "S": {
1686
+ return css`
1687
+ padding-block: 0.7rem;
1688
+ padding-inline: 0.7rem;
1689
+ `;
1690
+ }
1691
+ case "M": {
1692
+ return css`
1693
+ padding-block: 0.9rem;
1694
+ padding-inline: 0.9rem;
1695
+ `;
1696
+ }
1697
+ case "L": {
1698
+ return css`
1699
+ padding-block: 1.1rem;
1700
+ padding-inline: 1.1rem;
1701
+ `;
1702
+ }
1703
+ }
1704
+ }}
1705
+ ${getVariantStyle}
1706
+ ${(props) => props.$variant === "tertiary" ? css`
1707
+ color: ${props.theme.colors.neutral600};
1708
+ ` : ""}
1709
+
1710
+ &:hover {
1711
+ ${getHoverStyle}
1712
+ }
1713
+
1714
+ &:active {
1715
+ ${getActiveStyle}
1716
+ }
1717
+
1718
+ &[aria-disabled='true'] {
1719
+ ${getDisabledStyle}
1720
+ }
1721
+
1722
+ @media (prefers-reduced-motion: no-preference) {
1723
+ transition:
1724
+ ${(props) => props.theme.transitions.backgroundColor},
1725
+ ${(props) => props.theme.transitions.color},
1726
+ border-color ${(props) => props.theme.motion.timings["200"]} ${(props) => props.theme.motion.easings.easeOutQuad};
1727
+ }
1728
+ `;
1729
+ const IconButtonGroup = styled(Flex)`
1730
+ & ${IconButtonWrapper}:first-child {
1731
+ border-radius: ${({ theme }) => `${theme.borderRadius} 0 0 ${theme.borderRadius}`};
1732
+ }
1733
+
1734
+ & ${IconButtonWrapper}:last-child {
1735
+ border-radius: ${({ theme }) => `0 ${theme.borderRadius} ${theme.borderRadius} 0`};
1736
+ }
1737
+
1738
+ & ${IconButtonWrapper} {
1739
+ border-radius: 0;
1740
+
1741
+ & + ${IconButtonWrapper} {
1742
+ border-left: none;
1743
+ }
1744
+ }
1745
+ `;
1746
+ const Link = forwardRef(
1747
+ ({ children, href, disabled = false, startIcon, endIcon, isExternal = false, ...props }, ref) => {
1748
+ return /* @__PURE__ */ jsxs(LinkWrapper$1, { ref, href, disabled, isExternal, ...props, children: [
1749
+ startIcon,
1750
+ /* @__PURE__ */ jsx(Typography, { textColor: disabled ? "neutral600" : "primary600", children }),
1751
+ endIcon,
1752
+ href && !endIcon && isExternal && /* @__PURE__ */ jsx(ExternalLink, {})
1753
+ ] });
1754
+ }
1755
+ );
1756
+ const LinkWrapper$1 = styled(BaseLinkImpl)`
1757
+ display: inline-flex;
1758
+ align-items: center;
1759
+ text-decoration: none;
1760
+ gap: ${({ theme }) => theme.spaces[2]};
1761
+ pointer-events: ${({ disabled }) => disabled ? "none" : void 0};
1762
+
1763
+ svg {
1764
+ font-size: 1rem;
1765
+
1766
+ path {
1767
+ fill: ${({ disabled, theme }) => disabled ? theme.colors.neutral600 : theme.colors.primary600};
1768
+ }
1769
+ }
1770
+
1771
+ &:hover {
1772
+ & > span {
1773
+ color: ${({ theme }) => theme.colors.primary500};
1774
+ }
1775
+ }
1776
+
1777
+ &:active {
1778
+ color: ${({ theme }) => theme.colors.primary700};
1779
+ }
1780
+
1781
+ ${focus};
1782
+ `;
1783
+ const MenuRoot = DropdownMenu.Root;
1784
+ const MenuTrigger = React.forwardRef(
1785
+ ({ label, size, endIcon = /* @__PURE__ */ jsx(CaretDown, { width: "1.2rem", height: "1.2rem", "aria-hidden": true }), tag = Button, icon, ...rest }, ref) => {
1786
+ const props = {
1787
+ ...rest,
1788
+ ref,
1789
+ type: "button",
1790
+ variant: "ghost",
1791
+ paddingTop: size === "S" ? 1 : 2,
1792
+ paddingBottom: size === "S" ? 1 : 2,
1793
+ paddingLeft: size === "S" ? 3 : 4,
1794
+ paddingRight: size === "S" ? 3 : 4
1795
+ };
1796
+ return /* @__PURE__ */ jsx(DropdownMenu.Trigger, { asChild: true, children: tag === IconButton ? /* @__PURE__ */ jsx(IconButton, { label, ...props, children: icon }) : /* @__PURE__ */ jsx(Button, { endIcon, ...props }) });
1797
+ }
1542
1798
  );
1543
1799
  const MenuContent = React.forwardRef(
1544
1800
  ({ children, intersectionId, popoverPlacement = "bottom-start", ...props }, ref) => {
@@ -1548,8 +1804,6 @@ const MenuContent = React.forwardRef(
1548
1804
  {
1549
1805
  ref,
1550
1806
  direction: "column",
1551
- borderStyle: "solid",
1552
- borderWidth: "1px",
1553
1807
  borderColor: "neutral150",
1554
1808
  hasRadius: true,
1555
1809
  background: "neutral0",
@@ -1586,7 +1840,7 @@ const getOptionStyle = ({ theme }) => css`
1586
1840
  border-radius: ${theme.borderRadius};
1587
1841
  padding: ${theme.spaces[2]} ${theme.spaces[4]};
1588
1842
 
1589
- &[aria-disabled] {
1843
+ &[aria-disabled='true'] {
1590
1844
  cursor: not-allowed;
1591
1845
  color: ${theme.colors.neutral500};
1592
1846
  }
@@ -1691,37 +1945,41 @@ const Menu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
1691
1945
  SubTrigger,
1692
1946
  Trigger: Trigger$6
1693
1947
  }, Symbol.toStringTag, { value: "Module" }));
1694
- const SimpleMenu = ({ children, onOpen, onClose, popoverPlacement, onReachEnd, ...props }) => {
1695
- const contentRef = React.useRef(null);
1696
- const [internalIsOpen, setInternalIsOpen] = React.useState(false);
1697
- const handleReachEnd = (entry) => {
1698
- if (onReachEnd) {
1699
- onReachEnd(entry);
1700
- }
1701
- };
1702
- const handleOpenChange = (isOpen) => {
1703
- if (isOpen && typeof onOpen === "function") {
1704
- onOpen();
1705
- } else if (!isOpen && typeof onClose === "function") {
1706
- onClose();
1707
- }
1708
- setInternalIsOpen(isOpen);
1709
- };
1710
- const generatedId = useId();
1711
- const intersectionId = `intersection-${stripReactIdOfColon(generatedId)}`;
1712
- useIntersection(contentRef, handleReachEnd, {
1713
- selectorToWatch: `#${intersectionId}`,
1714
- /**
1715
- * We need to know when the select is open because only then will viewportRef
1716
- * not be null. Because it uses a portal that (sensibly) is not mounted 24/7.
1717
- */
1718
- skipWhen: !internalIsOpen
1719
- });
1720
- return /* @__PURE__ */ jsxs(Root$7, { onOpenChange: handleOpenChange, children: [
1721
- /* @__PURE__ */ jsx(Trigger$6, { ...props, children: props.label }),
1722
- /* @__PURE__ */ jsx(Content$6, { intersectionId, popoverPlacement, children })
1723
- ] });
1724
- };
1948
+ const SimpleMenu = React.forwardRef(
1949
+ ({ children, onOpen, onClose, popoverPlacement, onReachEnd, ...props }, forwardedRef) => {
1950
+ const triggerRef = React.useRef(null);
1951
+ const composedRef = useComposedRefs(forwardedRef, triggerRef);
1952
+ const contentRef = React.useRef(null);
1953
+ const [internalIsOpen, setInternalIsOpen] = React.useState(false);
1954
+ const handleReachEnd = (entry) => {
1955
+ if (onReachEnd) {
1956
+ onReachEnd(entry);
1957
+ }
1958
+ };
1959
+ const handleOpenChange = (isOpen) => {
1960
+ if (isOpen && typeof onOpen === "function") {
1961
+ onOpen();
1962
+ } else if (!isOpen && typeof onClose === "function") {
1963
+ onClose();
1964
+ }
1965
+ setInternalIsOpen(isOpen);
1966
+ };
1967
+ const generatedId = useId();
1968
+ const intersectionId = `intersection-${stripReactIdOfColon(generatedId)}`;
1969
+ useIntersection(contentRef, handleReachEnd, {
1970
+ selectorToWatch: `#${intersectionId}`,
1971
+ /**
1972
+ * We need to know when the select is open because only then will viewportRef
1973
+ * not be null. Because it uses a portal that (sensibly) is not mounted 24/7.
1974
+ */
1975
+ skipWhen: !internalIsOpen
1976
+ });
1977
+ return /* @__PURE__ */ jsxs(Root$7, { onOpenChange: handleOpenChange, children: [
1978
+ /* @__PURE__ */ jsx(Trigger$6, { ref: composedRef, ...props, children: props.label }),
1979
+ /* @__PURE__ */ jsx(Content$6, { ref: contentRef, intersectionId, popoverPlacement, children })
1980
+ ] });
1981
+ }
1982
+ );
1725
1983
  const MenuItem = Item$3;
1726
1984
  const StyledButton = styled(SimpleMenu)`
1727
1985
  padding: ${({ theme }) => `${theme.spaces[1]} ${theme.spaces[2]}`};
@@ -1732,16 +1990,19 @@ const StyledButton = styled(SimpleMenu)`
1732
1990
  background-color: ${({ theme }) => theme.colors.neutral200};
1733
1991
  }
1734
1992
  `;
1735
- const CrumbSimpleMenu = ({ children, ...props }) => /* @__PURE__ */ jsx(StyledButton, { endIcon: null, size: "S", ...props, children });
1993
+ const CrumbSimpleMenu = React.forwardRef(
1994
+ ({ children, ...props }, forwardedRef) => /* @__PURE__ */ jsx(StyledButton, { ref: forwardedRef, endIcon: null, size: "S", ...props, children })
1995
+ );
1736
1996
  CrumbSimpleMenu.displayName = "CrumbSimpleMenu";
1737
1997
  const CardContext = React.createContext({ id: "" });
1738
1998
  const useCard = () => React.useContext(CardContext);
1739
- const Card = ({ id, ...props }) => {
1999
+ const Card = React.forwardRef(({ id, ...props }, forwardedRef) => {
1740
2000
  const generatedId = useId(id);
1741
2001
  const context = React.useMemo(() => ({ id: generatedId }), [generatedId]);
1742
2002
  return /* @__PURE__ */ jsx(CardContext.Provider, { value: context, children: /* @__PURE__ */ jsx(
1743
2003
  Box,
1744
2004
  {
2005
+ ref: forwardedRef,
1745
2006
  id,
1746
2007
  tabIndex: 0,
1747
2008
  hasRadius: true,
@@ -1755,10 +2016,10 @@ const Card = ({ id, ...props }) => {
1755
2016
  ...props
1756
2017
  }
1757
2018
  ) });
1758
- };
1759
- const CardActionImpl = ({ position, ...restProps }) => {
1760
- return /* @__PURE__ */ jsx(CardAction, { $position: position, ...restProps, direction: "row", gap: 2 });
1761
- };
2019
+ });
2020
+ const CardActionImpl = React.forwardRef(({ position, ...restProps }, forwardedRef) => {
2021
+ return /* @__PURE__ */ jsx(CardAction, { ref: forwardedRef, $position: position, ...restProps, direction: "row", gap: 2 });
2022
+ });
1762
2023
  const CardAction = styled(Flex)`
1763
2024
  position: absolute;
1764
2025
  top: ${({ theme }) => theme.spaces[3]};
@@ -1809,19 +2070,6 @@ const CardBadge = (props) => /* @__PURE__ */ jsx(CardBadgeWrapper, { children: /
1809
2070
  const CardBody = (props) => {
1810
2071
  return /* @__PURE__ */ jsx(Box, { paddingLeft: 3, paddingRight: 3, paddingTop: 2, paddingBottom: 2, children: /* @__PURE__ */ jsx(Flex, { ...props, alignItems: "flex-start" }) });
1811
2072
  };
1812
- function setRef(ref, value) {
1813
- if (typeof ref === "function") {
1814
- ref(value);
1815
- } else if (ref !== null && ref !== void 0) {
1816
- ref.current = value;
1817
- }
1818
- }
1819
- function composeRefs(...refs) {
1820
- return (node) => refs.forEach((ref) => setRef(ref, node));
1821
- }
1822
- function useComposedRefs(...refs) {
1823
- return React.useCallback(composeRefs(...refs), refs);
1824
- }
1825
2073
  const CheckIcon = ({ fill, ...props }) => {
1826
2074
  const { colors } = useTheme();
1827
2075
  return /* @__PURE__ */ jsx(
@@ -1904,10 +2152,10 @@ const CheckboxImpl = React.forwardRef(({ children, ...restProps }, forwardedRef)
1904
2152
  /* @__PURE__ */ jsx(Typography, { tag: "label", textColor: "neutral800", htmlFor: labelId, children })
1905
2153
  ] });
1906
2154
  });
1907
- const CardCheckbox = (props) => {
2155
+ const CardCheckbox = React.forwardRef((props, forwardedRef) => {
1908
2156
  const { id } = useCard();
1909
- return /* @__PURE__ */ jsx(CardActionImpl, { position: "start", children: /* @__PURE__ */ jsx(CheckboxImpl, { "aria-labelledby": `${id}-title`, ...props }) });
1910
- };
2157
+ return /* @__PURE__ */ jsx(CardActionImpl, { position: "start", children: /* @__PURE__ */ jsx(CheckboxImpl, { "aria-labelledby": `${id}-title`, ...props, ref: forwardedRef }) });
2158
+ });
1911
2159
  const BreakBox = styled(Box)`
1912
2160
  word-break: break-all;
1913
2161
  `;
@@ -1959,49 +2207,6 @@ const KeyboardKeys = {
1959
2207
  BACKSPACE: "Backspace",
1960
2208
  CLEAR: "Clear"
1961
2209
  };
1962
- const TooltipImpl = React.forwardRef(
1963
- ({
1964
- children,
1965
- description,
1966
- label,
1967
- defaultOpen,
1968
- open,
1969
- onOpenChange,
1970
- delayDuration = 500,
1971
- disableHoverableContent,
1972
- ...restProps
1973
- }, forwardedRef) => {
1974
- return /* @__PURE__ */ jsxs(
1975
- Tooltip.Root,
1976
- {
1977
- defaultOpen,
1978
- open,
1979
- onOpenChange,
1980
- delayDuration,
1981
- disableHoverableContent,
1982
- children: [
1983
- /* @__PURE__ */ jsx(Tooltip.Trigger, { asChild: true, children }),
1984
- /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(TooltipContent, { ref: forwardedRef, sideOffset: 8, ...restProps, children: /* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", children: label || description }) }) })
1985
- ]
1986
- }
1987
- );
1988
- }
1989
- );
1990
- const TooltipContent = styled(Tooltip.Content)`
1991
- background-color: ${(props) => props.theme.colors.neutral900};
1992
- color: ${(props) => props.theme.colors.neutral0};
1993
- padding-inline: ${(props) => props.theme.spaces[2]};
1994
- padding-block: ${(props) => props.theme.spaces[2]};
1995
- border-radius: ${(props) => props.theme.borderRadius};
1996
- z-index: ${(props) => props.theme.zIndices.tooltip};
1997
- will-change: opacity;
1998
- transform-origin: var(--radix-tooltip-content-transform-origin);
1999
-
2000
- @media (prefers-reduced-motion: no-preference) {
2001
- animation: ${ANIMATIONS.fadeIn} ${(props) => props.theme.motion.timings["200"]}
2002
- ${(props) => props.theme.motion.easings.authenticMotion};
2003
- }
2004
- `;
2005
2210
  const CarouselGrid = styled(Box)`
2006
2211
  grid-template-columns: auto 1fr auto;
2007
2212
  grid-template-areas: 'startAction slides endAction';
@@ -2096,9 +2301,11 @@ const commonTheme = {
2096
2301
  },
2097
2302
  spaces: ["0px", "4px", "8px", "12px", "16px", "20px", "24px", "32px", "40px", "48px", "56px", "64px"],
2098
2303
  borderRadius: "4px",
2099
- mediaQueries: {
2100
- tablet: `@media (max-width: 1100px)`,
2101
- mobile: `@media (max-width: 550px)`
2304
+ breakpoints: {
2305
+ initial: "@media(min-width: 0px)",
2306
+ small: "@media(min-width: 520px)",
2307
+ medium: "@media(min-width: 768px)",
2308
+ large: "@media(min-width: 1280px)"
2102
2309
  },
2103
2310
  fontSizes: [`1.1rem`, `1.2rem`, `1.4rem`, "1.6rem", `1.8rem`, `3.2rem`],
2104
2311
  lineHeights: [1.14, 1.22, 1.25, 1.33, 1.43, 1.45, 1.5],
@@ -2939,7 +3146,7 @@ lodash.exports;
2939
3146
  }
2940
3147
  var runInContext = function runInContext2(context) {
2941
3148
  context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
2942
- var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function, Math = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String2 = context.String, TypeError = context.TypeError;
3149
+ 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;
2943
3150
  var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
2944
3151
  var coreJsData = context["__core-js_shared__"];
2945
3152
  var funcToString = funcProto.toString;
@@ -2965,7 +3172,7 @@ lodash.exports;
2965
3172
  }
2966
3173
  }();
2967
3174
  var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date2 && Date2.now !== root.Date.now && Date2.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
2968
- var nativeCeil = Math.ceil, nativeFloor = Math.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined$1, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math.max, nativeMin = Math.min, nativeNow = Date2.now, nativeParseInt = context.parseInt, nativeRandom = Math.random, nativeReverse = arrayProto.reverse;
3175
+ 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;
2969
3176
  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");
2970
3177
  var metaMap = WeakMap && new WeakMap();
2971
3178
  var realNames = {};
@@ -4711,7 +4918,7 @@ lodash.exports;
4711
4918
  return setWrapToString(result2, func, bitmask);
4712
4919
  }
4713
4920
  function createRound(methodName) {
4714
- var func = Math[methodName];
4921
+ var func = Math2[methodName];
4715
4922
  return function(number, precision) {
4716
4923
  number = toNumber(number);
4717
4924
  precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
@@ -7813,6 +8020,7 @@ const Label = React.forwardRef(({ children, action, ...props }, ref) => {
7813
8020
  id: `${id}-label`,
7814
8021
  htmlFor: id,
7815
8022
  tag: "label",
8023
+ ellipsis: true,
7816
8024
  children: [
7817
8025
  children,
7818
8026
  required && /* @__PURE__ */ jsx(Typography, { "aria-hidden": true, lineHeight: "1em", textColor: "danger600", children: "*" }),
@@ -7845,11 +8053,24 @@ const Input$2 = React.forwardRef(
7845
8053
  ariaDescription = `${id}-hint`;
7846
8054
  }
7847
8055
  const hasError = Boolean(error);
8056
+ const endActionRef = React.useRef(null);
8057
+ const inputElementRef = React.useRef(null);
8058
+ const inputRef = useComposedRefs(inputElementRef, ref);
7848
8059
  const handleChange = (e) => {
7849
8060
  if (!disabled && onChange) {
7850
8061
  onChange(e);
7851
8062
  }
7852
8063
  };
8064
+ React.useLayoutEffect(() => {
8065
+ if (endActionRef.current && inputElementRef.current) {
8066
+ const endActionWidth = endActionRef.current.offsetWidth;
8067
+ const inputElement = inputElementRef.current;
8068
+ if (inputElement) {
8069
+ const inputPadding = endActionWidth + 8 + 16;
8070
+ inputElement.style.paddingRight = `${inputPadding}px`;
8071
+ }
8072
+ }
8073
+ }, [endAction]);
7853
8074
  return /* @__PURE__ */ jsxs(
7854
8075
  InputWrapper,
7855
8076
  {
@@ -7857,6 +8078,9 @@ const Input$2 = React.forwardRef(
7857
8078
  justifyContent: "space-between",
7858
8079
  $hasError: hasError || hasErrorProp,
7859
8080
  $disabled: disabled,
8081
+ $size: size,
8082
+ $hasLeftAction: Boolean(startAction),
8083
+ $hasRightAction: Boolean(endAction),
7860
8084
  className,
7861
8085
  children: [
7862
8086
  startAction,
@@ -7865,9 +8089,7 @@ const Input$2 = React.forwardRef(
7865
8089
  {
7866
8090
  id,
7867
8091
  name,
7868
- ref,
7869
- $hasLeftAction: Boolean(startAction),
7870
- $hasRightAction: Boolean(endAction),
8092
+ ref: inputRef,
7871
8093
  $size: size,
7872
8094
  "aria-describedby": ariaDescription,
7873
8095
  "aria-invalid": hasError || hasErrorProp,
@@ -7876,10 +8098,12 @@ const Input$2 = React.forwardRef(
7876
8098
  "data-disabled": disabled ? "" : void 0,
7877
8099
  onChange: handleChange,
7878
8100
  "aria-required": required || requiredProp,
8101
+ $hasLeftAction: Boolean(startAction),
8102
+ $hasRightAction: Boolean(endAction),
7879
8103
  ...props
7880
8104
  }
7881
8105
  ),
7882
- endAction
8106
+ endAction && /* @__PURE__ */ jsx(EndAction, { ref: endActionRef, children: endAction })
7883
8107
  ]
7884
8108
  }
7885
8109
  );
@@ -7898,23 +8122,6 @@ const InputElement = styled.input`
7898
8122
  width: 100%;
7899
8123
  background: inherit;
7900
8124
 
7901
- ${(props) => {
7902
- switch (props.$size) {
7903
- case "S":
7904
- return css`
7905
- padding-inline-start: ${props.$hasLeftAction ? props.theme.spaces[3] : props.theme.spaces[4]};
7906
- padding-inline-end: ${props.$hasRightAction ? props.theme.spaces[3] : props.theme.spaces[4]};
7907
- padding-block: ${props.theme.spaces[1]};
7908
- `;
7909
- default:
7910
- return css`
7911
- padding-inline-start: ${props.$hasLeftAction ? props.theme.spaces[3] : props.theme.spaces[4]};
7912
- padding-inline-end: ${props.$hasRightAction ? props.theme.spaces[3] : props.theme.spaces[4]};
7913
- padding-block: ${props.theme.spaces[2]};
7914
- `;
7915
- }
7916
- }};
7917
-
7918
8125
  ::placeholder {
7919
8126
  color: ${({ theme }) => theme.colors.neutral500};
7920
8127
  opacity: 1;
@@ -7929,17 +8136,42 @@ const InputElement = styled.input`
7929
8136
  outline: none;
7930
8137
  box-shadow: none;
7931
8138
  }
8139
+
8140
+ ${(props) => {
8141
+ switch (props.$size) {
8142
+ case "S":
8143
+ return css`
8144
+ padding-inline-start: ${props.$hasLeftAction ? 0 : props.theme.spaces[4]};
8145
+ padding-inline-end: ${props.$hasRightAction ? 0 : props.theme.spaces[4]};
8146
+ padding-block: ${props.theme.spaces[1]};
8147
+ `;
8148
+ default:
8149
+ return css`
8150
+ padding-inline-start: ${props.$hasLeftAction ? 0 : props.theme.spaces[4]};
8151
+ padding-inline-end: ${props.$hasRightAction ? 0 : props.theme.spaces[4]};
8152
+ padding-block: ${props.theme.spaces[2]};
8153
+ `;
8154
+ }
8155
+ }}
8156
+ `;
8157
+ const EndAction = styled(Flex)`
8158
+ position: absolute;
8159
+ right: ${({ theme }) => theme.spaces[4]};
8160
+ top: 50%;
8161
+ transform: translateY(-50%);
7932
8162
  `;
7933
8163
  const InputWrapper = styled(Flex)`
7934
8164
  border: 1px solid ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral200};
7935
8165
  border-radius: ${({ theme }) => theme.borderRadius};
7936
8166
  background: ${({ theme }) => theme.colors.neutral0};
7937
- ${inputFocusStyle()}
8167
+ padding-inline-start: ${({ $hasLeftAction, theme }) => $hasLeftAction ? theme.spaces[4] : 0};
8168
+ position: relative;
7938
8169
 
8170
+ ${inputFocusStyle()}
7939
8171
  ${({ theme, $disabled }) => $disabled ? css`
7940
8172
  color: ${theme.colors.neutral600};
7941
8173
  background: ${theme.colors.neutral150};
7942
- ` : void 0}
8174
+ ` : void 0};
7943
8175
  `;
7944
8176
  const Hint = () => {
7945
8177
  const { id, hint, error } = useField("Hint");
@@ -8466,19 +8698,7 @@ const ContentImpl$1 = styled(AlertDialog.Content)`
8466
8698
  }
8467
8699
  `;
8468
8700
  const Header$1 = React.forwardRef(({ children, ...restProps }, forwardedRef) => {
8469
- return /* @__PURE__ */ jsx(AlertDialog.Title, { asChild: true, children: /* @__PURE__ */ jsx(
8470
- Title$1,
8471
- {
8472
- tag: "h2",
8473
- ref: forwardedRef,
8474
- padding: 6,
8475
- justifyContent: "center",
8476
- variant: "h2",
8477
- fontWeight: "bold",
8478
- ...restProps,
8479
- children
8480
- }
8481
- ) });
8701
+ return /* @__PURE__ */ jsx(AlertDialog.Title, { asChild: true, children: /* @__PURE__ */ jsx(Title$1, { tag: "h2", variant: "beta", ref: forwardedRef, padding: 6, fontWeight: "bold", ...restProps, children }) });
8482
8702
  });
8483
8703
  const Title$1 = styled(Typography)`
8484
8704
  display: flex;
@@ -8652,8 +8872,7 @@ ${css`
8652
8872
  img,
8653
8873
  picture,
8654
8874
  video,
8655
- canvas,
8656
- svg {
8875
+ canvas {
8657
8876
  display: block;
8658
8877
  max-width: 100%;
8659
8878
  }
@@ -8889,8 +9108,7 @@ const SelectContent = styled(Select.Content)`
8889
9108
  border: 1px solid ${({ theme }) => theme.colors.neutral150};
8890
9109
  border-radius: ${({ theme }) => theme.borderRadius};
8891
9110
  min-width: var(--radix-select-trigger-width);
8892
- /* This is from the design-system figma file. */
8893
- max-height: 15rem;
9111
+ max-height: 15.6rem;
8894
9112
  z-index: ${({ theme }) => theme.zIndices.popover};
8895
9113
 
8896
9114
  @media (prefers-reduced-motion: no-preference) {
@@ -9067,7 +9285,7 @@ const SingleSelectOption = React.forwardRef(
9067
9285
  ({ value, startIcon, children, ...restProps }, ref) => {
9068
9286
  return /* @__PURE__ */ jsxs(Item$2, { ref, value: value.toString(), ...restProps, children: [
9069
9287
  startIcon && /* @__PURE__ */ jsx(Box, { tag: "span", "aria-hidden": true, children: startIcon }),
9070
- /* @__PURE__ */ jsx(Typography, { children: /* @__PURE__ */ jsx(ItemText, { children }) })
9288
+ /* @__PURE__ */ jsx(Typography, { lineHeight: "20px", children: /* @__PURE__ */ jsx(ItemText, { children }) })
9071
9289
  ] });
9072
9290
  }
9073
9291
  );
@@ -10063,238 +10281,27 @@ const EmptyStateIconWrapper = styled(Box)`
10063
10281
  height: 8.8rem;
10064
10282
  }
10065
10283
  `;
10066
- const EmptyStateLayout = ({
10067
- icon,
10068
- content,
10069
- action,
10070
- hasRadius = true,
10071
- shadow = "tableShadow"
10072
- }) => {
10073
- return /* @__PURE__ */ jsxs(
10074
- Flex,
10075
- {
10076
- alignItems: "center",
10077
- direction: "column",
10078
- padding: 11,
10079
- background: "neutral0",
10080
- hasRadius,
10081
- shadow,
10082
- children: [
10083
- icon ? /* @__PURE__ */ jsx(EmptyStateIconWrapper, { paddingBottom: 6, "aria-hidden": true, children: icon }) : null,
10084
- /* @__PURE__ */ jsx(Box, { paddingBottom: 4, children: /* @__PURE__ */ jsx(Typography, { variant: "delta", tag: "p", textAlign: "center", textColor: "neutral600", children: content }) }),
10085
- action
10086
- ]
10087
- }
10088
- );
10089
- };
10090
- const getFocusableNodes = (node, includeNegativeTabIndex) => {
10091
- const nodes = [
10092
- ...node.querySelectorAll(
10093
- 'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
10094
- )
10095
- ];
10096
- const focusables = nodes.filter((node2) => {
10097
- if (node2.hasAttribute("disabled"))
10098
- return false;
10099
- if (includeNegativeTabIndex)
10100
- return true;
10101
- return node2.getAttribute("tabindex") !== "-1";
10102
- });
10103
- return focusables;
10104
- };
10105
- const getFocusableNodesWithKeyboardNav = (nodes) => {
10106
- return nodes.filter((node) => {
10107
- if (node.tagName === "INPUT") {
10108
- return node.type !== "checkbox" && node.type !== "radio";
10109
- }
10110
- return false;
10111
- });
10112
- };
10113
- const FocusTrap = ({ onEscape, restoreFocus = true, skipAutoFocus = false, ...props }) => {
10114
- const trappedRef = React.useRef(null);
10115
- React.useEffect(() => {
10116
- let currentFocus = null;
10117
- if (restoreFocus) {
10118
- currentFocus = document.activeElement;
10119
- }
10120
- return () => {
10121
- if (currentFocus) {
10122
- currentFocus.focus();
10123
- }
10124
- };
10125
- }, [restoreFocus]);
10126
- React.useEffect(() => {
10127
- if (!trappedRef.current || skipAutoFocus)
10128
- return;
10129
- const focusableChildren = getFocusableNodes(trappedRef.current);
10130
- if (focusableChildren.length > 0) {
10131
- const firstElement = focusableChildren[0];
10132
- firstElement.focus();
10133
- } else {
10134
- console.warn(
10135
- "[FocusTrap]: it seems there are no focusable elements in the focus trap tree. Make sure there s at least one."
10136
- );
10137
- }
10138
- }, [skipAutoFocus]);
10139
- const handleKeyDown = (e) => {
10140
- if (e.key === KeyboardKeys.ESCAPE && onEscape) {
10141
- onEscape();
10142
- return;
10143
- }
10144
- if (e.key !== KeyboardKeys.TAB)
10145
- return;
10146
- const focusableChildren = getFocusableNodes(trappedRef.current);
10147
- if (focusableChildren.length > 0) {
10148
- const firstElement = focusableChildren[0];
10149
- const lastElement = focusableChildren[focusableChildren.length - 1];
10150
- if (e.shiftKey) {
10151
- if (firstElement === document.activeElement) {
10152
- e.preventDefault();
10153
- lastElement.focus();
10154
- }
10155
- } else if (lastElement === document.activeElement) {
10156
- e.preventDefault();
10157
- firstElement.focus();
10158
- }
10159
- }
10160
- };
10161
- return /* @__PURE__ */ jsx("div", { ref: trappedRef, onKeyDown: handleKeyDown, ...props });
10162
- };
10163
- const Root$3 = forwardRef((props, forwardedRef) => {
10164
- const { gap = 0, gridCols = 12, ...rest } = props;
10165
- return /* @__PURE__ */ jsx(Wrapper$1, { ref: forwardedRef, $gap: gap, $gridCols: gridCols, ...rest });
10166
- });
10167
- const Wrapper$1 = styled(Box)`
10168
- display: grid;
10169
- grid-template-columns: repeat(${({ $gridCols }) => $gridCols}, 1fr);
10170
- ${({ theme, $gap }) => handleResponsiveValues("gap", $gap, theme)}
10171
- `;
10172
- const ItemImpl = forwardRef(
10173
- ({ col, s, xs, ...props }, forwardedRef) => /* @__PURE__ */ jsx(Item$1, { ref: forwardedRef, $col: col, $s: s, $xs: xs, ...props })
10174
- );
10175
- const Item$1 = styled(Box)`
10176
- grid-column: span ${({ $col }) => $col ?? 1};
10177
- max-width: 100%;
10178
-
10179
- ${({ theme }) => theme.mediaQueries.tablet} {
10180
- grid-column: span ${({ $s }) => $s};
10181
- }
10182
-
10183
- ${({ theme }) => theme.mediaQueries.mobile} {
10184
- grid-column: span ${({ $xs }) => $xs};
10185
- }
10186
- `;
10187
- const Grid = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10188
- __proto__: null,
10189
- Item: ItemImpl,
10190
- Root: Root$3
10191
- }, Symbol.toStringTag, { value: "Module" }));
10192
- const VARIANT_DEFAULT = "tertiary";
10193
- const VARIANT_SECONDARY = "secondary";
10194
- const SIZES = ["S", "M", "L"];
10195
- const VARIANTS = [VARIANT_DEFAULT, VARIANT_SECONDARY];
10196
- const IconButton = forwardRef(
10197
- ({
10198
- label,
10199
- background,
10200
- children,
10201
- disabled = false,
10202
- onClick,
10203
- size = SIZES[0],
10204
- variant: variant2 = VARIANTS[0],
10205
- withTooltip = true,
10206
- ...restProps
10207
- }, ref) => {
10208
- const handleClick = (e) => {
10209
- if (!disabled && onClick) {
10210
- onClick(e);
10211
- }
10212
- };
10213
- const component = /* @__PURE__ */ jsx(
10214
- IconButtonWrapper,
10284
+ const EmptyStateLayout = React.forwardRef(
10285
+ ({ icon, content, action, hasRadius = true, shadow = "tableShadow" }, forwardedRef) => {
10286
+ return /* @__PURE__ */ jsxs(
10287
+ Flex,
10215
10288
  {
10216
- "aria-disabled": disabled,
10217
- background: disabled ? "neutral150" : background,
10218
- justifyContent: "center",
10219
- ...restProps,
10220
- ref,
10221
- $size: size,
10222
- onClick: handleClick,
10223
- $variant: variant2,
10224
- children: /* @__PURE__ */ jsx(AccessibleIcon, { label, children })
10289
+ ref: forwardedRef,
10290
+ alignItems: "center",
10291
+ direction: "column",
10292
+ padding: 11,
10293
+ background: "neutral0",
10294
+ hasRadius,
10295
+ shadow,
10296
+ children: [
10297
+ icon ? /* @__PURE__ */ jsx(EmptyStateIconWrapper, { paddingBottom: 6, "aria-hidden": true, children: icon }) : null,
10298
+ /* @__PURE__ */ jsx(Box, { paddingBottom: 4, children: /* @__PURE__ */ jsx(Typography, { variant: "delta", tag: "p", textAlign: "center", textColor: "neutral600", children: content }) }),
10299
+ action
10300
+ ]
10225
10301
  }
10226
10302
  );
10227
- return withTooltip ? /* @__PURE__ */ jsx(TooltipImpl, { label, children: component }) : component;
10228
10303
  }
10229
10304
  );
10230
- const IconButtonWrapper = styled(BaseButton)`
10231
- background-color: ${({ theme, $variant }) => {
10232
- if ($variant === VARIANT_SECONDARY) {
10233
- return theme.colors.primary100;
10234
- }
10235
- return void 0;
10236
- }};
10237
- border-color: ${({ theme, $variant }) => {
10238
- if ($variant === VARIANT_SECONDARY) {
10239
- return theme.colors.primary200;
10240
- }
10241
- return theme.colors.neutral200;
10242
- }};
10243
- height: ${({ theme, $size }) => theme.sizes.button[$size]};
10244
- width: ${({ theme, $size }) => theme.sizes.button[$size]};
10245
- color: ${({ theme, $variant }) => {
10246
- if ($variant === VARIANT_SECONDARY) {
10247
- return theme.colors.primary500;
10248
- }
10249
- return theme.colors.neutral500;
10250
- }};
10251
-
10252
- &:hover,
10253
- &:focus {
10254
- color: ${({ theme, $variant }) => {
10255
- if ($variant === VARIANT_SECONDARY) {
10256
- return theme.colors.primary600;
10257
- }
10258
- return theme.colors.neutral600;
10259
- }};
10260
- }
10261
-
10262
- &[aria-disabled='true'] {
10263
- color: ${({ theme }) => theme.colors.neutral600};
10264
- }
10265
- `;
10266
- const IconButtonGroup = styled(Flex)`
10267
- & ${IconButtonWrapper}:first-child {
10268
- border-radius: ${({ theme }) => `${theme.borderRadius} 0 0 ${theme.borderRadius}`};
10269
- }
10270
-
10271
- & ${IconButtonWrapper}:last-child {
10272
- border-radius: ${({ theme }) => `0 ${theme.borderRadius} ${theme.borderRadius} 0`};
10273
- }
10274
-
10275
- & ${IconButtonWrapper} {
10276
- border-radius: 0;
10277
- color: ${({ theme }) => theme.colors.neutral700};
10278
-
10279
- & + ${IconButtonWrapper} {
10280
- border-left: none;
10281
- }
10282
-
10283
- &:hover {
10284
- background-color: ${({ theme }) => theme.colors.neutral100};
10285
- color: ${({ theme }) => theme.colors.neutral800};
10286
- }
10287
-
10288
- &:active {
10289
- background-color: ${({ theme }) => theme.colors.neutral150};
10290
- color: ${({ theme }) => theme.colors.neutral900};
10291
- }
10292
-
10293
- &[aria-disabled='true'] {
10294
- color: ${({ theme }) => theme.colors.neutral600};
10295
- }
10296
- }
10297
- `;
10298
10305
  const addMarks = StateEffect.define();
10299
10306
  const filterMarks = StateEffect.define();
10300
10307
  const lineHighlightMark = Decoration.mark({
@@ -10472,62 +10479,19 @@ const JSONInputContainer = styled(Flex)`
10472
10479
  }
10473
10480
  `;
10474
10481
  const LinkButton = forwardRef(
10475
- ({ variant: variant2 = "default", startIcon, endIcon, disabled = false, children, size = "S", ...props }, ref) => {
10476
- const paddingX = size === "S" ? 2 : "10px";
10477
- const paddingY = 4;
10478
- return /* @__PURE__ */ jsxs(
10479
- LinkWrapper$1,
10482
+ ({ disabled, ...restProps }, ref) => {
10483
+ return /* @__PURE__ */ jsx(
10484
+ Button,
10480
10485
  {
10481
10486
  ref,
10482
- "aria-disabled": disabled,
10483
- $variant: variant2,
10484
- background: "buttonPrimary600",
10485
- borderColor: "buttonPrimary600",
10486
- hasRadius: true,
10487
- display: "inline-flex",
10488
- paddingBottom: paddingX,
10489
- paddingLeft: paddingY,
10490
- paddingRight: paddingY,
10491
- paddingTop: paddingX,
10492
- pointerEvents: disabled ? "none" : void 0,
10493
- ...props,
10494
- children: [
10495
- startIcon && /* @__PURE__ */ jsx(Flex, { "aria-hidden": true, children: startIcon }),
10496
- /* @__PURE__ */ jsx(Typography, { variant: size === "S" ? "pi" : void 0, fontWeight: "bold", children }),
10497
- endIcon && /* @__PURE__ */ jsx(Flex, { "aria-hidden": true, children: endIcon })
10498
- ]
10487
+ tag: BaseLinkImpl,
10488
+ tabIndex: disabled ? -1 : void 0,
10489
+ disabled,
10490
+ ...restProps
10499
10491
  }
10500
10492
  );
10501
10493
  }
10502
10494
  );
10503
- const LinkWrapper$1 = styled(BaseLink)`
10504
- gap: ${({ theme }) => theme.spaces[2]};
10505
-
10506
- ${focus}
10507
-
10508
- &[aria-disabled='true'] {
10509
- pointer-events: none;
10510
- }
10511
-
10512
- text-decoration: none;
10513
-
10514
- &[aria-disabled='true'] {
10515
- ${getDisabledStyle}
10516
- &:active {
10517
- ${getDisabledStyle}
10518
- }
10519
- }
10520
-
10521
- &:hover {
10522
- ${getHoverStyle}
10523
- }
10524
-
10525
- &:active {
10526
- ${getActiveStyle}
10527
- }
10528
-
10529
- ${getVariantStyle}
10530
- `;
10531
10495
  const MainWrapper = styled(Box)`
10532
10496
  // To prevent global outline on focus visible to force an outline when Main is focused
10533
10497
  &:focus-visible {
@@ -10563,6 +10527,7 @@ const SkipToContent = ({ children }) => {
10563
10527
  }
10564
10528
  );
10565
10529
  };
10530
+ const setOpacity = (hex, alpha) => `${hex}${Math.floor(alpha * 255).toString(16).padStart(2, "0")}`;
10566
10531
  const ScrollAreaImpl$1 = React.forwardRef(
10567
10532
  ({ children, viewportRef, ...restProps }, forwardedRef) => {
10568
10533
  return /* @__PURE__ */ jsxs(ScrollAreaRoot, { ref: forwardedRef, ...restProps, children: [
@@ -10617,22 +10582,18 @@ const Thumb = styled(ScrollArea.Thumb)`
10617
10582
  min-height: 44px;
10618
10583
  }
10619
10584
  `;
10620
- const Root$2 = Dialog$1.Root;
10585
+ const Root$3 = Dialog$1.Root;
10621
10586
  const Trigger$2 = React.forwardRef((props, forwardedRef) => {
10622
10587
  return /* @__PURE__ */ jsx(Dialog$1.Trigger, { ...props, asChild: true, ref: forwardedRef });
10623
10588
  });
10624
10589
  const Content$2 = React.forwardRef((props, forwardedRef) => {
10625
- return /* @__PURE__ */ jsxs(Dialog$1.Portal, { children: [
10626
- /* @__PURE__ */ jsx(Overlay, {}),
10627
- /* @__PURE__ */ jsx(ContentImpl, { ref: forwardedRef, ...props })
10628
- ] });
10590
+ return /* @__PURE__ */ jsx(Dialog$1.Portal, { children: /* @__PURE__ */ jsx(Overlay, { children: /* @__PURE__ */ jsx(ContentImpl, { ref: forwardedRef, ...props }) }) });
10629
10591
  });
10630
10592
  const Overlay = styled(Dialog$1.Overlay)`
10631
- background-color: ${(props) => props.theme.colors.neutral800};
10593
+ background: ${(props) => setOpacity(props.theme.colors.neutral800, 0.2)};
10632
10594
  position: fixed;
10633
10595
  inset: 0;
10634
10596
  z-index: ${(props) => props.theme.zIndices.overlay};
10635
- opacity: 0.2;
10636
10597
 
10637
10598
  @media (prefers-reduced-motion: no-preference) {
10638
10599
  animation: ${ANIMATIONS.overlayFadeIn} ${(props) => props.theme.motion.timings["200"]}
@@ -10641,8 +10602,8 @@ const Overlay = styled(Dialog$1.Overlay)`
10641
10602
  `;
10642
10603
  const ContentImpl = styled(Dialog$1.Content)`
10643
10604
  max-width: 83rem;
10644
- max-height: 80vh;
10645
- height: min-content;
10605
+ max-height: 90vh;
10606
+ height: auto;
10646
10607
  width: 60%;
10647
10608
  overflow: hidden;
10648
10609
  margin: 0 auto;
@@ -10744,7 +10705,7 @@ const Modal = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
10744
10705
  Content: Content$2,
10745
10706
  Footer,
10746
10707
  Header,
10747
- Root: Root$2,
10708
+ Root: Root$3,
10748
10709
  Title,
10749
10710
  Trigger: Trigger$2
10750
10711
  }, Symbol.toStringTag, { value: "Module" }));
@@ -10931,7 +10892,7 @@ const NextLink = forwardRef(
10931
10892
  ] });
10932
10893
  }
10933
10894
  );
10934
- const LinkWrapper = styled(BaseLink)`
10895
+ const LinkWrapper = styled(BaseLinkImpl)`
10935
10896
  padding: ${({ theme }) => theme.spaces[3]};
10936
10897
  border-radius: ${({ theme }) => theme.borderRadius};
10937
10898
  box-shadow: ${({ $active, theme }) => $active ? theme.shadows.filterShadow : void 0};
@@ -10980,7 +10941,7 @@ const Dots = ({ children, ...props }) => /* @__PURE__ */ jsxs(Box, { ...props, c
10980
10941
  /* @__PURE__ */ jsx(VisuallyHidden, { children }),
10981
10942
  /* @__PURE__ */ jsx(Typography, { "aria-hidden": true, lineHeight: "revert", textColor: "neutral800", variant: "pi", children: "…" })
10982
10943
  ] });
10983
- const Root$1 = Popover$1.Root;
10944
+ const Root$2 = Popover$1.Root;
10984
10945
  const Trigger$1 = React.forwardRef((props, forwardedRef) => {
10985
10946
  return /* @__PURE__ */ jsx(Popover$1.Trigger, { ...props, asChild: true, ref: forwardedRef });
10986
10947
  });
@@ -10992,6 +10953,7 @@ const PopoverContent = styled(Popover$1.Content)`
10992
10953
  z-index: ${({ theme }) => theme.zIndices.popover};
10993
10954
  background-color: ${(props) => props.theme.colors.neutral0};
10994
10955
  border: 1px solid ${({ theme }) => theme.colors.neutral150};
10956
+ border-radius: ${({ theme }) => theme.borderRadius};
10995
10957
 
10996
10958
  @media (prefers-reduced-motion: no-preference) {
10997
10959
  animation-duration: ${(props) => props.theme.motion.timings["200"]};
@@ -11021,26 +10983,29 @@ const PopoverContent = styled(Popover$1.Content)`
11021
10983
  }
11022
10984
  }
11023
10985
  `;
11024
- const ScrollAreaImpl = ({ children, intersectionId, onReachEnd, ...props }) => {
11025
- const popoverRef = React.useRef(null);
11026
- const generatedIntersectionId = useId();
11027
- useIntersection(popoverRef, onReachEnd ?? (() => {
11028
- }), {
11029
- selectorToWatch: `#${stripReactIdOfColon(generatedIntersectionId)}`,
11030
- skipWhen: !intersectionId || !onReachEnd
11031
- });
11032
- return /* @__PURE__ */ jsxs(PopoverScrollArea, { ref: popoverRef, ...props, children: [
11033
- children,
11034
- intersectionId && onReachEnd && /* @__PURE__ */ jsx(Box, { id: stripReactIdOfColon(generatedIntersectionId), width: "100%", height: "1px" })
11035
- ] });
11036
- };
10986
+ const ScrollAreaImpl = React.forwardRef(
10987
+ ({ children, intersectionId, onReachEnd, ...props }, forwardedRef) => {
10988
+ const popoverRef = React.useRef(null);
10989
+ const composedRef = useComposedRefs(popoverRef, forwardedRef);
10990
+ const generatedIntersectionId = useId();
10991
+ useIntersection(popoverRef, onReachEnd ?? (() => {
10992
+ }), {
10993
+ selectorToWatch: `#${stripReactIdOfColon(generatedIntersectionId)}`,
10994
+ skipWhen: !intersectionId || !onReachEnd
10995
+ });
10996
+ return /* @__PURE__ */ jsxs(PopoverScrollArea, { ref: composedRef, ...props, children: [
10997
+ children,
10998
+ intersectionId && onReachEnd && /* @__PURE__ */ jsx(Box, { id: stripReactIdOfColon(generatedIntersectionId), width: "100%", height: "1px" })
10999
+ ] });
11000
+ }
11001
+ );
11037
11002
  const PopoverScrollArea = styled(ScrollAreaImpl$1)`
11038
11003
  height: 20rem;
11039
11004
  `;
11040
11005
  const Popover = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11041
11006
  __proto__: null,
11042
11007
  Content: Content$1,
11043
- Root: Root$1,
11008
+ Root: Root$2,
11044
11009
  ScrollArea: ScrollAreaImpl,
11045
11010
  Trigger: Trigger$1
11046
11011
  }, Symbol.toStringTag, { value: "Module" }));
@@ -11080,7 +11045,7 @@ const RadioGroupRoot = styled(RadioGroup.Root)`
11080
11045
  flex-direction: column;
11081
11046
  gap: ${(props) => props.theme.spaces[3]};
11082
11047
  `;
11083
- const Item = React.forwardRef(({ children, id: idProp, ...restProps }, forwardedRef) => {
11048
+ const Item$1 = React.forwardRef(({ children, id: idProp, ...restProps }, forwardedRef) => {
11084
11049
  const id = useId(idProp);
11085
11050
  return /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
11086
11051
  /* @__PURE__ */ jsx(RadioGroupItem, { id, ref: forwardedRef, ...restProps, children: /* @__PURE__ */ jsx(RadioGroupIndicator, {}) }),
@@ -11149,7 +11114,7 @@ const RadioGroupIndicator = styled(RadioGroup.Indicator)`
11149
11114
  const Radio = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11150
11115
  __proto__: null,
11151
11116
  Group,
11152
- Item
11117
+ Item: Item$1
11153
11118
  }, Symbol.toStringTag, { value: "Module" }));
11154
11119
  const focusFocusable = (node) => {
11155
11120
  const nextNode = node.querySelector('[tabindex="0"]');
@@ -11165,172 +11130,194 @@ const RawTableContext = React.createContext({
11165
11130
  }
11166
11131
  });
11167
11132
  const useTable = () => React.useContext(RawTableContext);
11168
- const RawTable = ({
11169
- colCount,
11170
- rowCount,
11171
- jumpStep = 3,
11172
- initialCol = 0,
11173
- initialRow = 0,
11174
- ...props
11175
- }) => {
11176
- const tableRef = React.useRef(null);
11177
- const mountedRef = React.useRef(false);
11178
- const [rowIndex, setRowIndex] = React.useState(initialRow);
11179
- const [colIndex, setColIndex] = React.useState(initialCol);
11180
- const setTableValues = React.useCallback(({ colIndex: colIndex2, rowIndex: rowIndex2 }) => {
11181
- setColIndex(colIndex2);
11182
- setRowIndex(rowIndex2);
11183
- }, []);
11184
- React.useEffect(() => {
11185
- if (mountedRef.current) {
11186
- focusFocusable(tableRef.current);
11187
- }
11188
- if (!mountedRef.current) {
11189
- mountedRef.current = true;
11190
- }
11191
- }, [colIndex, rowIndex]);
11192
- const handleKeyDown = (e) => {
11193
- switch (e.key) {
11194
- case KeyboardKeys.RIGHT: {
11195
- e.preventDefault();
11196
- setColIndex((prevColIndex) => prevColIndex < colCount - 1 ? prevColIndex + 1 : prevColIndex);
11197
- break;
11198
- }
11199
- case KeyboardKeys.LEFT: {
11200
- e.preventDefault();
11201
- setColIndex((prevColIndex) => prevColIndex > 0 ? prevColIndex - 1 : prevColIndex);
11202
- break;
11203
- }
11204
- case KeyboardKeys.UP: {
11205
- e.preventDefault();
11206
- setRowIndex((prevRowIndex) => prevRowIndex > 0 ? prevRowIndex - 1 : prevRowIndex);
11207
- break;
11133
+ const RawTable = React.forwardRef(
11134
+ ({ colCount, rowCount, jumpStep = 3, initialCol = 0, initialRow = 0, ...props }, forwardedRef) => {
11135
+ const tableRef = React.useRef(null);
11136
+ const mountedRef = React.useRef(false);
11137
+ const composedRef = useComposedRefs(tableRef, forwardedRef);
11138
+ const [rowIndex, setRowIndex] = React.useState(initialRow);
11139
+ const [colIndex, setColIndex] = React.useState(initialCol);
11140
+ const setTableValues = React.useCallback(({ colIndex: colIndex2, rowIndex: rowIndex2 }) => {
11141
+ setColIndex(colIndex2);
11142
+ setRowIndex(rowIndex2);
11143
+ }, []);
11144
+ React.useEffect(() => {
11145
+ if (mountedRef.current) {
11146
+ focusFocusable(tableRef.current);
11208
11147
  }
11209
- case KeyboardKeys.DOWN: {
11210
- e.preventDefault();
11211
- setRowIndex((prevRowIndex) => prevRowIndex < rowCount - 1 ? prevRowIndex + 1 : prevRowIndex);
11212
- break;
11148
+ if (!mountedRef.current) {
11149
+ mountedRef.current = true;
11213
11150
  }
11214
- case KeyboardKeys.HOME: {
11215
- e.preventDefault();
11216
- if (e.ctrlKey) {
11217
- setRowIndex(0);
11151
+ }, [colIndex, rowIndex]);
11152
+ const handleKeyDown = (e) => {
11153
+ switch (e.key) {
11154
+ case KeyboardKeys.RIGHT: {
11155
+ e.preventDefault();
11156
+ setColIndex((prevColIndex) => prevColIndex < colCount - 1 ? prevColIndex + 1 : prevColIndex);
11157
+ break;
11218
11158
  }
11219
- setColIndex(0);
11220
- break;
11221
- }
11222
- case KeyboardKeys.END: {
11223
- e.preventDefault();
11224
- if (e.ctrlKey) {
11225
- setRowIndex(rowCount - 1);
11159
+ case KeyboardKeys.LEFT: {
11160
+ e.preventDefault();
11161
+ setColIndex((prevColIndex) => prevColIndex > 0 ? prevColIndex - 1 : prevColIndex);
11162
+ break;
11163
+ }
11164
+ case KeyboardKeys.UP: {
11165
+ e.preventDefault();
11166
+ setRowIndex((prevRowIndex) => prevRowIndex > 0 ? prevRowIndex - 1 : prevRowIndex);
11167
+ break;
11168
+ }
11169
+ case KeyboardKeys.DOWN: {
11170
+ e.preventDefault();
11171
+ setRowIndex((prevRowIndex) => prevRowIndex < rowCount - 1 ? prevRowIndex + 1 : prevRowIndex);
11172
+ break;
11173
+ }
11174
+ case KeyboardKeys.HOME: {
11175
+ e.preventDefault();
11176
+ if (e.ctrlKey) {
11177
+ setRowIndex(0);
11178
+ }
11179
+ setColIndex(0);
11180
+ break;
11181
+ }
11182
+ case KeyboardKeys.END: {
11183
+ e.preventDefault();
11184
+ if (e.ctrlKey) {
11185
+ setRowIndex(rowCount - 1);
11186
+ }
11187
+ setColIndex(colCount - 1);
11188
+ break;
11189
+ }
11190
+ case KeyboardKeys.PAGE_DOWN: {
11191
+ e.preventDefault();
11192
+ setRowIndex((prevRowIndex) => prevRowIndex + jumpStep < rowCount ? prevRowIndex + jumpStep : rowCount - 1);
11193
+ break;
11194
+ }
11195
+ case KeyboardKeys.PAGE_UP: {
11196
+ e.preventDefault();
11197
+ setRowIndex((prevRowIndex) => prevRowIndex - jumpStep > 0 ? prevRowIndex - jumpStep : 0);
11198
+ break;
11226
11199
  }
11227
- setColIndex(colCount - 1);
11228
- break;
11229
- }
11230
- case KeyboardKeys.PAGE_DOWN: {
11231
- e.preventDefault();
11232
- setRowIndex((prevRowIndex) => prevRowIndex + jumpStep < rowCount ? prevRowIndex + jumpStep : rowCount - 1);
11233
- break;
11234
11200
  }
11235
- case KeyboardKeys.PAGE_UP: {
11236
- e.preventDefault();
11237
- setRowIndex((prevRowIndex) => prevRowIndex - jumpStep > 0 ? prevRowIndex - jumpStep : 0);
11238
- break;
11201
+ };
11202
+ const context = React.useMemo(() => ({ rowIndex, colIndex, setTableValues }), [colIndex, rowIndex, setTableValues]);
11203
+ return /* @__PURE__ */ jsx(RawTableContext.Provider, { value: context, children: /* @__PURE__ */ jsx(
11204
+ "table",
11205
+ {
11206
+ role: "grid",
11207
+ ref: composedRef,
11208
+ "aria-rowcount": rowCount,
11209
+ "aria-colcount": colCount,
11210
+ onKeyDown: handleKeyDown,
11211
+ ...props
11239
11212
  }
11240
- }
11241
- };
11242
- const context = React.useMemo(() => ({ rowIndex, colIndex, setTableValues }), [colIndex, rowIndex, setTableValues]);
11243
- return /* @__PURE__ */ jsx(RawTableContext.Provider, { value: context, children: /* @__PURE__ */ jsx(
11244
- "table",
11245
- {
11246
- role: "grid",
11247
- ref: tableRef,
11248
- "aria-rowcount": rowCount,
11249
- "aria-colcount": colCount,
11250
- onKeyDown: handleKeyDown,
11251
- ...props
11252
- }
11253
- ) });
11213
+ ) });
11214
+ }
11215
+ );
11216
+ const getFocusableNodes = (node, includeNegativeTabIndex) => {
11217
+ const nodes = [
11218
+ ...node.querySelectorAll(
11219
+ 'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
11220
+ )
11221
+ ];
11222
+ const focusables = nodes.filter((node2) => {
11223
+ if (node2.hasAttribute("disabled"))
11224
+ return false;
11225
+ if (includeNegativeTabIndex)
11226
+ return true;
11227
+ return node2.getAttribute("tabindex") !== "-1";
11228
+ });
11229
+ return focusables;
11254
11230
  };
11255
- const RawTd = ({ coords = { col: 0, row: 0 }, tag = "td", ...props }) => {
11256
- const tdRef = React.useRef(null);
11257
- const { rowIndex, colIndex, setTableValues } = useTable();
11258
- const [isActive, setIsActive] = React.useState(false);
11259
- const handleKeyDown = (e) => {
11260
- const focusableNodes = getFocusableNodes(tdRef.current, true);
11261
- if (focusableNodes.length === 0 || focusableNodes.length === 1 && getFocusableNodesWithKeyboardNav(focusableNodes).length === 0) {
11262
- return;
11231
+ const getFocusableNodesWithKeyboardNav = (nodes) => {
11232
+ return nodes.filter((node) => {
11233
+ if (node.tagName === "INPUT") {
11234
+ return node.type !== "checkbox" && node.type !== "radio";
11263
11235
  }
11264
- if (focusableNodes.length > 1 && !focusableNodes.find((node) => node.tagName !== "BUTTON")) {
11265
- e.preventDefault();
11266
- const focussedButtonIndex = focusableNodes.findIndex((node) => node === document.activeElement);
11267
- if (e.key === KeyboardKeys.RIGHT) {
11268
- const nextNode = focusableNodes[focussedButtonIndex + 1];
11269
- if (nextNode) {
11270
- e.stopPropagation();
11271
- nextNode.focus();
11272
- }
11273
- } else if (e.key === KeyboardKeys.LEFT) {
11274
- const nextNode = focusableNodes[focussedButtonIndex - 1];
11275
- if (nextNode) {
11276
- e.stopPropagation();
11277
- nextNode.focus();
11278
- }
11236
+ return false;
11237
+ });
11238
+ };
11239
+ const RawTd = React.forwardRef(
11240
+ ({ coords = { col: 0, row: 0 }, tag = "td", ...props }, forwardedRef) => {
11241
+ const tdRef = React.useRef(null);
11242
+ const composedRef = useComposedRefs(forwardedRef, tdRef);
11243
+ const { rowIndex, colIndex, setTableValues } = useTable();
11244
+ const [isActive, setIsActive] = React.useState(false);
11245
+ const handleKeyDown = (e) => {
11246
+ const focusableNodes = getFocusableNodes(tdRef.current, true);
11247
+ if (focusableNodes.length === 0 || focusableNodes.length === 1 && getFocusableNodesWithKeyboardNav(focusableNodes).length === 0) {
11248
+ return;
11279
11249
  }
11280
- return;
11281
- }
11282
- const isEnterKey = e.key === KeyboardKeys.ENTER;
11283
- if (isEnterKey && !isActive) {
11284
- setIsActive(true);
11285
- } else if ((e.key === KeyboardKeys.ESCAPE || isEnterKey) && isActive) {
11286
- if (isEnterKey && document.activeElement?.tagName === "A") {
11250
+ if (focusableNodes.length > 1 && !focusableNodes.find((node) => node.tagName !== "BUTTON")) {
11251
+ e.preventDefault();
11252
+ const focussedButtonIndex = focusableNodes.findIndex((node) => node === document.activeElement);
11253
+ if (e.key === KeyboardKeys.RIGHT) {
11254
+ const nextNode = focusableNodes[focussedButtonIndex + 1];
11255
+ if (nextNode) {
11256
+ e.stopPropagation();
11257
+ nextNode.focus();
11258
+ }
11259
+ } else if (e.key === KeyboardKeys.LEFT) {
11260
+ const nextNode = focusableNodes[focussedButtonIndex - 1];
11261
+ if (nextNode) {
11262
+ e.stopPropagation();
11263
+ nextNode.focus();
11264
+ }
11265
+ }
11287
11266
  return;
11288
11267
  }
11289
- setIsActive(false);
11290
- tdRef.current.focus();
11291
- } else if (isActive) {
11292
- e.stopPropagation();
11293
- }
11294
- };
11295
- const isFocused = rowIndex === coords.row - 1 && colIndex === coords.col - 1;
11296
- useIsomorphicLayoutEffect(() => {
11297
- const focusableNodes = getFocusableNodes(tdRef.current, true);
11298
- if (focusableNodes.length === 0 || focusableNodes.length === 1 && getFocusableNodesWithKeyboardNav(focusableNodes).length !== 0 || focusableNodes.length > 1 && Boolean(focusableNodes.find((node) => node.tagName !== "BUTTON"))) {
11299
- tdRef.current.setAttribute("tabIndex", !isActive && isFocused ? "0" : "-1");
11300
- focusableNodes.forEach((node, index) => {
11301
- node.setAttribute("tabIndex", isActive ? "0" : "-1");
11302
- if (isActive && index === 0) {
11303
- node.focus();
11268
+ const isEnterKey = e.key === KeyboardKeys.ENTER;
11269
+ if (isEnterKey && !isActive) {
11270
+ setIsActive(true);
11271
+ } else if ((e.key === KeyboardKeys.ESCAPE || isEnterKey) && isActive) {
11272
+ if (isEnterKey && document.activeElement?.tagName === "A") {
11273
+ return;
11304
11274
  }
11305
- });
11306
- } else {
11275
+ setIsActive(false);
11276
+ tdRef.current.focus();
11277
+ } else if (isActive) {
11278
+ e.stopPropagation();
11279
+ }
11280
+ };
11281
+ const isFocused = rowIndex === coords.row - 1 && colIndex === coords.col - 1;
11282
+ useIsomorphicLayoutEffect(() => {
11283
+ const focusableNodes = getFocusableNodes(tdRef.current, true);
11284
+ if (focusableNodes.length === 0 || focusableNodes.length === 1 && getFocusableNodesWithKeyboardNav(focusableNodes).length !== 0 || focusableNodes.length > 1 && Boolean(focusableNodes.find((node) => node.tagName !== "BUTTON"))) {
11285
+ tdRef.current.setAttribute("tabIndex", !isActive && isFocused ? "0" : "-1");
11286
+ focusableNodes.forEach((node, index) => {
11287
+ node.setAttribute("tabIndex", isActive ? "0" : "-1");
11288
+ if (isActive && index === 0) {
11289
+ node.focus();
11290
+ }
11291
+ });
11292
+ } else {
11293
+ focusableNodes.forEach((node) => {
11294
+ node.setAttribute("tabIndex", isFocused ? "0" : "-1");
11295
+ });
11296
+ }
11297
+ }, [isActive, isFocused]);
11298
+ const handleFocusableNodeFocus = React.useCallback(() => {
11299
+ const focusableNodes = getFocusableNodes(tdRef.current, true);
11300
+ if (focusableNodes.length >= 1 && (getFocusableNodesWithKeyboardNav(focusableNodes).length !== 0 || !focusableNodes.find((node) => node.tagName !== "BUTTON"))) {
11301
+ setIsActive(true);
11302
+ }
11303
+ setTableValues({ rowIndex: coords.row - 1, colIndex: coords.col - 1 });
11304
+ }, [coords, setTableValues]);
11305
+ useIsomorphicLayoutEffect(() => {
11306
+ const cell = tdRef.current;
11307
+ const focusableNodes = getFocusableNodes(cell, true);
11307
11308
  focusableNodes.forEach((node) => {
11308
- node.setAttribute("tabIndex", isFocused ? "0" : "-1");
11309
- });
11310
- }
11311
- }, [isActive, isFocused]);
11312
- const handleFocusableNodeFocus = React.useCallback(() => {
11313
- const focusableNodes = getFocusableNodes(tdRef.current, true);
11314
- if (focusableNodes.length >= 1 && (getFocusableNodesWithKeyboardNav(focusableNodes).length !== 0 || !focusableNodes.find((node) => node.tagName !== "BUTTON"))) {
11315
- setIsActive(true);
11316
- }
11317
- setTableValues({ rowIndex: coords.row - 1, colIndex: coords.col - 1 });
11318
- }, [coords, setTableValues]);
11319
- useIsomorphicLayoutEffect(() => {
11320
- const cell = tdRef.current;
11321
- const focusableNodes = getFocusableNodes(cell, true);
11322
- focusableNodes.forEach((node) => {
11323
- node.addEventListener("focus", handleFocusableNodeFocus);
11324
- });
11325
- return () => {
11326
- const focusableNodes2 = getFocusableNodes(cell, true);
11327
- focusableNodes2.forEach((node) => {
11328
- node.removeEventListener("focus", handleFocusableNodeFocus);
11309
+ node.addEventListener("focus", handleFocusableNodeFocus);
11329
11310
  });
11330
- };
11331
- }, [handleFocusableNodeFocus]);
11332
- return /* @__PURE__ */ jsx(Box, { role: "gridcell", tag, ref: tdRef, onKeyDown: handleKeyDown, ...props });
11333
- };
11311
+ return () => {
11312
+ const focusableNodes2 = getFocusableNodes(cell, true);
11313
+ focusableNodes2.forEach((node) => {
11314
+ node.removeEventListener("focus", handleFocusableNodeFocus);
11315
+ });
11316
+ };
11317
+ }, [handleFocusableNodeFocus]);
11318
+ return /* @__PURE__ */ jsx(Box, { role: "gridcell", tag, ref: composedRef, onKeyDown: handleKeyDown, ...props });
11319
+ }
11320
+ );
11334
11321
  const RawTh = (props) => /* @__PURE__ */ jsx(RawTd, { ...props, tag: "th" });
11335
11322
  const RawThead = ({ children, ...props }) => {
11336
11323
  const childrenClone = React.Children.toArray(children).map((child) => {
@@ -11381,14 +11368,18 @@ const SearchbarWrapper = styled.div`
11381
11368
  &:focus-within {
11382
11369
  ${SearchIcon} {
11383
11370
  fill: ${({ theme }) => theme.colors.primary600};
11384
- path {
11385
- }
11386
11371
  }
11387
11372
  }
11388
11373
  `;
11389
11374
  const SearchbarInput = styled(Input$2)`
11390
11375
  border: 1px solid transparent;
11391
11376
 
11377
+ &:hover {
11378
+ button {
11379
+ cursor: pointer;
11380
+ }
11381
+ }
11382
+
11392
11383
  ${inputFocusStyle()}
11393
11384
  `;
11394
11385
  const Searchbar = React.forwardRef(
@@ -11408,7 +11399,17 @@ const Searchbar = React.forwardRef(
11408
11399
  ref: actualRef,
11409
11400
  value,
11410
11401
  startAction: /* @__PURE__ */ jsx(SearchIcon, { "aria-hidden": true }),
11411
- endAction: isCompleting ? /* @__PURE__ */ jsx(Action$1, { label: clearLabel, onClick: handleClear, children: /* @__PURE__ */ jsx(CloseIcon, {}) }) : void 0,
11402
+ endAction: isCompleting ? /* @__PURE__ */ jsx(
11403
+ Action$1,
11404
+ {
11405
+ label: clearLabel,
11406
+ onClick: handleClear,
11407
+ onMouseDown: (e) => {
11408
+ e.preventDefault();
11409
+ },
11410
+ children: /* @__PURE__ */ jsx(CloseIcon, {})
11411
+ }
11412
+ ) : void 0,
11412
11413
  ...props
11413
11414
  }
11414
11415
  )
@@ -11416,47 +11417,60 @@ const Searchbar = React.forwardRef(
11416
11417
  }
11417
11418
  );
11418
11419
  const SearchForm = (props) => /* @__PURE__ */ jsx("form", { ...props, role: "search" });
11419
- const Tag = ({ children, icon, disabled = false, onClick, ...props }) => {
11420
+ const ButtonBox$1 = styled(Box)`
11421
+ display: inline-flex;
11422
+ border: none;
11423
+
11424
+ & > svg {
11425
+ height: 0.8rem;
11426
+ width: 0.8rem;
11427
+ }
11428
+
11429
+ & > svg path {
11430
+ fill: ${({ theme, ...p }) => p["aria-disabled"] ? theme.colors.neutral600 : theme.colors.primary600};
11431
+ }
11432
+
11433
+ &:hover {
11434
+ cursor: ${({ $iconAction }) => $iconAction ? "pointer" : "initial"};
11435
+ }
11436
+ `;
11437
+ const Tag = ({ children, icon, label, disabled = false, onClick, ...props }) => {
11420
11438
  const handleClick = (e) => {
11421
11439
  if (disabled || !onClick)
11422
11440
  return;
11423
11441
  onClick(e);
11424
11442
  };
11425
11443
  return /* @__PURE__ */ jsxs(
11426
- TagWrapper,
11444
+ Flex,
11427
11445
  {
11428
- tag: "button",
11446
+ inline: true,
11429
11447
  background: disabled ? "neutral200" : "primary100",
11430
11448
  color: disabled ? "neutral700" : "primary600",
11431
11449
  paddingLeft: 3,
11432
- paddingRight: 3,
11433
- onClick: handleClick,
11434
- "aria-disabled": disabled,
11435
- disabled,
11436
- borderWidth: "1px",
11437
- borderStyle: "solid",
11450
+ paddingRight: 1,
11438
11451
  borderColor: disabled ? "neutral300" : "primary200",
11439
11452
  hasRadius: true,
11440
11453
  height: "3.2rem",
11441
- gap: 2,
11442
11454
  ...props,
11443
11455
  children: [
11444
11456
  /* @__PURE__ */ jsx(TagText, { $disabled: disabled, variant: "pi", fontWeight: "bold", children }),
11445
- icon
11457
+ /* @__PURE__ */ jsx(
11458
+ ButtonBox$1,
11459
+ {
11460
+ tag: "button",
11461
+ disabled,
11462
+ "aria-disabled": disabled,
11463
+ "aria-label": label,
11464
+ padding: 2,
11465
+ onClick: handleClick,
11466
+ $iconAction: !!onClick,
11467
+ children: icon
11468
+ }
11469
+ )
11446
11470
  ]
11447
11471
  }
11448
11472
  );
11449
11473
  };
11450
- const TagWrapper = styled(Flex)`
11451
- & > svg {
11452
- height: 0.8rem;
11453
- width: 0.8rem;
11454
- }
11455
-
11456
- & > svg path {
11457
- fill: ${({ theme, ...p }) => p["aria-disabled"] ? theme.colors.neutral600 : theme.colors.primary600};
11458
- }
11459
- `;
11460
11474
  const TagText = styled(Typography)`
11461
11475
  color: inherit;
11462
11476
  border-right: 1px solid ${({ theme, $disabled }) => $disabled ? theme.colors.neutral300 : theme.colors.primary200};
@@ -11671,7 +11685,8 @@ const SubNavHeader = ({
11671
11685
  },
11672
11686
  onSubmit = () => {
11673
11687
  },
11674
- id
11688
+ id,
11689
+ placeholder
11675
11690
  }) => {
11676
11691
  const [isSearchOpen, setSearchOpen] = React.useState(false);
11677
11692
  const previousSearchOpenValue = usePrev(isSearchOpen);
@@ -11711,7 +11726,7 @@ const SubNavHeader = ({
11711
11726
  name: "searchbar",
11712
11727
  value,
11713
11728
  onChange,
11714
- placeholder: "e.g: strapi-plugin-abcd",
11729
+ placeholder,
11715
11730
  onKeyDown: handleKeyDown,
11716
11731
  ref: searchRef,
11717
11732
  onBlur: handleBlur,
@@ -11725,7 +11740,7 @@ const SubNavHeader = ({
11725
11740
  ] });
11726
11741
  }
11727
11742
  return /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "flex-start", paddingLeft: 6, paddingTop: 6, paddingBottom: 2, paddingRight: 4, children: [
11728
- /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", alignItems: "flex-start", children: [
11743
+ /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", alignItems: "flex-start", width: "100%", gap: 2, children: [
11729
11744
  /* @__PURE__ */ jsx(Typography, { variant: "beta", tag, children: label }),
11730
11745
  searchable && /* @__PURE__ */ jsx(IconButton, { ref: searchButtonRef, onClick: toggleSearch, label: searchLabel, children: /* @__PURE__ */ jsx(Search, {}) })
11731
11746
  ] }),
@@ -11760,7 +11775,7 @@ const CustomBullet = styled.span`
11760
11775
  background-color: ${({ theme, $active }) => $active ? theme.colors.primary600 : theme.colors.neutral600};
11761
11776
  border-radius: 50%;
11762
11777
  `;
11763
- const SubNavLinkWrapper = styled(BaseLink)`
11778
+ const SubNavLinkWrapper = styled(BaseLinkImpl)`
11764
11779
  display: flex;
11765
11780
  align-items: center;
11766
11781
  justify-content: space-between;
@@ -12000,7 +12015,7 @@ const LabelTypography = styled(Typography)`
12000
12015
  }
12001
12016
  `;
12002
12017
  const [TabsProvider, useTabs] = createContext("Tabs");
12003
- const Root = React.forwardRef(
12018
+ const Root$1 = React.forwardRef(
12004
12019
  ({ disabled = false, variant: variant2 = "regular", hasError, ...props }, forwardedRef) => {
12005
12020
  return /* @__PURE__ */ jsx(TabsProvider, { disabled, hasError, variant: variant2, children: /* @__PURE__ */ jsx(TabsRoot, { ref: forwardedRef, ...props }) });
12006
12021
  }
@@ -12126,7 +12141,7 @@ const Tabs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
12126
12141
  __proto__: null,
12127
12142
  Content,
12128
12143
  List,
12129
- Root,
12144
+ Root: Root$1,
12130
12145
  Trigger
12131
12146
  }, Symbol.toStringTag, { value: "Module" }));
12132
12147
  const TableContainer = styled(Box)`
@@ -12166,7 +12181,7 @@ const TableBox = styled(Box)`
12166
12181
  const ScrollContainer = styled(Box)`
12167
12182
  overflow-x: auto;
12168
12183
  `;
12169
- const Table = ({ footer, ...props }) => {
12184
+ const Table = React.forwardRef(({ footer, ...props }, forwardedRef) => {
12170
12185
  const tableRef = React.useRef(null);
12171
12186
  const [overflowing, setOverflowing] = React.useState();
12172
12187
  const handleScroll = (e) => {
@@ -12189,10 +12204,10 @@ const Table = ({ footer, ...props }) => {
12189
12204
  }
12190
12205
  }, []);
12191
12206
  return /* @__PURE__ */ jsxs(TableContainer, { shadow: "tableShadow", hasRadius: true, background: "neutral0", children: [
12192
- /* @__PURE__ */ jsx(TableBox, { $overflowing: overflowing, position: "relative", children: /* @__PURE__ */ jsx(ScrollContainer, { ref: tableRef, onScroll: handleScroll, paddingLeft: 6, paddingRight: 6, children: /* @__PURE__ */ jsx(TableWrapper, { ...props }) }) }),
12207
+ /* @__PURE__ */ jsx(TableBox, { $overflowing: overflowing, position: "relative", children: /* @__PURE__ */ jsx(ScrollContainer, { ref: tableRef, onScroll: handleScroll, paddingLeft: 6, paddingRight: 6, children: /* @__PURE__ */ jsx(TableWrapper, { ref: forwardedRef, ...props }) }) }),
12193
12208
  footer
12194
12209
  ] });
12195
- };
12210
+ });
12196
12211
  const TbodyWrapper = styled(RawTbody)`
12197
12212
  & tr:last-of-type {
12198
12213
  border-bottom: none;
@@ -12233,7 +12248,6 @@ const Tr = (props) => {
12233
12248
  const CellWrapper = styled(RawTd)`
12234
12249
  vertical-align: middle;
12235
12250
  text-align: left;
12236
- color: ${({ theme }) => theme.colors.neutral600};
12237
12251
  outline-offset: -4px;
12238
12252
 
12239
12253
  /**
@@ -12243,15 +12257,15 @@ const CellWrapper = styled(RawTd)`
12243
12257
  vertical-align: sub;
12244
12258
  }
12245
12259
  `;
12246
- const Th = ({ children, action, ...props }) => {
12247
- return /* @__PURE__ */ jsx(CellWrapper, { as: RawTh, ...props, children: /* @__PURE__ */ jsxs(Flex, { children: [
12260
+ const Th = React.forwardRef(({ children, action, ...props }, forwardedRef) => {
12261
+ return /* @__PURE__ */ jsx(CellWrapper, { color: "neutral600", as: RawTh, ref: forwardedRef, ...props, children: /* @__PURE__ */ jsxs(Flex, { children: [
12248
12262
  children,
12249
12263
  action
12250
12264
  ] }) });
12251
- };
12252
- const Td = ({ children, ...props }) => {
12253
- return /* @__PURE__ */ jsx(CellWrapper, { ...props, children });
12254
- };
12265
+ });
12266
+ const Td = React.forwardRef(({ children, ...props }, forwardedRef) => {
12267
+ return /* @__PURE__ */ jsx(CellWrapper, { color: "neutral800", ref: forwardedRef, ...props, children });
12268
+ });
12255
12269
  const IconBox = styled(Box)`
12256
12270
  height: 2.4rem;
12257
12271
  width: 2.4rem;
@@ -12284,6 +12298,28 @@ const TFooter = ({ children, icon, ...props }) => {
12284
12298
  ] }) })
12285
12299
  ] });
12286
12300
  };
12301
+ const TextButton = forwardRef(
12302
+ ({ children, startIcon, endIcon, disabled = false, loading = false, ...props }, ref) => {
12303
+ const isDisabled = disabled || loading;
12304
+ return /* @__PURE__ */ jsxs(
12305
+ TextButtonWrapper,
12306
+ {
12307
+ ref,
12308
+ disabled: isDisabled,
12309
+ "aria-disabled": isDisabled,
12310
+ tag: "button",
12311
+ type: "button",
12312
+ gap: 2,
12313
+ ...props,
12314
+ children: [
12315
+ loading ? /* @__PURE__ */ jsx(LoadingWrapper, { "aria-hidden": true, children: /* @__PURE__ */ jsx(Loader$1, {}) }) : startIcon,
12316
+ /* @__PURE__ */ jsx(Typography, { variant: "pi", children }),
12317
+ endIcon
12318
+ ]
12319
+ }
12320
+ );
12321
+ }
12322
+ );
12287
12323
  const rotation = keyframes`
12288
12324
  from {
12289
12325
  transform: rotate(0deg);
@@ -12292,51 +12328,24 @@ const rotation = keyframes`
12292
12328
  transform: rotate(359deg);
12293
12329
  }
12294
12330
  `;
12295
- const LoadingWrapper = styled.div`
12331
+ const LoadingWrapper = styled.span`
12332
+ display: flex;
12296
12333
  animation: ${rotation} 2s infinite linear;
12297
12334
  will-change: transform;
12298
12335
  `;
12299
12336
  const TextButtonWrapper = styled(Flex)`
12300
12337
  border: none;
12338
+ background-color: transparent;
12339
+ color: ${(props) => props.theme.colors.primary600};
12340
+ cursor: pointer;
12301
12341
 
12302
12342
  &[aria-disabled='true'] {
12303
12343
  pointer-events: none;
12304
- svg path {
12305
- fill: ${({ theme }) => theme.colors.neutral600};
12306
- }
12307
- }
12308
-
12309
- svg path {
12310
- fill: ${({ theme }) => theme.colors.primary600};
12344
+ color: ${(props) => props.theme.colors.neutral600};
12311
12345
  }
12312
12346
 
12313
12347
  ${focus}
12314
12348
  `;
12315
- const TextButton = React.forwardRef(
12316
- ({ children, startIcon, endIcon, onClick, disabled = false, loading = false, ...props }, ref) => {
12317
- const handleClick = onClick && !disabled ? onClick : void 0;
12318
- const isDisabled = disabled || loading;
12319
- return /* @__PURE__ */ jsxs(
12320
- TextButtonWrapper,
12321
- {
12322
- ref,
12323
- "aria-disabled": isDisabled,
12324
- onClick: handleClick,
12325
- tag: "button",
12326
- type: "button",
12327
- background: "transparent",
12328
- gap: 2,
12329
- ...props,
12330
- children: [
12331
- loading ? /* @__PURE__ */ jsx(LoadingWrapper, { "aria-hidden": true, children: /* @__PURE__ */ jsx(Loader$1, {}) }) : startIcon,
12332
- /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: isDisabled ? "neutral600" : "primary600", children }),
12333
- endIcon
12334
- ]
12335
- }
12336
- );
12337
- }
12338
- );
12339
- TextButton.displayName = "TextButton";
12340
12349
  const TextInput = React.forwardRef((props, ref) => {
12341
12350
  return /* @__PURE__ */ jsx(Input$2, { ref, ...props });
12342
12351
  });
@@ -12354,7 +12363,7 @@ const Textarea = React.forwardRef(
12354
12363
  } else if (field.hint) {
12355
12364
  ariaDescription = `${id}-hint`;
12356
12365
  }
12357
- return /* @__PURE__ */ jsx(Wrapper, { borderColor: hasError ? "danger600" : "neutral200", $hasError: hasError, hasRadius: true, children: /* @__PURE__ */ jsx(
12366
+ return /* @__PURE__ */ jsx(Wrapper$1, { borderColor: hasError ? "danger600" : "neutral200", $hasError: hasError, hasRadius: true, children: /* @__PURE__ */ jsx(
12358
12367
  TextareaElement,
12359
12368
  {
12360
12369
  "aria-invalid": hasError,
@@ -12378,7 +12387,7 @@ const Textarea = React.forwardRef(
12378
12387
  ) });
12379
12388
  }
12380
12389
  );
12381
- const Wrapper = styled(Box)`
12390
+ const Wrapper$1 = styled(Box)`
12382
12391
  ${inputFocusStyle()}
12383
12392
  `;
12384
12393
  const TextareaElement = styled(Box)`
@@ -12523,6 +12532,39 @@ const Input = styled.input`
12523
12532
  z-index: 0;
12524
12533
  width: 100%;
12525
12534
  `;
12535
+ const Root = forwardRef((props, forwardedRef) => {
12536
+ const { gap = 0, gridCols = 12, ...rest } = props;
12537
+ return /* @__PURE__ */ jsx(Wrapper, { ref: forwardedRef, $gap: gap, $gridCols: gridCols, ...rest });
12538
+ });
12539
+ const Wrapper = styled(Box)`
12540
+ display: grid;
12541
+ grid-template-columns: repeat(${({ $gridCols }) => $gridCols}, 1fr);
12542
+ ${({ theme, $gap }) => handleResponsiveValues({ gap: $gap }, theme)}
12543
+ `;
12544
+ const ItemImpl = forwardRef(
12545
+ ({ col, s, xs, ...props }, forwardedRef) => /* @__PURE__ */ jsx(Item, { ref: forwardedRef, $col: col, $s: s, $xs: xs, ...props })
12546
+ );
12547
+ const Item = styled(Flex)`
12548
+ grid-column: span ${({ $xs }) => $xs ?? 12};
12549
+ max-width: 100%;
12550
+
12551
+ ${({ theme }) => theme.breakpoints.small} {
12552
+ grid-column: span ${({ $s, $xs }) => $s ?? $xs ?? 12};
12553
+ }
12554
+
12555
+ ${({ theme }) => theme.breakpoints.medium} {
12556
+ grid-column: span ${({ $m, $s, $xs }) => $m ?? $s ?? $xs ?? 12};
12557
+ }
12558
+
12559
+ ${({ theme }) => theme.breakpoints.large} {
12560
+ grid-column: span ${({ $col, $m, $s, $xs }) => $col ?? $m ?? $s ?? $xs ?? 12};
12561
+ }
12562
+ `;
12563
+ const Grid = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12564
+ __proto__: null,
12565
+ Item: ItemImpl,
12566
+ Root
12567
+ }, Symbol.toStringTag, { value: "Module" }));
12526
12568
  const defaultState = {
12527
12569
  x: 0,
12528
12570
  y: 0,
@@ -12555,6 +12597,56 @@ function useMeasure() {
12555
12597
  }, [element, observer]);
12556
12598
  return [ref, rect];
12557
12599
  }
12600
+ const FocusTrap = ({ onEscape, restoreFocus = true, skipAutoFocus = false, ...props }) => {
12601
+ const trappedRef = React.useRef(null);
12602
+ React.useEffect(() => {
12603
+ let currentFocus = null;
12604
+ if (restoreFocus) {
12605
+ currentFocus = document.activeElement;
12606
+ }
12607
+ return () => {
12608
+ if (currentFocus) {
12609
+ currentFocus.focus();
12610
+ }
12611
+ };
12612
+ }, [restoreFocus]);
12613
+ React.useEffect(() => {
12614
+ if (!trappedRef.current || skipAutoFocus)
12615
+ return;
12616
+ const focusableChildren = getFocusableNodes(trappedRef.current);
12617
+ if (focusableChildren.length > 0) {
12618
+ const firstElement = focusableChildren[0];
12619
+ firstElement.focus();
12620
+ } else {
12621
+ console.warn(
12622
+ "[FocusTrap]: it seems there are no focusable elements in the focus trap tree. Make sure there s at least one."
12623
+ );
12624
+ }
12625
+ }, [skipAutoFocus]);
12626
+ const handleKeyDown = (e) => {
12627
+ if (e.key === KeyboardKeys.ESCAPE && onEscape) {
12628
+ onEscape();
12629
+ return;
12630
+ }
12631
+ if (e.key !== KeyboardKeys.TAB)
12632
+ return;
12633
+ const focusableChildren = getFocusableNodes(trappedRef.current);
12634
+ if (focusableChildren.length > 0) {
12635
+ const firstElement = focusableChildren[0];
12636
+ const lastElement = focusableChildren[focusableChildren.length - 1];
12637
+ if (e.shiftKey) {
12638
+ if (firstElement === document.activeElement) {
12639
+ e.preventDefault();
12640
+ lastElement.focus();
12641
+ }
12642
+ } else if (lastElement === document.activeElement) {
12643
+ e.preventDefault();
12644
+ firstElement.focus();
12645
+ }
12646
+ }
12647
+ };
12648
+ return /* @__PURE__ */ jsx("div", { ref: trappedRef, onKeyDown: handleKeyDown, ...props });
12649
+ };
12558
12650
  const KeyboardNavigable = ({ tagName, attributeName = "", ...props }) => {
12559
12651
  const isValidFocusedElement = () => {
12560
12652
  const focused = document.activeElement;
@@ -12626,8 +12718,7 @@ export {
12626
12718
  Alert,
12627
12719
  Avatar,
12628
12720
  Badge,
12629
- BaseButton,
12630
- BaseLink,
12721
+ BaseLinkImpl as BaseLink,
12631
12722
  Box,
12632
12723
  Breadcrumbs,
12633
12724
  Button,