@easypost/easy-ui 1.0.0-alpha.52 → 1.0.0-alpha.54

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 (221) hide show
  1. package/Badge/index.js +14 -14
  2. package/Badge/index.mjs +14 -14
  3. package/Banner/index.js +5 -5
  4. package/Banner/index.mjs +5 -5
  5. package/Button/index.js +1 -1
  6. package/Button/index.mjs +1 -1
  7. package/CHANGELOG.md +17 -0
  8. package/Calendar/index.js +21 -21
  9. package/Calendar/index.mjs +20 -20
  10. package/Card/index.js +1 -1
  11. package/Card/index.mjs +1 -1
  12. package/Checkbox/index.js +1 -1
  13. package/Checkbox/index.mjs +1 -1
  14. package/CodeBlock/index.js +15 -15
  15. package/CodeBlock/index.mjs +15 -15
  16. package/CodeSnippet/index.js +1 -1
  17. package/CodeSnippet/index.mjs +1 -1
  18. package/DataGrid/ActionsCellContent.d.ts.map +1 -1
  19. package/DataGrid/index.js +77 -150
  20. package/DataGrid/index.mjs +74 -131
  21. package/Drawer/index.js +21 -21
  22. package/Drawer/index.mjs +21 -21
  23. package/DropdownButton/index.js +13 -13
  24. package/DropdownButton/index.mjs +13 -13
  25. package/EmptyStateCard/index.js +8 -8
  26. package/EmptyStateCard/index.mjs +8 -8
  27. package/FocusedProductLayout/index.js +23 -23
  28. package/FocusedProductLayout/index.mjs +23 -23
  29. package/FormLayout/index.js +5 -5
  30. package/FormLayout/index.mjs +5 -5
  31. package/HorizontalGrid/index.js +1 -1
  32. package/HorizontalGrid/index.mjs +1 -1
  33. package/HorizontalStack/index.js +1 -1
  34. package/HorizontalStack/index.mjs +1 -1
  35. package/Icon/index.js +1 -1
  36. package/Icon/index.mjs +1 -1
  37. package/IconButton/index.js +13 -13
  38. package/IconButton/index.mjs +13 -13
  39. package/InputField/index.js +1 -1
  40. package/InputField/index.mjs +1 -1
  41. package/KebabButton/KebabButton.d.ts +19 -0
  42. package/KebabButton/KebabButton.d.ts.map +1 -0
  43. package/KebabButton/KebabButton.stories.d.ts +7 -0
  44. package/KebabButton/KebabButton.stories.d.ts.map +1 -0
  45. package/KebabButton/KebabButton.test.d.ts +2 -0
  46. package/KebabButton/KebabButton.test.d.ts.map +1 -0
  47. package/KebabButton/index.d.ts +2 -0
  48. package/KebabButton/index.d.ts.map +1 -0
  49. package/KebabButton/index.js +4 -0
  50. package/KebabButton/index.mjs +4 -0
  51. package/Menu/index.js +1 -1
  52. package/Menu/index.mjs +1 -1
  53. package/Modal/index.js +22 -22
  54. package/Modal/index.mjs +22 -22
  55. package/NexusLayout/index.js +31 -31
  56. package/NexusLayout/index.mjs +31 -31
  57. package/Notification/index.js +1 -1
  58. package/Notification/index.mjs +1 -1
  59. package/Pagination/index.js +8 -8
  60. package/Pagination/index.mjs +8 -8
  61. package/PillGroup/index.js +30 -143
  62. package/PillGroup/index.mjs +19 -132
  63. package/ProductLayout/index.js +25 -25
  64. package/ProductLayout/index.mjs +25 -25
  65. package/Provider/index.js +2 -2
  66. package/Provider/index.mjs +2 -2
  67. package/RadioButtonGroup/RadioButtonGroup.d.ts +103 -0
  68. package/RadioButtonGroup/RadioButtonGroup.d.ts.map +1 -0
  69. package/RadioButtonGroup/RadioButtonGroup.stories.d.ts +11 -0
  70. package/RadioButtonGroup/RadioButtonGroup.stories.d.ts.map +1 -0
  71. package/RadioButtonGroup/RadioButtonGroup.test.d.ts +2 -0
  72. package/RadioButtonGroup/RadioButtonGroup.test.d.ts.map +1 -0
  73. package/RadioButtonGroup/index.d.ts +2 -0
  74. package/RadioButtonGroup/index.d.ts.map +1 -0
  75. package/RadioButtonGroup/index.js +262 -0
  76. package/RadioButtonGroup/index.mjs +262 -0
  77. package/RadioGroup/index.js +21 -21
  78. package/RadioGroup/index.mjs +21 -21
  79. package/SearchNav/index.js +30 -30
  80. package/SearchNav/index.mjs +30 -30
  81. package/SectionCard/index.js +7 -7
  82. package/SectionCard/index.mjs +7 -7
  83. package/Select/index.js +5 -5
  84. package/Select/index.mjs +5 -5
  85. package/SelectorErrorTooltip/index.js +1 -1
  86. package/SelectorErrorTooltip/index.mjs +1 -1
  87. package/Spinner/index.js +1 -1
  88. package/Spinner/index.mjs +1 -1
  89. package/SplitToggleCard/index.js +4 -4
  90. package/SplitToggleCard/index.mjs +4 -4
  91. package/Stepper/index.js +1 -1
  92. package/Stepper/index.mjs +1 -1
  93. package/TabNav/index.js +1 -1
  94. package/TabNav/index.mjs +1 -1
  95. package/TabPanels/index.js +4 -4
  96. package/TabPanels/index.mjs +4 -4
  97. package/Tabs/index.js +1 -1
  98. package/Tabs/index.mjs +1 -1
  99. package/Text/index.js +1 -1
  100. package/Text/index.mjs +1 -1
  101. package/TextField/index.js +1 -1
  102. package/TextField/index.mjs +1 -1
  103. package/Textarea/index.js +1 -1
  104. package/Textarea/index.mjs +1 -1
  105. package/Toggle/index.js +1 -1
  106. package/Toggle/index.mjs +1 -1
  107. package/ToggleCard/index.js +2 -2
  108. package/ToggleCard/index.mjs +2 -2
  109. package/Tooltip/index.js +1 -1
  110. package/Tooltip/index.mjs +1 -1
  111. package/UnstyledButton/UnstyledPressButton.d.ts.map +1 -0
  112. package/UnstyledButton/index.js +1 -1
  113. package/UnstyledButton/index.mjs +1 -1
  114. package/VerticalNav/index.js +25 -25
  115. package/VerticalNav/index.mjs +25 -25
  116. package/VerticalStack/index.js +1 -1
  117. package/VerticalStack/index.mjs +1 -1
  118. package/__chunks__/{Button-C8CAs9Ya.js → Button-D_Bk7BuN.js} +18 -18
  119. package/__chunks__/{Button-B-PwoC5y.mjs → Button-Dy9idhgT.mjs} +18 -18
  120. package/__chunks__/{Card-UU3JcpMA.js → Card-9RlZlFEC.js} +12 -12
  121. package/__chunks__/{Card-BWhI0hJm.mjs → Card-mxjU9S-F.mjs} +12 -12
  122. package/__chunks__/{Checkbox-BZqZjAnI.mjs → Checkbox-BgumKMXU.mjs} +24 -23
  123. package/__chunks__/{Checkbox-CqRLbwPQ.js → Checkbox-CBB8jlZw.js} +25 -24
  124. package/__chunks__/{CodeSnippet-pRcbJYFv.mjs → CodeSnippet-BjUoaeh9.mjs} +2 -2
  125. package/__chunks__/{CodeSnippet-B1oVvl-o.js → CodeSnippet-DVrkwOg4.js} +2 -2
  126. package/__chunks__/{FocusScope-CjqREKhC.mjs → FocusScope-C194OB-4.mjs} +85 -3
  127. package/__chunks__/{FocusScope-CoZUVDQG.js → FocusScope-DJer9ahG.js} +96 -14
  128. package/__chunks__/{HelpMenu-c9NnR9pL.js → HelpMenu-DF2Bx-bn.js} +7 -7
  129. package/__chunks__/{HelpMenu-BqXmt7b0.mjs → HelpMenu-m1qJ4EyP.mjs} +7 -7
  130. package/__chunks__/{HorizontalGrid-DdZMHCh6.mjs → HorizontalGrid-BYR8Gr-h.mjs} +1 -1
  131. package/__chunks__/{HorizontalGrid-LK3oV1Xf.js → HorizontalGrid-DuHNRhon.js} +1 -1
  132. package/__chunks__/{HorizontalStack-CyOBQGUF.js → HorizontalStack-By6XdGZh.js} +1 -1
  133. package/__chunks__/{HorizontalStack-Cj64cYl-.mjs → HorizontalStack-DaZakHYj.mjs} +1 -1
  134. package/__chunks__/{Icon-BmhO04p4.mjs → Icon-3zFwhVjn.mjs} +2 -2
  135. package/__chunks__/{Icon-vgTkejl_.js → Icon-BB9QecRC.js} +2 -2
  136. package/__chunks__/{InputField-nGv1FZJR.js → InputField-CHAxJwME.js} +8 -8
  137. package/__chunks__/{InputField-w-orC_z_.mjs → InputField-CdEl4M4-.mjs} +7 -7
  138. package/__chunks__/{InputIcon-D5WHF9JB.mjs → InputIcon--PdoGQOO.mjs} +25 -25
  139. package/__chunks__/{InputIcon-eg1DDtXb.js → InputIcon-oj25h1MN.js} +25 -25
  140. package/__chunks__/KebabButton-3bAqpgLu.js +121 -0
  141. package/__chunks__/KebabButton-fmLpDchx.mjs +106 -0
  142. package/__chunks__/{Menu-ComLF8Lu.js → Menu--B0Fn4Ol.js} +19 -19
  143. package/__chunks__/{Menu-Bo7BjljK.mjs → Menu-B95QYBVQ.mjs} +19 -19
  144. package/__chunks__/{Notification-B344rGS6.mjs → Notification-D15awRNG.mjs} +18 -18
  145. package/__chunks__/{Notification-BZ3ybUEX.js → Notification-DTb3bJn4.js} +22 -22
  146. package/__chunks__/{Overlay-Dz_4R38U.mjs → Overlay-BtzIt9Ka.mjs} +1 -1
  147. package/__chunks__/{Overlay-DBi2SVGv.js → Overlay-CUtfbILq.js} +1 -1
  148. package/__chunks__/{SelectOverlay-Dlh7kgJP.mjs → SelectOverlay-D39ws5R2.mjs} +29 -28
  149. package/__chunks__/{SelectOverlay-DQgtS85D.js → SelectOverlay-_dx1vHML.js} +30 -29
  150. package/__chunks__/{SelectorErrorTooltip-BkPBRxMN.mjs → SelectorErrorTooltip-D8y5kImH.mjs} +4 -4
  151. package/__chunks__/{SelectorErrorTooltip-PmNc0Njc.js → SelectorErrorTooltip-DhV9YtiA.js} +4 -4
  152. package/__chunks__/{Spinner-DzWjiJW-.js → Spinner-CVcjgzNy.js} +5 -5
  153. package/__chunks__/{Spinner-7zBK2Xm-.mjs → Spinner-CfniY1TS.mjs} +5 -5
  154. package/__chunks__/{Stepper-CSyqKD6E.mjs → Stepper-D_2YRENa.mjs} +27 -27
  155. package/__chunks__/{Stepper-D_Eb3lcZ.js → Stepper-E2li7kd2.js} +27 -27
  156. package/__chunks__/{TabNav-ihtxj9yI.mjs → TabNav-BgwlyiLE.mjs} +1 -1
  157. package/__chunks__/{TabNav-bXzfdbir.js → TabNav-C7_HMIZx.js} +1 -1
  158. package/__chunks__/{Tabs-CJ0TRL3H.mjs → Tabs-CwxqTiAn.mjs} +18 -18
  159. package/__chunks__/{Tabs-CmmF0WMQ.js → Tabs-WKn9NKJy.js} +18 -18
  160. package/__chunks__/{Text-DN9QVNH4.js → Text-CoOcI-ZA.js} +34 -34
  161. package/__chunks__/{Text-CLXCmUFd.mjs → Text-Dfn-c0km.mjs} +34 -34
  162. package/__chunks__/{Toggle-D4oyHZCf.js → Toggle-DYTnMD3t.js} +15 -14
  163. package/__chunks__/{Toggle-DytN4mU6.mjs → Toggle-qa6gbH9Q.mjs} +14 -13
  164. package/__chunks__/{Tooltip-BFf05Sd7.js → Tooltip-6vJKVOnU.js} +11 -11
  165. package/__chunks__/{Tooltip-BHGCJiVl.mjs → Tooltip-DnLwtGUV.mjs} +11 -11
  166. package/__chunks__/{UnstyledButton-DcvMv4SL.mjs → UnstyledButton-0v6TRjMY.mjs} +1 -1
  167. package/__chunks__/{UnstyledButton-DVpiY5Qh.js → UnstyledButton-BfeN_d1h.js} +1 -1
  168. package/__chunks__/{VerticalStack-CbamvYP6.js → VerticalStack-BUxIVmGp.js} +3 -3
  169. package/__chunks__/{VerticalStack-DOMDyLlK.mjs → VerticalStack-ac4iBcxE.mjs} +3 -3
  170. package/__chunks__/{VisuallyHidden-CBNzWIG8.mjs → VisuallyHidden-BsBkcHpw.mjs} +1 -1
  171. package/__chunks__/{VisuallyHidden-zJSJlhfQ.js → VisuallyHidden-CVfjb1YY.js} +1 -1
  172. package/__chunks__/{ariaHideOutside-qn3-pnlW.js → ariaHideOutside-2fSu0FuJ.js} +5 -5
  173. package/__chunks__/{ariaHideOutside-CGNrOhSc.mjs → ariaHideOutside-Dhj8j6Mb.mjs} +3 -3
  174. package/__chunks__/focusSafely-CZPj1Dug.js +14 -0
  175. package/__chunks__/focusSafely-DfpH-pE9.mjs +15 -0
  176. package/__chunks__/isVirtualEvent-BPCuFO54.mjs +74 -0
  177. package/__chunks__/isVirtualEvent-DwoP1rNI.js +73 -0
  178. package/__chunks__/{focusSafely-MxnwWbsu.mjs → runAfterTransition-B7Bfhj0D.mjs} +2 -13
  179. package/__chunks__/{focusSafely-BpCL6rxl.js → runAfterTransition-DtSqibrj.js} +0 -11
  180. package/__chunks__/{useButton-COCB0O4M.mjs → useButton-C6QFpa4j.mjs} +2 -2
  181. package/__chunks__/{useButton-hrdBTa5u.js → useButton-DVdJNlul.js} +2 -2
  182. package/__chunks__/{useDialog-47nl4w_8.mjs → useDialog-CfUEt_df.mjs} +3 -3
  183. package/__chunks__/{useDialog-DNGXm940.js → useDialog-CtMBWxF5.js} +3 -3
  184. package/__chunks__/{useEdgeInterceptors-CrrZ-iAb.js → useEdgeInterceptors-CQ1iontu.js} +5 -5
  185. package/__chunks__/{useEdgeInterceptors-D0TMU4bR.mjs → useEdgeInterceptors-DYwJNXXm.mjs} +5 -5
  186. package/__chunks__/{useFocus-Dk6g6k91.js → useFocus-B4oRb1dU.js} +3 -2
  187. package/__chunks__/{useFocus-DOcjAFnP.mjs → useFocus-By3Cx-xz.mjs} +2 -1
  188. package/__chunks__/{useFocusRing-CKgGPgoX.js → useFocusRing-DFRFvht_.js} +3 -3
  189. package/__chunks__/{useFocusRing-Cj5zef_6.mjs → useFocusRing-dRPhwlpK.mjs} +3 -3
  190. package/__chunks__/{useFocusVisible-DXAxI2Xj.mjs → useFocusVisible-BbEmluTm.mjs} +4 -75
  191. package/__chunks__/{useFocusVisible-DAg8LS6j.js → useFocusVisible-PBQuklI8.js} +13 -84
  192. package/__chunks__/{useFocusWithin-CxvNMoRn.js → useFocusWithin-C1ioGWec.js} +1 -1
  193. package/__chunks__/{useFocusWithin-Bg5BTlgA.mjs → useFocusWithin-krnNAgDY.mjs} +1 -1
  194. package/__chunks__/{useFocusable-Uo_zjP6s.mjs → useFocusable-B0naYTNU.mjs} +2 -2
  195. package/__chunks__/{useFocusable-By9yXfUQ.js → useFocusable-D0hhxIk-.js} +2 -2
  196. package/__chunks__/{useFormValidation-DOUyT2Mb.js → useFormValidation-C2DoIczP.js} +1 -1
  197. package/__chunks__/{useFormValidation-C_CD-7QE.mjs → useFormValidation-DAScndBq.mjs} +1 -1
  198. package/__chunks__/{useHasTabbableChild-DhoFI49t.mjs → useHasTabbableChild-9rS-nuc-.mjs} +1 -1
  199. package/__chunks__/{useHasTabbableChild-BCSKoUR_.js → useHasTabbableChild-BY-g4H3y.js} +1 -1
  200. package/__chunks__/{useHighlightSelectionDescription-P7rP7hnM.js → useHighlightSelectionDescription-CG5W6CIQ.js} +1 -1
  201. package/__chunks__/{useHighlightSelectionDescription-BGSwVQtc.mjs → useHighlightSelectionDescription-CPtYsCSQ.mjs} +1 -1
  202. package/__chunks__/{useModal-sVKQd6HX.mjs → useModal-DajWXu6g.mjs} +1 -1
  203. package/__chunks__/{useModal-BV6_Azqp.js → useModal-QwDRNW96.js} +2 -2
  204. package/__chunks__/{usePress-DjyN_yP2.js → usePress-BVH8whNd.js} +26 -26
  205. package/__chunks__/{usePress-CA-sH9oY.mjs → usePress-CiUDlxr6.mjs} +2 -2
  206. package/__chunks__/{useSelectableItem-Bgjo4Ulj.js → useSelectableItem-C0qCIU8l.js} +10 -8
  207. package/__chunks__/{useSelectableItem-Dn-hODEw.mjs → useSelectableItem-CHd6ksRw.mjs} +6 -4
  208. package/__chunks__/{useSelectableList-CjopKGbS.js → useSelectableList-CnP9hXkb.js} +1 -1
  209. package/__chunks__/{useSelectableList-DjrCndUM.mjs → useSelectableList-FvytdUu7.mjs} +1 -1
  210. package/__chunks__/{useToggle-qLiVQ6Y2.js → useToggle-DsYRac30.js} +2 -19
  211. package/__chunks__/{useToggle-V7BhKpNo.mjs → useToggle-YUgC8qn-.mjs} +3 -20
  212. package/__chunks__/useToggleState-CdbEMLRz.js +18 -0
  213. package/__chunks__/useToggleState-kFojjzgV.mjs +19 -0
  214. package/__chunks__/{useTriggerWidth-CI9YrWOP.mjs → useTriggerWidth-B3JINZlR.mjs} +4 -4
  215. package/__chunks__/{useTriggerWidth-Bj1hzfIg.js → useTriggerWidth-CcKoLR8z.js} +4 -4
  216. package/__chunks__/utils-DXO9zsKE.js +154 -0
  217. package/__chunks__/utils-Dm-0qf_-.mjs +155 -0
  218. package/package.json +2 -2
  219. package/style.css +1015 -968
  220. package/DataGrid/UnstyledPressButton.d.ts.map +0 -1
  221. /package/{DataGrid → UnstyledButton}/UnstyledPressButton.d.ts +0 -0
