@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,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useAdapter, useCollectionAdapter } from "../../adapter/runtime/useAdapter.js";
|
|
3
|
+
import { useAdapterContext } from "../../adapter/runtime/useAdapterContext.js";
|
|
4
|
+
import { CalendarCollectionDescriptor, CalendarDescriptor, TCollectionExtension } from "@soxa-ui/setup";
|
|
5
|
+
//#region src/components/calendar/setup.component.ts
|
|
6
|
+
function useSetupCalendar(props) {
|
|
7
|
+
const { contexts: [adapter, collectionAdapter], layer } = useAdapterContext((create, elevator) => {
|
|
8
|
+
const adapter = create(CalendarDescriptor(), {
|
|
9
|
+
ctrl: props.ctrl,
|
|
10
|
+
props
|
|
11
|
+
});
|
|
12
|
+
return [adapter, create(CalendarCollectionDescriptor(), {
|
|
13
|
+
props,
|
|
14
|
+
options: {
|
|
15
|
+
owner: adapter.instance,
|
|
16
|
+
engine: props.engine
|
|
17
|
+
}
|
|
18
|
+
}, { bundle: adapter.bundle }).use(TCollectionExtension, { elevator })];
|
|
19
|
+
});
|
|
20
|
+
return {
|
|
21
|
+
...useCollectionAdapter(useAdapter(adapter, props), collectionAdapter, props),
|
|
22
|
+
layer
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { useSetupCalendar };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { CheckBoxProps } from './base.component';
|
|
3
|
+
/** CheckBox — флажок на нативном `<input type="checkbox">`: AGENTS.md (React), «Поля ввода». */
|
|
4
|
+
export declare function CheckBox(props: CheckBoxProps): ReactElement | null;
|
|
@@ -0,0 +1,49 @@
|
|
|
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 { NativeInput } from "../../adapter/runtime/NativeInput.js";
|
|
7
|
+
import { elevated } from "../../adapter/elevator/Elevate.js";
|
|
8
|
+
import { useSetupCheckBox } from "./setup.component.js";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
//#region src/components/check-box/CheckBox.tsx
|
|
11
|
+
/** Отметка — `svg` роли, а не `Icon`: тот собирал бы контекст на каждую смену отметки. */
|
|
12
|
+
var CheckMark = roleIcon("check");
|
|
13
|
+
var IndeterminateMark = roleIcon("checkIndeterminate");
|
|
14
|
+
/** CheckBox — флажок на нативном `<input type="checkbox">`: AGENTS.md (React), «Поля ввода». */
|
|
15
|
+
function CheckBox(props) {
|
|
16
|
+
const { ref, forwardProps, state, layer } = useSetupCheckBox(props);
|
|
17
|
+
const { rendered, tag, attrs, aria, dataset, id, value, indeterminate, name, disabled, required } = state;
|
|
18
|
+
if (!rendered) return null;
|
|
19
|
+
const Tag = tag;
|
|
20
|
+
const scope = {
|
|
21
|
+
value,
|
|
22
|
+
indeterminate: indeterminate ?? false
|
|
23
|
+
};
|
|
24
|
+
let mark = null;
|
|
25
|
+
if (indeterminate) mark = elevated(layer, renderSlot(props["indeterminate-icon"], scope)) ?? /* @__PURE__ */ jsx(IndeterminateMark, { className: "so-check-box__mark" });
|
|
26
|
+
else if (value) mark = elevated(layer, renderSlot(props.icon, scope)) ?? /* @__PURE__ */ jsx(CheckMark, { className: "so-check-box__mark" });
|
|
27
|
+
return /* @__PURE__ */ jsxs(Tag, {
|
|
28
|
+
...toRootProps(ref, state, [attrs, dataset], toRootForward(forwardProps)),
|
|
29
|
+
children: [/* @__PURE__ */ jsx(NativeInput, {
|
|
30
|
+
type: "checkbox",
|
|
31
|
+
id,
|
|
32
|
+
name,
|
|
33
|
+
disabled,
|
|
34
|
+
required,
|
|
35
|
+
...toAriaProps(aria),
|
|
36
|
+
...toControlAttrs(forwardProps),
|
|
37
|
+
live: {
|
|
38
|
+
checked: value,
|
|
39
|
+
indeterminate
|
|
40
|
+
}
|
|
41
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
42
|
+
className: "so-check-box__container",
|
|
43
|
+
"aria-hidden": "true",
|
|
44
|
+
children: mark
|
|
45
|
+
})]
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { CheckBox };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ICheckBox } from '@soxa-ui/core';
|
|
2
|
+
import type { CheckBoxDescriptor } from '@soxa-ui/setup';
|
|
3
|
+
import type { EventProps, TDomAttributes, TFieldAttributes, UseDomProps } from '../../types';
|
|
4
|
+
export type CheckBoxEventProps = EventProps<typeof CheckBoxDescriptor>;
|
|
5
|
+
/** Атрибуты CheckBox: класс и стиль — корню, остальное — полю `<input>`. */
|
|
6
|
+
export type CheckBoxAttributes = TDomAttributes<typeof CheckBoxDescriptor, TFieldAttributes>;
|
|
7
|
+
export type CheckBoxProps = UseDomProps<typeof CheckBoxDescriptor, ICheckBox, CheckBoxEventProps, TFieldAttributes>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { CheckBoxProps } from './base.component';
|
|
2
|
+
/** Поле формы `Field` над флажком: ошибку и ссылки на части флажок берёт от него лифтом. */
|
|
3
|
+
export declare function useSetupCheckBox(props: CheckBoxProps): import("../../adapter").TComponentBinding<import("@soxa-ui/setup").TContextContract<import("@soxa-ui/core").ICheckBox, {
|
|
4
|
+
props: object & {} & {} & {} & {
|
|
5
|
+
aria_label?: string | undefined;
|
|
6
|
+
aria_labelledBy?: string | undefined;
|
|
7
|
+
aria_describedBy?: string | undefined;
|
|
8
|
+
} & {
|
|
9
|
+
id?: string | undefined;
|
|
10
|
+
} & {} & {};
|
|
11
|
+
events: object & {
|
|
12
|
+
"element:removed": () => void;
|
|
13
|
+
"element:ready": (element: Element) => void;
|
|
14
|
+
} & {} & {
|
|
15
|
+
"aria:change:label": (payload: import("@soxa-ui/core").TValuePayload<string | undefined>) => void;
|
|
16
|
+
"aria:change:labelledBy": (payload: import("@soxa-ui/core").TValuePayload<string | undefined>) => void;
|
|
17
|
+
"aria:change:describedBy": (payload: import("@soxa-ui/core").TValuePayload<string | undefined>) => void;
|
|
18
|
+
} & {
|
|
19
|
+
"action:blur": (event: FocusEvent) => void;
|
|
20
|
+
"action:click": (event: MouseEvent) => void;
|
|
21
|
+
"action:focus": (event: FocusEvent) => void;
|
|
22
|
+
"action:press": (event: MouseEvent) => void;
|
|
23
|
+
} & {
|
|
24
|
+
"change:id": (payload: import("@soxa-ui/core").TValuePayload<string | undefined>) => void;
|
|
25
|
+
} & {};
|
|
26
|
+
outputs: object & {} & {} & {} & {} & {} & {} & {};
|
|
27
|
+
}>, CheckBoxProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useComponent } from "../../adapter/runtime/useComponent.js";
|
|
3
|
+
import { CheckBoxDescriptor, TFieldControlExtension } from "@soxa-ui/setup";
|
|
4
|
+
//#region src/components/check-box/setup.component.ts
|
|
5
|
+
/** Поле формы `Field` над флажком: ошибку и ссылки на части флажок берёт от него лифтом. */
|
|
6
|
+
function useSetupCheckBox(props) {
|
|
7
|
+
return useComponent((create, elevator) => create(CheckBoxDescriptor(), {
|
|
8
|
+
ctrl: props.ctrl,
|
|
9
|
+
props
|
|
10
|
+
}).use(TFieldControlExtension, { elevator }), props);
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { useSetupCheckBox };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IComponent } from '@soxa-ui/core';
|
|
2
|
+
import type { ComponentDescriptor } from '@soxa-ui/setup';
|
|
3
|
+
import type { EventProps, UseProps } from '../../types';
|
|
4
|
+
export type ComponentEventProps = EventProps<typeof ComponentDescriptor>;
|
|
5
|
+
export type ComponentProps = UseProps<typeof ComponentDescriptor, IComponent, ComponentEventProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './base.component';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { toRootProps } from "../../adapter/common/root.js";
|
|
3
|
+
import { renderSlot } from "../../adapter/common/slots.js";
|
|
4
|
+
import { useSetupComponentView } from "./setup.component.js";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/component-view/ComponentView.tsx
|
|
7
|
+
/** ComponentView — корень по `tag` со слотом `default`. */
|
|
8
|
+
function ComponentView(props) {
|
|
9
|
+
const { ref, forwardProps, state } = useSetupComponentView(props);
|
|
10
|
+
const { rendered, tag, aria, dataset, attrs } = state;
|
|
11
|
+
if (!rendered) return null;
|
|
12
|
+
return /* @__PURE__ */ jsx(tag, {
|
|
13
|
+
...toRootProps(ref, state, [
|
|
14
|
+
attrs,
|
|
15
|
+
aria,
|
|
16
|
+
dataset
|
|
17
|
+
], forwardProps),
|
|
18
|
+
children: renderSlot(props.children)
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { ComponentView };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IComponentView } from '@soxa-ui/core';
|
|
2
|
+
import type { ComponentViewDescriptor } from '@soxa-ui/setup';
|
|
3
|
+
import type { EventProps, UseDomProps } from '../../types';
|
|
4
|
+
export type ComponentViewEventProps = EventProps<typeof ComponentViewDescriptor>;
|
|
5
|
+
export type ComponentViewProps = UseDomProps<typeof ComponentViewDescriptor, IComponentView, ComponentViewEventProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ComponentViewProps } from './base.component';
|
|
2
|
+
export declare function useSetupComponentView(props: ComponentViewProps): import("../../adapter").TComponentBinding<import("@soxa-ui/setup").TContextContract<import("@soxa-ui/core").IComponentView<import("@soxa-ui/core").IComponentViewProps, import("@soxa-ui/core").TComponentViewEvents>, {
|
|
3
|
+
props: object & {} & {};
|
|
4
|
+
events: object & {
|
|
5
|
+
"element:removed": () => void;
|
|
6
|
+
"element:ready": (element: Element) => void;
|
|
7
|
+
} & {};
|
|
8
|
+
outputs: object & {} & {};
|
|
9
|
+
}>, ComponentViewProps>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useComponent } from "../../adapter/runtime/useComponent.js";
|
|
3
|
+
import { ComponentViewDescriptor } from "@soxa-ui/setup";
|
|
4
|
+
//#region src/components/component-view/setup.component.ts
|
|
5
|
+
function useSetupComponentView(props) {
|
|
6
|
+
return useComponent((create) => create(ComponentViewDescriptor(), {
|
|
7
|
+
ctrl: props.ctrl,
|
|
8
|
+
props
|
|
9
|
+
}), props);
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { useSetupComponentView };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IControl } from '@soxa-ui/core';
|
|
2
|
+
import type { ControlDescriptor } from '@soxa-ui/setup';
|
|
3
|
+
import type { EventProps, UseProps } from '../../types';
|
|
4
|
+
export type ControlEventProps = EventProps<typeof ControlDescriptor>;
|
|
5
|
+
export type ControlProps = UseProps<typeof ControlDescriptor, IControl, ControlEventProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './base.component';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ControlProps } from './base.component';
|
|
2
|
+
export declare function useSetupControl(props: ControlProps): import("../../adapter").TComponentBinding<import("@soxa-ui/setup").TContextContract<import("@soxa-ui/core").IControl<import("@soxa-ui/core").IControlProps, import("@soxa-ui/core").TControlEvents>, {
|
|
3
|
+
props: object & {} & {} & {} & {
|
|
4
|
+
aria_label?: string | undefined;
|
|
5
|
+
aria_labelledBy?: string | undefined;
|
|
6
|
+
aria_describedBy?: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
events: object & {
|
|
9
|
+
"element:removed": () => void;
|
|
10
|
+
"element:ready": (element: Element) => void;
|
|
11
|
+
} & {} & {
|
|
12
|
+
"aria:change:label": (payload: import("@soxa-ui/core").TValuePayload<string | undefined>) => void;
|
|
13
|
+
"aria:change:labelledBy": (payload: import("@soxa-ui/core").TValuePayload<string | undefined>) => void;
|
|
14
|
+
"aria:change:describedBy": (payload: import("@soxa-ui/core").TValuePayload<string | undefined>) => void;
|
|
15
|
+
} & {
|
|
16
|
+
"action:blur": (event: FocusEvent) => void;
|
|
17
|
+
"action:click": (event: MouseEvent) => void;
|
|
18
|
+
"action:focus": (event: FocusEvent) => void;
|
|
19
|
+
"action:press": (event: MouseEvent) => void;
|
|
20
|
+
};
|
|
21
|
+
outputs: object & {} & {} & {} & {};
|
|
22
|
+
}>, ControlProps>;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { toAriaProps } from "../../adapter/common/aria.js";
|
|
3
|
+
import { toRootProps } from "../../adapter/common/root.js";
|
|
4
|
+
import { hasSlot, renderSlot } from "../../adapter/common/slots.js";
|
|
5
|
+
import { roleIcon } from "../../adapter/common/icon.js";
|
|
6
|
+
import { useClickAction } from "../../adapter/runtime/useClickAction.js";
|
|
7
|
+
import { elevated } from "../../adapter/elevator/Elevate.js";
|
|
8
|
+
import { Button } from "../button/Button.js";
|
|
9
|
+
import { Icon } from "../icon/Icon.js";
|
|
10
|
+
import { useSetupDateInput } from "./setup.component.js";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
//#region src/components/date-input/DateInput.tsx
|
|
13
|
+
var CloseMark = roleIcon("close");
|
|
14
|
+
/**
|
|
15
|
+
* Часть или разделитель; ключ части — её тип, и при наборе узел тот же. Текст — единственный
|
|
16
|
+
* ребёнок-строка: docs/agents/dates.md, «Даты».
|
|
17
|
+
*/
|
|
18
|
+
function drawSegment(segment) {
|
|
19
|
+
if (segment.type === "literal") return /* @__PURE__ */ jsx("span", {
|
|
20
|
+
className: "so-date-input__literal",
|
|
21
|
+
...toAriaProps(segment.aria),
|
|
22
|
+
children: segment.text
|
|
23
|
+
}, segment.key);
|
|
24
|
+
return /* @__PURE__ */ jsx("span", {
|
|
25
|
+
className: "so-date-input__segment",
|
|
26
|
+
suppressContentEditableWarning: true,
|
|
27
|
+
...toAriaProps(segment.attrs),
|
|
28
|
+
...toAriaProps(segment.aria),
|
|
29
|
+
...toAriaProps(segment.dataset),
|
|
30
|
+
children: segment.text
|
|
31
|
+
}, segment.key);
|
|
32
|
+
}
|
|
33
|
+
/** DateInput — поле даты из частей по формату локали: docs/agents/dates.md, «Даты». */
|
|
34
|
+
function DateInput(props) {
|
|
35
|
+
const { ctrl, ref, forwardProps, state, layer } = useSetupDateInput(props);
|
|
36
|
+
const clear = useClickAction((event) => {
|
|
37
|
+
event.stopPropagation();
|
|
38
|
+
ctrl.clear();
|
|
39
|
+
});
|
|
40
|
+
const { rendered, tag, id, attrs, aria, dataset, segments, segmentsAttrs, name, value, disabled, size, clearable, clearAria } = state;
|
|
41
|
+
if (!rendered) return null;
|
|
42
|
+
const Tag = tag;
|
|
43
|
+
const trailing = clearable === true || hasSlot(props.clear) || hasSlot(props.trailing);
|
|
44
|
+
return /* @__PURE__ */ jsxs(Tag, {
|
|
45
|
+
id,
|
|
46
|
+
...toRootProps(ref, state, [
|
|
47
|
+
attrs,
|
|
48
|
+
aria,
|
|
49
|
+
dataset
|
|
50
|
+
], forwardProps),
|
|
51
|
+
children: [
|
|
52
|
+
hasSlot(props.leading) ? /* @__PURE__ */ jsx("div", {
|
|
53
|
+
className: "so-date-input__leading",
|
|
54
|
+
children: elevated(layer, renderSlot(props.leading, { ctrl }))
|
|
55
|
+
}) : null,
|
|
56
|
+
/* @__PURE__ */ jsx("span", {
|
|
57
|
+
className: "so-date-input__segments",
|
|
58
|
+
...toAriaProps(segmentsAttrs),
|
|
59
|
+
children: segments?.map(drawSegment)
|
|
60
|
+
}),
|
|
61
|
+
trailing ? /* @__PURE__ */ jsxs("div", {
|
|
62
|
+
className: "so-date-input__trailing",
|
|
63
|
+
children: [elevated(layer, renderSlot(props.clear, { clear: ctrl.clear })) ?? (clearable === true ? /* @__PURE__ */ jsx(Button, {
|
|
64
|
+
embedded: "date-input.clear",
|
|
65
|
+
type: "button",
|
|
66
|
+
className: "so-date-input__clear",
|
|
67
|
+
size,
|
|
68
|
+
disabled,
|
|
69
|
+
...toAriaProps(clearAria),
|
|
70
|
+
ref: clear,
|
|
71
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
72
|
+
embedded: "date-input.clear-icon",
|
|
73
|
+
tag: CloseMark,
|
|
74
|
+
size
|
|
75
|
+
})
|
|
76
|
+
}) : null), elevated(layer, renderSlot(props.trailing, { ctrl }))]
|
|
77
|
+
}) : null,
|
|
78
|
+
/* @__PURE__ */ jsx("input", {
|
|
79
|
+
type: "hidden",
|
|
80
|
+
name,
|
|
81
|
+
value: value ?? "",
|
|
82
|
+
disabled
|
|
83
|
+
})
|
|
84
|
+
]
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
//#endregion
|
|
88
|
+
export { DateInput };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IDateInput } from '@soxa-ui/core';
|
|
2
|
+
import type { DateInputDescriptor } from '@soxa-ui/setup';
|
|
3
|
+
import type { EventProps, UseDomProps } from '../../types';
|
|
4
|
+
export type DateInputEventProps = EventProps<typeof DateInputDescriptor>;
|
|
5
|
+
/** Пропсы DateInput: атрибуты потребителя — корню целиком, части рисует сам компонент. */
|
|
6
|
+
export type DateInputProps = UseDomProps<typeof DateInputDescriptor, IDateInput, DateInputEventProps>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { DateInputProps } from './base.component';
|
|
2
|
+
/** Поле формы `Field` над полем: ошибку и ссылки на части поле берёт от него лифтом. */
|
|
3
|
+
export declare function useSetupDateInput(props: DateInputProps): import("../../adapter").TComponentBinding<import("@soxa-ui/setup").TContextContract<import("@soxa-ui/core").IDateInput, {
|
|
4
|
+
props: object & {} & {} & {} & {
|
|
5
|
+
aria_label?: string | undefined;
|
|
6
|
+
aria_labelledBy?: string | undefined;
|
|
7
|
+
aria_describedBy?: string | undefined;
|
|
8
|
+
} & {
|
|
9
|
+
id?: string | undefined;
|
|
10
|
+
} & {} & {} & {} & {} & {} & {} & {} & {};
|
|
11
|
+
events: object & {
|
|
12
|
+
"element:removed": () => void;
|
|
13
|
+
"element:ready": (element: Element) => void;
|
|
14
|
+
} & {} & {
|
|
15
|
+
"aria:change:label": (payload: import("@soxa-ui/core").TValuePayload<string | undefined>) => void;
|
|
16
|
+
"aria:change:labelledBy": (payload: import("@soxa-ui/core").TValuePayload<string | undefined>) => void;
|
|
17
|
+
"aria:change:describedBy": (payload: import("@soxa-ui/core").TValuePayload<string | undefined>) => void;
|
|
18
|
+
} & {
|
|
19
|
+
"action:blur": (event: FocusEvent) => void;
|
|
20
|
+
"action:click": (event: MouseEvent) => void;
|
|
21
|
+
"action:focus": (event: FocusEvent) => void;
|
|
22
|
+
"action:press": (event: MouseEvent) => void;
|
|
23
|
+
} & {
|
|
24
|
+
"change:id": (payload: import("@soxa-ui/core").TValuePayload<string | undefined>) => void;
|
|
25
|
+
} & {} & {} & {} & {} & {} & {} & {};
|
|
26
|
+
outputs: object & {} & {} & {} & {} & {} & {} & {} & {} & {} & {} & {} & {} & {};
|
|
27
|
+
}>, DateInputProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useComponent } from "../../adapter/runtime/useComponent.js";
|
|
3
|
+
import { DateInputDescriptor, TFieldControlExtension } from "@soxa-ui/setup";
|
|
4
|
+
//#region src/components/date-input/setup.component.ts
|
|
5
|
+
/** Поле формы `Field` над полем: ошибку и ссылки на части поле берёт от него лифтом. */
|
|
6
|
+
function useSetupDateInput(props) {
|
|
7
|
+
return useComponent((create, elevator) => create(DateInputDescriptor(), {
|
|
8
|
+
ctrl: props.ctrl,
|
|
9
|
+
props
|
|
10
|
+
}).use(TFieldControlExtension, { elevator }), props);
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { useSetupDateInput };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { DatePickerProps } from './base.component';
|
|
3
|
+
/**
|
|
4
|
+
* DatePicker — a date field and a calendar in a panel: docs/agents/dates.md, «Даты». A mode's
|
|
5
|
+
* fields are read from the instance in that mode's branch: the core creates a field when its
|
|
6
|
+
* mode needs it. The keys of the fields and the calendar — AGENTS.md (React), «Пересобранный
|
|
7
|
+
* инстанс и `key`».
|
|
8
|
+
*/
|
|
9
|
+
export declare function DatePicker(props: DatePickerProps): ReactElement | null;
|
|
@@ -0,0 +1,148 @@
|
|
|
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 { roleIcon } from "../../adapter/common/icon.js";
|
|
6
|
+
import { useClickAction } from "../../adapter/runtime/useClickAction.js";
|
|
7
|
+
import { Elevate } from "../../adapter/elevator/Elevate.js";
|
|
8
|
+
import { Button } from "../button/Button.js";
|
|
9
|
+
import { Icon } from "../icon/Icon.js";
|
|
10
|
+
import { Frame } from "../frame/Frame.js";
|
|
11
|
+
import { DateInput } from "../date-input/DateInput.js";
|
|
12
|
+
import { Calendar } from "../calendar/index.js";
|
|
13
|
+
import { useSetupDatePicker } from "./setup.component.js";
|
|
14
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
//#region src/components/date-picker/DatePicker.tsx
|
|
16
|
+
var CloseMark = roleIcon("close");
|
|
17
|
+
var CalendarMark = roleIcon("calendar");
|
|
18
|
+
/**
|
|
19
|
+
* DatePicker — a date field and a calendar in a panel: docs/agents/dates.md, «Даты». A mode's
|
|
20
|
+
* fields are read from the instance in that mode's branch: the core creates a field when its
|
|
21
|
+
* mode needs it. The keys of the fields and the calendar — AGENTS.md (React), «Пересобранный
|
|
22
|
+
* инстанс и `key`».
|
|
23
|
+
*/
|
|
24
|
+
function DatePicker(props) {
|
|
25
|
+
const { ctrl, ref, forwardProps, state, layer, rootElement, calendar, engine } = useSetupDatePicker(props);
|
|
26
|
+
const clearValue = useClickAction((event) => {
|
|
27
|
+
event.stopPropagation();
|
|
28
|
+
ctrl.clear();
|
|
29
|
+
});
|
|
30
|
+
const cancel = useClickAction(() => {
|
|
31
|
+
ctrl.open = false;
|
|
32
|
+
});
|
|
33
|
+
const confirm = useClickAction(() => ctrl.confirm());
|
|
34
|
+
const { rendered, id, attrs, aria, rootAria, dataset, mode, size, disabled, clearable, clearAria, openable, triggerAria, triggerDataset, open, panelAria, panelDataset, handleRendered, contentRendered, confirmable, confirmDisabled, names_start, names_end, names_cancel, names_confirm, dismiss_ownerAttribute } = state;
|
|
35
|
+
if (!rendered) return null;
|
|
36
|
+
const clear = renderSlot(props.clear, { clear: ctrl.clear }) ?? (clearable === true ? /* @__PURE__ */ jsx(Button, {
|
|
37
|
+
embedded: "date-picker.clear",
|
|
38
|
+
type: "button",
|
|
39
|
+
className: "so-date-picker__clear",
|
|
40
|
+
size,
|
|
41
|
+
disabled,
|
|
42
|
+
...toAriaProps(clearAria),
|
|
43
|
+
ref: clearValue,
|
|
44
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
45
|
+
embedded: "date-picker.clear-icon",
|
|
46
|
+
tag: CloseMark,
|
|
47
|
+
size
|
|
48
|
+
})
|
|
49
|
+
}) : null);
|
|
50
|
+
const trigger = /* @__PURE__ */ jsx(Button, {
|
|
51
|
+
embedded: "date-picker.trigger",
|
|
52
|
+
type: "button",
|
|
53
|
+
className: "so-date-picker__trigger",
|
|
54
|
+
size,
|
|
55
|
+
disabled: !openable,
|
|
56
|
+
...toAriaProps(triggerAria),
|
|
57
|
+
...toAriaProps(triggerDataset),
|
|
58
|
+
children: renderSlot(props["trigger-icon"]) ?? /* @__PURE__ */ jsx(Icon, {
|
|
59
|
+
embedded: "date-picker.trigger-icon",
|
|
60
|
+
tag: CalendarMark
|
|
61
|
+
})
|
|
62
|
+
});
|
|
63
|
+
const footer = confirmable === true ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Button, {
|
|
64
|
+
embedded: "date-picker.cancel",
|
|
65
|
+
type: "button",
|
|
66
|
+
className: "so-date-picker__cancel",
|
|
67
|
+
size,
|
|
68
|
+
text: names_cancel,
|
|
69
|
+
ref: cancel
|
|
70
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
71
|
+
embedded: "date-picker.confirm",
|
|
72
|
+
type: "button",
|
|
73
|
+
className: "so-date-picker__confirm",
|
|
74
|
+
size,
|
|
75
|
+
disabled: confirmDisabled,
|
|
76
|
+
text: names_confirm,
|
|
77
|
+
ref: confirm
|
|
78
|
+
})] }) : void 0;
|
|
79
|
+
return /* @__PURE__ */ jsx("div", {
|
|
80
|
+
id,
|
|
81
|
+
...toRootProps(ref, state, [
|
|
82
|
+
attrs,
|
|
83
|
+
rootAria,
|
|
84
|
+
dataset
|
|
85
|
+
], forwardProps),
|
|
86
|
+
children: /* @__PURE__ */ jsxs(Elevate, {
|
|
87
|
+
layer,
|
|
88
|
+
children: [mode === "single" ? /* @__PURE__ */ jsx(DateInput, {
|
|
89
|
+
embedded: "date-picker.field",
|
|
90
|
+
className: "so-date-picker__field",
|
|
91
|
+
ctrl: ctrl.field,
|
|
92
|
+
aria_label: props.aria_label,
|
|
93
|
+
aria_labelledBy: props.aria_labelledBy,
|
|
94
|
+
aria_describedBy: props.aria_describedBy,
|
|
95
|
+
...toAriaProps(aria),
|
|
96
|
+
clear,
|
|
97
|
+
trailing: trigger
|
|
98
|
+
}, ctrl.field.uid) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
99
|
+
/* @__PURE__ */ jsx(DateInput, {
|
|
100
|
+
embedded: "date-picker.start",
|
|
101
|
+
className: "so-date-picker__start",
|
|
102
|
+
ctrl: ctrl.start,
|
|
103
|
+
aria_label: names_start
|
|
104
|
+
}, ctrl.start.uid),
|
|
105
|
+
/* @__PURE__ */ jsx("span", {
|
|
106
|
+
className: "so-date-picker__dash",
|
|
107
|
+
"aria-hidden": "true",
|
|
108
|
+
children: "–"
|
|
109
|
+
}),
|
|
110
|
+
/* @__PURE__ */ jsx(DateInput, {
|
|
111
|
+
embedded: "date-picker.end",
|
|
112
|
+
className: "so-date-picker__end",
|
|
113
|
+
ctrl: ctrl.end,
|
|
114
|
+
aria_label: names_end
|
|
115
|
+
}, ctrl.end.uid),
|
|
116
|
+
clear,
|
|
117
|
+
trigger
|
|
118
|
+
] }), /* @__PURE__ */ jsxs(Frame, {
|
|
119
|
+
embedded: "date-picker.frame",
|
|
120
|
+
className: "so-date-picker__panel",
|
|
121
|
+
tabIndex: -1,
|
|
122
|
+
visible: state.visible && open,
|
|
123
|
+
strategy: "fixed",
|
|
124
|
+
anchor_anchor: rootElement,
|
|
125
|
+
anchor_offset: 4,
|
|
126
|
+
...toAriaProps(panelAria),
|
|
127
|
+
...toAriaProps(panelDataset),
|
|
128
|
+
...toAriaProps(dismiss_ownerAttribute),
|
|
129
|
+
children: [handleRendered ? /* @__PURE__ */ jsx("div", {
|
|
130
|
+
className: "so-date-picker__handle",
|
|
131
|
+
"aria-hidden": "true"
|
|
132
|
+
}) : null, /* @__PURE__ */ jsx("div", {
|
|
133
|
+
className: "so-date-picker__content",
|
|
134
|
+
children: contentRendered ? /* @__PURE__ */ jsx(Calendar, {
|
|
135
|
+
embedded: "date-picker.calendar",
|
|
136
|
+
className: "so-date-picker__calendar",
|
|
137
|
+
ctrl: calendar,
|
|
138
|
+
engine,
|
|
139
|
+
item: props.item,
|
|
140
|
+
footer
|
|
141
|
+
}, calendar.uid) : null
|
|
142
|
+
})]
|
|
143
|
+
})]
|
|
144
|
+
})
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
//#endregion
|
|
148
|
+
export { DatePicker };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IDatePicker } from '@soxa-ui/core';
|
|
2
|
+
import type { DatePickerDescriptor } from '@soxa-ui/setup';
|
|
3
|
+
import type { EventProps, UseDomProps } from '../../types';
|
|
4
|
+
export type DatePickerEventProps = EventProps<typeof DatePickerDescriptor>;
|
|
5
|
+
/** Пропсы DatePicker: атрибуты потребителя — корню, якорю панели и коробке полей диапазона. */
|
|
6
|
+
export type DatePickerProps = UseDomProps<typeof DatePickerDescriptor, IDatePicker, DatePickerEventProps>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { DatePickerProps } from './base.component';
|
|
2
|
+
/**
|
|
3
|
+
* The calendar and its engine are core instances of the current assembly; the
|
|
4
|
+
* markup hands them over whole and reads a mode's fields from the instance in
|
|
5
|
+
* that mode's branch — the core creates a field when its mode needs it:
|
|
6
|
+
* AGENTS.md (React), «Пересобранный инстанс и `key`».
|
|
7
|
+
*/
|
|
8
|
+
export declare function useSetupDatePicker(props: DatePickerProps): {
|
|
9
|
+
rootElement: Element | null;
|
|
10
|
+
calendar: import("@soxa-ui/core").ICalendar;
|
|
11
|
+
engine: import("@soxa-ui/core").TCalendarCollection;
|
|
12
|
+
ctrl: object & import("@soxa-ui/core").IDatePicker;
|
|
13
|
+
plugins: import("@soxa-ui/plugins").IPluginBundle | null;
|
|
14
|
+
ref: (el: Element | null) => void;
|
|
15
|
+
bindRef: (el: Element | null) => void;
|
|
16
|
+
root: import("../../adapter").TRootSource;
|
|
17
|
+
forwardProps: Partial<DatePickerProps>;
|
|
18
|
+
state: import("@soxa-ui/setup").TAdapterState<import("@soxa-ui/setup").TContextContract<import("@soxa-ui/core").IDatePicker, {
|
|
19
|
+
props: object & {} & {} & {} & {
|
|
20
|
+
aria_label?: string | undefined;
|
|
21
|
+
aria_labelledBy?: string | undefined;
|
|
22
|
+
aria_describedBy?: string | undefined;
|
|
23
|
+
} & {
|
|
24
|
+
id?: string | undefined;
|
|
25
|
+
} & {} & {} & {} & {
|
|
26
|
+
dismiss_enabled?: boolean | undefined;
|
|
27
|
+
} & {
|
|
28
|
+
hideOutside_enabled?: boolean | undefined;
|
|
29
|
+
} & {} & {} & {} & {};
|
|
30
|
+
events: object & {
|
|
31
|
+
"element:removed": () => void;
|
|
32
|
+
"element:ready": (element: Element) => void;
|
|
33
|
+
} & {} & {
|
|
34
|
+
"aria:change:label": (payload: import("@soxa-ui/core").TValuePayload<string | undefined>) => void;
|
|
35
|
+
"aria:change:labelledBy": (payload: import("@soxa-ui/core").TValuePayload<string | undefined>) => void;
|
|
36
|
+
"aria:change:describedBy": (payload: import("@soxa-ui/core").TValuePayload<string | undefined>) => void;
|
|
37
|
+
} & {
|
|
38
|
+
"action:blur": (event: FocusEvent) => void;
|
|
39
|
+
"action:click": (event: MouseEvent) => void;
|
|
40
|
+
"action:focus": (event: FocusEvent) => void;
|
|
41
|
+
"action:press": (event: MouseEvent) => void;
|
|
42
|
+
} & {
|
|
43
|
+
"change:id": (payload: import("@soxa-ui/core").TValuePayload<string | undefined>) => void;
|
|
44
|
+
} & {
|
|
45
|
+
"dismiss:change:enabled": (payload: import("@soxa-ui/core").TValuePayload<boolean>) => void;
|
|
46
|
+
"dismiss:dismiss": (event: MouseEvent | FocusEvent) => void;
|
|
47
|
+
} & {
|
|
48
|
+
"hideOutside:change:enabled": (payload: import("@soxa-ui/core").TValuePayload<boolean>) => void;
|
|
49
|
+
} & {} & {} & {} & {} & {} & {};
|
|
50
|
+
outputs: object & {} & {} & {} & {} & {} & {} & {} & {} & {
|
|
51
|
+
readonly dismiss_ownerAttribute: Record<string, string>;
|
|
52
|
+
} & {} & {} & {} & {} & {
|
|
53
|
+
readonly names_end: string;
|
|
54
|
+
readonly names_start: string;
|
|
55
|
+
readonly names_cancel: string;
|
|
56
|
+
readonly names_confirm: string;
|
|
57
|
+
};
|
|
58
|
+
}>>;
|
|
59
|
+
layer: import("../../adapter").TElevatorLayer;
|
|
60
|
+
};
|