@servicetitan/anvil2 1.49.5 → 1.49.7

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 (185) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/{Alert-aGBkujwE.js → Alert-DNhUyWVm.js} +3 -2
  3. package/dist/{Alert-aGBkujwE.js.map → Alert-DNhUyWVm.js.map} +1 -1
  4. package/dist/Alert.js +1 -1
  5. package/dist/{Announcement-BPwFNhYe.js → Announcement-BBq8zIQ3.js} +3 -2
  6. package/dist/{Announcement-BPwFNhYe.js.map → Announcement-BBq8zIQ3.js.map} +1 -1
  7. package/dist/Announcement.js +1 -1
  8. package/dist/{Breadcrumbs-DjR-2OEH.js → Breadcrumbs-CfJJlIIa.js} +2 -2
  9. package/dist/{Breadcrumbs-DjR-2OEH.js.map → Breadcrumbs-CfJJlIIa.js.map} +1 -1
  10. package/dist/Breadcrumbs.js +1 -1
  11. package/dist/{Calendar-CLSm88D2.js → Calendar-C9oxHTGG.js} +2 -2
  12. package/dist/{Calendar-CLSm88D2.js.map → Calendar-C9oxHTGG.js.map} +1 -1
  13. package/dist/{Calendar-BP6r1sP9.js → Calendar-CAYitkfM.js} +2 -2
  14. package/dist/{Calendar-BP6r1sP9.js.map → Calendar-CAYitkfM.js.map} +1 -1
  15. package/dist/Calendar.js +2 -2
  16. package/dist/{Checkbox-DwuDx-t4.js → Checkbox-DbBeuNdW.js} +3 -3
  17. package/dist/{Checkbox-DwuDx-t4.js.map → Checkbox-DbBeuNdW.js.map} +1 -1
  18. package/dist/{Checkbox-PkAk1Saq.js → Checkbox-zAKOGEBl.js} +2 -2
  19. package/dist/{Checkbox-PkAk1Saq.js.map → Checkbox-zAKOGEBl.js.map} +1 -1
  20. package/dist/Checkbox.js +2 -2
  21. package/dist/{Chip-X2EwdZ97.js → Chip-UqdorCE2.js} +23 -17
  22. package/dist/Chip-UqdorCE2.js.map +1 -0
  23. package/dist/Chip.js +1 -1
  24. package/dist/{Combobox-DNCq-jkq.js → Combobox-hxGMMb8x.js} +6 -6
  25. package/dist/{Combobox-DNCq-jkq.js.map → Combobox-hxGMMb8x.js.map} +1 -1
  26. package/dist/Combobox.js +1 -1
  27. package/dist/{DataTable-BIhmpU0v.js → DataTable-CUFa7cQK.js} +6 -6
  28. package/dist/{DataTable-BIhmpU0v.js.map → DataTable-CUFa7cQK.js.map} +1 -1
  29. package/dist/{DateField-DsGHTMZ1.js → DateField-BT9jJRp5.js} +5 -5
  30. package/dist/{DateField-DsGHTMZ1.js.map → DateField-BT9jJRp5.js.map} +1 -1
  31. package/dist/DateField.js +1 -1
  32. package/dist/{DateFieldRange-Ct979nxF.js → DateFieldRange-ZAic_9mt.js} +5 -5
  33. package/dist/{DateFieldRange-Ct979nxF.js.map → DateFieldRange-ZAic_9mt.js.map} +1 -1
  34. package/dist/DateFieldRange.js +1 -1
  35. package/dist/{DateFieldSingle-frMHnRSg.js → DateFieldSingle-DAtR8ImE.js} +5 -5
  36. package/dist/{DateFieldSingle-frMHnRSg.js.map → DateFieldSingle-DAtR8ImE.js.map} +1 -1
  37. package/dist/DateFieldSingle.js +1 -1
  38. package/dist/{DateFieldYearless-po9ieLod.js → DateFieldYearless-DXO_MPwA.js} +4 -4
  39. package/dist/{DateFieldYearless-po9ieLod.js.map → DateFieldYearless-DXO_MPwA.js.map} +1 -1
  40. package/dist/DateFieldYearless.js +1 -1
  41. package/dist/{DateFieldYearlessRange-Dy8a8O1n.js → DateFieldYearlessRange-Cg6bbPIi.js} +4 -4
  42. package/dist/{DateFieldYearlessRange-Dy8a8O1n.js.map → DateFieldYearlessRange-Cg6bbPIi.js.map} +1 -1
  43. package/dist/DateFieldYearlessRange.js +1 -1
  44. package/dist/{DaysOfTheWeek-2_k3T4n4.js → DaysOfTheWeek-9B9d7-hF.js} +4 -4
  45. package/dist/{DaysOfTheWeek-2_k3T4n4.js.map → DaysOfTheWeek-9B9d7-hF.js.map} +1 -1
  46. package/dist/DaysOfTheWeek.js +1 -1
  47. package/dist/{Dialog-BT7a5KNT.js → Dialog-UzG6-s9H.js} +13 -13
  48. package/dist/{Dialog-BT7a5KNT.js.map → Dialog-UzG6-s9H.js.map} +1 -1
  49. package/dist/Dialog.css +32 -32
  50. package/dist/Dialog.js +1 -1
  51. package/dist/{Drawer-scQFylHI.js → Drawer-BHK18NYm.js} +12 -12
  52. package/dist/{Drawer-scQFylHI.js.map → Drawer-BHK18NYm.js.map} +1 -1
  53. package/dist/Drawer.css +31 -31
  54. package/dist/Drawer.js +1 -1
  55. package/dist/{FieldLabel-BIStrC2x.js → FieldLabel-jqlQ1Ldh.js} +2 -2
  56. package/dist/{FieldLabel-BIStrC2x.js.map → FieldLabel-jqlQ1Ldh.js.map} +1 -1
  57. package/dist/FieldLabel.js +1 -1
  58. package/dist/{FieldMessage-DWONT3dr.js → FieldMessage-DdCUxZz-.js} +3 -3
  59. package/dist/FieldMessage-DdCUxZz-.js.map +1 -0
  60. package/dist/FieldMessage.js +1 -1
  61. package/dist/{Helper-DjWotFtO.js → Helper-DzVUQgUJ.js} +2 -2
  62. package/dist/{Helper-DjWotFtO.js.map → Helper-DzVUQgUJ.js.map} +1 -1
  63. package/dist/{InputMask-A5LDdyxL.js → InputMask-CJC9xZHG.js} +2 -2
  64. package/dist/{InputMask-A5LDdyxL.js.map → InputMask-CJC9xZHG.js.map} +1 -1
  65. package/dist/InputMask.js +1 -1
  66. package/dist/{Link-DuYh7Xl2.js → Link-CGXEFA9w.js} +13 -4
  67. package/dist/Link-CGXEFA9w.js.map +1 -0
  68. package/dist/Link.css +34 -20
  69. package/dist/Link.js +1 -1
  70. package/dist/Link.module-ByPQQ0zy.js +14 -0
  71. package/dist/Link.module-ByPQQ0zy.js.map +1 -0
  72. package/dist/{LinkButton-pIUNATNE.js → LinkButton-BBCO-4em.js} +5 -2
  73. package/dist/LinkButton-BBCO-4em.js.map +1 -0
  74. package/dist/LinkButton.js +1 -1
  75. package/dist/{ListView-5cRssdYI.js → ListView-D8mfK8Lu.js} +2 -2
  76. package/dist/{ListView-5cRssdYI.js.map → ListView-D8mfK8Lu.js.map} +1 -1
  77. package/dist/ListView.js +1 -1
  78. package/dist/{NumberField-BUFymKV3.js → NumberField-CjWLnD9X.js} +3 -3
  79. package/dist/{NumberField-BUFymKV3.js.map → NumberField-CjWLnD9X.js.map} +1 -1
  80. package/dist/NumberField.js +1 -1
  81. package/dist/{Page-Dgpz2WD7.js → Page-ClI3IOc7.js} +6 -6
  82. package/dist/{Page-Dgpz2WD7.js.map → Page-ClI3IOc7.js.map} +1 -1
  83. package/dist/Page.js +1 -1
  84. package/dist/{Popover-CcMDyKTj.js → Popover-CCXrzBul.js} +27 -6
  85. package/dist/Popover-CCXrzBul.js.map +1 -0
  86. package/dist/Popover.css +40 -9
  87. package/dist/Popover.js +1 -1
  88. package/dist/{ProgressBar-R_UjSR4o.js → ProgressBar-BpKEr6cO.js} +5 -4
  89. package/dist/{ProgressBar-R_UjSR4o.js.map → ProgressBar-BpKEr6cO.js.map} +1 -1
  90. package/dist/ProgressBar.js +1 -1
  91. package/dist/{Radio-CLR1m8N9.js → Radio-jj0-1dOg.js} +2 -2
  92. package/dist/{Radio-CLR1m8N9.js.map → Radio-jj0-1dOg.js.map} +1 -1
  93. package/dist/Radio.js +2 -2
  94. package/dist/{RadioGroup-m46C69uO.js → RadioGroup-Bxy415eu.js} +3 -3
  95. package/dist/{RadioGroup-m46C69uO.js.map → RadioGroup-Bxy415eu.js.map} +1 -1
  96. package/dist/{SearchField-DrgNbG3I.js → SearchField-D6bICv4b.js} +36 -7
  97. package/dist/SearchField-D6bICv4b.js.map +1 -0
  98. package/dist/SearchField.css +13 -8
  99. package/dist/SearchField.js +1 -1
  100. package/dist/{SelectCard-DViLgRGh.js → SelectCard-CjbsPKZ4.js} +3 -3
  101. package/dist/{SelectCard-DViLgRGh.js.map → SelectCard-CjbsPKZ4.js.map} +1 -1
  102. package/dist/SelectCard.js +1 -1
  103. package/dist/SelectField.js +1 -1
  104. package/dist/{SelectFieldSync-DF05HvD4.js → SelectFieldSync-BOzavAtv.js} +132 -19
  105. package/dist/SelectFieldSync-BOzavAtv.js.map +1 -0
  106. package/dist/{SelectTrigger-BSzOoRsu.js → SelectTrigger-DfVnPiNf.js} +2 -2
  107. package/dist/{SelectTrigger-BSzOoRsu.js.map → SelectTrigger-DfVnPiNf.js.map} +1 -1
  108. package/dist/SelectTrigger.js +1 -1
  109. package/dist/{SelectTriggerBase-CfmRIFRs.js → SelectTriggerBase-D8scKtBr.js} +5 -5
  110. package/dist/{SelectTriggerBase-CfmRIFRs.js.map → SelectTriggerBase-D8scKtBr.js.map} +1 -1
  111. package/dist/SelectTriggerBase.css +59 -59
  112. package/dist/SelectTriggerBase.module-Ce49lamD.js +35 -0
  113. package/dist/SelectTriggerBase.module-Ce49lamD.js.map +1 -0
  114. package/dist/{Switch-BXDPs2mD.js → Switch-CGpg2ake.js} +2 -2
  115. package/dist/{Switch-BXDPs2mD.js.map → Switch-CGpg2ake.js.map} +1 -1
  116. package/dist/Switch.js +1 -1
  117. package/dist/Table.js +1 -1
  118. package/dist/{TextField-B08U4_rt.js → TextField-DNuEXKyN.js} +3 -3
  119. package/dist/{TextField-B08U4_rt.js.map → TextField-DNuEXKyN.js.map} +1 -1
  120. package/dist/{TextField-D29fTRGR.js → TextField-Qv6OqiKQ.js} +2 -2
  121. package/dist/{TextField-D29fTRGR.js.map → TextField-Qv6OqiKQ.js.map} +1 -1
  122. package/dist/TextField.js +1 -1
  123. package/dist/{Textarea-Dl4w2-t0.js → Textarea-DdLD4imO.js} +3 -3
  124. package/dist/{Textarea-Dl4w2-t0.js.map → Textarea-DdLD4imO.js.map} +1 -1
  125. package/dist/Textarea.js +1 -1
  126. package/dist/{TimeField-Dpi3fMsn.js → TimeField-C39hYluo.js} +3 -3
  127. package/dist/{TimeField-Dpi3fMsn.js.map → TimeField-C39hYluo.js.map} +1 -1
  128. package/dist/TimeField.js +1 -1
  129. package/dist/Toast.js +2 -2
  130. package/dist/{Toaster-CRNOANCk.js → Toaster-DJ4tNy-0.js} +2 -2
  131. package/dist/{Toaster-CRNOANCk.js.map → Toaster-DJ4tNy-0.js.map} +1 -1
  132. package/dist/{Toaster-B0ogInIl.js → Toaster-DyDVYq4x.js} +148 -53
  133. package/dist/Toaster-DyDVYq4x.js.map +1 -0
  134. package/dist/Toaster.css +95 -71
  135. package/dist/{Toolbar-CPldWSNJ.js → Toolbar-BxYOXLmv.js} +13 -13
  136. package/dist/{Toolbar-CPldWSNJ.js.map → Toolbar-BxYOXLmv.js.map} +1 -1
  137. package/dist/Toolbar.js +1 -1
  138. package/dist/{Tooltip-BbfLb3pI.js → Tooltip-CBy7srE2.js} +2 -2
  139. package/dist/Tooltip-CBy7srE2.js.map +1 -0
  140. package/dist/Tooltip.js +1 -1
  141. package/dist/{YearlessDateInputWithPicker-LiMI-Oer.js → YearlessDateInputWithPicker-DMGx3gE2.js} +2 -2
  142. package/dist/{YearlessDateInputWithPicker-LiMI-Oer.js.map → YearlessDateInputWithPicker-DMGx3gE2.js.map} +1 -1
  143. package/dist/beta/components/SelectField/internal/SelectFieldInput.d.ts +14 -3
  144. package/dist/beta/components/SelectField/internal/SelectFieldLabel.d.ts +12 -1
  145. package/dist/beta/components/SelectField/internal/useCombo.d.ts +2 -1
  146. package/dist/beta/components/SelectField/types.d.ts +43 -0
  147. package/dist/beta.js +5 -5
  148. package/dist/check_circle-CM0ukqXv.js +6 -0
  149. package/dist/check_circle-CM0ukqXv.js.map +1 -0
  150. package/dist/components/Chip/Chip.d.ts +2 -1
  151. package/dist/components/Chip/internal/Chip.d.ts +2 -1
  152. package/dist/components/DateFieldRange/internal/MaskedDateRangeInput.d.ts +1 -1
  153. package/dist/components/DateFieldSingle/internal/MaskedDateInput.d.ts +1 -1
  154. package/dist/components/Link/internal/Link.d.ts +21 -2
  155. package/dist/components/Link/useLinkStyles.d.ts +1 -1
  156. package/dist/components/LinkButton/LinkButton.d.ts +13 -1
  157. package/dist/components/Popover/internal/PopoverContext.d.ts +1 -0
  158. package/dist/components/Popover/internal/usePopoverContext.d.ts +1 -0
  159. package/dist/components/SearchField/SearchField.d.ts +6 -3
  160. package/dist/components/Stepper/Stepper.d.ts +1 -1
  161. package/dist/components/Stepper/StepperStep.d.ts +1 -1
  162. package/dist/components/Tab/Tab.d.ts +1 -1
  163. package/dist/components/Tab/TabButton.d.ts +1 -1
  164. package/dist/components/Toast/internal/constants.d.ts +16 -0
  165. package/dist/error-DR_wWdYY.js +6 -0
  166. package/dist/error-DR_wWdYY.js.map +1 -0
  167. package/dist/index.js +40 -40
  168. package/dist/{utils-CeT0omsG.js → utils-Bkbn9cyk.js} +2 -2
  169. package/dist/{utils-CeT0omsG.js.map → utils-Bkbn9cyk.js.map} +1 -1
  170. package/package.json +1 -1
  171. package/dist/Chip-X2EwdZ97.js.map +0 -1
  172. package/dist/FieldMessage-DWONT3dr.js.map +0 -1
  173. package/dist/Link-DuYh7Xl2.js.map +0 -1
  174. package/dist/Link.module-Cf17JWod.js +0 -12
  175. package/dist/Link.module-Cf17JWod.js.map +0 -1
  176. package/dist/LinkButton-pIUNATNE.js.map +0 -1
  177. package/dist/Popover-CcMDyKTj.js.map +0 -1
  178. package/dist/SearchField-DrgNbG3I.js.map +0 -1
  179. package/dist/SelectFieldSync-DF05HvD4.js.map +0 -1
  180. package/dist/SelectTriggerBase.module-DUhQNr6j.js +0 -33
  181. package/dist/SelectTriggerBase.module-DUhQNr6j.js.map +0 -1
  182. package/dist/Toaster-B0ogInIl.js.map +0 -1
  183. package/dist/Tooltip-BbfLb3pI.js.map +0 -1
  184. package/dist/check_circle-Dja-C2lM.js +0 -8
  185. package/dist/check_circle-Dja-C2lM.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer-scQFylHI.js","sources":["../src/components/Drawer/internal/useDrawerContext.ts","../src/components/Drawer/DrawerCancelButton.tsx","../src/components/Drawer/DrawerHeader.tsx","../src/components/Drawer/DrawerFooter.tsx","../src/components/Drawer/DrawerContent.tsx","../src/components/Drawer/Drawer.tsx"],"sourcesContent":["import { useContext } from \"react\";\nimport { DrawerContext } from \"./DrawerContext\";\n\n/**\n * Hook to access the drawer context.\n *\n * @returns The drawer context containing close function and ref\n * @throws Error if used outside of a DrawerContextProvider\n */\nexport function useDrawerContext() {\n const context = useContext(DrawerContext);\n if (!context) {\n throw new Error(\n \"useDrawerContext must be used within a DrawerContextProvider\",\n );\n }\n return context;\n}\n","import { MouseEvent, forwardRef } from \"react\";\nimport { Button, ButtonProps } from \"../Button\";\nimport { DataTrackingId } from \"../../types\";\nimport { childrenToString } from \"../../internal/functions\";\nimport { useTrackingId } from \"../../hooks\";\nimport { useDrawerContext } from \"./internal/useDrawerContext\";\n\n/**\n * Props for the DrawerCancelButton component\n * @extends ButtonProps\n */\nexport type DrawerCancelButtonProps = ButtonProps & DataTrackingId;\n\n/**\n * A button component that automatically closes the drawer when clicked.\n *\n * Features:\n * - Automatically closes the drawer when clicked\n * - Extends Button component functionality\n * - Accessible with proper ARIA attributes\n * - Consistent styling with the design system\n * - Supports all standard button props\n * - Proper focus management\n * - Can be used anywhere within the drawer context\n *\n * @example\n * <DrawerCancelButton appearance=\"ghost\" size=\"small\">\n * Cancel\n * </DrawerCancelButton>\n */\nexport const DrawerCancelButton = forwardRef<\n HTMLButtonElement,\n DrawerCancelButtonProps\n>((props, ref) => {\n const { onClick, ...rest } = props;\n const { close } = useDrawerContext();\n const data = {\n children: childrenToString(props.children),\n appearance: props.appearance,\n size: props.size,\n type: props.type,\n };\n\n const trackingId = useTrackingId({\n name: \"DrawerCancelButton\",\n data,\n hasOverride: !!props[\"data-tracking-id\"],\n });\n\n const onClickHandler = (e: MouseEvent<HTMLButtonElement>) => {\n onClick?.(e);\n close();\n };\n return (\n <Button\n aria-label=\"Close drawer\"\n data-anv=\"drawer-cancel-button\"\n data-tracking-id={trackingId}\n onClick={onClickHandler}\n ref={ref}\n {...rest}\n />\n );\n});\n\nDrawerCancelButton.displayName = \"DrawerCancelButton\";\n","import { ComponentPropsWithoutRef, forwardRef } from \"react\";\nimport Close from \"@servicetitan/hammer-icon/mdi/round/close.svg\";\nimport styles from \"./Drawer.module.scss\";\nimport { Text } from \"../Text\";\nimport { DrawerCancelButton } from \"./DrawerCancelButton\";\nimport cx from \"classnames\";\nimport { DataTrackingId } from \"../../types\";\nimport { childrenToString } from \"../../internal/functions\";\nimport { useTrackingId, useMergeRefs } from \"../../hooks\";\nimport { useDrawerContext } from \"./internal/useDrawerContext\";\n\n/**\n * Props for the DrawerHeader component\n * @extends ComponentPropsWithoutRef<\"header\">\n */\nexport type DrawerHeaderProps = ComponentPropsWithoutRef<\"header\"> &\n DataTrackingId;\n\n/**\n * Header component for the drawer that displays a title and close button.\n *\n * Features:\n * - Displays the drawer title as a headline\n * - Includes an accessible close button\n * - Sticky positioning at the top of the drawer\n * - Proper semantic HTML structure\n * - Accessible with proper ARIA attributes\n * - Consistent styling with the design system\n * - Automatic close functionality\n *\n * @example\n * <Drawer.Header>Settings</Drawer.Header>\n */\nexport const DrawerHeader = forwardRef<HTMLHeadElement, DrawerHeaderProps>(\n (props, ref) => {\n const { className, children } = props;\n const { headerRef } = useDrawerContext();\n const data = {\n children: childrenToString(props.children),\n };\n\n const trackingId = useTrackingId({\n name: \"DrawerHeader\",\n data,\n hasOverride: !!props[\"data-tracking-id\"],\n });\n\n const drawerHeaderClasses = cx(styles.header, className);\n\n return (\n <header\n className={drawerHeaderClasses}\n data-anv=\"drawer-header\"\n data-tracking-id={trackingId}\n ref={useMergeRefs([ref, headerRef])}\n >\n <Text variant=\"headline\" el=\"h1\">\n {children}\n </Text>\n <span className={styles[\"close-container\"]}>\n <DrawerCancelButton\n className={styles[\"close-button\"]}\n size=\"small\"\n appearance=\"ghost\"\n aria-label=\"Close drawer\"\n data-anv=\"drawer-header-close-button\"\n icon={Close}\n />\n </span>\n </header>\n );\n },\n);\n\nDrawerHeader.displayName = \"DrawerHeader\";\n","import { ComponentPropsWithoutRef, forwardRef } from \"react\";\nimport styles from \"./Drawer.module.scss\";\nimport cx from \"classnames\";\n\n/**\n * Props for the DrawerFooter component\n * @extends ComponentPropsWithoutRef<\"footer\">\n */\nexport type DrawerFooterProps = ComponentPropsWithoutRef<\"footer\"> & {\n /**\n * When true, the footer will stick to the bottom of the drawer.\n * @default false\n */\n sticky?: boolean;\n};\n\n/**\n * Footer component for the drawer that displays action buttons and controls.\n *\n * Features:\n * - Flexible layout for action buttons and controls\n * - Optional sticky positioning at the bottom\n * - Proper semantic HTML structure\n * - Accessible with proper ARIA attributes\n * - Consistent styling with the design system\n * - Supports all standard footer element props\n * - Responsive design that adapts to content\n *\n * @example\n * <Drawer.Footer sticky>\n * <Button onClick={handleSave}>Save</Button>\n * <Button onClick={handleCancel}>Cancel</Button>\n * </Drawer.Footer>\n */\nexport const DrawerFooter = forwardRef<HTMLElement, DrawerFooterProps>(\n (props, ref) => {\n const { className, children, sticky = false, ...rest } = props;\n const drawerFooterClasses = cx(styles.footer, className, {\n [styles[\"sticky\"]]: sticky,\n });\n\n return (\n <footer\n className={drawerFooterClasses}\n data-anv=\"drawer-footer\"\n ref={ref}\n {...rest}\n >\n {children}\n </footer>\n );\n },\n);\n\nDrawerFooter.displayName = \"DrawerFooter\";\n","import {\n ComponentPropsWithoutRef,\n forwardRef,\n useEffect,\n useState,\n} from \"react\";\nimport styles from \"./Drawer.module.scss\";\nimport cx from \"classnames\";\nimport { useDrawerContext } from \"./internal/useDrawerContext\";\n\n/**\n * Props for the DrawerContent component\n * @extends ComponentPropsWithoutRef<\"div\">\n */\nexport type DrawerContentProps = ComponentPropsWithoutRef<\"div\"> & {\n /**\n * When true, the content will stick below the header during scroll.\n * @default false\n */\n sticky?: boolean;\n};\n\n/**\n * Content container for the drawer that holds the main content area.\n *\n * Features:\n * - Flexible content area with proper spacing\n * - Scrollable content when needed\n * - Optional sticky positioning below header\n * - Proper semantic HTML structure\n * - Accessible with proper ARIA attributes\n * - Consistent styling with the design system\n * - Supports all standard div element props\n * - Responsive design that adapts to content\n * - Proper focus management\n *\n * @example\n * // Basic content\n * <Drawer.Content>\n * <p>This is the main content of the drawer.</p>\n * </Drawer.Content>\n *\n * @example\n * // Sticky content (e.g., search field that remains visible while scrolling)\n * <Drawer.Content sticky>\n * <TextField placeholder=\"Filter results...\" />\n * </Drawer.Content>\n */\nexport const DrawerContent = forwardRef<HTMLDivElement, DrawerContentProps>(\n (props, ref) => {\n const { children, className, sticky = false, ...rest } = props;\n const { headerRef } = useDrawerContext();\n const [headerHeight, setHeaderHeight] = useState(0);\n\n useEffect(() => {\n const headerElement = headerRef?.current;\n if (!sticky || !headerElement) return;\n\n const updateHeight = () => {\n setHeaderHeight(headerElement.offsetHeight || 0);\n };\n\n updateHeight();\n const resizeObserver = new ResizeObserver(updateHeight);\n resizeObserver.observe(headerElement);\n\n return () => resizeObserver.disconnect();\n }, [sticky, headerRef]);\n\n const contentClassNames = cx(styles[\"content\"], className, {\n [styles[\"sticky\"]]: sticky,\n });\n\n const stickyStyle = sticky ? { top: `${headerHeight}px` } : undefined;\n\n return (\n <div\n className={contentClassNames}\n data-anv=\"drawer-content\"\n ref={ref}\n style={{ ...stickyStyle, ...rest.style }}\n {...rest}\n >\n {children}\n </div>\n );\n },\n);\n\nDrawerContent.displayName = \"DrawerContent\";\n","import styles from \"./Drawer.module.scss\";\nimport {\n ComponentPropsWithoutRef,\n forwardRef,\n useRef,\n useId,\n useCallback,\n useEffect,\n SyntheticEvent,\n KeyboardEvent,\n useMemo,\n} from \"react\";\nimport { DrawerHeader } from \"./DrawerHeader\";\nimport { DrawerFooter } from \"./DrawerFooter\";\nimport { DrawerContent } from \"./DrawerContent\";\nimport { DrawerCancelButton } from \"./DrawerCancelButton\";\nimport {\n OpenCloseTransitionStateEffects,\n useDialogScrollLock,\n useDialogTransitionStates,\n useKeyboardFocusables,\n useOnClickOutside,\n} from \"../../internal/hooks\";\nimport {\n FocusableElement,\n DisableCloseOnEscapeOrClickProps,\n Size,\n} from \"../../types\";\nimport { registerLayer, unregisterLayer } from \"../../internal/utils\";\nimport { useMergeRefs } from \"../../hooks\";\nimport cx from \"classnames\";\nimport { ToastProvider } from \"../Toast/internal/ToastProvider\";\nimport { ToasterPopover } from \"../Toast/internal/ToasterPopover\";\nimport { ToasterContent } from \"../Toast/internal/Toaster\";\nimport { DrawerContext } from \"./internal/DrawerContext\";\nimport { useInitialFocus } from \"../Dialog/internal/useInitialFocus\";\n\n/**\n * Props for the Drawer component\n * @extends ComponentPropsWithoutRef<\"dialog\">\n * @extends DialogTransitionStateEffects\n * @extends DisableCloseOnEscapeOrClickProps\n */\nexport type DrawerProps = ComponentPropsWithoutRef<\"dialog\"> &\n OpenCloseTransitionStateEffects &\n DisableCloseOnEscapeOrClickProps & {\n /**\n * The size of the drawer.\n * @default \"medium\"\n */\n size?: Extract<Size, \"medium\" | \"large\">;\n /**\n * Controls whether the drawer is open or closed.\n * @default false\n */\n open?: boolean;\n /**\n * Callback function called after the drawer is animated closed.\n */\n onClose?: () => void;\n /**\n * Callback function called when the drawer opens.\n * @deprecated Use onOpenAnimationStart or onOpenAnimationComplete instead\n */\n onOpen?: () => void;\n /**\n * Callback when clicking outside the drawer\n */\n onClickOutside?: (e: globalThis.MouseEvent) => void;\n /**\n * Enables scroll chaining behavior.\n * @link https://developer.mozilla.org/en-US/docs/Glossary/Scroll_chaining\n */\n enableScrollChaining?: boolean;\n /**\n * Given an array of focusable elements, return the initial focus target.\n * @param focusables - The focusable elements to pick from\n * @returns The initial focus target\n */\n initialFocusResolver?: (focusables: FocusableElement[]) => FocusableElement;\n };\n\nconst DrawerElement = forwardRef<HTMLDialogElement, DrawerProps>(\n (props, ref) => {\n const {\n className,\n open = false,\n children,\n onOpen,\n onClose,\n // onCancel is destructured so that it is not passed to the dialog in ...rest\n onCancel,\n onKeyDown,\n disableCloseOnEscape = false,\n onClickOutside,\n disableCloseOnClickOutside = false,\n size = \"medium\",\n enableScrollChaining,\n onOpenAnimationStart,\n onOpenAnimationComplete,\n onCloseAnimationStart,\n onCloseAnimationComplete,\n initialFocusResolver,\n ...rest\n } = props;\n\n const elRef = useRef<HTMLDialogElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const toasterRef = useRef<HTMLDivElement>(null);\n const headerRef = useRef<HTMLElement>(null);\n const combinedRef = useMergeRefs([elRef, ref]);\n const id = useId();\n\n const { state, isOpenOrOpening } = useDialogTransitionStates(elRef, open, {\n onOpenAnimationStart: useCallback(() => {\n onOpenAnimationStart?.();\n }, [onOpenAnimationStart]),\n onOpenAnimationComplete: useCallback(() => {\n onOpenAnimationComplete?.();\n onOpen?.(); // DEPRECATED\n }, [onOpen, onOpenAnimationComplete]),\n onCloseAnimationStart: useCallback(() => {\n onCloseAnimationStart?.();\n }, [onCloseAnimationStart]),\n onCloseAnimationComplete: useCallback(() => {\n onCloseAnimationComplete?.();\n }, [onCloseAnimationComplete]),\n });\n\n const classNames = cx([styles.drawer], className, {\n [styles.remove]: state === \"closing\",\n [styles.large]: size === \"large\",\n });\n\n const { focusables } = useKeyboardFocusables(contentRef, {\n observeChange: false,\n });\n const firstFocusable = focusables?.[0];\n const lastFocusable = focusables?.[focusables.length - 1];\n\n useDialogScrollLock({\n open: isOpenOrOpening,\n id,\n enableScrollChaining,\n elementRef: elRef,\n });\n\n // Register/unregister with layer manager for proper stacking\n useEffect(() => {\n if (open) {\n registerLayer(id);\n } else {\n unregisterLayer(id);\n }\n\n // Cleanup when component unmounts\n return () => {\n unregisterLayer(id);\n };\n }, [open, id]);\n\n const computeFocus = useCallback((focusables: FocusableElement[]) => {\n return (\n focusables.find(\n (focusable) => focusable.dataset.anv !== \"drawer-header-close-button\",\n ) || focusables[0]\n );\n }, []);\n\n useInitialFocus(elRef, {\n computeFocus: initialFocusResolver || computeFocus,\n });\n\n const onCancelHandler = (e: SyntheticEvent<HTMLDialogElement>) => {\n e.preventDefault();\n\n if (disableCloseOnEscape) return;\n onClose?.();\n };\n\n useOnClickOutside({\n onOutsidePress: (e) => {\n if (!open) return;\n onClickOutside?.(e);\n },\n targets: [\n contentRef.current as HTMLElement,\n toasterRef.current as HTMLElement,\n ],\n onClose: () => {\n if (disableCloseOnClickOutside || !open) return;\n onClose?.();\n },\n layerId: id,\n });\n\n const onKeyDownHandler = (e: KeyboardEvent<HTMLDialogElement>) => {\n onKeyDown?.(e);\n if (e.code === \"Tab\") {\n if (e.shiftKey && e.target === firstFocusable) {\n e.preventDefault();\n (lastFocusable as HTMLElement)?.focus();\n return;\n }\n if (e.target === lastFocusable && !e.shiftKey) {\n e.preventDefault();\n (firstFocusable as HTMLElement)?.focus();\n return;\n }\n }\n };\n\n const contextValue = useMemo(() => {\n return { close: () => onClose?.(), headerRef };\n }, [onClose]);\n\n return (\n // dialog element does seem to be interactive on MDN guideline\n <dialog\n className={classNames}\n data-anv=\"drawer\"\n data-anv-scroll-chaining={enableScrollChaining}\n data-anv-transition-state={state}\n ref={combinedRef}\n onCancel={onCancelHandler}\n onKeyDown={onKeyDownHandler}\n {...rest}\n >\n <ToastProvider isDialogToaster={isOpenOrOpening}>\n <ToasterPopover>\n <ToasterContent id=\"drawer-toaster\" ref={toasterRef} />\n </ToasterPopover>\n </ToastProvider>\n <DrawerContext.Provider value={contextValue}>\n <section\n ref={contentRef}\n className={styles.container}\n data-open={isOpenOrOpening}\n >\n {children}\n </section>\n </DrawerContext.Provider>\n </dialog>\n );\n },\n);\nDrawerElement.displayName = \"Drawer\";\n\n/**\n * A slide-out drawer component that provides a modal-like experience from the side of the screen.\n *\n * Features:\n * - Slide-in animation from the side of the screen\n * - Keyboard navigation with focus trapping\n * - Escape key and click outside to close\n * - Configurable size variants (medium, large)\n * - Built-in toast support for notifications\n * - Automatic scroll locking when open\n * - Accessible with proper ARIA attributes\n * - Compound component structure with Header, Footer, Content, and CancelButton\n * - Transition state callbacks for animation control\n * - Optional scroll chaining support\n * - Automatic tracking ID generation for analytics\n *\n * @example\n * <Drawer open={isOpen} onClose={handleClose} size=\"medium\">\n * <Drawer.Header>Settings</Drawer.Header>\n * <Drawer.Content>Drawer content goes here</Drawer.Content>\n * <Drawer.Footer>\n * <Button onClick={handleSave}>Save</Button>\n * <Drawer.CancelButton>Cancel</Drawer.CancelButton>\n * </Drawer.Footer>\n * </Drawer>\n */\nexport const Drawer = Object.assign(DrawerElement, {\n /**\n * Header component for the drawer that displays a title and close button.\n *\n * Features:\n * - Displays the drawer title as a headline\n * - Includes an accessible close button\n * - Sticky positioning at the top of the drawer\n * - Proper semantic HTML structure\n * - Accessible with proper ARIA attributes\n * - Consistent styling with the design system\n * - Automatic close functionality\n * - Automatic tracking ID generation for analytics\n *\n * @example\n * <Drawer.Header>Settings</Drawer.Header>\n */\n Header: DrawerHeader,\n /**\n * Footer component for the drawer that displays action buttons and controls.\n *\n * Features:\n * - Flexible layout for action buttons and controls\n * - Optional sticky positioning at the bottom\n * - Proper semantic HTML structure\n * - Accessible with proper ARIA attributes\n * - Consistent styling with the design system\n * - Supports all standard footer element props\n * - Responsive design that adapts to content\n *\n * @example\n * <Drawer.Footer sticky>\n * <Button onClick={handleSave}>Save</Button>\n * <Drawer.CancelButton>Cancel</Drawer.CancelButton>\n * </Drawer.Footer>\n */\n Footer: DrawerFooter,\n /**\n * Content container for the drawer that holds the main content area.\n *\n * Features:\n * - Flexible content area with proper spacing\n * - Scrollable content when needed\n * - Proper semantic HTML structure\n * - Accessible with proper ARIA attributes\n * - Consistent styling with the design system\n * - Supports all standard div element props\n * - Responsive design that adapts to content\n * - Proper focus management\n *\n * @example\n * <Drawer.Content>\n * <p>This is the main content of the drawer.</p>\n * <p>It can contain any type of content.</p>\n * </Drawer.Content>\n */\n Content: DrawerContent,\n /**\n * A button component that automatically closes the drawer when clicked.\n *\n * Features:\n * - Automatically closes the drawer when clicked\n * - Extends Button component functionality\n * - Accessible with proper ARIA attributes\n * - Consistent styling with the design system\n * - Supports all standard button props\n * - Proper focus management\n * - Can be used anywhere within the drawer context\n * - Automatic tracking ID generation for analytics\n *\n * @example\n * <Drawer.CancelButton appearance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src/components/Drawer/internal/useDrawerContext.ts","../src/components/Drawer/DrawerCancelButton.tsx","../src/components/Drawer/DrawerHeader.tsx","../src/components/Drawer/DrawerFooter.tsx","../src/components/Drawer/DrawerContent.tsx","../src/components/Drawer/Drawer.tsx"],"sourcesContent":["import { useContext } from \"react\";\nimport { DrawerContext } from \"./DrawerContext\";\n\n/**\n * Hook to access the drawer context.\n *\n * @returns The drawer context containing close function and ref\n * @throws Error if used outside of a DrawerContextProvider\n */\nexport function useDrawerContext() {\n const context = useContext(DrawerContext);\n if (!context) {\n throw new Error(\n \"useDrawerContext must be used within a DrawerContextProvider\",\n );\n }\n return context;\n}\n","import { MouseEvent, forwardRef } from \"react\";\nimport { Button, ButtonProps } from \"../Button\";\nimport { DataTrackingId } from \"../../types\";\nimport { childrenToString } from \"../../internal/functions\";\nimport { useTrackingId } from \"../../hooks\";\nimport { useDrawerContext } from \"./internal/useDrawerContext\";\n\n/**\n * Props for the DrawerCancelButton component\n * @extends ButtonProps\n */\nexport type DrawerCancelButtonProps = ButtonProps & DataTrackingId;\n\n/**\n * A button component that automatically closes the drawer when clicked.\n *\n * Features:\n * - Automatically closes the drawer when clicked\n * - Extends Button component functionality\n * - Accessible with proper ARIA attributes\n * - Consistent styling with the design system\n * - Supports all standard button props\n * - Proper focus management\n * - Can be used anywhere within the drawer context\n *\n * @example\n * <DrawerCancelButton appearance=\"ghost\" size=\"small\">\n * Cancel\n * </DrawerCancelButton>\n */\nexport const DrawerCancelButton = forwardRef<\n HTMLButtonElement,\n DrawerCancelButtonProps\n>((props, ref) => {\n const { onClick, ...rest } = props;\n const { close } = useDrawerContext();\n const data = {\n children: childrenToString(props.children),\n appearance: props.appearance,\n size: props.size,\n type: props.type,\n };\n\n const trackingId = useTrackingId({\n name: \"DrawerCancelButton\",\n data,\n hasOverride: !!props[\"data-tracking-id\"],\n });\n\n const onClickHandler = (e: MouseEvent<HTMLButtonElement>) => {\n onClick?.(e);\n close();\n };\n return (\n <Button\n aria-label=\"Close drawer\"\n data-anv=\"drawer-cancel-button\"\n data-tracking-id={trackingId}\n onClick={onClickHandler}\n ref={ref}\n {...rest}\n />\n );\n});\n\nDrawerCancelButton.displayName = \"DrawerCancelButton\";\n","import { ComponentPropsWithoutRef, forwardRef } from \"react\";\nimport Close from \"@servicetitan/hammer-icon/mdi/round/close.svg\";\nimport styles from \"./Drawer.module.scss\";\nimport { Text } from \"../Text\";\nimport { DrawerCancelButton } from \"./DrawerCancelButton\";\nimport cx from \"classnames\";\nimport { DataTrackingId } from \"../../types\";\nimport { childrenToString } from \"../../internal/functions\";\nimport { useTrackingId, useMergeRefs } from \"../../hooks\";\nimport { useDrawerContext } from \"./internal/useDrawerContext\";\n\n/**\n * Props for the DrawerHeader component\n * @extends ComponentPropsWithoutRef<\"header\">\n */\nexport type DrawerHeaderProps = ComponentPropsWithoutRef<\"header\"> &\n DataTrackingId;\n\n/**\n * Header component for the drawer that displays a title and close button.\n *\n * Features:\n * - Displays the drawer title as a headline\n * - Includes an accessible close button\n * - Sticky positioning at the top of the drawer\n * - Proper semantic HTML structure\n * - Accessible with proper ARIA attributes\n * - Consistent styling with the design system\n * - Automatic close functionality\n *\n * @example\n * <Drawer.Header>Settings</Drawer.Header>\n */\nexport const DrawerHeader = forwardRef<HTMLHeadElement, DrawerHeaderProps>(\n (props, ref) => {\n const { className, children } = props;\n const { headerRef } = useDrawerContext();\n const data = {\n children: childrenToString(props.children),\n };\n\n const trackingId = useTrackingId({\n name: \"DrawerHeader\",\n data,\n hasOverride: !!props[\"data-tracking-id\"],\n });\n\n const drawerHeaderClasses = cx(styles.header, className);\n\n return (\n <header\n className={drawerHeaderClasses}\n data-anv=\"drawer-header\"\n data-tracking-id={trackingId}\n ref={useMergeRefs([ref, headerRef])}\n >\n <Text variant=\"headline\" el=\"h1\">\n {children}\n </Text>\n <span className={styles[\"close-container\"]}>\n <DrawerCancelButton\n className={styles[\"close-button\"]}\n size=\"small\"\n appearance=\"ghost\"\n aria-label=\"Close drawer\"\n data-anv=\"drawer-header-close-button\"\n icon={Close}\n />\n </span>\n </header>\n );\n },\n);\n\nDrawerHeader.displayName = \"DrawerHeader\";\n","import { ComponentPropsWithoutRef, forwardRef } from \"react\";\nimport styles from \"./Drawer.module.scss\";\nimport cx from \"classnames\";\n\n/**\n * Props for the DrawerFooter component\n * @extends ComponentPropsWithoutRef<\"footer\">\n */\nexport type DrawerFooterProps = ComponentPropsWithoutRef<\"footer\"> & {\n /**\n * When true, the footer will stick to the bottom of the drawer.\n * @default false\n */\n sticky?: boolean;\n};\n\n/**\n * Footer component for the drawer that displays action buttons and controls.\n *\n * Features:\n * - Flexible layout for action buttons and controls\n * - Optional sticky positioning at the bottom\n * - Proper semantic HTML structure\n * - Accessible with proper ARIA attributes\n * - Consistent styling with the design system\n * - Supports all standard footer element props\n * - Responsive design that adapts to content\n *\n * @example\n * <Drawer.Footer sticky>\n * <Button onClick={handleSave}>Save</Button>\n * <Button onClick={handleCancel}>Cancel</Button>\n * </Drawer.Footer>\n */\nexport const DrawerFooter = forwardRef<HTMLElement, DrawerFooterProps>(\n (props, ref) => {\n const { className, children, sticky = false, ...rest } = props;\n const drawerFooterClasses = cx(styles.footer, className, {\n [styles[\"sticky\"]]: sticky,\n });\n\n return (\n <footer\n className={drawerFooterClasses}\n data-anv=\"drawer-footer\"\n ref={ref}\n {...rest}\n >\n {children}\n </footer>\n );\n },\n);\n\nDrawerFooter.displayName = \"DrawerFooter\";\n","import {\n ComponentPropsWithoutRef,\n forwardRef,\n useEffect,\n useState,\n} from \"react\";\nimport styles from \"./Drawer.module.scss\";\nimport cx from \"classnames\";\nimport { useDrawerContext } from \"./internal/useDrawerContext\";\n\n/**\n * Props for the DrawerContent component\n * @extends ComponentPropsWithoutRef<\"div\">\n */\nexport type DrawerContentProps = ComponentPropsWithoutRef<\"div\"> & {\n /**\n * When true, the content will stick below the header during scroll.\n * @default false\n */\n sticky?: boolean;\n};\n\n/**\n * Content container for the drawer that holds the main content area.\n *\n * Features:\n * - Flexible content area with proper spacing\n * - Scrollable content when needed\n * - Optional sticky positioning below header\n * - Proper semantic HTML structure\n * - Accessible with proper ARIA attributes\n * - Consistent styling with the design system\n * - Supports all standard div element props\n * - Responsive design that adapts to content\n * - Proper focus management\n *\n * @example\n * // Basic content\n * <Drawer.Content>\n * <p>This is the main content of the drawer.</p>\n * </Drawer.Content>\n *\n * @example\n * // Sticky content (e.g., search field that remains visible while scrolling)\n * <Drawer.Content sticky>\n * <TextField placeholder=\"Filter results...\" />\n * </Drawer.Content>\n */\nexport const DrawerContent = forwardRef<HTMLDivElement, DrawerContentProps>(\n (props, ref) => {\n const { children, className, sticky = false, ...rest } = props;\n const { headerRef } = useDrawerContext();\n const [headerHeight, setHeaderHeight] = useState(0);\n\n useEffect(() => {\n const headerElement = headerRef?.current;\n if (!sticky || !headerElement) return;\n\n const updateHeight = () => {\n setHeaderHeight(headerElement.offsetHeight || 0);\n };\n\n updateHeight();\n const resizeObserver = new ResizeObserver(updateHeight);\n resizeObserver.observe(headerElement);\n\n return () => resizeObserver.disconnect();\n }, [sticky, headerRef]);\n\n const contentClassNames = cx(styles[\"content\"], className, {\n [styles[\"sticky\"]]: sticky,\n });\n\n const stickyStyle = sticky ? { top: `${headerHeight}px` } : undefined;\n\n return (\n <div\n className={contentClassNames}\n data-anv=\"drawer-content\"\n ref={ref}\n style={{ ...stickyStyle, ...rest.style }}\n {...rest}\n >\n {children}\n </div>\n );\n },\n);\n\nDrawerContent.displayName = \"DrawerContent\";\n","import styles from \"./Drawer.module.scss\";\nimport {\n ComponentPropsWithoutRef,\n forwardRef,\n useRef,\n useId,\n useCallback,\n useEffect,\n SyntheticEvent,\n KeyboardEvent,\n useMemo,\n} from \"react\";\nimport { DrawerHeader } from \"./DrawerHeader\";\nimport { DrawerFooter } from \"./DrawerFooter\";\nimport { DrawerContent } from \"./DrawerContent\";\nimport { DrawerCancelButton } from \"./DrawerCancelButton\";\nimport {\n OpenCloseTransitionStateEffects,\n useDialogScrollLock,\n useDialogTransitionStates,\n useKeyboardFocusables,\n useOnClickOutside,\n} from \"../../internal/hooks\";\nimport {\n FocusableElement,\n DisableCloseOnEscapeOrClickProps,\n Size,\n} from \"../../types\";\nimport { registerLayer, unregisterLayer } from \"../../internal/utils\";\nimport { useMergeRefs } from \"../../hooks\";\nimport cx from \"classnames\";\nimport { ToastProvider } from \"../Toast/internal/ToastProvider\";\nimport { ToasterPopover } from \"../Toast/internal/ToasterPopover\";\nimport { ToasterContent } from \"../Toast/internal/Toaster\";\nimport { DrawerContext } from \"./internal/DrawerContext\";\nimport { useInitialFocus } from \"../Dialog/internal/useInitialFocus\";\n\n/**\n * Props for the Drawer component\n * @extends ComponentPropsWithoutRef<\"dialog\">\n * @extends DialogTransitionStateEffects\n * @extends DisableCloseOnEscapeOrClickProps\n */\nexport type DrawerProps = ComponentPropsWithoutRef<\"dialog\"> &\n OpenCloseTransitionStateEffects &\n DisableCloseOnEscapeOrClickProps & {\n /**\n * The size of the drawer.\n * @default \"medium\"\n */\n size?: Extract<Size, \"medium\" | \"large\">;\n /**\n * Controls whether the drawer is open or closed.\n * @default false\n */\n open?: boolean;\n /**\n * Callback function called after the drawer is animated closed.\n */\n onClose?: () => void;\n /**\n * Callback function called when the drawer opens.\n * @deprecated Use onOpenAnimationStart or onOpenAnimationComplete instead\n */\n onOpen?: () => void;\n /**\n * Callback when clicking outside the drawer\n */\n onClickOutside?: (e: globalThis.MouseEvent) => void;\n /**\n * Enables scroll chaining behavior.\n * @link https://developer.mozilla.org/en-US/docs/Glossary/Scroll_chaining\n */\n enableScrollChaining?: boolean;\n /**\n * Given an array of focusable elements, return the initial focus target.\n * @param focusables - The focusable elements to pick from\n * @returns The initial focus target\n */\n initialFocusResolver?: (focusables: FocusableElement[]) => FocusableElement;\n };\n\nconst DrawerElement = forwardRef<HTMLDialogElement, DrawerProps>(\n (props, ref) => {\n const {\n className,\n open = false,\n children,\n onOpen,\n onClose,\n // onCancel is destructured so that it is not passed to the dialog in ...rest\n onCancel,\n onKeyDown,\n disableCloseOnEscape = false,\n onClickOutside,\n disableCloseOnClickOutside = false,\n size = \"medium\",\n enableScrollChaining,\n onOpenAnimationStart,\n onOpenAnimationComplete,\n onCloseAnimationStart,\n onCloseAnimationComplete,\n initialFocusResolver,\n ...rest\n } = props;\n\n const elRef = useRef<HTMLDialogElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const toasterRef = useRef<HTMLDivElement>(null);\n const headerRef = useRef<HTMLElement>(null);\n const combinedRef = useMergeRefs([elRef, ref]);\n const id = useId();\n\n const { state, isOpenOrOpening } = useDialogTransitionStates(elRef, open, {\n onOpenAnimationStart: useCallback(() => {\n onOpenAnimationStart?.();\n }, [onOpenAnimationStart]),\n onOpenAnimationComplete: useCallback(() => {\n onOpenAnimationComplete?.();\n onOpen?.(); // DEPRECATED\n }, [onOpen, onOpenAnimationComplete]),\n onCloseAnimationStart: useCallback(() => {\n onCloseAnimationStart?.();\n }, [onCloseAnimationStart]),\n onCloseAnimationComplete: useCallback(() => {\n onCloseAnimationComplete?.();\n }, [onCloseAnimationComplete]),\n });\n\n const classNames = cx([styles.drawer], className, {\n [styles.remove]: state === \"closing\",\n [styles.large]: size === \"large\",\n });\n\n const { focusables } = useKeyboardFocusables(contentRef, {\n observeChange: false,\n });\n const firstFocusable = focusables?.[0];\n const lastFocusable = focusables?.[focusables.length - 1];\n\n useDialogScrollLock({\n open: isOpenOrOpening,\n id,\n enableScrollChaining,\n elementRef: elRef,\n });\n\n // Register/unregister with layer manager for proper stacking\n useEffect(() => {\n if (open) {\n registerLayer(id);\n } else {\n unregisterLayer(id);\n }\n\n // Cleanup when component unmounts\n return () => {\n unregisterLayer(id);\n };\n }, [open, id]);\n\n const computeFocus = useCallback((focusables: FocusableElement[]) => {\n return (\n focusables.find(\n (focusable) => focusable.dataset.anv !== \"drawer-header-close-button\",\n ) || focusables[0]\n );\n }, []);\n\n useInitialFocus(elRef, {\n computeFocus: initialFocusResolver || computeFocus,\n });\n\n const onCancelHandler = (e: SyntheticEvent<HTMLDialogElement>) => {\n e.preventDefault();\n\n if (disableCloseOnEscape) return;\n onClose?.();\n };\n\n useOnClickOutside({\n onOutsidePress: (e) => {\n if (!open) return;\n onClickOutside?.(e);\n },\n targets: [\n contentRef.current as HTMLElement,\n toasterRef.current as HTMLElement,\n ],\n onClose: () => {\n if (disableCloseOnClickOutside || !open) return;\n onClose?.();\n },\n layerId: id,\n });\n\n const onKeyDownHandler = (e: KeyboardEvent<HTMLDialogElement>) => {\n onKeyDown?.(e);\n if (e.code === \"Tab\") {\n if (e.shiftKey && e.target === firstFocusable) {\n e.preventDefault();\n (lastFocusable as HTMLElement)?.focus();\n return;\n }\n if (e.target === lastFocusable && !e.shiftKey) {\n e.preventDefault();\n (firstFocusable as HTMLElement)?.focus();\n return;\n }\n }\n };\n\n const contextValue = useMemo(() => {\n return { close: () => onClose?.(), headerRef };\n }, [onClose]);\n\n return (\n // dialog element does seem to be interactive on MDN guideline\n <dialog\n className={classNames}\n data-anv=\"drawer\"\n data-anv-scroll-chaining={enableScrollChaining}\n data-anv-transition-state={state}\n ref={combinedRef}\n onCancel={onCancelHandler}\n onKeyDown={onKeyDownHandler}\n {...rest}\n >\n <ToastProvider isDialogToaster={isOpenOrOpening}>\n <ToasterPopover>\n <ToasterContent id=\"drawer-toaster\" ref={toasterRef} />\n </ToasterPopover>\n </ToastProvider>\n <DrawerContext.Provider value={contextValue}>\n <section\n ref={contentRef}\n className={styles.container}\n data-open={isOpenOrOpening}\n >\n {children}\n </section>\n </DrawerContext.Provider>\n </dialog>\n );\n },\n);\nDrawerElement.displayName = \"Drawer\";\n\n/**\n * A slide-out drawer component that provides a modal-like experience from the side of the screen.\n *\n * Features:\n * - Slide-in animation from the side of the screen\n * - Keyboard navigation with focus trapping\n * - Escape key and click outside to close\n * - Configurable size variants (medium, large)\n * - Built-in toast support for notifications\n * - Automatic scroll locking when open\n * - Accessible with proper ARIA attributes\n * - Compound component structure with Header, Footer, Content, and CancelButton\n * - Transition state callbacks for animation control\n * - Optional scroll chaining support\n * - Automatic tracking ID generation for analytics\n *\n * @example\n * <Drawer open={isOpen} onClose={handleClose} size=\"medium\">\n * <Drawer.Header>Settings</Drawer.Header>\n * <Drawer.Content>Drawer content goes here</Drawer.Content>\n * <Drawer.Footer>\n * <Button onClick={handleSave}>Save</Button>\n * <Drawer.CancelButton>Cancel</Drawer.CancelButton>\n * </Drawer.Footer>\n * </Drawer>\n */\nexport const Drawer = Object.assign(DrawerElement, {\n /**\n * Header component for the drawer that displays a title and close button.\n *\n * Features:\n * - Displays the drawer title as a headline\n * - Includes an accessible close button\n * - Sticky positioning at the top of the drawer\n * - Proper semantic HTML structure\n * - Accessible with proper ARIA attributes\n * - Consistent styling with the design system\n * - Automatic close functionality\n * - Automatic tracking ID generation for analytics\n *\n * @example\n * <Drawer.Header>Settings</Drawer.Header>\n */\n Header: DrawerHeader,\n /**\n * Footer component for the drawer that displays action buttons and controls.\n *\n * Features:\n * - Flexible layout for action buttons and controls\n * - Optional sticky positioning at the bottom\n * - Proper semantic HTML structure\n * - Accessible with proper ARIA attributes\n * - Consistent styling with the design system\n * - Supports all standard footer element props\n * - Responsive design that adapts to content\n *\n * @example\n * <Drawer.Footer sticky>\n * <Button onClick={handleSave}>Save</Button>\n * <Drawer.CancelButton>Cancel</Drawer.CancelButton>\n * </Drawer.Footer>\n */\n Footer: DrawerFooter,\n /**\n * Content container for the drawer that holds the main content area.\n *\n * Features:\n * - Flexible content area with proper spacing\n * - Scrollable content when needed\n * - Proper semantic HTML structure\n * - Accessible with proper ARIA attributes\n * - Consistent styling with the design system\n * - Supports all standard div element props\n * - Responsive design that adapts to content\n * - Proper focus management\n *\n * @example\n * <Drawer.Content>\n * <p>This is the main content of the drawer.</p>\n * <p>It can contain any type of content.</p>\n * </Drawer.Content>\n */\n Content: DrawerContent,\n /**\n * A button component that automatically closes the drawer when clicked.\n *\n * Features:\n * - Automatically closes the drawer when clicked\n * - Extends Button component functionality\n * - Accessible with proper ARIA attributes\n * - Consistent styling with the design system\n * - Supports all standard button props\n * - Proper focus management\n * - Can be used anywhere within the drawer context\n * - Automatic tracking ID generation for analytics\n *\n * @example\n * <Drawer.CancelButton appearance=\"ghost\" size=\"small\">\n * Cancel\n * </Drawer.CancelButton>\n */\n CancelButton: DrawerCancelButton,\n});\n"],"names":["Close","focusables"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASO,SAAS,gBAAA,GAAmB;AACjC,EAAA,MAAM,OAAA,GAAU,WAAW,aAAa,CAAA;AACxC,EAAA,IAAI,CAAC,OAAA,EAAS;AACZ,IAAA,MAAM,IAAI,KAAA;AAAA,MACR;AAAA,KACF;AAAA,EACF;AACA,EAAA,OAAO,OAAA;AACT;;ACaO,MAAM,kBAAA,GAAqB,UAAA,CAGhC,CAAC,KAAA,EAAO,GAAA,KAAQ;AAChB,EAAA,MAAM,EAAE,OAAA,EAAS,GAAG,IAAA,EAAK,GAAI,KAAA;AAC7B,EAAA,MAAM,EAAE,KAAA,EAAM,GAAI,gBAAA,EAAiB;AACnC,EAAA,MAAM,IAAA,GAAO;AAAA,IACX,QAAA,EAAU,gBAAA,CAAiB,KAAA,CAAM,QAAQ,CAAA;AAAA,IACzC,YAAY,KAAA,CAAM,UAAA;AAAA,IAClB,MAAM,KAAA,CAAM,IAAA;AAAA,IACZ,MAAM,KAAA,CAAM;AAAA,GACd;AAEA,EAAA,MAAM,aAAa,aAAA,CAAc;AAAA,IAC/B,IAAA,EAAM,oBAAA;AAAA,IACN,IAAA;AAAA,IACA,WAAA,EAAa,CAAC,CAAC,KAAA,CAAM,kBAAkB;AAAA,GACxC,CAAA;AAED,EAAA,MAAM,cAAA,GAAiB,CAAC,CAAA,KAAqC;AAC3D,IAAA,OAAA,GAAU,CAAC,CAAA;AACX,IAAA,KAAA,EAAM;AAAA,EACR,CAAA;AACA,EAAA,uBACE,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,YAAA,EAAW,cAAA;AAA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A;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmBT,YAAA,EAAc;AAChB,CAAC;;;;"}
package/dist/Drawer.css CHANGED
@@ -1,12 +1,12 @@
1
1
  @layer starter, reset, base, state, application;
2
2
  @layer base {
3
- ._drawer_k2741_2 {
3
+ ._drawer_6lfpm_2 {
4
4
  border: none;
5
5
  background: transparent;
6
6
  padding-block: 0;
7
7
  padding-inline: 0;
8
8
  outline: none;
9
- animation: _close-drawer_k2741_1 2s forwards;
9
+ animation: _close-drawer_6lfpm_1 2s forwards;
10
10
  transition: width 200ms;
11
11
  width: 35rem;
12
12
  height: 100%;
@@ -21,13 +21,13 @@
21
21
  --xpos: 10rem;
22
22
  --drawer-padding: 1.5rem;
23
23
  }
24
- ._drawer_k2741_2[open] {
25
- animation: _open-drawer_k2741_1 300ms forwards;
24
+ ._drawer_6lfpm_2[open] {
25
+ animation: _open-drawer_6lfpm_1 300ms forwards;
26
26
  }
27
- ._drawer_k2741_2[open]::backdrop {
28
- animation: _open-backdrop_k2741_1 200ms forwards;
27
+ ._drawer_6lfpm_2[open]::backdrop {
28
+ animation: _open-backdrop_6lfpm_1 200ms forwards;
29
29
  }
30
- ._drawer_k2741_2 ._container_k2741_29 {
30
+ ._drawer_6lfpm_2 ._container_6lfpm_29 {
31
31
  font-family: var(--font-family-base, "Nunito Sans", sans-serif);
32
32
  font-size: 100%;
33
33
  color: var(--foreground-color, #141414);
@@ -39,13 +39,13 @@
39
39
  overflow: auto;
40
40
  overscroll-behavior: contain;
41
41
  }
42
- ._drawer_k2741_2 ._container_k2741_29 ._content_k2741_41 {
42
+ ._drawer_6lfpm_2 ._container_6lfpm_29 ._content_6lfpm_41 {
43
43
  flex-grow: 1;
44
44
  font-size: 1rem;
45
45
  padding: var(--drawer-padding);
46
46
  isolation: isolate;
47
47
  }
48
- ._header_k2741_47 {
48
+ ._header_6lfpm_47 {
49
49
  position: sticky;
50
50
  inset-block-start: 0;
51
51
  display: flex;
@@ -55,20 +55,20 @@
55
55
  padding-inline: var(--drawer-padding);
56
56
  background-color: inherit;
57
57
  font-size: 1rem;
58
- z-index: 1;
58
+ z-index: 3;
59
59
  }
60
- ._header_k2741_47 h1 {
60
+ ._header_6lfpm_47 h1 {
61
61
  margin-block: 0;
62
62
  margin-inline: 0;
63
63
  }
64
- ._header_k2741_47 ._close-container_k2741_63 {
64
+ ._header_6lfpm_47 ._close-container_6lfpm_63 {
65
65
  display: flex;
66
66
  justify-content: center;
67
67
  align-items: center;
68
68
  width: 1.5625rem;
69
69
  height: 1.5625rem;
70
70
  }
71
- ._footer_k2741_70 {
71
+ ._footer_6lfpm_70 {
72
72
  display: flex;
73
73
  gap: 0.75rem;
74
74
  justify-content: flex-end;
@@ -81,39 +81,39 @@
81
81
  }
82
82
  @layer state {
83
83
  @media (prefers-reduced-motion: reduce) {
84
- ._drawer_k2741_2 {
84
+ ._drawer_6lfpm_2 {
85
85
  --xpos: 0;
86
86
  }
87
87
  }
88
- ._drawer_k2741_2._remove_k2741_87[open] {
89
- animation: _close-drawer_k2741_1 300ms forwards;
88
+ ._drawer_6lfpm_2._remove_6lfpm_87[open] {
89
+ animation: _close-drawer_6lfpm_1 300ms forwards;
90
90
  }
91
- ._drawer_k2741_2._remove_k2741_87[open]::backdrop {
92
- animation: _close-backdrop_k2741_1 200ms forwards;
91
+ ._drawer_6lfpm_2._remove_6lfpm_87[open]::backdrop {
92
+ animation: _close-backdrop_6lfpm_1 200ms forwards;
93
93
  }
94
- ._drawer_k2741_2::backdrop {
94
+ ._drawer_6lfpm_2::backdrop {
95
95
  background: #040404;
96
96
  }
97
- ._drawer_k2741_2._large_k2741_96 {
97
+ ._drawer_6lfpm_2._large_6lfpm_96 {
98
98
  width: 48rem;
99
99
  }
100
- ._drawer_k2741_2 ._content_k2741_41._sticky_k2741_99 {
100
+ ._drawer_6lfpm_2 ._content_6lfpm_41._sticky_6lfpm_99 {
101
101
  position: sticky;
102
102
  flex-grow: 0;
103
- z-index: 1;
103
+ z-index: 3;
104
104
  background-color: var(--background-color, #ffffff);
105
105
  padding-block-end: 0.25rem;
106
106
  }
107
- ._drawer_k2741_2 ._content_k2741_41._sticky_k2741_99 + ._content_k2741_41 {
107
+ ._drawer_6lfpm_2 ._content_6lfpm_41._sticky_6lfpm_99 + ._content_6lfpm_41 {
108
108
  padding-block-start: 0.25rem;
109
109
  }
110
- ._drawer_k2741_2 ._footer_k2741_70._sticky_k2741_99 {
110
+ ._drawer_6lfpm_2 ._footer_6lfpm_70._sticky_6lfpm_99 {
111
111
  position: sticky;
112
112
  inset-block-end: 0;
113
113
  }
114
114
  }
115
115
  @layer application {
116
- ._drawer_k2741_2 ._header_k2741_47 ._close-button_k2741_115 {
116
+ ._drawer_6lfpm_2 ._header_6lfpm_47 ._close-button_6lfpm_115 {
117
117
  color: var(--foreground-color, #141414);
118
118
  }
119
119
  }
@@ -121,7 +121,7 @@
121
121
  overflow: hidden;
122
122
  }
123
123
 
124
- @keyframes _open-drawer_k2741_1 {
124
+ @keyframes _open-drawer_6lfpm_1 {
125
125
  from {
126
126
  opacity: 0;
127
127
  transform: translateX(var(--xpos));
@@ -131,7 +131,7 @@
131
131
  transform: translateX(0%);
132
132
  }
133
133
  }
134
- @keyframes _close-drawer_k2741_1 {
134
+ @keyframes _close-drawer_6lfpm_1 {
135
135
  from {
136
136
  opacity: 1;
137
137
  transform: translateX(0%);
@@ -141,7 +141,7 @@
141
141
  transform: translateX(var(--xpos));
142
142
  }
143
143
  }
144
- @keyframes _open-backdrop_k2741_1 {
144
+ @keyframes _open-backdrop_6lfpm_1 {
145
145
  from {
146
146
  opacity: 0;
147
147
  }
@@ -149,7 +149,7 @@
149
149
  opacity: 0.6;
150
150
  }
151
151
  }
152
- @keyframes _close-backdrop_k2741_1 {
152
+ @keyframes _close-backdrop_6lfpm_1 {
153
153
  from {
154
154
  opacity: 0.6;
155
155
  }
@@ -160,9 +160,9 @@
160
160
  body:has(
161
161
  dialog[data-anv="drawer"][open]:not([data-anv-scroll-chaining="true"])
162
162
  ) {
163
- overflow: hidden;
163
+ overflow: hidden !important;
164
164
  }
165
165
 
166
166
  body:has([data-anv-dialogs-open="true"]) {
167
- overflow: hidden;
167
+ overflow: hidden !important;
168
168
  }
package/dist/Drawer.js CHANGED
@@ -1,2 +1,2 @@
1
- export { D as Drawer, a as DrawerCancelButton, d as DrawerContent, b as DrawerFooter, c as DrawerHeader, D as default } from './Drawer-scQFylHI.js';
1
+ export { D as Drawer, a as DrawerCancelButton, d as DrawerContent, b as DrawerFooter, c as DrawerHeader, D as default } from './Drawer-BHK18NYm.js';
2
2
  //# sourceMappingURL=Drawer.js.map
@@ -2,7 +2,7 @@ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
2
  import { useState, forwardRef } from 'react';
3
3
  import { c as cx } from './index-tZvMCc77.js';
4
4
  import { S as SrOnly } from './SrOnly-CTsYSuby.js';
5
- import { T as Tooltip } from './Tooltip-BbfLb3pI.js';
5
+ import { T as Tooltip } from './Tooltip-CBy7srE2.js';
6
6
  import { I as Icon } from './Icon-BSuTVNaa.js';
7
7
  import { S as SvgInfo } from './info-CYpG6tcI.js';
8
8
 
@@ -92,4 +92,4 @@ FieldLabelElement.displayName = "FieldLabel";
92
92
  const FieldLabel = FieldLabelElement;
93
93
 
94
94
  export { FieldLabel as F };
95
- //# sourceMappingURL=FieldLabel-BIStrC2x.js.map
95
+ //# sourceMappingURL=FieldLabel-jqlQ1Ldh.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FieldLabel-BIStrC2x.js","sources":["../src/components/FieldLabel/internal/FieldLabelMoreInfoIcon.tsx","../src/components/FieldLabel/FieldLabel.tsx"],"sourcesContent":["import { FieldLabelProps } from \"../FieldLabel\";\nimport { Tooltip } from \"../../Tooltip\";\nimport { Icon } from \"../../Icon\";\nimport Info from \"@servicetitan/hammer-icon/mdi/round/info.svg\";\nimport styles from \"../FieldLabel.module.scss\";\nimport { useState } from \"react\";\n\n/**\n * Internal component for rendering the info icon with tooltip.\n *\n * @param props - Component props\n * @param props.moreInfo - The content to display in the tooltip\n * @param props.openMoreInfo - Controls the tooltip open state\n * @param props.listenForHover - Whether to listen for hover events\n */\nexport const FieldLabelMoreInfoIcon = ({\n moreInfo,\n openMoreInfo,\n listenForHover = false,\n}: {\n moreInfo: FieldLabelProps[\"moreInfo\"];\n openMoreInfo: FieldLabelProps[\"openMoreInfo\"];\n listenForHover?: boolean;\n}) => {\n const [hovered, setHovered] = useState(false);\n const open = listenForHover && hovered ? true : openMoreInfo;\n return (\n <Tooltip\n open={open}\n placement=\"top\"\n offset={5}\n fallbackPlacements={[\"right\", \"bottom\", \"left\"]}\n >\n <Tooltip.Trigger\n className={styles[\"info-trigger\"]}\n onMouseEnter={() => setHovered(true)}\n onMouseLeave={() => setHovered(false)}\n >\n <Icon svg={Info} />\n </Tooltip.Trigger>\n <Tooltip.Content className={styles[\"info-content\"]}>\n {moreInfo}\n </Tooltip.Content>\n </Tooltip>\n );\n};\n","import {\n forwardRef,\n ComponentPropsWithoutRef,\n ReactNode,\n type ElementType,\n type JSX,\n type JSXElementConstructor,\n} from \"react\";\nimport cx from \"classnames\";\n\nimport styles from \"./FieldLabel.module.scss\";\nimport { TooltipProps } from \"../Tooltip\";\nimport { SrOnly } from \"../SrOnly\";\nimport { FieldLabelMoreInfoIcon } from \"./internal/FieldLabelMoreInfoIcon\";\n\ntype IntrinsicAttributes<\n E extends keyof JSX.IntrinsicElements | JSXElementConstructor<unknown>,\n> = JSX.LibraryManagedAttributes<E, ComponentPropsWithoutRef<E>>;\n\ntype FieldLabelOwnProps<E extends ElementType = ElementType> = {\n /** The HTML element to render */\n el?: E;\n /** Unique identifier for the label element */\n id?: string;\n /**\n * Whether the field is required. Shows a red asterisk (*) when true.\n * @default false\n */\n required?: boolean;\n /** Additional information to display in a tooltip */\n moreInfo?: ReactNode;\n /**\n * Controls the open state of the more info tooltip.\n * @default false\n */\n openMoreInfo?: TooltipProps[\"open\"];\n};\n\n/**\n * Props for the FieldLabel component.\n */\nexport type FieldLabelProps<E extends ElementType = ElementType> =\n FieldLabelOwnProps<E> &\n Omit<IntrinsicAttributes<E>, keyof FieldLabelOwnProps>;\n\n/**\n * FieldLabel component for form field labels with optional required indicator and help tooltip.\n *\n * Features:\n * - Accessible form label with proper semantic HTML\n * - Optional required field indicator with red asterisk\n * - Help tooltip with info icon for additional context\n * - Screen reader support for required field announcement\n * - Controlled and uncontrolled tooltip state management\n * - Flexible content support for label text and help information\n * - Proper ARIA attributes and semantic structure\n * - Responsive design with consistent typography\n * - Polymorphic element support for different HTML elements\n *\n * @example\n * <FieldLabel as=\"label\" htmlFor=\"email\" required>\n * Email Address\n * </FieldLabel>\n * <input id=\"email\" type=\"email\" />\n *\n * @example\n * <FieldLabel\n * el=\"label\"\n * htmlFor=\"password\"\n * required\n * moreInfo=\"Password must be at least 8 characters long\"\n * >\n * Password\n * </FieldLabel>\n * <input id=\"password\" type=\"password\" />\n *\n * @example\n * <FieldLabel el=\"legend\" required>\n * Form Section\n * </FieldLabel>\n */\nconst FieldLabelElement = forwardRef(\n (\n {\n el: Element = \"label\",\n children,\n className,\n moreInfo,\n required,\n openMoreInfo,\n ...props\n }: FieldLabelProps,\n ref,\n ) => {\n const FieldLabelClassNames = cx([styles[\"label\"]], className);\n\n return (\n <Element\n className={FieldLabelClassNames}\n data-anv=\"label\"\n ref={ref}\n {...props}\n >\n <div className={styles[\"top-container\"]} aria-atomic=\"true\">\n <span className={styles[\"label-text\"]}>\n {children}\n {required ? (\n <>\n <span aria-hidden className={styles[\"required\"]}>\n *\n </span>\n <SrOnly>Required</SrOnly>\n </>\n ) : null}\n </span>\n {moreInfo ? (\n <FieldLabelMoreInfoIcon\n moreInfo={moreInfo}\n openMoreInfo={openMoreInfo}\n />\n ) : null}\n </div>\n\n {moreInfo ? <SrOnly>{moreInfo}</SrOnly> : null}\n </Element>\n );\n },\n);\n\nFieldLabelElement.displayName = \"FieldLabel\";\n\nexport const FieldLabel = FieldLabelElement as <\n E extends ElementType = \"label\",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,uBAAuB,EAAA,CAAG,CAAC,OAAO,OAAO,CAAC,GAAG,SAAS,CAAA;AAE5D,IAAA,uBACE,IAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAW,oBAAA;AAAA,QACX,UAAA,EAAS,OAAA;AAAA,QACT,GAAA;AAAA,QACC,GAAG,KAAA;AAAA,QAEJ,QAAA,EAAA;AAAA,0BAAA,IAAA,CAAC,SAAI,SAAA,EAAW,MAAA,CAAO,eAAe,CAAA,EAAG,eAAY,MAAA,EACnD,QAAA,EAAA;AAAA,4BAAA,IAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAW,MAAA,CAAO,YAAY,CAAA,EACjC,QAAA,EAAA;AAAA,cAAA,QAAA;AAAA,cACA,2BACC,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,gCAAA,GAAA,CAAC,UAAK,aAAA,EAAW,IAAA,EAAC,WAAW,MAAA,CAAO,UAAU,GAAG,QAAA,EAAA,GAAA,EAEjD,CAAA;AAAA,gCACA,GAAA,CAAC,UAAO,QAAA,EAAA,UAAA,EAAQ;AAAA,eAAA,EAClB,CAAA,GACE;AAAA,aAAA,EACN,CAAA;AAAA,YACC,QAAA,mBACC,GAAA;AAAA,cAAC,sBAAA;AAAA,cAAA;AAAA,gBACC,QAAA;AAAA,gBACA;AAAA;AAAA,aACF,GACE;AAAA,WAAA,EACN,CAAA;AAAA,UAEC,QAAA,mBAAW,GAAA,CAAC,MAAA,EAAA,EAAQ,QAAA,EAAA,QAAA,EAAS,CAAA,GAAY;AAAA;AAAA;AAAA,KAC5C;AAAA,EAEJ;AACF,CAAA;AAEA,iBAAA,CAAkB,WAAA,GAAc,YAAA;AAEzB,MAAM,UAAA,GAAa;;;;"}
1
+ {"version":3,"file":"FieldLabel-jqlQ1Ldh.js","sources":["../src/components/FieldLabel/internal/FieldLabelMoreInfoIcon.tsx","../src/components/FieldLabel/FieldLabel.tsx"],"sourcesContent":["import { FieldLabelProps } from \"../FieldLabel\";\nimport { Tooltip } from \"../../Tooltip\";\nimport { Icon } from \"../../Icon\";\nimport Info from \"@servicetitan/hammer-icon/mdi/round/info.svg\";\nimport styles from \"../FieldLabel.module.scss\";\nimport { useState } from \"react\";\n\n/**\n * Internal component for rendering the info icon with tooltip.\n *\n * @param props - Component props\n * @param props.moreInfo - The content to display in the tooltip\n * @param props.openMoreInfo - Controls the tooltip open state\n * @param props.listenForHover - Whether to listen for hover events\n */\nexport const FieldLabelMoreInfoIcon = ({\n moreInfo,\n openMoreInfo,\n listenForHover = false,\n}: {\n moreInfo: FieldLabelProps[\"moreInfo\"];\n openMoreInfo: FieldLabelProps[\"openMoreInfo\"];\n listenForHover?: boolean;\n}) => {\n const [hovered, setHovered] = useState(false);\n const open = listenForHover && hovered ? true : openMoreInfo;\n return (\n <Tooltip\n open={open}\n placement=\"top\"\n offset={5}\n fallbackPlacements={[\"right\", \"bottom\", \"left\"]}\n >\n <Tooltip.Trigger\n className={styles[\"info-trigger\"]}\n onMouseEnter={() => setHovered(true)}\n onMouseLeave={() => setHovered(false)}\n >\n <Icon svg={Info} />\n </Tooltip.Trigger>\n <Tooltip.Content className={styles[\"info-content\"]}>\n {moreInfo}\n </Tooltip.Content>\n </Tooltip>\n );\n};\n","import {\n forwardRef,\n ComponentPropsWithoutRef,\n ReactNode,\n type ElementType,\n type JSX,\n type JSXElementConstructor,\n} from \"react\";\nimport cx from \"classnames\";\n\nimport styles from \"./FieldLabel.module.scss\";\nimport { TooltipProps } from \"../Tooltip\";\nimport { SrOnly } from \"../SrOnly\";\nimport { FieldLabelMoreInfoIcon } from \"./internal/FieldLabelMoreInfoIcon\";\n\ntype IntrinsicAttributes<\n E extends keyof JSX.IntrinsicElements | JSXElementConstructor<unknown>,\n> = JSX.LibraryManagedAttributes<E, ComponentPropsWithoutRef<E>>;\n\ntype FieldLabelOwnProps<E extends ElementType = ElementType> = {\n /** The HTML element to render */\n el?: E;\n /** Unique identifier for the label element */\n id?: string;\n /**\n * Whether the field is required. Shows a red asterisk (*) when true.\n * @default false\n */\n required?: boolean;\n /** Additional information to display in a tooltip */\n moreInfo?: ReactNode;\n /**\n * Controls the open state of the more info tooltip.\n * @default false\n */\n openMoreInfo?: TooltipProps[\"open\"];\n};\n\n/**\n * Props for the FieldLabel component.\n */\nexport type FieldLabelProps<E extends ElementType = ElementType> =\n FieldLabelOwnProps<E> &\n Omit<IntrinsicAttributes<E>, keyof FieldLabelOwnProps>;\n\n/**\n * FieldLabel component for form field labels with optional required indicator and help tooltip.\n *\n * Features:\n * - Accessible form label with proper semantic HTML\n * - Optional required field indicator with red asterisk\n * - Help tooltip with info icon for additional context\n * - Screen reader support for required field announcement\n * - Controlled and uncontrolled tooltip state management\n * - Flexible content support for label text and help information\n * - Proper ARIA attributes and semantic structure\n * - Responsive design with consistent typography\n * - Polymorphic element support for different HTML elements\n *\n * @example\n * <FieldLabel as=\"label\" htmlFor=\"email\" required>\n * Email Address\n * </FieldLabel>\n * <input id=\"email\" type=\"email\" />\n *\n * @example\n * <FieldLabel\n * el=\"label\"\n * htmlFor=\"password\"\n * required\n * moreInfo=\"Password must be at least 8 characters long\"\n * >\n * Password\n * </FieldLabel>\n * <input id=\"password\" type=\"password\" />\n *\n * @example\n * <FieldLabel el=\"legend\" required>\n * Form Section\n * </FieldLabel>\n */\nconst FieldLabelElement = forwardRef(\n (\n {\n el: Element = \"label\",\n children,\n className,\n moreInfo,\n required,\n openMoreInfo,\n ...props\n }: FieldLabelProps,\n ref,\n ) => {\n const FieldLabelClassNames = cx([styles[\"label\"]], className);\n\n return (\n <Element\n className={FieldLabelClassNames}\n data-anv=\"label\"\n ref={ref}\n {...props}\n >\n <div className={styles[\"top-container\"]} aria-atomic=\"true\">\n <span className={styles[\"label-text\"]}>\n {children}\n {required ? (\n <>\n <span aria-hidden className={styles[\"required\"]}>\n *\n </span>\n <SrOnly>Required</SrOnly>\n </>\n ) : null}\n </span>\n {moreInfo ? (\n <FieldLabelMoreInfoIcon\n moreInfo={moreInfo}\n openMoreInfo={openMoreInfo}\n />\n ) : null}\n </div>\n\n {moreInfo ? <SrOnly>{moreInfo}</SrOnly> : null}\n </Element>\n );\n },\n);\n\nFieldLabelElement.displayName = \"FieldLabel\";\n\nexport const FieldLabel = FieldLabelElement as <\n E extends ElementType = \"label\",\n>(\n props: FieldLabelProps<E>,\n) => JSX.Element;\n"],"names":["Info"],"mappings":";;;;;;;;;;;;;;;;;;;AAeO,MAAM,yBAAyB,CAAC;AAAA,EACrC,QAAA;AAAA,EACA,YAAA;AAAA,EACA,cAAA,GAAiB;AACnB,CAAA,KAIM;AACJ,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAS,KAAK,CAAA;AAC5C,EAAA,MAAM,IAAA,GAAO,cAAA,IAAkB,OAAA,GAAU,IAAA,GAAO,YAAA;AAChD,EAAA,uBACE,IAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACC,IAAA;AAAA,MACA,SAAA,EAAU,KAAA;AAAA,MACV,MAAA,EAAQ,CAAA;AAAA,MACR,kBAAA,EAAoB,CAAC,OAAA,EAAS,QAAA,EAAU,MAAM,CAAA;AAAA,MAE9C,QAAA,EAAA;AAAA,wBAAA,GAAA;AAAA,UAAC,OAAA,CAAQ,OAAA;AAAA,UAAR;AAAA,YACC,SAAA,EAAW,OAAO,cAAc,CAAA;AAAA,YAChC,YAAA,EAAc,MAAM,UAAA,CAAW,IAAI,CAAA;AAAA,YACnC,YAAA,EAAc,MAAM,UAAA,CAAW,KAAK,CAAA;AAAA,YAEpC,QAAA,kBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,GAAA,EAAKA,OAAA,EAAM;AAAA;AAAA,SACnB;AAAA,wBACA,GAAA,CAAC,QAAQ,OAAA,EAAR,EAAgB,WAAW,MAAA,CAAO,cAAc,GAC9C,QAAA,EAAA,QAAA,EACH;AAAA;AAAA;AAAA,GACF;AAEJ,CAAA;;ACoCA,MAAM,iBAAA,GAAoB,UAAA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,WAAA,GAAc,YAAA;AAEzB,MAAM,UAAA,GAAa;;;;"}
@@ -1,2 +1,2 @@
1
- export { F as FieldLabel, F as default } from './FieldLabel-BIStrC2x.js';
1
+ export { F as FieldLabel, F as default } from './FieldLabel-jqlQ1Ldh.js';
2
2
  //# sourceMappingURL=FieldLabel.js.map
@@ -2,7 +2,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { forwardRef } from 'react';
3
3
  import { c as cx } from './index-tZvMCc77.js';
4
4
  import { I as Icon } from './Icon-BSuTVNaa.js';
5
- import { S as SvgWarning } from './warning-c4Wj1rI4.js';
5
+ import { S as SvgError } from './error-DR_wWdYY.js';
6
6
 
7
7
  import './FieldMessage.css';const messages = "_messages_1hr9l_1";
8
8
  const styles = {
@@ -37,7 +37,7 @@ const FieldMessage = forwardRef(
37
37
  inherit: true,
38
38
  className: styles["error-icon"],
39
39
  "aria-hidden": true,
40
- svg: SvgWarning
40
+ svg: SvgError
41
41
  }
42
42
  ),
43
43
  /* @__PURE__ */ jsx("span", { className: styles["error-message"], "aria-live": errorAriaLive, children: errorMessage })
@@ -51,4 +51,4 @@ const FieldMessage = forwardRef(
51
51
  FieldMessage.displayName = "FieldMessage";
52
52
 
53
53
  export { FieldMessage as F };
54
- //# sourceMappingURL=FieldMessage-DWONT3dr.js.map
54
+ //# sourceMappingURL=FieldMessage-DdCUxZz-.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FieldMessage-DdCUxZz-.js","sources":["../src/components/FieldMessage/FieldMessage.tsx"],"sourcesContent":["import {\n forwardRef,\n type AriaAttributes,\n type ReactElement,\n type ComponentPropsWithoutRef,\n} from \"react\";\nimport cx from \"classnames\";\nimport styles from \"./FieldMessage.module.scss\";\nimport { Icon } from \"../Icon\";\nimport Error from \"@servicetitan/hammer-icon/mdi/round/error.svg\";\n\n/**\n * Props for the FieldMessage component\n * @extends ComponentPropsWithoutRef<\"div\">\n */\nexport type FieldMessageProps = ComponentPropsWithoutRef<\"div\"> & {\n /**\n * Unique identifier for the field message container.\n */\n id?: string;\n /**\n * Hint text or element to display when there's no error.\n */\n hint?: ReactElement | string;\n /**\n * Description text or element to display below the main message.\n */\n description?: ReactElement | string;\n /**\n * Error message or element to display when there's an error.\n */\n errorMessage?: ReactElement | string;\n /**\n * aria-live attribute value for the error message.\n * @default assertive\n * @remarks Controls how screen readers announce error messages. \"assertive\" interrupts current speech, \"polite\" waits for current speech to finish.\n * @link https://www.w3.org/WAI/tutorials/forms/notifications/\n */\n errorAriaLive?: AriaAttributes[\"aria-live\"];\n};\n\n/**\n * FieldMessage component for displaying hints, descriptions, and error messages for form fields.\n *\n * Features:\n * - Displays hint text when no error is present\n * - Shows error messages with warning icon when errors occur\n * - Supports both string and React element content\n * - Configurable aria-live behavior for screen readers\n * - Optional description text for additional context\n * - Accessible with proper ARIA attributes\n * - Visual error indicators with warning icons\n * - Conditional rendering based on error state\n * - Supports layout utilities for positioning and spacing\n *\n * @example\n * <FieldMessage\n * hint=\"Enter your email address\"\n * description=\"We'll use this to send you updates\"\n * errorMessage=\"Please enter a valid email address\"\n * />\n */\nexport const FieldMessage = forwardRef<HTMLDivElement, FieldMessageProps>(\n (props, ref) => {\n const {\n id,\n hint,\n description,\n errorAriaLive = \"assertive\",\n errorMessage,\n className,\n ...rest\n } = props;\n\n return (\n <div\n {...rest}\n className={cx(styles[\"messages\"], className)}\n ref={ref}\n id={id}\n >\n {errorMessage ? (\n <div className={styles[\"error-container\"]}>\n <Icon\n inherit\n className={styles[\"error-icon\"]}\n aria-hidden\n svg={Error}\n />\n <span className={styles[\"error-message\"]} aria-live={errorAriaLive}>\n {errorMessage}\n </span>\n </div>\n ) : (\n (hint ?? null)\n )}\n {description ? (\n <div className={styles[\"description-container\"]}>\n {description ? <span>{description}</span> : null}\n </div>\n ) : null}\n </div>\n );\n },\n);\n\nFieldMessage.displayName = \"FieldMessage\";\n"],"names":["Error"],"mappings":";;;;;;;;;;;;;AA8DO,MAAM,YAAA,GAAe,UAA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DWONT3dr.js';
1
+ export { F as FieldMessage, F as default } from './FieldMessage-DdCUxZz-.js';
2
2
  //# sourceMappingURL=FieldMessage.js.map
@@ -1,6 +1,6 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { forwardRef } from 'react';
3
- import { F as FieldMessage } from './FieldMessage-DWONT3dr.js';
3
+ import { F as FieldMessage } from './FieldMessage-DdCUxZz-.js';
4
4
  import { S as SrOnly } from './SrOnly-CTsYSuby.js';
5
5
 
6
6
  import './Helper.css';const helper = "_helper_157uk_1";
@@ -43,4 +43,4 @@ const Helper = forwardRef((props, ref) => {
43
43
  Helper.displayName = "Helper";
44
44
 
45
45
  export { Helper as H };
46
- //# sourceMappingURL=Helper-DjWotFtO.js.map
46
+ //# sourceMappingURL=Helper-DzVUQgUJ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Helper-DjWotFtO.js","sources":["../src/internal/components/Helper/Helper.tsx"],"sourcesContent":["import { forwardRef, AriaAttributes, ReactElement } from \"react\";\nimport styles from \"./Helper.module.scss\";\nimport { FieldMessage } from \"../../../components/FieldMessage\";\nimport { SrOnly } from \"../../../components/SrOnly\";\n\nexport type HelperProps = {\n id?: string;\n // required?: boolean;\n hint?: ReactElement | string;\n description?: ReactElement | string;\n errorMessage?: ReactElement | string;\n /**\n * aria-live for the error message\n * @default assertive\n * @link https://www.w3.org/WAI/tutorials/forms/notifications/\n */\n errorAriaLive?: AriaAttributes[\"aria-live\"];\n maxLength?: number;\n inputLength?: number;\n isTyping?: boolean;\n showCounter?: boolean;\n};\n\nexport const Helper = forwardRef<HTMLDivElement, HelperProps>((props, ref) => {\n const {\n id,\n hint,\n description,\n errorAriaLive = \"assertive\",\n errorMessage,\n maxLength,\n isTyping,\n inputLength = 0,\n showCounter,\n } = props;\n\n return (\n <div className={styles[\"helper\"]} ref={ref} id={id}>\n <FieldMessage\n className={styles[\"messages\"]}\n hint={hint}\n description={description}\n errorAriaLive={errorAriaLive}\n errorMessage={errorMessage}\n />\n\n {showCounter ? (\n <div className={styles[\"counter\"]}>\n <span aria-hidden=\"true\">\n {inputLength}/{maxLength}\n </span>\n </div>\n ) : null}\n {isTyping && !!maxLength ? (\n maxLength - inputLength >= 1 ? (\n <SrOnly>\n {/* TODO: potential localization */}\n <span aria-live=\"polite\" aria-atomic=\"true\">{`${\n maxLength - inputLength\n } character${maxLength - inputLength !== 1 ? \"s\" : \"\"} left`}</span>\n </SrOnly>\n ) : (\n <SrOnly>\n {/* TODO: potential localization */}\n <span role=\"alert\">Maximum characters count reached</span>\n </SrOnly>\n )\n ) : null}\n </div>\n );\n});\n\nHelper.displayName = \"Helper\";\n"],"names":[],"mappings":";;;;;;;;;;;AAuBO,MAAM,MAAA,GAAS,UAAA,CAAwC,CAAC,KAAA,EAAO,GAAA,KAAQ;AAC5E,EAAA,MAAM;AAAA,IACJ,EAAA;AAAA,IACA,IAAA;AAAA,IACA,WAAA;AAAA,IACA,aAAA,GAAgB,WAAA;AAAA,IAChB,YAAA;AAAA,IACA,SAAA;AAAA,IACA,QAAA;AAAA,IACA,WAAA,GAAc,CAAA;AAAA,IACd;AAAA,GACF,GAAI,KAAA;AAEJ,EAAA,4BACG,KAAA,EAAA,EAAI,SAAA,EAAW,OAAO,QAAQ,CAAA,EAAG,KAAU,EAAA,EAC1C,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAW,OAAO,UAAU,CAAA;AAAA,QAC5B,IAAA;AAAA,QACA,WAAA;AAAA,QACA,aAAA;AAAA,QACA;AAAA;AAAA,KACF;AAAA,IAEC,WAAA,mBACC,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,MAAA,CAAO,SAAS,CAAA,EAC9B,QAAA,kBAAA,IAAA,CAAC,MAAA,EAAA,EAAK,aAAA,EAAY,MAAA,EACf,QAAA,EAAA;AAAA,MAAA,WAAA;AAAA,MAAY,GAAA;AAAA,MAAE;AAAA,KAAA,EACjB,GACF,CAAA,GACE,IAAA;AAAA,IACH,QAAA,IAAY,CAAC,CAAC,SAAA,GACb,YAAY,WAAA,IAAe,CAAA,mBACzB,GAAA,CAAC,MAAA,EAAA,EAEC,8BAAC,MAAA,EAAA,EAAK,WAAA,EAAU,QAAA,EAAS,aAAA,EAAY,QAAQ,QAAA,EAAA,CAAA,EAC3C,SAAA,GAAY,WACd,CAAA,UAAA,EAAa,YAAY,WAAA,KAAgB,CAAA,GAAI,GAAA,GAAM,EAAE,SAAQ,CAAA,EAC/D,CAAA,mBAEA,GAAA,CAAC,MAAA,EAAA,EAEC,8BAAC,MAAA,EAAA,EAAK,IAAA,EAAK,OAAA,EAAQ,QAAA,EAAA,kCAAA,EAAgC,GACrD,CAAA,GAEA;AAAA,GAAA,EACN,CAAA;AAEJ,CAAC;AAED,MAAA,CAAO,WAAA,GAAc,QAAA;;;;"}
1
+ {"version":3,"file":"Helper-DzVUQgUJ.js","sources":["../src/internal/components/Helper/Helper.tsx"],"sourcesContent":["import { forwardRef, AriaAttributes, ReactElement } from \"react\";\nimport styles from \"./Helper.module.scss\";\nimport { FieldMessage } from \"../../../components/FieldMessage\";\nimport { SrOnly } from \"../../../components/SrOnly\";\n\nexport type HelperProps = {\n id?: string;\n // required?: boolean;\n hint?: ReactElement | string;\n description?: ReactElement | string;\n errorMessage?: ReactElement | string;\n /**\n * aria-live for the error message\n * @default assertive\n * @link https://www.w3.org/WAI/tutorials/forms/notifications/\n */\n errorAriaLive?: AriaAttributes[\"aria-live\"];\n maxLength?: number;\n inputLength?: number;\n isTyping?: boolean;\n showCounter?: boolean;\n};\n\nexport const Helper = forwardRef<HTMLDivElement, HelperProps>((props, ref) => {\n const {\n id,\n hint,\n description,\n errorAriaLive = \"assertive\",\n errorMessage,\n maxLength,\n isTyping,\n inputLength = 0,\n showCounter,\n } = props;\n\n return (\n <div className={styles[\"helper\"]} ref={ref} id={id}>\n <FieldMessage\n className={styles[\"messages\"]}\n hint={hint}\n description={description}\n errorAriaLive={errorAriaLive}\n errorMessage={errorMessage}\n />\n\n {showCounter ? (\n <div className={styles[\"counter\"]}>\n <span aria-hidden=\"true\">\n {inputLength}/{maxLength}\n </span>\n </div>\n ) : null}\n {isTyping && !!maxLength ? (\n maxLength - inputLength >= 1 ? (\n <SrOnly>\n {/* TODO: potential localization */}\n <span aria-live=\"polite\" aria-atomic=\"true\">{`${\n maxLength - inputLength\n } character${maxLength - inputLength !== 1 ? \"s\" : \"\"} left`}</span>\n </SrOnly>\n ) : (\n <SrOnly>\n {/* TODO: potential localization */}\n <span role=\"alert\">Maximum characters count reached</span>\n </SrOnly>\n )\n ) : null}\n </div>\n );\n});\n\nHelper.displayName = \"Helper\";\n"],"names":[],"mappings":";;;;;;;;;;;AAuBO,MAAM,MAAA,GAAS,UAAA,CAAwC,CAAC,KAAA,EAAO,GAAA,KAAQ;AAC5E,EAAA,MAAM;AAAA,IACJ,EAAA;AAAA,IACA,IAAA;AAAA,IACA,WAAA;AAAA,IACA,aAAA,GAAgB,WAAA;AAAA,IAChB,YAAA;AAAA,IACA,SAAA;AAAA,IACA,QAAA;AAAA,IACA,WAAA,GAAc,CAAA;AAAA,IACd;AAAA,GACF,GAAI,KAAA;AAEJ,EAAA,4BACG,KAAA,EAAA,EAAI,SAAA,EAAW,OAAO,QAAQ,CAAA,EAAG,KAAU,EAAA,EAC1C,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAW,OAAO,UAAU,CAAA;AAAA,QAC5B,IAAA;AAAA,QACA,WAAA;AAAA,QACA,aAAA;AAAA,QACA;AAAA;AAAA,KACF;AAAA,IAEC,WAAA,mBACC,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,MAAA,CAAO,SAAS,CAAA,EAC9B,QAAA,kBAAA,IAAA,CAAC,MAAA,EAAA,EAAK,aAAA,EAAY,MAAA,EACf,QAAA,EAAA;AAAA,MAAA,WAAA;AAAA,MAAY,GAAA;AAAA,MAAE;AAAA,KAAA,EACjB,GACF,CAAA,GACE,IAAA;AAAA,IACH,QAAA,IAAY,CAAC,CAAC,SAAA,GACb,YAAY,WAAA,IAAe,CAAA,mBACzB,GAAA,CAAC,MAAA,EAAA,EAEC,8BAAC,MAAA,EAAA,EAAK,WAAA,EAAU,QAAA,EAAS,aAAA,EAAY,QAAQ,QAAA,EAAA,CAAA,EAC3C,SAAA,GAAY,WACd,CAAA,UAAA,EAAa,YAAY,WAAA,KAAgB,CAAA,GAAI,GAAA,GAAM,EAAE,SAAQ,CAAA,EAC/D,CAAA,mBAEA,GAAA,CAAC,MAAA,EAAA,EAEC,8BAAC,MAAA,EAAA,EAAK,IAAA,EAAK,OAAA,EAAQ,QAAA,EAAA,kCAAA,EAAgC,GACrD,CAAA,GAEA;AAAA,GAAA,EACN,CAAA;AAEJ,CAAC;AAED,MAAA,CAAO,WAAA,GAAc,QAAA;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { forwardRef, useRef, useMemo, isValidElement, cloneElement } from 'react';
3
3
  import { u as useMergeRefs } from './DrawerContext-Cs3k160L.js';
4
- import { T as TextField } from './TextField-B08U4_rt.js';
4
+ import { T as TextField } from './TextField-DNuEXKyN.js';
5
5
  import { u as useOptionallyControlledState } from './useOptionallyControlledState-DbDuos5L.js';
6
6
  import { c as childrenToString } from './childrenToString-Bz9MqbHb.js';
7
7
  import { useTrackingId } from './useTrackingId.js';
@@ -261,4 +261,4 @@ const InputMask = forwardRef(
261
261
  InputMask.displayName = "InputMask";
262
262
 
263
263
  export { InputMask as I };
264
- //# sourceMappingURL=InputMask-A5LDdyxL.js.map
264
+ //# sourceMappingURL=InputMask-CJC9xZHG.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InputMask-A5LDdyxL.js","sources":["../src/components/InputMask/internal/constants.ts","../src/components/InputMask/internal/utils.ts","../src/components/InputMask/InputMask.tsx"],"sourcesContent":["export const MASK_CHARS = [\"a\", \"9\", \"*\"];\n","import { MASK_CHARS } from \"./constants\";\n\n/**\n * This function applies the mask to the input value, returning a new string that matches the mask's format.\n * @param value - a string representing the raw input value (e.g., what the user typed)\n * @param mask - a string representing the desired input mask (e.g., \"99/99/9999\" for a date)\n * @param defaultMaskCharacter - a string representing the default mask character (e.g., \"_\")\n * @returns a string representing the masked value (e.g., \"12/31/2025\" for a date)\n *\n * @example\n * applyMask(\"1234567890\", \"99/99/9999\", \"_\") // \"12/31/2025\"\n * applyMask(\"1234567890\", \"999-999-9999\", \"-\") // \"123-456-7890\"\n * applyMask(\"123\", \"99/99\", \"_\") // \"12/3_\"\n */\nexport function applyMask(\n value: string,\n mask: string,\n defaultMaskCharacter: string,\n) {\n let maskedValue = \"\";\n let valueIndex = 0;\n for (let i = 0; i < mask.length; i++) {\n const maskChar = mask[i];\n if (MASK_CHARS.includes(maskChar)) {\n // Find next acceptable char in value\n while (\n valueIndex < value.length &&\n !isAcceptableChar(value[valueIndex], maskChar)\n ) {\n valueIndex++;\n }\n if (valueIndex < value.length) {\n maskedValue += value[valueIndex];\n valueIndex++;\n } else {\n maskedValue += defaultMaskCharacter;\n }\n } else {\n maskedValue += maskChar;\n }\n }\n return maskedValue;\n}\n/**\n * This function checks if a character is acceptable for a given mask character.\n * @param char - a string representing the character to check\n * @param maskChar - a string representing the mask character\n * @returns a boolean indicating if the character is acceptable\n */\nfunction isAcceptableChar(char: string, maskChar: string) {\n if (maskChar === \"9\") {\n return /\\d/.test(char);\n }\n if (maskChar === \"a\") {\n return /[a-zA-Z]/.test(char);\n }\n if (maskChar === \"*\") {\n return /[a-zA-Z0-9]/.test(char);\n }\n return false;\n}\n/**\n * This function finds the next open character in a given value.\n * @param value - a string representing the value to search\n * @param defaultMaskCharacter - a string representing the default mask character (e.g., \"_\")\n * @returns a number representing the index of the next open character\n */\nexport function getNextOpenCharacterIndex(\n value: string,\n defaultMaskCharacter: string,\n) {\n let idx = value.indexOf(defaultMaskCharacter);\n if (idx < 0) {\n idx = value.length;\n }\n return idx;\n}\n/**\n * This function finds the first non-fixed character in the value.\n * @param startingIndex - a number representing the index to start searching from\n * @param fixedCharacterIndices - an array of numbers representing the indices of the fixed characters\n * @returns a number representing the index of the first non-fixed character\n */\nexport function getFirstNonFixedCharacterIndex(\n startingIndex: number,\n fixedCharacterIndices: number[],\n) {\n let idx = startingIndex;\n while (fixedCharacterIndices.includes(idx)) {\n idx++;\n }\n return idx;\n}\n/**\n * This function finds the last filled character in a given value.\n * @param value - a string representing the value to search\n * @param mask - a string representing the mask\n * @returns a number representing the index of the last filled character\n */\nexport function getLastFilledCharacterIndex(value: string, mask: string) {\n let idx = value\n .split(\"\")\n .findLastIndex((char, i) => isAcceptableChar(char, mask[i]));\n if (idx < 0) {\n idx = 0;\n }\n return idx;\n}\n/**\n * This function finds the first filled character in a given value.\n * @param value - a string representing the value to search\n * @param mask - a string representing the mask\n * @returns a number representing the index of the first filled character\n */\nexport function getFirstFilledCharacterIndex(value: string, mask: string) {\n let idx = value\n .split(\"\")\n .findIndex((char, i) => isAcceptableChar(char, mask[i]));\n if (idx < 0) {\n idx = 0;\n }\n return idx;\n}\n","import {\n ChangeEvent,\n ChangeEventHandler,\n FocusEvent,\n KeyboardEvent,\n InputHTMLAttributes,\n ReactElement,\n cloneElement,\n forwardRef,\n isValidElement,\n useRef,\n useMemo,\n MouseEvent,\n} from \"react\";\nimport { useMergeRefs } from \"@floating-ui/react\";\nimport { useOptionallyControlledState } from \"../../internal/hooks\";\nimport { useTrackingId } from \"../../hooks\";\nimport { TextField, TextFieldProps } from \"../TextField/internal/TextField\";\nimport { childrenToString } from \"../../internal/functions\";\nimport {\n applyMask,\n getLastFilledCharacterIndex,\n getFirstFilledCharacterIndex,\n getFirstNonFixedCharacterIndex,\n getNextOpenCharacterIndex,\n} from \"./internal/utils\";\nimport { MASK_CHARS } from \"./internal/constants\";\nimport { DataTrackingId } from \"../../types\";\n\n/**\n * Props for InputMask when using with children\n */\ninterface InputMaskPropsWithChildren {\n /**\n * Custom input element to be wrapped with mask functionality.\n */\n children: ReactElement<InputHTMLAttributes<HTMLInputElement>>;\n /**\n * Additional props to pass to the input element.\n */\n inputProps?: InputHTMLAttributes<HTMLInputElement>;\n}\n\n/**\n * Props for InputMask when using without children\n */\ninterface InputMaskPropsWithoutChildren {\n /**\n * No children allowed when using default TextField.\n */\n children?: never;\n /**\n * Props to pass to the default TextField component.\n */\n inputProps?: TextFieldProps;\n}\n\n/**\n * Configuration for custom mask handler matching\n */\ninterface ICustomMaskHandlerMatch {\n /**\n * Regular expression pattern to match against input.\n */\n matchPattern: RegExp;\n /**\n * Starting position in the input string.\n */\n startPosition: number;\n /**\n * Ending position in the input string.\n */\n endPosition: number;\n}\n\n/**\n * Configuration for custom mask handler application\n */\ninterface ICustomMaskHandlerApply {\n /**\n * Pattern to apply when match is found.\n */\n applyPattern: string;\n /**\n * Offset to apply to cursor position after transformation.\n */\n caretOffset: number;\n}\n\n/**\n * Custom mask handler for advanced input transformations\n */\ninterface ICustomMaskHandler {\n /**\n * Matching configuration for the handler.\n */\n match: ICustomMaskHandlerMatch;\n /**\n * Application configuration for the handler.\n */\n apply: ICustomMaskHandlerApply;\n}\n\n/**\n * Shared props for InputMask component\n */\ninterface SharedInputMaskProps {\n /**\n * The mask pattern to apply to the input.\n * - \"9\" for digits only\n * - \"a\" for letters only\n * - \"*\" for alphanumeric\n * - Any other character is treated as a fixed character\n */\n mask: string;\n /**\n * Character to display for unfilled mask positions.\n * @default \"_\"\n */\n defaultMaskCharacter?: string;\n /**\n * Controlled value for the input.\n */\n value?: string;\n /**\n * Default value for uncontrolled input.\n */\n defaultValue?: string;\n /**\n * Callback function called when input value changes.\n */\n onChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Array of custom mask handlers for advanced transformations.\n */\n customMaskHandler?: ICustomMaskHandler[];\n}\n\ntype SpecialChange = {\n reason: \"Backspace\" | \"Delete\" | \"Edit\";\n start: number;\n end: number;\n};\n\n/**\n * Props for the InputMask component\n * @property {string} mask - The mask pattern to apply to the input (9 for digits, a for letters, * for alphanumeric)\n * @property {string} [defaultMaskCharacter] - Character to display for unfilled mask positions\n * @property {array} [customMaskHandler] - Array of custom mask handlers for advanced transformations\n * @property {object} [inputProps] - Props to pass to the input component\n * @property {ReactElement} [children] - Custom input element to be wrapped with mask functionality\n * @property {string} [data-tracking-id] - Custom tracking ID for analytics\n */\nexport type InputMaskProps = SharedInputMaskProps &\n (InputMaskPropsWithChildren | InputMaskPropsWithoutChildren) &\n DataTrackingId;\n\n/**\n * InputMask component for applying input masks and formatting to text inputs.\n *\n * @deprecated Use the TextField component with custom masking instead. Over time, we intend to release additional components with built-in masking.\n */\nexport const InputMask = forwardRef<HTMLInputElement, InputMaskProps>(\n (\n {\n children,\n mask,\n defaultMaskCharacter = \"_\",\n value,\n defaultValue,\n onChange,\n inputProps,\n \"data-tracking-id\": dataTrackingId,\n },\n ref,\n ) => {\n const [v, setV] = useOptionallyControlledState({\n controlledValue:\n value !== undefined\n ? applyMask(value, mask, defaultMaskCharacter)\n : undefined,\n defaultValue: applyMask(defaultValue || \"\", mask, defaultMaskCharacter),\n // Omitting the onChange handler here because we want to handle it ourselves (i.e. send an event instead of just the value)\n });\n const specialChange = useRef<SpecialChange | null>(null);\n\n const inputRef = useRef<HTMLInputElement>(null);\n\n const passInRef = useMergeRefs([inputRef, ref]);\n\n const currentOpenCharacterCount = useMemo(() => {\n return v.split(\"\").filter((char) => char === defaultMaskCharacter).length;\n }, [v, defaultMaskCharacter]);\n\n const fixedCharacterIndices = useMemo(() => {\n const fixedIndices: number[] = [];\n mask.split(\"\").forEach((char, i) => {\n if (!MASK_CHARS.includes(char)) {\n fixedIndices.push(i);\n }\n });\n return fixedIndices;\n }, [mask]);\n\n const moveCursorTo = (start: number, end: number = start) => {\n requestAnimationFrame(() => {\n inputRef.current?.setSelectionRange(start, end);\n });\n };\n\n const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n let newVal = applyMask(e.target.value, mask, defaultMaskCharacter);\n if (\n // A single character was backspaced\n specialChange.current?.reason === \"Backspace\" &&\n specialChange.current.start === specialChange.current.end\n ) {\n // If the character before the backspace is a fixed character, we need to remove the filled character before the fixed character\n if (fixedCharacterIndices.includes(specialChange.current.start - 1)) {\n const removeIndex = getLastFilledCharacterIndex(\n newVal.slice(0, specialChange.current.start),\n mask,\n );\n newVal = applyMask(\n newVal.slice(0, removeIndex) + newVal.slice(removeIndex + 1),\n mask,\n defaultMaskCharacter,\n );\n moveCursorTo(removeIndex, removeIndex);\n } else {\n const idx = Math.min(\n getLastFilledCharacterIndex(newVal, mask) + 1,\n specialChange.current.start - 1,\n );\n moveCursorTo(idx, idx);\n }\n } else if (\n // A single character was deleted\n specialChange.current?.reason === \"Delete\" &&\n specialChange.current.start === specialChange.current.end\n ) {\n // If the character after the delete is a fixed character, we need to remove the filled character after the fixed character\n if (fixedCharacterIndices.includes(specialChange.current.start)) {\n const removeIndex = getFirstFilledCharacterIndex(\n newVal.slice(specialChange.current.start + 1),\n mask,\n );\n newVal = applyMask(\n newVal.slice(0, removeIndex) + newVal.slice(removeIndex + 1),\n mask,\n defaultMaskCharacter,\n );\n }\n const firstFilledIdx = getFirstFilledCharacterIndex(newVal, mask);\n const targetIdx = Math.max(firstFilledIdx, specialChange.current.start);\n moveCursorTo(targetIdx, targetIdx);\n } else if (\n specialChange.current?.reason === \"Edit\" &&\n specialChange.current.start === specialChange.current.end // A single character was edited\n ) {\n const firstNonFixedIdx = getFirstNonFixedCharacterIndex(\n specialChange.current.start + 1,\n fixedCharacterIndices,\n );\n moveCursorTo(firstNonFixedIdx, firstNonFixedIdx);\n } else {\n const newIndex = getNextOpenCharacterIndex(\n newVal,\n defaultMaskCharacter,\n );\n moveCursorTo(newIndex, newIndex);\n }\n\n setV(newVal);\n if (inputRef.current) {\n inputRef.current.value = newVal;\n }\n onChange?.({ ...e, target: { ...e.target, value: newVal } });\n };\n\n const handleFocus = (e: FocusEvent<HTMLInputElement>) => {\n requestAnimationFrame(() => {\n if (\n e.target.selectionStart === null ||\n e.target.selectionStart === undefined ||\n e.target.selectionStart >= v.length\n ) {\n const newIndex = getNextOpenCharacterIndex(v, defaultMaskCharacter);\n moveCursorTo(newIndex, newIndex);\n }\n });\n inputProps?.onFocus?.(e);\n };\n\n const handleKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n const target = e.target as HTMLInputElement;\n if (target.selectionStart === null || target.selectionEnd === null) {\n return;\n }\n if (e.key === \"Backspace\") {\n specialChange.current = {\n reason: \"Backspace\",\n start: target.selectionStart,\n end: target.selectionEnd,\n };\n } else if (e.key === \"Delete\") {\n specialChange.current = {\n reason: \"Delete\",\n start: target.selectionStart,\n end: target.selectionEnd,\n };\n } else if (currentOpenCharacterCount === 0) {\n specialChange.current = {\n reason: \"Edit\",\n start: target.selectionStart,\n end: target.selectionEnd,\n };\n } else {\n specialChange.current = null;\n }\n inputProps?.onKeyDown?.(e);\n };\n\n const handleClick = (e: MouseEvent<HTMLInputElement>) => {\n // For future use.\n e.preventDefault();\n e.stopPropagation();\n inputProps?.onClick?.(e);\n };\n\n const handleBlur = (e: FocusEvent<HTMLInputElement>) => {\n // For future use.\n e.preventDefault();\n e.stopPropagation();\n inputProps?.onBlur?.(e);\n };\n\n const mergedInputProps = {\n ...inputProps,\n ...(children && isValidElement(children) ? children.props : {}),\n value: v,\n onChange: handleChange,\n onFocus: handleFocus,\n onKeyDown: handleKeyDown,\n onClick: handleClick,\n onBlur: handleBlur,\n ref: passInRef,\n };\n\n const isInputEmpty = useMemo(() => {\n if (v.length === 0) {\n return true;\n }\n return v === applyMask(\"\", mask, defaultMaskCharacter);\n }, [v, defaultMaskCharacter, mask]);\n\n const data = {\n label:\n \"label\" in mergedInputProps\n ? childrenToString(mergedInputProps.label)\n : null,\n labelProps:\n \"labelProps\" in mergedInputProps ? mergedInputProps.labelProps : null,\n prefix: childrenToString(mergedInputProps.prefix),\n hint:\n \"hint\" in mergedInputProps\n ? childrenToString(mergedInputProps.hint)\n : null,\n description:\n \"description\" in mergedInputProps\n ? childrenToString(mergedInputProps.description)\n : null,\n size: mergedInputProps.size,\n type: mergedInputProps.type,\n };\n\n const trackingId = useTrackingId({\n name: \"InputMask\",\n data,\n hasOverride: !!dataTrackingId,\n });\n\n return children && isValidElement(children) && children.type === \"input\" ? (\n cloneElement(children, {\n ...mergedInputProps,\n \"data-tracking-id\": trackingId,\n } as InputHTMLAttributes<HTMLInputElement> & {\n \"data-tracking-id\"?: string;\n })\n ) : (\n <TextField\n data-input-empty={isInputEmpty}\n data-tracking-id={trackingId}\n {...(mergedInputProps as TextFieldProps)}\n />\n );\n },\n);\n\nInputMask.displayName = \"InputMask\";\n"],"names":[],"mappings":";;;;;;;;AAAO,MAAM,UAAA,GAAa,CAAC,GAAA,EAAK,GAAA,EAAK,GAAG,CAAA;;ACcjC,SAAS,SAAA,CACd,KAAA,EACA,IAAA,EACA,oBAAA,EACA;AACA,EAAA,IAAI,WAAA,GAAc,EAAA;AAClB,EAAA,IAAI,UAAA,GAAa,CAAA;AACjB,EAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,IAAA,CAAK,QAAQ,CAAA,EAAA,EAAK;AACpC,IAAA,MAAM,QAAA,GAAW,KAAK,CAAC,CAAA;AACvB,IAAA,IAAI,UAAA,CAAW,QAAA,CAAS,QAAQ,CAAA,EAAG;AAEjC,MAAA,OACE,UAAA,GAAa,MAAM,MAAA,IACnB,CAAC,iBAAiB,KAAA,CAAM,UAAU,CAAA,EAAG,QAAQ,CAAA,EAC7C;AACA,QAAA,UAAA,EAAA;AAAA,MACF;AACA,MAAA,IAAI,UAAA,GAAa,MAAM,MAAA,EAAQ;AAC7B,QAAA,WAAA,IAAe,MAAM,UAAU,CAAA;AAC/B,QAAA,UAAA,EAAA;AAAA,MACF,CAAA,MAAO;AACL,QAAA,WAAA,IAAe,oBAAA;AAAA,MACjB;AAAA,IACF,CAAA,MAAO;AACL,MAAA,WAAA,IAAe,QAAA;AAAA,I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MACrB,GAAG,gBAAA;AAAA,MACH,kBAAA,EAAoB;AAAA,KAGrB,CAAA,mBAED,GAAA;AAAA,MAAC,SAAA;AAAA,MAAA;AAAA,QACC,kBAAA,EAAkB,YAAA;AAAA,QAClB,kBAAA,EAAkB,UAAA;AAAA,QACjB,GAAI;AAAA;AAAA,KACP;AAAA,EAEJ;AACF;AAEA,SAAA,CAAU,WAAA,GAAc,WAAA;;;;"}
1
+ {"version":3,"file":"InputMask-CJC9xZHG.js","sources":["../src/components/InputMask/internal/constants.ts","../src/components/InputMask/internal/utils.ts","../src/components/InputMask/InputMask.tsx"],"sourcesContent":["export const MASK_CHARS = [\"a\", \"9\", \"*\"];\n","import { MASK_CHARS } from \"./constants\";\n\n/**\n * This function applies the mask to the input value, returning a new string that matches the mask's format.\n * @param value - a string representing the raw input value (e.g., what the user typed)\n * @param mask - a string representing the desired input mask (e.g., \"99/99/9999\" for a date)\n * @param defaultMaskCharacter - a string representing the default mask character (e.g., \"_\")\n * @returns a string representing the masked value (e.g., \"12/31/2025\" for a date)\n *\n * @example\n * applyMask(\"1234567890\", \"99/99/9999\", \"_\") // \"12/31/2025\"\n * applyMask(\"1234567890\", \"999-999-9999\", \"-\") // \"123-456-7890\"\n * applyMask(\"123\", \"99/99\", \"_\") // \"12/3_\"\n */\nexport function applyMask(\n value: string,\n mask: string,\n defaultMaskCharacter: string,\n) {\n let maskedValue = \"\";\n let valueIndex = 0;\n for (let i = 0; i < mask.length; i++) {\n const maskChar = mask[i];\n if (MASK_CHARS.includes(maskChar)) {\n // Find next acceptable char in value\n while (\n valueIndex < value.length &&\n !isAcceptableChar(value[valueIndex], maskChar)\n ) {\n valueIndex++;\n }\n if (valueIndex < value.length) {\n maskedValue += value[valueIndex];\n valueIndex++;\n } else {\n maskedValue += defaultMaskCharacter;\n }\n } else {\n maskedValue += maskChar;\n }\n }\n return maskedValue;\n}\n/**\n * This function checks if a character is acceptable for a given mask character.\n * @param char - a string representing the character to check\n * @param maskChar - a string representing the mask character\n * @returns a boolean indicating if the character is acceptable\n */\nfunction isAcceptableChar(char: string, maskChar: string) {\n if (maskChar === \"9\") {\n return /\\d/.test(char);\n }\n if (maskChar === \"a\") {\n return /[a-zA-Z]/.test(char);\n }\n if (maskChar === \"*\") {\n return /[a-zA-Z0-9]/.test(char);\n }\n return false;\n}\n/**\n * This function finds the next open character in a given value.\n * @param value - a string representing the value to search\n * @param defaultMaskCharacter - a string representing the default mask character (e.g., \"_\")\n * @returns a number representing the index of the next open character\n */\nexport function getNextOpenCharacterIndex(\n value: string,\n defaultMaskCharacter: string,\n) {\n let idx = value.indexOf(defaultMaskCharacter);\n if (idx < 0) {\n idx = value.length;\n }\n return idx;\n}\n/**\n * This function finds the first non-fixed character in the value.\n * @param startingIndex - a number representing the index to start searching from\n * @param fixedCharacterIndices - an array of numbers representing the indices of the fixed characters\n * @returns a number representing the index of the first non-fixed character\n */\nexport function getFirstNonFixedCharacterIndex(\n startingIndex: number,\n fixedCharacterIndices: number[],\n) {\n let idx = startingIndex;\n while (fixedCharacterIndices.includes(idx)) {\n idx++;\n }\n return idx;\n}\n/**\n * This function finds the last filled character in a given value.\n * @param value - a string representing the value to search\n * @param mask - a string representing the mask\n * @returns a number representing the index of the last filled character\n */\nexport function getLastFilledCharacterIndex(value: string, mask: string) {\n let idx = value\n .split(\"\")\n .findLastIndex((char, i) => isAcceptableChar(char, mask[i]));\n if (idx < 0) {\n idx = 0;\n }\n return idx;\n}\n/**\n * This function finds the first filled character in a given value.\n * @param value - a string representing the value to search\n * @param mask - a string representing the mask\n * @returns a number representing the index of the first filled character\n */\nexport function getFirstFilledCharacterIndex(value: string, mask: string) {\n let idx = value\n .split(\"\")\n .findIndex((char, i) => isAcceptableChar(char, mask[i]));\n if (idx < 0) {\n idx = 0;\n }\n return idx;\n}\n","import {\n ChangeEvent,\n ChangeEventHandler,\n FocusEvent,\n KeyboardEvent,\n InputHTMLAttributes,\n ReactElement,\n cloneElement,\n forwardRef,\n isValidElement,\n useRef,\n useMemo,\n MouseEvent,\n} from \"react\";\nimport { useMergeRefs } from \"@floating-ui/react\";\nimport { useOptionallyControlledState } from \"../../internal/hooks\";\nimport { useTrackingId } from \"../../hooks\";\nimport { TextField, TextFieldProps } from \"../TextField/internal/TextField\";\nimport { childrenToString } from \"../../internal/functions\";\nimport {\n applyMask,\n getLastFilledCharacterIndex,\n getFirstFilledCharacterIndex,\n getFirstNonFixedCharacterIndex,\n getNextOpenCharacterIndex,\n} from \"./internal/utils\";\nimport { MASK_CHARS } from \"./internal/constants\";\nimport { DataTrackingId } from \"../../types\";\n\n/**\n * Props for InputMask when using with children\n */\ninterface InputMaskPropsWithChildren {\n /**\n * Custom input element to be wrapped with mask functionality.\n */\n children: ReactElement<InputHTMLAttributes<HTMLInputElement>>;\n /**\n * Additional props to pass to the input element.\n */\n inputProps?: InputHTMLAttributes<HTMLInputElement>;\n}\n\n/**\n * Props for InputMask when using without children\n */\ninterface InputMaskPropsWithoutChildren {\n /**\n * No children allowed when using default TextField.\n */\n children?: never;\n /**\n * Props to pass to the default TextField component.\n */\n inputProps?: TextFieldProps;\n}\n\n/**\n * Configuration for custom mask handler matching\n */\ninterface ICustomMaskHandlerMatch {\n /**\n * Regular expression pattern to match against input.\n */\n matchPattern: RegExp;\n /**\n * Starting position in the input string.\n */\n startPosition: number;\n /**\n * Ending position in the input string.\n */\n endPosition: number;\n}\n\n/**\n * Configuration for custom mask handler application\n */\ninterface ICustomMaskHandlerApply {\n /**\n * Pattern to apply when match is found.\n */\n applyPattern: string;\n /**\n * Offset to apply to cursor position after transformation.\n */\n caretOffset: number;\n}\n\n/**\n * Custom mask handler for advanced input transformations\n */\ninterface ICustomMaskHandler {\n /**\n * Matching configuration for the handler.\n */\n match: ICustomMaskHandlerMatch;\n /**\n * Application configuration for the handler.\n */\n apply: ICustomMaskHandlerApply;\n}\n\n/**\n * Shared props for InputMask component\n */\ninterface SharedInputMaskProps {\n /**\n * The mask pattern to apply to the input.\n * - \"9\" for digits only\n * - \"a\" for letters only\n * - \"*\" for alphanumeric\n * - Any other character is treated as a fixed character\n */\n mask: string;\n /**\n * Character to display for unfilled mask positions.\n * @default \"_\"\n */\n defaultMaskCharacter?: string;\n /**\n * Controlled value for the input.\n */\n value?: string;\n /**\n * Default value for uncontrolled input.\n */\n defaultValue?: string;\n /**\n * Callback function called when input value changes.\n */\n onChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Array of custom mask handlers for advanced transformations.\n */\n customMaskHandler?: ICustomMaskHandler[];\n}\n\ntype SpecialChange = {\n reason: \"Backspace\" | \"Delete\" | \"Edit\";\n start: number;\n end: number;\n};\n\n/**\n * Props for the InputMask component\n * @property {string} mask - The mask pattern to apply to the input (9 for digits, a for letters, * for alphanumeric)\n * @property {string} [defaultMaskCharacter] - Character to display for unfilled mask positions\n * @property {array} [customMaskHandler] - Array of custom mask handlers for advanced transformations\n * @property {object} [inputProps] - Props to pass to the input component\n * @property {ReactElement} [children] - Custom input element to be wrapped with mask functionality\n * @property {string} [data-tracking-id] - Custom tracking ID for analytics\n */\nexport type InputMaskProps = SharedInputMaskProps &\n (InputMaskPropsWithChildren | InputMaskPropsWithoutChildren) &\n DataTrackingId;\n\n/**\n * InputMask component for applying input masks and formatting to text inputs.\n *\n * @deprecated Use the TextField component with custom masking instead. Over time, we intend to release additional components with built-in masking.\n */\nexport const InputMask = forwardRef<HTMLInputElement, InputMaskProps>(\n (\n {\n children,\n mask,\n defaultMaskCharacter = \"_\",\n value,\n defaultValue,\n onChange,\n inputProps,\n \"data-tracking-id\": dataTrackingId,\n },\n ref,\n ) => {\n const [v, setV] = useOptionallyControlledState({\n controlledValue:\n value !== undefined\n ? applyMask(value, mask, defaultMaskCharacter)\n : undefined,\n defaultValue: applyMask(defaultValue || \"\", mask, defaultMaskCharacter),\n // Omitting the onChange handler here because we want to handle it ourselves (i.e. send an event instead of just the value)\n });\n const specialChange = useRef<SpecialChange | null>(null);\n\n const inputRef = useRef<HTMLInputElement>(null);\n\n const passInRef = useMergeRefs([inputRef, ref]);\n\n const currentOpenCharacterCount = useMemo(() => {\n return v.split(\"\").filter((char) => char === defaultMaskCharacter).length;\n }, [v, defaultMaskCharacter]);\n\n const fixedCharacterIndices = useMemo(() => {\n const fixedIndices: number[] = [];\n mask.split(\"\").forEach((char, i) => {\n if (!MASK_CHARS.includes(char)) {\n fixedIndices.push(i);\n }\n });\n return fixedIndices;\n }, [mask]);\n\n const moveCursorTo = (start: number, end: number = start) => {\n requestAnimationFrame(() => {\n inputRef.current?.setSelectionRange(start, end);\n });\n };\n\n const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n let newVal = applyMask(e.target.value, mask, defaultMaskCharacter);\n if (\n // A single character was backspaced\n specialChange.current?.reason === \"Backspace\" &&\n specialChange.current.start === specialChange.current.end\n ) {\n // If the character before the backspace is a fixed character, we need to remove the filled character before the fixed character\n if (fixedCharacterIndices.includes(specialChange.current.start - 1)) {\n const removeIndex = getLastFilledCharacterIndex(\n newVal.slice(0, specialChange.current.start),\n mask,\n );\n newVal = applyMask(\n newVal.slice(0, removeIndex) + newVal.slice(removeIndex + 1),\n mask,\n defaultMaskCharacter,\n );\n moveCursorTo(removeIndex, removeIndex);\n } else {\n const idx = Math.min(\n getLastFilledCharacterIndex(newVal, mask) + 1,\n specialChange.current.start - 1,\n );\n moveCursorTo(idx, idx);\n }\n } else if (\n // A single character was deleted\n specialChange.current?.reason === \"Delete\" &&\n specialChange.current.start === specialChange.current.end\n ) {\n // If the character after the delete is a fixed character, we need to remove the filled character after the fixed character\n if (fixedCharacterIndices.includes(specialChange.current.start)) {\n const removeIndex = getFirstFilledCharacterIndex(\n newVal.slice(specialChange.current.start + 1),\n mask,\n );\n newVal = applyMask(\n newVal.slice(0, removeIndex) + newVal.slice(removeIndex + 1),\n mask,\n defaultMaskCharacter,\n );\n }\n const firstFilledIdx = getFirstFilledCharacterIndex(newVal, mask);\n const targetIdx = Math.max(firstFilledIdx, specialChange.current.start);\n moveCursorTo(targetIdx, targetIdx);\n } else if (\n specialChange.current?.reason === \"Edit\" &&\n specialChange.current.start === specialChange.current.end // A single character was edited\n ) {\n const firstNonFixedIdx = getFirstNonFixedCharacterIndex(\n specialChange.current.start + 1,\n fixedCharacterIndices,\n );\n moveCursorTo(firstNonFixedIdx, firstNonFixedIdx);\n } else {\n const newIndex = getNextOpenCharacterIndex(\n newVal,\n defaultMaskCharacter,\n );\n moveCursorTo(newIndex, newIndex);\n }\n\n setV(newVal);\n if (inputRef.current) {\n inputRef.current.value = newVal;\n }\n onChange?.({ ...e, target: { ...e.target, value: newVal } });\n };\n\n const handleFocus = (e: FocusEvent<HTMLInputElement>) => {\n requestAnimationFrame(() => {\n if (\n e.target.selectionStart === null ||\n e.target.selectionStart === undefined ||\n e.target.selectionStart >= v.length\n ) {\n const newIndex = getNextOpenCharacterIndex(v, defaultMaskCharacter);\n moveCursorTo(newIndex, newIndex);\n }\n });\n inputProps?.onFocus?.(e);\n };\n\n const handleKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n const target = e.target as HTMLInputElement;\n if (target.selectionStart === null || target.selectionEnd === null) {\n return;\n }\n if (e.key === \"Backspace\") {\n specialChange.current = {\n reason: \"Backspace\",\n start: target.selectionStart,\n end: target.selectionEnd,\n };\n } else if (e.key === \"Delete\") {\n specialChange.current = {\n reason: \"Delete\",\n start: target.selectionStart,\n end: target.selectionEnd,\n };\n } else if (currentOpenCharacterCount === 0) {\n specialChange.current = {\n reason: \"Edit\",\n start: target.selectionStart,\n end: target.selectionEnd,\n };\n } else {\n specialChange.current = null;\n }\n inputProps?.onKeyDown?.(e);\n };\n\n const handleClick = (e: MouseEvent<HTMLInputElement>) => {\n // For future use.\n e.preventDefault();\n e.stopPropagation();\n inputProps?.onClick?.(e);\n };\n\n const handleBlur = (e: FocusEvent<HTMLInputElement>) => {\n // For future use.\n e.preventDefault();\n e.stopPropagation();\n inputProps?.onBlur?.(e);\n };\n\n const mergedInputProps = {\n ...inputProps,\n ...(children && isValidElement(children) ? children.props : {}),\n value: v,\n onChange: handleChange,\n onFocus: handleFocus,\n onKeyDown: handleKeyDown,\n onClick: handleClick,\n onBlur: handleBlur,\n ref: passInRef,\n };\n\n const isInputEmpty = useMemo(() => {\n if (v.length === 0) {\n return true;\n }\n return v === applyMask(\"\", mask, defaultMaskCharacter);\n }, [v, defaultMaskCharacter, mask]);\n\n const data = {\n label:\n \"label\" in mergedInputProps\n ? childrenToString(mergedInputProps.label)\n : null,\n labelProps:\n \"labelProps\" in mergedInputProps ? mergedInputProps.labelProps : null,\n prefix: childrenToString(mergedInputProps.prefix),\n hint:\n \"hint\" in mergedInputProps\n ? childrenToString(mergedInputProps.hint)\n : null,\n description:\n \"description\" in mergedInputProps\n ? childrenToString(mergedInputProps.description)\n : null,\n size: mergedInputProps.size,\n type: mergedInputProps.type,\n };\n\n const trackingId = useTrackingId({\n name: \"InputMask\",\n data,\n hasOverride: !!dataTrackingId,\n });\n\n return children && isValidElement(children) && children.type === \"input\" ? (\n cloneElement(children, {\n ...mergedInputProps,\n \"data-tracking-id\": trackingId,\n } as InputHTMLAttributes<HTMLInputElement> & {\n \"data-tracking-id\"?: string;\n })\n ) : (\n <TextField\n data-input-empty={isInputEmpty}\n data-tracking-id={trackingId}\n {...(mergedInputProps as TextFieldProps)}\n />\n );\n },\n);\n\nInputMask.displayName = \"InputMask\";\n"],"names":[],"mappings":";;;;;;;;AAAO,MAAM,UAAA,GAAa,CAAC,GAAA,EAAK,GAAA,EAAK,GAAG,CAAA;;ACcjC,SAAS,SAAA,CACd,KAAA,EACA,IAAA,EACA,oBAAA,EACA;AACA,EAAA,IAAI,WAAA,GAAc,EAAA;AAClB,EAAA,IAAI,UAAA,GAAa,CAAA;AACjB,EAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,IAAA,CAAK,QAAQ,CAAA,EAAA,EAAK;AACpC,IAAA,MAAM,QAAA,GAAW,KAAK,CAAC,CAAA;AACvB,IAAA,IAAI,UAAA,CAAW,QAAA,CAA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,aAAA,IAAiB,gBAAA,GACb,gBAAA,CAAiB,gBAAA,CAAiB,WAAW,CAAA,GAC7C,IAAA;AAAA,MACN,MAAM,gBAAA,CAAiB,IAAA;AAAA,MACvB,MAAM,gBAAA,CAAiB;AAAA,KACzB;AAEA,IAAA,MAAM,aAAa,aAAA,CAAc;AAAA,MAC/B,IAAA,EAAM,WAAA;AAAA,MACN,IAAA;AAAA,MACA,WAAA,EAAa,CAAC,CAAC;AAAA,KAChB,CAAA;AAED,IAAA,OAAO,QAAA,IAAY,eAAe,QAAQ,CAAA,IAAK,SAAS,IAAA,KAAS,OAAA,GAC/D,aAAa,QAAA,EAAU;AAAA,MACrB,GAAG,gBAAA;AAAA,MACH,kBAAA,EAAoB;AAAA,KAGrB,CAAA,mBAED,GAAA;AAAA,MAAC,SAAA;AAAA,MAAA;AAAA,QACC,kBAAA,EAAkB,YAAA;AAAA,QAClB,kBAAA,EAAkB,UAAA;AAAA,QACjB,GAAI;AAAA;AAAA,KACP;AAAA,EAEJ;AACF;AAEA,SAAA,CAAU,WAAA,GAAc,WAAA;;;;"}
package/dist/InputMask.js CHANGED
@@ -1,2 +1,2 @@
1
- export { I as InputMask, I as default } from './InputMask-A5LDdyxL.js';
1
+ export { I as InputMask, I as default } from './InputMask-CJC9xZHG.js';
2
2
  //# sourceMappingURL=InputMask.js.map