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
package/dist/Toast.mjs
ADDED
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import d, { useEffect as C, useCallback as I, useState as M, useMemo as R, cloneElement as z, useContext as H } from "react";
|
|
3
|
+
import v, { css as w, th as m, ThemeContext as L, ThemeProvider as W } from "@xstyled/styled-components";
|
|
4
|
+
import { r as Y } from "./index-BYdkhqH4.mjs";
|
|
5
|
+
import { Box as $ } from "./Box.mjs";
|
|
6
|
+
import { Alert as _ } from "./Alert.mjs";
|
|
7
|
+
import { CloseButton as B } from "./CloseButton.mjs";
|
|
8
|
+
import { forwardRef as D } from "./System.mjs";
|
|
9
|
+
import { Button as U } from "./Button.mjs";
|
|
10
|
+
var j = (t) => typeof t == "function", A = (t, e) => j(t) ? t(e) : t, q = /* @__PURE__ */ (() => {
|
|
11
|
+
let t = 0;
|
|
12
|
+
return () => (++t).toString();
|
|
13
|
+
})(), F = 20, E = /* @__PURE__ */ new Map(), J = 1e3, O = (t) => {
|
|
14
|
+
if (E.has(t)) return;
|
|
15
|
+
let e = setTimeout(() => {
|
|
16
|
+
E.delete(t), h({ type: 4, toastId: t });
|
|
17
|
+
}, J);
|
|
18
|
+
E.set(t, e);
|
|
19
|
+
}, K = (t) => {
|
|
20
|
+
let e = E.get(t);
|
|
21
|
+
e && clearTimeout(e);
|
|
22
|
+
}, S = (t, e) => {
|
|
23
|
+
switch (e.type) {
|
|
24
|
+
case 0:
|
|
25
|
+
return { ...t, toasts: [e.toast, ...t.toasts].slice(0, F) };
|
|
26
|
+
case 1:
|
|
27
|
+
return e.toast.id && K(e.toast.id), { ...t, toasts: t.toasts.map((o) => o.id === e.toast.id ? { ...o, ...e.toast } : o) };
|
|
28
|
+
case 2:
|
|
29
|
+
let { toast: s } = e;
|
|
30
|
+
return t.toasts.find((o) => o.id === s.id) ? S(t, { type: 1, toast: s }) : S(t, { type: 0, toast: s });
|
|
31
|
+
case 3:
|
|
32
|
+
let { toastId: a } = e;
|
|
33
|
+
return a ? O(a) : t.toasts.forEach((o) => {
|
|
34
|
+
O(o.id);
|
|
35
|
+
}), { ...t, toasts: t.toasts.map((o) => o.id === a || a === void 0 ? { ...o, visible: !1 } : o) };
|
|
36
|
+
case 4:
|
|
37
|
+
return e.toastId === void 0 ? { ...t, toasts: [] } : { ...t, toasts: t.toasts.filter((o) => o.id !== e.toastId) };
|
|
38
|
+
case 5:
|
|
39
|
+
return { ...t, pausedAt: e.time };
|
|
40
|
+
case 6:
|
|
41
|
+
let r = e.time - (t.pausedAt || 0);
|
|
42
|
+
return { ...t, pausedAt: void 0, toasts: t.toasts.map((o) => ({ ...o, pauseDuration: o.pauseDuration + r })) };
|
|
43
|
+
}
|
|
44
|
+
}, k = [], T = { toasts: [], pausedAt: void 0 }, h = (t) => {
|
|
45
|
+
T = S(T, t), k.forEach((e) => {
|
|
46
|
+
e(T);
|
|
47
|
+
});
|
|
48
|
+
}, Q = { blank: 4e3, error: 4e3, success: 2e3, loading: 1 / 0, custom: 4e3 }, V = (t = {}) => {
|
|
49
|
+
let [e, s] = M(T);
|
|
50
|
+
C(() => (k.push(s), () => {
|
|
51
|
+
let r = k.indexOf(s);
|
|
52
|
+
r > -1 && k.splice(r, 1);
|
|
53
|
+
}), [e]);
|
|
54
|
+
let a = e.toasts.map((r) => {
|
|
55
|
+
var o, i;
|
|
56
|
+
return { ...t, ...t[r.type], ...r, duration: r.duration || ((o = t[r.type]) == null ? void 0 : o.duration) || (t == null ? void 0 : t.duration) || Q[r.type], style: { ...t.style, ...(i = t[r.type]) == null ? void 0 : i.style, ...r.style } };
|
|
57
|
+
});
|
|
58
|
+
return { ...e, toasts: a };
|
|
59
|
+
}, X = (t, e = "blank", s) => ({ createdAt: Date.now(), visible: !0, type: e, ariaProps: { role: "status", "aria-live": "polite" }, message: t, pauseDuration: 0, ...s, id: (s == null ? void 0 : s.id) || q() }), x = (t) => (e, s) => {
|
|
60
|
+
let a = X(e, t, s);
|
|
61
|
+
return h({ type: 2, toast: a }), a.id;
|
|
62
|
+
}, u = (t, e) => x("blank")(t, e);
|
|
63
|
+
u.error = x("error");
|
|
64
|
+
u.success = x("success");
|
|
65
|
+
u.loading = x("loading");
|
|
66
|
+
u.custom = x("custom");
|
|
67
|
+
u.dismiss = (t) => {
|
|
68
|
+
h({ type: 3, toastId: t });
|
|
69
|
+
};
|
|
70
|
+
u.remove = (t) => h({ type: 4, toastId: t });
|
|
71
|
+
u.promise = (t, e, s) => {
|
|
72
|
+
let a = u.loading(e.loading, { ...s, ...s == null ? void 0 : s.loading });
|
|
73
|
+
return t.then((r) => (u.success(A(e.success, r), { id: a, ...s, ...s == null ? void 0 : s.success }), r)).catch((r) => {
|
|
74
|
+
u.error(A(e.error, r), { id: a, ...s, ...s == null ? void 0 : s.error });
|
|
75
|
+
}), t;
|
|
76
|
+
};
|
|
77
|
+
var Z = (t, e) => {
|
|
78
|
+
h({ type: 1, toast: { id: t, height: e } });
|
|
79
|
+
}, tt = () => {
|
|
80
|
+
h({ type: 5, time: Date.now() });
|
|
81
|
+
}, et = (t) => {
|
|
82
|
+
let { toasts: e, pausedAt: s } = V(t);
|
|
83
|
+
C(() => {
|
|
84
|
+
if (s) return;
|
|
85
|
+
let o = Date.now(), i = e.map((n) => {
|
|
86
|
+
if (n.duration === 1 / 0) return;
|
|
87
|
+
let c = (n.duration || 0) + n.pauseDuration - (o - n.createdAt);
|
|
88
|
+
if (c < 0) {
|
|
89
|
+
n.visible && u.dismiss(n.id);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
return setTimeout(() => u.dismiss(n.id), c);
|
|
93
|
+
});
|
|
94
|
+
return () => {
|
|
95
|
+
i.forEach((n) => n && clearTimeout(n));
|
|
96
|
+
};
|
|
97
|
+
}, [e, s]);
|
|
98
|
+
let a = I(() => {
|
|
99
|
+
s && h({ type: 6, time: Date.now() });
|
|
100
|
+
}, [s]), r = I((o, i) => {
|
|
101
|
+
let { reverseOrder: n = !1, gutter: c = 8, defaultPosition: f } = i || {}, p = e.filter((l) => (l.position || f) === (o.position || f) && l.height), g = p.findIndex((l) => l.id === o.id), y = p.filter((l, b) => b < g && l.visible).length;
|
|
102
|
+
return p.filter((l) => l.visible).slice(...n ? [y + 1] : [0, y]).reduce((l, b) => l + (b.height || 0) + c, 0);
|
|
103
|
+
}, [e]);
|
|
104
|
+
return { toasts: e, handlers: { updateHeight: Z, startPause: tt, endPause: a, calculateOffset: r } };
|
|
105
|
+
}, P = u;
|
|
106
|
+
function st(t = !1) {
|
|
107
|
+
const [e, s] = M(!1);
|
|
108
|
+
return C(() => {
|
|
109
|
+
s(!0);
|
|
110
|
+
}, []), R(() => t ? (a) => a : e ? (a, r, o) => Y.createPortal(a, r || document.body, o) : () => null, [t, e]);
|
|
111
|
+
}
|
|
112
|
+
const ot = v($)(
|
|
113
|
+
({ isBottom: t }) => w`
|
|
114
|
+
${m("toasts.default")}
|
|
115
|
+
${t ? m("toasts.bottom") : m("toasts.top")}
|
|
116
|
+
|
|
117
|
+
position: fixed;
|
|
118
|
+
z-index: 9999;
|
|
119
|
+
transition: all 400ms ease-out;
|
|
120
|
+
`
|
|
121
|
+
), rt = v(_)(
|
|
122
|
+
() => w`
|
|
123
|
+
position: relative;
|
|
124
|
+
padding: lg;
|
|
125
|
+
${m("toasts.growls.default")};
|
|
126
|
+
|
|
127
|
+
div:first-of-type {
|
|
128
|
+
align-self: baseline;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
button {
|
|
132
|
+
flex-shrink: 0;
|
|
133
|
+
}
|
|
134
|
+
`
|
|
135
|
+
), at = v($)(
|
|
136
|
+
() => w`
|
|
137
|
+
display: flex;
|
|
138
|
+
align-items: center;
|
|
139
|
+
padding-bottom: xs;
|
|
140
|
+
${m("toasts.growls.title")};
|
|
141
|
+
|
|
142
|
+
& > *:first-child {
|
|
143
|
+
flex-shrink: 0;
|
|
144
|
+
}
|
|
145
|
+
`
|
|
146
|
+
), nt = v(_)`
|
|
147
|
+
display: flex;
|
|
148
|
+
align-items: center;
|
|
149
|
+
padding: sm md;
|
|
150
|
+
${m("toasts.snackbar.default")};
|
|
151
|
+
|
|
152
|
+
> div {
|
|
153
|
+
align-self: center !important;
|
|
154
|
+
}
|
|
155
|
+
`, it = v.box(
|
|
156
|
+
({ variant: t }) => w`
|
|
157
|
+
${m("toasts.snackbar.separator.default")};
|
|
158
|
+
${m(`toasts.snackbar.separator.${t}`)};
|
|
159
|
+
padding-left: sm;
|
|
160
|
+
`
|
|
161
|
+
), lt = {
|
|
162
|
+
"top-left": { top: 0, left: 0 },
|
|
163
|
+
"top-center": { top: 0, left: "50%" },
|
|
164
|
+
"top-right": { top: 0, right: 0 },
|
|
165
|
+
"bottom-left": { bottom: 0, left: 0 },
|
|
166
|
+
"bottom-center": { bottom: 0, left: "50%" },
|
|
167
|
+
"bottom-right": { bottom: 0, right: 0 }
|
|
168
|
+
}, dt = ({
|
|
169
|
+
calculateOffset: t,
|
|
170
|
+
toast: e,
|
|
171
|
+
updateHeight: s
|
|
172
|
+
}) => {
|
|
173
|
+
var p, g, y;
|
|
174
|
+
if (typeof e.message == "string")
|
|
175
|
+
return console.warn("You must pass a React component or a HTML element."), null;
|
|
176
|
+
const a = t(e, { reverseOrder: !1, gutter: 0 }), r = (l) => {
|
|
177
|
+
if (l && typeof e.height != "number") {
|
|
178
|
+
const b = l.getBoundingClientRect().height;
|
|
179
|
+
s(e.id, b);
|
|
180
|
+
}
|
|
181
|
+
}, o = (p = e.position) == null ? void 0 : p.includes("center"), i = (g = e.position) == null ? void 0 : g.includes("top"), n = (y = e.position) == null ? void 0 : y.includes("bottom"), c = () => {
|
|
182
|
+
e.onClose && e.onClose(), P.dismiss(e.id);
|
|
183
|
+
}, f = {
|
|
184
|
+
opacity: e.visible ? 1 : 0,
|
|
185
|
+
transform: `translate(${o ? "-50%" : "0"}, ${a * (i ? 1 : -1)}px)`,
|
|
186
|
+
...lt[e.position]
|
|
187
|
+
};
|
|
188
|
+
return /* @__PURE__ */ d.createElement(
|
|
189
|
+
ot,
|
|
190
|
+
{
|
|
191
|
+
isBottom: n,
|
|
192
|
+
opacity: f.opacity,
|
|
193
|
+
ref: r,
|
|
194
|
+
style: f,
|
|
195
|
+
transform: f.transform,
|
|
196
|
+
...e.ariaProps
|
|
197
|
+
},
|
|
198
|
+
z(e.message, { onClose: c })
|
|
199
|
+
);
|
|
200
|
+
}, N = D(
|
|
201
|
+
({ children: t, dataTestId: e, hasCloseButton: s = !0, icon: a, onClose: r, variant: o = "default" }, i) => {
|
|
202
|
+
const n = e ? `${e}-close-button` : void 0;
|
|
203
|
+
return /* @__PURE__ */ d.createElement(
|
|
204
|
+
rt,
|
|
205
|
+
{
|
|
206
|
+
"data-testid": e,
|
|
207
|
+
hasCloseButton: s,
|
|
208
|
+
icon: a,
|
|
209
|
+
ref: i,
|
|
210
|
+
variant: o
|
|
211
|
+
},
|
|
212
|
+
s && /* @__PURE__ */ d.createElement(
|
|
213
|
+
B,
|
|
214
|
+
{
|
|
215
|
+
dataTestId: n,
|
|
216
|
+
onClick: r,
|
|
217
|
+
position: "absolute",
|
|
218
|
+
right: "sm",
|
|
219
|
+
top: "sm"
|
|
220
|
+
}
|
|
221
|
+
),
|
|
222
|
+
/* @__PURE__ */ d.createElement($, { pr: "xl" }, t)
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
);
|
|
226
|
+
N.displayName = "Growl";
|
|
227
|
+
const G = D(
|
|
228
|
+
({ children: t, cta: e, hasCloseButton: s = !0, icon: a, onClose: r, variant: o = "default", ...i }, n) => /* @__PURE__ */ d.createElement(nt, { icon: a, ref: n, variant: o, ...i }, /* @__PURE__ */ d.createElement($, { alignItems: "center", display: "flex", gap: "sm" }, t, e && /* @__PURE__ */ d.createElement(it, { variant: o }, e), s && /* @__PURE__ */ d.createElement(B, { onClick: r, size: "xs" })))
|
|
229
|
+
), ut = D((t, e) => /* @__PURE__ */ d.createElement(U, { flexShrink: 0, ref: e, size: "xs", variant: "ghost", ...t }));
|
|
230
|
+
G.displayName = "Snackbar";
|
|
231
|
+
const Et = ({ pauseOnHover: t = !0 }) => {
|
|
232
|
+
const e = H(L), s = st(), { handlers: a, toasts: r } = et(), { calculateOffset: o, endPause: i, startPause: n, updateHeight: c } = a, f = t ? n : void 0, p = t ? i : void 0;
|
|
233
|
+
return /* @__PURE__ */ d.createElement(W, { theme: e }, r.length > 0 && s(
|
|
234
|
+
/* @__PURE__ */ d.createElement("div", { onMouseEnter: f, onMouseLeave: p }, r.map((g) => /* @__PURE__ */ d.createElement(
|
|
235
|
+
dt,
|
|
236
|
+
{
|
|
237
|
+
calculateOffset: o,
|
|
238
|
+
key: g.id,
|
|
239
|
+
toast: g,
|
|
240
|
+
updateHeight: c
|
|
241
|
+
}
|
|
242
|
+
)))
|
|
243
|
+
));
|
|
244
|
+
}, ct = ({ children: t, ...e }) => /* @__PURE__ */ d.createElement(at, { ...e }, t), ft = (t, e) => {
|
|
245
|
+
var o, i;
|
|
246
|
+
const r = {
|
|
247
|
+
duration: 7e3,
|
|
248
|
+
position: (typeof t == "string" ? void 0 : ((o = t == null ? void 0 : t.type) == null ? void 0 : o.displayName) || ((i = t == null ? void 0 : t.type) == null ? void 0 : i.name)) === "Growl" ? "top-right" : "bottom-center",
|
|
249
|
+
...e
|
|
250
|
+
};
|
|
251
|
+
return P(t, r);
|
|
252
|
+
}, kt = (t) => {
|
|
253
|
+
P.remove(t);
|
|
254
|
+
}, Tt = (t) => {
|
|
255
|
+
P.dismiss(t);
|
|
256
|
+
}, wt = () => ft, $t = { Title: ct, Growl: N, Snackbar: G, SnackbarAction: ut };
|
|
257
|
+
export {
|
|
258
|
+
Et as Notifications,
|
|
259
|
+
$t as Toast,
|
|
260
|
+
Tt as dismiss,
|
|
261
|
+
kt as remove,
|
|
262
|
+
ft as toast,
|
|
263
|
+
wt as useToast
|
|
264
|
+
};
|
package/dist/Toggle.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react"),a=require("./index-C_r0bVmL.js"),s=require("./System.js"),t=require("@xstyled/styled-components"),p=t(a.Checkbox).withConfig({shouldForwardProp:s.shouldForwardProp})(({order:o="-1",size:e})=>t.css`
|
|
2
|
+
${t.th("toggles.item.default")};
|
|
3
|
+
${t.th(`toggles.item.sizes.${e}`)};
|
|
4
|
+
position: relative;
|
|
5
|
+
display: block;
|
|
6
|
+
appearance: none;
|
|
7
|
+
outline: none !important; /* important for firefox */
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
transition: medium;
|
|
10
|
+
order: ${o};
|
|
11
|
+
|
|
12
|
+
&::after {
|
|
13
|
+
${t.th("toggles.after.default")};
|
|
14
|
+
${t.th(`toggles.after.sizes.${e}`)};
|
|
15
|
+
content: '';
|
|
16
|
+
top: 0;
|
|
17
|
+
bottom: 0;
|
|
18
|
+
left: 2;
|
|
19
|
+
position: absolute;
|
|
20
|
+
margin: auto;
|
|
21
|
+
transition: medium;
|
|
22
|
+
z-index: 1;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&:disabled {
|
|
26
|
+
${t.th("toggles.item.disabled")};
|
|
27
|
+
cursor: not-allowed;
|
|
28
|
+
|
|
29
|
+
&::after {
|
|
30
|
+
${t.th("toggles.after.disabled")};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&:checked {
|
|
35
|
+
&::after {
|
|
36
|
+
/* border + left padding + right padding */
|
|
37
|
+
transform: translateX(calc(${t.th(`toggles.item.sizes.${e}.width`)} - 100% - 0.3rem));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&:not(:disabled) {
|
|
41
|
+
${t.th("toggles.item.checked")};
|
|
42
|
+
|
|
43
|
+
&::after {
|
|
44
|
+
${t.th("toggles.after.checked")};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
${t.system};
|
|
50
|
+
`),m=t.box`
|
|
51
|
+
position: relative;
|
|
52
|
+
display: inline-block;
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
`,$=t.box.withConfig({shouldForwardProp:s.shouldForwardProp})(({checked:o,size:e})=>t.css`
|
|
55
|
+
position: absolute;
|
|
56
|
+
z-index: 1;
|
|
57
|
+
display: flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
height: ${t.th(`toggles.item.sizes.${e}.height`)};
|
|
60
|
+
bottom: 0;
|
|
61
|
+
|
|
62
|
+
> svg,
|
|
63
|
+
i {
|
|
64
|
+
${t.th(`toggles.icon.sizes.${e}`)}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
${o&&t.css`
|
|
68
|
+
left: ${t.th(`toggles.icon.position.${e}.left`)};
|
|
69
|
+
color: neutral-90;
|
|
70
|
+
`}
|
|
71
|
+
|
|
72
|
+
${!o&&t.css`
|
|
73
|
+
right: ${t.th(`toggles.icon.position.${e}.right`)};
|
|
74
|
+
`}
|
|
75
|
+
`),g=s.forwardRef(({checked:o,checkedIcon:e,onClick:i,size:l="xs",uncheckedIcon:n,...d},c)=>{const h=e&&n;return r.createElement(m,{onClick:i},h&&r.createElement($,{checked:o,onClick:i,size:l},o?e:n),r.createElement(a.Checkbox$1,{...d,Component:p,checked:o,ref:c,size:l}))});g.displayName="Toggle";exports.Toggle=g;
|
package/dist/Toggle.mjs
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import r from "react";
|
|
3
|
+
import { C as f, a as $ } from "./index-DCOLdphy.mjs";
|
|
4
|
+
import { shouldForwardProp as g, forwardRef as c } from "./System.mjs";
|
|
5
|
+
import s, { css as i, th as t, system as u } from "@xstyled/styled-components";
|
|
6
|
+
const b = s(f).withConfig({ shouldForwardProp: g })(
|
|
7
|
+
({ order: o = "-1", size: e }) => i`
|
|
8
|
+
${t("toggles.item.default")};
|
|
9
|
+
${t(`toggles.item.sizes.${e}`)};
|
|
10
|
+
position: relative;
|
|
11
|
+
display: block;
|
|
12
|
+
appearance: none;
|
|
13
|
+
outline: none !important; /* important for firefox */
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
transition: medium;
|
|
16
|
+
order: ${o};
|
|
17
|
+
|
|
18
|
+
&::after {
|
|
19
|
+
${t("toggles.after.default")};
|
|
20
|
+
${t(`toggles.after.sizes.${e}`)};
|
|
21
|
+
content: '';
|
|
22
|
+
top: 0;
|
|
23
|
+
bottom: 0;
|
|
24
|
+
left: 2;
|
|
25
|
+
position: absolute;
|
|
26
|
+
margin: auto;
|
|
27
|
+
transition: medium;
|
|
28
|
+
z-index: 1;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&:disabled {
|
|
32
|
+
${t("toggles.item.disabled")};
|
|
33
|
+
cursor: not-allowed;
|
|
34
|
+
|
|
35
|
+
&::after {
|
|
36
|
+
${t("toggles.after.disabled")};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&:checked {
|
|
41
|
+
&::after {
|
|
42
|
+
/* border + left padding + right padding */
|
|
43
|
+
transform: translateX(calc(${t(`toggles.item.sizes.${e}.width`)} - 100% - 0.3rem));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&:not(:disabled) {
|
|
47
|
+
${t("toggles.item.checked")};
|
|
48
|
+
|
|
49
|
+
&::after {
|
|
50
|
+
${t("toggles.after.checked")};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
${u};
|
|
56
|
+
`
|
|
57
|
+
), h = s.box`
|
|
58
|
+
position: relative;
|
|
59
|
+
display: inline-block;
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
`, x = s.box.withConfig({ shouldForwardProp: g })(
|
|
62
|
+
({ checked: o, size: e }) => i`
|
|
63
|
+
position: absolute;
|
|
64
|
+
z-index: 1;
|
|
65
|
+
display: flex;
|
|
66
|
+
align-items: center;
|
|
67
|
+
height: ${t(`toggles.item.sizes.${e}.height`)};
|
|
68
|
+
bottom: 0;
|
|
69
|
+
|
|
70
|
+
> svg,
|
|
71
|
+
i {
|
|
72
|
+
${t(`toggles.icon.sizes.${e}`)}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
${o && i`
|
|
76
|
+
left: ${t(`toggles.icon.position.${e}.left`)};
|
|
77
|
+
color: neutral-90;
|
|
78
|
+
`}
|
|
79
|
+
|
|
80
|
+
${!o && i`
|
|
81
|
+
right: ${t(`toggles.icon.position.${e}.right`)};
|
|
82
|
+
`}
|
|
83
|
+
`
|
|
84
|
+
), w = c(
|
|
85
|
+
({ checked: o, checkedIcon: e, onClick: a, size: l = "xs", uncheckedIcon: n, ...m }, d) => {
|
|
86
|
+
const p = e && n;
|
|
87
|
+
return /* @__PURE__ */ r.createElement(h, { onClick: a }, p && /* @__PURE__ */ r.createElement(x, { checked: o, onClick: a, size: l }, o ? e : n), /* @__PURE__ */ r.createElement($, { ...m, Component: b, checked: o, ref: d, size: l }));
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
w.displayName = "Toggle";
|
|
91
|
+
export {
|
|
92
|
+
w as Toggle
|
|
93
|
+
};
|
package/dist/Tooltip.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),F=require("./Box.js"),I=require("./System.js"),i=require("@xstyled/styled-components"),T=require("./BYC7LY2E-BkAEL2VD.js"),S=require("./YV4JVR4I-DIthYWMj.js"),r=require("./LVA2YJMS-B2HZjIhJ.js"),q=require("./JC64G2H7-YkBMNrtl.js");function N(e={}){var n;process.env.NODE_ENV!=="production"&&e.type==="label"&&console.warn("The `type` option on the tooltip store is deprecated.","Render a visually hidden label or use the `aria-label` or `aria-labelledby` attributes on the anchor element instead.","See https://ariakit.org/components/tooltip#tooltip-anchors-must-have-accessible-names");const o=(n=e.store)==null?void 0:n.getState(),t=T.createHovercardStore(r.__spreadProps$1(r.__spreadValues$1({},e),{placement:r.defaultValue(e.placement,o==null?void 0:o.placement,"top"),hideTimeout:r.defaultValue(e.hideTimeout,o==null?void 0:o.hideTimeout,0)})),m=r.__spreadProps$1(r.__spreadValues$1({},t.getState()),{type:r.defaultValue(e.type,o==null?void 0:o.type,"description"),skipTimeout:r.defaultValue(e.skipTimeout,o==null?void 0:o.skipTimeout,300)}),a=S.createStore(m,t,e.store);return r.__spreadValues$1(r.__spreadValues$1({},t),a)}function M(e,n,o){return S.useStoreProps(e,o,"type"),S.useStoreProps(e,o,"skipTimeout"),T.useHovercardStoreProps(e,n,o)}function j(e={}){const[n,o]=S.useStore(N,e);return M(n,o,e)}var R=r.createStoreContext([T.HovercardContextProvider],[T.HovercardScopedContextProvider]),O=R.useProviderContext,D=R.ScopedContextProvider,Y="div",L=r.createHook(function(n){var o=n,{store:t,portal:m=!0,gutter:a=8,preserveTabOrder:x=!1,hideOnHoverOutside:v=!0,hideOnInteractOutside:f=!0}=o,c=r.__objRest(o,["store","portal","gutter","preserveTabOrder","hideOnHoverOutside","hideOnInteractOutside"]);const b=O();t=t||b,r.invariant(t,process.env.NODE_ENV!=="production"&&"Tooltip must receive a `store` prop or be wrapped in a TooltipProvider component."),c=r.useWrapElement(c,u=>r.jsxRuntimeExports.jsx(D,{value:t,children:u}),[t]);const g=t.useState(u=>u.type==="description"?"tooltip":"none");return c=r.__spreadValues({role:g},c),c=T.useHovercard(r.__spreadProps(r.__spreadValues({},c),{store:t,portal:m,gutter:a,preserveTabOrder:x,hideOnHoverOutside(u){if(r.isFalsyBooleanCallback(v,u))return!1;const d=t==null?void 0:t.getState().anchorElement;return d?!("focusVisible"in d.dataset):!0},hideOnInteractOutside:u=>{if(r.isFalsyBooleanCallback(f,u))return!1;const d=t==null?void 0:t.getState().anchorElement;return d?!r.contains(d,u.target):!0}})),c}),z=q.createDialogComponent(r.forwardRef2(function(n){const o=L(n);return r.createElement(Y,o)}),O),J="div",h=S.createStore({activeStore:null});function C(e){return()=>{const{activeStore:n}=h.getState();n===e&&h.setState("activeStore",null)}}var G=r.createHook(function(n){var o=n,{store:t,showOnHover:m=!0}=o,a=r.__objRest(o,["store","showOnHover"]);const x=O();t=t||x,r.invariant(t,process.env.NODE_ENV!=="production"&&"TooltipAnchor must receive a `store` prop or be wrapped in a TooltipProvider component.");const v=l.useRef(!1);l.useEffect(()=>S.sync(t,["mounted"],s=>{s.mounted||(v.current=!1)}),[t]),l.useEffect(()=>{if(t)return r.chain(C(t),S.sync(t,["mounted","skipTimeout"],s=>{if(!t)return;if(s.mounted){const{activeStore:E}=h.getState();return E!==t&&(E==null||E.hide()),h.setState("activeStore",t)}const p=setTimeout(C(t),s.skipTimeout);return()=>clearTimeout(p)}))},[t]);const f=a.onMouseEnter,c=r.useEvent(s=>{f==null||f(s),v.current=!0}),b=a.onFocusVisible,g=r.useEvent(s=>{b==null||b(s),!s.defaultPrevented&&(t==null||t.setAnchorElement(s.currentTarget),t==null||t.show())}),u=a.onBlur,d=r.useEvent(s=>{if(u==null||u(s),s.defaultPrevented)return;const{activeStore:p}=h.getState();v.current=!1,p===t&&h.setState("activeStore",null)}),$=t.useState("type"),P=t.useState(s=>{var p;return(p=s.contentElement)==null?void 0:p.id});return a=r.__spreadProps(r.__spreadValues({"aria-labelledby":$==="label"?P:void 0},a),{onMouseEnter:c,onFocusVisible:g,onBlur:d}),a=T.useHovercardAnchor(r.__spreadValues({store:t,showOnHover(s){if(!v.current||r.isFalsyBooleanCallback(m,s))return!1;const{activeStore:p}=h.getState();return p?(t==null||t.show(),!1):!0}},a)),a}),K=r.forwardRef2(function(n){const o=G(n);return r.createElement(J,o)});const W={top:"translate3d(0, -4px, 0)",right:"translate3d(4px, 0, 0)",bottom:"translate3d(0, 4px, 0)",left:"translate3d(-4px, 0, 0)",auto:"translate3d(0, 0, 0)"},X=e=>{const n=e==null?void 0:e.split("-"),o=n[0];if(n.length<2)return W[o];{let t="0, 0";return(e=="right-end"||e=="bottom-end")&&(t="4px, 4px"),(e=="right-start"||e=="top-end")&&(t="4px, -4px"),(e=="left-end"||e=="bottom-start")&&(t="-4px, 4px"),(e=="left-start"||e=="top-start")&&(t="-4px, -4px"),`translate3d(${t}, 0)`}},Q=i.css`
|
|
2
|
+
visibility: visible;
|
|
3
|
+
opacity: 1;
|
|
4
|
+
transform: translate3d(0, 0, 0);
|
|
5
|
+
`,y=12,_=y*1.5,k=e=>e.includes("start")?_:e.includes("end")?`calc(100% - ${_+"px"})`:"50%",H=(e,n)=>{const o=n-_<y;return e.includes("end")?o?`${y}px`:`calc(100% - ${_}px)`:e.includes("start")?o?`${y}px`:`${_}px`:"50%"},U=i.divBox(({fixed:e,placement:n,popoverHeight:o,withArrow:t})=>i.css`
|
|
6
|
+
${i.th("tooltips")};
|
|
7
|
+
${i.system};
|
|
8
|
+
transition:
|
|
9
|
+
opacity ${i.th.transition("medium")},
|
|
10
|
+
transform ${i.th.transition("medium")},
|
|
11
|
+
visibility ${i.th.transition("medium")};
|
|
12
|
+
visibility: hidden;
|
|
13
|
+
opacity: 0;
|
|
14
|
+
transform-origin: top center;
|
|
15
|
+
z-index: 10;
|
|
16
|
+
|
|
17
|
+
${e&&t&&i.css`
|
|
18
|
+
&::after {
|
|
19
|
+
content: '';
|
|
20
|
+
position: absolute;
|
|
21
|
+
background-color: inherit;
|
|
22
|
+
width: ${y};
|
|
23
|
+
height: ${y};
|
|
24
|
+
border-width: inherit;
|
|
25
|
+
border-style: solid;
|
|
26
|
+
border-color: transparent neutral-60 neutral-60 transparent;
|
|
27
|
+
border-bottom-right-radius: inherit;
|
|
28
|
+
clip-path: polygon(0% 100%, 0% 100%, 100% 100%, 100% 0%);
|
|
29
|
+
z-index: 0;
|
|
30
|
+
translate: -50% -50%;
|
|
31
|
+
|
|
32
|
+
${n.includes("top")&&i.css`
|
|
33
|
+
top: 100%;
|
|
34
|
+
left: ${k(n)};
|
|
35
|
+
rotate: 45deg;
|
|
36
|
+
`}
|
|
37
|
+
|
|
38
|
+
${n.includes("bottom")&&i.css`
|
|
39
|
+
bottom: 100%;
|
|
40
|
+
left: ${k(n)};
|
|
41
|
+
translate: -50% 50%;
|
|
42
|
+
rotate: 225deg;
|
|
43
|
+
`}
|
|
44
|
+
|
|
45
|
+
${n.includes("left")&&i.css`
|
|
46
|
+
top: ${H(n,o)};
|
|
47
|
+
left: 100%;
|
|
48
|
+
rotate: -45deg;
|
|
49
|
+
`}
|
|
50
|
+
|
|
51
|
+
${n.includes("right")&&i.css`
|
|
52
|
+
top: ${H(n,o)};
|
|
53
|
+
left: 0%;
|
|
54
|
+
rotate: 135deg;
|
|
55
|
+
`}
|
|
56
|
+
}
|
|
57
|
+
`}
|
|
58
|
+
|
|
59
|
+
${e&&i.css`
|
|
60
|
+
transform: ${X(n)};
|
|
61
|
+
`}
|
|
62
|
+
|
|
63
|
+
[data-enter] & {
|
|
64
|
+
${Q}
|
|
65
|
+
}
|
|
66
|
+
`),Z=i.div`
|
|
67
|
+
display: inline-block;
|
|
68
|
+
`,ee=I.forwardRef(({children:e,content:n,fixed:o=!1,placement:t=o?"top":"bottom",gutter:m=8,withArrow:a,...x},v)=>{var V;const f=j({placement:t,animated:300}),[c,b]=l.useState({x:0,y:0}),{render:g,stopAnimation:u}=f,{anchorElement:d,currentPlacement:$,mounted:P,popoverElement:s}=f.useState(),p=()=>{s&&Object.assign(s.style,{display:P?"block":"none",position:"absolute",left:`${c.x}px`,top:`${c.y+window.scrollY+20}px`})},E=(V=e==null?void 0:e.props)!=null&&V.disabled?l.Children.only(l.createElement(Z,null,e)):e;return l.useEffect(()=>{function w({clientX:B,clientY:A}){b({x:B,y:A}),g()}if(d&&!o)return d.addEventListener("mousemove",w),()=>{d.removeEventListener("mousemove",w)}},[g,o,d]),n?l.createElement(l.Fragment,null,l.createElement(K,{render:E,store:f}),l.createElement(z,{fixed:o,gutter:m,ref:v,render:l.createElement(F.Box,{...x}),store:f,updatePosition:o?void 0:p},l.createElement(U,{fixed:o,onTransitionEnd:u,placement:$,popoverHeight:s==null?void 0:s.getBoundingClientRect().height,withArrow:a},n))):e});exports.Tooltip=ee;
|