@funstack/ui 0.1.0-alpha.19 → 0.1.0-alpha.20
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/dist/accordion/accordion-item.mjs +2 -2
- package/dist/accordion/accordion-item.mjs.map +1 -1
- package/dist/accordion/accordion-trigger.d.mts.map +1 -1
- package/dist/accordion/accordion-trigger.mjs +3 -20
- package/dist/accordion/accordion-trigger.mjs.map +1 -1
- package/dist/alert-dialog/alert-dialog-action.d.mts +73 -0
- package/dist/alert-dialog/alert-dialog-action.d.mts.map +1 -0
- package/dist/alert-dialog/alert-dialog-action.mjs +23 -0
- package/dist/alert-dialog/alert-dialog-action.mjs.map +1 -0
- package/dist/alert-dialog/alert-dialog-cancel.d.mts +31 -0
- package/dist/alert-dialog/alert-dialog-cancel.d.mts.map +1 -0
- package/dist/alert-dialog/alert-dialog-cancel.mjs +50 -0
- package/dist/alert-dialog/alert-dialog-cancel.mjs.map +1 -0
- package/dist/alert-dialog/alert-dialog-context.mjs +24 -0
- package/dist/alert-dialog/alert-dialog-context.mjs.map +1 -0
- package/dist/alert-dialog/alert-dialog-description.d.mts +25 -0
- package/dist/alert-dialog/alert-dialog-description.d.mts.map +1 -0
- package/dist/alert-dialog/alert-dialog-description.mjs +20 -0
- package/dist/alert-dialog/alert-dialog-description.mjs.map +1 -0
- package/dist/alert-dialog/alert-dialog-form.d.mts +27 -0
- package/dist/alert-dialog/alert-dialog-form.d.mts.map +1 -0
- package/dist/alert-dialog/alert-dialog-form.mjs +22 -0
- package/dist/alert-dialog/alert-dialog-form.mjs.map +1 -0
- package/dist/alert-dialog/alert-dialog-popup.d.mts +42 -0
- package/dist/alert-dialog/alert-dialog-popup.d.mts.map +1 -0
- package/dist/alert-dialog/alert-dialog-popup.mjs +53 -0
- package/dist/alert-dialog/alert-dialog-popup.mjs.map +1 -0
- package/dist/alert-dialog/alert-dialog-root.d.mts +31 -0
- package/dist/alert-dialog/alert-dialog-root.d.mts.map +1 -0
- package/dist/alert-dialog/alert-dialog-root.mjs +22 -0
- package/dist/alert-dialog/alert-dialog-root.mjs.map +1 -0
- package/dist/alert-dialog/alert-dialog-title.d.mts +23 -0
- package/dist/alert-dialog/alert-dialog-title.d.mts.map +1 -0
- package/dist/alert-dialog/alert-dialog-title.mjs +18 -0
- package/dist/alert-dialog/alert-dialog-title.mjs.map +1 -0
- package/dist/alert-dialog/alert-dialog-trigger.d.mts +23 -0
- package/dist/alert-dialog/alert-dialog-trigger.d.mts.map +1 -0
- package/dist/alert-dialog/alert-dialog-trigger.mjs +18 -0
- package/dist/alert-dialog/alert-dialog-trigger.mjs.map +1 -0
- package/dist/alert-dialog/index.d.mts +33 -0
- package/dist/alert-dialog/index.d.mts.map +1 -0
- package/dist/alert-dialog/index.mjs +33 -0
- package/dist/alert-dialog/index.mjs.map +1 -0
- package/dist/checkbox-group/checkbox-group-parent.mjs +1 -1
- package/dist/collapsible/collapsible-context.mjs +8 -0
- package/dist/collapsible/collapsible-context.mjs.map +1 -0
- package/dist/collapsible/collapsible-panel.d.mts +53 -0
- package/dist/collapsible/collapsible-panel.d.mts.map +1 -0
- package/dist/collapsible/collapsible-panel.mjs +41 -0
- package/dist/collapsible/collapsible-panel.mjs.map +1 -0
- package/dist/collapsible/collapsible-root.d.mts +108 -0
- package/dist/collapsible/collapsible-root.d.mts.map +1 -0
- package/dist/collapsible/collapsible-root.mjs +147 -0
- package/dist/collapsible/collapsible-root.mjs.map +1 -0
- package/dist/collapsible/collapsible-trigger.d.mts +45 -0
- package/dist/collapsible/collapsible-trigger.d.mts.map +1 -0
- package/dist/collapsible/collapsible-trigger.mjs +62 -0
- package/dist/collapsible/collapsible-trigger.mjs.map +1 -0
- package/dist/collapsible/index.d.mts +21 -0
- package/dist/collapsible/index.d.mts.map +1 -0
- package/dist/collapsible/index.mjs +21 -0
- package/dist/collapsible/index.mjs.map +1 -0
- package/dist/combobox/chip-text.mjs +24 -0
- package/dist/combobox/chip-text.mjs.map +1 -0
- package/dist/combobox/combobox-chips.d.mts +159 -0
- package/dist/combobox/combobox-chips.d.mts.map +1 -0
- package/dist/combobox/combobox-chips.mjs +198 -0
- package/dist/combobox/combobox-chips.mjs.map +1 -0
- package/dist/combobox/combobox-clear.d.mts +5 -2
- package/dist/combobox/combobox-clear.d.mts.map +1 -1
- package/dist/combobox/combobox-clear.mjs +3 -1
- package/dist/combobox/combobox-clear.mjs.map +1 -1
- package/dist/combobox/combobox-context.mjs +4 -5
- package/dist/combobox/combobox-context.mjs.map +1 -1
- package/dist/combobox/combobox-input.d.mts +10 -3
- package/dist/combobox/combobox-input.d.mts.map +1 -1
- package/dist/combobox/combobox-input.mjs +13 -5
- package/dist/combobox/combobox-input.mjs.map +1 -1
- package/dist/combobox/combobox-keyboard.mjs +50 -4
- package/dist/combobox/combobox-keyboard.mjs.map +1 -1
- package/dist/combobox/combobox-list.d.mts +1 -1
- package/dist/combobox/combobox-list.mjs +2 -1
- package/dist/combobox/combobox-list.mjs.map +1 -1
- package/dist/combobox/combobox-option.d.mts +5 -2
- package/dist/combobox/combobox-option.d.mts.map +1 -1
- package/dist/combobox/combobox-option.mjs +4 -3
- package/dist/combobox/combobox-option.mjs.map +1 -1
- package/dist/combobox/combobox-root.d.mts +127 -35
- package/dist/combobox/combobox-root.d.mts.map +1 -1
- package/dist/combobox/combobox-root.mjs +396 -44
- package/dist/combobox/combobox-root.mjs.map +1 -1
- package/dist/combobox/index.d.mts +8 -2
- package/dist/combobox/index.d.mts.map +1 -1
- package/dist/combobox/index.mjs +7 -1
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/combobox/use-combobox-form.mjs +2 -3
- package/dist/combobox/use-combobox-form.mjs.map +1 -1
- package/dist/dialog/dialog-close.d.mts +9 -5
- package/dist/dialog/dialog-close.d.mts.map +1 -1
- package/dist/dialog/dialog-close.mjs +19 -8
- package/dist/dialog/dialog-close.mjs.map +1 -1
- package/dist/dialog/dialog-context.d.mts +2 -0
- package/dist/dialog/dialog-context.mjs +14 -2
- package/dist/dialog/dialog-context.mjs.map +1 -1
- package/dist/dialog/dialog-description.d.mts +2 -1
- package/dist/dialog/dialog-description.d.mts.map +1 -1
- package/dist/dialog/dialog-description.mjs +8 -4
- package/dist/dialog/dialog-description.mjs.map +1 -1
- package/dist/dialog/dialog-form.d.mts +2 -1
- package/dist/dialog/dialog-form.d.mts.map +1 -1
- package/dist/dialog/dialog-form.mjs +11 -6
- package/dist/dialog/dialog-form.mjs.map +1 -1
- package/dist/dialog/dialog-popup.d.mts +2 -1
- package/dist/dialog/dialog-popup.d.mts.map +1 -1
- package/dist/dialog/dialog-popup.mjs +23 -14
- package/dist/dialog/dialog-popup.mjs.map +1 -1
- package/dist/dialog/dialog-root.d.mts +2 -1
- package/dist/dialog/dialog-root.d.mts.map +1 -1
- package/dist/dialog/dialog-root.mjs +15 -5
- package/dist/dialog/dialog-root.mjs.map +1 -1
- package/dist/dialog/dialog-title.d.mts +2 -1
- package/dist/dialog/dialog-title.d.mts.map +1 -1
- package/dist/dialog/dialog-title.mjs +8 -4
- package/dist/dialog/dialog-title.mjs.map +1 -1
- package/dist/dialog/dialog-trigger.d.mts +2 -1
- package/dist/dialog/dialog-trigger.d.mts.map +1 -1
- package/dist/dialog/dialog-trigger.mjs +14 -9
- package/dist/dialog/dialog-trigger.mjs.map +1 -1
- package/dist/docs/components/accordion.md +2 -0
- package/dist/docs/components/alert-dialog.md +546 -0
- package/dist/docs/components/collapsible.md +408 -0
- package/dist/docs/components/combobox.md +288 -26
- package/dist/docs/components/dialog.md +7 -5
- package/dist/docs/components/field.md +180 -3
- package/dist/docs/components/hover-card.md +494 -0
- package/dist/docs/components/multi-select.md +622 -0
- package/dist/docs/components/number-field.md +1 -1
- package/dist/docs/components/popover.md +4 -4
- package/dist/docs/components/select.md +9 -1
- package/dist/docs/components/separator.md +182 -0
- package/dist/docs/components/slider.md +1 -1
- package/dist/docs/components/tooltip.md +1 -1
- package/dist/docs/concepts/experimental.md +3 -3
- package/dist/docs/concepts/server-components.md +1 -1
- package/dist/docs/index.md +7 -2
- package/dist/docs/roadmap.md +8 -0
- package/dist/field/field-control.d.mts +13 -4
- package/dist/field/field-control.d.mts.map +1 -1
- package/dist/field/field-control.mjs +39 -10
- package/dist/field/field-control.mjs.map +1 -1
- package/dist/field/field-label.d.mts +6 -2
- package/dist/field/field-label.d.mts.map +1 -1
- package/dist/field/field-label.mjs +12 -2
- package/dist/field/field-label.mjs.map +1 -1
- package/dist/field/field-root.mjs +9 -1
- package/dist/field/field-root.mjs.map +1 -1
- package/dist/hover-card/hover-card-context.mjs +13 -0
- package/dist/hover-card/hover-card-context.mjs.map +1 -0
- package/dist/hover-card/hover-card-popup.d.mts +102 -0
- package/dist/hover-card/hover-card-popup.d.mts.map +1 -0
- package/dist/hover-card/hover-card-popup.mjs +80 -0
- package/dist/hover-card/hover-card-popup.mjs.map +1 -0
- package/dist/hover-card/hover-card-root.d.mts +94 -0
- package/dist/hover-card/hover-card-root.d.mts.map +1 -0
- package/dist/hover-card/hover-card-root.mjs +74 -0
- package/dist/hover-card/hover-card-root.mjs.map +1 -0
- package/dist/hover-card/hover-card-trigger.d.mts +65 -0
- package/dist/hover-card/hover-card-trigger.d.mts.map +1 -0
- package/dist/hover-card/hover-card-trigger.mjs +109 -0
- package/dist/hover-card/hover-card-trigger.mjs.map +1 -0
- package/dist/hover-card/index.d.mts +24 -0
- package/dist/hover-card/index.d.mts.map +1 -0
- package/dist/hover-card/index.mjs +24 -0
- package/dist/hover-card/index.mjs.map +1 -0
- package/dist/hover-card/use-hover-card-interest.mjs +242 -0
- package/dist/hover-card/use-hover-card-interest.mjs.map +1 -0
- package/dist/index.d.mts +38 -9
- package/dist/index.mjs +6 -1
- package/dist/internal/action/use-multiple-selection.mjs +83 -0
- package/dist/internal/action/use-multiple-selection.mjs.map +1 -0
- package/dist/internal/details-summary.mjs +56 -0
- package/dist/internal/details-summary.mjs.map +1 -0
- package/dist/internal/form/field-context.mjs.map +1 -1
- package/dist/internal/form/hidden-values.mjs +29 -0
- package/dist/internal/form/hidden-values.mjs.map +1 -0
- package/dist/internal/form/validity.mjs +3 -1
- package/dist/internal/form/validity.mjs.map +1 -1
- package/dist/internal/overlay/use-interest-dismiss.mjs +2 -1
- package/dist/internal/overlay/use-interest-dismiss.mjs.map +1 -1
- package/dist/internal/overlay/use-overlay-close.mjs +5 -3
- package/dist/internal/overlay/use-overlay-close.mjs.map +1 -1
- package/dist/internal/overlay/use-overlay-root.mjs +4 -1
- package/dist/internal/overlay/use-overlay-root.mjs.map +1 -1
- package/dist/internal/overlay/use-popover-popup.mjs +20 -7
- package/dist/internal/overlay/use-popover-popup.mjs.map +1 -1
- package/dist/internal/overlay/use-popover-trigger.d.mts +1 -1
- package/dist/internal/typeahead.mjs +52 -0
- package/dist/internal/typeahead.mjs.map +1 -0
- package/dist/{combobox → internal}/use-active-option.mjs +8 -6
- package/dist/internal/use-active-option.mjs.map +1 -0
- package/dist/{combobox → internal}/use-deferred-leave.mjs +20 -12
- package/dist/internal/use-deferred-leave.mjs.map +1 -0
- package/dist/internal/use-name-warning.mjs +57 -1
- package/dist/internal/use-name-warning.mjs.map +1 -1
- package/dist/internal/use-option-registry.mjs +70 -0
- package/dist/internal/use-option-registry.mjs.map +1 -0
- package/dist/menu/use-menu-keyboard.mjs +7 -27
- package/dist/menu/use-menu-keyboard.mjs.map +1 -1
- package/dist/multi-select/index.d.mts +37 -0
- package/dist/multi-select/index.d.mts.map +1 -0
- package/dist/multi-select/index.mjs +37 -0
- package/dist/multi-select/index.mjs.map +1 -0
- package/dist/multi-select/multi-select-context.mjs +19 -0
- package/dist/multi-select/multi-select-context.mjs.map +1 -0
- package/dist/multi-select/multi-select-group.d.mts +120 -0
- package/dist/multi-select/multi-select-group.d.mts.map +1 -0
- package/dist/multi-select/multi-select-group.mjs +111 -0
- package/dist/multi-select/multi-select-group.mjs.map +1 -0
- package/dist/multi-select/multi-select-keyboard.mjs +145 -0
- package/dist/multi-select/multi-select-keyboard.mjs.map +1 -0
- package/dist/multi-select/multi-select-label.d.mts +42 -0
- package/dist/multi-select/multi-select-label.d.mts.map +1 -0
- package/dist/multi-select/multi-select-label.mjs +41 -0
- package/dist/multi-select/multi-select-label.mjs.map +1 -0
- package/dist/multi-select/multi-select-list.d.mts +47 -0
- package/dist/multi-select/multi-select-list.d.mts.map +1 -0
- package/dist/multi-select/multi-select-list.mjs +65 -0
- package/dist/multi-select/multi-select-list.mjs.map +1 -0
- package/dist/multi-select/multi-select-option.d.mts +68 -0
- package/dist/multi-select/multi-select-option.d.mts.map +1 -0
- package/dist/multi-select/multi-select-option.mjs +93 -0
- package/dist/multi-select/multi-select-option.mjs.map +1 -0
- package/dist/multi-select/multi-select-popup.d.mts +58 -0
- package/dist/multi-select/multi-select-popup.d.mts.map +1 -0
- package/dist/multi-select/multi-select-popup.mjs +71 -0
- package/dist/multi-select/multi-select-popup.mjs.map +1 -0
- package/dist/multi-select/multi-select-root.d.mts +125 -0
- package/dist/multi-select/multi-select-root.d.mts.map +1 -0
- package/dist/multi-select/multi-select-root.mjs +257 -0
- package/dist/multi-select/multi-select-root.mjs.map +1 -0
- package/dist/multi-select/multi-select-trigger.d.mts +66 -0
- package/dist/multi-select/multi-select-trigger.d.mts.map +1 -0
- package/dist/multi-select/multi-select-trigger.mjs +169 -0
- package/dist/multi-select/multi-select-trigger.mjs.map +1 -0
- package/dist/multi-select/multi-select-value.d.mts +57 -0
- package/dist/multi-select/multi-select-value.d.mts.map +1 -0
- package/dist/multi-select/multi-select-value.mjs +41 -0
- package/dist/multi-select/multi-select-value.mjs.map +1 -0
- package/dist/number-field/number-field-root.mjs +1 -1
- package/dist/number-field/use-step-button.d.mts.map +1 -1
- package/dist/number-field/use-step-button.mjs +11 -2
- package/dist/number-field/use-step-button.mjs.map +1 -1
- package/dist/popover/popover-close.d.mts +6 -3
- package/dist/popover/popover-close.d.mts.map +1 -1
- package/dist/popover/popover-close.mjs +3 -2
- package/dist/popover/popover-close.mjs.map +1 -1
- package/dist/popover/popover-popup.mjs +1 -1
- package/dist/select/select-root.d.mts +1 -1
- package/dist/select/select-root.d.mts.map +1 -1
- package/dist/select/select-root.mjs +5 -1
- package/dist/select/select-root.mjs.map +1 -1
- package/dist/separator/index.d.mts +3 -0
- package/dist/separator/index.mjs +1 -0
- package/dist/separator/separator.d.mts +58 -0
- package/dist/separator/separator.d.mts.map +1 -0
- package/dist/separator/separator.mjs +41 -0
- package/dist/separator/separator.mjs.map +1 -0
- package/dist/slider/slider-root.mjs +1 -0
- package/dist/slider/slider-root.mjs.map +1 -1
- package/dist/toast/toast-viewport.mjs +1 -1
- package/package.json +6 -1
- package/skills/funstack-ui-knowledge/SKILL.md +14 -9
- package/dist/combobox/use-active-option.mjs.map +0 -1
- package/dist/combobox/use-deferred-leave.mjs.map +0 -1
- package/dist/combobox/use-option-registry.mjs +0 -52
- package/dist/combobox/use-option-registry.mjs.map +0 -1
|
@@ -3,7 +3,7 @@ import { dataAttr } from "../internal/data-attr.mjs";
|
|
|
3
3
|
import { useDevWarning } from "../internal/use-dev-warning.mjs";
|
|
4
4
|
import { useTransitionBoundary } from "../internal/transition-boundary.mjs";
|
|
5
5
|
import { useRender } from "../internal/use-render.mjs";
|
|
6
|
-
import {
|
|
6
|
+
import { useDetailsCheck } from "../internal/details-summary.mjs";
|
|
7
7
|
import { AccordionItemContext, AccordionRootContext } from "./accordion-context.mjs";
|
|
8
8
|
import { use, useCallback, useMemo, useState } from "react";
|
|
9
9
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -28,7 +28,7 @@ function AccordionItem({ value, defaultOpen = false, disabled: disabledProp = fa
|
|
|
28
28
|
useDevWarning(isLibrary && defaultOpen, isDev && "Accordion.Item: `defaultOpen` is ignored in library mode. Use `defaultValue` or `value` on Accordion.Root instead.");
|
|
29
29
|
useDevWarning(!isLibrary && transition !== void 0, isDev && "Accordion.Item: `transition` has no effect in JS-free mode; the browser toggles the item outside any React transition. Animate `::details-content` with CSS instead.");
|
|
30
30
|
const registerItem = root?.registerItem;
|
|
31
|
-
const checkElement =
|
|
31
|
+
const checkElement = useDetailsCheck("Accordion.Item", isDev && "toggle, find-in-page, exclusive groups");
|
|
32
32
|
const libraryRef = useCallback((element) => {
|
|
33
33
|
checkElement?.(element);
|
|
34
34
|
const unregister = registerItem?.(value, element);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion-item.mjs","names":[],"sources":["../../src/accordion/accordion-item.tsx"],"sourcesContent":["\"use client\";\nimport { use, useCallback, useMemo, useState } from \"react\";\nimport type {\n ComponentPropsWithRef,\n CSSProperties,\n ReactNode,\n SyntheticEvent,\n ViewTransitionClass,\n} from \"react\";\nimport { useTransitionBoundary } from \"../internal/transition-boundary.js\";\nimport { dataAttr } from \"../internal/data-attr.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useDevWarning } from \"../internal/use-dev-warning.js\";\nimport { useElementCheck } from \"../internal/use-element-check.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { AccordionItemContext, AccordionRootContext } from \"./accordion-context.js\";\nimport type { AccordionItemContextValue } from \"./accordion-context.js\";\n\nconst isDev = process.env.NODE_ENV !== \"production\";\n\n/**\n * State of `Accordion.Item`, passed to the function forms of `className`, `style`, `children` and\n * `render`.\n */\nexport interface AccordionItemState {\n /** The Item's `value` prop. */\n readonly value: string;\n /** Optimistic open state. `undefined` in JS-free mode (browser-owned, unknown to React). */\n readonly open: boolean | undefined;\n /** This item's open state is changing through an in-flight action. */\n readonly pending: boolean;\n /** Disabled by its own prop or by the Root. */\n readonly disabled: boolean;\n}\n\n/**\n * Props of `Accordion.Item`.\n *\n * @see https://ui.funstack.work/components/accordion\n */\nexport interface AccordionItemProps extends Omit<\n ComponentPropsWithRef<\"details\">,\n \"open\" | \"name\" | \"onToggle\" | \"className\" | \"style\" | \"children\"\n> {\n /** Identifies the item in the Root's `value`. Required in both modes. */\n value: string;\n /**\n * JS-free mode only: renders the initial `open` attribute; the browser owns it from then on.\n * Ignored (dev warning) in library mode, where the Root's `defaultValue` / `value` decide.\n *\n * @defaultValue `false`\n */\n defaultOpen?: boolean;\n /**\n * Disables this item: the Trigger renders `aria-disabled` and never toggles. Enforced by a\n * click handler, so in JS-free mode it does not hold before hydration or with JS off.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n /**\n * Library mode only. Forwarded as `default` to the `<ViewTransition>` around the `<details>`;\n * animates the commit that ends an action (the `open` attribute flip), not the optimistic\n * `data-open` flip. Ignored (dev warning) in JS-free mode.\n *\n * Static: setting or unsetting it remounts the element. Any value, `\"none\"` included, makes a\n * mount or `<Activity>` reveal inside a transition start a document view transition (a ~250 ms\n * page cross-fade that the next transition waits for).\n */\n transition?: ViewTransitionClass;\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, AccordionItemState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, AccordionItemState>;\n /** Content, or a function of the part's state. */\n children?: StateValue<ReactNode, AccordionItemState>;\n /** Must render a `<details>` element. */\n render?: RenderProp<ComponentPropsWithRef<\"details\">, AccordionItemState>;\n}\n\n/**\n * One accordion entry: the `<details>` element. In library mode its `open` attribute follows\n * committed state and `data-open` / `data-pending` follow optimistic state; in JS-free mode (or\n * outside any Root, as a standalone disclosure) the browser owns `open`.\n *\n * @see https://ui.funstack.work/components/accordion\n */\nexport function AccordionItem({\n value,\n defaultOpen = false,\n disabled: disabledProp = false,\n transition,\n className,\n style,\n children,\n render,\n ...rest\n}: AccordionItemProps) {\n const root = use(AccordionRootContext);\n const isLibrary = root?.mode === \"library\";\n const disabled = disabledProp || (root?.disabled ?? false);\n const committedOpen = isLibrary ? root.committed.has(value) : undefined;\n const optimisticOpen = isLibrary ? root.optimistic.has(value) : undefined;\n const rootPending = root?.pending ?? false;\n const pending = isLibrary && rootPending && committedOpen !== optimisticOpen;\n // JS-free mode: the prop React writes never changes after the first render, so React never\n // rewrites the attribute the browser now owns.\n const [staticOpen] = useState(defaultOpen);\n\n useDevWarning(\n isLibrary && defaultOpen,\n isDev &&\n \"Accordion.Item: `defaultOpen` is ignored in library mode. Use `defaultValue` or `value` on \" +\n \"Accordion.Root instead.\",\n );\n useDevWarning(\n !isLibrary && transition !== undefined,\n isDev &&\n \"Accordion.Item: `transition` has no effect in JS-free mode; the browser toggles the item \" +\n \"outside any React transition. Animate `::details-content` with CSS instead.\",\n );\n\n const registerItem = root?.registerItem;\n const checkElement = useElementCheck<HTMLDetailsElement>(\n isDev &&\n ((element) =>\n element.tagName !== \"DETAILS\"\n ? `Accordion.Item: expected to render a <details> element but got <${element.tagName.toLowerCase()}>. ` +\n \"The platform semantics (toggle, find-in-page, exclusive groups) need a real <details>.\"\n : null),\n );\n const libraryRef = useCallback(\n (element: HTMLDetailsElement) => {\n checkElement?.(element);\n const unregister = registerItem?.(value, element);\n return () => {\n unregister?.();\n };\n },\n [checkElement, registerItem, value],\n );\n\n // Platform path (design 2.3): the Root reconciles pre-hydration clicks on mount and re-applies\n // committed state once nothing is in flight; this handler reports the browser's own flips.\n const onToggle = isLibrary\n ? (event: SyntheticEvent<HTMLDetailsElement>) => {\n const element = event.currentTarget;\n // Read `details.open`, never `ToggleEvent.newState`: `toggle` is coalesced.\n if (element.open === committedOpen) return; // our own commit echoing back\n if (disabled) {\n // A disabled item cannot be opened by the browser either; close it again now or, while\n // an action is in flight, when the Root re-applies committed state.\n if (!rootPending) element.open = committedOpen === true;\n return;\n }\n root.dispatchFromDom(value, element.open, event.nativeEvent);\n }\n : undefined;\n\n const state: AccordionItemState = { value, open: optimisticOpen, pending, disabled };\n const dispatch = root?.dispatch;\n const registerTrigger = root?.registerTrigger;\n // Memoised: changes only with this item's own values, not with every Root change.\n const itemContext = useMemo<AccordionItemContextValue>(\n () => ({\n value,\n disabled,\n committedOpen,\n optimisticOpen,\n pending,\n library: isLibrary,\n dispatch,\n registerTrigger,\n }),\n [value, disabled, committedOpen, optimisticOpen, pending, isLibrary, dispatch, registerTrigger],\n );\n\n const element = useRender<ComponentPropsWithRef<\"details\">, AccordionItemState>({\n defaultElement: \"details\",\n render,\n state,\n className,\n style,\n children,\n ref: libraryRef,\n props: rest,\n // Library-controlled layer: `open`, `name` and `onToggle` are owned by the library in at\n // least one mode, so a `render` element cannot override them either (conventions 1.2).\n libraryProps: {\n open: isLibrary ? committedOpen : staticOpen,\n // A click before hydration changes `open` under React's feet in both modes; the mismatch is\n // expected and reconciled (library mode) or the browser's business (JS-free mode).\n suppressHydrationWarning: true,\n // Owned in both modes: in library mode there is one writer of `open`, so a render element's\n // `name` (a second, platform-level writer) is removed.\n name: !isLibrary ? root?.name : undefined,\n // Only installed in library mode; owning the key in static mode would strip a render\n // element's own `onToggle`.\n ...(isLibrary && { onToggle }),\n \"data-open\": dataAttr(optimisticOpen === true),\n \"data-pending\": dataAttr(pending),\n \"data-disabled\": dataAttr(disabled),\n },\n });\n\n return useTransitionBoundary(\n \"Accordion.Item\",\n isLibrary ? transition : undefined,\n <AccordionItemContext value={itemContext}>{element}</AccordionItemContext>,\n );\n}\n\nAccordionItem.displayName = \"AccordionItem\";\n"],"mappings":";;;;;;;;;;AAkBA,MAAM,QAAQ,QAAQ,IAAI,aAAa;;;;;;;;AAqEvC,SAAgB,cAAc,EAC5B,OACA,cAAc,OACd,UAAU,eAAe,OACzB,YACA,WACA,OACA,UACA,QACA,GAAG,QACkB;CACrB,MAAM,OAAO,IAAI,oBAAoB;CACrC,MAAM,YAAY,MAAM,SAAS;CACjC,MAAM,WAAW,iBAAiB,MAAM,YAAY;CACpD,MAAM,gBAAgB,YAAY,KAAK,UAAU,IAAI,KAAK,IAAI,KAAA;CAC9D,MAAM,iBAAiB,YAAY,KAAK,WAAW,IAAI,KAAK,IAAI,KAAA;CAChE,MAAM,cAAc,MAAM,WAAW;CACrC,MAAM,UAAU,aAAa,eAAe,kBAAkB;CAG9D,MAAM,CAAC,cAAc,SAAS,WAAW;CAEzC,cACE,aAAa,aACb,SACE,oHAEJ;CACA,cACE,CAAC,aAAa,eAAe,KAAA,GAC7B,SACE,sKAEJ;CAEA,MAAM,eAAe,MAAM;CAC3B,MAAM,eAAe,gBACnB,WACI,YACA,QAAQ,YAAY,YAChB,mEAAmE,QAAQ,QAAQ,YAAY,EAAE,6FAEjG,KACV;CACA,MAAM,aAAa,aAChB,YAAgC;EAC/B,eAAe,OAAO;EACtB,MAAM,aAAa,eAAe,OAAO,OAAO;EAChD,aAAa;GACX,aAAa;EACf;CACF,GACA;EAAC;EAAc;EAAc;CAAK,CACpC;CAIA,MAAM,WAAW,aACZ,UAA8C;EAC7C,MAAM,UAAU,MAAM;EAEtB,IAAI,QAAQ,SAAS,eAAe;EACpC,IAAI,UAAU;GAGZ,IAAI,CAAC,aAAa,QAAQ,OAAO,kBAAkB;GACnD;EACF;EACA,KAAK,gBAAgB,OAAO,QAAQ,MAAM,MAAM,WAAW;CAC7D,IACA,KAAA;CAEJ,MAAM,QAA4B;EAAE;EAAO,MAAM;EAAgB;EAAS;CAAS;CACnF,MAAM,WAAW,MAAM;CACvB,MAAM,kBAAkB,MAAM;CAE9B,MAAM,cAAc,eACX;EACL;EACA;EACA;EACA;EACA;EACA,SAAS;EACT;EACA;CACF,IACA;EAAC;EAAO;EAAU;EAAe;EAAgB;EAAS;EAAW;EAAU;CAAe,CAChG;CAEA,MAAM,UAAU,UAAgE;EAC9E,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,KAAK;EACL,OAAO;EAGP,cAAc;GACZ,MAAM,YAAY,gBAAgB;GAGlC,0BAA0B;GAG1B,MAAM,CAAC,YAAY,MAAM,OAAO,KAAA;GAGhC,GAAI,aAAa,EAAE,SAAS;GAC5B,aAAa,SAAS,mBAAmB,IAAI;GAC7C,gBAAgB,SAAS,OAAO;GAChC,iBAAiB,SAAS,QAAQ;EACpC;CACF,CAAC;CAED,OAAO,sBACL,kBACA,YAAY,aAAa,KAAA,GACzB,oBAAC,sBAAD;EAAsB,OAAO;EAAc,UAAA;CAA8B,CAAA,CAC3E;AACF;AAEA,cAAc,cAAc"}
|
|
1
|
+
{"version":3,"file":"accordion-item.mjs","names":[],"sources":["../../src/accordion/accordion-item.tsx"],"sourcesContent":["\"use client\";\nimport { use, useCallback, useMemo, useState } from \"react\";\nimport type {\n ComponentPropsWithRef,\n CSSProperties,\n ReactNode,\n SyntheticEvent,\n ViewTransitionClass,\n} from \"react\";\nimport { useTransitionBoundary } from \"../internal/transition-boundary.js\";\nimport { dataAttr } from \"../internal/data-attr.js\";\nimport { useDetailsCheck } from \"../internal/details-summary.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useDevWarning } from \"../internal/use-dev-warning.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { AccordionItemContext, AccordionRootContext } from \"./accordion-context.js\";\nimport type { AccordionItemContextValue } from \"./accordion-context.js\";\n\nconst isDev = process.env.NODE_ENV !== \"production\";\n\n/**\n * State of `Accordion.Item`, passed to the function forms of `className`, `style`, `children` and\n * `render`.\n */\nexport interface AccordionItemState {\n /** The Item's `value` prop. */\n readonly value: string;\n /** Optimistic open state. `undefined` in JS-free mode (browser-owned, unknown to React). */\n readonly open: boolean | undefined;\n /** This item's open state is changing through an in-flight action. */\n readonly pending: boolean;\n /** Disabled by its own prop or by the Root. */\n readonly disabled: boolean;\n}\n\n/**\n * Props of `Accordion.Item`.\n *\n * @see https://ui.funstack.work/components/accordion\n */\nexport interface AccordionItemProps extends Omit<\n ComponentPropsWithRef<\"details\">,\n \"open\" | \"name\" | \"onToggle\" | \"className\" | \"style\" | \"children\"\n> {\n /** Identifies the item in the Root's `value`. Required in both modes. */\n value: string;\n /**\n * JS-free mode only: renders the initial `open` attribute; the browser owns it from then on.\n * Ignored (dev warning) in library mode, where the Root's `defaultValue` / `value` decide.\n *\n * @defaultValue `false`\n */\n defaultOpen?: boolean;\n /**\n * Disables this item: the Trigger renders `aria-disabled` and never toggles. Enforced by a\n * click handler, so in JS-free mode it does not hold before hydration or with JS off.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n /**\n * Library mode only. Forwarded as `default` to the `<ViewTransition>` around the `<details>`;\n * animates the commit that ends an action (the `open` attribute flip), not the optimistic\n * `data-open` flip. Ignored (dev warning) in JS-free mode.\n *\n * Static: setting or unsetting it remounts the element. Any value, `\"none\"` included, makes a\n * mount or `<Activity>` reveal inside a transition start a document view transition (a ~250 ms\n * page cross-fade that the next transition waits for).\n */\n transition?: ViewTransitionClass;\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, AccordionItemState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, AccordionItemState>;\n /** Content, or a function of the part's state. */\n children?: StateValue<ReactNode, AccordionItemState>;\n /** Must render a `<details>` element. */\n render?: RenderProp<ComponentPropsWithRef<\"details\">, AccordionItemState>;\n}\n\n/**\n * One accordion entry: the `<details>` element. In library mode its `open` attribute follows\n * committed state and `data-open` / `data-pending` follow optimistic state; in JS-free mode (or\n * outside any Root, as a standalone disclosure) the browser owns `open`.\n *\n * @see https://ui.funstack.work/components/accordion\n */\nexport function AccordionItem({\n value,\n defaultOpen = false,\n disabled: disabledProp = false,\n transition,\n className,\n style,\n children,\n render,\n ...rest\n}: AccordionItemProps) {\n const root = use(AccordionRootContext);\n const isLibrary = root?.mode === \"library\";\n const disabled = disabledProp || (root?.disabled ?? false);\n const committedOpen = isLibrary ? root.committed.has(value) : undefined;\n const optimisticOpen = isLibrary ? root.optimistic.has(value) : undefined;\n const rootPending = root?.pending ?? false;\n const pending = isLibrary && rootPending && committedOpen !== optimisticOpen;\n // JS-free mode: the prop React writes never changes after the first render, so React never\n // rewrites the attribute the browser now owns.\n const [staticOpen] = useState(defaultOpen);\n\n useDevWarning(\n isLibrary && defaultOpen,\n isDev &&\n \"Accordion.Item: `defaultOpen` is ignored in library mode. Use `defaultValue` or `value` on \" +\n \"Accordion.Root instead.\",\n );\n useDevWarning(\n !isLibrary && transition !== undefined,\n isDev &&\n \"Accordion.Item: `transition` has no effect in JS-free mode; the browser toggles the item \" +\n \"outside any React transition. Animate `::details-content` with CSS instead.\",\n );\n\n const registerItem = root?.registerItem;\n const checkElement = useDetailsCheck(\n \"Accordion.Item\",\n isDev && \"toggle, find-in-page, exclusive groups\",\n );\n const libraryRef = useCallback(\n (element: HTMLDetailsElement) => {\n checkElement?.(element);\n const unregister = registerItem?.(value, element);\n return () => {\n unregister?.();\n };\n },\n [checkElement, registerItem, value],\n );\n\n // Platform path (design 2.3): the Root reconciles pre-hydration clicks on mount and re-applies\n // committed state once nothing is in flight; this handler reports the browser's own flips.\n const onToggle = isLibrary\n ? (event: SyntheticEvent<HTMLDetailsElement>) => {\n const element = event.currentTarget;\n // Read `details.open`, never `ToggleEvent.newState`: `toggle` is coalesced.\n if (element.open === committedOpen) return; // our own commit echoing back\n if (disabled) {\n // A disabled item cannot be opened by the browser either; close it again now or, while\n // an action is in flight, when the Root re-applies committed state.\n if (!rootPending) element.open = committedOpen === true;\n return;\n }\n root.dispatchFromDom(value, element.open, event.nativeEvent);\n }\n : undefined;\n\n const state: AccordionItemState = { value, open: optimisticOpen, pending, disabled };\n const dispatch = root?.dispatch;\n const registerTrigger = root?.registerTrigger;\n // Memoised: changes only with this item's own values, not with every Root change.\n const itemContext = useMemo<AccordionItemContextValue>(\n () => ({\n value,\n disabled,\n committedOpen,\n optimisticOpen,\n pending,\n library: isLibrary,\n dispatch,\n registerTrigger,\n }),\n [value, disabled, committedOpen, optimisticOpen, pending, isLibrary, dispatch, registerTrigger],\n );\n\n const element = useRender<ComponentPropsWithRef<\"details\">, AccordionItemState>({\n defaultElement: \"details\",\n render,\n state,\n className,\n style,\n children,\n ref: libraryRef,\n props: rest,\n // Library-controlled layer: `open`, `name` and `onToggle` are owned by the library in at\n // least one mode, so a `render` element cannot override them either (conventions 1.2).\n libraryProps: {\n open: isLibrary ? committedOpen : staticOpen,\n // A click before hydration changes `open` under React's feet in both modes; the mismatch is\n // expected and reconciled (library mode) or the browser's business (JS-free mode).\n suppressHydrationWarning: true,\n // Owned in both modes: in library mode there is one writer of `open`, so a render element's\n // `name` (a second, platform-level writer) is removed.\n name: !isLibrary ? root?.name : undefined,\n // Only installed in library mode; owning the key in static mode would strip a render\n // element's own `onToggle`.\n ...(isLibrary && { onToggle }),\n \"data-open\": dataAttr(optimisticOpen === true),\n \"data-pending\": dataAttr(pending),\n \"data-disabled\": dataAttr(disabled),\n },\n });\n\n return useTransitionBoundary(\n \"Accordion.Item\",\n isLibrary ? transition : undefined,\n <AccordionItemContext value={itemContext}>{element}</AccordionItemContext>,\n );\n}\n\nAccordionItem.displayName = \"AccordionItem\";\n"],"mappings":";;;;;;;;;;AAkBA,MAAM,QAAQ,QAAQ,IAAI,aAAa;;;;;;;;AAqEvC,SAAgB,cAAc,EAC5B,OACA,cAAc,OACd,UAAU,eAAe,OACzB,YACA,WACA,OACA,UACA,QACA,GAAG,QACkB;CACrB,MAAM,OAAO,IAAI,oBAAoB;CACrC,MAAM,YAAY,MAAM,SAAS;CACjC,MAAM,WAAW,iBAAiB,MAAM,YAAY;CACpD,MAAM,gBAAgB,YAAY,KAAK,UAAU,IAAI,KAAK,IAAI,KAAA;CAC9D,MAAM,iBAAiB,YAAY,KAAK,WAAW,IAAI,KAAK,IAAI,KAAA;CAChE,MAAM,cAAc,MAAM,WAAW;CACrC,MAAM,UAAU,aAAa,eAAe,kBAAkB;CAG9D,MAAM,CAAC,cAAc,SAAS,WAAW;CAEzC,cACE,aAAa,aACb,SACE,oHAEJ;CACA,cACE,CAAC,aAAa,eAAe,KAAA,GAC7B,SACE,sKAEJ;CAEA,MAAM,eAAe,MAAM;CAC3B,MAAM,eAAe,gBACnB,kBACA,SAAS,wCACX;CACA,MAAM,aAAa,aAChB,YAAgC;EAC/B,eAAe,OAAO;EACtB,MAAM,aAAa,eAAe,OAAO,OAAO;EAChD,aAAa;GACX,aAAa;EACf;CACF,GACA;EAAC;EAAc;EAAc;CAAK,CACpC;CAIA,MAAM,WAAW,aACZ,UAA8C;EAC7C,MAAM,UAAU,MAAM;EAEtB,IAAI,QAAQ,SAAS,eAAe;EACpC,IAAI,UAAU;GAGZ,IAAI,CAAC,aAAa,QAAQ,OAAO,kBAAkB;GACnD;EACF;EACA,KAAK,gBAAgB,OAAO,QAAQ,MAAM,MAAM,WAAW;CAC7D,IACA,KAAA;CAEJ,MAAM,QAA4B;EAAE;EAAO,MAAM;EAAgB;EAAS;CAAS;CACnF,MAAM,WAAW,MAAM;CACvB,MAAM,kBAAkB,MAAM;CAE9B,MAAM,cAAc,eACX;EACL;EACA;EACA;EACA;EACA;EACA,SAAS;EACT;EACA;CACF,IACA;EAAC;EAAO;EAAU;EAAe;EAAgB;EAAS;EAAW;EAAU;CAAe,CAChG;CAEA,MAAM,UAAU,UAAgE;EAC9E,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,KAAK;EACL,OAAO;EAGP,cAAc;GACZ,MAAM,YAAY,gBAAgB;GAGlC,0BAA0B;GAG1B,MAAM,CAAC,YAAY,MAAM,OAAO,KAAA;GAGhC,GAAI,aAAa,EAAE,SAAS;GAC5B,aAAa,SAAS,mBAAmB,IAAI;GAC7C,gBAAgB,SAAS,OAAO;GAChC,iBAAiB,SAAS,QAAQ;EACpC;CACF,CAAC;CAED,OAAO,sBACL,kBACA,YAAY,aAAa,KAAA,GACzB,oBAAC,sBAAD;EAAsB,OAAO;EAAc,UAAA;CAA8B,CAAA,CAC3E;AACF;AAEA,cAAc,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion-trigger.d.mts","names":[],"sources":["../../src/accordion/accordion-trigger.tsx"],"mappings":";;;;;YAqBY,wBAAwB;;;;;;iBAOnB,8BAA8B,KAC7C;;;;;;;;;;EAYA,aAAa;;EAEb,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,kCAAkC;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"accordion-trigger.d.mts","names":[],"sources":["../../src/accordion/accordion-trigger.tsx"],"mappings":";;;;;YAqBY,wBAAwB;;;;;;iBAOnB,8BAA8B,KAC7C;;;;;;;;;;EAYA,aAAa;;EAEb,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,kCAAkC;;;;;;;;;;wBAWxC,mBACd,YACA,WACA,OACA,UACA,WACG,QACF,wBAAqB;yBAPR"}
|
|
@@ -3,23 +3,11 @@ import { dataAttr } from "../internal/data-attr.mjs";
|
|
|
3
3
|
import { useDevWarning } from "../internal/use-dev-warning.mjs";
|
|
4
4
|
import { useTransitionBoundary } from "../internal/transition-boundary.mjs";
|
|
5
5
|
import { useRender } from "../internal/use-render.mjs";
|
|
6
|
-
import {
|
|
6
|
+
import { interceptSummaryClick, useSummaryCheck } from "../internal/details-summary.mjs";
|
|
7
7
|
import { AccordionItemContext } from "./accordion-context.mjs";
|
|
8
8
|
import { use, useCallback } from "react";
|
|
9
9
|
//#region src/accordion/accordion-trigger.tsx
|
|
10
10
|
const isDev = process.env.NODE_ENV !== "production";
|
|
11
|
-
const NESTED_INTERACTIVE = "a[href], button, label, input, select, textarea, [contenteditable]:not([contenteditable='false'])";
|
|
12
|
-
/**
|
|
13
|
-
* Nested controls with an activation behaviour of their own. The browser runs theirs instead of
|
|
14
|
-
* the summary's (no toggle), so their click must keep its default: navigation, check, submit.
|
|
15
|
-
*/
|
|
16
|
-
const SELF_ACTIVATING = "a[href], button, label, input:is([type='button'], [type='submit'], [type='reset'], [type='image'], [type='checkbox'], [type='radio'], [type='file'], [type='color'])";
|
|
17
|
-
/** The interactive descendant of the summary that was clicked (a link in the heading), if any. */
|
|
18
|
-
function nestedInteractive(target, summary) {
|
|
19
|
-
if (!(target instanceof Element) || target === summary) return null;
|
|
20
|
-
const interactive = target.closest(NESTED_INTERACTIVE);
|
|
21
|
-
return interactive !== null && interactive !== summary && summary.contains(interactive) ? interactive : null;
|
|
22
|
-
}
|
|
23
11
|
/**
|
|
24
12
|
* The item's disclosure control: the `<summary>`, which must be the first child of the Item. In
|
|
25
13
|
* library mode the click is intercepted and dispatched through the Root's transition; the
|
|
@@ -34,7 +22,7 @@ function AccordionTrigger({ transition, className, style, children, render, ...r
|
|
|
34
22
|
const isLibrary = item.library;
|
|
35
23
|
useDevWarning(!isLibrary && transition !== void 0, isDev && "Accordion.Trigger: `transition` has no effect in JS-free mode; the browser toggles the item outside any React transition.");
|
|
36
24
|
const registerTrigger = item.registerTrigger;
|
|
37
|
-
const checkElement =
|
|
25
|
+
const checkElement = useSummaryCheck("Accordion.Trigger");
|
|
38
26
|
const libraryRef = useCallback((element) => {
|
|
39
27
|
checkElement?.(element);
|
|
40
28
|
const unregister = registerTrigger?.(element);
|
|
@@ -49,12 +37,7 @@ function AccordionTrigger({ transition, className, style, children, render, ...r
|
|
|
49
37
|
disabled: item.disabled
|
|
50
38
|
};
|
|
51
39
|
const onClick = isLibrary || item.disabled ? (event) => {
|
|
52
|
-
|
|
53
|
-
if (nested !== null) {
|
|
54
|
-
if (!nested.matches(SELF_ACTIVATING)) event.preventDefault();
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
event.preventDefault();
|
|
40
|
+
if (!interceptSummaryClick(event)) return;
|
|
58
41
|
if (item.disabled || !isLibrary) return;
|
|
59
42
|
item.dispatch?.(item.value, !item.optimisticOpen, event.nativeEvent);
|
|
60
43
|
} : void 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion-trigger.mjs","names":[],"sources":["../../src/accordion/accordion-trigger.tsx"],"sourcesContent":["\"use client\";\nimport { use, useCallback } from \"react\";\nimport type {\n ComponentPropsWithRef,\n CSSProperties,\n MouseEvent,\n ReactNode,\n ViewTransitionClass,\n} from \"react\";\nimport { useTransitionBoundary } from \"../internal/transition-boundary.js\";\nimport { dataAttr } from \"../internal/data-attr.js\";\nimport
|
|
1
|
+
{"version":3,"file":"accordion-trigger.mjs","names":[],"sources":["../../src/accordion/accordion-trigger.tsx"],"sourcesContent":["\"use client\";\nimport { use, useCallback } from \"react\";\nimport type {\n ComponentPropsWithRef,\n CSSProperties,\n MouseEvent,\n ReactNode,\n ViewTransitionClass,\n} from \"react\";\nimport { useTransitionBoundary } from \"../internal/transition-boundary.js\";\nimport { dataAttr } from \"../internal/data-attr.js\";\nimport { interceptSummaryClick, useSummaryCheck } from \"../internal/details-summary.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useDevWarning } from \"../internal/use-dev-warning.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { AccordionItemContext } from \"./accordion-context.js\";\nimport type { AccordionItemState } from \"./accordion-item.js\";\n\nconst isDev = process.env.NODE_ENV !== \"production\";\n\n/** The trigger is the item's control; it renders the item's state object. */\nexport type AccordionTriggerState = AccordionItemState;\n\n/**\n * Props of `Accordion.Trigger`.\n *\n * @see https://ui.funstack.work/components/accordion\n */\nexport interface AccordionTriggerProps extends Omit<\n ComponentPropsWithRef<\"summary\">,\n \"onClick\" | \"className\" | \"style\" | \"children\"\n> {\n /**\n * Library mode only. Forwarded as `default` to the `<ViewTransition>` around the `<summary>`.\n * Animates only the commit that ends an action (for example a spinner rendered from `pending`\n * disappearing); the optimistic `data-open` flip is a CSS job.\n *\n * Static: setting or unsetting it remounts the element. Any value, `\"none\"` included, makes a\n * mount or `<Activity>` reveal inside a transition start a document view transition (a ~250 ms\n * page cross-fade that the next transition waits for).\n */\n transition?: ViewTransitionClass;\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, AccordionTriggerState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, AccordionTriggerState>;\n /** Rendered from optimistic state; must not suspend. A heading inside is recommended. */\n children?: StateValue<ReactNode, AccordionTriggerState>;\n /** Must render a `<summary>` element. */\n render?: RenderProp<ComponentPropsWithRef<\"summary\">, AccordionTriggerState>;\n}\n\n/**\n * The item's disclosure control: the `<summary>`, which must be the first child of the Item. In\n * library mode the click is intercepted and dispatched through the Root's transition; the\n * element shows optimistic `data-open` and `data-pending`. The platform forbids `aria-expanded`\n * on a summary, so assistive technology hears the committed state (from `<details open>`).\n *\n * @see https://ui.funstack.work/components/accordion\n */\nexport function AccordionTrigger({\n transition,\n className,\n style,\n children,\n render,\n ...rest\n}: AccordionTriggerProps) {\n // Only the Item's context (memoised per item), which carries what is needed of the Root's.\n const item = use(AccordionItemContext);\n if (item === null) {\n throw new Error(\"Accordion.Trigger must be rendered inside an Accordion.Item.\");\n }\n const isLibrary = item.library;\n\n useDevWarning(\n !isLibrary && transition !== undefined,\n isDev &&\n \"Accordion.Trigger: `transition` has no effect in JS-free mode; the browser toggles the item \" +\n \"outside any React transition.\",\n );\n\n const registerTrigger = item.registerTrigger;\n const checkElement = useSummaryCheck(\"Accordion.Trigger\");\n const libraryRef = useCallback(\n (element: HTMLElement) => {\n checkElement?.(element);\n const unregister = registerTrigger?.(element);\n // Always return a cleanup so the merged ref never calls back with `null`.\n return () => {\n unregister?.();\n };\n },\n [checkElement, registerTrigger],\n );\n\n const state: AccordionTriggerState = {\n value: item.value,\n open: item.optimisticOpen,\n pending: item.pending,\n disabled: item.disabled,\n };\n\n // JS-free mode attaches no click handler unless the item is disabled (design 2.1 / section 6).\n const onClick =\n isLibrary || item.disabled\n ? (event: MouseEvent<HTMLElement>) => {\n // A nested control never toggles; any other click is cancelled, which is what keeps the\n // browser from touching `open`.\n if (!interceptSummaryClick(event)) return;\n if (item.disabled || !isLibrary) return;\n item.dispatch?.(item.value, !item.optimisticOpen, event.nativeEvent);\n }\n : undefined;\n\n const element = useRender<ComponentPropsWithRef<\"summary\">, AccordionTriggerState>({\n defaultElement: \"summary\",\n render,\n state,\n className,\n style,\n children,\n ref: libraryRef,\n props: rest,\n // Library-controlled layer: wins over a `render` element's props (conventions 1.2).\n libraryProps: {\n \"aria-disabled\": item.disabled ? true : undefined,\n \"data-open\": dataAttr(item.optimisticOpen === true),\n \"data-pending\": dataAttr(item.pending),\n \"data-disabled\": dataAttr(item.disabled),\n // Only owned when installed, so a render element keeps its own `onClick` in JS-free mode.\n ...(onClick && { onClick }),\n },\n });\n\n return useTransitionBoundary(\"Accordion.Trigger\", isLibrary ? transition : undefined, element);\n}\n\nAccordionTrigger.displayName = \"AccordionTrigger\";\n"],"mappings":";;;;;;;;;AAkBA,MAAM,QAAQ,QAAQ,IAAI,aAAa;;;;;;;;;AA0CvC,SAAgB,iBAAiB,EAC/B,YACA,WACA,OACA,UACA,QACA,GAAG,QACqB;CAExB,MAAM,OAAO,IAAI,oBAAoB;CACrC,IAAI,SAAS,MACX,MAAM,IAAI,MAAM,8DAA8D;CAEhF,MAAM,YAAY,KAAK;CAEvB,cACE,CAAC,aAAa,eAAe,KAAA,GAC7B,SACE,2HAEJ;CAEA,MAAM,kBAAkB,KAAK;CAC7B,MAAM,eAAe,gBAAgB,mBAAmB;CACxD,MAAM,aAAa,aAChB,YAAyB;EACxB,eAAe,OAAO;EACtB,MAAM,aAAa,kBAAkB,OAAO;EAE5C,aAAa;GACX,aAAa;EACf;CACF,GACA,CAAC,cAAc,eAAe,CAChC;CAEA,MAAM,QAA+B;EACnC,OAAO,KAAK;EACZ,MAAM,KAAK;EACX,SAAS,KAAK;EACd,UAAU,KAAK;CACjB;CAGA,MAAM,UACJ,aAAa,KAAK,YACb,UAAmC;EAGlC,IAAI,CAAC,sBAAsB,KAAK,GAAG;EACnC,IAAI,KAAK,YAAY,CAAC,WAAW;EACjC,KAAK,WAAW,KAAK,OAAO,CAAC,KAAK,gBAAgB,MAAM,WAAW;CACrE,IACA,KAAA;CAEN,MAAM,UAAU,UAAmE;EACjF,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,KAAK;EACL,OAAO;EAEP,cAAc;GACZ,iBAAiB,KAAK,WAAW,OAAO,KAAA;GACxC,aAAa,SAAS,KAAK,mBAAmB,IAAI;GAClD,gBAAgB,SAAS,KAAK,OAAO;GACrC,iBAAiB,SAAS,KAAK,QAAQ;GAEvC,GAAI,WAAW,EAAE,QAAQ;EAC3B;CACF,CAAC;CAED,OAAO,sBAAsB,qBAAqB,YAAY,aAAa,KAAA,GAAW,OAAO;AAC/F;AAEA,iBAAiB,cAAc"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Action, RenderProp, StateValue, WhilePending } from "../internal/types.mjs";
|
|
2
|
+
import { DialogCloseDetails, DialogCloseState } from "../dialog/dialog-close.mjs";
|
|
3
|
+
import { CSSProperties, ComponentPropsWithRef, ReactNode } from "react";
|
|
4
|
+
//#region src/alert-dialog/alert-dialog-action.d.ts
|
|
5
|
+
/** State of `AlertDialog.Action`, passed to the function forms of `className`, `style`, `children` and `render`. */
|
|
6
|
+
export type AlertDialogActionState = DialogCloseState;
|
|
7
|
+
/** Details passed to `AlertDialog.Action`'s `action`. */
|
|
8
|
+
export type AlertDialogActionDetails = DialogCloseDetails;
|
|
9
|
+
/**
|
|
10
|
+
* Props of `AlertDialog.Action`.
|
|
11
|
+
*
|
|
12
|
+
* @see https://ui.funstack.work/components/alert-dialog
|
|
13
|
+
*/
|
|
14
|
+
export interface AlertDialogActionProps extends Omit<ComponentPropsWithRef<"button">, "onClick" | "value" | "className" | "style" | "children"> {
|
|
15
|
+
/**
|
|
16
|
+
* The confirmed work. Runs inside this part's own transition (`data-pending` on the button),
|
|
17
|
+
* then closes the dialog with `value` as `returnValue`: in library mode through the Root
|
|
18
|
+
* (`openChangeAction(false)` awaited, view transition if set), in JS-free mode with
|
|
19
|
+
* `close(value)`. A rejection reaches the nearest Error Boundary above this part and leaves
|
|
20
|
+
* the dialog open. If the dialog was dismissed and opened again while the action ran, the
|
|
21
|
+
* close is dropped. Escape or a Cancel while it runs closes the dialog; the action keeps
|
|
22
|
+
* running (it is hidden, not aborted).
|
|
23
|
+
*
|
|
24
|
+
* With `action` the button is no native close invoker (no `commandfor` / `command`): a click
|
|
25
|
+
* before hydration does nothing, rather than closing the dialog as if the work had been done.
|
|
26
|
+
* The confirm that works before hydration is `AlertDialog.Form`. Without `action` the button
|
|
27
|
+
* only closes the dialog (read `returnValue` in `openChangeAction`).
|
|
28
|
+
*/
|
|
29
|
+
action?: Action<[details: AlertDialogActionDetails]>;
|
|
30
|
+
/**
|
|
31
|
+
* What a click does while the `action` is pending. `"ignore"`: nothing (the click is
|
|
32
|
+
* cancelled, `aria-disabled="true"` meanwhile). `"run"`: the action runs again; the dialog
|
|
33
|
+
* closes once, after the last run and only if the latest one resolved.
|
|
34
|
+
*
|
|
35
|
+
* @defaultValue `"ignore"`
|
|
36
|
+
*/
|
|
37
|
+
whilePending?: WhilePending;
|
|
38
|
+
/** Becomes `dialog.returnValue` (and `details.returnValue` of the close request). */
|
|
39
|
+
value?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Never runs or closes. Native `disabled` on a `<button>`; owned. With a link or component
|
|
42
|
+
* `render`, `aria-disabled="true"` instead.
|
|
43
|
+
*
|
|
44
|
+
* @defaultValue `false`
|
|
45
|
+
*/
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
/** Class name, or a function of the part's state that returns one. */
|
|
48
|
+
className?: StateValue<string | undefined, AlertDialogActionState>;
|
|
49
|
+
/** Inline style, or a function of the part's state that returns one. */
|
|
50
|
+
style?: StateValue<CSSProperties | undefined, AlertDialogActionState>;
|
|
51
|
+
/** Content, or a function of the part's state (`pending ? "Deleting…" : "Delete"`). */
|
|
52
|
+
children?: StateValue<ReactNode, AlertDialogActionState>;
|
|
53
|
+
/** Replace the default `<button>` (element form) or take over rendering (function form). */
|
|
54
|
+
render?: RenderProp<ComponentPropsWithRef<"button">, AlertDialogActionState>;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The confirm button: `Dialog.Close` with an `action` (design 3.2). The action runs in this
|
|
58
|
+
* part's own transition (`data-pending` and, by default, `aria-disabled` on the button), then
|
|
59
|
+
* the dialog closes; a rejection leaves it open. Unlike `Dialog.Close`, an Action with `action`
|
|
60
|
+
* renders no `commandfor` / `command`.
|
|
61
|
+
*
|
|
62
|
+
* Owned keys (conventions 1.2): `type` (on a `<button>` only), `disabled`, `commandfor`,
|
|
63
|
+
* `command`, `value`, `onClick` (library mode, or with `action`), `aria-disabled`,
|
|
64
|
+
* `data-pending`, `data-disabled`.
|
|
65
|
+
*
|
|
66
|
+
* @see https://ui.funstack.work/components/alert-dialog
|
|
67
|
+
*/
|
|
68
|
+
export declare function AlertDialogAction(props: AlertDialogActionProps): ReactNode;
|
|
69
|
+
export declare namespace AlertDialogAction {
|
|
70
|
+
var displayName: string;
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
73
|
+
//# sourceMappingURL=alert-dialog-action.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-dialog-action.d.mts","names":[],"sources":["../../src/alert-dialog/alert-dialog-action.tsx"],"mappings":";;;;;YAOY,yBAAyB;;YAGzB,2BAA2B;;;;;;iBAOtB,+BAA+B,KAC9C;;;;;;;;;;;;;;;EAiBA,SAAS,QAAQ,SAAS;;;;;;;;EAQ1B,eAAe;;EAEf;;;;;;;EAOA;;EAEA,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,iCAAiC;;;;;;;;;;;;;;wBAevC,kBAAkB,OAAO,yBAAsB;yBAA/C"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useDialogClose } from "../dialog/dialog-close.mjs";
|
|
3
|
+
//#region src/alert-dialog/alert-dialog-action.tsx
|
|
4
|
+
/**
|
|
5
|
+
* The confirm button: `Dialog.Close` with an `action` (design 3.2). The action runs in this
|
|
6
|
+
* part's own transition (`data-pending` and, by default, `aria-disabled` on the button), then
|
|
7
|
+
* the dialog closes; a rejection leaves it open. Unlike `Dialog.Close`, an Action with `action`
|
|
8
|
+
* renders no `commandfor` / `command`.
|
|
9
|
+
*
|
|
10
|
+
* Owned keys (conventions 1.2): `type` (on a `<button>` only), `disabled`, `commandfor`,
|
|
11
|
+
* `command`, `value`, `onClick` (library mode, or with `action`), `aria-disabled`,
|
|
12
|
+
* `data-pending`, `data-disabled`.
|
|
13
|
+
*
|
|
14
|
+
* @see https://ui.funstack.work/components/alert-dialog
|
|
15
|
+
*/
|
|
16
|
+
function AlertDialogAction(props) {
|
|
17
|
+
return useDialogClose(props, { part: "AlertDialog.Action" });
|
|
18
|
+
}
|
|
19
|
+
AlertDialogAction.displayName = "AlertDialogAction";
|
|
20
|
+
//#endregion
|
|
21
|
+
export { AlertDialogAction };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=alert-dialog-action.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-dialog-action.mjs","names":[],"sources":["../../src/alert-dialog/alert-dialog-action.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport { useDialogClose } from \"../dialog/dialog-close.js\";\nimport type { DialogCloseDetails, DialogCloseState } from \"../dialog/dialog-close.js\";\nimport type { Action, RenderProp, StateValue, WhilePending } from \"../internal/types.js\";\n\n/** State of `AlertDialog.Action`, passed to the function forms of `className`, `style`, `children` and `render`. */\nexport type AlertDialogActionState = DialogCloseState;\n\n/** Details passed to `AlertDialog.Action`'s `action`. */\nexport type AlertDialogActionDetails = DialogCloseDetails;\n\n/**\n * Props of `AlertDialog.Action`.\n *\n * @see https://ui.funstack.work/components/alert-dialog\n */\nexport interface AlertDialogActionProps extends Omit<\n ComponentPropsWithRef<\"button\">,\n \"onClick\" | \"value\" | \"className\" | \"style\" | \"children\"\n> {\n /**\n * The confirmed work. Runs inside this part's own transition (`data-pending` on the button),\n * then closes the dialog with `value` as `returnValue`: in library mode through the Root\n * (`openChangeAction(false)` awaited, view transition if set), in JS-free mode with\n * `close(value)`. A rejection reaches the nearest Error Boundary above this part and leaves\n * the dialog open. If the dialog was dismissed and opened again while the action ran, the\n * close is dropped. Escape or a Cancel while it runs closes the dialog; the action keeps\n * running (it is hidden, not aborted).\n *\n * With `action` the button is no native close invoker (no `commandfor` / `command`): a click\n * before hydration does nothing, rather than closing the dialog as if the work had been done.\n * The confirm that works before hydration is `AlertDialog.Form`. Without `action` the button\n * only closes the dialog (read `returnValue` in `openChangeAction`).\n */\n action?: Action<[details: AlertDialogActionDetails]>;\n /**\n * What a click does while the `action` is pending. `\"ignore\"`: nothing (the click is\n * cancelled, `aria-disabled=\"true\"` meanwhile). `\"run\"`: the action runs again; the dialog\n * closes once, after the last run and only if the latest one resolved.\n *\n * @defaultValue `\"ignore\"`\n */\n whilePending?: WhilePending;\n /** Becomes `dialog.returnValue` (and `details.returnValue` of the close request). */\n value?: string;\n /**\n * Never runs or closes. Native `disabled` on a `<button>`; owned. With a link or component\n * `render`, `aria-disabled=\"true\"` instead.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, AlertDialogActionState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, AlertDialogActionState>;\n /** Content, or a function of the part's state (`pending ? \"Deleting…\" : \"Delete\"`). */\n children?: StateValue<ReactNode, AlertDialogActionState>;\n /** Replace the default `<button>` (element form) or take over rendering (function form). */\n render?: RenderProp<ComponentPropsWithRef<\"button\">, AlertDialogActionState>;\n}\n\n/**\n * The confirm button: `Dialog.Close` with an `action` (design 3.2). The action runs in this\n * part's own transition (`data-pending` and, by default, `aria-disabled` on the button), then\n * the dialog closes; a rejection leaves it open. Unlike `Dialog.Close`, an Action with `action`\n * renders no `commandfor` / `command`.\n *\n * Owned keys (conventions 1.2): `type` (on a `<button>` only), `disabled`, `commandfor`,\n * `command`, `value`, `onClick` (library mode, or with `action`), `aria-disabled`,\n * `data-pending`, `data-disabled`.\n *\n * @see https://ui.funstack.work/components/alert-dialog\n */\nexport function AlertDialogAction(props: AlertDialogActionProps) {\n // With `action` no native command, as every Close part (#182).\n return useDialogClose(props, { part: \"AlertDialog.Action\" });\n}\n\nAlertDialogAction.displayName = \"AlertDialogAction\";\n"],"mappings":";;;;;;;;;;;;;;;AA2EA,SAAgB,kBAAkB,OAA+B;CAE/D,OAAO,eAAe,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC7D;AAEA,kBAAkB,cAAc"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { DialogCloseDetails, DialogCloseProps, DialogCloseState } from "../dialog/dialog-close.mjs";
|
|
2
|
+
//#region src/alert-dialog/alert-dialog-cancel.d.ts
|
|
3
|
+
/** State of `AlertDialog.Cancel`: Dialog.Close's. */
|
|
4
|
+
export type AlertDialogCancelState = DialogCloseState;
|
|
5
|
+
/** Details passed to `AlertDialog.Cancel`'s `action`: Dialog.Close's. */
|
|
6
|
+
export type AlertDialogCancelDetails = DialogCloseDetails;
|
|
7
|
+
/**
|
|
8
|
+
* Props of `AlertDialog.Cancel`: `Dialog.Close`'s (`value` defaults to `""`, what Escape
|
|
9
|
+
* leaves in `returnValue`).
|
|
10
|
+
*
|
|
11
|
+
* @see https://ui.funstack.work/components/alert-dialog
|
|
12
|
+
*/
|
|
13
|
+
export type AlertDialogCancelProps = DialogCloseProps;
|
|
14
|
+
/**
|
|
15
|
+
* The safe answer: `Dialog.Close` under another name (`<button type="button" commandfor
|
|
16
|
+
* command="request-close">` in JS-free mode, a close through the Root in library mode), and the
|
|
17
|
+
* default initial focus target (design 3.4): when the Popup has no `initialFocus`, the dialog
|
|
18
|
+
* opens with focus on the first enabled Cancel. In JS-free mode it carries `autofocus`, in the
|
|
19
|
+
* server HTML too, so the focus is right before hydration.
|
|
20
|
+
*
|
|
21
|
+
* Owned keys (conventions 1.2): Dialog.Close's, and `autoFocus` in the server and hydration render
|
|
22
|
+
* while it is the default target in JS-free mode.
|
|
23
|
+
*
|
|
24
|
+
* @see https://ui.funstack.work/components/alert-dialog
|
|
25
|
+
*/
|
|
26
|
+
export declare function AlertDialogCancel({ disabled, ref, ...rest }: AlertDialogCancelProps): import("react").ReactNode;
|
|
27
|
+
export declare namespace AlertDialogCancel {
|
|
28
|
+
var displayName: string;
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
//# sourceMappingURL=alert-dialog-cancel.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-dialog-cancel.d.mts","names":[],"sources":["../../src/alert-dialog/alert-dialog-cancel.tsx"],"mappings":";;;YAcY,yBAAyB;;YAGzB,2BAA2B;;;;;;;YAQ3B,yBAAyB;;;;;;;;;;;;;wBAcrB,oBAAoB,UAAU,QAAQ,QAAQ,yCAAsB;yBAApE"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useMergedRefs } from "../internal/use-merged-refs.mjs";
|
|
3
|
+
import { useDialogContext } from "../dialog/dialog-context.mjs";
|
|
4
|
+
import { useDialogClose } from "../dialog/dialog-close.mjs";
|
|
5
|
+
import { useHydratedMount } from "../internal/use-hydrated-mount.mjs";
|
|
6
|
+
import { AlertDialogCancelContext } from "./alert-dialog-context.mjs";
|
|
7
|
+
import { use, useCallback } from "react";
|
|
8
|
+
//#region src/alert-dialog/alert-dialog-cancel.tsx
|
|
9
|
+
/**
|
|
10
|
+
* The safe answer: `Dialog.Close` under another name (`<button type="button" commandfor
|
|
11
|
+
* command="request-close">` in JS-free mode, a close through the Root in library mode), and the
|
|
12
|
+
* default initial focus target (design 3.4): when the Popup has no `initialFocus`, the dialog
|
|
13
|
+
* opens with focus on the first enabled Cancel. In JS-free mode it carries `autofocus`, in the
|
|
14
|
+
* server HTML too, so the focus is right before hydration.
|
|
15
|
+
*
|
|
16
|
+
* Owned keys (conventions 1.2): Dialog.Close's, and `autoFocus` in the server and hydration render
|
|
17
|
+
* while it is the default target in JS-free mode.
|
|
18
|
+
*
|
|
19
|
+
* @see https://ui.funstack.work/components/alert-dialog
|
|
20
|
+
*/
|
|
21
|
+
function AlertDialogCancel({ disabled, ref, ...rest }) {
|
|
22
|
+
const ctx = useDialogContext("AlertDialog.Cancel");
|
|
23
|
+
const cancels = use(AlertDialogCancelContext);
|
|
24
|
+
const register = cancels?.register;
|
|
25
|
+
const autofocus = ctx.mode !== "library" && cancels !== null && cancels.defaultFocus && disabled !== true;
|
|
26
|
+
const serverOrHydrating = useHydratedMount();
|
|
27
|
+
const attach = useCallback((element) => {
|
|
28
|
+
if (element === null) return;
|
|
29
|
+
const unregister = register?.(element);
|
|
30
|
+
if (autofocus) element.setAttribute("autofocus", "");
|
|
31
|
+
return () => {
|
|
32
|
+
unregister?.();
|
|
33
|
+
if (autofocus) element.removeAttribute("autofocus");
|
|
34
|
+
};
|
|
35
|
+
}, [register, autofocus]);
|
|
36
|
+
const mergedRef = useMergedRefs(attach, ref);
|
|
37
|
+
return useDialogClose({
|
|
38
|
+
...rest,
|
|
39
|
+
disabled,
|
|
40
|
+
ref: mergedRef
|
|
41
|
+
}, {
|
|
42
|
+
part: "AlertDialog.Cancel",
|
|
43
|
+
ownProps: autofocus && serverOrHydrating ? { autoFocus: true } : void 0
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
AlertDialogCancel.displayName = "AlertDialogCancel";
|
|
47
|
+
//#endregion
|
|
48
|
+
export { AlertDialogCancel };
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=alert-dialog-cancel.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-dialog-cancel.mjs","names":[],"sources":["../../src/alert-dialog/alert-dialog-cancel.tsx"],"sourcesContent":["\"use client\";\nimport { use, useCallback } from \"react\";\nimport { useDialogClose } from \"../dialog/dialog-close.js\";\nimport type {\n DialogCloseDetails,\n DialogCloseProps,\n DialogCloseState,\n} from \"../dialog/dialog-close.js\";\nimport { useDialogContext } from \"../dialog/dialog-context.js\";\nimport { useHydratedMount } from \"../internal/use-hydrated-mount.js\";\nimport { useMergedRefs } from \"../internal/use-merged-refs.js\";\nimport { AlertDialogCancelContext } from \"./alert-dialog-context.js\";\n\n/** State of `AlertDialog.Cancel`: Dialog.Close's. */\nexport type AlertDialogCancelState = DialogCloseState;\n\n/** Details passed to `AlertDialog.Cancel`'s `action`: Dialog.Close's. */\nexport type AlertDialogCancelDetails = DialogCloseDetails;\n\n/**\n * Props of `AlertDialog.Cancel`: `Dialog.Close`'s (`value` defaults to `\"\"`, what Escape\n * leaves in `returnValue`).\n *\n * @see https://ui.funstack.work/components/alert-dialog\n */\nexport type AlertDialogCancelProps = DialogCloseProps;\n\n/**\n * The safe answer: `Dialog.Close` under another name (`<button type=\"button\" commandfor\n * command=\"request-close\">` in JS-free mode, a close through the Root in library mode), and the\n * default initial focus target (design 3.4): when the Popup has no `initialFocus`, the dialog\n * opens with focus on the first enabled Cancel. In JS-free mode it carries `autofocus`, in the\n * server HTML too, so the focus is right before hydration.\n *\n * Owned keys (conventions 1.2): Dialog.Close's, and `autoFocus` in the server and hydration render\n * while it is the default target in JS-free mode.\n *\n * @see https://ui.funstack.work/components/alert-dialog\n */\nexport function AlertDialogCancel({ disabled, ref, ...rest }: AlertDialogCancelProps) {\n const ctx = useDialogContext(\"AlertDialog.Cancel\");\n const cancels = use(AlertDialogCancelContext);\n const register = cancels?.register;\n // JS-free mode: the browser opens the dialog itself, so the attribute has to be on the element\n // already (design 3.4). React renders `autoFocus` in the server HTML but does not write it on\n // a client render; the ref writes it there. Not on a disabled Cancel: the rule is the first\n // enabled one.\n const autofocus =\n ctx.mode !== \"library\" && cancels !== null && cancels.defaultFocus && disabled !== true;\n // React's `autoFocus` prop only where it writes the attribute: the server render and the\n // render that hydrates it (no `.focus()` there). On a client-created mount React would call\n // `.focus()` instead, so a Cancel mounting or remounting into an open dialog would take focus\n // (and of two, the last would win); there the ref's attribute is enough.\n const serverOrHydrating = useHydratedMount();\n\n const attach = useCallback(\n (element: HTMLElement | null) => {\n if (element === null) return;\n const unregister = register?.(element);\n // Owned while it is the target: removed when it stops being one (disabled, or an\n // `initialFocus` given), the server-rendered attribute included.\n if (autofocus) element.setAttribute(\"autofocus\", \"\");\n return () => {\n unregister?.();\n if (autofocus) element.removeAttribute(\"autofocus\");\n };\n },\n [register, autofocus],\n );\n const mergedRef = useMergedRefs<HTMLButtonElement | null>(attach, ref);\n\n return useDialogClose(\n { ...rest, disabled, ref: mergedRef },\n {\n part: \"AlertDialog.Cancel\",\n ownProps: autofocus && serverOrHydrating ? { autoFocus: true } : undefined,\n },\n );\n}\n\nAlertDialogCancel.displayName = \"AlertDialogCancel\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAuCA,SAAgB,kBAAkB,EAAE,UAAU,KAAK,GAAG,QAAgC;CACpF,MAAM,MAAM,iBAAiB,oBAAoB;CACjD,MAAM,UAAU,IAAI,wBAAwB;CAC5C,MAAM,WAAW,SAAS;CAK1B,MAAM,YACJ,IAAI,SAAS,aAAa,YAAY,QAAQ,QAAQ,gBAAgB,aAAa;CAKrF,MAAM,oBAAoB,iBAAiB;CAE3C,MAAM,SAAS,aACZ,YAAgC;EAC/B,IAAI,YAAY,MAAM;EACtB,MAAM,aAAa,WAAW,OAAO;EAGrC,IAAI,WAAW,QAAQ,aAAa,aAAa,EAAE;EACnD,aAAa;GACX,aAAa;GACb,IAAI,WAAW,QAAQ,gBAAgB,WAAW;EACpD;CACF,GACA,CAAC,UAAU,SAAS,CACtB;CACA,MAAM,YAAY,cAAwC,QAAQ,GAAG;CAErE,OAAO,eACL;EAAE,GAAG;EAAM;EAAU,KAAK;CAAU,GACpC;EACE,MAAM;EACN,UAAU,aAAa,oBAAoB,EAAE,WAAW,KAAK,IAAI,KAAA;CACnE,CACF;AACF;AAEA,kBAAkB,cAAc"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { compareDocumentOrder } from "../internal/dom-order.mjs";
|
|
3
|
+
import { createContext } from "react";
|
|
4
|
+
//#region src/alert-dialog/alert-dialog-context.ts
|
|
5
|
+
const AlertDialogCancelContext = createContext(null);
|
|
6
|
+
function isDisabled(element) {
|
|
7
|
+
return element.matches(":disabled") || element.getAttribute("aria-disabled") === "true";
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The first registered Cancel, in tree order, that belongs to `dialog` (not to a dialog nested
|
|
11
|
+
* in it) and is not disabled; `null` without one, and the platform chooses (design 3.4).
|
|
12
|
+
*/
|
|
13
|
+
function firstEnabledCancel(dialog, cancels) {
|
|
14
|
+
let first = null;
|
|
15
|
+
for (const element of cancels) {
|
|
16
|
+
if (element.closest("dialog") !== dialog || isDisabled(element)) continue;
|
|
17
|
+
if (first === null || compareDocumentOrder(element, first) < 0) first = element;
|
|
18
|
+
}
|
|
19
|
+
return first;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { AlertDialogCancelContext, firstEnabledCancel };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=alert-dialog-context.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-dialog-context.mjs","names":[],"sources":["../../src/alert-dialog/alert-dialog-context.ts"],"sourcesContent":["\"use client\";\nimport { createContext } from \"react\";\nimport { compareDocumentOrder } from \"../internal/dom-order.js\";\n\n/**\n * What `AlertDialog.Popup` tells the Cancels inside it (design 3.4): whether they are the\n * default initial focus target (the Popup has no `initialFocus`), and where they register their\n * element so that a library open can pick the first enabled one.\n */\nexport interface AlertDialogCancelContextValue {\n /** The Popup has no `initialFocus`: the first enabled Cancel is the target. */\n readonly defaultFocus: boolean;\n /** Registers a Cancel's element; returns the unregister function. */\n readonly register: (element: HTMLElement) => () => void;\n}\n\nexport const AlertDialogCancelContext = createContext<AlertDialogCancelContextValue | null>(null);\n\nfunction isDisabled(element: HTMLElement): boolean {\n return element.matches(\":disabled\") || element.getAttribute(\"aria-disabled\") === \"true\";\n}\n\n/**\n * The first registered Cancel, in tree order, that belongs to `dialog` (not to a dialog nested\n * in it) and is not disabled; `null` without one, and the platform chooses (design 3.4).\n */\nexport function firstEnabledCancel(\n dialog: HTMLDialogElement,\n cancels: ReadonlySet<HTMLElement>,\n): HTMLElement | null {\n let first: HTMLElement | null = null;\n for (const element of cancels) {\n if (element.closest(\"dialog\") !== dialog || isDisabled(element)) continue;\n if (first === null || compareDocumentOrder(element, first) < 0) first = element;\n }\n return first;\n}\n"],"mappings":";;;;AAgBA,MAAa,2BAA2B,cAAoD,IAAI;AAEhG,SAAS,WAAW,SAA+B;CACjD,OAAO,QAAQ,QAAQ,WAAW,KAAK,QAAQ,aAAa,eAAe,MAAM;AACnF;;;;;AAMA,SAAgB,mBACd,QACA,SACoB;CACpB,IAAI,QAA4B;CAChC,KAAK,MAAM,WAAW,SAAS;EAC7B,IAAI,QAAQ,QAAQ,QAAQ,MAAM,UAAU,WAAW,OAAO,GAAG;EACjE,IAAI,UAAU,QAAQ,qBAAqB,SAAS,KAAK,IAAI,GAAG,QAAQ;CAC1E;CACA,OAAO;AACT"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { DialogDescriptionProps, DialogDescriptionState } from "../dialog/dialog-description.mjs";
|
|
2
|
+
//#region src/alert-dialog/alert-dialog-description.d.ts
|
|
3
|
+
/** State of `AlertDialog.Description`: the Popup's state. */
|
|
4
|
+
export type AlertDialogDescriptionState = DialogDescriptionState;
|
|
5
|
+
/**
|
|
6
|
+
* Props of `AlertDialog.Description`: `Dialog.Description`'s.
|
|
7
|
+
*
|
|
8
|
+
* @see https://ui.funstack.work/components/alert-dialog
|
|
9
|
+
*/
|
|
10
|
+
export type AlertDialogDescriptionProps = DialogDescriptionProps;
|
|
11
|
+
/**
|
|
12
|
+
* The alert message: a `<p>` whose id the Popup references with `aria-describedby`. A screen
|
|
13
|
+
* reader announces an alert dialog by its name and this description; without one, development
|
|
14
|
+
* warns (design 2.2).
|
|
15
|
+
*
|
|
16
|
+
* Owned key (conventions 1.2): `id`.
|
|
17
|
+
*
|
|
18
|
+
* @see https://ui.funstack.work/components/alert-dialog
|
|
19
|
+
*/
|
|
20
|
+
export declare function AlertDialogDescription(props: AlertDialogDescriptionProps): import("react").ReactNode;
|
|
21
|
+
export declare namespace AlertDialogDescription {
|
|
22
|
+
var displayName: string;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
//# sourceMappingURL=alert-dialog-description.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-dialog-description.d.mts","names":[],"sources":["../../src/alert-dialog/alert-dialog-description.tsx"],"mappings":";;;YAQY,8BAA8B;;;;;;YAO9B,8BAA8B;;;;;;;;;;wBAW1B,uBAAuB,OAAO,8CAA2B;yBAAzD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useDialogDescription } from "../dialog/dialog-description.mjs";
|
|
3
|
+
//#region src/alert-dialog/alert-dialog-description.tsx
|
|
4
|
+
/**
|
|
5
|
+
* The alert message: a `<p>` whose id the Popup references with `aria-describedby`. A screen
|
|
6
|
+
* reader announces an alert dialog by its name and this description; without one, development
|
|
7
|
+
* warns (design 2.2).
|
|
8
|
+
*
|
|
9
|
+
* Owned key (conventions 1.2): `id`.
|
|
10
|
+
*
|
|
11
|
+
* @see https://ui.funstack.work/components/alert-dialog
|
|
12
|
+
*/
|
|
13
|
+
function AlertDialogDescription(props) {
|
|
14
|
+
return useDialogDescription(props, "AlertDialog");
|
|
15
|
+
}
|
|
16
|
+
AlertDialogDescription.displayName = "AlertDialogDescription";
|
|
17
|
+
//#endregion
|
|
18
|
+
export { AlertDialogDescription };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=alert-dialog-description.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-dialog-description.mjs","names":[],"sources":["../../src/alert-dialog/alert-dialog-description.tsx"],"sourcesContent":["\"use client\";\nimport { useDialogDescription } from \"../dialog/dialog-description.js\";\nimport type {\n DialogDescriptionProps,\n DialogDescriptionState,\n} from \"../dialog/dialog-description.js\";\n\n/** State of `AlertDialog.Description`: the Popup's state. */\nexport type AlertDialogDescriptionState = DialogDescriptionState;\n\n/**\n * Props of `AlertDialog.Description`: `Dialog.Description`'s.\n *\n * @see https://ui.funstack.work/components/alert-dialog\n */\nexport type AlertDialogDescriptionProps = DialogDescriptionProps;\n\n/**\n * The alert message: a `<p>` whose id the Popup references with `aria-describedby`. A screen\n * reader announces an alert dialog by its name and this description; without one, development\n * warns (design 2.2).\n *\n * Owned key (conventions 1.2): `id`.\n *\n * @see https://ui.funstack.work/components/alert-dialog\n */\nexport function AlertDialogDescription(props: AlertDialogDescriptionProps) {\n return useDialogDescription(props, \"AlertDialog\");\n}\n\nAlertDialogDescription.displayName = \"AlertDialogDescription\";\n"],"mappings":";;;;;;;;;;;;AA0BA,SAAgB,uBAAuB,OAAoC;CACzE,OAAO,qBAAqB,OAAO,aAAa;AAClD;AAEA,uBAAuB,cAAc"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { DialogFormProps, DialogFormState } from "../dialog/dialog-form.mjs";
|
|
2
|
+
//#region src/alert-dialog/alert-dialog-form.d.ts
|
|
3
|
+
/** State of `AlertDialog.Form`: Dialog's (`useFormStatus().pending` of this form). */
|
|
4
|
+
export type AlertDialogFormState = DialogFormState;
|
|
5
|
+
/**
|
|
6
|
+
* Props of `AlertDialog.Form`: `Dialog.Form`'s.
|
|
7
|
+
*
|
|
8
|
+
* @see https://ui.funstack.work/components/alert-dialog
|
|
9
|
+
*/
|
|
10
|
+
export type AlertDialogFormProps = DialogFormProps;
|
|
11
|
+
/**
|
|
12
|
+
* The confirm that works without JavaScript (design 6): `Dialog.Form`, unchanged. With a
|
|
13
|
+
* function `action` (a Server Function) and a plain submit button, the form posts before
|
|
14
|
+
* hydration through React's progressive enhancement; after hydration React runs the action and
|
|
15
|
+
* the dialog closes when its transition settles (`closeOnSettle`). Without `action`:
|
|
16
|
+
* `method="dialog"`.
|
|
17
|
+
*
|
|
18
|
+
* Owned keys (conventions 1.2): `method` (except with a string `action`), `action`.
|
|
19
|
+
*
|
|
20
|
+
* @see https://ui.funstack.work/components/alert-dialog
|
|
21
|
+
*/
|
|
22
|
+
export declare function AlertDialogForm(props: AlertDialogFormProps): import("react").ReactNode;
|
|
23
|
+
export declare namespace AlertDialogForm {
|
|
24
|
+
var displayName: string;
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
//# sourceMappingURL=alert-dialog-form.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-dialog-form.d.mts","names":[],"sources":["../../src/alert-dialog/alert-dialog-form.tsx"],"mappings":";;;YAKY,uBAAuB;;;;;;YAOvB,uBAAuB;;;;;;;;;;;;wBAanB,gBAAgB,OAAO,uCAAoB;yBAA3C"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useDialogForm } from "../dialog/dialog-form.mjs";
|
|
3
|
+
//#region src/alert-dialog/alert-dialog-form.tsx
|
|
4
|
+
/**
|
|
5
|
+
* The confirm that works without JavaScript (design 6): `Dialog.Form`, unchanged. With a
|
|
6
|
+
* function `action` (a Server Function) and a plain submit button, the form posts before
|
|
7
|
+
* hydration through React's progressive enhancement; after hydration React runs the action and
|
|
8
|
+
* the dialog closes when its transition settles (`closeOnSettle`). Without `action`:
|
|
9
|
+
* `method="dialog"`.
|
|
10
|
+
*
|
|
11
|
+
* Owned keys (conventions 1.2): `method` (except with a string `action`), `action`.
|
|
12
|
+
*
|
|
13
|
+
* @see https://ui.funstack.work/components/alert-dialog
|
|
14
|
+
*/
|
|
15
|
+
function AlertDialogForm(props) {
|
|
16
|
+
return useDialogForm(props, "AlertDialog");
|
|
17
|
+
}
|
|
18
|
+
AlertDialogForm.displayName = "AlertDialogForm";
|
|
19
|
+
//#endregion
|
|
20
|
+
export { AlertDialogForm };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=alert-dialog-form.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-dialog-form.mjs","names":[],"sources":["../../src/alert-dialog/alert-dialog-form.tsx"],"sourcesContent":["\"use client\";\nimport { useDialogForm } from \"../dialog/dialog-form.js\";\nimport type { DialogFormProps, DialogFormState } from \"../dialog/dialog-form.js\";\n\n/** State of `AlertDialog.Form`: Dialog's (`useFormStatus().pending` of this form). */\nexport type AlertDialogFormState = DialogFormState;\n\n/**\n * Props of `AlertDialog.Form`: `Dialog.Form`'s.\n *\n * @see https://ui.funstack.work/components/alert-dialog\n */\nexport type AlertDialogFormProps = DialogFormProps;\n\n/**\n * The confirm that works without JavaScript (design 6): `Dialog.Form`, unchanged. With a\n * function `action` (a Server Function) and a plain submit button, the form posts before\n * hydration through React's progressive enhancement; after hydration React runs the action and\n * the dialog closes when its transition settles (`closeOnSettle`). Without `action`:\n * `method=\"dialog\"`.\n *\n * Owned keys (conventions 1.2): `method` (except with a string `action`), `action`.\n *\n * @see https://ui.funstack.work/components/alert-dialog\n */\nexport function AlertDialogForm(props: AlertDialogFormProps) {\n return useDialogForm(props, \"AlertDialog\");\n}\n\nAlertDialogForm.displayName = \"AlertDialogForm\";\n"],"mappings":";;;;;;;;;;;;;;AAyBA,SAAgB,gBAAgB,OAA6B;CAC3D,OAAO,cAAc,OAAO,aAAa;AAC3C;AAEA,gBAAgB,cAAc"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { DialogPopupProps, DialogPopupState } from "../dialog/dialog-popup.mjs";
|
|
2
|
+
import { ReactNode, RefObject } from "react";
|
|
3
|
+
//#region src/alert-dialog/alert-dialog-popup.d.ts
|
|
4
|
+
/** State of `AlertDialog.Popup`: Dialog's, with `modal` always `true`. */
|
|
5
|
+
export type AlertDialogPopupState = DialogPopupState;
|
|
6
|
+
/**
|
|
7
|
+
* Props of `AlertDialog.Popup`: `Dialog.Popup`'s without `role` (owned: `alertdialog`),
|
|
8
|
+
* `lightDismiss` and `experimental_closedBy` (a click on the backdrop never closes an alert
|
|
9
|
+
* dialog).
|
|
10
|
+
*
|
|
11
|
+
* @see https://ui.funstack.work/components/alert-dialog
|
|
12
|
+
*/
|
|
13
|
+
export interface AlertDialogPopupProps extends Omit<DialogPopupProps, "role" | "lightDismiss" | "experimental_closedBy"> {
|
|
14
|
+
/**
|
|
15
|
+
* Element to focus when the dialog opens: a ref, or a selector resolved inside the dialog.
|
|
16
|
+
* With it, no Cancel renders `autofocus`. Point it at the Title with `tabIndex={-1}` for a
|
|
17
|
+
* long message, so that it is read from the top (APG).
|
|
18
|
+
*
|
|
19
|
+
* @defaultValue the first enabled `AlertDialog.Cancel`; without one, the platform's choice
|
|
20
|
+
* (the first focusable element)
|
|
21
|
+
*/
|
|
22
|
+
initialFocus?: RefObject<HTMLElement | null> | string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The alert dialog: `Dialog.Popup` rendering `<dialog role="alertdialog">`, always opened with
|
|
26
|
+
* `showModal()`, without light dismiss (a modal `<dialog>` without `closedby` closes on Escape and
|
|
27
|
+
* not on a backdrop click, in every engine and before hydration). Escape closes it: the
|
|
28
|
+
* platform's close request, reported to `onOpenChange(false, { reason: "dismiss" })`; there is no
|
|
29
|
+
* prop to turn it off. Opens with focus on the first enabled `AlertDialog.Cancel` unless
|
|
30
|
+
* `initialFocus` is given.
|
|
31
|
+
*
|
|
32
|
+
* Owned keys (conventions 1.2): Dialog.Popup's (`id`, `open`, `closedby`, `aria-labelledby` and
|
|
33
|
+
* `aria-describedby` token-merged, `data-modal`, `suppressHydrationWarning`) and `role`.
|
|
34
|
+
*
|
|
35
|
+
* @see https://ui.funstack.work/components/alert-dialog
|
|
36
|
+
*/
|
|
37
|
+
export declare function AlertDialogPopup(props: AlertDialogPopupProps): ReactNode;
|
|
38
|
+
export declare namespace AlertDialogPopup {
|
|
39
|
+
var displayName: string;
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
//# sourceMappingURL=alert-dialog-popup.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-dialog-popup.d.mts","names":[],"sources":["../../src/alert-dialog/alert-dialog-popup.tsx"],"mappings":";;;;YAaY,wBAAwB;;;;;;;;iBASnB,8BAA8B,KAC7C;;;;;;;;;EAWA,eAAe,UAAU;;;;;;;;;;;;;;;wBAgBX,iBAAiB,OAAO,wBAAqB;yBAA7C"}
|