@atom-learning/components 10.0.0 → 10.1.0

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 (108) hide show
  1. package/dist/components/accordion/Accordion.js +1 -1
  2. package/dist/components/accordion/AccordionContent.js +1 -1
  3. package/dist/components/accordion/AccordionItem.js +1 -1
  4. package/dist/components/accordion/AccordionTrigger.js +2 -2
  5. package/dist/components/action-icon/ActionIcon.js +2 -2
  6. package/dist/components/action-icon/ActionIcon.js.map +1 -1
  7. package/dist/components/alert-dialog/Alert.d.ts +3 -0
  8. package/dist/components/alert-dialog/Alert.js +7 -0
  9. package/dist/components/alert-dialog/Alert.js.map +1 -0
  10. package/dist/components/alert-dialog/alert-context/AlertDialog.js +1 -1
  11. package/dist/components/badge/BadgeText.js +1 -1
  12. package/dist/components/badge/BadgeText.js.map +1 -1
  13. package/dist/components/banner/BannerContainer.js.map +1 -1
  14. package/dist/components/banner/banner-regular/BannerRegularActions.js +1 -1
  15. package/dist/components/banner/banner-regular/BannerRegularActions.js.map +1 -1
  16. package/dist/components/calendar/Calendar.js +4 -4
  17. package/dist/components/calendar/Calendar.js.map +1 -1
  18. package/dist/components/carousel/Carousel.js.map +1 -1
  19. package/dist/components/checkbox-group/CheckboxGroup.d.ts +1 -1
  20. package/dist/components/checkbox-group/CheckboxGroupAllItem.js +3 -2
  21. package/dist/components/checkbox-group/CheckboxGroupAllItem.js.map +1 -1
  22. package/dist/components/checkbox-group/CheckboxGroupChecked.context.js +1 -1
  23. package/dist/components/checkbox-group/CheckboxGroupChecked.context.js.map +1 -1
  24. package/dist/components/checkbox-group/CheckboxGroupMounted.context.js +1 -1
  25. package/dist/components/checkbox-group/CheckboxGroupMounted.context.js.map +1 -1
  26. package/dist/components/chip/Chip.js +2 -2
  27. package/dist/components/chip/Chip.js.map +1 -1
  28. package/dist/components/create-password-field/CreatePasswordField.js +5 -5
  29. package/dist/components/create-password-field/CreatePasswordField.js.map +1 -1
  30. package/dist/components/data-table/DataTableBulkActionsFloating.js +1 -1
  31. package/dist/components/data-table/DataTableHeaderCell.js +9 -9
  32. package/dist/components/data-table/DataTableHeaderCell.js.map +1 -1
  33. package/dist/components/data-table/DataTableSelectAllRowsCheckbox.js.map +1 -1
  34. package/dist/components/data-table/getNewAsyncData.js +1 -1
  35. package/dist/components/data-table/getNewAsyncData.js.map +1 -1
  36. package/dist/components/date-input/DateInput.js.map +1 -1
  37. package/dist/components/file-drop/FileDrop.js +2 -2
  38. package/dist/components/file-drop/FileDrop.js.map +1 -1
  39. package/dist/components/file-input/FileInput.js +1 -1
  40. package/dist/components/form/useFieldError.js +2 -1
  41. package/dist/components/form/useFieldError.js.map +1 -1
  42. package/dist/components/index.d.ts +1 -3
  43. package/dist/components/inline-message/InlineMessage.js +1 -1
  44. package/dist/components/markdown-content/MarkdownContent.js +5 -5
  45. package/dist/components/markdown-content/MarkdownContent.js.map +1 -1
  46. package/dist/components/markdown-content/components/MarkdownEmphasis.d.ts +2 -2
  47. package/dist/components/markdown-content/components/MarkdownEmphasis.js.map +1 -1
  48. package/dist/components/markdown-content/components/MarkdownHeading.d.ts +2 -2
  49. package/dist/components/markdown-content/components/MarkdownHeading.js.map +1 -1
  50. package/dist/components/markdown-content/components/MarkdownLink.d.ts +2 -2
  51. package/dist/components/markdown-content/components/MarkdownLink.js.map +1 -1
  52. package/dist/components/markdown-content/components/MarkdownList.d.ts +2 -2
  53. package/dist/components/markdown-content/components/MarkdownList.js.map +1 -1
  54. package/dist/components/markdown-content/components/MarkdownListItem.d.ts +2 -2
  55. package/dist/components/markdown-content/components/MarkdownListItem.js.map +1 -1
  56. package/dist/components/markdown-content/components/MarkdownParagraph.d.ts +2 -2
  57. package/dist/components/markdown-content/components/MarkdownParagraph.js.map +1 -1
  58. package/dist/components/markdown-content/components/MarkdownStrong.d.ts +2 -2
  59. package/dist/components/markdown-content/components/MarkdownStrong.js.map +1 -1
  60. package/dist/components/navigation/NavigationMenu.js +1 -1
  61. package/dist/components/navigation/NavigationMenu.js.map +1 -1
  62. package/dist/components/pagination/PaginationItems.js +2 -2
  63. package/dist/components/pagination/PaginationItems.js.map +1 -1
  64. package/dist/components/pagination/pagination.helper.js +5 -3
  65. package/dist/components/pagination/pagination.helper.js.map +1 -1
  66. package/dist/components/select-menu/SelectMenu.d.ts +16 -9
  67. package/dist/components/select-menu/SelectMenu.js +6 -4
  68. package/dist/components/select-menu/SelectMenu.js.map +1 -1
  69. package/dist/components/select-menu/SelectMenuContent.d.ts +5 -3
  70. package/dist/components/select-menu/SelectMenuContent.js +24 -65
  71. package/dist/components/select-menu/SelectMenuContent.js.map +1 -1
  72. package/dist/components/select-menu/SelectMenuItem.d.ts +5 -3
  73. package/dist/components/select-menu/SelectMenuItem.js +15 -15
  74. package/dist/components/select-menu/SelectMenuItem.js.map +1 -1
  75. package/dist/components/select-menu/SelectMenuLabel.d.ts +2 -2
  76. package/dist/components/select-menu/SelectMenuLabel.js +2 -2
  77. package/dist/components/select-menu/SelectMenuLabel.js.map +1 -1
  78. package/dist/components/select-menu/SelectMenuSeparator.d.ts +2 -2
  79. package/dist/components/select-menu/SelectMenuSeparator.js +2 -2
  80. package/dist/components/select-menu/SelectMenuSeparator.js.map +1 -1
  81. package/dist/components/select-menu/SelectMenuTrigger.d.ts +3 -2
  82. package/dist/components/select-menu/SelectMenuTrigger.js +12 -12
  83. package/dist/components/select-menu/SelectMenuTrigger.js.map +1 -1
  84. package/dist/components/select-menu-field/SelectMenuField.js +5 -5
  85. package/dist/components/select-menu-field/SelectMenuField.js.map +1 -1
  86. package/dist/components/slider/Slider.js.map +1 -1
  87. package/dist/components/slider-field/SliderField.js +2 -1
  88. package/dist/components/slider-field/SliderField.js.map +1 -1
  89. package/dist/components/stepper/Stepper.js +1 -1
  90. package/dist/components/stepper/Stepper.js.map +1 -1
  91. package/dist/components/stepper/StepperSteps.js +7 -5
  92. package/dist/components/stepper/StepperSteps.js.map +1 -1
  93. package/dist/components/table/useStickyColumnsCss.js +1 -1
  94. package/dist/components/table/useStickyColumnsCss.js.map +1 -1
  95. package/dist/components/tabs/TabsTriggerList.js +1 -1
  96. package/dist/docgen.json +1 -1
  97. package/dist/index.cjs.js +872 -903
  98. package/dist/index.cjs.js.map +1 -1
  99. package/dist/index.js +7 -7
  100. package/dist/styled.js +15 -11
  101. package/dist/styled.js.map +1 -1
  102. package/dist/utilities/hooks/useResizeObserver.js +1 -3
  103. package/dist/utilities/hooks/useResizeObserver.js.map +1 -1
  104. package/dist/utilities/uri/index.js +2 -1
  105. package/dist/utilities/uri/index.js.map +1 -1
  106. package/package.json +25 -11
  107. package/dist/components/index.js +0 -102
  108. package/dist/components/index.js.map +0 -1
package/dist/index.cjs.js CHANGED
@@ -30,6 +30,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
30
  enumerable: true
31
31
  }) : target, mod));
32
32
  //#endregion
33
+ let _radix_ui_react_accordion = require("@radix-ui/react-accordion");
33
34
  let react = require("react");
34
35
  react = __toESM(react, 1);
35
36
  let _radix_ui_react_compose_refs = require("@radix-ui/react-compose-refs");
@@ -38,13 +39,12 @@ clsx = __toESM(clsx, 1);
38
39
  let tailwind_merge = require("tailwind-merge");
39
40
  let tailwind_variants = require("tailwind-variants");
40
41
  let react_jsx_runtime = require("react/jsx-runtime");
41
- let _radix_ui_react_alert_dialog = require("@radix-ui/react-alert-dialog");
42
42
  let _atom_learning_icons = require("@atom-learning/icons");
43
- let _radix_ui_react_accordion = require("@radix-ui/react-accordion");
44
43
  let _radix_ui_react_slot = require("@radix-ui/react-slot");
45
- let invariant = require("invariant");
46
- invariant = __toESM(invariant, 1);
44
+ let tiny_invariant = require("tiny-invariant");
45
+ tiny_invariant = __toESM(tiny_invariant, 1);
47
46
  let _radix_ui_react_tooltip = require("@radix-ui/react-tooltip");
47
+ let _radix_ui_react_alert_dialog = require("@radix-ui/react-alert-dialog");
48
48
  let throttle_debounce = require("throttle-debounce");
49
49
  let embla_carousel_react = require("embla-carousel-react");
50
50
  embla_carousel_react = __toESM(embla_carousel_react, 1);
@@ -73,17 +73,14 @@ let dayzed = require("dayzed");
73
73
  let _radix_ui_react_dialog = require("@radix-ui/react-dialog");
74
74
  let _radix_ui_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
75
75
  let mdast_util_directive = require("mdast-util-directive");
76
- mdast_util_directive = __toESM(mdast_util_directive, 1);
77
76
  let mdast_util_from_markdown = require("mdast-util-from-markdown");
78
- mdast_util_from_markdown = __toESM(mdast_util_from_markdown, 1);
79
77
  let micromark_extension_directive = require("micromark-extension-directive");
80
- micromark_extension_directive = __toESM(micromark_extension_directive, 1);
81
78
  let _radix_ui_react_navigation_menu = require("@radix-ui/react-navigation-menu");
82
79
  _radix_ui_react_navigation_menu = __toESM(_radix_ui_react_navigation_menu, 1);
83
80
  let _radix_ui_react_progress = require("@radix-ui/react-progress");
84
81
  _radix_ui_react_progress = __toESM(_radix_ui_react_progress, 1);
85
- let _radix_ui_react_select = require("@radix-ui/react-select");
86
- _radix_ui_react_select = __toESM(_radix_ui_react_select, 1);
82
+ let react_aria_components = require("react-aria-components");
83
+ react_aria_components = __toESM(react_aria_components, 1);
87
84
  let _radix_ui_react_slider = require("@radix-ui/react-slider");
88
85
  let _radix_ui_react_switch = require("@radix-ui/react-switch");
89
86
  _radix_ui_react_switch = __toESM(_radix_ui_react_switch, 1);
@@ -91,21 +88,11 @@ let _radix_ui_react_tabs = require("@radix-ui/react-tabs");
91
88
  let react_hot_toast = require("react-hot-toast");
92
89
  let react_player_vimeo_js = require("react-player/vimeo.js");
93
90
  react_player_vimeo_js = __toESM(react_player_vimeo_js, 1);
94
- //#region src/utilities/hooks/useIsMountedRef.ts
95
- var useIsMountedRef = () => {
96
- const isMountedRef = (0, react.useRef)(void 0);
97
- (0, react.useEffect)(() => {
98
- isMountedRef.current = true;
99
- return () => {
100
- isMountedRef.current = false;
101
- };
102
- });
103
- return isMountedRef;
104
- };
105
- //#endregion
106
91
  //#region src/styled.tsx
107
92
  tailwind_variants.defaultConfig.twMerge = false;
