onekijs-ui 0.9.2 → 0.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordion/AccordionService.d.ts +7 -0
- package/dist/components/accordion/components/AccordionComponent.d.ts +16 -0
- package/dist/components/accordion/components/AccordionContainer.d.ts +4 -0
- package/dist/components/accordion/components/AccordionPanel.d.ts +4 -0
- package/dist/components/accordion/components/AccordionPanelTitle.d.ts +4 -0
- package/dist/components/accordion/hooks/useAccordionPanel.d.ts +3 -0
- package/dist/components/accordion/hooks/useAccordionService.d.ts +5 -0
- package/dist/components/accordion/hooks/useAccordionState.d.ts +4 -0
- package/dist/components/accordion/index.d.ts +16 -0
- package/dist/components/accordion/style.d.ts +3 -0
- package/dist/components/accordion/typings.d.ts +45 -0
- package/dist/components/button/DropdownButton.d.ts +3 -0
- package/dist/components/button/SubmitButton.d.ts +4 -0
- package/dist/components/button/components/ButtonComponent.d.ts +4 -0
- package/dist/components/button/components/DropdownButtonComponent.d.ts +4 -0
- package/dist/components/button/index.d.ts +3 -3
- package/dist/components/button/style.d.ts +5 -4
- package/dist/components/button/typings.d.ts +19 -4
- package/dist/components/card/FormCard.d.ts +4 -0
- package/dist/components/card/components/CardComponent.d.ts +4 -0
- package/dist/components/card/components/CardTitle.d.ts +4 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/card/style.d.ts +3 -0
- package/dist/components/card/typings.d.ts +24 -0
- package/dist/components/checkbox/FormCheckbox.d.ts +4 -0
- package/dist/components/checkbox/components/CheckboxComponent.d.ts +4 -0
- package/dist/components/checkbox/index.d.ts +3 -0
- package/dist/components/checkbox/style.d.ts +4 -0
- package/dist/components/checkbox/typings.d.ts +14 -0
- package/dist/components/dashboard/DashboardService.d.ts +27 -0
- package/dist/components/dashboard/components/DashboardBody.d.ts +5 -0
- package/dist/components/dashboard/components/DashboardComponent.d.ts +7 -0
- package/dist/components/dashboard/components/DashboardContainer.d.ts +5 -0
- package/dist/components/dashboard/components/DashboardFooter.d.ts +2 -0
- package/dist/components/dashboard/components/DashboardHeader.d.ts +2 -0
- package/dist/components/dashboard/components/DashboardLeft.d.ts +2 -0
- package/dist/components/dashboard/components/DashboardOverlay.d.ts +6 -0
- package/dist/components/dashboard/components/DashboardRight.d.ts +2 -0
- package/dist/components/dashboard/components/DashboardToggler.d.ts +5 -0
- package/dist/components/dashboard/hoc/dashboardHorizontalPanel.d.ts +4 -0
- package/dist/components/dashboard/hoc/dashboardVerticalPanel.d.ts +4 -0
- package/dist/components/dashboard/hooks/useDashboard.d.ts +5 -0
- package/dist/components/dashboard/hooks/useDashboardService.d.ts +5 -0
- package/dist/components/dashboard/hooks/useDashboardState.d.ts +5 -0
- package/dist/components/dashboard/index.d.ts +4 -0
- package/dist/components/dashboard/typings.d.ts +96 -0
- package/dist/components/dashboard/utils/dashboardArea.d.ts +3 -0
- package/dist/components/dashboard/utils/dashboardLength.d.ts +5 -0
- package/dist/components/dropdown/components/DropdownComponent.d.ts +4 -4
- package/dist/components/dropdown/hooks/useDropdown.d.ts +5 -0
- package/dist/components/dropdown/index.d.ts +2 -3
- package/dist/components/dropdown/style.d.ts +4 -4
- package/dist/components/dropdown/typings.d.ts +24 -5
- package/dist/components/field/FieldDescription.d.ts +3 -0
- package/dist/components/field/FieldHelp.d.ts +3 -0
- package/dist/components/field/FieldLayout.d.ts +2 -0
- package/dist/components/field/components/FieldDescriptionComponent.d.ts +4 -0
- package/dist/components/field/components/FieldHelpComponent.d.ts +4 -0
- package/dist/components/field/components/FieldLayoutComponent.d.ts +4 -0
- package/dist/components/field/hooks/useFieldLayout.d.ts +4 -0
- package/dist/components/field/style.d.ts +5 -0
- package/dist/components/field/typings.d.ts +53 -0
- package/dist/components/field/util.d.ts +9 -0
- package/dist/components/grid/Col.d.ts +4 -0
- package/dist/components/grid/Row.d.ts +4 -0
- package/dist/components/grid/style.d.ts +4 -0
- package/dist/components/grid/typings.d.ts +33 -0
- package/dist/components/icon/CloseAllIcon.d.ts +4 -0
- package/dist/components/icon/CrossIcon.d.ts +3 -0
- package/dist/components/icon/FileIcon.d.ts +4 -0
- package/dist/components/icon/FolderIcon.d.ts +4 -0
- package/dist/components/icon/LoadingIcon.d.ts +4 -3
- package/dist/components/icon/MenuIcon.d.ts +4 -0
- package/dist/components/icon/RemoveIcon.d.ts +4 -0
- package/dist/components/icon/SearchIcon.d.ts +4 -0
- package/dist/components/icon/TogglerIcon.d.ts +4 -0
- package/dist/components/icon/typings.d.ts +14 -0
- package/dist/components/input/FormInput.d.ts +4 -0
- package/dist/components/input/components/InputComponent.d.ts +4 -0
- package/dist/components/input/index.d.ts +3 -0
- package/dist/components/input/style.d.ts +4 -0
- package/dist/components/input/typings.d.ts +14 -0
- package/dist/components/label/components/LabelComponent.d.ts +4 -0
- package/dist/components/label/index.d.ts +3 -0
- package/dist/components/label/style.d.ts +4 -0
- package/dist/components/label/typings.d.ts +16 -0
- package/dist/components/list/components/ArrayListComponent.d.ts +4 -0
- package/dist/components/list/components/CollectionListComponent.d.ts +4 -0
- package/dist/components/list/components/ListBodyComponent.d.ts +4 -0
- package/dist/components/list/components/ListComponent.d.ts +4 -4
- package/dist/components/list/components/ListItemComponent.d.ts +6 -4
- package/dist/components/list/components/LoadingItem.d.ts +5 -0
- package/dist/components/list/components/StandardListComponent.d.ts +4 -4
- package/dist/components/list/components/VirtualListComponent.d.ts +4 -4
- package/dist/components/list/hooks/useListController.d.ts +4 -0
- package/dist/components/list/hooks/useListService.d.ts +5 -0
- package/dist/components/list/hooks/useListState.d.ts +5 -0
- package/dist/components/list/hooks/useListView.d.ts +22 -0
- package/dist/components/list/index.d.ts +3 -3
- package/dist/components/list/style.d.ts +4 -4
- package/dist/components/list/typings.d.ts +121 -35
- package/dist/components/list/utils.d.ts +3 -4
- package/dist/components/modal/components/ModalComponent.d.ts +4 -0
- package/dist/components/modal/index.d.ts +2 -0
- package/dist/components/modal/style.d.ts +3 -0
- package/dist/components/modal/typings.d.ts +19 -0
- package/dist/components/properties/components/PropertiesComponent.d.ts +4 -0
- package/dist/components/properties/components/Property.d.ts +4 -0
- package/dist/components/properties/hooks/usePropertiesContext.d.ts +5 -0
- package/dist/components/properties/index.d.ts +3 -0
- package/dist/components/properties/style.d.ts +3 -0
- package/dist/components/properties/typings.d.ts +26 -0
- package/dist/components/resizer/ResizerService.d.ts +17 -0
- package/dist/components/resizer/components/ResizerComponent.d.ts +4 -0
- package/dist/components/resizer/components/ResizerHorizontalSplitter.d.ts +4 -0
- package/dist/components/resizer/components/ResizerVerticalSplitter.d.ts +4 -0
- package/dist/components/resizer/index.d.ts +2 -0
- package/dist/components/resizer/style.d.ts +4 -0
- package/dist/components/resizer/typings.d.ts +34 -0
- package/dist/components/select/FormSelect.d.ts +4 -0
- package/dist/components/select/SelectService.d.ts +5 -0
- package/dist/components/select/components/ArraySelectComponent.d.ts +4 -0
- package/dist/components/select/components/ControllerSelectComponent.d.ts +4 -0
- package/dist/components/select/components/SelectComponent.d.ts +4 -4
- package/dist/components/select/components/SelectIconComponent.d.ts +4 -4
- package/dist/components/select/components/SelectInputComponent.d.ts +4 -4
- package/dist/components/select/components/SelectNotFoundComponent.d.ts +4 -0
- package/dist/components/select/components/SelectOptionComponent.d.ts +6 -4
- package/dist/components/select/components/SelectTokenComponent.d.ts +4 -0
- package/dist/components/select/components/SelectTokensComponent.d.ts +4 -0
- package/dist/components/select/hooks/useSelectConfig.d.ts +4 -0
- package/dist/components/select/hooks/useSelectController.d.ts +6 -0
- package/dist/components/select/index.d.ts +3 -3
- package/dist/components/select/style.d.ts +4 -4
- package/dist/components/select/typings.d.ts +95 -37
- package/dist/components/tab/TabsService.d.ts +24 -0
- package/dist/components/tab/components/ControlledTabsComponent.d.ts +4 -0
- package/dist/components/tab/components/Tab.d.ts +4 -0
- package/dist/components/tab/components/TabTitle.d.ts +4 -0
- package/dist/components/tab/components/TabsComponent.d.ts +4 -0
- package/dist/components/tab/components/TabsContainer.d.ts +4 -0
- package/dist/components/tab/components/UncontrolledTabsComponent.d.ts +4 -0
- package/dist/components/tab/hooks/useTab.d.ts +5 -0
- package/dist/components/tab/hooks/useTabsController.d.ts +3 -0
- package/dist/components/tab/hooks/useTabsService.d.ts +5 -0
- package/dist/components/tab/hooks/useTabsState.d.ts +4 -0
- package/dist/components/tab/index.d.ts +2 -0
- package/dist/components/tab/style.d.ts +3 -0
- package/dist/components/tab/typings.d.ts +54 -0
- package/dist/components/table/FormTable.d.ts +4 -0
- package/dist/components/table/TableService.d.ts +18 -0
- package/dist/components/table/columns/useCheckboxColumn.d.ts +3 -0
- package/dist/components/table/columns/useColumn.d.ts +3 -0
- package/dist/components/table/columns/useInputColumn.d.ts +3 -0
- package/dist/components/table/columns/useLinkColumn.d.ts +3 -0
- package/dist/components/table/columns/useSelectColumn.d.ts +3 -0
- package/dist/components/table/components/ArrayTableComponent.d.ts +4 -0
- package/dist/components/table/components/ControllerTableComponent.d.ts +4 -0
- package/dist/components/table/components/FormTableComponent.d.ts +4 -0
- package/dist/components/table/components/TableBodyCellComponent.d.ts +4 -0
- package/dist/components/table/components/TableBodyComponent.d.ts +4 -0
- package/dist/components/table/components/TableBodyRowComponent.d.ts +4 -0
- package/dist/components/table/components/TableComponent.d.ts +4 -0
- package/dist/components/table/components/TableFooterCellComponent.d.ts +4 -0
- package/dist/components/table/components/TableFooterComponent.d.ts +4 -0
- package/dist/components/table/components/TableHeaderComponent.d.ts +4 -0
- package/dist/components/table/components/TableHeaderFilterComponent.d.ts +4 -0
- package/dist/components/table/components/TableHeaderTitleComponent.d.ts +5 -0
- package/dist/components/table/components/TableLoadingComponent.d.ts +3 -0
- package/dist/components/table/components/TableLoadingRowComponent.d.ts +3 -0
- package/dist/components/table/components/TableNotFoundComponent.d.ts +4 -0
- package/dist/components/table/components/TableSortComponent.d.ts +4 -0
- package/dist/components/table/components/cells/CheckboxCellComponent.d.ts +4 -0
- package/dist/components/table/components/cells/DefaultCellComponent.d.ts +4 -0
- package/dist/components/table/components/cells/ExpandedCellComponent.d.ts +4 -0
- package/dist/components/table/components/cells/InputCellComponent.d.ts +4 -0
- package/dist/components/table/components/cells/SelectCellComponent.d.ts +6 -0
- package/dist/components/table/components/filters/TableInputFilterComponent.d.ts +4 -0
- package/dist/components/table/components/hoc/linkCellComponent.d.ts +4 -0
- package/dist/components/table/hooks/useFormTableContext.d.ts +5 -0
- package/dist/components/table/hooks/useTableColumns.d.ts +3 -0
- package/dist/components/table/hooks/useTableConfig.d.ts +4 -0
- package/dist/components/table/hooks/useTableController.d.ts +5 -0
- package/dist/components/table/hooks/useTableInitialState.d.ts +3 -0
- package/dist/components/table/hooks/useTableItems.d.ts +3 -0
- package/dist/components/table/hooks/useTableService.d.ts +5 -0
- package/dist/components/table/hooks/useTableState.d.ts +4 -0
- package/dist/components/table/index.d.ts +3 -0
- package/dist/components/table/style.d.ts +3 -0
- package/dist/components/table/typings.d.ts +218 -0
- package/dist/components/table/util.d.ts +5 -0
- package/dist/components/tag/components/TagComponent.d.ts +4 -0
- package/dist/components/tag/index.d.ts +2 -0
- package/dist/components/tag/style.d.ts +3 -0
- package/dist/components/tag/typings.d.ts +16 -0
- package/dist/components/tooltip/components/TooltipComponent.d.ts +4 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tooltip/style.d.ts +4 -0
- package/dist/components/tooltip/typings.d.ts +10 -0
- package/dist/components/tree/TreeService.d.ts +23 -0
- package/dist/components/tree/components/ArrayTreeComponent.d.ts +4 -0
- package/dist/components/tree/components/ControllerTreeComponent.d.ts +4 -0
- package/dist/components/tree/components/TreeBodyComponent.d.ts +4 -0
- package/dist/components/tree/components/TreeComponent.d.ts +4 -0
- package/dist/components/tree/components/TreeItemComponent.d.ts +6 -0
- package/dist/components/tree/components/TreeListComponent.d.ts +4 -0
- package/dist/components/tree/components/VirtualTreeBodyComponent.d.ts +4 -0
- package/dist/components/tree/components/VirtualTreeListComponent.d.ts +4 -0
- package/dist/components/tree/hooks/useTreeConfig.d.ts +4 -0
- package/dist/components/tree/hooks/useTreeController.d.ts +5 -0
- package/dist/components/tree/hooks/useTreeInitialState.d.ts +5 -0
- package/dist/components/tree/hooks/useTreeItems.d.ts +3 -0
- package/dist/components/tree/hooks/useTreeService.d.ts +5 -0
- package/dist/components/tree/hooks/useTreeState.d.ts +4 -0
- package/dist/components/tree/index.d.ts +3 -0
- package/dist/components/tree/style.d.ts +3 -0
- package/dist/components/tree/typings.d.ts +87 -0
- package/dist/components/wizard/WizardModal.d.ts +2 -0
- package/dist/components/wizard/WizardService.d.ts +17 -0
- package/dist/components/wizard/components/ControlledWizardComponent.d.ts +4 -0
- package/dist/components/wizard/components/Step.d.ts +4 -0
- package/dist/components/wizard/components/StepTitle.d.ts +4 -0
- package/dist/components/wizard/components/UncontrolledWizardComponent.d.ts +4 -0
- package/dist/components/wizard/components/WizardComponent.d.ts +4 -0
- package/dist/components/wizard/components/WizardContainer.d.ts +4 -0
- package/dist/components/wizard/components/WizardModalComponent.d.ts +4 -0
- package/dist/components/wizard/hooks/useStep.d.ts +5 -0
- package/dist/components/wizard/hooks/useWizardController.d.ts +3 -0
- package/dist/components/wizard/hooks/useWizardService.d.ts +5 -0
- package/dist/components/wizard/hooks/useWizardState.d.ts +4 -0
- package/dist/components/wizard/index.d.ts +2 -0
- package/dist/components/wizard/style.d.ts +4 -0
- package/dist/components/wizard/typings.d.ts +41 -0
- package/dist/index.d.ts +167 -33
- package/dist/index.js +9945 -5
- package/dist/index.js.map +1 -0
- package/dist/index.module.js +9546 -0
- package/dist/index.module.js.map +1 -0
- package/dist/styles/alignment.d.ts +13 -13
- package/dist/styles/animation.d.ts +10 -9
- package/dist/styles/background.d.ts +11 -11
- package/dist/styles/border.d.ts +39 -39
- package/dist/styles/display.d.ts +6 -5
- package/dist/styles/effects.d.ts +2 -2
- package/dist/styles/flex.d.ts +9 -9
- package/dist/styles/fragmentation.d.ts +6 -6
- package/dist/styles/grid.d.ts +28 -28
- package/dist/styles/icon.d.ts +4 -0
- package/dist/styles/image.d.ts +5 -5
- package/dist/styles/interactivity.d.ts +16 -16
- package/dist/styles/list.d.ts +5 -5
- package/dist/styles/overflow.d.ts +6 -6
- package/dist/styles/position.d.ts +10 -9
- package/dist/styles/size.d.ts +12 -13
- package/dist/styles/spacing.d.ts +16 -16
- package/dist/styles/svg.d.ts +5 -4
- package/dist/styles/table.d.ts +8 -8
- package/dist/styles/transform.d.ts +8 -8
- package/dist/styles/transition.d.ts +5 -5
- package/dist/styles/typings.d.ts +528 -20
- package/dist/styles/typography.d.ts +49 -49
- package/dist/theme/base.d.ts +4 -0
- package/dist/theme/tailwind.d.ts +5 -0
- package/dist/utils/color.d.ts +10 -7
- package/dist/utils/dom.d.ts +9 -0
- package/dist/utils/event.d.ts +2 -1
- package/dist/utils/formatter.d.ts +7 -7
- package/dist/utils/popper.d.ts +4 -4
- package/dist/utils/size.d.ts +3 -0
- package/dist/utils/style.d.ts +9 -7
- package/package.json +36 -24
- package/src/components/accordion/AccordionService.ts +36 -0
- package/src/components/accordion/components/AccordionComponent.tsx +37 -0
- package/src/components/accordion/components/AccordionContainer.tsx +11 -0
- package/src/components/accordion/components/AccordionPanel.tsx +74 -0
- package/src/components/accordion/components/AccordionPanelTitle.tsx +14 -0
- package/src/components/accordion/hooks/useAccordionPanel.ts +19 -0
- package/src/components/accordion/hooks/useAccordionService.ts +11 -0
- package/src/components/accordion/hooks/useAccordionState.ts +7 -0
- package/src/components/accordion/index.ts +23 -0
- package/src/components/accordion/style.ts +72 -0
- package/src/components/accordion/typings.ts +50 -0
- package/src/components/button/DropdownButton.tsx +9 -0
- package/src/components/button/SubmitButton.tsx +58 -0
- package/src/components/button/components/ButtonComponent.tsx +24 -0
- package/src/components/button/components/DropdownButtonComponent.tsx +82 -0
- package/src/components/button/index.tsx +1 -1
- package/src/components/button/style.ts +84 -8
- package/src/components/button/typings.ts +19 -2
- package/src/components/card/FormCard.tsx +24 -0
- package/src/components/card/components/CardComponent.tsx +83 -0
- package/src/components/card/components/CardTitle.tsx +14 -0
- package/src/components/card/index.tsx +9 -0
- package/src/components/card/style.ts +68 -0
- package/src/components/card/typings.ts +28 -0
- package/src/components/checkbox/FormCheckbox.tsx +26 -0
- package/src/components/checkbox/components/CheckboxComponent.tsx +42 -0
- package/src/components/checkbox/index.tsx +9 -0
- package/src/components/checkbox/style.ts +103 -0
- package/src/components/checkbox/typings.ts +18 -0
- package/src/components/dashboard/DashboardService.ts +412 -0
- package/src/components/dashboard/components/DashboardBody.tsx +138 -0
- package/src/components/dashboard/components/DashboardComponent.tsx +36 -0
- package/src/components/dashboard/components/DashboardContainer.tsx +64 -0
- package/src/components/dashboard/components/DashboardFooter.tsx +4 -0
- package/src/components/dashboard/components/DashboardHeader.tsx +4 -0
- package/src/components/dashboard/components/DashboardLeft.tsx +4 -0
- package/src/components/dashboard/components/DashboardOverlay.tsx +29 -0
- package/src/components/dashboard/components/DashboardRight.tsx +4 -0
- package/src/components/dashboard/components/DashboardToggler.tsx +17 -0
- package/src/components/dashboard/hoc/dashboardHorizontalPanel.tsx +145 -0
- package/src/components/dashboard/hoc/dashboardVerticalPanel.tsx +148 -0
- package/src/components/dashboard/hooks/useDashboard.tsx +21 -0
- package/src/components/dashboard/hooks/useDashboardService.ts +11 -0
- package/src/components/dashboard/hooks/useDashboardState.ts +11 -0
- package/src/components/dashboard/index.tsx +13 -0
- package/src/components/dashboard/typings.ts +124 -0
- package/src/components/dashboard/utils/dashboardArea.ts +27 -0
- package/src/components/dashboard/utils/dashboardLength.ts +42 -0
- package/src/components/dropdown/components/DropdownComponent.tsx +201 -23
- package/src/components/dropdown/hooks/useDropdown.tsx +21 -0
- package/src/components/dropdown/style.ts +10 -28
- package/src/components/dropdown/typings.ts +26 -4
- package/src/components/field/FieldDescription.tsx +9 -0
- package/src/components/field/FieldHelp.tsx +9 -0
- package/src/components/field/FieldLayout.tsx +9 -0
- package/src/components/field/components/FieldDescriptionComponent.tsx +14 -0
- package/src/components/field/components/FieldHelpComponent.tsx +22 -0
- package/src/components/field/components/FieldLayoutComponent.tsx +174 -0
- package/src/components/field/hooks/useFieldLayout.ts +36 -0
- package/src/components/field/style.ts +59 -0
- package/src/components/field/typings.ts +67 -0
- package/src/components/field/util.ts +47 -0
- package/src/components/grid/Col.tsx +33 -0
- package/src/components/grid/Row.tsx +35 -0
- package/src/components/grid/style.ts +93 -0
- package/src/components/grid/typings.ts +35 -0
- package/src/components/icon/CloseAllIcon.tsx +38 -0
- package/src/components/icon/CrossIcon.tsx +30 -0
- package/src/components/icon/FileIcon.tsx +36 -0
- package/src/components/icon/FolderIcon.tsx +36 -0
- package/src/components/icon/LoadingIcon.tsx +26 -23
- package/src/components/icon/MenuIcon.tsx +34 -0
- package/src/components/icon/RemoveIcon.tsx +36 -0
- package/src/components/icon/SearchIcon.tsx +38 -0
- package/src/components/icon/TogglerIcon.tsx +126 -0
- package/src/components/icon/typings.ts +15 -0
- package/src/components/input/FormInput.tsx +26 -0
- package/src/components/input/components/InputComponent.tsx +46 -0
- package/src/components/input/index.tsx +9 -0
- package/src/components/input/style.ts +85 -0
- package/src/components/input/typings.ts +17 -0
- package/src/components/label/components/LabelComponent.tsx +39 -0
- package/src/components/label/index.tsx +9 -0
- package/src/components/label/style.ts +64 -0
- package/src/components/label/typings.ts +17 -0
- package/src/components/list/components/ArrayListComponent.tsx +11 -0
- package/src/components/list/components/CollectionListComponent.tsx +77 -0
- package/src/components/list/components/ListBodyComponent.tsx +250 -0
- package/src/components/list/components/ListComponent.tsx +11 -25
- package/src/components/list/components/ListItemComponent.tsx +16 -4
- package/src/components/list/components/LoadingItem.tsx +24 -0
- package/src/components/list/components/StandardListComponent.tsx +23 -21
- package/src/components/list/components/VirtualListComponent.tsx +93 -110
- package/src/components/list/hooks/useListController.ts +19 -0
- package/src/components/list/hooks/useListService.ts +15 -0
- package/src/components/list/hooks/useListState.ts +10 -0
- package/src/components/list/hooks/useListView.tsx +103 -0
- package/src/components/list/typings.ts +162 -24
- package/src/components/list/utils.ts +17 -55
- package/src/components/modal/components/ModalComponent.tsx +132 -0
- package/src/components/modal/index.tsx +9 -0
- package/src/components/modal/style.ts +135 -0
- package/src/components/modal/typings.ts +20 -0
- package/src/components/properties/components/PropertiesComponent.tsx +44 -0
- package/src/components/properties/components/Property.tsx +40 -0
- package/src/components/properties/hooks/usePropertiesContext.ts +10 -0
- package/src/components/properties/index.tsx +9 -0
- package/src/components/properties/style.ts +17 -0
- package/src/components/properties/typings.ts +30 -0
- package/src/components/resizer/ResizerService.ts +96 -0
- package/src/components/resizer/components/ResizerComponent.tsx +28 -0
- package/src/components/resizer/components/ResizerHorizontalSplitter.tsx +38 -0
- package/src/components/resizer/components/ResizerVerticalSplitter.tsx +37 -0
- package/src/components/resizer/index.tsx +9 -0
- package/src/components/resizer/style.ts +51 -0
- package/src/components/resizer/typings.ts +40 -0
- package/src/components/select/FormSelect.tsx +26 -0
- package/src/components/select/SelectService.ts +9 -0
- package/src/components/select/components/ArraySelectComponent.tsx +11 -0
- package/src/components/select/components/ControllerSelectComponent.tsx +441 -0
- package/src/components/select/components/SelectComponent.tsx +13 -121
- package/src/components/select/components/SelectIconComponent.tsx +4 -4
- package/src/components/select/components/SelectInputComponent.tsx +220 -76
- package/src/components/select/components/SelectNotFoundComponent.tsx +14 -0
- package/src/components/select/components/SelectOptionComponent.tsx +54 -20
- package/src/components/select/components/SelectTokenComponent.tsx +25 -0
- package/src/components/select/components/SelectTokensComponent.tsx +50 -0
- package/src/components/select/hooks/useSelectConfig.ts +7 -0
- package/src/components/select/hooks/useSelectController.ts +21 -0
- package/src/components/select/index.tsx +0 -89
- package/src/components/select/style.ts +336 -47
- package/src/components/select/typings.ts +130 -24
- package/src/components/tab/TabsService.ts +192 -0
- package/src/components/tab/components/ControlledTabsComponent.tsx +18 -0
- package/src/components/tab/components/Tab.tsx +55 -0
- package/src/components/tab/components/TabTitle.tsx +18 -0
- package/src/components/tab/components/TabsComponent.tsx +15 -0
- package/src/components/tab/components/TabsContainer.tsx +36 -0
- package/src/components/tab/components/UncontrolledTabsComponent.tsx +13 -0
- package/src/components/tab/hooks/useTab.ts +18 -0
- package/src/components/tab/hooks/useTabsController.ts +15 -0
- package/src/components/tab/hooks/useTabsService.ts +11 -0
- package/src/components/tab/hooks/useTabsState.ts +7 -0
- package/src/components/tab/index.tsx +9 -0
- package/src/components/tab/style.ts +78 -0
- package/src/components/tab/typings.ts +59 -0
- package/src/components/table/FormTable.tsx +38 -0
- package/src/components/table/TableService.ts +123 -0
- package/src/components/table/columns/useCheckboxColumn.ts +24 -0
- package/src/components/table/columns/useColumn.ts +23 -0
- package/src/components/table/columns/useInputColumn.ts +24 -0
- package/src/components/table/columns/useLinkColumn.ts +19 -0
- package/src/components/table/columns/useSelectColumn.ts +26 -0
- package/src/components/table/components/ArrayTableComponent.tsx +14 -0
- package/src/components/table/components/ControllerTableComponent.tsx +167 -0
- package/src/components/table/components/FormTableComponent.tsx +143 -0
- package/src/components/table/components/TableBodyCellComponent.tsx +36 -0
- package/src/components/table/components/TableBodyComponent.tsx +96 -0
- package/src/components/table/components/TableBodyRowComponent.tsx +125 -0
- package/src/components/table/components/TableComponent.tsx +17 -0
- package/src/components/table/components/TableFooterCellComponent.tsx +28 -0
- package/src/components/table/components/TableFooterComponent.tsx +34 -0
- package/src/components/table/components/TableHeaderComponent.tsx +81 -0
- package/src/components/table/components/TableHeaderFilterComponent.tsx +31 -0
- package/src/components/table/components/TableHeaderTitleComponent.tsx +62 -0
- package/src/components/table/components/TableLoadingComponent.tsx +18 -0
- package/src/components/table/components/TableLoadingRowComponent.tsx +21 -0
- package/src/components/table/components/TableNotFoundComponent.tsx +14 -0
- package/src/components/table/components/TableSortComponent.tsx +29 -0
- package/src/components/table/components/cells/CheckboxCellComponent.tsx +42 -0
- package/src/components/table/components/cells/DefaultCellComponent.tsx +9 -0
- package/src/components/table/components/cells/ExpandedCellComponent.tsx +16 -0
- package/src/components/table/components/cells/InputCellComponent.tsx +27 -0
- package/src/components/table/components/cells/SelectCellComponent.tsx +41 -0
- package/src/components/table/components/filters/TableInputFilterComponent.tsx +134 -0
- package/src/components/table/components/hoc/linkCellComponent.tsx +15 -0
- package/src/components/table/hooks/useFormTableContext.ts +10 -0
- package/src/components/table/hooks/useTableColumns.ts +9 -0
- package/src/components/table/hooks/useTableConfig.ts +7 -0
- package/src/components/table/hooks/useTableController.ts +26 -0
- package/src/components/table/hooks/useTableInitialState.ts +22 -0
- package/src/components/table/hooks/useTableItems.ts +9 -0
- package/src/components/table/hooks/useTableService.ts +10 -0
- package/src/components/table/hooks/useTableState.ts +7 -0
- package/src/components/table/index.tsx +9 -0
- package/src/components/table/style.ts +248 -0
- package/src/components/table/typings.ts +322 -0
- package/src/components/table/util.ts +52 -0
- package/src/components/tag/components/TagComponent.tsx +15 -0
- package/src/components/tag/index.tsx +9 -0
- package/src/components/tag/style.ts +62 -0
- package/src/components/tag/typings.ts +17 -0
- package/src/components/tooltip/components/TooltipComponent.tsx +38 -0
- package/src/components/tooltip/index.tsx +9 -0
- package/src/components/tooltip/style.ts +153 -0
- package/src/components/tooltip/typings.ts +10 -0
- package/src/components/tree/TreeService.ts +392 -0
- package/src/components/tree/components/ArrayTreeComponent.tsx +14 -0
- package/src/components/tree/components/ControllerTreeComponent.tsx +72 -0
- package/src/components/tree/components/TreeBodyComponent.tsx +25 -0
- package/src/components/tree/components/TreeComponent.tsx +17 -0
- package/src/components/tree/components/TreeItemComponent.tsx +100 -0
- package/src/components/tree/components/TreeListComponent.tsx +198 -0
- package/src/components/tree/components/VirtualTreeBodyComponent.tsx +34 -0
- package/src/components/tree/components/VirtualTreeListComponent.tsx +287 -0
- package/src/components/tree/hooks/useTreeConfig.ts +7 -0
- package/src/components/tree/hooks/useTreeController.ts +33 -0
- package/src/components/tree/hooks/useTreeInitialState.ts +12 -0
- package/src/components/tree/hooks/useTreeItems.ts +9 -0
- package/src/components/tree/hooks/useTreeService.ts +10 -0
- package/src/components/tree/hooks/useTreeState.ts +7 -0
- package/src/components/tree/index.tsx +9 -0
- package/src/components/tree/style.ts +57 -0
- package/src/components/tree/typings.ts +126 -0
- package/src/components/wizard/WizardModal.ts +9 -0
- package/src/components/wizard/WizardService.ts +123 -0
- package/src/components/wizard/components/ControlledWizardComponent.tsx +22 -0
- package/src/components/wizard/components/Step.tsx +82 -0
- package/src/components/wizard/components/StepTitle.tsx +26 -0
- package/src/components/wizard/components/UncontrolledWizardComponent.tsx +13 -0
- package/src/components/wizard/components/WizardComponent.tsx +15 -0
- package/src/components/wizard/components/WizardContainer.tsx +134 -0
- package/src/components/wizard/components/WizardModalComponent.tsx +15 -0
- package/src/components/wizard/hooks/useStep.ts +18 -0
- package/src/components/wizard/hooks/useWizardController.ts +27 -0
- package/src/components/wizard/hooks/useWizardService.ts +11 -0
- package/src/components/wizard/hooks/useWizardState.ts +7 -0
- package/src/components/wizard/index.tsx +9 -0
- package/src/components/wizard/style.ts +159 -0
- package/src/components/wizard/typings.ts +53 -0
- package/src/fonts.d.ts +1 -0
- package/src/index.ts +269 -9
- package/src/styles/border.ts +8 -11
- package/src/styles/flex.ts +3 -3
- package/src/styles/icon.ts +14 -0
- package/src/styles/position.ts +13 -2
- package/src/styles/size.ts +19 -13
- package/src/styles/svg.ts +4 -3
- package/src/styles/typings.ts +587 -63
- package/src/theme/base.tsx +507 -0
- package/src/theme/tailwind.tsx +112 -0
- package/src/utils/color.ts +35 -1
- package/src/utils/dom.ts +32 -0
- package/src/utils/event.ts +25 -4
- package/src/utils/formatter.ts +7 -10
- package/src/utils/popper.ts +1 -1
- package/src/utils/size.ts +12 -0
- package/src/utils/style.ts +6 -9
- package/src/vendor/reactVirtual.d.ts +76 -0
- package/src/vendor/reactVirtual.js +463 -0
- package/src/vendor/useIsomorphicLayoutEffect.js +3 -0
- package/src/vendor/useRect.js +49 -0
- package/CHANGELOG.md +0 -136
- package/dist/__tests__/mocks/handlers.d.ts +0 -1
- package/dist/__tests__/mocks/responses.d.ts +0 -4
- package/dist/__tests__/mocks/server.d.ts +0 -7
- package/dist/__tests__/setup.d.ts +0 -1
- package/dist/__tests__/setupTests.d.ts +0 -1
- package/dist/__tests__/utils/timeout.d.ts +0 -4
- package/dist/components/button/component.d.ts +0 -4
- package/dist/components/select/components/SelectOptionsComponent.d.ts +0 -4
- package/dist/onekijs-ui.cjs.development.js +0 -2115
- package/dist/onekijs-ui.cjs.development.js.map +0 -1
- package/dist/onekijs-ui.cjs.production.min.js +0 -2
- package/dist/onekijs-ui.cjs.production.min.js.map +0 -1
- package/dist/onekijs-ui.esm.js +0 -1853
- package/dist/onekijs-ui.esm.js.map +0 -1
- package/dist/styles/theme.d.ts +0 -2
- package/jest.config.js +0 -188
- package/postcss.config.js +0 -3
- package/src/__tests__/mocks/handlers.ts +0 -60
- package/src/__tests__/mocks/responses.ts +0 -7
- package/src/__tests__/mocks/server.ts +0 -4
- package/src/__tests__/setup.ts +0 -1
- package/src/__tests__/setupTests.ts +0 -12
- package/src/__tests__/utils/timeout.ts +0 -27
- package/src/components/button/component.tsx +0 -8
- package/src/components/select/components/SelectOptionsComponent.tsx +0 -14
- package/src/styles/index.css +0 -5
- package/src/styles/tailwind.css +0 -86923
- package/src/styles/theme.ts +0 -274
- package/src/utils/query.ts.old +0 -148
- package/tailwind.config.js +0 -8
- package/tsconfig.json +0 -37
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FCC } from 'onekijs-framework';
|
|
2
|
+
import { Palette, Theme, ThemeProps } from '../styles/typings';
|
|
3
|
+
export declare const tailwindPalette: Palette;
|
|
4
|
+
export declare const tailwindTheme: (customTheme?: Partial<Theme>) => Theme;
|
|
5
|
+
export declare const TailwindTheme: FCC<ThemeProps>;
|
package/dist/utils/color.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
export declare const darken: (color: string, gap?: number, newColorValue?: string) => string;
|
|
2
|
+
export declare const deriveColor: (color: string, gap: number | undefined, dark: boolean, newColorValue?: string) => string;
|
|
3
|
+
export declare const lighten: (color: string, gap: number, newColorValue?: string) => string;
|
|
4
|
+
export declare const hexToRgb: (hex: string) => {
|
|
5
|
+
r: number;
|
|
6
|
+
g: number;
|
|
7
|
+
b: number;
|
|
8
|
+
} | null;
|
|
9
|
+
export declare const rgbToHex: (r: number, g: number, b: number) => string;
|
|
10
|
+
export declare const applyOpacity: (color: string, opacity: number | string) => string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CursorProperty } from 'csstype';
|
|
2
|
+
export declare const clearSelection: () => void;
|
|
3
|
+
export declare const forceCursor: (cursor?: CursorProperty) => void;
|
|
4
|
+
export declare const getTranslateXY: (element: Element) => {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const markBodyAsUnselectable: () => void;
|
|
9
|
+
export declare const markBodyAsSelectable: () => void;
|
package/dist/utils/event.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export declare const useClickOutside: (ref: React.MutableRefObject<HTMLElement
|
|
1
|
+
export declare const useClickOutside: (ref: React.MutableRefObject<HTMLElement | null>, onClickOutside: (e: any) => void) => void;
|
|
2
|
+
export declare const useFocusOutside: (ref: React.MutableRefObject<HTMLElement | null>, onFocusOutside: (e: FocusEvent) => void) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AnonymousObject } from 'onekijs-
|
|
2
|
-
import { Formatter } from '../styles/typings';
|
|
3
|
-
export declare const booleanFormatter: Formatter<boolean>;
|
|
4
|
-
export declare const themeFormatter: (category: string) => Formatter<string | number>;
|
|
5
|
-
export declare const colorFormatter: (key: string, opacityKey?: string
|
|
6
|
-
export declare const enumFormatter: <T>(values: AnonymousObject) => Formatter<T>;
|
|
7
|
-
export declare const pxFormatter: Formatter<string | number>;
|
|
1
|
+
import { AnonymousObject } from 'onekijs-framework';
|
|
2
|
+
import { Formatter } from '../styles/typings';
|
|
3
|
+
export declare const booleanFormatter: Formatter<boolean>;
|
|
4
|
+
export declare const themeFormatter: (category: string) => Formatter<string | number>;
|
|
5
|
+
export declare const colorFormatter: (key: string, opacityKey?: string) => Formatter<string>;
|
|
6
|
+
export declare const enumFormatter: <T>(values: AnonymousObject) => Formatter<T>;
|
|
7
|
+
export declare const pxFormatter: Formatter<string | number>;
|
package/dist/utils/popper.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Modifier } from '@popperjs/core';
|
|
2
|
-
export declare const sameWidthPopperModifier: Partial<Modifier<string, Record<string, unknown>>>;
|
|
3
|
-
export declare const minWidthPopperModifier: Partial<Modifier<string, Record<string, unknown>>>;
|
|
4
|
-
export declare const maxWidthPopperModifier: Partial<Modifier<string, Record<string, unknown>>>;
|
|
1
|
+
import { Modifier } from '@popperjs/core';
|
|
2
|
+
export declare const sameWidthPopperModifier: Partial<Modifier<string, Record<string, unknown>>>;
|
|
3
|
+
export declare const minWidthPopperModifier: Partial<Modifier<string, Record<string, unknown>>>;
|
|
4
|
+
export declare const maxWidthPopperModifier: Partial<Modifier<string, Record<string, unknown>>>;
|
package/dist/utils/style.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { AnonymousObject } from 'onekijs-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
1
|
+
import { AnonymousObject } from 'onekijs-framework';
|
|
2
|
+
import { CSSProperties } from 'react';
|
|
3
|
+
import { FlattenInterpolation, ThemeProps } from 'styled-components';
|
|
4
|
+
import { CssProperty, Formatter } from '../styles/typings';
|
|
5
|
+
export declare const toCss: <T>(property: string | null, formatter: Formatter<T> | undefined, value: T, variants: AnonymousObject) => FlattenInterpolation<ThemeProps<any>>;
|
|
6
|
+
export declare const cssProperty: <T>(property: string | null, formatter?: Formatter<T> | undefined) => CssProperty<T>;
|
|
7
|
+
export declare const preflight: () => FlattenInterpolation<ThemeProps<any>>;
|
|
8
|
+
export declare const addClassname: (classname: string, existing?: string, after?: boolean) => string;
|
|
9
|
+
export declare const addStyle: (style: CSSProperties, existing?: CSSProperties) => CSSProperties;
|
package/package.json
CHANGED
|
@@ -1,44 +1,56 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "onekijs-ui",
|
|
3
|
-
"version": "0.9.2",
|
|
4
3
|
"private": false,
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"repository": "oneki/onekijs",
|
|
4
|
+
"version": "0.15.2",
|
|
5
|
+
"description": "Opiniated React framework built on top of Next.js",
|
|
6
|
+
"source": "src/index.ts",
|
|
9
7
|
"main": "dist/index.js",
|
|
10
8
|
"typings": "dist/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"src"
|
|
12
|
+
],
|
|
11
13
|
"engines": {
|
|
12
|
-
"node": ">=10"
|
|
13
|
-
"npm": ">=5"
|
|
14
|
+
"node": ">=10"
|
|
14
15
|
},
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"prepare": "tsdx build"
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"import": "./dist/index.module.js",
|
|
19
|
+
"require": "./dist/index.js"
|
|
20
|
+
}
|
|
21
21
|
},
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
"module": "dist/index.module.js",
|
|
23
|
+
"unpkg": "dist/index.umd.js",
|
|
24
|
+
"scripts": {
|
|
25
|
+
"clean": "rimraf dist",
|
|
26
|
+
"build": "rimraf dist && rollup --config rollup.config.js",
|
|
27
|
+
"start": "rollup -w --config rollup.config.js"
|
|
25
28
|
},
|
|
29
|
+
"author": "Oneki",
|
|
30
|
+
"license": "MIT",
|
|
26
31
|
"dependencies": {
|
|
32
|
+
"@clr/city": "^1.1.0",
|
|
27
33
|
"@popperjs/core": "^2.4.4",
|
|
28
|
-
"onekijs-
|
|
34
|
+
"onekijs-framework": "^0.15.2",
|
|
35
|
+
"react-icons": "^4.2.0",
|
|
29
36
|
"react-popper": "^2.2.3",
|
|
30
|
-
"react-
|
|
31
|
-
"react-virtual": "^2.
|
|
37
|
+
"react-popper-tooltip": "^4.2.0",
|
|
38
|
+
"react-virtual": "^2.10.0",
|
|
32
39
|
"react-virtualized-auto-sizer": "^1.0.2",
|
|
33
40
|
"react-window": "^1.8.5",
|
|
34
41
|
"react-window-infinite-loader": "^1.0.5",
|
|
35
|
-
"styled-components": "^5.
|
|
42
|
+
"styled-components": "^5.3.5"
|
|
36
43
|
},
|
|
37
|
-
"sideEffects": false,
|
|
38
44
|
"devDependencies": {
|
|
39
|
-
"@types/react-transition-group": "^4.4.0",
|
|
40
45
|
"@types/react-virtualized-auto-sizer": "^1.0.0",
|
|
41
|
-
"@types/react-window": "^1.8.2"
|
|
46
|
+
"@types/react-window": "^1.8.2",
|
|
47
|
+
"microbundle": "^0.13.3",
|
|
48
|
+
"rollup": "^2.77.3"
|
|
49
|
+
},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"react": ">=18",
|
|
52
|
+
"react-dom": ">=18"
|
|
42
53
|
},
|
|
43
|
-
"
|
|
54
|
+
"sideEffects": false,
|
|
55
|
+
"gitHead": "52e896d4a85be300f6d0a75b8b08f0aefefb416b"
|
|
44
56
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { DefaultService, reducer, service } from 'onekijs-framework';
|
|
2
|
+
import { AccordionState } from './typings';
|
|
3
|
+
|
|
4
|
+
@service
|
|
5
|
+
export class AccordionService extends DefaultService<AccordionState> {
|
|
6
|
+
@reducer
|
|
7
|
+
initPanel(uid: string, initialActive = false): void {
|
|
8
|
+
if (this.state.panels[uid] === undefined) {
|
|
9
|
+
this.state.panels[uid] = {
|
|
10
|
+
uid,
|
|
11
|
+
active: initialActive,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@reducer
|
|
17
|
+
collapse(uid: string): void {
|
|
18
|
+
const panel = this.state.panels[uid];
|
|
19
|
+
if (panel) {
|
|
20
|
+
panel.active = false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@reducer
|
|
25
|
+
expand(uid: string): void {
|
|
26
|
+
const panel = this.state.panels[uid];
|
|
27
|
+
if (panel) {
|
|
28
|
+
if (!this.state.multiActive) {
|
|
29
|
+
Object.keys(this.state.panels).forEach((uid) => {
|
|
30
|
+
this.state.panels[uid].active = false;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
panel.active = true;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { FCC, useService } from 'onekijs-framework';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { AccordionService } from '../AccordionService';
|
|
4
|
+
import { AccordionServiceContext } from '../hooks/useAccordionService';
|
|
5
|
+
import { AccordionStateContext } from '../hooks/useAccordionState';
|
|
6
|
+
import { AccordionProps, AccordionState } from '../typings';
|
|
7
|
+
import AccordionContainer from './AccordionContainer';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* This is the comment for AccordionComponent 2
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <AccordionComponent multiActive="true" />
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @group Accordion
|
|
18
|
+
* @category Components
|
|
19
|
+
* @remarks #notStyled#
|
|
20
|
+
*/
|
|
21
|
+
const AccordionComponent: FCC<AccordionProps> = ({ Component = AccordionContainer, ...props }) => {
|
|
22
|
+
const [state, service] = useService(AccordionService, {
|
|
23
|
+
multiActive: props.multiActive,
|
|
24
|
+
panels: {},
|
|
25
|
+
animate: props.animate ?? 150,
|
|
26
|
+
} as AccordionState);
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<AccordionServiceContext.Provider value={service}>
|
|
30
|
+
<AccordionStateContext.Provider value={state}>
|
|
31
|
+
<Component {...props} />
|
|
32
|
+
</AccordionStateContext.Provider>
|
|
33
|
+
</AccordionServiceContext.Provider>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default AccordionComponent;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FCC } from 'onekijs-framework';
|
|
2
|
+
import { AccordionProps } from '../typings';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { addClassname } from '../../../utils/style';
|
|
5
|
+
|
|
6
|
+
const AccordionContainer: FCC<Omit<AccordionProps, 'Component'>> = ({ className, children }) => {
|
|
7
|
+
const classNames = addClassname('o-accordion-container', className);
|
|
8
|
+
return <div className={classNames}>{children}</div>;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default AccordionContainer;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { FCC } from 'onekijs-framework';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { CSSTransition } from 'react-transition-group';
|
|
4
|
+
import useAccordionPanel from '../hooks/useAccordionPanel';
|
|
5
|
+
import useAccordionService from '../hooks/useAccordionService';
|
|
6
|
+
import { useAccordionState } from '../hooks/useAccordionState';
|
|
7
|
+
import { AccordionPanelProps } from '../typings';
|
|
8
|
+
import AccordionPanelTitle from './AccordionPanelTitle';
|
|
9
|
+
|
|
10
|
+
const AccordionPanel: FCC<AccordionPanelProps<any>> = ({
|
|
11
|
+
title,
|
|
12
|
+
initialActive,
|
|
13
|
+
children,
|
|
14
|
+
Component = AccordionPanelTitle,
|
|
15
|
+
}) => {
|
|
16
|
+
const panel = useAccordionPanel(initialActive);
|
|
17
|
+
const service = useAccordionService();
|
|
18
|
+
const { animate } = useAccordionState();
|
|
19
|
+
|
|
20
|
+
const toggle = () => {
|
|
21
|
+
if (!panel) return;
|
|
22
|
+
if (panel.active) {
|
|
23
|
+
service.collapse(panel.uid);
|
|
24
|
+
} else {
|
|
25
|
+
service.expand(panel.uid);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const onEntering = (node: HTMLElement) => {
|
|
30
|
+
const currentHeight = node.getBoundingClientRect().height;
|
|
31
|
+
node.style.height = '0px';
|
|
32
|
+
setTimeout(() => {
|
|
33
|
+
node.style.height = `${currentHeight}px`;
|
|
34
|
+
}, 0);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const onEntered = (node: HTMLElement) => {
|
|
38
|
+
node.style.height = '';
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const onExiting = (node: HTMLElement) => {
|
|
42
|
+
node.style.height = `${node.getBoundingClientRect().height}px`;
|
|
43
|
+
setTimeout(() => {
|
|
44
|
+
node.style.height = '0px';
|
|
45
|
+
}, 0);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
if (!panel) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<div className={`o-accordion-panel${panel.active ? ' o-accordion-panel-active' : ''}`}>
|
|
54
|
+
<Component title={title} active={panel.active} onClick={toggle} />
|
|
55
|
+
<CSSTransition
|
|
56
|
+
in={panel.active}
|
|
57
|
+
classNames="o-accordion-animate"
|
|
58
|
+
timeout={animate}
|
|
59
|
+
mountOnEnter={false}
|
|
60
|
+
appear={false}
|
|
61
|
+
unmountOnExit={true}
|
|
62
|
+
onExiting={onExiting}
|
|
63
|
+
onEntering={onEntering}
|
|
64
|
+
onEntered={onEntered}
|
|
65
|
+
>
|
|
66
|
+
<div>
|
|
67
|
+
<div className="o-accordion-content">{children}</div>
|
|
68
|
+
</div>
|
|
69
|
+
</CSSTransition>
|
|
70
|
+
</div>
|
|
71
|
+
);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export default AccordionPanel;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import TogglerIcon from '../../icon/TogglerIcon';
|
|
3
|
+
import { AccordionPanelTitleProps } from '../typings';
|
|
4
|
+
|
|
5
|
+
const AccordionPanelTitle: FC<AccordionPanelTitleProps<any>> = ({ title, active, onClick }) => {
|
|
6
|
+
return (
|
|
7
|
+
<div className="o-accordion-panel-title" onClick={onClick}>
|
|
8
|
+
<TogglerIcon open={active} />
|
|
9
|
+
<span>{`${title}`}</span>
|
|
10
|
+
</div>
|
|
11
|
+
);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default AccordionPanelTitle;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useEffect, useId } from 'react';
|
|
2
|
+
import { AccordionPanelState } from '../typings';
|
|
3
|
+
import useAccordionService from './useAccordionService';
|
|
4
|
+
import { useAccordionState } from './useAccordionState';
|
|
5
|
+
|
|
6
|
+
const useAccordionPanel = (initialActive = false): AccordionPanelState | undefined => {
|
|
7
|
+
const uid = useId();
|
|
8
|
+
const service = useAccordionService();
|
|
9
|
+
const state = useAccordionState();
|
|
10
|
+
const panel = state.panels[uid];
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (panel === undefined) {
|
|
13
|
+
service.initPanel(uid, initialActive);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
return panel;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default useAccordionPanel;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import { AccordionService } from '../AccordionService';
|
|
3
|
+
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
5
|
+
export const AccordionServiceContext = React.createContext<AccordionService>(null!);
|
|
6
|
+
|
|
7
|
+
const useAccordionService = (): AccordionService => {
|
|
8
|
+
return useContext(AccordionServiceContext);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default useAccordionService;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import { AccordionState } from '../typings';
|
|
3
|
+
|
|
4
|
+
export const AccordionStateContext = React.createContext<AccordionState>(null!);
|
|
5
|
+
export const useAccordionState = (): AccordionState => {
|
|
6
|
+
return useContext(AccordionStateContext);
|
|
7
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import AccordionComponent from './components/AccordionComponent';
|
|
3
|
+
import { accordionStyle } from './style';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Test Description
|
|
7
|
+
*
|
|
8
|
+
* @group Accordion
|
|
9
|
+
* @cateogry Components
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <Accordion multiActive="true" />
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @see AccordionComponent
|
|
17
|
+
* @remarks #styled#
|
|
18
|
+
*/
|
|
19
|
+
const Accordion = styled(AccordionComponent)`
|
|
20
|
+
${accordionStyle}
|
|
21
|
+
`;
|
|
22
|
+
|
|
23
|
+
export default Accordion;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { css } from 'styled-components';
|
|
2
|
+
import { alignItems } from '../../styles/alignment';
|
|
3
|
+
import { backgroundColor } from '../../styles/background';
|
|
4
|
+
import {
|
|
5
|
+
borderBottomLeftRadius,
|
|
6
|
+
borderBottomRightRadius,
|
|
7
|
+
borderBottomWidth,
|
|
8
|
+
borderColor,
|
|
9
|
+
borderStyle,
|
|
10
|
+
borderTopLeftRadius,
|
|
11
|
+
borderTopRightRadius,
|
|
12
|
+
borderWidth,
|
|
13
|
+
} from '../../styles/border';
|
|
14
|
+
import { display } from '../../styles/display';
|
|
15
|
+
import { iconHeight, iconWidth } from '../../styles/icon';
|
|
16
|
+
import { cursor } from '../../styles/interactivity';
|
|
17
|
+
import { overflowY } from '../../styles/overflow';
|
|
18
|
+
import { marginTop, paddingX, paddingY } from '../../styles/spacing';
|
|
19
|
+
import { transitionDuration, transitionProperty, transitionTimingFunction } from '../../styles/transition';
|
|
20
|
+
import { ComponentStyle } from '../../styles/typings';
|
|
21
|
+
import { color, fontSize, fontWeight } from '../../styles/typography';
|
|
22
|
+
import { AccordionProps } from './typings';
|
|
23
|
+
|
|
24
|
+
export const accordionStyle: ComponentStyle<AccordionProps> = ({ border = false, animate = 150, theme }) => {
|
|
25
|
+
const t = theme.accordion;
|
|
26
|
+
const bWidth = border ? t.borderWidth : 0;
|
|
27
|
+
return css`
|
|
28
|
+
.o-accordion-animate-enter-active, .o-accordion-animate-exit-active {
|
|
29
|
+
${overflowY('hidden')}
|
|
30
|
+
${transitionDuration(`${animate}ms`)}
|
|
31
|
+
${transitionProperty('height,opacity')}
|
|
32
|
+
${transitionTimingFunction('ease-in-out')}
|
|
33
|
+
}
|
|
34
|
+
.o-accordion-panel {
|
|
35
|
+
${borderWidth(bWidth)}
|
|
36
|
+
${borderTopLeftRadius(0, { 'first-child': t.borderRadius })}
|
|
37
|
+
${borderTopRightRadius(0, { 'first-child': t.borderRadius })}
|
|
38
|
+
${borderBottomLeftRadius(0, { 'last-child': t.borderRadius })}
|
|
39
|
+
${borderBottomRightRadius(0, { 'last-child': t.borderRadius })}
|
|
40
|
+
${borderBottomWidth(0, { 'last-child': bWidth })}
|
|
41
|
+
${borderStyle(t.borderStyle)}
|
|
42
|
+
${borderColor(t.borderColor)}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.o-accordion-panel-active {
|
|
46
|
+
.o-accordion-panel-title {
|
|
47
|
+
${backgroundColor(t.activeBgColor, { hover: t.hoverBgColor })}
|
|
48
|
+
${color(t.activeFontColor, { hover: t.activeFontColor })}
|
|
49
|
+
}
|
|
50
|
+
.o-accordion-content {
|
|
51
|
+
${backgroundColor(t.activeBgColor, { hover: t.activeBgColor })}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.o-accordion-panel-title {
|
|
56
|
+
${display('flex')}
|
|
57
|
+
${alignItems('center')}
|
|
58
|
+
${fontWeight(t.fontWeight)}
|
|
59
|
+
${color(t.fontColor, { hover: t.hoverFontColor })}
|
|
60
|
+
${fontSize(t.fontSize)}
|
|
61
|
+
${cursor('pointer')}
|
|
62
|
+
${paddingX(t.paddingX)}
|
|
63
|
+
${paddingY(t.paddingY)}
|
|
64
|
+
${backgroundColor(t.bgColor, { hover: t.hoverBgColor })}
|
|
65
|
+
.o-toggler-icon-container {
|
|
66
|
+
${iconHeight(t.togglerIconHeight)};
|
|
67
|
+
${iconWidth(t.togglerIconWidth)};
|
|
68
|
+
${marginTop('-2px')}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
`;
|
|
72
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { AnonymousObject, AnyFunction, FCC } from 'onekijs-framework';
|
|
2
|
+
|
|
3
|
+
export type AccordionPanelProps<T = string> = {
|
|
4
|
+
initialActive?: boolean;
|
|
5
|
+
title: T;
|
|
6
|
+
Component?: FCC<AccordionPanelTitleProps<T>>;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export type AccordionPanelTitleProps<T = string> = {
|
|
10
|
+
title: T;
|
|
11
|
+
active: boolean;
|
|
12
|
+
onClick: AnyFunction;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type AccordionPanelState = {
|
|
16
|
+
active: boolean;
|
|
17
|
+
uid: string;
|
|
18
|
+
collapsing?: boolean;
|
|
19
|
+
expanding?: boolean;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @group Accordion
|
|
24
|
+
* @category types
|
|
25
|
+
*/
|
|
26
|
+
export type AccordionProps = {
|
|
27
|
+
/**
|
|
28
|
+
* a flag to indicate if the border is visible or not
|
|
29
|
+
*
|
|
30
|
+
* @example test
|
|
31
|
+
* @defaultValue true
|
|
32
|
+
*/
|
|
33
|
+
border?: boolean;
|
|
34
|
+
Component?: FCC<Omit<AccordionProps, 'Component'>>;
|
|
35
|
+
className?: string;
|
|
36
|
+
/**
|
|
37
|
+
* @defaultValue false
|
|
38
|
+
*/
|
|
39
|
+
multiActive?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* @defaultValue 150
|
|
42
|
+
*/
|
|
43
|
+
animate?: number;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export type AccordionState = {
|
|
47
|
+
panels: AnonymousObject<AccordionPanelState>;
|
|
48
|
+
multiActive?: boolean;
|
|
49
|
+
animate: number;
|
|
50
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import DropdownButtonComponent from './components/DropdownButtonComponent';
|
|
3
|
+
import { dropdownButtonStyle } from './style';
|
|
4
|
+
|
|
5
|
+
export const DropdownButton = styled(DropdownButtonComponent)`
|
|
6
|
+
${dropdownButtonStyle}
|
|
7
|
+
`;
|
|
8
|
+
|
|
9
|
+
export default DropdownButton;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { AnonymousObject, FCC, useSubmit, ValidationCode } from 'onekijs-framework';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Button from '.';
|
|
4
|
+
import Tooltip from '../tooltip';
|
|
5
|
+
import { SubmitButtonProps } from './typings';
|
|
6
|
+
|
|
7
|
+
const TooltipContent: React.FC<{ code: ValidationCode; fields: AnonymousObject<string> }> = ({ code, fields }) => {
|
|
8
|
+
if (code <= ValidationCode.Error) {
|
|
9
|
+
return (
|
|
10
|
+
<>
|
|
11
|
+
<div>Some fields are in {code === ValidationCode.Error ? 'in error' : 'loading'}</div>
|
|
12
|
+
{Object.keys(fields).map((fieldName, index) => (
|
|
13
|
+
<div key={`error-${index}`}>
|
|
14
|
+
<b>{fieldName}</b>: {fields[fieldName]}
|
|
15
|
+
</div>
|
|
16
|
+
))}
|
|
17
|
+
</>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
return null;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const SubmitButton: FCC<SubmitButtonProps> = React.memo((opts) => {
|
|
24
|
+
const { submitting, code, fields } = useSubmit();
|
|
25
|
+
const { showErrors, type = 'submit', ...props } = opts;
|
|
26
|
+
let disabled = props.disabled || false;
|
|
27
|
+
|
|
28
|
+
let errors = [];
|
|
29
|
+
if (code <= ValidationCode.Error) {
|
|
30
|
+
disabled = true;
|
|
31
|
+
if (showErrors) {
|
|
32
|
+
errors = Object.keys(fields);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// eslint-disable-next-line react/prop-types
|
|
37
|
+
let children = props.children;
|
|
38
|
+
if (submitting) {
|
|
39
|
+
children = <>Loading...</>;
|
|
40
|
+
disabled = true;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<Tooltip
|
|
45
|
+
content={errors.length > 0 ? <TooltipContent code={code} fields={fields} /> : undefined}
|
|
46
|
+
placement="top"
|
|
47
|
+
kind="danger"
|
|
48
|
+
delayHide={0}
|
|
49
|
+
>
|
|
50
|
+
<Button {...props} disabled={disabled} type={type}>
|
|
51
|
+
{children ? children : 'Submit'}
|
|
52
|
+
</Button>
|
|
53
|
+
</Tooltip>
|
|
54
|
+
);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
SubmitButton.displayName = 'SubmitButton';
|
|
58
|
+
export default SubmitButton;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { addClassname } from '../../../utils/style';
|
|
3
|
+
import { ButtonProps } from '../typings';
|
|
4
|
+
|
|
5
|
+
const ButtonComponent = React.forwardRef<HTMLButtonElement, ButtonProps>((props, ref) => {
|
|
6
|
+
const { kind, pattern, className, loading, IconComponent, onClick, ...buttonProps } = props;
|
|
7
|
+
let classNames = addClassname('o-button', className);
|
|
8
|
+
if (loading) {
|
|
9
|
+
classNames = addClassname('o-button-loading', classNames);
|
|
10
|
+
}
|
|
11
|
+
if (props.disabled) {
|
|
12
|
+
classNames = addClassname('o-button-disabled', classNames);
|
|
13
|
+
}
|
|
14
|
+
return (
|
|
15
|
+
<span className={classNames} onClick={onClick}>
|
|
16
|
+
{IconComponent && <IconComponent {...props} onClick={undefined} className="o-button-icon" />}
|
|
17
|
+
<button {...buttonProps} ref={ref} className="o-button-content" />
|
|
18
|
+
</span>
|
|
19
|
+
);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
ButtonComponent.displayName = 'Button';
|
|
23
|
+
|
|
24
|
+
export default ButtonComponent;
|