@vuu-ui/vuu-utils 2.0.0 → 2.1.0-alpha.10
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/cjs/node_modules/@dnd-kit/react/hooks.js +3 -3
- package/cjs/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +492 -0
- package/cjs/node_modules/@floating-ui/dom/dist/floating-ui.dom.js.map +1 -0
- package/cjs/node_modules/@floating-ui/react/dist/floating-ui.react.js +987 -0
- package/cjs/node_modules/@floating-ui/react/dist/floating-ui.react.js.map +1 -0
- package/cjs/node_modules/@floating-ui/react/dist/floating-ui.react.utils.js +130 -0
- package/cjs/node_modules/@floating-ui/react/dist/floating-ui.react.utils.js.map +1 -0
- package/cjs/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +183 -0
- package/cjs/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +1 -0
- package/cjs/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +39 -0
- package/cjs/node_modules/@floating-ui/utils/dist/floating-ui.utils.js.map +1 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/aria-announcer/AriaAnnouncerContext.js +10 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/aria-announcer/AriaAnnouncerContext.js.map +1 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/aria-announcer/AriaAnnouncerProvider.js +76 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/aria-announcer/AriaAnnouncerProvider.js.map +1 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/aria-announcer/useAriaAnnouncer.js +52 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/aria-announcer/useAriaAnnouncer.js.map +1 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/breakpoints/BreakpointProvider.js +59 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/breakpoints/BreakpointProvider.js.map +1 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/breakpoints/Breakpoints.js +12 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/breakpoints/Breakpoints.js.map +1 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/button/Button.css.js +6 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/button/Button.css.js.map +1 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/button/Button.js +96 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/button/Button.js.map +1 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/button/useButton.js +65 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/button/useButton.js.map +1 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/salt-provider/ProviderContext.js +11 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/salt-provider/ProviderContext.js.map +1 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/salt-provider/SaltProvider.css.js +6 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/salt-provider/SaltProvider.css.js.map +1 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/salt-provider/SaltProvider.js +160 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/salt-provider/SaltProvider.js.map +1 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/salt-provider/ThemeApplicator.js +115 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/salt-provider/ThemeApplicator.js.map +1 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/spinner/Spinner.css.js +6 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/spinner/Spinner.css.js.map +1 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/spinner/Spinner.js +86 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/spinner/Spinner.js.map +1 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/spinner/svgSpinners/SpinnerSVG.js +93 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/spinner/svgSpinners/SpinnerSVG.js.map +1 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/utils/createChainedFunction.js +20 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/utils/createChainedFunction.js.map +1 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/utils/createContext.js +14 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/utils/createContext.js.map +1 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/utils/debounce.js +22 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/utils/debounce.js.map +1 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/utils/makePrefixer.js +6 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/utils/makePrefixer.js.map +1 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/utils/useFloatingUI/useFloatingUI.js +52 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/utils/useFloatingUI/useFloatingUI.js.map +1 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/utils/useId.js +45 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/utils/useId.js.map +1 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/utils/useIsomorphicLayoutEffect.js +8 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/utils/useIsomorphicLayoutEffect.js.map +1 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/utils/usePreventScroll.js +233 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/utils/usePreventScroll.js.map +1 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/viewport/ViewportProvider.js +35 -0
- package/cjs/node_modules/@salt-ds/core/dist-es/viewport/ViewportProvider.js.map +1 -0
- package/cjs/node_modules/@salt-ds/styles/dist-es/style-injection-provider/index.js +22 -0
- package/cjs/node_modules/@salt-ds/styles/dist-es/style-injection-provider/index.js.map +1 -0
- package/cjs/node_modules/@salt-ds/styles/dist-es/use-style-injection/InsertionPointProvider.js +16 -0
- package/cjs/node_modules/@salt-ds/styles/dist-es/use-style-injection/InsertionPointProvider.js.map +1 -0
- package/cjs/node_modules/@salt-ds/styles/dist-es/use-style-injection/useStyleInjection.js +75 -0
- package/cjs/node_modules/@salt-ds/styles/dist-es/use-style-injection/useStyleInjection.js.map +1 -0
- package/cjs/node_modules/@salt-ds/window/dist-es/WindowProvider.js +17 -0
- package/cjs/node_modules/@salt-ds/window/dist-es/WindowProvider.js.map +1 -0
- package/cjs/node_modules/tabbable/dist/index.esm.js +550 -0
- package/cjs/node_modules/tabbable/dist/index.esm.js.map +1 -0
- package/cjs/packages/vuu-utils/src/ThemeProvider.js +2 -2
- package/cjs/packages/vuu-utils/src/ThemeProvider.js.map +1 -1
- package/cjs/packages/vuu-utils/src/data-editing/DataEditingProvider.js +25 -0
- package/cjs/packages/vuu-utils/src/data-editing/DataEditingProvider.js.map +1 -0
- package/cjs/packages/vuu-utils/src/data-editing/EditButtons.js +31 -0
- package/cjs/packages/vuu-utils/src/data-editing/EditButtons.js.map +1 -0
- package/cjs/packages/vuu-utils/src/data-editing/EditTracker.js +157 -0
- package/cjs/packages/vuu-utils/src/data-editing/EditTracker.js.map +1 -0
- package/cjs/packages/vuu-utils/src/data-editing/useEditableTable.js +65 -0
- package/cjs/packages/vuu-utils/src/data-editing/useEditableTable.js.map +1 -0
- package/cjs/packages/vuu-utils/src/index.js +11 -0
- package/cjs/packages/vuu-utils/src/index.js.map +1 -1
- package/cjs/packages/vuu-utils/src/theme-utils.js +36 -0
- package/cjs/packages/vuu-utils/src/theme-utils.js.map +1 -0
- package/cjs/packages/vuu-utils/src/url-utils.js +2 -2
- package/cjs/packages/vuu-utils/src/url-utils.js.map +1 -1
- package/esm/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +489 -0
- package/esm/node_modules/@floating-ui/dom/dist/floating-ui.dom.js.map +1 -0
- package/esm/node_modules/@floating-ui/react/dist/floating-ui.react.js +962 -0
- package/esm/node_modules/@floating-ui/react/dist/floating-ui.react.js.map +1 -0
- package/esm/node_modules/@floating-ui/react/dist/floating-ui.react.utils.js +114 -0
- package/esm/node_modules/@floating-ui/react/dist/floating-ui.react.utils.js.map +1 -0
- package/esm/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +162 -0
- package/esm/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +1 -0
- package/esm/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +33 -0
- package/esm/node_modules/@floating-ui/utils/dist/floating-ui.utils.js.map +1 -0
- package/esm/node_modules/@salt-ds/core/dist-es/aria-announcer/AriaAnnouncerContext.js +8 -0
- package/esm/node_modules/@salt-ds/core/dist-es/aria-announcer/AriaAnnouncerContext.js.map +1 -0
- package/esm/node_modules/@salt-ds/core/dist-es/aria-announcer/AriaAnnouncerProvider.js +73 -0
- package/esm/node_modules/@salt-ds/core/dist-es/aria-announcer/AriaAnnouncerProvider.js.map +1 -0
- package/esm/node_modules/@salt-ds/core/dist-es/aria-announcer/useAriaAnnouncer.js +50 -0
- package/esm/node_modules/@salt-ds/core/dist-es/aria-announcer/useAriaAnnouncer.js.map +1 -0
- package/esm/node_modules/@salt-ds/core/dist-es/breakpoints/BreakpointProvider.js +56 -0
- package/esm/node_modules/@salt-ds/core/dist-es/breakpoints/BreakpointProvider.js.map +1 -0
- package/esm/node_modules/@salt-ds/core/dist-es/breakpoints/Breakpoints.js +10 -0
- package/esm/node_modules/@salt-ds/core/dist-es/breakpoints/Breakpoints.js.map +1 -0
- package/esm/node_modules/@salt-ds/core/dist-es/button/Button.css.js +4 -0
- package/esm/node_modules/@salt-ds/core/dist-es/button/Button.css.js.map +1 -0
- package/esm/node_modules/@salt-ds/core/dist-es/button/Button.js +94 -0
- package/esm/node_modules/@salt-ds/core/dist-es/button/Button.js.map +1 -0
- package/esm/node_modules/@salt-ds/core/dist-es/button/useButton.js +63 -0
- package/esm/node_modules/@salt-ds/core/dist-es/button/useButton.js.map +1 -0
- package/esm/node_modules/@salt-ds/core/dist-es/salt-provider/ProviderContext.js +9 -0
- package/esm/node_modules/@salt-ds/core/dist-es/salt-provider/ProviderContext.js.map +1 -0
- package/esm/node_modules/@salt-ds/core/dist-es/salt-provider/SaltProvider.css.js +4 -0
- package/esm/node_modules/@salt-ds/core/dist-es/salt-provider/SaltProvider.css.js.map +1 -0
- package/esm/node_modules/@salt-ds/core/dist-es/salt-provider/SaltProvider.js +151 -0
- package/esm/node_modules/@salt-ds/core/dist-es/salt-provider/SaltProvider.js.map +1 -0
- package/esm/node_modules/@salt-ds/core/dist-es/salt-provider/ThemeApplicator.js +113 -0
- package/esm/node_modules/@salt-ds/core/dist-es/salt-provider/ThemeApplicator.js.map +1 -0
- package/esm/node_modules/@salt-ds/core/dist-es/spinner/Spinner.css.js +4 -0
- package/esm/node_modules/@salt-ds/core/dist-es/spinner/Spinner.css.js.map +1 -0
- package/esm/node_modules/@salt-ds/core/dist-es/spinner/Spinner.js +84 -0
- package/esm/node_modules/@salt-ds/core/dist-es/spinner/Spinner.js.map +1 -0
- package/esm/node_modules/@salt-ds/core/dist-es/spinner/svgSpinners/SpinnerSVG.js +91 -0
- package/esm/node_modules/@salt-ds/core/dist-es/spinner/svgSpinners/SpinnerSVG.js.map +1 -0
- package/esm/node_modules/@salt-ds/core/dist-es/utils/createChainedFunction.js +18 -0
- package/esm/node_modules/@salt-ds/core/dist-es/utils/createChainedFunction.js.map +1 -0
- package/esm/node_modules/@salt-ds/core/dist-es/utils/createContext.js +12 -0
- package/esm/node_modules/@salt-ds/core/dist-es/utils/createContext.js.map +1 -0
- package/esm/node_modules/@salt-ds/core/dist-es/utils/debounce.js +20 -0
- package/esm/node_modules/@salt-ds/core/dist-es/utils/debounce.js.map +1 -0
- package/esm/node_modules/@salt-ds/core/dist-es/utils/makePrefixer.js +4 -0
- package/esm/node_modules/@salt-ds/core/dist-es/utils/makePrefixer.js.map +1 -0
- package/esm/node_modules/@salt-ds/core/dist-es/utils/useFloatingUI/useFloatingUI.js +50 -0
- package/esm/node_modules/@salt-ds/core/dist-es/utils/useFloatingUI/useFloatingUI.js.map +1 -0
- package/esm/node_modules/@salt-ds/core/dist-es/utils/useId.js +24 -0
- package/esm/node_modules/@salt-ds/core/dist-es/utils/useId.js.map +1 -0
- package/esm/node_modules/@salt-ds/core/dist-es/utils/useIsomorphicLayoutEffect.js +6 -0
- package/esm/node_modules/@salt-ds/core/dist-es/utils/useIsomorphicLayoutEffect.js.map +1 -0
- package/esm/node_modules/@salt-ds/core/dist-es/utils/usePreventScroll.js +231 -0
- package/esm/node_modules/@salt-ds/core/dist-es/utils/usePreventScroll.js.map +1 -0
- package/esm/node_modules/@salt-ds/core/dist-es/viewport/ViewportProvider.js +32 -0
- package/esm/node_modules/@salt-ds/core/dist-es/viewport/ViewportProvider.js.map +1 -0
- package/esm/node_modules/@salt-ds/styles/dist-es/style-injection-provider/index.js +19 -0
- package/esm/node_modules/@salt-ds/styles/dist-es/style-injection-provider/index.js.map +1 -0
- package/esm/node_modules/@salt-ds/styles/dist-es/use-style-injection/InsertionPointProvider.js +14 -0
- package/esm/node_modules/@salt-ds/styles/dist-es/use-style-injection/InsertionPointProvider.js.map +1 -0
- package/esm/node_modules/@salt-ds/styles/dist-es/use-style-injection/useStyleInjection.js +54 -0
- package/esm/node_modules/@salt-ds/styles/dist-es/use-style-injection/useStyleInjection.js.map +1 -0
- package/esm/node_modules/@salt-ds/window/dist-es/WindowProvider.js +15 -0
- package/esm/node_modules/@salt-ds/window/dist-es/WindowProvider.js.map +1 -0
- package/esm/node_modules/tabbable/dist/index.esm.js +546 -0
- package/esm/node_modules/tabbable/dist/index.esm.js.map +1 -0
- package/esm/packages/vuu-utils/src/ThemeProvider.js +2 -2
- package/esm/packages/vuu-utils/src/ThemeProvider.js.map +1 -1
- package/esm/packages/vuu-utils/src/context-definitions/WorkspaceContext.js +2 -2
- package/esm/packages/vuu-utils/src/context-definitions/WorkspaceContext.js.map +1 -1
- package/esm/packages/vuu-utils/src/data-editing/DataEditingProvider.js +22 -0
- package/esm/packages/vuu-utils/src/data-editing/DataEditingProvider.js.map +1 -0
- package/esm/packages/vuu-utils/src/data-editing/EditButtons.js +29 -0
- package/esm/packages/vuu-utils/src/data-editing/EditButtons.js.map +1 -0
- package/esm/packages/vuu-utils/src/data-editing/EditTracker.js +155 -0
- package/esm/packages/vuu-utils/src/data-editing/EditTracker.js.map +1 -0
- package/esm/packages/vuu-utils/src/data-editing/useEditableTable.js +63 -0
- package/esm/packages/vuu-utils/src/data-editing/useEditableTable.js.map +1 -0
- package/esm/packages/vuu-utils/src/feature-utils.js +2 -2
- package/esm/packages/vuu-utils/src/feature-utils.js.map +1 -1
- package/esm/packages/vuu-utils/src/index.js +5 -0
- package/esm/packages/vuu-utils/src/index.js.map +1 -1
- package/esm/packages/vuu-utils/src/theme-utils.js +34 -0
- package/esm/packages/vuu-utils/src/theme-utils.js.map +1 -0
- package/esm/packages/vuu-utils/src/url-utils.js +2 -2
- package/esm/packages/vuu-utils/src/url-utils.js.map +1 -1
- package/package.json +6 -6
- package/types/data-editing/DataEditingProvider.d.ts +7 -0
- package/types/data-editing/EditButtons.d.ts +7 -0
- package/types/data-editing/EditModeProvider.d.ts +13 -0
- package/types/data-editing/EditTracker.d.ts +24 -0
- package/types/data-editing/useEditableTable.d.ts +26 -0
- package/types/index.d.ts +6 -1
- package/types/theme-utils.d.ts +14 -0
- package/types/url-utils.d.ts +2 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemeApplicator.js","sources":["../../../../../../../../node_modules/@salt-ds/core/dist-es/salt-provider/ThemeApplicator.js"],"sourcesContent":["import { jsx } from 'react/jsx-runtime';\nimport { useWindow } from '@salt-ds/window';\nimport { clsx } from 'clsx';\nimport { isValidElement, cloneElement } from 'react';\nimport { useId } from '../utils/useId.js';\nimport { useIsomorphicLayoutEffect } from '../utils/useIsomorphicLayoutEffect.js';\n\nconst providerSymbol = Symbol.for(\"salt-provider\");\nfunction ThemeApplicator({\n applyClassesTo,\n children,\n density,\n mode,\n theme,\n corner,\n headingFont,\n accent,\n actionFont\n}) {\n var _a;\n const targetWindow = useWindow();\n const providerId = useId();\n useIsomorphicLayoutEffect(() => {\n if (applyClassesTo !== \"root\" || !targetWindow || !providerId) return;\n const targetDocument = targetWindow.document;\n if (!targetDocument[providerSymbol]) {\n targetDocument[providerSymbol] = providerId;\n }\n if (providerId !== targetDocument[providerSymbol]) {\n console.warn(\n \"Multiple providers targeting the same window. There can be only one level root level SaltProvider per window.\"\n );\n return;\n }\n const themeNames = theme.split(\" \");\n targetDocument.documentElement.classList.add(\n ...themeNames,\n `salt-density-${density}`\n );\n targetDocument.documentElement.dataset.mode = mode;\n if (corner) targetDocument.documentElement.dataset.corner = corner;\n if (headingFont)\n targetDocument.documentElement.dataset.headingFont = headingFont;\n if (accent) targetDocument.documentElement.dataset.accent = accent;\n if (actionFont)\n targetDocument.documentElement.dataset.actionFont = actionFont;\n return () => {\n delete targetDocument[providerSymbol];\n targetDocument.documentElement.classList.remove(\n ...themeNames,\n `salt-density-${density}`\n );\n targetDocument.documentElement.dataset.mode = void 0;\n delete targetDocument.documentElement.dataset.corner;\n delete targetDocument.documentElement.dataset.headingFont;\n delete targetDocument.documentElement.dataset.accent;\n delete targetDocument.documentElement.dataset.actionFont;\n };\n }, [\n providerId,\n applyClassesTo,\n density,\n mode,\n theme,\n targetWindow,\n corner,\n headingFont,\n accent,\n actionFont\n ]);\n const themeNextProps = {\n \"data-corner\": corner,\n \"data-heading-font\": headingFont,\n \"data-accent\": accent,\n \"data-action-font\": actionFont\n };\n if (applyClassesTo === \"child\") {\n if (isValidElement(children)) {\n return cloneElement(children, {\n className: clsx(\n (_a = children.props) == null ? void 0 : _a.className,\n theme,\n `salt-density-${density}`\n ),\n // @ts-expect-error\n \"data-mode\": mode,\n ...themeNextProps\n });\n }\n console.warn(\n `\nSaltProvider can only apply CSS classes for theming to a single nested child element of the SaltProvider.\n Either wrap elements with a single container or consider removing the applyClassesToChild prop, in which case a\n div element will wrap your child elements`\n );\n return children;\n }\n if (applyClassesTo === \"scope\") {\n return /* @__PURE__ */ jsx(\n \"div\",\n {\n className: clsx(\"salt-provider\", theme, `salt-density-${density}`),\n \"data-mode\": mode,\n ...themeNextProps,\n children\n }\n );\n }\n return children;\n}\n\nexport { ThemeApplicator };\n//# sourceMappingURL=ThemeApplicator.js.map\n"],"names":["useWindow","useId","useIsomorphicLayoutEffect","isValidElement","cloneElement","clsx","jsx"],"mappings":";;;;;;;;;AAOA,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC;AAClD,SAAS,eAAe,CAAC;AACzB,EAAE,cAAc;AAChB,EAAE,QAAQ;AACV,EAAE,OAAO;AACT,EAAE,IAAI;AACN,EAAE,KAAK;AACP,EAAE,MAAM;AACR,EAAE,WAAW;AACb,EAAE,MAAM;AACR,EAAE;AACF,CAAC,EAAE;AACH,EAAE,IAAI,EAAE;AACR,EAAE,MAAM,YAAY,GAAGA,wBAAS,EAAE;AAClC,EAAE,MAAM,UAAU,GAAGC,WAAK,EAAE;AAC5B,EAAEC,mDAAyB,CAAC,MAAM;AAClC,IAAI,IAAI,cAAc,KAAK,MAAM,IAAI,CAAC,YAAY,IAAI,CAAC,UAAU,EAAE;AACnE,IAAI,MAAM,cAAc,GAAG,YAAY,CAAC,QAAQ;AAChD,IAAI,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE;AACzC,MAAM,cAAc,CAAC,cAAc,CAAC,GAAG,UAAU;AACjD;AACA,IAAI,IAAI,UAAU,KAAK,cAAc,CAAC,cAAc,CAAC,EAAE;AACvD,MAAM,OAAO,CAAC,IAAI;AAClB,QAAQ;AACR,OAAO;AACP,MAAM;AACN;AACA,IAAI,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;AACvC,IAAI,cAAc,CAAC,eAAe,CAAC,SAAS,CAAC,GAAG;AAChD,MAAM,GAAG,UAAU;AACnB,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC;AAC9B,KAAK;AACL,IAAI,cAAc,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI;AACtD,IAAI,IAAI,MAAM,EAAE,cAAc,CAAC,eAAe,CAAC,OAAO,CAAC,MAAM,GAAG,MAAM;AACtE,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CAAC,EAAE;AAClC,MAAM,OAAOC,kBAAY,CAAC,QAAQ,EAAE;AACpC,QAAQ,SAAS,EAAEC,SAAI;AACvB,UAAU,CAAC,EAAE,GAAG,QAAQ,CAAC,KAAK,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS;AAC/D,UAAU,KAAK;AACf,UAAU,CAAC,aAAa,EAAE,OAAO,CAAC;AAClC,SAAS;AACT;AACA,QAAQ,WAAW,EAAE,IAAI;AACzB,QAAQ,GAAG;AACX,OAAO,CAAC;AACR;AACA,IAAI,OAAO,CAAC,IAAI;AAChB,MAAM;AACN;AACA;AACA,iDAAiD;AACjD,KAAK;AACL,IAAI,OAAO,QAAQ;AACnB;AACA,EAAE,IAAI,cAAc,KAAK,OAAO,EAAE;AAClC,IAAI,uBAAuBC,cAAG;AAC9B,MAAM,KAAK;AACX,MAAM;AACN,QAAQ,SAAS,EAAED,SAAI,CAAC,eAAe,EAAE,KAAK,EAAE,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC;AAC1E,QAAQ,WAAW,EAAE,IAAI;AACzB,QAAQ,GAAG,cAAc;AACzB,QAAQ;AACR;AACA,KAAK;AACL;AACA,EAAE,OAAO,QAAQ;AACjB;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var css_248z = "/* Styles applied to the root element */\n.saltSpinner {\n position: relative;\n}\n\n/* Styles applied to the SVG stop elements */\n.saltSpinner-gradientStop {\n stop-color: var(--saltSpinner-gradient-color, var(--salt-accent-background));\n}\n\n/* Styles applied when `size=\"medium\"` */\n.saltSpinner-medium {\n --spinner-strokeWidth: var(--salt-size-bar);\n height: var(--salt-size-base);\n width: var(--salt-size-base);\n}\n\n/* Styles applied when `size=\"large\"` */\n.saltSpinner-large {\n --spinner-strokeWidth: var(--salt-size-bar);\n height: calc(var(--salt-size-base) * 2);\n width: calc(var(--salt-size-base) * 2);\n}\n\n/* Styles applied when `size=\"small\"` */\n.saltSpinner-small {\n --spinner-strokeWidth: var(--salt-size-fixed-200);\n height: var(--salt-size-icon);\n width: var(--salt-size-icon);\n}\n\n/* Styles applied to the SVG */\n.saltSpinner-spinner {\n animation: spinner 0.9s linear infinite;\n width: 100%;\n height: 100%;\n position: absolute;\n left: 0;\n top: 0;\n}\n\n@keyframes spinner {\n 0% {\n transform: rotate(0);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n";
|
|
4
|
+
|
|
5
|
+
module.exports = css_248z;
|
|
6
|
+
//# sourceMappingURL=Spinner.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Spinner.css.js","sources":["../../../../../../../../node_modules/@salt-ds/core/dist-es/spinner/Spinner.css.js"],"sourcesContent":["var css_248z = \"/* Styles applied to the root element */\\n.saltSpinner {\\n position: relative;\\n}\\n\\n/* Styles applied to the SVG stop elements */\\n.saltSpinner-gradientStop {\\n stop-color: var(--saltSpinner-gradient-color, var(--salt-accent-background));\\n}\\n\\n/* Styles applied when `size=\\\"medium\\\"` */\\n.saltSpinner-medium {\\n --spinner-strokeWidth: var(--salt-size-bar);\\n height: var(--salt-size-base);\\n width: var(--salt-size-base);\\n}\\n\\n/* Styles applied when `size=\\\"large\\\"` */\\n.saltSpinner-large {\\n --spinner-strokeWidth: var(--salt-size-bar);\\n height: calc(var(--salt-size-base) * 2);\\n width: calc(var(--salt-size-base) * 2);\\n}\\n\\n/* Styles applied when `size=\\\"small\\\"` */\\n.saltSpinner-small {\\n --spinner-strokeWidth: var(--salt-size-fixed-200);\\n height: var(--salt-size-icon);\\n width: var(--salt-size-icon);\\n}\\n\\n/* Styles applied to the SVG */\\n.saltSpinner-spinner {\\n animation: spinner 0.9s linear infinite;\\n width: 100%;\\n height: 100%;\\n position: absolute;\\n left: 0;\\n top: 0;\\n}\\n\\n@keyframes spinner {\\n 0% {\\n transform: rotate(0);\\n }\\n 100% {\\n transform: rotate(360deg);\\n }\\n}\\n\";\n\nexport { css_248z as default };\n//# sourceMappingURL=Spinner.css.js.map\n"],"names":[],"mappings":";;AAAG,IAAC,QAAQ,GAAG;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var clsx = require('clsx');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var useAriaAnnouncer = require('../aria-announcer/useAriaAnnouncer.js');
|
|
7
|
+
require('../aria-announcer/AriaAnnouncerContext.js');
|
|
8
|
+
var SaltProvider = require('../salt-provider/SaltProvider.js');
|
|
9
|
+
var makePrefixer = require('../utils/makePrefixer.js');
|
|
10
|
+
require('../utils/useFloatingUI/useFloatingUI.js');
|
|
11
|
+
var useId = require('../utils/useId.js');
|
|
12
|
+
require('../viewport/ViewportProvider.js');
|
|
13
|
+
var Spinner_css = require('./Spinner.css.js');
|
|
14
|
+
var SpinnerSVG = require('./svgSpinners/SpinnerSVG.js');
|
|
15
|
+
var WindowProvider = require('../../../window/dist-es/WindowProvider.js');
|
|
16
|
+
var useStyleInjection = require('../../../styles/dist-es/use-style-injection/useStyleInjection.js');
|
|
17
|
+
|
|
18
|
+
const handleSize = (size) => size === "default" ? "medium" : size;
|
|
19
|
+
const withBaseName = makePrefixer.makePrefixer("saltSpinner");
|
|
20
|
+
const Spinner = React.forwardRef(
|
|
21
|
+
function Spinner2({
|
|
22
|
+
"aria-label": ariaLabel = "loading",
|
|
23
|
+
announcerInterval = 5e3,
|
|
24
|
+
announcerTimeout = 2e4,
|
|
25
|
+
completionAnnouncement = `finished ${ariaLabel}`,
|
|
26
|
+
disableAnnouncer,
|
|
27
|
+
className,
|
|
28
|
+
size = "medium",
|
|
29
|
+
id: idProp,
|
|
30
|
+
...rest
|
|
31
|
+
}, ref) {
|
|
32
|
+
const id = useId.useId(idProp);
|
|
33
|
+
const targetWindow = WindowProvider.useWindow();
|
|
34
|
+
useStyleInjection.useComponentCssInjection({
|
|
35
|
+
testId: "salt-spinner",
|
|
36
|
+
css: Spinner_css,
|
|
37
|
+
window: targetWindow
|
|
38
|
+
});
|
|
39
|
+
const { announce } = useAriaAnnouncer.useAriaAnnouncer();
|
|
40
|
+
const density = SaltProvider.useDensity();
|
|
41
|
+
size = handleSize(size);
|
|
42
|
+
React.useEffect(() => {
|
|
43
|
+
if (disableAnnouncer) return;
|
|
44
|
+
announce(ariaLabel);
|
|
45
|
+
const startTime = Date.now();
|
|
46
|
+
const interval = announcerInterval > 0 && setInterval(() => {
|
|
47
|
+
if (Date.now() - startTime > announcerTimeout) {
|
|
48
|
+
announce(
|
|
49
|
+
`${ariaLabel} is still in progress, but will no longer announce.`
|
|
50
|
+
);
|
|
51
|
+
interval && clearInterval(interval);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
announce(ariaLabel);
|
|
55
|
+
}, announcerInterval);
|
|
56
|
+
return () => {
|
|
57
|
+
if (disableAnnouncer) return;
|
|
58
|
+
interval && clearInterval(interval);
|
|
59
|
+
if (completionAnnouncement) {
|
|
60
|
+
announce(completionAnnouncement);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}, [
|
|
64
|
+
announce,
|
|
65
|
+
announcerInterval,
|
|
66
|
+
announcerTimeout,
|
|
67
|
+
ariaLabel,
|
|
68
|
+
completionAnnouncement,
|
|
69
|
+
disableAnnouncer
|
|
70
|
+
]);
|
|
71
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
72
|
+
"div",
|
|
73
|
+
{
|
|
74
|
+
"aria-label": ariaLabel,
|
|
75
|
+
className: clsx.clsx(withBaseName(), withBaseName(size), className),
|
|
76
|
+
ref,
|
|
77
|
+
role: "img",
|
|
78
|
+
...rest,
|
|
79
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(SpinnerSVG.SpinnerSVG, { size, density, id })
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
exports.Spinner = Spinner;
|
|
86
|
+
//# sourceMappingURL=Spinner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Spinner.js","sources":["../../../../../../../../node_modules/@salt-ds/core/dist-es/spinner/Spinner.js"],"sourcesContent":["import { jsx } from 'react/jsx-runtime';\nimport { useComponentCssInjection } from '@salt-ds/styles';\nimport { useWindow } from '@salt-ds/window';\nimport { clsx } from 'clsx';\nimport { forwardRef, useEffect } from 'react';\nimport { useAriaAnnouncer } from '../aria-announcer/useAriaAnnouncer.js';\nimport '../aria-announcer/AriaAnnouncerContext.js';\nimport { useDensity } from '../salt-provider/SaltProvider.js';\nimport { makePrefixer } from '../utils/makePrefixer.js';\nimport '../utils/useFloatingUI/useFloatingUI.js';\nimport { useId } from '../utils/useId.js';\nimport '../viewport/ViewportProvider.js';\nimport css_248z from './Spinner.css.js';\nimport { SpinnerSVG } from './svgSpinners/SpinnerSVG.js';\n\nconst SpinnerSizeValues = [\n \"default\",\n \"large\",\n \"small\",\n \"medium\"\n];\nconst handleSize = (size) => size === \"default\" ? \"medium\" : size;\nconst withBaseName = makePrefixer(\"saltSpinner\");\nconst Spinner = forwardRef(\n function Spinner2({\n \"aria-label\": ariaLabel = \"loading\",\n announcerInterval = 5e3,\n announcerTimeout = 2e4,\n completionAnnouncement = `finished ${ariaLabel}`,\n disableAnnouncer,\n className,\n size = \"medium\",\n id: idProp,\n ...rest\n }, ref) {\n const id = useId(idProp);\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-spinner\",\n css: css_248z,\n window: targetWindow\n });\n const { announce } = useAriaAnnouncer();\n const density = useDensity();\n size = handleSize(size);\n useEffect(() => {\n if (disableAnnouncer) return;\n announce(ariaLabel);\n const startTime = Date.now();\n const interval = announcerInterval > 0 && setInterval(() => {\n if (Date.now() - startTime > announcerTimeout) {\n announce(\n `${ariaLabel} is still in progress, but will no longer announce.`\n );\n interval && clearInterval(interval);\n return;\n }\n announce(ariaLabel);\n }, announcerInterval);\n return () => {\n if (disableAnnouncer) return;\n interval && clearInterval(interval);\n if (completionAnnouncement) {\n announce(completionAnnouncement);\n }\n };\n }, [\n announce,\n announcerInterval,\n announcerTimeout,\n ariaLabel,\n completionAnnouncement,\n disableAnnouncer\n ]);\n return /* @__PURE__ */ jsx(\n \"div\",\n {\n \"aria-label\": ariaLabel,\n className: clsx(withBaseName(), withBaseName(size), className),\n ref,\n role: \"img\",\n ...rest,\n children: /* @__PURE__ */ jsx(SpinnerSVG, { size, density, id })\n }\n );\n }\n);\n\nexport { Spinner, SpinnerSizeValues };\n//# sourceMappingURL=Spinner.js.map\n"],"names":["makePrefixer","forwardRef","useId","useWindow","useComponentCssInjection","css_248z","useAriaAnnouncer","useDensity","useEffect","jsx","clsx","SpinnerSVG"],"mappings":";;;;;;;;;;;;;;;;;AAqBA,MAAM,UAAU,GAAG,CAAC,IAAI,KAAK,IAAI,KAAK,SAAS,GAAG,QAAQ,GAAG,IAAI;AACjE,MAAM,YAAY,GAAGA,yBAAY,CAAC,aAAa,CAAC;AAC3C,MAAC,OAAO,GAAGC,gBAAU;AAC1B,EAAE,SAAS,QAAQ,CAAC;AACpB,IAAI,YAAY,EAAE,SAAS,GAAG,SAAS;AACvC,IAAI,iBAAiB,GAAG,GAAG;AAC3B,IAAI,gBAAgB,GAAG,GAAG;AAC1B,IAAI,sBAAsB,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AACpD,IAAI,gBAAgB;AACpB,IAAI,SAAS;AACb,IAAI,IAAI,GAAG,QAAQ;AACnB,IAAI,EAAE,EAAE,MAAM;AACd,IAAI,GAAG;AACP,GAAG,EAAE,GAAG,EAAE;AACV,IAAI,MAAM,EAAE,GAAGC,WAAK,CAAC,MAAM,CAAC;AAC5B,IAAI,MAAM,YAAY,GAAGC,wBAAS,EAAE;AACpC,IAAIC,0CAAwB,CAAC;AAC7B,MAAM,MAAM,EAAE,cAAc;AAC5B,MAAM,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Y,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;AACtE,QAAQ,GAAG;AACX,QAAQ,IAAI,EAAE,KAAK;AACnB,QAAQ,GAAG,IAAI;AACf,QAAQ,QAAQ,kBAAkBD,cAAG,CAACE,qBAAU,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;AACvE;AACA,KAAK;AACL;AACA;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
require('react');
|
|
5
|
+
var makePrefixer = require('../../utils/makePrefixer.js');
|
|
6
|
+
require('clsx');
|
|
7
|
+
require('../../utils/useFloatingUI/useFloatingUI.js');
|
|
8
|
+
require('../../utils/useId.js');
|
|
9
|
+
require('../../salt-provider/SaltProvider.js');
|
|
10
|
+
require('../../viewport/ViewportProvider.js');
|
|
11
|
+
|
|
12
|
+
const withBaseName = makePrefixer.makePrefixer("saltSpinner");
|
|
13
|
+
const sizeAndStrokeWidthMapping = {
|
|
14
|
+
small: {
|
|
15
|
+
high: { width: 12, strokeWidth: 2 },
|
|
16
|
+
medium: { width: 12, strokeWidth: 2 },
|
|
17
|
+
low: { width: 14, strokeWidth: 2 },
|
|
18
|
+
touch: { width: 16, strokeWidth: 2 }
|
|
19
|
+
},
|
|
20
|
+
medium: {
|
|
21
|
+
high: { width: 20, strokeWidth: 2 },
|
|
22
|
+
medium: { width: 28, strokeWidth: 4 },
|
|
23
|
+
low: { width: 36, strokeWidth: 6 },
|
|
24
|
+
touch: { width: 44, strokeWidth: 8 }
|
|
25
|
+
},
|
|
26
|
+
large: {
|
|
27
|
+
high: { width: 40, strokeWidth: 2 },
|
|
28
|
+
medium: { width: 56, strokeWidth: 4 },
|
|
29
|
+
low: { width: 72, strokeWidth: 6 },
|
|
30
|
+
touch: { width: 88, strokeWidth: 8 }
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const SpinnerSVG = ({
|
|
34
|
+
id = "svg-spinner",
|
|
35
|
+
rest,
|
|
36
|
+
size,
|
|
37
|
+
density
|
|
38
|
+
}) => {
|
|
39
|
+
const { width, strokeWidth } = sizeAndStrokeWidthMapping[size][density];
|
|
40
|
+
const radius = (width - strokeWidth) / 2;
|
|
41
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
42
|
+
"svg",
|
|
43
|
+
{
|
|
44
|
+
className: withBaseName("spinner"),
|
|
45
|
+
viewBox: `0 0 ${width} ${width}`,
|
|
46
|
+
id,
|
|
47
|
+
...rest,
|
|
48
|
+
children: [
|
|
49
|
+
/* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsxs("linearGradient", { id: `${id}-1`, x1: "0", y1: "0", x2: "100%", y2: "0", children: [
|
|
50
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
51
|
+
"stop",
|
|
52
|
+
{
|
|
53
|
+
className: withBaseName("gradientStop"),
|
|
54
|
+
offset: "15%",
|
|
55
|
+
stopOpacity: "1"
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
59
|
+
"stop",
|
|
60
|
+
{
|
|
61
|
+
className: withBaseName("gradientStop"),
|
|
62
|
+
offset: "100%",
|
|
63
|
+
stopOpacity: "0"
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
] }) }),
|
|
67
|
+
/* @__PURE__ */ jsxRuntime.jsxs("g", { fill: "none", children: [
|
|
68
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
69
|
+
"path",
|
|
70
|
+
{
|
|
71
|
+
d: `M${width - strokeWidth / 2},${width / 2} a${radius},${radius} 0 1,0 -${width - strokeWidth},0`,
|
|
72
|
+
stroke: "var(--saltSpinner-gradient-color, var(--salt-accent-background)",
|
|
73
|
+
strokeWidth: "var(--spinner-strokeWidth)",
|
|
74
|
+
fill: "none"
|
|
75
|
+
}
|
|
76
|
+
),
|
|
77
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
78
|
+
"path",
|
|
79
|
+
{
|
|
80
|
+
d: `M${width / 2},${strokeWidth / 2} a${radius},${radius} 0 1,0 0,${width - strokeWidth}`,
|
|
81
|
+
stroke: `url(#${id}-1)`,
|
|
82
|
+
strokeWidth: "var(--spinner-strokeWidth)",
|
|
83
|
+
fill: "none"
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
] })
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
exports.SpinnerSVG = SpinnerSVG;
|
|
93
|
+
//# sourceMappingURL=SpinnerSVG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpinnerSVG.js","sources":["../../../../../../../../../node_modules/@salt-ds/core/dist-es/spinner/svgSpinners/SpinnerSVG.js"],"sourcesContent":["import { jsxs, jsx } from 'react/jsx-runtime';\nimport 'react';\nimport { makePrefixer } from '../../utils/makePrefixer.js';\nimport 'clsx';\nimport '../../utils/useFloatingUI/useFloatingUI.js';\nimport '../../utils/useId.js';\nimport '../../salt-provider/SaltProvider.js';\nimport '../../viewport/ViewportProvider.js';\n\nconst withBaseName = makePrefixer(\"saltSpinner\");\nconst sizeAndStrokeWidthMapping = {\n small: {\n high: { width: 12, strokeWidth: 2 },\n medium: { width: 12, strokeWidth: 2 },\n low: { width: 14, strokeWidth: 2 },\n touch: { width: 16, strokeWidth: 2 }\n },\n medium: {\n high: { width: 20, strokeWidth: 2 },\n medium: { width: 28, strokeWidth: 4 },\n low: { width: 36, strokeWidth: 6 },\n touch: { width: 44, strokeWidth: 8 }\n },\n large: {\n high: { width: 40, strokeWidth: 2 },\n medium: { width: 56, strokeWidth: 4 },\n low: { width: 72, strokeWidth: 6 },\n touch: { width: 88, strokeWidth: 8 }\n }\n};\nconst SpinnerSVG = ({\n id = \"svg-spinner\",\n rest,\n size,\n density\n}) => {\n const { width, strokeWidth } = sizeAndStrokeWidthMapping[size][density];\n const radius = (width - strokeWidth) / 2;\n return /* @__PURE__ */ jsxs(\n \"svg\",\n {\n className: withBaseName(\"spinner\"),\n viewBox: `0 0 ${width} ${width}`,\n id,\n ...rest,\n children: [\n /* @__PURE__ */ jsx(\"defs\", { children: /* @__PURE__ */ jsxs(\"linearGradient\", { id: `${id}-1`, x1: \"0\", y1: \"0\", x2: \"100%\", y2: \"0\", children: [\n /* @__PURE__ */ jsx(\n \"stop\",\n {\n className: withBaseName(\"gradientStop\"),\n offset: \"15%\",\n stopOpacity: \"1\"\n }\n ),\n /* @__PURE__ */ jsx(\n \"stop\",\n {\n className: withBaseName(\"gradientStop\"),\n offset: \"100%\",\n stopOpacity: \"0\"\n }\n )\n ] }) }),\n /* @__PURE__ */ jsxs(\"g\", { fill: \"none\", children: [\n /* @__PURE__ */ jsx(\n \"path\",\n {\n d: `M${width - strokeWidth / 2},${width / 2} a${radius},${radius} 0 1,0 -${width - strokeWidth},0`,\n stroke: \"var(--saltSpinner-gradient-color, var(--salt-accent-background)\",\n strokeWidth: \"var(--spinner-strokeWidth)\",\n fill: \"none\"\n }\n ),\n /* @__PURE__ */ jsx(\n \"path\",\n {\n d: `M${width / 2},${strokeWidth / 2} a${radius},${radius} 0 1,0 0,${width - strokeWidth}`,\n stroke: `url(#${id}-1)`,\n strokeWidth: \"var(--spinner-strokeWidth)\",\n fill: \"none\"\n }\n )\n ] })\n ]\n }\n );\n};\n\nexport { SpinnerSVG };\n//# sourceMappingURL=SpinnerSVG.js.map\n"],"names":["makePrefixer","jsxs","jsx"],"mappings":";;;;;;;;;;;AASA,MAAM,YAAY,GAAGA,yBAAY,CAAC,aAAa,CAAC;AAChD,MAAM,yBAAyB,GAAG;AAClC,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE;AACvC,IAAI,MAAM,EAAE,EAAE,KAAK,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W,EAAE,4BAA4B;AACvD,cAAc,IAAI,EAAE;AACpB;AACA,WAAW;AACX,0BAA0BA,cAAG;AAC7B,YAAY,MAAM;AAClB,YAAY;AACZ,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,WAAW,GAAG,CAAC,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,SAAS,EAAE,KAAK,GAAG,WAAW,CAAC,CAAC;AACvG,cAAc,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,CAAC;AACrC,cAAc,WAAW,EAAE,4BAA4B;AACvD,cAAc,IAAI,EAAE;AACpB;AACA;AACA,SAAS,EAAE;AACX;AACA;AACA,GAAG;AACH;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function createChainedFunction(...funcs) {
|
|
4
|
+
return funcs.reduce(
|
|
5
|
+
(acc, func) => {
|
|
6
|
+
if (func == null) {
|
|
7
|
+
return acc;
|
|
8
|
+
}
|
|
9
|
+
return function chainedFunction(...args) {
|
|
10
|
+
acc.apply(this, args);
|
|
11
|
+
func.apply(this, args);
|
|
12
|
+
};
|
|
13
|
+
},
|
|
14
|
+
() => {
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
exports.createChainedFunction = createChainedFunction;
|
|
20
|
+
//# sourceMappingURL=createChainedFunction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createChainedFunction.js","sources":["../../../../../../../../node_modules/@salt-ds/core/dist-es/utils/createChainedFunction.js"],"sourcesContent":["function createChainedFunction(...funcs) {\n return funcs.reduce(\n (acc, func) => {\n if (func == null) {\n return acc;\n }\n return function chainedFunction(...args) {\n acc.apply(this, args);\n func.apply(this, args);\n };\n },\n () => {\n }\n );\n}\n\nexport { createChainedFunction };\n//# sourceMappingURL=createChainedFunction.js.map\n"],"names":[],"mappings":";;AAAA,SAAS,qBAAqB,CAAC,GAAG,KAAK,EAAE;AACzC,EAAE,OAAO,KAAK,CAAC,MAAM;AACrB,IAAI,CAAC,GAAG,EAAE,IAAI,KAAK;AACnB,MAAM,IAAI,IAAI,IAAI,IAAI,EAAE;AACxB,QAAQ,OAAO,GAAG;AAClB;AACA,MAAM,OAAO,SAAS,eAAe,CAAC,GAAG,IAAI,EAAE;AAC/C,QAAQ,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC;AAC7B,QAAQ,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC;AAC9B,OAAO;AACP,KAAK;AACL,IAAI,MAAM;AACV;AACA,GAAG;AACH;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
|
|
5
|
+
function createContext(name, defaultValue) {
|
|
6
|
+
const context = React.createContext(defaultValue);
|
|
7
|
+
if (process.env.NODE_ENV !== "production") {
|
|
8
|
+
context.displayName = name;
|
|
9
|
+
}
|
|
10
|
+
return context;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
exports.createContext = createContext;
|
|
14
|
+
//# sourceMappingURL=createContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createContext.js","sources":["../../../../../../../../node_modules/@salt-ds/core/dist-es/utils/createContext.js"],"sourcesContent":["import { createContext as createContext$1 } from 'react';\n\nfunction createContext(name, defaultValue) {\n const context = createContext$1(defaultValue);\n if (process.env.NODE_ENV !== \"production\") {\n context.displayName = name;\n }\n return context;\n}\n\nexport { createContext };\n//# sourceMappingURL=createContext.js.map\n"],"names":["createContext$1"],"mappings":";;;;AAEA,SAAS,aAAa,CAAC,IAAI,EAAE,YAAY,EAAE;AAC3C,EAAE,MAAM,OAAO,GAAGA,mBAAe,CAAC,YAAY,CAAC;AAC/C,EAAE,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;AAC7C,IAAI,OAAO,CAAC,WAAW,GAAG,IAAI;AAC9B;AACA,EAAE,OAAO,OAAO;AAChB;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function debounce(func, wait = 166, leading = false) {
|
|
4
|
+
let timeout;
|
|
5
|
+
const debounced = function debounced2(...args) {
|
|
6
|
+
const later = () => {
|
|
7
|
+
func.apply(this, args);
|
|
8
|
+
};
|
|
9
|
+
clearTimeout(timeout);
|
|
10
|
+
if (leading) {
|
|
11
|
+
later();
|
|
12
|
+
}
|
|
13
|
+
timeout = window.setTimeout(later, wait);
|
|
14
|
+
};
|
|
15
|
+
debounced.clear = () => {
|
|
16
|
+
clearTimeout(timeout);
|
|
17
|
+
};
|
|
18
|
+
return debounced;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
exports.debounce = debounce;
|
|
22
|
+
//# sourceMappingURL=debounce.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debounce.js","sources":["../../../../../../../../node_modules/@salt-ds/core/dist-es/utils/debounce.js"],"sourcesContent":["function debounce(func, wait = 166, leading = false) {\n let timeout;\n const debounced = function debounced2(...args) {\n const later = () => {\n func.apply(this, args);\n };\n clearTimeout(timeout);\n if (leading) {\n later();\n }\n timeout = window.setTimeout(later, wait);\n };\n debounced.clear = () => {\n clearTimeout(timeout);\n };\n return debounced;\n}\n\nexport { debounce };\n//# sourceMappingURL=debounce.js.map\n"],"names":[],"mappings":";;AAAA,SAAS,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,GAAG,EAAE,OAAO,GAAG,KAAK,EAAE;AACrD,EAAE,IAAI,OAAO;AACb,EAAE,MAAM,SAAS,GAAG,SAAS,UAAU,CAAC,GAAG,IAAI,EAAE;AACjD,IAAI,MAAM,KAAK,GAAG,MAAM;AACxB,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC;AAC5B,KAAK;AACL,IAAI,YAAY,CAAC,OAAO,CAAC;AACzB,IAAI,IAAI,OAAO,EAAE;AACjB,MAAM,KAAK,EAAE;AACb;AACA,IAAI,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC;AAC5C,GAAG;AACH,EAAE,SAAS,CAAC,KAAK,GAAG,MAAM;AAC1B,IAAI,YAAY,CAAC,OAAO,CAAC;AACzB,GAAG;AACH,EAAE,OAAO,SAAS;AAClB;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"makePrefixer.js","sources":["../../../../../../../../node_modules/@salt-ds/core/dist-es/utils/makePrefixer.js"],"sourcesContent":["const makePrefixer = (prefix) => (...names) => [prefix, ...names].join(\"-\");\n\nexport { makePrefixer };\n//# sourceMappingURL=makePrefixer.js.map\n"],"names":[],"mappings":";;AAAK,MAAC,YAAY,GAAG,CAAC,MAAM,KAAK,CAAC,GAAG,KAAK,KAAK,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var floatingUi_react = require('../../../../../@floating-ui/react/dist/floating-ui.react.js');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var SaltProvider = require('../../salt-provider/SaltProvider.js');
|
|
7
|
+
var usePreventScroll = require('../usePreventScroll.js');
|
|
8
|
+
var floatingUi_dom = require('../../../../../@floating-ui/dom/dist/floating-ui.dom.js');
|
|
9
|
+
|
|
10
|
+
const DefaultFloatingComponent = React.forwardRef(function DefaultFloatingComponent2(props, ref) {
|
|
11
|
+
const {
|
|
12
|
+
open,
|
|
13
|
+
top,
|
|
14
|
+
left,
|
|
15
|
+
position,
|
|
16
|
+
width: _width,
|
|
17
|
+
height: _height,
|
|
18
|
+
focusManagerProps,
|
|
19
|
+
lockScroll,
|
|
20
|
+
style: styleProp,
|
|
21
|
+
...rest
|
|
22
|
+
} = props;
|
|
23
|
+
const style = {
|
|
24
|
+
...styleProp,
|
|
25
|
+
top,
|
|
26
|
+
left,
|
|
27
|
+
position
|
|
28
|
+
};
|
|
29
|
+
const { themeNext } = SaltProvider.useTheme();
|
|
30
|
+
usePreventScroll.usePreventScroll({ isDisabled: !lockScroll || !open });
|
|
31
|
+
const ChosenSaltProvider = themeNext ? SaltProvider.SaltProviderNext : SaltProvider.SaltProvider;
|
|
32
|
+
if (focusManagerProps && open) {
|
|
33
|
+
return /* @__PURE__ */ jsxRuntime.jsx(floatingUi_react.FloatingPortal, { children: /* @__PURE__ */ jsxRuntime.jsx(ChosenSaltProvider, { applyClassesTo: "scope", children: /* @__PURE__ */ jsxRuntime.jsx(floatingUi_react.FloatingFocusManager, { ...focusManagerProps, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style, ...rest, ref }) }) }) });
|
|
34
|
+
}
|
|
35
|
+
return open ? /* @__PURE__ */ jsxRuntime.jsx(floatingUi_react.FloatingPortal, { children: /* @__PURE__ */ jsxRuntime.jsx(ChosenSaltProvider, { applyClassesTo: "scope", children: /* @__PURE__ */ jsxRuntime.jsx("div", { style, ...rest, ref }) }) }) : null;
|
|
36
|
+
});
|
|
37
|
+
const FloatingComponentContext = React.createContext({
|
|
38
|
+
Component: DefaultFloatingComponent
|
|
39
|
+
});
|
|
40
|
+
if (process.env.NODE_ENV !== "production") {
|
|
41
|
+
FloatingComponentContext.displayName = "FloatingComponentContext";
|
|
42
|
+
}
|
|
43
|
+
const defaultGetMiddleware = (defaultMiddleware) => defaultMiddleware;
|
|
44
|
+
const defaultFloatingPlaform = {
|
|
45
|
+
platform: floatingUi_dom.platform,
|
|
46
|
+
middleware: defaultGetMiddleware,
|
|
47
|
+
animationFrame: false
|
|
48
|
+
};
|
|
49
|
+
React.createContext(
|
|
50
|
+
defaultFloatingPlaform
|
|
51
|
+
);
|
|
52
|
+
//# sourceMappingURL=useFloatingUI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFloatingUI.js","sources":["../../../../../../../../../node_modules/@salt-ds/core/dist-es/utils/useFloatingUI/useFloatingUI.js"],"sourcesContent":["import { jsx } from 'react/jsx-runtime';\nimport { FloatingPortal, FloatingFocusManager, platform, flip, shift, limitShift, useFloating, autoUpdate } from '@floating-ui/react';\nimport { forwardRef, createContext, useContext, useMemo } from 'react';\nimport { useTheme, SaltProviderNext, SaltProvider } from '../../salt-provider/SaltProvider.js';\nimport { usePreventScroll } from '../usePreventScroll.js';\n\nconst DefaultFloatingComponent = forwardRef(function DefaultFloatingComponent2(props, ref) {\n const {\n open,\n top,\n left,\n position,\n width: _width,\n height: _height,\n focusManagerProps,\n lockScroll,\n style: styleProp,\n ...rest\n } = props;\n const style = {\n ...styleProp,\n top,\n left,\n position\n };\n const { themeNext } = useTheme();\n usePreventScroll({ isDisabled: !lockScroll || !open });\n const ChosenSaltProvider = themeNext ? SaltProviderNext : SaltProvider;\n if (focusManagerProps && open) {\n return /* @__PURE__ */ jsx(FloatingPortal, { children: /* @__PURE__ */ jsx(ChosenSaltProvider, { applyClassesTo: \"scope\", children: /* @__PURE__ */ jsx(FloatingFocusManager, { ...focusManagerProps, children: /* @__PURE__ */ jsx(\"div\", { style, ...rest, ref }) }) }) });\n }\n return open ? /* @__PURE__ */ jsx(FloatingPortal, { children: /* @__PURE__ */ jsx(ChosenSaltProvider, { applyClassesTo: \"scope\", children: /* @__PURE__ */ jsx(\"div\", { style, ...rest, ref }) }) }) : null;\n});\nconst FloatingComponentContext = createContext({\n Component: DefaultFloatingComponent\n});\nif (process.env.NODE_ENV !== \"production\") {\n FloatingComponentContext.displayName = \"FloatingComponentContext\";\n}\nfunction FloatingComponentProvider(props) {\n const { Component, children } = props;\n const value = useMemo(() => ({ Component }), [Component]);\n return /* @__PURE__ */ jsx(FloatingComponentContext.Provider, { value, children });\n}\nfunction useFloatingComponent() {\n return useContext(FloatingComponentContext);\n}\nconst defaultGetMiddleware = (defaultMiddleware) => defaultMiddleware;\nconst defaultFloatingPlaform = {\n platform,\n middleware: defaultGetMiddleware,\n animationFrame: false\n};\nconst FloatingPlatformContext = createContext(\n defaultFloatingPlaform\n);\nfunction FloatingPlatformProvider(props) {\n const {\n platform: platformProp,\n middleware,\n animationFrame,\n children\n } = props;\n const floatingPlatformContextValue = useMemo(\n () => ({\n platform: platformProp ?? platform,\n middleware: middleware ?? defaultGetMiddleware,\n animationFrame: animationFrame || false\n }),\n [platformProp, middleware, animationFrame]\n );\n return /* @__PURE__ */ jsx(FloatingPlatformContext.Provider, { value: floatingPlatformContextValue, children });\n}\nfunction useFloatingPlatform() {\n return useContext(FloatingPlatformContext);\n}\nconst DEFAULT_FLOATING_UI_MIDDLEWARE = [\n flip(),\n shift({ limiter: limitShift() })\n];\nfunction useFloatingUI(props) {\n const {\n middleware = DEFAULT_FLOATING_UI_MIDDLEWARE,\n open = false,\n onOpenChange,\n ...other\n } = props;\n const handleOpenChange = (open2, boolean, reason) => {\n update();\n onOpenChange == null ? void 0 : onOpenChange(open2, boolean, reason);\n };\n const {\n platform: contextPlatform,\n middleware: contextMiddleware,\n animationFrame\n } = useFloatingPlatform();\n const { refs, update, ...rest } = useFloating({\n ...other,\n middleware: contextMiddleware(middleware),\n open,\n onOpenChange: handleOpenChange,\n whileElementsMounted: (...args) => {\n const cleanup = autoUpdate(...args, { animationFrame });\n return cleanup;\n },\n platform: contextPlatform\n });\n return {\n reference: refs.setReference,\n floating: refs.setFloating,\n refs,\n update,\n ...rest\n };\n}\n\nexport { DEFAULT_FLOATING_UI_MIDDLEWARE, FloatingComponentProvider, FloatingPlatformProvider, useFloatingComponent, useFloatingPlatform, useFloatingUI };\n//# sourceMappingURL=useFloatingUI.js.map\n"],"names":["forwardRef","useTheme","usePreventScroll","SaltProviderNext","SaltProvider","jsx","FloatingPortal","FloatingFocusManager","createContext","platform"],"mappings":";;;;;;;;;AAMA,MAAM,wBAAwB,GAAGA,gBAAU,CAAC,SAAS,yBAAyB,CAAC,KAAK,EAAE,GAAG,EAAE;AAC3F,EAAE,MAAM;AACR,IAAI,IAAI;AACR,IAAI,GAAG;AACP,IAAI,IAAI;AACR,IAAI,QAAQ;AACZ,IAAI,KAAK,EAAE,MAAM;AACjB,IAAI,MAAM,EAAE,OAAO;AACnB,IAAI,iBAAiB;AACrB,IAAI,UAAU;AACd,IAAI,KAAK,EAAE,SAAS;AACpB,IAAI,GAAG;AACP,GAAG,GAAG,KAAK;AACX,EAAE,MAAM,KAAK,GAAG;AAChB,IAAI,GAAG,SAAS;AAChB,IAAI,GAAG;AACP,IAAI,IAAI;AACR,IAAI;AACJ,GAAG;AACH,EAAE,MAAM,EAAE,SAAS,EAAE,GAAGC,qBAAQ,EAAE;AAClC,EAAEC,iCAAgB,CAAC,EAAE,UAAU,EAAE,CAAC,UAAU,IAAI,CAAC,IAAI,EAAE,CAAC;AACxD,EAAE,MAAM,kBAAkB,GAAG,SAAS,GAAGC,6BAAgB,GAAGC,yBAAY;AACxE,EAAE,IAAI,iBAAiB,IAAI,IAAI,EAAE;AACjC,IAAI,uBAAuBC,cAAG,CAACC,+BAAc,EAAE,EAAE,QAAQ,kBAAkBD,cAAG,CAAC,kBAAkB,EAAE,EAAE,cAAc,EAAE,OAAO,EAAE,QAAQ,kBAAkBA,cAAG,CAACE,qCAAoB,EAAE,EAAE,GAAG,iBAAiB,EAAE,QAAQ,kBAAkBF,cAAG,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AAChR;AACA,EAAE,OAAO,IAAI,mBAAmBA,cAAG,CAACC,+BAAc,EAAE,EAAE,QAAQ,kBAAkBD,cAAG,CAAC,kBAAkB,EAAE,EAAE,cAAc,EAAE,OAAO,EAAE,QAAQ,kBAAkBA,cAAG,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,IAAI;AAC7M,CAAC,CAAC;AACF,MAAM,wBAAwB,GAAGG,mBAAa,CAAC;AAC/C,EAAE,SAAS,EAAE;AACb,CAAC,CAAC;AACF,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;AAC3C,EAAE,wBAAwB,CAAC,WAAW,GAAG,0BAA0B;AACnE;AASA,MAAM,oBAAoB,GAAG,CAAC,iBAAiB,KAAK,iBAAiB;AACrE,MAAM,sBAAsB,GAAG;AAC/B,YAAEC,uBAAQ;AACV,EAAE,UAAU,EAAE,oBAAoB;AAClC,EAAE,cAAc,EAAE;AAClB,CAAC;AAC+BD,mBAAa;AAC7C,EAAE;AACF;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
|
|
5
|
+
function _interopNamespaceDefault(e) {
|
|
6
|
+
var n = Object.create(null);
|
|
7
|
+
if (e) {
|
|
8
|
+
Object.keys(e).forEach(function (k) {
|
|
9
|
+
if (k !== 'default') {
|
|
10
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
11
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () { return e[k]; }
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
n.default = e;
|
|
19
|
+
return Object.freeze(n);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
23
|
+
|
|
24
|
+
const maybeReactUseId = React__namespace["useId".toString()];
|
|
25
|
+
let globalId = BigInt(0);
|
|
26
|
+
function useIdLegacy(idOverride) {
|
|
27
|
+
const [defaultId, setDefaultId] = React__namespace.useState(idOverride);
|
|
28
|
+
const id = idOverride || defaultId;
|
|
29
|
+
React__namespace.useEffect(() => {
|
|
30
|
+
if (defaultId == null) {
|
|
31
|
+
setDefaultId(`salt-${++globalId}`);
|
|
32
|
+
}
|
|
33
|
+
}, [defaultId]);
|
|
34
|
+
return id;
|
|
35
|
+
}
|
|
36
|
+
function useId(idOverride) {
|
|
37
|
+
if (maybeReactUseId !== void 0) {
|
|
38
|
+
const reactId = maybeReactUseId();
|
|
39
|
+
return idOverride ?? reactId;
|
|
40
|
+
}
|
|
41
|
+
return useIdLegacy(idOverride);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
exports.useId = useId;
|
|
45
|
+
//# sourceMappingURL=useId.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useId.js","sources":["../../../../../../../../node_modules/@salt-ds/core/dist-es/utils/useId.js"],"sourcesContent":["import * as React from 'react';\n\nconst maybeReactUseId = React[\"useId\".toString()];\nlet globalId = BigInt(0);\nfunction useIdLegacy(idOverride) {\n const [defaultId, setDefaultId] = React.useState(idOverride);\n const id = idOverride || defaultId;\n React.useEffect(() => {\n if (defaultId == null) {\n setDefaultId(`salt-${++globalId}`);\n }\n }, [defaultId]);\n return id;\n}\nfunction useId(idOverride) {\n if (maybeReactUseId !== void 0) {\n const reactId = maybeReactUseId();\n return idOverride ?? reactId;\n }\n return useIdLegacy(idOverride);\n}\nfunction useIdMemo(idOverride) {\n return React.useMemo(() => {\n return idOverride ?? `salt-${++globalId}`;\n }, [idOverride]);\n}\n\nexport { useId, useIdMemo };\n//# sourceMappingURL=useId.js.map\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,eAAe,GAAGA,gBAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;AACjD,IAAI,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC;AACxB,SAAS,WAAW,CAAC,UAAU,EAAE;AACjC,EAAE,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAGA,gBAAK,CAAC,QAAQ,CAAC,UAAU,CAAC;AAC9D,EAAE,MAAM,EAAE,GAAG,UAAU,IAAI,SAAS;AACpC,EAAEA,gBAAK,CAAC,SAAS,CAAC,MAAM;AACxB,IAAI,IAAI,SAAS,IAAI,IAAI,EAAE;AAC3B,MAAM,YAAY,CAAC,CAAC,KAAK,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC;AACxC;AACA,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;AACjB,EAAE,OAAO,EAAE;AACX;AACA,SAAS,KAAK,CAAC,UAAU,EAAE;AAC3B,EAAE,IAAI,eAAe,KAAK,KAAK,CAAC,EAAE;AAClC,IAAI,MAAM,OAAO,GAAG,eAAe,EAAE;AACrC,IAAI,OAAO,UAAU,IAAI,OAAO;AAChC;AACA,EAAE,OAAO,WAAW,CAAC,UAAU,CAAC;AAChC;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
|
|
5
|
+
const useIsomorphicLayoutEffect = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined" ? React.useLayoutEffect : React.useEffect;
|
|
6
|
+
|
|
7
|
+
exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect;
|
|
8
|
+
//# sourceMappingURL=useIsomorphicLayoutEffect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useIsomorphicLayoutEffect.js","sources":["../../../../../../../../node_modules/@salt-ds/core/dist-es/utils/useIsomorphicLayoutEffect.js"],"sourcesContent":["import { useLayoutEffect, useEffect } from 'react';\n\nconst useIsomorphicLayoutEffect = typeof window !== \"undefined\" && typeof window.document !== \"undefined\" && typeof window.document.createElement !== \"undefined\" ? useLayoutEffect : useEffect;\n\nexport { useIsomorphicLayoutEffect };\n//# sourceMappingURL=useIsomorphicLayoutEffect.js.map\n"],"names":["useLayoutEffect","useEffect"],"mappings":";;;;AAEK,MAAC,yBAAyB,GAAG,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,QAAQ,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,QAAQ,CAAC,aAAa,KAAK,WAAW,GAAGA,qBAAe,GAAGC;;;;","x_google_ignoreList":[0]}
|