108
- var isArbitraryNumber = (value) => /^\[[\d.]+\]$/.test(value) || !Number.isNaN(Number(value));
93
+ var ARBITRARY_NUMBER_RE = /^\[[\d.]+\]$/;
94
+ var isArbitraryNumber = (value) => ARBITRARY_NUMBER_RE.test(value) || !Number.isNaN(Number(value));
95
+ var DATA_STATE_VARIANT_RE = /^data-\[state=[^\]]+\]:/;
109
96
  var twMerge = (0, tailwind_merge.extendTailwindMerge)({ extend: {
110
97
  classGroups: {
111
98
  capsize: [{ capsize: ["none", isArbitraryNumber] }],
@@ -127,11 +114,12 @@ var Theme = ({ children, theme }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
127
114
  var createTheme = (config) => Object.fromEntries(Object.values(config).flatMap((tokens) => Object.entries(tokens).map(([token, value]) => [`--${token}`, value])));
128
115
  function styled(el, styles, options) {
129
116
  const variantKeys = Object.keys(styles.variants || {});
117
+ const variantKeySet = new Set(variantKeys);
130
118
  const enableResponsiveVariants = options?.enableResponsiveVariants === true;
131
119
  const tvFn = (0, tailwind_variants.tv)(styles);
132
120
  const Comp = (props) => {
133
- const { ref, ...propsWithoutRef } = props;
134
- const additionalStyles = enableResponsiveVariants ? variantKeys.map((variantKey) => {
121
+ const { ref } = props;
122
+ const additionalStyles = enableResponsiveVariants ? variantKeys.flatMap((variantKey) => {
135
123
  const responsiveVariantConfig = props[variantKey];
136
124
  const variantStyles = styles.variants[variantKey];
137
125
  if (typeof responsiveVariantConfig === "object" && responsiveVariantConfig && !Array.isArray(responsiveVariantConfig)) return Object.entries(responsiveVariantConfig).flatMap(([key, val]) => {
@@ -143,16 +131,17 @@ function styled(el, styles, options) {
143
131
  return [];
144
132
  });
145
133
  return [];
146
- }).flat() : [];
147
- const cls = tvFn(variantKeys.length > 0 ? Object.fromEntries(Object.entries(props).filter(([key]) => variantKeys.includes(key)).map(([key, value]) => {
134
+ }) : [];
135
+ const cls = tvFn(variantKeys.length > 0 ? Object.fromEntries(Object.entries(props).flatMap(([key, value]) => {
136
+ if (!variantKeySet.has(key)) return [];
148
137
  const variantConfig = styles.variants?.[key];
149
138
  if (variantConfig && "true" in variantConfig && "false" in variantConfig) {
150
- if (value === true || value === false) return [key, value];
151
- return [key, null];
139
+ if (value === true || value === false) return [[key, value]];
140
+ return [[key, null]];
152
141
  }
153
- return [key, value];
142
+ return [[key, value]];
154
143
  })) : {});
155
- const filteredProps = Object.fromEntries(Object.entries(props).filter(([key]) => !variantKeys.includes(key) && key !== "as" && key !== "__wrapperClasses"));
144
+ const filteredProps = Object.fromEntries(Object.entries(props).filter(([key]) => !variantKeySet.has(key) && key !== "as" && key !== "__wrapperClasses"));
156
145
  const mergedClassName = (0, clsx.default)(cls, additionalStyles).trim();
157
146
  const propsClassName = props.className;
158
147
  const wrapperClasses = props.__wrapperClasses;
@@ -161,7 +150,7 @@ function styled(el, styles, options) {
161
150
  if (typeof el === "string") {
162
151
  const { className: _, ...restFilteredProps } = filteredProps;
163
152
  const finalClassName = wrapperClasses && propsClassName ? twMerge(mergedClassName, wrapperClasses, propsClassName) : wrapperClasses ? twMerge(mergedClassName, wrapperClasses) : propsClassName ? (() => {
164
- if (propsClassName.split(" ").some((cls) => /^data-\[state=[^\]]+\]:/.test(cls))) return twMerge(propsClassName, mergedClassName);
153
+ if (propsClassName.split(" ").some((cls) => DATA_STATE_VARIANT_RE.test(cls))) return twMerge(propsClassName, mergedClassName);
165
154
  else return twMerge(mergedClassName, propsClassName);
166
155
  })() : twMerge(mergedClassName);
167
156
  return react.default.createElement(props.as || elementType, {
@@ -193,7 +182,7 @@ function styled(el, styles, options) {
193
182
  ref
194
183
  };
195
184
  if (isStyledComponent) {
196
- const hasDataAttributeVariants = propsClassName ? propsClassName.split(" ").some((cls) => /^data-\[state=[^\]]+\]:/.test(cls)) : false;
185
+ const hasDataAttributeVariants = propsClassName ? propsClassName.split(" ").some((cls) => DATA_STATE_VARIANT_RE.test(cls)) : false;
197
186
  const mergedPropsAndComponent = propsClassName ? hasDataAttributeVariants ? twMerge(propsClassName, mergedClassName) : twMerge(mergedClassName, propsClassName) : mergedClassName;
198
187
  propsForComponent.__wrapperClasses = mergedClassName;
199
188
  propsForComponent.className = mergedPropsAndComponent || void 0;
@@ -225,670 +214,181 @@ function styled(el, styles, options) {
225
214
  return Comp;
226
215
  }
227
216
  //#endregion
228
- //#region src/utilities/uri/index.ts
229
- var isExternalUrl = (url) => !!url && /^https?:\/\//.test(url);
230
- var getExternalAnchorProps = (url) => isExternalUrl(url) ? {
231
- target: "_blank",
232
- rel: "noopener noreferrer"
233
- } : {};
217
+ //#region src/utilities/css-wrapper/CSSWrapper.tsx
218
+ var CSSWrapper = ({ className, children }) => className ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
219
+ className,
220
+ children
221
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children });
222
+ CSSWrapper.displayName = "CSSWrapper";
234
223
  //#endregion
235
- //#region src/components/loader/Loader.tsx
236
- var Dot$1 = styled("div", {
224
+ //#region src/components/accordion/AccordionContent.tsx
225
+ var StyledContent$4 = styled(_radix_ui_react_accordion.Content, { base: [
226
+ "border-none",
227
+ "w-full",
228
+ "bg-(--base-1)",
229
+ "overflow-hidden",
230
+ "data-[state=open]:rounded-b-sm",
231
+ "data-[state=open]:rounded-t-none",
232
+ "motion-safe:data-[state=open]:animate-accordion-open",
233
+ "motion-safe:data-[state=closed]:animate-accordion-close"
234
+ ] });
235
+ var AccordionContent = ({ children, className, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledContent$4, {
236
+ ...rest,
237
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CSSWrapper, {
238
+ className,
239
+ children
240
+ })
241
+ });
242
+ //#endregion
243
+ //#region src/components/accordion/AccordionItem.tsx
244
+ var AccordionItem = styled(_radix_ui_react_accordion.Item, { base: ["w-full", "not-last:mb-1"] }, { enablePolymorphism: false });
245
+ //#endregion
246
+ //#region src/experiments/color-scheme/ColorScheme.config.ts
247
+ var generateColors = ({ prefix, colorName, color0 = "" }) => {
248
+ const colors = {};
249
+ let i = 1;
250
+ if (color0) {
251
+ colors[`--${prefix}-${i}`] = `var(--color-${color0})`;
252
+ i++;
253
+ }
254
+ let k = 1;
255
+ for (; i <= 11; i++) {
256
+ colors[`--${prefix}-${i}`] = `var(--color-${colorName}-${k * 100})`;
257
+ k++;
258
+ }
259
+ return colors;
260
+ };
261
+ var colorSchemes$4 = {};
262
+ colorSchemes$4["interactive-loContrast"] = {
263
+ "--interactive-foreground": "var(--foreground)",
264
+ "--interactive-1": "var(--accent-1)",
265
+ "--interactive-2": "var(--accent-2)",
266
+ "--interactive-3": "var(--accent-3)"
267
+ };
268
+ colorSchemes$4["interactive-hiContrast"] = {
269
+ "--interactive-foreground": "var(--foreground-7-plus)",
270
+ "--interactive-1": "var(--accent-9)",
271
+ "--interactive-2": "var(--accent-10)",
272
+ "--interactive-3": "var(--accent-11)"
273
+ };
274
+ var colorNames = [
275
+ "primary",
276
+ "grey",
277
+ "blue",
278
+ "pink",
279
+ "purple",
280
+ "cyan",
281
+ "green",
282
+ "magenta",
283
+ "red",
284
+ "teal",
285
+ "orange",
286
+ "yellow",
287
+ "lime"
288
+ ];
289
+ var createVariants = () => Object.fromEntries(colorNames.flatMap((c) => [[`${c}1`, {
290
+ colorName: c,
291
+ color0: "white"
292
+ }], [`${c}2`, { colorName: c }]]));
293
+ var bases = createVariants();
294
+ var accents = bases;
295
+ (() => {
296
+ Object.entries(bases).forEach(([name, config]) => {
297
+ const themeName = `base-${name}`;
298
+ colorSchemes$4[themeName] = {
299
+ "--foreground": "var(--color-grey-1000)",
300
+ "--foreground-7-plus": "var(--color-white)",
301
+ ...generateColors({
302
+ prefix: "base",
303
+ colorName: config.colorName,
304
+ color0: config.color0
305
+ })
306
+ };
307
+ });
308
+ Object.entries(accents).forEach(([name, config]) => {
309
+ colorSchemes$4[`accent-${name}`] = generateColors({
310
+ prefix: "accent",
311
+ colorName: config.colorName,
312
+ color0: config.color0
313
+ });
314
+ });
315
+ })();
316
+ //#endregion
317
+ //#region src/experiments/color-scheme/ColorScheme.tsx
318
+ /**
319
+ * @experimental Component has not been finalised. Further design input required. Use with caution.
320
+ */
321
+ var ColorScheme = ({ ref, base = "", accent = "", interactive, asChild = false, ...rest }) => {
322
+ const Component = asChild ? _radix_ui_react_slot.Slot : "div";
323
+ const style = {
324
+ ...interactive && colorSchemes$4[`interactive-${interactive}`],
325
+ ...accent && colorSchemes$4[`accent-${accent}`],
326
+ ...base && colorSchemes$4[`base-${base}`]
327
+ };
328
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
329
+ ...rest,
330
+ ref,
331
+ style
332
+ });
333
+ };
334
+ //#endregion
335
+ //#region src/components/icon/Icon.tsx
336
+ var StyledIcon$3 = styled("svg", {
237
337
  base: [
238
- "animate-pulse",
239
- "bg-current",
240
- "rounded-full",
241
- "animation-duration-900",
242
- "nth-3:animation-delay-300",
243
- "nth-4:animation-delay-600"
338
+ "inline-block",
339
+ "fill-none",
340
+ "shrink-0",
341
+ "stroke-current",
342
+ "[stroke-linecap:round]",
343
+ "[stroke-linejoin:round]",
344
+ "align-middle"
244
345
  ],
245
346
  variants: { size: {
246
- sm: ["size-1", "mx-0.5"],
247
- md: ["size-1.5", "mx-0.5"],
248
- lg: ["size-2", "mx-[3px]"]
347
+ sm: ["size-4", "stroke-[1.5]"],
348
+ md: ["size-6", "stroke-[1.75]"],
349
+ lg: ["size-8", "stroke-2"]
249
350
  } }
250
- });
251
- var Loader = ({ className, message = "Loading", size = "md", ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
252
- className: cn("flex", "justify-center", className),
253
- role: "alert",
351
+ }, { enableResponsiveVariants: true });
352
+ var Icon = ({ ref, is: SVG, size = "md", ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledIcon$3, {
353
+ size,
354
+ "aria-hidden": "true",
254
355
  ...rest,
255
- children: [
256
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
257
- className: "sr-only",
258
- children: message
259
- }),
260
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Dot$1, { size }),
261
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Dot$1, { size }),
262
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Dot$1, { size })
263
- ]
356
+ as: SVG,
357
+ ref
264
358
  });
265
359
  //#endregion
266
- //#region src/components/button/Button.tsx
267
- var StyledButton = styled("button", {
360
+ //#region src/components/accordion/AccordionTrigger.tsx
361
+ var RotatingIcon = styled(Icon, { base: [
362
+ "transition-transform",
363
+ "duration-300",
364
+ "[[data-state=open]>&]:rotate-180",
365
+ "[[data-state=closed]>&]:rotate-0"
366
+ ] });
367
+ var StyledTrigger$1 = styled(_radix_ui_react_accordion.Trigger, {
268
368
  base: [
369
+ "border-none",
370
+ "py-3",
371
+ "px-4",
372
+ "w-full",
373
+ "flex",
374
+ "justify-between",
269
375
  "items-center",
270
- "bg-[unset]",
271
- "rounded-md",
272
376
  "cursor-pointer",
273
- "flex",
274
- "font-body",
275
- "font-semibold",
276
- "justify-center",
277
- "no-underline",
278
- "transition-all",
279
- "duration-100",
280
- "ease-out",
281
- "whitespace-nowrap",
282
- "w-max",
377
+ "bg-(--interactive-2)",
378
+ "text-(--interactive-foreground)",
283
379
  "disabled:cursor-not-allowed",
284
- "disabled:opacity-30"
285
- ],
286
- variants: {
287
- theme: {
288
- primary: [
289
- "[--base:var(--color-primary-800)]",
290
- "[--interact:var(--color-primary-900)]",
291
- "[--active:var(--color-primary-1000)]"
292
- ],
293
- secondary: [
294
- "[--base:var(--color-primary-1000)]",
295
- "[--interact:var(--color-primary-1100)]",
296
- "[--active:var(--color-primary-1200)]"
297
- ],
298
- success: [
299
- "[--base:var(--color-success)]",
300
- "[--interact:var(--color-success-mid)]",
301
- "[--active:var(--color-success-dark)]"
302
- ],
303
- warning: [
304
- "[--base:var(--color-warning)]",
305
- "[--interact:var(--color-warning-mid)]",
306
- "[--active:var(--color-warning-dark)]",
307
- "[--text:var(--color-grey-800)]"
308
- ],
309
- danger: [
310
- "[--base:var(--color-danger)]",
311
- "[--interact:var(--color-danger-mid)]",
312
- "[--active:var(--color-danger-dark)]"
313
- ],
314
- neutral: [
315
- "[--base:white]",
316
- "[--interact:rgba(255,255,255,0.9)]",
317
- "[--active:rgba(255,255,255,0.75)]",
318
- "[--text:var(--color-primary-800)]"
319
- ]
320
- },
321
- appearance: {
322
- solid: [
323
- "bg-(--base)",
324
- "text-(--text,white)",
325
- "disabled:opacity-30",
326
- "disabled:cursor-not-allowed",
327
- "not-disabled:hover:bg-(--interact)",
328
- "not-disabled:hover:text-(--text,white)",
329
- "not-disabled:focus:bg-(--interact)",
330
- "not-disabled:focus:text-(--text,white)",
331
- "not-disabled:active:bg-(--active)"
332
- ],
333
- outline: [
334
- "border",
335
- "border-current",
336
- "text-(--base)",
337
- "disabled:opacity-30",
338
- "disabled:cursor-not-allowed",
339
- "not-disabled:hover:no-underline",
340
- "not-disabled:hover:text-(--interact)",
341
- "not-disabled:focus:no-underline",
342
- "not-disabled:focus:text-(--interact)",
343
- "not-disabled:active:text-(--active)"
344
- ]
345
- },
346
- size: {
347
- sm: [
348
- "text-sm",
349
- "leading-[1.53]",
350
- "h-8",
351
- "px-4",
352
- "gap-2",
353
- "[&_svg]:size-4"
354
- ],
355
- md: [
356
- "text-md",
357
- "leading-normal",
358
- "h-10",
359
- "px-8",
360
- "gap-3",
361
- "[&_svg]:size-5"
362
- ],
363
- lg: [
364
- "text-lg",
365
- "leading-normal",
366
- "h-12",
367
- "px-8",
368
- "gap-3",
369
- "[&_svg]:size-[22px]"
370
- ],
371
- xl: [
372
- "text-lg",
373
- "leading-normal",
374
- "h-16",
375
- "px-8",
376
- "gap-3",
377
- "[&_svg]:size-[22px]"
378
- ]
379
- },
380
- isLoading: { true: [
381
- "cursor-not-allowed",
382
- "opacity-60",
383
- "pointer-events-none"
384
- ] },
385
- fullWidth: {
386
- true: ["w-full"],
387
- false: ["w-max"]
388
- }
389
- },
390
- defaultVariants: {
391
- appearance: "solid",
392
- size: "md",
393
- theme: "primary"
394
- }
395
- }, { enableResponsiveVariants: true });
396
- // @__PURE__ keeps this tree-shakable for consumers importing only
397
- var LoaderContentsWrapper = /* @__PURE__ */ styled("span", {
398
- base: [
399
- "items-center",
400
- "flex",
401
- "justify-center",
402
- "invisible"
403
- ],
404
- variants: { size: {
405
- sm: ["gap-2"],
406
- md: ["gap-3"],
407
- lg: ["gap-3"],
408
- xl: ["gap-3"]
409
- } },
410
- defaultVariants: { size: "md" }
411
- }, { enableResponsiveVariants: true });
412
- var WithLoader = ({ size, children }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Loader, { className: "absolute" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LoaderContentsWrapper, {
413
- size,
414
- children
415
- })] });
416
- var Button = (({ ref, children, as, href, isLoading = false, onClick, disabled, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledButton, {
417
- as: as || (href ? "a" : void 0),
418
- ...!disabled && !isLoading && {
419
- href,
420
- onClick
421
- },
422
- isLoading,
423
- type: !href ? "button" : void 0,
424
- disabled,
425
- ...rest,
426
- ...getExternalAnchorProps(href),
427
- ref,
428
- children: isLoading ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WithLoader, {
429
- size: rest.size,
430
- children
431
- }) : children
432
- }));
433
- //#endregion
434
- //#region src/components/heading/Heading.tsx
435
- var Heading = styled("h2", {
436
- base: ["m-0"],
437
- variants: {
438
- size: {
439
- xs: [
440
- "font-body",
441
- "text-md",
442
- "leading-normal",
443
- "capsize-[0.3864]"
444
- ],
445
- sm: [
446
- "font-body",
447
- "text-lg",
448
- "leading-[1.14]",
449
- "capsize-[0.2078]"
450
- ],
451
- md: [
452
- "font-display",
453
- "text-xl",
454
- "leading-[1.14]",
455
- "tracking-[0.01em]",
456
- "capsize-before-[0.2114]",
457
- "capsize-after-[0.2634]"
458
- ],
459
- lg: [
460
- "font-display",
461
- "text-2xl",
462
- "leading-[1.08]",
463
- "tracking-[0.01em]",
464
- "capsize-before-[0.1405]",
465
- "capsize-after-[0.2405]"
466
- ],
467
- xl: [
468
- "font-display",
469
- "text-3xl",
470
- "leading-[1.12]",
471
- "capsize-before-[0.16]",
472
- "capsize-after-[0.26]"
473
- ],
474
- xxl: [
475
- "font-display",
476
- "text-4xl",
477
- "leading-none",
478
- "capsize-before-[0.1]",
479
- "capsize-after-[0.2]"
480
- ]
481
- },
482
- noCapsize: { true: ["capsize-none"] },
483
- weight: {
484
- medium: ["font-medium"],
485
- bold: ["font-bold"]
486
- }
487
- },
488
- defaultVariants: {
489
- size: "md",
490
- weight: "bold"
491
- }
492
- }, { enableResponsiveVariants: true });
493
- //#endregion
494
- //#region src/components/text/Text.tsx
495
- var Text = styled("p", {
496
- base: ["m-0"],
497
- variants: {
498
- size: {
499
- xs: [
500
- "text-xs",
501
- "leading-[1.6]",
502
- "capsize-[0.4364]"
503
- ],
504
- sm: [
505
- "text-sm",
506
- "leading-[1.53]",
507
- "capsize-[0.4056]"
508
- ],
509
- md: [
510
- "text-md",
511
- "leading-normal",
512
- "capsize-[0.3864]"
513
- ],
514
- lg: [
515
- "text-lg",
516
- "leading-[1.52]",
517
- "capsize-[0.3983]"
518
- ],
519
- xl: [
520
- "text-xl",
521
- "leading-[1.42]",
522
- "capsize-[0.3506]"
523
- ],
524
- "2xl": [
525
- "text-2xl",
526
- "leading-[1.40]",
527
- "capsize-[0.3336]"
528
- ],
529
- "3xl": [
530
- "text-3xl",
531
- "leading-[1.28]",
532
- "capsize-[0.2709]"
533
- ],
534
- "4xl": [
535
- "text-4xl",
536
- "leading-none",
537
- "capsize-[0.1309]"
538
- ]
539
- },
540
- noCapsize: { true: ["capsize-none"] },
541
- weight: {
542
- normal: ["font-normal"],
543
- bold: ["font-semibold"]
544
- },
545
- family: {
546
- body: ["font-body"],
547
- display: ["font-display"],
548
- mono: ["font-mono"]
549
- }
550
- },
551
- defaultVariants: {
552
- size: "md",
553
- family: "body"
554
- }
555
- }, { enableResponsiveVariants: true });
556
- //#endregion
557
- //#region src/components/alert-dialog/AlertDialogContent.tsx
558
- var StyledAlertDialogOverlay = styled(_radix_ui_react_alert_dialog.Overlay, { base: [
559
- "bg-alpha-600",
560
- "top-0",
561
- "right-0",
562
- "bottom-0",
563
- "left-0",
564
- "fixed",
565
- "z-1147483646",
566
- "motion-safe:data-[state=open]:animate-fade-in",
567
- "motion-safe:data-[state=closed]:animate-fade-out"
568
- ] });
569
- var StyledAlertDialogContent = styled(_radix_ui_react_alert_dialog.Content, {
570
- base: [
571
- "transform-[translate(-50%,-50%)]",
572
- "bg-white",
573
- "rounded-md",
574
- "shadow-xl",
575
- "box-border",
576
- "left-1/2",
577
- "max-w-[90vw]",
578
- "p-8",
579
- "fixed",
580
- "top-1/2",
581
- "focus:outline-none",
582
- "z-1147483646",
583
- "motion-safe:data-[state=open]:animate-slide-in-center",
584
- "motion-safe:data-[state=closed]:animate-slide-out-center"
585
- ],
586
- variants: { size: {
587
- sm: ["w-95"],
588
- md: ["w-120"],
589
- lg: ["w-150"]
590
- } }
591
- });
592
- var AlertDialogContent = ({ size = "sm", ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_alert_dialog.Portal, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledAlertDialogOverlay, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledAlertDialogContent, {
593
- size,
594
- ...rest
595
- })] });
596
- //#endregion
597
- //#region src/components/alert-dialog/AlertDialog.tsx
598
- var AlertDialog = /* @__PURE__ */ Object.assign(_radix_ui_react_alert_dialog.Root, {
599
- Description: _radix_ui_react_alert_dialog.Description,
600
- Title: _radix_ui_react_alert_dialog.Title,
601
- Action: _radix_ui_react_alert_dialog.Action,
602
- Cancel: _radix_ui_react_alert_dialog.Cancel,
603
- Content: AlertDialogContent,
604
- Trigger: _radix_ui_react_alert_dialog.Trigger
605
- });
606
- AlertDialog.displayName = "AlertDialog";
607
- //#endregion
608
- //#region src/components/icon/Icon.tsx
609
- var StyledIcon$3 = styled("svg", {
610
- base: [
611
- "inline-block",
612
- "fill-none",
613
- "shrink-0",
614
- "stroke-current",
615
- "[stroke-linecap:round]",
616
- "[stroke-linejoin:round]",
617
- "align-middle"
618
- ],
619
- variants: { size: {
620
- sm: ["size-4", "stroke-[1.5]"],
621
- md: ["size-6", "stroke-[1.75]"],
622
- lg: ["size-8", "stroke-2"]
623
- } }
624
- }, { enableResponsiveVariants: true });
625
- var Icon = ({ ref, is: SVG, size = "md", ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledIcon$3, {
626
- size,
627
- "aria-hidden": "true",
628
- ...rest,
629
- as: SVG,
630
- ref
631
- });
632
- //#endregion
633
- //#region src/components/alert-dialog/alert-context/AlertDialogIcon.tsx
634
- var StyledIcon$2 = styled(Icon, {
635
- base: ["self-start"],
636
- variants: { theme: {
637
- info: ["text-info"],
638
- warning: ["text-warning-mid"],
639
- danger: ["rotate-180", "text-danger"],
640
- success: ["text-success"]
641
- } }
642
- });
643
- var iconMap = {
644
- info: _atom_learning_icons.Info,
645
- warning: _atom_learning_icons.Danger,
646
- danger: _atom_learning_icons.Info,
647
- success: _atom_learning_icons.OkCircle
648
- };
649
- var AlertDialogIcon = ({ theme }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledIcon$2, {
650
- theme,
651
- is: iconMap[theme]
652
- });
653
- //#endregion
654
- //#region src/components/alert-dialog/alert-context/AlertDialog.tsx
655
- var Alert$1 = ({ title, size, theme, description, onAction, cancelActionText, confirmActionText, onClose, confirmElement, cancelElement, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlertDialog, {
656
- defaultOpen: true,
657
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(AlertDialog.Content, {
658
- size,
659
- onEscapeKeyDown: (e) => e.preventDefault(),
660
- onCloseAutoFocus: onClose,
661
- ...rest,
662
- className: "flex max-h-[90vh] flex-col gap-8",
663
- children: [
664
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
665
- className: "flex items-center gap-2",
666
- children: [theme && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlertDialogIcon, { theme }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Heading, {
667
- as: AlertDialog.Title,
668
- size: "sm",
669
- className: "mr-4",
670
- children: title
671
- })]
672
- }),
673
- description && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Text, {
674
- as: AlertDialog.Description,
675
- className: "flex overflow-y-auto",
676
- children: description
677
- }),
678
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
679
- className: "flex flex-wrap justify-end gap-2",
680
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlertDialog.Cancel, {
681
- asChild: true,
682
- children: cancelElement || cancelActionText && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
683
- size: "sm",
684
- appearance: "outline",
685
- onClick: () => onAction?.(false),
686
- children: cancelActionText
687
- })
688
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlertDialog.Action, {
689
- asChild: true,
690
- children: confirmElement || /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
691
- size: "sm",
692
- onClick: () => onAction?.(true),
693
- children: confirmActionText
694
- })
695
- })]
696
- })
697
- ]
698
- })
699
- });
700
- //#endregion
701
- //#region src/components/alert-dialog/alert-context/reducer.ts
702
- var initialState = [];
703
- var reducer = (state, action) => {
704
- switch (action.type) {
705
- case "ADD": return [...state, action.payload];
706
- case "REMOVE": return state.filter(({ id }) => id !== action.payload);
707
- default: return state;
708
- }
709
- };
710
- //#endregion
711
- //#region src/components/alert-dialog/AlertDialog.context.tsx
712
- var AlertContext = react.createContext(void 0);
713
- var AlertProvider = ({ children }) => {
714
- const [alerts, dispatch] = react.useReducer(reducer, initialState);
715
- const isMountedRef = useIsMountedRef();
716
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(AlertContext, {
717
- value: react.useMemo(() => ({ showAlert: (content) => dispatch({
718
- payload: {
719
- ...content,
720
- id: crypto.randomUUID()
721
- },
722
- type: "ADD"
723
- }) }), []),
724
- children: [Boolean(alerts.length) && /* @__PURE__ */ (0, react.createElement)(Alert$1, {
725
- ...alerts[0],
726
- key: alerts[0].id,
727
- onClose: () => {
728
- if (isMountedRef.current) dispatch({
729
- payload: alerts[0].id,
730
- type: "REMOVE"
731
- });
732
- }
733
- }), children]
734
- });
735
- };
736
- var useAlert = () => {
737
- const context = react.use(AlertContext);
738
- if (context === void 0) throw new Error("useAlert must be used within a AlertProvider");
739
- return context;
740
- };
741
- //#endregion
742
- //#region src/utilities/css-wrapper/CSSWrapper.tsx
743
- var CSSWrapper = ({ className, children }) => className ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
744
- className,
745
- children
746
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children });
747
- CSSWrapper.displayName = "CSSWrapper";
748
- //#endregion
749
- //#region src/components/accordion/AccordionContent.tsx
750
- var StyledContent$4 = styled(_radix_ui_react_accordion.Content, { base: [
751
- "border-none",
752
- "w-full",
753
- "bg-(--base-1)",
754
- "overflow-hidden",
755
- "data-[state=open]:rounded-b-sm",
756
- "data-[state=open]:rounded-t-none",
757
- "motion-safe:data-[state=open]:animate-accordion-open",
758
- "motion-safe:data-[state=closed]:animate-accordion-close"
759
- ] });
760
- var AccordionContent = ({ children, className, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledContent$4, {
761
- ...rest,
762
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CSSWrapper, {
763
- className,
764
- children
765
- })
766
- });
767
- //#endregion
768
- //#region src/components/accordion/AccordionItem.tsx
769
- var AccordionItem = styled(_radix_ui_react_accordion.Item, { base: ["w-full", "not-last:mb-1"] }, { enablePolymorphism: false });
770
- //#endregion
771
- //#region src/experiments/color-scheme/ColorScheme.config.ts
772
- var generateColors = ({ prefix, colorName, color0 = "" }) => {
773
- const colors = {};
774
- let i = 1;
775
- if (color0) {
776
- colors[`--${prefix}-${i}`] = `var(--color-${color0})`;
777
- i++;
778
- }
779
- let k = 1;
780
- for (; i <= 11; i++) {
781
- colors[`--${prefix}-${i}`] = `var(--color-${colorName}-${k * 100})`;
782
- k++;
783
- }
784
- return colors;
785
- };
786
- var colorSchemes$4 = {};
787
- colorSchemes$4["interactive-loContrast"] = {
788
- "--interactive-foreground": "var(--foreground)",
789
- "--interactive-1": "var(--accent-1)",
790
- "--interactive-2": "var(--accent-2)",
791
- "--interactive-3": "var(--accent-3)"
792
- };
793
- colorSchemes$4["interactive-hiContrast"] = {
794
- "--interactive-foreground": "var(--foreground-7-plus)",
795
- "--interactive-1": "var(--accent-9)",
796
- "--interactive-2": "var(--accent-10)",
797
- "--interactive-3": "var(--accent-11)"
798
- };
799
- var colorNames = [
800
- "primary",
801
- "grey",
802
- "blue",
803
- "pink",
804
- "purple",
805
- "cyan",
806
- "green",
807
- "magenta",
808
- "red",
809
- "teal",
810
- "orange",
811
- "yellow",
812
- "lime"
813
- ];
814
- var createVariants = () => Object.fromEntries(colorNames.flatMap((c) => [[`${c}1`, {
815
- colorName: c,
816
- color0: "white"
817
- }], [`${c}2`, { colorName: c }]]));
818
- var bases = createVariants();
819
- var accents = bases;
820
- (() => {
821
- Object.entries(bases).forEach(([name, config]) => {
822
- const themeName = `base-${name}`;
823
- colorSchemes$4[themeName] = {
824
- "--foreground": "var(--color-grey-1000)",
825
- "--foreground-7-plus": "var(--color-white)",
826
- ...generateColors({
827
- prefix: "base",
828
- colorName: config.colorName,
829
- color0: config.color0
830
- })
831
- };
832
- });
833
- Object.entries(accents).forEach(([name, config]) => {
834
- colorSchemes$4[`accent-${name}`] = generateColors({
835
- prefix: "accent",
836
- colorName: config.colorName,
837
- color0: config.color0
838
- });
839
- });
840
- })();
841
- //#endregion
842
- //#region src/experiments/color-scheme/ColorScheme.tsx
843
- /**
844
- * @experimental Component has not been finalised. Further design input required. Use with caution.
845
- */
846
- var ColorScheme = ({ ref, base = "", accent = "", interactive, asChild = false, ...rest }) => {
847
- const Component = asChild ? _radix_ui_react_slot.Slot : "div";
848
- const style = {
849
- ...interactive && colorSchemes$4[`interactive-${interactive}`],
850
- ...accent && colorSchemes$4[`accent-${accent}`],
851
- ...base && colorSchemes$4[`base-${base}`]
852
- };
853
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
854
- ...rest,
855
- ref,
856
- style
857
- });
858
- };
859
- //#endregion
860
- //#region src/components/accordion/AccordionTrigger.tsx
861
- var RotatingIcon = styled(Icon, { base: [
862
- "transition-transform",
863
- "duration-300",
864
- "[[data-state=open]>&]:rotate-180",
865
- "[[data-state=closed]>&]:rotate-0"
866
- ] });
867
- var StyledTrigger$1 = styled(_radix_ui_react_accordion.Trigger, {
868
- base: [
869
- "border-none",
870
- "py-3",
871
- "px-4",
872
- "w-full",
873
- "flex",
874
- "justify-between",
875
- "items-center",
876
- "cursor-pointer",
877
- "bg-(--interactive-2)",
878
- "text-(--interactive-foreground)",
879
- "disabled:cursor-not-allowed",
880
- "disabled:opacity-30",
881
- "not-disabled:active:bg-(--interactive-3)",
882
- "not-disabled:focus-visible:bg-(--interactive-3)",
883
- "not-disabled:focus-visible:outline-none",
884
- "not-disabled:focus-visible:relative",
885
- "not-disabled:focus-visible:shadow-[var(--color-primary-800)_0px_0px_0px_4px]",
886
- "not-disabled:focus-visible:shadow-[white_0px_0px_0px_2px]",
887
- "not-disabled:focus-visible:z-1",
888
- "not-disabled:hover:bg-(--interactive-3)",
889
- "data-[state=open]:rounded-b-none",
890
- "data-[state=open]:rounded-t-sm",
891
- "data-[state=closed]:rounded-sm"
380
+ "disabled:opacity-30",
381
+ "not-disabled:active:bg-(--interactive-3)",
382
+ "not-disabled:focus-visible:bg-(--interactive-3)",
383
+ "not-disabled:focus-visible:outline-none",
384
+ "not-disabled:focus-visible:relative",
385
+ "not-disabled:focus-visible:shadow-[var(--color-primary-800)_0px_0px_0px_4px]",
386
+ "not-disabled:focus-visible:shadow-[white_0px_0px_0px_2px]",
387
+ "not-disabled:focus-visible:z-1",
388
+ "not-disabled:hover:bg-(--interactive-3)",
389
+ "data-[state=open]:rounded-b-none",
390
+ "data-[state=open]:rounded-t-sm",
391
+ "data-[state=closed]:rounded-sm"
892
392
  ],
893
393
  variants: { arrowPosition: {
894
394
  left: [
@@ -1002,6 +502,14 @@ var OptionalTooltipWrapper = ({ hasTooltip, label, tooltipSide, children }) => {
1002
502
  };
1003
503
  OptionalTooltipWrapper.displayName = "OptionalTooltipWrapper";
1004
504
  //#endregion
505
+ //#region src/utilities/uri/index.ts
506
+ var EXTERNAL_URL_RE = /^https?:\/\//;
507
+ var isExternalUrl = (url) => !!url && EXTERNAL_URL_RE.test(url);
508
+ var getExternalAnchorProps = (url) => isExternalUrl(url) ? {
509
+ target: "_blank",
510
+ rel: "noopener noreferrer"
511
+ } : {};
512
+ //#endregion
1005
513
  //#region src/components/action-icon/ActionIcon.constants.ts
1006
514
  var ActionIconSizeMap = {
1007
515
  xs: "sm",
@@ -1010,41 +518,255 @@ var ActionIconSizeMap = {
1010
518
  lg: "lg"
1011
519
  };
1012
520
  //#endregion
1013
- //#region src/components/action-icon/ActionIcon.tsx
1014
- var StyledButton$5 = styled("button", {
521
+ //#region src/components/action-icon/ActionIcon.tsx
522
+ var StyledButton$5 = styled("button", {
523
+ base: [
524
+ "items-center",
525
+ "appearance-none",
526
+ "bg-white",
527
+ "rounded-md",
528
+ "box-border",
529
+ "cursor-pointer",
530
+ "flex",
531
+ "shrink-0",
532
+ "justify-center",
533
+ "transition-all",
534
+ "duration-100",
535
+ "ease-out",
536
+ "disabled:cursor-not-allowed",
537
+ "disabled:opacity-30"
538
+ ],
539
+ variants: {
540
+ theme: {
541
+ neutral: [
542
+ "[--solid-base:var(--color-white)]",
543
+ "[--solid-interact:var(--color-grey-100)]",
544
+ "[--solid-active:var(--color-grey-200)]",
545
+ "[--solid-text:var(--color-grey-1200)]",
546
+ "[--base:var(--color-grey-700)]",
547
+ "[--interact:var(--color-primary-900)]",
548
+ "[--active:var(--color-primary-1100)]"
549
+ ],
550
+ primary: [
551
+ "[--base:var(--color-primary-800)]",
552
+ "[--interact:var(--color-primary-900)]",
553
+ "[--active:var(--color-primary-1000)]"
554
+ ],
555
+ primaryDark: [
556
+ "[--base:var(--color-primary-1000)]",
557
+ "[--interact:var(--color-primary-1100)]",
558
+ "[--active:var(--color-primary-1200)]"
559
+ ],
560
+ success: [
561
+ "[--base:var(--color-success)]",
562
+ "[--interact:var(--color-success-mid)]",
563
+ "[--active:var(--color-success-dark)]"
564
+ ],
565
+ warning: [
566
+ "[--base:var(--color-warning)]",
567
+ "[--interact:var(--color-warning-mid)]",
568
+ "[--active:var(--color-warning-dark)]"
569
+ ],
570
+ danger: [
571
+ "[--base:var(--color-danger)]",
572
+ "[--interact:var(--color-danger-mid)]",
573
+ "[--active:var(--color-danger-dark)]"
574
+ ],
575
+ white: [
576
+ "[--base:var(--color-white)]",
577
+ "[--interact:var(--color-white)]",
578
+ "[--active:var(--color-white)]"
579
+ ]
580
+ },
581
+ appearance: {
582
+ simple: [
583
+ "bg-transparent",
584
+ "text-(--base)",
585
+ "not-disabled:hover:text-(--interact)",
586
+ "not-disabled:focus:text-(--interact)",
587
+ "not-disabled:active:text-(--active)"
588
+ ],
589
+ outline: [
590
+ "bg-[unset]",
591
+ "border",
592
+ "border-current",
593
+ "text-(--base)",
594
+ "not-disabled:hover:text-(--interact)",
595
+ "not-disabled:focus:text-(--interact)",
596
+ "not-disabled:active:text-(--active)"
597
+ ],
598
+ solid: [
599
+ "bg-(--solid-base,var(--base))",
600
+ "text-(--solid-text,white)",
601
+ "not-disabled:hover:bg-(--solid-interact,var(--interact))",
602
+ "not-disabled:hover:text-(--solid-text,white)",
603
+ "not-disabled:focus:bg-(--solid-interact,var(--interact))",
604
+ "not-disabled:focus:text-(--solid-text,white)",
605
+ "not-disabled:active:bg-(--solid-active,var(--active))"
606
+ ]
607
+ },
608
+ size: {
609
+ xs: ["size-6"],
610
+ sm: ["size-8"],
611
+ md: ["size-10"],
612
+ lg: ["size-12"]
613
+ },
614
+ isRounded: { true: ["rounded-full"] }
615
+ }
616
+ }, { enableResponsiveVariants: true });
617
+ var ActionIcon = ({ ref, children, theme = "primary", appearance = "simple", size = "sm", label, href, disabled, hasTooltip = true, tooltipSide, ...rest }) => {
618
+ const INVALID_CHILDREN_MESSAGE = `A single ${Icon.name} component is permitted as a child of ActionIcon`;
619
+ (0, tiny_invariant.default)(react.Children.count(children) === 1, INVALID_CHILDREN_MESSAGE);
620
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OptionalTooltipWrapper, {
621
+ hasTooltip,
622
+ label,
623
+ tooltipSide,
624
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledButton$5, {
625
+ ...href ? {
626
+ as: "a",
627
+ href: disabled ? void 0 : href,
628
+ onClick: void 0,
629
+ "aria-disabled": !!disabled
630
+ } : { type: "button" },
631
+ ...getExternalAnchorProps(href),
632
+ ...rest,
633
+ "aria-label": label,
634
+ theme,
635
+ appearance,
636
+ size,
637
+ ref,
638
+ disabled,
639
+ children: react.Children.map(children, (child) => {
640
+ if (!react.isValidElement(child)) throw new Error(INVALID_CHILDREN_MESSAGE);
641
+ (0, tiny_invariant.default)(child.type === Icon, `Children of type ${child?.type} aren't permitted. Only an ${Icon.name} component is allowed in ActionIcon`);
642
+ return react.cloneElement(child, { size: ActionIconSizeMap[size] });
643
+ })
644
+ })
645
+ });
646
+ };
647
+ //#endregion
648
+ //#region src/components/alert-dialog/AlertDialogContent.tsx
649
+ var StyledAlertDialogOverlay = styled(_radix_ui_react_alert_dialog.Overlay, { base: [
650
+ "bg-alpha-600",
651
+ "top-0",
652
+ "right-0",
653
+ "bottom-0",
654
+ "left-0",
655
+ "fixed",
656
+ "z-1147483646",
657
+ "motion-safe:data-[state=open]:animate-fade-in",
658
+ "motion-safe:data-[state=closed]:animate-fade-out"
659
+ ] });
660
+ var StyledAlertDialogContent = styled(_radix_ui_react_alert_dialog.Content, {
661
+ base: [
662
+ "transform-[translate(-50%,-50%)]",
663
+ "bg-white",
664
+ "rounded-md",
665
+ "shadow-xl",
666
+ "box-border",
667
+ "left-1/2",
668
+ "max-w-[90vw]",
669
+ "p-8",
670
+ "fixed",
671
+ "top-1/2",
672
+ "focus:outline-none",
673
+ "z-1147483646",
674
+ "motion-safe:data-[state=open]:animate-slide-in-center",
675
+ "motion-safe:data-[state=closed]:animate-slide-out-center"
676
+ ],
677
+ variants: { size: {
678
+ sm: ["w-95"],
679
+ md: ["w-120"],
680
+ lg: ["w-150"]
681
+ } }
682
+ });
683
+ var AlertDialogContent = ({ size = "sm", ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_alert_dialog.Portal, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledAlertDialogOverlay, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledAlertDialogContent, {
684
+ size,
685
+ ...rest
686
+ })] });
687
+ //#endregion
688
+ //#region src/components/alert-dialog/AlertDialog.tsx
689
+ var AlertDialog = /* @__PURE__ */ Object.assign(_radix_ui_react_alert_dialog.Root, {
690
+ Description: _radix_ui_react_alert_dialog.Description,
691
+ Title: _radix_ui_react_alert_dialog.Title,
692
+ Action: _radix_ui_react_alert_dialog.Action,
693
+ Cancel: _radix_ui_react_alert_dialog.Cancel,
694
+ Content: AlertDialogContent,
695
+ Trigger: _radix_ui_react_alert_dialog.Trigger
696
+ });
697
+ AlertDialog.displayName = "AlertDialog";
698
+ //#endregion
699
+ //#region src/utilities/hooks/useIsMountedRef.ts
700
+ var useIsMountedRef = () => {
701
+ const isMountedRef = (0, react.useRef)(void 0);
702
+ (0, react.useEffect)(() => {
703
+ isMountedRef.current = true;
704
+ return () => {
705
+ isMountedRef.current = false;
706
+ };
707
+ });
708
+ return isMountedRef;
709
+ };
710
+ //#endregion
711
+ //#region src/components/loader/Loader.tsx
712
+ var Dot$1 = styled("div", {
713
+ base: [
714
+ "animate-pulse",
715
+ "bg-current",
716
+ "rounded-full",
717
+ "animation-duration-900",
718
+ "nth-3:animation-delay-300",
719
+ "nth-4:animation-delay-600"
720
+ ],
721
+ variants: { size: {
722
+ sm: ["size-1", "mx-0.5"],
723
+ md: ["size-1.5", "mx-0.5"],
724
+ lg: ["size-2", "mx-[3px]"]
725
+ } }
726
+ });
727
+ var Loader = ({ className, message = "Loading", size = "md", ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
728
+ className: cn("flex", "justify-center", className),
729
+ role: "alert",
730
+ ...rest,
731
+ children: [
732
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
733
+ className: "sr-only",
734
+ children: message
735
+ }),
736
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Dot$1, { size }),
737
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Dot$1, { size }),
738
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Dot$1, { size })
739
+ ]
740
+ });
741
+ //#endregion
742
+ //#region src/components/button/Button.tsx
743
+ var StyledButton = styled("button", {
1015
744
  base: [
1016
745
  "items-center",
1017
- "appearance-none",
1018
- "bg-white",
746
+ "bg-[unset]",
1019
747
  "rounded-md",
1020
- "box-border",
1021
748
  "cursor-pointer",
1022
749
  "flex",
1023
- "shrink-0",
750
+ "font-body",
751
+ "font-semibold",
1024
752
  "justify-center",
753
+ "no-underline",
1025
754
  "transition-all",
1026
755
  "duration-100",
1027
756
  "ease-out",
757
+ "whitespace-nowrap",
758
+ "w-max",
1028
759
  "disabled:cursor-not-allowed",
1029
760
  "disabled:opacity-30"
1030
761
  ],
1031
762
  variants: {
1032
763
  theme: {
1033
- neutral: [
1034
- "[--solid-base:var(--color-white)]",
1035
- "[--solid-interact:var(--color-grey-100)]",
1036
- "[--solid-active:var(--color-grey-200)]",
1037
- "[--solid-text:var(--color-grey-1200)]",
1038
- "[--base:var(--color-grey-700)]",
1039
- "[--interact:var(--color-primary-900)]",
1040
- "[--active:var(--color-primary-1100)]"
1041
- ],
1042
764
  primary: [
1043
765
  "[--base:var(--color-primary-800)]",
1044
766
  "[--interact:var(--color-primary-900)]",
1045
767
  "[--active:var(--color-primary-1000)]"
1046
768
  ],
1047
- primaryDark: [
769
+ secondary: [
1048
770
  "[--base:var(--color-primary-1000)]",
1049
771
  "[--interact:var(--color-primary-1100)]",
1050
772
  "[--active:var(--color-primary-1200)]"
@@ -1057,85 +779,368 @@ var StyledButton$5 = styled("button", {
1057
779
  warning: [
1058
780
  "[--base:var(--color-warning)]",
1059
781
  "[--interact:var(--color-warning-mid)]",
1060
- "[--active:var(--color-warning-dark)]"
782
+ "[--active:var(--color-warning-dark)]",
783
+ "[--text:var(--color-grey-800)]"
1061
784
  ],
1062
785
  danger: [
1063
786
  "[--base:var(--color-danger)]",
1064
787
  "[--interact:var(--color-danger-mid)]",
1065
788
  "[--active:var(--color-danger-dark)]"
1066
789
  ],
1067
- white: [
1068
- "[--base:var(--color-white)]",
1069
- "[--interact:var(--color-white)]",
1070
- "[--active:var(--color-white)]"
790
+ neutral: [
791
+ "[--base:white]",
792
+ "[--interact:rgba(255,255,255,0.9)]",
793
+ "[--active:rgba(255,255,255,0.75)]",
794
+ "[--text:var(--color-primary-800)]"
1071
795
  ]
1072
796
  },
1073
797
  appearance: {
1074
- simple: [
1075
- "bg-transparent",
798
+ solid: [
799
+ "bg-(--base)",
800
+ "text-(--text,white)",
801
+ "disabled:opacity-30",
802
+ "disabled:cursor-not-allowed",
803
+ "not-disabled:hover:bg-(--interact)",
804
+ "not-disabled:hover:text-(--text,white)",
805
+ "not-disabled:focus:bg-(--interact)",
806
+ "not-disabled:focus:text-(--text,white)",
807
+ "not-disabled:active:bg-(--active)"
808
+ ],
809
+ outline: [
810
+ "border",
811
+ "border-current",
1076
812
  "text-(--base)",
813
+ "disabled:opacity-30",
814
+ "disabled:cursor-not-allowed",
815
+ "not-disabled:hover:no-underline",
1077
816
  "not-disabled:hover:text-(--interact)",
817
+ "not-disabled:focus:no-underline",
1078
818
  "not-disabled:focus:text-(--interact)",
1079
819
  "not-disabled:active:text-(--active)"
820
+ ]
821
+ },
822
+ size: {
823
+ sm: [
824
+ "text-sm",
825
+ "leading-[1.53]",
826
+ "h-8",
827
+ "px-4",
828
+ "gap-2",
829
+ "[&_svg]:size-4"
830
+ ],
831
+ md: [
832
+ "text-md",
833
+ "leading-normal",
834
+ "h-10",
835
+ "px-8",
836
+ "gap-3",
837
+ "[&_svg]:size-5"
838
+ ],
839
+ lg: [
840
+ "text-lg",
841
+ "leading-normal",
842
+ "h-12",
843
+ "px-8",
844
+ "gap-3",
845
+ "[&_svg]:size-[22px]"
846
+ ],
847
+ xl: [
848
+ "text-lg",
849
+ "leading-normal",
850
+ "h-16",
851
+ "px-8",
852
+ "gap-3",
853
+ "[&_svg]:size-[22px]"
854
+ ]
855
+ },
856
+ isLoading: { true: [
857
+ "cursor-not-allowed",
858
+ "opacity-60",
859
+ "pointer-events-none"
860
+ ] },
861
+ fullWidth: {
862
+ true: ["w-full"],
863
+ false: ["w-max"]
864
+ }
865
+ },
866
+ defaultVariants: {
867
+ appearance: "solid",
868
+ size: "md",
869
+ theme: "primary"
870
+ }
871
+ }, { enableResponsiveVariants: true });
872
+ // @__PURE__ keeps this tree-shakable for consumers importing only
873
+ var LoaderContentsWrapper = /* @__PURE__ */ styled("span", {
874
+ base: [
875
+ "items-center",
876
+ "flex",
877
+ "justify-center",
878
+ "invisible"
879
+ ],
880
+ variants: { size: {
881
+ sm: ["gap-2"],
882
+ md: ["gap-3"],
883
+ lg: ["gap-3"],
884
+ xl: ["gap-3"]
885
+ } },
886
+ defaultVariants: { size: "md" }
887
+ }, { enableResponsiveVariants: true });
888
+ var WithLoader = ({ size, children }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Loader, { className: "absolute" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LoaderContentsWrapper, {
889
+ size,
890
+ children
891
+ })] });
892
+ var Button = (({ ref, children, as, href, isLoading = false, onClick, disabled, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledButton, {
893
+ as: as || (href ? "a" : void 0),
894
+ ...!disabled && !isLoading && {
895
+ href,
896
+ onClick
897
+ },
898
+ isLoading,
899
+ type: !href ? "button" : void 0,
900
+ disabled,
901
+ ...rest,
902
+ ...getExternalAnchorProps(href),
903
+ ref,
904
+ children: isLoading ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WithLoader, {
905
+ size: rest.size,
906
+ children
907
+ }) : children
908
+ }));
909
+ //#endregion
910
+ //#region src/components/heading/Heading.tsx
911
+ var Heading = styled("h2", {
912
+ base: ["m-0"],
913
+ variants: {
914
+ size: {
915
+ xs: [
916
+ "font-body",
917
+ "text-md",
918
+ "leading-normal",
919
+ "capsize-[0.3864]"
920
+ ],
921
+ sm: [
922
+ "font-body",
923
+ "text-lg",
924
+ "leading-[1.14]",
925
+ "capsize-[0.2078]"
926
+ ],
927
+ md: [
928
+ "font-display",
929
+ "text-xl",
930
+ "leading-[1.14]",
931
+ "tracking-[0.01em]",
932
+ "capsize-before-[0.2114]",
933
+ "capsize-after-[0.2634]"
934
+ ],
935
+ lg: [
936
+ "font-display",
937
+ "text-2xl",
938
+ "leading-[1.08]",
939
+ "tracking-[0.01em]",
940
+ "capsize-before-[0.1405]",
941
+ "capsize-after-[0.2405]"
942
+ ],
943
+ xl: [
944
+ "font-display",
945
+ "text-3xl",
946
+ "leading-[1.12]",
947
+ "capsize-before-[0.16]",
948
+ "capsize-after-[0.26]"
949
+ ],
950
+ xxl: [
951
+ "font-display",
952
+ "text-4xl",
953
+ "leading-none",
954
+ "capsize-before-[0.1]",
955
+ "capsize-after-[0.2]"
956
+ ]
957
+ },
958
+ noCapsize: { true: ["capsize-none"] },
959
+ weight: {
960
+ medium: ["font-medium"],
961
+ bold: ["font-bold"]
962
+ }
963
+ },
964
+ defaultVariants: {
965
+ size: "md",
966
+ weight: "bold"
967
+ }
968
+ }, { enableResponsiveVariants: true });
969
+ //#endregion
970
+ //#region src/components/text/Text.tsx
971
+ var Text = styled("p", {
972
+ base: ["m-0"],
973
+ variants: {
974
+ size: {
975
+ xs: [
976
+ "text-xs",
977
+ "leading-[1.6]",
978
+ "capsize-[0.4364]"
979
+ ],
980
+ sm: [
981
+ "text-sm",
982
+ "leading-[1.53]",
983
+ "capsize-[0.4056]"
984
+ ],
985
+ md: [
986
+ "text-md",
987
+ "leading-normal",
988
+ "capsize-[0.3864]"
989
+ ],
990
+ lg: [
991
+ "text-lg",
992
+ "leading-[1.52]",
993
+ "capsize-[0.3983]"
994
+ ],
995
+ xl: [
996
+ "text-xl",
997
+ "leading-[1.42]",
998
+ "capsize-[0.3506]"
999
+ ],
1000
+ "2xl": [
1001
+ "text-2xl",
1002
+ "leading-[1.40]",
1003
+ "capsize-[0.3336]"
1080
1004
  ],
1081
- outline: [
1082
- "bg-[unset]",
1083
- "border",
1084
- "border-current",
1085
- "text-(--base)",
1086
- "not-disabled:hover:text-(--interact)",
1087
- "not-disabled:focus:text-(--interact)",
1088
- "not-disabled:active:text-(--active)"
1005
+ "3xl": [
1006
+ "text-3xl",
1007
+ "leading-[1.28]",
1008
+ "capsize-[0.2709]"
1089
1009
  ],
1090
- solid: [
1091
- "bg-(--solid-base,var(--base))",
1092
- "text-(--solid-text,white)",
1093
- "not-disabled:hover:bg-(--solid-interact,var(--interact))",
1094
- "not-disabled:hover:text-(--solid-text,white)",
1095
- "not-disabled:focus:bg-(--solid-interact,var(--interact))",
1096
- "not-disabled:focus:text-(--solid-text,white)",
1097
- "not-disabled:active:bg-(--solid-active,var(--active))"
1010
+ "4xl": [
1011
+ "text-4xl",
1012
+ "leading-none",
1013
+ "capsize-[0.1309]"
1098
1014
  ]
1099
1015
  },
1100
- size: {
1101
- xs: ["size-6"],
1102
- sm: ["size-8"],
1103
- md: ["size-10"],
1104
- lg: ["size-12"]
1016
+ noCapsize: { true: ["capsize-none"] },
1017
+ weight: {
1018
+ normal: ["font-normal"],
1019
+ bold: ["font-semibold"]
1105
1020
  },
1106
- isRounded: { true: ["rounded-full"] }
1021
+ family: {
1022
+ body: ["font-body"],
1023
+ display: ["font-display"],
1024
+ mono: ["font-mono"]
1025
+ }
1026
+ },
1027
+ defaultVariants: {
1028
+ size: "md",
1029
+ family: "body"
1107
1030
  }
1108
1031
  }, { enableResponsiveVariants: true });
1109
- var ActionIcon = ({ ref, children, theme = "primary", appearance = "simple", size = "sm", label, href, disabled, hasTooltip = true, tooltipSide, ...rest }) => {
1110
- const INVALID_CHILDREN_MESSAGE = `A single ${Icon.name} component is permitted as a child of ActionIcon`;
1111
- (0, invariant.default)(react.Children.count(children) === 1, INVALID_CHILDREN_MESSAGE);
1112
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OptionalTooltipWrapper, {
1113
- hasTooltip,
1114
- label,
1115
- tooltipSide,
1116
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledButton$5, {
1117
- ...href ? {
1118
- as: "a",
1119
- href: disabled ? void 0 : href,
1120
- onClick: void 0,
1121
- "aria-disabled": !!disabled
1122
- } : { type: "button" },
1123
- ...getExternalAnchorProps(href),
1124
- ...rest,
1125
- "aria-label": label,
1126
- theme,
1127
- appearance,
1128
- size,
1129
- ref,
1130
- disabled,
1131
- children: react.Children.map(children, (child) => {
1132
- if (!react.isValidElement(child)) throw new Error(INVALID_CHILDREN_MESSAGE);
1133
- (0, invariant.default)(child.type === Icon, `Children of type ${child?.type} aren't permitted. Only an ${Icon.name} component is allowed in ActionIcon`);
1134
- return react.cloneElement(child, { size: ActionIconSizeMap[size] });
1032
+ //#endregion
1033
+ //#region src/components/alert-dialog/alert-context/AlertDialogIcon.tsx
1034
+ var StyledIcon$2 = styled(Icon, {
1035
+ base: ["self-start"],
1036
+ variants: { theme: {
1037
+ info: ["text-info"],
1038
+ warning: ["text-warning-mid"],
1039
+ danger: ["rotate-180", "text-danger"],
1040
+ success: ["text-success"]
1041
+ } }
1042
+ });
1043
+ var iconMap = {
1044
+ info: _atom_learning_icons.Info,
1045
+ warning: _atom_learning_icons.Danger,
1046
+ danger: _atom_learning_icons.Info,
1047
+ success: _atom_learning_icons.OkCircle
1048
+ };
1049
+ var AlertDialogIcon = ({ theme }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledIcon$2, {
1050
+ theme,
1051
+ is: iconMap[theme]
1052
+ });
1053
+ //#endregion
1054
+ //#region src/components/alert-dialog/alert-context/AlertDialog.tsx
1055
+ var Alert$1 = ({ title, size, theme, description, onAction, cancelActionText, confirmActionText, onClose, confirmElement, cancelElement, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlertDialog, {
1056
+ defaultOpen: true,
1057
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(AlertDialog.Content, {
1058
+ size,
1059
+ onEscapeKeyDown: (e) => e.preventDefault(),
1060
+ onCloseAutoFocus: onClose,
1061
+ ...rest,
1062
+ className: "flex max-h-[90vh] flex-col gap-8",
1063
+ children: [
1064
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1065
+ className: "flex items-center gap-2",
1066
+ children: [theme && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlertDialogIcon, { theme }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Heading, {
1067
+ as: AlertDialog.Title,
1068
+ size: "sm",
1069
+ className: "mr-4",
1070
+ children: title
1071
+ })]
1072
+ }),
1073
+ description && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Text, {
1074
+ as: AlertDialog.Description,
1075
+ className: "flex overflow-y-auto",
1076
+ children: description
1077
+ }),
1078
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1079
+ className: "flex flex-wrap justify-end gap-2",
1080
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlertDialog.Cancel, {
1081
+ asChild: true,
1082
+ children: cancelElement || cancelActionText && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
1083
+ size: "sm",
1084
+ appearance: "outline",
1085
+ onClick: () => onAction?.(false),
1086
+ children: cancelActionText
1087
+ })
1088
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlertDialog.Action, {
1089
+ asChild: true,
1090
+ children: confirmElement || /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
1091
+ size: "sm",
1092
+ onClick: () => onAction?.(true),
1093
+ children: confirmActionText
1094
+ })
1095
+ })]
1135
1096
  })
1136
- })
1097
+ ]
1098
+ })
1099
+ });
1100
+ //#endregion
1101
+ //#region src/components/alert-dialog/alert-context/reducer.ts
1102
+ var initialState = [];
1103
+ var reducer = (state, action) => {
1104
+ switch (action.type) {
1105
+ case "ADD": return [...state, action.payload];
1106
+ case "REMOVE": return state.filter(({ id }) => id !== action.payload);
1107
+ default: return state;
1108
+ }
1109
+ };
1110
+ //#endregion
1111
+ //#region src/components/alert-dialog/AlertDialog.context.tsx
1112
+ var AlertContext = react.createContext(void 0);
1113
+ var AlertProvider = ({ children }) => {
1114
+ const [alerts, dispatch] = react.useReducer(reducer, initialState);
1115
+ const isMountedRef = useIsMountedRef();
1116
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(AlertContext, {
1117
+ value: react.useMemo(() => ({ showAlert: (content) => dispatch({
1118
+ payload: {
1119
+ ...content,
1120
+ id: crypto.randomUUID()
1121
+ },
1122
+ type: "ADD"
1123
+ }) }), []),
1124
+ children: [Boolean(alerts.length) && /* @__PURE__ */ (0, react.createElement)(Alert$1, {
1125
+ ...alerts[0],
1126
+ key: alerts[0].id,
1127
+ onClose: () => {
1128
+ if (isMountedRef.current) dispatch({
1129
+ payload: alerts[0].id,
1130
+ type: "REMOVE"
1131
+ });
1132
+ }
1133
+ }), children]
1137
1134
  });
1138
1135
  };
