@servicetitan/anvil2 1.45.1 → 1.45.2

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 (106) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/{Calendar-Dq_of5A3.js → Calendar-BK861SAW.js} +1173 -166
  3. package/dist/Calendar-BK861SAW.js.map +1 -0
  4. package/dist/Calendar.css +83 -47
  5. package/dist/Calendar.js +1 -1
  6. package/dist/{Checkbox-BiOzGpgJ.js → Checkbox-CYNjFdtO.js} +2 -2
  7. package/dist/{Checkbox-BiOzGpgJ.js.map → Checkbox-CYNjFdtO.js.map} +1 -1
  8. package/dist/{Checkbox-3y2d9mBd.js → Checkbox-ZphVb1l0.js} +2 -2
  9. package/dist/{Checkbox-3y2d9mBd.js.map → Checkbox-ZphVb1l0.js.map} +1 -1
  10. package/dist/Checkbox.js +2 -2
  11. package/dist/Combobox.js +1 -1
  12. package/dist/{DateField-B2mnasH5.js → DateField-DnasO2rB.js} +4 -4
  13. package/dist/{DateField-B2mnasH5.js.map → DateField-DnasO2rB.js.map} +1 -1
  14. package/dist/DateField.js +1 -1
  15. package/dist/{DateFieldRange-DPbyzuHb.js → DateFieldRange-Ba-8T-Nz.js} +31 -25
  16. package/dist/DateFieldRange-Ba-8T-Nz.js.map +1 -0
  17. package/dist/DateFieldRange.js +1 -1
  18. package/dist/{DateFieldSingle-CfAJDcx9.js → DateFieldSingle-BBu5Hi9c.js} +26 -26
  19. package/dist/DateFieldSingle-BBu5Hi9c.js.map +1 -0
  20. package/dist/DateFieldSingle.js +1 -1
  21. package/dist/{DateFieldYearless-ydxcsmRV.js → DateFieldYearless-Ba7HiTiI.js} +2 -2
  22. package/dist/{DateFieldYearless-ydxcsmRV.js.map → DateFieldYearless-Ba7HiTiI.js.map} +1 -1
  23. package/dist/DateFieldYearless.js +1 -1
  24. package/dist/{DaysOfTheWeek-BYvE9QK5.js → DaysOfTheWeek-BYSYZySH.js} +2 -2
  25. package/dist/{DaysOfTheWeek-BYvE9QK5.js.map → DaysOfTheWeek-BYSYZySH.js.map} +1 -1
  26. package/dist/DaysOfTheWeek.js +1 -1
  27. package/dist/{Dialog-DpH2Qvbd.js → Dialog-CgkrvrQu.js} +2 -2
  28. package/dist/{Dialog-DpH2Qvbd.js.map → Dialog-CgkrvrQu.js.map} +1 -1
  29. package/dist/Dialog.js +1 -1
  30. package/dist/{Drawer-DI_k6W2k.js → Drawer-CM4ZbAro.js} +2 -2
  31. package/dist/{Drawer-DI_k6W2k.js.map → Drawer-CM4ZbAro.js.map} +1 -1
  32. package/dist/Drawer.js +1 -1
  33. package/dist/{FieldLabel-BfnCXung.js → FieldLabel-BsbTTyom.js} +3 -14
  34. package/dist/FieldLabel-BsbTTyom.js.map +1 -0
  35. package/dist/FieldLabel.js +1 -1
  36. package/dist/{InputMask-O_qi1p_3.js → InputMask-_F139qFu.js} +2 -2
  37. package/dist/{InputMask-O_qi1p_3.js.map → InputMask-_F139qFu.js.map} +1 -1
  38. package/dist/InputMask.js +1 -1
  39. package/dist/{ListView-jR2ZkBB7.js → ListView-DEAMQopB.js} +2 -2
  40. package/dist/{ListView-jR2ZkBB7.js.map → ListView-DEAMQopB.js.map} +1 -1
  41. package/dist/ListView.js +1 -1
  42. package/dist/{NumberField-1_gRsWT4.js → NumberField-CkZZrkYC.js} +5 -5
  43. package/dist/{NumberField-1_gRsWT4.js.map → NumberField-CkZZrkYC.js.map} +1 -1
  44. package/dist/NumberField.js +1 -1
  45. package/dist/{Page-CY6QRlvb.js → Page-cKXkjMmd.js} +2 -2
  46. package/dist/{Page-CY6QRlvb.js.map → Page-cKXkjMmd.js.map} +1 -1
  47. package/dist/Page.js +1 -1
  48. package/dist/{ProgressBar-BnXuQ6Bx.js → ProgressBar-DXcXZEJ2.js} +2 -2
  49. package/dist/{ProgressBar-BnXuQ6Bx.js.map → ProgressBar-DXcXZEJ2.js.map} +1 -1
  50. package/dist/ProgressBar.js +1 -1
  51. package/dist/{Radio-CwmRUIzo.js → Radio-C89VCMXd.js} +2 -2
  52. package/dist/{Radio-CwmRUIzo.js.map → Radio-C89VCMXd.js.map} +1 -1
  53. package/dist/Radio.js +2 -2
  54. package/dist/{RadioGroup-BNCWIHOG.js → RadioGroup-C_4buUtG.js} +2 -2
  55. package/dist/{RadioGroup-BNCWIHOG.js.map → RadioGroup-C_4buUtG.js.map} +1 -1
  56. package/dist/{SelectCard-DOGCG0zr.js → SelectCard-BWh8Yp7T.js} +3 -3
  57. package/dist/{SelectCard-DOGCG0zr.js.map → SelectCard-BWh8Yp7T.js.map} +1 -1
  58. package/dist/SelectCard.js +1 -1
  59. package/dist/{SelectTrigger-BMo0e-F7.js → SelectTrigger-f1hvRrSC.js} +2 -2
  60. package/dist/{SelectTrigger-BMo0e-F7.js.map → SelectTrigger-f1hvRrSC.js.map} +1 -1
  61. package/dist/SelectTrigger.js +1 -1
  62. package/dist/{SelectTriggerBase-BMMxnXrw.js → SelectTriggerBase-DP9fmRSo.js} +2 -2
  63. package/dist/{SelectTriggerBase-BMMxnXrw.js.map → SelectTriggerBase-DP9fmRSo.js.map} +1 -1
  64. package/dist/{TextField-CwgE_JJU.js → TextField-BiHxlzE3.js} +2 -2
  65. package/dist/{TextField-CwgE_JJU.js.map → TextField-BiHxlzE3.js.map} +1 -1
  66. package/dist/{TextField-DlsZEkS0.js → TextField-D8fow9j7.js} +2 -2
  67. package/dist/{TextField-DlsZEkS0.js.map → TextField-D8fow9j7.js.map} +1 -1
  68. package/dist/TextField.js +1 -1
  69. package/dist/{Textarea-DU-SpoDL.js → Textarea-BdVJJlbP.js} +2 -2
  70. package/dist/{Textarea-DU-SpoDL.js.map → Textarea-BdVJJlbP.js.map} +1 -1
  71. package/dist/Textarea.js +1 -1
  72. package/dist/{TimeField-CfhyRfX9.js → TimeField-CmbErrsZ.js} +2 -2
  73. package/dist/{TimeField-CfhyRfX9.js.map → TimeField-CmbErrsZ.js.map} +1 -1
  74. package/dist/TimeField.js +1 -1
  75. package/dist/Toast.js +2 -2
  76. package/dist/{Toaster-BgjT0p8b.js → Toaster-9cpG_tWR.js} +2 -2
  77. package/dist/{Toaster-BgjT0p8b.js.map → Toaster-9cpG_tWR.js.map} +1 -1
  78. package/dist/{Toaster-CfC9wod0.js → Toaster-B7zUwJOt.js} +2 -2
  79. package/dist/{Toaster-CfC9wod0.js.map → Toaster-B7zUwJOt.js.map} +1 -1
  80. package/dist/components/DateFieldRange/DateFieldRange.d.ts +2 -2
  81. package/dist/components/DateFieldRange/internal/useDateFieldRangeState.d.ts +2 -7
  82. package/dist/components/DateFieldSingle/DateFieldSingle.d.ts +2 -2
  83. package/dist/components/DateFieldSingle/internal/useDateFieldSingleState.d.ts +2 -7
  84. package/dist/components/NumberField/NumberField.d.ts +4 -4
  85. package/dist/index.js +26 -26
  86. package/dist/internal/components/YearSelector/YearSelector.d.ts +67 -0
  87. package/dist/internal/components/YearSelector/index.d.ts +1 -0
  88. package/dist/internal/components/YearSelector/internal/YearItem.d.ts +10 -0
  89. package/dist/internal/components/YearSelector/internal/useYearSelectorKeys.d.ts +19 -0
  90. package/dist/internal/hooks/useFocusWithin/useFocusWithin.d.ts +11 -16
  91. package/dist/types/PassThroughProps.d.ts +4 -0
  92. package/dist/types/index.d.ts +1 -0
  93. package/dist/{useDateFieldOrchestration-Cqa7dxtr.js → useDateFieldOrchestration-DPLftOxu.js} +2 -2
  94. package/dist/{useDateFieldOrchestration-Cqa7dxtr.js.map → useDateFieldOrchestration-DPLftOxu.js.map} +1 -1
  95. package/dist/useFocusWithin-BhhgRXdZ.js +32 -0
  96. package/dist/useFocusWithin-BhhgRXdZ.js.map +1 -0
  97. package/dist/{useInfiniteCombobox-BN2uGhBh.js → useInfiniteCombobox-BaYWUxjg.js} +2 -2
  98. package/dist/{useInfiniteCombobox-BN2uGhBh.js.map → useInfiniteCombobox-BaYWUxjg.js.map} +1 -1
  99. package/package.json +2 -1
  100. package/dist/Calendar-Dq_of5A3.js.map +0 -1
  101. package/dist/DateFieldRange-DPbyzuHb.js.map +0 -1
  102. package/dist/DateFieldSingle-CfAJDcx9.js.map +0 -1
  103. package/dist/FieldLabel-BfnCXung.js.map +0 -1
  104. package/dist/components/Calendar/internal/CalendarYearSelection.d.ts +0 -25
  105. package/dist/useFocusWithin-BhU7hoAD.js +0 -56
  106. package/dist/useFocusWithin-BhU7hoAD.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog-DpH2Qvbd.js","sources":["../src/components/Dialog/internal/useDialogContext.ts","../src/components/Dialog/DialogCancelButton.tsx","../src/components/Dialog/DialogHeader.tsx","../src/components/Dialog/DialogFooter.tsx","../src/components/Dialog/DialogContent.tsx","../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import { useContext } from \"react\";\nimport { DialogContext } from \"./DialogContext\";\n\nexport function useDialogContext() {\n const context = useContext(DialogContext);\n if (!context) {\n throw new Error(\n \"useDialogContext must be used within a DialogContextProvider\",\n );\n }\n return context;\n}\n","import { MouseEvent, forwardRef } from \"react\";\nimport { Button, ButtonProps } from \"../Button\";\nimport { useDialogContext } from \"./internal/useDialogContext\";\nimport { DataTrackingId } from \"../../types\";\nimport { useTrackingId } from \"../../hooks\";\n\n/**\n * Props for the DialogCancelButton component\n * @extends ButtonProps\n */\nexport type DialogCancelButtonProps = ButtonProps & DataTrackingId;\n\n/**\n * DialogCancelButton component for cancel/close actions in a Dialog.\n *\n * Features:\n * - Button that automatically closes the dialog when clicked\n * - Extends all Button component props and functionality\n * - Proper accessibility with close dialog semantics\n * - Automatic focus management\n * - Consistent styling with other dialog elements\n *\n * @example\n * <Dialog.CancelButton appearance=\"ghost\">Cancel</Dialog.CancelButton>\n */\nexport const DialogCancelButton = forwardRef<\n HTMLButtonElement,\n DialogCancelButtonProps\n>((props, ref) => {\n const { onClick, ...rest } = props;\n const { close } = useDialogContext();\n const data = {\n title: props.title,\n appearance: props.appearance,\n size: props.size,\n type: props.type,\n };\n\n const trackingId = useTrackingId({\n name: \"DialogCancelButton\",\n data,\n hasOverride: !!props[\"data-tracking-id\"],\n });\n const onClickHandler = (e: MouseEvent<HTMLButtonElement>) => {\n onClick?.(e);\n close();\n };\n return (\n <Button\n aria-label=\"Close dialog\"\n data-anv=\"dialog-cancel-button\"\n data-tracking-id={trackingId}\n onClick={onClickHandler}\n ref={ref}\n {...rest}\n />\n );\n});\n\nDialogCancelButton.displayName = \"DialogCancelButton\";\n","import { ComponentPropsWithoutRef, forwardRef } from \"react\";\nimport Close from \"@servicetitan/hammer-icon/mdi/round/close.svg\";\nimport cx from \"classnames\";\n\nimport { Text } from \"../Text\";\nimport { DialogCancelButton } from \"./DialogCancelButton\";\n\nimport styles from \"./Dialog.module.scss\";\nimport { childrenToString } from \"../../internal/functions\";\nimport { useTrackingId } from \"../../hooks\";\nimport { DataTrackingId } from \"../../types\";\n\n/**\n * Props for the DialogHeader component\n * @extends ComponentPropsWithoutRef<\"header\">\n */\nexport type DialogHeaderProps = ComponentPropsWithoutRef<\"header\"> &\n DataTrackingId;\n\n/**\n * DialogHeader component for the header section of a Dialog.\n *\n * Features:\n * - Displays dialog title with headline typography\n * - Includes close button with proper accessibility\n * - Sticky positioning for long content\n * - Consistent spacing and styling\n * - Automatic focus management\n *\n * @example\n * <Dialog.Header>Confirm Delete</Dialog.Header>\n */\nexport const DialogHeader = forwardRef<HTMLDivElement, DialogHeaderProps>(\n (props: DialogHeaderProps, ref) => {\n const { children, className, ...rest } = props;\n const data = {\n children: childrenToString(props.children),\n };\n\n const trackingId = useTrackingId({\n name: \"Dialog\",\n data,\n hasOverride: !!props[\"data-tracking-id\"],\n });\n\n const headerClassNames = cx(className, styles[\"header\"]);\n\n return (\n <header\n className={headerClassNames}\n data-anv=\"dialog-header\"\n data-tracking-id={trackingId}\n ref={ref}\n {...rest}\n >\n <Text variant=\"headline\" el=\"h1\">\n {children}\n </Text>\n <span className={styles[\"close-container\"]}>\n <DialogCancelButton\n className={styles[\"close-button\"]}\n size=\"small\"\n appearance=\"ghost\"\n aria-label=\"Close dialog\"\n icon={Close}\n />\n </span>\n </header>\n );\n },\n);\n\nDialogHeader.displayName = \"DialogHeader\";\n","import { ComponentPropsWithoutRef, forwardRef } from \"react\";\nimport cx from \"classnames\";\n\nimport styles from \"./Dialog.module.scss\";\n\n/**\n * Props for the DialogFooter component\n * @extends ComponentPropsWithoutRef<\"footer\">\n */\nexport type DialogFooterProps = ComponentPropsWithoutRef<\"footer\"> & {\n /**\n * @default false\n */\n sticky?: boolean;\n};\n\n/**\n * DialogFooter component for the footer section of a Dialog.\n *\n * Features:\n * - Container for dialog action buttons\n * - Optional sticky positioning for long content\n * - Consistent spacing and alignment\n * - Right-aligned button layout by default\n * - Flexible content area for custom layouts\n *\n * @example\n * <Dialog.Footer sticky>\n * <Dialog.CancelButton>Cancel</Dialog.CancelButton>\n * <Button appearance=\"primary\">Save</Button>\n * </Dialog.Footer>\n */\nexport const DialogFooter = forwardRef<HTMLElement, DialogFooterProps>(\n (props, ref) => {\n const { children, className, sticky = false, ...rest } = props;\n\n const footerClassNames = cx(styles[\"footer\"], className, {\n [styles[\"sticky\"]]: sticky,\n });\n\n return (\n <footer\n className={footerClassNames}\n data-anv=\"dialog-footer\"\n ref={ref}\n {...rest}\n >\n {children}\n </footer>\n );\n },\n);\n\nDialogFooter.displayName = \"DialogFooter\";\n","import { ComponentPropsWithoutRef, forwardRef } from \"react\";\nimport cx from \"classnames\";\n\nimport styles from \"./Dialog.module.scss\";\n\n/**\n * Props for the DialogContent component\n * @extends ComponentPropsWithoutRef<\"div\">\n */\nexport type DialogContentProps = ComponentPropsWithoutRef<\"div\">;\n\n/**\n * DialogContent component for the main content area of a Dialog.\n *\n * Features:\n * - Main content container for dialog body\n * - Flexible height with overflow handling\n * - Consistent padding and spacing\n * - Responsive design\n * - Proper content scrolling for long content\n *\n * @example\n * <Dialog.Content>\n * <p>This is the main content of the dialog.</p>\n * </Dialog.Content>\n */\nexport const DialogContent = forwardRef<HTMLDivElement, DialogContentProps>(\n (props, ref) => {\n const { children, className, ...rest } = props;\n\n const contentClassNames = cx(styles[\"content\"], className);\n\n return (\n <div\n className={contentClassNames}\n data-anv=\"dialog-content\"\n ref={ref}\n {...rest}\n >\n {children}\n </div>\n );\n },\n);\n\nDialogContent.displayName = \"DialogContent\";\n","import {\n ComponentPropsWithoutRef,\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n KeyboardEvent,\n} from \"react\";\nimport { DialogHeader } from \"./DialogHeader\";\nimport { DialogFooter } from \"./DialogFooter\";\nimport { DialogContent } from \"./DialogContent\";\nimport { DialogCancelButton } from \"./DialogCancelButton\";\nimport {\n OpenCloseTransitionStateEffects,\n useDialogScrollLock,\n useDialogTransitionStates,\n useKeyboardFocusables,\n useOnClickOutside,\n} from \"../../internal/hooks\";\nimport { DisableCloseOnEscapeOrClickProps, Size } from \"../../types\";\nimport { DialogContext, DialogContextProps } from \"./internal/DialogContext\";\nimport styles from \"./Dialog.module.scss\";\nimport { getActiveElement } from \"../../internal/functions\";\nimport { useMergeRefs } from \"../../hooks\";\nimport cx from \"classnames\";\n\nimport { ToastProvider } from \"../Toast/internal/ToastProvider\";\nimport { ToasterPopover } from \"../Toast/internal/ToasterPopover\";\nimport { ToasterContent } from \"../Toast/internal/Toaster\";\n\n/**\n * Props for the Dialog component\n * @extends ComponentPropsWithoutRef<\"dialog\">\n * @extends DialogTransitionStateEffects\n * @extends DisableCloseOnEscapeOrClickProps\n */\nexport type DialogProps = ComponentPropsWithoutRef<\"dialog\"> &\n OpenCloseTransitionStateEffects &\n DisableCloseOnEscapeOrClickProps & {\n /**\n * @default false\n */\n fullScreen?: boolean;\n /**\n * @default \"medium\"\n */\n size?: Extract<Size, \"medium\" | \"large\">;\n\n /**\n * @default false\n */\n open?: boolean;\n onClose?: () => void;\n /**\n * @deprecated - use onOpenAnimationStart or onOpenAnimationComplete instead\n */\n onOpen?: () => void;\n /**\n * @deprecated - use onOpenAnimationStart or onOpenAnimationComplete instead\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * Callback when clicking outside the dialog\n */\n onClickOutside?: (e: globalThis.MouseEvent) => void;\n /**\n * Enables scroll chaining\n * @link https://developer.mozilla.org/en-US/docs/Glossary/Scroll_chaining\n */\n enableScrollChaining?: boolean;\n };\n\nexport const DialogElement = forwardRef<HTMLDialogElement, DialogProps>(\n (props, ref) => {\n const {\n className,\n open = false,\n children,\n onOpen,\n onOpenChange,\n onClose,\n onKeyDown,\n fullScreen = false,\n disableCloseOnEscape = false,\n onClickOutside,\n disableCloseOnClickOutside = false,\n size,\n enableScrollChaining,\n onOpenAnimationStart,\n onOpenAnimationComplete,\n onCloseAnimationStart,\n onCloseAnimationComplete,\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 [hasOpenPopover, setHasOpenPopover] =\n useState<DialogContextProps[\"hasOpenPopover\"]>(false);\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 // DEPRECATED\n const initial = useRef(true);\n useEffect(() => {\n if (initial.current) {\n initial.current = false;\n } else {\n onOpenChange?.(isOpenOrOpening);\n }\n }, [id, onOpenChange, isOpenOrOpening]);\n\n const classNames = cx([styles[\"dialog\"]], className, {\n [styles[\"closing\"]]: state === \"closing\",\n [styles[\"fullscreen\"]]: fullScreen,\n [styles[\"large\"]]: size === \"large\",\n });\n\n const { focusables } = useKeyboardFocusables(contentRef, {\n observeChange: true,\n });\n\n useDialogScrollLock({\n open: isOpenOrOpening,\n id,\n enableScrollChaining,\n elementRef: elRef,\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 });\n\n useEffect(() => {\n if (!isOpenOrOpening) return;\n if (!focusables) return;\n\n const activeElement = getActiveElement(document);\n if (!activeElement) return;\n\n if (\n activeElement.dataset.anv !== \"drawer-header-close-button\" &&\n (focusables.includes(activeElement) ||\n activeElement.tagName === \"DIALOG\")\n ) {\n return;\n }\n\n if (\n focusables[0]?.dataset.anv === \"dialog-header-close-button\" &&\n focusables[1]\n ) {\n focusables[1].focus();\n } else {\n focusables[0]?.focus();\n }\n }, [isOpenOrOpening, focusables]);\n\n const onKeyDownHandler = (e: KeyboardEvent<HTMLDialogElement>) => {\n onKeyDown?.(e);\n if (e.code === \"Escape\") {\n e.preventDefault();\n if (disableCloseOnEscape) return;\n if (hasOpenPopover) return;\n onClose?.();\n return;\n }\n\n if (e.code === \"Tab\") {\n if (e.shiftKey && e.target === focusables?.[0]) {\n e.preventDefault();\n (focusables[focusables.length - 1] as HTMLElement)?.focus();\n return;\n }\n if (e.target === focusables?.[focusables.length - 1] && !e.shiftKey) {\n e.preventDefault();\n focusables[0].focus();\n return;\n }\n }\n };\n\n return (\n // dialog element does seem to be interactive on MDN guideline\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\n <dialog\n className={classNames}\n data-anv=\"dialog\"\n data-anv-scroll-chaining={enableScrollChaining}\n data-anv-transition-state={state}\n ref={useMergeRefs([ref, elRef])}\n onKeyDown={onKeyDownHandler}\n {...rest}\n >\n <ToastProvider isDialogToaster={open}>\n <ToasterPopover>\n <ToasterContent id=\"dialog-toaster\" ref={toasterRef} />\n </ToasterPopover>\n </ToastProvider>\n <DialogContext.Provider\n value={{\n close: () => onClose?.(),\n ref: elRef,\n hasOpenPopover,\n setHasOpenPopover,\n }}\n >\n <section\n ref={contentRef}\n className={styles[\"container\"]}\n data-open={open}\n >\n {children}\n </section>\n </DialogContext.Provider>\n </dialog>\n );\n },\n);\n\nDialogElement.displayName = \"Dialog\";\n\n/**\n * Dialog component for creating modal dialogs and overlays.\n *\n * Features:\n * - Modal dialog with backdrop overlay\n * - Controlled and uncontrolled open state\n * - Smooth open/close animations\n * - Keyboard navigation and focus management\n * - Escape key and click outside to close\n * - Multiple size variants (medium, large, fullscreen)\n * - Scroll chaining support\n * - Toast integration for notifications\n * - Compound component pattern with Header, Footer, Content, and CancelButton sub-components\n * - Automatic tracking ID generation for analytics\n *\n * @example\n * <Dialog open={isOpen} onClose={() => setIsOpen(false)}>\n * <Dialog.Header>Confirm Action</Dialog.Header>\n * <Dialog.Content>Are you sure you want to proceed?</Dialog.Content>\n * <Dialog.Footer>\n * <Dialog.CancelButton>Cancel</Dialog.CancelButton>\n * <Button appearance=\"primary\">Confirm</Button>\n * </Dialog.Footer>\n * </Dialog>\n */\nexport const Dialog = Object.assign(DialogElement, {\n /**\n * DialogHeader component for the header section of a Dialog.\n *\n * Features:\n * - Displays dialog title with headline typography\n * - Includes close button with proper accessibility\n * - Sticky positioning for long content\n * - Consistent spacing and styling\n * - Automatic focus management\n * - Automatic tracking ID generation for analytics\n *\n * @example\n * <Dialog.Header>Confirm Delete</Dialog.Header>\n */\n Header: DialogHeader,\n /**\n * DialogFooter component for the footer section of a Dialog.\n *\n * Features:\n * - Container for dialog action buttons\n * - Optional sticky positioning for long content\n * - Consistent spacing and alignment\n * - Right-aligned button layout by default\n * - Flexible content area for custom layouts\n *\n * @example\n * <Dialog.Footer sticky>\n * <Dialog.CancelButton>Cancel</Dialog.CancelButton>\n * <Button appearance=\"primary\">Save</Button>\n * </Dialog.Footer>\n */\n Footer: DialogFooter,\n /**\n * DialogContent component for the main content area of a Dialog.\n *\n * Features:\n * - Main content container for dialog body\n * - Flexible height with overflow handling\n * - Consistent padding and spacing\n * - Responsive design\n * - Proper content scrolling for long content\n *\n * @example\n * <Dialog.Content>\n * <p>This is the main content of the dialog.</p>\n * </Dialog.Content>\n */\n Content: DialogContent,\n /**\n * DialogCancelButton component for cancel/close actions in a Dialog.\n *\n * Features:\n * - Button that automatically closes the dialog when clicked\n * - Extends all Button component props and functionality\n * - Proper accessibility with close dialog semantics\n * - Automatic focus management\n * - Consistent styling with other dialog elements\n * - Automatic tracking ID generation for analytics\n *\n * @example\n * <Dialog.CancelButton appearance=\"ghost\">Cancel</Dialog.CancelButton>\n */\n CancelButton: DialogCancelButton,\n});\n"],"names":["Close"],"mappings":";;;;;;;;;;;;;;;AAGO,SAAS,gBAAmB,GAAA;AACjC,EAAM,MAAA,OAAA,GAAU,WAAW,aAAa,CAAA;AACxC,EAAA,IAAI,CAAC,OAAS,EAAA;AACZ,IAAA,MAAM,IAAI,KAAA;AAAA,MACR;AAAA,KACF;AAAA;AAEF,EAAO,OAAA,OAAA;AACT;;ACcO,MAAM,kBAAqB,GAAA,UAAA,CAGhC,CAAC,KAAA,EAAO,GAAQ,KAAA;AAChB,EAAA,MAAM,EAAE,OAAA,EAAS,GAAG,IAAA,EAAS,GAAA,KAAA;AAC7B,EAAM,MAAA,EAAE,KAAM,EAAA,GAAI,gBAAiB,EAAA;AACnC,EAAA,MAAM,IAAO,GAAA;AAAA,IACX,OAAO,KAAM,CAAA,KAAA;AAAA,IACb,YAAY,KAAM,CAAA,UAAA;AAAA,IAClB,MAAM,KAAM,CAAA,IAAA;AAAA,IACZ,MAAM,KAAM,CAAA;AAAA,GACd;AAEA,EAAA,MAAM,aAAa,aAAc,CAAA;AAAA,IAC/B,IAAM,EAAA,oBAAA;AAAA,IACN,IAAA;AAAA,IACA,WAAa,EAAA,CAAC,CAAC,KAAA,CAAM,kBAAkB;AAAA,GACxC,CAAA;AACD,EAAM,MAAA,cAAA,GAAiB,CAAC,CAAqC,KAAA;AAC3D,IAAA,OAAA,GAAU,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AA,IAAA;AAAA,oBAEV;AAAA;AAAA;AACH;AAAA;AACF;AAAA;AAAA;AACF;AAAA;AAGN,CAAA;AAEA,aAAA,CAAc,WAAc,GAAA,QAAA;AA2Bf,MAAA,MAAA,GAAS,MAAO,CAAA,MAAA,CAAO,aAAe,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAejD,MAAQ,EAAA,YAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBR,MAAQ,EAAA,YAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBR,OAAS,EAAA,aAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAeT,YAAc,EAAA;AAChB,CAAC;;;;"}
