@os-design/core 1.0.156 → 1.0.158
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/cjs/Alert/index.js +4 -30
- package/dist/cjs/Alert/index.js.map +1 -1
- package/dist/cjs/Avatar/index.js +15 -39
- package/dist/cjs/Avatar/index.js.map +1 -1
- package/dist/cjs/Avatar/utils/nameToInitials.js +1 -3
- package/dist/cjs/Avatar/utils/nameToInitials.js.map +1 -1
- package/dist/cjs/Avatar/utils/strToHue.js +0 -4
- package/dist/cjs/Avatar/utils/strToHue.js.map +1 -1
- package/dist/cjs/AvatarSkeleton/index.js +3 -20
- package/dist/cjs/AvatarSkeleton/index.js.map +1 -1
- package/dist/cjs/Breadcrumb/index.js +4 -30
- package/dist/cjs/Breadcrumb/index.js.map +1 -1
- package/dist/cjs/BreadcrumbItem/index.js +8 -28
- package/dist/cjs/BreadcrumbItem/index.js.map +1 -1
- package/dist/cjs/Button/ButtonContent.js +7 -20
- package/dist/cjs/Button/ButtonContent.js.map +1 -1
- package/dist/cjs/Button/index.js +23 -53
- package/dist/cjs/Button/index.js.map +1 -1
- package/dist/cjs/Button/utils/useButtonColors.js +3 -12
- package/dist/cjs/Button/utils/useButtonColors.js.map +1 -1
- package/dist/cjs/Checkbox/index.js +20 -59
- package/dist/cjs/Checkbox/index.js.map +1 -1
- package/dist/cjs/CheckboxSkeleton/index.js +2 -22
- package/dist/cjs/CheckboxSkeleton/index.js.map +1 -1
- package/dist/cjs/DatePicker/DatePickerCalendar.js +11 -48
- package/dist/cjs/DatePicker/DatePickerCalendar.js.map +1 -1
- package/dist/cjs/DatePicker/index.js +32 -68
- package/dist/cjs/DatePicker/index.js.map +1 -1
- package/dist/cjs/Drawer/index.js +14 -44
- package/dist/cjs/Drawer/index.js.map +1 -1
- package/dist/cjs/Form/FormConfigContext.js +0 -4
- package/dist/cjs/Form/FormConfigContext.js.map +1 -1
- package/dist/cjs/Form/index.js +3 -20
- package/dist/cjs/Form/index.js.map +1 -1
- package/dist/cjs/FormDivider/index.js +3 -24
- package/dist/cjs/FormDivider/index.js.map +1 -1
- package/dist/cjs/FormItem/index.js +12 -42
- package/dist/cjs/FormItem/index.js.map +1 -1
- package/dist/cjs/FormItem/utils/firstChildHasType.js +0 -5
- package/dist/cjs/FormItem/utils/firstChildHasType.js.map +1 -1
- package/dist/cjs/Gallery/Status.js +2 -12
- package/dist/cjs/Gallery/Status.js.map +1 -1
- package/dist/cjs/Gallery/index.js +27 -61
- package/dist/cjs/Gallery/index.js.map +1 -1
- package/dist/cjs/GlobalStyles/index.js +0 -8
- package/dist/cjs/GlobalStyles/index.js.map +1 -1
- package/dist/cjs/GlobalStyles/resetStyles.js +0 -5
- package/dist/cjs/GlobalStyles/resetStyles.js.map +1 -1
- package/dist/cjs/GlobalStyles/typographyStyles.js +0 -11
- package/dist/cjs/GlobalStyles/typographyStyles.js.map +1 -1
- package/dist/cjs/HeaderSkeleton/index.js +7 -26
- package/dist/cjs/HeaderSkeleton/index.js.map +1 -1
- package/dist/cjs/Image/index.js +11 -31
- package/dist/cjs/Image/index.js.map +1 -1
- package/dist/cjs/ImageSkeleton/index.js +1 -12
- package/dist/cjs/ImageSkeleton/index.js.map +1 -1
- package/dist/cjs/Input/index.js +23 -57
- package/dist/cjs/Input/index.js.map +1 -1
- package/dist/cjs/Input/utils/getFocusableElements.js +0 -8
- package/dist/cjs/Input/utils/getFocusableElements.js.map +1 -1
- package/dist/cjs/InputNumber/index.js +49 -72
- package/dist/cjs/InputNumber/index.js.map +1 -1
- package/dist/cjs/InputNumber/utils/defaultLocale.js.map +1 -1
- package/dist/cjs/InputPassword/index.js +39 -77
- package/dist/cjs/InputPassword/index.js.map +1 -1
- package/dist/cjs/InputPassword/utils/defaultLocale.js.map +1 -1
- package/dist/cjs/InputSearch/index.js +22 -51
- package/dist/cjs/InputSearch/index.js.map +1 -1
- package/dist/cjs/InputSearch/utils/defaultLocale.js.map +1 -1
- package/dist/cjs/InputSkeleton/index.js +1 -14
- package/dist/cjs/InputSkeleton/index.js.map +1 -1
- package/dist/cjs/Layout/LayoutContext.js +0 -4
- package/dist/cjs/Layout/LayoutContext.js.map +1 -1
- package/dist/cjs/Layout/index.js +4 -12
- package/dist/cjs/Layout/index.js.map +1 -1
- package/dist/cjs/Link/index.js +8 -30
- package/dist/cjs/Link/index.js.map +1 -1
- package/dist/cjs/LinkButton/index.js +26 -49
- package/dist/cjs/LinkButton/index.js.map +1 -1
- package/dist/cjs/List/WindowScroller.js +4 -12
- package/dist/cjs/List/WindowScroller.js.map +1 -1
- package/dist/cjs/List/index.js +35 -68
- package/dist/cjs/List/index.js.map +1 -1
- package/dist/cjs/List/utils/bodyPointerEvents.js +0 -9
- package/dist/cjs/List/utils/bodyPointerEvents.js.map +1 -1
- package/dist/cjs/List/utils/frameTimeout.js +1 -8
- package/dist/cjs/List/utils/frameTimeout.js.map +1 -1
- package/dist/cjs/List/utils/useRWLoadNext.js +6 -9
- package/dist/cjs/List/utils/useRWLoadNext.js.map +1 -1
- package/dist/cjs/ListItem/ListItemContent.js +12 -44
- package/dist/cjs/ListItem/ListItemContent.js.map +1 -1
- package/dist/cjs/ListItem/index.js +15 -39
- package/dist/cjs/ListItem/index.js.map +1 -1
- package/dist/cjs/ListItemLink/index.js +18 -51
- package/dist/cjs/ListItemLink/index.js.map +1 -1
- package/dist/cjs/ListSkeleton/index.js +11 -32
- package/dist/cjs/ListSkeleton/index.js.map +1 -1
- package/dist/cjs/LogoLink/index.js +6 -27
- package/dist/cjs/LogoLink/index.js.map +1 -1
- package/dist/cjs/Menu/index.js +20 -47
- package/dist/cjs/Menu/index.js.map +1 -1
- package/dist/cjs/Menu/utils/useFocusWithArrows.js +1 -13
- package/dist/cjs/Menu/utils/useFocusWithArrows.js.map +1 -1
- package/dist/cjs/MenuDivider/index.js +1 -13
- package/dist/cjs/MenuDivider/index.js.map +1 -1
- package/dist/cjs/MenuGroup/index.js +19 -52
- package/dist/cjs/MenuGroup/index.js.map +1 -1
- package/dist/cjs/MenuItem/index.js +9 -32
- package/dist/cjs/MenuItem/index.js.map +1 -1
- package/dist/cjs/Modal/index.js +25 -65
- package/dist/cjs/Modal/index.js.map +1 -1
- package/dist/cjs/Modal/utils/defaultLocale.js.map +1 -1
- package/dist/cjs/Navigation/index.js +6 -35
- package/dist/cjs/Navigation/index.js.map +1 -1
- package/dist/cjs/Navigation/utils/useScrollFlags.js +6 -19
- package/dist/cjs/Navigation/utils/useScrollFlags.js.map +1 -1
- package/dist/cjs/NavigationItem/index.js +8 -32
- package/dist/cjs/NavigationItem/index.js.map +1 -1
- package/dist/cjs/PageContent/index.js +6 -30
- package/dist/cjs/PageContent/index.js.map +1 -1
- package/dist/cjs/PageHeader/index.js +13 -46
- package/dist/cjs/PageHeader/index.js.map +1 -1
- package/dist/cjs/PageHeader/utils/defaultLocale.js.map +1 -1
- package/dist/cjs/PageHeaderInputSearch/index.js +10 -46
- package/dist/cjs/PageHeaderInputSearch/index.js.map +1 -1
- package/dist/cjs/PageHeaderInputSearch/utils/defaultLocale.js +0 -7
- package/dist/cjs/PageHeaderInputSearch/utils/defaultLocale.js.map +1 -1
- package/dist/cjs/PageHeaderSkeleton/index.js +3 -18
- package/dist/cjs/PageHeaderSkeleton/index.js.map +1 -1
- package/dist/cjs/ParagraphSkeleton/index.js +7 -25
- package/dist/cjs/ParagraphSkeleton/index.js.map +1 -1
- package/dist/cjs/Popover/index.js +46 -77
- package/dist/cjs/Popover/index.js.map +1 -1
- package/dist/cjs/Popover/utils/usePopoverPosition.js +21 -43
- package/dist/cjs/Popover/utils/usePopoverPosition.js.map +1 -1
- package/dist/cjs/Progress/index.js +6 -25
- package/dist/cjs/Progress/index.js.map +1 -1
- package/dist/cjs/RadioGroup/index.js +25 -55
- package/dist/cjs/RadioGroup/index.js.map +1 -1
- package/dist/cjs/RadioGroupSkeleton/index.js +3 -20
- package/dist/cjs/RadioGroupSkeleton/index.js.map +1 -1
- package/dist/cjs/Result/index.js +6 -30
- package/dist/cjs/Result/index.js.map +1 -1
- package/dist/cjs/ScrollButton/index.js +15 -40
- package/dist/cjs/ScrollButton/index.js.map +1 -1
- package/dist/cjs/ScrollButton/utils/useContainerPosition.js +10 -23
- package/dist/cjs/ScrollButton/utils/useContainerPosition.js.map +1 -1
- package/dist/cjs/ScrollButton/utils/useVisibility.js +6 -19
- package/dist/cjs/ScrollButton/utils/useVisibility.js.map +1 -1
- package/dist/cjs/Select/SelectList.js +27 -53
- package/dist/cjs/Select/SelectList.js.map +1 -1
- package/dist/cjs/Select/SelectToggle.js +17 -52
- package/dist/cjs/Select/SelectToggle.js.map +1 -1
- package/dist/cjs/Select/index.js +60 -103
- package/dist/cjs/Select/index.js.map +1 -1
- package/dist/cjs/Select/utils/defaultLocale.js.map +1 -1
- package/dist/cjs/Skeleton/index.js +3 -20
- package/dist/cjs/Skeleton/index.js.map +1 -1
- package/dist/cjs/Switch/index.js +17 -52
- package/dist/cjs/Switch/index.js.map +1 -1
- package/dist/cjs/SwitchSkeleton/index.js +1 -14
- package/dist/cjs/SwitchSkeleton/index.js.map +1 -1
- package/dist/cjs/Tag/index.js +4 -26
- package/dist/cjs/Tag/index.js.map +1 -1
- package/dist/cjs/TagLink/index.js +7 -25
- package/dist/cjs/TagLink/index.js.map +1 -1
- package/dist/cjs/TagList/index.js +8 -38
- package/dist/cjs/TagList/index.js.map +1 -1
- package/dist/cjs/TagListSkeleton/index.js +4 -17
- package/dist/cjs/TagListSkeleton/index.js.map +1 -1
- package/dist/cjs/TagSkeleton/index.js +3 -20
- package/dist/cjs/TagSkeleton/index.js.map +1 -1
- package/dist/cjs/TextArea/index.js +6 -21
- package/dist/cjs/TextArea/index.js.map +1 -1
- package/dist/cjs/TextAreaSkeleton/index.js +1 -12
- package/dist/cjs/TextAreaSkeleton/index.js.map +1 -1
- package/dist/cjs/ThemeSwitcher/index.js +4 -20
- package/dist/cjs/ThemeSwitcher/index.js.map +1 -1
- package/dist/cjs/TimePicker/index.js +140 -0
- package/dist/cjs/TimePicker/index.js.map +1 -0
- package/dist/cjs/Video/index.js +2 -18
- package/dist/cjs/Video/index.js.map +1 -1
- package/dist/cjs/index.js +0 -126
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/message/AlertIcon.js +15 -26
- package/dist/cjs/message/AlertIcon.js.map +1 -1
- package/dist/cjs/message/Message.js +1 -17
- package/dist/cjs/message/Message.js.map +1 -1
- package/dist/cjs/message/index.js +7 -21
- package/dist/cjs/message/index.js.map +1 -1
- package/dist/cjs/message/styles.js +2 -12
- package/dist/cjs/message/styles.js.map +1 -1
- package/dist/esm/Alert/index.js +1 -10
- package/dist/esm/Alert/index.js.map +1 -1
- package/dist/esm/Avatar/index.js +5 -4
- package/dist/esm/Avatar/index.js.map +1 -1
- package/dist/esm/Avatar/utils/nameToInitials.js +0 -1
- package/dist/esm/Avatar/utils/nameToInitials.js.map +1 -1
- package/dist/esm/Avatar/utils/strToHue.js +0 -3
- package/dist/esm/Avatar/utils/strToHue.js.map +1 -1
- package/dist/esm/AvatarSkeleton/index.js +1 -2
- package/dist/esm/AvatarSkeleton/index.js.map +1 -1
- package/dist/esm/Breadcrumb/index.js +3 -5
- package/dist/esm/Breadcrumb/index.js.map +1 -1
- package/dist/esm/BreadcrumbItem/index.js +1 -2
- package/dist/esm/BreadcrumbItem/index.js.map +1 -1
- package/dist/esm/Button/ButtonContent.js +2 -2
- package/dist/esm/Button/ButtonContent.js.map +1 -1
- package/dist/esm/Button/index.js +1 -10
- package/dist/esm/Button/index.js.map +1 -1
- package/dist/esm/Button/utils/useButtonColors.js +0 -5
- package/dist/esm/Button/utils/useButtonColors.js.map +1 -1
- package/dist/esm/Checkbox/index.js +1 -15
- package/dist/esm/Checkbox/index.js.map +1 -1
- package/dist/esm/CheckboxSkeleton/index.js +1 -2
- package/dist/esm/CheckboxSkeleton/index.js.map +1 -1
- package/dist/esm/DatePicker/DatePickerCalendar.js +0 -7
- package/dist/esm/DatePicker/DatePickerCalendar.js.map +1 -1
- package/dist/esm/DatePicker/index.js +0 -5
- package/dist/esm/DatePicker/index.js.map +1 -1
- package/dist/esm/Drawer/index.js +1 -7
- package/dist/esm/Drawer/index.js.map +1 -1
- package/dist/esm/Form/FormConfigContext.js.map +1 -1
- package/dist/esm/Form/index.js +1 -2
- package/dist/esm/Form/index.js.map +1 -1
- package/dist/esm/FormDivider/index.js +1 -2
- package/dist/esm/FormDivider/index.js.map +1 -1
- package/dist/esm/FormItem/index.js +1 -4
- package/dist/esm/FormItem/index.js.map +1 -1
- package/dist/esm/FormItem/utils/firstChildHasType.js +0 -2
- package/dist/esm/FormItem/utils/firstChildHasType.js.map +1 -1
- package/dist/esm/Gallery/Status.js +0 -2
- package/dist/esm/Gallery/Status.js.map +1 -1
- package/dist/esm/Gallery/index.js +3 -7
- package/dist/esm/Gallery/index.js.map +1 -1
- package/dist/esm/GlobalStyles/index.js +0 -2
- package/dist/esm/GlobalStyles/index.js.map +1 -1
- package/dist/esm/GlobalStyles/resetStyles.js +0 -2
- package/dist/esm/GlobalStyles/resetStyles.js.map +1 -1
- package/dist/esm/GlobalStyles/typographyStyles.js +0 -4
- package/dist/esm/GlobalStyles/typographyStyles.js.map +1 -1
- package/dist/esm/HeaderSkeleton/index.js +1 -4
- package/dist/esm/HeaderSkeleton/index.js.map +1 -1
- package/dist/esm/Image/index.js +1 -6
- package/dist/esm/Image/index.js.map +1 -1
- package/dist/esm/ImageSkeleton/index.js +1 -2
- package/dist/esm/ImageSkeleton/index.js.map +1 -1
- package/dist/esm/Input/index.js +1 -10
- package/dist/esm/Input/index.js.map +1 -1
- package/dist/esm/Input/utils/getFocusableElements.js +0 -1
- package/dist/esm/Input/utils/getFocusableElements.js.map +1 -1
- package/dist/esm/InputNumber/index.js +10 -7
- package/dist/esm/InputNumber/index.js.map +1 -1
- package/dist/esm/InputNumber/utils/defaultLocale.js.map +1 -1
- package/dist/esm/InputPassword/index.js +3 -8
- package/dist/esm/InputPassword/index.js.map +1 -1
- package/dist/esm/InputPassword/utils/defaultLocale.js.map +1 -1
- package/dist/esm/InputSearch/index.js +1 -2
- package/dist/esm/InputSearch/index.js.map +1 -1
- package/dist/esm/InputSearch/utils/defaultLocale.js.map +1 -1
- package/dist/esm/InputSkeleton/index.js +1 -2
- package/dist/esm/InputSkeleton/index.js.map +1 -1
- package/dist/esm/Layout/LayoutContext.js.map +1 -1
- package/dist/esm/Layout/index.js +0 -2
- package/dist/esm/Layout/index.js.map +1 -1
- package/dist/esm/Link/index.js +3 -8
- package/dist/esm/Link/index.js.map +1 -1
- package/dist/esm/LinkButton/index.js +1 -4
- package/dist/esm/LinkButton/index.js.map +1 -1
- package/dist/esm/List/WindowScroller.js +2 -4
- package/dist/esm/List/WindowScroller.js.map +1 -1
- package/dist/esm/List/index.js +10 -9
- package/dist/esm/List/index.js.map +1 -1
- package/dist/esm/List/utils/bodyPointerEvents.js +0 -1
- package/dist/esm/List/utils/bodyPointerEvents.js.map +1 -1
- package/dist/esm/List/utils/frameTimeout.js +1 -4
- package/dist/esm/List/utils/frameTimeout.js.map +1 -1
- package/dist/esm/List/utils/useRWLoadNext.js +0 -2
- package/dist/esm/List/utils/useRWLoadNext.js.map +1 -1
- package/dist/esm/ListItem/ListItemContent.js +2 -6
- package/dist/esm/ListItem/ListItemContent.js.map +1 -1
- package/dist/esm/ListItem/index.js +1 -2
- package/dist/esm/ListItem/index.js.map +1 -1
- package/dist/esm/ListItemLink/index.js +1 -4
- package/dist/esm/ListItemLink/index.js.map +1 -1
- package/dist/esm/ListSkeleton/index.js +1 -2
- package/dist/esm/ListSkeleton/index.js.map +1 -1
- package/dist/esm/LogoLink/index.js +1 -4
- package/dist/esm/LogoLink/index.js.map +1 -1
- package/dist/esm/Menu/index.js +3 -3
- package/dist/esm/Menu/index.js.map +1 -1
- package/dist/esm/Menu/utils/useFocusWithArrows.js +0 -4
- package/dist/esm/Menu/utils/useFocusWithArrows.js.map +1 -1
- package/dist/esm/MenuDivider/index.js +1 -2
- package/dist/esm/MenuDivider/index.js.map +1 -1
- package/dist/esm/MenuGroup/index.js +1 -2
- package/dist/esm/MenuGroup/index.js.map +1 -1
- package/dist/esm/MenuItem/index.js +1 -4
- package/dist/esm/MenuItem/index.js.map +1 -1
- package/dist/esm/Modal/index.js +1 -8
- package/dist/esm/Modal/index.js.map +1 -1
- package/dist/esm/Modal/utils/defaultLocale.js.map +1 -1
- package/dist/esm/Navigation/index.js +1 -7
- package/dist/esm/Navigation/index.js.map +1 -1
- package/dist/esm/Navigation/utils/useScrollFlags.js +0 -2
- package/dist/esm/Navigation/utils/useScrollFlags.js.map +1 -1
- package/dist/esm/NavigationItem/index.js +1 -4
- package/dist/esm/NavigationItem/index.js.map +1 -1
- package/dist/esm/PageContent/index.js +1 -7
- package/dist/esm/PageContent/index.js.map +1 -1
- package/dist/esm/PageHeader/index.js +1 -8
- package/dist/esm/PageHeader/index.js.map +1 -1
- package/dist/esm/PageHeader/utils/defaultLocale.js.map +1 -1
- package/dist/esm/PageHeaderInputSearch/index.js +1 -5
- package/dist/esm/PageHeaderInputSearch/index.js.map +1 -1
- package/dist/esm/PageHeaderInputSearch/utils/defaultLocale.js +2 -1
- package/dist/esm/PageHeaderInputSearch/utils/defaultLocale.js.map +1 -1
- package/dist/esm/PageHeaderSkeleton/index.js +0 -2
- package/dist/esm/PageHeaderSkeleton/index.js.map +1 -1
- package/dist/esm/ParagraphSkeleton/index.js +1 -4
- package/dist/esm/ParagraphSkeleton/index.js.map +1 -1
- package/dist/esm/Popover/index.js +12 -13
- package/dist/esm/Popover/index.js.map +1 -1
- package/dist/esm/Popover/utils/usePopoverPosition.js +8 -19
- package/dist/esm/Popover/utils/usePopoverPosition.js.map +1 -1
- package/dist/esm/Progress/index.js +1 -2
- package/dist/esm/Progress/index.js.map +1 -1
- package/dist/esm/RadioGroup/index.js +1 -5
- package/dist/esm/RadioGroup/index.js.map +1 -1
- package/dist/esm/RadioGroupSkeleton/index.js +1 -2
- package/dist/esm/RadioGroupSkeleton/index.js.map +1 -1
- package/dist/esm/Result/index.js +1 -2
- package/dist/esm/Result/index.js.map +1 -1
- package/dist/esm/ScrollButton/index.js +7 -9
- package/dist/esm/ScrollButton/index.js.map +1 -1
- package/dist/esm/ScrollButton/utils/useContainerPosition.js +0 -2
- package/dist/esm/ScrollButton/utils/useContainerPosition.js.map +1 -1
- package/dist/esm/ScrollButton/utils/useVisibility.js +2 -5
- package/dist/esm/ScrollButton/utils/useVisibility.js.map +1 -1
- package/dist/esm/Select/SelectList.js +11 -12
- package/dist/esm/Select/SelectList.js.map +1 -1
- package/dist/esm/Select/SelectToggle.js +0 -14
- package/dist/esm/Select/SelectToggle.js.map +1 -1
- package/dist/esm/Select/index.js +4 -10
- package/dist/esm/Select/index.js.map +1 -1
- package/dist/esm/Select/utils/defaultLocale.js.map +1 -1
- package/dist/esm/Skeleton/index.js +1 -2
- package/dist/esm/Skeleton/index.js.map +1 -1
- package/dist/esm/Switch/index.js +1 -11
- package/dist/esm/Switch/index.js.map +1 -1
- package/dist/esm/SwitchSkeleton/index.js +1 -2
- package/dist/esm/SwitchSkeleton/index.js.map +1 -1
- package/dist/esm/Tag/index.js +1 -2
- package/dist/esm/Tag/index.js.map +1 -1
- package/dist/esm/TagLink/index.js +1 -2
- package/dist/esm/TagLink/index.js.map +1 -1
- package/dist/esm/TagList/index.js +1 -4
- package/dist/esm/TagList/index.js.map +1 -1
- package/dist/esm/TagListSkeleton/index.js +1 -2
- package/dist/esm/TagListSkeleton/index.js.map +1 -1
- package/dist/esm/TagSkeleton/index.js +1 -2
- package/dist/esm/TagSkeleton/index.js.map +1 -1
- package/dist/esm/TextArea/index.js +1 -2
- package/dist/esm/TextArea/index.js.map +1 -1
- package/dist/esm/TextAreaSkeleton/index.js +1 -2
- package/dist/esm/TextAreaSkeleton/index.js.map +1 -1
- package/dist/esm/ThemeSwitcher/index.js +0 -2
- package/dist/esm/ThemeSwitcher/index.js.map +1 -1
- package/dist/esm/TimePicker/index.js +105 -0
- package/dist/esm/TimePicker/index.js.map +1 -0
- package/dist/esm/Video/index.js +1 -2
- package/dist/esm/Video/index.js.map +1 -1
- package/dist/esm/emotion.d.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/message/AlertIcon.js +0 -2
- package/dist/esm/message/AlertIcon.js.map +1 -1
- package/dist/esm/message/Message.js.map +1 -1
- package/dist/esm/message/index.js +7 -9
- package/dist/esm/message/index.js.map +1 -1
- package/dist/esm/message/styles.js.map +1 -1
- package/dist/types/TimePicker/index.d.ts +11 -0
- package/dist/types/TimePicker/index.d.ts.map +1 -0
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","forwardRef","useEffect","useMemo","useState","useForwardedRef","numberToFormattedString","getNextState","getNextCaret","useValidate","useGetCaretWithinValue","Input","defaultLocale","InputNumber","min","max","precision","prefix","suffix","decimalSeparator","thousandsSeparator","locale","value","onChange","onSelect","onFocus","rest","ref","options","inputRef","mergedInputRef","valueString","setValueString","selection","setSelection","start","end","getCaretWithinValue","current","setSelectionRange","e","selectionStart","selectionEnd","currentTarget","length","v","nextState","valueNumber","nextCaret","prevValueString","nextValueString","prevCaret","deleteKeyPressed","nativeEvent","inputType","undefined","emptyLabel","displayName"],"sources":["../../../src/InputNumber/index.tsx"],"sourcesContent":["import React, { forwardRef, useEffect, useMemo, useState } from 'react';\nimport { useForwardedRef } from '@os-design/utils';\nimport {\n numberToFormattedString,\n getNextState,\n getNextCaret,\n useValidate,\n useGetCaretWithinValue,\n} from '@os-design/input-number-utils';\nimport Input, { InputProps } from '../Input';\nimport defaultLocale, { InputNumberLocale } from './utils/defaultLocale';\n\nexport interface InputNumberProps\n extends Omit<InputProps, 'type' | 'value' | 'onChange'> {\n /**\n * The minimum value.\n * @default 0\n */\n min?: number;\n /**\n * The maximum value.\n * @default 2147483647\n */\n max?: number;\n /**\n * The number of digits after the decimal point.\n * @default 0\n */\n precision?: number;\n /**\n * The string before the number.\n * @default undefined\n */\n prefix?: string;\n /**\n * The string after the number.\n * @default undefined\n */\n suffix?: string;\n /**\n * The decimal separator.\n * @default .\n */\n decimalSeparator?: '.' | ',';\n /**\n * The thousands separator.\n * @default ' '\n */\n thousandsSeparator?: ' ' | '.' | ',' | null;\n /**\n * The locale.\n * @default undefined\n */\n locale?: InputNumberLocale;\n /**\n * The input value.\n * @default undefined\n */\n value?: number | null;\n /**\n * The change event handler.\n * Returns null when the input value is empty.\n * @default undefined\n */\n onChange?: (value: number | null) => void;\n}\n\ninterface Selection {\n start: number;\n end: number;\n}\n\n/**\n * The input for entering a number.\n */\nconst InputNumber = forwardRef<HTMLInputElement, InputNumberProps>(\n (\n {\n min = 0,\n max = 2147483647,\n precision = 0,\n prefix = '',\n suffix = '',\n decimalSeparator = '.',\n thousandsSeparator = ' ',\n locale = defaultLocale,\n value = null,\n onChange = () => {},\n onSelect = () => {},\n onFocus = () => {},\n ...rest\n },\n ref\n ) => {\n useValidate({\n min,\n max,\n precision,\n prefix,\n suffix,\n decimalSeparator,\n thousandsSeparator,\n });\n\n const options = useMemo(\n () => ({\n min,\n max,\n precision,\n prefix,\n suffix,\n decimalSeparator,\n thousandsSeparator,\n }),\n [\n min,\n max,\n precision,\n prefix,\n suffix,\n decimalSeparator,\n thousandsSeparator,\n ]\n );\n\n const [inputRef, mergedInputRef] = useForwardedRef(ref);\n const [valueString, setValueString] = useState<string>(\n numberToFormattedString(value, options)\n );\n const [selection, setSelection] = useState<Selection>({ start: 0, end: 0 });\n const getCaretWithinValue = useGetCaretWithinValue(prefix, suffix);\n\n // Update the value\n useEffect(() => {\n setValueString(numberToFormattedString(value, options));\n }, [value, options]);\n\n // Update the selection\n useEffect(() => {\n if (!inputRef.current) return;\n inputRef.current.setSelectionRange(selection.start, selection.end);\n }, [inputRef, selection]);\n\n return (\n <Input\n onSelect={(e) => {\n // Update the selection state.\n // Don't use `getCaretWithinValue` here to allow a user to copy\n // the input value with a prefix and suffix.\n const { selectionStart, selectionEnd } = e.currentTarget;\n setSelection({ start: selectionStart || 0, end: selectionEnd || 0 });\n onSelect(e);\n }}\n onFocus={(e) => {\n // Move the caret to the end of the input value and before the suffix\n setSelection({\n start: getCaretWithinValue(valueString.length, valueString),\n end: getCaretWithinValue(valueString.length, valueString),\n });\n onFocus(e);\n }}\n value={valueString}\n onChange={(v, e) => {\n // Get a new value as a string and number\n const nextState = getNextState(v, options);\n\n // Set the new string value in the input field\n setValueString(nextState.valueString);\n\n // Send the new numeric value in the onChange callback\n onChange(nextState.valueNumber);\n\n // Update the caret position\n const nextCaret = getCaretWithinValue(\n getNextCaret({\n value: v,\n prevValueString: valueString,\n nextValueString: nextState.valueString,\n prevCaret: selection.end,\n deleteKeyPressed:\n (e.nativeEvent as InputEvent).inputType ===\n 'deleteContentBackward',\n options,\n }),\n nextState.valueString\n );\n setSelection({ start: nextCaret, end: nextCaret });\n }}\n role='spinbutton'\n aria-valuenow={\n value !== undefined && value !== null ? value : undefined\n }\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuetext={valueString === '' ? locale.emptyLabel : undefined}\n inputMode='decimal'\n autoComplete='off'\n autoCorrect='off'\n {...rest}\n ref={mergedInputRef}\n />\n );\n }\n);\n\nInputNumber.displayName = 'InputNumber';\n\nexport default InputNumber;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","forwardRef","useEffect","useMemo","useState","useForwardedRef","numberToFormattedString","getNextState","getNextCaret","useValidate","useGetCaretWithinValue","Input","defaultLocale","InputNumber","min","max","precision","prefix","suffix","decimalSeparator","thousandsSeparator","locale","value","onChange","onSelect","onFocus","rest","ref","options","inputRef","mergedInputRef","valueString","setValueString","selection","setSelection","start","end","getCaretWithinValue","current","setSelectionRange","e","selectionStart","selectionEnd","currentTarget","length","v","nextState","valueNumber","nextCaret","prevValueString","nextValueString","prevCaret","deleteKeyPressed","nativeEvent","inputType","undefined","emptyLabel","displayName"],"sources":["../../../src/InputNumber/index.tsx"],"sourcesContent":["import React, { forwardRef, useEffect, useMemo, useState } from 'react';\nimport { useForwardedRef } from '@os-design/utils';\nimport {\n numberToFormattedString,\n getNextState,\n getNextCaret,\n useValidate,\n useGetCaretWithinValue,\n} from '@os-design/input-number-utils';\nimport Input, { InputProps } from '../Input';\nimport defaultLocale, { InputNumberLocale } from './utils/defaultLocale';\n\nexport interface InputNumberProps\n extends Omit<InputProps, 'type' | 'value' | 'onChange'> {\n /**\n * The minimum value.\n * @default 0\n */\n min?: number;\n /**\n * The maximum value.\n * @default 2147483647\n */\n max?: number;\n /**\n * The number of digits after the decimal point.\n * @default 0\n */\n precision?: number;\n /**\n * The string before the number.\n * @default undefined\n */\n prefix?: string;\n /**\n * The string after the number.\n * @default undefined\n */\n suffix?: string;\n /**\n * The decimal separator.\n * @default .\n */\n decimalSeparator?: '.' | ',';\n /**\n * The thousands separator.\n * @default ' '\n */\n thousandsSeparator?: ' ' | '.' | ',' | null;\n /**\n * The locale.\n * @default undefined\n */\n locale?: InputNumberLocale;\n /**\n * The input value.\n * @default undefined\n */\n value?: number | null;\n /**\n * The change event handler.\n * Returns null when the input value is empty.\n * @default undefined\n */\n onChange?: (value: number | null) => void;\n}\n\ninterface Selection {\n start: number;\n end: number;\n}\n\n/**\n * The input for entering a number.\n */\nconst InputNumber = forwardRef<HTMLInputElement, InputNumberProps>(\n (\n {\n min = 0,\n max = 2147483647,\n precision = 0,\n prefix = '',\n suffix = '',\n decimalSeparator = '.',\n thousandsSeparator = ' ',\n locale = defaultLocale,\n value = null,\n onChange = () => {},\n onSelect = () => {},\n onFocus = () => {},\n ...rest\n },\n ref\n ) => {\n useValidate({\n min,\n max,\n precision,\n prefix,\n suffix,\n decimalSeparator,\n thousandsSeparator,\n });\n\n const options = useMemo(\n () => ({\n min,\n max,\n precision,\n prefix,\n suffix,\n decimalSeparator,\n thousandsSeparator,\n }),\n [\n min,\n max,\n precision,\n prefix,\n suffix,\n decimalSeparator,\n thousandsSeparator,\n ]\n );\n\n const [inputRef, mergedInputRef] = useForwardedRef(ref);\n const [valueString, setValueString] = useState<string>(\n numberToFormattedString(value, options)\n );\n const [selection, setSelection] = useState<Selection>({ start: 0, end: 0 });\n const getCaretWithinValue = useGetCaretWithinValue(prefix, suffix);\n\n // Update the value\n useEffect(() => {\n setValueString(numberToFormattedString(value, options));\n }, [value, options]);\n\n // Update the selection\n useEffect(() => {\n if (!inputRef.current) return;\n inputRef.current.setSelectionRange(selection.start, selection.end);\n }, [inputRef, selection]);\n\n return (\n <Input\n onSelect={(e) => {\n // Update the selection state.\n // Don't use `getCaretWithinValue` here to allow a user to copy\n // the input value with a prefix and suffix.\n const { selectionStart, selectionEnd } = e.currentTarget;\n setSelection({ start: selectionStart || 0, end: selectionEnd || 0 });\n onSelect(e);\n }}\n onFocus={(e) => {\n // Move the caret to the end of the input value and before the suffix\n setSelection({\n start: getCaretWithinValue(valueString.length, valueString),\n end: getCaretWithinValue(valueString.length, valueString),\n });\n onFocus(e);\n }}\n value={valueString}\n onChange={(v, e) => {\n // Get a new value as a string and number\n const nextState = getNextState(v, options);\n\n // Set the new string value in the input field\n setValueString(nextState.valueString);\n\n // Send the new numeric value in the onChange callback\n onChange(nextState.valueNumber);\n\n // Update the caret position\n const nextCaret = getCaretWithinValue(\n getNextCaret({\n value: v,\n prevValueString: valueString,\n nextValueString: nextState.valueString,\n prevCaret: selection.end,\n deleteKeyPressed:\n (e.nativeEvent as InputEvent).inputType ===\n 'deleteContentBackward',\n options,\n }),\n nextState.valueString\n );\n setSelection({ start: nextCaret, end: nextCaret });\n }}\n role='spinbutton'\n aria-valuenow={\n value !== undefined && value !== null ? value : undefined\n }\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuetext={valueString === '' ? locale.emptyLabel : undefined}\n inputMode='decimal'\n autoComplete='off'\n autoCorrect='off'\n {...rest}\n ref={mergedInputRef}\n />\n );\n }\n);\n\nInputNumber.displayName = 'InputNumber';\n\nexport default InputNumber;\n"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultLocale.js","names":["defaultLocale","emptyLabel"],"sources":["../../../../src/InputNumber/utils/defaultLocale.ts"],"sourcesContent":["export interface InputNumberLocale {\n emptyLabel: string;\n}\n\nconst defaultLocale: InputNumberLocale = {\n emptyLabel: 'Empty',\n};\n\nexport default defaultLocale;\n"],"mappings":"AAIA,MAAMA,aAAgC,GAAG;EACvCC,UAAU,EAAE;
|
|
1
|
+
{"version":3,"file":"defaultLocale.js","names":["defaultLocale","emptyLabel"],"sources":["../../../../src/InputNumber/utils/defaultLocale.ts"],"sourcesContent":["export interface InputNumberLocale {\n emptyLabel: string;\n}\n\nconst defaultLocale: InputNumberLocale = {\n emptyLabel: 'Empty',\n};\n\nexport default defaultLocale;\n"],"mappings":"AAIA,MAAMA,aAAgC,GAAG;EACvCC,UAAU,EAAE;AACd,CAAC;AAED,eAAeD,aAAa"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
2
|
import React, { forwardRef, useEffect, useMemo, useState } from 'react';
|
|
4
3
|
import { Eye, EyeInvisible } from '@os-design/icons';
|
|
5
4
|
import { ThemeOverrider, useTheme } from '@os-design/theming';
|
|
@@ -13,10 +12,10 @@ import defaultLocale from './utils/defaultLocale';
|
|
|
13
12
|
const StrengthMeterProgress = styled(Progress)`
|
|
14
13
|
margin-top: 0.4em;
|
|
15
14
|
`;
|
|
15
|
+
|
|
16
16
|
/**
|
|
17
17
|
* The input for entering a password.
|
|
18
18
|
*/
|
|
19
|
-
|
|
20
19
|
const InputPassword = /*#__PURE__*/forwardRef(({
|
|
21
20
|
showStrengthMeter = false,
|
|
22
21
|
strengthNames,
|
|
@@ -43,8 +42,9 @@ const InputPassword = /*#__PURE__*/forwardRef(({
|
|
|
43
42
|
const [invisible, setInvisible] = useState(true);
|
|
44
43
|
const {
|
|
45
44
|
theme
|
|
46
|
-
} = useTheme();
|
|
45
|
+
} = useTheme();
|
|
47
46
|
|
|
47
|
+
// Update the selection of the input when changing the invisible flag
|
|
48
48
|
useEffect(() => {
|
|
49
49
|
if (!inputRef.current) return;
|
|
50
50
|
inputRef.current.setSelectionRange(selection.start, selection.end);
|
|
@@ -57,21 +57,18 @@ const InputPassword = /*#__PURE__*/forwardRef(({
|
|
|
57
57
|
color: theme.inputPasswordColorPowerful
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
|
-
|
|
61
60
|
if (score >= strengthThresholds[1]) {
|
|
62
61
|
return {
|
|
63
62
|
name: 'strong',
|
|
64
63
|
color: theme.inputPasswordColorStrong
|
|
65
64
|
};
|
|
66
65
|
}
|
|
67
|
-
|
|
68
66
|
if (score >= strengthThresholds[0]) {
|
|
69
67
|
return {
|
|
70
68
|
name: 'good',
|
|
71
69
|
color: theme.inputPasswordColorGood
|
|
72
70
|
};
|
|
73
71
|
}
|
|
74
|
-
|
|
75
72
|
return {
|
|
76
73
|
name: 'weak',
|
|
77
74
|
color: theme.inputPasswordColorWeak
|
|
@@ -112,12 +109,10 @@ const InputPassword = /*#__PURE__*/forwardRef(({
|
|
|
112
109
|
})), showStrengthMeter && /*#__PURE__*/React.createElement(ThemeOverrider, {
|
|
113
110
|
overrides: {
|
|
114
111
|
progressColorStroke: strength.color,
|
|
115
|
-
|
|
116
112
|
get progressColorStrokeSuccess() {
|
|
117
113
|
// eslint-disable-next-line react/no-this-in-sfc
|
|
118
114
|
return this.progressColorStroke;
|
|
119
115
|
}
|
|
120
|
-
|
|
121
116
|
}
|
|
122
117
|
}, /*#__PURE__*/React.createElement(StrengthMeterProgress, {
|
|
123
118
|
size: "small",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","forwardRef","useEffect","useMemo","useState","Eye","EyeInvisible","ThemeOverrider","useTheme","useForwardedRef","useForwardedState","getPasswordScore","styled","Input","Button","Progress","defaultLocale","StrengthMeterProgress","InputPassword","showStrengthMeter","strengthNames","strengthThresholds","locale","value","defaultValue","onChange","onSelect","disabled","right","rest","ref","inputRef","mergedInputRef","forwardedValue","setForwardedValue","selection","setSelection","start","end","invisible","setInvisible","theme","current","setSelectionRange","score","strength","name","color","inputPasswordColorPowerful","inputPasswordColorStrong","inputPasswordColorGood","inputPasswordColorWeak","focus","showLabel","hideLabel","e","selectionStart","selectionEnd","currentTarget","progressColorStroke","progressColorStrokeSuccess","undefined","displayName"],"sources":["../../../src/InputPassword/index.tsx"],"sourcesContent":["import React, { forwardRef, useEffect, useMemo, useState } from 'react';\nimport { Eye, EyeInvisible } from '@os-design/icons';\nimport { ThemeOverrider, useTheme } from '@os-design/theming';\nimport { useForwardedRef, useForwardedState } from '@os-design/utils';\nimport getPasswordScore from '@os-team/password-score';\nimport styled from '@emotion/styled';\nimport Input, { InputProps } from '../Input';\nimport Button from '../Button';\nimport Progress from '../Progress';\nimport defaultLocale, { InputPasswordLocale } from './utils/defaultLocale';\n\nexport interface InputPasswordProps extends Omit<InputProps, 'type'> {\n /**\n * Whether the password strength meter is visible.\n * @default false\n */\n showStrengthMeter?: boolean;\n /**\n * The name of a weak, good, strong, and powerful password.\n * Located to the right of the password strength meter.\n * @default undefined\n */\n strengthNames?: Record<'weak' | 'good' | 'strong' | 'powerful', string>;\n /**\n * From what number of score the password is considered\n * good, strong, and powerful.\n * @default [30, 60, 80]\n */\n strengthThresholds?: [number, number, number];\n /**\n * The locale.\n * @default undefined\n */\n locale?: InputPasswordLocale;\n /**\n * The input value.\n * @default undefined\n */\n value?: string;\n /**\n * The default value.\n * @default undefined\n */\n defaultValue?: string;\n /**\n * The change event handler.\n * @default undefined\n */\n onChange?: (value: string) => void;\n}\n\ninterface Selection {\n start: number;\n end: number;\n}\n\nconst StrengthMeterProgress = styled(Progress)`\n margin-top: 0.4em;\n`;\n\n/**\n * The input for entering a password.\n */\nconst InputPassword = forwardRef<HTMLInputElement, InputPasswordProps>(\n (\n {\n showStrengthMeter = false,\n strengthNames,\n strengthThresholds = [30, 60, 80],\n locale = defaultLocale,\n value,\n defaultValue,\n onChange = () => {},\n onSelect = () => {},\n disabled,\n right,\n ...rest\n },\n ref\n ) => {\n const [inputRef, mergedInputRef] = useForwardedRef(ref);\n const [forwardedValue, setForwardedValue] = useForwardedState({\n value,\n defaultValue,\n onChange,\n });\n const [selection, setSelection] = useState<Selection>({ start: 0, end: 0 });\n const [invisible, setInvisible] = useState(true);\n const { theme } = useTheme();\n\n // Update the selection of the input when changing the invisible flag\n useEffect(() => {\n if (!inputRef.current) return;\n inputRef.current.setSelectionRange(selection.start, selection.end);\n }, [inputRef, selection, invisible]);\n\n const score = useMemo(\n () => getPasswordScore(forwardedValue || ''),\n [forwardedValue]\n );\n\n const strength = useMemo(() => {\n if (score >= strengthThresholds[2]) {\n return {\n name: 'powerful',\n color: theme.inputPasswordColorPowerful,\n };\n }\n if (score >= strengthThresholds[1]) {\n return {\n name: 'strong',\n color: theme.inputPasswordColorStrong,\n };\n }\n if (score >= strengthThresholds[0]) {\n return {\n name: 'good',\n color: theme.inputPasswordColorGood,\n };\n }\n return {\n name: 'weak',\n color: theme.inputPasswordColorWeak,\n };\n }, [\n score,\n strengthThresholds,\n theme.inputPasswordColorPowerful,\n theme.inputPasswordColorStrong,\n theme.inputPasswordColorGood,\n theme.inputPasswordColorWeak,\n ]);\n\n return (\n <>\n <Input\n type={invisible ? 'password' : 'text'}\n right={\n <>\n <Button\n key='invisible-button'\n type='ghost'\n wide='never'\n size='small'\n disabled={disabled}\n onClick={() => {\n setInvisible(!invisible);\n if (!inputRef.current) return;\n inputRef.current.focus();\n }}\n aria-label={invisible ? locale.showLabel : locale.hideLabel}\n >\n {invisible ? <EyeInvisible /> : <Eye />}\n </Button>\n {right}\n </>\n }\n value={forwardedValue}\n onChange={setForwardedValue}\n onSelect={(e) => {\n // Update the selection state\n const { selectionStart, selectionEnd } = e.currentTarget;\n setSelection({\n start: selectionStart || 0,\n end: selectionEnd || 0,\n });\n onSelect(e);\n }}\n disabled={disabled}\n {...rest}\n ref={mergedInputRef}\n />\n {showStrengthMeter && (\n <ThemeOverrider\n overrides={{\n progressColorStroke: strength.color,\n get progressColorStrokeSuccess() {\n // eslint-disable-next-line react/no-this-in-sfc\n return this.progressColorStroke;\n },\n }}\n >\n <StrengthMeterProgress\n size='small'\n height='0.25em'\n percent={score}\n text={strengthNames ? strengthNames[strength.name] : undefined}\n />\n </ThemeOverrider>\n )}\n </>\n );\n }\n);\n\nInputPassword.displayName = 'InputPassword';\n\nexport default InputPassword;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","forwardRef","useEffect","useMemo","useState","Eye","EyeInvisible","ThemeOverrider","useTheme","useForwardedRef","useForwardedState","getPasswordScore","styled","Input","Button","Progress","defaultLocale","StrengthMeterProgress","InputPassword","showStrengthMeter","strengthNames","strengthThresholds","locale","value","defaultValue","onChange","onSelect","disabled","right","rest","ref","inputRef","mergedInputRef","forwardedValue","setForwardedValue","selection","setSelection","start","end","invisible","setInvisible","theme","current","setSelectionRange","score","strength","name","color","inputPasswordColorPowerful","inputPasswordColorStrong","inputPasswordColorGood","inputPasswordColorWeak","focus","showLabel","hideLabel","e","selectionStart","selectionEnd","currentTarget","progressColorStroke","progressColorStrokeSuccess","undefined","displayName"],"sources":["../../../src/InputPassword/index.tsx"],"sourcesContent":["import React, { forwardRef, useEffect, useMemo, useState } from 'react';\nimport { Eye, EyeInvisible } from '@os-design/icons';\nimport { ThemeOverrider, useTheme } from '@os-design/theming';\nimport { useForwardedRef, useForwardedState } from '@os-design/utils';\nimport getPasswordScore from '@os-team/password-score';\nimport styled from '@emotion/styled';\nimport Input, { InputProps } from '../Input';\nimport Button from '../Button';\nimport Progress from '../Progress';\nimport defaultLocale, { InputPasswordLocale } from './utils/defaultLocale';\n\nexport interface InputPasswordProps extends Omit<InputProps, 'type'> {\n /**\n * Whether the password strength meter is visible.\n * @default false\n */\n showStrengthMeter?: boolean;\n /**\n * The name of a weak, good, strong, and powerful password.\n * Located to the right of the password strength meter.\n * @default undefined\n */\n strengthNames?: Record<'weak' | 'good' | 'strong' | 'powerful', string>;\n /**\n * From what number of score the password is considered\n * good, strong, and powerful.\n * @default [30, 60, 80]\n */\n strengthThresholds?: [number, number, number];\n /**\n * The locale.\n * @default undefined\n */\n locale?: InputPasswordLocale;\n /**\n * The input value.\n * @default undefined\n */\n value?: string;\n /**\n * The default value.\n * @default undefined\n */\n defaultValue?: string;\n /**\n * The change event handler.\n * @default undefined\n */\n onChange?: (value: string) => void;\n}\n\ninterface Selection {\n start: number;\n end: number;\n}\n\nconst StrengthMeterProgress = styled(Progress)`\n margin-top: 0.4em;\n`;\n\n/**\n * The input for entering a password.\n */\nconst InputPassword = forwardRef<HTMLInputElement, InputPasswordProps>(\n (\n {\n showStrengthMeter = false,\n strengthNames,\n strengthThresholds = [30, 60, 80],\n locale = defaultLocale,\n value,\n defaultValue,\n onChange = () => {},\n onSelect = () => {},\n disabled,\n right,\n ...rest\n },\n ref\n ) => {\n const [inputRef, mergedInputRef] = useForwardedRef(ref);\n const [forwardedValue, setForwardedValue] = useForwardedState({\n value,\n defaultValue,\n onChange,\n });\n const [selection, setSelection] = useState<Selection>({ start: 0, end: 0 });\n const [invisible, setInvisible] = useState(true);\n const { theme } = useTheme();\n\n // Update the selection of the input when changing the invisible flag\n useEffect(() => {\n if (!inputRef.current) return;\n inputRef.current.setSelectionRange(selection.start, selection.end);\n }, [inputRef, selection, invisible]);\n\n const score = useMemo(\n () => getPasswordScore(forwardedValue || ''),\n [forwardedValue]\n );\n\n const strength = useMemo(() => {\n if (score >= strengthThresholds[2]) {\n return {\n name: 'powerful',\n color: theme.inputPasswordColorPowerful,\n };\n }\n if (score >= strengthThresholds[1]) {\n return {\n name: 'strong',\n color: theme.inputPasswordColorStrong,\n };\n }\n if (score >= strengthThresholds[0]) {\n return {\n name: 'good',\n color: theme.inputPasswordColorGood,\n };\n }\n return {\n name: 'weak',\n color: theme.inputPasswordColorWeak,\n };\n }, [\n score,\n strengthThresholds,\n theme.inputPasswordColorPowerful,\n theme.inputPasswordColorStrong,\n theme.inputPasswordColorGood,\n theme.inputPasswordColorWeak,\n ]);\n\n return (\n <>\n <Input\n type={invisible ? 'password' : 'text'}\n right={\n <>\n <Button\n key='invisible-button'\n type='ghost'\n wide='never'\n size='small'\n disabled={disabled}\n onClick={() => {\n setInvisible(!invisible);\n if (!inputRef.current) return;\n inputRef.current.focus();\n }}\n aria-label={invisible ? locale.showLabel : locale.hideLabel}\n >\n {invisible ? <EyeInvisible /> : <Eye />}\n </Button>\n {right}\n </>\n }\n value={forwardedValue}\n onChange={setForwardedValue}\n onSelect={(e) => {\n // Update the selection state\n const { selectionStart, selectionEnd } = e.currentTarget;\n setSelection({\n start: selectionStart || 0,\n end: selectionEnd || 0,\n });\n onSelect(e);\n }}\n disabled={disabled}\n {...rest}\n ref={mergedInputRef}\n />\n {showStrengthMeter && (\n <ThemeOverrider\n overrides={{\n progressColorStroke: strength.color,\n get progressColorStrokeSuccess() {\n // eslint-disable-next-line react/no-this-in-sfc\n return this.progressColorStroke;\n },\n }}\n >\n <StrengthMeterProgress\n size='small'\n height='0.25em'\n percent={score}\n text={strengthNames ? strengthNames[strength.name] : undefined}\n />\n </ThemeOverrider>\n )}\n </>\n );\n }\n);\n\nInputPassword.displayName = 'InputPassword';\n\nexport default InputPassword;\n"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultLocale.js","names":["defaultLocale","showLabel","hideLabel"],"sources":["../../../../src/InputPassword/utils/defaultLocale.ts"],"sourcesContent":["export interface InputPasswordLocale {\n showLabel: string;\n hideLabel: string;\n}\n\nconst defaultLocale: InputPasswordLocale = {\n showLabel: 'Show password',\n hideLabel: 'Hide password',\n};\n\nexport default defaultLocale;\n"],"mappings":"AAKA,MAAMA,aAAkC,GAAG;EACzCC,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"defaultLocale.js","names":["defaultLocale","showLabel","hideLabel"],"sources":["../../../../src/InputPassword/utils/defaultLocale.ts"],"sourcesContent":["export interface InputPasswordLocale {\n showLabel: string;\n hideLabel: string;\n}\n\nconst defaultLocale: InputPasswordLocale = {\n showLabel: 'Show password',\n hideLabel: 'Hide password',\n};\n\nexport default defaultLocale;\n"],"mappings":"AAKA,MAAMA,aAAkC,GAAG;EACzCC,SAAS,EAAE,eAAe;EAC1BC,SAAS,EAAE;AACb,CAAC;AAED,eAAeF,aAAa"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
2
|
import React, { forwardRef } from 'react';
|
|
4
3
|
import { Search, CloseCircle } from '@os-design/icons';
|
|
5
4
|
import styled from '@emotion/styled';
|
|
@@ -16,10 +15,10 @@ const fadeIn = keyframes`
|
|
|
16
15
|
const ClearButton = styled(Button)`
|
|
17
16
|
animation: ${fadeIn} ${p => p.theme.transitionDelay}ms;
|
|
18
17
|
`;
|
|
18
|
+
|
|
19
19
|
/**
|
|
20
20
|
* The search input.
|
|
21
21
|
*/
|
|
22
|
-
|
|
23
22
|
const InputSearch = /*#__PURE__*/forwardRef(({
|
|
24
23
|
locale = defaultLocale,
|
|
25
24
|
value,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","forwardRef","Search","CloseCircle","styled","keyframes","useForwardedRef","useForwardedState","ThemeOverrider","Input","Button","defaultLocale","fadeIn","ClearButton","p","theme","transitionDelay","InputSearch","locale","value","defaultValue","onChange","disabled","left","leftHasPadding","right","rest","ref","inputRef","mergedInputRef","forwardedValue","setForwardedValue","buttonIconScaleFactor","current","focus","clearLabel","displayName"],"sources":["../../../src/InputSearch/index.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { Search, CloseCircle } from '@os-design/icons';\nimport styled from '@emotion/styled';\nimport { keyframes } from '@emotion/react';\nimport { useForwardedRef, useForwardedState } from '@os-design/utils';\nimport { ThemeOverrider } from '@os-design/theming';\nimport Input, { InputProps } from '../Input';\nimport Button from '../Button';\nimport defaultLocale, { InputSearchLocale } from './utils/defaultLocale';\n\nexport interface InputSearchProps\n extends Omit<InputProps, 'type' | 'onChange'> {\n /**\n * The locale.\n * @default undefined\n */\n locale?: InputSearchLocale;\n /**\n * The input value.\n * @default undefined\n */\n value?: string;\n /**\n * The default value.\n * @default undefined\n */\n defaultValue?: string;\n /**\n * The change event handler.\n * @default undefined\n */\n onChange?: (value: string) => void;\n}\n\nconst fadeIn = keyframes`\n from { opacity: 0; }\n to { opacity: 1; }\n`;\n\nconst ClearButton = styled(Button)`\n animation: ${fadeIn} ${(p) => p.theme.transitionDelay}ms;\n`;\n\n/**\n * The search input.\n */\nconst InputSearch = forwardRef<HTMLInputElement, InputSearchProps>(\n (\n {\n locale = defaultLocale,\n value,\n defaultValue,\n onChange = () => {},\n disabled,\n left,\n leftHasPadding = true,\n right,\n ...rest\n },\n ref\n ) => {\n const [inputRef, mergedInputRef] = useForwardedRef(ref);\n const [forwardedValue, setForwardedValue] = useForwardedState({\n value,\n defaultValue,\n onChange,\n });\n\n return (\n <Input\n type='text'\n left={\n <>\n <Search key='search-icon' />\n {left}\n </>\n }\n leftHasPadding={leftHasPadding}\n right={\n <>\n {!!forwardedValue && (\n <ThemeOverrider overrides={{ buttonIconScaleFactor: 1.2 }}>\n <ClearButton\n key='clear-button'\n type='ghost'\n wide='never'\n size='small'\n disabled={disabled}\n onClick={() => {\n setForwardedValue('');\n if (!inputRef.current) return;\n inputRef.current.focus();\n }}\n aria-label={locale.clearLabel}\n >\n <CloseCircle />\n </ClearButton>\n </ThemeOverrider>\n )}\n {right}\n </>\n }\n value={forwardedValue}\n onChange={setForwardedValue}\n role='searchbox'\n disabled={disabled}\n {...rest}\n ref={mergedInputRef}\n />\n );\n }\n);\n\nInputSearch.displayName = 'InputSearch';\n\nexport default InputSearch;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","forwardRef","Search","CloseCircle","styled","keyframes","useForwardedRef","useForwardedState","ThemeOverrider","Input","Button","defaultLocale","fadeIn","ClearButton","p","theme","transitionDelay","InputSearch","locale","value","defaultValue","onChange","disabled","left","leftHasPadding","right","rest","ref","inputRef","mergedInputRef","forwardedValue","setForwardedValue","buttonIconScaleFactor","current","focus","clearLabel","displayName"],"sources":["../../../src/InputSearch/index.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { Search, CloseCircle } from '@os-design/icons';\nimport styled from '@emotion/styled';\nimport { keyframes } from '@emotion/react';\nimport { useForwardedRef, useForwardedState } from '@os-design/utils';\nimport { ThemeOverrider } from '@os-design/theming';\nimport Input, { InputProps } from '../Input';\nimport Button from '../Button';\nimport defaultLocale, { InputSearchLocale } from './utils/defaultLocale';\n\nexport interface InputSearchProps\n extends Omit<InputProps, 'type' | 'onChange'> {\n /**\n * The locale.\n * @default undefined\n */\n locale?: InputSearchLocale;\n /**\n * The input value.\n * @default undefined\n */\n value?: string;\n /**\n * The default value.\n * @default undefined\n */\n defaultValue?: string;\n /**\n * The change event handler.\n * @default undefined\n */\n onChange?: (value: string) => void;\n}\n\nconst fadeIn = keyframes`\n from { opacity: 0; }\n to { opacity: 1; }\n`;\n\nconst ClearButton = styled(Button)`\n animation: ${fadeIn} ${(p) => p.theme.transitionDelay}ms;\n`;\n\n/**\n * The search input.\n */\nconst InputSearch = forwardRef<HTMLInputElement, InputSearchProps>(\n (\n {\n locale = defaultLocale,\n value,\n defaultValue,\n onChange = () => {},\n disabled,\n left,\n leftHasPadding = true,\n right,\n ...rest\n },\n ref\n ) => {\n const [inputRef, mergedInputRef] = useForwardedRef(ref);\n const [forwardedValue, setForwardedValue] = useForwardedState({\n value,\n defaultValue,\n onChange,\n });\n\n return (\n <Input\n type='text'\n left={\n <>\n <Search key='search-icon' />\n {left}\n </>\n }\n leftHasPadding={leftHasPadding}\n right={\n <>\n {!!forwardedValue && (\n <ThemeOverrider overrides={{ buttonIconScaleFactor: 1.2 }}>\n <ClearButton\n key='clear-button'\n type='ghost'\n wide='never'\n size='small'\n disabled={disabled}\n onClick={() => {\n setForwardedValue('');\n if (!inputRef.current) return;\n inputRef.current.focus();\n }}\n aria-label={locale.clearLabel}\n >\n <CloseCircle />\n </ClearButton>\n </ThemeOverrider>\n )}\n {right}\n </>\n }\n value={forwardedValue}\n onChange={setForwardedValue}\n role='searchbox'\n disabled={disabled}\n {...rest}\n ref={mergedInputRef}\n />\n );\n }\n);\n\nInputSearch.displayName = 'InputSearch';\n\nexport default InputSearch;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAASC,MAAM,EAAEC,WAAW,QAAQ,kBAAkB;AACtD,OAAOC,MAAM,MAAM,iBAAiB;AACpC,SAASC,SAAS,QAAQ,gBAAgB;AAC1C,SAASC,eAAe,EAAEC,iBAAiB,QAAQ,kBAAkB;AACrE,SAASC,cAAc,QAAQ,oBAAoB;AACnD,OAAOC,KAAK,MAAsB,UAAU;AAC5C,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,aAAa,MAA6B,uBAAuB;AA0BxE,MAAMC,MAAM,GAAGP,SAAU;AACzB;AACA;AACA,CAAC;AAED,MAAMQ,WAAW,GAAGT,MAAM,CAACM,MAAM,CAAE;AACnC,eAAeE,MAAO,IAAIE,CAAC,IAAKA,CAAC,CAACC,KAAK,CAACC,eAAgB;AACxD,CAAC;;AAED;AACA;AACA;AACA,MAAMC,WAAW,gBAAGhB,UAAU,CAC5B,CACE;EACEiB,MAAM,GAAGP,aAAa;EACtBQ,KAAK;EACLC,YAAY;EACZC,QAAQ,GAAG,MAAM,CAAC,CAAC;EACnBC,QAAQ;EACRC,IAAI;EACJC,cAAc,GAAG,IAAI;EACrBC,KAAK;EACL,GAAGC;AACL,CAAC,EACDC,GAAG,KACA;EACH,MAAM,CAACC,QAAQ,EAAEC,cAAc,CAAC,GAAGvB,eAAe,CAACqB,GAAG,CAAC;EACvD,MAAM,CAACG,cAAc,EAAEC,iBAAiB,CAAC,GAAGxB,iBAAiB,CAAC;IAC5DY,KAAK;IACLC,YAAY;IACZC;EACF,CAAC,CAAC;EAEF,oBACE,oBAAC,KAAK;IACJ,IAAI,EAAC,MAAM;IACX,IAAI,eACF,uDACE,oBAAC,MAAM;MAAC,GAAG,EAAC;IAAa,EAAG,EAC3BE,IAAI,CAER;IACD,cAAc,EAAEC,cAAe;IAC/B,KAAK,eACH,0CACG,CAAC,CAACM,cAAc,iBACf,oBAAC,cAAc;MAAC,SAAS,EAAE;QAAEE,qBAAqB,EAAE;MAAI;IAAE,gBACxD,oBAAC,WAAW;MACV,GAAG,EAAC,cAAc;MAClB,IAAI,EAAC,OAAO;MACZ,IAAI,EAAC,OAAO;MACZ,IAAI,EAAC,OAAO;MACZ,QAAQ,EAAEV,QAAS;MACnB,OAAO,EAAE,MAAM;QACbS,iBAAiB,CAAC,EAAE,CAAC;QACrB,IAAI,CAACH,QAAQ,CAACK,OAAO,EAAE;QACvBL,QAAQ,CAACK,OAAO,CAACC,KAAK,EAAE;MAC1B,CAAE;MACF,cAAYhB,MAAM,CAACiB;IAAW,gBAE9B,oBAAC,WAAW,OAAG,CACH,CAEjB,EACAV,KAAK,CAET;IACD,KAAK,EAAEK,cAAe;IACtB,QAAQ,EAAEC,iBAAkB;IAC5B,IAAI,EAAC,WAAW;IAChB,QAAQ,EAAET;EAAS,GACfI,IAAI;IACR,GAAG,EAAEG;EAAe,GACpB;AAEN,CAAC,CACF;AAEDZ,WAAW,CAACmB,WAAW,GAAG,aAAa;AAEvC,eAAenB,WAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultLocale.js","names":["defaultLocale","clearLabel"],"sources":["../../../../src/InputSearch/utils/defaultLocale.ts"],"sourcesContent":["export interface InputSearchLocale {\n clearLabel: string;\n}\n\nconst defaultLocale: InputSearchLocale = {\n clearLabel: 'Clear',\n};\n\nexport default defaultLocale;\n"],"mappings":"AAIA,MAAMA,aAAgC,GAAG;EACvCC,UAAU,EAAE;
|
|
1
|
+
{"version":3,"file":"defaultLocale.js","names":["defaultLocale","clearLabel"],"sources":["../../../../src/InputSearch/utils/defaultLocale.ts"],"sourcesContent":["export interface InputSearchLocale {\n clearLabel: string;\n}\n\nconst defaultLocale: InputSearchLocale = {\n clearLabel: 'Clear',\n};\n\nexport default defaultLocale;\n"],"mappings":"AAIA,MAAMA,aAAgC,GAAG;EACvCC,UAAU,EAAE;AACd,CAAC;AAED,eAAeD,aAAa"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
2
|
import styled from '@emotion/styled';
|
|
4
3
|
import React, { forwardRef } from 'react';
|
|
5
4
|
import { sizeStyles } from '@os-design/styles';
|
|
@@ -9,10 +8,10 @@ const StyledInputSkeleton = styled(Skeleton, omitEmotionProps('size'))`
|
|
|
9
8
|
height: ${p => p.theme.baseHeight}em;
|
|
10
9
|
${sizeStyles};
|
|
11
10
|
`;
|
|
11
|
+
|
|
12
12
|
/**
|
|
13
13
|
* Provides an input placeholder while a user waits for the content to load.
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
15
|
const InputSkeleton = /*#__PURE__*/forwardRef((props, ref) => /*#__PURE__*/React.createElement(StyledInputSkeleton, _extends({
|
|
17
16
|
width: "100%"
|
|
18
17
|
}, props, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["styled","React","forwardRef","sizeStyles","omitEmotionProps","Skeleton","StyledInputSkeleton","p","theme","baseHeight","InputSkeleton","props","ref","displayName"],"sources":["../../../src/InputSkeleton/index.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport React, { forwardRef } from 'react';\nimport { sizeStyles, WithSize } from '@os-design/styles';\nimport { omitEmotionProps } from '@os-design/utils';\nimport Skeleton, { SkeletonProps } from '../Skeleton';\n\nexport type InputSkeletonProps = Omit<SkeletonProps, 'width'> & WithSize;\n\nconst StyledInputSkeleton = styled(\n Skeleton,\n omitEmotionProps('size')\n)<WithSize>`\n height: ${(p) => p.theme.baseHeight}em;\n ${sizeStyles};\n`;\n\n/**\n * Provides an input placeholder while a user waits for the content to load.\n */\nconst InputSkeleton = forwardRef<HTMLDivElement, InputSkeletonProps>(\n (props, ref) => <StyledInputSkeleton width='100%' {...props} ref={ref} />\n);\n\nInputSkeleton.displayName = 'InputSkeleton';\n\nexport default InputSkeleton;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["styled","React","forwardRef","sizeStyles","omitEmotionProps","Skeleton","StyledInputSkeleton","p","theme","baseHeight","InputSkeleton","props","ref","displayName"],"sources":["../../../src/InputSkeleton/index.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport React, { forwardRef } from 'react';\nimport { sizeStyles, WithSize } from '@os-design/styles';\nimport { omitEmotionProps } from '@os-design/utils';\nimport Skeleton, { SkeletonProps } from '../Skeleton';\n\nexport type InputSkeletonProps = Omit<SkeletonProps, 'width'> & WithSize;\n\nconst StyledInputSkeleton = styled(\n Skeleton,\n omitEmotionProps('size')\n)<WithSize>`\n height: ${(p) => p.theme.baseHeight}em;\n ${sizeStyles};\n`;\n\n/**\n * Provides an input placeholder while a user waits for the content to load.\n */\nconst InputSkeleton = forwardRef<HTMLDivElement, InputSkeletonProps>(\n (props, ref) => <StyledInputSkeleton width='100%' {...props} ref={ref} />\n);\n\nInputSkeleton.displayName = 'InputSkeleton';\n\nexport default InputSkeleton;\n"],"mappings":";AAAA,OAAOA,MAAM,MAAM,iBAAiB;AACpC,OAAOC,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAASC,UAAU,QAAkB,mBAAmB;AACxD,SAASC,gBAAgB,QAAQ,kBAAkB;AACnD,OAAOC,QAAQ,MAAyB,aAAa;AAIrD,MAAMC,mBAAmB,GAAGN,MAAM,CAChCK,QAAQ,EACRD,gBAAgB,CAAC,MAAM,CAAC,CACd;AACZ,YAAaG,CAAC,IAAKA,CAAC,CAACC,KAAK,CAACC,UAAW;AACtC,IAAIN,UAAW;AACf,CAAC;;AAED;AACA;AACA;AACA,MAAMO,aAAa,gBAAGR,UAAU,CAC9B,CAACS,KAAK,EAAEC,GAAG,kBAAK,oBAAC,mBAAmB;EAAC,KAAK,EAAC;AAAM,GAAKD,KAAK;EAAE,GAAG,EAAEC;AAAI,GAAG,CAC1E;AAEDF,aAAa,CAACG,WAAW,GAAG,eAAe;AAE3C,eAAeH,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutContext.js","names":["React","LayoutContext","createContext","hasNavigation","hasPageHeader","displayName"],"sources":["../../../src/Layout/LayoutContext.ts"],"sourcesContent":["import React from 'react';\n\nexport interface LayoutContextProps {\n /**\n * Whether there is the navigation in the layout.\n */\n hasNavigation: boolean;\n /**\n * Whether there is the page header in the layout.\n */\n hasPageHeader: boolean;\n}\n\nconst LayoutContext = React.createContext<LayoutContextProps>({\n hasNavigation: false,\n hasPageHeader: false,\n});\n\nLayoutContext.displayName = 'LayoutContext';\n\nexport default LayoutContext;\n"],"mappings":"AAAA,OAAOA,
|
|
1
|
+
{"version":3,"file":"LayoutContext.js","names":["React","LayoutContext","createContext","hasNavigation","hasPageHeader","displayName"],"sources":["../../../src/Layout/LayoutContext.ts"],"sourcesContent":["import React from 'react';\n\nexport interface LayoutContextProps {\n /**\n * Whether there is the navigation in the layout.\n */\n hasNavigation: boolean;\n /**\n * Whether there is the page header in the layout.\n */\n hasPageHeader: boolean;\n}\n\nconst LayoutContext = React.createContext<LayoutContextProps>({\n hasNavigation: false,\n hasPageHeader: false,\n});\n\nLayoutContext.displayName = 'LayoutContext';\n\nexport default LayoutContext;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAazB,MAAMC,aAAa,gBAAGD,KAAK,CAACE,aAAa,CAAqB;EAC5DC,aAAa,EAAE,KAAK;EACpBC,aAAa,EAAE;AACjB,CAAC,CAAC;AAEFH,aAAa,CAACI,WAAW,GAAG,eAAe;AAE3C,eAAeJ,aAAa"}
|
package/dist/esm/Layout/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import LayoutContext from './LayoutContext';
|
|
3
|
-
|
|
4
3
|
/**
|
|
5
4
|
* The layout of the page.
|
|
6
5
|
*/
|
|
@@ -17,7 +16,6 @@ const Layout = ({
|
|
|
17
16
|
value: contextValue
|
|
18
17
|
}, children);
|
|
19
18
|
};
|
|
20
|
-
|
|
21
19
|
Layout.displayName = 'Layout';
|
|
22
20
|
export default Layout;
|
|
23
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","LayoutContext","Layout","hasNavigation","hasPageHeader","children","contextValue","displayName"],"sources":["../../../src/Layout/index.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport LayoutContext from './LayoutContext';\n\nexport interface LayoutProps {\n /**\n * Whether there is the navigation in the layout.\n * @default false\n */\n hasNavigation?: boolean;\n /**\n * Whether there is the page header in the layout.\n * @default false\n */\n hasPageHeader?: boolean;\n /**\n * The children.\n * @default undefined\n */\n children?: React.ReactNode;\n}\n\n/**\n * The layout of the page.\n */\nconst Layout: React.FC<LayoutProps> = ({\n hasNavigation = false,\n hasPageHeader = false,\n children,\n}) => {\n const contextValue = useMemo(\n () => ({ hasNavigation, hasPageHeader }),\n [hasNavigation, hasPageHeader]\n );\n\n return (\n <LayoutContext.Provider value={contextValue}>\n {children}\n </LayoutContext.Provider>\n );\n};\n\nLayout.displayName = 'Layout';\n\nexport default Layout;\n"],"mappings":"AAAA,OAAOA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","LayoutContext","Layout","hasNavigation","hasPageHeader","children","contextValue","displayName"],"sources":["../../../src/Layout/index.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport LayoutContext from './LayoutContext';\n\nexport interface LayoutProps {\n /**\n * Whether there is the navigation in the layout.\n * @default false\n */\n hasNavigation?: boolean;\n /**\n * Whether there is the page header in the layout.\n * @default false\n */\n hasPageHeader?: boolean;\n /**\n * The children.\n * @default undefined\n */\n children?: React.ReactNode;\n}\n\n/**\n * The layout of the page.\n */\nconst Layout: React.FC<LayoutProps> = ({\n hasNavigation = false,\n hasPageHeader = false,\n children,\n}) => {\n const contextValue = useMemo(\n () => ({ hasNavigation, hasPageHeader }),\n [hasNavigation, hasPageHeader]\n );\n\n return (\n <LayoutContext.Provider value={contextValue}>\n {children}\n </LayoutContext.Provider>\n );\n};\n\nLayout.displayName = 'Layout';\n\nexport default Layout;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,OAAOC,aAAa,MAAM,iBAAiB;AAoB3C;AACA;AACA;AACA,MAAMC,MAA6B,GAAG,CAAC;EACrCC,aAAa,GAAG,KAAK;EACrBC,aAAa,GAAG,KAAK;EACrBC;AACF,CAAC,KAAK;EACJ,MAAMC,YAAY,GAAGN,OAAO,CAC1B,OAAO;IAAEG,aAAa;IAAEC;EAAc,CAAC,CAAC,EACxC,CAACD,aAAa,EAAEC,aAAa,CAAC,CAC/B;EAED,oBACE,oBAAC,aAAa,CAAC,QAAQ;IAAC,KAAK,EAAEE;EAAa,GACzCD,QAAQ,CACc;AAE7B,CAAC;AAEDH,MAAM,CAACK,WAAW,GAAG,QAAQ;AAE7B,eAAeL,MAAM"}
|
package/dist/esm/Link/index.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
2
|
import styled from '@emotion/styled';
|
|
4
3
|
import React, { forwardRef } from 'react';
|
|
5
4
|
import { css } from '@emotion/react';
|
|
6
5
|
import { resetFocusStyles, sizeStyles, transitionStyles } from '@os-design/styles';
|
|
7
6
|
import { omitEmotionProps } from '@os-design/utils';
|
|
8
7
|
import { clr } from '@os-design/theming';
|
|
9
|
-
|
|
10
8
|
/**
|
|
11
9
|
* Sets base underline styles.
|
|
12
10
|
*/
|
|
@@ -24,11 +22,10 @@ const underlineBaseStyles = p => css`
|
|
|
24
22
|
background-color: ${clr(p.theme.linkColor)};
|
|
25
23
|
}
|
|
26
24
|
`;
|
|
25
|
+
|
|
27
26
|
/**
|
|
28
27
|
* Sets underline styles on hover.
|
|
29
28
|
*/
|
|
30
|
-
|
|
31
|
-
|
|
32
29
|
const underlineHoverStyles = p => p.underline === 'hover' && css`
|
|
33
30
|
@media (hover: hover) {
|
|
34
31
|
${underlineBaseStyles(p)};
|
|
@@ -46,11 +43,10 @@ const underlineHoverStyles = p => p.underline === 'hover' && css`
|
|
|
46
43
|
}
|
|
47
44
|
}
|
|
48
45
|
`;
|
|
46
|
+
|
|
49
47
|
/**
|
|
50
48
|
* Sets underline styles always.
|
|
51
49
|
*/
|
|
52
|
-
|
|
53
|
-
|
|
54
50
|
const underlineAlwaysStyles = p => p.underline === 'always' && css`
|
|
55
51
|
${underlineBaseStyles(p)};
|
|
56
52
|
|
|
@@ -59,7 +55,6 @@ const underlineAlwaysStyles = p => p.underline === 'always' && css`
|
|
|
59
55
|
opacity: 1;
|
|
60
56
|
}
|
|
61
57
|
`;
|
|
62
|
-
|
|
63
58
|
const StyledLink = styled('a', omitEmotionProps('size', 'underline', 'as'))`
|
|
64
59
|
${resetFocusStyles};
|
|
65
60
|
|
|
@@ -77,10 +72,10 @@ const StyledLink = styled('a', omitEmotionProps('size', 'underline', 'as'))`
|
|
|
77
72
|
${underlineAlwaysStyles};
|
|
78
73
|
${sizeStyles};
|
|
79
74
|
`;
|
|
75
|
+
|
|
80
76
|
/**
|
|
81
77
|
* The link component to navigate between pages.
|
|
82
78
|
*/
|
|
83
|
-
|
|
84
79
|
const Link = /*#__PURE__*/forwardRef(({
|
|
85
80
|
underline = 'hover',
|
|
86
81
|
as,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["styled","React","forwardRef","css","resetFocusStyles","sizeStyles","transitionStyles","omitEmotionProps","clr","underlineBaseStyles","p","theme","linkColor","underlineHoverStyles","underline","underlineAlwaysStyles","StyledLink","Link","as","onMouseDown","rest","ref","e","preventDefault","displayName"],"sources":["../../../src/Link/index.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport React, { forwardRef } from 'react';\nimport { css } from '@emotion/react';\nimport {\n resetFocusStyles,\n sizeStyles,\n transitionStyles,\n WithSize,\n} from '@os-design/styles';\nimport { omitEmotionProps } from '@os-design/utils';\nimport { clr } from '@os-design/theming';\n\nexport interface ReactRouterLinkProps {\n to?: string;\n replace?: boolean;\n}\n\ntype JsxAProps = Omit<JSX.IntrinsicElements['a'], 'ref'>;\nexport interface LinkProps extends JsxAProps, ReactRouterLinkProps, WithSize {\n /**\n * Type of the underline styles.\n * @default hover\n */\n underline?: 'hover' | 'always' | 'never';\n /**\n * The custom link component.\n * For example, the Link from react-router-dom.\n * @default undefined\n */\n as?: React.ElementType;\n}\n\n/**\n * Sets base underline styles.\n */\nconst underlineBaseStyles = (p) => css`\n position: relative;\n display: inline-block;\n padding-bottom: 0.1em;\n\n &::after {\n position: absolute;\n bottom: 0;\n left: 0;\n content: '';\n height: 0.125em;\n background-color: ${clr(p.theme.linkColor)};\n }\n`;\n\n/**\n * Sets underline styles on hover.\n */\nconst underlineHoverStyles = (p) =>\n p.underline === 'hover' &&\n css`\n @media (hover: hover) {\n ${underlineBaseStyles(p)};\n\n &::after {\n width: 0;\n opacity: 0;\n ${transitionStyles('width', 'opacity')(p)};\n }\n\n &:hover::after,\n &:focus::after {\n width: 100%;\n opacity: 1;\n }\n }\n `;\n\n/**\n * Sets underline styles always.\n */\nconst underlineAlwaysStyles = (p) =>\n p.underline === 'always' &&\n css`\n ${underlineBaseStyles(p)};\n\n &::after {\n width: 100%;\n opacity: 1;\n }\n `;\n\nconst StyledLink = styled(\n 'a',\n omitEmotionProps('size', 'underline', 'as')\n)<LinkProps>`\n ${resetFocusStyles};\n\n cursor: pointer;\n text-decoration: none;\n line-height: 1.2;\n\n &,\n &:active,\n &:focus {\n color: ${(p) => clr(p.theme.linkColor)};\n }\n\n ${underlineHoverStyles};\n ${underlineAlwaysStyles};\n ${sizeStyles};\n`;\n\n/**\n * The link component to navigate between pages.\n */\nconst Link = forwardRef<HTMLAnchorElement, LinkProps>(\n ({ underline = 'hover', as, onMouseDown = () => {}, ...rest }, ref) => (\n <StyledLink\n underline={underline}\n as={as}\n onMouseDown={(e) => {\n onMouseDown(e);\n e.preventDefault();\n }}\n {...rest}\n ref={ref}\n />\n )\n);\n\nLink.displayName = 'Link';\n\nexport default Link;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["styled","React","forwardRef","css","resetFocusStyles","sizeStyles","transitionStyles","omitEmotionProps","clr","underlineBaseStyles","p","theme","linkColor","underlineHoverStyles","underline","underlineAlwaysStyles","StyledLink","Link","as","onMouseDown","rest","ref","e","preventDefault","displayName"],"sources":["../../../src/Link/index.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport React, { forwardRef } from 'react';\nimport { css } from '@emotion/react';\nimport {\n resetFocusStyles,\n sizeStyles,\n transitionStyles,\n WithSize,\n} from '@os-design/styles';\nimport { omitEmotionProps } from '@os-design/utils';\nimport { clr } from '@os-design/theming';\n\nexport interface ReactRouterLinkProps {\n to?: string;\n replace?: boolean;\n}\n\ntype JsxAProps = Omit<JSX.IntrinsicElements['a'], 'ref'>;\nexport interface LinkProps extends JsxAProps, ReactRouterLinkProps, WithSize {\n /**\n * Type of the underline styles.\n * @default hover\n */\n underline?: 'hover' | 'always' | 'never';\n /**\n * The custom link component.\n * For example, the Link from react-router-dom.\n * @default undefined\n */\n as?: React.ElementType;\n}\n\n/**\n * Sets base underline styles.\n */\nconst underlineBaseStyles = (p) => css`\n position: relative;\n display: inline-block;\n padding-bottom: 0.1em;\n\n &::after {\n position: absolute;\n bottom: 0;\n left: 0;\n content: '';\n height: 0.125em;\n background-color: ${clr(p.theme.linkColor)};\n }\n`;\n\n/**\n * Sets underline styles on hover.\n */\nconst underlineHoverStyles = (p) =>\n p.underline === 'hover' &&\n css`\n @media (hover: hover) {\n ${underlineBaseStyles(p)};\n\n &::after {\n width: 0;\n opacity: 0;\n ${transitionStyles('width', 'opacity')(p)};\n }\n\n &:hover::after,\n &:focus::after {\n width: 100%;\n opacity: 1;\n }\n }\n `;\n\n/**\n * Sets underline styles always.\n */\nconst underlineAlwaysStyles = (p) =>\n p.underline === 'always' &&\n css`\n ${underlineBaseStyles(p)};\n\n &::after {\n width: 100%;\n opacity: 1;\n }\n `;\n\nconst StyledLink = styled(\n 'a',\n omitEmotionProps('size', 'underline', 'as')\n)<LinkProps>`\n ${resetFocusStyles};\n\n cursor: pointer;\n text-decoration: none;\n line-height: 1.2;\n\n &,\n &:active,\n &:focus {\n color: ${(p) => clr(p.theme.linkColor)};\n }\n\n ${underlineHoverStyles};\n ${underlineAlwaysStyles};\n ${sizeStyles};\n`;\n\n/**\n * The link component to navigate between pages.\n */\nconst Link = forwardRef<HTMLAnchorElement, LinkProps>(\n ({ underline = 'hover', as, onMouseDown = () => {}, ...rest }, ref) => (\n <StyledLink\n underline={underline}\n as={as}\n onMouseDown={(e) => {\n onMouseDown(e);\n e.preventDefault();\n }}\n {...rest}\n ref={ref}\n />\n )\n);\n\nLink.displayName = 'Link';\n\nexport default Link;\n"],"mappings":";AAAA,OAAOA,MAAM,MAAM,iBAAiB;AACpC,OAAOC,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAASC,GAAG,QAAQ,gBAAgB;AACpC,SACEC,gBAAgB,EAChBC,UAAU,EACVC,gBAAgB,QAEX,mBAAmB;AAC1B,SAASC,gBAAgB,QAAQ,kBAAkB;AACnD,SAASC,GAAG,QAAQ,oBAAoB;AAsBxC;AACA;AACA;AACA,MAAMC,mBAAmB,GAAIC,CAAC,IAAKP,GAAI;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwBK,GAAG,CAACE,CAAC,CAACC,KAAK,CAACC,SAAS,CAAE;AAC/C;AACA,CAAC;;AAED;AACA;AACA;AACA,MAAMC,oBAAoB,GAAIH,CAAC,IAC7BA,CAAC,CAACI,SAAS,KAAK,OAAO,IACvBX,GAAI;AACN;AACA,QAAQM,mBAAmB,CAACC,CAAC,CAAE;AAC/B;AACA;AACA;AACA;AACA,UAAUJ,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC,CAACI,CAAC,CAAE;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,MAAMK,qBAAqB,GAAIL,CAAC,IAC9BA,CAAC,CAACI,SAAS,KAAK,QAAQ,IACxBX,GAAI;AACN,MAAMM,mBAAmB,CAACC,CAAC,CAAE;AAC7B;AACA;AACA;AACA;AACA;AACA,GAAG;AAEH,MAAMM,UAAU,GAAGhB,MAAM,CACvB,GAAG,EACHO,gBAAgB,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,CAAC,CAChC;AACb,IAAIH,gBAAiB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAcM,CAAC,IAAKF,GAAG,CAACE,CAAC,CAACC,KAAK,CAACC,SAAS,CAAE;AAC3C;AACA;AACA,IAAIC,oBAAqB;AACzB,IAAIE,qBAAsB;AAC1B,IAAIV,UAAW;AACf,CAAC;;AAED;AACA;AACA;AACA,MAAMY,IAAI,gBAAGf,UAAU,CACrB,CAAC;EAAEY,SAAS,GAAG,OAAO;EAAEI,EAAE;EAAEC,WAAW,GAAG,MAAM,CAAC,CAAC;EAAE,GAAGC;AAAK,CAAC,EAAEC,GAAG,kBAChE,oBAAC,UAAU;EACT,SAAS,EAAEP,SAAU;EACrB,EAAE,EAAEI,EAAG;EACP,WAAW,EAAGI,CAAC,IAAK;IAClBH,WAAW,CAACG,CAAC,CAAC;IACdA,CAAC,CAACC,cAAc,EAAE;EACpB;AAAE,GACEH,IAAI;EACR,GAAG,EAAEC;AAAI,GAEZ,CACF;AAEDJ,IAAI,CAACO,WAAW,GAAG,MAAM;AAEzB,eAAeP,IAAI"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
2
|
import React, { forwardRef } from 'react';
|
|
4
3
|
import styled from '@emotion/styled';
|
|
5
4
|
import { omitEmotionProps } from '@os-design/utils';
|
|
@@ -7,20 +6,18 @@ import { css } from '@emotion/react';
|
|
|
7
6
|
import { StyledButton } from '../Button';
|
|
8
7
|
import useButtonColors from '../Button/utils/useButtonColors';
|
|
9
8
|
import ButtonContent from '../Button/ButtonContent';
|
|
10
|
-
|
|
11
9
|
const disabledStyles = p => p.disabled && css`
|
|
12
10
|
pointer-events: none;
|
|
13
11
|
`;
|
|
14
|
-
|
|
15
12
|
const StyledLinkButton = styled(StyledButton.withComponent('a'), omitEmotionProps('as', 'disabled'))`
|
|
16
13
|
text-decoration: none;
|
|
17
14
|
display: inline-flex;
|
|
18
15
|
${disabledStyles};
|
|
19
16
|
`;
|
|
17
|
+
|
|
20
18
|
/**
|
|
21
19
|
* The button that is rendered as the a tag.
|
|
22
20
|
*/
|
|
23
|
-
|
|
24
21
|
const LinkButton = /*#__PURE__*/forwardRef(({
|
|
25
22
|
type = 'primary',
|
|
26
23
|
danger = false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","forwardRef","styled","omitEmotionProps","css","StyledButton","useButtonColors","ButtonContent","disabledStyles","p","disabled","StyledLinkButton","withComponent","LinkButton","type","danger","left","right","wide","loading","size","as","onMouseDown","onKeyDown","children","rest","ref","buttonColors","loadingColors","e","preventDefault","displayName"],"sources":["../../../src/LinkButton/index.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport styled from '@emotion/styled';\nimport { omitEmotionProps } from '@os-design/utils';\nimport { css } from '@emotion/react';\nimport { ButtonProps, StyledButton } from '../Button';\nimport useButtonColors from '../Button/utils/useButtonColors';\nimport ButtonContent from '../Button/ButtonContent';\nimport { LinkProps, ReactRouterLinkProps } from '../Link';\n\ntype JsxAProps = Omit<JSX.IntrinsicElements['a'], 'type' | 'ref'>;\nexport type LinkButtonProps = JsxAProps &\n ReactRouterLinkProps &\n Pick<LinkProps, 'as'> &\n ButtonProps;\n\nconst disabledStyles = (p) =>\n p.disabled &&\n css`\n pointer-events: none;\n `;\n\nconst StyledLinkButton = styled(\n StyledButton.withComponent('a'),\n omitEmotionProps('as', 'disabled')\n)`\n text-decoration: none;\n display: inline-flex;\n ${disabledStyles};\n`;\n\n/**\n * The button that is rendered as the a tag.\n */\nconst LinkButton = forwardRef<HTMLAnchorElement, LinkButtonProps>(\n (\n {\n type = 'primary',\n danger = false,\n left,\n right,\n wide = 'default',\n loading = false,\n disabled = false,\n size,\n as,\n onMouseDown = () => {},\n onKeyDown = () => {},\n children,\n ...rest\n },\n ref\n ) => {\n const { buttonColors, loadingColors } = useButtonColors({\n type,\n danger,\n disabled,\n });\n\n return (\n <StyledLinkButton\n btnType={type}\n colors={buttonColors}\n wide={wide}\n loading={loading}\n disabled={disabled || loading}\n size={size}\n as={as}\n onMouseDown={(e) => {\n onMouseDown(e);\n e.preventDefault();\n }}\n onKeyDown={(e) => {\n onKeyDown(e);\n if (disabled || loading) e.preventDefault();\n }}\n aria-disabled={disabled || loading}\n aria-busy={loading}\n {...rest}\n ref={ref}\n >\n <ButtonContent\n left={left}\n right={right}\n loading={loading}\n loadingColors={loadingColors}\n >\n {children}\n </ButtonContent>\n </StyledLinkButton>\n );\n }\n);\n\nLinkButton.displayName = 'LinkButton';\n\nexport default LinkButton;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","forwardRef","styled","omitEmotionProps","css","StyledButton","useButtonColors","ButtonContent","disabledStyles","p","disabled","StyledLinkButton","withComponent","LinkButton","type","danger","left","right","wide","loading","size","as","onMouseDown","onKeyDown","children","rest","ref","buttonColors","loadingColors","e","preventDefault","displayName"],"sources":["../../../src/LinkButton/index.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport styled from '@emotion/styled';\nimport { omitEmotionProps } from '@os-design/utils';\nimport { css } from '@emotion/react';\nimport { ButtonProps, StyledButton } from '../Button';\nimport useButtonColors from '../Button/utils/useButtonColors';\nimport ButtonContent from '../Button/ButtonContent';\nimport { LinkProps, ReactRouterLinkProps } from '../Link';\n\ntype JsxAProps = Omit<JSX.IntrinsicElements['a'], 'type' | 'ref'>;\nexport type LinkButtonProps = JsxAProps &\n ReactRouterLinkProps &\n Pick<LinkProps, 'as'> &\n ButtonProps;\n\nconst disabledStyles = (p) =>\n p.disabled &&\n css`\n pointer-events: none;\n `;\n\nconst StyledLinkButton = styled(\n StyledButton.withComponent('a'),\n omitEmotionProps('as', 'disabled')\n)`\n text-decoration: none;\n display: inline-flex;\n ${disabledStyles};\n`;\n\n/**\n * The button that is rendered as the a tag.\n */\nconst LinkButton = forwardRef<HTMLAnchorElement, LinkButtonProps>(\n (\n {\n type = 'primary',\n danger = false,\n left,\n right,\n wide = 'default',\n loading = false,\n disabled = false,\n size,\n as,\n onMouseDown = () => {},\n onKeyDown = () => {},\n children,\n ...rest\n },\n ref\n ) => {\n const { buttonColors, loadingColors } = useButtonColors({\n type,\n danger,\n disabled,\n });\n\n return (\n <StyledLinkButton\n btnType={type}\n colors={buttonColors}\n wide={wide}\n loading={loading}\n disabled={disabled || loading}\n size={size}\n as={as}\n onMouseDown={(e) => {\n onMouseDown(e);\n e.preventDefault();\n }}\n onKeyDown={(e) => {\n onKeyDown(e);\n if (disabled || loading) e.preventDefault();\n }}\n aria-disabled={disabled || loading}\n aria-busy={loading}\n {...rest}\n ref={ref}\n >\n <ButtonContent\n left={left}\n right={right}\n loading={loading}\n loadingColors={loadingColors}\n >\n {children}\n </ButtonContent>\n </StyledLinkButton>\n );\n }\n);\n\nLinkButton.displayName = 'LinkButton';\n\nexport default LinkButton;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,MAAM,MAAM,iBAAiB;AACpC,SAASC,gBAAgB,QAAQ,kBAAkB;AACnD,SAASC,GAAG,QAAQ,gBAAgB;AACpC,SAAsBC,YAAY,QAAQ,WAAW;AACrD,OAAOC,eAAe,MAAM,iCAAiC;AAC7D,OAAOC,aAAa,MAAM,yBAAyB;AASnD,MAAMC,cAAc,GAAIC,CAAC,IACvBA,CAAC,CAACC,QAAQ,IACVN,GAAI;AACN;AACA,GAAG;AAEH,MAAMO,gBAAgB,GAAGT,MAAM,CAC7BG,YAAY,CAACO,aAAa,CAAC,GAAG,CAAC,EAC/BT,gBAAgB,CAAC,IAAI,EAAE,UAAU,CAAC,CAClC;AACF;AACA;AACA,IAAIK,cAAe;AACnB,CAAC;;AAED;AACA;AACA;AACA,MAAMK,UAAU,gBAAGZ,UAAU,CAC3B,CACE;EACEa,IAAI,GAAG,SAAS;EAChBC,MAAM,GAAG,KAAK;EACdC,IAAI;EACJC,KAAK;EACLC,IAAI,GAAG,SAAS;EAChBC,OAAO,GAAG,KAAK;EACfT,QAAQ,GAAG,KAAK;EAChBU,IAAI;EACJC,EAAE;EACFC,WAAW,GAAG,MAAM,CAAC,CAAC;EACtBC,SAAS,GAAG,MAAM,CAAC,CAAC;EACpBC,QAAQ;EACR,GAAGC;AACL,CAAC,EACDC,GAAG,KACA;EACH,MAAM;IAAEC,YAAY;IAAEC;EAAc,CAAC,GAAGtB,eAAe,CAAC;IACtDQ,IAAI;IACJC,MAAM;IACNL;EACF,CAAC,CAAC;EAEF,oBACE,oBAAC,gBAAgB;IACf,OAAO,EAAEI,IAAK;IACd,MAAM,EAAEa,YAAa;IACrB,IAAI,EAAET,IAAK;IACX,OAAO,EAAEC,OAAQ;IACjB,QAAQ,EAAET,QAAQ,IAAIS,OAAQ;IAC9B,IAAI,EAAEC,IAAK;IACX,EAAE,EAAEC,EAAG;IACP,WAAW,EAAGQ,CAAC,IAAK;MAClBP,WAAW,CAACO,CAAC,CAAC;MACdA,CAAC,CAACC,cAAc,EAAE;IACpB,CAAE;IACF,SAAS,EAAGD,CAAC,IAAK;MAChBN,SAAS,CAACM,CAAC,CAAC;MACZ,IAAInB,QAAQ,IAAIS,OAAO,EAAEU,CAAC,CAACC,cAAc,EAAE;IAC7C,CAAE;IACF,iBAAepB,QAAQ,IAAIS,OAAQ;IACnC,aAAWA;EAAQ,GACfM,IAAI;IACR,GAAG,EAAEC;EAAI,iBAET,oBAAC,aAAa;IACZ,IAAI,EAAEV,IAAK;IACX,KAAK,EAAEC,KAAM;IACb,OAAO,EAAEE,OAAQ;IACjB,aAAa,EAAES;EAAc,GAE5BJ,QAAQ,CACK,CACC;AAEvB,CAAC,CACF;AAEDX,UAAU,CAACkB,WAAW,GAAG,YAAY;AAErC,eAAelB,UAAU"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useRef } from 'react';
|
|
2
2
|
import { useEvent } from '@os-design/utils';
|
|
3
3
|
import { disableBodyPointerEvents, enableBodyPointerEventsAfterDelay } from './utils/bodyPointerEvents';
|
|
4
|
-
|
|
5
4
|
/**
|
|
6
5
|
* Specifies the number of milliseconds during which to disable pointer events while
|
|
7
6
|
* a scroll is in progress. This improves performance and makes scrolling smoother.
|
|
8
7
|
*/
|
|
9
8
|
export const DISABLE_BODY_POINTER_EVENTS_TIMEOUT = 150;
|
|
10
|
-
|
|
11
9
|
const WindowScroller = ({
|
|
12
10
|
onScroll = () => {},
|
|
13
11
|
children
|
|
@@ -26,10 +24,10 @@ const WindowScroller = ({
|
|
|
26
24
|
});
|
|
27
25
|
}, []);
|
|
28
26
|
useEffect(() => () => enableBodyPointerEventsAfterDelay(0), []);
|
|
29
|
-
useEvent(document, 'scroll', scrollListener);
|
|
27
|
+
useEvent(document, 'scroll', scrollListener);
|
|
30
28
|
|
|
29
|
+
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
31
30
|
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
32
31
|
};
|
|
33
|
-
|
|
34
32
|
export default WindowScroller;
|
|
35
33
|
//# sourceMappingURL=WindowScroller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WindowScroller.js","names":["React","useCallback","useEffect","useRef","useEvent","disableBodyPointerEvents","enableBodyPointerEventsAfterDelay","DISABLE_BODY_POINTER_EVENTS_TIMEOUT","WindowScroller","onScroll","children","onScrollRef","current","scrollListener","top","window","pageYOffset","left","pageXOffset","document"],"sources":["../../../src/List/WindowScroller.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef } from 'react';\nimport { useEvent } from '@os-design/utils';\nimport {\n disableBodyPointerEvents,\n enableBodyPointerEventsAfterDelay,\n} from './utils/bodyPointerEvents';\n\nexport interface ScrollPosition {\n top: number;\n left: number;\n}\n\ninterface WindowScrollerProps {\n onScroll?: (props: ScrollPosition) => void;\n children?: React.ReactNode;\n}\n\n/**\n * Specifies the number of milliseconds during which to disable pointer events while\n * a scroll is in progress. This improves performance and makes scrolling smoother.\n */\nexport const DISABLE_BODY_POINTER_EVENTS_TIMEOUT = 150;\n\nconst WindowScroller: React.FC<WindowScrollerProps> = ({\n onScroll = () => {},\n children,\n}) => {\n const onScrollRef = useRef<WindowScrollerProps['onScroll']>();\n\n useEffect(() => {\n onScrollRef.current = onScroll;\n }, [onScroll]);\n\n const scrollListener = useCallback(() => {\n disableBodyPointerEvents();\n enableBodyPointerEventsAfterDelay(DISABLE_BODY_POINTER_EVENTS_TIMEOUT);\n if (!onScrollRef.current) return;\n onScrollRef.current({\n top: window.pageYOffset,\n left: window.pageXOffset,\n });\n }, []);\n\n useEffect(() => () => enableBodyPointerEventsAfterDelay(0), []);\n useEvent(document, 'scroll', scrollListener);\n\n // eslint-disable-next-line react/jsx-no-useless-fragment\n return <>{children}</>;\n};\n\nexport default WindowScroller;\n"],"mappings":"AAAA,OAAOA,
|
|
1
|
+
{"version":3,"file":"WindowScroller.js","names":["React","useCallback","useEffect","useRef","useEvent","disableBodyPointerEvents","enableBodyPointerEventsAfterDelay","DISABLE_BODY_POINTER_EVENTS_TIMEOUT","WindowScroller","onScroll","children","onScrollRef","current","scrollListener","top","window","pageYOffset","left","pageXOffset","document"],"sources":["../../../src/List/WindowScroller.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef } from 'react';\nimport { useEvent } from '@os-design/utils';\nimport {\n disableBodyPointerEvents,\n enableBodyPointerEventsAfterDelay,\n} from './utils/bodyPointerEvents';\n\nexport interface ScrollPosition {\n top: number;\n left: number;\n}\n\ninterface WindowScrollerProps {\n onScroll?: (props: ScrollPosition) => void;\n children?: React.ReactNode;\n}\n\n/**\n * Specifies the number of milliseconds during which to disable pointer events while\n * a scroll is in progress. This improves performance and makes scrolling smoother.\n */\nexport const DISABLE_BODY_POINTER_EVENTS_TIMEOUT = 150;\n\nconst WindowScroller: React.FC<WindowScrollerProps> = ({\n onScroll = () => {},\n children,\n}) => {\n const onScrollRef = useRef<WindowScrollerProps['onScroll']>();\n\n useEffect(() => {\n onScrollRef.current = onScroll;\n }, [onScroll]);\n\n const scrollListener = useCallback(() => {\n disableBodyPointerEvents();\n enableBodyPointerEventsAfterDelay(DISABLE_BODY_POINTER_EVENTS_TIMEOUT);\n if (!onScrollRef.current) return;\n onScrollRef.current({\n top: window.pageYOffset,\n left: window.pageXOffset,\n });\n }, []);\n\n useEffect(() => () => enableBodyPointerEventsAfterDelay(0), []);\n useEvent(document, 'scroll', scrollListener);\n\n // eslint-disable-next-line react/jsx-no-useless-fragment\n return <>{children}</>;\n};\n\nexport default WindowScroller;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAC7D,SAASC,QAAQ,QAAQ,kBAAkB;AAC3C,SACEC,wBAAwB,EACxBC,iCAAiC,QAC5B,2BAA2B;AAYlC;AACA;AACA;AACA;AACA,OAAO,MAAMC,mCAAmC,GAAG,GAAG;AAEtD,MAAMC,cAA6C,GAAG,CAAC;EACrDC,QAAQ,GAAG,MAAM,CAAC,CAAC;EACnBC;AACF,CAAC,KAAK;EACJ,MAAMC,WAAW,GAAGR,MAAM,EAAmC;EAE7DD,SAAS,CAAC,MAAM;IACdS,WAAW,CAACC,OAAO,GAAGH,QAAQ;EAChC,CAAC,EAAE,CAACA,QAAQ,CAAC,CAAC;EAEd,MAAMI,cAAc,GAAGZ,WAAW,CAAC,MAAM;IACvCI,wBAAwB,EAAE;IAC1BC,iCAAiC,CAACC,mCAAmC,CAAC;IACtE,IAAI,CAACI,WAAW,CAACC,OAAO,EAAE;IAC1BD,WAAW,CAACC,OAAO,CAAC;MAClBE,GAAG,EAAEC,MAAM,CAACC,WAAW;MACvBC,IAAI,EAAEF,MAAM,CAACG;IACf,CAAC,CAAC;EACJ,CAAC,EAAE,EAAE,CAAC;EAENhB,SAAS,CAAC,MAAM,MAAMI,iCAAiC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;EAC/DF,QAAQ,CAACe,QAAQ,EAAE,QAAQ,EAAEN,cAAc,CAAC;;EAE5C;EACA,oBAAO,0CAAGH,QAAQ,CAAI;AACxB,CAAC;AAED,eAAeF,cAAc"}
|