@atom-learning/components 10.0.1 → 10.2.0-beta.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 (118) hide show
  1. package/dist/components/action-icon/ActionIcon.d.ts +4 -3
  2. package/dist/components/action-icon/ActionIcon.js +5 -3
  3. package/dist/components/action-icon/ActionIcon.js.map +1 -1
  4. package/dist/components/badge/BadgeText.js +1 -1
  5. package/dist/components/badge/BadgeText.js.map +1 -1
  6. package/dist/components/banner/BannerContainer.js.map +1 -1
  7. package/dist/components/banner/banner-regular/BannerRegular.d.ts +1 -0
  8. package/dist/components/banner/banner-regular/BannerRegularActions.js +1 -1
  9. package/dist/components/banner/banner-regular/BannerRegularActions.js.map +1 -1
  10. package/dist/components/banner/banner-regular/BannerRegularDismiss.d.ts +5 -3
  11. package/dist/components/banner/banner-slim/BannerSlim.d.ts +9 -2
  12. package/dist/components/banner/banner-slim/BannerSlimDismiss.d.ts +5 -3
  13. package/dist/components/button/Button.d.ts +2 -2
  14. package/dist/components/button/Button.js +21 -17
  15. package/dist/components/button/Button.js.map +1 -1
  16. package/dist/components/calendar/Calendar.js +2 -2
  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/CheckboxGroupAllItem.js +3 -2
  20. package/dist/components/checkbox-group/CheckboxGroupAllItem.js.map +1 -1
  21. package/dist/components/checkbox-group/CheckboxGroupChecked.context.js +1 -1
  22. package/dist/components/checkbox-group/CheckboxGroupChecked.context.js.map +1 -1
  23. package/dist/components/checkbox-group/CheckboxGroupMounted.context.js +1 -1
  24. package/dist/components/checkbox-group/CheckboxGroupMounted.context.js.map +1 -1
  25. package/dist/components/chip/Chip.js +2 -2
  26. package/dist/components/chip/Chip.js.map +1 -1
  27. package/dist/components/create-password-field/CreatePasswordField.js +5 -5
  28. package/dist/components/create-password-field/CreatePasswordField.js.map +1 -1
  29. package/dist/components/data-table/DataTableHeaderCell.js +8 -8
  30. package/dist/components/data-table/DataTableHeaderCell.js.map +1 -1
  31. package/dist/components/data-table/DataTableSelectAllRowsCheckbox.js.map +1 -1
  32. package/dist/components/data-table/getNewAsyncData.js +1 -1
  33. package/dist/components/data-table/getNewAsyncData.js.map +1 -1
  34. package/dist/components/date-input/DateInput.js.map +1 -1
  35. package/dist/components/dropdown-menu/DropdownMenu.d.ts +2 -1
  36. package/dist/components/dropdown-menu/DropdownMenuLinkItem.d.ts +2 -1
  37. package/dist/components/dropdown-menu/DropdownMenuLinkItem.js +18 -13
  38. package/dist/components/dropdown-menu/DropdownMenuLinkItem.js.map +1 -1
  39. package/dist/components/file-drop/FileDrop.js +2 -2
  40. package/dist/components/file-drop/FileDrop.js.map +1 -1
  41. package/dist/components/form/useFieldError.js +2 -1
  42. package/dist/components/form/useFieldError.js.map +1 -1
  43. package/dist/components/index.d.ts +1 -0
  44. package/dist/components/link/Link.d.ts +2 -2
  45. package/dist/components/link/Link.js +13 -9
  46. package/dist/components/link/Link.js.map +1 -1
  47. package/dist/components/navigation/NavigationMenu.d.ts +2 -1
  48. package/dist/components/navigation/NavigationMenu.js +1 -1
  49. package/dist/components/navigation/NavigationMenu.js.map +1 -1
  50. package/dist/components/navigation/NavigationMenuLink.d.ts +2 -1
  51. package/dist/components/navigation/NavigationMenuLink.js +28 -13
  52. package/dist/components/navigation/NavigationMenuLink.js.map +1 -1
  53. package/dist/components/navigation-menu-vertical/NavigationMenuVertical.d.ts +4 -2
  54. package/dist/components/navigation-menu-vertical/NavigationMenuVerticalLink.d.ts +4 -2
  55. package/dist/components/navigation-menu-vertical/NavigationMenuVerticalLink.js +5 -3
  56. package/dist/components/navigation-menu-vertical/NavigationMenuVerticalLink.js.map +1 -1
  57. package/dist/components/number-input/NumberInputStepper.d.ts +5 -3
  58. package/dist/components/pagination/PaginationItems.js +2 -2
  59. package/dist/components/pagination/PaginationItems.js.map +1 -1
  60. package/dist/components/pagination/PaginationNextButton.d.ts +5 -3
  61. package/dist/components/pagination/PaginationPreviousButton.d.ts +5 -3
  62. package/dist/components/pagination/pagination.helper.js +5 -3
  63. package/dist/components/pagination/pagination.helper.js.map +1 -1
  64. package/dist/components/router-provider/Router.d.ts +9 -0
  65. package/dist/components/router-provider/Router.js +7 -0
  66. package/dist/components/router-provider/Router.js.map +1 -0
  67. package/dist/components/router-provider/RouterProvider.d.ts +16 -0
  68. package/dist/components/router-provider/RouterProvider.js +23 -0
  69. package/dist/components/router-provider/RouterProvider.js.map +1 -0
  70. package/dist/components/select-menu/SelectMenu.d.ts +16 -9
  71. package/dist/components/select-menu/SelectMenu.js +6 -4
  72. package/dist/components/select-menu/SelectMenu.js.map +1 -1
  73. package/dist/components/select-menu/SelectMenuContent.d.ts +5 -3
  74. package/dist/components/select-menu/SelectMenuContent.js +24 -65
  75. package/dist/components/select-menu/SelectMenuContent.js.map +1 -1
  76. package/dist/components/select-menu/SelectMenuItem.d.ts +5 -3
  77. package/dist/components/select-menu/SelectMenuItem.js +15 -15
  78. package/dist/components/select-menu/SelectMenuItem.js.map +1 -1
  79. package/dist/components/select-menu/SelectMenuLabel.d.ts +2 -2
  80. package/dist/components/select-menu/SelectMenuLabel.js +2 -2
  81. package/dist/components/select-menu/SelectMenuLabel.js.map +1 -1
  82. package/dist/components/select-menu/SelectMenuSeparator.d.ts +2 -2
  83. package/dist/components/select-menu/SelectMenuSeparator.js +2 -2
  84. package/dist/components/select-menu/SelectMenuSeparator.js.map +1 -1
  85. package/dist/components/select-menu/SelectMenuTrigger.d.ts +3 -2
  86. package/dist/components/select-menu/SelectMenuTrigger.js +12 -12
  87. package/dist/components/select-menu/SelectMenuTrigger.js.map +1 -1
  88. package/dist/components/select-menu-field/SelectMenuField.js +5 -5
  89. package/dist/components/select-menu-field/SelectMenuField.js.map +1 -1
  90. package/dist/components/slider/Slider.js.map +1 -1
  91. package/dist/components/slider-field/SliderField.js +2 -1
  92. package/dist/components/slider-field/SliderField.js.map +1 -1
  93. package/dist/components/sortable/Handle.d.ts +5 -3
  94. package/dist/components/stepper/Stepper.js +1 -1
  95. package/dist/components/stepper/Stepper.js.map +1 -1
  96. package/dist/components/stepper/StepperSteps.js +7 -5
  97. package/dist/components/stepper/StepperSteps.js.map +1 -1
  98. package/dist/components/table/useStickyColumnsCss.js +1 -1
  99. package/dist/components/table/useStickyColumnsCss.js.map +1 -1
  100. package/dist/components/tile-interactive/TileInteractive.d.ts +5 -3
  101. package/dist/components/tile-interactive/TileInteractive.js +4 -2
  102. package/dist/components/tile-interactive/TileInteractive.js.map +1 -1
  103. package/dist/components/tile-toggle-group/TileToggleGroupItem.d.ts +5 -2
  104. package/dist/components/top-bar/TopBar.d.ts +4 -2
  105. package/dist/docgen.json +1 -1
  106. package/dist/index.cjs.js +239 -218
  107. package/dist/index.cjs.js.map +1 -1
  108. package/dist/index.d.ts +0 -1
  109. package/dist/index.js +2 -1
  110. package/dist/styled.js +15 -11
  111. package/dist/styled.js.map +1 -1
  112. package/dist/utilities/hooks/useResizeObserver.js +1 -3
  113. package/dist/utilities/hooks/useResizeObserver.js.map +1 -1
  114. package/dist/utilities/uri/index.js +2 -1
  115. package/dist/utilities/uri/index.js.map +1 -1
  116. package/package.json +15 -7
  117. package/src/utilities.css +1 -1
  118. package/dist/types/navigatorActions.types.d.ts +0 -5
@@ -2,11 +2,11 @@ import { styled } from "../../styled.js";
2
2
  import { Icon } from "../icon/Icon.js";
3
3
  import { useSelectMenuContext } from "./SelectMenu.context.js";
4
4
  import "react";
5
- import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
6
  import { Ok } from "@atom-learning/icons";
7
- import * as RadixSelect from "@radix-ui/react-select";
7
+ import * as AriaComponents from "react-aria-components";
8
8
  //#region src/components/select-menu/SelectMenuItem.tsx
