@gunkin/uiify 0.0.1-alpha → 0.0.2-alpha
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/components/accordion/Accordion.d.ts +2 -2
- package/dist/components/accordion/Accordion.d.ts.map +1 -1
- package/dist/components/accordion/Accordion.js +1 -2
- package/dist/components/accordion/Accordion.js.map +1 -1
- package/dist/components/alert-modal/AlertModal.d.ts +1 -1
- package/dist/components/alert-modal/AlertModal.d.ts.map +1 -1
- package/dist/components/alert-modal/AlertModal.js +5 -8
- package/dist/components/alert-modal/AlertModal.js.map +1 -1
- package/dist/components/alert-modal/AlertModalParts.d.ts +4 -29
- package/dist/components/alert-modal/AlertModalParts.d.ts.map +1 -1
- package/dist/components/alert-modal/AlertModalParts.js +29 -36
- package/dist/components/alert-modal/AlertModalParts.js.map +1 -1
- package/dist/components/alert-modal/types.d.ts +0 -3
- package/dist/components/alert-modal/types.d.ts.map +1 -1
- package/dist/components/behavior.css +91 -48
- package/dist/components/behavior.css.map +1 -1
- package/dist/components/breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/button/Button.js +1 -0
- package/dist/components/button/Button.js.map +1 -1
- package/dist/components/candle-chart/CandleChart.d.ts.map +1 -1
- package/dist/components/candle-chart/CandleChart.js +39 -55
- package/dist/components/candle-chart/CandleChart.js.map +1 -1
- package/dist/components/candle-chart/client/CandleChartClient.js.map +1 -1
- package/dist/components/carousel/CarouselMarkup.d.ts.map +1 -1
- package/dist/components/carousel/CarouselMarkup.js +26 -45
- package/dist/components/carousel/CarouselMarkup.js.map +1 -1
- package/dist/components/carousel/carousel-markup.d.ts +0 -1
- package/dist/components/carousel/carousel-markup.d.ts.map +1 -1
- package/dist/components/carousel/carousel-markup.js +0 -5
- package/dist/components/carousel/carousel-markup.js.map +1 -1
- package/dist/components/carousel/client/carousel-controller.js +2 -2
- package/dist/components/carousel/client/carousel-controller.js.map +1 -1
- package/dist/components/carousel/client/carousel-controls.d.ts.map +1 -1
- package/dist/components/carousel/client/carousel-controls.js +3 -5
- package/dist/components/carousel/client/carousel-controls.js.map +1 -1
- package/dist/components/carousel/client/carousel-drag.js +1 -1
- package/dist/components/carousel/client/carousel-drag.js.map +1 -1
- package/dist/components/carousel/client/carousel-observer.js +2 -2
- package/dist/components/carousel/client/carousel-observer.js.map +1 -1
- package/dist/components/carousel/fade/fade-controller.js +2 -2
- package/dist/components/carousel/fade/fade-controller.js.map +1 -1
- package/dist/components/carousel/fade/fade-swipe.js +1 -1
- package/dist/components/carousel/fade/fade-swipe.js.map +1 -1
- package/dist/components/carousel/index.d.ts +1 -1
- package/dist/components/carousel/index.d.ts.map +1 -1
- package/dist/components/carousel/index.js.map +1 -1
- package/dist/components/carousel/types.d.ts +0 -13
- package/dist/components/carousel/types.d.ts.map +1 -1
- package/dist/components/checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/checkbox/Checkbox.js +3 -2
- package/dist/components/checkbox/Checkbox.js.map +1 -1
- package/dist/components/combobox/Combobox.d.ts.map +1 -1
- package/dist/components/combobox/Combobox.js +7 -1
- package/dist/components/combobox/Combobox.js.map +1 -1
- package/dist/components/combobox/types.d.ts +1 -0
- package/dist/components/combobox/types.d.ts.map +1 -1
- package/dist/components/context-menu/ContextMenu.d.ts.map +1 -1
- package/dist/components/context-menu/ContextMenu.js +21 -4
- package/dist/components/context-menu/ContextMenu.js.map +1 -1
- package/dist/components/drawer/Drawer.d.ts.map +1 -1
- package/dist/components/drawer/Drawer.js +15 -0
- package/dist/components/drawer/Drawer.js.map +1 -1
- package/dist/components/drawer/DrawerNative.d.ts +1 -1
- package/dist/components/drawer/DrawerNative.d.ts.map +1 -1
- package/dist/components/drawer/DrawerNative.js +28 -13
- package/dist/components/drawer/DrawerNative.js.map +1 -1
- package/dist/components/drawer/types.d.ts +0 -2
- package/dist/components/drawer/types.d.ts.map +1 -1
- package/dist/components/dropdown-menu/DropdownMenu.d.ts.map +1 -1
- package/dist/components/dropdown-menu/DropdownMenu.js +2 -1
- package/dist/components/dropdown-menu/DropdownMenu.js.map +1 -1
- package/dist/components/dropdown-menu/DropdownMenuBar.d.ts +1 -1
- package/dist/components/dropdown-menu/DropdownMenuBar.d.ts.map +1 -1
- package/dist/components/dropdown-menu/DropdownMenuBar.js +12 -2
- package/dist/components/dropdown-menu/DropdownMenuBar.js.map +1 -1
- package/dist/components/dropdown-menu/types.d.ts +1 -0
- package/dist/components/dropdown-menu/types.d.ts.map +1 -1
- package/dist/components/enhance/listeners.js +1 -1
- package/dist/components/enhance/listeners.js.map +1 -1
- package/dist/components/enhance/sync.d.ts.map +1 -1
- package/dist/components/enhance/sync.js +7 -4
- package/dist/components/enhance/sync.js.map +1 -1
- package/dist/components/field/Field.d.ts.map +1 -1
- package/dist/components/field/Field.js +6 -0
- package/dist/components/field/Field.js.map +1 -1
- package/dist/components/file-upload/FileUpload.d.ts.map +1 -1
- package/dist/components/file-upload/FileUpload.js +8 -2
- package/dist/components/file-upload/FileUpload.js.map +1 -1
- package/dist/components/file-upload/types.d.ts +1 -0
- package/dist/components/file-upload/types.d.ts.map +1 -1
- package/dist/components/hover-card/HoverCard.d.ts.map +1 -1
- package/dist/components/hover-card/HoverCard.js +2 -0
- package/dist/components/hover-card/HoverCard.js.map +1 -1
- package/dist/components/input/Input.d.ts.map +1 -1
- package/dist/components/input/Input.js +1 -0
- package/dist/components/input/Input.js.map +1 -1
- package/dist/components/internal/choice-family/ChoiceGroup.d.ts +1 -2
- package/dist/components/internal/choice-family/ChoiceGroup.d.ts.map +1 -1
- package/dist/components/internal/choice-family/ChoiceGroup.js +5 -6
- package/dist/components/internal/choice-family/ChoiceGroup.js.map +1 -1
- package/dist/components/internal/choice-family/types.d.ts +0 -4
- package/dist/components/internal/choice-family/types.d.ts.map +1 -1
- package/dist/components/line-chart/LineChart.d.ts.map +1 -1
- package/dist/components/line-chart/LineChart.js +30 -38
- package/dist/components/line-chart/LineChart.js.map +1 -1
- package/dist/components/line-chart/client/LineChartClient.js.map +1 -1
- package/dist/components/modal/Modal.d.ts +1 -1
- package/dist/components/modal/Modal.d.ts.map +1 -1
- package/dist/components/modal/Modal.js +4 -6
- package/dist/components/modal/Modal.js.map +1 -1
- package/dist/components/modal/ModalParts.d.ts +3 -30
- package/dist/components/modal/ModalParts.d.ts.map +1 -1
- package/dist/components/modal/ModalParts.js +20 -17
- package/dist/components/modal/ModalParts.js.map +1 -1
- package/dist/components/modal/client/ModalClientContent.d.ts.map +1 -1
- package/dist/components/modal/client/ModalClientContent.js +5 -2
- package/dist/components/modal/client/ModalClientContent.js.map +1 -1
- package/dist/components/modal/types.d.ts +0 -2
- package/dist/components/modal/types.d.ts.map +1 -1
- package/dist/components/otp-input/OtpInput.d.ts.map +1 -1
- package/dist/components/otp-input/OtpInput.js +3 -0
- package/dist/components/otp-input/OtpInput.js.map +1 -1
- package/dist/components/popup/Popup.d.ts.map +1 -1
- package/dist/components/popup/Popup.js +8 -3
- package/dist/components/popup/Popup.js.map +1 -1
- package/dist/components/popup/PopupParts.d.ts +3 -26
- package/dist/components/popup/PopupParts.d.ts.map +1 -1
- package/dist/components/popup/PopupParts.js +27 -18
- package/dist/components/popup/PopupParts.js.map +1 -1
- package/dist/components/radio-group/RadioGroup.d.ts.map +1 -1
- package/dist/components/radio-group/RadioGroup.js +0 -1
- package/dist/components/radio-group/RadioGroup.js.map +1 -1
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/Select.js +1 -0
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components/slider/Slider.d.ts.map +1 -1
- package/dist/components/slider/Slider.js +1 -0
- package/dist/components/slider/Slider.js.map +1 -1
- package/dist/components/spinner/Spinner.d.ts.map +1 -1
- package/dist/components/spinner/Spinner.js +2 -2
- package/dist/components/spinner/Spinner.js.map +1 -1
- package/dist/components/spinner/types.d.ts +1 -1
- package/dist/components/spinner/types.d.ts.map +1 -1
- package/dist/components/stepper/Stepper.js +2 -2
- package/dist/components/stepper/Stepper.js.map +1 -1
- package/dist/components/switch/Switch.d.ts.map +1 -1
- package/dist/components/switch/Switch.js +1 -0
- package/dist/components/switch/Switch.js.map +1 -1
- package/dist/components/tabs/Tabs.d.ts.map +1 -1
- package/dist/components/tabs/Tabs.js +1 -3
- package/dist/components/tabs/Tabs.js.map +1 -1
- package/dist/components/tags-input/TagsInput.d.ts.map +1 -1
- package/dist/components/tags-input/TagsInput.js +6 -1
- package/dist/components/tags-input/TagsInput.js.map +1 -1
- package/dist/components/tags-input/types.d.ts +1 -0
- package/dist/components/tags-input/types.d.ts.map +1 -1
- package/dist/components/textarea/Textarea.d.ts.map +1 -1
- package/dist/components/textarea/Textarea.js +1 -0
- package/dist/components/textarea/Textarea.js.map +1 -1
- package/dist/components/toast/Toast.d.ts.map +1 -1
- package/dist/components/toast/Toast.js +2 -1
- package/dist/components/toast/Toast.js.map +1 -1
- package/dist/components/toast/ToastElements.d.ts.map +1 -1
- package/dist/components/toast/ToastElements.js +4 -1
- package/dist/components/toast/ToastElements.js.map +1 -1
- package/dist/components/toggle/Toggle.d.ts.map +1 -1
- package/dist/components/toggle/Toggle.js +1 -0
- package/dist/components/toggle/Toggle.js.map +1 -1
- package/dist/components/toolbar/Toolbar.d.ts.map +1 -1
- package/dist/components/toolbar/Toolbar.js +5 -3
- package/dist/components/toolbar/Toolbar.js.map +1 -1
- package/dist/components/toolbar/ToolbarShell.d.ts.map +1 -1
- package/dist/components/toolbar/ToolbarShell.js +8 -5
- package/dist/components/toolbar/ToolbarShell.js.map +1 -1
- package/dist/components/tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/Tooltip.js +2 -0
- package/dist/components/tooltip/Tooltip.js.map +1 -1
- package/dist/components/virtual-scroll/VirtualScroll.js +2 -2
- package/dist/components/virtual-scroll/VirtualScroll.js.map +1 -1
- package/dist/components/virtual-scroll/VirtualScrollRowShell.d.ts +1 -1
- package/dist/components/virtual-scroll/VirtualScrollRowShell.js +3 -3
- package/dist/components/virtual-scroll/VirtualScrollRowShell.js.map +1 -1
- package/dist/components/virtual-scroll/virtual-scroll-scroll-sync.js +2 -2
- package/dist/components/virtual-scroll/virtual-scroll-scroll-sync.js.map +1 -1
- package/dist/core/render-native-invoker.d.ts +6 -3
- package/dist/core/render-native-invoker.d.ts.map +1 -1
- package/dist/core/render-native-invoker.js +5 -3
- package/dist/core/render-native-invoker.js.map +1 -1
- package/dist/elements/choice/Choice.d.ts +2 -2
- package/dist/elements/choice/Choice.js +1 -1
- package/dist/elements/choice/Choice.js.map +1 -1
- package/dist/elements/choice/types.d.ts +1 -1
- package/dist/elements/choice/types.d.ts.map +1 -1
- package/dist/elements/dialog/Dialog.d.ts +3 -3
- package/dist/elements/dialog/Dialog.d.ts.map +1 -1
- package/dist/elements/dialog/Dialog.js +5 -3
- package/dist/elements/dialog/Dialog.js.map +1 -1
- package/dist/elements/popover/Popover.d.ts +6 -5
- package/dist/elements/popover/Popover.d.ts.map +1 -1
- package/dist/elements/popover/Popover.js +8 -4
- package/dist/elements/popover/Popover.js.map +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/styles/tailwind.css +33 -35
- package/dist/styles/tokens.css +1 -1
- package/package.json +7 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/render-native-invoker.ts"],"sourcesContent":["import { createElement } from \"react\";\nimport type { ElementType, ReactElement } from \"react\";\n\nexport type NativeInvokerCommand = \"show-modal\" | \"request-close\";\n\n/**\n * Render a native invoker button. `command`/`commandfor` are lowercase HTML\n * attributes that React 19.2 passes through untouched; @types/react 19.2 does\n * not declare them and the lint rule react/no-unknown-property rejects them in\n * JSX, so they travel as a props object through createElement. Shared by the\n * Modal and AlertModal parts, which use identical `show-modal`/`request-close`\n * command semantics; Popup uses `popoverTarget`/`popoverTargetAction` instead\n * and keeps its own renderer (see popup/PopupParts.tsx).\n *\n
|
|
1
|
+
{"version":3,"sources":["../../src/core/render-native-invoker.ts"],"sourcesContent":["import { createElement } from \"react\";\nimport type { ElementType, ReactElement } from \"react\";\n\nexport type NativeInvokerCommand = \"show-modal\" | \"request-close\";\n\ninterface NativeInvokerOptions {\n readonly button?: boolean;\n readonly variant?: \"ghost\" | \"danger\";\n}\n\n/**\n * Render a native invoker button. `command`/`commandfor` are lowercase HTML\n * attributes that React 19.2 passes through untouched; @types/react 19.2 does\n * not declare them and the lint rule react/no-unknown-property rejects them in\n * JSX, so they travel as a props object through createElement. Shared by the\n * Modal and AlertModal parts, which use identical `show-modal`/`request-close`\n * command semantics; Popup uses `popoverTarget`/`popoverTargetAction` instead\n * and keeps its own renderer (see popup/PopupParts.tsx).\n *\n */\nexport function renderNativeInvoker(\n as: ElementType | undefined,\n marker: string,\n part: string,\n command: NativeInvokerCommand,\n target: string,\n consumerProps: Record<string, unknown>,\n options: NativeInvokerOptions = {},\n): ReactElement {\n return createElement(as ?? \"button\", {\n ...consumerProps,\n ...(options.button ? { \"data-uiify-button\": \"\" } : {}),\n [marker]: \"\",\n \"data-part\": part,\n ...(options.variant ? { \"data-variant\": options.variant } : {}),\n command,\n commandfor: target,\n type: \"button\",\n });\n}\n"],"mappings":"AAAA,SAAS,qBAAqB;AAoBvB,SAAS,oBACd,IACA,QACA,MACA,SACA,QACA,eACA,UAAgC,CAAC,GACnB;AACd,SAAO,cAAc,MAAM,UAAU;AAAA,IACnC,GAAG;AAAA,IACH,GAAI,QAAQ,SAAS,EAAE,qBAAqB,GAAG,IAAI,CAAC;AAAA,IACpD,CAAC,MAAM,GAAG;AAAA,IACV,aAAa;AAAA,IACb,GAAI,QAAQ,UAAU,EAAE,gBAAgB,QAAQ,QAAQ,IAAI,CAAC;AAAA,IAC7D;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,EACR,CAAC;AACH;","names":[]}
|
|
@@ -12,8 +12,8 @@ export declare namespace ChoiceGroup {
|
|
|
12
12
|
/**
|
|
13
13
|
* One radio/checkbox choice: an `<input>`, its `<label>`, and an optional panel. `groupId` and
|
|
14
14
|
* `kind` are explicit (see `ChoiceGroupOwnProps.id`) — this part does not read them from its
|
|
15
|
-
* `Choice.Group` ancestor. Emits `data-part` (default `"item"`)
|
|
16
|
-
*
|
|
15
|
+
* `Choice.Group` ancestor. Emits `data-uiify-choice` and `data-part` (default `"item"`) on the
|
|
16
|
+
* wrapper.
|
|
17
17
|
*/
|
|
18
18
|
export declare function ChoiceItem(props: ChoiceItemProps): ReactElement;
|
|
19
19
|
export declare namespace ChoiceItem {
|
|
@@ -34,7 +34,7 @@ function ChoiceItem(props) {
|
|
|
34
34
|
const { controlId, labelId, panelId } = choiceIds(groupId, value);
|
|
35
35
|
const groupName = name ?? choiceGroupName(groupId, kind);
|
|
36
36
|
const inputType = kind === "single" ? "radio" : "checkbox";
|
|
37
|
-
return /* @__PURE__ */ jsxs("div", { "data-part": part, "data-uiify-choice
|
|
37
|
+
return /* @__PURE__ */ jsxs("div", { ...consumerProps, "data-part": part, "data-uiify-choice": "", children: [
|
|
38
38
|
/* @__PURE__ */ jsx(
|
|
39
39
|
"input",
|
|
40
40
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/elements/choice/Choice.tsx"],"sourcesContent":["import type { ReactElement } from \"react\";\nimport { choiceGroupName, choiceIds } from \"./ids.js\";\nimport type { ChoiceGroupProps, ChoiceItemProps } from \"./types.js\";\n\n/**\n * A group of `Choice.Item`s. Purely a marked, oriented `<div>` — the actual `<input>`s are\n * siblings-by-id, not parent/child data flow (no `useContext`, no `cloneElement`: Tier 0 bans\n * both). Emits `data-orientation` and `data-uiify-choice`.\n */\nexport function ChoiceGroup(props: ChoiceGroupProps): ReactElement {\n const {\n children,\n kind: _kind,\n name: _name,\n orientation = \"horizontal\",\n ...consumerProps\n } = props;\n return (\n <div {...consumerProps} data-orientation={orientation} data-uiify-choice=\"\">\n {children}\n </div>\n );\n}\nChoiceGroup.displayName = \"ChoiceGroup\";\n\n/**\n * One radio/checkbox choice: an `<input>`, its `<label>`, and an optional panel. `groupId` and\n * `kind` are explicit (see `ChoiceGroupOwnProps.id`) — this part does not read them from its\n * `Choice.Group` ancestor. Emits `data-part` (default `\"item\"`)
|
|
1
|
+
{"version":3,"sources":["../../../src/elements/choice/Choice.tsx"],"sourcesContent":["import type { ReactElement } from \"react\";\nimport { choiceGroupName, choiceIds } from \"./ids.js\";\nimport type { ChoiceGroupProps, ChoiceItemProps } from \"./types.js\";\n\n/**\n * A group of `Choice.Item`s. Purely a marked, oriented `<div>` — the actual `<input>`s are\n * siblings-by-id, not parent/child data flow (no `useContext`, no `cloneElement`: Tier 0 bans\n * both). Emits `data-orientation` and `data-uiify-choice`.\n */\nexport function ChoiceGroup(props: ChoiceGroupProps): ReactElement {\n const {\n children,\n kind: _kind,\n name: _name,\n orientation = \"horizontal\",\n ...consumerProps\n } = props;\n return (\n <div {...consumerProps} data-orientation={orientation} data-uiify-choice=\"\">\n {children}\n </div>\n );\n}\nChoiceGroup.displayName = \"ChoiceGroup\";\n\n/**\n * One radio/checkbox choice: an `<input>`, its `<label>`, and an optional panel. `groupId` and\n * `kind` are explicit (see `ChoiceGroupOwnProps.id`) — this part does not read them from its\n * `Choice.Group` ancestor. Emits `data-uiify-choice` and `data-part` (default `\"item\"`) on the\n * wrapper.\n */\nexport function ChoiceItem(props: ChoiceItemProps): ReactElement {\n const {\n defaultChecked = false,\n checked,\n disabled = false,\n groupId,\n inputProps,\n kind,\n label,\n labelPart = false,\n labelProps,\n name,\n onChange,\n panel,\n panelProps,\n part = \"item\",\n value,\n ...consumerProps\n } = props;\n\n const isControlled = checked !== undefined;\n\n const { controlId, labelId, panelId } = choiceIds(groupId, value);\n const groupName = name ?? choiceGroupName(groupId, kind);\n const inputType = kind === \"single\" ? \"radio\" : \"checkbox\";\n\n return (\n <div {...consumerProps} data-part={part} data-uiify-choice=\"\">\n <input\n {...inputProps}\n aria-labelledby={labelId}\n {...(isControlled ? { checked } : { defaultChecked })}\n disabled={disabled}\n id={controlId}\n name={groupName}\n type={inputType}\n value={value}\n {...(onChange ? { onChange: () => onChange(value) } : {})}\n />\n <label\n {...labelProps}\n htmlFor={controlId}\n id={labelId}\n {...(labelPart ? { \"data-part\": \"label\" } : {})}\n >\n {label}\n </label>\n {panel === undefined ? null : (\n <div {...panelProps} data-part=\"panel\" id={panelId}>\n {panel}\n </div>\n )}\n </div>\n );\n}\nChoiceItem.displayName = \"ChoiceItem\";\n\nexport const Choice = {\n Group: ChoiceGroup,\n Item: ChoiceItem,\n};\n"],"mappings":"AAkBI,cAwCA,YAxCA;AAjBJ,SAAS,iBAAiB,iBAAiB;AAQpC,SAAS,YAAY,OAAuC;AACjE,QAAM;AAAA,IACJ;AAAA,IACA,MAAM;AAAA,IACN,MAAM;AAAA,IACN,cAAc;AAAA,IACd,GAAG;AAAA,EACL,IAAI;AACJ,SACE,oBAAC,SAAK,GAAG,eAAe,oBAAkB,aAAa,qBAAkB,IACtE,UACH;AAEJ;AACA,YAAY,cAAc;AAQnB,SAAS,WAAW,OAAsC;AAC/D,QAAM;AAAA,IACJ,iBAAiB;AAAA,IACjB;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AAEJ,QAAM,eAAe,YAAY;AAEjC,QAAM,EAAE,WAAW,SAAS,QAAQ,IAAI,UAAU,SAAS,KAAK;AAChE,QAAM,YAAY,QAAQ,gBAAgB,SAAS,IAAI;AACvD,QAAM,YAAY,SAAS,WAAW,UAAU;AAEhD,SACE,qBAAC,SAAK,GAAG,eAAe,aAAW,MAAM,qBAAkB,IACzD;AAAA;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ,mBAAiB;AAAA,QAChB,GAAI,eAAe,EAAE,QAAQ,IAAI,EAAE,eAAe;AAAA,QACnD;AAAA,QACA,IAAI;AAAA,QACJ,MAAM;AAAA,QACN,MAAM;AAAA,QACN;AAAA,QACC,GAAI,WAAW,EAAE,UAAU,MAAM,SAAS,KAAK,EAAE,IAAI,CAAC;AAAA;AAAA,IACzD;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACH,GAAI,YAAY,EAAE,aAAa,QAAQ,IAAI,CAAC;AAAA,QAE5C;AAAA;AAAA,IACH;AAAA,IACC,UAAU,SAAY,OACrB,oBAAC,SAAK,GAAG,YAAY,aAAU,SAAQ,IAAI,SACxC,iBACH;AAAA,KAEJ;AAEJ;AACA,WAAW,cAAc;AAElB,MAAM,SAAS;AAAA,EACpB,OAAO;AAAA,EACP,MAAM;AACR;","names":[]}
|
|
@@ -42,7 +42,7 @@ export interface ChoiceItemOwnProps {
|
|
|
42
42
|
readonly part?: string;
|
|
43
43
|
/** Adds `data-part="label"` to the `<label>`. */
|
|
44
44
|
readonly labelPart?: boolean;
|
|
45
|
-
/** Escape hatch: extra attributes spread onto the `<input>` (
|
|
45
|
+
/** Escape hatch: extra attributes spread onto the `<input>` (for example, `data-part="control"`). */
|
|
46
46
|
readonly inputProps?: Record<string, unknown>;
|
|
47
47
|
/** Escape hatch: extra attributes spread onto the `<label>`. */
|
|
48
48
|
readonly labelProps?: Record<string, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/elements/choice/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9D,iFAAiF;AACjF,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE/C,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,UAAU,CAAC;AAE1D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,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AAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9C,gEAAgE;IAChE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9C,oEAAoE;IACpE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9C;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C;AAED,MAAM,MAAM,eAAe,GAAG,kBAAkB,GAC9C,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,EAAE,MAAM,kBAAkB,GAAG,UAAU,CAAC,CAAC"}
|
|
@@ -2,7 +2,7 @@ import type { ElementType, ReactElement } from "react";
|
|
|
2
2
|
import type { DialogCloseProps, DialogContentProps, DialogTriggerProps } from "./types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Opens `target` modally through the browser: no React handler, works before hydration.
|
|
5
|
-
* Emits `data-uiify-dialog-trigger`.
|
|
5
|
+
* Emits `data-uiify-dialog` with `data-part="trigger"`.
|
|
6
6
|
*
|
|
7
7
|
* Defined via `Object.assign(fn, { displayName })` rather than this file's usual
|
|
8
8
|
* `fn.displayName = "…"` statement: `Dialog.Trigger`/`.Content`/`.Close` are meant to be
|
|
@@ -18,7 +18,7 @@ export declare const DialogTrigger: typeof dialogTrigger & {
|
|
|
18
18
|
displayName: string;
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
21
|
-
* A plain, initially closed `<dialog>`. Emits `data-uiify-dialog-content`.
|
|
21
|
+
* A plain, initially closed `<dialog>`. Emits `data-uiify-dialog` with `data-part="content"`.
|
|
22
22
|
*/
|
|
23
23
|
declare function dialogContent(props: DialogContentProps): ReactElement;
|
|
24
24
|
export declare const DialogContent: typeof dialogContent & {
|
|
@@ -26,7 +26,7 @@ export declare const DialogContent: typeof dialogContent & {
|
|
|
26
26
|
};
|
|
27
27
|
/**
|
|
28
28
|
* Requests closing `target` (fires the cancelable `cancel` event first).
|
|
29
|
-
* Emits `data-uiify-dialog-close`.
|
|
29
|
+
* Emits `data-uiify-dialog` with `data-part="close"`.
|
|
30
30
|
*/
|
|
31
31
|
declare function dialogClose<TAs extends ElementType = "button">(props: DialogCloseProps<TAs>): ReactElement;
|
|
32
32
|
export declare const DialogClose: typeof dialogClose & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../src/elements/dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAE3F;;;;;;;;;;;;GAYG;AACH,iBAAS,aAAa,CAAC,GAAG,SAAS,WAAW,GAAG,QAAQ,EACvD,KAAK,EAAE,kBAAkB,CAAC,GAAG,CAAC,GAC7B,YAAY,
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../src/elements/dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAE3F;;;;;;;;;;;;GAYG;AACH,iBAAS,aAAa,CAAC,GAAG,SAAS,WAAW,GAAG,QAAQ,EACvD,KAAK,EAAE,kBAAkB,CAAC,GAAG,CAAC,GAC7B,YAAY,CAUd;AACD,eAAO,MAAM,aAAa;;CAExB,CAAC;AAEH;;GAEG;AACH,iBAAS,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,YAAY,CAO9D;AACD,eAAO,MAAM,aAAa;;CAExB,CAAC;AAEH;;;GAGG;AACH,iBAAS,WAAW,CAAC,GAAG,SAAS,WAAW,GAAG,QAAQ,EACrD,KAAK,EAAE,gBAAgB,CAAC,GAAG,CAAC,GAC3B,YAAY,CAUd;AACD,eAAO,MAAM,WAAW;;CAEtB,CAAC;AAEH,eAAO,MAAM,MAAM;;;;;;;;;;CAIlB,CAAC"}
|
|
@@ -4,7 +4,8 @@ function dialogTrigger(props) {
|
|
|
4
4
|
const { as, target, ...consumerProps } = props;
|
|
5
5
|
return renderNativeInvoker(
|
|
6
6
|
as,
|
|
7
|
-
"data-uiify-dialog
|
|
7
|
+
"data-uiify-dialog",
|
|
8
|
+
"trigger",
|
|
8
9
|
"show-modal",
|
|
9
10
|
target,
|
|
10
11
|
consumerProps
|
|
@@ -15,7 +16,7 @@ const DialogTrigger = /* @__PURE__ */ Object.assign(dialogTrigger, {
|
|
|
15
16
|
});
|
|
16
17
|
function dialogContent(props) {
|
|
17
18
|
const { children, ...dialogProps } = props;
|
|
18
|
-
return /* @__PURE__ */ jsx("dialog", { ...dialogProps, "data-uiify-dialog
|
|
19
|
+
return /* @__PURE__ */ jsx("dialog", { ...dialogProps, "data-part": "content", "data-uiify-dialog": "", children });
|
|
19
20
|
}
|
|
20
21
|
const DialogContent = /* @__PURE__ */ Object.assign(dialogContent, {
|
|
21
22
|
displayName: "DialogContent"
|
|
@@ -24,7 +25,8 @@ function dialogClose(props) {
|
|
|
24
25
|
const { as, target, ...consumerProps } = props;
|
|
25
26
|
return renderNativeInvoker(
|
|
26
27
|
as,
|
|
27
|
-
"data-uiify-dialog
|
|
28
|
+
"data-uiify-dialog",
|
|
29
|
+
"close",
|
|
28
30
|
"request-close",
|
|
29
31
|
target,
|
|
30
32
|
consumerProps
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/elements/dialog/Dialog.tsx"],"sourcesContent":["import type { ElementType, ReactElement } from \"react\";\nimport { renderNativeInvoker } from \"@gunkin/uiify/core/render\";\nimport type { DialogCloseProps, DialogContentProps, DialogTriggerProps } from \"./types.js\";\n\n/**\n * Opens `target` modally through the browser: no React handler, works before hydration.\n * Emits `data-uiify-dialog-trigger`.\n *\n * Defined via `Object.assign(fn, { displayName })` rather than this file's usual\n * `fn.displayName = \"…\"` statement: `Dialog.Trigger`/`.Content`/`.Close` are meant to be\n * consumed individually (`modal`, `alert-modal` and `drawer` each use a different subset), and\n * esbuild's default tree-shaking\n * cannot prove a bare `fn.displayName = \"…\"` assignment statement is side-effect-free, so it\n * keeps every part whose file is reachable at all. A pure-annotated expression assigned\n * directly to the export lets an unused part be dropped instead of taxing every consumer\n * for parts it never renders.\n */\nfunction dialogTrigger<TAs extends ElementType = \"button\">(\n props: DialogTriggerProps<TAs>,\n): ReactElement {\n const { as, target, ...consumerProps } = props as DialogTriggerProps<\"button\">;\n return renderNativeInvoker(\n as,\n \"data-uiify-dialog
|
|
1
|
+
{"version":3,"sources":["../../../src/elements/dialog/Dialog.tsx"],"sourcesContent":["import type { ElementType, ReactElement } from \"react\";\nimport { renderNativeInvoker } from \"@gunkin/uiify/core/render\";\nimport type { DialogCloseProps, DialogContentProps, DialogTriggerProps } from \"./types.js\";\n\n/**\n * Opens `target` modally through the browser: no React handler, works before hydration.\n * Emits `data-uiify-dialog` with `data-part=\"trigger\"`.\n *\n * Defined via `Object.assign(fn, { displayName })` rather than this file's usual\n * `fn.displayName = \"…\"` statement: `Dialog.Trigger`/`.Content`/`.Close` are meant to be\n * consumed individually (`modal`, `alert-modal` and `drawer` each use a different subset), and\n * esbuild's default tree-shaking\n * cannot prove a bare `fn.displayName = \"…\"` assignment statement is side-effect-free, so it\n * keeps every part whose file is reachable at all. A pure-annotated expression assigned\n * directly to the export lets an unused part be dropped instead of taxing every consumer\n * for parts it never renders.\n */\nfunction dialogTrigger<TAs extends ElementType = \"button\">(\n props: DialogTriggerProps<TAs>,\n): ReactElement {\n const { as, target, ...consumerProps } = props as DialogTriggerProps<\"button\">;\n return renderNativeInvoker(\n as,\n \"data-uiify-dialog\",\n \"trigger\",\n \"show-modal\",\n target,\n consumerProps as Record<string, unknown>,\n );\n}\nexport const DialogTrigger = /* @__PURE__ */ Object.assign(dialogTrigger, {\n displayName: \"DialogTrigger\",\n});\n\n/**\n * A plain, initially closed `<dialog>`. Emits `data-uiify-dialog` with `data-part=\"content\"`.\n */\nfunction dialogContent(props: DialogContentProps): ReactElement {\n const { children, ...dialogProps } = props;\n return (\n <dialog {...dialogProps} data-part=\"content\" data-uiify-dialog=\"\">\n {children}\n </dialog>\n );\n}\nexport const DialogContent = /* @__PURE__ */ Object.assign(dialogContent, {\n displayName: \"DialogContent\",\n});\n\n/**\n * Requests closing `target` (fires the cancelable `cancel` event first).\n * Emits `data-uiify-dialog` with `data-part=\"close\"`.\n */\nfunction dialogClose<TAs extends ElementType = \"button\">(\n props: DialogCloseProps<TAs>,\n): ReactElement {\n const { as, target, ...consumerProps } = props as DialogCloseProps<\"button\">;\n return renderNativeInvoker(\n as,\n \"data-uiify-dialog\",\n \"close\",\n \"request-close\",\n target,\n consumerProps as Record<string, unknown>,\n );\n}\nexport const DialogClose = /* @__PURE__ */ Object.assign(dialogClose, {\n displayName: \"DialogClose\",\n});\n\nexport const Dialog = {\n Trigger: DialogTrigger,\n Content: DialogContent,\n Close: DialogClose,\n};\n"],"mappings":"AAwCI;AAvCJ,SAAS,2BAA2B;AAgBpC,SAAS,cACP,OACc;AACd,QAAM,EAAE,IAAI,QAAQ,GAAG,cAAc,IAAI;AACzC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AACO,MAAM,gBAAgC,uBAAO,OAAO,eAAe;AAAA,EACxE,aAAa;AACf,CAAC;AAKD,SAAS,cAAc,OAAyC;AAC9D,QAAM,EAAE,UAAU,GAAG,YAAY,IAAI;AACrC,SACE,oBAAC,YAAQ,GAAG,aAAa,aAAU,WAAU,qBAAkB,IAC5D,UACH;AAEJ;AACO,MAAM,gBAAgC,uBAAO,OAAO,eAAe;AAAA,EACxE,aAAa;AACf,CAAC;AAMD,SAAS,YACP,OACc;AACd,QAAM,EAAE,IAAI,QAAQ,GAAG,cAAc,IAAI;AACzC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AACO,MAAM,cAA8B,uBAAO,OAAO,aAAa;AAAA,EACpE,aAAa;AACf,CAAC;AAEM,MAAM,SAAS;AAAA,EACpB,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACT;","names":[]}
|
|
@@ -3,23 +3,24 @@ import type { PopoverCloseProps, PopoverSurfaceProps, PopoverTriggerProps } from
|
|
|
3
3
|
/**
|
|
4
4
|
* Acts on `target` (`action`, default `"toggle"`); light dismiss, Escape and nesting are
|
|
5
5
|
* handled by the browser. The popover opened this way uses the invoker as its implicit
|
|
6
|
-
* anchor, so no anchor name is emitted. Emits `data-uiify-popover
|
|
6
|
+
* anchor, so no anchor name is emitted. Emits `data-uiify-popover` with
|
|
7
|
+
* `data-part="trigger"`.
|
|
7
8
|
*/
|
|
8
9
|
declare function popoverTrigger<TAs extends ElementType = "button">(props: PopoverTriggerProps<TAs>): ReactElement;
|
|
9
10
|
export declare const PopoverTrigger: typeof popoverTrigger & {
|
|
10
11
|
displayName: string;
|
|
11
12
|
};
|
|
12
13
|
/**
|
|
13
|
-
* The popover surface. `data-side`/`data-align` drive
|
|
14
|
-
* `@gunkin/uiify/
|
|
15
|
-
* `data-uiify-popover-surface`.
|
|
14
|
+
* The popover surface. `data-side`/`data-align` drive required geometry in
|
|
15
|
+
* `@gunkin/uiify/components/behavior.css`; optional skins provide the gap. Emits `popover`, `data-side`, `data-align`, `data-positioning="native"` and
|
|
16
|
+
* `data-uiify-popover` with `data-part="surface"`.
|
|
16
17
|
*/
|
|
17
18
|
declare function popoverSurface(props: PopoverSurfaceProps): ReactElement;
|
|
18
19
|
export declare const PopoverSurface: typeof popoverSurface & {
|
|
19
20
|
displayName: string;
|
|
20
21
|
};
|
|
21
22
|
/**
|
|
22
|
-
* Hides `target`. Emits `data-uiify-popover-close`.
|
|
23
|
+
* Hides `target`. Emits `data-uiify-popover` with `data-part="close"`.
|
|
23
24
|
*/
|
|
24
25
|
declare function popoverClose<TAs extends ElementType = "button">(props: PopoverCloseProps<TAs>): ReactElement;
|
|
25
26
|
export declare const PopoverClose: typeof popoverClose & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../../../src/elements/popover/Popover.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,KAAK,EACV,iBAAiB,EACjB,mBAAmB,EAEnB,mBAAmB,EACpB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../../../src/elements/popover/Popover.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,KAAK,EACV,iBAAiB,EACjB,mBAAmB,EAEnB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAmCpB;;;;;GAKG;AACH,iBAAS,cAAc,CAAC,GAAG,SAAS,WAAW,GAAG,QAAQ,EACxD,KAAK,EAAE,mBAAmB,CAAC,GAAG,CAAC,GAC9B,YAAY,CAed;AACD,eAAO,MAAM,cAAc;;CAEzB,CAAC;AAEH;;;;GAIG;AACH,iBAAS,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,YAAY,CAehE;AACD,eAAO,MAAM,cAAc;;CAEzB,CAAC;AAEH;;GAEG;AACH,iBAAS,YAAY,CAAC,GAAG,SAAS,WAAW,GAAG,QAAQ,EACtD,KAAK,EAAE,iBAAiB,CAAC,GAAG,CAAC,GAC5B,YAAY,CAUd;AACD,eAAO,MAAM,YAAY;;CAEvB,CAAC;AAEH,eAAO,MAAM,OAAO;;;;;;;;;;CAInB,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createElement } from "react";
|
|
3
|
-
function renderInvoker(as, marker, action, target, consumerProps) {
|
|
3
|
+
function renderInvoker(as, marker, part, action, target, consumerProps) {
|
|
4
4
|
return createElement(as ?? "button", {
|
|
5
5
|
...consumerProps,
|
|
6
6
|
[marker]: "",
|
|
7
|
+
"data-part": part,
|
|
7
8
|
popoverTarget: target,
|
|
8
9
|
popoverTargetAction: action,
|
|
9
10
|
type: "button"
|
|
@@ -18,7 +19,8 @@ function popoverTrigger(props) {
|
|
|
18
19
|
} = props;
|
|
19
20
|
return renderInvoker(
|
|
20
21
|
as,
|
|
21
|
-
"data-uiify-popover
|
|
22
|
+
"data-uiify-popover",
|
|
23
|
+
"trigger",
|
|
22
24
|
action,
|
|
23
25
|
target,
|
|
24
26
|
consumerProps
|
|
@@ -34,9 +36,10 @@ function popoverSurface(props) {
|
|
|
34
36
|
{
|
|
35
37
|
...consumerProps,
|
|
36
38
|
"data-align": align,
|
|
39
|
+
"data-part": "surface",
|
|
37
40
|
"data-positioning": "native",
|
|
38
41
|
"data-side": side,
|
|
39
|
-
"data-uiify-popover
|
|
42
|
+
"data-uiify-popover": "",
|
|
40
43
|
popover: mode,
|
|
41
44
|
children
|
|
42
45
|
}
|
|
@@ -49,7 +52,8 @@ function popoverClose(props) {
|
|
|
49
52
|
const { as, target, ...consumerProps } = props;
|
|
50
53
|
return renderInvoker(
|
|
51
54
|
as,
|
|
52
|
-
"data-uiify-popover
|
|
55
|
+
"data-uiify-popover",
|
|
56
|
+
"close",
|
|
53
57
|
"hide",
|
|
54
58
|
target,
|
|
55
59
|
consumerProps
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/elements/popover/Popover.tsx"],"sourcesContent":["import { createElement } from \"react\";\nimport type { ElementType, ReactElement } from \"react\";\nimport type {\n PopoverCloseProps,\n PopoverSurfaceProps,\n PopoverTriggerAction,\n PopoverTriggerProps,\n} from \"./types.js\";\n\n/**\n * Render a `popovertarget` invoker. React 19 knows `popoverTarget` and\n * `popoverTargetAction` as camelCase DOM properties: on the client it sets them via\n * `setAttribute`, which the browser lowercases automatically for an HTML element, and any\n * HTML parser (including hydration) lowercases attribute names from source regardless of\n * case — so the resulting DOM attribute is always `popovertarget`/`popovertargetaction`.\n * React's SSR string renderer has no case-mapping for these two (unlike `className` or\n * `htmlFor`) and serializes the literal camelCase spelling into the markup string; that is\n * a cosmetic detail of the raw SSR string, not a behavioral gap, since a real parser\n * normalizes it.\n *\n * `createElement` rather than JSX for the same reason as `elements/invoker`/`elements/dialog`:\n * `as` is typed as the generic `ElementType`, so a plain object survives type-checking where\n * a literal JSX attribute list on a polymorphic tag would not.\n */\nfunction renderInvoker(\n as: ElementType | undefined,\n marker: string,\n action: PopoverTriggerAction,\n target: string,\n consumerProps: Record<string, unknown>,\n): ReactElement {\n return createElement(as ?? \"button\", {\n ...consumerProps,\n [marker]: \"\",\n popoverTarget: target,\n popoverTargetAction: action,\n type: \"button\",\n });\n}\n\n/**\n * Acts on `target` (`action`, default `\"toggle\"`); light dismiss, Escape and nesting are\n * handled by the browser. The popover opened this way uses the invoker as its implicit\n * anchor, so no anchor name is emitted. Emits `data-uiify-popover-trigger`.\n */\nfunction popoverTrigger<TAs extends ElementType = \"button\">(\n props: PopoverTriggerProps<TAs>,\n): ReactElement {\n const {\n action = \"toggle\",\n as,\n target,\n ...consumerProps\n } = props as PopoverTriggerProps<\"button\">;\n return renderInvoker(\n as,\n \"data-uiify-popover
|
|
1
|
+
{"version":3,"sources":["../../../src/elements/popover/Popover.tsx"],"sourcesContent":["import { createElement } from \"react\";\nimport type { ElementType, ReactElement } from \"react\";\nimport type {\n PopoverCloseProps,\n PopoverSurfaceProps,\n PopoverTriggerAction,\n PopoverTriggerProps,\n} from \"./types.js\";\n\n/**\n * Render a `popovertarget` invoker. React 19 knows `popoverTarget` and\n * `popoverTargetAction` as camelCase DOM properties: on the client it sets them via\n * `setAttribute`, which the browser lowercases automatically for an HTML element, and any\n * HTML parser (including hydration) lowercases attribute names from source regardless of\n * case — so the resulting DOM attribute is always `popovertarget`/`popovertargetaction`.\n * React's SSR string renderer has no case-mapping for these two (unlike `className` or\n * `htmlFor`) and serializes the literal camelCase spelling into the markup string; that is\n * a cosmetic detail of the raw SSR string, not a behavioral gap, since a real parser\n * normalizes it.\n *\n * `createElement` rather than JSX for the same reason as `elements/invoker`/`elements/dialog`:\n * `as` is typed as the generic `ElementType`, so a plain object survives type-checking where\n * a literal JSX attribute list on a polymorphic tag would not.\n */\nfunction renderInvoker(\n as: ElementType | undefined,\n marker: string,\n part: string,\n action: PopoverTriggerAction,\n target: string,\n consumerProps: Record<string, unknown>,\n): ReactElement {\n return createElement(as ?? \"button\", {\n ...consumerProps,\n [marker]: \"\",\n \"data-part\": part,\n popoverTarget: target,\n popoverTargetAction: action,\n type: \"button\",\n });\n}\n\n/**\n * Acts on `target` (`action`, default `\"toggle\"`); light dismiss, Escape and nesting are\n * handled by the browser. The popover opened this way uses the invoker as its implicit\n * anchor, so no anchor name is emitted. Emits `data-uiify-popover` with\n * `data-part=\"trigger\"`.\n */\nfunction popoverTrigger<TAs extends ElementType = \"button\">(\n props: PopoverTriggerProps<TAs>,\n): ReactElement {\n const {\n action = \"toggle\",\n as,\n target,\n ...consumerProps\n } = props as PopoverTriggerProps<\"button\">;\n return renderInvoker(\n as,\n \"data-uiify-popover\",\n \"trigger\",\n action,\n target,\n consumerProps as Record<string, unknown>,\n );\n}\nexport const PopoverTrigger = /* @__PURE__ */ Object.assign(popoverTrigger, {\n displayName: \"PopoverTrigger\",\n});\n\n/**\n * The popover surface. `data-side`/`data-align` drive required geometry in\n * `@gunkin/uiify/components/behavior.css`; optional skins provide the gap. Emits `popover`, `data-side`, `data-align`, `data-positioning=\"native\"` and\n * `data-uiify-popover` with `data-part=\"surface\"`.\n */\nfunction popoverSurface(props: PopoverSurfaceProps): ReactElement {\n const { align = \"center\", children, mode = \"auto\", side = \"bottom\", ...consumerProps } = props;\n return (\n <div\n {...consumerProps}\n data-align={align}\n data-part=\"surface\"\n data-positioning=\"native\"\n data-side={side}\n data-uiify-popover=\"\"\n popover={mode}\n >\n {children}\n </div>\n );\n}\nexport const PopoverSurface = /* @__PURE__ */ Object.assign(popoverSurface, {\n displayName: \"PopoverSurface\",\n});\n\n/**\n * Hides `target`. Emits `data-uiify-popover` with `data-part=\"close\"`.\n */\nfunction popoverClose<TAs extends ElementType = \"button\">(\n props: PopoverCloseProps<TAs>,\n): ReactElement {\n const { as, target, ...consumerProps } = props as PopoverCloseProps<\"button\">;\n return renderInvoker(\n as,\n \"data-uiify-popover\",\n \"close\",\n \"hide\",\n target,\n consumerProps as Record<string, unknown>,\n );\n}\nexport const PopoverClose = /* @__PURE__ */ Object.assign(popoverClose, {\n displayName: \"PopoverClose\",\n});\n\nexport const Popover = {\n Trigger: PopoverTrigger,\n Surface: PopoverSurface,\n Close: PopoverClose,\n};\n"],"mappings":"AA8EI;AA9EJ,SAAS,qBAAqB;AAwB9B,SAAS,cACP,IACA,QACA,MACA,QACA,QACA,eACc;AACd,SAAO,cAAc,MAAM,UAAU;AAAA,IACnC,GAAG;AAAA,IACH,CAAC,MAAM,GAAG;AAAA,IACV,aAAa;AAAA,IACb,eAAe;AAAA,IACf,qBAAqB;AAAA,IACrB,MAAM;AAAA,EACR,CAAC;AACH;AAQA,SAAS,eACP,OACc;AACd,QAAM;AAAA,IACJ,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AACJ,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AACO,MAAM,iBAAiC,uBAAO,OAAO,gBAAgB;AAAA,EAC1E,aAAa;AACf,CAAC;AAOD,SAAS,eAAe,OAA0C;AAChE,QAAM,EAAE,QAAQ,UAAU,UAAU,OAA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