@persona/design-system 0.5.1 → 0.6.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 (164) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/{Breadcrumbs-ClKHNIr-.mjs → Breadcrumbs-CR-xdruP.mjs} +3 -3
  3. package/dist/{Breadcrumbs-ClKHNIr-.mjs.map → Breadcrumbs-CR-xdruP.mjs.map} +1 -1
  4. package/dist/Card2.d.mts +2 -2
  5. package/dist/{CardV2-CFTjYWoO.mjs → CardV2-CBjhsfrn.mjs} +5 -5
  6. package/dist/{CardV2-CFTjYWoO.mjs.map → CardV2-CBjhsfrn.mjs.map} +1 -1
  7. package/dist/{Checkbox-CyeitZ5q.mjs → Checkbox-BHZ7c7_6.mjs} +2 -2
  8. package/dist/{Checkbox-CyeitZ5q.mjs.map → Checkbox-BHZ7c7_6.mjs.map} +1 -1
  9. package/dist/{Combobox-Ddas5FN-.mjs → Combobox-BCYLeZDP.mjs} +6 -6
  10. package/dist/{Combobox-Ddas5FN-.mjs.map → Combobox-BCYLeZDP.mjs.map} +1 -1
  11. package/dist/{Combobox-DX4DLe1b.d.mts → Combobox-DMN3nc7E.d.mts} +3 -3
  12. package/dist/Combobox.d.mts +2 -2
  13. package/dist/{ComboboxBase-Ds_i3K2m.d.mts → ComboboxBase-DBLJYQrh.d.mts} +2 -2
  14. package/dist/ComboboxBase.d.mts +1 -1
  15. package/dist/{ComboboxMultiSelect-S6oFJcOS.d.mts → ComboboxMultiSelect-CZRLyM_y.d.mts} +2 -2
  16. package/dist/ComboboxMultiSelect.d.mts +1 -1
  17. package/dist/{ComboboxSingleSelect-DFzCwW1Y.d.mts → ComboboxSingleSelect-BS6pZpU_.d.mts} +3 -3
  18. package/dist/ComboboxSingleSelect.d.mts +1 -1
  19. package/dist/{ConfigFormGroup-DcsM-u8o.mjs → ConfigFormGroup-BnRDAs0j.mjs} +2 -2
  20. package/dist/{ConfigFormGroup-DcsM-u8o.mjs.map → ConfigFormGroup-BnRDAs0j.mjs.map} +1 -1
  21. package/dist/{DatePicker-DTT-mJ8r.mjs → DatePicker-BcjrAr7o.mjs} +6 -6
  22. package/dist/{DatePicker-DTT-mJ8r.mjs.map → DatePicker-BcjrAr7o.mjs.map} +1 -1
  23. package/dist/{DropdownButton-DV5if_uG.mjs → DropdownButton-l-fzkb5_.mjs} +2 -2
  24. package/dist/{DropdownButton-DV5if_uG.mjs.map → DropdownButton-l-fzkb5_.mjs.map} +1 -1
  25. package/dist/DropdownButton.d.mts +1 -1
  26. package/dist/{DropdownMenu-CbhEzWy1.d.mts → DropdownMenu-Bg68vvxx.d.mts} +2 -2
  27. package/dist/{DropdownMenu-DovtBJBs.mjs → DropdownMenu-C0WK4bM0.mjs} +2 -2
  28. package/dist/{DropdownMenu-DovtBJBs.mjs.map → DropdownMenu-C0WK4bM0.mjs.map} +1 -1
  29. package/dist/DropdownMenu.d.mts +1 -1
  30. package/dist/{FormControl-BvRzRknE.mjs → FormControl-BzMbbgr0.mjs} +3 -3
  31. package/dist/{FormControl-BvRzRknE.mjs.map → FormControl-BzMbbgr0.mjs.map} +1 -1
  32. package/dist/{FormField-BDJ6zNE6.mjs → FormField-2sNS5PzN.mjs} +14 -14
  33. package/dist/{FormField-BDJ6zNE6.mjs.map → FormField-2sNS5PzN.mjs.map} +1 -1
  34. package/dist/{HoverCopyableField-WP6DPjy1.mjs → HoverCopyableField-CeJ0UP87.mjs} +2 -2
  35. package/dist/{HoverCopyableField-WP6DPjy1.mjs.map → HoverCopyableField-CeJ0UP87.mjs.map} +1 -1
  36. package/dist/InlineCombobox.d.mts +1 -1
  37. package/dist/InlineInput.d.mts +1 -1
  38. package/dist/{Input-DbfwNzS_.mjs → Input-DGWThZlt.mjs} +2 -2
  39. package/dist/{Input-DbfwNzS_.mjs.map → Input-DGWThZlt.mjs.map} +1 -1
  40. package/dist/{ListBox-P1eTecdo.d.mts → ListBox-Awtw7Xy_.d.mts} +2 -2
  41. package/dist/{ListBox-CXh9Jfb-.mjs → ListBox-DqII8giL.mjs} +6 -6
  42. package/dist/{ListBox-CXh9Jfb-.mjs.map → ListBox-DqII8giL.mjs.map} +1 -1
  43. package/dist/ListBox.d.mts +1 -1
  44. package/dist/ListBoxField.d.mts +2 -2
  45. package/dist/{LoadingShimmer-DeVCDCjT.mjs → LoadingShimmer-ZyzJs5Vi.mjs} +1 -1
  46. package/dist/{LoadingShimmer-DeVCDCjT.mjs.map → LoadingShimmer-ZyzJs5Vi.mjs.map} +1 -1
  47. package/dist/{LogicRow-DtZYOzQ8.d.mts → LogicRow-DIn0gLEq.d.mts} +2 -2
  48. package/dist/LogicRow.d.mts +1 -1
  49. package/dist/{Menu-CAGTCBqj.mjs → Menu-CeV3lL2g.mjs} +1 -1
  50. package/dist/{Menu-CAGTCBqj.mjs.map → Menu-CeV3lL2g.mjs.map} +1 -1
  51. package/dist/{Menu-_loh8pe3.d.mts → Menu-DdHN-drQ.d.mts} +2 -2
  52. package/dist/Menu.d.mts +1 -1
  53. package/dist/{PageHeader-wpvRRTaa.mjs → PageHeader-UI_6yImi.mjs} +2 -2
  54. package/dist/{PageHeader-wpvRRTaa.mjs.map → PageHeader-UI_6yImi.mjs.map} +1 -1
  55. package/dist/{Pagination-wjr3W3xf.mjs → Pagination-DgA0U1fa.mjs} +3 -3
  56. package/dist/{Pagination-wjr3W3xf.mjs.map → Pagination-DgA0U1fa.mjs.map} +1 -1
  57. package/dist/{Pii-Bm-qkweh.mjs → Pii-bxG0qu3t.mjs} +1 -1
  58. package/dist/{Pii-Bm-qkweh.mjs.map → Pii-bxG0qu3t.mjs.map} +1 -1
  59. package/dist/{Popover-DUyzmq3e.mjs → Popover-UiOUt5up.mjs} +1 -1
  60. package/dist/{Popover-DUyzmq3e.mjs.map → Popover-UiOUt5up.mjs.map} +1 -1
  61. package/dist/{Radio-CkugnL91.mjs → Radio-BrQzZhwP.mjs} +2 -2
  62. package/dist/{Radio-CkugnL91.mjs.map → Radio-BrQzZhwP.mjs.map} +1 -1
  63. package/dist/{RadioGroup-8dI8gljw.mjs → RadioGroup-Bl9oXPIo.mjs} +2 -2
  64. package/dist/{RadioGroup-8dI8gljw.mjs.map → RadioGroup-Bl9oXPIo.mjs.map} +1 -1
  65. package/dist/{SegmentedControl-DQE0hN57.mjs → SegmentedControl-BozydMtT.mjs} +2 -2
  66. package/dist/{SegmentedControl-DQE0hN57.mjs.map → SegmentedControl-BozydMtT.mjs.map} +1 -1
  67. package/dist/{Select-D9OVjzPR.mjs → Select-CktsIrzf.mjs} +4 -4
  68. package/dist/{Select-D9OVjzPR.mjs.map → Select-CktsIrzf.mjs.map} +1 -1
  69. package/dist/{Select-wnr46ROZ.d.mts → Select-yPqzqe5k.d.mts} +2 -2
  70. package/dist/Select.d.mts +1 -1
  71. package/dist/{Spinner-gBNWIwOn.mjs → Spinner-Dpw3-3JS.mjs} +1 -1
  72. package/dist/{Spinner-gBNWIwOn.mjs.map → Spinner-Dpw3-3JS.mjs.map} +1 -1
  73. package/dist/{TabBar-B__54oO3.mjs → TabBar-Dw3xE_B-.mjs} +1 -1
  74. package/dist/{TabBar-B__54oO3.mjs.map → TabBar-Dw3xE_B-.mjs.map} +1 -1
  75. package/dist/{Table-CqIi5mVF.mjs → Table-ELLvSvH4.mjs} +2 -2
  76. package/dist/{Table-CqIi5mVF.mjs.map → Table-ELLvSvH4.mjs.map} +1 -1
  77. package/dist/{TableBox-C-8RxZT4.mjs → TableBox-CCfha6G2.mjs} +7 -7
  78. package/dist/{TableBox-C-8RxZT4.mjs.map → TableBox-CCfha6G2.mjs.map} +1 -1
  79. package/dist/TableBox.d.mts +1 -1
  80. package/dist/{TableBoxCell-CQ3zT1jG.d.mts → TableBoxCell-xnzuHPV1.d.mts} +4 -4
  81. package/dist/TableBoxCell.d.mts +1 -1
  82. package/dist/TableBoxField.d.mts +3 -3
  83. package/dist/{TableBoxRow-ClK2pceY.d.mts → TableBoxRow-BBDMh5xl.d.mts} +2 -2
  84. package/dist/TableBoxRow.d.mts +1 -1
  85. package/dist/{TableBoxRowActions-CoF3DuUQ.d.mts → TableBoxRowActions-DCfol4GC.d.mts} +2 -2
  86. package/dist/TableBoxRowActions.d.mts +1 -1
  87. package/dist/{TableControls-DplArh-9.mjs → TableControls-C-yb5EYU.mjs} +11 -11
  88. package/dist/{TableControls-DplArh-9.mjs.map → TableControls-C-yb5EYU.mjs.map} +1 -1
  89. package/dist/{TechnicalSticker-D6MO_IfT.mjs → TechnicalSticker-CLbNA0kp.mjs} +1 -1
  90. package/dist/{TechnicalSticker-D6MO_IfT.mjs.map → TechnicalSticker-CLbNA0kp.mjs.map} +1 -1
  91. package/dist/{TextArea-CYirq-B2.mjs → TextArea-oAK1DKId.mjs} +2 -2
  92. package/dist/{TextArea-CYirq-B2.mjs.map → TextArea-oAK1DKId.mjs.map} +1 -1
  93. package/dist/{Toggle-CqgFNIYS.mjs → Toggle-DZzirZ8p.mjs} +2 -2
  94. package/dist/{Toggle-CqgFNIYS.mjs.map → Toggle-DZzirZ8p.mjs.map} +1 -1
  95. package/dist/components/BottomPanel/index.mjs +1 -1
  96. package/dist/components/Breadcrumbs/index.mjs +1 -1
  97. package/dist/components/ButtonGroup/index.mjs +1 -1
  98. package/dist/components/CardV2/index.mjs +1 -1
  99. package/dist/components/Checkbox/index.mjs +1 -1
  100. package/dist/components/Combobox/index.d.mts +2 -2
  101. package/dist/components/Combobox/index.mjs +1 -1
  102. package/dist/components/ConfigFormGroup/index.mjs +2 -2
  103. package/dist/components/DataTable/TableControls/index.mjs +1 -1
  104. package/dist/components/DataTable/index.mjs +7 -7
  105. package/dist/components/DataTable/types.d.mts +1 -1
  106. package/dist/components/DatePicker/index.mjs +1 -1
  107. package/dist/components/DropdownButton/index.mjs +1 -1
  108. package/dist/components/DropdownMenu/index.d.mts +1 -1
  109. package/dist/components/DropdownMenu/index.mjs +1 -1
  110. package/dist/components/FormControl/index.mjs +2 -2
  111. package/dist/components/FormField/index.mjs +1 -1
  112. package/dist/components/HoverCopyableField/index.mjs +1 -1
  113. package/dist/components/ImageTile/index.mjs +3 -3
  114. package/dist/components/Input/index.mjs +1 -1
  115. package/dist/components/ListBox/index.d.mts +3 -3
  116. package/dist/components/ListBox/index.mjs +1 -1
  117. package/dist/components/LoadingShimmer/index.mjs +1 -1
  118. package/dist/components/MaskedInput/index.mjs +1 -1
  119. package/dist/components/Menu/index.d.mts +1 -1
  120. package/dist/components/Menu/index.mjs +1 -1
  121. package/dist/components/Modal/index.mjs +3 -65
  122. package/dist/components/Modal/index.mjs.map +1 -1
  123. package/dist/components/PageHeader/index.mjs +1 -1
  124. package/dist/components/Pagination/index.mjs +1 -1
  125. package/dist/components/Pii/index.mjs +1 -1
  126. package/dist/components/Popover/index.mjs +1 -1
  127. package/dist/components/Radio/index.mjs +1 -1
  128. package/dist/components/RadioGroup/index.mjs +1 -1
  129. package/dist/components/RightPanel/index.mjs +1 -1
  130. package/dist/components/SegmentedControl/index.mjs +1 -1
  131. package/dist/components/Select/index.d.mts +1 -1
  132. package/dist/components/Select/index.mjs +1 -1
  133. package/dist/components/Slider/index.mjs +1 -1
  134. package/dist/components/SmartTextInput/parser/method-chain/grammar.pegjs +219 -0
  135. package/dist/components/SmartTextInput/parser/smart-text/grammar.pegjs +154 -0
  136. package/dist/components/Spinner/index.mjs +1 -1
  137. package/dist/components/TabBar/index.mjs +1 -1
  138. package/dist/components/Table/index.mjs +1 -1
  139. package/dist/components/TableBox/index.d.mts +1 -1
  140. package/dist/components/TableBox/index.mjs +1 -1
  141. package/dist/components/TechnicalSticker/index.mjs +1 -1
  142. package/dist/components/TextArea/index.mjs +1 -1
  143. package/dist/components/Toggle/index.mjs +1 -1
  144. package/dist/fieldPickerOptions.d.mts +1 -1
  145. package/dist/{index-BJr_obTf.d.mts → index-CBWvk6Ch.d.mts} +3 -3
  146. package/dist/inputFields.d.mts +3 -3
  147. package/dist/{intersperse-CRUnXmnu.mjs → intersperse-vOYvFOfF.mjs} +1 -1
  148. package/dist/{intersperse-CRUnXmnu.mjs.map → intersperse-vOYvFOfF.mjs.map} +1 -1
  149. package/dist/lib/useModalInsetRight.mjs +69 -0
  150. package/dist/lib/useModalInsetRight.mjs.map +1 -0
  151. package/dist/patterns/LayoutLoadingShimmer/index.mjs +4 -4
  152. package/dist/useComboboxFooterAction.d.mts +1 -1
  153. package/dist/{useFormField-C-K1lgmv.mjs → useFormField-DhYd6bNn.mjs} +2 -2
  154. package/dist/{useFormField-C-K1lgmv.mjs.map → useFormField-DhYd6bNn.mjs.map} +1 -1
  155. package/dist/{useFormGroup-y-duFylq.mjs → useFormGroup-DWVW7A9f.mjs} +1 -1
  156. package/dist/{useFormGroup-y-duFylq.mjs.map → useFormGroup-DWVW7A9f.mjs.map} +1 -1
  157. package/dist/useTruncation.d.mts +1 -1
  158. package/llms.txt +1 -0
  159. package/package.json +3 -1
  160. package/skills/design-system-component-authoring/SKILL.md +79 -0
  161. package/skills/design-system-component-authoring/clarifying-scope.md +18 -0
  162. package/skills/design-system-component-authoring/component-conventions.md +70 -0
  163. package/skills/design-system-component-authoring/prop-interface-patterns.md +30 -0
  164. /package/dist/{useModalInsetRight.d.mts → lib/useModalInsetRight.d.mts} +0 -0
@@ -1,5 +1,5 @@
1
- import { n as ComboboxMultiSelectProps } from "./ComboboxMultiSelect-S6oFJcOS.mjs";
2
- import { n as ComboboxSingleSelectProps } from "./ComboboxSingleSelect-DFzCwW1Y.mjs";
1
+ import { n as ComboboxMultiSelectProps } from "./ComboboxMultiSelect-CZRLyM_y.mjs";
2
+ import { n as ComboboxSingleSelectProps } from "./ComboboxSingleSelect-BS6pZpU_.mjs";
3
3
 
4
4
  //#region components/Combobox/Combobox.d.ts
5
5
  type ComboboxProps<T = string> = ComboboxSingleSelectProps<T> | ComboboxMultiSelectProps<T>;
@@ -8,4 +8,4 @@ declare const Combobox: <T = string>(props: ComboboxProps<T> & {
8
8
  }) => React.ReactElement;
9
9
  //#endregion
10
10
  export { ComboboxProps as n, Combobox as t };
11
- //# sourceMappingURL=Combobox-DX4DLe1b.d.mts.map
11
+ //# sourceMappingURL=Combobox-DMN3nc7E.d.mts.map
@@ -1,3 +1,3 @@
1
- import { t as CaretButton } from "./ComboboxBase-Ds_i3K2m.mjs";
2
- import { n as ComboboxProps, t as Combobox } from "./Combobox-DX4DLe1b.mjs";
1
+ import { t as CaretButton } from "./ComboboxBase-DBLJYQrh.mjs";
2
+ import { n as ComboboxProps, t as Combobox } from "./Combobox-DMN3nc7E.mjs";
3
3
  export { CaretButton, Combobox, Combobox as default, ComboboxProps };
@@ -1,5 +1,5 @@
1
1
  import { c as ParagraphProps, u as SpanProps } from "./Text-tgFz40XD.mjs";
2
- import { t as FloatingCard } from "./Menu-_loh8pe3.mjs";
2
+ import { t as FloatingCard } from "./Menu-DdHN-drQ.mjs";
3
3
  import { o as StickerProps } from "./Sticker-qvWkqEMw.mjs";
4
4
  import { n as InputSizes } from "./input-DN_8iHVD.mjs";
5
5
  import { Spacing } from "@persona/design-tokens";
@@ -352,4 +352,4 @@ declare function DropdownPortalWrapper({
352
352
  }: DropdownPortalWrapperProps): _$react_jsx_runtime0.JSX.Element;
353
353
  //#endregion
