rsuite 6.0.0-canary-2025032014 → 6.0.0-canary-20250416
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/AutoComplete/styles/index.css +112 -62
- package/AutoComplete/styles/index.less +1 -1
- package/Box/styles/index.css +12 -0
- package/CHANGELOG.md +24 -0
- package/Calendar/styles/index.css +11 -9
- package/Calendar/styles/index.less +3 -1
- package/Cascader/styles/index.css +112 -62
- package/CheckPicker/styles/index.css +112 -62
- package/CheckPicker/styles/index.less +1 -1
- package/CheckTree/styles/index.css +113 -63
- package/CheckTree/styles/index.less +1 -1
- package/CheckTreePicker/styles/index.css +113 -63
- package/DateInput/styles/index.css +0 -7
- package/DatePicker/styles/index.css +122 -74
- package/DatePicker/styles/index.less +5 -11
- package/DateRangeInput/styles/index.css +0 -7
- package/DateRangePicker/styles/index.css +132 -78
- package/DateRangePicker/styles/index.less +10 -4
- package/Divider/styles/index.css +2 -2
- package/Divider/styles/index.less +2 -2
- package/Grid/styles/columns.less +1 -2
- package/Grid/styles/grid-framework.less +1 -0
- package/Grid/styles/index.css +9 -4
- package/Grid/styles/row.less +2 -2
- package/Input/styles/index.css +0 -7
- package/Input/styles/index.less +0 -6
- package/Input/styles/mixin.less +0 -4
- package/InputGroup/styles/index.css +1 -1
- package/InputGroup/styles/index.less +1 -1
- package/InputNumber/styles/index.css +1 -8
- package/InputPicker/styles/index.css +121 -70
- package/InputPicker/styles/index.less +4 -4
- package/Link/package.json +7 -0
- package/Link/styles/index.css +32 -0
- package/Link/styles/index.less +39 -0
- package/Message/styles/index.css +9 -0
- package/Message/styles/index.less +11 -0
- package/MultiCascadeTree/styles/index.css +112 -62
- package/MultiCascader/styles/index.css +112 -62
- package/Nav/styles/index.css +1 -0
- package/Nav/styles/index.less +1 -0
- package/Pagination/styles/index.css +114 -64
- package/PasswordInput/package.json +7 -0
- package/PasswordInput/styles/index.css +172 -0
- package/PasswordInput/styles/index.less +1 -0
- package/PasswordStrengthMeter/package.json +7 -0
- package/PasswordStrengthMeter/styles/index.css +33 -0
- package/PasswordStrengthMeter/styles/index.less +39 -0
- package/README.md +3 -3
- package/RadioGroup/styles/index.css +1 -0
- package/RadioGroup/styles/index.less +1 -0
- package/RangeSlider/styles/index.css +76 -43
- package/Rate/styles/index.css +48 -34
- package/Rate/styles/index.less +32 -21
- package/SelectPicker/styles/index.css +112 -62
- package/SelectPicker/styles/index.less +1 -1
- package/Slider/styles/index.css +76 -43
- package/Slider/styles/index.less +95 -48
- package/Tabs/styles/index.css +1 -0
- package/TagInput/styles/index.css +152 -91
- package/TagInput/styles/index.less +1 -1
- package/TagPicker/styles/index.css +151 -90
- package/TagPicker/styles/index.less +52 -41
- package/Textarea/package.json +7 -0
- package/Textarea/styles/index.css +6 -0
- package/Textarea/styles/index.less +7 -0
- package/TimePicker/styles/index.css +122 -74
- package/TimeRangePicker/styles/index.css +132 -78
- package/Toggle/styles/index.css +146 -87
- package/Toggle/styles/index.less +66 -38
- package/Tree/styles/index.css +113 -63
- package/Tree/styles/index.less +1 -1
- package/TreePicker/styles/index.css +113 -63
- package/cjs/AutoComplete/AutoComplete.d.ts +1 -1
- package/cjs/AutoComplete/AutoComplete.js +13 -11
- package/cjs/Avatar/Avatar.d.ts +3 -4
- package/cjs/Breadcrumb/Breadcrumb.js +2 -2
- package/cjs/Breadcrumb/BreadcrumbItem.js +1 -1
- package/cjs/Button/Button.js +9 -10
- package/cjs/Calendar/CalendarProvider.js +0 -0
- package/cjs/Calendar/hooks/useCalendar.js +0 -0
- package/cjs/Carousel/Carousel.js +2 -2
- package/cjs/Cascader/Cascader.js +42 -45
- package/cjs/Cascader/useActive.d.ts +6 -4
- package/cjs/Cascader/useActive.js +10 -8
- package/cjs/CheckPicker/CheckPicker.js +38 -41
- package/cjs/CheckTreePicker/CheckTreePicker.js +20 -22
- package/cjs/CustomProvider/CustomProvider.d.ts +1 -4
- package/cjs/CustomProvider/types.d.ts +10 -2
- package/cjs/DatePicker/DatePicker.d.ts +1 -1
- package/cjs/DatePicker/DatePicker.js +28 -25
- package/cjs/DatePicker/utils.d.ts +3 -3
- package/cjs/DatePicker/utils.js +3 -3
- package/cjs/DateRangePicker/DateRangePicker.js +39 -33
- package/cjs/DateRangePicker/utils.js +0 -0
- package/cjs/Divider/Divider.d.ts +3 -2
- package/cjs/Divider/Divider.js +2 -2
- package/cjs/Form/hooks/useFormValidate.js +0 -0
- package/cjs/Form/hooks/useSchemaModel.js +2 -54
- package/cjs/Form/utils/constructFlatSchema.d.ts +4 -0
- package/cjs/Form/utils/constructFlatSchema.js +41 -0
- package/cjs/FormControl/hooks/useField.js +0 -0
- package/cjs/FormControl/utils.js +0 -0
- package/cjs/Grid/Row.d.ts +2 -2
- package/cjs/Grid/Row.js +2 -20
- package/cjs/Grid/types.d.ts +1 -0
- package/cjs/Grid/utils/styles.d.ts +6 -0
- package/cjs/Grid/utils/styles.js +43 -0
- package/cjs/Image/Image.js +12 -11
- package/cjs/Image/hooks/useImage.d.ts +2 -0
- package/cjs/Image/hooks/useImage.js +19 -43
- package/cjs/InlineEdit/InlineEdit.js +3 -1
- package/cjs/InlineEdit/useEditState.d.ts +2 -0
- package/cjs/InlineEdit/useEditState.js +8 -0
- package/cjs/Input/Input.d.ts +3 -12
- package/cjs/Input/Input.js +12 -73
- package/cjs/InputPicker/InputPicker.js +27 -28
- package/cjs/Link/ExternalLinkIcon.d.ts +3 -0
- package/cjs/Link/ExternalLinkIcon.js +23 -0
- package/cjs/Link/Link.d.ts +14 -0
- package/cjs/Link/Link.js +52 -0
- package/cjs/Link/index.d.ts +4 -0
- package/cjs/Link/index.js +11 -0
- package/cjs/List/List.js +6 -2
- package/cjs/List/helper/useSortHelper.d.ts +7 -5
- package/cjs/List/helper/useSortHelper.js +109 -16
- package/cjs/List/helper/utils.js +14 -6
- package/cjs/MultiCascader/MultiCascader.js +40 -43
- package/cjs/Nav/NavItem.js +1 -1
- package/cjs/Nav/NavMegaMenu.d.ts +5 -0
- package/cjs/Nav/NavMegaMenu.js +5 -0
- package/cjs/Navbar/NavbarItem.js +1 -1
- package/cjs/Navbar/NavbarMegaMenu.js +1 -1
- package/cjs/PasswordInput/PasswordInput.d.ts +14 -0
- package/cjs/PasswordInput/PasswordInput.js +71 -0
- package/cjs/PasswordInput/index.d.ts +4 -0
- package/cjs/PasswordInput/index.js +11 -0
- package/cjs/PasswordStrengthMeter/PasswordStrengthMeter.d.ts +12 -0
- package/cjs/PasswordStrengthMeter/PasswordStrengthMeter.js +50 -0
- package/cjs/PasswordStrengthMeter/index.d.ts +4 -0
- package/cjs/PasswordStrengthMeter/index.js +11 -0
- package/cjs/RangeSlider/RangeSlider.js +18 -3
- package/cjs/Rate/Character.d.ts +4 -3
- package/cjs/Rate/Character.js +19 -15
- package/cjs/Rate/Rate.d.ts +10 -2
- package/cjs/Rate/Rate.js +47 -42
- package/cjs/Rate/types.d.ts +8 -0
- package/cjs/Rate/types.js +4 -0
- package/cjs/Rate/useRatingStates.d.ts +20 -0
- package/cjs/Rate/useRatingStates.js +48 -0
- package/cjs/Rate/utils.d.ts +14 -3
- package/cjs/Rate/utils.js +50 -9
- package/cjs/SelectPicker/SelectPicker.js +45 -46
- package/cjs/Sidenav/ExpandedSidenavDropdownItem.js +1 -1
- package/cjs/Sidenav/SidenavItem.js +1 -1
- package/cjs/Slider/Graduated.d.ts +4 -0
- package/cjs/Slider/Graduated.js +43 -20
- package/cjs/Slider/Handle.d.ts +1 -1
- package/cjs/Slider/Handle.js +12 -12
- package/cjs/Slider/Slider.d.ts +16 -1
- package/cjs/Slider/Slider.js +7 -2
- package/cjs/Slider/useDrag.d.ts +1 -0
- package/cjs/Slider/useDrag.js +8 -3
- package/cjs/Steps/Steps.js +2 -2
- package/cjs/Tabs/Tabs.js +2 -2
- package/cjs/Textarea/Textarea.d.ts +32 -0
- package/cjs/Textarea/Textarea.js +51 -0
- package/cjs/Textarea/index.d.ts +4 -0
- package/cjs/Textarea/index.js +11 -0
- package/cjs/Timeline/Timeline.js +2 -2
- package/cjs/Toggle/Toggle.d.ts +10 -1
- package/cjs/Toggle/Toggle.js +12 -9
- package/cjs/TreePicker/TreePicker.js +18 -19
- package/cjs/index.d.ts +4 -1
- package/cjs/index.js +24 -6
- package/cjs/internals/Box/Box.d.ts +4 -0
- package/cjs/internals/Box/Box.js +1 -1
- package/cjs/internals/Box/utils.js +5 -1
- package/cjs/internals/InputBase/InputBase.d.ts +45 -0
- package/cjs/internals/InputBase/InputBase.js +96 -0
- package/cjs/internals/InputBase/index.d.ts +3 -0
- package/cjs/internals/InputBase/index.js +8 -0
- package/cjs/internals/Overlay/Modal.d.ts +1 -1
- package/cjs/internals/Overlay/OverlayTrigger.d.ts +4 -3
- package/cjs/internals/Overlay/OverlayTrigger.js +8 -3
- package/cjs/internals/Picker/Listbox.js +7 -9
- package/cjs/internals/Picker/PickerDrawer.d.ts +8 -0
- package/cjs/internals/Picker/PickerDrawer.js +31 -0
- package/cjs/internals/Picker/PickerPopup.js +5 -3
- package/cjs/internals/Picker/PickerToggle.d.ts +1 -0
- package/cjs/internals/Picker/PickerToggle.js +10 -3
- package/cjs/internals/Picker/PickerToggleTrigger.d.ts +51 -11
- package/cjs/internals/Picker/PickerToggleTrigger.js +59 -13
- package/cjs/internals/Picker/hooks/index.d.ts +0 -1
- package/cjs/internals/Picker/hooks/index.js +2 -4
- package/cjs/internals/Picker/hooks/useCombobox.d.ts +1 -0
- package/cjs/internals/Picker/hooks/useCombobox.js +3 -1
- package/cjs/internals/Picker/index.d.ts +1 -2
- package/cjs/internals/Picker/index.js +10 -12
- package/{esm → cjs/internals}/SafeAnchor/SafeAnchor.d.ts +2 -2
- package/cjs/{SafeAnchor → internals/SafeAnchor}/SafeAnchor.js +3 -3
- package/cjs/internals/Tree/TreeView.js +3 -4
- package/cjs/internals/hooks/useRootClose.js +4 -4
- package/cjs/internals/index.d.ts +4 -0
- package/cjs/internals/index.js +13 -1
- package/cjs/internals/types/html.d.ts +2 -0
- package/cjs/internals/utils/{dom.d.ts → html/dom.d.ts} +1 -0
- package/cjs/internals/utils/{dom.js → html/dom.js} +8 -0
- package/cjs/internals/utils/{events.js → html/events.js} +0 -0
- package/cjs/internals/utils/{htmlPropsUtils.js → html/htmlPropsUtils.js} +0 -0
- package/cjs/internals/utils/html/index.d.ts +4 -0
- package/cjs/internals/utils/html/index.js +28 -0
- package/cjs/internals/utils/{safeSetSelection.js → html/safeSetSelection.js} +1 -1
- package/cjs/internals/utils/index.d.ts +3 -15
- package/cjs/internals/utils/index.js +20 -49
- package/cjs/internals/utils/{ReactChildren.d.ts → react/ReactChildren.d.ts} +2 -8
- package/cjs/internals/utils/{ReactChildren.js → react/ReactChildren.js} +5 -25
- package/cjs/internals/utils/react/ReactIs.d.ts +7 -0
- package/cjs/internals/utils/react/ReactIs.js +26 -0
- package/{esm/internals/utils → cjs/internals/utils/react}/createComponent.d.ts +2 -2
- package/cjs/internals/utils/{createComponent.js → react/createComponent.js} +3 -3
- package/cjs/internals/utils/{deprecateComponent.js → react/deprecateComponent.js} +1 -1
- package/cjs/internals/utils/{forwardRef.d.ts → react/forwardRef.d.ts} +1 -1
- package/cjs/internals/utils/react/index.d.ts +7 -0
- package/cjs/internals/utils/react/index.js +46 -0
- package/cjs/internals/utils/{mergeRefs.js → react/mergeRefs.js} +0 -0
- package/cjs/internals/utils/{getStringLength.d.ts → string/getStringLength.d.ts} +0 -1
- package/cjs/internals/utils/{getStringLength.js → string/getStringLength.js} +1 -3
- package/cjs/internals/utils/string/index.d.ts +4 -0
- package/cjs/internals/utils/string/index.js +28 -0
- package/cjs/internals/utils/{stringifyReactNode.js → string/stringifyReactNode.js} +0 -0
- package/cjs/internals/utils/{tplTransform.js → string/tplTransform.js} +0 -0
- package/cjs/locales/en_GB.js +2 -2
- package/cjs/locales/en_US.js +2 -2
- package/cjs/locales/index.js +0 -0
- package/cjs/locales/pl_PL.js +2 -3
- package/cjs/useBreakpointValue/useBreakpointValue.d.ts +6 -2
- package/cjs/useBreakpointValue/useBreakpointValue.js +9 -4
- package/cjs/useMediaQuery/breakpoints.d.ts +24 -0
- package/cjs/useMediaQuery/breakpoints.js +248 -0
- package/cjs/useMediaQuery/index.d.ts +1 -1
- package/cjs/useMediaQuery/types.d.ts +45 -0
- package/cjs/useMediaQuery/types.js +4 -0
- package/cjs/useMediaQuery/useMediaQuery.d.ts +4 -13
- package/cjs/useMediaQuery/useMediaQuery.js +30 -12
- package/cjs/useToaster/useToaster.d.ts +1 -1
- package/cjs/useToaster/useToaster.js +1 -1
- package/dist/rsuite-no-reset-rtl.css +565 -276
- package/dist/rsuite-no-reset-rtl.min.css +1 -1
- package/dist/rsuite-no-reset-rtl.min.css.map +1 -1
- package/dist/rsuite-no-reset.css +565 -276
- package/dist/rsuite-no-reset.min.css +1 -1
- package/dist/rsuite-no-reset.min.css.map +1 -1
- package/dist/rsuite-rtl.css +565 -276
- package/dist/rsuite-rtl.min.css +1 -1
- package/dist/rsuite-rtl.min.css.map +1 -1
- package/dist/rsuite.css +565 -276
- package/dist/rsuite.js +508 -211
- package/dist/rsuite.js.map +1 -1
- package/dist/rsuite.min.css +1 -1
- package/dist/rsuite.min.css.map +1 -1
- package/dist/rsuite.min.js +1 -1
- package/dist/rsuite.min.js.map +1 -1
- package/esm/AutoComplete/AutoComplete.d.ts +1 -1
- package/esm/AutoComplete/AutoComplete.js +13 -11
- package/esm/Avatar/Avatar.d.ts +3 -4
- package/esm/Breadcrumb/Breadcrumb.js +3 -3
- package/esm/Breadcrumb/BreadcrumbItem.js +1 -1
- package/esm/Button/Button.js +10 -11
- package/esm/Calendar/CalendarProvider.js +0 -0
- package/esm/Calendar/hooks/useCalendar.js +0 -0
- package/esm/Carousel/Carousel.js +3 -3
- package/esm/Cascader/Cascader.js +43 -46
- package/esm/Cascader/useActive.d.ts +6 -4
- package/esm/Cascader/useActive.js +10 -8
- package/esm/CheckPicker/CheckPicker.js +39 -42
- package/esm/CheckTreePicker/CheckTreePicker.js +21 -23
- package/esm/CustomProvider/CustomProvider.d.ts +1 -4
- package/esm/CustomProvider/types.d.ts +10 -2
- package/esm/DatePicker/DatePicker.d.ts +1 -1
- package/esm/DatePicker/DatePicker.js +29 -26
- package/esm/DatePicker/utils.d.ts +3 -3
- package/esm/DatePicker/utils.js +4 -4
- package/esm/DateRangePicker/DateRangePicker.js +35 -29
- package/esm/DateRangePicker/utils.js +0 -0
- package/esm/Divider/Divider.d.ts +3 -2
- package/esm/Divider/Divider.js +2 -2
- package/esm/Form/hooks/useFormValidate.js +0 -0
- package/esm/Form/hooks/useSchemaModel.js +3 -55
- package/esm/Form/utils/constructFlatSchema.d.ts +4 -0
- package/esm/Form/utils/constructFlatSchema.js +37 -0
- package/esm/FormControl/hooks/useField.js +0 -0
- package/esm/FormControl/utils.js +0 -0
- package/esm/Grid/Row.d.ts +2 -2
- package/esm/Grid/Row.js +2 -20
- package/esm/Grid/types.d.ts +1 -0
- package/esm/Grid/utils/styles.d.ts +6 -0
- package/esm/Grid/utils/styles.js +37 -0
- package/esm/Image/Image.js +12 -11
- package/esm/Image/hooks/useImage.d.ts +2 -0
- package/esm/Image/hooks/useImage.js +20 -43
- package/esm/InlineEdit/InlineEdit.js +3 -1
- package/esm/InlineEdit/useEditState.d.ts +2 -0
- package/esm/InlineEdit/useEditState.js +8 -0
- package/esm/Input/Input.d.ts +3 -12
- package/esm/Input/Input.js +12 -74
- package/esm/InputPicker/InputPicker.js +28 -29
- package/esm/Link/ExternalLinkIcon.d.ts +3 -0
- package/esm/Link/ExternalLinkIcon.js +18 -0
- package/esm/Link/Link.d.ts +14 -0
- package/esm/Link/Link.js +47 -0
- package/esm/Link/index.d.ts +4 -0
- package/esm/Link/index.js +8 -0
- package/esm/List/List.js +6 -2
- package/esm/List/helper/useSortHelper.d.ts +7 -5
- package/esm/List/helper/useSortHelper.js +109 -16
- package/esm/List/helper/utils.js +14 -6
- package/esm/MultiCascader/MultiCascader.js +41 -44
- package/esm/Nav/NavItem.js +1 -1
- package/esm/Nav/NavMegaMenu.d.ts +5 -0
- package/esm/Nav/NavMegaMenu.js +5 -0
- package/esm/Navbar/NavbarItem.js +1 -1
- package/esm/Navbar/NavbarMegaMenu.js +1 -1
- package/esm/PasswordInput/PasswordInput.d.ts +14 -0
- package/esm/PasswordInput/PasswordInput.js +66 -0
- package/esm/PasswordInput/index.d.ts +4 -0
- package/esm/PasswordInput/index.js +8 -0
- package/esm/PasswordStrengthMeter/PasswordStrengthMeter.d.ts +12 -0
- package/esm/PasswordStrengthMeter/PasswordStrengthMeter.js +45 -0
- package/esm/PasswordStrengthMeter/index.d.ts +4 -0
- package/esm/PasswordStrengthMeter/index.js +8 -0
- package/esm/RangeSlider/RangeSlider.js +18 -3
- package/esm/Rate/Character.d.ts +4 -3
- package/esm/Rate/Character.js +20 -16
- package/esm/Rate/Rate.d.ts +10 -2
- package/esm/Rate/Rate.js +49 -42
- package/esm/Rate/types.d.ts +8 -0
- package/esm/Rate/types.js +2 -0
- package/esm/Rate/useRatingStates.d.ts +20 -0
- package/esm/Rate/useRatingStates.js +43 -0
- package/esm/Rate/utils.d.ts +14 -3
- package/esm/Rate/utils.js +46 -7
- package/esm/SelectPicker/SelectPicker.js +46 -47
- package/esm/Sidenav/ExpandedSidenavDropdownItem.js +1 -1
- package/esm/Sidenav/SidenavItem.js +1 -1
- package/esm/Slider/Graduated.d.ts +4 -0
- package/esm/Slider/Graduated.js +43 -20
- package/esm/Slider/Handle.d.ts +1 -1
- package/esm/Slider/Handle.js +12 -12
- package/esm/Slider/Slider.d.ts +16 -1
- package/esm/Slider/Slider.js +7 -2
- package/esm/Slider/useDrag.d.ts +1 -0
- package/esm/Slider/useDrag.js +8 -3
- package/esm/Steps/Steps.js +3 -3
- package/esm/Tabs/Tabs.js +3 -3
- package/esm/Textarea/Textarea.d.ts +32 -0
- package/esm/Textarea/Textarea.js +46 -0
- package/esm/Textarea/index.d.ts +4 -0
- package/esm/Textarea/index.js +8 -0
- package/esm/Timeline/Timeline.js +3 -3
- package/esm/Toggle/Toggle.d.ts +10 -1
- package/esm/Toggle/Toggle.js +12 -9
- package/esm/TreePicker/TreePicker.js +19 -20
- package/esm/index.d.ts +4 -1
- package/esm/index.js +4 -1
- package/esm/internals/Box/Box.d.ts +4 -0
- package/esm/internals/Box/Box.js +1 -1
- package/esm/internals/Box/utils.js +5 -1
- package/esm/internals/InputBase/InputBase.d.ts +45 -0
- package/esm/internals/InputBase/InputBase.js +89 -0
- package/esm/internals/InputBase/index.d.ts +3 -0
- package/esm/internals/InputBase/index.js +3 -0
- package/esm/internals/Overlay/Modal.d.ts +1 -1
- package/esm/internals/Overlay/OverlayTrigger.d.ts +4 -3
- package/esm/internals/Overlay/OverlayTrigger.js +8 -2
- package/esm/internals/Picker/Listbox.js +8 -10
- package/esm/internals/Picker/PickerDrawer.d.ts +8 -0
- package/esm/internals/Picker/PickerDrawer.js +26 -0
- package/esm/internals/Picker/PickerPopup.js +5 -3
- package/esm/internals/Picker/PickerToggle.d.ts +1 -0
- package/esm/internals/Picker/PickerToggle.js +10 -3
- package/esm/internals/Picker/PickerToggleTrigger.d.ts +51 -11
- package/esm/internals/Picker/PickerToggleTrigger.js +59 -12
- package/esm/internals/Picker/hooks/index.d.ts +0 -1
- package/esm/internals/Picker/hooks/index.js +1 -2
- package/esm/internals/Picker/hooks/useCombobox.d.ts +1 -0
- package/esm/internals/Picker/hooks/useCombobox.js +3 -1
- package/esm/internals/Picker/index.d.ts +1 -2
- package/esm/internals/Picker/index.js +1 -2
- package/{cjs → esm/internals}/SafeAnchor/SafeAnchor.d.ts +2 -2
- package/esm/{SafeAnchor → internals/SafeAnchor}/SafeAnchor.js +3 -3
- package/esm/internals/Tree/TreeView.js +4 -5
- package/esm/internals/hooks/useRootClose.js +1 -1
- package/esm/internals/index.d.ts +4 -0
- package/esm/internals/index.js +5 -0
- package/esm/internals/types/html.d.ts +2 -0
- package/esm/internals/utils/{dom.d.ts → html/dom.d.ts} +1 -0
- package/esm/internals/utils/{dom.js → html/dom.js} +7 -0
- package/esm/internals/utils/{events.js → html/events.js} +0 -0
- package/esm/internals/utils/{htmlPropsUtils.js → html/htmlPropsUtils.js} +0 -0
- package/esm/internals/utils/html/index.d.ts +4 -0
- package/esm/internals/utils/html/index.js +5 -0
- package/esm/internals/utils/{safeSetSelection.js → html/safeSetSelection.js} +1 -1
- package/esm/internals/utils/index.d.ts +3 -15
- package/esm/internals/utils/index.js +3 -14
- package/esm/internals/utils/{ReactChildren.d.ts → react/ReactChildren.d.ts} +2 -8
- package/esm/internals/utils/{ReactChildren.js → react/ReactChildren.js} +3 -21
- package/esm/internals/utils/react/ReactIs.d.ts +7 -0
- package/esm/internals/utils/react/ReactIs.js +22 -0
- package/{cjs/internals/utils → esm/internals/utils/react}/createComponent.d.ts +2 -2
- package/esm/internals/utils/{createComponent.js → react/createComponent.js} +3 -3
- package/esm/internals/utils/{deprecateComponent.js → react/deprecateComponent.js} +1 -1
- package/esm/internals/utils/{forwardRef.d.ts → react/forwardRef.d.ts} +1 -1
- package/esm/internals/utils/react/index.d.ts +7 -0
- package/esm/internals/utils/react/index.js +8 -0
- package/esm/internals/utils/{mergeRefs.js → react/mergeRefs.js} +0 -0
- package/esm/internals/utils/{getStringLength.d.ts → string/getStringLength.d.ts} +0 -1
- package/esm/internals/utils/{getStringLength.js → string/getStringLength.js} +1 -2
- package/esm/internals/utils/string/index.d.ts +4 -0
- package/esm/internals/utils/string/index.js +5 -0
- package/esm/internals/utils/{stringifyReactNode.js → string/stringifyReactNode.js} +0 -0
- package/esm/internals/utils/{tplTransform.js → string/tplTransform.js} +0 -0
- package/esm/locales/en_GB.js +2 -2
- package/esm/locales/en_US.js +2 -2
- package/esm/locales/index.js +0 -0
- package/esm/locales/pl_PL.js +1 -1
- package/esm/useBreakpointValue/useBreakpointValue.d.ts +6 -2
- package/esm/useBreakpointValue/useBreakpointValue.js +9 -4
- package/esm/useMediaQuery/breakpoints.d.ts +24 -0
- package/esm/useMediaQuery/breakpoints.js +244 -0
- package/esm/useMediaQuery/index.d.ts +1 -1
- package/esm/useMediaQuery/types.d.ts +45 -0
- package/esm/useMediaQuery/types.js +2 -0
- package/esm/useMediaQuery/useMediaQuery.d.ts +4 -13
- package/esm/useMediaQuery/useMediaQuery.js +29 -11
- package/esm/useToaster/useToaster.d.ts +1 -1
- package/esm/useToaster/useToaster.js +1 -1
- package/internals/Box/styles/index.less +4 -0
- package/internals/Picker/styles/index.less +105 -23
- package/internals/Picker/styles/mixin.less +6 -6
- package/package.json +3 -2
- package/styles/color-modes/dark.less +2 -2
- package/styles/color-modes/high-contrast.less +2 -2
- package/styles/color-modes/light.less +2 -2
- package/styles/index.less +3 -0
- package/styles/root.less +2 -0
- package/styles/variables.less +0 -24
- package/SafeAnchor/package.json +0 -7
- package/cjs/Form/hooks/useFormClassNames.d.ts +0 -5
- package/cjs/Form/hooks/useFormClassNames.js +0 -29
- package/cjs/internals/Picker/hooks/usePickerClassName.d.ts +0 -19
- package/cjs/internals/Picker/hooks/usePickerClassName.js +0 -45
- package/esm/Form/hooks/useFormClassNames.d.ts +0 -5
- package/esm/Form/hooks/useFormClassNames.js +0 -25
- package/esm/internals/Picker/hooks/usePickerClassName.d.ts +0 -19
- package/esm/internals/Picker/hooks/usePickerClassName.js +0 -40
- /package/cjs/{SafeAnchor → internals/SafeAnchor}/index.d.ts +0 -0
- /package/cjs/{SafeAnchor → internals/SafeAnchor}/index.js +0 -0
- /package/cjs/internals/utils/{events.d.ts → html/events.d.ts} +0 -0
- /package/cjs/internals/utils/{htmlPropsUtils.d.ts → html/htmlPropsUtils.d.ts} +0 -0
- /package/cjs/internals/utils/{safeSetSelection.d.ts → html/safeSetSelection.d.ts} +0 -0
- /package/cjs/internals/utils/{deprecateComponent.d.ts → react/deprecateComponent.d.ts} +0 -0
- /package/cjs/internals/utils/{forwardRef.js → react/forwardRef.js} +0 -0
- /package/cjs/internals/utils/{getDOMNode.d.ts → react/getDOMNode.d.ts} +0 -0
- /package/cjs/internals/utils/{getDOMNode.js → react/getDOMNode.js} +0 -0
- /package/cjs/internals/utils/{mergeRefs.d.ts → react/mergeRefs.d.ts} +0 -0
- /package/cjs/internals/utils/{getSafeRegExpString.d.ts → string/getSafeRegExpString.d.ts} +0 -0
- /package/cjs/internals/utils/{getSafeRegExpString.js → string/getSafeRegExpString.js} +0 -0
- /package/cjs/internals/utils/{stringifyReactNode.d.ts → string/stringifyReactNode.d.ts} +0 -0
- /package/cjs/internals/utils/{tplTransform.d.ts → string/tplTransform.d.ts} +0 -0
- /package/esm/{SafeAnchor → internals/SafeAnchor}/index.d.ts +0 -0
- /package/esm/{SafeAnchor → internals/SafeAnchor}/index.js +0 -0
- /package/esm/internals/utils/{events.d.ts → html/events.d.ts} +0 -0
- /package/esm/internals/utils/{htmlPropsUtils.d.ts → html/htmlPropsUtils.d.ts} +0 -0
- /package/esm/internals/utils/{safeSetSelection.d.ts → html/safeSetSelection.d.ts} +0 -0
- /package/esm/internals/utils/{deprecateComponent.d.ts → react/deprecateComponent.d.ts} +0 -0
- /package/esm/internals/utils/{forwardRef.js → react/forwardRef.js} +0 -0
- /package/esm/internals/utils/{getDOMNode.d.ts → react/getDOMNode.d.ts} +0 -0
- /package/esm/internals/utils/{getDOMNode.js → react/getDOMNode.js} +0 -0
- /package/esm/internals/utils/{mergeRefs.d.ts → react/mergeRefs.d.ts} +0 -0
- /package/esm/internals/utils/{getSafeRegExpString.d.ts → string/getSafeRegExpString.d.ts} +0 -0
- /package/esm/internals/utils/{getSafeRegExpString.js → string/getSafeRegExpString.js} +0 -0
- /package/esm/internals/utils/{stringifyReactNode.d.ts → string/stringifyReactNode.d.ts} +0 -0
- /package/esm/internals/utils/{tplTransform.d.ts → string/tplTransform.d.ts} +0 -0
package/esm/Grid/Row.js
CHANGED
|
@@ -4,26 +4,8 @@ import React from 'react';
|
|
|
4
4
|
import Box from "../internals/Box/index.js";
|
|
5
5
|
import { useStyles } from "../internals/hooks/index.js";
|
|
6
6
|
import { useCustom } from "../CustomProvider/index.js";
|
|
7
|
-
import { forwardRef, mergeStyles
|
|
8
|
-
import {
|
|
9
|
-
const getResponsiveGutterStyles = gutter => {
|
|
10
|
-
if (!gutter) {
|
|
11
|
-
return {};
|
|
12
|
-
}
|
|
13
|
-
if (typeof gutter !== 'object') {
|
|
14
|
-
return {
|
|
15
|
-
'--rs-grid-gutter': getCssValue(gutter)
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
return BREAKPOINTS.reduce((styles, breakpoint) => {
|
|
19
|
-
const breakpointValue = gutter[breakpoint];
|
|
20
|
-
if (!breakpointValue) return styles;
|
|
21
|
-
const newStyles = {
|
|
22
|
-
[`--rs-grid-gutter${breakpoint === 'xs' ? '' : `-${breakpoint}`}`]: getCssValue(breakpointValue)
|
|
23
|
-
};
|
|
24
|
-
return mergeStyles(styles, newStyles);
|
|
25
|
-
}, {});
|
|
26
|
-
};
|
|
7
|
+
import { forwardRef, mergeStyles } from "../internals/utils/index.js";
|
|
8
|
+
import { getResponsiveGutterStyles } from "./utils/styles.js";
|
|
27
9
|
/**
|
|
28
10
|
* The Row component is used to create a row container that can contain Col components.
|
|
29
11
|
* @see https://rsuitejs.com/components/grid
|
package/esm/Grid/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type RowAlignment = 'top' | 'middle' | 'bottom';
|
|
2
2
|
export type RowJustify = 'start' | 'end' | 'center' | 'space-around' | 'space-between';
|
|
3
|
+
export type GutterType = number | string | [number | string, number | string];
|
|
3
4
|
/** @deprecated Use new responsive props format instead */
|
|
4
5
|
export interface DeprecatedColProps {
|
|
5
6
|
/** @deprecated Use span={{ xs: number }} instead */
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ResponsiveValue } from '../../internals/types';
|
|
2
|
+
import type { GutterType } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Generates CSS variable styles for grid gutters, supporting both single values and arrays [horizontal, vertical]
|
|
5
|
+
*/
|
|
6
|
+
export declare const getResponsiveGutterStyles: (gutter?: GutterType | ResponsiveValue<GutterType>) => Record<string, string>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import isPlainObject from 'lodash/isPlainObject';
|
|
3
|
+
import { BREAKPOINTS } from "../../internals/constants/index.js";
|
|
4
|
+
import { mergeStyles, getCssValue } from "../../internals/utils/index.js";
|
|
5
|
+
/**
|
|
6
|
+
* Generates CSS variable styles for grid gutters, supporting both single values and arrays [horizontal, vertical]
|
|
7
|
+
*/
|
|
8
|
+
export const getResponsiveGutterStyles = gutter => {
|
|
9
|
+
if (typeof gutter === 'undefined') {
|
|
10
|
+
return {};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// Helper function to process gutter values and generate CSS variables
|
|
14
|
+
const processGutterValue = function (value, prefix) {
|
|
15
|
+
if (prefix === void 0) {
|
|
16
|
+
prefix = '';
|
|
17
|
+
}
|
|
18
|
+
const [h, v] = Array.isArray(value) ? value : [value, value];
|
|
19
|
+
return {
|
|
20
|
+
[`--rs-grid-gutter${prefix}`]: getCssValue(h),
|
|
21
|
+
[`--rs-grid-row-gutter${prefix}`]: getCssValue(v)
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// Handle responsive object
|
|
26
|
+
if (isPlainObject(gutter)) {
|
|
27
|
+
return BREAKPOINTS.reduce((styles, breakpoint) => {
|
|
28
|
+
const value = gutter[breakpoint];
|
|
29
|
+
if (!value) return styles;
|
|
30
|
+
const prefix = breakpoint === 'xs' ? '' : `-${breakpoint}`;
|
|
31
|
+
return mergeStyles(styles, processGutterValue(value, prefix));
|
|
32
|
+
}, {});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Handle non-responsive value
|
|
36
|
+
return processGutterValue(gutter);
|
|
37
|
+
};
|
package/esm/Image/Image.js
CHANGED
|
@@ -45,19 +45,14 @@ const Image = forwardRef((props, ref) => {
|
|
|
45
45
|
shaded,
|
|
46
46
|
zoomed
|
|
47
47
|
}));
|
|
48
|
-
const imgProps = {
|
|
49
|
-
crossOrigin,
|
|
50
|
-
srcSet,
|
|
51
|
-
sizes,
|
|
52
|
-
loading
|
|
53
|
-
};
|
|
54
48
|
const {
|
|
55
49
|
imgSrc,
|
|
56
|
-
isLoading
|
|
50
|
+
isLoading,
|
|
51
|
+
onLoad,
|
|
52
|
+
onError
|
|
57
53
|
} = useImage({
|
|
58
54
|
src,
|
|
59
|
-
fallbackSrc
|
|
60
|
-
...imgProps
|
|
55
|
+
fallbackSrc
|
|
61
56
|
});
|
|
62
57
|
const styles = {
|
|
63
58
|
...style,
|
|
@@ -71,8 +66,14 @@ const Image = forwardRef((props, ref) => {
|
|
|
71
66
|
className: classes,
|
|
72
67
|
style: styles,
|
|
73
68
|
width: width,
|
|
74
|
-
height: height
|
|
75
|
-
|
|
69
|
+
height: height,
|
|
70
|
+
loading: loading,
|
|
71
|
+
onLoad: onLoad,
|
|
72
|
+
onError: onError,
|
|
73
|
+
crossOrigin: crossOrigin,
|
|
74
|
+
srcSet: srcSet,
|
|
75
|
+
sizes: sizes
|
|
76
|
+
}, rest));
|
|
76
77
|
if (zoomed) {
|
|
77
78
|
return /*#__PURE__*/React.createElement(ImageWrapper, {
|
|
78
79
|
w: width,
|
|
@@ -1,59 +1,36 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { useState, useEffect
|
|
3
|
-
import useIsomorphicLayoutEffect from "../../internals/hooks/useIsomorphicLayoutEffect.js";
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
4
3
|
export const useImage = props => {
|
|
5
4
|
const {
|
|
6
5
|
src,
|
|
7
|
-
fallbackSrc
|
|
8
|
-
crossOrigin,
|
|
9
|
-
srcSet,
|
|
10
|
-
sizes,
|
|
11
|
-
loading
|
|
6
|
+
fallbackSrc
|
|
12
7
|
} = props;
|
|
13
8
|
const [imgSrc, setImgSrc] = useState(src || fallbackSrc || null);
|
|
14
9
|
const [isLoading, setIsLoading] = useState(!!src);
|
|
15
10
|
const [error, setError] = useState(false);
|
|
16
|
-
const imageRef = useRef(null);
|
|
17
11
|
useEffect(() => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (imageRef.current) {
|
|
22
|
-
imageRef.current.onload = null;
|
|
23
|
-
imageRef.current.onerror = null;
|
|
12
|
+
if (!src) {
|
|
13
|
+
setIsLoading(false);
|
|
14
|
+
return;
|
|
24
15
|
}
|
|
16
|
+
setImgSrc(src);
|
|
17
|
+
setIsLoading(true);
|
|
18
|
+
setError(false);
|
|
19
|
+
}, [src]);
|
|
20
|
+
const handleLoad = () => {
|
|
21
|
+
setIsLoading(false);
|
|
22
|
+
setError(false);
|
|
23
|
+
};
|
|
24
|
+
const handleError = () => {
|
|
25
|
+
setIsLoading(false);
|
|
26
|
+
setError(true);
|
|
27
|
+
setImgSrc(fallbackSrc || null);
|
|
25
28
|
};
|
|
26
|
-
const loadImage = useCallback(() => {
|
|
27
|
-
if (!src) return;
|
|
28
|
-
flush();
|
|
29
|
-
const image = new Image();
|
|
30
|
-
image.src = src;
|
|
31
|
-
if (crossOrigin) image.crossOrigin = crossOrigin;
|
|
32
|
-
if (srcSet) image.srcset = srcSet;
|
|
33
|
-
if (sizes) image.sizes = sizes;
|
|
34
|
-
if (loading) image.loading = loading;
|
|
35
|
-
image.onload = () => {
|
|
36
|
-
flush();
|
|
37
|
-
setImgSrc(src);
|
|
38
|
-
setIsLoading(false);
|
|
39
|
-
};
|
|
40
|
-
image.onerror = () => {
|
|
41
|
-
flush();
|
|
42
|
-
setError(true);
|
|
43
|
-
setImgSrc(fallbackSrc || null);
|
|
44
|
-
setIsLoading(false);
|
|
45
|
-
};
|
|
46
|
-
imageRef.current = image;
|
|
47
|
-
}, [crossOrigin, fallbackSrc, loading, sizes, src, srcSet]);
|
|
48
|
-
useIsomorphicLayoutEffect(() => {
|
|
49
|
-
loadImage();
|
|
50
|
-
return () => {
|
|
51
|
-
flush();
|
|
52
|
-
};
|
|
53
|
-
}, [loadImage]);
|
|
54
29
|
return {
|
|
55
30
|
imgSrc,
|
|
56
31
|
isLoading,
|
|
57
|
-
error
|
|
32
|
+
error,
|
|
33
|
+
onLoad: handleLoad,
|
|
34
|
+
onError: handleError
|
|
58
35
|
};
|
|
59
36
|
};
|
|
@@ -38,6 +38,7 @@ const InlineEdit = forwardRef((props, ref) => {
|
|
|
38
38
|
onChange,
|
|
39
39
|
onKeyDown,
|
|
40
40
|
onClick,
|
|
41
|
+
onFocus,
|
|
41
42
|
htmlProps
|
|
42
43
|
} = useEditState({
|
|
43
44
|
...rest,
|
|
@@ -70,7 +71,8 @@ const InlineEdit = forwardRef((props, ref) => {
|
|
|
70
71
|
disabled
|
|
71
72
|
})),
|
|
72
73
|
onClick: onClick,
|
|
73
|
-
onKeyDown: onKeyDown
|
|
74
|
+
onKeyDown: onKeyDown,
|
|
75
|
+
onFocus: onFocus
|
|
74
76
|
}, htmlProps), renderChildren(children, childrenProps, target), showControls && isEditing && /*#__PURE__*/React.createElement(EditableControls, {
|
|
75
77
|
className: prefix('controls'),
|
|
76
78
|
onSave: onSave,
|
|
@@ -8,12 +8,14 @@ interface EditStateProps {
|
|
|
8
8
|
onCancel?: (event?: React.MouseEvent) => void;
|
|
9
9
|
onSave?: (event?: React.MouseEvent) => void;
|
|
10
10
|
onClick?: (event: React.SyntheticEvent) => void;
|
|
11
|
+
onFocus?: (event?: React.FocusEvent) => void;
|
|
11
12
|
}
|
|
12
13
|
declare const useEditState: (props: EditStateProps) => {
|
|
13
14
|
isEditing: boolean;
|
|
14
15
|
value: any;
|
|
15
16
|
onClick: (...args: any[]) => any;
|
|
16
17
|
onChange: (...args: any[]) => any;
|
|
18
|
+
onFocus: (...args: any[]) => any;
|
|
17
19
|
onCancel: (...args: any[]) => any;
|
|
18
20
|
onSave: (...args: any[]) => any;
|
|
19
21
|
onKeyDown: (...args: any[]) => any;
|
|
@@ -11,6 +11,7 @@ const useEditState = props => {
|
|
|
11
11
|
onCancel,
|
|
12
12
|
onSave,
|
|
13
13
|
onClick,
|
|
14
|
+
onFocus,
|
|
14
15
|
...htmlProps
|
|
15
16
|
} = props;
|
|
16
17
|
const [isEditing, setIsEditing] = useState(false);
|
|
@@ -27,6 +28,12 @@ const useEditState = props => {
|
|
|
27
28
|
setIsEditing(true);
|
|
28
29
|
setResetValue(value);
|
|
29
30
|
});
|
|
31
|
+
const handleFocus = useEventCallback(event => {
|
|
32
|
+
if (disabled) return;
|
|
33
|
+
onFocus === null || onFocus === void 0 || onFocus(event);
|
|
34
|
+
setIsEditing(true);
|
|
35
|
+
setResetValue(value);
|
|
36
|
+
});
|
|
30
37
|
const handleChange = useEventCallback((value, event) => {
|
|
31
38
|
setValue(value);
|
|
32
39
|
onChange === null || onChange === void 0 || onChange(value, event);
|
|
@@ -64,6 +71,7 @@ const useEditState = props => {
|
|
|
64
71
|
value,
|
|
65
72
|
onClick: handleClick,
|
|
66
73
|
onChange: handleChange,
|
|
74
|
+
onFocus: handleFocus,
|
|
67
75
|
onCancel: handleCancel,
|
|
68
76
|
onSave: handleSave,
|
|
69
77
|
onKeyDown: handleKeyDown,
|
package/esm/Input/Input.d.ts
CHANGED
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { InputBaseCommonProps } from '../internals/InputBase';
|
|
3
3
|
import { PrependParameters } from '../internals/types/utils';
|
|
4
|
-
import type {
|
|
5
|
-
export interface
|
|
6
|
-
unfilled: string;
|
|
7
|
-
}
|
|
8
|
-
export interface InputProps extends BoxProps, SanitizedInputProps, PropsWithoutChange<FormControlBaseProps> {
|
|
4
|
+
import type { SanitizedInputProps, PropsWithoutChange, FormControlBaseProps } from '../internals/types';
|
|
5
|
+
export interface InputProps extends InputBaseCommonProps, SanitizedInputProps, PropsWithoutChange<FormControlBaseProps> {
|
|
9
6
|
/** The HTML input type */
|
|
10
7
|
type?: string;
|
|
11
|
-
/** The HTML input id */
|
|
12
|
-
id?: string;
|
|
13
|
-
/** A component can have different sizes */
|
|
14
|
-
size?: Size;
|
|
15
|
-
/** Ref of input element */
|
|
16
|
-
inputRef?: React.Ref<any>;
|
|
17
8
|
/**
|
|
18
9
|
* The htmlSize attribute defines the width of the <input> element.
|
|
19
10
|
*
|
package/esm/Input/Input.js
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import React, { useContext } from 'react';
|
|
4
|
-
import Plaintext from "../internals/Plaintext/index.js";
|
|
5
|
-
import Box from "../internals/Box/index.js";
|
|
6
4
|
import { forwardRef } from "../internals/utils/index.js";
|
|
7
|
-
import
|
|
5
|
+
import InputBase from "../internals/InputBase/index.js";
|
|
8
6
|
import { InputGroupContext } from "../InputGroup/InputGroup.js";
|
|
9
|
-
import { KEY_VALUES } from "../internals/constants/index.js";
|
|
10
|
-
import { useStyles } from "../internals/hooks/index.js";
|
|
11
|
-
import { createChainedFunction, mergeRefs } from "../internals/utils/index.js";
|
|
12
7
|
import { useCustom } from "../CustomProvider/index.js";
|
|
13
8
|
/**
|
|
14
9
|
* The `<Input>` component is used to get user input in a text field.
|
|
@@ -21,79 +16,22 @@ const Input = forwardRef((props, ref) => {
|
|
|
21
16
|
} = useCustom('Input', props);
|
|
22
17
|
const inputGroup = useContext(InputGroupContext);
|
|
23
18
|
const {
|
|
24
|
-
as = 'input',
|
|
25
|
-
className,
|
|
26
|
-
classPrefix = 'input',
|
|
27
19
|
type = 'text',
|
|
28
|
-
disabled,
|
|
29
|
-
value,
|
|
30
|
-
defaultValue,
|
|
31
|
-
inputRef,
|
|
32
|
-
id,
|
|
33
|
-
size = (inputGroup === null || inputGroup === void 0 ? void 0 : inputGroup.size) || 'md',
|
|
34
20
|
htmlSize,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
readOnly,
|
|
38
|
-
onPressEnter,
|
|
39
|
-
onFocus,
|
|
40
|
-
onBlur,
|
|
41
|
-
onKeyDown,
|
|
42
|
-
onChange,
|
|
21
|
+
size = (inputGroup === null || inputGroup === void 0 ? void 0 : inputGroup.size) || 'md',
|
|
22
|
+
classPrefix = 'input',
|
|
43
23
|
...rest
|
|
44
24
|
} = propsWithDefaults;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
};
|
|
51
|
-
const handleChange = event => {
|
|
52
|
-
var _event$target;
|
|
53
|
-
onChange === null || onChange === void 0 || onChange((_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.value, event);
|
|
54
|
-
};
|
|
55
|
-
const {
|
|
56
|
-
withPrefix,
|
|
57
|
-
merge
|
|
58
|
-
} = useStyles(classPrefix);
|
|
59
|
-
const classes = merge(className, withPrefix(size, {
|
|
60
|
-
plaintext
|
|
61
|
-
}));
|
|
62
|
-
const {
|
|
63
|
-
controlId
|
|
64
|
-
} = useFormGroup();
|
|
65
|
-
|
|
66
|
-
// Make the Input component display in plain text,
|
|
67
|
-
// and display default characters when there is no value.
|
|
68
|
-
if (plaintext) {
|
|
69
|
-
return /*#__PURE__*/React.createElement(Plaintext, {
|
|
70
|
-
ref: ref,
|
|
71
|
-
localeKey: "unfilled",
|
|
72
|
-
placeholder: placeholder
|
|
73
|
-
}, typeof value === 'undefined' ? defaultValue : value);
|
|
74
|
-
}
|
|
75
|
-
const inputable = !disabled && !readOnly;
|
|
76
|
-
const eventProps = {};
|
|
77
|
-
if (inputable) {
|
|
78
|
-
eventProps.onChange = handleChange;
|
|
79
|
-
eventProps.onKeyDown = handleKeyDown;
|
|
80
|
-
eventProps.onFocus = createChainedFunction(onFocus, inputGroup === null || inputGroup === void 0 ? void 0 : inputGroup.onFocus);
|
|
81
|
-
eventProps.onBlur = createChainedFunction(onBlur, inputGroup === null || inputGroup === void 0 ? void 0 : inputGroup.onBlur);
|
|
82
|
-
}
|
|
83
|
-
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
84
|
-
as: as
|
|
85
|
-
}, rest, eventProps, {
|
|
86
|
-
ref: mergeRefs(ref, inputRef),
|
|
87
|
-
className: classes,
|
|
25
|
+
return /*#__PURE__*/React.createElement(InputBase, _extends({
|
|
26
|
+
as: "input",
|
|
27
|
+
ref: ref,
|
|
28
|
+
classPrefix: classPrefix,
|
|
29
|
+
size: size,
|
|
88
30
|
type: type,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
readOnly: readOnly,
|
|
94
|
-
size: htmlSize,
|
|
95
|
-
placeholder: placeholder
|
|
96
|
-
}));
|
|
31
|
+
inputProps: {
|
|
32
|
+
size: htmlSize
|
|
33
|
+
}
|
|
34
|
+
}, rest));
|
|
97
35
|
});
|
|
98
36
|
Input.displayName = 'Input';
|
|
99
37
|
export default Input;
|
|
@@ -6,7 +6,6 @@ import isFunction from 'lodash/isFunction';
|
|
|
6
6
|
import remove from 'lodash/remove';
|
|
7
7
|
import clone from 'lodash/clone';
|
|
8
8
|
import isArray from 'lodash/isArray';
|
|
9
|
-
import omit from 'lodash/omit';
|
|
10
9
|
import pick from 'lodash/pick';
|
|
11
10
|
import Tag from "../Tag/index.js";
|
|
12
11
|
import TextBox from "./TextBox.js";
|
|
@@ -14,7 +13,6 @@ import Stack from "../Stack/index.js";
|
|
|
14
13
|
import useInput from "./hooks/useInput.js";
|
|
15
14
|
import useData from "./hooks/useData.js";
|
|
16
15
|
import Plaintext from "../internals/Plaintext/index.js";
|
|
17
|
-
import Box from "../internals/Box/index.js";
|
|
18
16
|
import { filterNodesOfTree } from "../internals/Tree/utils/index.js";
|
|
19
17
|
import { useStyles, useControlled, useEventCallback } from "../internals/hooks/index.js";
|
|
20
18
|
import { KEY_VALUES } from "../internals/constants/index.js";
|
|
@@ -22,7 +20,7 @@ import { useTagContext } from "./InputPickerContext.js";
|
|
|
22
20
|
import { convertSize } from "./utils.js";
|
|
23
21
|
import { useCustom } from "../CustomProvider/index.js";
|
|
24
22
|
import { forwardRef, shallowEqual, getDataGroupBy, createChainedFunction, tplTransform, mergeRefs, isOneOf, mergeStyles } from "../internals/utils/index.js";
|
|
25
|
-
import { Listbox, ListItem, ListCheckItem, PickerToggle, PickerPopup, PickerToggleTrigger, useFocusItemValue,
|
|
23
|
+
import { Listbox, ListItem, ListCheckItem, PickerToggle, PickerPopup, PickerToggleTrigger, useFocusItemValue, useSearch, usePickerRef, useToggleKeyDownEvent, triggerPropKeys } from "../internals/Picker/index.js";
|
|
26
24
|
import { getPositionStyle } from "../internals/Overlay/Position.js";
|
|
27
25
|
/**
|
|
28
26
|
* Single item selector with text box input.
|
|
@@ -36,8 +34,10 @@ const InputPicker = forwardRef((props, ref) => {
|
|
|
36
34
|
const {
|
|
37
35
|
as,
|
|
38
36
|
appearance = 'default',
|
|
37
|
+
block,
|
|
39
38
|
cleanable = true,
|
|
40
39
|
cacheData = [],
|
|
40
|
+
className,
|
|
41
41
|
classPrefix = 'picker',
|
|
42
42
|
caretAs,
|
|
43
43
|
data: controlledData = [],
|
|
@@ -564,19 +564,8 @@ const InputPicker = forwardRef((props, ref) => {
|
|
|
564
564
|
const hasSingleValue = !isNil(value) && isFunction(renderValue) && !isNil(itemNode);
|
|
565
565
|
const hasMultiValue = isArray(value) && value.length > 0 && isFunction(renderValue) && !isNil(tagElements);
|
|
566
566
|
const hasValue = multi ? !!(tagElements !== null && tagElements !== void 0 && tagElements.length) || hasMultiValue : isValid || hasSingleValue;
|
|
567
|
-
const
|
|
568
|
-
|
|
569
|
-
classPrefix,
|
|
570
|
-
appearance,
|
|
571
|
-
hasValue,
|
|
572
|
-
name: 'input',
|
|
573
|
-
cleanable
|
|
574
|
-
});
|
|
575
|
-
const classes = merge(pickerClasses, {
|
|
576
|
-
[prefix`tag`]: multi,
|
|
577
|
-
[prefix(`${multi ? 'tag' : 'input'}-${size}`)]: size,
|
|
578
|
-
[prefix`focused`]: open,
|
|
579
|
-
[prefix`disabled-options`]: disabledOptions
|
|
567
|
+
const classes = merge(className, {
|
|
568
|
+
[prefix`focused`]: open
|
|
580
569
|
});
|
|
581
570
|
const searching = !!searchKeyword && open;
|
|
582
571
|
const editable = searchable && !disabled && !loading;
|
|
@@ -595,26 +584,36 @@ const InputPicker = forwardRef((props, ref) => {
|
|
|
595
584
|
}, plaintextProps), itemNode || (tagElements !== null && tagElements !== void 0 && tagElements.length ? tagElements : null) || placeholder);
|
|
596
585
|
}
|
|
597
586
|
const placeholderNode = placeholder || (disabledOptions ? null : locale === null || locale === void 0 ? void 0 : locale.placeholder);
|
|
598
|
-
|
|
587
|
+
const triggerProps = {
|
|
588
|
+
...pick(props, triggerPropKeys),
|
|
589
|
+
onEnter: createChainedFunction(handleEnter, onEnter),
|
|
590
|
+
onEntered: onEntered,
|
|
591
|
+
onExit: createChainedFunction(handleExit, onExit),
|
|
592
|
+
onExited: createChainedFunction(handleExited, onExited)
|
|
593
|
+
};
|
|
594
|
+
return /*#__PURE__*/React.createElement(PickerToggleTrigger, _extends({
|
|
599
595
|
id: id,
|
|
600
596
|
multiple: multi,
|
|
601
|
-
|
|
597
|
+
name: multi ? 'tag' : 'input',
|
|
598
|
+
block: block,
|
|
599
|
+
disabled: disabled,
|
|
600
|
+
appearance: appearance,
|
|
601
|
+
as: as,
|
|
602
|
+
triggerProps: triggerProps,
|
|
602
603
|
ref: triggerRef,
|
|
603
604
|
trigger: "active",
|
|
604
|
-
onEnter: createChainedFunction(handleEnter, onEnter),
|
|
605
|
-
onEntered: onEntered,
|
|
606
|
-
onExit: createChainedFunction(handleExit, onExit),
|
|
607
|
-
onExited: createChainedFunction(handleExited, onExited),
|
|
608
605
|
speaker: renderPopup,
|
|
609
|
-
placement: placement
|
|
610
|
-
|
|
611
|
-
as: as,
|
|
612
|
-
className: classes,
|
|
606
|
+
placement: placement,
|
|
607
|
+
rootRef: root,
|
|
613
608
|
style: style,
|
|
609
|
+
size: size,
|
|
610
|
+
classPrefix: classPrefix,
|
|
611
|
+
className: classes,
|
|
612
|
+
responsive: searchable === false,
|
|
614
613
|
onClick: focus,
|
|
615
614
|
onKeyDown: onPickerKeyDown,
|
|
616
|
-
|
|
617
|
-
},
|
|
615
|
+
"data-disabled-options": disabledOptions
|
|
616
|
+
}, rest), /*#__PURE__*/React.createElement(PickerToggle, {
|
|
618
617
|
loading: loading,
|
|
619
618
|
label: label,
|
|
620
619
|
appearance: appearance,
|
|
@@ -647,7 +646,7 @@ const InputPicker = forwardRef((props, ref) => {
|
|
|
647
646
|
onBlur: onBlur,
|
|
648
647
|
onFocus: handleFocus,
|
|
649
648
|
onChange: handleSearch
|
|
650
|
-
}))
|
|
649
|
+
}));
|
|
651
650
|
});
|
|
652
651
|
InputPicker.displayName = 'InputPicker';
|
|
653
652
|
export default InputPicker;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
const ExternalLinkIcon = props => /*#__PURE__*/React.createElement("svg", _extends({
|
|
5
|
+
stroke: "currentColor",
|
|
6
|
+
fill: "currentColor",
|
|
7
|
+
strokeWidth: "0",
|
|
8
|
+
viewBox: "0 0 24 24",
|
|
9
|
+
height: "1em",
|
|
10
|
+
width: "1em",
|
|
11
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
12
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
13
|
+
fill: "none",
|
|
14
|
+
d: "M0 0h24v24H0V0z"
|
|
15
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
16
|
+
d: "M19 19H5V5h7V3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"
|
|
17
|
+
}));
|
|
18
|
+
export default ExternalLinkIcon;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SafeAnchorProps } from '../internals/SafeAnchor';
|
|
3
|
+
export interface LinkProps extends SafeAnchorProps {
|
|
4
|
+
/** The icon to be displayed after the link */
|
|
5
|
+
anchorIcon?: React.ReactNode;
|
|
6
|
+
/** Determines in which cases link should have text-decoration: underline styles, hover by default */
|
|
7
|
+
underline?: 'always' | 'hover' | 'not-hover' | 'never';
|
|
8
|
+
/** Whether the link is external */
|
|
9
|
+
external?: boolean;
|
|
10
|
+
/** Whether to show the anchor icon */
|
|
11
|
+
showAnchorIcon?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const Link: import("../internals/types").InternalRefForwardingComponent<"a", LinkProps, never> & Record<string, never>;
|
|
14
|
+
export default Link;
|
package/esm/Link/Link.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { forwardRef } from "../internals/utils/index.js";
|
|
5
|
+
import { useStyles } from "../internals/hooks/index.js";
|
|
6
|
+
import { useCustom } from "../CustomProvider/index.js";
|
|
7
|
+
import SafeAnchor from "../internals/SafeAnchor/index.js";
|
|
8
|
+
import ExternalLinkIcon from "./ExternalLinkIcon.js";
|
|
9
|
+
const Link = forwardRef((props, ref) => {
|
|
10
|
+
const {
|
|
11
|
+
propsWithDefaults
|
|
12
|
+
} = useCustom('Link', props);
|
|
13
|
+
const {
|
|
14
|
+
as,
|
|
15
|
+
anchorIcon,
|
|
16
|
+
classPrefix = 'link',
|
|
17
|
+
className,
|
|
18
|
+
children,
|
|
19
|
+
disabled,
|
|
20
|
+
underline,
|
|
21
|
+
showAnchorIcon,
|
|
22
|
+
external,
|
|
23
|
+
...rest
|
|
24
|
+
} = propsWithDefaults;
|
|
25
|
+
const {
|
|
26
|
+
merge,
|
|
27
|
+
prefix,
|
|
28
|
+
withPrefix
|
|
29
|
+
} = useStyles(classPrefix);
|
|
30
|
+
const classes = merge(className, withPrefix());
|
|
31
|
+
const icon = anchorIcon || /*#__PURE__*/React.createElement(ExternalLinkIcon, {
|
|
32
|
+
className: prefix('icon')
|
|
33
|
+
});
|
|
34
|
+
return /*#__PURE__*/React.createElement(SafeAnchor, _extends({
|
|
35
|
+
as: as,
|
|
36
|
+
ref: ref,
|
|
37
|
+
role: "link",
|
|
38
|
+
className: classes,
|
|
39
|
+
disabled: disabled,
|
|
40
|
+
target: external ? '_blank' : undefined,
|
|
41
|
+
rel: external ? 'noopener noreferrer' : undefined,
|
|
42
|
+
"data-underline": underline,
|
|
43
|
+
"data-disabled": disabled
|
|
44
|
+
}, rest), children, showAnchorIcon && icon);
|
|
45
|
+
});
|
|
46
|
+
Link.displayName = 'Link';
|
|
47
|
+
export default Link;
|
package/esm/List/List.js
CHANGED
|
@@ -48,7 +48,9 @@ const List = forwardRef((props, ref) => {
|
|
|
48
48
|
register,
|
|
49
49
|
sorting,
|
|
50
50
|
handleEnd,
|
|
51
|
-
handleStart
|
|
51
|
+
handleStart,
|
|
52
|
+
handleTouchStart,
|
|
53
|
+
handleTouchEnd
|
|
52
54
|
} = useSortHelper({
|
|
53
55
|
autoScroll,
|
|
54
56
|
onSort,
|
|
@@ -76,7 +78,9 @@ const List = forwardRef((props, ref) => {
|
|
|
76
78
|
ref: mergeRefs(containerRef, ref),
|
|
77
79
|
className: classes,
|
|
78
80
|
onMouseDown: sortable ? handleStart : undefined,
|
|
79
|
-
onMouseUp: sortable ? handleEnd : undefined
|
|
81
|
+
onMouseUp: sortable ? handleEnd : undefined,
|
|
82
|
+
onTouchStart: sortable ? handleTouchStart : undefined,
|
|
83
|
+
onTouchEnd: sortable ? handleTouchEnd : undefined
|
|
80
84
|
}, rest), /*#__PURE__*/React.createElement(ListContext.Provider, {
|
|
81
85
|
value: contextValue
|
|
82
86
|
}, children));
|