@servicetitan/anvil2 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/{Combobox-B6saoDAP.js → Combobox-Drqb3GVU.js} +2 -2
- package/dist/{Combobox-B6saoDAP.js.map → Combobox-Drqb3GVU.js.map} +1 -1
- package/dist/Combobox.js +1 -1
- package/dist/{DataTable-NzX8SCYT.js → DataTable-BLuJ4FtH.js} +272 -42
- package/dist/DataTable-BLuJ4FtH.js.map +1 -0
- package/dist/{DateFieldRange-DgGgNSzN.js → DateFieldRange-CvlOeE4v.js} +2 -2
- package/dist/{DateFieldRange-DgGgNSzN.js.map → DateFieldRange-CvlOeE4v.js.map} +1 -1
- package/dist/DateFieldRange.js +1 -1
- package/dist/{DateFieldSingle-BR4nJNVl.js → DateFieldSingle-9UHxIxIA.js} +2 -2
- package/dist/{DateFieldSingle-BR4nJNVl.js.map → DateFieldSingle-9UHxIxIA.js.map} +1 -1
- package/dist/DateFieldSingle.js +1 -1
- package/dist/{DateFieldYearless-mqvM2uVP.js → DateFieldYearless-HNydELvO.js} +2 -2
- package/dist/{DateFieldYearless-mqvM2uVP.js.map → DateFieldYearless-HNydELvO.js.map} +1 -1
- package/dist/DateFieldYearless.js +1 -1
- package/dist/{DateFieldYearlessRange-CLuyUoGF.js → DateFieldYearlessRange-COb8v2CG.js} +2 -2
- package/dist/{DateFieldYearlessRange-CLuyUoGF.js.map → DateFieldYearlessRange-COb8v2CG.js.map} +1 -1
- package/dist/DateFieldYearlessRange.js +1 -1
- package/dist/{Dialog-yA2jYtgv.js → Dialog-DEAR058v.js} +2 -2
- package/dist/{Dialog-yA2jYtgv.js.map → Dialog-DEAR058v.js.map} +1 -1
- package/dist/Dialog.js +1 -1
- package/dist/{Drawer-Dt4dqAxQ.js → Drawer-CnMskBQl.js} +2 -2
- package/dist/{Drawer-Dt4dqAxQ.js.map → Drawer-CnMskBQl.js.map} +1 -1
- package/dist/Drawer.js +1 -1
- package/dist/DrillDown.js +1 -1
- package/dist/{FieldDialog-BghhsL2B.js → FieldDialog-C5mwMjrr.js} +2 -2
- package/dist/{FieldDialog-BghhsL2B.js.map → FieldDialog-C5mwMjrr.js.map} +1 -1
- package/dist/MultiSelectField.js +1 -1
- package/dist/{MultiSelectFieldSync-ChDuxvhE.js → MultiSelectFieldSync-BnPzYM72.js} +2 -2
- package/dist/{MultiSelectFieldSync-ChDuxvhE.js.map → MultiSelectFieldSync-BnPzYM72.js.map} +1 -1
- package/dist/{Page-CkcnGPPK.js → Page-qOkG6psI.js} +4 -4
- package/dist/{Page-CkcnGPPK.js.map → Page-qOkG6psI.js.map} +1 -1
- package/dist/Page.js +1 -1
- package/dist/{Pagination-DO9NORlw.js → Pagination-BuiyhZlJ.js} +11 -4
- package/dist/Pagination-BuiyhZlJ.js.map +1 -0
- package/dist/Pagination.js +1 -1
- package/dist/{Popover-D_BmwIOW.js → Popover-CYWYCj7l.js} +2 -2
- package/dist/{Popover-D_BmwIOW.js.map → Popover-CYWYCj7l.js.map} +1 -1
- package/dist/Popover.js +1 -1
- package/dist/SelectField.js +1 -1
- package/dist/{SelectFieldSync-DfP3eETZ.js → SelectFieldSync-DCrafdbx.js} +2 -2
- package/dist/{SelectFieldSync-DfP3eETZ.js.map → SelectFieldSync-DCrafdbx.js.map} +1 -1
- package/dist/{Tab-CeXt6A_D.js → Tab-DXivEqur.js} +47 -6
- package/dist/Tab-DXivEqur.js.map +1 -0
- package/dist/Tab.js +1 -1
- package/dist/Table.js +1 -1
- package/dist/{TimeField-CbdxhawY.js → TimeField-DREFzFkw.js} +2 -2
- package/dist/{TimeField-CbdxhawY.js.map → TimeField-DREFzFkw.js.map} +1 -1
- package/dist/TimeField.js +1 -1
- package/dist/{Toolbar-4VdevLJd.js → Toolbar-jfZ-CupZ.js} +7 -7
- package/dist/{Toolbar-4VdevLJd.js.map → Toolbar-jfZ-CupZ.js.map} +1 -1
- package/dist/Toolbar.js +1 -1
- package/dist/{YearlessDateInputWithPicker-BADNBDmy.js → YearlessDateInputWithPicker-mW5KykHZ.js} +2 -2
- package/dist/{YearlessDateInputWithPicker-BADNBDmy.js.map → YearlessDateInputWithPicker-mW5KykHZ.js.map} +1 -1
- package/dist/beta/components/Table/DataTable/DataTable.d.ts +12 -0
- package/dist/beta/components/Table/DataTable/internal/editable-cells/DataTableEditableBooleanCell.d.ts +7 -0
- package/dist/beta/components/Table/DataTable/internal/util/getTanStackColumnDef.d.ts +4 -0
- package/dist/beta/components/Table/createColumnHelper.d.ts +18 -7
- package/dist/beta/components/Table/types.d.ts +44 -3
- package/dist/beta.js +5 -5
- package/dist/components/Pagination/Pagination.d.ts +3 -0
- package/dist/components/Pagination/internal/PaginationItemsPerPageMenu.d.ts +5 -0
- package/dist/components/Tab/Tab.d.ts +41 -2
- package/dist/components/Tab/internal/TabContext.d.ts +1 -1
- package/dist/{index.esm-BZV0wNKZ.js → index.esm-K9kxJhLx.js} +2 -1
- package/dist/{index.esm-BZV0wNKZ.js.map → index.esm-K9kxJhLx.js.map} +1 -1
- package/dist/index.js +13 -13
- package/dist/internal/components/ManualTestLayout/ManualTestLayout.d.ts +16 -0
- package/dist/internal/components/ManualTestLayout/index.d.ts +1 -0
- package/dist/internal/components/index.d.ts +1 -0
- package/dist/{useDrilldown-C8TRwNE9.js → useDrilldown-hUxMOdnz.js} +2 -2
- package/dist/{useDrilldown-C8TRwNE9.js.map → useDrilldown-hUxMOdnz.js.map} +1 -1
- package/dist/{useInitialFocus-CdoVwSbr.js → useInitialFocus-BRRbylek.js} +2 -2
- package/dist/{useInitialFocus-CdoVwSbr.js.map → useInitialFocus-BRRbylek.js.map} +1 -1
- package/package.json +3 -3
- package/dist/DataTable-NzX8SCYT.js.map +0 -1
- package/dist/Pagination-DO9NORlw.js.map +0 -1
- package/dist/Tab-CeXt6A_D.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback, useState, useRef, useEffect } from 'react';
|
|
2
2
|
import { u as useOpenCloseTransitionStates } from './useOpenCloseTransitionStates-CiTYrLGi.js';
|
|
3
|
-
import { t as tabbable } from './index.esm-
|
|
3
|
+
import { t as tabbable } from './index.esm-K9kxJhLx.js';
|
|
4
4
|
|
|
5
5
|
const useDialogTransitionStates = (ref, openProp, options = {}) => {
|
|
6
6
|
const { onOpenAnimationStart, onCloseAnimationComplete } = options;
|
|
@@ -187,4 +187,4 @@ const useInitialFocus = (dialogRef, { computeFocus }) => {
|
|
|
187
187
|
};
|
|
188
188
|
|
|
189
189
|
export { useDialogTransitionStates as a, useKeyboardFocusables as b, useInitialFocus as c, useDrillDownContextState as u };
|
|
190
|
-
//# sourceMappingURL=useInitialFocus-
|
|
190
|
+
//# sourceMappingURL=useInitialFocus-BRRbylek.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInitialFocus-CdoVwSbr.js","sources":["../src/internal/hooks/useDialogTransitionStates/useDialogTransitionStates.ts","../src/internal/hooks/useKeyboardFocusables/useKeyboardFocusables.ts","../src/components/DrillDown/internal/useDrillDownContextState.ts","../src/components/Dialog/internal/useInitialFocus.ts"],"sourcesContent":["import { RefObject, useCallback } from \"react\";\nimport {\n useOpenCloseTransitionStates,\n type OpenCloseTransitionStateEffects,\n} from \"../useOpenCloseTransitionStates\";\n\n/**\n * Effects configuration for dialog transition states\n * @property {() => void} [onOpenAnimationStart] - Callback when opening animation starts\n * @property {() => void} [onCloseAnimationStart] - Callback when closing animation starts\n * @property {() => void} [onOpenAnimationComplete] - Callback when opening animation completes\n * @property {() => void} [onCloseAnimationComplete] - Callback when closing animation completes\n */\n\n/**\n * Custom hook for managing dialog transition states and animations.\n *\n * Features:\n * - Manages dialog open/close transition states\n * - Handles animation timing based on CSS animation duration\n * - Provides callbacks for animation lifecycle events\n * - Supports controlled dialog state management\n * - Automatically handles showModal() and close() calls\n * - Provides utility flags for open/closed states\n *\n * @param ref - The ref to the dialog element\n * @param openProp - The open prop controlling dialog visibility\n * @param options - Additional, optional options including callbacks for animation start, complete, and initialization\n * @returns Object containing dialog state, control functions, and utility flags\n */\n\n/**\n * Effects configuration for dialog transition states\n * @param openProp - The open prop controlling dialog visibility\n * @param options - The effects configuration\n * @returns The dialog transition state\n */\nexport const useDialogTransitionStates = (\n ref: RefObject<HTMLDialogElement>,\n openProp: boolean | undefined,\n options: OpenCloseTransitionStateEffects = {},\n) => {\n const { onOpenAnimationStart, onCloseAnimationComplete } = options;\n\n const getDurationMs = useCallback(() => {\n if (!ref.current || !window) return 0;\n const duration = window.getComputedStyle(ref.current).animationDuration;\n return parseFloat(duration) * 1000;\n }, [ref]);\n\n const handleOpenAnimationStart = useCallback(() => {\n if (!ref.current) return;\n ref.current.showModal();\n onOpenAnimationStart?.();\n }, [ref, onOpenAnimationStart]);\n\n const handleCloseAnimationComplete = useCallback(() => {\n if (!ref.current) return;\n ref.current.close();\n onCloseAnimationComplete?.();\n }, [ref, onCloseAnimationComplete]);\n\n return useOpenCloseTransitionStates(openProp, {\n ...options,\n onOpenAnimationStart: handleOpenAnimationStart,\n onCloseAnimationComplete: handleCloseAnimationComplete,\n durationMs: getDurationMs,\n });\n};\n","import { RefObject, useEffect, useRef, useState } from \"react\";\nimport { FocusableElement, tabbable } from \"tabbable\";\n\n/**\n * Options for the useKeyboardFocusables hook\n */\ntype OptionProps =\n | {\n /**\n * Disable mutation observer\n */\n observeChange: false;\n }\n | {\n /**\n * Enable mutation observer with optional configuration\n */\n observeChange: true;\n /**\n * Observe attribute changes\n */\n attributes?: boolean;\n /**\n * Observe text content changes\n */\n characterData?: boolean;\n /**\n * Observe child element changes\n */\n childList?: boolean;\n /**\n * Observe descendant changes\n */\n subtree?: boolean;\n };\n\n/**\n * Custom hook for tracking keyboard focusable elements within a container.\n *\n * Features:\n * - Tracks all keyboard focusable elements within a target container\n * - Supports both ref objects and direct element references\n * - Optional mutation observer for real-time updates\n * - Debounced updates to prevent excessive re-renders\n * - Configurable mutation observer options\n * - Manual update function for immediate refresh\n * - Uses tabbable library for accurate focusable detection\n * - Automatically cleans up mutation observer\n *\n * @param element - Target element or ref to monitor for focusable elements\n * @param options - Configuration options for mutation observer behavior\n * @returns Object containing current focusable elements and update function\n */\nexport const useKeyboardFocusables = (\n element: RefObject<HTMLElement> | HTMLElement | undefined,\n options: OptionProps = {\n observeChange: true,\n attributes: true,\n characterData: true,\n childList: true,\n subtree: true,\n },\n) => {\n const [focusables, setFocusables] = useState<FocusableElement[] | null>(null);\n const observerRef = useRef<MutationObserver>();\n\n useEffect(() => {\n const target = element instanceof HTMLElement ? element : element?.current;\n if (!target) return;\n if (!options.observeChange && !focusables) {\n setFocusables(tabbable(target as Element));\n return;\n }\n\n const mutationCallback = () => {\n const targetArr = tabbable(target as Element);\n if (targetArr.length === 0) return;\n setFocusables(targetArr);\n };\n\n const observer = new MutationObserver(mutationCallback);\n observerRef.current = observer;\n observer.observe(target, {\n childList: true, // Observe changes to child elements\n subtree: true, // Observe changes to descendants of the target\n attributes: true, // Observe changes to attributes\n characterData: true, // Observe changes to text content\n });\n return () => {\n observer.disconnect();\n };\n }, [element, options, focusables]);\n\n return { focusables };\n};\n","import { useState, useCallback, useRef } from \"react\";\nimport { DrillDownContextProps } from \"./DrillDownContext\";\n\ntype useDrillDownContextStateParams = {\n defaultDrillDownIndex?: number;\n};\n\nexport function useDrillDownContextState({\n defaultDrillDownIndex = 0,\n}: useDrillDownContextStateParams) {\n const [drillDownIndex, setDrillDownIndex] =\n useState<DrillDownContextProps[\"index\"]>(undefined);\n const [registeredIndices, setRegisteredIndices] = useState<\n DrillDownContextProps[\"registeredIndices\"]\n >([]);\n // Track the drilldown path for back navigation\n const drillDownPath = useRef<number[]>([]);\n const [onClose, setOnClose] = useState<(() => void)[]>([]);\n // focus ref for the action that called the Drilldown to open\n const triggerFocusRef = useRef<HTMLElement | null>(null);\n\n const restoreFocus = useCallback(() => {\n requestAnimationFrame(() => {\n triggerFocusRef.current?.focus();\n triggerFocusRef.current = null;\n });\n }, [triggerFocusRef]);\n\n const back = useCallback(() => {\n const newIndex = drillDownPath.current.pop();\n // Return focus to the trigger element if we're closing the Drilldown\n if (newIndex == null && triggerFocusRef.current) {\n setDrillDownIndex(undefined);\n restoreFocus();\n return;\n }\n setDrillDownIndex(newIndex);\n }, [setDrillDownIndex, drillDownPath, restoreFocus]);\n\n const next = useCallback(() => {\n if (drillDownIndex == null) {\n // Set focus ref if the Drilldown is opening for the first time\n triggerFocusRef.current = document.activeElement as HTMLElement;\n drillDownPath.current = [];\n setDrillDownIndex(defaultDrillDownIndex);\n return;\n }\n if (registeredIndices && registeredIndices[drillDownIndex + 1] == null) {\n // Closes the Drilldown if there is no next index\n drillDownPath.current = [];\n setDrillDownIndex(undefined);\n restoreFocus();\n return;\n }\n drillDownPath.current.push(drillDownIndex);\n setDrillDownIndex(drillDownIndex + 1);\n }, [\n drillDownIndex,\n setDrillDownIndex,\n defaultDrillDownIndex,\n drillDownPath,\n registeredIndices,\n restoreFocus,\n ]);\n\n const setIndexWithinBounds = useCallback(\n (index: number | undefined) => {\n // Invalid index, close the Drilldown\n if (\n index == null ||\n index < 0 ||\n (registeredIndices && registeredIndices[index] == null)\n ) {\n setDrillDownIndex(undefined);\n restoreFocus();\n return;\n }\n // Update the drilldown path for back navigation\n if (drillDownIndex === undefined) {\n triggerFocusRef.current = document.activeElement as HTMLElement;\n drillDownPath.current = [];\n } else {\n drillDownPath.current.push(drillDownIndex);\n }\n setDrillDownIndex(index);\n },\n [\n drillDownIndex,\n setDrillDownIndex,\n drillDownPath,\n registeredIndices,\n restoreFocus,\n ],\n );\n\n const setOnCloseForIndex = useCallback(\n (fn: () => void, index: number) => {\n setOnClose((arr) => {\n arr[index] = () => {\n fn();\n setDrillDownIndex(undefined);\n restoreFocus();\n };\n return arr;\n });\n },\n [restoreFocus],\n );\n\n return {\n index: drillDownIndex,\n setIndex: setIndexWithinBounds,\n back,\n next,\n registeredIndices,\n setRegisteredIndices,\n onClose,\n setOnClose: setOnCloseForIndex,\n };\n}\n","import { RefObject, useEffect } from \"react\";\nimport { FocusableElement, tabbable } from \"tabbable\";\n\nexport type InitialFocusOptions = {\n /**\n * Function to pick the initial focus target, given an array of focusable elements\n */\n computeFocus?: (focusables: FocusableElement[]) => FocusableElement;\n};\n\n/**\n * Hook to set initial focus for a dialog (e.g. Dialog, Drawer) when it is opened.\n * @param dialogRef - Ref to the dialog element\n * @param options - Options for the hook\n * @param options.computeFocus - Function to pick the initial focus target, given an array of focusable elements\n */\nexport const useInitialFocus = (\n /**\n * Ref to the dialog element\n */\n dialogRef: RefObject<HTMLDialogElement>,\n { computeFocus }: InitialFocusOptions,\n) => {\n useEffect(() => {\n if (!dialogRef.current) {\n return () => {};\n }\n // Create a MutationObserver to check if dialogRef.current is open or closed\n const observer = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n if (\n mutation.attributeName === \"open\" &&\n mutation.target === dialogRef.current &&\n mutation.target instanceof HTMLDialogElement &&\n mutation.target.open === true\n ) {\n const focusables = tabbable(dialogRef.current);\n const target = computeFocus?.(focusables) || focusables[0];\n target?.focus();\n }\n });\n });\n observer.observe(dialogRef.current, {\n attributes: true,\n attributeFilter: [\"open\"],\n });\n return () => {\n observer.disconnect();\n };\n }, [dialogRef, computeFocus]);\n};\n"],"names":[],"mappings":";;;;AAqCO,MAAM,4BAA4B,CACvC,GAAA,EACA,QAAA,EACA,OAAA,GAA2C,EAAC,KACzC;AACH,EAAA,MAAM,EAAE,oBAAA,EAAsB,wBAAA,EAAyB,GAAI,OAAA;AAE3D,EAAA,MAAM,aAAA,GAAgB,YAAY,MAAM;AACtC,IAAA,IAAI,CAAC,GAAA,CAAI,OAAA,IAAW,CAAC,QAAQ,OAAO,CAAA;AACpC,IAAA,MAAM,QAAA,GAAW,MAAA,CAAO,gBAAA,CAAiB,GAAA,CAAI,OAAO,CAAA,CAAE,iBAAA;AACtD,IAAA,OAAO,UAAA,CAAW,QAAQ,CAAA,GAAI,GAAA;AAAA,E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AAA,EACA,EAAE,cAAa,KACZ;AACH,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,CAAC,UAAU,OAAA,EAAS;AACtB,MAAA,OAAO,MAAM;AAAA,MAAC,CAAA;AAAA,IAChB;AAEA,IAAA,MAAM,QAAA,GAAW,IAAI,gBAAA,CAAiB,CAAC,SAAA,KAAc;AACnD,MAAA,SAAA,CAAU,OAAA,CAAQ,CAAC,QAAA,KAAa;AAC9B,QAAA,IACE,QAAA,CAAS,aAAA,KAAkB,MAAA,IAC3B,QAAA,CAAS,MAAA,KAAW,SAAA,CAAU,OAAA,IAC9B,QAAA,CAAS,MAAA,YAAkB,iBAAA,IAC3B,QAAA,CAAS,MAAA,CAAO,SAAS,IAAA,EACzB;AACA,UAAA,MAAM,UAAA,GAAa,QAAA,CAAS,SAAA,CAAU,OAAO,CAAA;AAC7C,UAAA,MAAM,MAAA,GAAS,YAAA,GAAe,UAAU,CAAA,IAAK,WAAW,CAAC,CAAA;AACzD,UAAA,MAAA,EAAQ,KAAA,EAAM;AAAA,QAChB;AAAA,MACF,CAAC,CAAA;AAAA,IACH,CAAC,CAAA;AACD,IAAA,QAAA,CAAS,OAAA,CAAQ,UAAU,OAAA,EAAS;AAAA,MAClC,UAAA,EAAY,IAAA;AAAA,MACZ,eAAA,EAAiB,CAAC,MAAM;AAAA,KACzB,CAAA;AACD,IAAA,OAAO,MAAM;AACX,MAAA,QAAA,CAAS,UAAA,EAAW;AAAA,IACtB,CAAA;AAAA,EACF,CAAA,EAAG,CAAC,SAAA,EAAW,YAAY,CAAC,CAAA;AAC9B;;;;"}
|
|
1
|
+
{"version":3,"file":"useInitialFocus-BRRbylek.js","sources":["../src/internal/hooks/useDialogTransitionStates/useDialogTransitionStates.ts","../src/internal/hooks/useKeyboardFocusables/useKeyboardFocusables.ts","../src/components/DrillDown/internal/useDrillDownContextState.ts","../src/components/Dialog/internal/useInitialFocus.ts"],"sourcesContent":["import { RefObject, useCallback } from \"react\";\nimport {\n useOpenCloseTransitionStates,\n type OpenCloseTransitionStateEffects,\n} from \"../useOpenCloseTransitionStates\";\n\n/**\n * Effects configuration for dialog transition states\n * @property {() => void} [onOpenAnimationStart] - Callback when opening animation starts\n * @property {() => void} [onCloseAnimationStart] - Callback when closing animation starts\n * @property {() => void} [onOpenAnimationComplete] - Callback when opening animation completes\n * @property {() => void} [onCloseAnimationComplete] - Callback when closing animation completes\n */\n\n/**\n * Custom hook for managing dialog transition states and animations.\n *\n * Features:\n * - Manages dialog open/close transition states\n * - Handles animation timing based on CSS animation duration\n * - Provides callbacks for animation lifecycle events\n * - Supports controlled dialog state management\n * - Automatically handles showModal() and close() calls\n * - Provides utility flags for open/closed states\n *\n * @param ref - The ref to the dialog element\n * @param openProp - The open prop controlling dialog visibility\n * @param options - Additional, optional options including callbacks for animation start, complete, and initialization\n * @returns Object containing dialog state, control functions, and utility flags\n */\n\n/**\n * Effects configuration for dialog transition states\n * @param openProp - The open prop controlling dialog visibility\n * @param options - The effects configuration\n * @returns The dialog transition state\n */\nexport const useDialogTransitionStates = (\n ref: RefObject<HTMLDialogElement>,\n openProp: boolean | undefined,\n options: OpenCloseTransitionStateEffects = {},\n) => {\n const { onOpenAnimationStart, onCloseAnimationComplete } = options;\n\n const getDurationMs = useCallback(() => {\n if (!ref.current || !window) return 0;\n const duration = window.getComputedStyle(ref.current).animationDuration;\n return parseFloat(duration) * 1000;\n }, [ref]);\n\n const handleOpenAnimationStart = useCallback(() => {\n if (!ref.current) return;\n ref.current.showModal();\n onOpenAnimationStart?.();\n }, [ref, onOpenAnimationStart]);\n\n const handleCloseAnimationComplete = useCallback(() => {\n if (!ref.current) return;\n ref.current.close();\n onCloseAnimationComplete?.();\n }, [ref, onCloseAnimationComplete]);\n\n return useOpenCloseTransitionStates(openProp, {\n ...options,\n onOpenAnimationStart: handleOpenAnimationStart,\n onCloseAnimationComplete: handleCloseAnimationComplete,\n durationMs: getDurationMs,\n });\n};\n","import { RefObject, useEffect, useRef, useState } from \"react\";\nimport { FocusableElement, tabbable } from \"tabbable\";\n\n/**\n * Options for the useKeyboardFocusables hook\n */\ntype OptionProps =\n | {\n /**\n * Disable mutation observer\n */\n observeChange: false;\n }\n | {\n /**\n * Enable mutation observer with optional configuration\n */\n observeChange: true;\n /**\n * Observe attribute changes\n */\n attributes?: boolean;\n /**\n * Observe text content changes\n */\n characterData?: boolean;\n /**\n * Observe child element changes\n */\n childList?: boolean;\n /**\n * Observe descendant changes\n */\n subtree?: boolean;\n };\n\n/**\n * Custom hook for tracking keyboard focusable elements within a container.\n *\n * Features:\n * - Tracks all keyboard focusable elements within a target container\n * - Supports both ref objects and direct element references\n * - Optional mutation observer for real-time updates\n * - Debounced updates to prevent excessive re-renders\n * - Configurable mutation observer options\n * - Manual update function for immediate refresh\n * - Uses tabbable library for accurate focusable detection\n * - Automatically cleans up mutation observer\n *\n * @param element - Target element or ref to monitor for focusable elements\n * @param options - Configuration options for mutation observer behavior\n * @returns Object containing current focusable elements and update function\n */\nexport const useKeyboardFocusables = (\n element: RefObject<HTMLElement> | HTMLElement | undefined,\n options: OptionProps = {\n observeChange: true,\n attributes: true,\n characterData: true,\n childList: true,\n subtree: true,\n },\n) => {\n const [focusables, setFocusables] = useState<FocusableElement[] | null>(null);\n const observerRef = useRef<MutationObserver>();\n\n useEffect(() => {\n const target = element instanceof HTMLElement ? element : element?.current;\n if (!target) return;\n if (!options.observeChange && !focusables) {\n setFocusables(tabbable(target as Element));\n return;\n }\n\n const mutationCallback = () => {\n const targetArr = tabbable(target as Element);\n if (targetArr.length === 0) return;\n setFocusables(targetArr);\n };\n\n const observer = new MutationObserver(mutationCallback);\n observerRef.current = observer;\n observer.observe(target, {\n childList: true, // Observe changes to child elements\n subtree: true, // Observe changes to descendants of the target\n attributes: true, // Observe changes to attributes\n characterData: true, // Observe changes to text content\n });\n return () => {\n observer.disconnect();\n };\n }, [element, options, focusables]);\n\n return { focusables };\n};\n","import { useState, useCallback, useRef } from \"react\";\nimport { DrillDownContextProps } from \"./DrillDownContext\";\n\ntype useDrillDownContextStateParams = {\n defaultDrillDownIndex?: number;\n};\n\nexport function useDrillDownContextState({\n defaultDrillDownIndex = 0,\n}: useDrillDownContextStateParams) {\n const [drillDownIndex, setDrillDownIndex] =\n useState<DrillDownContextProps[\"index\"]>(undefined);\n const [registeredIndices, setRegisteredIndices] = useState<\n DrillDownContextProps[\"registeredIndices\"]\n >([]);\n // Track the drilldown path for back navigation\n const drillDownPath = useRef<number[]>([]);\n const [onClose, setOnClose] = useState<(() => void)[]>([]);\n // focus ref for the action that called the Drilldown to open\n const triggerFocusRef = useRef<HTMLElement | null>(null);\n\n const restoreFocus = useCallback(() => {\n requestAnimationFrame(() => {\n triggerFocusRef.current?.focus();\n triggerFocusRef.current = null;\n });\n }, [triggerFocusRef]);\n\n const back = useCallback(() => {\n const newIndex = drillDownPath.current.pop();\n // Return focus to the trigger element if we're closing the Drilldown\n if (newIndex == null && triggerFocusRef.current) {\n setDrillDownIndex(undefined);\n restoreFocus();\n return;\n }\n setDrillDownIndex(newIndex);\n }, [setDrillDownIndex, drillDownPath, restoreFocus]);\n\n const next = useCallback(() => {\n if (drillDownIndex == null) {\n // Set focus ref if the Drilldown is opening for the first time\n triggerFocusRef.current = document.activeElement as HTMLElement;\n drillDownPath.current = [];\n setDrillDownIndex(defaultDrillDownIndex);\n return;\n }\n if (registeredIndices && registeredIndices[drillDownIndex + 1] == null) {\n // Closes the Drilldown if there is no next index\n drillDownPath.current = [];\n setDrillDownIndex(undefined);\n restoreFocus();\n return;\n }\n drillDownPath.current.push(drillDownIndex);\n setDrillDownIndex(drillDownIndex + 1);\n }, [\n drillDownIndex,\n setDrillDownIndex,\n defaultDrillDownIndex,\n drillDownPath,\n registeredIndices,\n restoreFocus,\n ]);\n\n const setIndexWithinBounds = useCallback(\n (index: number | undefined) => {\n // Invalid index, close the Drilldown\n if (\n index == null ||\n index < 0 ||\n (registeredIndices && registeredIndices[index] == null)\n ) {\n setDrillDownIndex(undefined);\n restoreFocus();\n return;\n }\n // Update the drilldown path for back navigation\n if (drillDownIndex === undefined) {\n triggerFocusRef.current = document.activeElement as HTMLElement;\n drillDownPath.current = [];\n } else {\n drillDownPath.current.push(drillDownIndex);\n }\n setDrillDownIndex(index);\n },\n [\n drillDownIndex,\n setDrillDownIndex,\n drillDownPath,\n registeredIndices,\n restoreFocus,\n ],\n );\n\n const setOnCloseForIndex = useCallback(\n (fn: () => void, index: number) => {\n setOnClose((arr) => {\n arr[index] = () => {\n fn();\n setDrillDownIndex(undefined);\n restoreFocus();\n };\n return arr;\n });\n },\n [restoreFocus],\n );\n\n return {\n index: drillDownIndex,\n setIndex: setIndexWithinBounds,\n back,\n next,\n registeredIndices,\n setRegisteredIndices,\n onClose,\n setOnClose: setOnCloseForIndex,\n };\n}\n","import { RefObject, useEffect } from \"react\";\nimport { FocusableElement, tabbable } from \"tabbable\";\n\nexport type InitialFocusOptions = {\n /**\n * Function to pick the initial focus target, given an array of focusable elements\n */\n computeFocus?: (focusables: FocusableElement[]) => FocusableElement;\n};\n\n/**\n * Hook to set initial focus for a dialog (e.g. Dialog, Drawer) when it is opened.\n * @param dialogRef - Ref to the dialog element\n * @param options - Options for the hook\n * @param options.computeFocus - Function to pick the initial focus target, given an array of focusable elements\n */\nexport const useInitialFocus = (\n /**\n * Ref to the dialog element\n */\n dialogRef: RefObject<HTMLDialogElement>,\n { computeFocus }: InitialFocusOptions,\n) => {\n useEffect(() => {\n if (!dialogRef.current) {\n return () => {};\n }\n // Create a MutationObserver to check if dialogRef.current is open or closed\n const observer = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n if (\n mutation.attributeName === \"open\" &&\n mutation.target === dialogRef.current &&\n mutation.target instanceof HTMLDialogElement &&\n mutation.target.open === true\n ) {\n const focusables = tabbable(dialogRef.current);\n const target = computeFocus?.(focusables) || focusables[0];\n target?.focus();\n }\n });\n });\n observer.observe(dialogRef.current, {\n attributes: true,\n attributeFilter: [\"open\"],\n });\n return () => {\n observer.disconnect();\n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AA,EAAY,IAAA;AAAA,MACZ,eAAA,EAAiB,CAAC,MAAM;AAAA,KACzB,CAAA;AACD,IAAA,OAAO,MAAM;AACX,MAAA,QAAA,CAAS,UAAA,EAAW;AAAA,IACtB,CAAA;AAAA,EACF,CAAA,EAAG,CAAC,SAAA,EAAW,YAAY,CAAC,CAAA;AAC9B;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/anvil2",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"tabbable": "^6.2.0",
|
|
60
60
|
"tinycolor2": "^1.6.0",
|
|
61
61
|
"uuid": "^10.0.0",
|
|
62
|
-
"@servicetitan/hammer-
|
|
63
|
-
"@servicetitan/hammer-
|
|
62
|
+
"@servicetitan/hammer-token": "2.5.1",
|
|
63
|
+
"@servicetitan/hammer-icon": "1.2.0"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"@types/react": "^18 || ^19",
|