354
354
  export { isNestedGroup as A, SearchInputContainer as C, flattenOptions as D, flattenLeafOptions as E, renderOptionsWithGroups as M, useDropdownPosition as N, getNavigableItemsAtLevel as O, useFilteredOptions as P, SearchInput as S, containsNestedGroup as T, LoadingContainer as _, ComboboxOptionGroup as a, OptionLabel as b, Description as c, DropdownPortalWrapperProps as d, EmptyState as f, LeafOptionEntry as g, InputContainer as h, ComboboxOption as i, isOptionGroup as j, getOptionsAtPath as k, DropdownContainer as l, FooterActionRow as m, ComboboxBaseProps as n, ComboboxOptionsOrGroups as o, FooterAction as p, ComboboxInput as r, Container as s, CaretButton as t, DropdownPortalWrapper as u, MAX_DROPDOWN_HEIGHT as v, buildVirtualRows as w, ScrollableMenuList as x, NavigableItem as y };
355
- //# sourceMappingURL=ComboboxBase-Ds_i3K2m.d.mts.map
355
+ //# sourceMappingURL=ComboboxBase-DBLJYQrh.d.mts.map
@@ -1,2 +1,2 @@
1
- import { A as isNestedGroup, C as SearchInputContainer, D as flattenOptions, E as flattenLeafOptions, M as renderOptionsWithGroups, N as useDropdownPosition, O as getNavigableItemsAtLevel, P as useFilteredOptions, S as SearchInput, T as containsNestedGroup, _ as LoadingContainer, a as ComboboxOptionGroup, b as OptionLabel, c as Description, d as DropdownPortalWrapperProps, f as EmptyState, g as LeafOptionEntry, h as InputContainer, i as ComboboxOption, j as isOptionGroup, k as getOptionsAtPath, l as DropdownContainer, m as FooterActionRow, n as ComboboxBaseProps, o as ComboboxOptionsOrGroups, p as FooterAction, r as ComboboxInput, s as Container, t as CaretButton, u as DropdownPortalWrapper, v as MAX_DROPDOWN_HEIGHT, w as buildVirtualRows, x as ScrollableMenuList, y as NavigableItem } from "./ComboboxBase-Ds_i3K2m.mjs";
1
+ import { A as isNestedGroup, C as SearchInputContainer, D as flattenOptions, E as flattenLeafOptions, M as renderOptionsWithGroups, N as useDropdownPosition, O as getNavigableItemsAtLevel, P as useFilteredOptions, S as SearchInput, T as containsNestedGroup, _ as LoadingContainer, a as ComboboxOptionGroup, b as OptionLabel, c as Description, d as DropdownPortalWrapperProps, f as EmptyState, g as LeafOptionEntry, h as InputContainer, i as ComboboxOption, j as isOptionGroup, k as getOptionsAtPath, l as DropdownContainer, m as FooterActionRow, n as ComboboxBaseProps, o as ComboboxOptionsOrGroups, p as FooterAction, r as ComboboxInput, s as Container, t as CaretButton, u as DropdownPortalWrapper, v as MAX_DROPDOWN_HEIGHT, w as buildVirtualRows, x as ScrollableMenuList, y as NavigableItem } from "./ComboboxBase-DBLJYQrh.mjs";
2
2
  export { CaretButton, ComboboxBaseProps, ComboboxInput, ComboboxOption, ComboboxOptionGroup, ComboboxOptionsOrGroups, Container, Description, DropdownContainer, DropdownPortalWrapper, DropdownPortalWrapperProps, EmptyState, FooterAction, FooterActionRow, InputContainer, LeafOptionEntry, LoadingContainer, MAX_DROPDOWN_HEIGHT, NavigableItem, OptionLabel, ScrollableMenuList, SearchInput, SearchInputContainer, buildVirtualRows, containsNestedGroup, flattenLeafOptions, flattenOptions, getNavigableItemsAtLevel, getOptionsAtPath, isNestedGroup, isOptionGroup, renderOptionsWithGroups, useDropdownPosition, useFilteredOptions };
@@ -1,4 +1,4 @@
1
- import { n as ComboboxBaseProps } from "./ComboboxBase-Ds_i3K2m.mjs";
1
+ import { n as ComboboxBaseProps } from "./ComboboxBase-DBLJYQrh.mjs";
2
2
 
3
3
  //#region components/Combobox/ComboboxMultiSelect.d.ts
4
4
  interface ComboboxMultiSelectProps<T = string> extends ComboboxBaseProps<T> {
@@ -44,4 +44,4 @@ declare const ComboboxMultiSelect: <T = string>(props: ComboboxMultiSelectProps<
44
44
  }) => React.ReactElement;
45
45
  //#endregion
46
46
  export { ComboboxMultiSelectProps as n, ComboboxMultiSelect as t };
47
- //# sourceMappingURL=ComboboxMultiSelect-S6oFJcOS.d.mts.map
47
+ //# sourceMappingURL=ComboboxMultiSelect-CZRLyM_y.d.mts.map
@@ -1,2 +1,2 @@
1
- import { n as ComboboxMultiSelectProps, t as ComboboxMultiSelect } from "./ComboboxMultiSelect-S6oFJcOS.mjs";
1
+ import { n as ComboboxMultiSelectProps, t as ComboboxMultiSelect } from "./ComboboxMultiSelect-CZRLyM_y.mjs";
2
2
  export { ComboboxMultiSelect, ComboboxMultiSelect as default, ComboboxMultiSelectProps };
@@ -1,6 +1,6 @@
1
- import { u as MenuItemType } from "./Menu-_loh8pe3.mjs";
1
+ import { u as MenuItemType } from "./Menu-DdHN-drQ.mjs";
2
2
  import { n as InputSizes } from "./input-DN_8iHVD.mjs";
3
- import { n as ComboboxBaseProps } from "./ComboboxBase-Ds_i3K2m.mjs";
3
+ import { n as ComboboxBaseProps } from "./ComboboxBase-DBLJYQrh.mjs";
4
4
  import * as _$styled_components0 from "styled-components";
5
5
 
6
6
  //#region components/Combobox/ComboboxSingleSelect.d.ts
@@ -32,4 +32,4 @@ declare const ComboboxSingleSelect: <T = string>(props: ComboboxSingleSelectProp
32
32
  }) => React.ReactElement;
33
33
  //#endregion
34
34
  export { ComboboxSingleSelectProps as n, StyledMenuItem as r, ComboboxSingleSelect as t };
35
- //# sourceMappingURL=ComboboxSingleSelect-DFzCwW1Y.d.mts.map
35
+ //# sourceMappingURL=ComboboxSingleSelect-BS6pZpU_.d.mts.map
@@ -1,2 +1,2 @@
1
- import { n as ComboboxSingleSelectProps, r as StyledMenuItem, t as ComboboxSingleSelect } from "./ComboboxSingleSelect-DFzCwW1Y.mjs";
1
+ import { n as ComboboxSingleSelectProps, r as StyledMenuItem, t as ComboboxSingleSelect } from "./ComboboxSingleSelect-BS6pZpU_.mjs";
2
2
  export { ComboboxSingleSelect, ComboboxSingleSelect as default, ComboboxSingleSelectProps, StyledMenuItem };
@@ -1,5 +1,5 @@
1
1
  import { a as styled } from "./styledComponentsInterop-NxwFjeA4.mjs";
2
- import { t as FormGroupContext } from "./useFormGroup-y-duFylq.mjs";
2
+ import { t as FormGroupContext } from "./useFormGroup-DWVW7A9f.mjs";
3
3
  import { Spacing } from "@persona/design-tokens";
4
4
  import { forwardRef } from "react";
5
5
  import { jsx } from "react/jsx-runtime";