1
+ {"version":3,"file":"Dialog-CgkrvrQu.js","sources":["../src/components/Dialog/internal/useDialogContext.ts","../src/components/Dialog/DialogCancelButton.tsx","../src/components/Dialog/DialogHeader.tsx","../src/components/Dialog/DialogFooter.tsx","../src/components/Dialog/DialogContent.tsx","../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import { useContext } from \"react\";\nimport { DialogContext } from \"./DialogContext\";\n\nexport function useDialogContext() {\n const context = useContext(DialogContext);\n if (!context) {\n throw new Error(\n \"useDialogContext must be used within a DialogContextProvider\",\n );\n }\n return context;\n}\n","import { MouseEvent, forwardRef } from \"react\";\nimport { Button, ButtonProps } from \"../Button\";\nimport { useDialogContext } from \"./internal/useDialogContext\";\nimport { DataTrackingId } from \"../../types\";\nimport { useTrackingId } from \"../../hooks\";\n\n/**\n * Props for the DialogCancelButton component\n * @extends ButtonProps\n */\nexport type DialogCancelButtonProps = ButtonProps & DataTrackingId;\n\n/**\n * DialogCancelButton component for cancel/close actions in a Dialog.\n *\n * Features:\n * - Button that automatically closes the dialog when clicked\n * - Extends all Button component props and functionality\n * - Proper accessibility with close dialog semantics\n * - Automatic focus management\n * - Consistent styling with other dialog elements\n *\n * @example\n * <Dialog.CancelButton appearance=\"ghost\">Cancel</Dialog.CancelButton>\n */\nexport const DialogCancelButton = forwardRef<\n HTMLButtonElement,\n DialogCancelButtonProps\n>((props, ref) => {\n const { onClick, ...rest } = props;\n const { close } = useDialogContext();\n const data = {\n title: props.title,\n appearance: props.appearance,\n size: props.size,\n type: props.type,\n };\n\n const trackingId = useTrackingId({\n name: \"DialogCancelButton\",\n data,\n hasOverride: !!props[\"data-tracking-id\"],\n });\n const onClickHandler = (e: MouseEvent<HTMLButtonElement>) => {\n onClick?.(e);\n close();\n };\n return (\n <Button\n aria-label=\"Close dialog\"\n data-anv=\"dialog-cancel-button\"\n data-tracking-id={trackingId}\n onClick={onClickHandler}\n ref={ref}\n {...rest}\n />\n );\n});\n\nDialogCancelButton.displayName = \"DialogCancelButton\";\n","import { ComponentPropsWithoutRef, forwardRef } from \"react\";\nimport Close from \"@servicetitan/hammer-icon/mdi/round/close.svg\";\nimport cx from \"classnames\";\n\nimport { Text } from \"../Text\";\nimport { DialogCancelButton } from \"./DialogCancelButton\";\n\nimport styles from \"./Dialog.module.scss\";\nimport { childrenToString } from \"../../internal/functions\";\nimport { useTrackingId } from \"../../hooks\";\nimport { DataTrackingId } from \"../../types\";\n\n/**\n * Props for the DialogHeader component\n * @extends ComponentPropsWithoutRef<\"header\">\n */\nexport type DialogHeaderProps = ComponentPropsWithoutRef<\"header\"> &\n DataTrackingId;\n\n/**\n * DialogHeader component for the header section of a Dialog.\n *\n * Features:\n * - Displays dialog title with headline typography\n * - Includes close button with proper accessibility\n * - Sticky positioning for long content\n * - Consistent spacing and styling\n * - Automatic focus management\n *\n * @example\n * <Dialog.Header>Confirm Delete</Dialog.Header>\n */\nexport const DialogHeader = forwardRef<HTMLDivElement, DialogHeaderProps>(\n (props: DialogHeaderProps, ref) => {\n const { children, className, ...rest } = props;\n const data = {\n children: childrenToString(props.children),\n };\n\n const trackingId = useTrackingId({\n name: \"Dialog\",\n data,\n hasOverride: !!props[\"data-tracking-id\"],\n });\n\n const headerClassNames = cx(className, styles[\"header\"]);\n\n return (\n <header\n className={headerClassNames}\n data-anv=\"dialog-header\"\n data-tracking-id={trackingId}\n ref={ref}\n {...rest}\n >\n <Text variant=\"headline\" el=\"h1\">\n {children}\n </Text>\n <span className={styles[\"close-container\"]}>\n <DialogCancelButton\n className={styles[\"close-button\"]}\n size=\"small\"\n appearance=\"ghost\"\n aria-label=\"Close dialog\"\n icon={Close}\n />\n </span>\n </header>\n );\n },\n);\n\nDialogHeader.displayName = \"DialogHeader\";\n","import { ComponentPropsWithoutRef, forwardRef } from \"react\";\nimport cx from \"classnames\";\n\nimport styles from \"./Dialog.module.scss\";\n\n/**\n * Props for the DialogFooter component\n * @extends ComponentPropsWithoutRef<\"footer\">\n */\nexport type DialogFooterProps = ComponentPropsWithoutRef<\"footer\"> & {\n /**\n * @default false\n */\n sticky?: boolean;\n};\n\n/**\n * DialogFooter component for the footer section of a Dialog.\n *\n * Features:\n * - Container for dialog action buttons\n * - Optional sticky positioning for long content\n * - Consistent spacing and alignment\n * - Right-aligned button layout by default\n * - Flexible content area for custom layouts\n *\n * @example\n * <Dialog.Footer sticky>\n * <Dialog.CancelButton>Cancel</Dialog.CancelButton>\n * <Button appearance=\"primary\">Save</Button>\n * </Dialog.Footer>\n */\nexport const DialogFooter = forwardRef<HTMLElement, DialogFooterProps>(\n (props, ref) => {\n const { children, className, sticky = false, ...rest } = props;\n\n const footerClassNames = cx(styles[\"footer\"], className, {\n [styles[\"sticky\"]]: sticky,\n });\n\n return (\n <footer\n className={footerClassNames}\n data-anv=\"dialog-footer\"\n ref={ref}\n {...rest}\n >\n {children}\n </footer>\n );\n },\n);\n\nDialogFooter.displayName = \"DialogFooter\";\n","import { ComponentPropsWithoutRef, forwardRef } from \"react\";\nimport cx from \"classnames\";\n\nimport styles from \"./Dialog.module.scss\";\n\n/**\n * Props for the DialogContent component\n * @extends ComponentPropsWithoutRef<\"div\">\n */\nexport type DialogContentProps = ComponentPropsWithoutRef<\"div\">;\n\n/**\n * DialogContent component for the main content area of a Dialog.\n *\n * Features:\n * - Main content container for dialog body\n * - Flexible height with overflow handling\n * - Consistent padding and spacing\n * - Responsive design\n * - Proper content scrolling for long content\n *\n * @example\n * <Dialog.Content>\n * <p>This is the main content of the dialog.</p>\n * </Dialog.Content>\n */\nexport const DialogContent = forwardRef<HTMLDivElement, DialogContentProps>(\n (props, ref) => {\n const { children, className, ...rest } = props;\n\n const contentClassNames = cx(styles[\"content\"], className);\n\n return (\n <div\n className={contentClassNames}\n data-anv=\"dialog-content\"\n ref={ref}\n {...rest}\n >\n {children}\n </div>\n );\n },\n);\n\nDialogContent.displayName = \"DialogContent\";\n","import {\n ComponentPropsWithoutRef,\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n KeyboardEvent,\n} from \"react\";\nimport { DialogHeader } from \"./DialogHeader\";\nimport { DialogFooter } from \"./DialogFooter\";\nimport { DialogContent } from \"./DialogContent\";\nimport { DialogCancelButton } from \"./DialogCancelButton\";\nimport {\n OpenCloseTransitionStateEffects,\n useDialogScrollLock,\n useDialogTransitionStates,\n useKeyboardFocusables,\n useOnClickOutside,\n} from \"../../internal/hooks\";\nimport { DisableCloseOnEscapeOrClickProps, Size } from \"../../types\";\nimport { DialogContext, DialogContextProps } from \"./internal/DialogContext\";\nimport styles from \"./Dialog.module.scss\";\nimport { getActiveElement } from \"../../internal/functions\";\nimport { useMergeRefs } from \"../../hooks\";\nimport cx from \"classnames\";\n\nimport { ToastProvider } from \"../Toast/internal/ToastProvider\";\nimport { ToasterPopover } from \"../Toast/internal/ToasterPopover\";\nimport { ToasterContent } from \"../Toast/internal/Toaster\";\n\n/**\n * Props for the Dialog component\n * @extends ComponentPropsWithoutRef<\"dialog\">\n * @extends DialogTransitionStateEffects\n * @extends DisableCloseOnEscapeOrClickProps\n */\nexport type DialogProps = ComponentPropsWithoutRef<\"dialog\"> &\n OpenCloseTransitionStateEffects &\n DisableCloseOnEscapeOrClickProps & {\n /**\n * @default false\n */\n fullScreen?: boolean;\n /**\n * @default \"medium\"\n */\n size?: Extract<Size, \"medium\" | \"large\">;\n\n /**\n * @default false\n */\n open?: boolean;\n onClose?: () => void;\n /**\n * @deprecated - use onOpenAnimationStart or onOpenAnimationComplete instead\n */\n onOpen?: () => void;\n /**\n * @deprecated - use onOpenAnimationStart or onOpenAnimationComplete instead\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * Callback when clicking outside the dialog\n */\n onClickOutside?: (e: globalThis.MouseEvent) => void;\n /**\n * Enables scroll chaining\n * @link https://developer.mozilla.org/en-US/docs/Glossary/Scroll_chaining\n */\n enableScrollChaining?: boolean;\n };\n\nexport const DialogElement = forwardRef<HTMLDialogElement, DialogProps>(\n (props, ref) => {\n const {\n className,\n open = false,\n children,\n onOpen,\n onOpenChange,\n onClose,\n onKeyDown,\n fullScreen = false,\n disableCloseOnEscape = false,\n onClickOutside,\n disableCloseOnClickOutside = false,\n size,\n enableScrollChaining,\n onOpenAnimationStart,\n onOpenAnimationComplete,\n onCloseAnimationStart,\n onCloseAnimationComplete,\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 [hasOpenPopover, setHasOpenPopover] =\n useState<DialogContextProps[\"hasOpenPopover\"]>(false);\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 // DEPRECATED\n const initial = useRef(true);\n useEffect(() => {\n if (initial.current) {\n initial.current = false;\n } else {\n onOpenChange?.(isOpenOrOpening);\n }\n }, [id, onOpenChange, isOpenOrOpening]);\n\n const classNames = cx([styles[\"dialog\"]], className, {\n [styles[\"closing\"]]: state === \"closing\",\n [styles[\"fullscreen\"]]: fullScreen,\n [styles[\"large\"]]: size === \"large\",\n });\n\n const { focusables } = useKeyboardFocusables(contentRef, {\n observeChange: true,\n });\n\n useDialogScrollLock({\n open: isOpenOrOpening,\n id,\n enableScrollChaining,\n elementRef: elRef,\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 });\n\n useEffect(() => {\n if (!isOpenOrOpening) return;\n if (!focusables) return;\n\n const activeElement = getActiveElement(document);\n if (!activeElement) return;\n\n if (\n activeElement.dataset.anv !== \"drawer-header-close-button\" &&\n (focusables.includes(activeElement) ||\n activeElement.tagName === \"DIALOG\")\n ) {\n return;\n }\n\n if (\n focusables[0]?.dataset.anv === \"dialog-header-close-button\" &&\n focusables[1]\n ) {\n focusables[1].focus();\n } else {\n focusables[0]?.focus();\n }\n }, [isOpenOrOpening, focusables]);\n\n const onKeyDownHandler = (e: KeyboardEvent<HTMLDialogElement>) => {\n onKeyDown?.(e);\n if (e.code === \"Escape\") {\n e.preventDefault();\n if (disableCloseOnEscape) return;\n if (hasOpenPopover) return;\n onClose?.();\n return;\n }\n\n if (e.code === \"Tab\") {\n if (e.shiftKey && e.target === focusables?.[0]) {\n e.preventDefault();\n (focusables[focusables.length - 1] as HTMLElement)?.focus();\n return;\n }\n if (e.target === focusables?.[focusables.length - 1] && !e.shiftKey) {\n e.preventDefault();\n focusables[0].focus();\n return;\n }\n }\n };\n\n return (\n // dialog element does seem to be interactive on MDN guideline\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\n <dialog\n className={classNames}\n data-anv=\"dialog\"\n data-anv-scroll-chaining={enableScrollChaining}\n data-anv-transition-state={state}\n ref={useMergeRefs([ref, elRef])}\n onKeyDown={onKeyDownHandler}\n {...rest}\n >\n <ToastProvider isDialogToaster={open}>\n <ToasterPopover>\n <ToasterContent id=\"dialog-toaster\" ref={toasterRef} />\n </ToasterPopover>\n </ToastProvider>\n <DialogContext.Provider\n value={{\n close: () => onClose?.(),\n ref: elRef,\n hasOpenPopover,\n setHasOpenPopover,\n }}\n >\n <section\n ref={contentRef}\n className={styles[\"container\"]}\n data-open={open}\n >\n {children}\n </section>\n </DialogContext.Provider>\n </dialog>\n );\n },\n);\n\nDialogElement.displayName = \"Dialog\";\n\n/**\n * Dialog component for creating modal dialogs and overlays.\n *\n * Features:\n * - Modal dialog with backdrop overlay\n * - Controlled and uncontrolled open state\n * - Smooth open/close animations\n * - Keyboard navigation and focus management\n * - Escape key and click outside to close\n * - Multiple size variants (medium, large, fullscreen)\n * - Scroll chaining support\n * - Toast integration for notifications\n * - Compound component pattern with Header, Footer, Content, and CancelButton sub-components\n * - Automatic tracking ID generation for analytics\n *\n * @example\n * <Dialog open={isOpen} onClose={() => setIsOpen(false)}>\n * <Dialog.Header>Confirm Action</Dialog.Header>\n * <Dialog.Content>Are you sure you want to proceed?</Dialog.Content>\n * <Dialog.Footer>\n * <Dialog.CancelButton>Cancel</Dialog.CancelButton>\n * <Button appearance=\"primary\">Confirm</Button>\n * </Dialog.Footer>\n * </Dialog>\n */\nexport const Dialog = Object.assign(DialogElement, {\n /**\n * DialogHeader component for the header section of a Dialog.\n *\n * Features:\n * - Displays dialog title with headline typography\n * - Includes close button with proper accessibility\n * - Sticky positioning for long content\n * - Consistent spacing and styling\n * - Automatic focus management\n * - Automatic tracking ID generation for analytics\n *\n * @example\n * <Dialog.Header>Confirm Delete</Dialog.Header>\n */\n Header: DialogHeader,\n /**\n * DialogFooter component for the footer section of a Dialog.\n *\n * Features:\n * - Container for dialog action buttons\n * - Optional sticky positioning for long content\n * - Consistent spacing and alignment\n * - Right-aligned button layout by default\n * - Flexible content area for custom layouts\n *\n * @example\n * <Dialog.Footer sticky>\n * <Dialog.CancelButton>Cancel</Dialog.CancelButton>\n * <Button appearance=\"primary\">Save</Button>\n * </Dialog.Footer>\n */\n Footer: DialogFooter,\n /**\n * DialogContent component for the main content area of a Dialog.\n *\n * Features:\n * - Main content container for dialog body\n * - Flexible height with overflow handling\n * - Consistent padding and spacing\n * - Responsive design\n * - Proper content scrolling for long content\n *\n * @example\n * <Dialog.Content>\n * <p>This is the main content of the dialog.</p>\n * </Dialog.Content>\n */\n Content: DialogContent,\n /**\n * DialogCancelButton component for cancel/close actions in a Dialog.\n *\n * Features:\n * - Button that automatically closes the dialog when clicked\n * - Extends all Button component props and functionality\n * - Proper accessibility with close dialog semantics\n * - Automatic focus management\n * - Consistent styling with other dialog elements\n * - Automatic tracking ID generation for analytics\n *\n * @example\n * <Dialog.CancelButton appearance=\"ghost\">Cancel</Dialog.CancelButton>\n */\n CancelButton: DialogCancelButton,\n});\n"],"names":["Close"],"mappings":";;;;;;;;;;;;;;;AAGO,SAAS,gBAAmB,GAAA;AACjC,EAAM,MAAA,OAAA,GAAU,WAAW,aAAa,CAAA;AACxC,EAAA,IAAI,CAAC,OAAS,EAAA;AACZ,IAAA,MAAM,IAAI,KAAA;AAAA,MACR;AAAA,KACF;AAAA;AAEF,EAAO,OAAA,OAAA;AACT;;ACcO,MAAM,kBAAqB,GAAA,UAAA,CAGhC,CAAC,KAAA,EAAO,GAAQ,KAAA;AAChB,EAAA,MAAM,EAAE,OAAA,EAAS,GAAG,IAAA,EAAS,GAAA,KAAA;AAC7B,EAAM,MAAA,EAAE,KAAM,EAAA,GAAI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BAAiB,EAAA,GAAA,EAAK,UAAY,EAAA,CAAA,EACvD,CACF,EAAA,CAAA;AAAA,4BACA,GAAA;AAAA,cAAC,aAAc,CAAA,QAAA;AAAA,cAAd;AAAA,gBACC,KAAO,EAAA;AAAA,kBACL,KAAA,EAAO,MAAM,OAAU,IAAA;AAAA,kBACvB,GAAK,EAAA,KAAA;AAAA,kBACL,cAAA;AAAA,kBACA;AAAA,iBACF;AAAA,gBAEA,QAAA,kBAAA,GAAA;AAAA,kBAAC,SAAA;AAAA,kBAAA;AAAA,oBACC,GAAK,EAAA,UAAA;AAAA,oBACL,SAAA,EAAW,OAAO,WAAW,CAAA;AAAA,oBAC7B,WAAW,EAAA,IAAA;AAAA,oBAEV;AAAA;AAAA;AACH;AAAA;AACF;AAAA;AAAA;AACF;AAAA;AAGN,CAAA;AAEA,aAAA,CAAc,WAAc,GAAA,QAAA;AA2Bf,MAAA,MAAA,GAAS,MAAO,CAAA,MAAA,CAAO,aAAe,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAejD,MAAQ,EAAA,YAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBR,MAAQ,EAAA,YAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBR,OAAS,EAAA,aAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAeT,YAAc,EAAA;AAChB,CAAC;;;;"}
package/dist/Dialog.js CHANGED
@@ -1,2 +1,2 @@
1
- export { D as Dialog, a as DialogCancelButton, b as DialogContent, c as DialogFooter, d as DialogHeader, D as default } from './Dialog-DpH2Qvbd.js';
1
+ export { D as Dialog, a as DialogCancelButton, b as DialogContent, c as DialogFooter, d as DialogHeader, D as default } from './Dialog-CgkrvrQu.js';
2
2
  //# sourceMappingURL=Dialog.js.map
