welcome-ui 1.0.0-beta.3 → 1.0.0-beta.4
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/AXB53BZF-BxNazDnS.mjs +25 -0
- package/dist/AXB53BZF-KWM2jKTz.js +1 -0
- package/dist/Accordion.js +16 -30
- package/dist/Accordion.mjs +27 -515
- package/dist/Alert.js +37 -1
- package/dist/Alert.mjs +118 -5
- package/dist/AspectRatio.mjs +7 -7
- package/dist/Avatar.js +3 -3
- package/dist/Avatar.mjs +16 -15
- package/dist/BYC7LY2E-BAjGN7k_.mjs +1074 -0
- package/dist/BYC7LY2E-BkAEL2VD.js +1 -0
- package/dist/Badge.js +3 -3
- package/dist/Badge.mjs +10 -10
- package/dist/Breadcrumb.js +1 -54
- package/dist/Breadcrumb.mjs +7 -437
- package/dist/Button.js +78 -0
- package/dist/Button.mjs +136 -0
- package/dist/ButtonGroup.js +32 -0
- package/dist/ButtonGroup.mjs +51 -0
- package/dist/Card.js +17 -0
- package/dist/Card.mjs +29 -0
- package/dist/Checkbox.js +1 -0
- package/dist/Checkbox.mjs +6 -0
- package/dist/ClearButton.js +14 -0
- package/dist/ClearButton.mjs +26 -0
- package/dist/CloseButton.js +6 -0
- package/dist/CloseButton.mjs +15 -0
- package/dist/CustomInput-9aCUiD6o.js +1070 -0
- package/dist/CustomInput-CenfXh_H.mjs +7825 -0
- package/dist/DatePicker.js +1 -0
- package/dist/DatePicker.mjs +108 -0
- package/dist/DateTimePicker.js +38 -0
- package/dist/DateTimePicker.mjs +109 -0
- package/dist/DateTimePickerCommon.js +1 -0
- package/dist/DateTimePickerCommon.mjs +14 -0
- package/dist/Drawer.js +64 -0
- package/dist/Drawer.mjs +267 -0
- package/dist/DropdownMenu.js +45 -0
- package/dist/DropdownMenu.mjs +776 -0
- package/dist/Field.js +72 -0
- package/dist/Field.mjs +177 -0
- package/dist/FieldGroup.js +13 -0
- package/dist/FieldGroup.mjs +26 -0
- package/dist/FileDrop.js +46 -0
- package/dist/FileDrop.mjs +2325 -0
- package/dist/FileUpload.js +3 -0
- package/dist/FileUpload.mjs +88 -0
- package/dist/Grid.js +1 -0
- package/dist/Grid.mjs +57 -0
- package/dist/Hint.js +8 -0
- package/dist/Hint.mjs +22 -0
- package/dist/ITI7HKP4-BPa8qpnl.js +1 -0
- package/dist/ITI7HKP4-Couz1Z73.mjs +473 -0
- package/dist/Icon.js +17 -0
- package/dist/Icon.mjs +51 -0
- package/dist/IconFont.js +17 -0
- package/dist/IconFont.mjs +348 -0
- package/dist/InputText.js +8 -0
- package/dist/InputText.mjs +81 -0
- package/dist/JC64G2H7-CQsqXPS_.mjs +965 -0
- package/dist/JC64G2H7-YkBMNrtl.js +1 -0
- package/dist/KUU7WJ55-DN8gk6_R.js +1 -0
- package/dist/KUU7WJ55-bC4FU_j7.mjs +61 -0
- package/dist/LVA2YJMS-B2HZjIhJ.js +14 -0
- package/dist/LVA2YJMS-Dm5ieEMw.mjs +1479 -0
- package/dist/Label.js +35 -0
- package/dist/Label.mjs +78 -0
- package/dist/Link.js +43 -0
- package/dist/Link.mjs +77 -0
- package/dist/Loader.js +30 -0
- package/dist/Loader.mjs +48 -0
- package/dist/Logo.js +1 -0
- package/dist/Logo.mjs +8 -0
- package/dist/MTZPJQMC-5Xg78Uyy.js +1 -0
- package/dist/MTZPJQMC-DZ3zg4be.mjs +13 -0
- package/dist/Modal.js +181 -0
- package/dist/Modal.mjs +365 -0
- package/dist/NLEBE274-DvH3XTTw.js +1 -0
- package/dist/NLEBE274-FThuwZH_.mjs +84 -0
- package/dist/P2CTZE2T-5jxBu6ix.mjs +297 -0
- package/dist/P2CTZE2T-q8vyaGc0.js +1 -0
- package/dist/P4IRICAX-DF0_vmod.mjs +37 -0
- package/dist/P4IRICAX-nhgZ26A1.js +1 -0
- package/dist/Pagination.js +46 -0
- package/dist/Pagination.mjs +158 -0
- package/dist/PasswordInput.js +1 -0
- package/dist/PasswordInput.mjs +54 -0
- package/dist/Picker.js +8 -0
- package/dist/Picker.mjs +50 -0
- package/dist/Popover.js +1 -0
- package/dist/Popover.mjs +8 -0
- package/dist/QYJ6MIDR-CRK3satR.js +1 -0
- package/dist/QYJ6MIDR-Cy39pEs2.mjs +97 -0
- package/dist/Radio.js +60 -0
- package/dist/Radio.mjs +118 -0
- package/dist/RadioGroup.js +8 -0
- package/dist/RadioGroup.mjs +68 -0
- package/dist/RadioTab.js +61 -0
- package/dist/RadioTab.mjs +104 -0
- package/dist/SYRFVSLH-BpAfr7UE.js +1 -0
- package/dist/SYRFVSLH-DyepaZf7.mjs +48 -0
- package/dist/Search.js +70 -0
- package/dist/Search.mjs +225 -0
- package/dist/Select.js +122 -0
- package/dist/Select.mjs +1071 -0
- package/dist/Shape.js +23 -0
- package/dist/Shape.mjs +37 -0
- package/dist/Slider.js +190 -0
- package/dist/Slider.mjs +531 -0
- package/dist/Stack.js +1 -0
- package/dist/Stack.mjs +32 -0
- package/dist/Swiper.js +141 -0
- package/dist/Swiper.mjs +448 -0
- package/dist/System.js +1 -1
- package/dist/System.mjs +5 -5
- package/dist/Table.js +55 -0
- package/dist/Table.mjs +75 -0
- package/dist/Tabs.js +82 -0
- package/dist/Tabs.mjs +539 -0
- package/dist/Tag.js +78 -0
- package/dist/Tag.mjs +135 -0
- package/dist/Text.js +46 -0
- package/dist/Text.mjs +97 -0
- package/dist/Textarea.js +6 -0
- package/dist/Textarea.mjs +55 -0
- package/dist/TimePicker.js +4 -0
- package/dist/TimePicker.mjs +88 -0
- package/dist/Toast.js +42 -0
- package/dist/Toast.mjs +264 -0
- package/dist/Toggle.js +75 -0
- package/dist/Toggle.mjs +93 -0
- package/dist/Tooltip.js +68 -0
- package/dist/Tooltip.mjs +303 -0
- package/dist/UniversalLink.js +4 -0
- package/dist/UniversalLink.mjs +25 -0
- package/dist/VEVQD5MH-De4r89YE.mjs +20 -0
- package/dist/VEVQD5MH-mN1wMozH.js +1 -0
- package/dist/VGCJ63VH-BNLwLOaC.js +1 -0
- package/dist/VGCJ63VH-fv0YLRh8.mjs +186 -0
- package/dist/VariantIcon.js +8 -0
- package/dist/VariantIcon.mjs +32 -0
- package/dist/Welcome-BNr4uu5n.mjs +48 -0
- package/dist/Welcome-Dw9OaREs.js +3 -0
- package/dist/WelcomeLoader.js +11 -0
- package/dist/WelcomeLoader.mjs +9453 -0
- package/dist/X5NMLKT6-BzhcQu_I.js +1 -0
- package/dist/X5NMLKT6-DGZEtYXj.mjs +25 -0
- package/dist/YV4JVR4I-1ezWeCCz.mjs +341 -0
- package/dist/YV4JVR4I-DIthYWMj.js +15 -0
- package/dist/_commonjsHelpers-CXJ7dpIk.mjs +9 -0
- package/dist/_commonjsHelpers-DvH0V_XJ.js +1 -0
- package/dist/create-event-YSlay9Ef.js +1 -0
- package/dist/create-event-rXDe5aCQ.mjs +8 -0
- package/dist/downshift.esm-DAo-GJwH.js +1 -0
- package/dist/downshift.esm-K4YLLQXl.mjs +1085 -0
- package/dist/field-styles-CeV7pnOp.mjs +86 -0
- package/dist/field-styles-D_gf6ypV.js +63 -0
- package/dist/get-max-width-height-CDLBnp_J.js +1 -0
- package/dist/get-max-width-height-DoUro2T7.mjs +8 -0
- package/dist/hide-focus-rings-root-BNyva1yb.mjs +14 -0
- package/dist/hide-focus-rings-root-DGU4Klq5.js +5 -0
- package/dist/index-1C9Z0d5Q.mjs +446 -0
- package/dist/index-BHi0wohR.js +142 -0
- package/dist/index-BLom3M2B.js +2 -0
- package/dist/{index-WmqrMIzg.mjs → index-BYdkhqH4.mjs} +6344 -6386
- package/dist/index-C_r0bVmL.js +56 -0
- package/dist/index-CgT8GWHS.js +1 -0
- package/dist/index-ColyClKR.mjs +239 -0
- package/dist/index-CrhKWaM2.js +54 -0
- package/dist/index-Cs1IZBks.js +17 -0
- package/dist/index-DCOLdphy.mjs +184 -0
- package/dist/index-DHOW43M6.mjs +132 -0
- package/dist/index-SbQUT2mU.mjs +639 -0
- package/dist/index.js +5 -147
- package/dist/index.mjs +1448 -537
- package/dist/overflow-ellipsis-C2ESrF8C.js +5 -0
- package/dist/overflow-ellipsis-DGV5Kgt-.mjs +10 -0
- package/dist/radio-group-29lMl-2M.mjs +51 -0
- package/dist/radio-group-BpImAAmy.js +1 -0
- package/dist/throttle-BB1Y3bfD.js +1 -0
- package/dist/throttle-BDBzFeFj.mjs +13 -0
- package/dist/types/components/Alert/Title.d.ts +1 -1
- package/dist/types/components/Alert/index.d.ts +3 -3
- package/dist/types/components/Alert/styles.d.ts +2 -2
- package/dist/types/components/Avatar/index.d.ts +1 -1
- package/dist/types/components/Avatar/styles.d.ts +2 -2
- package/dist/types/components/Badge/styles.d.ts +2 -2
- package/dist/types/components/Card/Cover.d.ts +1 -1
- package/dist/types/components/Card/Cover.styles.d.ts +1 -1
- package/dist/types/components/Checkbox/index.d.ts +13 -0
- package/dist/types/components/Checkbox/styles.d.ts +3 -0
- package/dist/types/components/Checkbox/theme.d.ts +8 -0
- package/dist/types/components/ClearButton/styles.d.ts +1 -1
- package/dist/types/components/CloseButton/styles.d.ts +1 -1
- package/dist/types/components/DatePicker/index.d.ts +15 -0
- package/dist/types/components/DateTimePicker/index.d.ts +5 -0
- package/dist/types/components/DateTimePicker/styles.d.ts +1 -0
- package/dist/types/components/DateTimePickerCommon/CustomHeader.d.ts +18 -0
- package/dist/types/components/DateTimePickerCommon/CustomInput.d.ts +17 -0
- package/dist/types/components/DateTimePickerCommon/CustomPopper.d.ts +4 -0
- package/dist/types/components/DateTimePickerCommon/datePickerStyles.d.ts +1 -0
- package/dist/types/components/DateTimePickerCommon/index.d.ts +5 -0
- package/dist/types/components/DateTimePickerCommon/styles.d.ts +9 -0
- package/dist/types/components/DateTimePickerCommon/theme.d.ts +9 -0
- package/dist/types/components/DateTimePickerCommon/utils.d.ts +6 -0
- package/dist/types/components/Drawer/AssetDrawer/Header.d.ts +31 -0
- package/dist/types/components/Drawer/AssetDrawer/index.d.ts +4 -0
- package/dist/types/components/Drawer/AssetDrawer/styles.d.ts +3 -0
- package/dist/types/components/Drawer/Close.d.ts +5 -0
- package/dist/types/components/Drawer/Content.d.ts +4 -0
- package/dist/types/components/Drawer/Footer.d.ts +4 -0
- package/dist/types/components/Drawer/Title.d.ts +3 -0
- package/dist/types/components/Drawer/index.d.ts +52 -0
- package/dist/types/components/Drawer/styles.d.ts +10 -0
- package/dist/types/components/Drawer/theme.d.ts +17 -0
- package/dist/types/components/DropdownMenu/Arrow.d.ts +4 -0
- package/dist/types/components/DropdownMenu/Arrow.styled.d.ts +4 -0
- package/dist/types/components/DropdownMenu/Item.d.ts +4 -0
- package/dist/types/components/DropdownMenu/Item.styled.d.ts +1 -0
- package/dist/types/components/DropdownMenu/Separator.d.ts +4 -0
- package/dist/types/components/DropdownMenu/Separator.styled.d.ts +1 -0
- package/dist/types/components/DropdownMenu/index.d.ts +25 -0
- package/dist/types/components/DropdownMenu/styles.d.ts +1 -0
- package/dist/types/components/DropdownMenu/theme.d.ts +8 -0
- package/dist/types/components/Field/index.d.ts +26 -0
- package/dist/types/components/Field/styles.d.ts +21 -0
- package/dist/types/components/Field/utils.d.ts +5 -0
- package/dist/types/components/FieldGroup/index.d.ts +11 -0
- package/dist/types/components/FieldGroup/styles.d.ts +1 -0
- package/dist/types/components/FileDrop/FilePreview.d.ts +9 -0
- package/dist/types/components/FileDrop/Message.d.ts +7 -0
- package/dist/types/components/FileDrop/Preview.d.ts +3 -0
- package/dist/types/components/FileDrop/index.d.ts +52 -0
- package/dist/types/components/FileDrop/styles.d.ts +9 -0
- package/dist/types/components/FileDrop/theme.d.ts +9 -0
- package/dist/types/components/FileDrop/utils.d.ts +3 -0
- package/dist/types/components/FileUpload/index.d.ts +35 -0
- package/dist/types/components/FileUpload/styles.d.ts +1 -0
- package/dist/types/components/Files/index.d.ts +8 -0
- package/dist/types/components/Files/types.d.ts +72 -0
- package/dist/types/components/Grid/Item.d.ts +14 -0
- package/dist/types/components/Grid/index.d.ts +31 -0
- package/dist/types/components/Hint/index.d.ts +10 -0
- package/dist/types/components/Hint/styles.d.ts +4 -0
- package/dist/types/components/Hint/theme.d.ts +9 -0
- package/dist/types/components/Icon/index.d.ts +26 -0
- package/dist/types/components/Icon/styles.d.ts +9 -0
- package/dist/types/components/Icon/theme.d.ts +10 -0
- package/dist/types/components/IconFont/index.d.ts +311 -0
- package/dist/types/components/IconFont/styles.d.ts +7 -0
- package/dist/types/components/IconFont/unicode.json.d.ts +303 -0
- package/dist/types/components/InputText/index.d.ts +21 -0
- package/dist/types/components/InputText/styles.d.ts +3 -0
- package/dist/types/components/Label/index.d.ts +16 -0
- package/dist/types/components/Label/styles.d.ts +5 -0
- package/dist/types/components/Label/theme.d.ts +4 -0
- package/dist/types/components/Link/index.d.ts +15 -0
- package/dist/types/components/Link/styles.d.ts +2 -0
- package/dist/types/components/Link/theme.d.ts +16 -0
- package/dist/types/components/Link/utils.d.ts +1 -0
- package/dist/types/components/Loader/index.d.ts +11 -0
- package/dist/types/components/Loader/styles.d.ts +6 -0
- package/dist/types/components/Loader/theme.d.ts +8 -0
- package/dist/types/components/Logo/Solutions.d.ts +3 -0
- package/dist/types/components/Logo/Symbol.d.ts +3 -0
- package/dist/types/components/Logo/Welcome.d.ts +3 -0
- package/dist/types/components/Logo/Wui.d.ts +3 -0
- package/dist/types/components/Logo/index.d.ts +7 -0
- package/dist/types/components/Logo/styles.d.ts +1 -0
- package/dist/types/components/Modal/Assets/AssetWithTitle.d.ts +9 -0
- package/dist/types/components/Modal/Assets/Backdrop.d.ts +4 -0
- package/dist/types/components/Modal/Assets/Iframe.d.ts +5 -0
- package/dist/types/components/Modal/Assets/index.d.ts +17 -0
- package/dist/types/components/Modal/Assets/styles.d.ts +7 -0
- package/dist/types/components/Modal/Close.d.ts +6 -0
- package/dist/types/components/Modal/Content.d.ts +16 -0
- package/dist/types/components/Modal/Footer.d.ts +12 -0
- package/dist/types/components/Modal/Header.d.ts +12 -0
- package/dist/types/components/Modal/index.d.ts +53 -0
- package/dist/types/components/Modal/styles.d.ts +11 -0
- package/dist/types/components/Modal/theme.d.ts +17 -0
- package/dist/types/components/Pagination/index.d.ts +14 -0
- package/dist/types/components/Pagination/styles.d.ts +7 -0
- package/dist/types/components/Pagination/theme.d.ts +9 -0
- package/dist/types/components/Pagination/utils.d.ts +7 -0
- package/dist/types/components/PasswordInput/ToggleButton.d.ts +9 -0
- package/dist/types/components/PasswordInput/index.d.ts +5 -0
- package/dist/types/components/Picker/index.d.ts +17 -0
- package/dist/types/components/Picker/styles.d.ts +2 -0
- package/dist/types/components/Popover/Arrow.d.ts +6 -0
- package/dist/types/components/Popover/Content.d.ts +9 -0
- package/dist/types/components/Popover/Popover.d.ts +14 -0
- package/dist/types/components/Popover/PopoverHover.d.ts +14 -0
- package/dist/types/components/Popover/Trigger.d.ts +10 -0
- package/dist/types/components/Popover/index.d.ts +3 -0
- package/dist/types/components/Popover/styles.d.ts +12 -0
- package/dist/types/components/Popover/theme.d.ts +8 -0
- package/dist/types/components/Popover/usePopover.d.ts +15 -0
- package/dist/types/components/Radio/index.d.ts +12 -0
- package/dist/types/components/Radio/styles.d.ts +7 -0
- package/dist/types/components/Radio/theme.d.ts +11 -0
- package/dist/types/components/RadioGroup/index.d.ts +17 -0
- package/dist/types/components/RadioGroup/styles.d.ts +4 -0
- package/dist/types/components/RadioTab/index.d.ts +14 -0
- package/dist/types/components/RadioTab/styles.d.ts +18 -0
- package/dist/types/components/RadioTab/theme.d.ts +7 -0
- package/dist/types/components/Search/index.d.ts +29 -0
- package/dist/types/components/Search/styles.d.ts +15 -0
- package/dist/types/components/Select/index.d.ts +54 -0
- package/dist/types/components/Select/multipleSelections.d.ts +3 -0
- package/dist/types/components/Select/styles.d.ts +32 -0
- package/dist/types/components/Select/utils.d.ts +18 -0
- package/dist/types/components/Shape/index.d.ts +6 -0
- package/dist/types/components/Shape/styles.d.ts +2 -0
- package/dist/types/components/Slider/Range.d.ts +17 -0
- package/dist/types/components/Slider/index.d.ts +27 -0
- package/dist/types/components/Slider/styles.d.ts +19 -0
- package/dist/types/components/Slider/theme.d.ts +11 -0
- package/dist/types/components/Stack/index.d.ts +7 -0
- package/dist/types/components/Swiper/index.d.ts +80 -0
- package/dist/types/components/Swiper/styles.d.ts +138 -0
- package/dist/types/components/Swiper/theme.d.ts +11 -0
- package/dist/types/components/Swiper/use-interval.d.ts +1 -0
- package/dist/types/components/Table/index.d.ts +18 -0
- package/dist/types/components/Table/styles.d.ts +13 -0
- package/dist/types/components/Table/theme.d.ts +15 -0
- package/dist/types/components/Tabs/ActiveBar.d.ts +13 -0
- package/dist/types/components/Tabs/TabList.d.ts +13 -0
- package/dist/types/components/Tabs/TabPanel.d.ts +11 -0
- package/dist/types/components/Tabs/index.d.ts +18 -0
- package/dist/types/components/Tabs/styles.d.ts +9 -0
- package/dist/types/components/Tabs/theme.d.ts +28 -0
- package/dist/types/components/Tabs/utils.d.ts +1 -0
- package/dist/types/components/Tag/index.d.ts +17 -0
- package/dist/types/components/Tag/styles.d.ts +15 -0
- package/dist/types/components/Tag/theme.d.ts +14 -0
- package/dist/types/components/Text/index.d.ts +25 -0
- package/dist/types/components/Text/styles.d.ts +2 -0
- package/dist/types/components/Textarea/index.d.ts +18 -0
- package/dist/types/components/Textarea/styles.d.ts +2 -0
- package/dist/types/components/Textarea/theme.d.ts +4 -0
- package/dist/types/components/TimePicker/index.d.ts +13 -0
- package/dist/types/components/TimePicker/styles.d.ts +1 -0
- package/dist/types/components/Toast/Growl.d.ts +12 -0
- package/dist/types/components/Toast/Snackbar.d.ts +18 -0
- package/dist/types/components/Toast/ToastWrapper.d.ts +16 -0
- package/dist/types/components/Toast/index.d.ts +27 -0
- package/dist/types/components/Toast/styles.d.ts +19 -0
- package/dist/types/components/Toast/theme.d.ts +22 -0
- package/dist/types/components/Toast/utils.d.ts +26 -0
- package/dist/types/components/Toggle/index.d.ts +11 -0
- package/dist/types/components/Toggle/styles.d.ts +12 -0
- package/dist/types/components/Toggle/theme.d.ts +10 -0
- package/dist/types/components/Tooltip/index.d.ts +11 -0
- package/dist/types/components/Tooltip/styles.d.ts +10 -0
- package/dist/types/components/Tooltip/theme.d.ts +4 -0
- package/dist/types/components/UniversalLink/index.d.ts +7 -0
- package/dist/types/components/UniversalLink/styles.d.ts +1 -0
- package/dist/types/components/VariantIcon/index.d.ts +11 -0
- package/dist/types/components/VariantIcon/styles.d.ts +4 -0
- package/dist/types/components/VariantIcon/theme.d.ts +10 -0
- package/dist/types/components/WelcomeLoader/index.d.ts +2 -0
- package/dist/types/components/WelcomeLoader/loader.json.d.ts +3 -0
- package/dist/types/components/index.d.ts +43 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/theme/defaultFields.d.ts +39 -0
- package/dist/types/theme/index.d.ts +52 -2
- package/dist/types/theme/typography.d.ts +2 -2
- package/dist/types/utils/clamp.d.ts +1 -0
- package/dist/types/utils/create-event.d.ts +8 -0
- package/dist/types/utils/field-styles.d.ts +21 -0
- package/dist/types/utils/format-bytes.d.ts +1 -0
- package/dist/types/utils/get-max-width-height.d.ts +1 -0
- package/dist/types/utils/hex-to-rgb.d.ts +1 -0
- package/dist/types/utils/hex-to-rgba.d.ts +1 -0
- package/dist/types/utils/hide-focus-rings-root.d.ts +8 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/overflow-ellipsis.d.ts +1 -0
- package/dist/types/utils/throttle.d.ts +5 -0
- package/dist/types/utils/use-copy-text.d.ts +5 -0
- package/dist/types/utils/use-create-portal.d.ts +4 -0
- package/dist/types/utils/use-fork-ref.d.ts +3 -0
- package/dist/types/utils/use-isomorphic-layout-effect.d.ts +2 -0
- package/dist/types/utils/use-viewport.d.ts +6 -0
- package/dist/types/utils/wrap-children.d.ts +1 -0
- package/dist/use-isomorphic-layout-effect-C1_Gy5Nu.js +1 -0
- package/dist/use-isomorphic-layout-effect-Izr-e2pi.mjs +6 -0
- package/dist/use-viewport-BDDjd1nl.js +1 -0
- package/dist/use-viewport-m3glsbna.mjs +16 -0
- package/dist/usePopover-CZsYHcTW.js +31 -0
- package/dist/usePopover-CcsC9Y-s.mjs +143 -0
- package/dist/wrap-children-BLDjJiiy.js +1 -0
- package/dist/wrap-children-aq69jtFP.mjs +12 -0
- package/package.json +56 -4
- package/dist/X5NMLKT6-BC1Q56kB.mjs +0 -1258
- package/dist/X5NMLKT6-vrNG8i_R.js +0 -14
- package/dist/index-0MPAX4B5.mjs +0 -320
- package/dist/index-BNA_A0oa.js +0 -155
- package/dist/index-BXJQXgy9.js +0 -13
- package/dist/index-Bwrtxit1.mjs +0 -84
- package/dist/index-Ct2FOeyM.js +0 -17
- package/dist/index-DRNn5iIc.js +0 -142
- package/dist/index-Du8Nrf16.mjs +0 -128
- package/dist/index-MifIgNHW.mjs +0 -47
- package/dist/index-V28zHt_Z.js +0 -68
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),P=require("./Button.js"),A=require("./System.js"),k=require("./create-event-YSlay9Ef.js"),g=require("./index-CgT8GWHS.js"),h=require("./Tag.js"),z=require("./Box.js"),D=require("@xstyled/styled-components"),O=D.inputBox.withConfig({shouldForwardProp:A.shouldForwardProp})`
|
|
2
|
+
display: none;
|
|
3
|
+
`,C=2e6,M="*/*",S=n=>Array.isArray(n)?n:n?[n]:[],N=({file:n,onRemove:u})=>{const m=g.getFileIcon(n),o=g.getFileName(n),p=g.getFileSize(n);return t.createElement(h.Tag,{"data-id":o,key:o,mr:"sm",mt:"sm",onRemove:u},t.createElement(m,{size:"md"}),o,p&&t.createElement(z.Box,{color:"beige-60"},"(",p,")"))},I=A.forwardRef(({accept:n=M,children:u,dataTestId:m,disabled:o,draggable:p,handleAddFile:f,handleRemoveFile:v,maxSize:T=C,multiple:w,name:E,onBlur:i,onChange:l,onError:B,preview:R=N,value:d=[],...b},s)=>{const[c,F]=t.useState(S(d)),U=t.useRef();t.useEffect(()=>{F(S(d))},[d]),t.useEffect(()=>()=>{c&&c.map(e=>e instanceof File?URL.revokeObjectURL(e.preview):e)},[c]);const _=e=>{let r=Array.from(e.target.files).map(a=>(a.preview=URL.createObjectURL(a),a));F(r),r.length===1&&(r=r[0]);const y=k.createEvent({name:E,value:r});l&&l(y),f&&f(r),i&&i()},q=e=>{const r=c.filter(x=>x!==e),y=w?r:void 0;F(r);const a=k.createEvent({name:E,value:y});l&&l(a),v&&v(e),i&&i()},L=()=>{U.current.click()},j=c.map(e=>e instanceof File?e.preview:void 0).join("");return t.createElement(t.Fragment,null,u?u({openFile:L,disabled:o,files:c,onRemoveFile:q}):t.createElement(P.Button,{disabled:o,onClick:L},"Upload file"),t.createElement("br",null),t.createElement(O,{accept:n,"data-testid":m,disabled:o,key:j,maxSize:T,multiple:w,name:E,onBlur:i,onChange:_,ref:e=>{U.current=e,typeof s=="function"?s(e):s!=null&&s.current&&(s.current=e)},...b,type:"file"}),R&&c.map(e=>t.createElement(R,{file:e,key:e instanceof File?e.name:e,onRemove:()=>q(e)})))});I.displayName="FileUpload";exports.FileUpload=I;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import n, { useState as x, useRef as z, useEffect as k } from "react";
|
|
3
|
+
import { Button as D } from "./Button.mjs";
|
|
4
|
+
import { shouldForwardProp as h, forwardRef as C } from "./System.mjs";
|
|
5
|
+
import { c as v } from "./create-event-rXDe5aCQ.mjs";
|
|
6
|
+
import { g as N, a as O, b as P } from "./index-DHOW43M6.mjs";
|
|
7
|
+
import { Tag as K } from "./Tag.mjs";
|
|
8
|
+
import { Box as M } from "./Box.mjs";
|
|
9
|
+
import X from "@xstyled/styled-components";
|
|
10
|
+
const Y = X.inputBox.withConfig({ shouldForwardProp: h })`
|
|
11
|
+
display: none;
|
|
12
|
+
`, Z = 2e6, q = "*/*", A = (t) => Array.isArray(t) ? t : t ? [t] : [], G = ({ file: t, onRemove: m }) => {
|
|
13
|
+
const l = N(t), o = O(t), u = P(t);
|
|
14
|
+
return /* @__PURE__ */ n.createElement(K, { "data-id": o, key: o, mr: "sm", mt: "sm", onRemove: m }, /* @__PURE__ */ n.createElement(l, { size: "md" }), o, u && /* @__PURE__ */ n.createElement(M, { color: "beige-60" }, "(", u, ")"));
|
|
15
|
+
}, H = C(
|
|
16
|
+
({
|
|
17
|
+
accept: t = q,
|
|
18
|
+
children: m,
|
|
19
|
+
dataTestId: l,
|
|
20
|
+
disabled: o,
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
22
|
+
draggable: u,
|
|
23
|
+
handleAddFile: y,
|
|
24
|
+
handleRemoveFile: g,
|
|
25
|
+
maxSize: I = Z,
|
|
26
|
+
multiple: R,
|
|
27
|
+
name: f,
|
|
28
|
+
onBlur: a,
|
|
29
|
+
onChange: p,
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
31
|
+
onError: J,
|
|
32
|
+
preview: w = G,
|
|
33
|
+
value: E = [],
|
|
34
|
+
...b
|
|
35
|
+
}, s) => {
|
|
36
|
+
const [c, F] = x(A(E)), U = z();
|
|
37
|
+
k(() => {
|
|
38
|
+
F(A(E));
|
|
39
|
+
}, [E]), k(() => () => {
|
|
40
|
+
c && c.map((e) => e instanceof File ? URL.revokeObjectURL(e.preview) : e);
|
|
41
|
+
}, [c]);
|
|
42
|
+
const S = (e) => {
|
|
43
|
+
let r = Array.from(e.target.files).map(
|
|
44
|
+
(i) => (i.preview = URL.createObjectURL(i), i)
|
|
45
|
+
);
|
|
46
|
+
F(r), r.length === 1 && (r = r[0]);
|
|
47
|
+
const d = v({ name: f, value: r });
|
|
48
|
+
p && p(d), y && y(r), a && a();
|
|
49
|
+
}, _ = (e) => {
|
|
50
|
+
const r = c.filter((j) => j !== e), d = R ? r : void 0;
|
|
51
|
+
F(r);
|
|
52
|
+
const i = v({ name: f, value: d });
|
|
53
|
+
p && p(i), g && g(e), a && a();
|
|
54
|
+
}, L = () => {
|
|
55
|
+
U.current.click();
|
|
56
|
+
}, T = c.map((e) => e instanceof File ? e.preview : void 0).join("");
|
|
57
|
+
return /* @__PURE__ */ n.createElement(n.Fragment, null, m ? m({ openFile: L, disabled: o, files: c, onRemoveFile: _ }) : /* @__PURE__ */ n.createElement(D, { disabled: o, onClick: L }, "Upload file"), /* @__PURE__ */ n.createElement("br", null), /* @__PURE__ */ n.createElement(
|
|
58
|
+
Y,
|
|
59
|
+
{
|
|
60
|
+
accept: t,
|
|
61
|
+
"data-testid": l,
|
|
62
|
+
disabled: o,
|
|
63
|
+
key: T,
|
|
64
|
+
maxSize: I,
|
|
65
|
+
multiple: R,
|
|
66
|
+
name: f,
|
|
67
|
+
onBlur: a,
|
|
68
|
+
onChange: S,
|
|
69
|
+
ref: (e) => {
|
|
70
|
+
U.current = e, typeof s == "function" ? s(e) : s != null && s.current && (s.current = e);
|
|
71
|
+
},
|
|
72
|
+
...b,
|
|
73
|
+
type: "file"
|
|
74
|
+
}
|
|
75
|
+
), w && c.map((e) => /* @__PURE__ */ n.createElement(
|
|
76
|
+
w,
|
|
77
|
+
{
|
|
78
|
+
file: e,
|
|
79
|
+
key: e instanceof File ? e.name : e,
|
|
80
|
+
onRemove: () => _(e)
|
|
81
|
+
}
|
|
82
|
+
)));
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
H.displayName = "FileUpload";
|
|
86
|
+
export {
|
|
87
|
+
H as FileUpload
|
|
88
|
+
};
|
package/dist/Grid.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),s=require("./Box.js"),a=require("./System.js"),f=a.forwardRef(({area:e,column:r,dataTestId:t,row:o,...i},d)=>n.createElement(s.Box,{"data-testid":t,gridArea:e,gridColumn:r,ref:d,row:o,...i})),C=a.forwardRef(({area:e,autoColumns:r,autoFlow:t,autoRows:o,column:i,columnGap:d,dataTestId:u,gap:g,row:l,rowGap:c,templateAreas:m,templateColumns:p,templateRows:w,...A},R)=>n.createElement(s.Box,{columnGap:d,"data-testid":u,display:"grid",gap:g,gridArea:e,gridAutoColumns:r,gridAutoFlow:t,gridAutoRows:o,gridColumn:i,gridRow:l,gridTemplateAreas:m,gridTemplateColumns:p,gridTemplateRows:w,ref:R,rowGap:c,...A})),y=Object.assign(C,{Item:f});exports.Grid=y;
|
package/dist/Grid.mjs
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import a from "react";
|
|
3
|
+
import { Box as m } from "./Box.mjs";
|
|
4
|
+
import { forwardRef as n } from "./System.mjs";
|
|
5
|
+
const C = n(
|
|
6
|
+
({ area: r, column: t, dataTestId: e, row: o, ...i }, d) => /* @__PURE__ */ a.createElement(
|
|
7
|
+
m,
|
|
8
|
+
{
|
|
9
|
+
"data-testid": e,
|
|
10
|
+
gridArea: r,
|
|
11
|
+
gridColumn: t,
|
|
12
|
+
ref: d,
|
|
13
|
+
row: o,
|
|
14
|
+
...i
|
|
15
|
+
}
|
|
16
|
+
)
|
|
17
|
+
), R = n(
|
|
18
|
+
({
|
|
19
|
+
area: r,
|
|
20
|
+
autoColumns: t,
|
|
21
|
+
autoFlow: e,
|
|
22
|
+
autoRows: o,
|
|
23
|
+
column: i,
|
|
24
|
+
columnGap: d,
|
|
25
|
+
dataTestId: s,
|
|
26
|
+
gap: g,
|
|
27
|
+
row: l,
|
|
28
|
+
rowGap: u,
|
|
29
|
+
templateAreas: p,
|
|
30
|
+
templateColumns: c,
|
|
31
|
+
templateRows: f,
|
|
32
|
+
...A
|
|
33
|
+
}, w) => /* @__PURE__ */ a.createElement(
|
|
34
|
+
m,
|
|
35
|
+
{
|
|
36
|
+
columnGap: d,
|
|
37
|
+
"data-testid": s,
|
|
38
|
+
display: "grid",
|
|
39
|
+
gap: g,
|
|
40
|
+
gridArea: r,
|
|
41
|
+
gridAutoColumns: t,
|
|
42
|
+
gridAutoFlow: e,
|
|
43
|
+
gridAutoRows: o,
|
|
44
|
+
gridColumn: i,
|
|
45
|
+
gridRow: l,
|
|
46
|
+
gridTemplateAreas: p,
|
|
47
|
+
gridTemplateColumns: c,
|
|
48
|
+
gridTemplateRows: f,
|
|
49
|
+
ref: w,
|
|
50
|
+
rowGap: u,
|
|
51
|
+
...A
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
), G = Object.assign(R, { Item: C });
|
|
55
|
+
export {
|
|
56
|
+
G as Grid
|
|
57
|
+
};
|
package/dist/Hint.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),o=require("./System.js"),t=require("@xstyled/styled-components"),s=t.div(({variant:e})=>t.css`
|
|
2
|
+
${t.th("hints.default")};
|
|
3
|
+
${e&&t.th(`hints.${e}`)};
|
|
4
|
+
margin-top: xs;
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
${t.system};
|
|
8
|
+
`),i=o.forwardRef(({children:e,dataTestId:n,variant:r,...c},l)=>d.createElement(s,{"data-testid":n,ref:l,variant:r,...c},e));i.displayName="Hint";const a=s;exports.Hint=i;exports.StyledHint=a;
|
package/dist/Hint.mjs
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import a from "react";
|
|
3
|
+
import { forwardRef as d } from "./System.mjs";
|
|
4
|
+
import l, { css as m, th as e, system as f } from "@xstyled/styled-components";
|
|
5
|
+
const i = l.div(
|
|
6
|
+
({ variant: t }) => m`
|
|
7
|
+
${e("hints.default")};
|
|
8
|
+
${t && e(`hints.${t}`)};
|
|
9
|
+
margin-top: xs;
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
${f};
|
|
13
|
+
`
|
|
14
|
+
), c = d(
|
|
15
|
+
({ children: t, dataTestId: s, variant: n, ...r }, o) => /* @__PURE__ */ a.createElement(i, { "data-testid": s, ref: o, variant: n, ...r }, t)
|
|
16
|
+
);
|
|
17
|
+
c.displayName = "Hint";
|
|
18
|
+
const $ = i;
|
|
19
|
+
export {
|
|
20
|
+
c as Hint,
|
|
21
|
+
$ as StyledHint
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";const v=require("./YV4JVR4I-DIthYWMj.js"),r=require("./LVA2YJMS-B2HZjIhJ.js"),b=require("./P2CTZE2T-q8vyaGc0.js"),M=require("react");function X(e){var i;const n=e.find(c=>!!c.element),t=[...e].reverse().find(c=>!!c.element);let o=(i=n==null?void 0:n.element)==null?void 0:i.parentElement;for(;o&&(t!=null&&t.element);){if(t&&o.contains(t.element))return o;o=o.parentElement}return r.getDocument(o).body}function ee(e){return e==null?void 0:e.__unstablePrivateStore}function Y(e={}){var i;v.throwOnConflictingProps(e,e.store);const n=(i=e.store)==null?void 0:i.getState(),t=r.defaultValue(e.items,n==null?void 0:n.items,e.defaultItems,[]),o=new Map(t.map(l=>[l.id,l])),c={items:t,renderedItems:r.defaultValue(n==null?void 0:n.renderedItems,[])},d=ee(e.store),a=v.createStore({items:t,renderedItems:c.renderedItems},d),u=v.createStore(c,e.store),F=l=>{const m=r.sortBasedOnDOMPosition(l,I=>I.element);a.setState("renderedItems",m),u.setState("renderedItems",m)};v.setup(u,()=>v.init(a)),v.setup(a,()=>v.batch(a,["items"],l=>{u.setState("items",l.items)})),v.setup(a,()=>v.batch(a,["renderedItems"],l=>{let m=!0,I=requestAnimationFrame(()=>{const{renderedItems:E}=u.getState();l.renderedItems!==E&&F(l.renderedItems)});if(typeof IntersectionObserver!="function")return()=>cancelAnimationFrame(I);const w=()=>{if(m){m=!1;return}cancelAnimationFrame(I),I=requestAnimationFrame(()=>F(l.renderedItems))},R=X(l.renderedItems),g=new IntersectionObserver(w,{root:R});for(const E of l.renderedItems)E.element&&g.observe(E.element);return()=>{cancelAnimationFrame(I),g.disconnect()}}));const S=(l,m,I=!1)=>{let w;return m(g=>{const E=g.findIndex(({id:h})=>h===l.id),V=g.slice();if(E!==-1){w=g[E];const h=r.__spreadValues$1(r.__spreadValues$1({},w),l);V[E]=h,o.set(l.id,h)}else V.push(l),o.set(l.id,l);return V}),()=>{m(g=>{if(!w)return I&&o.delete(l.id),g.filter(({id:h})=>h!==l.id);const E=g.findIndex(({id:h})=>h===l.id);if(E===-1)return g;const V=g.slice();return V[E]=w,o.set(l.id,w),V})}},L=l=>S(l,m=>a.setState("items",m),!0);return r.__spreadProps$1(r.__spreadValues$1({},u),{registerItem:L,renderItem:l=>r.chain(L(l),S(l,m=>a.setState("renderedItems",m))),item:l=>{if(!l)return null;let m=o.get(l);if(!m){const{items:I}=a.getState();m=I.find(w=>w.id===l),m&&o.set(l,m)}return m||null},__unstablePrivateStore:a})}function te(e,i,n){return r.useUpdateEffect(i,[n.store]),v.useStoreProps(e,n,"items","setItems"),e}function G(e){const i=[];for(const n of e)i.push(...n);return i}function N(e){return e.slice().reverse()}var ne={id:null};function k(e,i){return e.find(n=>i?!n.disabled&&n.id!==i:!n.disabled)}function re(e,i){return e.filter(n=>i?!n.disabled&&n.id!==i:!n.disabled)}function U(e,i){return e.filter(n=>n.rowId===i)}function ue(e,i,n=!1){const t=e.findIndex(o=>o.id===i);return[...e.slice(t+1),...n?[ne]:[],...e.slice(0,t)]}function J(e){const i=[];for(const n of e){const t=i.find(o=>{var c;return((c=o[0])==null?void 0:c.rowId)===n.rowId});t?t.push(n):i.push([n])}return i}function Z(e){let i=0;for(const{length:n}of e)n>i&&(i=n);return i}function se(e){return{id:"__EMPTY_ITEM__",disabled:!0,rowId:e}}function ie(e,i,n){const t=Z(e);for(const o of e)for(let c=0;c<t;c+=1){const d=o[c];if(!d||n&&d.disabled){const u=c===0&&n?k(o):o[c-1];o[c]=u&&i!==u.id&&n?u:se(u==null?void 0:u.rowId)}}return e}function oe(e){const i=J(e),n=Z(i),t=[];for(let o=0;o<n;o+=1)for(const c of i){const d=c[o];d&&t.push(r.__spreadProps$1(r.__spreadValues$1({},d),{rowId:d.rowId?`${o}`:void 0}))}return t}function le(e={}){var i;const n=(i=e.store)==null?void 0:i.getState(),t=Y(e),o=r.defaultValue(e.activeId,n==null?void 0:n.activeId,e.defaultActiveId),c=r.__spreadProps$1(r.__spreadValues$1({},t.getState()),{id:r.defaultValue(e.id,n==null?void 0:n.id,`id-${Math.random().toString(36).slice(2,8)}`),activeId:o,baseElement:r.defaultValue(n==null?void 0:n.baseElement,null),includesBaseElement:r.defaultValue(e.includesBaseElement,n==null?void 0:n.includesBaseElement,o===null),moves:r.defaultValue(n==null?void 0:n.moves,0),orientation:r.defaultValue(e.orientation,n==null?void 0:n.orientation,"both"),rtl:r.defaultValue(e.rtl,n==null?void 0:n.rtl,!1),virtualFocus:r.defaultValue(e.virtualFocus,n==null?void 0:n.virtualFocus,!1),focusLoop:r.defaultValue(e.focusLoop,n==null?void 0:n.focusLoop,!1),focusWrap:r.defaultValue(e.focusWrap,n==null?void 0:n.focusWrap,!1),focusShift:r.defaultValue(e.focusShift,n==null?void 0:n.focusShift,!1)}),d=v.createStore(c,t,e.store);v.setup(d,()=>v.sync(d,["renderedItems","activeId"],u=>{d.setState("activeId",F=>{var S;return F!==void 0?F:(S=k(u.renderedItems))==null?void 0:S.id})}));const a=(u="next",F={})=>{var S,L;const l=d.getState(),{skip:m=0,activeId:I=l.activeId,focusShift:w=l.focusShift,focusLoop:R=l.focusLoop,focusWrap:g=l.focusWrap,includesBaseElement:E=l.includesBaseElement,renderedItems:V=l.renderedItems,rtl:h=l.rtl}=F,A=u==="up"||u==="down",D=u==="next"||u==="down",W=D?h&&!A:!h||A,O=w&&!m;let _=A?G(ie(J(V),I,O)):V;if(_=W?N(_):_,_=A?oe(_):_,I==null)return(S=k(_))==null?void 0:S.id;const K=_.find(p=>p.id===I);if(!K)return(L=k(_))==null?void 0:L.id;const z=_.some(p=>p.rowId),q=_.indexOf(K),s=_.slice(q+1),f=U(s,K.rowId);if(m){const p=re(f,I),x=p.slice(m)[0]||p[p.length-1];return x==null?void 0:x.id}const P=R&&(A?R!=="horizontal":R!=="vertical"),y=z&&g&&(A?g!=="horizontal":g!=="vertical"),C=D?(!z||A)&&P&&E:A?E:!1;if(P){const p=y&&!C?_:U(_,K.rowId),x=ue(p,I,C),B=k(x,I);return B==null?void 0:B.id}if(y){const p=k(C?f:s,I);return C?(p==null?void 0:p.id)||null:p==null?void 0:p.id}const T=k(f,I);return!T&&C?null:T==null?void 0:T.id};return r.__spreadProps$1(r.__spreadValues$1(r.__spreadValues$1({},t),d),{setBaseElement:u=>d.setState("baseElement",u),setActiveId:u=>d.setState("activeId",u),move:u=>{u!==void 0&&(d.setState("activeId",u),d.setState("moves",F=>F+1))},first:()=>{var u;return(u=k(d.getState().renderedItems))==null?void 0:u.id},last:()=>{var u;return(u=k(N(d.getState().renderedItems)))==null?void 0:u.id},next:u=>(u!==void 0&&typeof u=="number"&&(u={skip:u}),a("next",u)),previous:u=>(u!==void 0&&typeof u=="number"&&(u={skip:u}),a("previous",u)),down:u=>(u!==void 0&&typeof u=="number"&&(u={skip:u}),a("down",u)),up:u=>(u!==void 0&&typeof u=="number"&&(u={skip:u}),a("up",u))})}function ae(e,i,n){return e=te(e,i,n),v.useStoreProps(e,n,"activeId","setActiveId"),v.useStoreProps(e,n,"includesBaseElement"),v.useStoreProps(e,n,"virtualFocus"),v.useStoreProps(e,n,"orientation"),v.useStoreProps(e,n,"rtl"),v.useStoreProps(e,n,"focusLoop"),v.useStoreProps(e,n,"focusWrap"),v.useStoreProps(e,n,"focusShift"),e}var ce="div";function de(e){return e.some(i=>!!i.rowId)}function fe(e){const i=e.target;return i&&!r.isTextField(i)?!1:e.key.length===1&&!e.ctrlKey&&!e.metaKey}function me(e){return e.key==="Shift"||e.key==="Control"||e.key==="Alt"||e.key==="Meta"}function j(e,i,n){return r.useEvent(t=>{var o;if(i==null||i(t),t.defaultPrevented||t.isPropagationStopped()||!r.isSelfTarget(t)||me(t)||fe(t))return;const c=e.getState(),d=(o=b.getEnabledItem(e,c.activeId))==null?void 0:o.element;if(!d)return;const a=t,u=r.__objRest(a,["view"]),F=n==null?void 0:n.current;d!==F&&d.focus(),r.fireKeyboardEvent(d,t.type,u)||t.preventDefault(),t.currentTarget.contains(d)&&t.stopPropagation()})}function Ie(e){return b.findFirstEnabledItem(G(N(b.groupItemsByRows(e))))}function ve(e){const[i,n]=M.useState(!1),t=M.useCallback(()=>n(!0),[]),o=e.useState(c=>b.getEnabledItem(e,c.activeId));return M.useEffect(()=>{const c=o==null?void 0:o.element;i&&c&&(n(!1),c.focus({preventScroll:!0}))},[o,i]),t}var Q=r.createHook(function(i){var n=i,{store:t,composite:o=!0,focusOnMove:c=o,moveOnKeyPress:d=!0}=n,a=r.__objRest(n,["store","composite","focusOnMove","moveOnKeyPress"]);const u=b.useCompositeProviderContext();t=t||u,r.invariant(t,process.env.NODE_ENV!=="production"&&"Composite must receive a `store` prop or be wrapped in a CompositeProvider component.");const F=M.useRef(null),S=M.useRef(null),L=ve(t),l=t.useState("moves"),[,m]=r.useTransactionState(o?t.setBaseElement:null);M.useEffect(()=>{var s;if(!t||!l||!o||!c)return;const{activeId:f}=t.getState(),P=(s=b.getEnabledItem(t,f))==null?void 0:s.element;P&&r.focusIntoView(P)},[t,l,o,c]),r.useSafeLayoutEffect(()=>{if(!t||!l||!o)return;const{baseElement:s,activeId:f}=t.getState();if(!(f===null)||!s)return;const y=S.current;S.current=null,y&&r.fireBlurEvent(y,{relatedTarget:s}),r.hasFocus(s)||s.focus()},[t,l,o]);const I=t.useState("activeId"),w=t.useState("virtualFocus");r.useSafeLayoutEffect(()=>{var s;if(!t||!o||!w)return;const f=S.current;if(S.current=null,!f)return;const y=((s=b.getEnabledItem(t,I))==null?void 0:s.element)||r.getActiveElement(f);y!==f&&r.fireBlurEvent(f,{relatedTarget:y})},[t,I,w,o]);const R=j(t,a.onKeyDownCapture,S),g=j(t,a.onKeyUpCapture,S),E=a.onFocusCapture,V=r.useEvent(s=>{if(E==null||E(s),s.defaultPrevented||!t)return;const{virtualFocus:f}=t.getState();if(!f)return;const P=s.relatedTarget,y=b.silentlyFocused(s.currentTarget);r.isSelfTarget(s)&&y&&(s.stopPropagation(),S.current=P)}),h=a.onFocus,A=r.useEvent(s=>{if(h==null||h(s),s.defaultPrevented||!o||!t)return;const{relatedTarget:f}=s,{virtualFocus:P}=t.getState();P?r.isSelfTarget(s)&&!b.isItem(t,f)&&queueMicrotask(L):r.isSelfTarget(s)&&t.setActiveId(null)}),D=a.onBlurCapture,W=r.useEvent(s=>{var f;if(D==null||D(s),s.defaultPrevented||!t)return;const{virtualFocus:P,activeId:y}=t.getState();if(!P)return;const C=(f=b.getEnabledItem(t,y))==null?void 0:f.element,T=s.relatedTarget,p=b.isItem(t,T),x=S.current;S.current=null,r.isSelfTarget(s)&&p?(T===C?x&&x!==T&&r.fireBlurEvent(x,s):C?r.fireBlurEvent(C,s):x&&r.fireBlurEvent(x,s),s.stopPropagation()):!b.isItem(t,s.target)&&C&&r.fireBlurEvent(C,s)}),O=a.onKeyDown,_=r.useBooleanEvent(d),K=r.useEvent(s=>{var f;if(O==null||O(s),s.defaultPrevented||!t||!r.isSelfTarget(s))return;const{orientation:P,renderedItems:y,activeId:C}=t.getState(),T=b.getEnabledItem(t,C);if((f=T==null?void 0:T.element)!=null&&f.isConnected)return;const p=P!=="horizontal",x=P!=="vertical",B=de(y);if((s.key==="ArrowLeft"||s.key==="ArrowRight"||s.key==="Home"||s.key==="End")&&r.isTextField(s.currentTarget))return;const H={ArrowUp:(B||p)&&(()=>{if(B){const $=Ie(y);return $==null?void 0:$.id}return t==null?void 0:t.last()}),ArrowRight:(B||x)&&t.first,ArrowDown:(B||p)&&t.first,ArrowLeft:(B||x)&&t.last,Home:t.first,End:t.last,PageUp:t.first,PageDown:t.last}[s.key];if(H){const $=H();if($!==void 0){if(!_(s))return;s.preventDefault(),t.move($)}}});a=r.useWrapElement(a,s=>r.jsxRuntimeExports.jsx(b.CompositeContextProvider,{value:t,children:s}),[t]);const z=t.useState(s=>{var f;if(t&&o&&s.virtualFocus)return(f=b.getEnabledItem(t,s.activeId))==null?void 0:f.id});a=r.__spreadProps(r.__spreadValues({"aria-activedescendant":z},a),{ref:r.useMergeRefs(F,m,a.ref),onKeyDownCapture:R,onKeyUpCapture:g,onFocusCapture:V,onFocus:A,onBlurCapture:W,onKeyDown:K});const q=t.useState(s=>o&&(s.virtualFocus||s.activeId===null));return a=r.useFocusable(r.__spreadValues({focusable:q},a)),a});r.forwardRef2(function(i){const n=Q(i);return r.createElement(ce,n)});exports.createCollectionStore=Y;exports.createCompositeStore=le;exports.useComposite=Q;exports.useCompositeStoreProps=ae;
|
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as de, c as X, s as $, i as fe, g as Z, b as B, d as me } from "./YV4JVR4I-1ezWeCCz.mjs";
|
|
3
|
+
import { C as F, B as j, Q as Ie, D as T, I as ve, R as ge, H as Se, c as pe, _ as ie, i as Ee, S as ye, T as we, F as ee, U as O, V as be, W as he, e as H, p as z, u as xe, q as ue, E as _e, m as Fe, h as Pe, j as Ce, a as te, v as Ae, f as ke, b as Be, X as Re } from "./LVA2YJMS-Dm5ieEMw.mjs";
|
|
4
|
+
import { b as De, g as L, s as Ke, i as Q, a as Le, f as Te, c as Me } from "./P2CTZE2T-5jxBu6ix.mjs";
|
|
5
|
+
import { useRef as ne, useEffect as oe, useState as Oe, useCallback as ze } from "react";
|
|
6
|
+
function We(e) {
|
|
7
|
+
var i;
|
|
8
|
+
const n = e.find((c) => !!c.element), t = [...e].reverse().find((c) => !!c.element);
|
|
9
|
+
let u = (i = n == null ? void 0 : n.element) == null ? void 0 : i.parentElement;
|
|
10
|
+
for (; u && (t != null && t.element); ) {
|
|
11
|
+
if (t && u.contains(t.element))
|
|
12
|
+
return u;
|
|
13
|
+
u = u.parentElement;
|
|
14
|
+
}
|
|
15
|
+
return ve(u).body;
|
|
16
|
+
}
|
|
17
|
+
function Ve(e) {
|
|
18
|
+
return e == null ? void 0 : e.__unstablePrivateStore;
|
|
19
|
+
}
|
|
20
|
+
function He(e = {}) {
|
|
21
|
+
var i;
|
|
22
|
+
de(e, e.store);
|
|
23
|
+
const n = (i = e.store) == null ? void 0 : i.getState(), t = F(
|
|
24
|
+
e.items,
|
|
25
|
+
n == null ? void 0 : n.items,
|
|
26
|
+
e.defaultItems,
|
|
27
|
+
[]
|
|
28
|
+
), u = new Map(t.map((o) => [o.id, o])), c = {
|
|
29
|
+
items: t,
|
|
30
|
+
renderedItems: F(n == null ? void 0 : n.renderedItems, [])
|
|
31
|
+
}, l = Ve(e.store), a = X(
|
|
32
|
+
{ items: t, renderedItems: c.renderedItems },
|
|
33
|
+
l
|
|
34
|
+
), r = X(c, e.store), x = (o) => {
|
|
35
|
+
const f = ge(o, (m) => m.element);
|
|
36
|
+
a.setState("renderedItems", f), r.setState("renderedItems", f);
|
|
37
|
+
};
|
|
38
|
+
$(r, () => fe(a)), $(a, () => Z(a, ["items"], (o) => {
|
|
39
|
+
r.setState("items", o.items);
|
|
40
|
+
})), $(a, () => Z(a, ["renderedItems"], (o) => {
|
|
41
|
+
let f = !0, m = requestAnimationFrame(() => {
|
|
42
|
+
const { renderedItems: S } = r.getState();
|
|
43
|
+
o.renderedItems !== S && x(o.renderedItems);
|
|
44
|
+
});
|
|
45
|
+
if (typeof IntersectionObserver != "function")
|
|
46
|
+
return () => cancelAnimationFrame(m);
|
|
47
|
+
const w = () => {
|
|
48
|
+
if (f) {
|
|
49
|
+
f = !1;
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
cancelAnimationFrame(m), m = requestAnimationFrame(() => x(o.renderedItems));
|
|
53
|
+
}, D = We(o.renderedItems), g = new IntersectionObserver(w, { root: D });
|
|
54
|
+
for (const S of o.renderedItems)
|
|
55
|
+
S.element && g.observe(S.element);
|
|
56
|
+
return () => {
|
|
57
|
+
cancelAnimationFrame(m), g.disconnect();
|
|
58
|
+
};
|
|
59
|
+
}));
|
|
60
|
+
const v = (o, f, m = !1) => {
|
|
61
|
+
let w;
|
|
62
|
+
return f((g) => {
|
|
63
|
+
const S = g.findIndex(({ id: b }) => b === o.id), P = g.slice();
|
|
64
|
+
if (S !== -1) {
|
|
65
|
+
w = g[S];
|
|
66
|
+
const b = T(T({}, w), o);
|
|
67
|
+
P[S] = b, u.set(o.id, b);
|
|
68
|
+
} else
|
|
69
|
+
P.push(o), u.set(o.id, o);
|
|
70
|
+
return P;
|
|
71
|
+
}), () => {
|
|
72
|
+
f((g) => {
|
|
73
|
+
if (!w)
|
|
74
|
+
return m && u.delete(o.id), g.filter(({ id: b }) => b !== o.id);
|
|
75
|
+
const S = g.findIndex(({ id: b }) => b === o.id);
|
|
76
|
+
if (S === -1) return g;
|
|
77
|
+
const P = g.slice();
|
|
78
|
+
return P[S] = w, u.set(o.id, w), P;
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
}, K = (o) => v(
|
|
82
|
+
o,
|
|
83
|
+
(f) => a.setState("items", f),
|
|
84
|
+
!0
|
|
85
|
+
);
|
|
86
|
+
return j(T({}, r), {
|
|
87
|
+
registerItem: K,
|
|
88
|
+
renderItem: (o) => Ie(
|
|
89
|
+
K(o),
|
|
90
|
+
v(
|
|
91
|
+
o,
|
|
92
|
+
(f) => a.setState("renderedItems", f)
|
|
93
|
+
)
|
|
94
|
+
),
|
|
95
|
+
item: (o) => {
|
|
96
|
+
if (!o) return null;
|
|
97
|
+
let f = u.get(o);
|
|
98
|
+
if (!f) {
|
|
99
|
+
const { items: m } = a.getState();
|
|
100
|
+
f = m.find((w) => w.id === o), f && u.set(o, f);
|
|
101
|
+
}
|
|
102
|
+
return f || null;
|
|
103
|
+
},
|
|
104
|
+
// @ts-expect-error Internal
|
|
105
|
+
__unstablePrivateStore: a
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
function Ne(e, i, n) {
|
|
109
|
+
return Se(i, [n.store]), B(e, n, "items", "setItems"), e;
|
|
110
|
+
}
|
|
111
|
+
function ae(e) {
|
|
112
|
+
const i = [];
|
|
113
|
+
for (const n of e)
|
|
114
|
+
i.push(...n);
|
|
115
|
+
return i;
|
|
116
|
+
}
|
|
117
|
+
function Y(e) {
|
|
118
|
+
return e.slice().reverse();
|
|
119
|
+
}
|
|
120
|
+
var Ue = { id: null };
|
|
121
|
+
function R(e, i) {
|
|
122
|
+
return e.find((n) => i ? !n.disabled && n.id !== i : !n.disabled);
|
|
123
|
+
}
|
|
124
|
+
function $e(e, i) {
|
|
125
|
+
return e.filter((n) => i ? !n.disabled && n.id !== i : !n.disabled);
|
|
126
|
+
}
|
|
127
|
+
function re(e, i) {
|
|
128
|
+
return e.filter((n) => n.rowId === i);
|
|
129
|
+
}
|
|
130
|
+
function je(e, i, n = !1) {
|
|
131
|
+
const t = e.findIndex((u) => u.id === i);
|
|
132
|
+
return [
|
|
133
|
+
...e.slice(t + 1),
|
|
134
|
+
...n ? [Ue] : [],
|
|
135
|
+
...e.slice(0, t)
|
|
136
|
+
];
|
|
137
|
+
}
|
|
138
|
+
function ce(e) {
|
|
139
|
+
const i = [];
|
|
140
|
+
for (const n of e) {
|
|
141
|
+
const t = i.find((u) => {
|
|
142
|
+
var c;
|
|
143
|
+
return ((c = u[0]) == null ? void 0 : c.rowId) === n.rowId;
|
|
144
|
+
});
|
|
145
|
+
t ? t.push(n) : i.push([n]);
|
|
146
|
+
}
|
|
147
|
+
return i;
|
|
148
|
+
}
|
|
149
|
+
function le(e) {
|
|
150
|
+
let i = 0;
|
|
151
|
+
for (const { length: n } of e)
|
|
152
|
+
n > i && (i = n);
|
|
153
|
+
return i;
|
|
154
|
+
}
|
|
155
|
+
function qe(e) {
|
|
156
|
+
return {
|
|
157
|
+
id: "__EMPTY_ITEM__",
|
|
158
|
+
disabled: !0,
|
|
159
|
+
rowId: e
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
function Ge(e, i, n) {
|
|
163
|
+
const t = le(e);
|
|
164
|
+
for (const u of e)
|
|
165
|
+
for (let c = 0; c < t; c += 1) {
|
|
166
|
+
const l = u[c];
|
|
167
|
+
if (!l || n && l.disabled) {
|
|
168
|
+
const r = c === 0 && n ? R(u) : u[c - 1];
|
|
169
|
+
u[c] = r && i !== r.id && n ? r : qe(r == null ? void 0 : r.rowId);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return e;
|
|
173
|
+
}
|
|
174
|
+
function Qe(e) {
|
|
175
|
+
const i = ce(e), n = le(i), t = [];
|
|
176
|
+
for (let u = 0; u < n; u += 1)
|
|
177
|
+
for (const c of i) {
|
|
178
|
+
const l = c[u];
|
|
179
|
+
l && t.push(j(T({}, l), {
|
|
180
|
+
// If there's no rowId, it means that it's not a grid composite, but
|
|
181
|
+
// a single row instead. So, instead of verticalizing it, that is,
|
|
182
|
+
// assigning a different rowId based on the column index, we keep it
|
|
183
|
+
// undefined so they will be part of the same row. This is useful
|
|
184
|
+
// when using up/down on one-dimensional composites.
|
|
185
|
+
rowId: l.rowId ? `${u}` : void 0
|
|
186
|
+
}));
|
|
187
|
+
}
|
|
188
|
+
return t;
|
|
189
|
+
}
|
|
190
|
+
function lt(e = {}) {
|
|
191
|
+
var i;
|
|
192
|
+
const n = (i = e.store) == null ? void 0 : i.getState(), t = He(e), u = F(
|
|
193
|
+
e.activeId,
|
|
194
|
+
n == null ? void 0 : n.activeId,
|
|
195
|
+
e.defaultActiveId
|
|
196
|
+
), c = j(T({}, t.getState()), {
|
|
197
|
+
id: F(
|
|
198
|
+
e.id,
|
|
199
|
+
n == null ? void 0 : n.id,
|
|
200
|
+
`id-${Math.random().toString(36).slice(2, 8)}`
|
|
201
|
+
),
|
|
202
|
+
activeId: u,
|
|
203
|
+
baseElement: F(n == null ? void 0 : n.baseElement, null),
|
|
204
|
+
includesBaseElement: F(
|
|
205
|
+
e.includesBaseElement,
|
|
206
|
+
n == null ? void 0 : n.includesBaseElement,
|
|
207
|
+
u === null
|
|
208
|
+
),
|
|
209
|
+
moves: F(n == null ? void 0 : n.moves, 0),
|
|
210
|
+
orientation: F(
|
|
211
|
+
e.orientation,
|
|
212
|
+
n == null ? void 0 : n.orientation,
|
|
213
|
+
"both"
|
|
214
|
+
),
|
|
215
|
+
rtl: F(e.rtl, n == null ? void 0 : n.rtl, !1),
|
|
216
|
+
virtualFocus: F(
|
|
217
|
+
e.virtualFocus,
|
|
218
|
+
n == null ? void 0 : n.virtualFocus,
|
|
219
|
+
!1
|
|
220
|
+
),
|
|
221
|
+
focusLoop: F(e.focusLoop, n == null ? void 0 : n.focusLoop, !1),
|
|
222
|
+
focusWrap: F(e.focusWrap, n == null ? void 0 : n.focusWrap, !1),
|
|
223
|
+
focusShift: F(e.focusShift, n == null ? void 0 : n.focusShift, !1)
|
|
224
|
+
}), l = X(c, t, e.store);
|
|
225
|
+
$(
|
|
226
|
+
l,
|
|
227
|
+
() => me(l, ["renderedItems", "activeId"], (r) => {
|
|
228
|
+
l.setState("activeId", (x) => {
|
|
229
|
+
var v;
|
|
230
|
+
return x !== void 0 ? x : (v = R(r.renderedItems)) == null ? void 0 : v.id;
|
|
231
|
+
});
|
|
232
|
+
})
|
|
233
|
+
);
|
|
234
|
+
const a = (r = "next", x = {}) => {
|
|
235
|
+
var v, K;
|
|
236
|
+
const o = l.getState(), {
|
|
237
|
+
skip: f = 0,
|
|
238
|
+
activeId: m = o.activeId,
|
|
239
|
+
focusShift: w = o.focusShift,
|
|
240
|
+
focusLoop: D = o.focusLoop,
|
|
241
|
+
focusWrap: g = o.focusWrap,
|
|
242
|
+
includesBaseElement: S = o.includesBaseElement,
|
|
243
|
+
renderedItems: P = o.renderedItems,
|
|
244
|
+
rtl: b = o.rtl
|
|
245
|
+
} = x, C = r === "up" || r === "down", W = r === "next" || r === "down", q = W ? b && !C : !b || C, N = w && !f;
|
|
246
|
+
let p = C ? ae(
|
|
247
|
+
Ge(ce(P), m, N)
|
|
248
|
+
) : P;
|
|
249
|
+
if (p = q ? Y(p) : p, p = C ? Qe(p) : p, m == null)
|
|
250
|
+
return (v = R(p)) == null ? void 0 : v.id;
|
|
251
|
+
const M = p.find((I) => I.id === m);
|
|
252
|
+
if (!M)
|
|
253
|
+
return (K = R(p)) == null ? void 0 : K.id;
|
|
254
|
+
const U = p.some((I) => I.rowId), G = p.indexOf(M), s = p.slice(G + 1), d = re(s, M.rowId);
|
|
255
|
+
if (f) {
|
|
256
|
+
const I = $e(d, m), h = I.slice(f)[0] || // If we can't find an item, just return the last one.
|
|
257
|
+
I[I.length - 1];
|
|
258
|
+
return h == null ? void 0 : h.id;
|
|
259
|
+
}
|
|
260
|
+
const E = D && (C ? D !== "horizontal" : D !== "vertical"), y = U && g && (C ? g !== "horizontal" : g !== "vertical"), _ = W ? (!U || C) && E && S : C ? S : !1;
|
|
261
|
+
if (E) {
|
|
262
|
+
const I = y && !_ ? p : re(p, M.rowId), h = je(I, m, _), k = R(h, m);
|
|
263
|
+
return k == null ? void 0 : k.id;
|
|
264
|
+
}
|
|
265
|
+
if (y) {
|
|
266
|
+
const I = R(
|
|
267
|
+
// We can use nextItems, which contains all the next items, including
|
|
268
|
+
// items from other rows, to wrap between rows. However, if there is a
|
|
269
|
+
// null item (the composite container), we'll only use the next items in
|
|
270
|
+
// the row. So moving next from the last item will focus on the
|
|
271
|
+
// composite container. On grid composites, horizontal navigation never
|
|
272
|
+
// focuses on the composite container, only vertical.
|
|
273
|
+
_ ? d : s,
|
|
274
|
+
m
|
|
275
|
+
);
|
|
276
|
+
return _ ? (I == null ? void 0 : I.id) || null : I == null ? void 0 : I.id;
|
|
277
|
+
}
|
|
278
|
+
const A = R(d, m);
|
|
279
|
+
return !A && _ ? null : A == null ? void 0 : A.id;
|
|
280
|
+
};
|
|
281
|
+
return j(T(T({}, t), l), {
|
|
282
|
+
setBaseElement: (r) => l.setState("baseElement", r),
|
|
283
|
+
setActiveId: (r) => l.setState("activeId", r),
|
|
284
|
+
move: (r) => {
|
|
285
|
+
r !== void 0 && (l.setState("activeId", r), l.setState("moves", (x) => x + 1));
|
|
286
|
+
},
|
|
287
|
+
first: () => {
|
|
288
|
+
var r;
|
|
289
|
+
return (r = R(l.getState().renderedItems)) == null ? void 0 : r.id;
|
|
290
|
+
},
|
|
291
|
+
last: () => {
|
|
292
|
+
var r;
|
|
293
|
+
return (r = R(Y(l.getState().renderedItems))) == null ? void 0 : r.id;
|
|
294
|
+
},
|
|
295
|
+
next: (r) => (r !== void 0 && typeof r == "number" && (r = { skip: r }), a("next", r)),
|
|
296
|
+
previous: (r) => (r !== void 0 && typeof r == "number" && (r = { skip: r }), a("previous", r)),
|
|
297
|
+
down: (r) => (r !== void 0 && typeof r == "number" && (r = { skip: r }), a("down", r)),
|
|
298
|
+
up: (r) => (r !== void 0 && typeof r == "number" && (r = { skip: r }), a("up", r))
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
function dt(e, i, n) {
|
|
302
|
+
return e = Ne(e, i, n), B(e, n, "activeId", "setActiveId"), B(e, n, "includesBaseElement"), B(e, n, "virtualFocus"), B(e, n, "orientation"), B(e, n, "rtl"), B(e, n, "focusLoop"), B(e, n, "focusWrap"), B(e, n, "focusShift"), e;
|
|
303
|
+
}
|
|
304
|
+
var Xe = "div";
|
|
305
|
+
function Ye(e) {
|
|
306
|
+
return e.some((i) => !!i.rowId);
|
|
307
|
+
}
|
|
308
|
+
function Je(e) {
|
|
309
|
+
const i = e.target;
|
|
310
|
+
return i && !ue(i) ? !1 : e.key.length === 1 && !e.ctrlKey && !e.metaKey;
|
|
311
|
+
}
|
|
312
|
+
function Ze(e) {
|
|
313
|
+
return e.key === "Shift" || e.key === "Control" || e.key === "Alt" || e.key === "Meta";
|
|
314
|
+
}
|
|
315
|
+
function se(e, i, n) {
|
|
316
|
+
return H((t) => {
|
|
317
|
+
var u;
|
|
318
|
+
if (i == null || i(t), t.defaultPrevented || t.isPropagationStopped() || !z(t) || Ze(t) || Je(t)) return;
|
|
319
|
+
const c = e.getState(), l = (u = L(e, c.activeId)) == null ? void 0 : u.element;
|
|
320
|
+
if (!l) return;
|
|
321
|
+
const a = t, r = ie(a, ["view"]), x = n == null ? void 0 : n.current;
|
|
322
|
+
l !== x && l.focus(), Re(l, t.type, r) || t.preventDefault(), t.currentTarget.contains(l) && t.stopPropagation();
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
function et(e) {
|
|
326
|
+
return Te(
|
|
327
|
+
ae(Y(Me(e)))
|
|
328
|
+
);
|
|
329
|
+
}
|
|
330
|
+
function tt(e) {
|
|
331
|
+
const [i, n] = Oe(!1), t = ze(() => n(!0), []), u = e.useState(
|
|
332
|
+
(c) => L(e, c.activeId)
|
|
333
|
+
);
|
|
334
|
+
return oe(() => {
|
|
335
|
+
const c = u == null ? void 0 : u.element;
|
|
336
|
+
i && c && (n(!1), c.focus({ preventScroll: !0 }));
|
|
337
|
+
}, [u, i]), t;
|
|
338
|
+
}
|
|
339
|
+
var nt = pe(
|
|
340
|
+
function(i) {
|
|
341
|
+
var n = i, {
|
|
342
|
+
store: t,
|
|
343
|
+
composite: u = !0,
|
|
344
|
+
focusOnMove: c = u,
|
|
345
|
+
moveOnKeyPress: l = !0
|
|
346
|
+
} = n, a = ie(n, [
|
|
347
|
+
"store",
|
|
348
|
+
"composite",
|
|
349
|
+
"focusOnMove",
|
|
350
|
+
"moveOnKeyPress"
|
|
351
|
+
]);
|
|
352
|
+
const r = De();
|
|
353
|
+
t = t || r, Ee(
|
|
354
|
+
t,
|
|
355
|
+
process.env.NODE_ENV !== "production" && "Composite must receive a `store` prop or be wrapped in a CompositeProvider component."
|
|
356
|
+
);
|
|
357
|
+
const x = ne(null), v = ne(null), K = tt(t), o = t.useState("moves"), [, f] = ye(
|
|
358
|
+
u ? t.setBaseElement : null
|
|
359
|
+
);
|
|
360
|
+
oe(() => {
|
|
361
|
+
var s;
|
|
362
|
+
if (!t || !o || !u || !c) return;
|
|
363
|
+
const { activeId: d } = t.getState(), E = (s = L(t, d)) == null ? void 0 : s.element;
|
|
364
|
+
E && we(E);
|
|
365
|
+
}, [t, o, u, c]), ee(() => {
|
|
366
|
+
if (!t || !o || !u) return;
|
|
367
|
+
const { baseElement: s, activeId: d } = t.getState();
|
|
368
|
+
if (!(d === null) || !s) return;
|
|
369
|
+
const y = v.current;
|
|
370
|
+
v.current = null, y && O(y, { relatedTarget: s }), be(s) || s.focus();
|
|
371
|
+
}, [t, o, u]);
|
|
372
|
+
const m = t.useState("activeId"), w = t.useState("virtualFocus");
|
|
373
|
+
ee(() => {
|
|
374
|
+
var s;
|
|
375
|
+
if (!t || !u || !w) return;
|
|
376
|
+
const d = v.current;
|
|
377
|
+
if (v.current = null, !d) return;
|
|
378
|
+
const y = ((s = L(t, m)) == null ? void 0 : s.element) || he(d);
|
|
379
|
+
y !== d && O(d, { relatedTarget: y });
|
|
380
|
+
}, [t, m, w, u]);
|
|
381
|
+
const D = se(
|
|
382
|
+
t,
|
|
383
|
+
a.onKeyDownCapture,
|
|
384
|
+
v
|
|
385
|
+
), g = se(
|
|
386
|
+
t,
|
|
387
|
+
a.onKeyUpCapture,
|
|
388
|
+
v
|
|
389
|
+
), S = a.onFocusCapture, P = H((s) => {
|
|
390
|
+
if (S == null || S(s), s.defaultPrevented || !t) return;
|
|
391
|
+
const { virtualFocus: d } = t.getState();
|
|
392
|
+
if (!d) return;
|
|
393
|
+
const E = s.relatedTarget, y = Ke(s.currentTarget);
|
|
394
|
+
z(s) && y && (s.stopPropagation(), v.current = E);
|
|
395
|
+
}), b = a.onFocus, C = H((s) => {
|
|
396
|
+
if (b == null || b(s), s.defaultPrevented || !u || !t) return;
|
|
397
|
+
const { relatedTarget: d } = s, { virtualFocus: E } = t.getState();
|
|
398
|
+
E ? z(s) && !Q(t, d) && queueMicrotask(K) : z(s) && t.setActiveId(null);
|
|
399
|
+
}), W = a.onBlurCapture, q = H((s) => {
|
|
400
|
+
var d;
|
|
401
|
+
if (W == null || W(s), s.defaultPrevented || !t) return;
|
|
402
|
+
const { virtualFocus: E, activeId: y } = t.getState();
|
|
403
|
+
if (!E) return;
|
|
404
|
+
const _ = (d = L(t, y)) == null ? void 0 : d.element, A = s.relatedTarget, I = Q(t, A), h = v.current;
|
|
405
|
+
v.current = null, z(s) && I ? (A === _ ? h && h !== A && O(h, s) : _ ? O(_, s) : h && O(h, s), s.stopPropagation()) : !Q(t, s.target) && _ && O(_, s);
|
|
406
|
+
}), N = a.onKeyDown, p = xe(l), M = H((s) => {
|
|
407
|
+
var d;
|
|
408
|
+
if (N == null || N(s), s.defaultPrevented || !t || !z(s)) return;
|
|
409
|
+
const { orientation: E, renderedItems: y, activeId: _ } = t.getState(), A = L(t, _);
|
|
410
|
+
if ((d = A == null ? void 0 : A.element) != null && d.isConnected) return;
|
|
411
|
+
const I = E !== "horizontal", h = E !== "vertical", k = Ye(y);
|
|
412
|
+
if ((s.key === "ArrowLeft" || s.key === "ArrowRight" || s.key === "Home" || s.key === "End") && ue(s.currentTarget)) return;
|
|
413
|
+
const J = {
|
|
414
|
+
ArrowUp: (k || I) && (() => {
|
|
415
|
+
if (k) {
|
|
416
|
+
const V = et(y);
|
|
417
|
+
return V == null ? void 0 : V.id;
|
|
418
|
+
}
|
|
419
|
+
return t == null ? void 0 : t.last();
|
|
420
|
+
}),
|
|
421
|
+
ArrowRight: (k || h) && t.first,
|
|
422
|
+
ArrowDown: (k || I) && t.first,
|
|
423
|
+
ArrowLeft: (k || h) && t.last,
|
|
424
|
+
Home: t.first,
|
|
425
|
+
End: t.last,
|
|
426
|
+
PageUp: t.first,
|
|
427
|
+
PageDown: t.last
|
|
428
|
+
}[s.key];
|
|
429
|
+
if (J) {
|
|
430
|
+
const V = J();
|
|
431
|
+
if (V !== void 0) {
|
|
432
|
+
if (!p(s)) return;
|
|
433
|
+
s.preventDefault(), t.move(V);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
});
|
|
437
|
+
a = _e(
|
|
438
|
+
a,
|
|
439
|
+
(s) => /* @__PURE__ */ Fe.jsx(Le, { value: t, children: s }),
|
|
440
|
+
[t]
|
|
441
|
+
);
|
|
442
|
+
const U = t.useState((s) => {
|
|
443
|
+
var d;
|
|
444
|
+
if (t && u && s.virtualFocus)
|
|
445
|
+
return (d = L(t, s.activeId)) == null ? void 0 : d.id;
|
|
446
|
+
});
|
|
447
|
+
a = Pe(te({
|
|
448
|
+
"aria-activedescendant": U
|
|
449
|
+
}, a), {
|
|
450
|
+
ref: Ce(x, f, a.ref),
|
|
451
|
+
onKeyDownCapture: D,
|
|
452
|
+
onKeyUpCapture: g,
|
|
453
|
+
onFocusCapture: P,
|
|
454
|
+
onFocus: C,
|
|
455
|
+
onBlurCapture: q,
|
|
456
|
+
onKeyDown: M
|
|
457
|
+
});
|
|
458
|
+
const G = t.useState(
|
|
459
|
+
(s) => u && (s.virtualFocus || s.activeId === null)
|
|
460
|
+
);
|
|
461
|
+
return a = Ae(te({ focusable: G }, a)), a;
|
|
462
|
+
}
|
|
463
|
+
);
|
|
464
|
+
ke(function(i) {
|
|
465
|
+
const n = nt(i);
|
|
466
|
+
return Be(Xe, n);
|
|
467
|
+
});
|
|
468
|
+
export {
|
|
469
|
+
nt as a,
|
|
470
|
+
He as b,
|
|
471
|
+
lt as c,
|
|
472
|
+
dt as u
|
|
473
|
+
};
|