@gunkin/uiify 0.0.25-alpha → 0.0.26-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/agents/reference/components/accordion.md +4 -4
- package/agents/reference/components/alert-modal.md +10 -10
- package/agents/reference/components/alert.md +1 -1
- package/agents/reference/components/aspect-ratio.md +1 -1
- package/agents/reference/components/avatar.md +2 -2
- package/agents/reference/components/breadcrumb.md +9 -10
- package/agents/reference/components/candle-chart.md +35 -35
- package/agents/reference/components/carousel.md +10 -14
- package/agents/reference/components/collapsible.md +3 -3
- package/agents/reference/components/color-picker.md +6 -6
- package/agents/reference/components/combobox.md +7 -17
- package/agents/reference/components/context-menu.md +5 -26
- package/agents/reference/components/date-picker.md +2 -1
- package/agents/reference/components/drawer.md +17 -31
- package/agents/reference/components/dropdown-menu.md +2 -3
- package/agents/reference/components/field.md +11 -11
- package/agents/reference/components/form-error-summary.md +4 -4
- package/agents/reference/components/input-group.md +1 -0
- package/agents/reference/components/input.md +1 -0
- package/agents/reference/components/line-chart.md +29 -29
- package/agents/reference/components/modal.md +13 -15
- package/agents/reference/components/number-field.md +1 -1
- package/agents/reference/components/otp-input.md +2 -1
- package/agents/reference/components/pagination.md +7 -8
- package/agents/reference/components/rating.md +1 -1
- package/agents/reference/components/segmented-control.md +1 -0
- package/agents/reference/components/select.md +1 -0
- package/agents/reference/components/slider.md +4 -4
- package/agents/reference/components/spinner.md +1 -1
- package/agents/reference/components/table.md +1 -1
- package/agents/reference/components/tabs.md +6 -6
- package/agents/reference/components/tags-input.md +5 -12
- package/agents/reference/components/toast.md +8 -15
- package/agents/reference/components/toggle.md +4 -3
- package/agents/reference/components/virtual-scroll.md +4 -5
- package/agents/reference/elements/choice.md +3 -3
- package/agents/reference/elements/details.md +2 -2
- package/agents/reference/elements/popover.md +3 -3
- package/dist/components/accordion/Accordion.d.ts.map +1 -1
- package/dist/components/accordion/Accordion.js +20 -46
- package/dist/components/accordion/Accordion.js.map +1 -1
- package/dist/components/accordion/types.d.ts +6 -15
- package/dist/components/accordion/types.d.ts.map +1 -1
- package/dist/components/alert/Alert.d.ts.map +1 -1
- package/dist/components/alert/Alert.js +5 -14
- package/dist/components/alert/Alert.js.map +1 -1
- package/dist/components/alert/types.d.ts +3 -7
- package/dist/components/alert/types.d.ts.map +1 -1
- package/dist/components/alert-modal/AlertModal.d.ts.map +1 -1
- package/dist/components/alert-modal/AlertModal.js +28 -137
- package/dist/components/alert-modal/AlertModal.js.map +1 -1
- package/dist/components/alert-modal/AlertModalParts.d.ts.map +1 -1
- package/dist/components/alert-modal/AlertModalParts.js +4 -37
- package/dist/components/alert-modal/AlertModalParts.js.map +1 -1
- package/dist/components/alert-modal/types.d.ts +15 -33
- package/dist/components/alert-modal/types.d.ts.map +1 -1
- package/dist/components/aspect-ratio/AspectRatio.d.ts.map +1 -1
- package/dist/components/aspect-ratio/AspectRatio.js +4 -12
- package/dist/components/aspect-ratio/AspectRatio.js.map +1 -1
- package/dist/components/aspect-ratio/types.d.ts +3 -6
- package/dist/components/aspect-ratio/types.d.ts.map +1 -1
- package/dist/components/avatar/Avatar.d.ts.map +1 -1
- package/dist/components/avatar/Avatar.js +4 -21
- package/dist/components/avatar/Avatar.js.map +1 -1
- package/dist/components/avatar/types.d.ts +4 -14
- package/dist/components/avatar/types.d.ts.map +1 -1
- package/dist/components/breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/components/breadcrumb/Breadcrumb.js +43 -123
- package/dist/components/breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/components/breadcrumb/types.d.ts +12 -35
- package/dist/components/breadcrumb/types.d.ts.map +1 -1
- package/dist/components/candle-chart/CandleChart.d.ts.map +1 -1
- package/dist/components/candle-chart/CandleChart.js +122 -186
- package/dist/components/candle-chart/CandleChart.js.map +1 -1
- package/dist/components/candle-chart/client/CandleChartClient.d.ts.map +1 -1
- package/dist/components/candle-chart/client/CandleChartClient.js +8 -15
- package/dist/components/candle-chart/client/CandleChartClient.js.map +1 -1
- package/dist/components/candle-chart/types.d.ts +42 -116
- package/dist/components/candle-chart/types.d.ts.map +1 -1
- package/dist/components/carousel/CarouselMarkup.d.ts.map +1 -1
- package/dist/components/carousel/CarouselMarkup.js +55 -142
- package/dist/components/carousel/CarouselMarkup.js.map +1 -1
- package/dist/components/carousel/types.d.ts +13 -80
- package/dist/components/carousel/types.d.ts.map +1 -1
- package/dist/components/collapsible/Collapsible.d.ts +1 -5
- package/dist/components/collapsible/Collapsible.d.ts.map +1 -1
- package/dist/components/collapsible/Collapsible.js +3 -33
- package/dist/components/collapsible/Collapsible.js.map +1 -1
- package/dist/components/collapsible/types.d.ts +4 -18
- package/dist/components/collapsible/types.d.ts.map +1 -1
- package/dist/components/color-picker/ColorPicker.d.ts.map +1 -1
- package/dist/components/color-picker/ColorPicker.js +28 -123
- package/dist/components/color-picker/ColorPicker.js.map +1 -1
- package/dist/components/color-picker/types.d.ts +11 -30
- package/dist/components/color-picker/types.d.ts.map +1 -1
- package/dist/components/combobox/Combobox.d.ts.map +1 -1
- package/dist/components/combobox/Combobox.js +30 -23
- package/dist/components/combobox/Combobox.js.map +1 -1
- package/dist/components/combobox/types.d.ts +9 -29
- 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 +30 -53
- package/dist/components/context-menu/ContextMenu.js.map +1 -1
- package/dist/components/context-menu/types.d.ts +6 -31
- package/dist/components/context-menu/types.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.d.ts +1 -1
- package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.js +2 -1
- package/dist/components/date-picker/DatePicker.js.map +1 -1
- package/dist/components/date-picker/types.d.ts +4 -1
- package/dist/components/date-picker/types.d.ts.map +1 -1
- package/dist/components/drawer/Drawer.d.ts.map +1 -1
- package/dist/components/drawer/Drawer.js +12 -12
- package/dist/components/drawer/Drawer.js.map +1 -1
- package/dist/components/drawer/DrawerNative.d.ts.map +1 -1
- package/dist/components/drawer/DrawerNative.js +47 -252
- package/dist/components/drawer/DrawerNative.js.map +1 -1
- package/dist/components/drawer/types.d.ts +25 -30
- 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 +30 -27
- package/dist/components/dropdown-menu/DropdownMenu.js.map +1 -1
- package/dist/components/dropdown-menu/DropdownMenuBar.d.ts.map +1 -1
- package/dist/components/dropdown-menu/DropdownMenuBar.js +3 -7
- package/dist/components/dropdown-menu/DropdownMenuBar.js.map +1 -1
- package/dist/components/dropdown-menu/types.d.ts +2 -5
- package/dist/components/dropdown-menu/types.d.ts.map +1 -1
- package/dist/components/field/Field.js +7 -7
- package/dist/components/field/Field.js.map +1 -1
- package/dist/components/field/types.d.ts +11 -11
- package/dist/components/field/types.d.ts.map +1 -1
- package/dist/components/form-error-summary/FormErrorSummary.d.ts.map +1 -1
- package/dist/components/form-error-summary/FormErrorSummary.js +20 -34
- package/dist/components/form-error-summary/FormErrorSummary.js.map +1 -1
- package/dist/components/form-error-summary/types.d.ts +6 -16
- package/dist/components/form-error-summary/types.d.ts.map +1 -1
- package/dist/components/hover-card/HoverCard.d.ts.map +1 -1
- package/dist/components/hover-card/HoverCard.js +9 -9
- 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 +2 -0
- package/dist/components/input/Input.js.map +1 -1
- package/dist/components/input/types.d.ts +3 -0
- package/dist/components/input/types.d.ts.map +1 -1
- package/dist/components/input-group/InputGroup.d.ts.map +1 -1
- package/dist/components/input-group/InputGroup.js +2 -1
- package/dist/components/input-group/InputGroup.js.map +1 -1
- package/dist/components/input-group/types.d.ts +3 -0
- package/dist/components/input-group/types.d.ts.map +1 -1
- package/dist/components/internal/chart-scrollbar/use-scrollbar-reserve.d.ts +2 -2
- package/dist/components/internal/chart-scrollbar/use-scrollbar-reserve.d.ts.map +1 -1
- package/dist/components/internal/chart-scrollbar/use-scrollbar-reserve.js +11 -3
- package/dist/components/internal/chart-scrollbar/use-scrollbar-reserve.js.map +1 -1
- package/dist/components/internal/choice-family/ChoiceGroup.d.ts.map +1 -1
- package/dist/components/internal/choice-family/ChoiceGroup.js +14 -51
- package/dist/components/internal/choice-family/ChoiceGroup.js.map +1 -1
- package/dist/components/internal/choice-family/types.d.ts +8 -40
- package/dist/components/internal/choice-family/types.d.ts.map +1 -1
- package/dist/components/internal/control-size/types.d.ts +3 -0
- package/dist/components/internal/control-size/types.d.ts.map +1 -0
- package/dist/components/internal/control-size/types.js +1 -0
- package/dist/components/internal/control-size/types.js.map +1 -0
- package/dist/components/internal/live-chart/types.d.ts +3 -1
- package/dist/components/internal/live-chart/types.d.ts.map +1 -1
- package/dist/components/internal/live-chart/use-live-chart-window.d.ts.map +1 -1
- package/dist/components/internal/live-chart/use-live-chart-window.js +21 -5
- package/dist/components/internal/live-chart/use-live-chart-window.js.map +1 -1
- package/dist/components/internal/menu/menu-parts.d.ts.map +1 -1
- package/dist/components/internal/menu/menu-parts.js +3 -3
- package/dist/components/internal/menu/menu-parts.js.map +1 -1
- package/dist/components/internal/native-check-control/NativeCheckControl.d.ts.map +1 -1
- package/dist/components/internal/native-check-control/NativeCheckControl.js +8 -32
- package/dist/components/internal/native-check-control/NativeCheckControl.js.map +1 -1
- package/dist/components/internal/native-check-control/types.d.ts +4 -18
- package/dist/components/internal/native-check-control/types.d.ts.map +1 -1
- package/dist/components/line-chart/LineChart.d.ts.map +1 -1
- package/dist/components/line-chart/LineChart.js +134 -208
- package/dist/components/line-chart/LineChart.js.map +1 -1
- package/dist/components/line-chart/client/LineChartClient.d.ts.map +1 -1
- package/dist/components/line-chart/client/LineChartClient.js +8 -15
- package/dist/components/line-chart/client/LineChartClient.js.map +1 -1
- package/dist/components/line-chart/types.d.ts +36 -103
- package/dist/components/line-chart/types.d.ts.map +1 -1
- package/dist/components/modal/Modal.d.ts.map +1 -1
- package/dist/components/modal/Modal.js +34 -115
- package/dist/components/modal/Modal.js.map +1 -1
- package/dist/components/modal/ModalAnatomy.js +6 -6
- package/dist/components/modal/ModalAnatomy.js.map +1 -1
- package/dist/components/modal/ModalParts.js +1 -1
- 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 +2 -2
- package/dist/components/modal/client/ModalClientContent.js.map +1 -1
- package/dist/components/modal/types.d.ts +19 -19
- package/dist/components/modal/types.d.ts.map +1 -1
- package/dist/components/number-field/NumberField.d.ts.map +1 -1
- package/dist/components/number-field/NumberField.js +13 -11
- package/dist/components/number-field/NumberField.js.map +1 -1
- package/dist/components/number-field/types.d.ts +1 -1
- package/dist/components/number-field/types.d.ts.map +1 -1
- package/dist/components/otp-input/OtpInput.d.ts.map +1 -1
- package/dist/components/otp-input/OtpInput.js +9 -9
- package/dist/components/otp-input/OtpInput.js.map +1 -1
- package/dist/components/otp-input/types.d.ts +4 -1
- package/dist/components/otp-input/types.d.ts.map +1 -1
- package/dist/components/pagination/Pagination.d.ts.map +1 -1
- package/dist/components/pagination/Pagination.js +26 -69
- package/dist/components/pagination/Pagination.js.map +1 -1
- package/dist/components/pagination/PaginationShell.d.ts.map +1 -1
- package/dist/components/pagination/PaginationShell.js +5 -6
- package/dist/components/pagination/PaginationShell.js.map +1 -1
- package/dist/components/pagination/types.d.ts +9 -32
- package/dist/components/pagination/types.d.ts.map +1 -1
- package/dist/components/rating/types.d.ts +1 -5
- package/dist/components/rating/types.d.ts.map +1 -1
- package/dist/components/segmented-control/SegmentedControl.d.ts +1 -1
- package/dist/components/segmented-control/SegmentedControl.d.ts.map +1 -1
- package/dist/components/segmented-control/SegmentedControl.js +4 -2
- package/dist/components/segmented-control/SegmentedControl.js.map +1 -1
- package/dist/components/segmented-control/client/SegmentedControlClient.d.ts +1 -1
- package/dist/components/segmented-control/client/SegmentedControlClient.d.ts.map +1 -1
- package/dist/components/segmented-control/client/SegmentedControlClient.js +4 -2
- package/dist/components/segmented-control/client/SegmentedControlClient.js.map +1 -1
- package/dist/components/segmented-control/types.d.ts +3 -0
- package/dist/components/segmented-control/types.d.ts.map +1 -1
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/Select.js +2 -0
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components/select/types.d.ts +3 -0
- package/dist/components/select/types.d.ts.map +1 -1
- package/dist/components/slider/Slider.d.ts.map +1 -1
- package/dist/components/slider/Slider.js +12 -7
- package/dist/components/slider/Slider.js.map +1 -1
- package/dist/components/slider/client/SliderClient.d.ts.map +1 -1
- package/dist/components/slider/client/SliderClient.js +53 -100
- package/dist/components/slider/client/SliderClient.js.map +1 -1
- package/dist/components/slider/types.d.ts +8 -38
- package/dist/components/slider/types.d.ts.map +1 -1
- package/dist/components/spinner/Spinner.d.ts.map +1 -1
- package/dist/components/spinner/Spinner.js +2 -10
- package/dist/components/spinner/Spinner.js.map +1 -1
- package/dist/components/spinner/types.d.ts +3 -6
- package/dist/components/spinner/types.d.ts.map +1 -1
- package/dist/components/table/client/TableColumnHeader.d.ts.map +1 -1
- package/dist/components/table/client/TableColumnHeader.js +1 -15
- package/dist/components/table/client/TableColumnHeader.js.map +1 -1
- package/dist/components/table/types.d.ts +2 -6
- package/dist/components/table/types.d.ts.map +1 -1
- package/dist/components/tabs/Tabs.d.ts.map +1 -1
- package/dist/components/tabs/Tabs.js +9 -43
- package/dist/components/tabs/Tabs.js.map +1 -1
- package/dist/components/tabs/types.d.ts +8 -21
- package/dist/components/tabs/types.d.ts.map +1 -1
- package/dist/components/tags-input/TagsInput.d.ts.map +1 -1
- package/dist/components/tags-input/TagsInput.js +16 -27
- package/dist/components/tags-input/TagsInput.js.map +1 -1
- package/dist/components/tags-input/types.d.ts +8 -23
- package/dist/components/tags-input/types.d.ts.map +1 -1
- package/dist/components/toast/Toast.d.ts.map +1 -1
- package/dist/components/toast/Toast.js +13 -62
- 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 +20 -57
- package/dist/components/toast/ToastElements.js.map +1 -1
- package/dist/components/toast/types.d.ts +9 -36
- package/dist/components/toast/types.d.ts.map +1 -1
- package/dist/components/toggle/Toggle.d.ts +1 -1
- package/dist/components/toggle/Toggle.d.ts.map +1 -1
- package/dist/components/toggle/Toggle.js +36 -61
- package/dist/components/toggle/Toggle.js.map +1 -1
- package/dist/components/toggle/types.d.ts +5 -24
- package/dist/components/toggle/types.d.ts.map +1 -1
- package/dist/components/tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/Tooltip.js +4 -4
- package/dist/components/tooltip/Tooltip.js.map +1 -1
- package/dist/components/virtual-scroll/VirtualScroll.d.ts.map +1 -1
- package/dist/components/virtual-scroll/VirtualScroll.js +65 -43
- package/dist/components/virtual-scroll/VirtualScroll.js.map +1 -1
- package/dist/components/virtual-scroll/VirtualScrollRowShell.js +2 -2
- package/dist/components/virtual-scroll/VirtualScrollRowShell.js.map +1 -1
- package/dist/components/virtual-scroll/types.d.ts +7 -20
- package/dist/components/virtual-scroll/types.d.ts.map +1 -1
- package/dist/components/virtual-scroll/types.js.map +1 -1
- package/dist/components/virtual-scroll/virtual-scroll-scroll-sync.d.ts +3 -0
- package/dist/components/virtual-scroll/virtual-scroll-scroll-sync.d.ts.map +1 -1
- package/dist/components/virtual-scroll/virtual-scroll-scroll-sync.js +11 -2
- package/dist/components/virtual-scroll/virtual-scroll-scroll-sync.js.map +1 -1
- package/dist/core/class-names.d.ts +3 -0
- package/dist/core/class-names.d.ts.map +1 -0
- package/dist/core/class-names.js +7 -0
- package/dist/core/class-names.js.map +1 -0
- package/dist/core/part-names.d.ts +8 -0
- package/dist/core/part-names.d.ts.map +1 -0
- package/dist/core/part-names.js +111 -0
- package/dist/core/part-names.js.map +1 -0
- package/dist/core/polymorphic.d.ts +10 -3
- package/dist/core/polymorphic.d.ts.map +1 -1
- package/dist/core/render-native-invoker.d.ts +1 -0
- package/dist/core/render-native-invoker.d.ts.map +1 -1
- package/dist/core/render-native-invoker.js +6 -6
- package/dist/core/render-native-invoker.js.map +1 -1
- package/dist/core/roving-focus.d.ts +2 -2
- package/dist/core/roving-focus.d.ts.map +1 -1
- package/dist/core/roving-focus.js +6 -7
- package/dist/core/roving-focus.js.map +1 -1
- package/dist/core/slot-props.d.ts +9 -7
- package/dist/core/slot-props.d.ts.map +1 -1
- package/dist/core/slot-props.js +4 -14
- package/dist/core/slot-props.js.map +1 -1
- package/dist/elements/choice/Choice.d.ts.map +1 -1
- package/dist/elements/choice/Choice.js +5 -42
- package/dist/elements/choice/Choice.js.map +1 -1
- package/dist/elements/choice/types.d.ts +4 -11
- package/dist/elements/choice/types.d.ts.map +1 -1
- package/dist/elements/details/Details.d.ts.map +1 -1
- package/dist/elements/details/Details.js +4 -5
- package/dist/elements/details/Details.js.map +1 -1
- package/dist/elements/details/types.d.ts +3 -3
- package/dist/elements/details/types.d.ts.map +1 -1
- package/dist/elements/dialog/Dialog.d.ts.map +1 -1
- package/dist/elements/dialog/Dialog.js +1 -1
- package/dist/elements/dialog/Dialog.js.map +1 -1
- package/dist/elements/invoker/Invoker.js +3 -3
- package/dist/elements/invoker/Invoker.js.map +1 -1
- package/dist/elements/popover/Popover.d.ts.map +1 -1
- package/dist/elements/popover/Popover.js +3 -3
- package/dist/elements/popover/Popover.js.map +1 -1
- package/dist/elements/popover/types.d.ts +6 -4
- package/dist/elements/popover/types.d.ts.map +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/styles/tailwind.css +2 -2
- package/dist/styles/tokens.css +1 -1
- package/package.json +1 -1
- package/skills/uiify/references/elements/aspect-ratio.md +1 -1
- package/skills/uiify/references/elements/field.md +1 -1
- package/skills/uiify/references/elements/toggle.md +1 -0
|
@@ -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\ninterface NativeInvokerOptions {\n readonly button?: boolean;\n readonly variant?: \"secondary\" | \"ghost\" | \"destructive\";\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
|
|
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?: \"secondary\" | \"ghost\" | \"destructive\";\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 * The invoker attributes, `type=\"button\"` and markers are defaults: consumer props replace them.\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 type: \"button\",\n command,\n commandfor: target,\n \"data-part\": part,\n [marker]: \"\",\n ...(options.button ? { \"data-uiify-button\": \"\" } : {}),\n ...(options.variant ? { \"data-variant\": options.variant } : {}),\n ...consumerProps,\n });\n}\n"],"mappings":"AAAA,SAAS,qBAAqB;AAqBvB,SAAS,oBACd,IACA,QACA,MACA,SACA,QACA,eACA,UAAgC,CAAC,GACnB;AACd,SAAO,cAAc,MAAM,UAAU;AAAA,IACnC,MAAM;AAAA,IACN;AAAA,IACA,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,CAAC,MAAM,GAAG;AAAA,IACV,GAAI,QAAQ,SAAS,EAAE,qBAAqB,GAAG,IAAI,CAAC;AAAA,IACpD,GAAI,QAAQ,UAAU,EAAE,gBAAgB,QAAQ,QAAQ,IAAI,CAAC;AAAA,IAC7D,GAAG;AAAA,EACL,CAAC;AACH;","names":[]}
|
|
@@ -15,9 +15,9 @@ export declare namespace RovingFocusRoot {
|
|
|
15
15
|
var displayName: string;
|
|
16
16
|
}
|
|
17
17
|
export interface RovingFocusItemOwnProps {
|
|
18
|
-
readonly ref?: Ref<HTMLElement
|
|
18
|
+
readonly ref?: Ref<HTMLElement> | undefined;
|
|
19
19
|
readonly disabled?: boolean;
|
|
20
|
-
readonly id?: string;
|
|
20
|
+
readonly id?: string | undefined;
|
|
21
21
|
readonly textValue?: string;
|
|
22
22
|
}
|
|
23
23
|
export type RovingFocusItemProps<TAs extends ElementType = "div"> = RenderableProps<TAs, RovingFocusItemOwnProps, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roving-focus.d.ts","sourceRoot":"","sources":["../../src/core/roving-focus.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"roving-focus.d.ts","sourceRoot":"","sources":["../../src/core/roving-focus.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,WAAW,EAGX,YAAY,EACZ,GAAG,EACJ,MAAM,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S,WAAW,GAAG,KAAK,EAC7D,KAAK,EAAE,oBAAoB,CAAC,GAAG,CAAC,GAC/B,YAAY,GAAG,IAAI,CA8ErB;AACD,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAClC,YAAY,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -28,9 +28,9 @@ function RovingFocusRoot(props) {
|
|
|
28
28
|
as,
|
|
29
29
|
defaultTag: "div",
|
|
30
30
|
props: {
|
|
31
|
-
...consumerProps,
|
|
32
31
|
...direction ? { dir: direction } : {},
|
|
33
|
-
"data-orientation": orientation
|
|
32
|
+
"data-orientation": orientation,
|
|
33
|
+
...consumerProps
|
|
34
34
|
},
|
|
35
35
|
render,
|
|
36
36
|
state: { orientation }
|
|
@@ -42,7 +42,6 @@ function RovingFocusItem(props) {
|
|
|
42
42
|
const {
|
|
43
43
|
as,
|
|
44
44
|
disabled = false,
|
|
45
|
-
id: providedId,
|
|
46
45
|
ref: consumerRef,
|
|
47
46
|
render,
|
|
48
47
|
textValue = "",
|
|
@@ -50,7 +49,7 @@ function RovingFocusItem(props) {
|
|
|
50
49
|
} = props;
|
|
51
50
|
const { onFocus: consumerOnFocus, onKeyDown: consumerOnKeyDown } = consumerProps;
|
|
52
51
|
const generatedId = useId();
|
|
53
|
-
const id =
|
|
52
|
+
const id = props.id ?? generatedId;
|
|
54
53
|
const store = useContext(RovingFocusContext);
|
|
55
54
|
if (!store) throw new Error("RovingFocusItem must be used inside RovingFocusRoot");
|
|
56
55
|
const elementRef = useRef(null);
|
|
@@ -97,16 +96,16 @@ function RovingFocusItem(props) {
|
|
|
97
96
|
as,
|
|
98
97
|
defaultTag: "div",
|
|
99
98
|
props: {
|
|
100
|
-
...consumerProps,
|
|
101
99
|
id,
|
|
102
100
|
"aria-disabled": disabled || void 0,
|
|
103
101
|
"data-current": current ? "" : void 0,
|
|
104
102
|
"data-disabled": disabled ? "" : void 0,
|
|
105
103
|
...nativeButton ? { disabled: disabled || void 0 } : {},
|
|
104
|
+
tabIndex: current && !disabled ? 0 : -1,
|
|
105
|
+
...consumerProps,
|
|
106
106
|
onFocus: composeEventHandlers(consumerOnFocus, handleFocus),
|
|
107
107
|
onKeyDown: composeEventHandlers(consumerOnKeyDown, handleKeyDown),
|
|
108
|
-
ref: mergedRef
|
|
109
|
-
tabIndex: current && !disabled ? 0 : -1
|
|
108
|
+
ref: mergedRef
|
|
110
109
|
},
|
|
111
110
|
render,
|
|
112
111
|
state: { current, disabled }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/roving-focus.tsx"],"sourcesContent":["\"use client\";\
|
|
1
|
+
{"version":3,"sources":["../../src/core/roving-focus.tsx"],"sourcesContent":["\"use client\";\nimport { createContext, useCallback, useContext, useRef, useSyncExternalStore } from \"react\";\nimport { useId, useIsomorphicLayoutEffect, useMergedRefs } from \"@gunkin/uiify/hooks\";\nimport type {\n ElementType,\n FocusEvent as ReactFocusEvent,\n KeyboardEvent as ReactKeyboardEvent,\n ReactElement,\n Ref,\n} from \"react\";\nimport { composeEventHandlers } from \"./compose-event-handlers.js\";\nimport { useDirectionOverride, type Direction } from \"./direction.js\";\nimport { isComposingKeyEvent } from \"./ime.js\";\nimport type { RenderableProps } from \"./polymorphic.js\";\nimport {\n createRovingFocusStore,\n type RovingFocusOrientation,\n type RovingFocusStore,\n} from \"./roving-focus-store.js\";\nimport { resolveDirection } from \"./text-direction.js\";\nimport { useRenderElement } from \"./use-render-element.js\";\nconst RovingFocusContext = createContext<RovingFocusStore | null>(null);\nexport interface RovingFocusRootOwnProps {\n readonly direction?: Direction;\n readonly loop?: boolean;\n readonly orientation?: RovingFocusOrientation;\n}\nexport type RovingFocusRootProps<TAs extends ElementType = \"div\"> = RenderableProps<\n TAs,\n RovingFocusRootOwnProps,\n {\n orientation: RovingFocusOrientation;\n },\n HTMLElement\n>;\nexport function RovingFocusRoot<TAs extends ElementType = \"div\">(\n props: RovingFocusRootProps<TAs>,\n): ReactElement | null {\n const {\n as,\n direction: localDirection,\n loop = true,\n orientation = \"both\",\n render,\n ...consumerProps\n } = props as RovingFocusRootProps<ElementType>;\n const direction = useDirectionOverride(localDirection);\n const storeRef = useRef<RovingFocusStore | null>(null);\n storeRef.current ??= createRovingFocusStore({ direction, loop, orientation });\n storeRef.current.updateConfig({ direction, loop, orientation });\n const element = useRenderElement({\n as,\n defaultTag: \"div\",\n props: {\n ...(direction ? { dir: direction } : {}),\n \"data-orientation\": orientation,\n ...consumerProps,\n },\n render,\n state: { orientation },\n });\n return <RovingFocusContext value={storeRef.current}>{element}</RovingFocusContext>;\n}\nRovingFocusRoot.displayName = \"RovingFocusRoot\";\nexport interface RovingFocusItemOwnProps {\n readonly ref?: Ref<HTMLElement> | undefined;\n readonly disabled?: boolean;\n readonly id?: string | undefined;\n readonly textValue?: string;\n}\nexport type RovingFocusItemProps<TAs extends ElementType = \"div\"> = RenderableProps<\n TAs,\n RovingFocusItemOwnProps,\n {\n current: boolean;\n disabled: boolean;\n },\n HTMLElement\n>;\nexport function RovingFocusItem<TAs extends ElementType = \"div\">(\n props: RovingFocusItemProps<TAs>,\n): ReactElement | null {\n const {\n as,\n disabled = false,\n ref: consumerRef,\n render,\n textValue = \"\",\n ...consumerProps\n } = props as RovingFocusItemProps<ElementType> & {\n ref?: Ref<HTMLElement>;\n };\n const { onFocus: consumerOnFocus, onKeyDown: consumerOnKeyDown } = consumerProps as {\n onFocus?: (event: ReactFocusEvent<HTMLElement>) => void;\n onKeyDown?: (event: ReactKeyboardEvent<HTMLElement>) => void;\n };\n const generatedId = useId();\n const id = props.id ?? generatedId;\n const store = useContext(RovingFocusContext);\n if (!store) throw new Error(\"RovingFocusItem must be used inside RovingFocusRoot\");\n const elementRef = useRef<HTMLElement | null>(null);\n const current = useSyncExternalStore(\n (listener) => store.subscribeItem(id, listener),\n () => store.getCurrentId() === id,\n () => false,\n );\n const setElement = useCallback(\n (element: HTMLElement | null) => store.setElement(id, element),\n [id, store],\n );\n const mergedRef = useMergedRefs(elementRef, consumerRef, setElement);\n useIsomorphicLayoutEffect(\n () =>\n store.register({\n disabled,\n element: elementRef.current,\n id,\n textValue: textValue || elementRef.current?.textContent?.trim() || \"\",\n }),\n [id, store],\n );\n useIsomorphicLayoutEffect(() => {\n store.updateItem(id, {\n disabled,\n textValue: textValue || elementRef.current?.textContent?.trim() || \"\",\n });\n }, [disabled, id, store, textValue]);\n const nativeButton = as === \"button\";\n const handleFocus = () => {\n if (!disabled) store.setCurrentId(id);\n };\n const handleKeyDown = (event: ReactKeyboardEvent<HTMLElement>) => {\n if (isComposingKeyEvent(event)) return;\n if (event.key === \"Home\" || event.key === \"End\" || event.key.startsWith(\"Arrow\")) {\n if (store.move(id, event.key, resolveDirection(event.currentTarget, store.getDirection()))) {\n event.preventDefault();\n }\n } else if (event.key.length === 1 && !event.altKey && !event.ctrlKey && !event.metaKey) {\n store.search(event.key);\n }\n };\n return useRenderElement({\n as,\n defaultTag: \"div\",\n props: {\n id,\n \"aria-disabled\": disabled || undefined,\n \"data-current\": current ? \"\" : undefined,\n \"data-disabled\": disabled ? \"\" : undefined,\n ...(nativeButton ? { disabled: disabled || undefined } : {}),\n tabIndex: current && !disabled ? 0 : -1,\n ...consumerProps,\n onFocus: composeEventHandlers(consumerOnFocus, handleFocus),\n onKeyDown: composeEventHandlers(consumerOnKeyDown, handleKeyDown),\n ref: mergedRef,\n },\n render,\n state: { current, disabled },\n });\n}\nexport { createRovingFocusStore };\nexport type { RovingFocusOrientation, RovingFocusStore };\n"],"mappings":";AA6DS;AA5DT,SAAS,eAAe,aAAa,YAAY,QAAQ,4BAA4B;AACrF,SAAS,OAAO,2BAA2B,qBAAqB;AAQhE,SAAS,4BAA4B;AACrC,SAAS,4BAA4C;AACrD,SAAS,2BAA2B;AAEpC;AAAA,EACE;AAAA,OAGK;AACP,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AACjC,MAAM,qBAAqB,cAAuC,IAAI;AAc/D,SAAS,gBACd,OACqB;AACrB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qBAAqB,iBAAiB,WAAW;AAAA,MAC1D,WAAW,qBAAqB,mBAAmB,aAAa;AAAA,MAChE,KAAK;AAAA,IACP;AAAA,IACA;AAAA,IACA,OAAO,EAAE,SAAS,SAAS;AAAA,EAC7B,CAAC;AACH;","names":[]}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef, ElementType } from "react";
|
|
1
2
|
/** Native custom data attributes are accepted by slot objects as well as JSX. */
|
|
2
3
|
export interface ConsumerDataAttributes {
|
|
3
4
|
readonly [attribute: `data-${string}`]: string | number | boolean | undefined;
|
|
4
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* Native props for an element whose content the component renders. Consumer values replace the
|
|
8
|
+
* component's defaults, ids, ARIA and markers included; only the content itself is not a slot prop.
|
|
9
|
+
*/
|
|
10
|
+
export type SlotProps<T extends ElementType> = Omit<ComponentPropsWithRef<T>, "children" | "dangerouslySetInnerHTML"> & ConsumerDataAttributes;
|
|
5
11
|
/**
|
|
6
12
|
* Props for a repeated internal part. Common props apply to each instance;
|
|
7
13
|
* `byItemValue` adds props to the item with the matching stable `value`.
|
|
8
14
|
*/
|
|
9
|
-
export type RepeatedSlotProps<TProps extends object
|
|
10
|
-
readonly byItemValue?: Readonly<Record<string,
|
|
15
|
+
export type RepeatedSlotProps<TProps extends object> = TProps & {
|
|
16
|
+
readonly byItemValue?: Readonly<Record<string, TProps>>;
|
|
11
17
|
} & ConsumerDataAttributes;
|
|
12
18
|
/** Merge consumer props without losing common/item classes, styles, or event handlers. */
|
|
13
19
|
export declare function mergeRepeatedSlotProps<TProps extends object>(common: TProps | undefined, byItemValue: TProps | undefined): TProps;
|
|
14
|
-
export declare function resolveRepeatedSlotProps<TProps extends object>(props:
|
|
15
|
-
readonly byItemValue?: Readonly<Record<string, TProps>>;
|
|
16
|
-
}) | undefined, itemValue: string, protectedKeys?: readonly string[]): TProps;
|
|
17
|
-
/** Remove generated content and behavior-owned properties, including values from JS callers. */
|
|
18
|
-
export declare function omitProps<TProps extends object>(props: TProps | undefined, omittedKeys: readonly string[]): TProps;
|
|
20
|
+
export declare function resolveRepeatedSlotProps<TProps extends object>(props: RepeatedSlotProps<TProps> | undefined, itemValue: string): TProps;
|
|
19
21
|
//# sourceMappingURL=slot-props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slot-props.d.ts","sourceRoot":"","sources":["../../src/core/slot-props.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"slot-props.d.ts","sourceRoot":"","sources":["../../src/core/slot-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAO,MAAM,OAAO,CAAC;AAGrE,iFAAiF;AACjF,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,SAAS,EAAE,QAAQ,MAAM,EAAE,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CAC/E;AAED;;;GAGG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,WAAW,IAAI,IAAI,CACjD,qBAAqB,CAAC,CAAC,CAAC,EACxB,UAAU,GAAG,yBAAyB,CACvC,GACC,sBAAsB,CAAC;AAOzB;;;GAGG;AACH,MAAM,MAAM,iBAAiB,CAAC,MAAM,SAAS,MAAM,IAAI,MAAM,GAAG;IAC9D,QAAQ,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACzD,GAAG,sBAAsB,CAAC;AAE3B,0FAA0F;AAC1F,wBAAgB,sBAAsB,CAAC,MAAM,SAAS,MAAM,EAC1D,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,WAAW,EAAE,MAAM,GAAG,SAAS,GAC9B,MAAM,CA0CR;AAED,wBAAgB,wBAAwB,CAAC,MAAM,SAAS,MAAM,EAC5D,KAAK,EAAE,iBAAiB,CAAC,MAAM,CAAC,GAAG,SAAS,EAC5C,SAAS,EAAE,MAAM,GAChB,MAAM,CAGR"}
|
package/dist/core/slot-props.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { cn } from "./class-names.js";
|
|
1
2
|
function mergeRepeatedSlotProps(common, byItemValue) {
|
|
2
3
|
const commonRecord = common;
|
|
3
4
|
const itemRecord = byItemValue;
|
|
4
5
|
const merged = { ...commonRecord, ...itemRecord };
|
|
5
6
|
if (commonRecord?.className !== void 0 || itemRecord?.className !== void 0) {
|
|
6
|
-
merged.className =
|
|
7
|
+
merged.className = cn(commonRecord?.className, itemRecord?.className);
|
|
7
8
|
}
|
|
8
9
|
if (commonRecord?.style !== void 0 || itemRecord?.style !== void 0) {
|
|
9
10
|
merged.style = { ...commonRecord?.style, ...itemRecord?.style };
|
|
@@ -37,23 +38,12 @@ function mergeRepeatedSlotProps(common, byItemValue) {
|
|
|
37
38
|
}
|
|
38
39
|
return merged;
|
|
39
40
|
}
|
|
40
|
-
function resolveRepeatedSlotProps(props, itemValue
|
|
41
|
+
function resolveRepeatedSlotProps(props, itemValue) {
|
|
41
42
|
const { byItemValue, ...common } = props ?? {};
|
|
42
|
-
|
|
43
|
-
return omitProps(mergeRepeatedSlotProps(common, itemProps), [
|
|
44
|
-
"children",
|
|
45
|
-
"dangerouslySetInnerHTML",
|
|
46
|
-
...protectedKeys
|
|
47
|
-
]);
|
|
48
|
-
}
|
|
49
|
-
function omitProps(props, omittedKeys) {
|
|
50
|
-
const result = { ...props };
|
|
51
|
-
for (const key of omittedKeys) delete result[key];
|
|
52
|
-
return result;
|
|
43
|
+
return mergeRepeatedSlotProps(common, byItemValue?.[itemValue]);
|
|
53
44
|
}
|
|
54
45
|
export {
|
|
55
46
|
mergeRepeatedSlotProps,
|
|
56
|
-
omitProps,
|
|
57
47
|
resolveRepeatedSlotProps
|
|
58
48
|
};
|
|
59
49
|
//# sourceMappingURL=slot-props.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/slot-props.ts"],"sourcesContent":["import type { Ref } from \"react\";\n\n/** Native custom data attributes are accepted by slot objects as well as JSX. */\nexport interface ConsumerDataAttributes {\n readonly [attribute: `data-${string}`]: string | number | boolean | undefined;\n}\n\ntype NativeSlotObject = Record<string, unknown> & {\n readonly className?: string;\n readonly style?: object;\n};\n\n/**\n * Props for a repeated internal part. Common props apply to each instance;\n * `byItemValue` adds props to the item with the matching stable `value`.\n */\nexport type RepeatedSlotProps<TProps extends object
|
|
1
|
+
{"version":3,"sources":["../../src/core/slot-props.ts"],"sourcesContent":["import type { ComponentPropsWithRef, ElementType, Ref } from \"react\";\nimport { cn } from \"./class-names.js\";\n\n/** Native custom data attributes are accepted by slot objects as well as JSX. */\nexport interface ConsumerDataAttributes {\n readonly [attribute: `data-${string}`]: string | number | boolean | undefined;\n}\n\n/**\n * Native props for an element whose content the component renders. Consumer values replace the\n * component's defaults, ids, ARIA and markers included; only the content itself is not a slot prop.\n */\nexport type SlotProps<T extends ElementType> = Omit<\n ComponentPropsWithRef<T>,\n \"children\" | \"dangerouslySetInnerHTML\"\n> &\n ConsumerDataAttributes;\n\ntype NativeSlotObject = Record<string, unknown> & {\n readonly className?: string;\n readonly style?: object;\n};\n\n/**\n * Props for a repeated internal part. Common props apply to each instance;\n * `byItemValue` adds props to the item with the matching stable `value`.\n */\nexport type RepeatedSlotProps<TProps extends object> = TProps & {\n readonly byItemValue?: Readonly<Record<string, TProps>>;\n} & ConsumerDataAttributes;\n\n/** Merge consumer props without losing common/item classes, styles, or event handlers. */\nexport function mergeRepeatedSlotProps<TProps extends object>(\n common: TProps | undefined,\n byItemValue: TProps | undefined,\n): TProps {\n const commonRecord = common as NativeSlotObject | undefined;\n const itemRecord = byItemValue as NativeSlotObject | undefined;\n const merged: Record<string, unknown> = { ...commonRecord, ...itemRecord };\n\n if (commonRecord?.className !== undefined || itemRecord?.className !== undefined) {\n merged.className = cn(commonRecord?.className, itemRecord?.className);\n }\n if (commonRecord?.style !== undefined || itemRecord?.style !== undefined) {\n merged.style = { ...commonRecord?.style, ...itemRecord?.style };\n }\n\n for (const [key, first] of Object.entries(commonRecord ?? {})) {\n const second = itemRecord?.[key];\n if (key.startsWith(\"on\") && typeof first === \"function\" && typeof second === \"function\") {\n merged[key] = (...args: unknown[]) => {\n (first as (...values: unknown[]) => unknown)(...args);\n (second as (...values: unknown[]) => unknown)(...args);\n };\n }\n }\n\n if (commonRecord?.ref !== undefined && itemRecord?.ref !== undefined) {\n const refs = [commonRecord.ref, itemRecord.ref] as Array<Ref<unknown>>;\n merged.ref = (node: unknown) => {\n const cleanups = refs.map((ref) => {\n if (typeof ref === \"function\") {\n const cleanup = ref(node);\n return typeof cleanup === \"function\" ? cleanup : () => ref(null);\n }\n if (ref !== null) ref.current = node;\n return () => {\n if (ref !== null) ref.current = null;\n };\n });\n return () => {\n for (const cleanup of cleanups.reverse()) cleanup();\n };\n };\n }\n\n return merged as TProps;\n}\n\nexport function resolveRepeatedSlotProps<TProps extends object>(\n props: RepeatedSlotProps<TProps> | undefined,\n itemValue: string,\n): TProps {\n const { byItemValue, ...common } = props ?? {};\n return mergeRepeatedSlotProps(common as TProps, byItemValue?.[itemValue]);\n}\n"],"mappings":"AACA,SAAS,UAAU;AA+BZ,SAAS,uBACd,QACA,aACQ;AACR,QAAM,eAAe;AACrB,QAAM,aAAa;AACnB,QAAM,SAAkC,EAAE,GAAG,cAAc,GAAG,WAAW;AAEzE,MAAI,cAAc,cAAc,UAAa,YAAY,cAAc,QAAW;AAChF,WAAO,YAAY,GAAG,cAAc,WAAW,YAAY,SAAS;AAAA,EACtE;AACA,MAAI,cAAc,UAAU,UAAa,YAAY,UAAU,QAAW;AACxE,WAAO,QAAQ,EAAE,GAAG,cAAc,OAAO,GAAG,YAAY,MAAM;AAAA,EAChE;AAEA,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,gBAAgB,CAAC,CAAC,GAAG;AAC7D,UAAM,SAAS,aAAa,GAAG;AAC/B,QAAI,IAAI,WAAW,IAAI,KAAK,OAAO,UAAU,cAAc,OAAO,WAAW,YAAY;AACvF,aAAO,GAAG,IAAI,IAAI,SAAoB;AACpC,QAAC,MAA4C,GAAG,IAAI;AACpD,QAAC,OAA6C,GAAG,IAAI;AAAA,MACvD;AAAA,IACF;AAAA,EACF;AAEA,MAAI,cAAc,QAAQ,UAAa,YAAY,QAAQ,QAAW;AACpE,UAAM,OAAO,CAAC,aAAa,KAAK,WAAW,GAAG;AAC9C,WAAO,MAAM,CAAC,SAAkB;AAC9B,YAAM,WAAW,KAAK,IAAI,CAAC,QAAQ;AACjC,YAAI,OAAO,QAAQ,YAAY;AAC7B,gBAAM,UAAU,IAAI,IAAI;AACxB,iBAAO,OAAO,YAAY,aAAa,UAAU,MAAM,IAAI,IAAI;AAAA,QACjE;AACA,YAAI,QAAQ,KAAM,KAAI,UAAU;AAChC,eAAO,MAAM;AACX,cAAI,QAAQ,KAAM,KAAI,UAAU;AAAA,QAClC;AAAA,MACF,CAAC;AACD,aAAO,MAAM;AACX,mBAAW,WAAW,SAAS,QAAQ,EAAG,SAAQ;AAAA,MACpD;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;AAEO,SAAS,yBACd,OACA,WACQ;AACR,QAAM,EAAE,aAAa,GAAG,OAAO,IAAI,SAAS,CAAC;AAC7C,SAAO,uBAAuB,QAAkB,cAAc,SAAS,CAAC;AAC1E;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Choice.d.ts","sourceRoot":"","sources":["../../../src/elements/choice/Choice.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"Choice.d.ts","sourceRoot":"","sources":["../../../src/elements/choice/Choice.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEpE;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,YAAY,CAajE;yBAbe,WAAW;;;AAgB3B;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,YAAY,CA0D/D;yBA1De,UAAU;;;AA6D1B,eAAO,MAAM,MAAM;;;CAGlB,CAAC"}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { choiceGroupName, choiceIds } from "./ids.js";
|
|
3
|
-
function omitOwnedProps(props, keys) {
|
|
4
|
-
const result = { ...props };
|
|
5
|
-
for (const key of keys) delete result[key];
|
|
6
|
-
return result;
|
|
7
|
-
}
|
|
8
3
|
function ChoiceGroup(props) {
|
|
9
4
|
const {
|
|
10
5
|
children,
|
|
@@ -13,8 +8,7 @@ function ChoiceGroup(props) {
|
|
|
13
8
|
orientation = "horizontal",
|
|
14
9
|
...consumerProps
|
|
15
10
|
} = props;
|
|
16
|
-
|
|
17
|
-
return /* @__PURE__ */ jsx("div", { ...nativeProps, "data-orientation": orientation, "data-uiify-choice": "", children });
|
|
11
|
+
return /* @__PURE__ */ jsx("div", { "data-orientation": orientation, "data-uiify-choice": "", ...consumerProps, children });
|
|
18
12
|
}
|
|
19
13
|
ChoiceGroup.displayName = "ChoiceGroup";
|
|
20
14
|
function ChoiceItem(props) {
|
|
@@ -35,45 +29,13 @@ function ChoiceItem(props) {
|
|
|
35
29
|
...consumerProps
|
|
36
30
|
} = props;
|
|
37
31
|
const isControlled = checked !== void 0;
|
|
38
|
-
const wrapperProps = omitOwnedProps(consumerProps, [
|
|
39
|
-
"children",
|
|
40
|
-
"dangerouslySetInnerHTML",
|
|
41
|
-
"data-part",
|
|
42
|
-
"data-uiify-choice"
|
|
43
|
-
]);
|
|
44
|
-
const inputProps = omitOwnedProps(slotProps?.input, [
|
|
45
|
-
"children",
|
|
46
|
-
"dangerouslySetInnerHTML",
|
|
47
|
-
"aria-labelledby",
|
|
48
|
-
"checked",
|
|
49
|
-
"defaultChecked",
|
|
50
|
-
"disabled",
|
|
51
|
-
"id",
|
|
52
|
-
"name",
|
|
53
|
-
"type",
|
|
54
|
-
"value"
|
|
55
|
-
]);
|
|
56
|
-
const labelProps = omitOwnedProps(slotProps?.label, [
|
|
57
|
-
"children",
|
|
58
|
-
"dangerouslySetInnerHTML",
|
|
59
|
-
"htmlFor",
|
|
60
|
-
"id",
|
|
61
|
-
"data-part"
|
|
62
|
-
]);
|
|
63
|
-
const panelProps = omitOwnedProps(slotProps?.panel, [
|
|
64
|
-
"children",
|
|
65
|
-
"dangerouslySetInnerHTML",
|
|
66
|
-
"id",
|
|
67
|
-
"data-part"
|
|
68
|
-
]);
|
|
69
32
|
const { controlId, labelId, panelId } = choiceIds(groupId, value);
|
|
70
33
|
const groupName = name ?? choiceGroupName(groupId, kind);
|
|
71
34
|
const inputType = kind === "single" ? "radio" : "checkbox";
|
|
72
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
35
|
+
return /* @__PURE__ */ jsxs("div", { "data-part": part, "data-uiify-choice": "", ...consumerProps, children: [
|
|
73
36
|
/* @__PURE__ */ jsx(
|
|
74
37
|
"input",
|
|
75
38
|
{
|
|
76
|
-
...inputProps,
|
|
77
39
|
"aria-labelledby": labelId,
|
|
78
40
|
...isControlled ? { checked } : { defaultChecked },
|
|
79
41
|
disabled,
|
|
@@ -81,6 +43,7 @@ function ChoiceItem(props) {
|
|
|
81
43
|
name: groupName,
|
|
82
44
|
type: inputType,
|
|
83
45
|
value,
|
|
46
|
+
...slotProps?.input,
|
|
84
47
|
...onValueChange ? {
|
|
85
48
|
onChange: (event) => {
|
|
86
49
|
slotProps?.input?.onChange?.(event);
|
|
@@ -92,14 +55,14 @@ function ChoiceItem(props) {
|
|
|
92
55
|
/* @__PURE__ */ jsx(
|
|
93
56
|
"label",
|
|
94
57
|
{
|
|
95
|
-
...labelProps,
|
|
96
58
|
htmlFor: controlId,
|
|
97
59
|
id: labelId,
|
|
98
60
|
...labelPart ? { "data-part": labelPart === true ? "label" : labelPart } : {},
|
|
61
|
+
...slotProps?.label,
|
|
99
62
|
children: label
|
|
100
63
|
}
|
|
101
64
|
),
|
|
102
|
-
panel === void 0 ? null : /* @__PURE__ */ jsx("div", {
|
|
65
|
+
panel === void 0 ? null : /* @__PURE__ */ jsx("div", { "data-part": "panel", id: panelId, ...slotProps?.panel, children: panel })
|
|
103
66
|
] });
|
|
104
67
|
}
|
|
105
68
|
ChoiceItem.displayName = "ChoiceItem";
|
|
@@ -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\
|
|
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 data-orientation={orientation} data-uiify-choice=\"\" {...consumerProps}>\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 kind,\n label,\n labelPart = false,\n name,\n onValueChange,\n panel,\n slotProps,\n part = \"item\",\n value,\n ...consumerProps\n } = props;\n\n const isControlled = checked !== undefined;\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 data-part={part} data-uiify-choice=\"\" {...consumerProps}>\n <input\n aria-labelledby={labelId}\n {...(isControlled ? { checked } : { defaultChecked })}\n disabled={disabled}\n id={controlId}\n name={groupName}\n type={inputType}\n value={value}\n {...slotProps?.input}\n {...(onValueChange\n ? {\n onChange: (event) => {\n slotProps?.input?.onChange?.(event);\n if (!event.defaultPrevented) onValueChange(event.currentTarget.value);\n },\n }\n : {})}\n />\n <label\n htmlFor={controlId}\n id={labelId}\n {...(labelPart ? { \"data-part\": labelPart === true ? \"label\" : labelPart } : {})}\n {...slotProps?.label}\n >\n {label}\n </label>\n {panel === undefined ? null : (\n <div data-part=\"panel\" id={panelId} {...slotProps?.panel}>\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,cAqCA,YArCA;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,SAAI,oBAAkB,aAAa,qBAAkB,IAAI,GAAG,eAC1D,UACH;AAEJ;AACA,YAAY,cAAc;AAQnB,SAAS,WAAW,OAAsC;AAC/D,QAAM;AAAA,IAC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ceGroupOwnProps {
|
|
|
25
25
|
readonly name?: string;
|
|
26
26
|
}
|
|
27
27
|
export type ChoiceGroupProps = ChoiceGroupOwnProps & Omit<ComponentPropsWithRef<"div">, keyof ChoiceGroupOwnProps | "dangerouslySetInnerHTML">;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
};
|
|
33
|
-
export type ChoiceLabelSlotProps = Omit<ComponentPropsWithRef<"label">, "children" | "dangerouslySetInnerHTML" | "htmlFor" | "id" | "data-part"> & ConsumerDataAttributes & {
|
|
34
|
-
readonly "data-part"?: never;
|
|
35
|
-
};
|
|
36
|
-
export type ChoicePanelSlotProps = Omit<ComponentPropsWithRef<"div">, "children" | "dangerouslySetInnerHTML" | "id" | "data-part"> & ConsumerDataAttributes & {
|
|
37
|
-
readonly "data-part"?: never;
|
|
38
|
-
};
|
|
28
|
+
/** Native props of the generated input; consumer values replace the defaults. */
|
|
29
|
+
export type ChoiceInputSlotProps = Omit<ComponentPropsWithRef<"input">, "children" | "dangerouslySetInnerHTML"> & ConsumerDataAttributes;
|
|
30
|
+
export type ChoiceLabelSlotProps = Omit<ComponentPropsWithRef<"label">, "children" | "dangerouslySetInnerHTML"> & ConsumerDataAttributes;
|
|
31
|
+
export type ChoicePanelSlotProps = Omit<ComponentPropsWithRef<"div">, "children" | "dangerouslySetInnerHTML"> & ConsumerDataAttributes;
|
|
39
32
|
export interface ChoiceItemSlotProps {
|
|
40
33
|
readonly input?: ChoiceInputSlotProps;
|
|
41
34
|
readonly label?: ChoiceLabelSlotProps;
|
|
@@ -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,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,SAAS,EAAE,QAAQ,MAAM,EAAE,GAAG,MAAM,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MAAM,CAAC;IACvB,qDAAqD;IACrD,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC,kEAAkE;IAClE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,iDAAiD;IACjD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,iFAAiF;IACjF,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACtC,sEAAsE;IACtE,QAAQ,CAAC,SAAS,CAAC,EAAE,mBAAmB,CAAC;IACzC;;;;OAIG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAClD;AAED,MAAM,MAAM,eAAe,GAAG,kBAAkB,GAC9C,IAAI,CACF,qBAAqB,CAAC,KAAK,CAAC,EAC5B,MAAM,kBAAkB,GAAG,UAAU,GAAG,yBAAyB,CAClE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Details.d.ts","sourceRoot":"","sources":["../../../src/elements/details/Details.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAE7F;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"Details.d.ts","sourceRoot":"","sources":["../../../src/elements/details/Details.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAE7F;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,YAAY,CAYjE;yBAZe,WAAW;;;AAe3B;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,YAAY,CAWvE;yBAXe,cAAc;;;AAc9B;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,SAAS,WAAW,GAAG,KAAK,EAC5D,KAAK,EAAE,mBAAmB,CAAC,GAAG,CAAC,GAC9B,YAAY,GAAG,IAAI,CASrB;yBAXe,cAAc;;;AAc9B,eAAO,MAAM,OAAO;;;;CAInB,CAAC"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useRenderElement } from "@gunkin/uiify/core/render";
|
|
3
3
|
function DetailsRoot(props) {
|
|
4
|
-
const { children, defaultOpen, disabled,
|
|
4
|
+
const { children, defaultOpen, disabled, ...consumerProps } = props;
|
|
5
5
|
return /* @__PURE__ */ jsx(
|
|
6
6
|
"details",
|
|
7
7
|
{
|
|
8
|
-
...consumerProps,
|
|
9
8
|
"data-disabled": disabled ? "" : void 0,
|
|
10
9
|
"data-uiify-details": "",
|
|
11
|
-
...name === void 0 ? {} : { name },
|
|
12
10
|
...defaultOpen ? { open: true } : {},
|
|
11
|
+
...consumerProps,
|
|
13
12
|
children
|
|
14
13
|
}
|
|
15
14
|
);
|
|
@@ -20,9 +19,9 @@ function DetailsSummary(props) {
|
|
|
20
19
|
return /* @__PURE__ */ jsx(
|
|
21
20
|
"summary",
|
|
22
21
|
{
|
|
23
|
-
...consumerProps,
|
|
24
22
|
...part === void 0 ? {} : { "data-part": part },
|
|
25
23
|
...disabled ? { "aria-disabled": "true", tabIndex: -1 } : {},
|
|
24
|
+
...consumerProps,
|
|
26
25
|
children
|
|
27
26
|
}
|
|
28
27
|
);
|
|
@@ -33,7 +32,7 @@ function DetailsContent(props) {
|
|
|
33
32
|
return useRenderElement({
|
|
34
33
|
as,
|
|
35
34
|
defaultTag: "div",
|
|
36
|
-
props: { ...
|
|
35
|
+
props: { ...part === void 0 ? {} : { "data-part": part }, ...consumerProps },
|
|
37
36
|
render,
|
|
38
37
|
state: {}
|
|
39
38
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/elements/details/Details.tsx"],"sourcesContent":["import type { ElementType, ReactElement } from \"react\";\nimport { useRenderElement } from \"@gunkin/uiify/core/render\";\nimport type { DetailsContentProps, DetailsRootProps, DetailsSummaryProps } from \"./types.js\";\n\n/**\n * A native disclosure. `name` is what makes a group of these single-open with zero JS — the\n * browser enforces the exclusivity. Emits `data-uiify-details`, plus `data-disabled` when\n * `disabled`.\n */\nexport function DetailsRoot(props: DetailsRootProps): ReactElement {\n const { children, defaultOpen, disabled,
|
|
1
|
+
{"version":3,"sources":["../../../src/elements/details/Details.tsx"],"sourcesContent":["import type { ElementType, ReactElement } from \"react\";\nimport { useRenderElement } from \"@gunkin/uiify/core/render\";\nimport type { DetailsContentProps, DetailsRootProps, DetailsSummaryProps } from \"./types.js\";\n\n/**\n * A native disclosure. `name` is what makes a group of these single-open with zero JS — the\n * browser enforces the exclusivity. Emits `data-uiify-details`, plus `data-disabled` when\n * `disabled`.\n */\nexport function DetailsRoot(props: DetailsRootProps): ReactElement {\n const { children, defaultOpen, disabled, ...consumerProps } = props;\n return (\n <details\n data-disabled={disabled ? \"\" : undefined}\n data-uiify-details=\"\"\n {...(defaultOpen ? { open: true } : {})}\n {...consumerProps}\n >\n {children}\n </details>\n );\n}\nDetailsRoot.displayName = \"DetailsRoot\";\n\n/**\n * The disclosure trigger. `part` sets `data-part` when given (omitted entirely otherwise —\n * not every consumer wants a part name on this element, see breadcrumb's ellipsis trigger).\n * When `disabled`, the trigger loses focusability and gets `aria-disabled` — the browser has\n * no native `disabled` state for `<summary>`.\n */\nexport function DetailsSummary(props: DetailsSummaryProps): ReactElement {\n const { children, disabled, part, ...consumerProps } = props;\n return (\n <summary\n {...(part === undefined ? {} : { \"data-part\": part })}\n {...(disabled ? { \"aria-disabled\": \"true\", tabIndex: -1 } : {})}\n {...consumerProps}\n >\n {children}\n </summary>\n );\n}\nDetailsSummary.displayName = \"DetailsSummary\";\n\n/**\n * The disclosure body. Polymorphic (`as`/`render`) since the content isn't always a `<div>` —\n * breadcrumb's ellipsis panel is an `<ol>`. `part` sets `data-part` when given, same rule as\n * `DetailsSummary`.\n */\nexport function DetailsContent<TAs extends ElementType = \"div\">(\n props: DetailsContentProps<TAs>,\n): ReactElement | null {\n const { as, render, part, ...consumerProps } = props as DetailsContentProps<\"div\">;\n return useRenderElement({\n as,\n defaultTag: \"div\",\n props: { ...(part === undefined ? {} : { \"data-part\": part }), ...consumerProps },\n render,\n state: {},\n });\n}\nDetailsContent.displayName = \"DetailsContent\";\n\nexport const Details = {\n Root: DetailsRoot,\n Summary: DetailsSummary,\n Content: DetailsContent,\n};\n"],"mappings":"AAYI;AAXJ,SAAS,wBAAwB;AAQ1B,SAAS,YAAY,OAAuC;AACjE,QAAM,EAAE,UAAU,aAAa,UAAU,GAAG,cAAc,IAAI;AAC9D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,iBAAe,WAAW,KAAK;AAAA,MAC/B,sBAAmB;AAAA,MAClB,GAAI,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;AAAA,MACpC,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;AACA,YAAY,cAAc;AAQnB,SAAS,eAAe,OAA0C;AACvE,QAAM,EAAE,UAAU,UAAU,MAAM,GAAG,cAAc,IAAI;AACvD,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAI,SAAS,SAAY,CAAC,IAAI,EAAE,aAAa,KAAK;AAAA,MAClD,GAAI,WAAW,EAAE,iBAAiB,QAAQ,UAAU,GAAG,IAAI,CAAC;AAAA,MAC5D,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;AACA,eAAe,cAAc;AAOtB,SAAS,eACd,OACqB;AACrB,QAAM,EAAE,IAAI,QAAQ,MAAM,GAAG,cAAc,IAAI;AAC/C,SAAO,iBAAiB;AAAA,IACtB;AAAA,IACA,YAAY;AAAA,IACZ,OAAO,EAAE,GAAI,SAAS,SAAY,CAAC,IAAI,EAAE,aAAa,KAAK,GAAI,GAAG,cAAc;AAAA,IAChF;AAAA,IACA,OAAO,CAAC;AAAA,EACV,CAAC;AACH;AACA,eAAe,cAAc;AAEtB,MAAM,UAAU;AAAA,EACrB,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AACX;","names":[]}
|
|
@@ -8,11 +8,11 @@ export interface DetailsRootOwnProps {
|
|
|
8
8
|
* Groups sibling `<details name>` into an exclusive, single-open set — the browser
|
|
9
9
|
* enforces it, no JS. Must be unique per group and stable across SSR.
|
|
10
10
|
*/
|
|
11
|
-
readonly name?: string;
|
|
11
|
+
readonly name?: string | undefined;
|
|
12
12
|
readonly disabled?: boolean;
|
|
13
13
|
}
|
|
14
|
-
/**
|
|
15
|
-
export type DetailsRootProps = DetailsRootOwnProps & Omit<ComponentPropsWithRef<"details">, keyof DetailsRootOwnProps
|
|
14
|
+
/** Native props may override the initial open state. */
|
|
15
|
+
export type DetailsRootProps = DetailsRootOwnProps & Omit<ComponentPropsWithRef<"details">, keyof DetailsRootOwnProps>;
|
|
16
16
|
export interface DetailsSummaryOwnProps {
|
|
17
17
|
readonly children?: ReactNode;
|
|
18
18
|
readonly disabled?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/elements/details/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;IAC9B,2DAA2D;IA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,CAAC,GAAG,SAAS,WAAW,GAAG,KAAK,IAAI,eAAe,CAChF,GAAG,EACH,sBAAsB,EACtB,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EACrB,WAAW,CACZ,CAAC"}
|
|
@@ -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;
|
|
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;AAC3F;;;;;;;;;;;;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;AACH;;GAEG;AACH,iBAAS,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,YAAY,CAO9D;AACD,eAAO,MAAM,aAAa;;CAExB,CAAC;AACH;;;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;AACH,eAAO,MAAM,MAAM;;;;;;;;;;CAIlB,CAAC"}
|
|
@@ -16,7 +16,7 @@ const DialogTrigger = /* @__PURE__ */ Object.assign(dialogTrigger, {
|
|
|
16
16
|
});
|
|
17
17
|
function dialogContent(props) {
|
|
18
18
|
const { children, ...dialogProps } = props;
|
|
19
|
-
return /* @__PURE__ */ jsx("dialog", {
|
|
19
|
+
return /* @__PURE__ */ jsx("dialog", { "data-part": "content", "data-uiify-dialog": "", ...dialogProps, children });
|
|
20
20
|
}
|
|
21
21
|
const DialogContent = /* @__PURE__ */ Object.assign(dialogContent, {
|
|
22
22
|
displayName: "DialogContent"
|
|
@@ -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
|
|
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 * 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 * 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 data-part=\"content\" data-uiify-dialog=\"\" {...dialogProps}>\n {children}\n </dialog>\n );\n}\nexport const DialogContent = /* @__PURE__ */ Object.assign(dialogContent, {\n displayName: \"DialogContent\",\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});\nexport const Dialog = {\n Trigger: DialogTrigger,\n Content: DialogContent,\n Close: DialogClose,\n};\n"],"mappings":"AAsCI;AArCJ,SAAS,2BAA2B;AAepC,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;AAID,SAAS,cAAc,OAAyC;AAC9D,QAAM,EAAE,UAAU,GAAG,YAAY,IAAI;AACrC,SACE,oBAAC,YAAO,aAAU,WAAU,qBAAkB,IAAI,GAAG,aAClD,UACH;AAEJ;AACO,MAAM,gBAAgC,uBAAO,OAAO,eAAe;AAAA,EACxE,aAAa;AACf,CAAC;AAKD,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;AACM,MAAM,SAAS;AAAA,EACpB,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACT;","names":[]}
|
|
@@ -2,11 +2,11 @@ import { createElement } from "react";
|
|
|
2
2
|
function Invoker(props) {
|
|
3
3
|
const { as, command, commandfor, ...consumerProps } = props;
|
|
4
4
|
return createElement(as ?? "button", {
|
|
5
|
+
type: "button",
|
|
6
|
+
"data-uiify-invoker": "",
|
|
5
7
|
...consumerProps,
|
|
6
8
|
command,
|
|
7
|
-
commandfor
|
|
8
|
-
"data-uiify-invoker": "",
|
|
9
|
-
type: "button"
|
|
9
|
+
commandfor
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
Invoker.displayName = "Invoker";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/elements/invoker/Invoker.tsx"],"sourcesContent":["import { createElement } from \"react\";\nimport type { ElementType, ReactElement } from \"react\";\nimport type { InvokerProps } from \"./types.js\";\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\n * in JSX, so they travel as a props object through `createElement` rather\n * than JSX. This is the one place that workaround is written — `Modal`,\n * `AlertModal` and every other `command`/`commandfor` consumer builds on this\n * element (or its `@gunkin/uiify/core/render` counterpart, `renderNativeInvoker`).\n */\nexport function Invoker<TAs extends ElementType = \"button\">(\n props: InvokerProps<TAs>,\n): ReactElement {\n const { as, command, commandfor, ...consumerProps } = props as InvokerProps<\"button\">;\n return createElement(as ?? \"button\", {\n
|
|
1
|
+
{"version":3,"sources":["../../../src/elements/invoker/Invoker.tsx"],"sourcesContent":["import { createElement } from \"react\";\nimport type { ElementType, ReactElement } from \"react\";\nimport type { InvokerProps } from \"./types.js\";\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\n * in JSX, so they travel as a props object through `createElement` rather\n * than JSX. This is the one place that workaround is written — `Modal`,\n * `AlertModal` and every other `command`/`commandfor` consumer builds on this\n * element (or its `@gunkin/uiify/core/render` counterpart, `renderNativeInvoker`).\n */\nexport function Invoker<TAs extends ElementType = \"button\">(\n props: InvokerProps<TAs>,\n): ReactElement {\n const { as, command, commandfor, ...consumerProps } = props as InvokerProps<\"button\">;\n return createElement(as ?? \"button\", {\n type: \"button\",\n \"data-uiify-invoker\": \"\",\n ...consumerProps,\n command,\n commandfor,\n });\n}\nInvoker.displayName = \"Invoker\";\n"],"mappings":"AAAA,SAAS,qBAAqB;AAavB,SAAS,QACd,OACc;AACd,QAAM,EAAE,IAAI,SAAS,YAAY,GAAG,cAAc,IAAI;AACtD,SAAO,cAAc,MAAM,UAAU;AAAA,IACnC,MAAM;AAAA,IACN,sBAAsB;AAAA,IACtB,GAAG;AAAA,IACH;AAAA,IACA;AAAA,EACF,CAAC;AACH;AACA,QAAQ,cAAc;","names":[]}
|
|
@@ -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;AAiCpB;;;;;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;AACH;;;;GAIG;AACH,iBAAS,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,YAAY,CAehE;AACD,eAAO,MAAM,cAAc;;CAEzB,CAAC;AACH;;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;AACH,eAAO,MAAM,OAAO;;;;;;;;;;CAInB,CAAC"}
|
|
@@ -2,12 +2,12 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { createElement } from "react";
|
|
3
3
|
function renderInvoker(as, marker, part, action, target, consumerProps) {
|
|
4
4
|
return createElement(as ?? "button", {
|
|
5
|
-
...consumerProps,
|
|
6
5
|
[marker]: "",
|
|
7
6
|
"data-part": part,
|
|
8
7
|
popoverTarget: target,
|
|
9
8
|
popoverTargetAction: action,
|
|
10
|
-
type: "button"
|
|
9
|
+
type: "button",
|
|
10
|
+
...consumerProps
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
13
|
function popoverTrigger(props) {
|
|
@@ -34,13 +34,13 @@ function popoverSurface(props) {
|
|
|
34
34
|
return /* @__PURE__ */ jsx(
|
|
35
35
|
"div",
|
|
36
36
|
{
|
|
37
|
-
...consumerProps,
|
|
38
37
|
"data-align": align,
|
|
39
38
|
"data-part": "surface",
|
|
40
39
|
"data-positioning": "native",
|
|
41
40
|
"data-side": side,
|
|
42
41
|
"data-uiify-popover": "",
|
|
43
42
|
popover: mode,
|
|
43
|
+
...consumerProps,
|
|
44
44
|
children
|
|
45
45
|
}
|
|
46
46
|
);
|