@@ -25,4 +25,4 @@ const ConfigFormGroup = forwardRef(function ConfigFormGroup(props, ref) {
25
25
  //#endregion
26
26
  export { ConfigFormGroup as t };
27
27
 
28
- //# sourceMappingURL=ConfigFormGroup-DcsM-u8o.mjs.map
28
+ //# sourceMappingURL=ConfigFormGroup-BnRDAs0j.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigFormGroup-DcsM-u8o.mjs","names":[],"sources":["../components/ConfigFormGroup/ConfigFormGroup.tsx"],"sourcesContent":["import { type ComponentPropsWithoutRef, forwardRef } from 'react';\nimport styled from 'styled-components';\n\nimport { Spacing } from '@persona/design-tokens';\n\nimport { FormGroupContext } from './useFormGroup';\n\n/**\n * Use to wrap a group of config fields.\n * Provides consistent spacing between the fields.\n */\nconst FormGroup = styled.div`\n display: flex;\n flex-direction: column;\n gap: ${Spacing[5]};\n`;\n\nexport const ConfigFormGroup = forwardRef<HTMLDivElement, ComponentPropsWithoutRef<'div'>>(\n function ConfigFormGroup(props, ref) {\n return (\n <FormGroupContext.Provider value={{ configField: true }}>\n <FormGroup ref={ref} {...props} />\n </FormGroupContext.Provider>\n );\n },\n);\n\nexport default ConfigFormGroup;\n"],"mappings":";;;;;;;;;;AAWA,MAAM,YAAY,OAAO,GAAG;;;SAGnB,QAAQ,GAAG;;AAGpB,MAAa,kBAAkB,WAC7B,SAAS,gBAAgB,OAAO,KAAK;AACnC,QACE,oBAAC,iBAAiB,UAAlB;EAA2B,OAAO,EAAE,aAAa,MAAM;YACrD,oBAAC,WAAD;GAAgB;GAAK,GAAI;GAAS,CAAA;EACR,CAAA;EAGjC"}
1
+ {"version":3,"file":"ConfigFormGroup-BnRDAs0j.mjs","names":[],"sources":["../components/ConfigFormGroup/ConfigFormGroup.tsx"],"sourcesContent":["import { type ComponentPropsWithoutRef, forwardRef } from 'react';\nimport styled from 'styled-components';\n\nimport { Spacing } from '@persona/design-tokens';\n\nimport { FormGroupContext } from './useFormGroup';\n\n/**\n * Use to wrap a group of config fields.\n * Provides consistent spacing between the fields.\n */\nconst FormGroup = styled.div`\n display: flex;\n flex-direction: column;\n gap: ${Spacing[5]};\n`;\n\nexport const ConfigFormGroup = forwardRef<HTMLDivElement, ComponentPropsWithoutRef<'div'>>(\n function ConfigFormGroup(props, ref) {\n return (\n <FormGroupContext.Provider value={{ configField: true }}>\n <FormGroup ref={ref} {...props} />\n </FormGroupContext.Provider>\n );\n },\n);\n\nexport default ConfigFormGroup;\n"],"mappings":";;;;;;;;;;AAWA,MAAM,YAAY,OAAO,GAAG;;;SAGnB,QAAQ,GAAG;;AAGpB,MAAa,kBAAkB,WAC7B,SAAS,gBAAgB,OAAO,KAAK;AACnC,QACE,oBAAC,iBAAiB,UAAlB;EAA2B,OAAO,EAAE,aAAa,MAAM;YACrD,oBAAC,WAAD;GAAgB;GAAK,GAAI;GAAS,CAAA;EACR,CAAA;EAGjC"}
@@ -7,10 +7,10 @@ import { Z_INDICES } from "./lib/zindex.mjs";
7
7
  import { focusWithinOutline } from "./mixins/focus.mjs";
8
8
  import inputMixin from "./mixins/input.mjs";
9
9
  import { t as IconButton } from "./IconButton-CnJNIJVQ.mjs";
10
- import { t as ClearButton } from "./Input-DbfwNzS_.mjs";
11
- import { c as MenuList, s as MenuItem } from "./Menu-CAGTCBqj.mjs";
12
- import { s as Popover_default } from "./Popover-DUyzmq3e.mjs";
13
- import { a as FormLabel } from "./FormControl-BvRzRknE.mjs";
10
+ import { t as ClearButton } from "./Input-DGWThZlt.mjs";
11
+ import { c as MenuList, s as MenuItem } from "./Menu-CeV3lL2g.mjs";
12
+ import { s as Popover_default } from "./Popover-UiOUt5up.mjs";
13
+ import { a as FormLabel } from "./FormControl-BzMbbgr0.mjs";
14
14
  import { BorderRadius, Color, Spacing, Typography } from "@persona/design-tokens";
15
15
  import { forwardRef, memo, useCallback, useEffect, useRef, useState } from "react";
16
16
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -18,8 +18,8 @@ import { ArrowLeftIcon, ArrowRightIcon, CircleXInverseIcon } from "@persona/icon
18
18
  import { range } from "lodash-es";
19
19
  import { VisuallyHidden, mergeProps, useButton, useCalendar, useCalendarCell, useCalendarGrid, useDateFormatter, useDatePicker, useDateRangePicker, useFocusWithin, useLocale, usePress, useRangeCalendar } from "react-aria";
20
20
  import { useCalendarState, useDatePickerState, useDateRangePickerState, useRangeCalendarState } from "react-stately";
21
- import { DateTime, Settings } from "luxon";
22
21
  import { mergeRefs } from "@react-aria/utils";
22
+ import { DateTime, Settings } from "luxon";
23
23
  import { CalendarDate, GregorianCalendar, endOfMonth, endOfYear, getWeeksInMonth, isSameDay, isSameMonth, now, parseAbsolute, startOfMonth, startOfYear, toCalendarDateTime, today } from "@internationalized/date";
24
24
  import { useDateField, useDateSegment } from "@react-aria/datepicker";
25
25
  import { useLocale as useLocale$1 } from "@react-aria/i18n";
@@ -1003,4 +1003,4 @@ const DateRangePicker = ({ granularity = "day", hideTimeZone = true, className,
1003
1003
  //#endregion
1004
1004
  export { Calendar as i, DatePicker as n, DateField as r, DateRangePicker as t };
1005
1005
 
1006
- //# sourceMappingURL=DatePicker-DTT-mJ8r.mjs.map
1006
+ //# sourceMappingURL=DatePicker-BcjrAr7o.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"DatePicker-DTT-mJ8r.mjs","names":["useLocale","OpenButton","Popover","Card","RangeCalendarPresets","Popover"],"sources":["../components/DatePicker/Calendar/CalendarBase.tsx","../components/DatePicker/Calendar/CalendarCell.tsx","../components/DatePicker/Calendar/CalendarGrid.tsx","../components/DatePicker/common.ts","../components/DatePicker/Calendar/Calendar.tsx","../components/DatePicker/DateField.tsx","../components/DatePicker/DatePicker.tsx","../components/DatePicker/Calendar/RangeCalendarPresets.tsx","../components/DatePicker/Calendar/RangeCalendar.tsx","../components/DatePicker/DateRangePicker.tsx"],"sourcesContent":["import { useRef } from 'react';\nimport { useButton } from 'react-aria';\nimport styled from 'styled-components';\n\nimport { Spacing, Typography } from '@persona/design-tokens';\nimport { IconButton } from 'design-system/components/Button';\nimport type { IconButtonProps } from 'design-system/components/Button/IconButton';\n\nexport const CalendarContainer = styled.div`\n display: inline-block;\n`;\n\nexport const CalendarHeader = styled.div`\n display: flex;\n align-items: center;\n margin-bottom: ${Spacing[2]};\n`;\n\nexport const CalendarHeading = styled.div`\n ${Typography.TextLargeBold};\n flex: 1;\n text-align: center;\n`;\n\nconst StyledCalendarButton = styled(IconButton)`\n width: 32px;\n height: 32px;\n`;\n\nexport const CalendarButton = (props: IconButtonProps) => {\n const ref = useRef();\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n const { buttonProps } = useButton(props, ref);\n\n return (\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n <StyledCalendarButton {...buttonProps} className={props.className} ref={ref}>\n {props.children}\n </StyledCalendarButton>\n );\n};\n","import { type CalendarDate, type DateValue, isSameDay, isSameMonth } from '@internationalized/date';\nimport { useRef } from 'react';\nimport { useCalendarCell } from 'react-aria';\nimport type { CalendarState, RangeCalendarState } from 'react-stately';\nimport styled, { css } from 'styled-components';\n\nimport { BorderRadius, Color, Typography } from '@persona/design-tokens';\nimport { withAlpha } from 'design-system/lib/color';\nimport { semanticColor, semanticTokens } from 'design-system/lib/semanticColor';\n\nconst CalendarCellContainer = styled.td`\n text-align: center;\n width: 38px;\n height: 38px;\n padding: 0px;\n`;\n\ninterface CalendarCellButtonProps {\n isSelected?: boolean;\n isSelectionStart?: boolean;\n isSelectionEnd?: boolean;\n isInvalid?: boolean;\n isDisabled?: boolean;\n}\n\nconst CalendarCellButton = styled.button<CalendarCellButtonProps>`\n ${Typography.TextMedium};\n border-style: none;\n padding: 0;\n background: none;\n width: 100%;\n height: 100%;\n cursor: pointer;\n position: relative;\n\n ${({ isSelected, theme }) => {\n if (!isSelected) {\n return null;\n }\n const tokens = semanticTokens(theme);\n return css`\n background: ${tokens ? withAlpha(tokens.SurfaceAccent, tokens.Opacity25) : Color.CorePurple100};\n ${tokens ? `color: ${tokens.FgPrimary};` : ''}\n `;\n }}\n\n ${({ isSelectionStart, theme }) =>\n isSelectionStart &&\n css`\n background: ${semanticColor(theme, 'ActionPrimary', Color.BackgroundButtonPrimary)};\n color: ${semanticColor(theme, 'FgInverse', Color.TextInverse)};\n border-top-left-radius: ${BorderRadius.Sm};\n border-bottom-left-radius: ${BorderRadius.Sm};\n `}\n\n ${({ isSelectionEnd, theme }) =>\n isSelectionEnd &&\n css`\n background: ${semanticColor(theme, 'ActionPrimary', Color.BackgroundButtonPrimary)};\n color: ${semanticColor(theme, 'FgInverse', Color.TextInverse)};\n border-top-right-radius: ${BorderRadius.Sm};\n border-bottom-right-radius: ${BorderRadius.Sm};\n `}\n\n ${({ isDisabled, theme }) =>\n isDisabled &&\n css`\n color: ${semanticColor(theme, 'FgDisabled', Color.CoreSlate300)};\n `}\n\n ${({ isInvalid, theme }) =>\n isInvalid &&\n css`\n background: ${semanticColor(theme, 'FeedbackDanger4', Color.BackgroundButtonDanger)};\n color: ${semanticColor(theme, 'FgInverseStatic', Color.TextInverse)};\n `}\n\n &:focus-visible {\n outline: 2px solid ${({ theme }) => semanticColor(theme, 'BorderFocus', Color.BorderFocus)};\n outline-offset: -2px;\n box-shadow: ${({ theme }) => semanticColor(theme, 'SurfacePrimary', Color.PrimaryWhite)} 0px 0px 0px 3px inset;\n z-index: 1;\n }\n`;\n\ninterface CalendarCellProps {\n state: CalendarState | RangeCalendarState;\n date: CalendarDate;\n currentMonth: DateValue;\n}\n\nconst CalendarCell = ({ state, date, currentMonth }: CalendarCellProps) => {\n const ref = useRef();\n const { cellProps, buttonProps, isSelected, isInvalid, isDisabled, formattedDate } =\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n useCalendarCell({ date }, state, ref);\n\n const highlightedRange = 'highlightedRange' in state && state.highlightedRange;\n\n const isOutsideMonth = !isSameMonth(currentMonth, date);\n const isSelectionStart = highlightedRange ? isSameDay(date, highlightedRange.start) : isSelected;\n const isSelectionEnd = highlightedRange ? isSameDay(date, highlightedRange.end) : isSelected;\n\n return (\n <CalendarCellContainer {...cellProps}>\n <CalendarCellButton\n {...buttonProps}\n hidden={isOutsideMonth}\n isSelected={isSelected}\n isSelectionStart={isSelectionStart}\n isSelectionEnd={isSelectionEnd}\n isInvalid={isInvalid}\n isDisabled={isDisabled}\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n ref={ref}\n >\n {formattedDate}\n </CalendarCellButton>\n </CalendarCellContainer>\n );\n};\n\nexport default CalendarCell;\n","import { type DateDuration, endOfMonth, getWeeksInMonth } from '@internationalized/date';\nimport { useCalendarGrid, useLocale } from 'react-aria';\nimport type { CalendarState, RangeCalendarState } from 'react-stately';\nimport styled from 'styled-components';\n\nimport { Color, Typography } from '@persona/design-tokens';\nimport { semanticColor } from 'design-system/lib/semanticColor';\n\nimport CalendarCell from './CalendarCell';\n\nconst CalendarGridContainer = styled.table`\n width: 266px;\n border-spacing: 0px;\n border-collapse: collapse;\n\n &:focus-visible {\n outline: 2px solid ${({ theme }) => semanticColor(theme, 'BorderFocus', Color.BorderFocus)};\n outline-offset: 1px;\n }\n`;\n\nconst CalendarGridDayHeader = styled.th`\n ${Typography.TextMedium};\n color: ${({ theme }) => semanticColor(theme, 'FgSecondary', Color.TextSecondary)};\n`;\n\ninterface CalendarGridProps {\n state: CalendarState | RangeCalendarState;\n offset?: DateDuration;\n skipFromTabOrder?: boolean;\n}\n\nconst CalendarGrid = ({ state, offset = {}, skipFromTabOrder = false }: CalendarGridProps) => {\n const { locale } = useLocale();\n const startDate = state.visibleRange.start.add(offset);\n const endDate = endOfMonth(startDate);\n\n const { gridProps, headerProps, weekDays } = useCalendarGrid(\n {\n startDate,\n endDate,\n },\n state,\n );\n\n const weeksInMonth = getWeeksInMonth(startDate, locale);\n\n // Remove second calendar grid from tab order - use arrow keys to navigate between months\n const modifiedGridProps = skipFromTabOrder ? { ...gridProps, tabIndex: -1 } : gridProps;\n\n return (\n <CalendarGridContainer {...modifiedGridProps}>\n <thead {...headerProps}>\n <tr>\n {weekDays.map((day, index) => (\n <CalendarGridDayHeader key={index}>{day}</CalendarGridDayHeader>\n ))}\n </tr>\n </thead>\n <tbody>\n {[...new Array(weeksInMonth).keys()].map((weekIndex) => (\n <tr key={weekIndex}>\n {state\n .getDatesInWeek(weekIndex, startDate)\n .map((date, i) =>\n date ? (\n <CalendarCell key={i} state={state} date={date} currentMonth={startDate} />\n ) : (\n <td key={i} />\n ),\n )}\n </tr>\n ))}\n </tbody>\n </CalendarGridContainer>\n );\n};\n\nexport default CalendarGrid;\n","import { GregorianCalendar } from '@internationalized/date';\n\nexport const createCalendar = () => new GregorianCalendar();\n","import type { Ref } from 'react';\nimport { type AriaCalendarProps, type DateValue, useCalendar, useLocale } from 'react-aria';\nimport { useCalendarState } from 'react-stately';\n\nimport { ArrowLeftIcon, ArrowRightIcon } from '@persona/icons';\nimport {\n CalendarButton,\n CalendarContainer,\n CalendarHeader,\n CalendarHeading,\n} from 'design-system/components/DatePicker/Calendar/CalendarBase';\nimport CalendarGrid from 'design-system/components/DatePicker/Calendar/CalendarGrid';\nimport { createCalendar } from 'design-system/components/DatePicker/common';\n\ninterface CalendarProps extends AriaCalendarProps<DateValue> {\n calendarRef?: Ref<HTMLDivElement>;\n}\n\nconst Calendar = (props: CalendarProps) => {\n const { locale } = useLocale();\n const state = useCalendarState({ ...props, locale, createCalendar });\n const { calendarProps, prevButtonProps, nextButtonProps, title } = useCalendar(props, state);\n\n return (\n <CalendarContainer {...calendarProps} ref={props.calendarRef}>\n <CalendarHeader>\n <CalendarButton {...prevButtonProps}>\n <ArrowLeftIcon />\n </CalendarButton>\n <CalendarHeading>{title}</CalendarHeading>\n <CalendarButton {...nextButtonProps}>\n <ArrowRightIcon />\n </CalendarButton>\n </CalendarHeader>\n <CalendarGrid state={state} />\n </CalendarContainer>\n );\n};\n\nexport default Calendar;\n","import type { DateValue } from '@internationalized/date';\nimport { type AriaDateFieldProps, useDateField, useDateSegment } from '@react-aria/datepicker';\nimport { useLocale } from '@react-aria/i18n';\nimport { mergeRefs } from '@react-aria/utils';\nimport {\n type DateFieldState,\n type DateSegment as DateSegmentObj,\n type SegmentType,\n useDateFieldState,\n} from '@react-stately/datepicker';\nimport { forwardRef, useRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Color, Spacing } from '@persona/design-tokens';\nimport { createCalendar } from 'design-system/components/DatePicker/common';\nimport { withAlpha } from 'design-system/lib/color';\nimport { isFocused, isFocusedVisible, isNotDisabled } from 'design-system/lib/pseudoClass';\nimport { semanticColor, semanticOnly, semanticTokens } from 'design-system/lib/semanticColor';\nimport { focusWithinOutline } from 'design-system/mixins/focus';\nimport inputMixin, { type InputMixinProps, type InputSizes } from 'design-system/mixins/input';\nimport type PseudoClassProps from 'design-system/types/PseudoClassProps';\n\ntype DateSegmentContainerProps = { $isComma?: boolean; $isTimezone?: boolean } & PseudoClassProps;\nconst DateSegmentContainer = styled.div<DateSegmentContainerProps>`\n font-variant-numeric: tabular-nums;\n box-sizing: content-box;\n text-align: end;\n\n ${isFocused} {\n outline: 2px solid ${({ theme }) => semanticColor(theme, 'BorderFocus', Color.BorderFocus)};\n outline-offset: 1px;\n background-color: ${({ theme }) => {\n const tokens = semanticTokens(theme);\n return tokens ? withAlpha(tokens.SurfaceAccent, tokens.Opacity25) : Color.CorePurple200;\n }};\n ${semanticOnly((tokens) => `color: ${tokens.FgAccent};`)}\n }\n\n ${({ $isComma, $isTimezone }) =>\n ($isComma || $isTimezone) &&\n css`\n margin-left: 0.25ch;\n margin-right: 0.25ch;\n `}\n\n ${({ $isTimezone }) =>\n $isTimezone &&\n css`\n color: ${({ theme }) => semanticColor(theme, 'FgSecondary', Color.TextSecondary)};\n pointer-events: none;\n\n &:focus {\n outline: none;\n background-color: transparent;\n }\n `}\n`;\n\ntype DateSegmentPlaceholderProps = { isPlaceholder?: boolean; type: SegmentType };\nconst DateSegmentPlaceholder = styled.span<DateSegmentPlaceholderProps>`\n display: block;\n width: 100%;\n pointer-events: none;\n\n &:focus {\n outline: none;\n }\n\n ${({ isPlaceholder }) =>\n isPlaceholder\n ? css`\n height: 100%;\n color: ${({ theme }) => semanticColor(theme, 'FgSecondary', theme.color.text.tertiary)};\n `\n : css`\n visibility: hidden;\n height: 0;\n `}\n ${({ type }) =>\n type === 'literal' &&\n css`\n padding-left: ${Spacing[1]};\n padding-right: ${Spacing[1]};\n `}\n ${({ type, isPlaceholder }) =>\n type === 'month' &&\n isPlaceholder &&\n css`\n width: 3ch;\n `}\n`;\n\ninterface DateSegmentProps {\n segment: DateSegmentObj;\n state: DateFieldState;\n}\n\nfunction DateSegment({ segment, state }: DateSegmentProps) {\n const ref = useRef();\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n const { segmentProps } = useDateSegment(segment, state, ref);\n\n let minWidth: string;\n\n switch (segment.type) {\n case 'dayPeriod': {\n minWidth = '2.75ch';\n break;\n }\n default: {\n minWidth = `${segment.maxValue != null && String(segment.maxValue).length + 0.25}ch`;\n break;\n }\n }\n\n const isComma = segment.type === 'literal' && segment.text === ', ';\n const isTimezone = segment.type === 'timeZoneName';\n\n return (\n <DateSegmentContainer\n {...segmentProps}\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n ref={ref}\n style={{\n ...segmentProps.style,\n minWidth,\n }}\n $isComma={isComma}\n $isTimezone={isTimezone}\n {...(isTimezone && { tabIndex: -1, role: 'presentation' })}\n >\n {/* Always reserve space for the placeholder, to prevent layout shift when editing. */}\n {segment.placeholder && (\n <DateSegmentPlaceholder\n aria-hidden='true'\n isPlaceholder={segment.isPlaceholder}\n type={segment.type}\n >\n {segment.placeholder}\n </DateSegmentPlaceholder>\n )}\n {segment.isPlaceholder ? '' : segment.text}\n </DateSegmentContainer>\n );\n}\n\nconst InputBox = styled.div<InputMixinProps & { $inputPosition: 'start' | 'end' }>`\n ${inputMixin};\n display: flex;\n padding-left: ${Spacing[2]};\n padding-right: ${Spacing[2]};\n line-height: 1;\n position: relative;\n\n &${isFocusedVisible}${isNotDisabled} {\n position: relative;\n z-index: 1;\n }\n\n ${focusWithinOutline}\n\n ${({ $inputPosition }) => {\n switch ($inputPosition) {\n case 'start': {\n return css`\n border-top-right-radius: 0px;\n border-bottom-right-radius: 0px;\n `;\n }\n case 'end': {\n return css`\n margin-left: -1px;\n border-top-left-radius: 0px;\n border-bottom-left-radius: 0px;\n `;\n }\n }\n }}\n`;\n\ninterface DateFieldProps extends AriaDateFieldProps<DateValue> {\n inputPosition?: 'start' | 'end';\n focused?: boolean;\n readOnly?: boolean;\n value?: DateValue;\n disabled?: boolean;\n size?: InputSizes;\n style?: React.CSSProperties;\n dateFieldProps?: {\n style?: React.CSSProperties;\n };\n hasError?: boolean;\n}\n\nexport const DateField = forwardRef<HTMLDivElement, DateFieldProps>(function DateField(\n props: DateFieldProps,\n forwardedRef,\n) {\n const { locale } = useLocale();\n const state = useDateFieldState({\n ...props,\n locale,\n createCalendar,\n });\n\n const ref = useRef<HTMLDivElement>();\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n const { fieldProps } = useDateField(props, state, ref);\n\n return (\n <InputBox\n {...fieldProps}\n {...(props.dateFieldProps || {})}\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n ref={mergeRefs<HTMLDivElement>(ref, forwardedRef)}\n focused={props.focused}\n disabled={props.disabled}\n aria-label={props['aria-label']}\n $size={props.size ?? 'md'}\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n $inputPosition={props.inputPosition}\n hasError={props.hasError}\n >\n {state.segments.map((segment, i) => (\n <DateSegment key={i} segment={segment} state={state} />\n ))}\n </InputBox>\n );\n});\n\nexport default DateField;\n","import type { DateValue } from '@internationalized/date';\nimport type { DatePickerProps as DatePickerBase } from '@react-types/datepicker';\nimport { type RefObject, useCallback, useRef } from 'react';\nimport { mergeProps, useButton, useDatePicker, useFocusWithin, VisuallyHidden } from 'react-aria';\nimport { useDatePickerState } from 'react-stately';\n\nimport Calendar from 'design-system/components/DatePicker/Calendar/Calendar';\nimport DateField from 'design-system/components/DatePicker/DateField';\nimport Popover from 'design-system/components/Popover';\nimport { Z_INDICES } from 'design-system/lib/zindex';\nimport type { InputSizes } from 'design-system/mixins/input';\n\nexport interface DatePickerProps extends DatePickerBase<DateValue> {\n id?: string;\n dateFieldProps?: {\n style?: React.CSSProperties;\n };\n disabled?: boolean;\n size?: InputSizes;\n useModalZIndex?: boolean;\n}\n\nconst OpenButton = ({ calendarRef }: { calendarRef: RefObject<HTMLElement> }) => {\n const openCalBtnRef = useRef<HTMLButtonElement>(null);\n const { buttonProps } = useButton(\n {\n onPress: () => {\n if (calendarRef.current) {\n (\n calendarRef.current.querySelector('button[aria-label=\"Previous\"]') as HTMLButtonElement\n ).focus();\n }\n },\n },\n openCalBtnRef,\n );\n\n return <button {...buttonProps} ref={openCalBtnRef} aria-label='Open calendar' />;\n};\n\nexport const DatePicker = (props: DatePickerProps) => {\n const state = useDatePickerState(props);\n const ref = useRef<HTMLDivElement>(null);\n const fieldRef = useRef<HTMLDivElement>(null);\n const { groupProps, fieldProps, calendarProps } = useDatePicker(props, state, ref);\n const calendarRef = useRef<HTMLDivElement>(null);\n // A ref, not state: the close sequence focuses the field before a state update would commit.\n const isClosingRef = useRef(false);\n\n const { focusWithinProps } = useFocusWithin({\n onFocusWithin: () => {\n if (!state.isOpen && !isClosingRef.current) {\n state.setOpen(true);\n }\n },\n onBlurWithin: (e) => {\n // Close calendar if next target is not within the calendar\n if (e.relatedTarget && !calendarRef?.current?.contains(e.relatedTarget) && state.isOpen) {\n state.setOpen(false);\n }\n },\n });\n\n const handleOutsideClick = (e: Event) => {\n const target = e.target as Node;\n // Don't close if clicking on the date input itself\n if (ref.current?.contains(target)) {\n return;\n }\n if (state.isOpen) {\n state.setOpen(false);\n }\n };\n\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n if (event.key === 'Enter' && !state.isOpen) {\n event.preventDefault();\n state.setOpen(true);\n }\n },\n [state],\n );\n\n return (\n <div style={{ display: 'flex', flexDirection: 'column' }}>\n <Popover\n open={state.isOpen}\n modal={false}\n contentProps={{\n style: { zIndex: props.useModalZIndex ? Z_INDICES.modalDropdown : Z_INDICES.dropdown },\n align: 'start',\n 'aria-modal': true,\n onInteractOutside: handleOutsideClick,\n onEscapeKeyDown: () => {\n state.setOpen(false);\n },\n onCloseAutoFocus: (e: Event) => {\n // Prevent Radix's default focus restoration\n e.preventDefault();\n isClosingRef.current = true;\n\n // Manually restore focus to the date field\n if (fieldRef.current) {\n const firstEditableSegment = fieldRef.current.querySelector('[tabindex=\"0\"]');\n if (firstEditableSegment instanceof HTMLElement) {\n firstEditableSegment.focus();\n }\n }\n\n // Reset flag after focus is done\n requestAnimationFrame(() => {\n isClosingRef.current = false;\n });\n },\n noPadding: true,\n }}\n >\n <Popover.Trigger asChild>\n <div\n {...mergeProps(groupProps, focusWithinProps)}\n ref={ref}\n style={{ display: 'flex', position: 'relative' }}\n >\n <DateField\n ref={fieldRef}\n id={props.id}\n dateFieldProps={props.dateFieldProps}\n disabled={props.disabled}\n size={props.size}\n {...mergeProps(fieldProps, { onKeyDown: handleKeyDown })}\n value={fieldProps.value ?? undefined}\n />\n <VisuallyHidden>\n <OpenButton calendarRef={calendarRef} />\n </VisuallyHidden>\n </div>\n </Popover.Trigger>\n <Calendar\n {...{ ...calendarProps, autoFocus: undefined }}\n calendarRef={calendarRef}\n id='calendar-popover'\n />\n </Popover>\n </div>\n );\n};\n\nexport default DatePicker;\n","import {\n type CalendarDate,\n type DateValue,\n endOfMonth,\n endOfYear,\n startOfMonth,\n startOfYear,\n today,\n} from '@internationalized/date';\nimport type { RangeValue } from '@react-types/shared';\nimport { Settings } from 'luxon';\nimport { memo, useRef } from 'react';\nimport { mergeProps, useButton } from 'react-aria';\nimport type { RangeCalendarState } from 'react-stately';\nimport styled, { css } from 'styled-components';\n\nimport type { DateFilterPreset } from '@persona/design-system/lib/date-filter';\nimport { Color } from '@persona/design-tokens';\nimport { MenuItem, MenuList } from 'design-system/components/Menu';\nimport { isFocused, isHovered, isNotDisabled } from 'design-system/lib/pseudoClass';\nimport { semanticColor } from 'design-system/lib/semanticColor';\n\ninterface DateRangePreset {\n id: DateFilterPreset;\n label: string;\n range: RangeValue<CalendarDate>;\n}\n\n/** The preset windows the picker offers; the codec resolves the same ids on read. */\nexport const getDefaultPresets = (tz: string): DateRangePreset[] => {\n const now = today(tz);\n return [\n {\n id: 'last_7_days',\n label: 'Last 7 days',\n range: {\n start: now.subtract({ days: 7 }),\n end: now,\n },\n },\n {\n id: 'last_14_days',\n label: 'Last 14 days',\n range: {\n start: now.subtract({ days: 14 }),\n end: now,\n },\n },\n {\n id: 'last_30_days',\n label: 'Last 30 days',\n range: {\n start: now.subtract({ days: 30 }),\n end: now,\n },\n },\n {\n id: 'this_month',\n label: 'This month',\n range: {\n start: startOfMonth(now),\n // Effectively, this should always be today, since we can't look forward\n end: now,\n },\n },\n {\n id: 'last_month',\n label: 'Last month',\n range: {\n start: startOfMonth(now.subtract({ months: 1 })),\n end: endOfMonth(now.subtract({ months: 1 })),\n },\n },\n {\n id: 'this_year',\n label: 'This year',\n range: {\n start: startOfYear(now),\n end: now,\n },\n },\n {\n id: 'last_year',\n label: 'Last year',\n range: {\n start: startOfYear(now.subtract({ years: 1 })),\n end: endOfYear(now.subtract({ years: 1 })),\n },\n },\n ];\n};\n\n/**\n * Compare two date values by year/month/day only, ignoring time components.\n */\nconst datesMatchByDay = (a: CalendarDate, b: DateValue): boolean =>\n a.year === b.year && a.month === b.month && a.day === b.day;\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n`;\n\ninterface PresetButtonProps {\n state: RangeCalendarState;\n preset: DateRangePreset;\n isSelected: boolean;\n setDateMode: (mode: 'start' | 'end' | null) => void;\n onPresetSelect?: (preset: DateFilterPreset, commit: () => void) => void;\n commitRange: (value: RangeValue<DateValue>) => void;\n}\n\nconst StyledPresetButton = styled(MenuItem)`\n ${({ selected }) =>\n !selected &&\n css`\n &${isNotDisabled}${isHovered}, &${isNotDisabled}${isFocused} {\n background-color: transparent;\n }\n `}\n\n &:focus-visible {\n // MenuItems default to outline: none, so we need to override it here.\n outline: 2px solid ${({ theme }) => semanticColor(theme, 'BorderFocus', Color.BorderFocus)} !important;\n outline-offset: 1px;\n }\n`;\n\ninterface DateRangePickerPresetsProps {\n presetsFn?: (tz: string) => DateRangePreset[];\n state: RangeCalendarState;\n setDateMode: (mode: 'start' | 'end' | null) => void;\n onPresetSelect?: (preset: DateFilterPreset, commit: () => void) => void;\n selectedPreset?: DateFilterPreset | null;\n commitRange: (value: RangeValue<DateValue>) => void;\n}\n\nconst PresetButton = ({\n commitRange,\n state,\n preset,\n isSelected,\n setDateMode,\n onPresetSelect,\n ...props\n}: PresetButtonProps) => {\n const ref = useRef<HTMLDivElement>();\n const { buttonProps } = useButton(\n {\n onPress: () => {\n const commit = () => commitRange(preset.range);\n\n if (onPresetSelect) {\n onPresetSelect(preset.id, commit);\n } else {\n commit();\n }\n setDateMode(null);\n },\n },\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n ref,\n );\n\n // Strip aria-current from useButton's props so it doesn't override MenuItem's.\n const { 'aria-current': _ariaCurrent, ...mergedProps } = mergeProps(props, buttonProps);\n\n return (\n <StyledPresetButton\n selected={isSelected}\n {...mergedProps}\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n ref={ref}\n >\n {preset.label}\n </StyledPresetButton>\n );\n};\n\nconst DateRangePickerPresets = ({\n presetsFn = getDefaultPresets,\n commitRange,\n state,\n setDateMode,\n onPresetSelect,\n selectedPreset,\n ...props\n}: DateRangePickerPresetsProps) => {\n // The reason that we need to do this at render time is because the default timezone for moment is set after\n // the current User's timezone is loaded. Thus we woudln't be getting the right timezone unless if we defer getting\n // the timezone.\n const presets = presetsFn(Settings.defaultZone.name);\n\n // First match wins — prevents multiple presets appearing selected when ranges overlap.\n const { value } = state;\n const selectedPresetIndex = value\n ? presets.findIndex(\n (preset) =>\n datesMatchByDay(preset.range.start, value.start) &&\n datesMatchByDay(preset.range.end, value.end),\n )\n : -1;\n\n // `undefined` falls back to matching on dates; `null` is an explicit \"no preset\".\n const infersSelection = typeof selectedPreset === 'undefined';\n\n return (\n <Container {...props}>\n <MenuList aria-label='Date range presets'>\n {presets.map((preset, i) => (\n <PresetButton\n key={i}\n preset={preset}\n commitRange={commitRange}\n state={state}\n setDateMode={setDateMode}\n onPresetSelect={onPresetSelect}\n isSelected={infersSelection ? i === selectedPresetIndex : preset.id === selectedPreset}\n />\n ))}\n </MenuList>\n </Container>\n );\n};\n\n// Skips re-renders driven by calendar state the preset list does not read —\n// focus and hover updates fire on every pointer move during range selection.\nconst arePropsEqual = (\n prevProps: DateRangePickerPresetsProps,\n nextProps: DateRangePickerPresetsProps,\n) => {\n if (\n prevProps.selectedPreset !== nextProps.selectedPreset ||\n prevProps.onPresetSelect !== nextProps.onPresetSelect ||\n prevProps.commitRange !== nextProps.commitRange ||\n prevProps.setDateMode !== nextProps.setDateMode ||\n prevProps.presetsFn !== nextProps.presetsFn\n ) {\n return false;\n }\n\n const prevValue = prevProps.state.value;\n const nextValue = nextProps.state.value;\n\n if (!prevValue && !nextValue) {\n return true;\n }\n if (!prevValue || !nextValue) {\n return false;\n }\n\n return (\n prevValue.start.compare(nextValue.start) === 0 && prevValue.end.compare(nextValue.end) === 0\n );\n};\n\nexport default memo(DateRangePickerPresets, arePropsEqual);\n","import {\n type CalendarDate,\n type CalendarDateTime,\n type DateValue,\n now,\n toCalendarDateTime,\n} from '@internationalized/date';\nimport type { RangeValue } from '@react-types/shared';\nimport { range } from 'lodash-es';\nimport { Settings } from 'luxon';\nimport { type Ref, useCallback, useEffect, useRef } from 'react';\nimport {\n type DateRange,\n type RangeCalendarProps as RangeCalendarBaseProps,\n useDateFormatter,\n useLocale,\n useRangeCalendar,\n VisuallyHidden,\n} from 'react-aria';\nimport { type RangeCalendarState, useRangeCalendarState } from 'react-stately';\nimport styled from 'styled-components';\n\nimport type { DateFilterPreset } from '@persona/design-system/lib/date-filter';\nimport { BorderRadius, Color, Spacing } from '@persona/design-tokens';\nimport { ArrowLeftIcon, ArrowRightIcon } from '@persona/icons';\nimport Card from 'design-system/components/Card';\nimport {\n CalendarButton,\n CalendarContainer,\n CalendarHeader,\n CalendarHeading,\n} from 'design-system/components/DatePicker/Calendar/CalendarBase';\nimport CalendarGrid from 'design-system/components/DatePicker/Calendar/CalendarGrid';\nimport RangeCalendarPresets from 'design-system/components/DatePicker/Calendar/RangeCalendarPresets';\nimport { createCalendar } from 'design-system/components/DatePicker/common';\nimport { semanticColor } from 'design-system/lib/semanticColor';\n\nconst RangeCalendarHeader = styled(CalendarHeader)`\n gap: ${Spacing[5]};\n`;\n\nconst CalendarHeaderMonth = styled.div`\n display: grid;\n grid-template-columns: minmax(auto, 1fr) auto minmax(auto, 1fr);\n grid-template-areas: 'prev title next';\n width: 266px;\n align-items: center;\n`;\n\nconst CalendarGrids = styled.div`\n display: flex;\n gap: ${Spacing[5]};\n align-items: start;\n`;\n\nconst PrevButton = styled(CalendarButton)`\n grid-area: prev;\n justify-self: start;\n border-radius: ${BorderRadius.Sm};\n`;\n\nconst NextButton = styled(CalendarButton)`\n grid-area: next;\n justify-self: end;\n border-radius: ${BorderRadius.Sm};\n`;\n\nconst RangeCalendarHeading = styled(CalendarHeading)`\n grid-area: title;\n`;\n\nconst RangeCalendarContainer = styled.div`\n display: flex;\n`;\n\nconst PresetsContainer = styled(Card.Body)`\n border-right: 1px solid ${({ theme }) => semanticColor(theme, 'BorderDivider', Color.BorderHairline)};\n`;\n\nexport interface RangeCalendarProps extends RangeCalendarBaseProps<DateValue> {\n minDate?: RangeCalendarBaseProps<DateValue>['minValue'];\n maxDate?: RangeCalendarBaseProps<DateValue>['maxValue'];\n calendarRef?: Ref<HTMLDivElement>;\n hidePresets?: boolean;\n visibleMonths?: 1 | 2;\n onSelectDate?: (d: CalendarDate) => void;\n setDateMode: (mode: 'start' | 'end' | null) => void;\n onPresetSelect?: (preset: DateFilterPreset, commit: () => void) => void;\n selectedPreset?: DateFilterPreset | null;\n /**\n * From setValue of DateRangePicker\n */\n setValue: (value: DateRange | null) => void;\n granularity: 'day' | 'hour' | 'minute' | 'second';\n}\n\nconst hasTimeComponent = (date: DateValue) => 'hour' in date;\n\nconst earliest = (a: CalendarDateTime, b: CalendarDateTime) => (a.compare(b) <= 0 ? a : b);\n\n/**\n * Reaches the end of the preset's final day, but never past the present — filters\n * reject a future bound and drop the range entirely. The present is floored to the\n * minute, the finest the picker can express, so the bound is a stable value rather\n * than the sub-second noise of whenever the click landed.\n */\nconst presetEnd = (end: CalendarDateTime) =>\n earliest(\n end.set({ hour: 23, minute: 59, second: 59, millisecond: 999 }),\n toCalendarDateTime(now(Settings.defaultZone.name)).set({ second: 0, millisecond: 0 }),\n );\n\nconst RangeCalendar = ({\n calendarRef,\n onSelectDate,\n minDate,\n maxDate,\n hidePresets,\n visibleMonths = 2,\n setDateMode,\n onPresetSelect,\n selectedPreset,\n setValue,\n granularity,\n ...props\n}: RangeCalendarProps) => {\n const { locale } = useLocale();\n // Must gather the TZ from the user's settings.\n const timezoneName = Settings.defaultZone.name;\n const rangeCalendarState = useRangeCalendarState({\n ...props,\n minValue: minDate,\n maxValue: maxDate,\n visibleDuration: {\n months: visibleMonths,\n },\n locale,\n createCalendar,\n });\n\n const state: RangeCalendarState = {\n ...rangeCalendarState,\n setValue: (value) => {\n if (!value || granularity === 'day') {\n rangeCalendarState.setValue(value);\n return;\n }\n\n setValue({\n start: toCalendarDateTime(value.start),\n // A date-only end comes from a preset, where the end date is inclusive.\n end: hasTimeComponent(value.end)\n ? toCalendarDateTime(value.end)\n : presetEnd(toCalendarDateTime(value.end)),\n });\n },\n selectDate: (date) => {\n if (onSelectDate) {\n onSelectDate(date);\n rangeCalendarState.setAnchorDate(null);\n } else {\n rangeCalendarState.selectDate(date);\n }\n },\n };\n\n // The preset list is memoized on its own props, so it can hold a `state` from\n // an earlier render. Committing through a ref keeps the write on the current\n // `onChange` chain instead of one the parent has already replaced.\n const commitRef = useRef(state.setValue);\n useEffect(() => {\n commitRef.current = state.setValue;\n });\n const commitRange = useCallback((value: RangeValue<DateValue>) => commitRef.current(value), []);\n\n const ref = useRef();\n\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n const { calendarProps, prevButtonProps, nextButtonProps } = useRangeCalendar(props, state, ref);\n\n const monthDateFormatter = useDateFormatter({\n month: 'long',\n year: 'numeric',\n timeZone: timezoneName,\n });\n\n const monthHeaders = range(0, visibleMonths).map((i) => {\n return (\n <CalendarHeaderMonth key={`calendar-month-${i}`}>\n {i === 0 && (\n <PrevButton {...prevButtonProps}>\n <ArrowLeftIcon />\n </PrevButton>\n )}\n <RangeCalendarHeading aria-hidden>\n {monthDateFormatter.format(\n state.visibleRange.start.add({ months: i }).toDate(timezoneName),\n )}\n </RangeCalendarHeading>\n {i === visibleMonths - 1 && (\n <NextButton {...nextButtonProps}>\n <ArrowRightIcon />\n </NextButton>\n )}\n </CalendarHeaderMonth>\n );\n });\n\n const monthGrids = range(0, visibleMonths).map((i) => {\n return (\n <CalendarGrid\n key={`calendar-grid-${i}`}\n state={state}\n offset={{ months: i }}\n skipFromTabOrder={i > 0}\n />\n );\n });\n\n return (\n <RangeCalendarContainer ref={calendarRef}>\n {!hidePresets && (\n <PresetsContainer padding={Spacing[3]}>\n <RangeCalendarPresets\n state={state}\n commitRange={commitRange}\n setDateMode={setDateMode}\n onPresetSelect={onPresetSelect}\n selectedPreset={selectedPreset}\n />\n </PresetsContainer>\n )}\n <Card.Body padding={Spacing[3]}>\n {/* @ts-expect-error [strict-migration] The following line is not strict; please fix! */}\n <CalendarContainer {...calendarProps} ref={ref}>\n {/* Calendar header is separate from grid like this to facilitate a11y. */}\n <RangeCalendarHeader>\n <VisuallyHidden isFocusable={false}>{calendarProps['aria-label']}</VisuallyHidden>\n {monthHeaders}\n </RangeCalendarHeader>\n <CalendarGrids>{monthGrids}</CalendarGrids>\n </CalendarContainer>\n </Card.Body>\n </RangeCalendarContainer>\n );\n};\n\nexport default RangeCalendar;\n","import {\n CalendarDate,\n type DateValue,\n parseAbsolute,\n toCalendarDateTime,\n} from '@internationalized/date';\nimport type { DateRangePickerProps as DateRangePickerBase } from '@react-types/datepicker';\nimport type { AriaLabelingProps, RangeValue } from '@react-types/shared';\nimport { DateTime, Settings } from 'luxon';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport {\n mergeProps,\n useButton,\n useDateRangePicker,\n useFocusWithin,\n usePress,\n VisuallyHidden,\n} from 'react-aria';\nimport { useDateRangePickerState } from 'react-stately';\nimport styled from 'styled-components';\n\nimport type { DateFilterPreset } from '@persona/design-system/lib/date-filter';\nimport { Spacing, Typography } from '@persona/design-tokens';\nimport { CircleXInverseIcon } from '@persona/icons';\nimport RangeCalendar from 'design-system/components/DatePicker/Calendar/RangeCalendar';\nimport DateField from 'design-system/components/DatePicker/DateField';\nimport { FormLabel } from 'design-system/components/FormControl';\nimport { ClearButton } from 'design-system/components/Input';\nimport Popover from 'design-system/components/Popover';\nimport { isDisabled } from 'design-system/lib/pseudoClass';\nimport type { InputSizes } from 'design-system/mixins/input';\n\nconst DateRangeContainer = styled.div`\n display: inline-flex;\n flex-direction: column;\n width: 100%;\n`;\n\nconst DateRangeInputs = styled.div`\n display: flex;\n align-items: center;\n`;\n\nconst CustomFormLabel = styled(FormLabel)`\n margin-bottom: ${Spacing[2]};\n ${Typography.TextMediumBold};\n`;\n\nexport type DateRange = {\n startDate?: DateTime;\n endDate?: DateTime;\n};\n\nexport type DateFilterChange =\n | {\n source: 'preset';\n preset: DateFilterPreset;\n range: RangeValue<DateValue>;\n }\n | {\n source: 'calendar';\n range: RangeValue<DateValue> | null;\n }\n | {\n source: 'clear';\n };\n\n/**\n * `onChange` fires for controlled prop replay as well as user edits, so only the\n * code path that started a write can say what that write meant.\n */\ntype WriteOrigin =\n | { kind: 'interaction' }\n | { kind: 'sync' }\n | { kind: 'clear' }\n | { kind: 'preset'; preset: DateFilterPreset };\n\nexport interface DateRangePickerProps extends DateRangePickerBase<DateValue>, AriaLabelingProps {\n dateRange: DateRange;\n onChange: (range: RangeValue<DateValue> | null) => void;\n disabled?: boolean;\n size?: InputSizes;\n minDate?: DateValue;\n maxDate?: DateValue;\n label?: string | null;\n dataTest?: string;\n id?: string;\n hidePresets?: boolean;\n visibleMonths?: 1 | 2;\n className?: string;\n /**\n * Whether or not to display clear button\n */\n showClear?: boolean;\n /**\n * Called when the clear button is clicked/pressed\n */\n onClear?: () => void;\n /**\n * Additive notification of genuine user interactions. Never fires for\n * controlled prop synchronization. `onChange` is unaffected by this prop.\n */\n onDateFilterChange?: (change: DateFilterChange) => void;\n /** `undefined` infers from dates, `null` selects none, and an id selects that preset. */\n selectedPreset?: DateFilterPreset | null;\n /**\n * z-index of the calendar popover\n */\n calendarZIndex?: number;\n /**\n * Element that should contain the calendar portal.\n */\n portalContainer?: HTMLElement | null;\n}\n\nconst OpenButton = ({ onOpen, disabled }: { onOpen: () => void; disabled?: boolean }) => {\n const openCalBtnRef = useRef<HTMLButtonElement>(null);\n const { buttonProps } = useButton(\n {\n isDisabled: disabled,\n onPress: onOpen,\n },\n openCalBtnRef,\n );\n\n return (\n <button\n {...buttonProps}\n type='button'\n ref={openCalBtnRef}\n aria-label='Open calendar'\n tabIndex={-1}\n />\n );\n};\n\nconst ClearRangeButton = styled(ClearButton)`\n height: 16px;\n width: 16px;\n margin-left: ${Spacing[2]};\n\n &${isDisabled}, &:disabled {\n background-color: transparent;\n }\n`;\n\nconst DateRangePicker = ({\n granularity = 'day',\n hideTimeZone = true,\n className,\n calendarZIndex,\n portalContainer,\n onDateFilterChange,\n selectedPreset,\n ...props\n}: DateRangePickerProps) => {\n const writeOriginRef = useRef<WriteOrigin>({ kind: 'interaction' });\n const writeWithOrigin = useCallback((origin: WriteOrigin, commit: () => void) => {\n writeOriginRef.current = origin;\n try {\n commit();\n } finally {\n writeOriginRef.current = { kind: 'interaction' };\n }\n }, []);\n\n const state = useDateRangePickerState({\n granularity,\n hideTimeZone,\n ...props,\n onChange: (range) => {\n props.onChange(range);\n\n const origin = writeOriginRef.current;\n if (origin.kind === 'sync' || origin.kind === 'clear') {\n return;\n }\n if (origin.kind === 'preset' && range) {\n onDateFilterChange?.({ source: 'preset', preset: origin.preset, range });\n return;\n }\n onDateFilterChange?.({ source: 'calendar', range });\n },\n });\n const ref = useRef<HTMLDivElement>(null);\n const startFieldRef = useRef<HTMLDivElement>(null);\n const endFieldRef = useRef<HTMLDivElement>(null);\n const calendarRef = useRef<HTMLDivElement>(null);\n const [dateMode, setDateMode] = useState<'start' | 'end' | null>(null);\n // A ref, not state: focus can return to a field before a state update would commit.\n const isClosingRef = useRef(false);\n const { groupProps, startFieldProps, endFieldProps, calendarProps, labelProps } =\n useDateRangePicker({ granularity, hideTimeZone, ...props }, state, ref);\n\n const focusCalendar = useCallback(() => {\n requestAnimationFrame(() => {\n const firstFocusableCalendarElement = calendarRef.current?.querySelector<HTMLElement>(\n '[role=\"menuitem\"], button:not(:disabled), [tabindex=\"0\"]',\n );\n firstFocusableCalendarElement?.focus();\n });\n }, []);\n\n const openCalendar = useCallback(() => {\n if (!props.disabled && !state.isOpen && !isClosingRef.current) {\n state.setOpen(true);\n }\n }, [props.disabled, state]);\n\n const openCalendarWithFocus = useCallback(() => {\n openCalendar();\n focusCalendar();\n }, [focusCalendar, openCalendar]);\n\n const handlePresetSelect = useCallback(\n (preset: DateFilterPreset, commit: () => void) =>\n writeWithOrigin({ kind: 'preset', preset }, commit),\n [writeWithOrigin],\n );\n\n // Keyed on instants rather than the `DateTime` identities: a caller that parses\n // its range during render hands us new objects every commit, and syncing on that\n // would call `setValue` -> `onChange` -> re-render without end.\n const startInstant = props.dateRange.startDate?.isValid\n ? props.dateRange.startDate.toMillis()\n : undefined;\n const endInstant = props.dateRange.endDate?.isValid\n ? props.dateRange.endDate.toMillis()\n : undefined;\n\n useEffect(() => {\n // If not set, return early\n if (startInstant == null || endInstant == null) {\n return;\n }\n\n // Find out the real time by adjusting the date to the user's timezone\n const startDate = DateTime.fromMillis(startInstant).setZone(Settings.defaultZone);\n const endDate = DateTime.fromMillis(endInstant).setZone(Settings.defaultZone);\n\n if (!startDate.isValid || !endDate.isValid) {\n return;\n }\n\n // Months are 1-indexed, no translations need to happen to CalendarDates\n const startCalendar = state.hasTime\n ? parseAbsolute(startDate.toISO(), Settings.defaultZone.name)\n : new CalendarDate(startDate.year, startDate.month, startDate.day);\n const endCalendar = state.hasTime\n ? parseAbsolute(endDate.toISO(), Settings.defaultZone.name)\n : new CalendarDate(endDate.year, endDate.month, endDate.day);\n\n const dateRangeV2: RangeValue<DateValue> = {\n start: startCalendar,\n end: endCalendar,\n };\n\n writeWithOrigin({ kind: 'sync' }, () => state.setValue(dateRangeV2));\n }, [startInstant, endInstant, granularity]);\n\n // Auto-close overlay when a complete range is selected (e.g., from presets with time enabled)\n const prevValueRef = useRef<RangeValue<DateValue | null> | null>(state.value);\n useEffect(() => {\n const prevValue = prevValueRef.current;\n const currentValue = state.value;\n\n // Update ref for next comparison\n prevValueRef.current = currentValue;\n\n // Close overlay only if BOTH start and end changed simultaneously to DIFFERENT dates (e.g., preset selection)\n // Do not close during manual date selection where:\n // 1. Only one date changes at a time, OR\n // 2. Both dates are set to the same value (initial selection from empty state)\n // Use value comparison (.compare) instead of object identity to handle controlled component re-renders\n const startChanged =\n prevValue?.start && currentValue?.start\n ? prevValue.start.compare(currentValue.start) !== 0\n : prevValue?.start !== currentValue?.start;\n const endChanged =\n prevValue?.end && currentValue?.end\n ? prevValue.end.compare(currentValue.end) !== 0\n : prevValue?.end !== currentValue?.end;\n const datesAreDifferent =\n currentValue?.start &&\n currentValue?.end &&\n currentValue.start.compare(currentValue.end) !== 0;\n\n if (state.isOpen && startChanged && endChanged && datesAreDifferent) {\n state.setOpen(false);\n }\n }, [state.value, state.isOpen]);\n\n const { focusWithinProps: startFocusWithinProps } = useFocusWithin({\n onFocusWithin: () => {\n setDateMode('start');\n openCalendar();\n },\n });\n\n const { focusWithinProps: endFocusWithinProps } = useFocusWithin({\n onFocusWithin: () => {\n setDateMode('end');\n openCalendar();\n },\n });\n\n const { focusWithinProps: containerFocusProps } = useFocusWithin({\n onBlurWithin: () => {\n requestAnimationFrame(() => {\n // Wait for popover focus transitions to settle before closing.\n const activeElement = document.activeElement;\n const isFocusInDateRangeInput =\n activeElement instanceof Node && ref.current?.contains(activeElement);\n const isFocusInCalendar =\n activeElement instanceof Node && calendarRef.current?.contains(activeElement);\n\n if (isFocusInDateRangeInput || isFocusInCalendar) {\n return;\n }\n\n setDateMode(null);\n if (state.isOpen) {\n state.setOpen(false);\n }\n });\n },\n });\n\n const handleOutsideClick = (e: Event) => {\n const target = e.target as Node;\n // Don't close if clicking on the date inputs themselves\n if (ref.current?.contains(target)) {\n return;\n }\n\n // When there's a click outside of the containers + calendars, reset the highlighted date\n // Only close the calendar if it's open\n // Note: Radix UI's onInteractOutside already ensures the interaction is outside the popover content\n if (state.isOpen) {\n setDateMode(null);\n state.setOpen(false);\n }\n };\n\n const { pressProps: pressClearProps } = usePress({\n onPress: () => {\n writeWithOrigin({ kind: 'clear' }, () => state.setValue(null));\n\n if (props.onClear) {\n props.onClear();\n }\n onDateFilterChange?.({ source: 'clear' });\n },\n });\n\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n if (event.key === 'Enter') {\n event.preventDefault(); // Prevent form submission\n openCalendarWithFocus();\n }\n },\n [openCalendarWithFocus],\n );\n\n const isValueNull = state.value && state.value.start == null && state.value.end == null;\n\n return (\n <DateRangeContainer data-test={props.dataTest} className={className}>\n {props.label && <CustomFormLabel {...labelProps}>{props.label}</CustomFormLabel>}\n <Popover\n open={state.isOpen}\n modal={false}\n portalProps={portalContainer ? { container: portalContainer } : undefined}\n contentProps={{\n align: 'start',\n 'aria-modal': true,\n 'aria-label': props['aria-label'] ?? undefined,\n onInteractOutside: handleOutsideClick,\n onOpenAutoFocus: (e: Event) => {\n // Field focus opens the calendar for editing, while Enter/Open calendar moves focus inside.\n e.preventDefault();\n },\n onEscapeKeyDown: () => {\n state.setOpen(false);\n // Restore focus to the date field for keyboard users\n if (dateMode) {\n const fieldRef = dateMode === 'start' ? startFieldRef : endFieldRef;\n const seg = fieldRef.current?.querySelector('[tabindex=\"0\"]');\n if (seg instanceof HTMLElement) {\n seg.focus();\n }\n }\n },\n onCloseAutoFocus: (e: Event) => {\n // Prevent Radix's default focus restoration — Escape handles its own above.\n e.preventDefault();\n isClosingRef.current = true;\n requestAnimationFrame(() => {\n isClosingRef.current = false;\n });\n },\n noPadding: true,\n style: { zIndex: calendarZIndex },\n zIndex: calendarZIndex,\n }}\n >\n <Popover.Trigger asChild>\n <DateRangeInputs {...mergeProps(groupProps, containerFocusProps)} ref={ref}>\n {/* @ts-expect-error [strict-migration] The following line is not strict; please fix! */}\n <DateField\n ref={startFieldRef}\n inputPosition='start'\n focused={dateMode === 'start'}\n disabled={props.disabled}\n size={props.size}\n {...mergeProps(startFieldProps, startFocusWithinProps, { onKeyDown: handleKeyDown })}\n />\n {/* @ts-expect-error [strict-migration] The following line is not strict; please fix! */}\n <DateField\n ref={endFieldRef}\n inputPosition='end'\n focused={dateMode === 'end'}\n disabled={props.disabled}\n size={props.size}\n {...mergeProps(endFieldProps, endFocusWithinProps, { onKeyDown: handleKeyDown })}\n />\n {props.showClear && (\n <ClearRangeButton\n {...pressClearProps}\n type='button'\n disabled={isValueNull}\n aria-label='Clear date range'\n >\n <CircleXInverseIcon />\n </ClearRangeButton>\n )}\n <VisuallyHidden>\n <OpenButton onOpen={openCalendarWithFocus} disabled={props.disabled} />\n </VisuallyHidden>\n </DateRangeInputs>\n </Popover.Trigger>\n <RangeCalendar\n {...{ ...calendarProps, autoFocus: undefined }}\n calendarRef={calendarRef}\n setDateMode={setDateMode}\n setValue={state.setValue}\n granularity={granularity}\n hidePresets={props.hidePresets}\n visibleMonths={props.visibleMonths}\n onPresetSelect={handlePresetSelect}\n selectedPreset={selectedPreset}\n onSelectDate={(dateVal) => {\n /**\n * Please use caution when editing the logic below.\n * It is specific to react-aria's date picker and can be brittle.\n */\n if (dateVal) {\n const date = state.hasTime ? toCalendarDateTime(dateVal) : dateVal;\n\n if (dateMode === 'start') {\n // Handle a case where we've deleted both dates\n if (state.value.end == null && state.value.start == null) {\n state.setValue({\n start: date,\n end: date,\n });\n }\n // If end becomes the start\n else if (state.value.end && date.compare(state.value.end) > 0) {\n state.setValue({\n start: state.value.end,\n end: state.value.end.set(dateVal), // Preserve time\n });\n } else {\n state.setValue({\n // if start is not set, set it to the date or date + time value, otherwise set the dateVal to preserve time\n start: state.value.start == null ? date : state.value.start.set(dateVal),\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n\n end: state.value.end,\n });\n }\n setDateMode('end');\n } else {\n // Handle a case where we've deleted both dates\n if (state.value.end == null && state.value.start == null) {\n state.setValue({\n start: date,\n end: date,\n });\n }\n // If start becomes the end\n else if (state.value.start && date.compare(state.value.start) < 0) {\n state.setValue({\n start: state.value.start.set(dateVal),\n end: state.value.start,\n });\n } else {\n state.setValue({\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n start: state.value.start,\n // if end is not set, set it to the date or date + time value, otherwise set the dateVal to preserve time\n end: state.value.end == null ? date : state.value.end.set(dateVal),\n });\n }\n // Close popover and keep focus on end field\n state.setOpen(false);\n }\n }\n }}\n minDate={props.minDate}\n maxDate={props.maxDate}\n />\n </Popover>\n </DateRangeContainer>\n );\n};\n\nexport default DateRangePicker;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAa,oBAAoB,OAAO,GAAG;;;AAI3C,MAAa,iBAAiB,OAAO,GAAG;;;mBAGrB,QAAQ,GAAG;;AAG9B,MAAa,kBAAkB,OAAO,GAAG;IACrC,WAAW,cAAc;;;;AAK7B,MAAM,uBAAuB,OAAO,WAAW;;;;AAK/C,MAAa,kBAAkB,UAA2B;CACxD,MAAM,MAAM,QAAQ;CAEpB,MAAM,EAAE,gBAAgB,UAAU,OAAO,IAAI;AAE7C,QAEE,oBAAC,sBAAD;EAAsB,GAAI;EAAa,WAAW,MAAM;EAAgB;YACrE,MAAM;EACc,CAAA;;;;AC5B3B,MAAM,wBAAwB,OAAO,EAAE;;;;;;AAevC,MAAM,qBAAqB,OAAO,MAA+B;IAC7D,WAAW,WAAW;;;;;;;;;KASrB,EAAE,YAAY,YAAY;AAC3B,KAAI,CAAC,WACH,QAAO;CAET,MAAM,SAAS,eAAe,MAAM;AACpC,QAAO,GAAG;oBACM,SAAS,UAAU,OAAO,eAAe,OAAO,UAAU,GAAG,MAAM,cAAc;QAC7F,SAAS,UAAU,OAAO,UAAU,KAAK,GAAG;;EAEhD;;KAEC,EAAE,kBAAkB,YACrB,oBACA,GAAG;oBACa,cAAc,OAAO,iBAAiB,MAAM,wBAAwB,CAAC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,OAAO;QACP,KAAK;QACN,CAAC;gBAGK,MAAM,MAAM,OAAO,KAAK,QAAQ,MAAM,MAAM,IAAI,GAAG,EAC1D,OAAM,SAAS;QACb,OAAO,MAAM,MAAM;QACnB,KAAK,MAAM,MAAM,IAAI,IAAI,QAAQ;QAClC,CAAC;WAEF,OAAM,SAAS;QAEb,OAAO,MAAM,MAAM,SAAS,OAAO,OAAO,MAAM,MAAM,MAAM,IAAI,QAAQ;QAGxE,KAAK,MAAM,MAAM;QAClB,CAAC;AAEJ,mBAAY,MAAM;aACb;AAEL,WAAI,MAAM,MAAM,OAAO,QAAQ,MAAM,MAAM,SAAS,KAClD,OAAM,SAAS;QACb,OAAO;QACP,KAAK;QACN,CAAC;gBAGK,MAAM,MAAM,SAAS,KAAK,QAAQ,MAAM,MAAM,MAAM,GAAG,EAC9D,OAAM,SAAS;QACb,OAAO,MAAM,MAAM,MAAM,IAAI,QAAQ;QACrC,KAAK,MAAM,MAAM;QAClB,CAAC;WAEF,OAAM,SAAS;QAEb,OAAO,MAAM,MAAM;QAEnB,KAAK,MAAM,MAAM,OAAO,OAAO,OAAO,MAAM,MAAM,IAAI,IAAI,QAAQ;QACnE,CAAC;AAGJ,aAAM,QAAQ,MAAM;;;;IAI1B,SAAS,MAAM;IACf,SAAS,MAAM;IACf,CAAA,CACM;KACS"}
1
+ {"version":3,"file":"DatePicker-BcjrAr7o.mjs","names":["useLocale","OpenButton","Popover","Card","RangeCalendarPresets","Popover"],"sources":["../components/DatePicker/Calendar/CalendarBase.tsx","../components/DatePicker/Calendar/CalendarCell.tsx","../components/DatePicker/Calendar/CalendarGrid.tsx","../components/DatePicker/common.ts","../components/DatePicker/Calendar/Calendar.tsx","../components/DatePicker/DateField.tsx","../components/DatePicker/DatePicker.tsx","../components/DatePicker/Calendar/RangeCalendarPresets.tsx","../components/DatePicker/Calendar/RangeCalendar.tsx","../components/DatePicker/DateRangePicker.tsx"],"sourcesContent":["import { useRef } from 'react';\nimport { useButton } from 'react-aria';\nimport styled from 'styled-components';\n\nimport { Spacing, Typography } from '@persona/design-tokens';\nimport { IconButton } from 'design-system/components/Button';\nimport type { IconButtonProps } from 'design-system/components/Button/IconButton';\n\nexport const CalendarContainer = styled.div`\n display: inline-block;\n`;\n\nexport const CalendarHeader = styled.div`\n display: flex;\n align-items: center;\n margin-bottom: ${Spacing[2]};\n`;\n\nexport const CalendarHeading = styled.div`\n ${Typography.TextLargeBold};\n flex: 1;\n text-align: center;\n`;\n\nconst StyledCalendarButton = styled(IconButton)`\n width: 32px;\n height: 32px;\n`;\n\nexport const CalendarButton = (props: IconButtonProps) => {\n const ref = useRef();\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n const { buttonProps } = useButton(props, ref);\n\n return (\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n <StyledCalendarButton {...buttonProps} className={props.className} ref={ref}>\n {props.children}\n </StyledCalendarButton>\n );\n};\n","import { type CalendarDate, type DateValue, isSameDay, isSameMonth } from '@internationalized/date';\nimport { useRef } from 'react';\nimport { useCalendarCell } from 'react-aria';\nimport type { CalendarState, RangeCalendarState } from 'react-stately';\nimport styled, { css } from 'styled-components';\n\nimport { BorderRadius, Color, Typography } from '@persona/design-tokens';\nimport { withAlpha } from 'design-system/lib/color';\nimport { semanticColor, semanticTokens } from 'design-system/lib/semanticColor';\n\nconst CalendarCellContainer = styled.td`\n text-align: center;\n width: 38px;\n height: 38px;\n padding: 0px;\n`;\n\ninterface CalendarCellButtonProps {\n isSelected?: boolean;\n isSelectionStart?: boolean;\n isSelectionEnd?: boolean;\n isInvalid?: boolean;\n isDisabled?: boolean;\n}\n\nconst CalendarCellButton = styled.button<CalendarCellButtonProps>`\n ${Typography.TextMedium};\n border-style: none;\n padding: 0;\n background: none;\n width: 100%;\n height: 100%;\n cursor: pointer;\n position: relative;\n\n ${({ isSelected, theme }) => {\n if (!isSelected) {\n return null;\n }\n const tokens = semanticTokens(theme);\n return css`\n background: ${tokens ? withAlpha(tokens.SurfaceAccent, tokens.Opacity25) : Color.CorePurple100};\n ${tokens ? `color: ${tokens.FgPrimary};` : ''}\n `;\n }}\n\n ${({ isSelectionStart, theme }) =>\n isSelectionStart &&\n css`\n background: ${semanticColor(theme, 'ActionPrimary', Color.BackgroundButtonPrimary)};\n color: ${semanticColor(theme, 'FgInverse', Color.TextInverse)};\n border-top-left-radius: ${BorderRadius.Sm};\n border-bottom-left-radius: ${BorderRadius.Sm};\n `}\n\n ${({ isSelectionEnd, theme }) =>\n isSelectionEnd &&\n css`\n background: ${semanticColor(theme, 'ActionPrimary', Color.BackgroundButtonPrimary)};\n color: ${semanticColor(theme, 'FgInverse', Color.TextInverse)};\n border-top-right-radius: ${BorderRadius.Sm};\n border-bottom-right-radius: ${BorderRadius.Sm};\n `}\n\n ${({ isDisabled, theme }) =>\n isDisabled &&\n css`\n color: ${semanticColor(theme, 'FgDisabled', Color.CoreSlate300)};\n `}\n\n ${({ isInvalid, theme }) =>\n isInvalid &&\n css`\n background: ${semanticColor(theme, 'FeedbackDanger4', Color.BackgroundButtonDanger)};\n color: ${semanticColor(theme, 'FgInverseStatic', Color.TextInverse)};\n `}\n\n &:focus-visible {\n outline: 2px solid ${({ theme }) => semanticColor(theme, 'BorderFocus', Color.BorderFocus)};\n outline-offset: -2px;\n box-shadow: ${({ theme }) => semanticColor(theme, 'SurfacePrimary', Color.PrimaryWhite)} 0px 0px 0px 3px inset;\n z-index: 1;\n }\n`;\n\ninterface CalendarCellProps {\n state: CalendarState | RangeCalendarState;\n date: CalendarDate;\n currentMonth: DateValue;\n}\n\nconst CalendarCell = ({ state, date, currentMonth }: CalendarCellProps) => {\n const ref = useRef();\n const { cellProps, buttonProps, isSelected, isInvalid, isDisabled, formattedDate } =\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n useCalendarCell({ date }, state, ref);\n\n const highlightedRange = 'highlightedRange' in state && state.highlightedRange;\n\n const isOutsideMonth = !isSameMonth(currentMonth, date);\n const isSelectionStart = highlightedRange ? isSameDay(date, highlightedRange.start) : isSelected;\n const isSelectionEnd = highlightedRange ? isSameDay(date, highlightedRange.end) : isSelected;\n\n return (\n <CalendarCellContainer {...cellProps}>\n <CalendarCellButton\n {...buttonProps}\n hidden={isOutsideMonth}\n isSelected={isSelected}\n isSelectionStart={isSelectionStart}\n isSelectionEnd={isSelectionEnd}\n isInvalid={isInvalid}\n isDisabled={isDisabled}\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n ref={ref}\n >\n {formattedDate}\n </CalendarCellButton>\n </CalendarCellContainer>\n );\n};\n\nexport default CalendarCell;\n","import { type DateDuration, endOfMonth, getWeeksInMonth } from '@internationalized/date';\nimport { useCalendarGrid, useLocale } from 'react-aria';\nimport type { CalendarState, RangeCalendarState } from 'react-stately';\nimport styled from 'styled-components';\n\nimport { Color, Typography } from '@persona/design-tokens';\nimport { semanticColor } from 'design-system/lib/semanticColor';\n\nimport CalendarCell from './CalendarCell';\n\nconst CalendarGridContainer = styled.table`\n width: 266px;\n border-spacing: 0px;\n border-collapse: collapse;\n\n &:focus-visible {\n outline: 2px solid ${({ theme }) => semanticColor(theme, 'BorderFocus', Color.BorderFocus)};\n outline-offset: 1px;\n }\n`;\n\nconst CalendarGridDayHeader = styled.th`\n ${Typography.TextMedium};\n color: ${({ theme }) => semanticColor(theme, 'FgSecondary', Color.TextSecondary)};\n`;\n\ninterface CalendarGridProps {\n state: CalendarState | RangeCalendarState;\n offset?: DateDuration;\n skipFromTabOrder?: boolean;\n}\n\nconst CalendarGrid = ({ state, offset = {}, skipFromTabOrder = false }: CalendarGridProps) => {\n const { locale } = useLocale();\n const startDate = state.visibleRange.start.add(offset);\n const endDate = endOfMonth(startDate);\n\n const { gridProps, headerProps, weekDays } = useCalendarGrid(\n {\n startDate,\n endDate,\n },\n state,\n );\n\n const weeksInMonth = getWeeksInMonth(startDate, locale);\n\n // Remove second calendar grid from tab order - use arrow keys to navigate between months\n const modifiedGridProps = skipFromTabOrder ? { ...gridProps, tabIndex: -1 } : gridProps;\n\n return (\n <CalendarGridContainer {...modifiedGridProps}>\n <thead {...headerProps}>\n <tr>\n {weekDays.map((day, index) => (\n <CalendarGridDayHeader key={index}>{day}</CalendarGridDayHeader>\n ))}\n </tr>\n </thead>\n <tbody>\n {[...new Array(weeksInMonth).keys()].map((weekIndex) => (\n <tr key={weekIndex}>\n {state\n .getDatesInWeek(weekIndex, startDate)\n .map((date, i) =>\n date ? (\n <CalendarCell key={i} state={state} date={date} currentMonth={startDate} />\n ) : (\n <td key={i} />\n ),\n )}\n </tr>\n ))}\n </tbody>\n </CalendarGridContainer>\n );\n};\n\nexport default CalendarGrid;\n","import { GregorianCalendar } from '@internationalized/date';\n\nexport const createCalendar = () => new GregorianCalendar();\n","import type { Ref } from 'react';\nimport { type AriaCalendarProps, type DateValue, useCalendar, useLocale } from 'react-aria';\nimport { useCalendarState } from 'react-stately';\n\nimport { ArrowLeftIcon, ArrowRightIcon } from '@persona/icons';\nimport {\n CalendarButton,\n CalendarContainer,\n CalendarHeader,\n CalendarHeading,\n} from 'design-system/components/DatePicker/Calendar/CalendarBase';\nimport CalendarGrid from 'design-system/components/DatePicker/Calendar/CalendarGrid';\nimport { createCalendar } from 'design-system/components/DatePicker/common';\n\ninterface CalendarProps extends AriaCalendarProps<DateValue> {\n calendarRef?: Ref<HTMLDivElement>;\n}\n\nconst Calendar = (props: CalendarProps) => {\n const { locale } = useLocale();\n const state = useCalendarState({ ...props, locale, createCalendar });\n const { calendarProps, prevButtonProps, nextButtonProps, title } = useCalendar(props, state);\n\n return (\n <CalendarContainer {...calendarProps} ref={props.calendarRef}>\n <CalendarHeader>\n <CalendarButton {...prevButtonProps}>\n <ArrowLeftIcon />\n </CalendarButton>\n <CalendarHeading>{title}</CalendarHeading>\n <CalendarButton {...nextButtonProps}>\n <ArrowRightIcon />\n </CalendarButton>\n </CalendarHeader>\n <CalendarGrid state={state} />\n </CalendarContainer>\n );\n};\n\nexport default Calendar;\n","import type { DateValue } from '@internationalized/date';\nimport { type AriaDateFieldProps, useDateField, useDateSegment } from '@react-aria/datepicker';\nimport { useLocale } from '@react-aria/i18n';\nimport { mergeRefs } from '@react-aria/utils';\nimport {\n type DateFieldState,\n type DateSegment as DateSegmentObj,\n type SegmentType,\n useDateFieldState,\n} from '@react-stately/datepicker';\nimport { forwardRef, useRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Color, Spacing } from '@persona/design-tokens';\nimport { createCalendar } from 'design-system/components/DatePicker/common';\nimport { withAlpha } from 'design-system/lib/color';\nimport { isFocused, isFocusedVisible, isNotDisabled } from 'design-system/lib/pseudoClass';\nimport { semanticColor, semanticOnly, semanticTokens } from 'design-system/lib/semanticColor';\nimport { focusWithinOutline } from 'design-system/mixins/focus';\nimport inputMixin, { type InputMixinProps, type InputSizes } from 'design-system/mixins/input';\nimport type PseudoClassProps from 'design-system/types/PseudoClassProps';\n\ntype DateSegmentContainerProps = { $isComma?: boolean; $isTimezone?: boolean } & PseudoClassProps;\nconst DateSegmentContainer = styled.div<DateSegmentContainerProps>`\n font-variant-numeric: tabular-nums;\n box-sizing: content-box;\n text-align: end;\n\n ${isFocused} {\n outline: 2px solid ${({ theme }) => semanticColor(theme, 'BorderFocus', Color.BorderFocus)};\n outline-offset: 1px;\n background-color: ${({ theme }) => {\n const tokens = semanticTokens(theme);\n return tokens ? withAlpha(tokens.SurfaceAccent, tokens.Opacity25) : Color.CorePurple200;\n }};\n ${semanticOnly((tokens) => `color: ${tokens.FgAccent};`)}\n }\n\n ${({ $isComma, $isTimezone }) =>\n ($isComma || $isTimezone) &&\n css`\n margin-left: 0.25ch;\n margin-right: 0.25ch;\n `}\n\n ${({ $isTimezone }) =>\n $isTimezone &&\n css`\n color: ${({ theme }) => semanticColor(theme, 'FgSecondary', Color.TextSecondary)};\n pointer-events: none;\n\n &:focus {\n outline: none;\n background-color: transparent;\n }\n `}\n`;\n\ntype DateSegmentPlaceholderProps = { isPlaceholder?: boolean; type: SegmentType };\nconst DateSegmentPlaceholder = styled.span<DateSegmentPlaceholderProps>`\n display: block;\n width: 100%;\n pointer-events: none;\n\n &:focus {\n outline: none;\n }\n\n ${({ isPlaceholder }) =>\n isPlaceholder\n ? css`\n height: 100%;\n color: ${({ theme }) => semanticColor(theme, 'FgSecondary', theme.color.text.tertiary)};\n `\n : css`\n visibility: hidden;\n height: 0;\n `}\n ${({ type }) =>\n type === 'literal' &&\n css`\n padding-left: ${Spacing[1]};\n padding-right: ${Spacing[1]};\n `}\n ${({ type, isPlaceholder }) =>\n type === 'month' &&\n isPlaceholder &&\n css`\n width: 3ch;\n `}\n`;\n\ninterface DateSegmentProps {\n segment: DateSegmentObj;\n state: DateFieldState;\n}\n\nfunction DateSegment({ segment, state }: DateSegmentProps) {\n const ref = useRef();\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n const { segmentProps } = useDateSegment(segment, state, ref);\n\n let minWidth: string;\n\n switch (segment.type) {\n case 'dayPeriod': {\n minWidth = '2.75ch';\n break;\n }\n default: {\n minWidth = `${segment.maxValue != null && String(segment.maxValue).length + 0.25}ch`;\n break;\n }\n }\n\n const isComma = segment.type === 'literal' && segment.text === ', ';\n const isTimezone = segment.type === 'timeZoneName';\n\n return (\n <DateSegmentContainer\n {...segmentProps}\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n ref={ref}\n style={{\n ...segmentProps.style,\n minWidth,\n }}\n $isComma={isComma}\n $isTimezone={isTimezone}\n {...(isTimezone && { tabIndex: -1, role: 'presentation' })}\n >\n {/* Always reserve space for the placeholder, to prevent layout shift when editing. */}\n {segment.placeholder && (\n <DateSegmentPlaceholder\n aria-hidden='true'\n isPlaceholder={segment.isPlaceholder}\n type={segment.type}\n >\n {segment.placeholder}\n </DateSegmentPlaceholder>\n )}\n {segment.isPlaceholder ? '' : segment.text}\n </DateSegmentContainer>\n );\n}\n\nconst InputBox = styled.div<InputMixinProps & { $inputPosition: 'start' | 'end' }>`\n ${inputMixin};\n display: flex;\n padding-left: ${Spacing[2]};\n padding-right: ${Spacing[2]};\n line-height: 1;\n position: relative;\n\n &${isFocusedVisible}${isNotDisabled} {\n position: relative;\n z-index: 1;\n }\n\n ${focusWithinOutline}\n\n ${({ $inputPosition }) => {\n switch ($inputPosition) {\n case 'start': {\n return css`\n border-top-right-radius: 0px;\n border-bottom-right-radius: 0px;\n `;\n }\n case 'end': {\n return css`\n margin-left: -1px;\n border-top-left-radius: 0px;\n border-bottom-left-radius: 0px;\n `;\n }\n }\n }}\n`;\n\ninterface DateFieldProps extends AriaDateFieldProps<DateValue> {\n inputPosition?: 'start' | 'end';\n focused?: boolean;\n readOnly?: boolean;\n value?: DateValue;\n disabled?: boolean;\n size?: InputSizes;\n style?: React.CSSProperties;\n dateFieldProps?: {\n style?: React.CSSProperties;\n };\n hasError?: boolean;\n}\n\nexport const DateField = forwardRef<HTMLDivElement, DateFieldProps>(function DateField(\n props: DateFieldProps,\n forwardedRef,\n) {\n const { locale } = useLocale();\n const state = useDateFieldState({\n ...props,\n locale,\n createCalendar,\n });\n\n const ref = useRef<HTMLDivElement>();\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n const { fieldProps } = useDateField(props, state, ref);\n\n return (\n <InputBox\n {...fieldProps}\n {...(props.dateFieldProps || {})}\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n ref={mergeRefs<HTMLDivElement>(ref, forwardedRef)}\n focused={props.focused}\n disabled={props.disabled}\n aria-label={props['aria-label']}\n $size={props.size ?? 'md'}\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n $inputPosition={props.inputPosition}\n hasError={props.hasError}\n >\n {state.segments.map((segment, i) => (\n <DateSegment key={i} segment={segment} state={state} />\n ))}\n </InputBox>\n );\n});\n\nexport default DateField;\n","import type { DateValue } from '@internationalized/date';\nimport type { DatePickerProps as DatePickerBase } from '@react-types/datepicker';\nimport { type RefObject, useCallback, useRef } from 'react';\nimport { mergeProps, useButton, useDatePicker, useFocusWithin, VisuallyHidden } from 'react-aria';\nimport { useDatePickerState } from 'react-stately';\n\nimport Calendar from 'design-system/components/DatePicker/Calendar/Calendar';\nimport DateField from 'design-system/components/DatePicker/DateField';\nimport Popover from 'design-system/components/Popover';\nimport { Z_INDICES } from 'design-system/lib/zindex';\nimport type { InputSizes } from 'design-system/mixins/input';\n\nexport interface DatePickerProps extends DatePickerBase<DateValue> {\n id?: string;\n dateFieldProps?: {\n style?: React.CSSProperties;\n };\n disabled?: boolean;\n size?: InputSizes;\n useModalZIndex?: boolean;\n}\n\nconst OpenButton = ({ calendarRef }: { calendarRef: RefObject<HTMLElement> }) => {\n const openCalBtnRef = useRef<HTMLButtonElement>(null);\n const { buttonProps } = useButton(\n {\n onPress: () => {\n if (calendarRef.current) {\n (\n calendarRef.current.querySelector('button[aria-label=\"Previous\"]') as HTMLButtonElement\n ).focus();\n }\n },\n },\n openCalBtnRef,\n );\n\n return <button {...buttonProps} ref={openCalBtnRef} aria-label='Open calendar' />;\n};\n\nexport const DatePicker = (props: DatePickerProps) => {\n const state = useDatePickerState(props);\n const ref = useRef<HTMLDivElement>(null);\n const fieldRef = useRef<HTMLDivElement>(null);\n const { groupProps, fieldProps, calendarProps } = useDatePicker(props, state, ref);\n const calendarRef = useRef<HTMLDivElement>(null);\n // A ref, not state: the close sequence focuses the field before a state update would commit.\n const isClosingRef = useRef(false);\n\n const { focusWithinProps } = useFocusWithin({\n onFocusWithin: () => {\n if (!state.isOpen && !isClosingRef.current) {\n state.setOpen(true);\n }\n },\n onBlurWithin: (e) => {\n // Close calendar if next target is not within the calendar\n if (e.relatedTarget && !calendarRef?.current?.contains(e.relatedTarget) && state.isOpen) {\n state.setOpen(false);\n }\n },\n });\n\n const handleOutsideClick = (e: Event) => {\n const target = e.target as Node;\n // Don't close if clicking on the date input itself\n if (ref.current?.contains(target)) {\n return;\n }\n if (state.isOpen) {\n state.setOpen(false);\n }\n };\n\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n if (event.key === 'Enter' && !state.isOpen) {\n event.preventDefault();\n state.setOpen(true);\n }\n },\n [state],\n );\n\n return (\n <div style={{ display: 'flex', flexDirection: 'column' }}>\n <Popover\n open={state.isOpen}\n modal={false}\n contentProps={{\n style: { zIndex: props.useModalZIndex ? Z_INDICES.modalDropdown : Z_INDICES.dropdown },\n align: 'start',\n 'aria-modal': true,\n onInteractOutside: handleOutsideClick,\n onEscapeKeyDown: () => {\n state.setOpen(false);\n },\n onCloseAutoFocus: (e: Event) => {\n // Prevent Radix's default focus restoration\n e.preventDefault();\n isClosingRef.current = true;\n\n // Manually restore focus to the date field\n if (fieldRef.current) {\n const firstEditableSegment = fieldRef.current.querySelector('[tabindex=\"0\"]');\n if (firstEditableSegment instanceof HTMLElement) {\n firstEditableSegment.focus();\n }\n }\n\n // Reset flag after focus is done\n requestAnimationFrame(() => {\n isClosingRef.current = false;\n });\n },\n noPadding: true,\n }}\n >\n <Popover.Trigger asChild>\n <div\n {...mergeProps(groupProps, focusWithinProps)}\n ref={ref}\n style={{ display: 'flex', position: 'relative' }}\n >\n <DateField\n ref={fieldRef}\n id={props.id}\n dateFieldProps={props.dateFieldProps}\n disabled={props.disabled}\n size={props.size}\n {...mergeProps(fieldProps, { onKeyDown: handleKeyDown })}\n value={fieldProps.value ?? undefined}\n />\n <VisuallyHidden>\n <OpenButton calendarRef={calendarRef} />\n </VisuallyHidden>\n </div>\n </Popover.Trigger>\n <Calendar\n {...{ ...calendarProps, autoFocus: undefined }}\n calendarRef={calendarRef}\n id='calendar-popover'\n />\n </Popover>\n </div>\n );\n};\n\nexport default DatePicker;\n","import {\n type CalendarDate,\n type DateValue,\n endOfMonth,\n endOfYear,\n startOfMonth,\n startOfYear,\n today,\n} from '@internationalized/date';\nimport type { RangeValue } from '@react-types/shared';\nimport { Settings } from 'luxon';\nimport { memo, useRef } from 'react';\nimport { mergeProps, useButton } from 'react-aria';\nimport type { RangeCalendarState } from 'react-stately';\nimport styled, { css } from 'styled-components';\n\nimport type { DateFilterPreset } from '@persona/design-system/lib/date-filter';\nimport { Color } from '@persona/design-tokens';\nimport { MenuItem, MenuList } from 'design-system/components/Menu';\nimport { isFocused, isHovered, isNotDisabled } from 'design-system/lib/pseudoClass';\nimport { semanticColor } from 'design-system/lib/semanticColor';\n\ninterface DateRangePreset {\n id: DateFilterPreset;\n label: string;\n range: RangeValue<CalendarDate>;\n}\n\n/** The preset windows the picker offers; the codec resolves the same ids on read. */\nexport const getDefaultPresets = (tz: string): DateRangePreset[] => {\n const now = today(tz);\n return [\n {\n id: 'last_7_days',\n label: 'Last 7 days',\n range: {\n start: now.subtract({ days: 7 }),\n end: now,\n },\n },\n {\n id: 'last_14_days',\n label: 'Last 14 days',\n range: {\n start: now.subtract({ days: 14 }),\n end: now,\n },\n },\n {\n id: 'last_30_days',\n label: 'Last 30 days',\n range: {\n start: now.subtract({ days: 30 }),\n end: now,\n },\n },\n {\n id: 'this_month',\n label: 'This month',\n range: {\n start: startOfMonth(now),\n // Effectively, this should always be today, since we can't look forward\n end: now,\n },\n },\n {\n id: 'last_month',\n label: 'Last month',\n range: {\n start: startOfMonth(now.subtract({ months: 1 })),\n end: endOfMonth(now.subtract({ months: 1 })),\n },\n },\n {\n id: 'this_year',\n label: 'This year',\n range: {\n start: startOfYear(now),\n end: now,\n },\n },\n {\n id: 'last_year',\n label: 'Last year',\n range: {\n start: startOfYear(now.subtract({ years: 1 })),\n end: endOfYear(now.subtract({ years: 1 })),\n },\n },\n ];\n};\n\n/**\n * Compare two date values by year/month/day only, ignoring time components.\n */\nconst datesMatchByDay = (a: CalendarDate, b: DateValue): boolean =>\n a.year === b.year && a.month === b.month && a.day === b.day;\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n`;\n\ninterface PresetButtonProps {\n state: RangeCalendarState;\n preset: DateRangePreset;\n isSelected: boolean;\n setDateMode: (mode: 'start' | 'end' | null) => void;\n onPresetSelect?: (preset: DateFilterPreset, commit: () => void) => void;\n commitRange: (value: RangeValue<DateValue>) => void;\n}\n\nconst StyledPresetButton = styled(MenuItem)`\n ${({ selected }) =>\n !selected &&\n css`\n &${isNotDisabled}${isHovered}, &${isNotDisabled}${isFocused} {\n background-color: transparent;\n }\n `}\n\n &:focus-visible {\n // MenuItems default to outline: none, so we need to override it here.\n outline: 2px solid ${({ theme }) => semanticColor(theme, 'BorderFocus', Color.BorderFocus)} !important;\n outline-offset: 1px;\n }\n`;\n\ninterface DateRangePickerPresetsProps {\n presetsFn?: (tz: string) => DateRangePreset[];\n state: RangeCalendarState;\n setDateMode: (mode: 'start' | 'end' | null) => void;\n onPresetSelect?: (preset: DateFilterPreset, commit: () => void) => void;\n selectedPreset?: DateFilterPreset | null;\n commitRange: (value: RangeValue<DateValue>) => void;\n}\n\nconst PresetButton = ({\n commitRange,\n state,\n preset,\n isSelected,\n setDateMode,\n onPresetSelect,\n ...props\n}: PresetButtonProps) => {\n const ref = useRef<HTMLDivElement>();\n const { buttonProps } = useButton(\n {\n onPress: () => {\n const commit = () => commitRange(preset.range);\n\n if (onPresetSelect) {\n onPresetSelect(preset.id, commit);\n } else {\n commit();\n }\n setDateMode(null);\n },\n },\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n ref,\n );\n\n // Strip aria-current from useButton's props so it doesn't override MenuItem's.\n const { 'aria-current': _ariaCurrent, ...mergedProps } = mergeProps(props, buttonProps);\n\n return (\n <StyledPresetButton\n selected={isSelected}\n {...mergedProps}\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n ref={ref}\n >\n {preset.label}\n </StyledPresetButton>\n );\n};\n\nconst DateRangePickerPresets = ({\n presetsFn = getDefaultPresets,\n commitRange,\n state,\n setDateMode,\n onPresetSelect,\n selectedPreset,\n ...props\n}: DateRangePickerPresetsProps) => {\n // The reason that we need to do this at render time is because the default timezone for moment is set after\n // the current User's timezone is loaded. Thus we woudln't be getting the right timezone unless if we defer getting\n // the timezone.\n const presets = presetsFn(Settings.defaultZone.name);\n\n // First match wins — prevents multiple presets appearing selected when ranges overlap.\n const { value } = state;\n const selectedPresetIndex = value\n ? presets.findIndex(\n (preset) =>\n datesMatchByDay(preset.range.start, value.start) &&\n datesMatchByDay(preset.range.end, value.end),\n )\n : -1;\n\n // `undefined` falls back to matching on dates; `null` is an explicit \"no preset\".\n const infersSelection = typeof selectedPreset === 'undefined';\n\n return (\n <Container {...props}>\n <MenuList aria-label='Date range presets'>\n {presets.map((preset, i) => (\n <PresetButton\n key={i}\n preset={preset}\n commitRange={commitRange}\n state={state}\n setDateMode={setDateMode}\n onPresetSelect={onPresetSelect}\n isSelected={infersSelection ? i === selectedPresetIndex : preset.id === selectedPreset}\n />\n ))}\n </MenuList>\n </Container>\n );\n};\n\n// Skips re-renders driven by calendar state the preset list does not read —\n// focus and hover updates fire on every pointer move during range selection.\nconst arePropsEqual = (\n prevProps: DateRangePickerPresetsProps,\n nextProps: DateRangePickerPresetsProps,\n) => {\n if (\n prevProps.selectedPreset !== nextProps.selectedPreset ||\n prevProps.onPresetSelect !== nextProps.onPresetSelect ||\n prevProps.commitRange !== nextProps.commitRange ||\n prevProps.setDateMode !== nextProps.setDateMode ||\n prevProps.presetsFn !== nextProps.presetsFn\n ) {\n return false;\n }\n\n const prevValue = prevProps.state.value;\n const nextValue = nextProps.state.value;\n\n if (!prevValue && !nextValue) {\n return true;\n }\n if (!prevValue || !nextValue) {\n return false;\n }\n\n return (\n prevValue.start.compare(nextValue.start) === 0 && prevValue.end.compare(nextValue.end) === 0\n );\n};\n\nexport default memo(DateRangePickerPresets, arePropsEqual);\n","import {\n type CalendarDate,\n type CalendarDateTime,\n type DateValue,\n now,\n toCalendarDateTime,\n} from '@internationalized/date';\nimport type { RangeValue } from '@react-types/shared';\nimport { range } from 'lodash-es';\nimport { Settings } from 'luxon';\nimport { type Ref, useCallback, useEffect, useRef } from 'react';\nimport {\n type DateRange,\n type RangeCalendarProps as RangeCalendarBaseProps,\n useDateFormatter,\n useLocale,\n useRangeCalendar,\n VisuallyHidden,\n} from 'react-aria';\nimport { type RangeCalendarState, useRangeCalendarState } from 'react-stately';\nimport styled from 'styled-components';\n\nimport type { DateFilterPreset } from '@persona/design-system/lib/date-filter';\nimport { BorderRadius, Color, Spacing } from '@persona/design-tokens';\nimport { ArrowLeftIcon, ArrowRightIcon } from '@persona/icons';\nimport Card from 'design-system/components/Card';\nimport {\n CalendarButton,\n CalendarContainer,\n CalendarHeader,\n CalendarHeading,\n} from 'design-system/components/DatePicker/Calendar/CalendarBase';\nimport CalendarGrid from 'design-system/components/DatePicker/Calendar/CalendarGrid';\nimport RangeCalendarPresets from 'design-system/components/DatePicker/Calendar/RangeCalendarPresets';\nimport { createCalendar } from 'design-system/components/DatePicker/common';\nimport { semanticColor } from 'design-system/lib/semanticColor';\n\nconst RangeCalendarHeader = styled(CalendarHeader)`\n gap: ${Spacing[5]};\n`;\n\nconst CalendarHeaderMonth = styled.div`\n display: grid;\n grid-template-columns: minmax(auto, 1fr) auto minmax(auto, 1fr);\n grid-template-areas: 'prev title next';\n width: 266px;\n align-items: center;\n`;\n\nconst CalendarGrids = styled.div`\n display: flex;\n gap: ${Spacing[5]};\n align-items: start;\n`;\n\nconst PrevButton = styled(CalendarButton)`\n grid-area: prev;\n justify-self: start;\n border-radius: ${BorderRadius.Sm};\n`;\n\nconst NextButton = styled(CalendarButton)`\n grid-area: next;\n justify-self: end;\n border-radius: ${BorderRadius.Sm};\n`;\n\nconst RangeCalendarHeading = styled(CalendarHeading)`\n grid-area: title;\n`;\n\nconst RangeCalendarContainer = styled.div`\n display: flex;\n`;\n\nconst PresetsContainer = styled(Card.Body)`\n border-right: 1px solid ${({ theme }) => semanticColor(theme, 'BorderDivider', Color.BorderHairline)};\n`;\n\nexport interface RangeCalendarProps extends RangeCalendarBaseProps<DateValue> {\n minDate?: RangeCalendarBaseProps<DateValue>['minValue'];\n maxDate?: RangeCalendarBaseProps<DateValue>['maxValue'];\n calendarRef?: Ref<HTMLDivElement>;\n hidePresets?: boolean;\n visibleMonths?: 1 | 2;\n onSelectDate?: (d: CalendarDate) => void;\n setDateMode: (mode: 'start' | 'end' | null) => void;\n onPresetSelect?: (preset: DateFilterPreset, commit: () => void) => void;\n selectedPreset?: DateFilterPreset | null;\n /**\n * From setValue of DateRangePicker\n */\n setValue: (value: DateRange | null) => void;\n granularity: 'day' | 'hour' | 'minute' | 'second';\n}\n\nconst hasTimeComponent = (date: DateValue) => 'hour' in date;\n\nconst earliest = (a: CalendarDateTime, b: CalendarDateTime) => (a.compare(b) <= 0 ? a : b);\n\n/**\n * Reaches the end of the preset's final day, but never past the present — filters\n * reject a future bound and drop the range entirely. The present is floored to the\n * minute, the finest the picker can express, so the bound is a stable value rather\n * than the sub-second noise of whenever the click landed.\n */\nconst presetEnd = (end: CalendarDateTime) =>\n earliest(\n end.set({ hour: 23, minute: 59, second: 59, millisecond: 999 }),\n toCalendarDateTime(now(Settings.defaultZone.name)).set({ second: 0, millisecond: 0 }),\n );\n\nconst RangeCalendar = ({\n calendarRef,\n onSelectDate,\n minDate,\n maxDate,\n hidePresets,\n visibleMonths = 2,\n setDateMode,\n onPresetSelect,\n selectedPreset,\n setValue,\n granularity,\n ...props\n}: RangeCalendarProps) => {\n const { locale } = useLocale();\n // Must gather the TZ from the user's settings.\n const timezoneName = Settings.defaultZone.name;\n const rangeCalendarState = useRangeCalendarState({\n ...props,\n minValue: minDate,\n maxValue: maxDate,\n visibleDuration: {\n months: visibleMonths,\n },\n locale,\n createCalendar,\n });\n\n const state: RangeCalendarState = {\n ...rangeCalendarState,\n setValue: (value) => {\n if (!value || granularity === 'day') {\n rangeCalendarState.setValue(value);\n return;\n }\n\n setValue({\n start: toCalendarDateTime(value.start),\n // A date-only end comes from a preset, where the end date is inclusive.\n end: hasTimeComponent(value.end)\n ? toCalendarDateTime(value.end)\n : presetEnd(toCalendarDateTime(value.end)),\n });\n },\n selectDate: (date) => {\n if (onSelectDate) {\n onSelectDate(date);\n rangeCalendarState.setAnchorDate(null);\n } else {\n rangeCalendarState.selectDate(date);\n }\n },\n };\n\n // The preset list is memoized on its own props, so it can hold a `state` from\n // an earlier render. Committing through a ref keeps the write on the current\n // `onChange` chain instead of one the parent has already replaced.\n const commitRef = useRef(state.setValue);\n useEffect(() => {\n commitRef.current = state.setValue;\n });\n const commitRange = useCallback((value: RangeValue<DateValue>) => commitRef.current(value), []);\n\n const ref = useRef();\n\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n const { calendarProps, prevButtonProps, nextButtonProps } = useRangeCalendar(props, state, ref);\n\n const monthDateFormatter = useDateFormatter({\n month: 'long',\n year: 'numeric',\n timeZone: timezoneName,\n });\n\n const monthHeaders = range(0, visibleMonths).map((i) => {\n return (\n <CalendarHeaderMonth key={`calendar-month-${i}`}>\n {i === 0 && (\n <PrevButton {...prevButtonProps}>\n <ArrowLeftIcon />\n </PrevButton>\n )}\n <RangeCalendarHeading aria-hidden>\n {monthDateFormatter.format(\n state.visibleRange.start.add({ months: i }).toDate(timezoneName),\n )}\n </RangeCalendarHeading>\n {i === visibleMonths - 1 && (\n <NextButton {...nextButtonProps}>\n <ArrowRightIcon />\n </NextButton>\n )}\n </CalendarHeaderMonth>\n );\n });\n\n const monthGrids = range(0, visibleMonths).map((i) => {\n return (\n <CalendarGrid\n key={`calendar-grid-${i}`}\n state={state}\n offset={{ months: i }}\n skipFromTabOrder={i > 0}\n />\n );\n });\n\n return (\n <RangeCalendarContainer ref={calendarRef}>\n {!hidePresets && (\n <PresetsContainer padding={Spacing[3]}>\n <RangeCalendarPresets\n state={state}\n commitRange={commitRange}\n setDateMode={setDateMode}\n onPresetSelect={onPresetSelect}\n selectedPreset={selectedPreset}\n />\n </PresetsContainer>\n )}\n <Card.Body padding={Spacing[3]}>\n {/* @ts-expect-error [strict-migration] The following line is not strict; please fix! */}\n <CalendarContainer {...calendarProps} ref={ref}>\n {/* Calendar header is separate from grid like this to facilitate a11y. */}\n <RangeCalendarHeader>\n <VisuallyHidden isFocusable={false}>{calendarProps['aria-label']}</VisuallyHidden>\n {monthHeaders}\n </RangeCalendarHeader>\n <CalendarGrids>{monthGrids}</CalendarGrids>\n </CalendarContainer>\n </Card.Body>\n </RangeCalendarContainer>\n );\n};\n\nexport default RangeCalendar;\n","import {\n CalendarDate,\n type DateValue,\n parseAbsolute,\n toCalendarDateTime,\n} from '@internationalized/date';\nimport type { DateRangePickerProps as DateRangePickerBase } from '@react-types/datepicker';\nimport type { AriaLabelingProps, RangeValue } from '@react-types/shared';\nimport { DateTime, Settings } from 'luxon';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport {\n mergeProps,\n useButton,\n useDateRangePicker,\n useFocusWithin,\n usePress,\n VisuallyHidden,\n} from 'react-aria';\nimport { useDateRangePickerState } from 'react-stately';\nimport styled from 'styled-components';\n\nimport type { DateFilterPreset } from '@persona/design-system/lib/date-filter';\nimport { Spacing, Typography } from '@persona/design-tokens';\nimport { CircleXInverseIcon } from '@persona/icons';\nimport RangeCalendar from 'design-system/components/DatePicker/Calendar/RangeCalendar';\nimport DateField from 'design-system/components/DatePicker/DateField';\nimport { FormLabel } from 'design-system/components/FormControl';\nimport { ClearButton } from 'design-system/components/Input';\nimport Popover from 'design-system/components/Popover';\nimport { isDisabled } from 'design-system/lib/pseudoClass';\nimport type { InputSizes } from 'design-system/mixins/input';\n\nconst DateRangeContainer = styled.div`\n display: inline-flex;\n flex-direction: column;\n width: 100%;\n`;\n\nconst DateRangeInputs = styled.div`\n display: flex;\n align-items: center;\n`;\n\nconst CustomFormLabel = styled(FormLabel)`\n margin-bottom: ${Spacing[2]};\n ${Typography.TextMediumBold};\n`;\n\nexport type DateRange = {\n startDate?: DateTime;\n endDate?: DateTime;\n};\n\nexport type DateFilterChange =\n | {\n source: 'preset';\n preset: DateFilterPreset;\n range: RangeValue<DateValue>;\n }\n | {\n source: 'calendar';\n range: RangeValue<DateValue> | null;\n }\n | {\n source: 'clear';\n };\n\n/**\n * `onChange` fires for controlled prop replay as well as user edits, so only the\n * code path that started a write can say what that write meant.\n */\ntype WriteOrigin =\n | { kind: 'interaction' }\n | { kind: 'sync' }\n | { kind: 'clear' }\n | { kind: 'preset'; preset: DateFilterPreset };\n\nexport interface DateRangePickerProps extends DateRangePickerBase<DateValue>, AriaLabelingProps {\n dateRange: DateRange;\n onChange: (range: RangeValue<DateValue> | null) => void;\n disabled?: boolean;\n size?: InputSizes;\n minDate?: DateValue;\n maxDate?: DateValue;\n label?: string | null;\n dataTest?: string;\n id?: string;\n hidePresets?: boolean;\n visibleMonths?: 1 | 2;\n className?: string;\n /**\n * Whether or not to display clear button\n */\n showClear?: boolean;\n /**\n * Called when the clear button is clicked/pressed\n */\n onClear?: () => void;\n /**\n * Additive notification of genuine user interactions. Never fires for\n * controlled prop synchronization. `onChange` is unaffected by this prop.\n */\n onDateFilterChange?: (change: DateFilterChange) => void;\n /** `undefined` infers from dates, `null` selects none, and an id selects that preset. */\n selectedPreset?: DateFilterPreset | null;\n /**\n * z-index of the calendar popover\n */\n calendarZIndex?: number;\n /**\n * Element that should contain the calendar portal.\n */\n portalContainer?: HTMLElement | null;\n}\n\nconst OpenButton = ({ onOpen, disabled }: { onOpen: () => void; disabled?: boolean }) => {\n const openCalBtnRef = useRef<HTMLButtonElement>(null);\n const { buttonProps } = useButton(\n {\n isDisabled: disabled,\n onPress: onOpen,\n },\n openCalBtnRef,\n );\n\n return (\n <button\n {...buttonProps}\n type='button'\n ref={openCalBtnRef}\n aria-label='Open calendar'\n tabIndex={-1}\n />\n );\n};\n\nconst ClearRangeButton = styled(ClearButton)`\n height: 16px;\n width: 16px;\n margin-left: ${Spacing[2]};\n\n &${isDisabled}, &:disabled {\n background-color: transparent;\n }\n`;\n\nconst DateRangePicker = ({\n granularity = 'day',\n hideTimeZone = true,\n className,\n calendarZIndex,\n portalContainer,\n onDateFilterChange,\n selectedPreset,\n ...props\n}: DateRangePickerProps) => {\n const writeOriginRef = useRef<WriteOrigin>({ kind: 'interaction' });\n const writeWithOrigin = useCallback((origin: WriteOrigin, commit: () => void) => {\n writeOriginRef.current = origin;\n try {\n commit();\n } finally {\n writeOriginRef.current = { kind: 'interaction' };\n }\n }, []);\n\n const state = useDateRangePickerState({\n granularity,\n hideTimeZone,\n ...props,\n onChange: (range) => {\n props.onChange(range);\n\n const origin = writeOriginRef.current;\n if (origin.kind === 'sync' || origin.kind === 'clear') {\n return;\n }\n if (origin.kind === 'preset' && range) {\n onDateFilterChange?.({ source: 'preset', preset: origin.preset, range });\n return;\n }\n onDateFilterChange?.({ source: 'calendar', range });\n },\n });\n const ref = useRef<HTMLDivElement>(null);\n const startFieldRef = useRef<HTMLDivElement>(null);\n const endFieldRef = useRef<HTMLDivElement>(null);\n const calendarRef = useRef<HTMLDivElement>(null);\n const [dateMode, setDateMode] = useState<'start' | 'end' | null>(null);\n // A ref, not state: focus can return to a field before a state update would commit.\n const isClosingRef = useRef(false);\n const { groupProps, startFieldProps, endFieldProps, calendarProps, labelProps } =\n useDateRangePicker({ granularity, hideTimeZone, ...props }, state, ref);\n\n const focusCalendar = useCallback(() => {\n requestAnimationFrame(() => {\n const firstFocusableCalendarElement = calendarRef.current?.querySelector<HTMLElement>(\n '[role=\"menuitem\"], button:not(:disabled), [tabindex=\"0\"]',\n );\n firstFocusableCalendarElement?.focus();\n });\n }, []);\n\n const openCalendar = useCallback(() => {\n if (!props.disabled && !state.isOpen && !isClosingRef.current) {\n state.setOpen(true);\n }\n }, [props.disabled, state]);\n\n const openCalendarWithFocus = useCallback(() => {\n openCalendar();\n focusCalendar();\n }, [focusCalendar, openCalendar]);\n\n const handlePresetSelect = useCallback(\n (preset: DateFilterPreset, commit: () => void) =>\n writeWithOrigin({ kind: 'preset', preset }, commit),\n [writeWithOrigin],\n );\n\n // Keyed on instants rather than the `DateTime` identities: a caller that parses\n // its range during render hands us new objects every commit, and syncing on that\n // would call `setValue` -> `onChange` -> re-render without end.\n const startInstant = props.dateRange.startDate?.isValid\n ? props.dateRange.startDate.toMillis()\n : undefined;\n const endInstant = props.dateRange.endDate?.isValid\n ? props.dateRange.endDate.toMillis()\n : undefined;\n\n useEffect(() => {\n // If not set, return early\n if (startInstant == null || endInstant == null) {\n return;\n }\n\n // Find out the real time by adjusting the date to the user's timezone\n const startDate = DateTime.fromMillis(startInstant).setZone(Settings.defaultZone);\n const endDate = DateTime.fromMillis(endInstant).setZone(Settings.defaultZone);\n\n if (!startDate.isValid || !endDate.isValid) {\n return;\n }\n\n // Months are 1-indexed, no translations need to happen to CalendarDates\n const startCalendar = state.hasTime\n ? parseAbsolute(startDate.toISO(), Settings.defaultZone.name)\n : new CalendarDate(startDate.year, startDate.month, startDate.day);\n const endCalendar = state.hasTime\n ? parseAbsolute(endDate.toISO(), Settings.defaultZone.name)\n : new CalendarDate(endDate.year, endDate.month, endDate.day);\n\n const dateRangeV2: RangeValue<DateValue> = {\n start: startCalendar,\n end: endCalendar,\n };\n\n writeWithOrigin({ kind: 'sync' }, () => state.setValue(dateRangeV2));\n }, [startInstant, endInstant, granularity]);\n\n // Auto-close overlay when a complete range is selected (e.g., from presets with time enabled)\n const prevValueRef = useRef<RangeValue<DateValue | null> | null>(state.value);\n useEffect(() => {\n const prevValue = prevValueRef.current;\n const currentValue = state.value;\n\n // Update ref for next comparison\n prevValueRef.current = currentValue;\n\n // Close overlay only if BOTH start and end changed simultaneously to DIFFERENT dates (e.g., preset selection)\n // Do not close during manual date selection where:\n // 1. Only one date changes at a time, OR\n // 2. Both dates are set to the same value (initial selection from empty state)\n // Use value comparison (.compare) instead of object identity to handle controlled component re-renders\n const startChanged =\n prevValue?.start && currentValue?.start\n ? prevValue.start.compare(currentValue.start) !== 0\n : prevValue?.start !== currentValue?.start;\n const endChanged =\n prevValue?.end && currentValue?.end\n ? prevValue.end.compare(currentValue.end) !== 0\n : prevValue?.end !== currentValue?.end;\n const datesAreDifferent =\n currentValue?.start &&\n currentValue?.end &&\n currentValue.start.compare(currentValue.end) !== 0;\n\n if (state.isOpen && startChanged && endChanged && datesAreDifferent) {\n state.setOpen(false);\n }\n }, [state.value, state.isOpen]);\n\n const { focusWithinProps: startFocusWithinProps } = useFocusWithin({\n onFocusWithin: () => {\n setDateMode('start');\n openCalendar();\n },\n });\n\n const { focusWithinProps: endFocusWithinProps } = useFocusWithin({\n onFocusWithin: () => {\n setDateMode('end');\n openCalendar();\n },\n });\n\n const { focusWithinProps: containerFocusProps } = useFocusWithin({\n onBlurWithin: () => {\n requestAnimationFrame(() => {\n // Wait for popover focus transitions to settle before closing.\n const activeElement = document.activeElement;\n const isFocusInDateRangeInput =\n activeElement instanceof Node && ref.current?.contains(activeElement);\n const isFocusInCalendar =\n activeElement instanceof Node && calendarRef.current?.contains(activeElement);\n\n if (isFocusInDateRangeInput || isFocusInCalendar) {\n return;\n }\n\n setDateMode(null);\n if (state.isOpen) {\n state.setOpen(false);\n }\n });\n },\n });\n\n const handleOutsideClick = (e: Event) => {\n const target = e.target as Node;\n // Don't close if clicking on the date inputs themselves\n if (ref.current?.contains(target)) {\n return;\n }\n\n // When there's a click outside of the containers + calendars, reset the highlighted date\n // Only close the calendar if it's open\n // Note: Radix UI's onInteractOutside already ensures the interaction is outside the popover content\n if (state.isOpen) {\n setDateMode(null);\n state.setOpen(false);\n }\n };\n\n const { pressProps: pressClearProps } = usePress({\n onPress: () => {\n writeWithOrigin({ kind: 'clear' }, () => state.setValue(null));\n\n if (props.onClear) {\n props.onClear();\n }\n onDateFilterChange?.({ source: 'clear' });\n },\n });\n\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n if (event.key === 'Enter') {\n event.preventDefault(); // Prevent form submission\n openCalendarWithFocus();\n }\n },\n [openCalendarWithFocus],\n );\n\n const isValueNull = state.value && state.value.start == null && state.value.end == null;\n\n return (\n <DateRangeContainer data-test={props.dataTest} className={className}>\n {props.label && <CustomFormLabel {...labelProps}>{props.label}</CustomFormLabel>}\n <Popover\n open={state.isOpen}\n modal={false}\n portalProps={portalContainer ? { container: portalContainer } : undefined}\n contentProps={{\n align: 'start',\n 'aria-modal': true,\n 'aria-label': props['aria-label'] ?? undefined,\n onInteractOutside: handleOutsideClick,\n onOpenAutoFocus: (e: Event) => {\n // Field focus opens the calendar for editing, while Enter/Open calendar moves focus inside.\n e.preventDefault();\n },\n onEscapeKeyDown: () => {\n state.setOpen(false);\n // Restore focus to the date field for keyboard users\n if (dateMode) {\n const fieldRef = dateMode === 'start' ? startFieldRef : endFieldRef;\n const seg = fieldRef.current?.querySelector('[tabindex=\"0\"]');\n if (seg instanceof HTMLElement) {\n seg.focus();\n }\n }\n },\n onCloseAutoFocus: (e: Event) => {\n // Prevent Radix's default focus restoration — Escape handles its own above.\n e.preventDefault();\n isClosingRef.current = true;\n requestAnimationFrame(() => {\n isClosingRef.current = false;\n });\n },\n noPadding: true,\n style: { zIndex: calendarZIndex },\n zIndex: calendarZIndex,\n }}\n >\n <Popover.Trigger asChild>\n <DateRangeInputs {...mergeProps(groupProps, containerFocusProps)} ref={ref}>\n {/* @ts-expect-error [strict-migration] The following line is not strict; please fix! */}\n <DateField\n ref={startFieldRef}\n inputPosition='start'\n focused={dateMode === 'start'}\n disabled={props.disabled}\n size={props.size}\n {...mergeProps(startFieldProps, startFocusWithinProps, { onKeyDown: handleKeyDown })}\n />\n {/* @ts-expect-error [strict-migration] The following line is not strict; please fix! */}\n <DateField\n ref={endFieldRef}\n inputPosition='end'\n focused={dateMode === 'end'}\n disabled={props.disabled}\n size={props.size}\n {...mergeProps(endFieldProps, endFocusWithinProps, { onKeyDown: handleKeyDown })}\n />\n {props.showClear && (\n <ClearRangeButton\n {...pressClearProps}\n type='button'\n disabled={isValueNull}\n aria-label='Clear date range'\n >\n <CircleXInverseIcon />\n </ClearRangeButton>\n )}\n <VisuallyHidden>\n <OpenButton onOpen={openCalendarWithFocus} disabled={props.disabled} />\n </VisuallyHidden>\n </DateRangeInputs>\n </Popover.Trigger>\n <RangeCalendar\n {...{ ...calendarProps, autoFocus: undefined }}\n calendarRef={calendarRef}\n setDateMode={setDateMode}\n setValue={state.setValue}\n granularity={granularity}\n hidePresets={props.hidePresets}\n visibleMonths={props.visibleMonths}\n onPresetSelect={handlePresetSelect}\n selectedPreset={selectedPreset}\n onSelectDate={(dateVal) => {\n /**\n * Please use caution when editing the logic below.\n * It is specific to react-aria's date picker and can be brittle.\n */\n if (dateVal) {\n const date = state.hasTime ? toCalendarDateTime(dateVal) : dateVal;\n\n if (dateMode === 'start') {\n // Handle a case where we've deleted both dates\n if (state.value.end == null && state.value.start == null) {\n state.setValue({\n start: date,\n end: date,\n });\n }\n // If end becomes the start\n else if (state.value.end && date.compare(state.value.end) > 0) {\n state.setValue({\n start: state.value.end,\n end: state.value.end.set(dateVal), // Preserve time\n });\n } else {\n state.setValue({\n // if start is not set, set it to the date or date + time value, otherwise set the dateVal to preserve time\n start: state.value.start == null ? date : state.value.start.set(dateVal),\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n\n end: state.value.end,\n });\n }\n setDateMode('end');\n } else {\n // Handle a case where we've deleted both dates\n if (state.value.end == null && state.value.start == null) {\n state.setValue({\n start: date,\n end: date,\n });\n }\n // If start becomes the end\n else if (state.value.start && date.compare(state.value.start) < 0) {\n state.setValue({\n start: state.value.start.set(dateVal),\n end: state.value.start,\n });\n } else {\n state.setValue({\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n start: state.value.start,\n // if end is not set, set it to the date or date + time value, otherwise set the dateVal to preserve time\n end: state.value.end == null ? date : state.value.end.set(dateVal),\n });\n }\n // Close popover and keep focus on end field\n state.setOpen(false);\n }\n }\n }}\n minDate={props.minDate}\n maxDate={props.maxDate}\n />\n </Popover>\n </DateRangeContainer>\n );\n};\n\nexport default DateRangePicker;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAa,oBAAoB,OAAO,GAAG;;;AAI3C,MAAa,iBAAiB,OAAO,GAAG;;;mBAGrB,QAAQ,GAAG;;AAG9B,MAAa,kBAAkB,OAAO,GAAG;IACrC,WAAW,cAAc;;;;AAK7B,MAAM,uBAAuB,OAAO,WAAW;;;;AAK/C,MAAa,kBAAkB,UAA2B;CACxD,MAA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OAAO,OAAO,OAAO,MAAM,MAAM,IAAI,IAAI,QAAQ;QACnE,CAAC;AAGJ,aAAM,QAAQ,MAAM;;;;IAI1B,SAAS,MAAM;IACf,SAAS,MAAM;IACf,CAAA,CACM;KACS"}
@@ -1,5 +1,5 @@
1
1
  import { n as Button } from "./IconButton-CnJNIJVQ.mjs";
2
- import { n as DropdownMenu_default } from "./DropdownMenu-DovtBJBs.mjs";
2
+ import { n as DropdownMenu_default } from "./DropdownMenu-C0WK4bM0.mjs";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import { CaretDownIcon } from "@persona/icons";
5
5
  //#region components/DropdownButton/DropdownButton.tsx
@@ -23,4 +23,4 @@ const DropdownButton = ({ children, menuItems, menuProps, side, ...props }) => {
23
23
  //#endregion
24
24
  export { DropdownButton as t };
25
25
 
26
- //# sourceMappingURL=DropdownButton-DV5if_uG.mjs.map
26
+ //# sourceMappingURL=DropdownButton-l-fzkb5_.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownButton-DV5if_uG.mjs","names":["DropdownMenu"],"sources":["../components/DropdownButton/DropdownButton.tsx"],"sourcesContent":["import type { FC, ReactNode } from 'react';\n\nimport { CaretDownIcon } from '@persona/icons';\nimport Button, { type ButtonProps } from 'design-system/components/Button';\nimport DropdownMenu, {\n type DropdownMenuProps,\n} from 'design-system/components/DropdownMenu/DropdownMenu';\n\nexport interface DropdownButtonProps extends ButtonProps {\n /**\n * Use `DropdownMenu.Item` components to render the menu items.\n */\n menuItems: ReactNode;\n /**\n * Additional props will be spread to the inner `<DropdownMenu>` component.\n */\n menuProps?: Partial<Omit<DropdownMenuProps, 'trigger'>>;\n /**\n * The side of the dropdown menu.\n */\n side?: DropdownMenuProps['side'];\n}\n\n/**\n * A button that opens a dropdown menu.\n */\nexport const DropdownButton: FC<DropdownButtonProps> = ({\n children,\n menuItems,\n menuProps,\n side,\n ...props\n}) => {\n return (\n <DropdownMenu\n trigger={\n <Button variant='basic' width='auto' suffixIcon={<CaretDownIcon />} {...props}>\n {children}\n </Button>\n }\n side={side}\n {...menuProps}\n >\n {menuItems}\n </DropdownMenu>\n );\n};\n\nexport default DropdownButton;\n"],"mappings":";;;;;;;;AA0BA,MAAa,kBAA2C,EACtD,UACA,WACA,WACA,MACA,GAAG,YACC;AACJ,QACE,oBAACA,sBAAD;EACE,SACE,oBAAC,QAAD;GAAQ,SAAQ;GAAQ,OAAM;GAAO,YAAY,oBAAC,eAAD,EAAiB,CAAA;GAAE,GAAI;GACrE;GACM,CAAA;EAEL;EACN,GAAI;YAEH;EACY,CAAA"}
1
+ {"version":3,"file":"DropdownButton-l-fzkb5_.mjs","names":["DropdownMenu"],"sources":["../components/DropdownButton/DropdownButton.tsx"],"sourcesContent":["import type { FC, ReactNode } from 'react';\n\nimport { CaretDownIcon } from '@persona/icons';\nimport Button, { type ButtonProps } from 'design-system/components/Button';\nimport DropdownMenu, {\n type DropdownMenuProps,\n} from 'design-system/components/DropdownMenu/DropdownMenu';\n\nexport interface DropdownButtonProps extends ButtonProps {\n /**\n * Use `DropdownMenu.Item` components to render the menu items.\n */\n menuItems: ReactNode;\n /**\n * Additional props will be spread to the inner `<DropdownMenu>` component.\n */\n menuProps?: Partial<Omit<DropdownMenuProps, 'trigger'>>;\n /**\n * The side of the dropdown menu.\n */\n side?: DropdownMenuProps['side'];\n}\n\n/**\n * A button that opens a dropdown menu.\n */\nexport const DropdownButton: FC<DropdownButtonProps> = ({\n children,\n menuItems,\n menuProps,\n side,\n ...props\n}) => {\n return (\n <DropdownMenu\n trigger={\n <Button variant='basic' width='auto' suffixIcon={<CaretDownIcon />} {...props}>\n {children}\n </Button>\n }\n side={side}\n {...menuProps}\n >\n {menuItems}\n </DropdownMenu>\n );\n};\n\nexport default DropdownButton;\n"],"mappings":";;;;;;;;AA0BA,MAAa,kBAA2C,EACtD,UACA,WACA,WACA,MACA,GAAG,YACC;AACJ,QACE,oBAACA,sBAAD;EACE,SACE,oBAAC,QAAD;GAAQ,SAAQ;GAAQ,OAAM;GAAO,YAAY,oBAAC,eAAD,EAAiB,CAAA;GAAE,GAAI;GACrE;GACM,CAAA;EAEL;EACN,GAAI;YAEH;EACY,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { r as ButtonProps } from "./Button-CTgyA3gc.mjs";
2
- import { n as DropdownMenuProps } from "./DropdownMenu-CbhEzWy1.mjs";
2
+ import { n as DropdownMenuProps } from "./DropdownMenu-Bg68vvxx.mjs";
3
3
  import { FC, ReactNode } from "react";
4
4
 
5
5
  //#region components/DropdownButton/DropdownButton.d.ts
@@ -1,4 +1,4 @@
1
- import { l as MenuItemProps, s as MenuHeadingProps } from "./Menu-_loh8pe3.mjs";
1
+ import { l as MenuItemProps, s as MenuHeadingProps } from "./Menu-DdHN-drQ.mjs";
2
2
  import { ComponentPropsWithRef, ComponentPropsWithoutRef, ElementType, FC, FunctionComponentElement } from "react";
3
3
  import * as _$styled_components0 from "styled-components";
4
4
  import * as _$react_jsx_runtime0 from "react/jsx-runtime";
@@ -72,4 +72,4 @@ declare const _default: (({
72
72
  };
73
73
  //#endregion
74
74
  export { DropdownMenuProps as n, _default as r, DropdownMenu as t };
75
- //# sourceMappingURL=DropdownMenu-CbhEzWy1.d.mts.map
75
+ //# sourceMappingURL=DropdownMenu-Bg68vvxx.d.mts.map
@@ -1,7 +1,7 @@
1
1
  import { a as styled } from "./styledComponentsInterop-NxwFjeA4.mjs";
2
2
  import "./variables/spacing.mjs";
3
3
  import { Z_INDICES } from "./lib/zindex.mjs";
4
- import { a as MenuDivider, i as Menu, o as MenuHeading, s as MenuItem } from "./Menu-CAGTCBqj.mjs";
4
+ import { a as MenuDivider, i as Menu, o as MenuHeading, s as MenuItem } from "./Menu-CeV3lL2g.mjs";
5
5
  import { Children, forwardRef } from "react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  import * as Primitive from "@radix-ui/react-dropdown-menu";
@@ -57,4 +57,4 @@ var DropdownMenu_default = Object.assign(DropdownMenu, {
57
57
  //#endregion
58
58
  export { DropdownMenu_default as n, DropdownMenu as t };
59
59
 
60
- //# sourceMappingURL=DropdownMenu-DovtBJBs.mjs.map
60
+ //# sourceMappingURL=DropdownMenu-C0WK4bM0.mjs.map