@@ -7,7 +7,7 @@ import { a as DrawerContext } from './DrawerContext-DboTgTmo.js';
7
7
  import { c as childrenToString } from './childrenToString-Bz9MqbHb.js';
8
8
  import { useTrackingId } from './useTrackingId.js';
9
9
  import { c as cx } from './index-tZvMCc77.js';
10
- import { a as ToastProvider, b as ToasterPopover, c as ToasterContent } from './Toaster-BgjT0p8b.js';
10
+ import { a as ToastProvider, b as ToasterPopover, c as ToasterContent } from './Toaster-9cpG_tWR.js';
11
11
  import { u as useMergeRefs } from './useMergeRefs-Bde85AWI.js';
12
12
  import { u as useDialogTransitionStates, a as useDialogScrollLock } from './useDialogTransitionStates-2NaE_noq.js';
13
13
  import { a as useKeyboardFocusables, b as useOnClickOutside } from './useOnClickOutside-BHEWMLa9.js';
@@ -374,4 +374,4 @@ const Drawer = Object.assign(DrawerElement, {
374
374
  });
375
375
 
376
376
  export { Drawer as D, DrawerCancelButton as a, DrawerFooter as b, DrawerHeader as c, DrawerContent as d };
377
- //# sourceMappingURL=Drawer-DI_k6W2k.js.map
377
+ //# sourceMappingURL=Drawer-CM4ZbAro.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer-DI_k6W2k.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 } from \"../../hooks\";\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 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={ref}\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 { ComponentPropsWithoutRef, forwardRef } from \"react\";\nimport styles from \"./Drawer.module.scss\";\nimport cx from \"classnames\";\n\n/**\n * Props for the DrawerContent component\n * @extends ComponentPropsWithoutRef<\"div\">\n */\nexport type DrawerContentProps = ComponentPropsWithoutRef<\"div\">;\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 * - 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 */\nexport const DrawerContent = forwardRef<HTMLDivElement, DrawerContentProps>(\n (props, ref) => {\n const { className, children, ...rest } = props;\n const drawerContentClasses = cx(styles.content, className);\n\n return (\n <div\n className={drawerContentClasses}\n data-anv=\"drawer-content\"\n ref={ref}\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 { DisableCloseOnEscapeOrClickProps, Size } from \"../../types\";\nimport { useMergeRefs } from \"../../hooks\";\nimport cx from \"classnames\";\nimport { getActiveElement } from \"../../internal/functions\";\nimport { ToastProvider } from \"../Toast/internal/ToastProvider\";\nimport { ToasterPopover } from \"../Toast/internal/ToasterPopover\";\nimport { ToasterContent } from \"../Toast/internal/Toaster\";\nimport { DrawerContext } from \"./internal/DrawerContext\";\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\nconst DrawerElement = forwardRef<HTMLDialogElement, DrawerProps>(\n (props, ref) => {\n const {\n className,\n open = false,\n children,\n onOpen,\n onClose,\n /* eslint-disable-next-line @typescript-eslint/no-unused-vars --\n onCancel is destructured so that it is not passed to the dialog in ...rest\n */\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 ...rest\n } = props;\n\n const elRef = useRef<HTMLDialogElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const toasterRef = useRef<HTMLDivElement>(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 useEffect(() => {\n if (!isOpenOrOpening) return;\n if (!focusables) return;\n\n const activeElement = getActiveElement(document);\n if (!activeElement) return;\n\n if (\n activeElement.dataset.anv !== \"drawer-header-close-button\" &&\n (focusables.includes(activeElement) ||\n activeElement.tagName === \"DIALOG\")\n ) {\n return;\n }\n\n if (\n focusables[0]?.dataset.anv === \"drawer-header-close-button\" &&\n focusables[1]\n ) {\n focusables[1].focus();\n } else {\n focusables[0]?.focus();\n }\n }, [isOpenOrOpening, focusables]);\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 });\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?.() };\n }, [onClose]);\n\n return (\n // dialog element does seem to be interactive on MDN guideline\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASO,SAAS,gBAAmB,GAAA;AACjC,EAAM,MAAA,OAAA,GAAU,WAAW,aAAa,CAAA;AACxC,EAAA,IAAI,CAAC,OAAS,EAAA;AACZ,IAAA,MAAM,IAAI,KAAA;AAAA,MACR;AAAA,KACF;AAAA;AAEF,EAAO,OAAA,OAAA;AACT;;ACaO,MAAM,kBAAqB,GAAA,UAAA,CAGhC,CAAC,KAAA,EAAO,GAAQ,KAAA;AAChB,EAAA,MAAM,EAAE,OAAA,EAAS,GAAG,IAAA,EAAS,GAAA,KAAA;AAC7B,EAAM,MAAA,EAAE,KAAM,EAAA,GAAI,gBAAiB,EAAA;AACnC,EAAA,MAAM,IAAO,GAAA;AAAA,IACX,QAAA,EAAU,gBAAiB,CAAA,KAAA,CAAM,QAAQ,CAAA;AAAA,IACzC,YAAY,KAAM,CAAA,UAAA;AAAA,IAClB,MAAM,KAAM,CAAA,IAAA;AAAA,IACZ,MAAM,KAAM,CAAA;AAAA,GACd;AAEA,EAAA,MAAM,aAAa,aAAc,CAAA;AAAA,IAC/B,IAAM,EAAA,oBAAA;AAAA,IACN,IAAA;AAAA,IACA,WAAa,EAAA,CAAC,CAAC,KAAA,CAAM,kBAAkB;AAAA,GACxC,CAAA;AAED,EAAM,MAAA,cAAA,GAAiB,CAAC,CAAqC,KAAA;AAC3D,IAAA,OAAA,GAAU,CAAC,CAAA;AACX,IAAM,KAAA,EAAA;AAAA,GACR;AACA,EACE,uBAAA,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,YAAW,EAAA,cAAA;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A;AAAA;AAAA;AAAA;AAAA;AAAA,EAoBR,OAAS,EAAA,aAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmBT,YAAc,EAAA;AAChB,CAAC;;;;"}
1
+ {"version":3,"file":"Drawer-CM4ZbAro.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 } from \"../../hooks\";\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 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={ref}\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 { ComponentPropsWithoutRef, forwardRef } from \"react\";\nimport styles from \"./Drawer.module.scss\";\nimport cx from \"classnames\";\n\n/**\n * Props for the DrawerContent component\n * @extends ComponentPropsWithoutRef<\"div\">\n */\nexport type DrawerContentProps = ComponentPropsWithoutRef<\"div\">;\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 * - 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 */\nexport const DrawerContent = forwardRef<HTMLDivElement, DrawerContentProps>(\n (props, ref) => {\n const { className, children, ...rest } = props;\n const drawerContentClasses = cx(styles.content, className);\n\n return (\n <div\n className={drawerContentClasses}\n data-anv=\"drawer-content\"\n ref={ref}\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 { DisableCloseOnEscapeOrClickProps, Size } from \"../../types\";\nimport { useMergeRefs } from \"../../hooks\";\nimport cx from \"classnames\";\nimport { getActiveElement } from \"../../internal/functions\";\nimport { ToastProvider } from \"../Toast/internal/ToastProvider\";\nimport { ToasterPopover } from \"../Toast/internal/ToasterPopover\";\nimport { ToasterContent } from \"../Toast/internal/Toaster\";\nimport { DrawerContext } from \"./internal/DrawerContext\";\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\nconst DrawerElement = forwardRef<HTMLDialogElement, DrawerProps>(\n (props, ref) => {\n const {\n className,\n open = false,\n children,\n onOpen,\n onClose,\n /* eslint-disable-next-line @typescript-eslint/no-unused-vars --\n onCancel is destructured so that it is not passed to the dialog in ...rest\n */\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 ...rest\n } = props;\n\n const elRef = useRef<HTMLDialogElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const toasterRef = useRef<HTMLDivElement>(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 useEffect(() => {\n if (!isOpenOrOpening) return;\n if (!focusables) return;\n\n const activeElement = getActiveElement(document);\n if (!activeElement) return;\n\n if (\n activeElement.dataset.anv !== \"drawer-header-close-button\" &&\n (focusables.includes(activeElement) ||\n activeElement.tagName === \"DIALOG\")\n ) {\n return;\n }\n\n if (\n focusables[0]?.dataset.anv === \"drawer-header-close-button\" &&\n focusables[1]\n ) {\n focusables[1].focus();\n } else {\n focusables[0]?.focus();\n }\n }, [isOpenOrOpening, focusables]);\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 });\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?.() };\n }, [onClose]);\n\n return (\n // dialog element does seem to be interactive on MDN guideline\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASO,SAAS,gBAAmB,GAAA;AACjC,EAAM,MAAA,OAAA,GAAU,WAAW,aAAa,CAAA;AACxC,EAAA,IAAI,CAAC,OAAS,EAAA;AACZ,IAAA,MAAM,IAAI,KAAA;AAAA,MACR;AAAA,KACF;AAAA;AAEF,EAAO,OAAA,OAAA;AACT;;ACaO,MAAM,kBAAqB,GAAA,UAAA,CAGhC,CAAC,KAAA,EAAO,GAAQ,KAAA;AAChB,EAAA,MAAM,EAAE,OAAA,EAAS,GAAG,IAAA,EAA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,cAAA;AAAA,gBACC,GAAK,EAAA,UAAA;AAAA,gBACL,WAAW,MAAO,CAAA,SAAA;AAAA,gBAClB,WAAW,EAAA,eAAA;AAAA,gBAEV;AAAA;AAAA,aAEL,EAAA;AAAA;AAAA;AAAA;AACF;AAAA;AAGN,CAAA;AACA,aAAA,CAAc,WAAc,GAAA,QAAA;AA4Bf,MAAA,MAAA,GAAS,MAAO,CAAA,MAAA,CAAO,aAAe,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBjD,MAAQ,EAAA,YAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmBR,MAAQ,EAAA,YAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAoBR,OAAS,EAAA,aAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmBT,YAAc,EAAA;AAChB,CAAC;;;;"}
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-DI_k6W2k.js';
1
+ export { D as Drawer, a as DrawerCancelButton, d as DrawerContent, b as DrawerFooter, c as DrawerHeader, D as default } from './Drawer-CM4ZbAro.js';
2
2
  //# sourceMappingURL=Drawer.js.map
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
- import { useState, useEffect, forwardRef } from 'react';
2
+ import { forwardRef } from 'react';
3
3
  import { c as cx } from './index-tZvMCc77.js';