9
- var Item = styled(RadixSelect.Item, {
9
+ var Item = styled(AriaComponents.ListBoxItem, {
10
10
  base: [
11
11
  "relative",
12
12
  "flex",
@@ -17,11 +17,11 @@ var Item = styled(RadixSelect.Item, {
17
17
  "cursor-pointer",
18
18
  "rounded-sm",
19
19
  "outline-none",
20
- "data-disabled:cursor-not-allowed",
21
- "data-disabled:opacity-30",
22
- "data-disabled:pointer-events-none",
23
- "data-highlighted:bg-grey-100",
24
- "data-highlighted:outline-none"
20
+ "data-[disabled]:cursor-not-allowed",
21
+ "data-[disabled]:opacity-30",
22
+ "data-[hovered]:bg-grey-100",
23
+ "data-[focused]:bg-grey-100",
24
+ "data-[focus-visible]:outline-none"
25
25
  ],
26
26
  variants: { size: {
27
27
  sm: [
@@ -41,20 +41,20 @@ var Item = styled(RadixSelect.Item, {
41
41
  "pr-6"
42
42
  ]
43
43
  } }
44
- });
45
- var SelectMenuItem = ({ ref, children, ...rest }) => {
44
+ }, { enablePolymorphism: false });
45
+ var SelectMenuItem = ({ children, textValue, ...rest }) => {
46
46
  const { size } = useSelectMenuContext();
47
- return /* @__PURE__ */ jsxs(Item, {
48
- ref,
47
+ return /* @__PURE__ */ jsx(Item, {
49
48
  size,
49
+ textValue: textValue ?? (typeof children === "string" ? children : void 0),
50
50
  ...rest,
51
- children: [/* @__PURE__ */ jsx(RadixSelect.ItemIndicator, {
51
+ children: ({ isSelected }) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
52
52
  className: "absolute left-2 inline-flex items-center",
53
- children: /* @__PURE__ */ jsx(Icon, {
53
+ children: isSelected && /* @__PURE__ */ jsx(Icon, {
54
54
  is: Ok,
55
55
  className: size === "sm" ? "size-3" : "size-4"
56
56
  })
57
- }), /* @__PURE__ */ jsx(RadixSelect.ItemText, { children })]
57
+ }), children] })
58
58
  });
59
59
  };
60
60
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"SelectMenuItem.js","names":[],"sources":["../../../src/components/select-menu/SelectMenuItem.tsx"],"sourcesContent":["import { Ok } from '@atom-learning/icons'\nimport * as RadixSelect from '@radix-ui/react-select'\nimport * as React from 'react'\n\nimport { styled } from '../../styled'\nimport { Icon } from '../icon/Icon'\nimport { useSelectMenuContext } from './SelectMenu.context'\n\nconst Item = styled(RadixSelect.Item, {\n base: [\n 'relative',\n 'flex',\n 'items-center',\n 'text-grey-1000',\n 'font-body',\n 'font-normal',\n 'cursor-pointer',\n 'rounded-sm',\n 'outline-none',\n 'data-disabled:cursor-not-allowed',\n 'data-disabled:opacity-30',\n 'data-disabled:pointer-events-none',\n 'data-highlighted:bg-grey-100',\n 'data-highlighted:outline-none'\n ],\n variants: {\n size: {\n sm: ['py-1.5', 'pl-7', 'pr-4', 'text-sm'],\n md: ['py-2', 'pl-8', 'pr-6'],\n lg: ['py-2', 'pl-8', 'pr-6']\n }\n }\n})\n\ntype SelectMenuItemProps = React.ComponentPropsWithRef<typeof RadixSelect.Item>\n\nexport const SelectMenuItem = ({\n ref,\n children,\n ...rest\n}: SelectMenuItemProps) => {\n const { size } = useSelectMenuContext()\n\n return (\n <Item ref={ref} size={size} {...rest}>\n <RadixSelect.ItemIndicator className=\"absolute left-2 inline-flex items-center\">\n <Icon is={Ok} className={size === 'sm' ? 'size-3' : 'size-4'} />\n </RadixSelect.ItemIndicator>\n <RadixSelect.ItemText>{children}</RadixSelect.ItemText>\n </Item>\n )\n}\n"],"mappings":";;;;;;;;AAQA,IAAM,OAAO,OAAO,YAAY,MAAM;CACpC,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,UAAU,EACR,MAAM;EACJ,IAAI;GAAC;GAAU;GAAQ;GAAQ;EAAS;EACxC,IAAI;GAAC;GAAQ;GAAQ;EAAM;EAC3B,IAAI;GAAC;GAAQ;GAAQ;EAAM;CAC7B,EACF;AACF,CAAC;AAID,IAAa,kBAAkB,EAC7B,KACA,UACA,GAAG,WACsB;CACzB,MAAM,EAAE,SAAS,qBAAqB;CAEtC,OACE,qBAAC,MAAD;EAAW;EAAW;EAAM,GAAI;YAAhC,CACE,oBAAC,YAAY,eAAb;GAA2B,WAAU;aACnC,oBAAC,MAAD;IAAM,IAAI;IAAI,WAAW,SAAS,OAAO,WAAW;GAAW,CAAA;EACtC,CAAA,GAC3B,oBAAC,YAAY,UAAb,EAAuB,SAA+B,CAAA,CAClD;;AAEV"}
1
+ {"version":3,"file":"SelectMenuItem.js","names":[],"sources":["../../../src/components/select-menu/SelectMenuItem.tsx"],"sourcesContent":["import { Ok } from '@atom-learning/icons'\nimport * as React from 'react'\nimport * as AriaComponents from 'react-aria-components'\n\nimport { styled } from '../../styled'\nimport { Icon } from '../icon/Icon'\nimport { useSelectMenuContext } from './SelectMenu.context'\n\nconst Item = styled(\n AriaComponents.ListBoxItem,\n {\n base: [\n 'relative',\n 'flex',\n 'items-center',\n 'text-grey-1000',\n 'font-body',\n 'font-normal',\n 'cursor-pointer',\n 'rounded-sm',\n 'outline-none',\n 'data-[disabled]:cursor-not-allowed',\n 'data-[disabled]:opacity-30',\n // react-aria's data-hovered (pointer only, ignores touch) — not `hover:`,\n // whose :hover sticks after a tap on touchscreens (this menu targets\n // webviews). data-focused covers keyboard navigation; together they\n // replicate the old Radix data-highlighted.\n 'data-[hovered]:bg-grey-100',\n 'data-[focused]:bg-grey-100',\n 'data-[focus-visible]:outline-none'\n ],\n variants: {\n size: {\n sm: ['py-1.5', 'pl-7', 'pr-4', 'text-sm'],\n md: ['py-2', 'pl-8', 'pr-6'],\n lg: ['py-2', 'pl-8', 'pr-6']\n }\n }\n },\n { enablePolymorphism: false }\n)\n\ntype SelectMenuItemProps = Omit<AriaComponents.ListBoxItemProps, 'children'> & {\n children?: React.ReactNode\n}\n\nexport const SelectMenuItem = ({\n children,\n textValue,\n ...rest\n}: SelectMenuItemProps) => {\n const { size } = useSelectMenuContext()\n const resolvedTextValue =\n textValue ?? (typeof children === 'string' ? children : undefined)\n\n return (\n <Item size={size} textValue={resolvedTextValue} {...rest}>\n {({ isSelected }) => (\n <>\n <span className=\"absolute left-2 inline-flex items-center\">\n {isSelected && (\n <Icon is={Ok} className={size === 'sm' ? 'size-3' : 'size-4'} />\n )}\n </span>\n {children}\n </>\n )}\n </Item>\n )\n}\n"],"mappings":";;;;;;;;AAQA,IAAM,OAAO,OACX,eAAe,aACf;CACE,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAKA;EACA;EACA;CACF;CACA,UAAU,EACR,MAAM;EACJ,IAAI;GAAC;GAAU;GAAQ;GAAQ;EAAS;EACxC,IAAI;GAAC;GAAQ;GAAQ;EAAM;EAC3B,IAAI;GAAC;GAAQ;GAAQ;EAAM;CAC7B,EACF;AACF,GACA,EAAE,oBAAoB,MAAM,CAC9B;AAMA,IAAa,kBAAkB,EAC7B,UACA,WACA,GAAG,WACsB;CACzB,MAAM,EAAE,SAAS,qBAAqB;CAItC,OACE,oBAAC,MAAD;EAAY;EAAM,WAHlB,cAAc,OAAO,aAAa,WAAW,WAAW,KAAA;EAGR,GAAI;aAChD,EAAE,iBACF,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,QAAD;GAAM,WAAU;aACb,cACC,oBAAC,MAAD;IAAM,IAAI;IAAI,WAAW,SAAS,OAAO,WAAW;GAAW,CAAA;EAE7D,CAAA,GACL,QACD,EAAA,CAAA;CAEA,CAAA;AAEV"}
@@ -1,6 +1,6 @@
1
- import * as RadixSelect from '@radix-ui/react-select';
2
1
  import * as React from 'react';
3
- type SelectMenuLabelProps = React.ComponentProps<typeof RadixSelect.Label>;
2
+ import * as AriaComponents from 'react-aria-components';
3
+ type SelectMenuLabelProps = React.ComponentProps<typeof AriaComponents.Header>;
4
4
  export declare function SelectMenuLabel({ className, ...rest }: SelectMenuLabelProps): React.JSX.Element;
5
5
  export declare namespace SelectMenuLabel {
6
6
  var displayName: string;
@@ -2,10 +2,10 @@ import { cn } from "../../styled.js";
2
2
  import { Text } from "../text/Text.js";
3
3
  import "react";
4
4
  import { jsx } from "react/jsx-runtime";
5
- import * as RadixSelect from "@radix-ui/react-select";
5
+ import * as AriaComponents from "react-aria-components";
6
6
  //#region src/components/select-menu/SelectMenuLabel.tsx
7
7
  var SelectMenuLabel = ({ className, ...rest }) => /* @__PURE__ */ jsx(Text, {
8
- as: RadixSelect.Label,
8
+ as: AriaComponents.Header,
9
9
  size: "sm",
10
10
  className: cn("p-2", "mb-1", "text-text-subtle", className),
11
11
  ...rest
@@ -1 +1 @@
1
- {"version":3,"file":"SelectMenuLabel.js","names":[],"sources":["../../../src/components/select-menu/SelectMenuLabel.tsx"],"sourcesContent":["import * as RadixSelect from '@radix-ui/react-select'\nimport * as React from 'react'\n\nimport { cn } from '../../styled'\nimport { Text } from '../text/Text'\n\ntype SelectMenuLabelProps = React.ComponentProps<typeof RadixSelect.Label>\n\nexport const SelectMenuLabel = ({\n className,\n ...rest\n}: SelectMenuLabelProps) => (\n <Text\n as={RadixSelect.Label}\n size=\"sm\"\n className={cn('p-2', 'mb-1', 'text-text-subtle', className)}\n {...rest}\n />\n)\n\nSelectMenuLabel.displayName = 'SelectMenuLabel'\n"],"mappings":";;;;;;AAQA,IAAa,mBAAmB,EAC9B,WACA,GAAG,WAEH,oBAAC,MAAD;CACE,IAAI,YAAY;CAChB,MAAK;CACL,WAAW,GAAG,OAAO,QAAQ,oBAAoB,SAAS;CAC1D,GAAI;AACL,CAAA;AAGH,gBAAgB,cAAc"}
1
+ {"version":3,"file":"SelectMenuLabel.js","names":[],"sources":["../../../src/components/select-menu/SelectMenuLabel.tsx"],"sourcesContent":["import * as React from 'react'\nimport * as AriaComponents from 'react-aria-components'\n\nimport { cn } from '../../styled'\nimport { Text } from '../text/Text'\n\ntype SelectMenuLabelProps = React.ComponentProps<typeof AriaComponents.Header>\n\nexport const SelectMenuLabel = ({\n className,\n ...rest\n}: SelectMenuLabelProps) => (\n <Text\n as={AriaComponents.Header}\n size=\"sm\"\n className={cn('p-2', 'mb-1', 'text-text-subtle', className)}\n {...rest}\n />\n)\n\nSelectMenuLabel.displayName = 'SelectMenuLabel'\n"],"mappings":";;;;;;AAQA,IAAa,mBAAmB,EAC9B,WACA,GAAG,WAEH,oBAAC,MAAD;CACE,IAAI,eAAe;CACnB,MAAK;CACL,WAAW,GAAG,OAAO,QAAQ,oBAAoB,SAAS;CAC1D,GAAI;AACL,CAAA;AAGH,gBAAgB,cAAc"}
@@ -1,2 +1,2 @@
1
- import * as RadixSelect from '@radix-ui/react-select';
2
- export declare const SelectMenuSeparator: import("../..").StyledComponent<import("react").ForwardRefExoticComponent<RadixSelect.SelectSeparatorProps & import("react").RefAttributes<HTMLDivElement>>, unknown>;
1
+ import * as AriaComponents from 'react-aria-components';
2
+ export declare const SelectMenuSeparator: import("../..").StyledComponent<(props: AriaComponents.SeparatorProps & React.RefAttributes<HTMLElement>) => React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null, unknown>;
@@ -1,7 +1,7 @@
1
1
  import { styled } from "../../styled.js";
2
- import * as RadixSelect from "@radix-ui/react-select";
2
+ import * as AriaComponents from "react-aria-components";
3
3
  //#region src/components/select-menu/SelectMenuSeparator.tsx
4
- var SelectMenuSeparator = styled(RadixSelect.Separator, { base: [
4
+ var SelectMenuSeparator = styled(AriaComponents.Separator, { base: [
5
5
  "h-px",
6
6
  "bg-grey-200",
7
7
  "my-2",
@@ -1 +1 @@
1
- {"version":3,"file":"SelectMenuSeparator.js","names":[],"sources":["../../../src/components/select-menu/SelectMenuSeparator.tsx"],"sourcesContent":["import * as RadixSelect from '@radix-ui/react-select'\n\nimport { styled } from '../../styled'\n\nexport const SelectMenuSeparator = styled(\n RadixSelect.Separator,\n {\n base: ['h-px', 'bg-grey-200', 'my-2', 'mx-1']\n },\n { enablePolymorphism: false }\n)\n"],"mappings":";;;AAIA,IAAa,sBAAsB,OACjC,YAAY,WACZ,EACE,MAAM;CAAC;CAAQ;CAAe;CAAQ;AAAM,EAC9C,GACA,EAAE,oBAAoB,MAAM,CAC9B"}
1
+ {"version":3,"file":"SelectMenuSeparator.js","names":[],"sources":["../../../src/components/select-menu/SelectMenuSeparator.tsx"],"sourcesContent":["import * as AriaComponents from 'react-aria-components'\n\nimport { styled } from '../../styled'\n\nexport const SelectMenuSeparator = styled(\n AriaComponents.Separator,\n {\n base: ['h-px', 'bg-grey-200', 'my-2', 'mx-1']\n },\n { enablePolymorphism: false }\n)\n"],"mappings":";;;AAIA,IAAa,sBAAsB,OACjC,eAAe,WACf,EACE,MAAM;CAAC;CAAQ;CAAe;CAAQ;AAAM,EAC9C,GACA,EAAE,oBAAoB,MAAM,CAC9B"}
@@ -1,7 +1,8 @@
1
- import * as RadixSelect from '@radix-ui/react-select';
2
1
  import * as React from 'react';
3
- type SelectMenuTriggerProps = React.ComponentPropsWithRef<typeof RadixSelect.Trigger> & {
2
+ import * as AriaComponents from 'react-aria-components';
3
+ type SelectMenuTriggerProps = Omit<React.ComponentPropsWithRef<typeof AriaComponents.Button>, 'children' | 'aria-label' | 'aria-labelledby'> & {
4
4
  placeholder?: string;
5
+ children?: React.ReactNode;
5
6
  };
6
7
  export declare const SelectMenuTrigger: ({ ref, placeholder, children, ...rest }: SelectMenuTriggerProps) => React.JSX.Element;
7
8
  export {};
@@ -4,9 +4,9 @@ import { useSelectMenuContext } from "./SelectMenu.context.js";
4
4
  import "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { ChevronDown } from "@atom-learning/icons";
7
- import * as RadixSelect from "@radix-ui/react-select";
7
+ import * as AriaComponents from "react-aria-components";
8
8
  //#region src/components/select-menu/SelectMenuTrigger.tsx
9
- var Trigger = styled(RadixSelect.Trigger, {
9
+ var Trigger = styled(AriaComponents.Button, {
10
10
  base: [
11
11
  "appearance-none",
12
12
  "rounded-md",
@@ -24,11 +24,11 @@ var Trigger = styled(RadixSelect.Trigger, {
24
24
  "hover:cursor-pointer",
25
25
  "disabled:opacity-30",
26
26
  "disabled:cursor-not-allowed",
27
- "focus:outline-2",
28
- "focus:outline-blue-800",
29
- "focus:outline-offset-1",
30
- "focus:outline-solid",
31
- "focus:z-1"
27
+ "data-[focus-visible]:outline-2",
28
+ "data-[focus-visible]:outline-blue-800",
29
+ "data-[focus-visible]:outline-offset-1",
30
+ "data-[focus-visible]:outline-solid",
31
+ "data-[focus-visible]:z-1"
32
32
  ],
33
33
  variants: {
34
34
  size: {
@@ -55,9 +55,9 @@ var Trigger = styled(RadixSelect.Trigger, {
55
55
  white: ["bg-white"],
56
56
  grey: ["bg-grey-100"]
57
57
  },
58
- state: { error: ["bg-danger-light", "focus:outline-danger"] }
58
+ state: { error: ["bg-danger-light", "data-[focus-visible]:outline-danger"] }
59
59
  }
60
- });
60
+ }, { enablePolymorphism: false });
61
61
  var TriggerIcon = styled(Icon, {
62
62
  base: [
63
63
  "absolute",
@@ -80,9 +80,9 @@ var SelectMenuTrigger = ({ ref, placeholder, children, ...rest }) => {
80
80
  theme,
81
81
  state,
82
82
  ...rest,
83
- children: [/* @__PURE__ */ jsx(RadixSelect.Value, {
84
- placeholder,
85
- children
83
+ children: [/* @__PURE__ */ jsx(AriaComponents.SelectValue, {
84
+ className: "truncate",
85
+ children: ({ isPlaceholder, selectedText }) => isPlaceholder ? placeholder ?? "" : children ?? selectedText
86
86
  }), /* @__PURE__ */ jsx(TriggerIcon, {
87
87
  is: ChevronDown,
88
88
  size
@@ -1 +1 @@
1
- {"version":3,"file":"SelectMenuTrigger.js","names":[],"sources":["../../../src/components/select-menu/SelectMenuTrigger.tsx"],"sourcesContent":["import { ChevronDown } from '@atom-learning/icons'\nimport * as RadixSelect from '@radix-ui/react-select'\nimport * as React from 'react'\n\nimport { styled } from '../../styled'\nimport { Icon } from '../icon/Icon'\nimport { useSelectMenuContext } from './SelectMenu.context'\n\nconst Trigger = styled(RadixSelect.Trigger, {\n base: [\n 'appearance-none',\n 'rounded-md',\n 'block',\n 'w-full',\n 'font-body',\n 'font-normal',\n 'leading-[1.4]',\n 'text-grey-1000',\n 'text-left',\n 'relative',\n 'inline-flex',\n 'items-center',\n 'border-none',\n 'hover:cursor-pointer',\n 'disabled:opacity-30',\n 'disabled:cursor-not-allowed',\n 'focus:outline-2',\n 'focus:outline-blue-800',\n 'focus:outline-offset-1',\n 'focus:outline-solid',\n 'focus:z-1'\n ],\n variants: {\n size: {\n sm: ['h-8', 'pl-2', 'pr-8', 'text-sm'],\n md: ['h-10', 'pl-3', 'pr-10', 'text-md'],\n lg: ['h-12', 'pl-3', 'pr-10', 'text-md']\n },\n theme: {\n white: ['bg-white'],\n grey: ['bg-grey-100']\n },\n state: {\n error: ['bg-danger-light', 'focus:outline-danger']\n }\n }\n})\n\nconst TriggerIcon = styled(Icon, {\n base: [\n 'absolute',\n 'top-1/2',\n '-translate-y-1/2',\n 'pointer-events-none',\n 'text-grey-700'\n ],\n variants: {\n size: {\n sm: ['right-2', 'size-4'],\n md: ['right-3', 'size-5'],\n lg: ['right-3', 'size-5']\n }\n }\n})\n\ntype SelectMenuTriggerProps = React.ComponentPropsWithRef<\n typeof RadixSelect.Trigger\n> & {\n placeholder?: string\n}\n\nexport const SelectMenuTrigger = ({\n ref,\n placeholder,\n children,\n ...rest\n}: SelectMenuTriggerProps) => {\n const { size, theme, state } = useSelectMenuContext()\n\n return (\n <Trigger ref={ref} size={size} theme={theme} state={state} {...rest}>\n <RadixSelect.Value placeholder={placeholder}>\n {children}\n </RadixSelect.Value>\n <TriggerIcon is={ChevronDown} size={size} />\n </Trigger>\n )\n}\n"],"mappings":";;;;;;;;AAQA,IAAM,UAAU,OAAO,YAAY,SAAS;CAC1C,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,UAAU;EACR,MAAM;GACJ,IAAI;IAAC;IAAO;IAAQ;IAAQ;GAAS;GACrC,IAAI;IAAC;IAAQ;IAAQ;IAAS;GAAS;GACvC,IAAI;IAAC;IAAQ;IAAQ;IAAS;GAAS;EACzC;EACA,OAAO;GACL,OAAO,CAAC,UAAU;GAClB,MAAM,CAAC,aAAa;EACtB;EACA,OAAO,EACL,OAAO,CAAC,mBAAmB,sBAAsB,EACnD;CACF;AACF,CAAC;AAED,IAAM,cAAc,OAAO,MAAM;CAC/B,MAAM;EACJ;EACA;EACA;EACA;EACA;CACF;CACA,UAAU,EACR,MAAM;EACJ,IAAI,CAAC,WAAW,QAAQ;EACxB,IAAI,CAAC,WAAW,QAAQ;EACxB,IAAI,CAAC,WAAW,QAAQ;CAC1B,EACF;AACF,CAAC;AAQD,IAAa,qBAAqB,EAChC,KACA,aACA,UACA,GAAG,WACyB;CAC5B,MAAM,EAAE,MAAM,OAAO,UAAU,qBAAqB;CAEpD,OACE,qBAAC,SAAD;EAAc;EAAW;EAAa;EAAc;EAAO,GAAI;YAA/D,CACE,oBAAC,YAAY,OAAb;GAAgC;GAC7B;EACgB,CAAA,GACnB,oBAAC,aAAD;GAAa,IAAI;GAAmB;EAAO,CAAA,CACpC;;AAEb"}
1
+ {"version":3,"file":"SelectMenuTrigger.js","names":[],"sources":["../../../src/components/select-menu/SelectMenuTrigger.tsx"],"sourcesContent":["import { ChevronDown } from '@atom-learning/icons'\nimport * as React from 'react'\nimport * as AriaComponents from 'react-aria-components'\n\nimport { styled } from '../../styled'\nimport { Icon } from '../icon/Icon'\nimport { useSelectMenuContext } from './SelectMenu.context'\n\nconst Trigger = styled(\n AriaComponents.Button,\n {\n base: [\n 'appearance-none',\n 'rounded-md',\n 'block',\n 'w-full',\n 'font-body',\n 'font-normal',\n 'leading-[1.4]',\n 'text-grey-1000',\n 'text-left',\n 'relative',\n 'inline-flex',\n 'items-center',\n 'border-none',\n 'hover:cursor-pointer',\n 'disabled:opacity-30',\n 'disabled:cursor-not-allowed',\n 'data-[focus-visible]:outline-2',\n 'data-[focus-visible]:outline-blue-800',\n 'data-[focus-visible]:outline-offset-1',\n 'data-[focus-visible]:outline-solid',\n 'data-[focus-visible]:z-1'\n ],\n variants: {\n size: {\n sm: ['h-8', 'pl-2', 'pr-8', 'text-sm'],\n md: ['h-10', 'pl-3', 'pr-10', 'text-md'],\n lg: ['h-12', 'pl-3', 'pr-10', 'text-md']\n },\n theme: {\n white: ['bg-white'],\n grey: ['bg-grey-100']\n },\n state: {\n error: ['bg-danger-light', 'data-[focus-visible]:outline-danger']\n }\n }\n },\n { enablePolymorphism: false }\n)\n\nconst TriggerIcon = styled(Icon, {\n base: [\n 'absolute',\n 'top-1/2',\n '-translate-y-1/2',\n 'pointer-events-none',\n 'text-grey-700'\n ],\n variants: {\n size: {\n sm: ['right-2', 'size-4'],\n md: ['right-3', 'size-5'],\n lg: ['right-3', 'size-5']\n }\n }\n})\n\n// Label the SelectMenu via aria-label/aria-labelledby on the root <SelectMenu>,\n// not here — react-aria computes the trigger's accessible name from the root\n// Select's label props, so labels placed on the trigger are ignored.\ntype SelectMenuTriggerProps = Omit<\n React.ComponentPropsWithRef<typeof AriaComponents.Button>,\n 'children' | 'aria-label' | 'aria-labelledby'\n> & {\n placeholder?: string\n children?: React.ReactNode\n}\n\nexport const SelectMenuTrigger = ({\n ref,\n placeholder,\n children,\n ...rest\n}: SelectMenuTriggerProps) => {\n const { size, theme, state } = useSelectMenuContext()\n\n return (\n <Trigger ref={ref} size={size} theme={theme} state={state} {...rest}>\n <AriaComponents.SelectValue className=\"truncate\">\n {({ isPlaceholder, selectedText }) =>\n isPlaceholder ? (placeholder ?? '') : (children ?? selectedText)\n }\n </AriaComponents.SelectValue>\n <TriggerIcon is={ChevronDown} size={size} />\n </Trigger>\n )\n}\n"],"mappings":";;;;;;;;AAQA,IAAM,UAAU,OACd,eAAe,QACf;CACE,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,UAAU;EACR,MAAM;GACJ,IAAI;IAAC;IAAO;IAAQ;IAAQ;GAAS;GACrC,IAAI;IAAC;IAAQ;IAAQ;IAAS;GAAS;GACvC,IAAI;IAAC;IAAQ;IAAQ;IAAS;GAAS;EACzC;EACA,OAAO;GACL,OAAO,CAAC,UAAU;GAClB,MAAM,CAAC,aAAa;EACtB;EACA,OAAO,EACL,OAAO,CAAC,mBAAmB,qCAAqC,EAClE;CACF;AACF,GACA,EAAE,oBAAoB,MAAM,CAC9B;AAEA,IAAM,cAAc,OAAO,MAAM;CAC/B,MAAM;EACJ;EACA;EACA;EACA;EACA;CACF;CACA,UAAU,EACR,MAAM;EACJ,IAAI,CAAC,WAAW,QAAQ;EACxB,IAAI,CAAC,WAAW,QAAQ;EACxB,IAAI,CAAC,WAAW,QAAQ;CAC1B,EACF;AACF,CAAC;AAaD,IAAa,qBAAqB,EAChC,KACA,aACA,UACA,GAAG,WACyB;CAC5B,MAAM,EAAE,MAAM,OAAO,UAAU,qBAAqB;CAEpD,OACE,qBAAC,SAAD;EAAc;EAAW;EAAa;EAAc;EAAO,GAAI;YAA/D,CACE,oBAAC,eAAe,aAAhB;GAA4B,WAAU;cAClC,EAAE,eAAe,mBACjB,gBAAiB,eAAe,KAAO,YAAY;EAE3B,CAAA,GAC5B,oBAAC,aAAD;GAAa,IAAI;GAAmB;EAAO,CAAA,CACpC;;AAEb"}
@@ -27,17 +27,17 @@ var SelectMenuField = ({ className, hideLabel, children, name, label, validation
27
27
  prompt,
28
28
  required: Boolean(validation?.required),
29
29
  children: /* @__PURE__ */ jsxs(SelectMenu, {
30
- value,
31
- onValueChange: onChange,
30
+ "aria-label": label,
31
+ selectedKey: value === "" ? null : value,
32
+ onSelectionChange: onChange,
32
33
  size,
33
34
  theme: formTheme,
34
- disabled,
35
+ isDisabled: disabled,
35
36
  ...error && { state: "error" },
36
37
  ...rest,
37
38
  children: [/* @__PURE__ */ jsx(SelectMenu.Trigger, {
38
39
  ref,
39
- placeholder,
40
- "aria-label": label
40
+ placeholder
41
41
  }), /* @__PURE__ */ jsx(SelectMenu.Content, { children })]
42
42
  })
43
43
  });
@@ -1 +1 @@
1
- {"version":3,"file":"SelectMenuField.js","names":[],"sources":["../../../src/components/select-menu-field/SelectMenuField.tsx"],"sourcesContent":["import * as React from 'react'\nimport { useController, useFormContext } from 'react-hook-form'\n\nimport {\n type FieldElementWrapperProps,\n FieldWrapper\n} from '../field-wrapper/FieldWrapper'\nimport { useFieldError } from '../form/useFieldError'\nimport { useFormCustomContext } from '../form/useFormCustomContext'\nimport { SelectMenu } from '../select-menu/SelectMenu'\n\ntype SelectMenuFieldProps = React.PropsWithChildren<\n FieldElementWrapperProps & {\n placeholder?: string\n size?: 'sm' | 'md' | 'lg'\n theme?: 'white' | 'grey'\n disabled?: boolean\n className?: string\n }\n>\n\nexport const SelectMenuField = ({\n className,\n hideLabel,\n children,\n name,\n label,\n validation,\n prompt,\n description,\n theme,\n size,\n placeholder,\n disabled,\n ...rest\n}: SelectMenuFieldProps) => {\n const { control } = useFormContext()\n const context = useFormCustomContext()\n const { error } = useFieldError(name)\n const formTheme = context?.theme ?? theme\n\n const {\n field: { ref, onChange, value }\n } = useController({\n name,\n control,\n rules: validation,\n defaultValue: ''\n })\n\n return (\n <FieldWrapper\n className={className}\n description={description}\n error={error}\n fieldId={name}\n hideLabel={hideLabel}\n label={label}\n prompt={prompt}\n required={Boolean(validation?.required)}\n >\n <SelectMenu\n value={value}\n onValueChange={onChange}\n size={size}\n theme={formTheme}\n disabled={disabled}\n {...(error && { state: 'error' })}\n {...rest}\n >\n <SelectMenu.Trigger\n ref={ref}\n placeholder={placeholder}\n aria-label={label}\n />\n <SelectMenu.Content>{children}</SelectMenu.Content>\n </SelectMenu>\n </FieldWrapper>\n )\n}\n\nSelectMenuField.displayName = 'SelectMenuField'\n"],"mappings":";;;;;;;;AAqBA,IAAa,mBAAmB,EAC9B,WACA,WACA,UACA,MACA,OACA,YACA,QACA,aACA,OACA,MACA,aACA,UACA,GAAG,WACuB;CAC1B,MAAM,EAAE,YAAY,eAAe;CACnC,MAAM,UAAU,qBAAqB;CACrC,MAAM,EAAE,UAAU,cAAc,IAAI;CACpC,MAAM,YAAY,SAAS,SAAS;CAEpC,MAAM,EACJ,OAAO,EAAE,KAAK,UAAU,YACtB,cAAc;EAChB;EACA;EACA,OAAO;EACP,cAAc;CAChB,CAAC;CAED,OACE,oBAAC,cAAD;EACa;EACE;EACN;EACP,SAAS;EACE;EACJ;EACC;EACR,UAAU,QAAQ,YAAY,QAAQ;YAEtC,qBAAC,YAAD;GACS;GACP,eAAe;GACT;GACN,OAAO;GACG;GACV,GAAK,SAAS,EAAE,OAAO,QAAQ;GAC/B,GAAI;aAPN,CASE,oBAAC,WAAW,SAAZ;IACO;IACQ;IACb,cAAY;GACb,CAAA,GACD,oBAAC,WAAW,SAAZ,EAAqB,SAA6B,CAAA,CACxC;;CACA,CAAA;AAElB;AAEA,gBAAgB,cAAc"}
1
+ {"version":3,"file":"SelectMenuField.js","names":[],"sources":["../../../src/components/select-menu-field/SelectMenuField.tsx"],"sourcesContent":["import * as React from 'react'\nimport { useController, useFormContext } from 'react-hook-form'\n\nimport {\n type FieldElementWrapperProps,\n FieldWrapper\n} from '../field-wrapper/FieldWrapper'\nimport { useFieldError } from '../form/useFieldError'\nimport { useFormCustomContext } from '../form/useFormCustomContext'\nimport { SelectMenu } from '../select-menu/SelectMenu'\n\ntype SelectMenuFieldProps = React.PropsWithChildren<\n FieldElementWrapperProps & {\n placeholder?: string\n size?: 'sm' | 'md' | 'lg'\n theme?: 'white' | 'grey'\n disabled?: boolean\n className?: string\n }\n>\n\nexport const SelectMenuField = ({\n className,\n hideLabel,\n children,\n name,\n label,\n validation,\n prompt,\n description,\n theme,\n size,\n placeholder,\n disabled,\n ...rest\n}: SelectMenuFieldProps) => {\n const { control } = useFormContext()\n const context = useFormCustomContext()\n const { error } = useFieldError(name)\n const formTheme = context?.theme ?? theme\n\n const {\n field: { ref, onChange, value }\n } = useController({\n name,\n control,\n rules: validation,\n defaultValue: ''\n })\n\n return (\n <FieldWrapper\n className={className}\n description={description}\n error={error}\n fieldId={name}\n hideLabel={hideLabel}\n label={label}\n prompt={prompt}\n required={Boolean(validation?.required)}\n >\n <SelectMenu\n aria-label={label}\n selectedKey={value === '' ? null : value}\n onSelectionChange={onChange}\n size={size}\n theme={formTheme}\n isDisabled={disabled}\n {...(error && { state: 'error' })}\n {...rest}\n >\n <SelectMenu.Trigger ref={ref} placeholder={placeholder} />\n <SelectMenu.Content>{children}</SelectMenu.Content>\n </SelectMenu>\n </FieldWrapper>\n )\n}\n\nSelectMenuField.displayName = 'SelectMenuField'\n"],"mappings":";;;;;;;;AAqBA,IAAa,mBAAmB,EAC9B,WACA,WACA,UACA,MACA,OACA,YACA,QACA,aACA,OACA,MACA,aACA,UACA,GAAG,WACuB;CAC1B,MAAM,EAAE,YAAY,eAAe;CACnC,MAAM,UAAU,qBAAqB;CACrC,MAAM,EAAE,UAAU,cAAc,IAAI;CACpC,MAAM,YAAY,SAAS,SAAS;CAEpC,MAAM,EACJ,OAAO,EAAE,KAAK,UAAU,YACtB,cAAc;EAChB;EACA;EACA,OAAO;EACP,cAAc;CAChB,CAAC;CAED,OACE,oBAAC,cAAD;EACa;EACE;EACN;EACP,SAAS;EACE;EACJ;EACC;EACR,UAAU,QAAQ,YAAY,QAAQ;YAEtC,qBAAC,YAAD;GACE,cAAY;GACZ,aAAa,UAAU,KAAK,OAAO;GACnC,mBAAmB;GACb;GACN,OAAO;GACP,YAAY;GACZ,GAAK,SAAS,EAAE,OAAO,QAAQ;GAC/B,GAAI;aARN,CAUE,oBAAC,WAAW,SAAZ;IAAyB;IAAkB;GAAc,CAAA,GACzD,oBAAC,WAAW,SAAZ,EAAqB,SAA6B,CAAA,CACxC;;CACA,CAAA;AAElB;AAEA,gBAAgB,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"Slider.js","names":[],"sources":["../../../src/components/slider/Slider.tsx"],"sourcesContent":["import { Range, Root, Thumb, Track } from '@radix-ui/react-slider'\nimport * as React from 'react'\n\nimport { styled } from '../../styled'\nimport { CSSWrapper } from '../../utilities/css-wrapper/CSSWrapper'\nimport { SliderSteps } from './SliderSteps'\nimport { SliderValue } from './SliderValue'\n\nconst StyledTrack = styled(Track, {\n base: [\n 'rounded-full',\n 'grow',\n 'relative',\n 'data-[orientation=horizontal]:h-1',\n 'data-[orientation=vertical]:w-1'\n ],\n variants: {\n theme: {\n light: ['bg-white'],\n tonal: ['bg-grey-600']\n }\n }\n})\n\nconst StyledSlider = styled(Root, {\n base: [\n 'items-center',\n 'flex',\n 'relative',\n 'touch-none',\n 'select-none',\n 'cursor-pointer',\n 'data-[orientation=horizontal]:h-4',\n 'data-[orientation=vertical]:flex-col',\n 'data-[orientation=vertical]:w-4',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-30'\n ]\n})\n\nconst StyledRange = styled(Range, {\n base: [\n 'bg-primary-800',\n 'rounded-full',\n 'h-full',\n 'absolute',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-30'\n ]\n})\n\nconst StyledThumb = styled(Thumb, {\n base: [\n 'bg-primary-900',\n 'rounded-full',\n 'block',\n 'size-4',\n 'hover:bg-primary-1000',\n 'focus:outline-2',\n 'focus:outline-offset-2',\n 'focus:outline-primary-900',\n 'focus:outline-solid',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-30'\n ]\n})\n\nexport type SliderProps = React.ComponentProps<typeof StyledSlider> &\n Pick<React.ComponentProps<typeof StyledTrack>, 'theme'>\n\nconst SliderComponent = ({\n ref,\n value,\n defaultValue,\n min = 0,\n max = 100,\n theme = 'tonal',\n className,\n children,\n ...rest\n}: SliderProps) => {\n const values = value || defaultValue\n return (\n <CSSWrapper className={className}>\n <StyledSlider\n defaultValue={defaultValue}\n value={value}\n min={min}\n max={max}\n ref={ref}\n {...rest}\n >\n <StyledTrack theme={theme}>\n <StyledRange />\n </StyledTrack>\n {values?.length &&\n values.map((_, i) => <StyledThumb key={`thumb${i}`} />)}\n </StyledSlider>\n {children}\n </CSSWrapper>\n )\n}\n\nexport const Slider = /* @__PURE__ */ Object.assign(SliderComponent, {\n Value: SliderValue,\n Steps: SliderSteps\n})\n"],"mappings":";;;;;;;;AAQA,IAAM,cAAc,OAAO,OAAO;CAChC,MAAM;EACJ;EACA;EACA;EACA;EACA;CACF;CACA,UAAU,EACR,OAAO;EACL,OAAO,CAAC,UAAU;EAClB,OAAO,CAAC,aAAa;CACvB,EACF;AACF,CAAC;AAED,IAAM,eAAe,OAAO,MAAM,EAChC,MAAM;CACJ;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,EACF,CAAC;AAED,IAAM,cAAc,OAAO,OAAO,EAChC,MAAM;CACJ;CACA;CACA;CACA;CACA;CACA;AACF,EACF,CAAC;AAED,IAAM,cAAc,OAAO,OAAO,EAChC,MAAM;CACJ;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,EACF,CAAC;AAKD,IAAM,mBAAmB,EACvB,KACA,OACA,cACA,MAAM,GACN,MAAM,KACN,QAAQ,SACR,WACA,UACA,GAAG,WACc;CACjB,MAAM,SAAS,SAAS;CACxB,OACE,qBAAC,YAAD;EAAuB;YAAvB,CACE,qBAAC,cAAD;GACgB;GACP;GACF;GACA;GACA;GACL,GAAI;aANN,CAQE,oBAAC,aAAD;IAAoB;cAClB,oBAAC,aAAD,CAAc,CAAA;GACH,CAAA,GACZ,QAAQ,UACP,OAAO,KAAK,GAAG,MAAM,oBAAC,aAAD,CAAgC,GAAd,QAAQ,GAAM,CAAC,CAC5C;MACb,QACS;;AAEhB;AAEA,IAAa,SAAyB,uBAAO,OAAO,iBAAiB;CACnE,OAAO;CACP,OAAO;AACT,CAAC"}
1
+ {"version":3,"file":"Slider.js","names":[],"sources":["../../../src/components/slider/Slider.tsx"],"sourcesContent":["import { Range, Root, Thumb, Track } from '@radix-ui/react-slider'\nimport * as React from 'react'\n\nimport { styled } from '../../styled'\nimport { CSSWrapper } from '../../utilities/css-wrapper/CSSWrapper'\nimport { SliderSteps } from './SliderSteps'\nimport { SliderValue } from './SliderValue'\n\nconst StyledTrack = styled(Track, {\n base: [\n 'rounded-full',\n 'grow',\n 'relative',\n 'data-[orientation=horizontal]:h-1',\n 'data-[orientation=vertical]:w-1'\n ],\n variants: {\n theme: {\n light: ['bg-white'],\n tonal: ['bg-grey-600']\n }\n }\n})\n\nconst StyledSlider = styled(Root, {\n base: [\n 'items-center',\n 'flex',\n 'relative',\n 'touch-none',\n 'select-none',\n 'cursor-pointer',\n 'data-[orientation=horizontal]:h-4',\n 'data-[orientation=vertical]:flex-col',\n 'data-[orientation=vertical]:w-4',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-30'\n ]\n})\n\nconst StyledRange = styled(Range, {\n base: [\n 'bg-primary-800',\n 'rounded-full',\n 'h-full',\n 'absolute',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-30'\n ]\n})\n\nconst StyledThumb = styled(Thumb, {\n base: [\n 'bg-primary-900',\n 'rounded-full',\n 'block',\n 'size-4',\n 'hover:bg-primary-1000',\n 'focus:outline-2',\n 'focus:outline-offset-2',\n 'focus:outline-primary-900',\n 'focus:outline-solid',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-30'\n ]\n})\n\nexport type SliderProps = React.ComponentProps<typeof StyledSlider> &\n Pick<React.ComponentProps<typeof StyledTrack>, 'theme'>\n\nconst SliderComponent = ({\n ref,\n value,\n defaultValue,\n min = 0,\n max = 100,\n theme = 'tonal',\n className,\n children,\n ...rest\n}: SliderProps) => {\n const values = value || defaultValue\n return (\n <CSSWrapper className={className}>\n <StyledSlider\n defaultValue={defaultValue}\n value={value}\n min={min}\n max={max}\n ref={ref}\n {...rest}\n >\n <StyledTrack theme={theme}>\n <StyledRange />\n </StyledTrack>\n {values?.length &&\n // Thumbs are positional and can share a value, so the index is their\n // stable identity.\n // eslint-disable-next-line react/no-array-index-key\n values.map((_, i) => <StyledThumb key={`thumb${i}`} />)}\n </StyledSlider>\n {children}\n </CSSWrapper>\n )\n}\n\nexport const Slider = /* @__PURE__ */ Object.assign(SliderComponent, {\n Value: SliderValue,\n Steps: SliderSteps\n})\n"],"mappings":";;;;;;;;AAQA,IAAM,cAAc,OAAO,OAAO;CAChC,MAAM;EACJ;EACA;EACA;EACA;EACA;CACF;CACA,UAAU,EACR,OAAO;EACL,OAAO,CAAC,UAAU;EAClB,OAAO,CAAC,aAAa;CACvB,EACF;AACF,CAAC;AAED,IAAM,eAAe,OAAO,MAAM,EAChC,MAAM;CACJ;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,EACF,CAAC;AAED,IAAM,cAAc,OAAO,OAAO,EAChC,MAAM;CACJ;CACA;CACA;CACA;CACA;CACA;AACF,EACF,CAAC;AAED,IAAM,cAAc,OAAO,OAAO,EAChC,MAAM;CACJ;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,EACF,CAAC;AAKD,IAAM,mBAAmB,EACvB,KACA,OACA,cACA,MAAM,GACN,MAAM,KACN,QAAQ,SACR,WACA,UACA,GAAG,WACc;CACjB,MAAM,SAAS,SAAS;CACxB,OACE,qBAAC,YAAD;EAAuB;YAAvB,CACE,qBAAC,cAAD;GACgB;GACP;GACF;GACA;GACA;GACL,GAAI;aANN,CAQE,oBAAC,aAAD;IAAoB;cAClB,oBAAC,aAAD,CAAc,CAAA;GACH,CAAA,GACZ,QAAQ,UAIP,OAAO,KAAK,GAAG,MAAM,oBAAC,aAAD,CAAgC,GAAd,QAAQ,GAAM,CAAC,CAC5C;MACb,QACS;;AAEhB;AAEA,IAAa,SAAyB,uBAAO,OAAO,iBAAiB;CACnE,OAAO;CACP,OAAO;AACT,CAAC"}
@@ -4,7 +4,8 @@ import * as React$1 from "react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { useController, useFormContext } from "react-hook-form";
6
6
  //#region src/components/slider-field/SliderField.tsx
7
- var SliderField = ({ className, hideLabel, label, name, defaultValue, value, validation, outputLabel, min = 0, max = 100, steps = [], ...rest }) => {
7
+ var DEFAULT_STEPS = [];
8
+ var SliderField = ({ className, hideLabel, label, name, defaultValue, value, validation, outputLabel, min = 0, max = 100, steps = DEFAULT_STEPS, ...rest }) => {
8
9
  const { control, setValue } = useFormContext();
9
10
  const { field: { ref, onChange, value: innerValue, name: innerName } } = useController({
10
11
  name,
@@ -1 +1 @@
1
- {"version":3,"file":"SliderField.js","names":[],"sources":["../../../src/components/slider-field/SliderField.tsx"],"sourcesContent":["import * as React from 'react'\nimport { useController, useFormContext } from 'react-hook-form'\n\nimport {\n type FieldElementWrapperProps,\n FieldWrapper\n} from '../field-wrapper/FieldWrapper'\nimport { Slider, type SliderProps } from '../slider/Slider'\nimport type { SliderStepsType } from '../slider/SliderSteps'\nimport type { SliderValueType } from '../slider/SliderValue'\n\ntype SliderFieldProps = SliderProps &\n SliderStepsType &\n SliderValueType &\n FieldElementWrapperProps\n\nexport const SliderField = ({\n className,\n hideLabel,\n label,\n name,\n defaultValue,\n value,\n validation,\n outputLabel,\n min = 0,\n max = 100,\n steps = [],\n ...rest\n}: SliderFieldProps) => {\n const { control, setValue } = useFormContext()\n const {\n field: { ref, onChange, value: innerValue, name: innerName }\n } = useController({\n name,\n control,\n rules: validation,\n defaultValue\n })\n\n // Serialized so an inline `value` array with a fresh identity per render\n // doesn't re-fire the sync effect.\n const serializedValue = JSON.stringify(value)\n React.useEffect(() => {\n // Sync an externally-controlled `value` into react-hook-form without\n // marking the field dirty/touched — this isn't user input. An empty\n // array is a valid value (clearing) and must sync too.\n if (typeof value !== 'undefined')\n setValue(name, value, { shouldDirty: false })\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [serializedValue, name, setValue])\n\n return (\n <FieldWrapper\n className={className}\n fieldId={name}\n label={label}\n hideLabel={hideLabel}\n >\n <Slider\n ref={ref}\n name={innerName}\n onValueChange={onChange}\n value={innerValue}\n min={min}\n max={max}\n {...rest}\n >\n <Slider.Steps min={min} max={max} steps={steps} />\n\n <Slider.Value value={innerValue} outputLabel={outputLabel} />\n </Slider>\n </FieldWrapper>\n )\n}\n\nSliderField.displayName = 'SliderField'\n"],"mappings":";;;;;;AAgBA,IAAa,eAAe,EAC1B,WACA,WACA,OACA,MACA,cACA,OACA,YACA,aACA,MAAM,GACN,MAAM,KACN,QAAQ,CAAC,GACT,GAAG,WACmB;CACtB,MAAM,EAAE,SAAS,aAAa,eAAe;CAC7C,MAAM,EACJ,OAAO,EAAE,KAAK,UAAU,OAAO,YAAY,MAAM,gBAC/C,cAAc;EAChB;EACA;EACA,OAAO;EACP;CACF,CAAC;CAID,MAAM,kBAAkB,KAAK,UAAU,KAAK;CAC5C,QAAM,gBAAgB;EAIpB,IAAI,OAAO,UAAU,aACnB,SAAS,MAAM,OAAO,EAAE,aAAa,MAAM,CAAC;CAEhD,GAAG;EAAC;EAAiB;EAAM;CAAQ,CAAC;CAEpC,OACE,oBAAC,cAAD;EACa;EACX,SAAS;EACF;EACI;YAEX,qBAAC,QAAD;GACO;GACL,MAAM;GACN,eAAe;GACf,OAAO;GACF;GACA;GACL,GAAI;aAPN,CASE,oBAAC,OAAO,OAAR;IAAmB;IAAU;IAAY;GAAQ,CAAA,GAEjD,oBAAC,OAAO,OAAR;IAAc,OAAO;IAAyB;GAAc,CAAA,CACtD;;CACI,CAAA;AAElB;AAEA,YAAY,cAAc"}
1
+ {"version":3,"file":"SliderField.js","names":[],"sources":["../../../src/components/slider-field/SliderField.tsx"],"sourcesContent":["import * as React from 'react'\nimport { useController, useFormContext } from 'react-hook-form'\n\nimport {\n type FieldElementWrapperProps,\n FieldWrapper\n} from '../field-wrapper/FieldWrapper'\nimport { Slider, type SliderProps } from '../slider/Slider'\nimport type { SliderStepsType } from '../slider/SliderSteps'\nimport type { SliderValueType } from '../slider/SliderValue'\n\ntype SliderFieldProps = SliderProps &\n SliderStepsType &\n SliderValueType &\n FieldElementWrapperProps\n\n// Stable identity so the default doesn't hand `Slider.Steps` a fresh array every\n// render (which would redraw children that compare props).\nconst DEFAULT_STEPS: SliderFieldProps['steps'] = []\n\nexport const SliderField = ({\n className,\n hideLabel,\n label,\n name,\n defaultValue,\n value,\n validation,\n outputLabel,\n min = 0,\n max = 100,\n steps = DEFAULT_STEPS,\n ...rest\n}: SliderFieldProps) => {\n const { control, setValue } = useFormContext()\n const {\n field: { ref, onChange, value: innerValue, name: innerName }\n } = useController({\n name,\n control,\n rules: validation,\n defaultValue\n })\n\n // Serialized so an inline `value` array with a fresh identity per render\n // doesn't re-fire the sync effect.\n const serializedValue = JSON.stringify(value)\n React.useEffect(() => {\n // Sync an externally-controlled `value` into react-hook-form without\n // marking the field dirty/touched — this isn't user input. An empty\n // array is a valid value (clearing) and must sync too.\n if (typeof value !== 'undefined')\n setValue(name, value, { shouldDirty: false })\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [serializedValue, name, setValue])\n\n return (\n <FieldWrapper\n className={className}\n fieldId={name}\n label={label}\n hideLabel={hideLabel}\n >\n <Slider\n ref={ref}\n name={innerName}\n onValueChange={onChange}\n value={innerValue}\n min={min}\n max={max}\n {...rest}\n >\n <Slider.Steps min={min} max={max} steps={steps} />\n\n <Slider.Value value={innerValue} outputLabel={outputLabel} />\n </Slider>\n </FieldWrapper>\n )\n}\n\nSliderField.displayName = 'SliderField'\n"],"mappings":";;;;;;AAkBA,IAAM,gBAA2C,CAAC;AAElD,IAAa,eAAe,EAC1B,WACA,WACA,OACA,MACA,cACA,OACA,YACA,aACA,MAAM,GACN,MAAM,KACN,QAAQ,eACR,GAAG,WACmB;CACtB,MAAM,EAAE,SAAS,aAAa,eAAe;CAC7C,MAAM,EACJ,OAAO,EAAE,KAAK,UAAU,OAAO,YAAY,MAAM,gBAC/C,cAAc;EAChB;EACA;EACA,OAAO;EACP;CACF,CAAC;CAID,MAAM,kBAAkB,KAAK,UAAU,KAAK;CAC5C,QAAM,gBAAgB;EAIpB,IAAI,OAAO,UAAU,aACnB,SAAS,MAAM,OAAO,EAAE,aAAa,MAAM,CAAC;CAEhD,GAAG;EAAC;EAAiB;EAAM;CAAQ,CAAC;CAEpC,OACE,oBAAC,cAAD;EACa;EACX,SAAS;EACF;EACI;YAEX,qBAAC,QAAD;GACO;GACL,MAAM;GACN,eAAe;GACf,OAAO;GACF;GACA;GACL,GAAI;aAPN,CASE,oBAAC,OAAO,OAAR;IAAmB;IAAU;IAAY;GAAQ,CAAA,GAEjD,oBAAC,OAAO,OAAR;IAAc,OAAO;IAAyB;GAAc,CAAA,CACtD;;CACI,CAAA;AAElB;AAEA,YAAY,cAAc"}
@@ -1,17 +1,19 @@
1
1
  import * as React from 'react';
2
2
  import { Icon } from '../icon/Icon';
3
- export declare const StyledHandle: import("../..").PolymorphicComponent<({ ref, children, theme, appearance, size, label, href, disabled, hasTooltip, tooltipSide, ...rest }: Omit<{
3
+ export declare const StyledHandle: import("../..").PolymorphicComponent<({ ref, children, theme, appearance, size, label, href, disabled, hasTooltip, tooltipSide, reloadDocument, ...rest }: Omit<{
4
4
  theme?: ("danger" | "neutral" | "primary" | "primaryDark" | "success" | "warning" | "white" | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", "danger" | "neutral" | "primary" | "primaryDark" | "success" | "warning" | "white">>) | undefined;
5
5
  appearance?: ("outline" | "simple" | "solid" | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", "outline" | "simple" | "solid">>) | undefined;
6
6
  size?: ("lg" | "md" | "sm" | "xs" | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", "lg" | "md" | "sm" | "xs">>) | undefined;
7
7
  isRounded?: (boolean | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", boolean>>) | undefined;
8
8
  } & {
9
9
  as?: never;
10
- } & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "appearance" | "as" | "isRounded" | "size" | "theme">, "as" | "children" | "hasTooltip" | "label" | "tooltipSide" | keyof import("../..").NavigatorActions> & {
10
+ } & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "appearance" | "as" | "isRounded" | "size" | "theme">, "as" | "children" | "hasTooltip" | "href" | "label" | "reloadDocument" | "tooltipSide"> & {
11
11
  as?: React.ElementType;
12
12
  children: React.ReactNode;
13
+ href?: string;
13
14
  label: string;
14
- } & Omit<import("../..").OptionalTooltipWrapperProps, "label"> & import("../..").NavigatorActions) => React.JSX.Element, {
15
+ reloadDocument?: boolean;
16
+ } & Omit<import("../..").OptionalTooltipWrapperProps, "label">) => React.JSX.Element, {
15
17
  isDragging?: boolean | undefined;
16
18
  }>;
17
19
  export type HandleProps = Omit<React.ComponentProps<typeof StyledHandle>, 'children' | 'size'> & {
@@ -5,7 +5,7 @@ import { StepperStepForward } from "./StepperStepForward.js";
5
5
  import { StepperSteps } from "./StepperSteps.js";
6
6
  import "react";
7
7
  import { jsx } from "react/jsx-runtime";
8
- import invariant from "invariant";
8
+ import invariant from "tiny-invariant";
9
9
  //#region src/components/stepper/Stepper.tsx
10
10
  var StepperComponent = ({ children, stepCount, allowSkip, onComplete, onStepChange, direction = "horizontal", steps, hideLabels = false, showCompletedIcons = false, className }) => {
11
11
  invariant(!(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.");
@@ -1 +1 @@
1
- {"version":3,"file":"Stepper.js","names":[],"sources":["../../../src/components/stepper/Stepper.tsx"],"sourcesContent":["import invariant from 'invariant'\nimport * as React from 'react'\n\nimport { cn } from '../../styled'\nimport { StepperProvider } from './Stepper.context'\nimport { StepperStepBack } from './StepperStepBack'\nimport { StepperStepForward } from './StepperStepForward'\nimport { StepperSteps } from './StepperSteps'\nimport type { StepperProps } from './types'\n\nconst StepperComponent = ({\n children,\n stepCount,\n allowSkip,\n onComplete,\n onStepChange,\n direction = 'horizontal',\n steps,\n hideLabels = false,\n showCompletedIcons = false,\n className\n}: React.PropsWithChildren<StepperProps>) => {\n invariant(\n !(stepCount && steps),\n '`Stepper` should only be given one of `stepCount` or `steps`. When both are provided, `steps` will be used and `stepCount` will be ignored.'\n )\n\n const count = steps?.length || stepCount || 0\n\n return (\n <StepperProvider\n stepCount={count}\n allowSkip={allowSkip}\n onComplete={onComplete}\n onStepChange={stepCount ? onStepChange : undefined}\n direction={direction}\n steps={steps || Array(count).fill('')}\n hideLabels={hideLabels}\n showCompletedIcons={showCompletedIcons}\n >\n <div aria-label=\"progress\" className={cn('w-full', className)}>\n {children}\n </div>\n </StepperProvider>\n )\n}\n\nexport const Stepper = /* @__PURE__ */ Object.assign(StepperComponent, {\n StepBack: StepperStepBack,\n StepForward: StepperStepForward,\n Steps: StepperSteps\n})\n\nStepperComponent.displayName = 'Stepper'\n"],"mappings":";;;;;;;;;AAUA,IAAM,oBAAoB,EACxB,UACA,WACA,WACA,YACA,cACA,YAAY,cACZ,OACA,aAAa,OACb,qBAAqB,OACrB,gBAC2C;CAC3C,UACE,EAAE,aAAa,QACf,6IACF;CAEA,MAAM,QAAQ,OAAO,UAAU,aAAa;CAE5C,OACE,oBAAC,iBAAD;EACE,WAAW;EACA;EACC;EACZ,cAAc,YAAY,eAAe,KAAA;EAC9B;EACX,OAAO,SAAS,MAAM,KAAK,CAAC,CAAC,KAAK,EAAE;EACxB;EACQ;YAEpB,oBAAC,OAAD;GAAK,cAAW;GAAW,WAAW,GAAG,UAAU,SAAS;GACzD;EACE,CAAA;CACU,CAAA;AAErB;AAEA,IAAa,UAA0B,uBAAO,OAAO,kBAAkB;CACrE,UAAU;CACV,aAAa;CACb,OAAO;AACT,CAAC;AAED,iBAAiB,cAAc"}
1
+ {"version":3,"file":"Stepper.js","names":[],"sources":["../../../src/components/stepper/Stepper.tsx"],"sourcesContent":["import * as React from 'react'\nimport invariant from 'tiny-invariant'\n\nimport { cn } from '../../styled'\nimport { StepperProvider } from './Stepper.context'\nimport { StepperStepBack } from './StepperStepBack'\nimport { StepperStepForward } from './StepperStepForward'\nimport { StepperSteps } from './StepperSteps'\nimport type { StepperProps } from './types'\n\nconst StepperComponent = ({\n children,\n stepCount,\n allowSkip,\n onComplete,\n onStepChange,\n direction = 'horizontal',\n steps,\n hideLabels = false,\n showCompletedIcons = false,\n className\n}: React.PropsWithChildren<StepperProps>) => {\n invariant(\n !(stepCount && steps),\n '`Stepper` should only be given one of `stepCount` or `steps`. When both are provided, `steps` will be used and `stepCount` will be ignored.'\n )\n\n const count = steps?.length || stepCount || 0\n\n return (\n <StepperProvider\n stepCount={count}\n allowSkip={allowSkip}\n onComplete={onComplete}\n onStepChange={stepCount ? onStepChange : undefined}\n direction={direction}\n steps={steps || Array(count).fill('')}\n hideLabels={hideLabels}\n showCompletedIcons={showCompletedIcons}\n >\n <div aria-label=\"progress\" className={cn('w-full', className)}>\n {children}\n </div>\n </StepperProvider>\n )\n}\n\nexport const Stepper = /* @__PURE__ */ Object.assign(StepperComponent, {\n StepBack: StepperStepBack,\n StepForward: StepperStepForward,\n Steps: StepperSteps\n})\n\nStepperComponent.displayName = 'Stepper'\n"],"mappings":";;;;;;;;;AAUA,IAAM,oBAAoB,EACxB,UACA,WACA,WACA,YACA,cACA,YAAY,cACZ,OACA,aAAa,OACb,qBAAqB,OACrB,gBAC2C;CAC3C,UACE,EAAE,aAAa,QACf,6IACF;CAEA,MAAM,QAAQ,OAAO,UAAU,aAAa;CAE5C,OACE,oBAAC,iBAAD;EACE,WAAW;EACA;EACC;EACZ,cAAc,YAAY,eAAe,KAAA;EAC9B;EACX,OAAO,SAAS,MAAM,KAAK,CAAC,CAAC,KAAK,EAAE;EACxB;EACQ;YAEpB,oBAAC,OAAD;GAAK,cAAW;GAAW,WAAW,GAAG,UAAU,SAAS;GACzD;EACE,CAAA;CACU,CAAA;AAErB;AAEA,IAAa,UAA0B,uBAAO,OAAO,kBAAkB;CACrE,UAAU;CACV,aAAa;CACb,OAAO;AACT,CAAC;AAED,iBAAiB,cAAc"}
@@ -18,14 +18,16 @@ var StepperStepsContainer = styled("div", {
18
18
  });
19
19
  var StepperSteps = ({ className }) => {
20
20
  const { steps, goToStep, activeStep, viewedSteps, allowSkip, direction, hideLabels, completedSteps, showCompletedIcons } = useStepper();
21
+ const viewedStepsSet = new Set(viewedSteps);
22
+ const completedStepsSet = new Set(completedSteps);
21
23
  const getBulletStatus = (index) => {
22
24
  const activeBullet = steps[index];
23
25
  if (activeBullet.status) return activeBullet.status;
24
26
  if (completedSteps.length === steps.length) return Status.SUCCESS;
25
- if (activeStep === index && completedSteps.includes(activeStep)) return Status.REVIEWED;
27
+ if (activeStep === index && completedStepsSet.has(activeStep)) return Status.REVIEWED;
26
28
  if (activeStep === index) return Status.ACTIVE;
27
- if (completedSteps.includes(index)) return Status.COMPLETED;
28
- if (viewedSteps.includes(index)) return Status.VIEWED;
29
+ if (completedStepsSet.has(index)) return Status.COMPLETED;
30
+ if (viewedStepsSet.has(index)) return Status.VIEWED;
29
31
  return Status.DEFAULT;
30
32
  };
31
33
  const getSeparatorStatus = (index) => {
@@ -51,12 +53,12 @@ var StepperSteps = ({ className }) => {
51
53
  canInteract: allowSkip,
52
54
  children: [/* @__PURE__ */ jsx(StepperStepBullet, {
53
55
  as: allowSkip ? "button" : "div",
54
- onClick: () => allowSkip && viewedSteps.includes(index) ? goToStep?.(index) : void 0,
56
+ onClick: () => allowSkip && viewedStepsSet.has(index) ? goToStep?.(index) : void 0,
55
57
  status: bulletStatus,
56
58
  "aria-current": index === activeStep ? "step" : void 0,
57
59
  "aria-label": !step.label ? `step ${index + 1}` : "",
58
60
  "aria-labelledby": step.label ? `step-${index}` : void 0,
59
- className: allowSkip && viewedSteps.includes(index) ? "cursor-pointer" : "cursor-auto",
61
+ className: allowSkip && viewedStepsSet.has(index) ? "cursor-pointer" : "cursor-auto",
60
62
  children: step.status === Status.SUCCESS || showCompletedIcons && bulletStatus === Status.COMPLETED ? /* @__PURE__ */ jsx(Icon, { is: Ok }) : index + 1
61
63
  }), step.label && !hideLabels && /* @__PURE__ */ jsx(StepperStepLabel, {
62
64
  as: "span",
@@ -1 +1 @@
1
- {"version":3,"file":"StepperSteps.js","names":[],"sources":["../../../src/components/stepper/StepperSteps.tsx"],"sourcesContent":["import { Ok } from '@atom-learning/icons'\nimport * as React from 'react'\n\nimport { styled } from '../../styled'\nimport { Icon } from '../icon/Icon'\nimport { useStepper } from './Stepper.context'\nimport { StepperStepBullet } from './StepperStepBullet'\nimport { StepperStepContainer } from './StepperStepContainer'\nimport { StepperStepLabel } from './StepperStepLabel'\nimport { type StepperStepsProps, Status } from './types'\n\nconst StepperStepsContainer = styled('div', {\n base: ['flex', 'justify-between'],\n variants: {\n direction: {\n vertical: ['flex-col'],\n horizontal: ['flex-row']\n }\n }\n})\n\nexport const StepperSteps = ({ className }: StepperStepsProps) => {\n const {\n steps,\n goToStep,\n activeStep,\n viewedSteps,\n allowSkip,\n direction,\n hideLabels,\n completedSteps,\n showCompletedIcons\n } = useStepper()\n\n const getBulletStatus = (index: number) => {\n const activeBullet = steps[index]\n\n if (activeBullet.status) return activeBullet.status\n if (completedSteps.length === steps.length) return Status.SUCCESS\n if (activeStep === index && completedSteps.includes(activeStep))\n return Status.REVIEWED\n if (activeStep === index) return Status.ACTIVE\n if (completedSteps.includes(index)) return Status.COMPLETED\n if (viewedSteps.includes(index)) return Status.VIEWED\n return Status.DEFAULT\n }\n\n const getSeparatorStatus = (index: number) => {\n const bulletStatus = steps[index]?.status\n\n if (completedSteps.length === steps.length) {\n return Status.SUCCESS\n }\n\n if (bulletStatus === Status.SUCCESS) {\n return Status.SUCCESS\n }\n\n if (bulletStatus === Status.COMPLETED || index < Math.max(...viewedSteps)) {\n return Status.ACTIVE\n }\n\n if (bulletStatus === Status.VIEWED) {\n return Status.VIEWED\n }\n\n return Status.DEFAULT\n }\n\n return (\n <StepperStepsContainer className={className} direction={direction}>\n {steps.map((step, index) => {\n const bulletStatus = getBulletStatus(index)\n const separatorStatus = getSeparatorStatus(index)\n\n return (\n <StepperStepContainer\n tabIndex={0}\n key={`step_${index}`}\n direction={direction}\n separator={separatorStatus}\n status={bulletStatus}\n style={{ '--steps': steps.length || 0 }}\n className={\n direction === 'horizontal'\n ? 'w-[calc(100%/var(--steps))]'\n : 'h-[calc(100%/var(--steps))]'\n }\n canInteract={allowSkip}\n >\n <StepperStepBullet\n as={allowSkip ? 'button' : 'div'}\n onClick={() =>\n allowSkip && viewedSteps.includes(index)\n ? goToStep?.(index)\n : undefined\n }\n status={bulletStatus}\n aria-current={index === activeStep ? 'step' : undefined}\n aria-label={!step.label ? `step ${index + 1}` : ''}\n aria-labelledby={step.label ? `step-${index}` : undefined}\n className={\n allowSkip && viewedSteps.includes(index)\n ? 'cursor-pointer'\n : 'cursor-auto'\n }\n >\n {step.status === Status.SUCCESS ||\n (showCompletedIcons && bulletStatus === Status.COMPLETED) ? (\n <Icon is={Ok} />\n ) : (\n index + 1\n )}\n </StepperStepBullet>\n\n {step.label && !hideLabels && (\n <StepperStepLabel\n as=\"span\"\n id={`step-${index}`}\n direction={direction}\n status={bulletStatus}\n >\n {step.label}\n </StepperStepLabel>\n )}\n </StepperStepContainer>\n )\n })}\n </StepperStepsContainer>\n )\n}\n"],"mappings":";;;;;;;;;;;AAWA,IAAM,wBAAwB,OAAO,OAAO;CAC1C,MAAM,CAAC,QAAQ,iBAAiB;CAChC,UAAU,EACR,WAAW;EACT,UAAU,CAAC,UAAU;EACrB,YAAY,CAAC,UAAU;CACzB,EACF;AACF,CAAC;AAED,IAAa,gBAAgB,EAAE,gBAAmC;CAChE,MAAM,EACJ,OACA,UACA,YACA,aACA,WACA,WACA,YACA,gBACA,uBACE,WAAW;CAEf,MAAM,mBAAmB,UAAkB;EACzC,MAAM,eAAe,MAAM;EAE3B,IAAI,aAAa,QAAQ,OAAO,aAAa;EAC7C,IAAI,eAAe,WAAW,MAAM,QAAQ,OAAO,OAAO;EAC1D,IAAI,eAAe,SAAS,eAAe,SAAS,UAAU,GAC5D,OAAO,OAAO;EAChB,IAAI,eAAe,OAAO,OAAO,OAAO;EACxC,IAAI,eAAe,SAAS,KAAK,GAAG,OAAO,OAAO;EAClD,IAAI,YAAY,SAAS,KAAK,GAAG,OAAO,OAAO;EAC/C,OAAO,OAAO;CAChB;CAEA,MAAM,sBAAsB,UAAkB;EAC5C,MAAM,eAAe,MAAM,MAAM,EAAE;EAEnC,IAAI,eAAe,WAAW,MAAM,QAClC,OAAO,OAAO;EAGhB,IAAI,iBAAiB,OAAO,SAC1B,OAAO,OAAO;EAGhB,IAAI,iBAAiB,OAAO,aAAa,QAAQ,KAAK,IAAI,GAAG,WAAW,GACtE,OAAO,OAAO;EAGhB,IAAI,iBAAiB,OAAO,QAC1B,OAAO,OAAO;EAGhB,OAAO,OAAO;CAChB;CAEA,OACE,oBAAC,uBAAD;EAAkC;EAAsB;YACrD,MAAM,KAAK,MAAM,UAAU;GAC1B,MAAM,eAAe,gBAAgB,KAAK;GAG1C,OACE,qBAAC,sBAAD;IACE,UAAU;IAEC;IACX,WAPoB,mBAAmB,KAO5B;IACX,QAAQ;IACR,OAAO,EAAE,WAAW,MAAM,UAAU,EAAE;IACtC,WACE,cAAc,eACV,gCACA;IAEN,aAAa;cAZf,CAcE,oBAAC,mBAAD;KACE,IAAI,YAAY,WAAW;KAC3B,eACE,aAAa,YAAY,SAAS,KAAK,IACnC,WAAW,KAAK,IAChB,KAAA;KAEN,QAAQ;KACR,gBAAc,UAAU,aAAa,SAAS,KAAA;KAC9C,cAAY,CAAC,KAAK,QAAQ,QAAQ,QAAQ,MAAM;KAChD,mBAAiB,KAAK,QAAQ,QAAQ,UAAU,KAAA;KAChD,WACE,aAAa,YAAY,SAAS,KAAK,IACnC,mBACA;eAGL,KAAK,WAAW,OAAO,WACvB,sBAAsB,iBAAiB,OAAO,YAC7C,oBAAC,MAAD,EAAM,IAAI,GAAK,CAAA,IAEf,QAAQ;IAEO,CAAA,GAElB,KAAK,SAAS,CAAC,cACd,oBAAC,kBAAD;KACE,IAAG;KACH,IAAI,QAAQ;KACD;KACX,QAAQ;eAEP,KAAK;IACU,CAAA,CAEA;MA/Cf,QAAQ,OA+CO;EAE1B,CAAC;CACoB,CAAA;AAE3B"}
1
+ {"version":3,"file":"StepperSteps.js","names":[],"sources":["../../../src/components/stepper/StepperSteps.tsx"],"sourcesContent":["import { Ok } from '@atom-learning/icons'\nimport * as React from 'react'\n\nimport { styled } from '../../styled'\nimport { Icon } from '../icon/Icon'\nimport { useStepper } from './Stepper.context'\nimport { StepperStepBullet } from './StepperStepBullet'\nimport { StepperStepContainer } from './StepperStepContainer'\nimport { StepperStepLabel } from './StepperStepLabel'\nimport { type StepperStepsProps, Status } from './types'\n\nconst StepperStepsContainer = styled('div', {\n base: ['flex', 'justify-between'],\n variants: {\n direction: {\n vertical: ['flex-col'],\n horizontal: ['flex-row']\n }\n }\n})\n\nexport const StepperSteps = ({ className }: StepperStepsProps) => {\n const {\n steps,\n goToStep,\n activeStep,\n viewedSteps,\n allowSkip,\n direction,\n hideLabels,\n completedSteps,\n showCompletedIcons\n } = useStepper()\n\n // `viewedSteps`/`completedSteps` are scanned once per step below; Set lookups\n // keep the per-step status checks O(1) instead of O(steps).\n const viewedStepsSet = new Set(viewedSteps)\n const completedStepsSet = new Set(completedSteps)\n\n const getBulletStatus = (index: number) => {\n const activeBullet = steps[index]\n\n if (activeBullet.status) return activeBullet.status\n if (completedSteps.length === steps.length) return Status.SUCCESS\n if (activeStep === index && completedStepsSet.has(activeStep))\n return Status.REVIEWED\n if (activeStep === index) return Status.ACTIVE\n if (completedStepsSet.has(index)) return Status.COMPLETED\n if (viewedStepsSet.has(index)) return Status.VIEWED\n return Status.DEFAULT\n }\n\n const getSeparatorStatus = (index: number) => {\n const bulletStatus = steps[index]?.status\n\n if (completedSteps.length === steps.length) {\n return Status.SUCCESS\n }\n\n if (bulletStatus === Status.SUCCESS) {\n return Status.SUCCESS\n }\n\n if (bulletStatus === Status.COMPLETED || index < Math.max(...viewedSteps)) {\n return Status.ACTIVE\n }\n\n if (bulletStatus === Status.VIEWED) {\n return Status.VIEWED\n }\n\n return Status.DEFAULT\n }\n\n return (\n <StepperStepsContainer className={className} direction={direction}>\n {steps.map((step, index) => {\n const bulletStatus = getBulletStatus(index)\n const separatorStatus = getSeparatorStatus(index)\n\n return (\n <StepperStepContainer\n tabIndex={0}\n // Steps are a fixed, index-addressed list (activeStep/viewedSteps/\n // goToStep all key off the index) that never reorders, so the index\n // is the stable identity here.\n // eslint-disable-next-line react/no-array-index-key\n key={`step_${index}`}\n direction={direction}\n separator={separatorStatus}\n status={bulletStatus}\n style={{ '--steps': steps.length || 0 }}\n className={\n direction === 'horizontal'\n ? 'w-[calc(100%/var(--steps))]'\n : 'h-[calc(100%/var(--steps))]'\n }\n canInteract={allowSkip}\n >\n <StepperStepBullet\n as={allowSkip ? 'button' : 'div'}\n onClick={() =>\n allowSkip && viewedStepsSet.has(index)\n ? goToStep?.(index)\n : undefined\n }\n status={bulletStatus}\n aria-current={index === activeStep ? 'step' : undefined}\n aria-label={!step.label ? `step ${index + 1}` : ''}\n aria-labelledby={step.label ? `step-${index}` : undefined}\n className={\n allowSkip && viewedStepsSet.has(index)\n ? 'cursor-pointer'\n : 'cursor-auto'\n }\n >\n {step.status === Status.SUCCESS ||\n (showCompletedIcons && bulletStatus === Status.COMPLETED) ? (\n <Icon is={Ok} />\n ) : (\n index + 1\n )}\n </StepperStepBullet>\n\n {step.label && !hideLabels && (\n <StepperStepLabel\n as=\"span\"\n id={`step-${index}`}\n direction={direction}\n status={bulletStatus}\n >\n {step.label}\n </StepperStepLabel>\n )}\n </StepperStepContainer>\n )\n })}\n </StepperStepsContainer>\n )\n}\n"],"mappings":";;;;;;;;;;;AAWA,IAAM,wBAAwB,OAAO,OAAO;CAC1C,MAAM,CAAC,QAAQ,iBAAiB;CAChC,UAAU,EACR,WAAW;EACT,UAAU,CAAC,UAAU;EACrB,YAAY,CAAC,UAAU;CACzB,EACF;AACF,CAAC;AAED,IAAa,gBAAgB,EAAE,gBAAmC;CAChE,MAAM,EACJ,OACA,UACA,YACA,aACA,WACA,WACA,YACA,gBACA,uBACE,WAAW;CAIf,MAAM,iBAAiB,IAAI,IAAI,WAAW;CAC1C,MAAM,oBAAoB,IAAI,IAAI,cAAc;CAEhD,MAAM,mBAAmB,UAAkB;EACzC,MAAM,eAAe,MAAM;EAE3B,IAAI,aAAa,QAAQ,OAAO,aAAa;EAC7C,IAAI,eAAe,WAAW,MAAM,QAAQ,OAAO,OAAO;EAC1D,IAAI,eAAe,SAAS,kBAAkB,IAAI,UAAU,GAC1D,OAAO,OAAO;EAChB,IAAI,eAAe,OAAO,OAAO,OAAO;EACxC,IAAI,kBAAkB,IAAI,KAAK,GAAG,OAAO,OAAO;EAChD,IAAI,eAAe,IAAI,KAAK,GAAG,OAAO,OAAO;EAC7C,OAAO,OAAO;CAChB;CAEA,MAAM,sBAAsB,UAAkB;EAC5C,MAAM,eAAe,MAAM,MAAM,EAAE;EAEnC,IAAI,eAAe,WAAW,MAAM,QAClC,OAAO,OAAO;EAGhB,IAAI,iBAAiB,OAAO,SAC1B,OAAO,OAAO;EAGhB,IAAI,iBAAiB,OAAO,aAAa,QAAQ,KAAK,IAAI,GAAG,WAAW,GACtE,OAAO,OAAO;EAGhB,IAAI,iBAAiB,OAAO,QAC1B,OAAO,OAAO;EAGhB,OAAO,OAAO;CAChB;CAEA,OACE,oBAAC,uBAAD;EAAkC;EAAsB;YACrD,MAAM,KAAK,MAAM,UAAU;GAC1B,MAAM,eAAe,gBAAgB,KAAK;GAG1C,OACE,qBAAC,sBAAD;IACE,UAAU;IAMC;IACX,WAXoB,mBAAmB,KAW5B;IACX,QAAQ;IACR,OAAO,EAAE,WAAW,MAAM,UAAU,EAAE;IACtC,WACE,cAAc,eACV,gCACA;IAEN,aAAa;cAhBf,CAkBE,oBAAC,mBAAD;KACE,IAAI,YAAY,WAAW;KAC3B,eACE,aAAa,eAAe,IAAI,KAAK,IACjC,WAAW,KAAK,IAChB,KAAA;KAEN,QAAQ;KACR,gBAAc,UAAU,aAAa,SAAS,KAAA;KAC9C,cAAY,CAAC,KAAK,QAAQ,QAAQ,QAAQ,MAAM;KAChD,mBAAiB,KAAK,QAAQ,QAAQ,UAAU,KAAA;KAChD,WACE,aAAa,eAAe,IAAI,KAAK,IACjC,mBACA;eAGL,KAAK,WAAW,OAAO,WACvB,sBAAsB,iBAAiB,OAAO,YAC7C,oBAAC,MAAD,EAAM,IAAI,GAAK,CAAA,IAEf,QAAQ;IAEO,CAAA,GAElB,KAAK,SAAS,CAAC,cACd,oBAAC,kBAAD;KACE,IAAG;KACH,IAAI,QAAQ;KACD;KACX,QAAQ;eAEP,KAAK;IACU,CAAA,CAEA;MA/Cf,QAAQ,OA+CO;EAE1B,CAAC;CACoB,CAAA;AAE3B"}
@@ -5,7 +5,7 @@ var useStickyColumnsStyle = ({ numberOfStickyColumns, wrapperRef }) => {
5
5
  const generateColumnsStyle = React$1.useCallback(() => {
6
6
  let accWidth = 0;
7
7
  const tableHeaderCells = wrapperRef.current?.querySelectorAll("th");
8
- return Array.from(tableHeaderCells || []).slice(0, numberOfStickyColumns).reduce((acc, column, index) => {
8
+ return [...tableHeaderCells || []].slice(0, numberOfStickyColumns).reduce((acc, column, index) => {
9
9
  const elementNumber = index + 1;
10
10
  const styleObject = {
11
11
  ...acc,
@@ -1 +1 @@
1
- {"version":3,"file":"useStickyColumnsCss.js","names":[],"sources":["../../../src/components/table/useStickyColumnsCss.ts"],"sourcesContent":["import * as React from 'react'\n\ntype ColumnStyle = Record<\n `--sticky-column-width-${number}` | `--sticky-offset-left-${number}`,\n string\n>\n\ninterface UseStickyColumnsCss {\n columnsStyle?: ColumnStyle\n}\n\nexport const useStickyColumnsStyle = ({\n numberOfStickyColumns,\n wrapperRef\n}: {\n numberOfStickyColumns: number\n wrapperRef: React.RefObject<HTMLDivElement | null>\n}): UseStickyColumnsCss => {\n const [columnsStyle, setColumnsStyle] = React.useState<ColumnStyle>({})\n\n const generateColumnsStyle = React.useCallback(() => {\n let accWidth = 0\n\n // Getting the table header cells elements to use their width to set the left position in the sticky columns.\n const tableHeaderCells = wrapperRef.current?.querySelectorAll('th')\n const tableHeaderElements = Array.from(tableHeaderCells || [])\n\n // Getting only the number of sticky columns from the elements array that is what we are interested in.\n const stickyColumns = tableHeaderElements.slice(0, numberOfStickyColumns)\n\n const newColumnsStyle = stickyColumns.reduce((acc, column, index) => {\n const elementNumber = index + 1\n const styleObject = {\n ...acc,\n [`--sticky-column-width-${elementNumber}`]: `${column.offsetWidth}px`,\n [`--sticky-offset-left-${elementNumber}`]: `${accWidth}px`\n }\n\n accWidth += tableHeaderCells?.item(index).clientWidth || 0\n\n return styleObject\n }, {})\n\n return newColumnsStyle\n }, [numberOfStickyColumns, wrapperRef])\n\n React.useLayoutEffect(() => {\n if (!numberOfStickyColumns) return\n const newColumnsStyle = generateColumnsStyle()\n\n setColumnsStyle(newColumnsStyle)\n }, [numberOfStickyColumns, wrapperRef, generateColumnsStyle])\n\n return {\n columnsStyle\n }\n}\n"],"mappings":";;AAWA,IAAa,yBAAyB,EACpC,uBACA,iBAIyB;CACzB,MAAM,CAAC,cAAc,mBAAmB,QAAM,SAAsB,CAAC,CAAC;CAEtE,MAAM,uBAAuB,QAAM,kBAAkB;EACnD,IAAI,WAAW;EAGf,MAAM,mBAAmB,WAAW,SAAS,iBAAiB,IAAI;EAmBlE,OAlB4B,MAAM,KAAK,oBAAoB,CAAC,CAGtC,CAAA,CAAoB,MAAM,GAAG,qBAE3B,CAAA,CAAc,QAAQ,KAAK,QAAQ,UAAU;GACnE,MAAM,gBAAgB,QAAQ;GAC9B,MAAM,cAAc;IAClB,GAAG;KACF,yBAAyB,kBAAkB,GAAG,OAAO,YAAY;KACjE,wBAAwB,kBAAkB,GAAG,SAAS;GACzD;GAEA,YAAY,kBAAkB,KAAK,KAAK,CAAC,CAAC,eAAe;GAEzD,OAAO;EACT,GAAG,CAAC,CAEG;CACT,GAAG,CAAC,uBAAuB,UAAU,CAAC;CAEtC,QAAM,sBAAsB;EAC1B,IAAI,CAAC,uBAAuB;EAG5B,gBAFwB,qBAER,CAAe;CACjC,GAAG;EAAC;EAAuB;EAAY;CAAoB,CAAC;CAE5D,OAAO,EACL,aACF;AACF"}
1
+ {"version":3,"file":"useStickyColumnsCss.js","names":[],"sources":["../../../src/components/table/useStickyColumnsCss.ts"],"sourcesContent":["import * as React from 'react'\n\ntype ColumnStyle = Record<\n `--sticky-column-width-${number}` | `--sticky-offset-left-${number}`,\n string\n>\n\ninterface UseStickyColumnsCss {\n columnsStyle?: ColumnStyle\n}\n\nexport const useStickyColumnsStyle = ({\n numberOfStickyColumns,\n wrapperRef\n}: {\n numberOfStickyColumns: number\n wrapperRef: React.RefObject<HTMLDivElement | null>\n}): UseStickyColumnsCss => {\n const [columnsStyle, setColumnsStyle] = React.useState<ColumnStyle>({})\n\n const generateColumnsStyle = React.useCallback(() => {\n let accWidth = 0\n\n // Getting the table header cells elements to use their width to set the left position in the sticky columns.\n const tableHeaderCells = wrapperRef.current?.querySelectorAll('th')\n const tableHeaderElements = [...(tableHeaderCells || [])]\n\n // Getting only the number of sticky columns from the elements array that is what we are interested in.\n const stickyColumns = tableHeaderElements.slice(0, numberOfStickyColumns)\n\n const newColumnsStyle = stickyColumns.reduce((acc, column, index) => {\n const elementNumber = index + 1\n const styleObject = {\n ...acc,\n [`--sticky-column-width-${elementNumber}`]: `${column.offsetWidth}px`,\n [`--sticky-offset-left-${elementNumber}`]: `${accWidth}px`\n }\n\n accWidth += tableHeaderCells?.item(index).clientWidth || 0\n\n return styleObject\n }, {})\n\n return newColumnsStyle\n }, [numberOfStickyColumns, wrapperRef])\n\n React.useLayoutEffect(() => {\n if (!numberOfStickyColumns) return\n const newColumnsStyle = generateColumnsStyle()\n\n setColumnsStyle(newColumnsStyle)\n }, [numberOfStickyColumns, wrapperRef, generateColumnsStyle])\n\n return {\n columnsStyle\n }\n}\n"],"mappings":";;AAWA,IAAa,yBAAyB,EACpC,uBACA,iBAIyB;CACzB,MAAM,CAAC,cAAc,mBAAmB,QAAM,SAAsB,CAAC,CAAC;CAEtE,MAAM,uBAAuB,QAAM,kBAAkB;EACnD,IAAI,WAAW;EAGf,MAAM,mBAAmB,WAAW,SAAS,iBAAiB,IAAI;EAmBlE,OAfsB,CAHO,GAAI,oBAAoB,CAAC,CAGhC,CAAA,CAAoB,MAAM,GAAG,qBAE3B,CAAA,CAAc,QAAQ,KAAK,QAAQ,UAAU;GACnE,MAAM,gBAAgB,QAAQ;GAC9B,MAAM,cAAc;IAClB,GAAG;KACF,yBAAyB,kBAAkB,GAAG,OAAO,YAAY;KACjE,wBAAwB,kBAAkB,GAAG,SAAS;GACzD;GAEA,YAAY,kBAAkB,KAAK,KAAK,CAAC,CAAC,eAAe;GAEzD,OAAO;EACT,GAAG,CAAC,CAEG;CACT,GAAG,CAAC,uBAAuB,UAAU,CAAC;CAEtC,QAAM,sBAAsB;EAC1B,IAAI,CAAC,uBAAuB;EAG5B,gBAFwB,qBAER,CAAe;CACjC,GAAG;EAAC;EAAuB;EAAY;CAAoB,CAAC;CAE5D,OAAO,EACL,aACF;AACF"}
@@ -1,5 +1,4 @@
1
1
  import * as React from 'react';
2
- import type { NavigatorActions } from '../../types/navigatorActions.types';
3
2
  import type { Override } from '../../utilities/types';
4
3
  declare const StyledTileInteractive: import("../..").PolymorphicComponent<import("../..").PolymorphicComponent<"div", {
5
4
  borderRadius?: ("lg" | "md" | "sm" | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", "lg" | "md" | "sm">>) | undefined;
@@ -14,8 +13,11 @@ declare const StyledTileInteractive: import("../..").PolymorphicComponent<import
14
13
  } & {
15
14
  colorScheme?: import("../..").TcolorScheme;
16
15
  }>;
17
- type TileInteractiveProps = Override<React.ComponentProps<typeof StyledTileInteractive> & React.ButtonHTMLAttributes<HTMLButtonElement> & NavigatorActions, {
16
+ type TileInteractiveProps = Override<React.ComponentProps<typeof StyledTileInteractive> & React.ButtonHTMLAttributes<HTMLButtonElement> & {
17
+ href?: string;
18
+ reloadDocument?: boolean;
19
+ }, {
18
20
  as?: React.ElementType;
19
21
  }>;
20
- export declare const TileInteractive: ({ ref, onClick, href, type, as, ...rest }: TileInteractiveProps) => React.JSX.Element;
22
+ export declare const TileInteractive: ({ ref, onClick, href, type, as, reloadDocument, ...rest }: TileInteractiveProps) => React.JSX.Element;
21
23
  export {};
@@ -1,4 +1,5 @@
1
1
  import { styled } from "../../styled.js";
2
+ import { useRouterLinkProps } from "../router-provider/RouterProvider.js";
2
3
  import { Tile } from "../tile/Tile.js";
3
4
  import "react";
4
5
  import { jsx } from "react/jsx-runtime";
@@ -29,9 +30,10 @@ var StyledTileInteractive = styled(Tile, { base: [
29
30
  "not-disabled:transition-transform",
30
31
  "not-disabled:translate-y-0"
31
32
  ] });
32
- var TileInteractive = ({ ref, onClick, href, type = "button", as, ...rest }) => {
33
+ var TileInteractive = ({ ref, onClick, href, type = "button", as, reloadDocument, ...rest }) => {
34
+ const routerLinkProps = useRouterLinkProps(href, { reloadDocument });
33
35
  const elementSpecificProps = !!href ? {
34
- as: as || "a",
36
+ as: as || routerLinkProps.as || "a",
35
37
  href,
36
38
  onClick: void 0
37
39
  } : {
@@ -1 +1 @@
1
- {"version":3,"file":"TileInteractive.js","names":[],"sources":["../../../src/components/tile-interactive/TileInteractive.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '../../styled'\nimport type { NavigatorActions } from '../../types/navigatorActions.types'\nimport type { Override } from '../../utilities/types'\nimport { Tile } from '../tile/Tile'\n\nconst StyledTileInteractive = styled(Tile, {\n base: [\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-30',\n 'not-disabled:active:bg-(--base-2)',\n 'not-disabled:after:absolute',\n 'not-disabled:after:duration-250',\n 'not-disabled:after:ease-out',\n 'not-disabled:after:inset-0',\n 'not-disabled:after:opacity-0',\n 'not-disabled:after:pointer-events-none',\n 'not-disabled:after:rounded-[inherit]',\n 'not-disabled:after:shadow-lg',\n 'not-disabled:after:transition-opacity',\n 'not-disabled:cursor-pointer',\n 'not-disabled:duration-250',\n 'not-disabled:ease-in',\n 'not-disabled:focus-visible:outline-none',\n 'not-disabled:focus-visible:relative',\n 'not-disabled:focus-visible:shadow-[var(--color-primary-800)_0px_0px_0px_4px]',\n 'not-disabled:focus-visible:shadow-[white_0px_0px_0px_2px]',\n 'not-disabled:focus-visible:z-1',\n 'not-disabled:hover:after:opacity-100',\n 'not-disabled:hover:-translate-y-0.5',\n 'not-disabled:transition-transform',\n 'not-disabled:translate-y-0'\n ]\n})\n\ntype TileInteractiveProps = Override<\n React.ComponentProps<typeof StyledTileInteractive> &\n React.ButtonHTMLAttributes<HTMLButtonElement> &\n NavigatorActions,\n { as?: React.ElementType }\n>\n\nexport const TileInteractive = ({\n ref,\n onClick,\n href,\n type = 'button',\n as,\n ...rest\n}: TileInteractiveProps) => {\n const isLink = !!href\n const elementSpecificProps = isLink\n ? {\n as: as || 'a',\n href,\n onClick: undefined\n }\n : {\n as: as || 'button',\n type,\n onClick\n }\n\n return <StyledTileInteractive {...rest} {...elementSpecificProps} ref={ref} />\n}\n"],"mappings":";;;;;AAOA,IAAM,wBAAwB,OAAO,MAAM,EACzC,MAAM;CACJ;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,EACF,CAAC;AASD,IAAa,mBAAmB,EAC9B,KACA,SACA,MACA,OAAO,UACP,IACA,GAAG,WACuB;CAE1B,MAAM,uBAAuB,CADb,CAAC,OAEb;EACE,IAAI,MAAM;EACV;EACA,SAAS,KAAA;CACX,IACA;EACE,IAAI,MAAM;EACV;EACA;CACF;CAEJ,OAAO,oBAAC,uBAAD;EAAuB,GAAI;EAAM,GAAI;EAA2B;CAAM,CAAA;AAC/E"}
1
+ {"version":3,"file":"TileInteractive.js","names":[],"sources":["../../../src/components/tile-interactive/TileInteractive.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '../../styled'\nimport type { Override } from '../../utilities/types'\nimport { useRouterLinkProps } from '../router-provider/RouterProvider'\nimport { Tile } from '../tile/Tile'\n\nconst StyledTileInteractive = styled(Tile, {\n base: [\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-30',\n 'not-disabled:active:bg-(--base-2)',\n 'not-disabled:after:absolute',\n 'not-disabled:after:duration-250',\n 'not-disabled:after:ease-out',\n 'not-disabled:after:inset-0',\n 'not-disabled:after:opacity-0',\n 'not-disabled:after:pointer-events-none',\n 'not-disabled:after:rounded-[inherit]',\n 'not-disabled:after:shadow-lg',\n 'not-disabled:after:transition-opacity',\n 'not-disabled:cursor-pointer',\n 'not-disabled:duration-250',\n 'not-disabled:ease-in',\n 'not-disabled:focus-visible:outline-none',\n 'not-disabled:focus-visible:relative',\n 'not-disabled:focus-visible:shadow-[var(--color-primary-800)_0px_0px_0px_4px]',\n 'not-disabled:focus-visible:shadow-[white_0px_0px_0px_2px]',\n 'not-disabled:focus-visible:z-1',\n 'not-disabled:hover:after:opacity-100',\n 'not-disabled:hover:-translate-y-0.5',\n 'not-disabled:transition-transform',\n 'not-disabled:translate-y-0'\n ]\n})\n\ntype TileInteractiveProps = Override<\n React.ComponentProps<typeof StyledTileInteractive> &\n React.ButtonHTMLAttributes<HTMLButtonElement> & {\n href?: string\n reloadDocument?: boolean\n },\n { as?: React.ElementType }\n>\n\nexport const TileInteractive = ({\n ref,\n onClick,\n href,\n type = 'button',\n as,\n reloadDocument,\n ...rest\n}: TileInteractiveProps) => {\n const routerLinkProps = useRouterLinkProps(href, { reloadDocument })\n const isLink = !!href\n const elementSpecificProps = isLink\n ? {\n as: as || routerLinkProps.as || 'a',\n href,\n onClick: undefined\n }\n : {\n as: as || 'button',\n type,\n onClick\n }\n\n return <StyledTileInteractive {...rest} {...elementSpecificProps} ref={ref} />\n}\n"],"mappings":";;;;;;AAOA,IAAM,wBAAwB,OAAO,MAAM,EACzC,MAAM;CACJ;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,EACF,CAAC;AAWD,IAAa,mBAAmB,EAC9B,KACA,SACA,MACA,OAAO,UACP,IACA,gBACA,GAAG,WACuB;CAC1B,MAAM,kBAAkB,mBAAmB,MAAM,EAAE,eAAe,CAAC;CAEnE,MAAM,uBAAuB,CADb,CAAC,OAEb;EACE,IAAI,MAAM,gBAAgB,MAAM;EAChC;EACA,SAAS,KAAA;CACX,IACA;EACE,IAAI,MAAM;EACV;EACA;CACF;CAEJ,OAAO,oBAAC,uBAAD;EAAuB,GAAI;EAAM,GAAI;EAA2B;CAAM,CAAA;AAC/E"}
@@ -1,6 +1,6 @@
1
1
  import * as ToggleGroup from '@radix-ui/react-toggle-group';
2
2
  import * as React from 'react';
3
- declare const StyledTileToggleGroupItem: import("../..").PolymorphicComponent<({ ref, onClick, href, type, as, ...rest }: Omit<{
3
+ declare const StyledTileToggleGroupItem: import("../..").PolymorphicComponent<({ ref, onClick, href, type, as, reloadDocument, ...rest }: Omit<{
4
4
  borderRadius?: ("lg" | "md" | "sm" | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", "lg" | "md" | "sm">>) | undefined;
5
5
  border?: (boolean | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", boolean>>) | undefined;
6
6
  diffused?: (boolean | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", boolean>>) | undefined;
@@ -16,7 +16,10 @@ declare const StyledTileToggleGroupItem: import("../..").PolymorphicComponent<({
16
16
  colorScheme?: import("../..").TcolorScheme;
17
17
  } & {
18
18
  as?: never;
19
- } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "as" | "border" | "borderRadius" | "colorScheme" | "diffused">, "as" | "border" | "borderRadius" | "colorScheme" | "diffused"> & React.ButtonHTMLAttributes<HTMLButtonElement> & import("../..").NavigatorActions, "as"> & {
19
+ } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "as" | "border" | "borderRadius" | "colorScheme" | "diffused">, "as" | "border" | "borderRadius" | "colorScheme" | "diffused"> & React.ButtonHTMLAttributes<HTMLButtonElement> & {
20
+ href?: string;
21
+ reloadDocument?: boolean;
22
+ }, "as"> & {
20
23
  as?: React.ElementType;
21
24
  }) => React.JSX.Element, unknown>;
22
25
  type TileToggleGroupItem = React.ComponentProps<typeof ToggleGroup.Item> & React.ComponentProps<typeof StyledTileToggleGroupItem>;
@@ -34,11 +34,13 @@ export declare const TopBar: {
34
34
  isRounded?: (boolean | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", boolean>>) | undefined;
35
35
  } & {
36
36
  as?: never;
37
- } & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "appearance" | "as" | "isRounded" | "size" | "theme">, "as" | "children" | "hasTooltip" | "label" | "tooltipSide" | keyof import("../..").NavigatorActions> & {
37
+ } & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "appearance" | "as" | "isRounded" | "size" | "theme">, "as" | "children" | "hasTooltip" | "href" | "label" | "reloadDocument" | "tooltipSide"> & {
38
38
  as?: React.ElementType;
39
39
  children: React.ReactNode;
40
+ href?: string;
40
41
  label: string;
41
- } & Omit<import("../..").OptionalTooltipWrapperProps, "label"> & import("../..").NavigatorActions, "children" | "size"> & {
42
+ reloadDocument?: boolean;
43
+ } & Omit<import("../..").OptionalTooltipWrapperProps, "label">, "children" | "size"> & {
42
44
  icon: React.FC<React.SVGProps<SVGSVGElement>>;
43
45
  label: string;
44
46
  }) => React.JSX.Element;