@bolio-ui/core 2.0.0-alpha.1 → 2.0.0-alpha.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/Avatar/Avatar.d.ts +3 -2
- package/dist/Avatar/AvatarGroup.d.ts +2 -1
- package/dist/Avatar/index.js +10 -785
- package/dist/Badge/Badge.d.ts +11 -2
- package/dist/Badge/BadgeAnchor.d.ts +3 -3
- package/dist/Badge/index.js +11 -799
- package/dist/BolioUIProvider/index.js +26 -1724
- package/dist/Breadcrumbs/Breadcrumbs.d.ts +3 -2
- package/dist/Breadcrumbs/BreadcrumbsItem.d.ts +3 -2
- package/dist/Breadcrumbs/BreadcrumbsSeparator.d.ts +2 -1
- package/dist/Breadcrumbs/index.js +12 -873
- package/dist/Button/Button.d.ts +2 -1
- package/dist/Button/ButtonIcon.d.ts +2 -1
- package/dist/Button/index.js +18 -1242
- package/dist/Button/styles.d.ts +2 -0
- package/dist/ButtonDropdown/ButtonDropdown.d.ts +3 -2
- package/dist/ButtonDropdown/ButtonDropdownItem.d.ts +2 -1
- package/dist/ButtonDropdown/index.js +16 -1015
- package/dist/ButtonGroup/ButtonGroup.d.ts +1 -1
- package/dist/ButtonGroup/index.js +11 -706
- package/dist/Calendar/index.js +10 -937
- package/dist/Capacity/Capacity.d.ts +3 -2
- package/dist/Capacity/index.js +11 -693
- package/dist/Card/Card.d.ts +6 -2
- package/dist/Card/CardContent.d.ts +2 -1
- package/dist/Card/CardFooter.d.ts +2 -1
- package/dist/Card/index.js +17 -1159
- package/dist/Card/styles.d.ts +7 -1
- package/dist/Checkbox/Checkbox.d.ts +3 -2
- package/dist/Checkbox/CheckboxGroup.d.ts +2 -1
- package/dist/Checkbox/CheckboxIcon.d.ts +1 -2
- package/dist/Checkbox/index.js +11 -941
- package/dist/Checkbox/styles.d.ts +1 -5
- package/dist/Code/Code.d.ts +6 -2
- package/dist/Code/index.js +10 -714
- package/dist/Col/Col.d.ts +3 -2
- package/dist/Col/index.js +4 -65
- package/dist/Collapse/Collapse.d.ts +3 -2
- package/dist/Collapse/CollapseGroup.d.ts +3 -2
- package/dist/Collapse/index.js +18 -1032
- package/dist/Combobox/index.js +10 -855
- package/dist/Container/Container.d.ts +1 -1
- package/dist/Container/index.js +8 -408
- package/dist/CssBaseline/CssBaseline.d.ts +1 -1
- package/dist/CssBaseline/index.js +7 -331
- package/dist/DatePicker/index.js +16 -1124
- package/dist/Description/Description.d.ts +3 -2
- package/dist/Description/index.js +10 -657
- package/dist/Display/Display.d.ts +3 -2
- package/dist/Display/index.js +10 -661
- package/dist/Divider/Divider.d.ts +3 -2
- package/dist/Divider/index.js +10 -681
- package/dist/Dot/Dot.d.ts +3 -2
- package/dist/Dot/index.js +10 -672
- package/dist/Drawer/Drawer.d.ts +1 -1
- package/dist/Drawer/DrawerWrapper.d.ts +1 -1
- package/dist/Drawer/helper.d.ts +1 -3
- package/dist/Drawer/index.js +21 -1368
- package/dist/Fieldset/Fieldset.d.ts +3 -2
- package/dist/Fieldset/FieldsetContent.d.ts +3 -2
- package/dist/Fieldset/FieldsetFooter.d.ts +3 -2
- package/dist/Fieldset/FieldsetGroup.d.ts +3 -2
- package/dist/Fieldset/index.js +16 -953
- package/dist/Grid/BasicItem.d.ts +3 -2
- package/dist/Grid/Grid.d.ts +107 -105
- package/dist/Grid/GridContainer.d.ts +107 -105
- package/dist/Grid/GridTypes.d.ts +5 -11
- package/dist/Grid/index.js +10 -783
- package/dist/Image/Image.d.ts +3 -2
- package/dist/Image/ImageBrowser.d.ts +4 -3
- package/dist/Image/index.js +12 -979
- package/dist/Input/Input.d.ts +3 -2
- package/dist/Input/InputBlockLabel.d.ts +3 -1
- package/dist/Input/InputProps.d.ts +1 -2
- package/dist/Input/Password.d.ts +3 -2
- package/dist/Input/index.js +17 -1174
- package/dist/Keyboard/Keyboard.d.ts +3 -2
- package/dist/Keyboard/index.js +9 -635
- package/dist/Link/Link.d.ts +3 -2
- package/dist/Link/index.js +11 -766
- package/dist/Loading/Loading.d.ts +3 -2
- package/dist/Loading/index.js +10 -681
- package/dist/MdxWidgets/index.js +42 -401
- package/dist/Menu/Menu.d.ts +20 -0
- package/dist/Menu/MenuContext.d.ts +15 -0
- package/dist/Menu/MenuItem.d.ts +57 -0
- package/dist/Menu/MenuList.d.ts +12 -0
- package/dist/Menu/MenuSub.d.ts +12 -0
- package/dist/Menu/index.d.ts +17 -0
- package/dist/Menu/index.js +24 -0
- package/dist/Modal/Modal.d.ts +3 -2
- package/dist/Modal/ModalAction.d.ts +1 -1
- package/dist/Modal/ModalActions.d.ts +1 -1
- package/dist/Modal/ModalContent.d.ts +1 -1
- package/dist/Modal/ModalSubtitle.d.ts +1 -1
- package/dist/Modal/ModalTitle.d.ts +3 -2
- package/dist/Modal/ModalWrapper.d.ts +1 -1
- package/dist/Modal/index.js +27 -2041
- package/dist/Next/index.js +20 -79
- package/dist/Note/Note.d.ts +6 -3
- package/dist/Note/index.js +11 -688
- package/dist/NumberInput/NumberInput.d.ts +24 -0
- package/dist/NumberInput/index.d.ts +3 -0
- package/dist/NumberInput/index.js +16 -0
- package/dist/Page/Page.d.ts +4 -4
- package/dist/Page/PageContent.d.ts +3 -2
- package/dist/Page/PageFooter.d.ts +3 -2
- package/dist/Page/PageHeader.d.ts +3 -2
- package/dist/Page/index.js +10 -820
- package/dist/Pagination/Pagination.d.ts +3 -2
- package/dist/Pagination/PaginationContext.d.ts +1 -3
- package/dist/Pagination/PaginationItem.d.ts +2 -1
- package/dist/Pagination/PaginationNext.d.ts +2 -1
- package/dist/Pagination/PaginationPrevious.d.ts +2 -1
- package/dist/Pagination/index.js +16 -1071
- package/dist/Popover/Popover.d.ts +1 -1
- package/dist/Popover/PopoverItem.d.ts +3 -2
- package/dist/Popover/index.js +23 -1413
- package/dist/Progress/Progress.d.ts +3 -2
- package/dist/Progress/index.js +11 -717
- package/dist/Radio/Radio.d.ts +3 -2
- package/dist/Radio/RadioDescription.d.ts +3 -2
- package/dist/Radio/RadioGroup.d.ts +3 -2
- package/dist/Radio/index.js +11 -909
- package/dist/Rating/Rating.d.ts +5 -6
- package/dist/Rating/index.js +10 -807
- package/dist/Row/Row.d.ts +1 -1
- package/dist/Row/index.js +8 -406
- package/dist/Section/Section.d.ts +1 -1
- package/dist/Section/index.js +10 -650
- package/dist/Select/Select.d.ts +3 -2
- package/dist/Select/SelectDropdown.d.ts +3 -2
- package/dist/Select/SelectOption.d.ts +3 -2
- package/dist/Select/index.js +24 -1696
- package/dist/Shared/backdrop.d.ts +1 -15
- package/dist/Shared/css-transition.d.ts +3 -17
- package/dist/Shared/expand.d.ts +1 -9
- package/dist/Shared/highlight.d.ts +2 -1
- package/dist/Skeleton/Skeleton.d.ts +13 -0
- package/dist/Skeleton/index.d.ts +3 -0
- package/dist/Skeleton/index.js +14 -0
- package/dist/Slider/Slider.d.ts +3 -2
- package/dist/Slider/SliderDot.d.ts +3 -2
- package/dist/Slider/index.js +16 -1012
- package/dist/Snippet/Snippet.d.ts +6 -2
- package/dist/Snippet/index.js +20 -1069
- package/dist/Snippet/styles.d.ts +7 -1
- package/dist/Spacer/index.js +9 -617
- package/dist/Spinner/Spinner.d.ts +3 -2
- package/dist/Spinner/index.js +10 -675
- package/dist/Stepper/Stepper.d.ts +14 -0
- package/dist/Stepper/StepperContext.d.ts +10 -0
- package/dist/Stepper/StepperStep.d.ts +13 -0
- package/dist/Stepper/index.d.ts +9 -0
- package/dist/Stepper/index.js +14 -0
- package/dist/Table/Table.d.ts +4 -3
- package/dist/Table/TableBody.d.ts +3 -10
- package/dist/Table/TableCell.d.ts +2 -1
- package/dist/Table/TableColumn.d.ts +0 -4
- package/dist/Table/TableContext.d.ts +1 -1
- package/dist/Table/TableHead.d.ts +2 -4
- package/dist/Table/TableTypes.d.ts +2 -1
- package/dist/Table/index.js +17 -1017
- package/dist/Tabs/Tabs.d.ts +1 -1
- package/dist/Tabs/TabsContext.d.ts +7 -2
- package/dist/Tabs/TabsItem.d.ts +5 -2
- package/dist/Tabs/index.js +11 -1018
- package/dist/Tag/Tag.d.ts +5 -2
- package/dist/Tag/index.js +10 -669
- package/dist/Text/Child.d.ts +3 -2
- package/dist/Text/Text.d.ts +4 -3
- package/dist/Text/index.js +9 -751
- package/dist/Textarea/Textarea.d.ts +4 -4
- package/dist/Textarea/index.js +11 -839
- package/dist/Themes/index.js +4 -305
- package/dist/Toggle/Toggle.d.ts +3 -2
- package/dist/Toggle/index.js +10 -763
- package/dist/Tooltip/Tooltip.d.ts +6 -2
- package/dist/Tooltip/TooltipContent.d.ts +3 -0
- package/dist/Tooltip/helper.d.ts +1 -1
- package/dist/Tooltip/index.js +21 -1244
- package/dist/Tooltip/styles.d.ts +7 -1
- package/dist/chunk-33BUV2RX.js +10 -0
- package/dist/chunk-33WYJZ4F.js +88 -0
- package/dist/chunk-3BVFLDHI.js +295 -0
- package/dist/chunk-3WPRUUZ6.js +25 -0
- package/dist/chunk-3XTTDT42.js +72 -0
- package/dist/chunk-45MVPPJN.js +10 -0
- package/dist/chunk-4RJGB3WA.js +107 -0
- package/dist/chunk-4VCNNVZ4.js +310 -0
- package/dist/chunk-5BRAW5HK.js +10 -0
- package/dist/chunk-5GR6MFT5.js +70 -0
- package/dist/chunk-5JAYTLFV.js +227 -0
- package/dist/chunk-5KUROAEP.js +39 -0
- package/dist/chunk-5KWSYI7C.js +143 -0
- package/dist/chunk-5W4MJC2K.js +55 -0
- package/dist/chunk-6BHDVSPB.js +226 -0
- package/dist/chunk-6XJS3KMW.js +436 -0
- package/dist/chunk-7L3HCDGD.js +65 -0
- package/dist/chunk-A3BIV2QM.js +26 -0
- package/dist/chunk-APDSEVV6.js +443 -0
- package/dist/chunk-AXYDJGTN.js +18 -0
- package/dist/chunk-BDEBNBW6.js +61 -0
- package/dist/chunk-BSDZWWUS.js +20 -0
- package/dist/chunk-BXDUHMWS.js +57 -0
- package/dist/chunk-C3ZZPIUO.js +54 -0
- package/dist/chunk-CNY7HPMQ.js +191 -0
- package/dist/chunk-CPIFYIT3.js +465 -0
- package/dist/chunk-CV4DIXTB.js +93 -0
- package/dist/chunk-DD72MTCX.js +55 -0
- package/dist/chunk-DGXZP4VJ.js +10 -0
- package/dist/chunk-DSX6YDJM.js +71 -0
- package/dist/chunk-DTRBG524.js +195 -0
- package/dist/chunk-ELIPUM6Q.js +142 -0
- package/dist/chunk-EMDU5OPY.js +236 -0
- package/dist/chunk-EZILJ6TJ.js +133 -0
- package/dist/chunk-F3AL4TQZ.js +186 -0
- package/dist/chunk-F5ENWFJU.js +273 -0
- package/dist/chunk-GGD4BGH2.js +30 -0
- package/dist/chunk-GJZT47MP.js +32 -0
- package/dist/chunk-HH2IP5Z4.js +189 -0
- package/dist/chunk-HKOESPKZ.js +35 -0
- package/dist/chunk-HMOOLCMA.js +401 -0
- package/dist/chunk-HMOTWEQB.js +113 -0
- package/dist/chunk-HX5M3GSJ.js +63 -0
- package/dist/chunk-I6WWABJN.js +27 -0
- package/dist/chunk-IB2FP4DM.js +307 -0
- package/dist/chunk-IUOX444H.js +282 -0
- package/{esm/Select/styles.js → dist/chunk-IWMGNPNV.js} +26 -12
- package/dist/chunk-J4K4LRBI.js +32 -0
- package/dist/chunk-J6KQRS7O.js +226 -0
- package/dist/chunk-JJFOGZ6V.js +22 -0
- package/dist/chunk-JM3DV57W.js +44 -0
- package/dist/chunk-K53ERLS7.js +150 -0
- package/dist/chunk-KBCAV5FR.js +22 -0
- package/dist/chunk-KHB3EKRQ.js +36 -0
- package/dist/chunk-KVIIL2O6.js +192 -0
- package/dist/chunk-KZXX7IEN.js +44 -0
- package/dist/chunk-LDTDMDE6.js +51 -0
- package/dist/chunk-MYAZEMZC.js +134 -0
- package/dist/chunk-NCUSKYUE.js +95 -0
- package/dist/chunk-NDERASK2.js +13 -0
- package/dist/chunk-NRSWR3C4.js +165 -0
- package/dist/chunk-O3RTRCY5.js +64 -0
- package/dist/chunk-OEHIZKSM.js +31 -0
- package/dist/chunk-OFNHKVGZ.js +136 -0
- package/dist/chunk-PGK3BYA2.js +60 -0
- package/dist/chunk-PHKAYQE4.js +42 -0
- package/dist/chunk-PJH7CP77.js +27 -0
- package/dist/chunk-QMV4ULSR.js +124 -0
- package/dist/chunk-QUMM6MGX.js +10 -0
- package/dist/chunk-RF5ZQ37O.js +66 -0
- package/dist/chunk-RSHEENJP.js +156 -0
- package/dist/chunk-RZBEZ26A.js +38 -0
- package/dist/chunk-S62PPQHN.js +208 -0
- package/dist/chunk-TF3CTLKX.js +42 -0
- package/dist/chunk-TFZ2IGNH.js +14 -0
- package/dist/chunk-TUWG4TLU.js +97 -0
- package/dist/chunk-TXG6TBSG.js +91 -0
- package/dist/chunk-U2NJJS3T.js +88 -0
- package/dist/chunk-UEWD6OUC.js +137 -0
- package/dist/chunk-UF4IKEU2.js +17 -0
- package/dist/chunk-UVCSH6DW.js +16 -0
- package/dist/chunk-UX2B3G6U.js +106 -0
- package/dist/chunk-V57PNXMD.js +14 -0
- package/dist/chunk-VCTKX4AS.js +247 -0
- package/dist/chunk-W4T2KO5B.js +129 -0
- package/dist/chunk-XSXJO2KP.js +29 -0
- package/dist/chunk-XXMCR322.js +199 -0
- package/dist/chunk-Y6X5SEN7.js +232 -0
- package/dist/chunk-YDYRM2KN.js +25 -0
- package/dist/chunk-YFQOB5OC.js +204 -0
- package/dist/chunk-YHEIC6EK.js +102 -0
- package/dist/chunk-YS5PWRS7.js +288 -0
- package/dist/chunk-ZNNLYTW5.js +64 -0
- package/dist/chunk-ZQ25CQCG.js +153 -0
- package/dist/chunk-ZRORQ2WH.js +14 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +325 -10217
- package/dist/use-all-themes/index.js +5 -321
- package/dist/use-body-scroll/index.js +3 -153
- package/dist/use-body-scroll/use-body-scroll.d.ts +1 -1
- package/dist/use-classes/index.d.ts +1 -0
- package/dist/use-classes/index.js +3 -42
- package/dist/use-classes/use-classes.d.ts +1 -0
- package/dist/use-click-away/index.js +3 -23
- package/dist/use-clipboard/index.js +7 -155
- package/dist/use-current-state/index.js +3 -73
- package/dist/use-input/index.js +5 -109
- package/dist/use-keyboard/helper.d.ts +1 -1
- package/dist/use-keyboard/index.js +5 -194
- package/dist/use-media-query/index.js +7 -458
- package/dist/use-media-query/use-media-query.d.ts +2 -4
- package/dist/use-modal/index.js +5 -94
- package/dist/use-scale/index.js +8 -587
- package/dist/use-tabs/index.js +5 -93
- package/dist/use-theme/index.js +6 -319
- package/dist/use-toasts/helpers.d.ts +2 -4
- package/dist/use-toasts/index.js +5 -204
- package/dist/utils/collections.d.ts +1 -1
- package/dist/utils/log-warning.d.ts +2 -0
- package/dist/utils/prop-types.d.ts +8 -17
- package/dist/utils/types.d.ts +3 -1
- package/dist/utils/use-bolio-ui-context.d.ts +3 -3
- package/dist/utils/use-default-props.d.ts +2 -1
- package/dist/utils/use-drag.d.ts +1 -1
- package/dist/utils/use-latest.d.ts +3 -0
- package/dist/utils/use-previous.d.ts +1 -1
- package/dist/utils/variant-colors.d.ts +11 -0
- package/esm/Avatar/Avatar.d.ts +3 -2
- package/esm/Avatar/AvatarGroup.d.ts +2 -1
- package/esm/Avatar/index.js +13 -4
- package/esm/Badge/Badge.d.ts +11 -2
- package/esm/Badge/BadgeAnchor.d.ts +3 -3
- package/esm/Badge/index.js +14 -4
- package/esm/BolioUIProvider/index.js +26 -2
- package/esm/Breadcrumbs/Breadcrumbs.d.ts +3 -2
- package/esm/Breadcrumbs/BreadcrumbsItem.d.ts +3 -2
- package/esm/Breadcrumbs/BreadcrumbsSeparator.d.ts +2 -1
- package/esm/Breadcrumbs/index.js +15 -6
- package/esm/Button/Button.d.ts +2 -1
- package/esm/Button/ButtonIcon.d.ts +2 -1
- package/esm/Button/index.js +18 -2
- package/esm/Button/styles.d.ts +2 -0
- package/esm/ButtonDropdown/ButtonDropdown.d.ts +3 -2
- package/esm/ButtonDropdown/ButtonDropdownItem.d.ts +2 -1
- package/esm/ButtonDropdown/index.js +16 -4
- package/esm/ButtonGroup/ButtonGroup.d.ts +1 -1
- package/esm/ButtonGroup/index.js +14 -2
- package/esm/Calendar/index.js +13 -2
- package/esm/Capacity/Capacity.d.ts +3 -2
- package/esm/Capacity/index.js +14 -2
- package/esm/Card/Card.d.ts +6 -2
- package/esm/Card/CardContent.d.ts +2 -1
- package/esm/Card/CardFooter.d.ts +2 -1
- package/esm/Card/index.js +17 -8
- package/esm/Card/styles.d.ts +7 -1
- package/esm/Checkbox/Checkbox.d.ts +3 -2
- package/esm/Checkbox/CheckboxGroup.d.ts +2 -1
- package/esm/Checkbox/CheckboxIcon.d.ts +1 -2
- package/esm/Checkbox/index.js +14 -4
- package/esm/Checkbox/styles.d.ts +1 -5
- package/esm/Code/Code.d.ts +6 -2
- package/esm/Code/index.js +13 -2
- package/esm/Col/Col.d.ts +3 -2
- package/esm/Col/index.js +7 -2
- package/esm/Collapse/Collapse.d.ts +3 -2
- package/esm/Collapse/CollapseGroup.d.ts +3 -2
- package/esm/Collapse/index.js +18 -4
- package/esm/Combobox/index.js +13 -2
- package/esm/Container/Container.d.ts +1 -1
- package/esm/Container/index.js +11 -2
- package/esm/CssBaseline/CssBaseline.d.ts +1 -1
- package/esm/CssBaseline/index.js +10 -1
- package/esm/DatePicker/index.js +16 -2
- package/esm/Description/Description.d.ts +3 -2
- package/esm/Description/index.js +13 -2
- package/esm/Display/Display.d.ts +3 -2
- package/esm/Display/index.js +13 -2
- package/esm/Divider/Divider.d.ts +3 -2
- package/esm/Divider/index.js +13 -2
- package/esm/Dot/Dot.d.ts +3 -2
- package/esm/Dot/index.js +13 -2
- package/esm/Drawer/Drawer.d.ts +1 -1
- package/esm/Drawer/DrawerWrapper.d.ts +1 -1
- package/esm/Drawer/helper.d.ts +1 -3
- package/esm/Drawer/index.js +21 -8
- package/esm/Fieldset/Fieldset.d.ts +3 -2
- package/esm/Fieldset/FieldsetContent.d.ts +3 -2
- package/esm/Fieldset/FieldsetFooter.d.ts +3 -2
- package/esm/Fieldset/FieldsetGroup.d.ts +3 -2
- package/esm/Fieldset/index.js +16 -13
- package/esm/Grid/BasicItem.d.ts +3 -2
- package/esm/Grid/Grid.d.ts +107 -105
- package/esm/Grid/GridContainer.d.ts +107 -105
- package/esm/Grid/GridTypes.d.ts +5 -11
- package/esm/Grid/index.js +13 -4
- package/esm/Image/Image.d.ts +3 -2
- package/esm/Image/ImageBrowser.d.ts +4 -3
- package/esm/Image/index.js +15 -4
- package/esm/Input/Input.d.ts +3 -2
- package/esm/Input/InputBlockLabel.d.ts +3 -1
- package/esm/Input/InputProps.d.ts +1 -2
- package/esm/Input/Password.d.ts +3 -2
- package/esm/Input/index.js +17 -6
- package/esm/Keyboard/Keyboard.d.ts +3 -2
- package/esm/Keyboard/index.js +12 -2
- package/esm/Link/Link.d.ts +3 -2
- package/esm/Link/index.js +14 -2
- package/esm/Loading/Loading.d.ts +3 -2
- package/esm/Loading/index.js +13 -2
- package/esm/MdxWidgets/index.js +51 -2
- package/esm/Menu/Menu.d.ts +20 -0
- package/esm/Menu/MenuContext.d.ts +15 -0
- package/esm/Menu/MenuItem.d.ts +57 -0
- package/esm/Menu/MenuList.d.ts +12 -0
- package/esm/Menu/MenuSub.d.ts +12 -0
- package/esm/Menu/index.d.ts +17 -0
- package/esm/Menu/index.js +24 -0
- package/esm/Modal/Modal.d.ts +3 -2
- package/esm/Modal/ModalAction.d.ts +1 -1
- package/esm/Modal/ModalActions.d.ts +1 -1
- package/esm/Modal/ModalContent.d.ts +1 -1
- package/esm/Modal/ModalSubtitle.d.ts +1 -1
- package/esm/Modal/ModalTitle.d.ts +3 -2
- package/esm/Modal/ModalWrapper.d.ts +1 -1
- package/esm/Modal/index.js +27 -10
- package/esm/Next/index.js +24 -3
- package/esm/Note/Note.d.ts +6 -3
- package/esm/Note/index.js +14 -2
- package/esm/NumberInput/NumberInput.d.ts +24 -0
- package/esm/NumberInput/index.d.ts +3 -0
- package/esm/NumberInput/index.js +16 -0
- package/esm/Page/Page.d.ts +4 -4
- package/esm/Page/PageContent.d.ts +3 -2
- package/esm/Page/PageFooter.d.ts +3 -2
- package/esm/Page/PageHeader.d.ts +3 -2
- package/esm/Page/index.js +13 -9
- package/esm/Pagination/Pagination.d.ts +3 -2
- package/esm/Pagination/PaginationContext.d.ts +1 -3
- package/esm/Pagination/PaginationItem.d.ts +2 -1
- package/esm/Pagination/PaginationNext.d.ts +2 -1
- package/esm/Pagination/PaginationPrevious.d.ts +2 -1
- package/esm/Pagination/index.js +16 -6
- package/esm/Popover/Popover.d.ts +1 -1
- package/esm/Popover/PopoverItem.d.ts +3 -2
- package/esm/Popover/index.js +23 -5
- package/esm/Progress/Progress.d.ts +3 -2
- package/esm/Progress/index.js +14 -2
- package/esm/Radio/Radio.d.ts +3 -2
- package/esm/Radio/RadioDescription.d.ts +3 -2
- package/esm/Radio/RadioGroup.d.ts +3 -2
- package/esm/Radio/index.js +14 -7
- package/esm/Rating/Rating.d.ts +5 -6
- package/esm/Rating/index.js +13 -2
- package/esm/Row/Row.d.ts +1 -1
- package/esm/Row/index.js +11 -2
- package/esm/Section/Section.d.ts +1 -1
- package/esm/Section/index.js +13 -2
- package/esm/Select/Select.d.ts +3 -2
- package/esm/Select/SelectDropdown.d.ts +3 -2
- package/esm/Select/SelectOption.d.ts +3 -2
- package/esm/Select/index.js +24 -4
- package/esm/Shared/backdrop.d.ts +1 -15
- package/esm/Shared/css-transition.d.ts +3 -17
- package/esm/Shared/expand.d.ts +1 -9
- package/esm/Shared/highlight.d.ts +2 -1
- package/esm/Skeleton/Skeleton.d.ts +13 -0
- package/esm/Skeleton/index.d.ts +3 -0
- package/esm/Skeleton/index.js +14 -0
- package/esm/Slider/Slider.d.ts +3 -2
- package/esm/Slider/SliderDot.d.ts +3 -2
- package/esm/Slider/index.js +16 -2
- package/esm/Snippet/Snippet.d.ts +6 -2
- package/esm/Snippet/index.js +20 -2
- package/esm/Snippet/styles.d.ts +7 -1
- package/esm/Spacer/index.js +12 -2
- package/esm/Spinner/Spinner.d.ts +3 -2
- package/esm/Spinner/index.js +13 -2
- package/esm/Stepper/Stepper.d.ts +14 -0
- package/esm/Stepper/StepperContext.d.ts +10 -0
- package/esm/Stepper/StepperStep.d.ts +13 -0
- package/esm/Stepper/index.d.ts +9 -0
- package/esm/Stepper/index.js +14 -0
- package/esm/Table/Table.d.ts +4 -3
- package/esm/Table/TableBody.d.ts +3 -10
- package/esm/Table/TableCell.d.ts +2 -1
- package/esm/Table/TableColumn.d.ts +0 -4
- package/esm/Table/TableContext.d.ts +1 -1
- package/esm/Table/TableHead.d.ts +2 -4
- package/esm/Table/TableTypes.d.ts +2 -1
- package/esm/Table/index.js +17 -2
- package/esm/Tabs/Tabs.d.ts +1 -1
- package/esm/Tabs/TabsContext.d.ts +7 -2
- package/esm/Tabs/TabsItem.d.ts +5 -2
- package/esm/Tabs/index.js +14 -5
- package/esm/Tag/Tag.d.ts +5 -2
- package/esm/Tag/index.js +13 -2
- package/esm/Text/Child.d.ts +3 -2
- package/esm/Text/Text.d.ts +4 -3
- package/esm/Text/index.js +12 -2
- package/esm/Textarea/Textarea.d.ts +4 -4
- package/esm/Textarea/index.js +14 -2
- package/esm/Themes/index.js +7 -2
- package/esm/Toggle/Toggle.d.ts +3 -2
- package/esm/Toggle/index.js +13 -2
- package/esm/Tooltip/Tooltip.d.ts +6 -2
- package/esm/Tooltip/TooltipContent.d.ts +3 -0
- package/esm/Tooltip/helper.d.ts +1 -1
- package/esm/Tooltip/index.js +21 -2
- package/esm/Tooltip/styles.d.ts +7 -1
- package/esm/chunk-33BUV2RX.js +10 -0
- package/esm/chunk-33WYJZ4F.js +88 -0
- package/esm/chunk-3BVFLDHI.js +295 -0
- package/esm/chunk-3WPRUUZ6.js +25 -0
- package/esm/chunk-3XTTDT42.js +72 -0
- package/esm/chunk-45MVPPJN.js +10 -0
- package/esm/chunk-4RJGB3WA.js +107 -0
- package/esm/chunk-4VCNNVZ4.js +310 -0
- package/esm/chunk-5BRAW5HK.js +10 -0
- package/esm/chunk-5GR6MFT5.js +70 -0
- package/esm/chunk-5JAYTLFV.js +227 -0
- package/esm/chunk-5KUROAEP.js +39 -0
- package/esm/chunk-5KWSYI7C.js +143 -0
- package/esm/chunk-5W4MJC2K.js +55 -0
- package/esm/chunk-6BHDVSPB.js +226 -0
- package/esm/chunk-6XJS3KMW.js +436 -0
- package/esm/chunk-7L3HCDGD.js +65 -0
- package/esm/chunk-A3BIV2QM.js +26 -0
- package/esm/chunk-APDSEVV6.js +443 -0
- package/esm/chunk-AXYDJGTN.js +18 -0
- package/esm/chunk-BDEBNBW6.js +61 -0
- package/esm/chunk-BSDZWWUS.js +20 -0
- package/esm/chunk-BXDUHMWS.js +57 -0
- package/esm/chunk-C3ZZPIUO.js +54 -0
- package/esm/chunk-CNY7HPMQ.js +191 -0
- package/esm/chunk-CPIFYIT3.js +465 -0
- package/esm/chunk-CV4DIXTB.js +93 -0
- package/esm/chunk-DD72MTCX.js +55 -0
- package/esm/chunk-DGXZP4VJ.js +10 -0
- package/esm/chunk-DSX6YDJM.js +71 -0
- package/esm/chunk-DTRBG524.js +195 -0
- package/esm/chunk-ELIPUM6Q.js +142 -0
- package/esm/chunk-EMDU5OPY.js +236 -0
- package/esm/chunk-EZILJ6TJ.js +133 -0
- package/esm/chunk-F3AL4TQZ.js +186 -0
- package/esm/chunk-F5ENWFJU.js +273 -0
- package/esm/chunk-GGD4BGH2.js +30 -0
- package/esm/chunk-GJZT47MP.js +32 -0
- package/esm/chunk-HH2IP5Z4.js +189 -0
- package/esm/chunk-HKOESPKZ.js +35 -0
- package/esm/chunk-HMOOLCMA.js +401 -0
- package/esm/chunk-HMOTWEQB.js +113 -0
- package/esm/chunk-HX5M3GSJ.js +63 -0
- package/esm/chunk-I6WWABJN.js +27 -0
- package/esm/chunk-IB2FP4DM.js +307 -0
- package/esm/chunk-IUOX444H.js +282 -0
- package/esm/{Input/styles.js → chunk-IWMGNPNV.js} +26 -19
- package/esm/chunk-J4K4LRBI.js +32 -0
- package/esm/chunk-J6KQRS7O.js +226 -0
- package/esm/chunk-JJFOGZ6V.js +22 -0
- package/esm/chunk-JM3DV57W.js +44 -0
- package/esm/chunk-K53ERLS7.js +150 -0
- package/esm/chunk-KBCAV5FR.js +22 -0
- package/esm/chunk-KHB3EKRQ.js +36 -0
- package/esm/chunk-KVIIL2O6.js +192 -0
- package/esm/chunk-KZXX7IEN.js +44 -0
- package/esm/chunk-LDTDMDE6.js +51 -0
- package/esm/chunk-MYAZEMZC.js +134 -0
- package/esm/chunk-NCUSKYUE.js +95 -0
- package/esm/chunk-NDERASK2.js +13 -0
- package/esm/chunk-NRSWR3C4.js +165 -0
- package/esm/chunk-O3RTRCY5.js +64 -0
- package/esm/chunk-OEHIZKSM.js +31 -0
- package/esm/chunk-OFNHKVGZ.js +136 -0
- package/esm/chunk-PGK3BYA2.js +60 -0
- package/esm/chunk-PHKAYQE4.js +42 -0
- package/esm/chunk-PJH7CP77.js +27 -0
- package/esm/chunk-QMV4ULSR.js +124 -0
- package/esm/chunk-QUMM6MGX.js +10 -0
- package/esm/chunk-RF5ZQ37O.js +66 -0
- package/esm/chunk-RSHEENJP.js +156 -0
- package/esm/chunk-RZBEZ26A.js +38 -0
- package/esm/chunk-S62PPQHN.js +208 -0
- package/esm/chunk-TF3CTLKX.js +42 -0
- package/esm/chunk-TFZ2IGNH.js +14 -0
- package/esm/chunk-TUWG4TLU.js +97 -0
- package/esm/chunk-TXG6TBSG.js +91 -0
- package/esm/chunk-U2NJJS3T.js +88 -0
- package/esm/chunk-UEWD6OUC.js +137 -0
- package/esm/chunk-UF4IKEU2.js +17 -0
- package/esm/chunk-UVCSH6DW.js +16 -0
- package/esm/chunk-UX2B3G6U.js +106 -0
- package/esm/chunk-V57PNXMD.js +14 -0
- package/esm/chunk-VCTKX4AS.js +247 -0
- package/esm/chunk-W4T2KO5B.js +129 -0
- package/esm/chunk-XSXJO2KP.js +29 -0
- package/esm/chunk-XXMCR322.js +199 -0
- package/esm/chunk-Y6X5SEN7.js +232 -0
- package/esm/chunk-YDYRM2KN.js +25 -0
- package/esm/chunk-YFQOB5OC.js +204 -0
- package/esm/chunk-YHEIC6EK.js +102 -0
- package/esm/chunk-YS5PWRS7.js +288 -0
- package/esm/chunk-ZNNLYTW5.js +64 -0
- package/esm/chunk-ZQ25CQCG.js +153 -0
- package/esm/chunk-ZRORQ2WH.js +14 -0
- package/esm/index.d.ts +8 -0
- package/esm/index.js +325 -74
- package/esm/use-all-themes/index.js +8 -2
- package/esm/use-body-scroll/index.js +6 -2
- package/esm/use-body-scroll/use-body-scroll.d.ts +1 -1
- package/esm/use-classes/index.d.ts +1 -0
- package/esm/use-classes/index.js +8 -2
- package/esm/use-classes/use-classes.d.ts +1 -0
- package/esm/use-click-away/index.js +6 -2
- package/esm/use-clipboard/index.js +10 -2
- package/esm/use-current-state/index.js +6 -2
- package/esm/use-input/index.js +8 -2
- package/esm/use-keyboard/helper.d.ts +1 -1
- package/esm/use-keyboard/index.js +12 -4
- package/esm/use-media-query/index.js +10 -2
- package/esm/use-media-query/use-media-query.d.ts +2 -4
- package/esm/use-modal/index.js +8 -2
- package/esm/use-scale/index.js +23 -6
- package/esm/use-tabs/index.js +8 -2
- package/esm/use-theme/index.js +9 -2
- package/esm/use-toasts/helpers.d.ts +2 -4
- package/esm/use-toasts/index.js +8 -2
- package/esm/utils/collections.d.ts +1 -1
- package/esm/utils/log-warning.d.ts +2 -0
- package/esm/utils/prop-types.d.ts +8 -17
- package/esm/utils/types.d.ts +3 -1
- package/esm/utils/use-bolio-ui-context.d.ts +3 -3
- package/esm/utils/use-default-props.d.ts +2 -1
- package/esm/utils/use-drag.d.ts +1 -1
- package/esm/utils/use-latest.d.ts +3 -0
- package/esm/utils/use-previous.d.ts +1 -1
- package/esm/utils/variant-colors.d.ts +11 -0
- package/package.json +43 -52
- package/dist/utils/use-warning.d.ts +0 -2
- package/esm/Avatar/Avatar.js +0 -91
- package/esm/Avatar/AvatarGroup.js +0 -25
- package/esm/Avatar/AvatarSkeleton.js +0 -20
- package/esm/Avatar/helpers.js +0 -14
- package/esm/Badge/Badge.js +0 -54
- package/esm/Badge/BadgeAnchor.js +0 -64
- package/esm/BolioUIProvider/BolioUIProvider.js +0 -53
- package/esm/BolioUIProvider/ThemeProvider.js +0 -43
- package/esm/Breadcrumbs/Breadcrumbs.js +0 -42
- package/esm/Breadcrumbs/BreadcrumbsItem.js +0 -43
- package/esm/Breadcrumbs/BreadcrumbsSeparator.js +0 -21
- package/esm/Button/Button.js +0 -131
- package/esm/Button/ButtonDrip.js +0 -55
- package/esm/Button/ButtonIcon.js +0 -26
- package/esm/Button/ButtonLoading.js +0 -15
- package/esm/Button/styles.js +0 -232
- package/esm/Button/utils.js +0 -45
- package/esm/ButtonDropdown/ButtonDropdown.js +0 -107
- package/esm/ButtonDropdown/ButtonDropdownContext.js +0 -11
- package/esm/ButtonDropdown/ButtonDropdownItem.js +0 -45
- package/esm/ButtonDropdown/Icon.js +0 -28
- package/esm/ButtonDropdown/styles.js +0 -71
- package/esm/ButtonGroup/ButtonGroup.js +0 -80
- package/esm/ButtonGroup/ButtonGroupContext.js +0 -9
- package/esm/Calendar/Calendar.js +0 -243
- package/esm/Calendar/date-utils.js +0 -39
- package/esm/Capacity/Capacity.js +0 -47
- package/esm/Card/Card.js +0 -66
- package/esm/Card/CardContent.js +0 -24
- package/esm/Card/CardFooter.js +0 -31
- package/esm/Card/styles.js +0 -54
- package/esm/Checkbox/Checkbox.js +0 -102
- package/esm/Checkbox/CheckboxContext.js +0 -10
- package/esm/Checkbox/CheckboxGroup.js +0 -62
- package/esm/Checkbox/CheckboxIcon.js +0 -63
- package/esm/Checkbox/styles.js +0 -34
- package/esm/Code/Code.js +0 -54
- package/esm/Col/Col.js +0 -28
- package/esm/Collapse/Collapse.js +0 -92
- package/esm/Collapse/CollapseContext.js +0 -8
- package/esm/Collapse/CollapseGroup.js +0 -65
- package/esm/Collapse/CollapseIcon.js +0 -26
- package/esm/Combobox/Combobox.js +0 -199
- package/esm/Container/Container.js +0 -62
- package/esm/CssBaseline/CssBaseline.js +0 -12
- package/esm/DatePicker/DatePicker.js +0 -163
- package/esm/Description/Description.js +0 -36
- package/esm/Display/Display.js +0 -40
- package/esm/Divider/Divider.js +0 -60
- package/esm/Dot/Dot.js +0 -51
- package/esm/Drawer/Drawer.js +0 -69
- package/esm/Drawer/DrawerWrapper.js +0 -82
- package/esm/Drawer/helper.js +0 -27
- package/esm/Fieldset/Fieldset.js +0 -84
- package/esm/Fieldset/FieldsetContent.js +0 -25
- package/esm/Fieldset/FieldsetContext.js +0 -9
- package/esm/Fieldset/FieldsetFooter.js +0 -25
- package/esm/Fieldset/FieldsetGroup.js +0 -77
- package/esm/Fieldset/FieldsetSubtitle.js +0 -18
- package/esm/Fieldset/FieldsetTitle.js +0 -20
- package/esm/Grid/BasicItem.js +0 -95
- package/esm/Grid/Grid.js +0 -34
- package/esm/Grid/GridContainer.js +0 -43
- package/esm/Grid/GridTypes.js +0 -6
- package/esm/Image/Image.js +0 -83
- package/esm/Image/ImageBrowser.js +0 -80
- package/esm/Image/ImageBrowserHttpsIcon.js +0 -21
- package/esm/Image/ImageSkeleton.js +0 -20
- package/esm/Image/helpers.js +0 -14
- package/esm/Image/styles.js +0 -15
- package/esm/Input/Input.js +0 -165
- package/esm/Input/InputBlockLabel.js +0 -17
- package/esm/Input/InputIcon.js +0 -17
- package/esm/Input/InputIconClear.js +0 -43
- package/esm/Input/InputLabel.js +0 -16
- package/esm/Input/InputProps.js +0 -13
- package/esm/Input/Password.js +0 -57
- package/esm/Input/PasswordIcon.js +0 -28
- package/esm/Keyboard/Keyboard.js +0 -45
- package/esm/Link/Icon.js +0 -30
- package/esm/Link/Link.js +0 -47
- package/esm/Loading/Loading.js +0 -60
- package/esm/MdxWidgets/MockPage.js +0 -31
- package/esm/MdxWidgets/ParsedCodes/WaitTime.js +0 -11
- package/esm/MdxWidgets/ParsedCodes/index.js +0 -1
- package/esm/Modal/Modal.js +0 -109
- package/esm/Modal/ModalAction.js +0 -67
- package/esm/Modal/ModalActions.js +0 -34
- package/esm/Modal/ModalContent.js +0 -24
- package/esm/Modal/ModalContext.js +0 -6
- package/esm/Modal/ModalSubtitle.js +0 -30
- package/esm/Modal/ModalTitle.js +0 -30
- package/esm/Modal/ModalWrapper.js +0 -76
- package/esm/Next/StyledJsxRegistry.js +0 -26
- package/esm/Note/Note.js +0 -67
- package/esm/Page/Page.js +0 -80
- package/esm/Page/PageContent.js +0 -22
- package/esm/Page/PageFooter.js +0 -21
- package/esm/Page/PageHeader.js +0 -29
- package/esm/Pagination/Pagination.js +0 -99
- package/esm/Pagination/PaginationContext.js +0 -8
- package/esm/Pagination/PaginationEllipsis.js +0 -69
- package/esm/Pagination/PaginationItem.js +0 -44
- package/esm/Pagination/PaginationNext.js +0 -21
- package/esm/Pagination/PaginationPages.js +0 -84
- package/esm/Pagination/PaginationPrevious.js +0 -21
- package/esm/Popover/Popover.js +0 -96
- package/esm/Popover/PopoverContext.js +0 -9
- package/esm/Popover/PopoverItem.js +0 -55
- package/esm/Progress/Progress.js +0 -71
- package/esm/Radio/Radio.js +0 -108
- package/esm/Radio/RadioContext.js +0 -9
- package/esm/Radio/RadioDescription.js +0 -25
- package/esm/Radio/RadioGroup.js +0 -55
- package/esm/Radio/styles.js +0 -41
- package/esm/Rating/Rating.js +0 -104
- package/esm/Rating/RatingIcon.js +0 -18
- package/esm/Row/Row.js +0 -60
- package/esm/Section/Section.js +0 -28
- package/esm/Select/Select.js +0 -223
- package/esm/Select/SelectContext.js +0 -9
- package/esm/Select/SelectDropdown.js +0 -39
- package/esm/Select/SelectIcon.js +0 -21
- package/esm/Select/SelectIconClear.js +0 -37
- package/esm/Select/SelectInput.js +0 -37
- package/esm/Select/SelectMultipleValue.js +0 -21
- package/esm/Select/SelectOption.js +0 -88
- package/esm/Shared/backdrop.js +0 -70
- package/esm/Shared/css-transition.js +0 -66
- package/esm/Shared/dropdown.js +0 -97
- package/esm/Shared/ellipsis.js +0 -13
- package/esm/Shared/expand.js +0 -87
- package/esm/Shared/highlight.js +0 -44
- package/esm/Slider/Slider.js +0 -178
- package/esm/Slider/SliderDot.js +0 -32
- package/esm/Slider/SliderMark.js +0 -35
- package/esm/Slider/styles.js +0 -27
- package/esm/Snippet/Snippet.js +0 -94
- package/esm/Snippet/SnippetIcon.js +0 -25
- package/esm/Snippet/styles.js +0 -58
- package/esm/Spacer/Spacer.js +0 -26
- package/esm/Spinner/Spinner.js +0 -43
- package/esm/Table/Table.js +0 -112
- package/esm/Table/TableBody.js +0 -49
- package/esm/Table/TableCell.js +0 -25
- package/esm/Table/TableColumn.js +0 -35
- package/esm/Table/TableContext.js +0 -9
- package/esm/Table/TableHead.js +0 -55
- package/esm/Table/TableTypes.js +0 -1
- package/esm/Tabs/Tabs.js +0 -140
- package/esm/Tabs/TabsContext.js +0 -8
- package/esm/Tabs/TabsItem.js +0 -89
- package/esm/Tag/Tag.js +0 -79
- package/esm/Text/Child.js +0 -74
- package/esm/Text/Text.js +0 -91
- package/esm/Textarea/Textarea.js +0 -100
- package/esm/Themes/Presets/Dark.js +0 -67
- package/esm/Themes/Presets/Default.js +0 -67
- package/esm/Themes/Presets/Shared.js +0 -42
- package/esm/Themes/Presets/index.js +0 -1
- package/esm/Themes/Themes.js +0 -76
- package/esm/Toggle/Toggle.js +0 -80
- package/esm/Toggle/styles.js +0 -27
- package/esm/Tooltip/Tooltip.js +0 -136
- package/esm/Tooltip/TooltipContent.js +0 -77
- package/esm/Tooltip/TooltipIcon.js +0 -28
- package/esm/Tooltip/helper.js +0 -21
- package/esm/Tooltip/placement.js +0 -160
- package/esm/Tooltip/styles.js +0 -18
- package/esm/use-all-themes/all-themes-context.js +0 -9
- package/esm/use-body-scroll/use-body-scroll.js +0 -60
- package/esm/use-classes/use-classes.js +0 -32
- package/esm/use-click-away/use-click-away.js +0 -19
- package/esm/use-clipboard/use-clipboard.js +0 -39
- package/esm/use-current-state/use-current-state.js +0 -21
- package/esm/use-input/use-input.js +0 -29
- package/esm/use-keyboard/codes.js +0 -95
- package/esm/use-keyboard/helper.js +0 -26
- package/esm/use-keyboard/use-keyboard.js +0 -68
- package/esm/use-media-query/use-media-query.js +0 -79
- package/esm/use-modal/use-modal.js +0 -22
- package/esm/use-scale/scale-context.js +0 -35
- package/esm/use-scale/utils.js +0 -49
- package/esm/use-scale/with-scale.js +0 -105
- package/esm/use-tabs/use-tabs.js +0 -21
- package/esm/use-theme/theme-context.js +0 -7
- package/esm/use-toasts/helpers.js +0 -70
- package/esm/use-toasts/toast-container.js +0 -118
- package/esm/use-toasts/toast-item.js +0 -45
- package/esm/use-toasts/use-toast.js +0 -101
- package/esm/utils/calculations.js +0 -27
- package/esm/utils/collections.js +0 -126
- package/esm/utils/color.js +0 -35
- package/esm/utils/layouts.js +0 -71
- package/esm/utils/prop-types.js +0 -20
- package/esm/utils/types.js +0 -1
- package/esm/utils/use-body-scroll.js +0 -2
- package/esm/utils/use-bolio-ui-context.js +0 -27
- package/esm/utils/use-click-anywhere.js +0 -13
- package/esm/utils/use-click-away.js +0 -2
- package/esm/utils/use-clipboard.js +0 -2
- package/esm/utils/use-context-state/create-bolio-ui-context.js +0 -49
- package/esm/utils/use-context-state/use-context-state.js +0 -38
- package/esm/utils/use-current-state.js +0 -2
- package/esm/utils/use-default-props.js +0 -17
- package/esm/utils/use-dom-observer.js +0 -24
- package/esm/utils/use-drag.js +0 -64
- package/esm/utils/use-portal.js +0 -32
- package/esm/utils/use-previous.js +0 -9
- package/esm/utils/use-real-shape.js +0 -45
- package/esm/utils/use-resize.js +0 -17
- package/esm/utils/use-ssr.js +0 -17
- package/esm/utils/use-warning.d.ts +0 -2
- package/esm/utils/use-warning.js +0 -13
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// core/utils/layouts.ts
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
var getElementOffset = (el) => {
|
|
4
|
+
if (!el)
|
|
5
|
+
return {
|
|
6
|
+
top: 0,
|
|
7
|
+
left: 0
|
|
8
|
+
};
|
|
9
|
+
const { top, left } = el.getBoundingClientRect();
|
|
10
|
+
return { top, left };
|
|
11
|
+
};
|
|
12
|
+
var defaultRect = {
|
|
13
|
+
top: -1e3,
|
|
14
|
+
left: -1e3,
|
|
15
|
+
right: -1e3,
|
|
16
|
+
width: 0,
|
|
17
|
+
height: 0,
|
|
18
|
+
elementTop: -1e3
|
|
19
|
+
};
|
|
20
|
+
var getRectFromDOMWithContainer = (domRect, getContainer) => {
|
|
21
|
+
if (!domRect) return defaultRect;
|
|
22
|
+
const container = getContainer ? getContainer() : null;
|
|
23
|
+
const scrollElement = container || document.documentElement;
|
|
24
|
+
const { top: offsetTop, left: offsetLeft } = getElementOffset(container);
|
|
25
|
+
return {
|
|
26
|
+
...domRect,
|
|
27
|
+
width: domRect.width || domRect.right - domRect.left,
|
|
28
|
+
height: domRect.height || domRect.top - domRect.bottom,
|
|
29
|
+
top: domRect.bottom + scrollElement.scrollTop - offsetTop,
|
|
30
|
+
left: domRect.left + scrollElement.scrollLeft - offsetLeft,
|
|
31
|
+
elementTop: domRect.top + scrollElement.scrollTop - offsetTop
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
var isUnplacedRect = (rect) => {
|
|
35
|
+
if (!rect) return true;
|
|
36
|
+
return rect.top === defaultRect.top && rect.left === defaultRect.left;
|
|
37
|
+
};
|
|
38
|
+
var getRefRect = (ref, getContainer) => {
|
|
39
|
+
if (!ref || !ref.current) return defaultRect;
|
|
40
|
+
const rect = ref.current.getBoundingClientRect();
|
|
41
|
+
return getRectFromDOMWithContainer(rect, getContainer);
|
|
42
|
+
};
|
|
43
|
+
var getEventRect = (event, getContainer) => {
|
|
44
|
+
var _a;
|
|
45
|
+
const rect = (_a = event == null ? void 0 : event.target) == null ? void 0 : _a.getBoundingClientRect();
|
|
46
|
+
if (!rect) return defaultRect;
|
|
47
|
+
return getRectFromDOMWithContainer(rect, getContainer);
|
|
48
|
+
};
|
|
49
|
+
var isRefTarget = (eventOrRef) => {
|
|
50
|
+
return typeof (eventOrRef == null ? void 0 : eventOrRef.target) === "undefined";
|
|
51
|
+
};
|
|
52
|
+
var useRect = (initialState) => {
|
|
53
|
+
const [rect, setRect] = useState(
|
|
54
|
+
initialState || defaultRect
|
|
55
|
+
);
|
|
56
|
+
const updateRect = (eventOrRef, getContainer) => {
|
|
57
|
+
if (isRefTarget(eventOrRef))
|
|
58
|
+
return setRect(getRefRect(eventOrRef, getContainer));
|
|
59
|
+
setRect(getEventRect(eventOrRef, getContainer));
|
|
60
|
+
};
|
|
61
|
+
return {
|
|
62
|
+
rect,
|
|
63
|
+
setRect: updateRect
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export {
|
|
68
|
+
isUnplacedRect,
|
|
69
|
+
getRefRect,
|
|
70
|
+
useRect
|
|
71
|
+
};
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ModalContent_default,
|
|
3
|
+
ModalSubtitle_default,
|
|
4
|
+
ModalTitle_default,
|
|
5
|
+
backdrop_default,
|
|
6
|
+
use_body_scroll_default
|
|
7
|
+
} from "./chunk-K53ERLS7.js";
|
|
8
|
+
import {
|
|
9
|
+
use_keyboard_default
|
|
10
|
+
} from "./chunk-F3AL4TQZ.js";
|
|
11
|
+
import {
|
|
12
|
+
css_transition_default
|
|
13
|
+
} from "./chunk-LDTDMDE6.js";
|
|
14
|
+
import {
|
|
15
|
+
use_portal_default
|
|
16
|
+
} from "./chunk-BXDUHMWS.js";
|
|
17
|
+
import {
|
|
18
|
+
use_scale_default,
|
|
19
|
+
with_scale_default
|
|
20
|
+
} from "./chunk-S62PPQHN.js";
|
|
21
|
+
import {
|
|
22
|
+
isChildElement
|
|
23
|
+
} from "./chunk-UX2B3G6U.js";
|
|
24
|
+
import {
|
|
25
|
+
use_theme_default
|
|
26
|
+
} from "./chunk-45MVPPJN.js";
|
|
27
|
+
import {
|
|
28
|
+
use_classes_default
|
|
29
|
+
} from "./chunk-5KUROAEP.js";
|
|
30
|
+
|
|
31
|
+
// core/Drawer/Drawer.tsx
|
|
32
|
+
import React2, { useEffect as useEffect2, useState } from "react";
|
|
33
|
+
import { createPortal } from "react-dom";
|
|
34
|
+
|
|
35
|
+
// core/Drawer/DrawerWrapper.tsx
|
|
36
|
+
import _JSXStyle from "styled-jsx/style";
|
|
37
|
+
import React, { useEffect, useImperativeHandle, useMemo, useRef } from "react";
|
|
38
|
+
|
|
39
|
+
// core/Drawer/helper.ts
|
|
40
|
+
var getDrawerTransform = (placement) => {
|
|
41
|
+
const translates = {
|
|
42
|
+
top: {
|
|
43
|
+
initial: "translate3d(0, -100%, 0)",
|
|
44
|
+
hidden: "translate3d(0, -100%, 0)",
|
|
45
|
+
visible: "translate3d(0, 0, 0)"
|
|
46
|
+
},
|
|
47
|
+
left: {
|
|
48
|
+
initial: "translate3d(-100%, 0, 0)",
|
|
49
|
+
hidden: "translate3d(-100%, 0, 0)",
|
|
50
|
+
visible: "translate3d(0, 0, 0)"
|
|
51
|
+
},
|
|
52
|
+
bottom: {
|
|
53
|
+
initial: "translate3d(0, 100%, 0)",
|
|
54
|
+
hidden: "translate3d(0, 100%, 0)",
|
|
55
|
+
visible: "translate3d(0, 0, 0)"
|
|
56
|
+
},
|
|
57
|
+
right: {
|
|
58
|
+
initial: "translate3d(100%, 0, 0)",
|
|
59
|
+
hidden: "translate3d(100%, 0, 0)",
|
|
60
|
+
visible: "translate3d(0, 0, 0)"
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
return translates[placement];
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
// core/Drawer/DrawerWrapper.tsx
|
|
67
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
68
|
+
var DrawerWrapper = React.forwardRef(({
|
|
69
|
+
className = "",
|
|
70
|
+
children,
|
|
71
|
+
visible = false,
|
|
72
|
+
placement,
|
|
73
|
+
...props
|
|
74
|
+
}, ref) => {
|
|
75
|
+
const theme = use_theme_default();
|
|
76
|
+
const {
|
|
77
|
+
SCALES
|
|
78
|
+
} = use_scale_default();
|
|
79
|
+
const modalContent = useRef(null);
|
|
80
|
+
useImperativeHandle(ref, () => modalContent.current);
|
|
81
|
+
const tabStart = useRef(null);
|
|
82
|
+
const tabEnd = useRef(null);
|
|
83
|
+
const transform = useMemo(() => getDrawerTransform(placement), [placement]);
|
|
84
|
+
const classes = use_classes_default("wrapper", placement, className);
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
if (!visible) return;
|
|
87
|
+
const activeElement = document.activeElement;
|
|
88
|
+
const isChild = isChildElement(modalContent.current, activeElement);
|
|
89
|
+
if (isChild) return;
|
|
90
|
+
if (tabStart.current) tabStart.current.focus();
|
|
91
|
+
}, [visible]);
|
|
92
|
+
const onKeyDown = (event) => {
|
|
93
|
+
const isTabDown = event.keyCode === 9;
|
|
94
|
+
if (!visible || !isTabDown) return;
|
|
95
|
+
const activeElement = document.activeElement;
|
|
96
|
+
if (event.shiftKey) {
|
|
97
|
+
if (activeElement === tabStart.current) {
|
|
98
|
+
if (tabEnd.current) tabEnd.current.focus();
|
|
99
|
+
}
|
|
100
|
+
} else {
|
|
101
|
+
if (activeElement === tabEnd.current) {
|
|
102
|
+
if (tabStart.current) tabStart.current.focus();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
return /* @__PURE__ */ jsx(css_transition_default, { name: "wrapper", visible, clearTime: 300, children: /* @__PURE__ */ jsxs("div", { role: "dialog", "aria-modal": "true", tabIndex: -1, onKeyDown, ref: modalContent, ...props, className: _JSXStyle.dynamic([["157760385", [theme.palette.background, theme.palette.foreground, theme.layout.radius, theme.expressiveness.shadowLarge, transform.initial, SCALES.font(1), SCALES.pl(1.3125), SCALES.pr(1.3125), SCALES.pt(1.3125), SCALES.pb(1.3125), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, "100%"), SCALES.height(1, "auto"), SCALES.width(1, "auto"), SCALES.height(1, "100%"), transform.hidden, transform.visible, transform.visible, transform.hidden]]]) + " " + (props && props.className != null && props.className || classes || ""), children: [
|
|
107
|
+
/* @__PURE__ */ jsx("div", { tabIndex: 0, "aria-hidden": "true", ref: tabStart, className: _JSXStyle.dynamic([["157760385", [theme.palette.background, theme.palette.foreground, theme.layout.radius, theme.expressiveness.shadowLarge, transform.initial, SCALES.font(1), SCALES.pl(1.3125), SCALES.pr(1.3125), SCALES.pt(1.3125), SCALES.pb(1.3125), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, "100%"), SCALES.height(1, "auto"), SCALES.width(1, "auto"), SCALES.height(1, "100%"), transform.hidden, transform.visible, transform.visible, transform.hidden]]]) + " hide-tab start" }),
|
|
108
|
+
children,
|
|
109
|
+
/* @__PURE__ */ jsx("div", { tabIndex: 0, "aria-hidden": "true", ref: tabEnd, className: _JSXStyle.dynamic([["157760385", [theme.palette.background, theme.palette.foreground, theme.layout.radius, theme.expressiveness.shadowLarge, transform.initial, SCALES.font(1), SCALES.pl(1.3125), SCALES.pr(1.3125), SCALES.pt(1.3125), SCALES.pb(1.3125), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, "100%"), SCALES.height(1, "auto"), SCALES.width(1, "auto"), SCALES.height(1, "100%"), transform.hidden, transform.visible, transform.visible, transform.hidden]]]) + " hide-tab end" }),
|
|
110
|
+
/* @__PURE__ */ jsx(_JSXStyle, { id: "157760385", dynamic: [theme.palette.background, theme.palette.foreground, theme.layout.radius, theme.expressiveness.shadowLarge, transform.initial, SCALES.font(1), SCALES.pl(1.3125), SCALES.pr(1.3125), SCALES.pt(1.3125), SCALES.pb(1.3125), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, "100%"), SCALES.height(1, "auto"), SCALES.width(1, "auto"), SCALES.height(1, "100%"), transform.hidden, transform.visible, transform.visible, transform.hidden], children: `.wrapper.__jsx-style-dynamic-selector{position:fixed;top:0;left:0;right:0;bottom:0;max-width:100%;vertical-align:middle;overflow:auto;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;box-sizing:border-box;background-color:${theme.palette.background};color:${theme.palette.foreground};border-radius:calc(3 * ${theme.layout.radius});box-shadow:${theme.expressiveness.shadowLarge};opacity:0;outline:none;-webkit-transform:${transform.initial};-ms-transform:${transform.initial};transform:${transform.initial};-webkit-transition: opacity, -webkit-transform 400ms cubic-bezier(0.1,0.6,0.1,1);-webkit-transition: opacity, transform 400ms cubic-bezier(0.1,0.6,0.1,1);transition: opacity, transform 400ms cubic-bezier(0.1,0.6,0.1,1);font-size:${SCALES.font(1)};--modal-wrapper-padding-left:${SCALES.pl(1.3125)};--modal-wrapper-padding-right:${SCALES.pr(1.3125)};padding:${SCALES.pt(1.3125)} var(--modal-wrapper-padding-right) ${SCALES.pb(1.3125)} var(--modal-wrapper-padding-left);margin:${SCALES.mt(0)} ${SCALES.mr(0)} ${SCALES.mb(0)} ${SCALES.ml(0)};}.top.__jsx-style-dynamic-selector,.bottom.__jsx-style-dynamic-selector{width:${SCALES.width(1, "100%")};height:${SCALES.height(1, "auto")};}.left.__jsx-style-dynamic-selector,.right.__jsx-style-dynamic-selector{width:${SCALES.width(1, "auto")};height:${SCALES.height(1, "100%")};}.top.__jsx-style-dynamic-selector{bottom:auto;border-top-left-radius:0;border-top-right-radius:0;}.left.__jsx-style-dynamic-selector{right:auto;border-top-left-radius:0;border-bottom-left-radius:0;}.bottom.__jsx-style-dynamic-selector{top:auto;border-bottom-left-radius:0;border-bottom-right-radius:0;}.right.__jsx-style-dynamic-selector{left:auto;border-top-right-radius:0;border-bottom-right-radius:0;}.wrapper-enter.__jsx-style-dynamic-selector{opacity:0;-webkit-transform:${transform.hidden};-ms-transform:${transform.hidden};transform:${transform.hidden};}.wrapper-enter-active.__jsx-style-dynamic-selector{opacity:1;-webkit-transform:${transform.visible};-ms-transform:${transform.visible};transform:${transform.visible};}.wrapper-leave.__jsx-style-dynamic-selector{opacity:1;-webkit-transform:${transform.visible};-ms-transform:${transform.visible};transform:${transform.visible};-webkit-transition: opacity, -webkit-transform 400ms cubic-bezier(0.1,0.2,0.1,1);-webkit-transition: opacity, transform 400ms cubic-bezier(0.1,0.2,0.1,1);transition: opacity, transform 400ms cubic-bezier(0.1,0.2,0.1,1);}.wrapper-leave-active.__jsx-style-dynamic-selector{opacity:0.4;-webkit-transform:${transform.hidden};-ms-transform:${transform.hidden};transform:${transform.hidden};}.hide-tab.__jsx-style-dynamic-selector{outline:none;overflow:hidden;width:0;height:0;opacity:0;}` })
|
|
111
|
+
] }) });
|
|
112
|
+
});
|
|
113
|
+
DrawerWrapper.displayName = "BolioUIDrawerWrapper";
|
|
114
|
+
var DrawerWrapper_default = DrawerWrapper;
|
|
115
|
+
|
|
116
|
+
// core/Drawer/Drawer.tsx
|
|
117
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
118
|
+
var DrawerComponent = React2.forwardRef(
|
|
119
|
+
({
|
|
120
|
+
visible: customVisible,
|
|
121
|
+
keyboard = true,
|
|
122
|
+
disableBackdropClick,
|
|
123
|
+
wrapClassName,
|
|
124
|
+
children,
|
|
125
|
+
placement,
|
|
126
|
+
onClose,
|
|
127
|
+
onContentClick,
|
|
128
|
+
...props
|
|
129
|
+
}, ref) => {
|
|
130
|
+
const portal = use_portal_default("drawer");
|
|
131
|
+
const [visible, setVisible] = useState(false);
|
|
132
|
+
const [, setBodyHidden] = use_body_scroll_default(null, { delayReset: 300 });
|
|
133
|
+
const closeDrawer = () => {
|
|
134
|
+
if (onClose) onClose();
|
|
135
|
+
setVisible(false);
|
|
136
|
+
setBodyHidden(false);
|
|
137
|
+
};
|
|
138
|
+
useEffect2(() => {
|
|
139
|
+
if (typeof customVisible === "undefined") return;
|
|
140
|
+
setVisible(customVisible);
|
|
141
|
+
setBodyHidden(customVisible);
|
|
142
|
+
}, [customVisible, setBodyHidden]);
|
|
143
|
+
const { bindings } = use_keyboard_default(
|
|
144
|
+
() => {
|
|
145
|
+
if (keyboard) closeDrawer();
|
|
146
|
+
},
|
|
147
|
+
27 /* Escape */,
|
|
148
|
+
{
|
|
149
|
+
disableGlobalEvent: true
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
const closeFromBackdrop = () => {
|
|
153
|
+
if (disableBackdropClick) return;
|
|
154
|
+
closeDrawer();
|
|
155
|
+
};
|
|
156
|
+
if (!portal) return null;
|
|
157
|
+
return createPortal(
|
|
158
|
+
/* @__PURE__ */ jsx2(
|
|
159
|
+
backdrop_default,
|
|
160
|
+
{
|
|
161
|
+
onClick: closeFromBackdrop,
|
|
162
|
+
onContentClick,
|
|
163
|
+
visible,
|
|
164
|
+
width: "100%",
|
|
165
|
+
...bindings,
|
|
166
|
+
children: /* @__PURE__ */ jsx2(
|
|
167
|
+
DrawerWrapper_default,
|
|
168
|
+
{
|
|
169
|
+
ref,
|
|
170
|
+
visible,
|
|
171
|
+
className: wrapClassName,
|
|
172
|
+
placement,
|
|
173
|
+
...props,
|
|
174
|
+
children
|
|
175
|
+
}
|
|
176
|
+
)
|
|
177
|
+
}
|
|
178
|
+
),
|
|
179
|
+
portal
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
);
|
|
183
|
+
DrawerComponent.displayName = "BolioUIDrawer";
|
|
184
|
+
var Drawer = with_scale_default(DrawerComponent);
|
|
185
|
+
var Drawer_default = Drawer;
|
|
186
|
+
|
|
187
|
+
// core/Drawer/index.ts
|
|
188
|
+
Drawer_default.Title = ModalTitle_default;
|
|
189
|
+
Drawer_default.Subtitle = ModalSubtitle_default;
|
|
190
|
+
Drawer_default.Content = ModalContent_default;
|
|
191
|
+
var Drawer_default2 = Drawer_default;
|
|
192
|
+
|
|
193
|
+
export {
|
|
194
|
+
Drawer_default2 as Drawer_default
|
|
195
|
+
};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import {
|
|
2
|
+
use_scale_default,
|
|
3
|
+
with_scale_default
|
|
4
|
+
} from "./chunk-S62PPQHN.js";
|
|
5
|
+
import {
|
|
6
|
+
use_theme_default
|
|
7
|
+
} from "./chunk-45MVPPJN.js";
|
|
8
|
+
import {
|
|
9
|
+
joinClasses,
|
|
10
|
+
use_classes_default
|
|
11
|
+
} from "./chunk-5KUROAEP.js";
|
|
12
|
+
|
|
13
|
+
// core/Combobox/Combobox.tsx
|
|
14
|
+
import _JSXStyle from "styled-jsx/style";
|
|
15
|
+
import React, { useEffect, useId, useMemo, useState } from "react";
|
|
16
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
+
var getLabel = (option) => {
|
|
18
|
+
var _a;
|
|
19
|
+
return option ? (_a = option.label) != null ? _a : option.value : "";
|
|
20
|
+
};
|
|
21
|
+
var defaultFilter = (option, text) => getLabel(option).toLowerCase().includes(text.trim().toLowerCase());
|
|
22
|
+
var firstEnabled = (options) => options.findIndex((option) => !option.disabled);
|
|
23
|
+
var ComboboxComponent = React.forwardRef(({
|
|
24
|
+
options,
|
|
25
|
+
value: customValue,
|
|
26
|
+
initialValue = null,
|
|
27
|
+
onChange,
|
|
28
|
+
onInputChange,
|
|
29
|
+
placeholder,
|
|
30
|
+
disabled = false,
|
|
31
|
+
emptyText = "No results",
|
|
32
|
+
filter = defaultFilter,
|
|
33
|
+
className = "",
|
|
34
|
+
onKeyDown,
|
|
35
|
+
onBlur,
|
|
36
|
+
...props
|
|
37
|
+
}, ref) => {
|
|
38
|
+
const theme = use_theme_default();
|
|
39
|
+
const {
|
|
40
|
+
SCALES
|
|
41
|
+
} = use_scale_default();
|
|
42
|
+
const baseId = useId();
|
|
43
|
+
const listId = `${baseId}-list`;
|
|
44
|
+
const optionId = (index) => `${baseId}-option-${index}`;
|
|
45
|
+
const isControlled = customValue !== void 0;
|
|
46
|
+
const [selfValue, setSelfValue] = useState(initialValue);
|
|
47
|
+
const selected = isControlled ? customValue : selfValue;
|
|
48
|
+
const selectedOption = options.find((option) => option.value === selected);
|
|
49
|
+
const selectedLabel = getLabel(selectedOption);
|
|
50
|
+
const [text, setText] = useState(selectedLabel);
|
|
51
|
+
const [open, setOpen] = useState(false);
|
|
52
|
+
const [activeIndex, setActiveIndex] = useState(-1);
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
setText(selectedLabel);
|
|
55
|
+
}, [selectedLabel]);
|
|
56
|
+
const query = selectedOption && text === selectedLabel ? "" : text;
|
|
57
|
+
const visible = useMemo(() => options.filter((option) => filter(option, query)), [options, filter, query]);
|
|
58
|
+
const expanded = open && visible.length > 0;
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
setActiveIndex(open ? firstEnabled(visible) : -1);
|
|
61
|
+
}, [open, query]);
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
var _a;
|
|
64
|
+
if (activeIndex < 0) return;
|
|
65
|
+
const element = document.getElementById(optionId(activeIndex));
|
|
66
|
+
(_a = element == null ? void 0 : element.scrollIntoView) == null ? void 0 : _a.call(element, {
|
|
67
|
+
block: "nearest"
|
|
68
|
+
});
|
|
69
|
+
}, [activeIndex]);
|
|
70
|
+
const choose = (option) => {
|
|
71
|
+
if (option.disabled) return;
|
|
72
|
+
if (!isControlled) setSelfValue(option.value);
|
|
73
|
+
setText(getLabel(option));
|
|
74
|
+
setOpen(false);
|
|
75
|
+
if (onChange) onChange(option.value);
|
|
76
|
+
};
|
|
77
|
+
const inputHandler = (event) => {
|
|
78
|
+
const next = event.target.value;
|
|
79
|
+
setText(next);
|
|
80
|
+
setOpen(true);
|
|
81
|
+
if (onInputChange) onInputChange(next);
|
|
82
|
+
if (next === "" && selected !== null) {
|
|
83
|
+
if (!isControlled) setSelfValue(null);
|
|
84
|
+
if (onChange) onChange(null);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
const move = (direction) => {
|
|
88
|
+
const count = visible.length;
|
|
89
|
+
if (!count) return;
|
|
90
|
+
let index = activeIndex === -1 ? direction === 1 ? -1 : count : activeIndex;
|
|
91
|
+
for (let step = 0; step < count; step++) {
|
|
92
|
+
index = (index + direction + count) % count;
|
|
93
|
+
if (!visible[index].disabled) return setActiveIndex(index);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
const keyDownHandler = (event) => {
|
|
97
|
+
if (onKeyDown) onKeyDown(event);
|
|
98
|
+
if (event.defaultPrevented) return;
|
|
99
|
+
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
100
|
+
event.preventDefault();
|
|
101
|
+
if (!open) return setOpen(true);
|
|
102
|
+
return move(event.key === "ArrowDown" ? 1 : -1);
|
|
103
|
+
}
|
|
104
|
+
if (event.key === "Enter" && expanded && activeIndex >= 0) {
|
|
105
|
+
event.preventDefault();
|
|
106
|
+
return choose(visible[activeIndex]);
|
|
107
|
+
}
|
|
108
|
+
if (event.key === "Escape" && open) {
|
|
109
|
+
event.preventDefault();
|
|
110
|
+
setOpen(false);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
const blurHandler = (event) => {
|
|
114
|
+
if (onBlur) onBlur(event);
|
|
115
|
+
setOpen(false);
|
|
116
|
+
setText(selectedLabel);
|
|
117
|
+
};
|
|
118
|
+
return /* @__PURE__ */ jsxs("div", { className: _JSXStyle.dynamic([["1685493807", [SCALES.font(1), SCALES.width(1, "initial"), SCALES.height(1, "auto"), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.foreground, theme.palette.background, theme.palette.border, theme.layout.radius, theme.palette.primary, theme.palette.accents_4, theme.palette.accents_1, theme.palette.background, theme.palette.border, theme.layout.radius, theme.expressiveness.shadowMedium, theme.palette.foreground, theme.palette.accents_2, theme.palette.accents_4, theme.palette.accents_5]]]) + " " + (use_classes_default("combobox", className) || ""), children: [
|
|
119
|
+
/* @__PURE__ */ jsx("input", { ref, type: "text", role: "combobox", autoComplete: "off", "aria-autocomplete": "list", "aria-expanded": expanded, "aria-controls": expanded ? listId : void 0, "aria-activedescendant": expanded && activeIndex >= 0 ? optionId(activeIndex) : void 0, value: text, placeholder, disabled, onChange: inputHandler, onKeyDown: keyDownHandler, onBlur: blurHandler, ...props, className: _JSXStyle.dynamic([["1685493807", [SCALES.font(1), SCALES.width(1, "initial"), SCALES.height(1, "auto"), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.foreground, theme.palette.background, theme.palette.border, theme.layout.radius, theme.palette.primary, theme.palette.accents_4, theme.palette.accents_1, theme.palette.background, theme.palette.border, theme.layout.radius, theme.expressiveness.shadowMedium, theme.palette.foreground, theme.palette.accents_2, theme.palette.accents_4, theme.palette.accents_5]]]) + " " + (props && props.className != null && props.className || "") }),
|
|
120
|
+
expanded && /* @__PURE__ */ jsx("ul", { id: listId, role: "listbox", className: _JSXStyle.dynamic([["1685493807", [SCALES.font(1), SCALES.width(1, "initial"), SCALES.height(1, "auto"), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.foreground, theme.palette.background, theme.palette.border, theme.layout.radius, theme.palette.primary, theme.palette.accents_4, theme.palette.accents_1, theme.palette.background, theme.palette.border, theme.layout.radius, theme.expressiveness.shadowMedium, theme.palette.foreground, theme.palette.accents_2, theme.palette.accents_4, theme.palette.accents_5]]]), children: visible.map((option, index) => /* @__PURE__ */ jsx("li", { id: optionId(index), role: "option", "aria-selected": option.value === selected, "aria-disabled": option.disabled || void 0, onMouseDown: (event) => {
|
|
121
|
+
event.preventDefault();
|
|
122
|
+
choose(option);
|
|
123
|
+
}, onMouseMove: () => !option.disabled && setActiveIndex(index), className: _JSXStyle.dynamic([["1685493807", [SCALES.font(1), SCALES.width(1, "initial"), SCALES.height(1, "auto"), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.foreground, theme.palette.background, theme.palette.border, theme.layout.radius, theme.palette.primary, theme.palette.accents_4, theme.palette.accents_1, theme.palette.background, theme.palette.border, theme.layout.radius, theme.expressiveness.shadowMedium, theme.palette.foreground, theme.palette.accents_2, theme.palette.accents_4, theme.palette.accents_5]]]) + " " + (joinClasses({
|
|
124
|
+
active: index === activeIndex,
|
|
125
|
+
selected: option.value === selected,
|
|
126
|
+
disabled: option.disabled
|
|
127
|
+
}) || ""), children: getLabel(option) }, option.value)) }),
|
|
128
|
+
open && visible.length === 0 && /* @__PURE__ */ jsx("div", { className: _JSXStyle.dynamic([["1685493807", [SCALES.font(1), SCALES.width(1, "initial"), SCALES.height(1, "auto"), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.foreground, theme.palette.background, theme.palette.border, theme.layout.radius, theme.palette.primary, theme.palette.accents_4, theme.palette.accents_1, theme.palette.background, theme.palette.border, theme.layout.radius, theme.expressiveness.shadowMedium, theme.palette.foreground, theme.palette.accents_2, theme.palette.accents_4, theme.palette.accents_5]]]) + " empty", children: emptyText }),
|
|
129
|
+
/* @__PURE__ */ jsx("div", { role: "status", className: _JSXStyle.dynamic([["1685493807", [SCALES.font(1), SCALES.width(1, "initial"), SCALES.height(1, "auto"), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.foreground, theme.palette.background, theme.palette.border, theme.layout.radius, theme.palette.primary, theme.palette.accents_4, theme.palette.accents_1, theme.palette.background, theme.palette.border, theme.layout.radius, theme.expressiveness.shadowMedium, theme.palette.foreground, theme.palette.accents_2, theme.palette.accents_4, theme.palette.accents_5]]]) + " sr-only", children: expanded ? `${visible.length} result${visible.length === 1 ? "" : "s"} available` : "" }),
|
|
130
|
+
/* @__PURE__ */ jsx(_JSXStyle, { id: "1685493807", dynamic: [SCALES.font(1), SCALES.width(1, "initial"), SCALES.height(1, "auto"), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.foreground, theme.palette.background, theme.palette.border, theme.layout.radius, theme.palette.primary, theme.palette.accents_4, theme.palette.accents_1, theme.palette.background, theme.palette.border, theme.layout.radius, theme.expressiveness.shadowMedium, theme.palette.foreground, theme.palette.accents_2, theme.palette.accents_4, theme.palette.accents_5], children: `.combobox.__jsx-style-dynamic-selector{position:relative;display:inline-block;font-size:${SCALES.font(1)};width:${SCALES.width(1, "initial")};height:${SCALES.height(1, "auto")};padding:${SCALES.pt(0)} ${SCALES.pr(0)} ${SCALES.pb(0)} ${SCALES.pl(0)};margin:${SCALES.mt(0)} ${SCALES.mr(0)} ${SCALES.mb(0)} ${SCALES.ml(0)};}input.__jsx-style-dynamic-selector{box-sizing:border-box;width:100%;min-width:12.5em;height:2.5em;padding:0 0.875em;font:inherit;color:${theme.palette.foreground};background-color:${theme.palette.background};border:1px solid ${theme.palette.border};border-radius:${theme.layout.radius};outline:none;-webkit-transition:border-color 0.15s ease;transition:border-color 0.15s ease;}input.__jsx-style-dynamic-selector:focus{border-color:${theme.palette.primary};}input.__jsx-style-dynamic-selector:disabled{cursor:not-allowed;color:${theme.palette.accents_4};background-color:${theme.palette.accents_1};}ul.__jsx-style-dynamic-selector,.empty.__jsx-style-dynamic-selector{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:1100;box-sizing:border-box;background-color:${theme.palette.background};border:1px solid ${theme.palette.border};border-radius:${theme.layout.radius};box-shadow:${theme.expressiveness.shadowMedium};}ul.__jsx-style-dynamic-selector{max-height:15em;overflow-y:auto;margin:0;padding:0.25em;list-style:none;}li.__jsx-style-dynamic-selector{padding:0.5em 0.75em;border-radius:4px;cursor:pointer;color:${theme.palette.foreground};}li.active.__jsx-style-dynamic-selector{background-color:${theme.palette.accents_2};}li.selected.__jsx-style-dynamic-selector{font-weight:600;}li.disabled.__jsx-style-dynamic-selector{cursor:not-allowed;color:${theme.palette.accents_4};}.empty.__jsx-style-dynamic-selector{padding:0.75em;color:${theme.palette.accents_5};}.sr-only.__jsx-style-dynamic-selector{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;-webkit-clip:rect(0 0 0 0);clip:rect(0 0 0 0);white-space:nowrap;border:0;}` })
|
|
131
|
+
] });
|
|
132
|
+
});
|
|
133
|
+
ComboboxComponent.displayName = "BolioUICombobox";
|
|
134
|
+
var Combobox = with_scale_default(ComboboxComponent);
|
|
135
|
+
var Combobox_default = Combobox;
|
|
136
|
+
|
|
137
|
+
// core/Combobox/index.ts
|
|
138
|
+
var Combobox_default2 = Combobox_default;
|
|
139
|
+
|
|
140
|
+
export {
|
|
141
|
+
Combobox_default2 as Combobox_default
|
|
142
|
+
};
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import {
|
|
2
|
+
use_resize_default
|
|
3
|
+
} from "./chunk-JJFOGZ6V.js";
|
|
4
|
+
import {
|
|
5
|
+
use_real_shape_default
|
|
6
|
+
} from "./chunk-HKOESPKZ.js";
|
|
7
|
+
import {
|
|
8
|
+
log_warning_default
|
|
9
|
+
} from "./chunk-AXYDJGTN.js";
|
|
10
|
+
import {
|
|
11
|
+
use_scale_default,
|
|
12
|
+
with_scale_default
|
|
13
|
+
} from "./chunk-S62PPQHN.js";
|
|
14
|
+
import {
|
|
15
|
+
use_theme_default
|
|
16
|
+
} from "./chunk-45MVPPJN.js";
|
|
17
|
+
import {
|
|
18
|
+
joinClasses
|
|
19
|
+
} from "./chunk-5KUROAEP.js";
|
|
20
|
+
|
|
21
|
+
// core/Table/Table.tsx
|
|
22
|
+
import _JSXStyle3 from "styled-jsx/style";
|
|
23
|
+
import React4, { useCallback, useEffect as useEffect2, useImperativeHandle, useMemo as useMemo2, useRef, useState } from "react";
|
|
24
|
+
|
|
25
|
+
// core/Table/TableHead.tsx
|
|
26
|
+
import _JSXStyle from "styled-jsx/style";
|
|
27
|
+
import { useMemo } from "react";
|
|
28
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
29
|
+
var makeColgroup = (width, columns) => {
|
|
30
|
+
const unsetWidthCount = columns.filter((c) => !c.width).length;
|
|
31
|
+
const customWidthTotal = columns.reduce((pre, current) => {
|
|
32
|
+
return current.width ? pre + current.width : pre;
|
|
33
|
+
}, 0);
|
|
34
|
+
const averageWidth = (width - customWidthTotal) / unsetWidthCount;
|
|
35
|
+
if (averageWidth <= 0) return /* @__PURE__ */ jsx("colgroup", {});
|
|
36
|
+
return /* @__PURE__ */ jsx("colgroup", { children: columns.map((column, index) => /* @__PURE__ */ jsx("col", { width: column.width || averageWidth }, `colgroup-${index}`)) });
|
|
37
|
+
};
|
|
38
|
+
var TableHead = (props) => {
|
|
39
|
+
const theme = use_theme_default();
|
|
40
|
+
const {
|
|
41
|
+
columns,
|
|
42
|
+
width
|
|
43
|
+
} = props;
|
|
44
|
+
const isScalableWidth = useMemo(() => columns.find((item) => !!item.width), [columns]);
|
|
45
|
+
const colgroup = useMemo(() => {
|
|
46
|
+
if (!isScalableWidth) return /* @__PURE__ */ jsx("colgroup", {});
|
|
47
|
+
return makeColgroup(width, columns);
|
|
48
|
+
}, [isScalableWidth, width, columns]);
|
|
49
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
50
|
+
colgroup,
|
|
51
|
+
/* @__PURE__ */ jsx("thead", { className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]]), children: /* @__PURE__ */ jsx("tr", { className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]]), children: columns.map((column, index) => /* @__PURE__ */ jsx("th", { className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]]) + " " + (column.className || ""), children: /* @__PURE__ */ jsx("div", { className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]]) + " thead-box", children: column.label }) }, `table-th-${String(column.prop)}-${index}`)) }) }),
|
|
52
|
+
/* @__PURE__ */ jsx(_JSXStyle, { id: "134865897", dynamic: [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius], children: `thead.__jsx-style-dynamic-selector{border-collapse:separate;border-spacing:0;font-size:inherit;}th.__jsx-style-dynamic-selector{padding:0 0.5em;font-size:calc(0.75 * var(--table-font-size));font-weight:normal;text-align:left;-webkit-letter-spacing:0;-moz-letter-spacing:0;-ms-letter-spacing:0;letter-spacing:0;vertical-align:middle;min-height:calc(2.5 * var(--table-font-size));color:${theme.palette.accents_5};background:${theme.palette.accents_1};border-bottom:1px solid ${theme.palette.border};border-top:1px solid ${theme.palette.border};border-radius:0;}th.__jsx-style-dynamic-selector:nth-child(1){border-bottom:1px solid ${theme.palette.border};border-left:1px solid ${theme.palette.border};border-top:1px solid ${theme.palette.border};border-top-left-radius:${theme.layout.radius};border-bottom-left-radius:${theme.layout.radius};}th.__jsx-style-dynamic-selector:last-child{border-bottom:1px solid ${theme.palette.border};border-right:1px solid ${theme.palette.border};border-top:1px solid ${theme.palette.border};border-top-right-radius:${theme.layout.radius};border-bottom-right-radius:${theme.layout.radius};}.thead-box.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-align:center;min-height:calc(2.5 * var(--table-font-size));text-transform:uppercase;}` })
|
|
53
|
+
] });
|
|
54
|
+
};
|
|
55
|
+
TableHead.displayName = "BolioUITableHead";
|
|
56
|
+
var TableHead_default = TableHead;
|
|
57
|
+
|
|
58
|
+
// core/Table/TableBody.tsx
|
|
59
|
+
import _JSXStyle2 from "styled-jsx/style";
|
|
60
|
+
|
|
61
|
+
// core/Table/TableCell.tsx
|
|
62
|
+
import { Fragment as Fragment2, jsx as jsx2 } from "react/jsx-runtime";
|
|
63
|
+
var TableCell = ({
|
|
64
|
+
columns,
|
|
65
|
+
row,
|
|
66
|
+
rowIndex,
|
|
67
|
+
emptyText,
|
|
68
|
+
onCellClick
|
|
69
|
+
}) => {
|
|
70
|
+
return /* @__PURE__ */ jsx2(Fragment2, { children: columns.map((column, index) => {
|
|
71
|
+
const currentRowValue = row[column.prop];
|
|
72
|
+
const cellValue = currentRowValue || emptyText;
|
|
73
|
+
const shouldBeRenderElement = column.renderHandler(
|
|
74
|
+
currentRowValue,
|
|
75
|
+
row,
|
|
76
|
+
rowIndex
|
|
77
|
+
);
|
|
78
|
+
return /* @__PURE__ */ jsx2(
|
|
79
|
+
"td",
|
|
80
|
+
{
|
|
81
|
+
onClick: () => onCellClick && onCellClick(currentRowValue, rowIndex, index),
|
|
82
|
+
className: column.className,
|
|
83
|
+
children: /* @__PURE__ */ jsx2("div", { className: "cell", children: shouldBeRenderElement ? shouldBeRenderElement : cellValue })
|
|
84
|
+
},
|
|
85
|
+
`row-td-${index}-${String(column.prop)}`
|
|
86
|
+
);
|
|
87
|
+
}) });
|
|
88
|
+
};
|
|
89
|
+
var TableCell_default = TableCell;
|
|
90
|
+
|
|
91
|
+
// core/Table/TableContext.ts
|
|
92
|
+
import React2 from "react";
|
|
93
|
+
var defaultContext = {
|
|
94
|
+
columns: [],
|
|
95
|
+
updateColumn: () => {
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
var TableContext = React2.createContext(defaultContext);
|
|
99
|
+
var useTableContext = () => React2.useContext(TableContext);
|
|
100
|
+
|
|
101
|
+
// core/Table/TableBody.tsx
|
|
102
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
103
|
+
var TableBody = ({
|
|
104
|
+
data,
|
|
105
|
+
hover,
|
|
106
|
+
emptyText,
|
|
107
|
+
onRow,
|
|
108
|
+
onCell,
|
|
109
|
+
rowClassName
|
|
110
|
+
}) => {
|
|
111
|
+
const theme = use_theme_default();
|
|
112
|
+
const {
|
|
113
|
+
columns
|
|
114
|
+
} = useTableContext();
|
|
115
|
+
const rowClickHandler = (row, index) => {
|
|
116
|
+
if (onRow) onRow(row, index);
|
|
117
|
+
};
|
|
118
|
+
return /* @__PURE__ */ jsxs2("tbody", { className: _JSXStyle2.dynamic([["3433300570", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]]), children: [
|
|
119
|
+
data.map((row, index) => {
|
|
120
|
+
const className = rowClassName(row, index);
|
|
121
|
+
return /* @__PURE__ */ jsx3("tr", { onClick: () => rowClickHandler(row, index), className: _JSXStyle2.dynamic([["3433300570", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]]) + " " + (joinClasses({
|
|
122
|
+
hover
|
|
123
|
+
}, className) || ""), children: /* @__PURE__ */ jsx3(TableCell_default, { columns, row, rowIndex: index, emptyText, onCellClick: onCell }) }, `tbody-row-${index}`);
|
|
124
|
+
}),
|
|
125
|
+
/* @__PURE__ */ jsx3(_JSXStyle2, { id: "3433300570", dynamic: [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6], children: `tr.__jsx-style-dynamic-selector{-webkit-transition:background-color 0.25s ease;transition:background-color 0.25s ease;font-size:inherit;}tr.hover.__jsx-style-dynamic-selector:hover{background-color:${theme.palette.accents_1};}tr.__jsx-style-dynamic-selector td{padding:0 0.5em;border-bottom:1px solid ${theme.palette.border};color:${theme.palette.accents_6};font-size:calc(0.875 * var(--table-font-size));text-align:left;}tr.__jsx-style-dynamic-selector .cell{min-height:calc(3.125 * var(--table-font-size));display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;}` })
|
|
126
|
+
] });
|
|
127
|
+
};
|
|
128
|
+
TableBody.displayName = "BolioUITableBody";
|
|
129
|
+
var TableBody_default = TableBody;
|
|
130
|
+
|
|
131
|
+
// core/Table/TableColumn.tsx
|
|
132
|
+
import { useEffect } from "react";
|
|
133
|
+
var defaultRender = () => {
|
|
134
|
+
};
|
|
135
|
+
var TableColumn = (columnProps) => {
|
|
136
|
+
const {
|
|
137
|
+
children,
|
|
138
|
+
prop,
|
|
139
|
+
label,
|
|
140
|
+
width,
|
|
141
|
+
className = "",
|
|
142
|
+
render: renderHandler = defaultRender
|
|
143
|
+
} = columnProps;
|
|
144
|
+
const { updateColumn } = useTableContext();
|
|
145
|
+
const safeProp = String(prop).trim();
|
|
146
|
+
if (!safeProp) {
|
|
147
|
+
log_warning_default('The props "prop" is required.', "Table.Column");
|
|
148
|
+
}
|
|
149
|
+
useEffect(() => {
|
|
150
|
+
updateColumn({
|
|
151
|
+
label: children || label,
|
|
152
|
+
prop: safeProp,
|
|
153
|
+
width,
|
|
154
|
+
className,
|
|
155
|
+
renderHandler
|
|
156
|
+
});
|
|
157
|
+
}, [children, label, safeProp, width, className, renderHandler, updateColumn]);
|
|
158
|
+
return null;
|
|
159
|
+
};
|
|
160
|
+
TableColumn.displayName = "BolioUITableColumn";
|
|
161
|
+
var TableColumn_default = TableColumn;
|
|
162
|
+
|
|
163
|
+
// core/Table/Table.tsx
|
|
164
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
165
|
+
var defaultProps = {
|
|
166
|
+
hover: true,
|
|
167
|
+
initialData: [],
|
|
168
|
+
emptyText: "",
|
|
169
|
+
className: "",
|
|
170
|
+
rowClassName: () => ""
|
|
171
|
+
};
|
|
172
|
+
function TableComponent(tableProps, forwardedRef) {
|
|
173
|
+
const {
|
|
174
|
+
children,
|
|
175
|
+
data: customData,
|
|
176
|
+
initialData = defaultProps.initialData,
|
|
177
|
+
hover = defaultProps.hover,
|
|
178
|
+
emptyText = defaultProps.emptyText,
|
|
179
|
+
onRow,
|
|
180
|
+
onCell,
|
|
181
|
+
onChange,
|
|
182
|
+
className = defaultProps.className,
|
|
183
|
+
rowClassName = defaultProps.rowClassName,
|
|
184
|
+
...props
|
|
185
|
+
} = tableProps;
|
|
186
|
+
const {
|
|
187
|
+
SCALES
|
|
188
|
+
} = use_scale_default();
|
|
189
|
+
const tableRef = useRef(null);
|
|
190
|
+
useImperativeHandle(forwardedRef, () => tableRef.current);
|
|
191
|
+
const [{
|
|
192
|
+
width
|
|
193
|
+
}, updateShape] = use_real_shape_default(tableRef);
|
|
194
|
+
const [columns, setColumns] = useState([]);
|
|
195
|
+
const [data, setData] = useState(initialData);
|
|
196
|
+
const updateColumn = useCallback((column) => {
|
|
197
|
+
setColumns((last) => {
|
|
198
|
+
const hasColumn = last.find((item) => item.prop === column.prop);
|
|
199
|
+
if (!hasColumn) return [...last, column];
|
|
200
|
+
return last.map((item) => {
|
|
201
|
+
if (item.prop !== column.prop) return item;
|
|
202
|
+
return column;
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
}, []);
|
|
206
|
+
const contextValue = useMemo2(() => ({
|
|
207
|
+
columns,
|
|
208
|
+
updateColumn
|
|
209
|
+
}), [columns, updateColumn]);
|
|
210
|
+
useEffect2(() => {
|
|
211
|
+
if (typeof customData === "undefined") return;
|
|
212
|
+
setData(customData);
|
|
213
|
+
}, [customData]);
|
|
214
|
+
use_resize_default(() => updateShape());
|
|
215
|
+
return (
|
|
216
|
+
// the context is typed for any row: each Table provides its own
|
|
217
|
+
/* @__PURE__ */ jsx4(TableContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs3("table", { ref: tableRef, ...props, className: _JSXStyle3.dynamic([["2991182230", [SCALES.font(1), SCALES.width(1, "100%"), SCALES.height(1, "auto"), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]]) + " " + (props && props.className != null && props.className || className || ""), children: [
|
|
218
|
+
/* @__PURE__ */ jsx4(TableHead_default, { columns, width }),
|
|
219
|
+
/* @__PURE__ */ jsx4(TableBody_default, { data, hover, emptyText, onRow, onCell, rowClassName }),
|
|
220
|
+
children,
|
|
221
|
+
/* @__PURE__ */ jsx4(_JSXStyle3, { id: "2991182230", dynamic: [SCALES.font(1), SCALES.width(1, "100%"), SCALES.height(1, "auto"), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)], children: `table.__jsx-style-dynamic-selector{border-collapse:separate;border-spacing:0;--table-font-size:${SCALES.font(1)};font-size:var(--table-font-size);width:${SCALES.width(1, "100%")};height:${SCALES.height(1, "auto")};padding:${SCALES.pt(0)} ${SCALES.pr(0)} ${SCALES.pb(0)} ${SCALES.pl(0)};margin:${SCALES.mt(0)} ${SCALES.mr(0)} ${SCALES.mb(0)} ${SCALES.ml(0)};}` })
|
|
222
|
+
] }) })
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
TableComponent.displayName = "BolioUITable";
|
|
226
|
+
TableComponent.Column = TableColumn_default;
|
|
227
|
+
var Table = with_scale_default(React4.forwardRef(TableComponent));
|
|
228
|
+
Table.Column = TableColumn_default;
|
|
229
|
+
var Table_default = Table;
|
|
230
|
+
|
|
231
|
+
// core/Table/index.ts
|
|
232
|
+
var Table_default2 = Table_default;
|
|
233
|
+
|
|
234
|
+
export {
|
|
235
|
+
Table_default2 as Table_default
|
|
236
|
+
};
|