4
4
  import { S as SrOnly } from './SrOnly-CTsYSuby.js';
5
5
  import { T as Tooltip } from './Tooltip-BI3Xs75X.js';
@@ -21,21 +21,10 @@ const FieldLabelMoreInfoIcon = ({
21
21
  moreInfo,
22
22
  openMoreInfo
23
23
  }) => {
24
- const [open, setOpen] = useState(openMoreInfo);
25
- useEffect(() => {
26
- if (openMoreInfo) {
27
- setOpen(true);
28
- } else {
29
- setOpen(false);
30
- setTimeout(() => {
31
- setOpen(void 0);
32
- });
33
- }
34
- }, [openMoreInfo]);
35
24
  return /* @__PURE__ */ jsxs(
36
25
  Tooltip,
37
26
  {
38
- open,
27
+ open: openMoreInfo,
39
28
  placement: "top",
40
29
  offset: 5,
41
30
  fallbackPlacements: ["right", "bottom", "left"],
@@ -84,4 +73,4 @@ const FieldLabel = forwardRef(
84
73
  FieldLabel.displayName = "FieldLabel";
85
74
 
86
75
  export { FieldLabel as F };
87
- //# sourceMappingURL=FieldLabel-BfnCXung.js.map
76
+ //# sourceMappingURL=FieldLabel-BsbTTyom.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FieldLabel-BsbTTyom.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\";\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 */\nexport const FieldLabelMoreInfoIcon = ({\n moreInfo,\n openMoreInfo,\n}: {\n moreInfo: FieldLabelProps[\"moreInfo\"];\n openMoreInfo: FieldLabelProps[\"openMoreInfo\"];\n}) => {\n return (\n <Tooltip\n open={openMoreInfo}\n placement=\"top\"\n offset={5}\n fallbackPlacements={[\"right\", \"bottom\", \"left\"]}\n >\n <Tooltip.Trigger className={styles[\"info-trigger\"]}>\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 { forwardRef, ComponentPropsWithoutRef, ReactNode } 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\n/**\n * Props for the FieldLabel component.\n */\nexport type FieldLabelProps = Omit<ComponentPropsWithoutRef<\"label\">, \"id\"> & {\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 * 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 *\n * @example\n * <FieldLabel htmlFor=\"email\" required>\n * Email Address\n * </FieldLabel>\n * <input id=\"email\" type=\"email\" />\n *\n * @example\n * <FieldLabel\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 */\nexport const FieldLabel = forwardRef<HTMLLabelElement, FieldLabelProps>(\n (props, ref) => {\n const { children, className, moreInfo, required, openMoreInfo, ...rest } =\n props;\n const FieldLabelClassNames = cx([styles[\"label\"]], className);\n\n return (\n <label\n className={FieldLabelClassNames}\n data-anv=\"label\"\n ref={ref}\n {...rest}\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 </label>\n );\n },\n);\n\nFieldLabel.displayName = \"FieldLabel\";\n"],"names":["Info"],"mappings":";;;;;;;;;;;;;;;;;;;AAaO,MAAM,yBAAyB,CAAC;AAAA,EACrC,QAAA;AAAA,EACA;AACF,CAGM,KAAA;AACJ,EACE,uBAAA,IAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACC,IAAM,EAAA,YAAA;AAAA,MACN,SAAU,EAAA,KAAA;AAAA,MACV,MAAQ,EAAA,CAAA;AAAA,MACR,kBAAoB,EAAA,CAAC,OAAS,EAAA,QAAA,EAAU,MAAM,CAAA;AAAA,MAE9C,QAAA,EAAA;AAAA,wBAAC,GAAA,CAAA,OAAA,CAAQ,OAAR,EAAA,EAAgB,SAAW,EAAA,MAAA,CAAO,cAAc,CAAA,EAC/C,QAAC,kBAAA,GAAA,CAAA,IAAA,EAAA,EAAK,GAAK,EAAAA,OAAA,EAAM,CACnB,EAAA,CAAA;AAAA,wBACA,GAAA,CAAC,QAAQ,OAAR,EAAA,EAAgB,WAAW,MAAO,CAAA,cAAc,GAC9C,QACH,EAAA,QAAA,EAAA;AAAA;AAAA;AAAA,GACF;AAEJ,CAAA;;ACsBO,MAAM,UAAa,GAAA,UAAA;AAAA,EACxB,CAAC,OAAO,GAAQ,KAAA;AACd,IAAM,MAAA,EAAE,UAAU,SAAW,EAAA,QAAA,EAAU,UAAU,YAAc,EAAA,GAAG,MAChE,GAAA,KAAA;AACF,IAAA,MAAM,uBAAuB,EAAG,CAAA,CAAC,OAAO,OAAO,CAAC,GAAG,SAAS,CAAA;AAE5D,IACE,uBAAA,IAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,SAAW,EAAA,oBAAA;AAAA,QACX,UAAS,EAAA,OAAA;AAAA,QACT,GAAA;AAAA,QACC,GAAG,IAAA;AAAA,QAEJ,QAAA,EAAA;AAAA,0BAAA,IAAA,CAAC,SAAI,SAAW,EAAA,MAAA,CAAO,eAAe,CAAA,EAAG,eAAY,MACnD,EAAA,QAAA,EAAA;AAAA,4BAAA,IAAA,CAAC,MAAK,EAAA,EAAA,SAAA,EAAW,MAAO,CAAA,YAAY,CACjC,EAAA,QAAA,EAAA;AAAA,cAAA,QAAA;AAAA,cACA,2BAEG,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,gCAAA,GAAA,CAAC,UAAK,aAAW,EAAA,IAAA,EAAC,WAAW,MAAO,CAAA,UAAU,GAAG,QAEjD,EAAA,GAAA,EAAA,CAAA;AAAA,gCACA,GAAA,CAAC,UAAO,QAAQ,EAAA,UAAA,EAAA;AAAA,eAAA,EAClB,CACE,GAAA;AAAA,aACN,EAAA,CAAA;AAAA,YACC,QACC,mBAAA,GAAA;AAAA,cAAC,sBAAA;AAAA,cAAA;AAAA,gBACC,QAAA;AAAA,gBACA;AAAA;AAAA,aAEA,GAAA;AAAA,WACN,EAAA,CAAA;AAAA,UAEC,QAAW,mBAAA,GAAA,CAAC,MAAQ,EAAA,EAAA,QAAA,EAAA,QAAA,EAAS,CAAY,GAAA;AAAA;AAAA;AAAA,KAC5C;AAAA;AAGN;AAEA,UAAA,CAAW,WAAc,GAAA,YAAA;;;;"}
@@ -1,2 +1,2 @@
1
- export { F as FieldLabel, F as default } from './FieldLabel-BfnCXung.js';
1
+ export { F as FieldLabel, F as default } from './FieldLabel-BsbTTyom.js';
2
2
  //# sourceMappingURL=FieldLabel.js.map
@@ -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-DboTgTmo.js';
4
- import { T as TextField } from './TextField-DlsZEkS0.js';
4
+ import { T as TextField } from './TextField-D8fow9j7.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-O_qi1p_3.js.map
264
+ //# sourceMappingURL=InputMask-_F139qFu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InputMask-O_qi1p_3.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,GAAK,EAAA,GAAA,EAAK,GAAG,CAAA;;ACcxB,SAAA,SAAA,CACd,KACA,EAAA,IAAA,EACA,oBACA,EAAA;AACA,EAA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AI,CACtC,GAAA,IAAA;AAAA,MACN,aACE,aAAiB,IAAA,gBAAA,GACb,gBAAiB,CAAA,gBAAA,CAAiB,WAAW,CAC7C,GAAA,IAAA;AAAA,MACN,MAAM,gBAAiB,CAAA,IAAA;AAAA,MACvB,MAAM,gBAAiB,CAAA;AAAA,KACzB;AAEA,IAAA,MAAM,aAAa,aAAc,CAAA;AAAA,MAC/B,IAAM,EAAA,WAAA;AAAA,MACN,IAAA;AAAA,MACA,WAAA,EAAa,CAAC,CAAC;AAAA,KAChB,CAAA;AAED,IAAO,OAAA,QAAA,IAAY,eAAe,QAAQ,CAAA,IAAK,SAAS,IAAS,KAAA,OAAA,GAC/D,aAAa,QAAU,EAAA;AAAA,MACrB,GAAG,gBAAA;AAAA,MACH,kBAAoB,EAAA;AAAA,KAGrB,CAED,mBAAA,GAAA;AAAA,MAAC,SAAA;AAAA,MAAA;AAAA,QACC,kBAAkB,EAAA,YAAA;AAAA,QAClB,kBAAkB,EAAA,UAAA;AAAA,QACjB,GAAI;AAAA;AAAA,KACP;AAAA;AAGN;AAEA,SAAA,CAAU,WAAc,GAAA,WAAA;;;;"}
1
+ {"version":3,"file":"InputMask-_F139qFu.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 },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gB,gBAAmB,GAAA,gBAAA,CAAiB,UAAa,GAAA,IAAA;AAAA,MACnE,MAAA,EAAQ,gBAAiB,CAAA,gBAAA,CAAiB,MAAM,CAAA;AAAA,MAChD,MACE,MAAU,IAAA,gBAAA,GACN,gBAAiB,CAAA,gBAAA,CAAiB,IAAI,CACtC,GAAA,IAAA;AAAA,MACN,aACE,aAAiB,IAAA,gBAAA,GACb,gBAAiB,CAAA,gBAAA,CAAiB,WAAW,CAC7C,GAAA,IAAA;AAAA,MACN,MAAM,gBAAiB,CAAA,IAAA;AAAA,MACvB,MAAM,gBAAiB,CAAA;AAAA,KACzB;AAEA,IAAA,MAAM,aAAa,aAAc,CAAA;AAAA,MAC/B,IAAM,EAAA,WAAA;AAAA,MACN,IAAA;AAAA,MACA,WAAA,EAAa,CAAC,CAAC;AAAA,KAChB,CAAA;AAED,IAAO,OAAA,QAAA,IAAY,eAAe,QAAQ,CAAA,IAAK,SAAS,IAAS,KAAA,OAAA,GAC/D,aAAa,QAAU,EAAA;AAAA,MACrB,GAAG,gBAAA;AAAA,MACH,kBAAoB,EAAA;AAAA,KAGrB,CAED,mBAAA,GAAA;AAAA,MAAC,SAAA;AAAA,MAAA;AAAA,QACC,kBAAkB,EAAA,YAAA;AAAA,QAClB,kBAAkB,EAAA,UAAA;AAAA,QACjB,GAAI;AAAA;AAAA,KACP;AAAA;AAGN;AAEA,SAAA,CAAU,WAAc,GAAA,WAAA;;;;"}
package/dist/InputMask.js CHANGED
@@ -1,2 +1,2 @@
1
- export { I as InputMask, I as default } from './InputMask-O_qi1p_3.js';
1
+ export { I as InputMask, I as default } from './InputMask-_F139qFu.js';
2
2
  //# sourceMappingURL=InputMask.js.map
@@ -1,6 +1,6 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { createContext, useContext, forwardRef, useRef, useId, useEffect, useMemo, useState } from 'react';
3
- import { C as Checkbox } from './Checkbox-3y2d9mBd.js';
3
+ import { C as Checkbox } from './Checkbox-ZphVb1l0.js';
4
4
  import { c as cx } from './index-tZvMCc77.js';
5
5
  import { s as styles } from './ListView.module-MVsNF0X0.js';
6
6
  import { u as useMergeRefs } from './useMergeRefs-Bde85AWI.js';
@@ -529,4 +529,4 @@ const ListView = Object.assign(
529
529
  );
530
530
 
531
531
  export { ListView as L, ListViewOption as a, ListViewOptionCell as b };
532
- //# sourceMappingURL=ListView-jR2ZkBB7.js.map
532
+ //# sourceMappingURL=ListView-DEAMQopB.js.map