package/Provider/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const usePress = require("../__chunks__/usePress-DjyN_yP2.js");
3
+ const usePress = require("../__chunks__/usePress-BVH8whNd.js");
4
4
  const React = require("react");
5
- const Notification = require("../__chunks__/Notification-BZ3ybUEX.js");
5
+ const Notification = require("../__chunks__/Notification-DTb3bJn4.js");
6
6
  const Theme = require("../__chunks__/Theme-BTOgcCP2.js");
7
7
  function Provider({ children, theme, colorScheme, notificationPlacement, navigate, useHref }) {
8
8
  return React.createElement(EasyUIRouterProvider, {
@@ -1,6 +1,6 @@
1
- import { a as $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb } from "../__chunks__/usePress-CA-sH9oY.mjs";
1
+ import { a as $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb } from "../__chunks__/usePress-CiUDlxr6.mjs";
2
2
  import React__default from "react";
3
- import { b as NotificationProvider } from "../__chunks__/Notification-B344rGS6.mjs";
3
+ import { b as NotificationProvider } from "../__chunks__/Notification-D15awRNG.mjs";
4
4
  import { T as ThemeProvider } from "../__chunks__/Theme-CKTfAcvs.mjs";
5
5
  function Provider({ children, theme, colorScheme, notificationPlacement, navigate, useHref }) {
6
6
  return React__default.createElement(EasyUIRouterProvider, {
@@ -0,0 +1,103 @@
1
+ import React, { ReactNode } from "react";
2
+ import { Key } from "react-aria";
3
+ import { AriaLabelingProps } from "@react-types/shared";
4
+ import { ThemeColorAliases } from "../types";
5
+ export type RadioButtonGroupButtonProps = {
6
+ /**
7
+ * The label for the radio button.
8
+ */
9
+ children: ReactNode;
10
+ /**
11
+ * Whether the radio button is disabled or not.
12
+ */
13
+ isDisabled?: boolean;
14
+ /**
15
+ * An identifier for the item in selectedKeys.
16
+ */
17
+ id: string;
18
+ };
19
+ /**
20
+ * Represents an button in a `<RadioButtonGroup />`.
21
+ */
22
+ declare function RadioButtonGroupButton(props: RadioButtonGroupButtonProps): React.JSX.Element;
23
+ export type RadioButtonGroupProps = AriaLabelingProps & {
24
+ /**
25
+ * Color for the selected button in the group.
26
+ * @default "primary.500"
27
+ */
28
+ color?: ThemeColorAliases;
29
+ /**
30
+ * Whether single or multiple selection is enabled.
31
+ * @default "single"
32
+ */
33
+ selectionMode?: "single" | "multiple";
34
+ /**
35
+ * Whether the collection allows empty selection.
36
+ */
37
+ disallowEmptySelection?: boolean;
38
+ /**
39
+ * The currently selected keys in the collection (controlled).
40
+ */
41
+ selectedKeys?: Iterable<Key>;
42
+ /**
43
+ * The initial selected keys in the collection (uncontrolled).
44
+ */
45
+ defaultSelectedKeys?: Iterable<Key>;
46
+ /**
47
+ * Whether all items are disabled.
48
+ */
49
+ isDisabled?: boolean;
50
+ /**
51
+ * RadioButtonGroup Buttons
52
+ */
53
+ children: ReactNode;
54
+ /**
55
+ * Handler that is called when the selection changes.
56
+ */
57
+ onSelectionChange?: (keys: Set<Key>) => void;
58
+ };
59
+ /**
60
+ * A group of connected buttons that act as a radio group.
61
+ *
62
+ * @remarks
63
+ * Use a radio button group to toggle between two or more
64
+ * values for a given attribute.
65
+ *
66
+ * @example
67
+ * ```tsx
68
+ * <RadioButtonGroup defaultSelectedKeys={["first"]}>
69
+ * <RadioButtonGroup.Button id="first">First item</RadioButtonGroup.Button>
70
+ * <RadioButtonGroup.Button id="second">
71
+ * Second item
72
+ * </RadioButtonGroup.Button>
73
+ * </RadioButtonGroup>
74
+ * ```
75
+ *
76
+ * @example
77
+ * _Default selected keys:_
78
+ * ```tsx
79
+ * <RadioButtonGroup defaultSelectedKeys={["first"]}>
80
+ * <RadioButtonGroup.Button id="first">First item</RadioButtonGroup.Button>
81
+ * <RadioButtonGroup.Button id="second">
82
+ * Second item
83
+ * </RadioButtonGroup.Button>
84
+ * </RadioButtonGroup>
85
+ * ```
86
+ *
87
+ * @example
88
+ * _Controlled value:_
89
+ * ```tsx
90
+ * <RadioButtonGroup selectedKeys={["first"]} onSelectionChange={(value) => ()}>
91
+ * <RadioButtonGroup.Button id="first">First item</RadioButtonGroup.Button>
92
+ * <RadioButtonGroup.Button id="second">
93
+ * Second item
94
+ * </RadioButtonGroup.Button>
95
+ * </RadioButtonGroup>
96
+ * ```
97
+ */
98
+ export declare function RadioButtonGroup(props: RadioButtonGroupProps): React.JSX.Element;
99
+ export declare namespace RadioButtonGroup {
100
+ var Button: typeof RadioButtonGroupButton;
101
+ }
102
+ export {};
103
+ //# sourceMappingURL=RadioButtonGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RadioButtonGroup.d.ts","sourceRoot":"","sources":["../../src/RadioButtonGroup/RadioButtonGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAK7C,MAAM,MAAM,2BAA2B,GAAG;IACxC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF;;GAEG;AAEH,iBAAS,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,qBAYjE;AAED,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,GAAG;IACtD;;;OAGG;IACH,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IACtC;;OAEG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC;;OAEG;IACH,YAAY,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC7B;;OAEG;IACH,mBAAmB,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;IACpC;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;CAC9C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,qBA6B5D;yBA7Be,gBAAgB"}
@@ -0,0 +1,11 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import { RadioButtonGroup } from "./RadioButtonGroup";
3
+ type Story = StoryObj<typeof RadioButtonGroup>;
4
+ declare const meta: Meta<typeof RadioButtonGroup>;
5
+ export default meta;
6
+ export declare const Default: Story;
7
+ export declare const SelectionMode: Story;
8
+ export declare const EnabledDisabled: Story;
9
+ export declare const EnabledDisabledButton: Story;
10
+ export declare const DisallowEmptySelection: Story;
11
+ //# sourceMappingURL=RadioButtonGroup.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RadioButtonGroup.stories.d.ts","sourceRoot":"","sources":["../../src/RadioButtonGroup/RadioButtonGroup.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGlD,OAAO,EAAE,gBAAgB,EAAyB,MAAM,oBAAoB,CAAC;AAE7E,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE/C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,gBAAgB,CAcvC,CAAC;AAOF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,OAAO,EAAE,KAWrB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAc3B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAY7B,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,KAiBnC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KAYpC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=RadioButtonGroup.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RadioButtonGroup.test.d.ts","sourceRoot":"","sources":["../../src/RadioButtonGroup/RadioButtonGroup.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from "./RadioButtonGroup";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/RadioButtonGroup/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,262 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __spreadValues = (a, b) => {
10
+ for (var prop in b || (b = {}))
11
+ if (__hasOwnProp.call(b, prop))
12
+ __defNormalProp(a, prop, b[prop]);
13
+ if (__getOwnPropSymbols)
14
+ for (var prop of __getOwnPropSymbols(b)) {
15
+ if (__propIsEnum.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ }
18
+ return a;
19
+ };
20
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
21
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
22
+ const React = require("react");
23
+ const utils = require("../__chunks__/utils-DXO9zsKE.js");
24
+ const useControlledState = require("../__chunks__/useControlledState-mnKBd6Uc.js");
25
+ const useButton = require("../__chunks__/useButton-DVdJNlul.js");
26
+ const mergeProps = require("../__chunks__/mergeProps-DniMwM6P.js");
27
+ const FocusScope = require("../__chunks__/FocusScope-DJer9ahG.js");
28
+ const filterDOMProps = require("../__chunks__/filterDOMProps-D3iOHP0H.js");
29
+ const context = require("../__chunks__/context-D3NeXov7.js");
30
+ const useToggleState = require("../__chunks__/useToggleState-CdbEMLRz.js");
31
+ const useFocusRing = require("../__chunks__/useFocusRing-DFRFvht_.js");
32
+ const useHover = require("../__chunks__/useHover-BIKwjrCT.js");
33
+ const utilities_css = require("../utilities/css.js");
34
+ const Text = require("../__chunks__/Text-CoOcI-ZA.js");
35
+ function $ad999b7f496648d1$export$8deac67f4addf270(props) {
36
+ let { selectionMode = "single", disallowEmptySelection, isDisabled = false } = props;
37
+ let [selectedKeys, setSelectedKeys] = useControlledState.$458b0a5536c1a7cf$export$40bfa8c7b0832715(React.useMemo(() => props.selectedKeys ? new Set(props.selectedKeys) : void 0, [
38
+ props.selectedKeys
39
+ ]), React.useMemo(() => props.defaultSelectedKeys ? new Set(props.defaultSelectedKeys) : /* @__PURE__ */ new Set(), [
40
+ props.defaultSelectedKeys
41
+ ]), props.onSelectionChange);
42
+ return {
43
+ selectionMode,
44
+ isDisabled,
45
+ selectedKeys,
46
+ setSelectedKeys,
47
+ toggleKey(key) {
48
+ let keys;
49
+ if (selectionMode === "multiple") {
50
+ keys = new Set(selectedKeys);
51
+ if (keys.has(key) && (!disallowEmptySelection || keys.size > 1)) keys.delete(key);
52
+ else keys.add(key);
53
+ } else keys = new Set(selectedKeys.has(key) && !disallowEmptySelection ? [] : [
54
+ key
55
+ ]);
56
+ setSelectedKeys(keys);
57
+ },
58
+ setSelected(key, isSelected) {
59
+ if (isSelected !== selectedKeys.has(key)) this.toggleKey(key);
60
+ }
61
+ };
62
+ }
63
+ function $55f54f7887471b58$export$51e84d46ca0bc451(props, state, ref) {
64
+ const { isSelected } = state;
65
+ const { isPressed, buttonProps } = useButton.$701a24aa0da5b062$export$ea18c227d4417cc3(__spreadProps(__spreadValues({}, props), {
66
+ onPress: mergeProps.$ff5963eb1fccf552$export$e08e3b67e392101e(state.toggle, props.onPress)
67
+ }), ref);
68
+ return {
69
+ isPressed,
70
+ isSelected,
71
+ isDisabled: props.isDisabled || false,
72
+ buttonProps: mergeProps.$3ef42575df84b30b$export$9d1611c77c2fe928(buttonProps, {
73
+ "aria-pressed": isSelected
74
+ })
75
+ };
76
+ }
77
+ function $2680b1829e803644$export$fa142eb1681c520(props, ref) {
78
+ const { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, orientation = "horizontal" } = props;
79
+ let [isInToolbar, setInToolbar] = React.useState(false);
80
+ mergeProps.$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
81
+ var _ref_current_parentElement;
82
+ setInToolbar(!!(ref.current && ((_ref_current_parentElement = ref.current.parentElement) === null || _ref_current_parentElement === void 0 ? void 0 : _ref_current_parentElement.closest('[role="toolbar"]'))));
83
+ });
84
+ const { direction } = context.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
85
+ const shouldReverse = direction === "rtl" && orientation === "horizontal";
86
+ let focusManager = FocusScope.$9bf71ea28793e738$export$c5251b9e124bf29(ref);
87
+ const onKeyDown = (e) => {
88
+ if (!e.currentTarget.contains(e.target)) return;
89
+ if (orientation === "horizontal" && e.key === "ArrowRight" || orientation === "vertical" && e.key === "ArrowDown") {
90
+ if (shouldReverse) focusManager.focusPrevious();
91
+ else focusManager.focusNext();
92
+ } else if (orientation === "horizontal" && e.key === "ArrowLeft" || orientation === "vertical" && e.key === "ArrowUp") {
93
+ if (shouldReverse) focusManager.focusNext();
94
+ else focusManager.focusPrevious();
95
+ } else if (e.key === "Tab") {
96
+ e.stopPropagation();
97
+ lastFocused.current = document.activeElement;
98
+ if (e.shiftKey) focusManager.focusFirst();
99
+ else focusManager.focusLast();
100
+ return;
101
+ } else
102
+ return;
103
+ e.stopPropagation();
104
+ e.preventDefault();
105
+ };
106
+ const lastFocused = React.useRef(null);
107
+ const onBlur = (e) => {
108
+ if (!e.currentTarget.contains(e.relatedTarget) && !lastFocused.current) lastFocused.current = e.target;
109
+ };
110
+ const onFocus = (e) => {
111
+ var _ref_current;
112
+ if (lastFocused.current && !e.currentTarget.contains(e.relatedTarget) && ((_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.contains(e.target))) {
113
+ var _lastFocused_current;
114
+ (_lastFocused_current = lastFocused.current) === null || _lastFocused_current === void 0 ? void 0 : _lastFocused_current.focus();
115
+ lastFocused.current = null;
116
+ }
117
+ };
118
+ return {
119
+ toolbarProps: __spreadProps(__spreadValues({}, filterDOMProps.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
120
+ labelable: true
121
+ })), {
122
+ role: !isInToolbar ? "toolbar" : "group",
123
+ "aria-orientation": orientation,
124
+ "aria-label": ariaLabel,
125
+ "aria-labelledby": ariaLabel == null ? ariaLabelledBy : void 0,
126
+ onKeyDownCapture: !isInToolbar ? onKeyDown : void 0,
127
+ onFocusCapture: !isInToolbar ? onFocus : void 0,
128
+ onBlurCapture: !isInToolbar ? onBlur : void 0
129
+ })
130
+ };
131
+ }
132
+ function $4547d1bf40011fdf$export$dd5580ae642f110f(props, state, ref) {
133
+ let { isDisabled } = props;
134
+ let { toolbarProps } = $2680b1829e803644$export$fa142eb1681c520(props, ref);
135
+ return {
136
+ groupProps: __spreadProps(__spreadValues({}, toolbarProps), {
137
+ role: state.selectionMode === "single" ? "radiogroup" : toolbarProps.role,
138
+ "aria-disabled": isDisabled
139
+ })
140
+ };
141
+ }
142
+ function $4547d1bf40011fdf$export$bc53712daae3d6e6(props, state, ref) {
143
+ let toggleState = {
144
+ isSelected: state.selectedKeys.has(props.id),
145
+ setSelected(isSelected2) {
146
+ state.setSelected(props.id, isSelected2);
147
+ },
148
+ toggle() {
149
+ state.toggleKey(props.id);
150
+ }
151
+ };
152
+ let { isPressed, isSelected, isDisabled, buttonProps } = $55f54f7887471b58$export$51e84d46ca0bc451(__spreadProps(__spreadValues({}, props), {
153
+ id: void 0,
154
+ isDisabled: props.isDisabled || state.isDisabled
155
+ }), toggleState, ref);
156
+ if (state.selectionMode === "single") {
157
+ buttonProps.role = "radio";
158
+ buttonProps["aria-checked"] = toggleState.isSelected;
159
+ delete buttonProps["aria-pressed"];
160
+ }
161
+ return {
162
+ isPressed,
163
+ isSelected,
164
+ isDisabled,
165
+ buttonProps
166
+ };
167
+ }
168
+ const $84b7d8702d4ff4a8$export$298258635ae0dd97 = /* @__PURE__ */ React.createContext({});
169
+ const $84b7d8702d4ff4a8$export$a8a71863db173133 = /* @__PURE__ */ React.createContext(null);
170
+ function $84b7d8702d4ff4a8$var$ToggleButtonGroup(props, ref) {
171
+ [props, ref] = utils.$64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $84b7d8702d4ff4a8$export$298258635ae0dd97);
172
+ let state = $ad999b7f496648d1$export$8deac67f4addf270(props);
173
+ let { groupProps } = $4547d1bf40011fdf$export$dd5580ae642f110f(props, state, ref);
174
+ let renderProps = utils.$64fa3d84918910a7$export$4d86445c2cf5e3(__spreadProps(__spreadValues({}, props), {
175
+ values: {
176
+ isDisabled: state.isDisabled,
177
+ state
178
+ },
179
+ defaultClassName: "react-aria-ToggleButtonGroup"
180
+ }));
181
+ return /* @__PURE__ */ React.createElement("div", __spreadProps(__spreadValues(__spreadValues({}, groupProps), renderProps), {
182
+ ref,
183
+ slot: props.slot || void 0,
184
+ "data-orientation": props.orientation || "horizontal",
185
+ "data-disabled": props.isDisabled || void 0
186
+ }), /* @__PURE__ */ React.createElement($84b7d8702d4ff4a8$export$a8a71863db173133.Provider, {
187
+ value: state
188
+ }, renderProps.children));
189
+ }
190
+ const $84b7d8702d4ff4a8$export$40258cc1d95ff477 = /* @__PURE__ */ React.forwardRef($84b7d8702d4ff4a8$var$ToggleButtonGroup);
191
+ const $efde0372d7a700fe$export$43506d75ebd2e218 = /* @__PURE__ */ React.createContext({});
192
+ function $efde0372d7a700fe$var$ToggleButton(props, ref) {
193
+ [props, ref] = utils.$64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $efde0372d7a700fe$export$43506d75ebd2e218);
194
+ let groupState = React.useContext($84b7d8702d4ff4a8$export$a8a71863db173133);
195
+ let state = useToggleState.$3017fa7ffdddec74$export$8042c6c013fd5226(groupState && props.id != null ? {
196
+ isSelected: groupState.selectedKeys.has(props.id),
197
+ onChange(isSelected2) {
198
+ groupState.setSelected(props.id, isSelected2);
199
+ }
200
+ } : props);
201
+ let { buttonProps, isPressed, isSelected, isDisabled } = groupState && props.id != null ? $4547d1bf40011fdf$export$bc53712daae3d6e6(__spreadProps(__spreadValues({}, props), {
202
+ id: props.id
203
+ }), groupState, ref) : $55f54f7887471b58$export$51e84d46ca0bc451(__spreadProps(__spreadValues({}, props), {
204
+ id: props.id != null ? String(props.id) : void 0
205
+ }), state, ref);
206
+ let { focusProps, isFocused, isFocusVisible } = useFocusRing.$f7dceffc5ad7768b$export$4e328f61c538687f(props);
207
+ let { hoverProps, isHovered } = useHover.$6179b936705e76d3$export$ae780daf29e6d456(props);
208
+ let renderProps = utils.$64fa3d84918910a7$export$4d86445c2cf5e3(__spreadProps(__spreadValues({}, props), {
209
+ id: void 0,
210
+ values: {
211
+ isHovered,
212
+ isPressed,
213
+ isFocused,
214
+ isSelected: state.isSelected,
215
+ isFocusVisible,
216
+ isDisabled,
217
+ state
218
+ },
219
+ defaultClassName: "react-aria-ToggleButton"
220
+ }));
221
+ return /* @__PURE__ */ React.createElement("button", __spreadProps(__spreadValues(__spreadValues({}, mergeProps.$3ef42575df84b30b$export$9d1611c77c2fe928(buttonProps, focusProps, hoverProps)), renderProps), {
222
+ ref,
223
+ slot: props.slot || void 0,
224
+ "data-focused": isFocused || void 0,
225
+ "data-disabled": isDisabled || void 0,
226
+ "data-pressed": isPressed || void 0,
227
+ "data-selected": isSelected || void 0,
228
+ "data-hovered": isHovered || void 0,
229
+ "data-focus-visible": isFocusVisible || void 0
230
+ }));
231
+ }
232
+ const $efde0372d7a700fe$export$d2b052e7b4be1756 = /* @__PURE__ */ React.forwardRef($efde0372d7a700fe$var$ToggleButton);
233
+ const RadioButtonGroupButton$1 = "_RadioButtonGroupButton_mfbzo_5";
234
+ const styles = {
235
+ RadioButtonGroupButton: RadioButtonGroupButton$1
236
+ };
237
+ function RadioButtonGroupButton(props) {
238
+ const { children, isDisabled, id } = props;
239
+ return React.createElement($efde0372d7a700fe$export$d2b052e7b4be1756, {
240
+ className: utilities_css.classNames(styles.RadioButtonGroupButton),
241
+ isDisabled,
242
+ id
243
+ }, React.createElement(Text.Text, {
244
+ variant: "small_button"
245
+ }, children));
246
+ }
247
+ function RadioButtonGroup(props) {
248
+ const { color = "primary.500", children, onSelectionChange, selectedKeys, selectionMode = "single", disallowEmptySelection, defaultSelectedKeys, isDisabled } = props;
249
+ const style = __spreadValues({}, utilities_css.getComponentThemeToken("radio-button-group", "color", "color", color));
250
+ return React.createElement($84b7d8702d4ff4a8$export$40258cc1d95ff477, {
251
+ style,
252
+ className: styles.RadiobuttonGroup,
253
+ onSelectionChange,
254
+ selectedKeys,
255
+ selectionMode,
256
+ disallowEmptySelection,
257
+ defaultSelectedKeys,
258
+ isDisabled
259
+ }, children);
260
+ }
261
+ RadioButtonGroup.Button = RadioButtonGroupButton;
262
+ exports.RadioButtonGroup = RadioButtonGroup;