@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,6 @@
|
|
|
1
|
+
import { Accordion as AccordionComponent } from './Accordion';
|
|
2
|
+
export * from './base.component';
|
|
3
|
+
export * from './item';
|
|
4
|
+
export declare const Accordion: typeof AccordionComponent & {
|
|
5
|
+
Item: import("react").NamedExoticComponent<import("./item").AccordionItemProps>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AccordionItem } from "./item/Item.js";
|
|
2
|
+
import { Accordion as Accordion$1 } from "./Accordion.js";
|
|
3
|
+
import { withParts } from "@soxa-ui/setup";
|
|
4
|
+
//#region src/components/accordion/index.ts
|
|
5
|
+
var Accordion = withParts(Accordion$1, { Item: AccordionItem });
|
|
6
|
+
//#endregion
|
|
7
|
+
export { Accordion };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AccordionItemProps } from './base.component';
|
|
2
|
+
/**
|
|
3
|
+
* AccordionItem — секция: заголовок `Button` и панель с набором `contentAria`.
|
|
4
|
+
* Атрибуты потребителя — заголовку: AGENTS.md (React), «Корень и `ref` потребителя».
|
|
5
|
+
*/
|
|
6
|
+
export declare const AccordionItem: import("react").NamedExoticComponent<AccordionItemProps>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { toAriaProps } from "../../../adapter/common/aria.js";
|
|
3
|
+
import { toControlAttrs, toRootForward, 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 { withRenderBoundary } from "../../../adapter/runtime/withRenderBoundary.js";
|
|
8
|
+
import { Button } from "../../button/Button.js";
|
|
9
|
+
import { Icon } from "../../icon/Icon.js";
|
|
10
|
+
import { useSetupAccordionItem } from "./setup.component.js";
|
|
11
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
//#region src/components/accordion/item/Item.tsx
|
|
13
|
+
/**
|
|
14
|
+
* AccordionItem — секция: заголовок `Button` и панель с набором `contentAria`.
|
|
15
|
+
* Атрибуты потребителя — заголовку: AGENTS.md (React), «Корень и `ref` потребителя».
|
|
16
|
+
*/
|
|
17
|
+
var AccordionItem = withRenderBoundary(function AccordionItem(props) {
|
|
18
|
+
const { ref, forwardProps, state, context, ctrl } = useSetupAccordionItem(props);
|
|
19
|
+
const toggle = useClickAction(() => context?.adapters.selection.toggle());
|
|
20
|
+
const { rendered, tag, text, view, disabled, size, variant, selected, arrowPlacement, contentAria, aria, dataset, attrs } = state;
|
|
21
|
+
if (!rendered) return null;
|
|
22
|
+
const Tag = tag;
|
|
23
|
+
const header = toControlAttrs(forwardProps);
|
|
24
|
+
const item = ctrl;
|
|
25
|
+
const arrowAt = (side, slot) => {
|
|
26
|
+
if (arrowPlacement !== side) return null;
|
|
27
|
+
const rendered = renderSlot(slot, { item });
|
|
28
|
+
return hasSlot(rendered) || arrowPlacement === side ? /* @__PURE__ */ jsx("span", {
|
|
29
|
+
className: "so-accordion-item__arrow",
|
|
30
|
+
children: hasSlot(rendered) ? rendered : /* @__PURE__ */ jsx(Icon, {
|
|
31
|
+
embedded: "accordion.arrow",
|
|
32
|
+
tag: roleIcon("arrowRight"),
|
|
33
|
+
size
|
|
34
|
+
})
|
|
35
|
+
}) : null;
|
|
36
|
+
};
|
|
37
|
+
return /* @__PURE__ */ jsxs(Tag, {
|
|
38
|
+
...toRootProps(ref, state, [dataset, attrs], toRootForward(forwardProps)),
|
|
39
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
40
|
+
embedded: "accordion.header",
|
|
41
|
+
type: "button",
|
|
42
|
+
className: "so-accordion-item__header",
|
|
43
|
+
view,
|
|
44
|
+
disabled,
|
|
45
|
+
size,
|
|
46
|
+
variant,
|
|
47
|
+
...toAriaProps(aria),
|
|
48
|
+
...header,
|
|
49
|
+
ref: toggle,
|
|
50
|
+
leading: /* @__PURE__ */ jsxs(Fragment, { children: [arrowAt("start", props["arrow-icon"]), renderSlot(props.leading, { item })] }),
|
|
51
|
+
trailing: /* @__PURE__ */ jsxs(Fragment, { children: [renderSlot(props.trailing, { item }), arrowAt("end", props["arrow-icon"])] }),
|
|
52
|
+
children: renderSlot(props.header, {
|
|
53
|
+
item,
|
|
54
|
+
text: text ?? "",
|
|
55
|
+
selected: selected ?? false
|
|
56
|
+
}) ?? text
|
|
57
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
58
|
+
className: "so-accordion-item__body",
|
|
59
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
60
|
+
className: "so-accordion-item__content",
|
|
61
|
+
...toAriaProps(contentAria),
|
|
62
|
+
children: renderSlot(props.children, { item })
|
|
63
|
+
})
|
|
64
|
+
})]
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
//#endregion
|
|
68
|
+
export { AccordionItem };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
import type { IAccordionItem } from '@soxa-ui/core';
|
|
3
|
+
import type { AccordionCollectionItemDescriptor, AccordionItemDescriptor } from '@soxa-ui/setup';
|
|
4
|
+
import type { EventProps, TDomAttributes, UseDomProps } from '../../../types';
|
|
5
|
+
/** События секции — свои и фасада. */
|
|
6
|
+
export type AccordionItemEventProps = EventProps<typeof AccordionItemDescriptor> & EventProps<typeof AccordionCollectionItemDescriptor>;
|
|
7
|
+
/** Атрибуты секции: класс и стиль — корню, остальное — заголовку. */
|
|
8
|
+
export type AccordionItemAttributes = TDomAttributes<typeof AccordionItemDescriptor, HTMLAttributes<HTMLElement>, AccordionItemEventProps>;
|
|
9
|
+
export type AccordionItemProps = UseDomProps<typeof AccordionItemDescriptor, IAccordionItem, AccordionItemEventProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AccordionItemProps } from './base.component';
|
|
2
|
+
export declare function useSetupAccordionItem(props: AccordionItemProps): {
|
|
3
|
+
context: import("@soxa-ui/core").TItemContext<import("@soxa-ui/core").IAccordionItem<import("@soxa-ui/core").IAccordionItemProps, import("@soxa-ui/core").TAccordionItemEvents>, import("@soxa-ui/core").TAccordionCollectionExtensions> | undefined;
|
|
4
|
+
ref: (el: Element | null) => void;
|
|
5
|
+
plugins: import("@soxa-ui/plugins").IPluginBundle | null;
|
|
6
|
+
ctrl: object & import("@soxa-ui/core").IAccordionItem<import("@soxa-ui/core").IAccordionItemProps, import("@soxa-ui/core").TAccordionItemEvents>;
|
|
7
|
+
root: import("../../../adapter").TRootSource;
|
|
8
|
+
forwardProps: Partial<AccordionItemProps>;
|
|
9
|
+
bindRef: (el: Element | null) => void;
|
|
10
|
+
state: import("@soxa-ui/setup").TInstanceState<object & import("@soxa-ui/core").IAccordionItem<import("@soxa-ui/core").IAccordionItemProps, import("@soxa-ui/core").TAccordionItemEvents>> & import("@soxa-ui/setup").TInstanceState<object & {} & {} & {} & {
|
|
11
|
+
aria_label?: string | undefined;
|
|
12
|
+
aria_labelledBy?: string | undefined;
|
|
13
|
+
aria_describedBy?: string | undefined;
|
|
14
|
+
} & {} & {
|
|
15
|
+
id?: string | undefined;
|
|
16
|
+
} & {}> & import("@soxa-ui/setup").TInstanceState<object & {} & {} & {} & {} & {} & {} & {}> & import("@soxa-ui/setup").TInstanceState<object & import("@soxa-ui/core").TAccordionItemCollectionFacade> & 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 { AccordionCollectionItemDescriptor, AccordionItemDescriptor, TCollectionItemExtension } from "@soxa-ui/setup";
|
|
5
|
+
//#region src/components/accordion/item/setup.component.ts
|
|
6
|
+
function useSetupAccordionItem(props) {
|
|
7
|
+
const { contexts: [adapter, item] } = useAdapterContext((create, elevator) => {
|
|
8
|
+
const adapter = create(AccordionItemDescriptor(), {
|
|
9
|
+
ctrl: props.ctrl,
|
|
10
|
+
props
|
|
11
|
+
});
|
|
12
|
+
return [adapter, create(AccordionCollectionItemDescriptor(), { 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 { useSetupAccordionItem };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AccordionProps } from './base.component';
|
|
2
|
+
export declare function useSetupAccordion(props: AccordionProps): {
|
|
3
|
+
layer: import("../../adapter").TElevatorLayer;
|
|
4
|
+
ref: (el: Element | null) => void;
|
|
5
|
+
plugins: import("@soxa-ui/plugins").IPluginBundle | null;
|
|
6
|
+
ctrl: object & import("@soxa-ui/core").IAccordion;
|
|
7
|
+
root: import("../../adapter").TRootSource;
|
|
8
|
+
forwardProps: Partial<AccordionProps>;
|
|
9
|
+
bindRef: (el: Element | null) => void;
|
|
10
|
+
state: import("@soxa-ui/setup").TInstanceState<object & import("@soxa-ui/core").IAccordion> & 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 & {} & {} & {} & {} & {} & {} & {} & {}> & import("@soxa-ui/setup").TInstanceState<object & import("@soxa-ui/core").TAccordionCollectionFacade> & object;
|
|
15
|
+
};
|
|
@@ -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 { AccordionCollectionDescriptor, AccordionDescriptor, TCollectionExtension, TDragAndDropCollectionExtension } from "@soxa-ui/setup";
|
|
5
|
+
//#region src/components/accordion/setup.component.ts
|
|
6
|
+
function useSetupAccordion(props) {
|
|
7
|
+
const { contexts: [adapter, collectionAdapter], layer } = useAdapterContext((create, elevator) => {
|
|
8
|
+
const adapter = create(AccordionDescriptor(), {
|
|
9
|
+
ctrl: props.ctrl,
|
|
10
|
+
props
|
|
11
|
+
});
|
|
12
|
+
return [adapter, create(AccordionCollectionDescriptor(), {
|
|
13
|
+
props,
|
|
14
|
+
options: {
|
|
15
|
+
owner: adapter.instance,
|
|
16
|
+
engine: props.engine
|
|
17
|
+
}
|
|
18
|
+
}, { bundle: adapter.bundle }).use(TCollectionExtension, { elevator }).use(TDragAndDropCollectionExtension, { elevator })];
|
|
19
|
+
});
|
|
20
|
+
return {
|
|
21
|
+
...useCollectionAdapter(useAdapter(adapter, props), collectionAdapter, props),
|
|
22
|
+
layer
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { useSetupAccordion };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import { useSetupButton } from './setup.component';
|
|
3
|
+
import type { ButtonProps } from './base.component';
|
|
4
|
+
/**
|
|
5
|
+
* Button — кнопка с текстом и слотами `leading`, `default`, `trailing`.
|
|
6
|
+
* Порядок атрибутов корня — AGENTS.md (React), «Корень и `ref` потребителя».
|
|
7
|
+
*/
|
|
8
|
+
export declare function Button(props: ButtonProps): ReactElement | null;
|
|
9
|
+
/** Что разметке кнопки нужно от её связки. */
|
|
10
|
+
export type TButtonBinding = Pick<ReturnType<typeof useSetupButton>, 'ref' | 'forwardProps' | 'state'>;
|
|
11
|
+
/**
|
|
12
|
+
* Разметка кнопки по её связке. Одна на Button и строку элемента коллекции
|
|
13
|
+
* (`ItemRow`): у них разная сборка, а разметка та же.
|
|
14
|
+
*/
|
|
15
|
+
export declare function renderButton({ ref, forwardProps, state }: TButtonBinding, props: ButtonProps): ReactElement | null;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { toRootProps } from "../../adapter/common/root.js";
|
|
3
|
+
import { renderSlot } from "../../adapter/common/slots.js";
|
|
4
|
+
import { useSetupButton } from "./setup.component.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/button/Button.tsx
|
|
7
|
+
/**
|
|
8
|
+
* Button — кнопка с текстом и слотами `leading`, `default`, `trailing`.
|
|
9
|
+
* Порядок атрибутов корня — AGENTS.md (React), «Корень и `ref` потребителя».
|
|
10
|
+
*/
|
|
11
|
+
function Button(props) {
|
|
12
|
+
return renderButton(useSetupButton(props), props);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Разметка кнопки по её связке. Одна на Button и строку элемента коллекции
|
|
16
|
+
* (`ItemRow`): у них разная сборка, а разметка та же.
|
|
17
|
+
*/
|
|
18
|
+
function renderButton({ ref, forwardProps, state }, props) {
|
|
19
|
+
const { rendered, tag, text, aria, dataset, attrs } = state;
|
|
20
|
+
if (!rendered) return null;
|
|
21
|
+
return /* @__PURE__ */ jsxs(tag, {
|
|
22
|
+
...toRootProps(ref, state, [
|
|
23
|
+
attrs,
|
|
24
|
+
aria,
|
|
25
|
+
dataset
|
|
26
|
+
], forwardProps),
|
|
27
|
+
children: [
|
|
28
|
+
renderSlot(props.leading),
|
|
29
|
+
/* @__PURE__ */ jsx("span", {
|
|
30
|
+
className: "so-button__text",
|
|
31
|
+
children: renderSlot(props.children, { text: text ?? "" }) ?? text
|
|
32
|
+
}),
|
|
33
|
+
renderSlot(props.trailing)
|
|
34
|
+
]
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { Button, renderButton };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ButtonHTMLAttributes } from 'react';
|
|
2
|
+
import type { IButton } from '@soxa-ui/core';
|
|
3
|
+
import type { ButtonDescriptor } from '@soxa-ui/setup';
|
|
4
|
+
import type { EventProps, UseDomProps } from '../../types';
|
|
5
|
+
export type ButtonEventProps = EventProps<typeof ButtonDescriptor>;
|
|
6
|
+
/** Атрибуты — кнопки (корень по умолчанию `<button>`), элемент — `HTMLElement`: `tag` свободен. */
|
|
7
|
+
export type ButtonProps = UseDomProps<typeof ButtonDescriptor, IButton, ButtonEventProps, ButtonHTMLAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ButtonProps } from './base.component';
|
|
2
|
+
export declare function useSetupButton(props: ButtonProps): import("../../adapter").TComponentBinding<import("@soxa-ui/setup").TContextContract<import("@soxa-ui/core").IButton, {
|
|
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
|
+
}>, ButtonProps>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useComponent } from "../../adapter/runtime/useComponent.js";
|
|
3
|
+
import { ButtonDescriptor } from "@soxa-ui/setup";
|
|
4
|
+
//#region src/components/button/setup.component.ts
|
|
5
|
+
function useSetupButton(props) {
|
|
6
|
+
return useComponent((create) => create(ButtonDescriptor(), {
|
|
7
|
+
ctrl: props.ctrl,
|
|
8
|
+
props
|
|
9
|
+
}), props);
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { useSetupButton };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { CalendarProps } from './base.component';
|
|
3
|
+
/**
|
|
4
|
+
* Calendar — grids of the shown months, paging and the footer: docs/agents/dates.md, «Даты».
|
|
5
|
+
* The popover is keyed by its instance: AGENTS.md (React), «Пересобранный инстанс и `key`».
|
|
6
|
+
*/
|
|
7
|
+
export declare function Calendar(props: CalendarProps): ReactElement | null;
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { toAriaProps } from "../../adapter/common/aria.js";
|
|
3
|
+
import { 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 { Elevate } from "../../adapter/elevator/Elevate.js";
|
|
7
|
+
import { Button } from "../button/Button.js";
|
|
8
|
+
import { Icon } from "../icon/Icon.js";
|
|
9
|
+
import { Popover } from "../popover/Popover.js";
|
|
10
|
+
import { ListBox } from "../list-box/index.js";
|
|
11
|
+
import { CalendarItem } from "./item/Item.js";
|
|
12
|
+
import { useSetupCalendar } from "./setup.component.js";
|
|
13
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
//#region src/components/calendar/Calendar.tsx
|
|
15
|
+
/** One icon for all arrows: there is no «left» role, the theme mirrors the arrow to the line start. */
|
|
16
|
+
var ARROW = roleIcon("arrowRight");
|
|
17
|
+
/** A week cell: a day is a collection item, a placeholder is an empty cell. */
|
|
18
|
+
function drawCell(props, cell) {
|
|
19
|
+
const { item } = cell;
|
|
20
|
+
if (!item) return /* @__PURE__ */ jsx("td", {
|
|
21
|
+
className: "so-calendar__filler",
|
|
22
|
+
...toAriaProps(cell.aria)
|
|
23
|
+
}, cell.date);
|
|
24
|
+
return /* @__PURE__ */ jsx(CalendarItem, {
|
|
25
|
+
ctrl: item,
|
|
26
|
+
children: relaySlot(props.item, { item })
|
|
27
|
+
}, cell.date);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The picker's card: the list comes before the header in the DOM — focus on opening lands on it.
|
|
31
|
+
* The place gets its list with the first opening of the popover; the list is keyed by its instance.
|
|
32
|
+
*/
|
|
33
|
+
function drawCard(picker, size) {
|
|
34
|
+
const { list } = picker;
|
|
35
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
36
|
+
className: "so-calendar__picker",
|
|
37
|
+
children: [list ? /* @__PURE__ */ jsx(ListBox, {
|
|
38
|
+
embedded: "calendar.picker-list",
|
|
39
|
+
className: "so-calendar__picker-list",
|
|
40
|
+
ctrl: list.ctrl,
|
|
41
|
+
engine: list.engine,
|
|
42
|
+
size,
|
|
43
|
+
indicator: "none",
|
|
44
|
+
aria_labelledBy: picker.labelledBy
|
|
45
|
+
}, list.ctrl.uid) : null, /* @__PURE__ */ jsxs("div", {
|
|
46
|
+
className: "so-calendar__picker-header",
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ jsx(Button, {
|
|
49
|
+
embedded: "calendar.picker-heading",
|
|
50
|
+
type: "button",
|
|
51
|
+
className: "so-calendar__picker-heading",
|
|
52
|
+
size,
|
|
53
|
+
...toAriaProps(picker.headingAria),
|
|
54
|
+
children: picker.heading
|
|
55
|
+
}),
|
|
56
|
+
/* @__PURE__ */ jsx(Button, {
|
|
57
|
+
embedded: "calendar.picker-prev",
|
|
58
|
+
type: "button",
|
|
59
|
+
className: "so-calendar__picker-prev",
|
|
60
|
+
size,
|
|
61
|
+
disabled: picker.prevDisabled,
|
|
62
|
+
...toAriaProps(picker.prevAria),
|
|
63
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
64
|
+
embedded: "calendar.picker-prev-icon",
|
|
65
|
+
tag: ARROW,
|
|
66
|
+
size
|
|
67
|
+
})
|
|
68
|
+
}),
|
|
69
|
+
/* @__PURE__ */ jsx(Button, {
|
|
70
|
+
embedded: "calendar.picker-next",
|
|
71
|
+
type: "button",
|
|
72
|
+
className: "so-calendar__picker-next",
|
|
73
|
+
size,
|
|
74
|
+
disabled: picker.nextDisabled,
|
|
75
|
+
...toAriaProps(picker.nextAria),
|
|
76
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
77
|
+
embedded: "calendar.picker-next-icon",
|
|
78
|
+
tag: ARROW,
|
|
79
|
+
size
|
|
80
|
+
})
|
|
81
|
+
})
|
|
82
|
+
]
|
|
83
|
+
})]
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Calendar — grids of the shown months, paging and the footer: docs/agents/dates.md, «Даты».
|
|
88
|
+
* The popover is keyed by its instance: AGENTS.md (React), «Пересобранный инстанс и `key`».
|
|
89
|
+
*/
|
|
90
|
+
function Calendar(props) {
|
|
91
|
+
const { ref, forwardProps, state, layer } = useSetupCalendar(props);
|
|
92
|
+
const { rendered, tag, attrs, aria, dataset, size, disabled, grids, pickers, weekdays, prevDisabled, nextDisabled, prevAria, nextAria } = state;
|
|
93
|
+
if (!rendered) return null;
|
|
94
|
+
const Tag = tag;
|
|
95
|
+
const title = (grid) => ({ triggerAria, triggerDataset }) => /* @__PURE__ */ jsx(Button, {
|
|
96
|
+
embedded: "calendar.title",
|
|
97
|
+
type: "button",
|
|
98
|
+
className: "so-calendar__title",
|
|
99
|
+
size,
|
|
100
|
+
disabled,
|
|
101
|
+
...toAriaProps(triggerAria),
|
|
102
|
+
...toAriaProps(triggerDataset),
|
|
103
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
104
|
+
className: "so-calendar__title-text",
|
|
105
|
+
...toAriaProps(grid.titleAria),
|
|
106
|
+
children: grid.title
|
|
107
|
+
})
|
|
108
|
+
});
|
|
109
|
+
const paging = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Button, {
|
|
110
|
+
embedded: "calendar.prev",
|
|
111
|
+
type: "button",
|
|
112
|
+
className: "so-calendar__prev",
|
|
113
|
+
size,
|
|
114
|
+
disabled: prevDisabled,
|
|
115
|
+
...toAriaProps(prevAria),
|
|
116
|
+
children: renderSlot(props["prev-icon"]) ?? /* @__PURE__ */ jsx(Icon, {
|
|
117
|
+
embedded: "calendar.prev-icon",
|
|
118
|
+
tag: ARROW,
|
|
119
|
+
size
|
|
120
|
+
})
|
|
121
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
122
|
+
embedded: "calendar.next",
|
|
123
|
+
type: "button",
|
|
124
|
+
className: "so-calendar__next",
|
|
125
|
+
size,
|
|
126
|
+
disabled: nextDisabled,
|
|
127
|
+
...toAriaProps(nextAria),
|
|
128
|
+
children: renderSlot(props["next-icon"]) ?? /* @__PURE__ */ jsx(Icon, {
|
|
129
|
+
embedded: "calendar.next-icon",
|
|
130
|
+
tag: ARROW,
|
|
131
|
+
size
|
|
132
|
+
})
|
|
133
|
+
})] });
|
|
134
|
+
const month = (grid, index) => {
|
|
135
|
+
const picker = pickers?.[index];
|
|
136
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
137
|
+
className: "so-calendar__month",
|
|
138
|
+
children: [
|
|
139
|
+
picker ? /* @__PURE__ */ jsx(Popover, {
|
|
140
|
+
embedded: "calendar.picker",
|
|
141
|
+
className: "so-calendar__heading",
|
|
142
|
+
tag: "div",
|
|
143
|
+
contained: true,
|
|
144
|
+
edge: "top",
|
|
145
|
+
ctrl: picker.popover,
|
|
146
|
+
aria_labelledBy: picker.labelledBy,
|
|
147
|
+
trigger: title(grid),
|
|
148
|
+
children: drawCard(picker, size)
|
|
149
|
+
}, picker.popover.uid) : null,
|
|
150
|
+
index === 0 ? paging : null,
|
|
151
|
+
/* @__PURE__ */ jsxs("table", {
|
|
152
|
+
className: "so-calendar__grid",
|
|
153
|
+
...toAriaProps(grid.gridAria),
|
|
154
|
+
children: [/* @__PURE__ */ jsx("thead", {
|
|
155
|
+
"aria-hidden": "true",
|
|
156
|
+
children: /* @__PURE__ */ jsx("tr", {
|
|
157
|
+
className: "so-calendar__weekdays",
|
|
158
|
+
children: weekdays?.map((weekday, column) => /* @__PURE__ */ jsx("th", {
|
|
159
|
+
className: "so-calendar__weekday",
|
|
160
|
+
children: weekday.label
|
|
161
|
+
}, column))
|
|
162
|
+
})
|
|
163
|
+
}), /* @__PURE__ */ jsx("tbody", { children: grid.weeks.map((week, place) => /* @__PURE__ */ jsx("tr", {
|
|
164
|
+
className: "so-calendar__week",
|
|
165
|
+
children: week.map((cell) => drawCell(props, cell))
|
|
166
|
+
}, place)) })]
|
|
167
|
+
})
|
|
168
|
+
]
|
|
169
|
+
}, index);
|
|
170
|
+
};
|
|
171
|
+
return /* @__PURE__ */ jsx(Tag, {
|
|
172
|
+
...toRootProps(ref, state, [
|
|
173
|
+
attrs,
|
|
174
|
+
aria,
|
|
175
|
+
dataset
|
|
176
|
+
], forwardProps),
|
|
177
|
+
children: /* @__PURE__ */ jsxs(Elevate, {
|
|
178
|
+
layer,
|
|
179
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
180
|
+
className: "so-calendar__months",
|
|
181
|
+
children: grids?.map(month)
|
|
182
|
+
}), hasSlot(props.footer) ? /* @__PURE__ */ jsx("div", {
|
|
183
|
+
className: "so-calendar__footer",
|
|
184
|
+
children: renderSlot(props.footer)
|
|
185
|
+
}) : null]
|
|
186
|
+
})
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
//#endregion
|
|
190
|
+
export { Calendar };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ICalendar } from '@soxa-ui/core';
|
|
2
|
+
import type { CalendarCollectionDescriptor, CalendarDescriptor } from '@soxa-ui/setup';
|
|
3
|
+
import type { EventProps, UseDomProps } from '../../types';
|
|
4
|
+
/** События Calendar — свои и фасада коллекции: колбэки обоих контекстов — пропсы компонента. */
|
|
5
|
+
export type CalendarEventProps = EventProps<typeof CalendarDescriptor> & EventProps<typeof CalendarCollectionDescriptor>;
|
|
6
|
+
/** Пропсы Calendar; коллекционные входы (`engine`, `mode`) несёт `ICalendarProps`. */
|
|
7
|
+
export type CalendarProps = UseDomProps<typeof CalendarDescriptor, ICalendar, CalendarEventProps>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Calendar as CalendarComponent } from './Calendar';
|
|
2
|
+
export * from './base.component';
|
|
3
|
+
export * from './item';
|
|
4
|
+
/** Основная форма — `<Calendar.Item>`; плоский `CalendarItem` работает так же. */
|
|
5
|
+
export declare const Calendar: typeof CalendarComponent & {
|
|
6
|
+
Item: import("react").NamedExoticComponent<import("./item").CalendarItemProps>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CalendarItem } from "./item/Item.js";
|
|
2
|
+
import { Calendar as Calendar$1 } from "./Calendar.js";
|
|
3
|
+
import { withParts } from "@soxa-ui/setup";
|
|
4
|
+
//#region src/components/calendar/index.ts
|
|
5
|
+
/** Основная форма — `<Calendar.Item>`; плоский `CalendarItem` работает так же. */
|
|
6
|
+
var Calendar = withParts(Calendar$1, { Item: CalendarItem });
|
|
7
|
+
//#endregion
|
|
8
|
+
export { Calendar };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { toRootProps } from "../../../adapter/common/root.js";
|
|
3
|
+
import { renderSlot } from "../../../adapter/common/slots.js";
|
|
4
|
+
import { withRenderBoundary } from "../../../adapter/runtime/withRenderBoundary.js";
|
|
5
|
+
import { useSetupCalendarItem } from "./setup.component.js";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/calendar/item/Item.tsx
|
|
8
|
+
/** CalendarItem — день календаря, корень — ячейка сетки: docs/agents/dates.md, «Даты». */
|
|
9
|
+
var CalendarItem = withRenderBoundary(function CalendarItem(props) {
|
|
10
|
+
const { ref, forwardProps, state } = useSetupCalendarItem(props);
|
|
11
|
+
const { rendered, tag, text, attrs, aria, dataset } = state;
|
|
12
|
+
if (!rendered) return null;
|
|
13
|
+
return /* @__PURE__ */ jsx(tag, {
|
|
14
|
+
...toRootProps(ref, state, [
|
|
15
|
+
attrs,
|
|
16
|
+
aria,
|
|
17
|
+
dataset
|
|
18
|
+
], forwardProps),
|
|
19
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
20
|
+
className: "so-calendar-item__day",
|
|
21
|
+
children: renderSlot(props.children, { text: text ?? "" }) ?? text
|
|
22
|
+
})
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
//#endregion
|
|
26
|
+
export { CalendarItem };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ICalendarItem } from '@soxa-ui/core';
|
|
2
|
+
import type { CalendarCollectionItemDescriptor, CalendarItemDescriptor } from '@soxa-ui/setup';
|
|
3
|
+
import type { EventProps, UseDomProps } from '../../../types';
|
|
4
|
+
/** События дня — свои (ядро и плагины) и фасада. */
|
|
5
|
+
export type CalendarItemEventProps = EventProps<typeof CalendarItemDescriptor> & EventProps<typeof CalendarCollectionItemDescriptor>;
|
|
6
|
+
/** Пропсы дня: входов нет — только `ctrl` и слот; атрибуты потребителя — ячейке. */
|
|
7
|
+
export type CalendarItemProps = UseDomProps<typeof CalendarItemDescriptor, ICalendarItem, CalendarItemEventProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CalendarItemProps } from './base.component';
|
|
2
|
+
export declare function useSetupCalendarItem(props: CalendarItemProps): import("../../../adapter").TCollectionBinding<import("../../../adapter").TBinding<import("@soxa-ui/setup").TContextContract<import("@soxa-ui/core").ICalendarItem<import("@soxa-ui/core").ICalendarItemProps, import("@soxa-ui/core").TCalendarItemEvents>, {
|
|
3
|
+
props: object & {} & {};
|
|
4
|
+
events: object & {
|
|
5
|
+
"element:removed": () => void;
|
|
6
|
+
"element:ready": (element: Element) => void;
|
|
7
|
+
} & {};
|
|
8
|
+
outputs: object & {} & {};
|
|
9
|
+
}>, CalendarItemProps>, import("@soxa-ui/setup").TContextContract<import("@soxa-ui/core").TCalendarItemCollectionFacade, {
|
|
10
|
+
props: object;
|
|
11
|
+
events: object;
|
|
12
|
+
outputs: object;
|
|
13
|
+
}>, CalendarItemProps>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useAdapter, useCollectionAdapter } from "../../../adapter/runtime/useAdapter.js";
|
|
3
|
+
import { useAdapterContext } from "../../../adapter/runtime/useAdapterContext.js";
|
|
4
|
+
import { CalendarCollectionItemDescriptor, CalendarItemDescriptor, TCollectionItemExtension } from "@soxa-ui/setup";
|
|
5
|
+
//#region src/components/calendar/item/setup.component.ts
|
|
6
|
+
function useSetupCalendarItem(props) {
|
|
7
|
+
const { contexts: [adapter, item] } = useAdapterContext((create, elevator) => {
|
|
8
|
+
const adapter = create(CalendarItemDescriptor(), {
|
|
9
|
+
ctrl: props.ctrl,
|
|
10
|
+
props
|
|
11
|
+
});
|
|
12
|
+
return [adapter, create(CalendarCollectionItemDescriptor(), { props }, { bundle: adapter.bundle }).use(TCollectionItemExtension, {
|
|
13
|
+
adapter,
|
|
14
|
+
elevator
|
|
15
|
+
})];
|
|
16
|
+
});
|
|
17
|
+
return useCollectionAdapter(useAdapter(adapter, props), item, props);
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { useSetupCalendarItem };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CalendarProps } from './base.component';
|
|
2
|
+
export declare function useSetupCalendar(props: CalendarProps): {
|
|
3
|
+
layer: import("../../adapter").TElevatorLayer;
|
|
4
|
+
ref: (el: Element | null) => void;
|
|
5
|
+
plugins: import("@soxa-ui/plugins").IPluginBundle | null;
|
|
6
|
+
ctrl: object & import("@soxa-ui/core").ICalendar;
|
|
7
|
+
root: import("../../adapter").TRootSource;
|
|
8
|
+
forwardProps: Partial<CalendarProps>;
|
|
9
|
+
bindRef: (el: Element | null) => void;
|
|
10
|
+
state: import("@soxa-ui/setup").TInstanceState<object & import("@soxa-ui/core").ICalendar> & 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 & {} & {} & {} & {} & {} & {} & {} & {} & {} & {} & {} & {}> & import("@soxa-ui/setup").TInstanceState<object & import("@soxa-ui/core").TCalendarCollectionFacade> & object;
|
|
15
|
+
};
|