1136
+ var useAlert = () => {
1137
+ const context = react.use(AlertContext);
1138
+ if (context === void 0) throw new Error("useAlert must be used within a AlertProvider");
1139
+ return context;
1140
+ };
1141
+ //#endregion
1142
+ //#region src/components/alert-dialog/Alert.ts
1143
+ var Alert = { Provider: AlertProvider };
1139
1144
  //#endregion
1140
1145
  //#region src/components/avatar/Avatar.context.tsx
1141
1146
  var AvatarRootContext = react.createContext({
@@ -1657,9 +1662,7 @@ var useResizeObserver = ({ delay = 500, elements, onResize }) => {
1657
1662
  elements.forEach((element) => {
1658
1663
  if (element) observer.observe(element);
1659
1664
  });
1660
- return () => {
1661
- elements.forEach((element) => element && observer.unobserve(element));
1662
- };
1665
+ return () => observer.disconnect();
1663
1666
  }, [observer, elements]);
1664
1667
  return observer;
1665
1668
  };
@@ -1669,7 +1672,7 @@ var ObserveBadgeTextOverflow = ({ elRef }) => {
1669
1672
  const { setIsOverflowing } = react.use(BadgeContext);
1670
1673
  useResizeObserver({
1671
1674
  delay: 0,
1672
- elements: [elRef],
1675
+ elements: react.useMemo(() => [elRef], [elRef]),
1673
1676
  onResize: () => {
1674
1677
  if (!elRef?.scrollWidth || !elRef?.clientWidth) return;
1675
1678
  setIsOverflowing?.(elRef.scrollWidth > elRef.clientWidth);
@@ -1945,14 +1948,14 @@ var BannerRegularActions = ({ children, className, ...rest }) => {
1945
1948
  const { size } = useBannerContext();
1946
1949
  const gap = typeof size === "string" ? toGap[size] : "gap-2 md:gap-4";
1947
1950
  const direction = typeof size === "string" ? toDirection$1[size] : "flex-col md:flex-row";
1948
- (0, invariant.default)(react.Children.count(children) <= MAX_ALLOWED_CHILDREN, `A maximum of ${MAX_ALLOWED_CHILDREN} ${BannerRegularButton.displayName} component(s) are permitted as children of ${BannerRegularActions.displayName}`);
1951
+ (0, tiny_invariant.default)(react.Children.count(children) <= MAX_ALLOWED_CHILDREN, `A maximum of ${MAX_ALLOWED_CHILDREN} ${BannerRegularButton.displayName} component(s) are permitted as children of ${BannerRegularActions.displayName}`);
1949
1952
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1950
1953
  className: cn("flex", gap, direction, className),
1951
1954
  ...rest,
1952
1955
  children: react.Children.map(children, (child, index) => {
1953
1956
  if (child == null) return child;
1954
1957
  if (!react.isValidElement(child)) throw new Error(`Child passed to ${BannerRegularActions.displayName} is not a valid element`);
1955
- (0, invariant.default)(child.type === BannerRegularButton, `Children of type ${child?.type} aren't permitted. Only an ${BannerRegularButton.displayName} component is allowed in ${BannerRegularActions.displayName}`);
1958
+ (0, tiny_invariant.default)(child.type === BannerRegularButton, `Children of type ${child?.type} aren't permitted. Only an ${BannerRegularButton.displayName} component is allowed in ${BannerRegularActions.displayName}`);
1956
1959
  const propsToInject = { appearance: index > 0 ? "outline" : void 0 };
1957
1960
  return react.cloneElement(child, propsToInject);
1958
1961
  })
@@ -2653,7 +2656,7 @@ var generateNewCheckedFn = (currentChecked) => {
2653
2656
  const newCheckedSet = new Set(currentChecked);
2654
2657
  if (newItemChecked) newCheckedSet.add(itemValue);
2655
2658
  else newCheckedSet.delete(itemValue);
2656
- return Array.from(newCheckedSet);
2659
+ return [...newCheckedSet];
2657
2660
  };
2658
2661
  };
2659
2662
  var CheckboxGroupCheckedProvider = ({ checked: controlledChecked, defaultChecked = [], onCheckedChange, ...rest }) => {
@@ -2701,7 +2704,7 @@ var CheckboxGroupMountedProvider = (props) => {
2701
2704
  const newMountedSet = new Set(prevMounted);
2702
2705
  if (newItemMounted) newMountedSet.add(itemValue);
2703
2706
  else newMountedSet.delete(itemValue);
2704
- return Array.from(newMountedSet);
2707
+ return [...newMountedSet];
2705
2708
  });
2706
2709
  }, [handleItemMountedChangeFurtherUpContext]);
2707
2710
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CheckboxGroupMountedContext, {
@@ -2727,8 +2730,9 @@ var CheckboxGroupAllItem = ({ onCheckedChange, title = "all", ...rest }) => {
2727
2730
  onCheckedChange: handleItemCheckedChange,
2728
2731
  checked: (() => {
2729
2732
  if (!checkedItems.length || !mountedItems.length) return false;
2730
- if (mountedItems.every((mountedItem) => checkedItems.includes(mountedItem))) return true;
2731
- if (mountedItems.some((mountedItem) => checkedItems.includes(mountedItem))) return "indeterminate";
2733
+ const checkedSet = new Set(checkedItems);
2734
+ if (mountedItems.every((mountedItem) => checkedSet.has(mountedItem))) return true;
2735
+ if (mountedItems.some((mountedItem) => checkedSet.has(mountedItem))) return "indeterminate";
2732
2736
  return false;
2733
2737
  })(),
2734
2738
  title,
@@ -3234,9 +3238,10 @@ var InlineFieldWrapper = ({ align = "start", children, className, description, d
3234
3238
  InlineFieldWrapper.displayName = "InlineFieldWrapper";
3235
3239
  //#endregion
3236
3240
  //#region src/components/form/useFieldError.ts
3241
+ var FIELD_PATH_SEPARATOR_RE = /[,[\].]+?/;
3237
3242
  var useFieldError = (fieldName) => {
3238
3243
  const { errors } = (0, react_hook_form.useFormContext)();
3239
- const fieldPath = fieldName.split(/[,[\].]+?/).filter(Boolean);
3244
+ const fieldPath = fieldName.split(FIELD_PATH_SEPARATOR_RE).filter(Boolean);
3240
3245
  const getErrors = () => (0, dlv.default)(errors, fieldPath);
3241
3246
  return { error: getErrors()?.message };
3242
3247
  };
@@ -3309,14 +3314,14 @@ var ChipContent = ({ children, ...rest }) => {
3309
3314
  const isSingleChild = childrenArray.length <= 1;
3310
3315
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledChipContent, {
3311
3316
  ...rest,
3312
- children: childrenArray.map((child, index) => {
3317
+ children: childrenArray.map((child) => {
3313
3318
  if (!isSingleChild && typeof child === "string") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3314
3319
  className: "overflow-hidden text-ellipsis whitespace-nowrap",
3315
3320
  children: child
3316
3321
  }, child);
3317
3322
  if (react.isValidElement(child) && child.type === Icon) {
3318
3323
  const iconProps = child.props;
3319
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChipIcon, { ...iconProps }, `icon-${index}`);
3324
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChipIcon, { ...iconProps }, child.key);
3320
3325
  }
3321
3326
  return child;
3322
3327
  })
@@ -3905,6 +3910,10 @@ var PasswordField = ({ className, hideLabel, label = "Password", name, prompt =
3905
3910
  PasswordField.displayName = "PasswordField";
3906
3911
  //#endregion
3907
3912
  //#region src/components/create-password-field/CreatePasswordField.tsx
3913
+ var getMessageTheme = (result, isFocused) => {
3914
+ if (result) return "success";
3915
+ return isFocused ? "neutral" : "error";
3916
+ };
3908
3917
  var CreatePasswordField = ({ validate, defaultValidation, messageDirection = "row", label = "Create a password", name = "password", className, validation, appearance, ...rest }) => {
3909
3918
  const { formState, control } = (0, react_hook_form.useFormContext)();
3910
3919
  const [isFocused, setIsFocused] = react.useState(false);
@@ -3914,17 +3923,13 @@ var CreatePasswordField = ({ validate, defaultValidation, messageDirection = "ro
3914
3923
  const validatePassword = react.useCallback(async (password) => {
3915
3924
  const result = await validate(password);
3916
3925
  if (result) {
3917
- (0, invariant.default)(typeof result === "object", "The validate function must return an object");
3926
+ (0, tiny_invariant.default)(typeof result === "object", "The validate function must return an object");
3918
3927
  setValidationResult(result);
3919
3928
  return Object.values(result).every((isValid) => isValid);
3920
3929
  }
3921
3930
  return false;
3922
3931
  }, [setValidationResult]);
3923
3932
  const handleChange = react.useMemo(() => (0, throttle_debounce.throttle)(500, validatePassword), [validatePassword]);
3924
- const getMessageTheme = (result, isFocused) => {
3925
- if (result) return "success";
3926
- return isFocused ? "neutral" : "error";
3927
- };
3928
3933
  const showValidation = control.mode.isOnBlur && (isFocused || touched) || control.mode.isOnSubmit && (isFocused || formState.isSubmitted && error);
3929
3934
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3930
3935
  className,
@@ -3974,8 +3979,8 @@ var getNewAsyncData = async (getAsyncData, asyncDataOptions, paginationState, so
3974
3979
  sortDirection: asyncDataOptions?.sortDirection ?? getSortDirection(sorting),
3975
3980
  globalFilter: asyncDataOptions.globalFilter ?? globalFilter
3976
3981
  });
3977
- (0, invariant.default)(Array.isArray(newData?.results), "The getAsyncData function must return an object with a property `result` which must be an array");
3978
- (0, invariant.default)(newData && Number.isInteger(newData.total) && newData.total >= 0, "The getAsyncData function must return an object with a property `total` which must be a positive integer or zero");
3982
+ (0, tiny_invariant.default)(Array.isArray(newData?.results), "The getAsyncData function must return an object with a property `result` which must be an array");
3983
+ (0, tiny_invariant.default)(newData && Number.isInteger(newData.total) && newData.total >= 0, "The getAsyncData function must return an object with a property `total` which must be a positive integer or zero");
3979
3984
  return newData;
3980
3985
  };
3981
3986
  //#endregion
@@ -4266,7 +4271,7 @@ var useStickyColumnsStyle = ({ numberOfStickyColumns, wrapperRef }) => {
4266
4271
  const generateColumnsStyle = react.useCallback(() => {
4267
4272
  let accWidth = 0;
4268
4273
  const tableHeaderCells = wrapperRef.current?.querySelectorAll("th");
4269
- return Array.from(tableHeaderCells || []).slice(0, numberOfStickyColumns).reduce((acc, column, index) => {
4274
+ return [...tableHeaderCells || []].slice(0, numberOfStickyColumns).reduce((acc, column, index) => {
4270
4275
  const elementNumber = index + 1;
4271
4276
  const styleObject = {
4272
4277
  ...acc,
@@ -4975,18 +4980,18 @@ var SortIcon = ({ direction }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Ico
4975
4980
  size: "sm",
4976
4981
  className: "stroke-primary-900 absolute left-1"
4977
4982
  });
4983
+ var handleKeyDown = (event, callback) => {
4984
+ if (event.key === "Enter" || event.key === " ") {
4985
+ event.preventDefault();
4986
+ callback(event);
4987
+ }
4988
+ };
4978
4989
  var DataTableHeaderCell = ({ header, includeTotal = false, totalSuffix = "items", children, className, ...rest }) => {
4979
4990
  const sortDirection = header.column.getIsSorted();
4980
4991
  const { isSortable: isSortableTable, getRowModel } = useDataTable();
4981
4992
  const isDataColumn = header.column.getCanSort();
4982
4993
  const totalRows = getRowModel()?.rows?.length;
4983
4994
  const { hoverProps, isHovered } = (0, react_aria.useHover)({});
4984
- const handleKeyDown = (event, callback) => {
4985
- if (event.key === "Enter" || event.key === " ") {
4986
- event.preventDefault();
4987
- callback(event);
4988
- }
4989
- };
4990
4995
  const headerSortingHandler = header.column.getToggleSortingHandler();
4991
4996
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledTableHeaderCell, {
4992
4997
  isSortable: isSortableTable && isDataColumn,
@@ -5005,7 +5010,7 @@ var DataTableHeaderCell = ({ header, includeTotal = false, totalSuffix = "items"
5005
5010
  className: cn("flex", "items-center", "relative", "size-6", "ml-2", isHovered ? "bg-primary-200" : "bg-primary-100", "rounded-sm"),
5006
5011
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SortIcon, { direction: sortDirection })
5007
5012
  }),
5008
- includeTotal && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(StyledCount, {
5013
+ includeTotal ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(StyledCount, {
5009
5014
  size: "sm",
5010
5015
  weight: "normal",
5011
5016
  children: [
@@ -5015,7 +5020,7 @@ var DataTableHeaderCell = ({ header, includeTotal = false, totalSuffix = "items"
5015
5020
  totalSuffix,
5016
5021
  ")"
5017
5022
  ]
5018
- })
5023
+ }) : null
5019
5024
  ]
5020
5025
  })
5021
5026
  });
@@ -5456,7 +5461,7 @@ var getPaginationElementsToRender = (currentPage, pagesCount, visibleElementsCou
5456
5461
  if (canFitViewAllPopover) visiblePagesCount -= 1;
5457
5462
  if (canFitEdgePage) visiblePagesCount -= 1;
5458
5463
  const firstPage = paginationPages[0];
5459
- const lastPage = paginationPages[paginationPages.length - 1];
5464
+ const lastPage = paginationPages.at(-1);
5460
5465
  /**
5461
5466
  * If we're truncating and current page is at the start of the page list,
5462
5467
  * render the initial truncated page list, e.g.
@@ -5531,14 +5536,16 @@ var getPaginationElementsToRender = (currentPage, pagesCount, visibleElementsCou
5531
5536
  };
5532
5537
  var findNextAvailablePage = (startPage, disabledPages, pagesCount) => {
5533
5538
  if (startPage > pagesCount) return;
5539
+ const disabledSet = new Set(disabledPages);
5534
5540
  let nextPage = startPage;
5535
- while (disabledPages.includes(nextPage)) nextPage++;
5541
+ while (disabledSet.has(nextPage)) nextPage++;
5536
5542
  return nextPage;
5537
5543
  };
5538
5544
  var findPreviousAvailablePage = (startPage, disabledPages) => {
5539
5545
  if (startPage < 1) return;
5546
+ const disabledSet = new Set(disabledPages);
5540
5547
  let previousPage = startPage;
5541
- while (disabledPages.includes(previousPage)) previousPage--;
5548
+ while (disabledSet.has(previousPage)) previousPage--;
5542
5549
  return previousPage;
5543
5550
  };
5544
5551
  //#endregion
@@ -5853,9 +5860,9 @@ var PaginationPreviousButton = (props) => {
5853
5860
  //#region src/components/pagination/PaginationItems.tsx
5854
5861
  var PaginationItems = () => {
5855
5862
  const { paginationItems } = usePagination();
5856
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: paginationItems.map((paginationItem, i) => {
5863
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: paginationItems.map((paginationItem) => {
5857
5864
  switch (paginationItem) {
5858
- case VIEW_ALL_POPOVER: return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PaginationPopover, {}, paginationItem + i);
5865
+ case VIEW_ALL_POPOVER: return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PaginationPopover, {}, paginationItem);
5859
5866
  case GO_TO_PREVIOUS_PAGE: return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PaginationPreviousButton, {}, paginationItem);
5860
5867
  case GO_TO_NEXT_PAGE: return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PaginationNextButton, {}, paginationItem);
5861
5868
  default: return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PaginationPage, { pageNumber: paginationItem }, paginationItem);
@@ -6136,7 +6143,7 @@ var StyledButton$2 = styled(Button, {
6136
6143
  });
6137
6144
  var offsetWeekdayNames = (weekdayNames, firstDayOfWeek) => {
6138
6145
  const start = weekdayNames.slice(0, firstDayOfWeek);
6139
- return weekdayNames.slice(firstDayOfWeek).concat(start);
6146
+ return [...weekdayNames.slice(firstDayOfWeek), ...start];
6140
6147
  };
6141
6148
  var Calendar = ({ className, refDateSelected, refDateToday, firstDayOfWeek = 0, monthNames = monthNamesShort, weekdayNames = weekdayNamesShort, labels = DEFAULT_LABELS, date: dateProp, minDate, maxDate, setYear, ...rest }) => {
6142
6149
  const [fallbackDate] = react.useState(() => /* @__PURE__ */ new Date());
@@ -6198,7 +6205,7 @@ var Calendar = ({ className, refDateSelected, refDateToday, firstDayOfWeek = 0,
6198
6205
  onClick: () => handleSetYear(year),
6199
6206
  selected: isCurrentYear,
6200
6207
  children: year
6201
- }, `${year}${i}`);
6208
+ }, year);
6202
6209
  })
6203
6210
  }),
6204
6211
  !showYears && calendars.map(({ month, year, weeks }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
@@ -7108,9 +7115,9 @@ var generateNodeKey = (node, index) => {
7108
7115
  return `${node.type}${index}`;
7109
7116
  };
7110
7117
  var MarkdownContent = ({ content, customComponents = {}, className }) => {
7111
- const AST = (0, mdast_util_from_markdown.default)(content, {
7112
- extensions: [(0, micromark_extension_directive.default)()],
7113
- mdastExtensions: [mdast_util_directive.default.fromMarkdown]
7118
+ const AST = (0, mdast_util_from_markdown.fromMarkdown)(content, {
7119
+ extensions: [(0, micromark_extension_directive.directive)()],
7120
+ mdastExtensions: [(0, mdast_util_directive.directiveFromMarkdown)()]
7114
7121
  });
7115
7122
  const componentsMap = {
7116
7123
  ...defaultComponentsMap,
@@ -7357,7 +7364,7 @@ var NavigationMenuComponent = ({ children, className, ...rest }) => {
7357
7364
  }, [react.Children.toArray(children).length]);
7358
7365
  react.useEffect(() => {
7359
7366
  let timer;
7360
- if (activeItem === "") timer = setTimeout(() => setOffset(null), 200);
7367
+ if (activeItem === "") timer = setTimeout(setOffset, 200, null);
7361
7368
  return () => {
7362
7369
  if (timer !== null) clearTimeout(timer);
7363
7370
  };
@@ -8503,72 +8510,33 @@ var SelectMenuContext = react.createContext({
8503
8510
  var useSelectMenuContext = () => react.use(SelectMenuContext);
8504
8511
  //#endregion
8505
8512
  //#region src/components/select-menu/SelectMenuContent.tsx
8506
- var Content$2 = styled(_radix_ui_react_select.Content, {
8507
- base: [
8508
- "bg-white",
8509
- "rounded-md",
8510
- "shadow-lg",
8511
- "z-10",
8512
- "overflow-hidden",
8513
- "will-change-transform",
8514
- "will-change-opacity",
8515
- "[--slide-opacity-out:0]",
8516
- "data-[side=top]:[--slide-direction-out-y:-4px]",
8517
- "data-[side=right]:[--slide-direction-out-x:4px]",
8518
- "data-[side=bottom]:[--slide-direction-out-y:4px]",
8519
- "data-[side=left]:[--slide-direction-out-x:-4px]",
8520
- "motion-safe:data-[state=open]:animate-slide-direction-in",
8521
- "motion-safe:data-[state=closed]:animate-slide-direction-out"
8522
- ],
8523
- variants: { position: {
8524
- popper: ["max-h-(--radix-select-content-available-height)", "min-w-(--radix-select-trigger-width)"],
8525
- "item-aligned": []
8526
- } }
8527
- });
8528
- var Viewport = styled(_radix_ui_react_select.Viewport, {
8529
- base: ["p-1", "w-full"],
8530
- variants: { position: {
8531
- popper: ["h-(--radix-select-content-available-height)"],
8532
- "item-aligned": []
8533
- } }
8534
- });
8535
- var ScrollUpButton = styled(_radix_ui_react_select.ScrollUpButton, { base: [
8536
- "flex",
8537
- "items-center",
8538
- "justify-center",
8539
- "h-6",
8540
- "cursor-default"
8541
- ] });
8542
- var ScrollDownButton = styled(_radix_ui_react_select.ScrollDownButton, { base: [
8543
- "flex",
8544
- "items-center",
8545
- "justify-center",
8546
- "h-6",
8547
- "cursor-default"
8548
- ] });
8549
- var SelectMenuContent = ({ ref, children, position = "popper", sideOffset = 4, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Portal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Content$2, {
8513
+ var Content$2 = styled(react_aria_components.Popover, { base: [
8514
+ "bg-white",
8515
+ "rounded-md",
8516
+ "shadow-lg",
8517
+ "z-10",
8518
+ "overflow-hidden",
8519
+ "will-change-transform",
8520
+ "min-w-[var(--trigger-width)]",
8521
+ "max-w-[min(calc(100vw-(--spacing(4))),--spacing(100))]"
8522
+ ] }, { enablePolymorphism: false });
8523
+ var Viewport = styled(react_aria_components.ListBox, { base: [
8524
+ "max-h-[inherit]",
8525
+ "w-full",
8526
+ "overflow-auto",
8527
+ "p-1",
8528
+ "outline-none"
8529
+ ] }, { enablePolymorphism: false });
8530
+ var SelectMenuContent = ({ ref, children, offset = 4, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Content$2, {
8550
8531
  ref,
8551
- position,
8552
- sideOffset,
8532
+ offset,
8533
+ containerPadding: 8,
8553
8534
  ...rest,
8554
- children: [
8555
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ScrollUpButton, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
8556
- is: _atom_learning_icons.ChevronUp,
8557
- className: "text-grey-700 size-4"
8558
- }) }),
8559
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Viewport, {
8560
- position,
8561
- children
8562
- }),
8563
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ScrollDownButton, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
8564
- is: _atom_learning_icons.ChevronDown,
8565
- className: "text-grey-700 size-4"
8566
- }) })
8567
- ]
8568
- }) });
8535
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Viewport, { children })
8536
+ });
8569
8537
  //#endregion
8570
8538
  //#region src/components/select-menu/SelectMenuItem.tsx
8571
- var Item = styled(_radix_ui_react_select.Item, {
8539
+ var Item = styled(react_aria_components.ListBoxItem, {
8572
8540
  base: [
8573
8541
  "relative",
8574
8542
  "flex",
@@ -8579,11 +8547,11 @@ var Item = styled(_radix_ui_react_select.Item, {
8579
8547
  "cursor-pointer",
8580
8548
  "rounded-sm",
8581
8549
  "outline-none",
8582
- "data-disabled:cursor-not-allowed",
8583
- "data-disabled:opacity-30",
8584
- "data-disabled:pointer-events-none",
8585
- "data-highlighted:bg-grey-100",
8586
- "data-highlighted:outline-none"
8550
+ "data-[disabled]:cursor-not-allowed",
8551
+ "data-[disabled]:opacity-30",
8552
+ "data-[hovered]:bg-grey-100",
8553
+ "data-[focused]:bg-grey-100",
8554
+ "data-[focus-visible]:outline-none"
8587
8555
  ],
8588
8556
  variants: { size: {
8589
8557
  sm: [
@@ -8603,26 +8571,26 @@ var Item = styled(_radix_ui_react_select.Item, {
8603
8571
  "pr-6"
8604
8572
  ]
8605
8573
  } }
8606
- });
8607
- var SelectMenuItem = ({ ref, children, ...rest }) => {
8574
+ }, { enablePolymorphism: false });
8575
+ var SelectMenuItem = ({ children, textValue, ...rest }) => {
8608
8576
  const { size } = useSelectMenuContext();
8609
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Item, {
8610
- ref,
8577
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Item, {
8611
8578
  size,
8579
+ textValue: textValue ?? (typeof children === "string" ? children : void 0),
8612
8580
  ...rest,
8613
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.ItemIndicator, {
8581
+ children: ({ isSelected }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8614
8582
  className: "absolute left-2 inline-flex items-center",
8615
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
8583
+ children: isSelected && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
8616
8584
  is: _atom_learning_icons.Ok,
8617
8585
  className: size === "sm" ? "size-3" : "size-4"
8618
8586
  })
8619
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.ItemText, { children })]
8587
+ }), children] })
8620
8588
  });
8621
8589
  };
8622
8590
  //#endregion
8623
8591
  //#region src/components/select-menu/SelectMenuLabel.tsx
8624
8592
  var SelectMenuLabel = ({ className, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Text, {
8625
- as: _radix_ui_react_select.Label,
8593
+ as: react_aria_components.Header,
8626
8594
  size: "sm",
8627
8595
  className: cn("p-2", "mb-1", "text-text-subtle", className),
8628
8596
  ...rest
@@ -8630,7 +8598,7 @@ var SelectMenuLabel = ({ className, ...rest }) => /* @__PURE__ */ (0, react_jsx_
8630
8598
  SelectMenuLabel.displayName = "SelectMenuLabel";
8631
8599
  //#endregion
8632
8600
  //#region src/components/select-menu/SelectMenuSeparator.tsx
8633
- var SelectMenuSeparator = styled(_radix_ui_react_select.Separator, { base: [
8601
+ var SelectMenuSeparator = styled(react_aria_components.Separator, { base: [
8634
8602
  "h-px",
8635
8603
  "bg-grey-200",
8636
8604
  "my-2",
@@ -8638,7 +8606,7 @@ var SelectMenuSeparator = styled(_radix_ui_react_select.Separator, { base: [
8638
8606
  ] }, { enablePolymorphism: false });
8639
8607
  //#endregion
8640
8608
  //#region src/components/select-menu/SelectMenuTrigger.tsx
8641
- var Trigger$2 = styled(_radix_ui_react_select.Trigger, {
8609
+ var Trigger$2 = styled(react_aria_components.Button, {
8642
8610
  base: [
8643
8611
  "appearance-none",
8644
8612
  "rounded-md",
@@ -8656,11 +8624,11 @@ var Trigger$2 = styled(_radix_ui_react_select.Trigger, {
8656
8624
  "hover:cursor-pointer",
8657
8625
  "disabled:opacity-30",
8658
8626
  "disabled:cursor-not-allowed",
8659
- "focus:outline-2",
8660
- "focus:outline-blue-800",
8661
- "focus:outline-offset-1",
8662
- "focus:outline-solid",
8663
- "focus:z-1"
8627
+ "data-[focus-visible]:outline-2",
8628
+ "data-[focus-visible]:outline-blue-800",
8629
+ "data-[focus-visible]:outline-offset-1",
8630
+ "data-[focus-visible]:outline-solid",
8631
+ "data-[focus-visible]:z-1"
8664
8632
  ],
8665
8633
  variants: {
8666
8634
  size: {
@@ -8687,9 +8655,9 @@ var Trigger$2 = styled(_radix_ui_react_select.Trigger, {
8687
8655
  white: ["bg-white"],
8688
8656
  grey: ["bg-grey-100"]
8689
8657
  },
8690
- state: { error: ["bg-danger-light", "focus:outline-danger"] }
8658
+ state: { error: ["bg-danger-light", "data-[focus-visible]:outline-danger"] }
8691
8659
  }
8692
- });
8660
+ }, { enablePolymorphism: false });
8693
8661
  var TriggerIcon = styled(Icon, {
8694
8662
  base: [
8695
8663
  "absolute",
@@ -8712,9 +8680,9 @@ var SelectMenuTrigger = ({ ref, placeholder, children, ...rest }) => {
8712
8680
  theme,
8713
8681
  state,
8714
8682
  ...rest,
8715
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Value, {
8716
- placeholder,
8717
- children
8683
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.SelectValue, {
8684
+ className: "truncate",
8685
+ children: ({ isPlaceholder, selectedText }) => isPlaceholder ? placeholder ?? "" : children ?? selectedText
8718
8686
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TriggerIcon, {
8719
8687
  is: _atom_learning_icons.ChevronDown,
8720
8688
  size
@@ -8723,7 +8691,7 @@ var SelectMenuTrigger = ({ ref, placeholder, children, ...rest }) => {
8723
8691
  };
8724
8692
  //#endregion
8725
8693
  //#region src/components/select-menu/SelectMenu.tsx
8726
- var SelectMenuRoot = ({ size = "md", theme = "grey", state, children, ...rest }) => {
8694
+ var SelectMenuRoot = ({ size = "md", theme = "grey", state, className, children, ...rest }) => {
8727
8695
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectMenuContext, {
8728
8696
  value: react.useMemo(() => ({
8729
8697
  size,
@@ -8734,7 +8702,8 @@ var SelectMenuRoot = ({ size = "md", theme = "grey", state, children, ...rest })
8734
8702
  theme,
8735
8703
  state
8736
8704
  ]),
8737
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Root, {
8705
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.Select, {
8706
+ className: cn("w-full", className),
8738
8707
  ...rest,
8739
8708
  children
8740
8709
  })
@@ -8744,7 +8713,7 @@ var SelectMenu = /* @__PURE__ */ Object.assign(SelectMenuRoot, {
8744
8713
  Trigger: SelectMenuTrigger,
8745
8714
  Content: SelectMenuContent,
8746
8715
  Item: SelectMenuItem,
8747
- Group: _radix_ui_react_select.Group,
8716
+ Group: react_aria_components.ListBoxSection,
8748
8717
  Label: SelectMenuLabel,
8749
8718
  Separator: SelectMenuSeparator
8750
8719
  });
@@ -8771,17 +8740,17 @@ var SelectMenuField = ({ className, hideLabel, children, name, label, validation
8771
8740
  prompt,
8772
8741
  required: Boolean(validation?.required),
8773
8742
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(SelectMenu, {
8774
- value,
8775
- onValueChange: onChange,
8743
+ "aria-label": label,
8744
+ selectedKey: value === "" ? null : value,
8745
+ onSelectionChange: onChange,
8776
8746
  size,
8777
8747
  theme: formTheme,
8778
- disabled,
8748
+ isDisabled: disabled,
8779
8749
  ...error && { state: "error" },
8780
8750
  ...rest,
8781
8751
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectMenu.Trigger, {
8782
8752
  ref,
8783
- placeholder,
8784
- "aria-label": label
8753
+ placeholder
8785
8754
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectMenu.Content, { children })]
8786
8755
  })
8787
8756
  });
@@ -9036,7 +9005,8 @@ var Slider = /* @__PURE__ */ Object.assign(SliderComponent, {
9036
9005
  });
9037
9006
  //#endregion
9038
9007
  //#region src/components/slider-field/SliderField.tsx
9039
- var SliderField = ({ className, hideLabel, label, name, defaultValue, value, validation, outputLabel, min = 0, max = 100, steps = [], ...rest }) => {
9008
+ var DEFAULT_STEPS = [];
9009
+ var SliderField = ({ className, hideLabel, label, name, defaultValue, value, validation, outputLabel, min = 0, max = 100, steps = DEFAULT_STEPS, ...rest }) => {
9040
9010
  const { control, setValue } = (0, react_hook_form.useFormContext)();
9041
9011
  const { field: { ref, onChange, value: innerValue, name: innerName } } = (0, react_hook_form.useController)({
9042
9012
  name,
@@ -9577,14 +9547,16 @@ var StepperStepsContainer = styled("div", {
9577
9547
  });
9578
9548
  var StepperSteps = ({ className }) => {
9579
9549
  const { steps, goToStep, activeStep, viewedSteps, allowSkip, direction, hideLabels, completedSteps, showCompletedIcons } = useStepper();
9550
+ const viewedStepsSet = new Set(viewedSteps);
9551
+ const completedStepsSet = new Set(completedSteps);
9580
9552
  const getBulletStatus = (index) => {
9581
9553
  const activeBullet = steps[index];
9582
9554
  if (activeBullet.status) return activeBullet.status;
9583
9555
  if (completedSteps.length === steps.length) return Status.SUCCESS;
9584
- if (activeStep === index && completedSteps.includes(activeStep)) return Status.REVIEWED;
9556
+ if (activeStep === index && completedStepsSet.has(activeStep)) return Status.REVIEWED;
9585
9557
  if (activeStep === index) return Status.ACTIVE;
9586
- if (completedSteps.includes(index)) return Status.COMPLETED;
9587
- if (viewedSteps.includes(index)) return Status.VIEWED;
9558
+ if (completedStepsSet.has(index)) return Status.COMPLETED;
9559
+ if (viewedStepsSet.has(index)) return Status.VIEWED;
9588
9560
  return Status.DEFAULT;
9589
9561
  };
9590
9562
  const getSeparatorStatus = (index) => {
@@ -9610,12 +9582,12 @@ var StepperSteps = ({ className }) => {
9610
9582
  canInteract: allowSkip,
9611
9583
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StepperStepBullet, {
9612
9584
  as: allowSkip ? "button" : "div",
9613
- onClick: () => allowSkip && viewedSteps.includes(index) ? goToStep?.(index) : void 0,
9585
+ onClick: () => allowSkip && viewedStepsSet.has(index) ? goToStep?.(index) : void 0,
9614
9586
  status: bulletStatus,
9615
9587
  "aria-current": index === activeStep ? "step" : void 0,
9616
9588
  "aria-label": !step.label ? `step ${index + 1}` : "",
9617
9589
  "aria-labelledby": step.label ? `step-${index}` : void 0,
9618
- className: allowSkip && viewedSteps.includes(index) ? "cursor-pointer" : "cursor-auto",
9590
+ className: allowSkip && viewedStepsSet.has(index) ? "cursor-pointer" : "cursor-auto",
9619
9591
  children: step.status === Status.SUCCESS || showCompletedIcons && bulletStatus === Status.COMPLETED ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, { is: _atom_learning_icons.Ok }) : index + 1
9620
9592
  }), step.label && !hideLabels && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StepperStepLabel, {
9621
9593
  as: "span",
@@ -9631,7 +9603,7 @@ var StepperSteps = ({ className }) => {
9631
9603
  //#endregion
9632
9604
  //#region src/components/stepper/Stepper.tsx
9633
9605
  var StepperComponent = ({ children, stepCount, allowSkip, onComplete, onStepChange, direction = "horizontal", steps, hideLabels = false, showCompletedIcons = false, className }) => {
9634
- (0, invariant.default)(!(stepCount && steps), "`Stepper` should only be given one of `stepCount` or `steps`. When both are provided, `steps` will be used and `stepCount` will be ignored.");
9606
+ (0, tiny_invariant.default)(!(stepCount && steps), "`Stepper` should only be given one of `stepCount` or `steps`. When both are provided, `steps` will be used and `stepCount` will be ignored.");
9635
9607
  const count = steps?.length || stepCount || 0;
9636
9608
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StepperProvider, {
9637
9609
  stepCount: count,
@@ -11039,12 +11011,12 @@ var FileDrop = ({ children, accept, multiple, onDrop, ...rest }) => {
11039
11011
  const handleDrop = (fileList) => {
11040
11012
  if (!fileList) return;
11041
11013
  setIsDragging(false);
11042
- const files = Array.from(fileList);
11014
+ const files = [...fileList];
11043
11015
  onDrop(files);
11044
11016
  setFiles(files);
11045
11017
  };
11046
11018
  const handleKeyDown = (event) => {
11047
- if (["Space", "Enter"].includes(event.key)) fileUploadInputRef.current?.click();
11019
+ if ("Space" === event.key || "Enter" === event.key) fileUploadInputRef.current?.click();
11048
11020
  };
11049
11021
  const value = react.useMemo(() => ({
11050
11022
  isDragging,
@@ -11082,9 +11054,6 @@ FileDrop.displayName = "FileDrop";
11082
11054
  //#region src/components/file-drop/useFileDrop.ts
11083
11055
  var useFileDrop = () => react.use(FileDropContext);
11084
11056
  //#endregion
11085
- //#region src/components/index.ts
11086
- var Alert = { Provider: AlertProvider };
11087
- //#endregion
11088
11057
  exports.Accordion = Accordion;
11089
11058
  exports.ActionIcon = ActionIcon;
11090
11059
  exports.Alert = Alert;