@soxa-ui/react 0.0.0-stage → 0.3.0-beta.1
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/LICENSE +21 -0
- package/README.md +253 -2
- package/dist/adapter/common/aria.d.ts +6 -0
- package/dist/adapter/common/aria.js +22 -0
- package/dist/adapter/common/icon.d.ts +9 -0
- package/dist/adapter/common/icon.js +22 -0
- package/dist/adapter/common/index.d.ts +6 -0
- package/dist/adapter/common/naming.d.ts +6 -0
- package/dist/adapter/common/naming.js +8 -0
- package/dist/adapter/common/profile.d.ts +3 -0
- package/dist/adapter/common/profile.js +8 -0
- package/dist/adapter/common/root.d.ts +67 -0
- package/dist/adapter/common/root.js +83 -0
- package/dist/adapter/common/slots.d.ts +15 -0
- package/dist/adapter/common/slots.js +23 -0
- package/dist/adapter/elevator/Elevate.d.ts +16 -0
- package/dist/adapter/elevator/Elevate.js +22 -0
- package/dist/adapter/elevator/elevator.class.d.ts +14 -0
- package/dist/adapter/elevator/elevator.class.js +23 -0
- package/dist/adapter/elevator/index.d.ts +3 -0
- package/dist/adapter/elevator/layer.d.ts +6 -0
- package/dist/adapter/elevator/layer.js +5 -0
- package/dist/adapter/elevator/scope.class.d.ts +19 -0
- package/dist/adapter/elevator/scope.class.js +31 -0
- package/dist/adapter/index.d.ts +5 -0
- package/dist/adapter/locale/LocaleProvider.d.ts +19 -0
- package/dist/adapter/locale/LocaleProvider.js +29 -0
- package/dist/adapter/locale/context.d.ts +3 -0
- package/dist/adapter/locale/context.js +7 -0
- package/dist/adapter/locale/index.d.ts +2 -0
- package/dist/adapter/runtime/NativeInput.d.ts +24 -0
- package/dist/adapter/runtime/NativeInput.js +40 -0
- package/dist/adapter/runtime/NativeTextarea.d.ts +10 -0
- package/dist/adapter/runtime/NativeTextarea.js +24 -0
- package/dist/adapter/runtime/Teleport.d.ts +14 -0
- package/dist/adapter/runtime/Teleport.js +82 -0
- package/dist/adapter/runtime/accepting.d.ts +10 -0
- package/dist/adapter/runtime/accepting.js +18 -0
- package/dist/adapter/runtime/click-action.class.d.ts +14 -0
- package/dist/adapter/runtime/click-action.class.js +26 -0
- package/dist/adapter/runtime/drafts.class.d.ts +24 -0
- package/dist/adapter/runtime/drafts.class.js +41 -0
- package/dist/adapter/runtime/event-callbacks.class.d.ts +29 -0
- package/dist/adapter/runtime/event-callbacks.class.js +44 -0
- package/dist/adapter/runtime/index.d.ts +16 -0
- package/dist/adapter/runtime/root-ref.class.d.ts +39 -0
- package/dist/adapter/runtime/root-ref.class.js +86 -0
- package/dist/adapter/runtime/stable-snapshot.class.d.ts +20 -0
- package/dist/adapter/runtime/stable-snapshot.class.js +43 -0
- package/dist/adapter/runtime/useAdapter.d.ts +39 -0
- package/dist/adapter/runtime/useAdapter.js +78 -0
- package/dist/adapter/runtime/useAdapterContext.d.ts +22 -0
- package/dist/adapter/runtime/useAdapterContext.js +128 -0
- package/dist/adapter/runtime/useClickAction.d.ts +6 -0
- package/dist/adapter/runtime/useClickAction.js +16 -0
- package/dist/adapter/runtime/useComponent.d.ts +15 -0
- package/dist/adapter/runtime/useComponent.js +13 -0
- package/dist/adapter/runtime/useRootElement.d.ts +6 -0
- package/dist/adapter/runtime/useRootElement.js +13 -0
- package/dist/adapter/runtime/withRenderBoundary.d.ts +7 -0
- package/dist/adapter/runtime/withRenderBoundary.js +13 -0
- package/dist/adapter/toasts/index.d.ts +3 -0
- package/dist/adapter/toasts/render.d.ts +6 -0
- package/dist/adapter/toasts/render.js +17 -0
- package/dist/adapter/toasts/types.d.ts +6 -0
- package/dist/adapter/toasts/useToasts.d.ts +8 -0
- package/dist/adapter/toasts/useToasts.js +19 -0
- package/dist/components/accordion/Accordion.d.ts +14 -0
- package/dist/components/accordion/Accordion.js +40 -0
- package/dist/components/accordion/base.component.d.ts +6 -0
- package/dist/components/accordion/index.d.ts +6 -0
- package/dist/components/accordion/index.js +7 -0
- package/dist/components/accordion/item/Item.d.ts +6 -0
- package/dist/components/accordion/item/Item.js +68 -0
- package/dist/components/accordion/item/base.component.d.ts +9 -0
- package/dist/components/accordion/item/index.d.ts +2 -0
- package/dist/components/accordion/item/setup.component.d.ts +17 -0
- package/dist/components/accordion/item/setup.component.js +23 -0
- package/dist/components/accordion/setup.component.d.ts +15 -0
- package/dist/components/accordion/setup.component.js +26 -0
- package/dist/components/button/Button.d.ts +15 -0
- package/dist/components/button/Button.js +38 -0
- package/dist/components/button/base.component.d.ts +7 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/setup.component.d.ts +22 -0
- package/dist/components/button/setup.component.js +12 -0
- package/dist/components/calendar/Calendar.d.ts +7 -0
- package/dist/components/calendar/Calendar.js +190 -0
- package/dist/components/calendar/base.component.d.ts +7 -0
- package/dist/components/calendar/index.d.ts +7 -0
- package/dist/components/calendar/index.js +8 -0
- package/dist/components/calendar/item/Item.d.ts +3 -0
- package/dist/components/calendar/item/Item.js +26 -0
- package/dist/components/calendar/item/base.component.d.ts +7 -0
- package/dist/components/calendar/item/index.d.ts +2 -0
- package/dist/components/calendar/item/setup.component.d.ts +13 -0
- package/dist/components/calendar/item/setup.component.js +20 -0
- package/dist/components/calendar/setup.component.d.ts +15 -0
- package/dist/components/calendar/setup.component.js +26 -0
- package/dist/components/check-box/CheckBox.d.ts +4 -0
- package/dist/components/check-box/CheckBox.js +49 -0
- package/dist/components/check-box/base.component.d.ts +7 -0
- package/dist/components/check-box/index.d.ts +2 -0
- package/dist/components/check-box/setup.component.d.ts +27 -0
- package/dist/components/check-box/setup.component.js +13 -0
- package/dist/components/component/base.component.d.ts +5 -0
- package/dist/components/component/index.d.ts +1 -0
- package/dist/components/component-view/ComponentView.d.ts +4 -0
- package/dist/components/component-view/ComponentView.js +22 -0
- package/dist/components/component-view/base.component.d.ts +5 -0
- package/dist/components/component-view/index.d.ts +2 -0
- package/dist/components/component-view/setup.component.d.ts +9 -0
- package/dist/components/component-view/setup.component.js +12 -0
- package/dist/components/control/base.component.d.ts +5 -0
- package/dist/components/control/index.d.ts +1 -0
- package/dist/components/control/setup.component.d.ts +22 -0
- package/dist/components/date-input/DateInput.d.ts +4 -0
- package/dist/components/date-input/DateInput.js +88 -0
- package/dist/components/date-input/base.component.d.ts +6 -0
- package/dist/components/date-input/index.d.ts +2 -0
- package/dist/components/date-input/setup.component.d.ts +27 -0
- package/dist/components/date-input/setup.component.js +13 -0
- package/dist/components/date-picker/DatePicker.d.ts +9 -0
- package/dist/components/date-picker/DatePicker.js +148 -0
- package/dist/components/date-picker/base.component.d.ts +6 -0
- package/dist/components/date-picker/index.d.ts +2 -0
- package/dist/components/date-picker/setup.component.d.ts +60 -0
- package/dist/components/date-picker/setup.component.js +26 -0
- package/dist/components/dialog/Dialog.d.ts +7 -0
- package/dist/components/dialog/Dialog.js +88 -0
- package/dist/components/dialog/base.component.d.ts +6 -0
- package/dist/components/dialog/index.d.ts +2 -0
- package/dist/components/dialog/setup.component.d.ts +29 -0
- package/dist/components/dialog/setup.component.js +12 -0
- package/dist/components/drag-and-drop/DragAndDrop.d.ts +4 -0
- package/dist/components/drag-and-drop/DragAndDrop.js +16 -0
- package/dist/components/drag-and-drop/base.component.d.ts +6 -0
- package/dist/components/drag-and-drop/index.d.ts +2 -0
- package/dist/components/drag-and-drop/setup.component.d.ts +6 -0
- package/dist/components/drag-and-drop/setup.component.js +12 -0
- package/dist/components/drawer/Drawer.d.ts +7 -0
- package/dist/components/drawer/Drawer.js +75 -0
- package/dist/components/drawer/base.component.d.ts +6 -0
- package/dist/components/drawer/index.d.ts +2 -0
- package/dist/components/drawer/setup.component.d.ts +29 -0
- package/dist/components/drawer/setup.component.js +12 -0
- package/dist/components/field/Field.d.ts +4 -0
- package/dist/components/field/Field.js +58 -0
- package/dist/components/field/base.component.d.ts +5 -0
- package/dist/components/field/index.d.ts +2 -0
- package/dist/components/field/setup.component.d.ts +10 -0
- package/dist/components/field/setup.component.js +13 -0
- package/dist/components/frame/Frame.d.ts +7 -0
- package/dist/components/frame/Frame.js +30 -0
- package/dist/components/frame/base.component.d.ts +5 -0
- package/dist/components/frame/index.d.ts +2 -0
- package/dist/components/frame/setup.component.d.ts +33 -0
- package/dist/components/frame/setup.component.js +12 -0
- package/dist/components/icon/Icon.d.ts +7 -0
- package/dist/components/icon/Icon.js +17 -0
- package/dist/components/icon/base.component.d.ts +5 -0
- package/dist/components/icon/index.d.ts +2 -0
- package/dist/components/icon/setup.component.d.ts +19 -0
- package/dist/components/icon/setup.component.js +12 -0
- package/dist/components/index.d.ts +43 -0
- package/dist/components/input/Input.d.ts +4 -0
- package/dist/components/input/Input.js +65 -0
- package/dist/components/input/base.component.d.ts +7 -0
- package/dist/components/input/index.d.ts +2 -0
- package/dist/components/input/setup.component.d.ts +27 -0
- package/dist/components/input/setup.component.js +13 -0
- package/dist/components/input-control/base.component.d.ts +6 -0
- package/dist/components/input-control/index.d.ts +1 -0
- package/dist/components/input-control/setup.component.d.ts +26 -0
- package/dist/components/interactive/base.component.d.ts +5 -0
- package/dist/components/interactive/index.d.ts +1 -0
- package/dist/components/interactive/setup.component.d.ts +9 -0
- package/dist/components/item-row/ItemRow.d.ts +13 -0
- package/dist/components/item-row/ItemRow.js +19 -0
- package/dist/components/item-row/index.d.ts +2 -0
- package/dist/components/item-row/setup.component.d.ts +22 -0
- package/dist/components/item-row/setup.component.js +12 -0
- package/dist/components/label/Label.d.ts +7 -0
- package/dist/components/label/Label.js +31 -0
- package/dist/components/label/base.component.d.ts +5 -0
- package/dist/components/label/index.d.ts +2 -0
- package/dist/components/label/setup.component.d.ts +9 -0
- package/dist/components/label/setup.component.js +12 -0
- package/dist/components/list-box/ListBox.d.ts +8 -0
- package/dist/components/list-box/ListBox.js +67 -0
- package/dist/components/list-box/base.component.d.ts +9 -0
- package/dist/components/list-box/group/Group.d.ts +7 -0
- package/dist/components/list-box/group/Group.js +34 -0
- package/dist/components/list-box/group/base.component.d.ts +6 -0
- package/dist/components/list-box/group/index.d.ts +2 -0
- package/dist/components/list-box/group/setup.component.d.ts +9 -0
- package/dist/components/list-box/group/setup.component.js +12 -0
- package/dist/components/list-box/index.d.ts +9 -0
- package/dist/components/list-box/index.js +11 -0
- package/dist/components/list-box/item/Item.d.ts +6 -0
- package/dist/components/list-box/item/Item.js +57 -0
- package/dist/components/list-box/item/base.component.d.ts +8 -0
- package/dist/components/list-box/item/index.d.ts +2 -0
- package/dist/components/list-box/item/setup.component.d.ts +19 -0
- package/dist/components/list-box/item/setup.component.js +23 -0
- package/dist/components/list-box/setup.component.d.ts +15 -0
- package/dist/components/list-box/setup.component.js +26 -0
- package/dist/components/menu/Menu.d.ts +7 -0
- package/dist/components/menu/Menu.js +47 -0
- package/dist/components/menu/base.component.d.ts +6 -0
- package/dist/components/menu/checkbox-item/CheckboxItem.d.ts +6 -0
- package/dist/components/menu/checkbox-item/CheckboxItem.js +61 -0
- package/dist/components/menu/checkbox-item/base.component.d.ts +8 -0
- package/dist/components/menu/checkbox-item/index.d.ts +2 -0
- package/dist/components/menu/checkbox-item/setup.component.d.ts +17 -0
- package/dist/components/menu/checkbox-item/setup.component.js +23 -0
- package/dist/components/menu/group/Group.d.ts +4 -0
- package/dist/components/menu/group/Group.js +31 -0
- package/dist/components/menu/group/base.component.d.ts +6 -0
- package/dist/components/menu/group/index.d.ts +2 -0
- package/dist/components/menu/group/setup.component.d.ts +9 -0
- package/dist/components/menu/group/setup.component.js +12 -0
- package/dist/components/menu/index.d.ts +23 -0
- package/dist/components/menu/index.js +23 -0
- package/dist/components/menu/item/Item.d.ts +3 -0
- package/dist/components/menu/item/Item.js +42 -0
- package/dist/components/menu/item/base.component.d.ts +8 -0
- package/dist/components/menu/item/index.d.ts +2 -0
- package/dist/components/menu/item/setup.component.d.ts +17 -0
- package/dist/components/menu/item/setup.component.js +23 -0
- package/dist/components/menu/popover-item/PopoverItem.d.ts +6 -0
- package/dist/components/menu/popover-item/PopoverItem.js +72 -0
- package/dist/components/menu/popover-item/base.component.d.ts +8 -0
- package/dist/components/menu/popover-item/index.d.ts +2 -0
- package/dist/components/menu/popover-item/setup.component.d.ts +24 -0
- package/dist/components/menu/popover-item/setup.component.js +26 -0
- package/dist/components/menu/radio-group/RadioGroup.d.ts +4 -0
- package/dist/components/menu/radio-group/RadioGroup.js +31 -0
- package/dist/components/menu/radio-group/base.component.d.ts +5 -0
- package/dist/components/menu/radio-group/index.d.ts +2 -0
- package/dist/components/menu/radio-group/setup.component.d.ts +9 -0
- package/dist/components/menu/radio-group/setup.component.js +12 -0
- package/dist/components/menu/radio-item/RadioItem.d.ts +3 -0
- package/dist/components/menu/radio-item/RadioItem.js +50 -0
- package/dist/components/menu/radio-item/base.component.d.ts +9 -0
- package/dist/components/menu/radio-item/index.d.ts +2 -0
- package/dist/components/menu/radio-item/setup.component.d.ts +17 -0
- package/dist/components/menu/radio-item/setup.component.js +23 -0
- package/dist/components/menu/separator/Separator.d.ts +4 -0
- package/dist/components/menu/separator/Separator.js +18 -0
- package/dist/components/menu/separator/base.component.d.ts +5 -0
- package/dist/components/menu/separator/index.d.ts +2 -0
- package/dist/components/menu/separator/setup.component.d.ts +9 -0
- package/dist/components/menu/separator/setup.component.js +12 -0
- package/dist/components/menu/setup.component.d.ts +16 -0
- package/dist/components/menu/setup.component.js +29 -0
- package/dist/components/menu/submenu/Submenu.d.ts +22 -0
- package/dist/components/menu/submenu/Submenu.js +117 -0
- package/dist/components/menu/submenu/base.component.d.ts +9 -0
- package/dist/components/menu/submenu/index.d.ts +2 -0
- package/dist/components/menu/submenu/setup.component.d.ts +25 -0
- package/dist/components/menu/submenu/setup.component.js +37 -0
- package/dist/components/number-input/NumberInput.d.ts +4 -0
- package/dist/components/number-input/NumberInput.js +108 -0
- package/dist/components/number-input/base.component.d.ts +7 -0
- package/dist/components/number-input/index.d.ts +2 -0
- package/dist/components/number-input/setup.component.d.ts +27 -0
- package/dist/components/number-input/setup.component.js +13 -0
- package/dist/components/pagination/Pagination.d.ts +7 -0
- package/dist/components/pagination/Pagination.js +80 -0
- package/dist/components/pagination/base.component.d.ts +6 -0
- package/dist/components/pagination/index.d.ts +2 -0
- package/dist/components/pagination/item/Item.d.ts +3 -0
- package/dist/components/pagination/item/Item.js +34 -0
- package/dist/components/pagination/item/base.component.d.ts +5 -0
- package/dist/components/pagination/item/index.d.ts +2 -0
- package/dist/components/pagination/item/setup.component.d.ts +11 -0
- package/dist/components/pagination/item/setup.component.js +23 -0
- package/dist/components/pagination/setup.component.d.ts +15 -0
- package/dist/components/pagination/setup.component.js +26 -0
- package/dist/components/popover/Popover.d.ts +7 -0
- package/dist/components/popover/Popover.js +68 -0
- package/dist/components/popover/base.component.d.ts +6 -0
- package/dist/components/popover/index.d.ts +2 -0
- package/dist/components/popover/setup.component.d.ts +34 -0
- package/dist/components/popover/setup.component.js +17 -0
- package/dist/components/progress-linear/ProgressLinear.d.ts +7 -0
- package/dist/components/progress-linear/ProgressLinear.js +24 -0
- package/dist/components/progress-linear/base.component.d.ts +5 -0
- package/dist/components/progress-linear/index.d.ts +2 -0
- package/dist/components/progress-linear/setup.component.d.ts +17 -0
- package/dist/components/progress-linear/setup.component.js +12 -0
- package/dist/components/progress-spinner/ProgressSpinner.d.ts +7 -0
- package/dist/components/progress-spinner/ProgressSpinner.js +50 -0
- package/dist/components/progress-spinner/base.component.d.ts +5 -0
- package/dist/components/progress-spinner/index.d.ts +2 -0
- package/dist/components/progress-spinner/setup.component.d.ts +17 -0
- package/dist/components/progress-spinner/setup.component.js +12 -0
- package/dist/components/radio-group/RadioGroup.d.ts +4 -0
- package/dist/components/radio-group/RadioGroup.js +30 -0
- package/dist/components/radio-group/base.component.d.ts +7 -0
- package/dist/components/radio-group/index.d.ts +7 -0
- package/dist/components/radio-group/index.js +8 -0
- package/dist/components/radio-group/item/Item.d.ts +3 -0
- package/dist/components/radio-group/item/Item.js +46 -0
- package/dist/components/radio-group/item/base.component.d.ts +9 -0
- package/dist/components/radio-group/item/index.d.ts +2 -0
- package/dist/components/radio-group/item/setup.component.d.ts +42 -0
- package/dist/components/radio-group/item/setup.component.js +30 -0
- package/dist/components/radio-group/setup.component.d.ts +16 -0
- package/dist/components/radio-group/setup.component.js +27 -0
- package/dist/components/rating/Rating.d.ts +4 -0
- package/dist/components/rating/Rating.js +55 -0
- package/dist/components/rating/base.component.d.ts +6 -0
- package/dist/components/rating/index.d.ts +2 -0
- package/dist/components/rating/setup.component.d.ts +27 -0
- package/dist/components/rating/setup.component.js +13 -0
- package/dist/components/scroller/Scroller.d.ts +7 -0
- package/dist/components/scroller/Scroller.js +64 -0
- package/dist/components/scroller/base.component.d.ts +6 -0
- package/dist/components/scroller/index.d.ts +2 -0
- package/dist/components/scroller/setup.component.d.ts +22 -0
- package/dist/components/scroller/setup.component.js +12 -0
- package/dist/components/select/Select.d.ts +7 -0
- package/dist/components/select/Select.js +116 -0
- package/dist/components/select/base.component.d.ts +8 -0
- package/dist/components/select/group/Group.d.ts +7 -0
- package/dist/components/select/group/Group.js +34 -0
- package/dist/components/select/group/base.component.d.ts +6 -0
- package/dist/components/select/group/index.d.ts +2 -0
- package/dist/components/select/group/setup.component.d.ts +9 -0
- package/dist/components/select/group/setup.component.js +12 -0
- package/dist/components/select/index.d.ts +9 -0
- package/dist/components/select/index.js +11 -0
- package/dist/components/select/item/Item.d.ts +6 -0
- package/dist/components/select/item/Item.js +58 -0
- package/dist/components/select/item/base.component.d.ts +8 -0
- package/dist/components/select/item/index.d.ts +2 -0
- package/dist/components/select/item/setup.component.d.ts +19 -0
- package/dist/components/select/item/setup.component.js +23 -0
- package/dist/components/select/setup.component.d.ts +27 -0
- package/dist/components/select/setup.component.js +30 -0
- package/dist/components/skeleton/Skeleton.d.ts +4 -0
- package/dist/components/skeleton/Skeleton.js +23 -0
- package/dist/components/skeleton/base.component.d.ts +5 -0
- package/dist/components/skeleton/index.d.ts +2 -0
- package/dist/components/skeleton/setup.component.d.ts +11 -0
- package/dist/components/skeleton/setup.component.js +12 -0
- package/dist/components/slider/Slider.d.ts +4 -0
- package/dist/components/slider/Slider.js +72 -0
- package/dist/components/slider/base.component.d.ts +6 -0
- package/dist/components/slider/index.d.ts +2 -0
- package/dist/components/slider/setup.component.d.ts +23 -0
- package/dist/components/slider/setup.component.js +13 -0
- package/dist/components/stylable/base.component.d.ts +5 -0
- package/dist/components/stylable/index.d.ts +1 -0
- package/dist/components/stylable/setup.component.d.ts +9 -0
- package/dist/components/switch/Switch.d.ts +4 -0
- package/dist/components/switch/Switch.js +42 -0
- package/dist/components/switch/base.component.d.ts +7 -0
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/switch/setup.component.d.ts +27 -0
- package/dist/components/switch/setup.component.js +13 -0
- package/dist/components/table/Table.d.ts +9 -0
- package/dist/components/table/Table.js +83 -0
- package/dist/components/table/base.component.d.ts +7 -0
- package/dist/components/table/column/Column.d.ts +7 -0
- package/dist/components/table/column/Column.js +66 -0
- package/dist/components/table/column/base.component.d.ts +6 -0
- package/dist/components/table/column/index.d.ts +2 -0
- package/dist/components/table/column/setup.component.d.ts +19 -0
- package/dist/components/table/column/setup.component.js +16 -0
- package/dist/components/table/index.d.ts +9 -0
- package/dist/components/table/index.js +11 -0
- package/dist/components/table/row/Cells.d.ts +14 -0
- package/dist/components/table/row/Cells.js +29 -0
- package/dist/components/table/row/Row.d.ts +6 -0
- package/dist/components/table/row/Row.js +43 -0
- package/dist/components/table/row/base.component.d.ts +7 -0
- package/dist/components/table/row/index.d.ts +2 -0
- package/dist/components/table/row/setup.component.d.ts +11 -0
- package/dist/components/table/row/setup.component.js +23 -0
- package/dist/components/table/setup.component.d.ts +18 -0
- package/dist/components/table/setup.component.js +27 -0
- package/dist/components/tabs/Tabs.d.ts +9 -0
- package/dist/components/tabs/Tabs.js +53 -0
- package/dist/components/tabs/base.component.d.ts +9 -0
- package/dist/components/tabs/content/Content.d.ts +4 -0
- package/dist/components/tabs/content/Content.js +18 -0
- package/dist/components/tabs/content/base.component.d.ts +7 -0
- package/dist/components/tabs/content/index.d.ts +2 -0
- package/dist/components/tabs/content/setup.component.d.ts +17 -0
- package/dist/components/tabs/content/setup.component.js +20 -0
- package/dist/components/tabs/index.d.ts +9 -0
- package/dist/components/tabs/index.js +11 -0
- package/dist/components/tabs/item/Item.d.ts +6 -0
- package/dist/components/tabs/item/Item.js +64 -0
- package/dist/components/tabs/item/base.component.d.ts +9 -0
- package/dist/components/tabs/item/index.d.ts +2 -0
- package/dist/components/tabs/item/setup.component.d.ts +17 -0
- package/dist/components/tabs/item/setup.component.js +23 -0
- package/dist/components/tabs/setup.component.d.ts +15 -0
- package/dist/components/tabs/setup.component.js +26 -0
- package/dist/components/tags/Tags.d.ts +7 -0
- package/dist/components/tags/Tags.js +36 -0
- package/dist/components/tags/base.component.d.ts +6 -0
- package/dist/components/tags/index.d.ts +6 -0
- package/dist/components/tags/index.js +7 -0
- package/dist/components/tags/item/Item.d.ts +6 -0
- package/dist/components/tags/item/Item.js +63 -0
- package/dist/components/tags/item/base.component.d.ts +8 -0
- package/dist/components/tags/item/index.d.ts +2 -0
- package/dist/components/tags/item/setup.component.d.ts +15 -0
- package/dist/components/tags/item/setup.component.js +23 -0
- package/dist/components/tags/setup.component.d.ts +15 -0
- package/dist/components/tags/setup.component.js +26 -0
- package/dist/components/textable/base.component.d.ts +5 -0
- package/dist/components/textable/index.d.ts +1 -0
- package/dist/components/textable/setup.component.d.ts +22 -0
- package/dist/components/textarea/Textarea.d.ts +4 -0
- package/dist/components/textarea/Textarea.js +35 -0
- package/dist/components/textarea/base.component.d.ts +7 -0
- package/dist/components/textarea/index.d.ts +2 -0
- package/dist/components/textarea/setup.component.d.ts +29 -0
- package/dist/components/textarea/setup.component.js +13 -0
- package/dist/components/toasts/Toasts.d.ts +7 -0
- package/dist/components/toasts/Toasts.js +43 -0
- package/dist/components/toasts/base.component.d.ts +7 -0
- package/dist/components/toasts/index.d.ts +2 -0
- package/dist/components/toasts/item/Item.d.ts +3 -0
- package/dist/components/toasts/item/Item.js +88 -0
- package/dist/components/toasts/item/base.component.d.ts +6 -0
- package/dist/components/toasts/item/index.d.ts +2 -0
- package/dist/components/toasts/item/setup.component.d.ts +13 -0
- package/dist/components/toasts/item/setup.component.js +20 -0
- package/dist/components/toasts/setup.component.d.ts +13 -0
- package/dist/components/toasts/setup.component.js +26 -0
- package/dist/components/tooltip/Tooltip.d.ts +4 -0
- package/dist/components/tooltip/Tooltip.js +34 -0
- package/dist/components/tooltip/base.component.d.ts +6 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tooltip/setup.component.d.ts +26 -0
- package/dist/components/tooltip/setup.component.js +17 -0
- package/dist/components/value-control/base.component.d.ts +6 -0
- package/dist/components/value-control/index.d.ts +1 -0
- package/dist/components/value-control/setup.component.d.ts +22 -0
- package/dist/components/virtual/Virtual.d.ts +4 -0
- package/dist/components/virtual/Virtual.js +16 -0
- package/dist/components/virtual/base.component.d.ts +6 -0
- package/dist/components/virtual/index.d.ts +2 -0
- package/dist/components/virtual/setup.component.d.ts +6 -0
- package/dist/components/virtual/setup.component.js +12 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +60 -0
- package/dist/types.d.ts +25 -0
- package/package.json +60 -4
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { toAriaProps } from "../../../adapter/common/aria.js";
|
|
3
|
+
import { toControlAttrs, toRootForward, toRootProps } from "../../../adapter/common/root.js";
|
|
4
|
+
import { renderSlot } from "../../../adapter/common/slots.js";
|
|
5
|
+
import { roleIcon } from "../../../adapter/common/icon.js";
|
|
6
|
+
import { useClickAction } from "../../../adapter/runtime/useClickAction.js";
|
|
7
|
+
import { withRenderBoundary } from "../../../adapter/runtime/withRenderBoundary.js";
|
|
8
|
+
import { Icon } from "../../icon/Icon.js";
|
|
9
|
+
import { Frame } from "../../frame/Frame.js";
|
|
10
|
+
import { ItemRow } from "../../item-row/ItemRow.js";
|
|
11
|
+
import { useSetupMenuPopoverItem } from "./setup.component.js";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
//#region src/components/menu/popover-item/PopoverItem.tsx
|
|
14
|
+
/** Стрелка без слота — иконка из пакета по роли, компонент на роль один на модуль. */
|
|
15
|
+
var ArrowIcon = roleIcon("arrowRight");
|
|
16
|
+
/**
|
|
17
|
+
* MenuPopoverItem — пункт со своей панелью сбоку с любым содержимым. Текст строки — слот
|
|
18
|
+
* `header`: `default` — содержимое панели, как у `Accordion.Item` и `Popover`.
|
|
19
|
+
*/
|
|
20
|
+
var MenuPopoverItem = withRenderBoundary(function MenuPopoverItem(props) {
|
|
21
|
+
const { ref, forwardProps, state, context, rootElement } = useSetupMenuPopoverItem(props);
|
|
22
|
+
const expand = useClickAction(() => context?.adapters.menu.open());
|
|
23
|
+
const { rendered, tag, text, size, disabled, open, aria, dataset, attrs, panelAria, contentRendered, dismiss_ownerAttribute } = state;
|
|
24
|
+
if (!rendered) return null;
|
|
25
|
+
const Tag = tag;
|
|
26
|
+
const row = toControlAttrs(forwardProps);
|
|
27
|
+
return /* @__PURE__ */ jsxs(Tag, {
|
|
28
|
+
...toRootProps(ref, state, [dataset, attrs], toRootForward(forwardProps)),
|
|
29
|
+
children: [/* @__PURE__ */ jsx(ItemRow, {
|
|
30
|
+
embedded: "menu.row",
|
|
31
|
+
tag: "div",
|
|
32
|
+
size,
|
|
33
|
+
disabled,
|
|
34
|
+
...toAriaProps(aria),
|
|
35
|
+
...row,
|
|
36
|
+
ref: expand,
|
|
37
|
+
leading: /* @__PURE__ */ jsx("span", {
|
|
38
|
+
className: "so-menu-item__icon",
|
|
39
|
+
children: renderSlot(props.leading)
|
|
40
|
+
}),
|
|
41
|
+
trailing: /* @__PURE__ */ jsx("span", {
|
|
42
|
+
className: "so-menu-item__arrow",
|
|
43
|
+
"aria-hidden": "true",
|
|
44
|
+
children: renderSlot(props["arrow-icon"]) ?? /* @__PURE__ */ jsx(Icon, {
|
|
45
|
+
embedded: "menu.arrow",
|
|
46
|
+
tag: ArrowIcon,
|
|
47
|
+
size
|
|
48
|
+
})
|
|
49
|
+
}),
|
|
50
|
+
children: renderSlot(props.header, {
|
|
51
|
+
text: text ?? "",
|
|
52
|
+
open: open ?? false
|
|
53
|
+
}) ?? text
|
|
54
|
+
}), /* @__PURE__ */ jsx(Frame, {
|
|
55
|
+
embedded: "menu.popover-item-frame",
|
|
56
|
+
className: "so-menu-item__panel",
|
|
57
|
+
tabIndex: -1,
|
|
58
|
+
visible: state.visible && open,
|
|
59
|
+
strategy: "fixed",
|
|
60
|
+
anchor_anchor: rootElement,
|
|
61
|
+
anchor_placement: "end-start",
|
|
62
|
+
...toAriaProps(panelAria),
|
|
63
|
+
...toAriaProps(dismiss_ownerAttribute),
|
|
64
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
65
|
+
className: "so-menu-item__content",
|
|
66
|
+
children: contentRendered ? renderSlot(props.children) : null
|
|
67
|
+
})
|
|
68
|
+
})]
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
//#endregion
|
|
72
|
+
export { MenuPopoverItem };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
import type { IMenuPopoverItem } from '@soxa-ui/core';
|
|
3
|
+
import type { MenuCollectionItemDescriptor, MenuPopoverItemDescriptor } from '@soxa-ui/setup';
|
|
4
|
+
import type { EventProps, TDomAttributes, UseDomProps } from '../../../types';
|
|
5
|
+
export type MenuPopoverItemEventProps = EventProps<typeof MenuPopoverItemDescriptor> & EventProps<typeof MenuCollectionItemDescriptor>;
|
|
6
|
+
/** Атрибуты пункта с панелью: класс и стиль — корню, остальное — строке с `role="menuitem"`. */
|
|
7
|
+
export type MenuPopoverItemAttributes = TDomAttributes<typeof MenuPopoverItemDescriptor, HTMLAttributes<HTMLElement>, MenuPopoverItemEventProps>;
|
|
8
|
+
export type MenuPopoverItemProps = UseDomProps<typeof MenuPopoverItemDescriptor, IMenuPopoverItem, MenuPopoverItemEventProps>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { MenuPopoverItemProps } from './base.component';
|
|
2
|
+
export declare function useSetupMenuPopoverItem(props: MenuPopoverItemProps): {
|
|
3
|
+
context: import("@soxa-ui/core").TItemContext<import("@soxa-ui/core").IMenuItem<import("@soxa-ui/core").IMenuItemProps, any>, import("@soxa-ui/core").TMenuCollectionExtensions> | undefined;
|
|
4
|
+
rootElement: Element | null;
|
|
5
|
+
ref: (el: Element | null) => void;
|
|
6
|
+
plugins: import("@soxa-ui/plugins").IPluginBundle | null;
|
|
7
|
+
ctrl: object & import("@soxa-ui/core").IMenuPopoverItem;
|
|
8
|
+
root: import("../../../adapter").TRootSource;
|
|
9
|
+
forwardProps: Partial<MenuPopoverItemProps>;
|
|
10
|
+
bindRef: (el: Element | null) => void;
|
|
11
|
+
state: import("@soxa-ui/setup").TInstanceState<object & import("@soxa-ui/core").IMenuPopoverItem> & import("@soxa-ui/setup").TInstanceState<object & {} & {} & {} & {
|
|
12
|
+
aria_label?: string | undefined;
|
|
13
|
+
aria_labelledBy?: string | undefined;
|
|
14
|
+
aria_describedBy?: string | undefined;
|
|
15
|
+
} & {} & {} & {} & {
|
|
16
|
+
dismiss_enabled?: boolean | undefined;
|
|
17
|
+
} & {} & {} & {
|
|
18
|
+
id?: string | undefined;
|
|
19
|
+
}> & import("@soxa-ui/setup").TInstanceState<object & {} & {} & {} & {} & {} & {
|
|
20
|
+
readonly listItem_highlighted: boolean;
|
|
21
|
+
} & {} & {
|
|
22
|
+
readonly dismiss_ownerAttribute: Record<string, string>;
|
|
23
|
+
} & {} & {} & {}> & import("@soxa-ui/setup").TInstanceState<object & import("@soxa-ui/core").TMenuItemCollectionFacade> & object;
|
|
24
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useAdapter, useCollectionAdapter } from "../../../adapter/runtime/useAdapter.js";
|
|
3
|
+
import { useAdapterContext } from "../../../adapter/runtime/useAdapterContext.js";
|
|
4
|
+
import { useRootElement } from "../../../adapter/runtime/useRootElement.js";
|
|
5
|
+
import { MenuCollectionItemDescriptor, MenuPopoverItemDescriptor, TCollectionItemExtension } from "@soxa-ui/setup";
|
|
6
|
+
//#region src/components/menu/popover-item/setup.component.ts
|
|
7
|
+
function useSetupMenuPopoverItem(props) {
|
|
8
|
+
const { contexts: [adapter, item] } = useAdapterContext((create, elevator) => {
|
|
9
|
+
const adapter = create(MenuPopoverItemDescriptor(), {
|
|
10
|
+
ctrl: props.ctrl,
|
|
11
|
+
props
|
|
12
|
+
});
|
|
13
|
+
return [adapter, create(MenuCollectionItemDescriptor(), { props }, { bundle: adapter.bundle }).use(TCollectionItemExtension, {
|
|
14
|
+
adapter,
|
|
15
|
+
elevator
|
|
16
|
+
})];
|
|
17
|
+
});
|
|
18
|
+
const binding = useCollectionAdapter(useAdapter(adapter, props), item, props);
|
|
19
|
+
return {
|
|
20
|
+
...binding,
|
|
21
|
+
context: item.instance.context,
|
|
22
|
+
rootElement: useRootElement(binding.root)
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { useSetupMenuPopoverItem };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { MenuRadioGroupProps } from './base.component';
|
|
3
|
+
/** MenuRadioGroup — переключатели меню под общей подписью: роль `group`, не `radiogroup` (APG). */
|
|
4
|
+
export declare function MenuRadioGroup(props: MenuRadioGroupProps): ReactElement | null;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { toAriaProps } from "../../../adapter/common/aria.js";
|
|
3
|
+
import { toRootProps } from "../../../adapter/common/root.js";
|
|
4
|
+
import { renderSlot } from "../../../adapter/common/slots.js";
|
|
5
|
+
import { Elevate } from "../../../adapter/elevator/Elevate.js";
|
|
6
|
+
import { useSetupMenuRadioGroup } from "./setup.component.js";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/menu/radio-group/RadioGroup.tsx
|
|
9
|
+
/** MenuRadioGroup — переключатели меню под общей подписью: роль `group`, не `radiogroup` (APG). */
|
|
10
|
+
function MenuRadioGroup(props) {
|
|
11
|
+
const { ref, forwardProps, state, layer } = useSetupMenuRadioGroup(props);
|
|
12
|
+
const { rendered, tag, label, labelAria, attrs, aria, dataset } = state;
|
|
13
|
+
if (!rendered) return null;
|
|
14
|
+
return /* @__PURE__ */ jsxs(tag, {
|
|
15
|
+
...toRootProps(ref, state, [
|
|
16
|
+
attrs,
|
|
17
|
+
aria,
|
|
18
|
+
dataset
|
|
19
|
+
], forwardProps),
|
|
20
|
+
children: [label ? /* @__PURE__ */ jsx("div", {
|
|
21
|
+
className: "so-menu-group__label",
|
|
22
|
+
...toAriaProps(labelAria),
|
|
23
|
+
children: label
|
|
24
|
+
}) : null, /* @__PURE__ */ jsx(Elevate, {
|
|
25
|
+
layer,
|
|
26
|
+
children: renderSlot(props.children)
|
|
27
|
+
})]
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { MenuRadioGroup };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IMenuRadioGroup } from '@soxa-ui/core';
|
|
2
|
+
import type { MenuRadioGroupDescriptor } from '@soxa-ui/setup';
|
|
3
|
+
import type { EventProps, UseDomProps } from '../../../types';
|
|
4
|
+
export type MenuRadioGroupEventProps = EventProps<typeof MenuRadioGroupDescriptor>;
|
|
5
|
+
export type MenuRadioGroupProps = UseDomProps<typeof MenuRadioGroupDescriptor, IMenuRadioGroup, MenuRadioGroupEventProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { MenuRadioGroupProps } from './base.component';
|
|
2
|
+
export declare function useSetupMenuRadioGroup(props: MenuRadioGroupProps): import("../../../adapter").TComponentBinding<import("@soxa-ui/setup").TContextContract<import("@soxa-ui/core").IMenuRadioGroup, {
|
|
3
|
+
props: object & {} & {} & {};
|
|
4
|
+
events: object & {
|
|
5
|
+
"element:removed": () => void;
|
|
6
|
+
"element:ready": (element: Element) => void;
|
|
7
|
+
} & {} & {};
|
|
8
|
+
outputs: object & {} & {} & {};
|
|
9
|
+
}>, MenuRadioGroupProps>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useComponent } from "../../../adapter/runtime/useComponent.js";
|
|
3
|
+
import { MenuRadioGroupDescriptor, TItemGroupExtension, TMenuRadioGroupExtension } from "@soxa-ui/setup";
|
|
4
|
+
//#region src/components/menu/radio-group/setup.component.ts
|
|
5
|
+
function useSetupMenuRadioGroup(props) {
|
|
6
|
+
return useComponent((create, elevator) => create(MenuRadioGroupDescriptor(), {
|
|
7
|
+
ctrl: props.ctrl,
|
|
8
|
+
props
|
|
9
|
+
}).use(TItemGroupExtension, { elevator }).use(TMenuRadioGroupExtension, { elevator }), props);
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { useSetupMenuRadioGroup };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { toAriaProps } from "../../../adapter/common/aria.js";
|
|
3
|
+
import { toControlAttrs, toRootForward, toRootProps } from "../../../adapter/common/root.js";
|
|
4
|
+
import { renderSlot } from "../../../adapter/common/slots.js";
|
|
5
|
+
import { useClickAction } from "../../../adapter/runtime/useClickAction.js";
|
|
6
|
+
import { withRenderBoundary } from "../../../adapter/runtime/withRenderBoundary.js";
|
|
7
|
+
import { ItemRow } from "../../item-row/ItemRow.js";
|
|
8
|
+
import { useSetupMenuRadioItem } from "./setup.component.js";
|
|
9
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
//#region src/components/menu/radio-item/RadioItem.tsx
|
|
11
|
+
/** MenuRadioItem — переключатель меню: строка пункта с точкой-отметкой в начале, как у флажка. */
|
|
12
|
+
var MenuRadioItem = withRenderBoundary(function MenuRadioItem(props) {
|
|
13
|
+
const { ref, forwardProps, state, context } = useSetupMenuRadioItem(props);
|
|
14
|
+
const check = useClickAction(() => context?.adapters.menu.check());
|
|
15
|
+
const { rendered, tag, text, size, disabled, selected, aria, dataset, attrs } = state;
|
|
16
|
+
if (!rendered) return null;
|
|
17
|
+
const Tag = tag;
|
|
18
|
+
const checked = selected ?? false;
|
|
19
|
+
const row = toControlAttrs(forwardProps);
|
|
20
|
+
return /* @__PURE__ */ jsx(Tag, {
|
|
21
|
+
...toRootProps(ref, state, [dataset, attrs], toRootForward(forwardProps)),
|
|
22
|
+
children: /* @__PURE__ */ jsx(ItemRow, {
|
|
23
|
+
embedded: "menu.row",
|
|
24
|
+
tag: "div",
|
|
25
|
+
size,
|
|
26
|
+
disabled,
|
|
27
|
+
...toAriaProps(aria),
|
|
28
|
+
...row,
|
|
29
|
+
ref: check,
|
|
30
|
+
leading: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
31
|
+
className: "so-menu-item__indicator",
|
|
32
|
+
"aria-hidden": "true",
|
|
33
|
+
children: renderSlot(props["indicator-icon"], { selected: checked }) ?? (checked ? /* @__PURE__ */ jsx("span", { className: "so-menu-item__dot" }) : null)
|
|
34
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
35
|
+
className: "so-menu-item__icon",
|
|
36
|
+
children: renderSlot(props.leading)
|
|
37
|
+
})] }),
|
|
38
|
+
trailing: /* @__PURE__ */ jsx("span", {
|
|
39
|
+
className: "so-menu-item__shortcut",
|
|
40
|
+
children: renderSlot(props.trailing)
|
|
41
|
+
}),
|
|
42
|
+
children: renderSlot(props.children, {
|
|
43
|
+
text: text ?? "",
|
|
44
|
+
selected: checked
|
|
45
|
+
}) ?? text
|
|
46
|
+
})
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
//#endregion
|
|
50
|
+
export { MenuRadioItem };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
import type { IMenuRadioItem } from '@soxa-ui/core';
|
|
3
|
+
import type { MenuCollectionRadioItemDescriptor, MenuRadioItemDescriptor } from '@soxa-ui/setup';
|
|
4
|
+
import type { EventProps, TDomAttributes, UseDomProps } from '../../../types';
|
|
5
|
+
export type MenuRadioItemEventProps = EventProps<typeof MenuRadioItemDescriptor> & EventProps<typeof MenuCollectionRadioItemDescriptor>;
|
|
6
|
+
/** Атрибуты переключателя: класс и стиль — корню, остальное — строке с `role="menuitemradio"`. */
|
|
7
|
+
export type MenuRadioItemAttributes = TDomAttributes<typeof MenuRadioItemDescriptor, HTMLAttributes<HTMLElement>, MenuRadioItemEventProps>;
|
|
8
|
+
/** Пропсы переключателя; группу пишет проводка — ближайшая `Menu.RadioGroup` над пунктом. */
|
|
9
|
+
export type MenuRadioItemProps = UseDomProps<typeof MenuRadioItemDescriptor, IMenuRadioItem, MenuRadioItemEventProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { MenuRadioItemProps } from './base.component';
|
|
2
|
+
export declare function useSetupMenuRadioItem(props: MenuRadioItemProps): {
|
|
3
|
+
context: import("@soxa-ui/core").TItemContext<import("@soxa-ui/core").IMenuItem<import("@soxa-ui/core").IMenuItemProps, any>, import("@soxa-ui/core").TMenuCollectionExtensions> | undefined;
|
|
4
|
+
ref: (el: Element | null) => void;
|
|
5
|
+
plugins: import("@soxa-ui/plugins").IPluginBundle | null;
|
|
6
|
+
ctrl: object & import("@soxa-ui/core").IMenuRadioItem;
|
|
7
|
+
root: import("../../../adapter").TRootSource;
|
|
8
|
+
forwardProps: Partial<MenuRadioItemProps>;
|
|
9
|
+
bindRef: (el: Element | null) => void;
|
|
10
|
+
state: import("@soxa-ui/setup").TInstanceState<object & import("@soxa-ui/core").IMenuRadioItem> & import("@soxa-ui/setup").TInstanceState<object & {} & {} & {} & {
|
|
11
|
+
aria_label?: string | undefined;
|
|
12
|
+
aria_labelledBy?: string | undefined;
|
|
13
|
+
aria_describedBy?: string | undefined;
|
|
14
|
+
} & {} & {}> & import("@soxa-ui/setup").TInstanceState<object & {} & {} & {} & {} & {} & {
|
|
15
|
+
readonly listItem_highlighted: boolean;
|
|
16
|
+
}> & import("@soxa-ui/setup").TInstanceState<object & import("@soxa-ui/core").TMenuItemCollectionFacade> & object;
|
|
17
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useAdapter, useCollectionAdapter } from "../../../adapter/runtime/useAdapter.js";
|
|
3
|
+
import { useAdapterContext } from "../../../adapter/runtime/useAdapterContext.js";
|
|
4
|
+
import { MenuCollectionRadioItemDescriptor, MenuRadioItemDescriptor, TCollectionItemExtension, TMenuRadioItemExtension } from "@soxa-ui/setup";
|
|
5
|
+
//#region src/components/menu/radio-item/setup.component.ts
|
|
6
|
+
function useSetupMenuRadioItem(props) {
|
|
7
|
+
const { contexts: [adapter, item] } = useAdapterContext((create, elevator) => {
|
|
8
|
+
const adapter = create(MenuRadioItemDescriptor(), {
|
|
9
|
+
ctrl: props.ctrl,
|
|
10
|
+
props
|
|
11
|
+
}).use(TMenuRadioItemExtension, { elevator });
|
|
12
|
+
return [adapter, create(MenuCollectionRadioItemDescriptor(), { props }, { bundle: adapter.bundle }).use(TCollectionItemExtension, {
|
|
13
|
+
adapter,
|
|
14
|
+
elevator
|
|
15
|
+
})];
|
|
16
|
+
});
|
|
17
|
+
return {
|
|
18
|
+
...useCollectionAdapter(useAdapter(adapter, props), item, props),
|
|
19
|
+
context: item.instance.context
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { useSetupMenuRadioItem };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { MenuSeparatorProps } from './base.component';
|
|
3
|
+
/** MenuSeparator — линия между группами пунктов, `role="separator"` от ядра. */
|
|
4
|
+
export declare function MenuSeparator(props: MenuSeparatorProps): ReactElement | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { toRootProps } from "../../../adapter/common/root.js";
|
|
3
|
+
import { useSetupMenuSeparator } from "./setup.component.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/menu/separator/Separator.tsx
|
|
6
|
+
/** MenuSeparator — линия между группами пунктов, `role="separator"` от ядра. */
|
|
7
|
+
function MenuSeparator(props) {
|
|
8
|
+
const { ref, forwardProps, state } = useSetupMenuSeparator(props);
|
|
9
|
+
const { rendered, tag, attrs, aria, dataset } = state;
|
|
10
|
+
if (!rendered) return null;
|
|
11
|
+
return /* @__PURE__ */ jsx(tag, { ...toRootProps(ref, state, [
|
|
12
|
+
attrs,
|
|
13
|
+
aria,
|
|
14
|
+
dataset
|
|
15
|
+
], forwardProps) });
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { MenuSeparator };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { TMenuSeparator } from '@soxa-ui/core';
|
|
2
|
+
import type { MenuSeparatorDescriptor } from '@soxa-ui/setup';
|
|
3
|
+
import type { EventProps, UseDomProps } from '../../../types';
|
|
4
|
+
export type MenuSeparatorEventProps = EventProps<typeof MenuSeparatorDescriptor>;
|
|
5
|
+
export type MenuSeparatorProps = UseDomProps<typeof MenuSeparatorDescriptor, TMenuSeparator, MenuSeparatorEventProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { MenuSeparatorProps } from './base.component';
|
|
2
|
+
export declare function useSetupMenuSeparator(props: MenuSeparatorProps): import("../../../adapter").TComponentBinding<import("@soxa-ui/setup").TContextContract<import("@soxa-ui/core").TMenuSeparator, {
|
|
3
|
+
props: object & {} & {};
|
|
4
|
+
events: object & {
|
|
5
|
+
"element:removed": () => void;
|
|
6
|
+
"element:ready": (element: Element) => void;
|
|
7
|
+
} & {};
|
|
8
|
+
outputs: object & {} & {};
|
|
9
|
+
}>, MenuSeparatorProps>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useComponent } from "../../../adapter/runtime/useComponent.js";
|
|
3
|
+
import { MenuSeparatorDescriptor } from "@soxa-ui/setup";
|
|
4
|
+
//#region src/components/menu/separator/setup.component.ts
|
|
5
|
+
function useSetupMenuSeparator(props) {
|
|
6
|
+
return useComponent((create) => create(MenuSeparatorDescriptor(), {
|
|
7
|
+
ctrl: props.ctrl,
|
|
8
|
+
props
|
|
9
|
+
}), props);
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { useSetupMenuSeparator };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { MenuProps } from './base.component';
|
|
2
|
+
export declare function useSetupMenu(props: MenuProps): {
|
|
3
|
+
rootElement: Element | null;
|
|
4
|
+
layer: import("../../adapter").TElevatorLayer;
|
|
5
|
+
ref: (el: Element | null) => void;
|
|
6
|
+
plugins: import("@soxa-ui/plugins").IPluginBundle | null;
|
|
7
|
+
ctrl: object & import("@soxa-ui/core").IMenu;
|
|
8
|
+
root: import("../../adapter").TRootSource;
|
|
9
|
+
forwardProps: Partial<MenuProps>;
|
|
10
|
+
bindRef: (el: Element | null) => void;
|
|
11
|
+
state: import("@soxa-ui/setup").TInstanceState<object & import("@soxa-ui/core").IMenu> & import("@soxa-ui/setup").TInstanceState<object & {} & {} & {} & {} & {} & {
|
|
12
|
+
dismiss_enabled?: boolean | undefined;
|
|
13
|
+
} & {} & {} & {} & {} & {}> & import("@soxa-ui/setup").TInstanceState<object & {} & {} & {} & {} & {} & {
|
|
14
|
+
readonly dismiss_ownerAttribute: Record<string, string>;
|
|
15
|
+
} & {} & {} & {} & {} & {}> & import("@soxa-ui/setup").TInstanceState<object & import("@soxa-ui/core").TMenuCollectionFacade> & object;
|
|
16
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useAdapter, useCollectionAdapter } from "../../adapter/runtime/useAdapter.js";
|
|
3
|
+
import { useAdapterContext } from "../../adapter/runtime/useAdapterContext.js";
|
|
4
|
+
import { useRootElement } from "../../adapter/runtime/useRootElement.js";
|
|
5
|
+
import { MenuCollectionDescriptor, MenuDescriptor, TCollectionExtension } from "@soxa-ui/setup";
|
|
6
|
+
//#region src/components/menu/setup.component.ts
|
|
7
|
+
function useSetupMenu(props) {
|
|
8
|
+
const { contexts: [adapter, collectionAdapter], layer } = useAdapterContext((create, elevator) => {
|
|
9
|
+
const adapter = create(MenuDescriptor(), {
|
|
10
|
+
ctrl: props.ctrl,
|
|
11
|
+
props
|
|
12
|
+
});
|
|
13
|
+
return [adapter, create(MenuCollectionDescriptor(), {
|
|
14
|
+
props,
|
|
15
|
+
options: {
|
|
16
|
+
owner: adapter.instance,
|
|
17
|
+
engine: props.engine
|
|
18
|
+
}
|
|
19
|
+
}, { bundle: adapter.bundle }).use(TCollectionExtension, { elevator })];
|
|
20
|
+
});
|
|
21
|
+
const binding = useCollectionAdapter(useAdapter(adapter, props), collectionAdapter, props);
|
|
22
|
+
return {
|
|
23
|
+
...binding,
|
|
24
|
+
rootElement: useRootElement(binding.root),
|
|
25
|
+
layer
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { useSetupMenu };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { IMenuItem, TGroupSection, TMenuSubmenuEntries } from '@soxa-ui/core';
|
|
3
|
+
import type { MenuSubmenuProps } from './base.component';
|
|
4
|
+
/** Что пунктам из данных нужно от состояния владельца — меню или подменю. */
|
|
5
|
+
type TItemsState = {
|
|
6
|
+
/** Секции показанных пунктов: группа с подписью или пункты без группы. */
|
|
7
|
+
readonly sections?: ReadonlyArray<TGroupSection<IMenuItem>>;
|
|
8
|
+
/** Подменю из данных по пункту — пункт и движок его пунктов. */
|
|
9
|
+
readonly submenus?: TMenuSubmenuEntries;
|
|
10
|
+
/** Рисовать ли разделитель между соседними секциями. */
|
|
11
|
+
readonly groupSeparators?: boolean;
|
|
12
|
+
};
|
|
13
|
+
/** Слоты пунктов из данных — одни у меню и подменю, и на все уровни. */
|
|
14
|
+
type TItemSlots = Pick<MenuSubmenuProps, 'item' | 'item-leading' | 'item-trailing' | 'item-header' | 'item-arrow-icon' | 'item-content'>;
|
|
15
|
+
/** Пункты из данных по секциям — одна разметка на меню и подменю всех уровней. */
|
|
16
|
+
export declare function drawItems(state: TItemsState, slots: TItemSlots): ReactElement[];
|
|
17
|
+
/**
|
|
18
|
+
* MenuSubmenu — пункт с подменю: строка в меню над ним и своя панель с пунктами; панель —
|
|
19
|
+
* в слое лифта подменю, и её пункты входят в его коллекцию, а не в коллекцию меню.
|
|
20
|
+
*/
|
|
21
|
+
export declare const MenuSubmenu: import("react").NamedExoticComponent<MenuSubmenuProps>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { toAriaProps } from "../../../adapter/common/aria.js";
|
|
3
|
+
import { toControlAttrs, toPartClass, toRootForward, toRootProps } from "../../../adapter/common/root.js";
|
|
4
|
+
import { hasSlot, relaySlot, renderSlot } from "../../../adapter/common/slots.js";
|
|
5
|
+
import { roleIcon } from "../../../adapter/common/icon.js";
|
|
6
|
+
import { useClickAction } from "../../../adapter/runtime/useClickAction.js";
|
|
7
|
+
import { withRenderBoundary } from "../../../adapter/runtime/withRenderBoundary.js";
|
|
8
|
+
import { Elevate } from "../../../adapter/elevator/Elevate.js";
|
|
9
|
+
import { Icon } from "../../icon/Icon.js";
|
|
10
|
+
import { Frame } from "../../frame/Frame.js";
|
|
11
|
+
import { ItemRow } from "../../item-row/ItemRow.js";
|
|
12
|
+
import { MenuGroup } from "../group/Group.js";
|
|
13
|
+
import { MenuItem } from "../item/Item.js";
|
|
14
|
+
import { MenuSeparator } from "../separator/Separator.js";
|
|
15
|
+
import { useSetupMenuSubmenu } from "./setup.component.js";
|
|
16
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
+
//#region src/components/menu/submenu/Submenu.tsx
|
|
18
|
+
/** Стрелка без слота — иконка из пакета по роли, компонент на роль один на модуль. */
|
|
19
|
+
var ArrowIcon = roleIcon("arrowRight");
|
|
20
|
+
/** Пункт из данных: подменю, если коллекция завела ему движок (`submenus`), иначе действие. */
|
|
21
|
+
function drawItem(state, slots, item) {
|
|
22
|
+
const entry = state.submenus?.get(item);
|
|
23
|
+
if (!entry) return /* @__PURE__ */ jsx(MenuItem, {
|
|
24
|
+
ctrl: item,
|
|
25
|
+
leading: renderSlot(slots["item-leading"], { item }),
|
|
26
|
+
trailing: renderSlot(slots["item-trailing"], { item }),
|
|
27
|
+
children: relaySlot(slots.item, { item })
|
|
28
|
+
}, item.uid);
|
|
29
|
+
return /* @__PURE__ */ jsx(MenuSubmenu, {
|
|
30
|
+
ctrl: entry.ctrl,
|
|
31
|
+
engine: entry.engine,
|
|
32
|
+
leading: renderSlot(slots["item-leading"], { item }),
|
|
33
|
+
header: relaySlot(slots["item-header"], { item }),
|
|
34
|
+
"arrow-icon": renderSlot(slots["item-arrow-icon"], { item }),
|
|
35
|
+
item: slots.item,
|
|
36
|
+
"item-leading": slots["item-leading"],
|
|
37
|
+
"item-trailing": slots["item-trailing"],
|
|
38
|
+
"item-header": slots["item-header"],
|
|
39
|
+
"item-arrow-icon": slots["item-arrow-icon"],
|
|
40
|
+
"item-content": slots["item-content"],
|
|
41
|
+
children: renderSlot(slots["item-content"], { item })
|
|
42
|
+
}, item.uid);
|
|
43
|
+
}
|
|
44
|
+
/** Ключи пункта (`uid`), группы и разделителя секции не пересекаются. */
|
|
45
|
+
function drawSection(state, slots, section, separated) {
|
|
46
|
+
const items = section.items.map((item) => drawItem(state, slots, item));
|
|
47
|
+
const separator = separated ? [/* @__PURE__ */ jsx(MenuSeparator, {}, `separator:${section.key}`)] : [];
|
|
48
|
+
if (!section.group) return [...separator, ...items];
|
|
49
|
+
return [...separator, /* @__PURE__ */ jsx(MenuGroup, {
|
|
50
|
+
label: section.group.label,
|
|
51
|
+
children: items
|
|
52
|
+
}, section.key)];
|
|
53
|
+
}
|
|
54
|
+
/** Пункты из данных по секциям — одна разметка на меню и подменю всех уровней. */
|
|
55
|
+
function drawItems(state, slots) {
|
|
56
|
+
return (state.sections ?? []).flatMap((section, index) => drawSection(state, slots, section, state.groupSeparators === true && index > 0));
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* MenuSubmenu — пункт с подменю: строка в меню над ним и своя панель с пунктами; панель —
|
|
60
|
+
* в слое лифта подменю, и её пункты входят в его коллекцию, а не в коллекцию меню.
|
|
61
|
+
*/
|
|
62
|
+
var MenuSubmenu = withRenderBoundary(function MenuSubmenu(props) {
|
|
63
|
+
const { ref, forwardProps, state, context, rootElement, layer } = useSetupMenuSubmenu(props);
|
|
64
|
+
const expand = useClickAction(() => context?.adapters.menu.open());
|
|
65
|
+
const { rendered, tag, text, size, disabled, open, aria, dataset, attrs, panelAria, panelClasses, contentRendered, dismiss_ownerAttribute } = state;
|
|
66
|
+
if (!rendered) return null;
|
|
67
|
+
const Tag = tag;
|
|
68
|
+
const row = toControlAttrs(forwardProps);
|
|
69
|
+
return /* @__PURE__ */ jsxs(Tag, {
|
|
70
|
+
...toRootProps(ref, state, [dataset, attrs], toRootForward(forwardProps)),
|
|
71
|
+
children: [/* @__PURE__ */ jsx(ItemRow, {
|
|
72
|
+
embedded: "menu.row",
|
|
73
|
+
tag: "div",
|
|
74
|
+
size,
|
|
75
|
+
disabled,
|
|
76
|
+
...toAriaProps(aria),
|
|
77
|
+
...row,
|
|
78
|
+
ref: expand,
|
|
79
|
+
leading: /* @__PURE__ */ jsx("span", {
|
|
80
|
+
className: "so-menu-item__icon",
|
|
81
|
+
children: renderSlot(props.leading)
|
|
82
|
+
}),
|
|
83
|
+
trailing: /* @__PURE__ */ jsx("span", {
|
|
84
|
+
className: "so-menu-item__arrow",
|
|
85
|
+
"aria-hidden": "true",
|
|
86
|
+
children: renderSlot(props["arrow-icon"]) ?? /* @__PURE__ */ jsx(Icon, {
|
|
87
|
+
embedded: "menu.arrow",
|
|
88
|
+
tag: ArrowIcon,
|
|
89
|
+
size
|
|
90
|
+
})
|
|
91
|
+
}),
|
|
92
|
+
children: renderSlot(props.header, {
|
|
93
|
+
text: text ?? "",
|
|
94
|
+
open: open ?? false
|
|
95
|
+
}) ?? text
|
|
96
|
+
}), /* @__PURE__ */ jsx(Elevate, {
|
|
97
|
+
layer,
|
|
98
|
+
children: /* @__PURE__ */ jsx(Frame, {
|
|
99
|
+
embedded: "menu.submenu-frame",
|
|
100
|
+
className: toPartClass(panelClasses),
|
|
101
|
+
tabIndex: -1,
|
|
102
|
+
visible: state.visible && open,
|
|
103
|
+
strategy: "fixed",
|
|
104
|
+
anchor_anchor: rootElement,
|
|
105
|
+
anchor_placement: "end-start",
|
|
106
|
+
...toAriaProps(panelAria),
|
|
107
|
+
...toAriaProps(dismiss_ownerAttribute),
|
|
108
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
109
|
+
className: "so-menu__list",
|
|
110
|
+
children: !contentRendered ? null : hasSlot(props.children) ? renderSlot(props.children) : drawItems(state, props)
|
|
111
|
+
})
|
|
112
|
+
})
|
|
113
|
+
})]
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
//#endregion
|
|
117
|
+
export { MenuSubmenu, drawItems };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
import type { IMenuSubmenu } from '@soxa-ui/core';
|
|
3
|
+
import type { MenuCollectionItemDescriptor, MenuSubmenuCollectionDescriptor, MenuSubmenuDescriptor } from '@soxa-ui/setup';
|
|
4
|
+
import type { EventProps, TDomAttributes, UseDomProps } from '../../../types';
|
|
5
|
+
/** Колбэки трёх контекстов подменю — свой, фасад пункта и фасад меню — пропсы одного компонента. */
|
|
6
|
+
export type MenuSubmenuEventProps = EventProps<typeof MenuSubmenuDescriptor> & EventProps<typeof MenuCollectionItemDescriptor> & EventProps<typeof MenuSubmenuCollectionDescriptor>;
|
|
7
|
+
/** Атрибуты пункта с подменю: класс и стиль — корню, остальное — строке с `role="menuitem"`. */
|
|
8
|
+
export type MenuSubmenuAttributes = TDomAttributes<typeof MenuSubmenuDescriptor, HTMLAttributes<HTMLElement>, MenuSubmenuEventProps>;
|
|
9
|
+
export type MenuSubmenuProps = UseDomProps<typeof MenuSubmenuDescriptor, IMenuSubmenu, MenuSubmenuEventProps>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { MenuSubmenuProps } from './base.component';
|
|
2
|
+
export declare function useSetupMenuSubmenu(props: MenuSubmenuProps): {
|
|
3
|
+
context: import("@soxa-ui/core").TItemContext<import("@soxa-ui/core").IMenuItem<import("@soxa-ui/core").IMenuItemProps, any>, import("@soxa-ui/core").TMenuCollectionExtensions> | undefined;
|
|
4
|
+
rootElement: Element | null;
|
|
5
|
+
layer: import("../../../adapter").TElevatorLayer;
|
|
6
|
+
ref: (el: Element | null) => void;
|
|
7
|
+
plugins: import("@soxa-ui/plugins").IPluginBundle | null;
|
|
8
|
+
ctrl: object & import("@soxa-ui/core").IMenuSubmenu;
|
|
9
|
+
root: import("../../../adapter").TRootSource;
|
|
10
|
+
forwardProps: Partial<MenuSubmenuProps>;
|
|
11
|
+
bindRef: (el: Element | null) => void;
|
|
12
|
+
state: import("@soxa-ui/setup").TInstanceState<object & import("@soxa-ui/core").IMenuSubmenu> & import("@soxa-ui/setup").TInstanceState<object & {} & {} & {} & {
|
|
13
|
+
aria_label?: string | undefined;
|
|
14
|
+
aria_labelledBy?: string | undefined;
|
|
15
|
+
aria_describedBy?: string | undefined;
|
|
16
|
+
} & {} & {} & {} & {} & {} & {} & {
|
|
17
|
+
dismiss_enabled?: boolean | undefined;
|
|
18
|
+
} & {} & {} & {
|
|
19
|
+
id?: string | undefined;
|
|
20
|
+
} & {}> & import("@soxa-ui/setup").TInstanceState<object & {} & {} & {} & {} & {} & {
|
|
21
|
+
readonly listItem_highlighted: boolean;
|
|
22
|
+
} & {} & {} & {} & {} & {
|
|
23
|
+
readonly dismiss_ownerAttribute: Record<string, string>;
|
|
24
|
+
} & {} & {} & {} & {}> & import("@soxa-ui/setup").TInstanceState<object & import("@soxa-ui/core").TMenuItemCollectionFacade> & object & import("@soxa-ui/setup").TInstanceState<object & import("@soxa-ui/core").TMenuCollectionFacade>;
|
|
25
|
+
};
|