react-miui 0.32.0 → 0.32.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +8 -0
- package/CHANGELOG.md +23 -0
- package/CLAUDE.md +67 -0
- package/dist/components/form/Checkbox.d.ts.map +1 -1
- package/dist/components/form/Checkbox.js.map +1 -1
- package/dist/components/form/ColorPicker.d.ts.map +1 -1
- package/dist/components/form/ColorPicker.js.map +1 -1
- package/dist/components/form/Suggestions.d.ts +1 -1
- package/dist/components/form/Suggestions.d.ts.map +1 -1
- package/dist/components/form/Toggle.d.ts.map +1 -1
- package/dist/components/form/Toggle.js.map +1 -1
- package/dist/components/form/choice/Choice.d.ts +1 -1
- package/dist/components/form/choice/Choice.d.ts.map +1 -1
- package/dist/components/form/choice/Choice.js +1 -1
- package/dist/components/form/choice/Choice.js.map +1 -1
- package/dist/components/form/choice/ChoiceItem.d.ts.map +1 -1
- package/dist/components/form/choice/ChoiceItem.js +3 -2
- package/dist/components/form/choice/ChoiceItem.js.map +1 -1
- package/dist/components/form/input/Input.d.ts +5 -2
- package/dist/components/form/input/Input.d.ts.map +1 -1
- package/dist/components/form/input/Input.js +18 -9
- package/dist/components/form/input/Input.js.map +1 -1
- package/dist/components/form/input/Input.styled.d.ts.map +1 -1
- package/dist/components/form/input/Input.styled.js.map +1 -1
- package/dist/components/form/textarea/TextArea.styled.d.ts.map +1 -1
- package/dist/components/form/textarea/TextArea.styled.js +1 -1
- package/dist/components/form/textarea/TextArea.styled.js.map +1 -1
- package/dist/components/icons/Back.d.ts +1 -1
- package/dist/components/icons/Back.d.ts.map +1 -1
- package/dist/components/icons/Back.js +38 -7
- package/dist/components/icons/Back.js.map +1 -1
- package/dist/components/icons/Battery.d.ts +1 -1
- package/dist/components/icons/Battery.d.ts.map +1 -1
- package/dist/components/icons/Battery.js +38 -7
- package/dist/components/icons/Battery.js.map +1 -1
- package/dist/components/icons/Checkmark.d.ts +1 -1
- package/dist/components/icons/Checkmark.d.ts.map +1 -1
- package/dist/components/icons/Checkmark.js +38 -7
- package/dist/components/icons/Checkmark.js.map +1 -1
- package/dist/components/icons/Config.d.ts +1 -1
- package/dist/components/icons/Config.d.ts.map +1 -1
- package/dist/components/icons/Config.js +38 -7
- package/dist/components/icons/Config.js.map +1 -1
- package/dist/components/icons/Dots.d.ts +1 -1
- package/dist/components/icons/Dots.d.ts.map +1 -1
- package/dist/components/icons/Dots.js +38 -7
- package/dist/components/icons/Dots.js.map +1 -1
- package/dist/components/icons/Forward.d.ts +1 -1
- package/dist/components/icons/Forward.d.ts.map +1 -1
- package/dist/components/icons/Forward.js +38 -7
- package/dist/components/icons/Forward.js.map +1 -1
- package/dist/components/icons/Heart.d.ts +1 -1
- package/dist/components/icons/Heart.d.ts.map +1 -1
- package/dist/components/icons/Heart.js +38 -7
- package/dist/components/icons/Heart.js.map +1 -1
- package/dist/components/icons/Icon.d.ts +1 -1
- package/dist/components/icons/Icon.d.ts.map +1 -1
- package/dist/components/icons/Icon.js +43 -12
- package/dist/components/icons/Icon.js.map +1 -1
- package/dist/components/icons/Search.d.ts +1 -1
- package/dist/components/icons/Search.d.ts.map +1 -1
- package/dist/components/icons/Search.js +38 -7
- package/dist/components/icons/Search.js.map +1 -1
- package/dist/components/icons/Trash.d.ts +1 -1
- package/dist/components/icons/Trash.d.ts.map +1 -1
- package/dist/components/icons/Trash.js +38 -7
- package/dist/components/icons/Trash.js.map +1 -1
- package/dist/components/layout/header/Header.d.ts.map +1 -1
- package/dist/components/layout/header/Header.js.map +1 -1
- package/dist/components/layout/header/HeaderIconAction.d.ts +3 -2
- package/dist/components/layout/header/HeaderIconAction.d.ts.map +1 -1
- package/dist/components/layout/header/HeaderIconAction.js +45 -11
- package/dist/components/layout/header/HeaderIconAction.js.map +1 -1
- package/dist/components/layout/header/HeaderIconAction.styled.d.ts +87 -2
- package/dist/components/layout/header/HeaderIconAction.styled.d.ts.map +1 -1
- package/dist/components/layout/header/HeaderIconAction.styled.js +4 -3
- package/dist/components/layout/header/HeaderIconAction.styled.js.map +1 -1
- package/dist/components/layout/header/StickyHeader.d.ts.map +1 -1
- package/dist/components/layout/header/StickyHeader.js.map +1 -1
- package/dist/components/layout/list/Header.d.ts +96 -93
- package/dist/components/layout/list/Header.d.ts.map +1 -1
- package/dist/components/layout/list/Header.js +43 -9
- package/dist/components/layout/list/Header.js.map +1 -1
- package/dist/components/layout/list/Item.d.ts +273 -7
- package/dist/components/layout/list/Item.d.ts.map +1 -1
- package/dist/components/layout/list/Item.js +52 -17
- package/dist/components/layout/list/Item.js.map +1 -1
- package/dist/components/layout/list/Item.styled.d.ts +1 -1
- package/dist/components/layout/list/Label.d.ts.map +1 -1
- package/dist/components/layout/list/Label.js.map +1 -1
- package/dist/components/layout/list/List.d.ts +547 -94
- package/dist/components/layout/list/List.d.ts.map +1 -1
- package/dist/components/layout/list/List.js +46 -10
- package/dist/components/layout/list/List.js.map +1 -1
- package/dist/components/layout/section/Section.d.ts.map +1 -1
- package/dist/components/layout/section/Section.js.map +1 -1
- package/dist/components/ui/action/Action.d.ts +5 -3
- package/dist/components/ui/action/Action.d.ts.map +1 -1
- package/dist/components/ui/action/Action.js +46 -10
- package/dist/components/ui/action/Action.js.map +1 -1
- package/dist/components/ui/drawer/Drawer.d.ts.map +1 -1
- package/dist/components/ui/drawer/Drawer.js.map +1 -1
- package/dist/components/ui/keyValue/KeyValue.d.ts +2 -2
- package/dist/components/ui/keyValue/KeyValue.d.ts.map +1 -1
- package/dist/components/ui/keyValue/KeyValue.js +2 -2
- package/dist/components/ui/keyValue/KeyValue.js.map +1 -1
- package/dist/components/ui/loader/CoveringLoader.d.ts.map +1 -1
- package/dist/components/ui/loader/CoveringLoader.js +14 -9
- package/dist/components/ui/loader/CoveringLoader.js.map +1 -1
- package/dist/components/ui/loader/FullLoader.d.ts +1 -1
- package/dist/components/ui/loader/FullLoader.d.ts.map +1 -1
- package/dist/components/ui/loader/FullLoader.js +50 -6
- package/dist/components/ui/loader/FullLoader.js.map +1 -1
- package/dist/components/ui/loader/Loader.d.ts +2 -1
- package/dist/components/ui/loader/Loader.d.ts.map +1 -1
- package/dist/components/ui/loader/Loader.js +41 -9
- package/dist/components/ui/loader/Loader.js.map +1 -1
- package/dist/components/ui/loader/Loading.d.ts.map +1 -1
- package/dist/components/ui/loader/Loading.js +2 -1
- package/dist/components/ui/loader/Loading.js.map +1 -1
- package/dist/components/ui/loader/PopLoader.d.ts +2 -3
- package/dist/components/ui/loader/PopLoader.d.ts.map +1 -1
- package/dist/components/ui/loader/PopLoader.js +40 -8
- package/dist/components/ui/loader/PopLoader.js.map +1 -1
- package/dist/components/ui/message/Message.d.ts.map +1 -1
- package/dist/components/ui/message/Message.js.map +1 -1
- package/dist/components/ui/message/Message.styled.d.ts +1 -1
- package/dist/components/ui/modal/Modal.d.ts +92 -6
- package/dist/components/ui/modal/Modal.d.ts.map +1 -1
- package/dist/components/ui/modal/Modal.js +19 -7
- package/dist/components/ui/modal/Modal.js.map +1 -1
- package/dist/components/ui/modal/Modal.styled.d.ts.map +1 -1
- package/dist/components/ui/modal/Modal.styled.js +1 -0
- package/dist/components/ui/modal/Modal.styled.js.map +1 -1
- package/dist/components/ui/modal/ModalButtons.styled.d.ts.map +1 -1
- package/dist/components/ui/modal/ModalButtons.styled.js.map +1 -1
- package/dist/components/ui/pop/OnButtonClick.d.ts.map +1 -1
- package/dist/components/ui/pop/OnButtonClick.js +3 -2
- package/dist/components/ui/pop/OnButtonClick.js.map +1 -1
- package/dist/components/ui/pop/Pop.d.ts +3 -1
- package/dist/components/ui/pop/Pop.d.ts.map +1 -1
- package/dist/components/ui/pop/Pop.js +7 -2
- package/dist/components/ui/pop/Pop.js.map +1 -1
- package/dist/components/ui/pop/PopOption.d.ts +4 -2
- package/dist/components/ui/pop/PopOption.d.ts.map +1 -1
- package/dist/components/ui/pop/PopOption.js +44 -8
- package/dist/components/ui/pop/PopOption.js.map +1 -1
- package/dist/components/ui/progress/Progress.d.ts.map +1 -1
- package/dist/components/ui/progress/Progress.js.map +1 -1
- package/dist/components/ui/progress/Progress.styled.js +1 -1
- package/dist/components/ui/stats/Stats.d.ts.map +1 -1
- package/dist/components/ui/tabs/Item.d.ts.map +1 -1
- package/dist/components/ui/tabs/Item.js +3 -2
- package/dist/components/ui/tabs/Item.js.map +1 -1
- package/dist/components/ui/tabs/Item.styled.d.ts.map +1 -1
- package/dist/components/ui/tabs/Item.styled.js +2 -0
- package/dist/components/ui/tabs/Item.styled.js.map +1 -1
- package/dist/components/ui/tabs/Selector.d.ts +2 -1
- package/dist/components/ui/tabs/Selector.d.ts.map +1 -1
- package/dist/components/ui/tabs/Selector.js +60 -4
- package/dist/components/ui/tabs/Selector.js.map +1 -1
- package/dist/components/ui/tabs/Selector.styled.d.ts +9 -1
- package/dist/components/ui/tabs/Selector.styled.d.ts.map +1 -1
- package/dist/components/ui/tabs/Selector.styled.js +68 -2
- package/dist/components/ui/tabs/Selector.styled.js.map +1 -1
- package/dist/components/ui/toaster/Notification.d.ts.map +1 -1
- package/dist/components/ui/toaster/Notification.js +4 -2
- package/dist/components/ui/toaster/Notification.js.map +1 -1
- package/dist/components/utils/HandleEsc.d.ts.map +1 -1
- package/dist/components/utils/HandleEsc.js +5 -5
- package/dist/components/utils/HandleEsc.js.map +1 -1
- package/dist/utils/useTailSpin.js +1 -1
- package/dist/utils/useTailSpin.js.map +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/index.Pop.html +7 -7
- package/docs/classes/index.ToasterProvider.html +4 -4
- package/docs/documents/Test.html +2 -2
- package/docs/enums/index.ICON.html +2 -2
- package/docs/functions/index.Action.html +6 -25
- package/docs/functions/index.Button.html +3 -3
- package/docs/functions/index.Card.html +2 -2
- package/docs/functions/index.Checkbox.html +3 -3
- package/docs/functions/index.Choice.html +2 -2
- package/docs/functions/index.ColorPicker.html +3 -3
- package/docs/functions/index.CoveringLoader.html +3 -3
- package/docs/functions/index.DirectionPad.html +2 -2
- package/docs/functions/index.Drawer.html +2 -2
- package/docs/functions/index.EqualActions.html +2 -2
- package/docs/functions/index.FullLoader.html +6 -25
- package/docs/functions/index.Gap.html +2 -2
- package/docs/functions/index.HandleEsc.html +3 -3
- package/docs/functions/index.Header.html +3 -3
- package/docs/functions/index.HeaderIconAction.html +6 -25
- package/docs/functions/index.Icon-1.html +5 -24
- package/docs/functions/index.If.html +3 -3
- package/docs/functions/index.Input.html +1 -1
- package/docs/functions/index.KeyValue.html +2 -2
- package/docs/functions/index.Label.html +2 -2
- package/docs/functions/index.Line.html +3 -3
- package/docs/functions/index.List.html +5 -33
- package/docs/functions/index.Loader.html +6 -25
- package/docs/functions/index.Loading.html +3 -3
- package/docs/functions/index.Message.html +3 -3
- package/docs/functions/index.Modal.html +5 -24
- package/docs/functions/index.ModalButtons.html +3 -3
- package/docs/functions/index.PopLoader.html +6 -25
- package/docs/functions/index.PopOption.html +5 -24
- package/docs/functions/index.Progress.html +2 -2
- package/docs/functions/index.SearchContainer.html +2 -2
- package/docs/functions/index.Section.html +4 -4
- package/docs/functions/index.Select.html +2 -2
- package/docs/functions/index.Selector.html +2 -2
- package/docs/functions/index.Spacer.html +2 -2
- package/docs/functions/index.Stats.html +2 -2
- package/docs/functions/index.StickyHeader.html +4 -4
- package/docs/functions/index.Table.html +2 -2
- package/docs/functions/index.TextArea.html +2 -2
- package/docs/functions/index.Toggle.html +3 -3
- package/docs/functions/index.ToolButton.html +3 -3
- package/docs/functions/index.borderPxToRem.html +1 -1
- package/docs/functions/index.createTheme.html +1 -1
- package/docs/functions/index.css.html +1 -1
- package/docs/functions/index.dimensionsPxToRem.html +1 -1
- package/docs/functions/index.fontPxToRem.html +1 -1
- package/docs/functions/index.getCssText.html +1 -1
- package/docs/functions/index.globalCss.html +2 -2
- package/docs/functions/index.injectGlobalStyles.html +1 -1
- package/docs/functions/index.keyframes.html +1 -1
- package/docs/functions/index.pxToRem.html +1 -1
- package/docs/functions/index.styled.html +1 -1
- package/docs/functions/index.useToaster.html +1 -1
- package/docs/index.html +2 -2
- package/docs/interfaces/index.IconProps.html +2 -2
- package/docs/interfaces/index.InputCustomProps.html +2 -2
- package/docs/interfaces/index.LoaderProps.html +7 -6
- package/docs/interfaces/index.StickyHeaderProps.html +4 -4
- package/docs/modules/index.html +1 -1
- package/docs/modules.html +1 -1
- package/docs/types/index.ActionProps.html +1 -1
- package/docs/types/index.CardProps.html +1 -1
- package/docs/types/index.CheckboxProps.html +2 -2
- package/docs/types/index.ChoiceProps.html +1 -1
- package/docs/types/index.ColorPickerProps.html +1 -1
- package/docs/types/index.DirectionPadProps.html +1 -1
- package/docs/types/index.DrawerProps.html +1 -1
- package/docs/types/index.EqualActionsProps.html +1 -1
- package/docs/types/index.HeaderProps.html +1 -1
- package/docs/types/index.InputProps.html +1 -1
- package/docs/types/index.KeyValueProps.html +1 -1
- package/docs/types/index.LabelProps.html +1 -1
- package/docs/types/index.OverwriteProps.html +1 -1
- package/docs/types/index.ProgressProps.html +2 -2
- package/docs/types/index.SelectProps.html +1 -1
- package/docs/types/index.SelectorProps.html +1 -1
- package/docs/types/index.Stat.html +1 -1
- package/docs/types/index.StatsProps.html +1 -1
- package/docs/types/index.TextAreaProps.html +1 -1
- package/docs/types/index.ThemeCSS.html +1 -1
- package/docs/types/index.ToggleProps.html +2 -2
- package/docs/variables/index.ActionBadgeSelector.html +1 -0
- package/docs/variables/index.ActionCircleSelector.html +1 -0
- package/docs/variables/index.CheckboxCheckmarkWrapperSelector.html +1 -1
- package/docs/variables/index.CheckboxTextLabelSelector.html +1 -1
- package/docs/variables/index.ChoiceItemSelector.html +1 -1
- package/docs/variables/index.ColorPickerColorDisplaySelector.html +1 -1
- package/docs/variables/index.DirectionPadButtonDotSelector.html +1 -1
- package/docs/variables/index.DirectionPadButtonSelector.html +1 -1
- package/docs/variables/index.DirectionPadLineSelector.html +1 -1
- package/docs/variables/index.DirectionPadMiddleSelector.html +1 -1
- package/docs/variables/index.DrawerContentSelector.html +1 -1
- package/docs/variables/index.HeaderAfterSelector.html +1 -1
- package/docs/variables/index.HeaderBeforeSelector.html +1 -1
- package/docs/variables/index.HeaderContentsSelector.html +1 -1
- package/docs/variables/index.HeaderIconActionIconSelector.html +1 -0
- package/docs/variables/index.InputInputSelector.html +1 -0
- package/docs/variables/index.InputPrefixSelector.html +1 -0
- package/docs/variables/index.InputSuffixSelector.html +1 -0
- package/docs/variables/index.KeyValueIconSelector.html +1 -1
- package/docs/variables/index.KeyValueItemSelector.html +1 -1
- package/docs/variables/index.KeyValueKeySelector.html +1 -1
- package/docs/variables/index.KeyValuePairSelector.html +1 -1
- package/docs/variables/index.KeyValueValueSelector.html +1 -1
- package/docs/variables/index.LabelTextSelector.html +1 -1
- package/docs/variables/index.ListItemInnerContainerClassNameSelector.html +1 -0
- package/docs/variables/index.ModalContainerSelector.html +1 -0
- package/docs/variables/index.ModalRemovePaddingSelector.html +1 -0
- package/docs/variables/index.ModalTitleSelector.html +1 -0
- package/docs/variables/index.PopListSelector.html +1 -0
- package/docs/variables/index.PopOptionButtonSelector.html +1 -0
- package/docs/variables/index.PopOptionIconSelector.html +1 -0
- package/docs/variables/index.PopOverlaySelector.html +1 -0
- package/docs/variables/index.ProgressBackgroundSelector.html +1 -1
- package/docs/variables/index.ProgressValueSelector.html +1 -1
- package/docs/variables/index.SelectorItemSelector.html +1 -1
- package/docs/variables/index.StatsItemSelector.html +1 -1
- package/docs/variables/index.StatsLabelSelector.html +1 -1
- package/docs/variables/index.StatsSeparatorSelector.html +1 -1
- package/docs/variables/index.StatsValueSelector.html +1 -1
- package/docs/variables/index.ToggleStyledToggleSelector.html +1 -1
- package/docs/variables/index.config.html +1 -1
- package/docs/variables/index.cssReset.html +2 -2
- package/docs/variables/index.darkTheme.html +1 -1
- package/docs/variables/index.miuiScrollbars.html +1 -1
- package/docs/variables/index.theme.html +1 -1
- package/esm/components/form/Checkbox.d.ts.map +1 -1
- package/esm/components/form/Checkbox.js.map +1 -1
- package/esm/components/form/Checkbox.stories.d.ts +1 -1
- package/esm/components/form/Checkbox.stories.d.ts.map +1 -1
- package/esm/components/form/Checkbox.stories.js +1 -1
- package/esm/components/form/Checkbox.stories.js.map +1 -1
- package/esm/components/form/ColorPicker.d.ts.map +1 -1
- package/esm/components/form/ColorPicker.js.map +1 -1
- package/esm/components/form/ColorPicker.stories.d.ts +1 -1
- package/esm/components/form/ColorPicker.stories.d.ts.map +1 -1
- package/esm/components/form/ColorPicker.stories.js.map +1 -1
- package/esm/components/form/Label.stories.d.ts.map +1 -1
- package/esm/components/form/Label.stories.js.map +1 -1
- package/esm/components/form/Label.styled.js +1 -1
- package/esm/components/form/Label.styled.js.map +1 -1
- package/esm/components/form/Select.stories.d.ts +1 -1
- package/esm/components/form/Select.stories.d.ts.map +1 -1
- package/esm/components/form/Suggestions.d.ts +1 -1
- package/esm/components/form/Suggestions.d.ts.map +1 -1
- package/esm/components/form/Toggle.d.ts.map +1 -1
- package/esm/components/form/Toggle.js.map +1 -1
- package/esm/components/form/Toggle.styled.js +1 -1
- package/esm/components/form/Toggle.styled.js.map +1 -1
- package/esm/components/form/choice/Choice.d.ts +1 -1
- package/esm/components/form/choice/Choice.d.ts.map +1 -1
- package/esm/components/form/choice/Choice.js +1 -1
- package/esm/components/form/choice/Choice.js.map +1 -1
- package/esm/components/form/choice/Choice.stories.d.ts +1 -1
- package/esm/components/form/choice/Choice.stories.d.ts.map +1 -1
- package/esm/components/form/choice/Choice.stories.js.map +1 -1
- package/esm/components/form/choice/ChoiceItem.d.ts.map +1 -1
- package/esm/components/form/choice/ChoiceItem.js +3 -2
- package/esm/components/form/choice/ChoiceItem.js.map +1 -1
- package/esm/components/form/input/Input.d.ts +5 -2
- package/esm/components/form/input/Input.d.ts.map +1 -1
- package/esm/components/form/input/Input.js +17 -11
- package/esm/components/form/input/Input.js.map +1 -1
- package/esm/components/form/input/Input.stories.d.ts +1 -1
- package/esm/components/form/input/Input.stories.d.ts.map +1 -1
- package/esm/components/form/input/Input.stories.js +1 -1
- package/esm/components/form/input/Input.stories.js.map +1 -1
- package/esm/components/form/input/Input.styled.d.ts.map +1 -1
- package/esm/components/form/input/Input.styled.js.map +1 -1
- package/esm/components/form/textarea/TextArea.stories.d.ts +1 -1
- package/esm/components/form/textarea/TextArea.stories.d.ts.map +1 -1
- package/esm/components/form/textarea/TextArea.styled.d.ts.map +1 -1
- package/esm/components/form/textarea/TextArea.styled.js +1 -1
- package/esm/components/form/textarea/TextArea.styled.js.map +1 -1
- package/esm/components/icons/Back.d.ts +1 -1
- package/esm/components/icons/Back.d.ts.map +1 -1
- package/esm/components/icons/Back.js +5 -4
- package/esm/components/icons/Back.js.map +1 -1
- package/esm/components/icons/Battery.d.ts +1 -1
- package/esm/components/icons/Battery.d.ts.map +1 -1
- package/esm/components/icons/Battery.js +5 -4
- package/esm/components/icons/Battery.js.map +1 -1
- package/esm/components/icons/Checkmark.d.ts +1 -1
- package/esm/components/icons/Checkmark.d.ts.map +1 -1
- package/esm/components/icons/Checkmark.js +5 -4
- package/esm/components/icons/Checkmark.js.map +1 -1
- package/esm/components/icons/Config.d.ts +1 -1
- package/esm/components/icons/Config.d.ts.map +1 -1
- package/esm/components/icons/Config.js +5 -4
- package/esm/components/icons/Config.js.map +1 -1
- package/esm/components/icons/Dots.d.ts +1 -1
- package/esm/components/icons/Dots.d.ts.map +1 -1
- package/esm/components/icons/Dots.js +5 -4
- package/esm/components/icons/Dots.js.map +1 -1
- package/esm/components/icons/Forward.d.ts +1 -1
- package/esm/components/icons/Forward.d.ts.map +1 -1
- package/esm/components/icons/Forward.js +5 -4
- package/esm/components/icons/Forward.js.map +1 -1
- package/esm/components/icons/Heart.d.ts +1 -1
- package/esm/components/icons/Heart.d.ts.map +1 -1
- package/esm/components/icons/Heart.js +5 -4
- package/esm/components/icons/Heart.js.map +1 -1
- package/esm/components/icons/Icon.d.ts +1 -1
- package/esm/components/icons/Icon.d.ts.map +1 -1
- package/esm/components/icons/Icon.js +10 -9
- package/esm/components/icons/Icon.js.map +1 -1
- package/esm/components/icons/Icon.stories.d.ts.map +1 -1
- package/esm/components/icons/Icon.stories.js +1 -1
- package/esm/components/icons/Icon.stories.js.map +1 -1
- package/esm/components/icons/Search.d.ts +1 -1
- package/esm/components/icons/Search.d.ts.map +1 -1
- package/esm/components/icons/Search.js +5 -4
- package/esm/components/icons/Search.js.map +1 -1
- package/esm/components/icons/Trash.d.ts +1 -1
- package/esm/components/icons/Trash.d.ts.map +1 -1
- package/esm/components/icons/Trash.js +5 -4
- package/esm/components/icons/Trash.js.map +1 -1
- package/esm/components/layout/card/Card.stories.d.ts.map +1 -1
- package/esm/components/layout/card/Card.stories.js.map +1 -1
- package/esm/components/layout/header/Header.d.ts.map +1 -1
- package/esm/components/layout/header/Header.js.map +1 -1
- package/esm/components/layout/header/Header.stories.d.ts +1 -1
- package/esm/components/layout/header/Header.stories.d.ts.map +1 -1
- package/esm/components/layout/header/Header.stories.js.map +1 -1
- package/esm/components/layout/header/HeaderIconAction.d.ts +3 -2
- package/esm/components/layout/header/HeaderIconAction.d.ts.map +1 -1
- package/esm/components/layout/header/HeaderIconAction.js +12 -9
- package/esm/components/layout/header/HeaderIconAction.js.map +1 -1
- package/esm/components/layout/header/HeaderIconAction.stories.d.ts +5 -4
- package/esm/components/layout/header/HeaderIconAction.stories.d.ts.map +1 -1
- package/esm/components/layout/header/HeaderIconAction.stories.js +20 -1
- package/esm/components/layout/header/HeaderIconAction.stories.js.map +1 -1
- package/esm/components/layout/header/HeaderIconAction.styled.d.ts +87 -2
- package/esm/components/layout/header/HeaderIconAction.styled.d.ts.map +1 -1
- package/esm/components/layout/header/HeaderIconAction.styled.js +4 -4
- package/esm/components/layout/header/HeaderIconAction.styled.js.map +1 -1
- package/esm/components/layout/header/StickyHeader.d.ts.map +1 -1
- package/esm/components/layout/header/StickyHeader.js +1 -1
- package/esm/components/layout/header/StickyHeader.js.map +1 -1
- package/esm/components/layout/header/StickyHeader.stories.d.ts +1 -1
- package/esm/components/layout/header/StickyHeader.stories.d.ts.map +1 -1
- package/esm/components/layout/header/StickyHeader.stories.js +1 -1
- package/esm/components/layout/header/StickyHeader.stories.js.map +1 -1
- package/esm/components/layout/list/Header.d.ts +96 -93
- package/esm/components/layout/list/Header.d.ts.map +1 -1
- package/esm/components/layout/list/Header.js +10 -7
- package/esm/components/layout/list/Header.js.map +1 -1
- package/esm/components/layout/list/Header.stories.d.ts +1 -1
- package/esm/components/layout/list/Header.stories.d.ts.map +1 -1
- package/esm/components/layout/list/Item.d.ts +273 -7
- package/esm/components/layout/list/Item.d.ts.map +1 -1
- package/esm/components/layout/list/Item.js +18 -13
- package/esm/components/layout/list/Item.js.map +1 -1
- package/esm/components/layout/list/Item.stories.d.ts +1 -1
- package/esm/components/layout/list/Item.stories.d.ts.map +1 -1
- package/esm/components/layout/list/Item.stories.js +1 -1
- package/esm/components/layout/list/Item.stories.js.map +1 -1
- package/esm/components/layout/list/Item.styled.d.ts +1 -1
- package/esm/components/layout/list/Label.d.ts.map +1 -1
- package/esm/components/layout/list/Label.js.map +1 -1
- package/esm/components/layout/list/Label.stories.d.ts +1 -1
- package/esm/components/layout/list/Label.stories.d.ts.map +1 -1
- package/esm/components/layout/list/Label.stories.js +1 -1
- package/esm/components/layout/list/Label.stories.js.map +1 -1
- package/esm/components/layout/list/List.d.ts +547 -94
- package/esm/components/layout/list/List.d.ts.map +1 -1
- package/esm/components/layout/list/List.js +13 -8
- package/esm/components/layout/list/List.js.map +1 -1
- package/esm/components/layout/list/List.stories.d.ts +1 -1
- package/esm/components/layout/list/List.stories.d.ts.map +1 -1
- package/esm/components/layout/list/List.stories.js +1 -1
- package/esm/components/layout/list/List.stories.js.map +1 -1
- package/esm/components/layout/list/Value.stories.d.ts +1 -1
- package/esm/components/layout/list/Value.stories.d.ts.map +1 -1
- package/esm/components/layout/list/Value.stories.js +2 -2
- package/esm/components/layout/list/Value.stories.js.map +1 -1
- package/esm/components/layout/section/Section.d.ts.map +1 -1
- package/esm/components/layout/section/Section.js.map +1 -1
- package/esm/components/layout/section/Section.stories.d.ts +1 -1
- package/esm/components/layout/section/Section.stories.d.ts.map +1 -1
- package/esm/components/layout/section/Section.stories.js +1 -1
- package/esm/components/layout/section/Section.stories.js.map +1 -1
- package/esm/components/layout/table/Table.stories.d.ts +1 -1
- package/esm/components/layout/table/Table.stories.d.ts.map +1 -1
- package/esm/components/ui/action/Action.d.ts +5 -3
- package/esm/components/ui/action/Action.d.ts.map +1 -1
- package/esm/components/ui/action/Action.js +11 -7
- package/esm/components/ui/action/Action.js.map +1 -1
- package/esm/components/ui/action/Action.stories.d.ts +1 -1
- package/esm/components/ui/action/Action.stories.d.ts.map +1 -1
- package/esm/components/ui/action/EqualActions.stories.d.ts.map +1 -1
- package/esm/components/ui/action/EqualActions.stories.js +1 -1
- package/esm/components/ui/action/EqualActions.stories.js.map +1 -1
- package/esm/components/ui/button/Button.stories.d.ts +1 -1
- package/esm/components/ui/button/Button.stories.d.ts.map +1 -1
- package/esm/components/ui/button/Button.stories.js.map +1 -1
- package/esm/components/ui/directionPad/Pad.js +1 -1
- package/esm/components/ui/directionPad/Pad.js.map +1 -1
- package/esm/components/ui/directionPad/Pad.stories.js +1 -1
- package/esm/components/ui/directionPad/Pad.stories.js.map +1 -1
- package/esm/components/ui/drawer/Drawer.d.ts.map +1 -1
- package/esm/components/ui/drawer/Drawer.js +1 -1
- package/esm/components/ui/drawer/Drawer.js.map +1 -1
- package/esm/components/ui/drawer/Drawer.stories.d.ts.map +1 -1
- package/esm/components/ui/drawer/Drawer.stories.js +3 -2
- package/esm/components/ui/drawer/Drawer.stories.js.map +1 -1
- package/esm/components/ui/keyValue/KeyValue.d.ts +2 -2
- package/esm/components/ui/keyValue/KeyValue.d.ts.map +1 -1
- package/esm/components/ui/keyValue/KeyValue.js +3 -3
- package/esm/components/ui/keyValue/KeyValue.js.map +1 -1
- package/esm/components/ui/keyValue/KeyValue.stories.d.ts.map +1 -1
- package/esm/components/ui/keyValue/KeyValue.stories.js +5 -5
- package/esm/components/ui/keyValue/KeyValue.stories.js.map +1 -1
- package/esm/components/ui/loader/CoveringLoader.d.ts.map +1 -1
- package/esm/components/ui/loader/CoveringLoader.js +14 -9
- package/esm/components/ui/loader/CoveringLoader.js.map +1 -1
- package/esm/components/ui/loader/FullLoader.d.ts +1 -1
- package/esm/components/ui/loader/FullLoader.d.ts.map +1 -1
- package/esm/components/ui/loader/FullLoader.js +6 -4
- package/esm/components/ui/loader/FullLoader.js.map +1 -1
- package/esm/components/ui/loader/FullLoader.stories.d.ts +1 -1
- package/esm/components/ui/loader/FullLoader.stories.d.ts.map +1 -1
- package/esm/components/ui/loader/Loader.d.ts +2 -1
- package/esm/components/ui/loader/Loader.d.ts.map +1 -1
- package/esm/components/ui/loader/Loader.js +7 -5
- package/esm/components/ui/loader/Loader.js.map +1 -1
- package/esm/components/ui/loader/Loading.d.ts.map +1 -1
- package/esm/components/ui/loader/Loading.js +2 -1
- package/esm/components/ui/loader/Loading.js.map +1 -1
- package/esm/components/ui/loader/Loading.stories.d.ts +1 -1
- package/esm/components/ui/loader/Loading.stories.d.ts.map +1 -1
- package/esm/components/ui/loader/Loading.stories.js.map +1 -1
- package/esm/components/ui/loader/PopLoader.d.ts +2 -3
- package/esm/components/ui/loader/PopLoader.d.ts.map +1 -1
- package/esm/components/ui/loader/PopLoader.js +6 -4
- package/esm/components/ui/loader/PopLoader.js.map +1 -1
- package/esm/components/ui/loader/PopLoader.stories.d.ts +1 -1
- package/esm/components/ui/loader/PopLoader.stories.d.ts.map +1 -1
- package/esm/components/ui/loader/PopLoader.stories.js.map +1 -1
- package/esm/components/ui/message/Message.d.ts.map +1 -1
- package/esm/components/ui/message/Message.js.map +1 -1
- package/esm/components/ui/message/Message.stories.d.ts.map +1 -1
- package/esm/components/ui/message/Message.stories.js.map +1 -1
- package/esm/components/ui/message/Message.styled.d.ts +1 -1
- package/esm/components/ui/modal/Modal.d.ts +92 -6
- package/esm/components/ui/modal/Modal.d.ts.map +1 -1
- package/esm/components/ui/modal/Modal.js +17 -8
- package/esm/components/ui/modal/Modal.js.map +1 -1
- package/esm/components/ui/modal/Modal.stories.d.ts +1 -1
- package/esm/components/ui/modal/Modal.stories.d.ts.map +1 -1
- package/esm/components/ui/modal/Modal.stories.js +4 -4
- package/esm/components/ui/modal/Modal.stories.js.map +1 -1
- package/esm/components/ui/modal/Modal.styled.d.ts.map +1 -1
- package/esm/components/ui/modal/Modal.styled.js +1 -0
- package/esm/components/ui/modal/Modal.styled.js.map +1 -1
- package/esm/components/ui/modal/ModalButtons.stories.d.ts +1 -1
- package/esm/components/ui/modal/ModalButtons.stories.d.ts.map +1 -1
- package/esm/components/ui/modal/ModalButtons.stories.js +1 -1
- package/esm/components/ui/modal/ModalButtons.stories.js.map +1 -1
- package/esm/components/ui/modal/ModalButtons.styled.d.ts.map +1 -1
- package/esm/components/ui/modal/ModalButtons.styled.js.map +1 -1
- package/esm/components/ui/pop/OnButtonClick.d.ts.map +1 -1
- package/esm/components/ui/pop/OnButtonClick.js +3 -2
- package/esm/components/ui/pop/OnButtonClick.js.map +1 -1
- package/esm/components/ui/pop/Pop.d.ts +3 -1
- package/esm/components/ui/pop/Pop.d.ts.map +1 -1
- package/esm/components/ui/pop/Pop.js +5 -2
- package/esm/components/ui/pop/Pop.js.map +1 -1
- package/esm/components/ui/pop/Pop.stories.d.ts.map +1 -1
- package/esm/components/ui/pop/Pop.stories.js +2 -2
- package/esm/components/ui/pop/Pop.stories.js.map +1 -1
- package/esm/components/ui/pop/PopOption.d.ts +4 -2
- package/esm/components/ui/pop/PopOption.d.ts.map +1 -1
- package/esm/components/ui/pop/PopOption.js +9 -5
- package/esm/components/ui/pop/PopOption.js.map +1 -1
- package/esm/components/ui/progress/Progress.d.ts.map +1 -1
- package/esm/components/ui/progress/Progress.js.map +1 -1
- package/esm/components/ui/progress/Progress.stories.d.ts.map +1 -1
- package/esm/components/ui/progress/Progress.stories.js.map +1 -1
- package/esm/components/ui/progress/Progress.styled.js +1 -1
- package/esm/components/ui/stats/Stats.d.ts.map +1 -1
- package/esm/components/ui/stats/Stats.js +1 -1
- package/esm/components/ui/stats/Stats.js.map +1 -1
- package/esm/components/ui/stats/Stats.stories.d.ts.map +1 -1
- package/esm/components/ui/stats/Stats.stories.js +1 -1
- package/esm/components/ui/stats/Stats.stories.js.map +1 -1
- package/esm/components/ui/tabs/Item.d.ts.map +1 -1
- package/esm/components/ui/tabs/Item.js +3 -2
- package/esm/components/ui/tabs/Item.js.map +1 -1
- package/esm/components/ui/tabs/Item.styled.d.ts.map +1 -1
- package/esm/components/ui/tabs/Item.styled.js +2 -0
- package/esm/components/ui/tabs/Item.styled.js.map +1 -1
- package/esm/components/ui/tabs/Selector.d.ts +2 -1
- package/esm/components/ui/tabs/Selector.d.ts.map +1 -1
- package/esm/components/ui/tabs/Selector.js +62 -6
- package/esm/components/ui/tabs/Selector.js.map +1 -1
- package/esm/components/ui/tabs/Selector.stories.d.ts +4 -2
- package/esm/components/ui/tabs/Selector.stories.d.ts.map +1 -1
- package/esm/components/ui/tabs/Selector.stories.js +40 -2
- package/esm/components/ui/tabs/Selector.stories.js.map +1 -1
- package/esm/components/ui/tabs/Selector.styled.d.ts +9 -1
- package/esm/components/ui/tabs/Selector.styled.d.ts.map +1 -1
- package/esm/components/ui/tabs/Selector.styled.js +67 -3
- package/esm/components/ui/tabs/Selector.styled.js.map +1 -1
- package/esm/components/ui/toaster/Notification.d.ts.map +1 -1
- package/esm/components/ui/toaster/Notification.js +4 -2
- package/esm/components/ui/toaster/Notification.js.map +1 -1
- package/esm/components/ui/toaster/Toaster.stories.d.ts +1 -1
- package/esm/components/ui/toaster/Toaster.stories.d.ts.map +1 -1
- package/esm/components/ui/toaster/Toaster.stories.js.map +1 -1
- package/esm/components/utils/HandleEsc.d.ts.map +1 -1
- package/esm/components/utils/HandleEsc.js +3 -3
- package/esm/components/utils/HandleEsc.js.map +1 -1
- package/esm/utils/useTailSpin.js +1 -1
- package/esm/utils/useTailSpin.js.map +1 -1
- package/package.json +2 -2
- package/src/components/form/Checkbox.stories.tsx +2 -3
- package/src/components/form/Checkbox.tsx +1 -2
- package/src/components/form/ColorPicker.stories.tsx +1 -2
- package/src/components/form/ColorPicker.tsx +0 -1
- package/src/components/form/Label.stories.tsx +0 -1
- package/src/components/form/Label.styled.ts +1 -1
- package/src/components/form/Select.stories.tsx +1 -1
- package/src/components/form/Suggestions.tsx +1 -1
- package/src/components/form/Toggle.styled.ts +1 -1
- package/src/components/form/Toggle.tsx +2 -1
- package/src/components/form/choice/Choice.stories.tsx +1 -2
- package/src/components/form/choice/Choice.tsx +3 -4
- package/src/components/form/choice/ChoiceItem.tsx +4 -3
- package/src/components/form/input/Input.stories.tsx +2 -3
- package/src/components/form/input/Input.styled.ts +0 -1
- package/src/components/form/input/Input.tsx +23 -15
- package/src/components/form/textarea/TextArea.stories.tsx +1 -1
- package/src/components/form/textarea/TextArea.styled.ts +1 -2
- package/src/components/icons/Back.tsx +6 -3
- package/src/components/icons/Battery.tsx +6 -3
- package/src/components/icons/Checkmark.tsx +6 -3
- package/src/components/icons/Config.tsx +6 -3
- package/src/components/icons/Dots.tsx +6 -3
- package/src/components/icons/Forward.tsx +6 -3
- package/src/components/icons/Heart.tsx +6 -3
- package/src/components/icons/Icon.stories.tsx +1 -2
- package/src/components/icons/Icon.tsx +16 -12
- package/src/components/icons/Search.tsx +6 -3
- package/src/components/icons/Trash.tsx +6 -3
- package/src/components/layout/card/Card.stories.tsx +0 -1
- package/src/components/layout/header/Header.stories.tsx +1 -2
- package/src/components/layout/header/Header.tsx +1 -1
- package/src/components/layout/header/HeaderIconAction.stories.tsx +49 -2
- package/src/components/layout/header/HeaderIconAction.styled.ts +4 -5
- package/src/components/layout/header/HeaderIconAction.tsx +23 -10
- package/src/components/layout/header/StickyHeader.stories.tsx +3 -3
- package/src/components/layout/header/StickyHeader.tsx +2 -4
- package/src/components/layout/list/Header.stories.tsx +1 -1
- package/src/components/layout/list/Header.tsx +12 -8
- package/src/components/layout/list/Item.stories.tsx +2 -2
- package/src/components/layout/list/Item.tsx +33 -26
- package/src/components/layout/list/Label.stories.tsx +2 -2
- package/src/components/layout/list/Label.tsx +1 -0
- package/src/components/layout/list/List.stories.tsx +2 -3
- package/src/components/layout/list/List.tsx +14 -14
- package/src/components/layout/list/Value.stories.tsx +3 -3
- package/src/components/layout/section/Section.stories.tsx +2 -3
- package/src/components/layout/section/Section.tsx +0 -1
- package/src/components/layout/table/Table.stories.tsx +1 -1
- package/src/components/ui/action/Action.stories.tsx +1 -1
- package/src/components/ui/action/Action.tsx +35 -11
- package/src/components/ui/action/EqualActions.stories.tsx +1 -2
- package/src/components/ui/button/Button.stories.tsx +1 -2
- package/src/components/ui/directionPad/Pad.stories.tsx +1 -1
- package/src/components/ui/directionPad/Pad.tsx +1 -1
- package/src/components/ui/drawer/Drawer.stories.tsx +3 -5
- package/src/components/ui/drawer/Drawer.tsx +2 -2
- package/src/components/ui/keyValue/KeyValue.stories.tsx +5 -6
- package/src/components/ui/keyValue/KeyValue.tsx +6 -5
- package/src/components/ui/loader/CoveringLoader.tsx +17 -11
- package/src/components/ui/loader/FullLoader.stories.tsx +1 -1
- package/src/components/ui/loader/FullLoader.tsx +7 -4
- package/src/components/ui/loader/Loader.tsx +15 -6
- package/src/components/ui/loader/Loading.stories.tsx +1 -2
- package/src/components/ui/loader/Loading.tsx +3 -1
- package/src/components/ui/loader/PopLoader.stories.tsx +1 -2
- package/src/components/ui/loader/PopLoader.tsx +9 -6
- package/src/components/ui/message/Message.stories.tsx +0 -1
- package/src/components/ui/message/Message.tsx +1 -2
- package/src/components/ui/modal/Modal.stories.tsx +5 -9
- package/src/components/ui/modal/Modal.styled.ts +1 -0
- package/src/components/ui/modal/Modal.tsx +24 -14
- package/src/components/ui/modal/ModalButtons.stories.tsx +2 -2
- package/src/components/ui/modal/ModalButtons.styled.ts +0 -1
- package/src/components/ui/pop/OnButtonClick.tsx +4 -2
- package/src/components/ui/pop/Pop.stories.tsx +2 -4
- package/src/components/ui/pop/Pop.tsx +7 -3
- package/src/components/ui/pop/PopOption.tsx +11 -5
- package/src/components/ui/progress/Progress.stories.tsx +1 -2
- package/src/components/ui/progress/Progress.styled.ts +1 -1
- package/src/components/ui/progress/Progress.tsx +0 -1
- package/src/components/ui/stats/Stats.stories.tsx +2 -3
- package/src/components/ui/stats/Stats.tsx +1 -1
- package/src/components/ui/tabs/Item.styled.ts +2 -0
- package/src/components/ui/tabs/Item.tsx +4 -2
- package/src/components/ui/tabs/Selector.stories.tsx +63 -3
- package/src/components/ui/tabs/Selector.styled.ts +74 -3
- package/src/components/ui/tabs/Selector.tsx +82 -7
- package/src/components/ui/toaster/Notification.tsx +6 -2
- package/src/components/ui/toaster/Toaster.stories.tsx +1 -2
- package/src/components/utils/HandleEsc.tsx +5 -4
- package/src/utils/useTailSpin.ts +1 -1
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
2
|
|
|
3
|
+
import { fnWithProps } from "../../../types/fnWithProps";
|
|
3
4
|
import { ICON } from "../../icons/Icon";
|
|
4
|
-
|
|
5
|
-
import { Value } from "./Value";
|
|
6
|
-
import { Label } from "./Label";
|
|
7
5
|
import { StyledIcon, StyledInnerContainer, StyledItem, StyledNoIcon } from "./Item.styled";
|
|
6
|
+
import { Label } from "./Label";
|
|
7
|
+
import { Value } from "./Value";
|
|
8
8
|
|
|
9
9
|
interface LinkProps {
|
|
10
10
|
href: string;
|
|
11
11
|
children: React.ReactNode;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
type Ratio = `${number}` |
|
|
14
|
+
type Ratio = `${number}` | "";
|
|
15
15
|
|
|
16
|
-
type SlashSeparatedNumbers
|
|
17
|
-
| Ratio
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
16
|
+
type SlashSeparatedNumbers
|
|
17
|
+
= | Ratio
|
|
18
|
+
| `${Ratio}/${Ratio}`
|
|
19
|
+
| `${Ratio}/${Ratio}/${Ratio}`
|
|
20
|
+
| `${Ratio}/${Ratio}/${Ratio}/${Ratio}`
|
|
21
|
+
| `${Ratio}/${Ratio}/${Ratio}/${Ratio}/${Ratio}`
|
|
22
|
+
| `${Ratio}/${Ratio}/${Ratio}/${Ratio}/${Ratio}/${Ratio}`
|
|
23
|
+
| `${Ratio}/${Ratio}/${Ratio}/${Ratio}/${Ratio}/${Ratio}/${Ratio}`
|
|
24
|
+
| `${Ratio}/${Ratio}/${Ratio}/${Ratio}/${Ratio}/${Ratio}/${Ratio}/${Ratio}`
|
|
25
|
+
| `${Ratio}/${Ratio}/${Ratio}/${Ratio}/${Ratio}/${Ratio}/${Ratio}/${Ratio}/${Ratio}`
|
|
26
|
+
| `${Ratio}/${Ratio}/${Ratio}/${Ratio}/${Ratio}/${Ratio}/${Ratio}/${Ratio}/${Ratio}/${Ratio}`;
|
|
27
27
|
|
|
28
28
|
interface Props {
|
|
29
29
|
href?: string;
|
|
@@ -41,7 +41,7 @@ interface SubComponents {
|
|
|
41
41
|
const icon = <StyledIcon name={ICON.forward} />;
|
|
42
42
|
const noIcon = <StyledNoIcon />;
|
|
43
43
|
|
|
44
|
-
const
|
|
44
|
+
const ListItemInnerContainerClassNameSelector = StyledInnerContainer.toString();
|
|
45
45
|
type StyledItemProps = React.ComponentProps<typeof StyledItem>;
|
|
46
46
|
|
|
47
47
|
/**
|
|
@@ -66,7 +66,9 @@ type StyledItemProps = React.ComponentProps<typeof StyledItem>;
|
|
|
66
66
|
* - `to`: if given it will render an anchor tag wrapped in a link using the given `Link` component
|
|
67
67
|
* - `onClick`: if given it will render a button tag with the given onClick handler (it can be passed with `href` too)
|
|
68
68
|
*/
|
|
69
|
-
const
|
|
69
|
+
const ItemBase = forwardRef<
|
|
70
|
+
HTMLLIElement, StyledItemProps & Props
|
|
71
|
+
>(({ href, to, onClick, Link, ratio, ...props }, ref) => {
|
|
70
72
|
const r = ratio ? ratio.split("/") : [];
|
|
71
73
|
|
|
72
74
|
const pre = typeof props.selected === "boolean"
|
|
@@ -96,7 +98,7 @@ const Item: React.FC<StyledItemProps & Props> & SubComponents = ({ href, to, onC
|
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
return (
|
|
99
|
-
<StyledItem {...props}>
|
|
101
|
+
<StyledItem {...props} ref={ref}>
|
|
100
102
|
<Link href={to}><StyledInnerContainer as={"a"} href={to}>{pre}{ren}</StyledInnerContainer></Link>
|
|
101
103
|
</StyledItem>
|
|
102
104
|
);
|
|
@@ -104,7 +106,7 @@ const Item: React.FC<StyledItemProps & Props> & SubComponents = ({ href, to, onC
|
|
|
104
106
|
|
|
105
107
|
if (href) {
|
|
106
108
|
return (
|
|
107
|
-
<StyledItem {...props}>
|
|
109
|
+
<StyledItem {...props} ref={ref}>
|
|
108
110
|
<StyledInnerContainer as={"a"} href={href} onClick={onClick}>{pre}{ren}</StyledInnerContainer>
|
|
109
111
|
</StyledItem>
|
|
110
112
|
);
|
|
@@ -112,19 +114,24 @@ const Item: React.FC<StyledItemProps & Props> & SubComponents = ({ href, to, onC
|
|
|
112
114
|
|
|
113
115
|
if (onClick) {
|
|
114
116
|
return (
|
|
115
|
-
<StyledItem {...props}>
|
|
117
|
+
<StyledItem {...props} ref={ref}>
|
|
116
118
|
<StyledInnerContainer as={"button"} onClick={onClick}>{pre}{ren}</StyledInnerContainer>
|
|
117
119
|
</StyledItem>
|
|
118
120
|
);
|
|
119
121
|
}
|
|
120
122
|
|
|
121
|
-
return <StyledItem {...props}><StyledInnerContainer>{pre}{ren}</StyledInnerContainer></StyledItem>;
|
|
122
|
-
};
|
|
123
|
+
return <StyledItem {...props} ref={ref}><StyledInnerContainer>{pre}{ren}</StyledInnerContainer></StyledItem>;
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
ItemBase.displayName = "List.Item";
|
|
123
127
|
|
|
124
|
-
Item
|
|
125
|
-
|
|
128
|
+
const Item = fnWithProps(ItemBase, {
|
|
129
|
+
Label,
|
|
130
|
+
Value,
|
|
131
|
+
});
|
|
132
|
+
Item.toString = () => StyledItem.toString();
|
|
126
133
|
|
|
127
|
-
export { Item,
|
|
134
|
+
export { Item, ListItemInnerContainerClassNameSelector };
|
|
128
135
|
|
|
129
136
|
export type {
|
|
130
137
|
Props as ItemProps,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
|
-
import type {
|
|
3
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
4
4
|
|
|
5
|
+
import { Item } from "./Item";
|
|
5
6
|
import { Label } from "./Label";
|
|
6
7
|
import { List } from "./List";
|
|
7
|
-
import { Item } from "./Item";
|
|
8
8
|
|
|
9
9
|
const meta: Meta = {
|
|
10
10
|
title: "Components/Layout/List/Label",
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
import { Icon, ICON } from "../../icons/Icon";
|
|
3
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
6
4
|
|
|
5
|
+
import { ICON, Icon } from "../../icons/Icon";
|
|
7
6
|
import { List } from "./List";
|
|
8
7
|
|
|
9
8
|
const meta: Meta = {
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
2
|
|
|
3
3
|
import { pxToRem, styled } from "../../../theme";
|
|
4
|
-
|
|
4
|
+
import { fnWithProps } from "../../../types/fnWithProps";
|
|
5
5
|
import { Header } from "./Header";
|
|
6
|
-
import { Item } from "./Item";
|
|
7
|
-
|
|
8
|
-
interface SubComponents {
|
|
9
|
-
Header: typeof Header;
|
|
10
|
-
Item: typeof Item;
|
|
11
|
-
}
|
|
6
|
+
import { Item, ListItemInnerContainerClassNameSelector } from "./Item";
|
|
12
7
|
|
|
13
8
|
const StyledList = styled("ul", {
|
|
14
9
|
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
@@ -38,7 +33,7 @@ type StyledListProps = React.ComponentProps<typeof StyledList>;
|
|
|
38
33
|
*
|
|
39
34
|
* See `Item` and `Header` for more information about their usage.
|
|
40
35
|
*/
|
|
41
|
-
const
|
|
36
|
+
const ListBase = forwardRef<HTMLUListElement, StyledListProps>((props, ref) => {
|
|
42
37
|
const chld = React.Children.map(props.children, (child) => {
|
|
43
38
|
if (child && typeof child === "object" && "type" in child && (child.type === Item || child.type === Header)) {
|
|
44
39
|
return React.cloneElement(child, {
|
|
@@ -49,10 +44,15 @@ const List: React.FC<StyledListProps> & SubComponents = (props) => {
|
|
|
49
44
|
});
|
|
50
45
|
|
|
51
46
|
return (
|
|
52
|
-
<StyledList {...props}>{chld}</StyledList>
|
|
47
|
+
<StyledList {...props} ref={ref}>{chld}</StyledList>
|
|
53
48
|
);
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
|
|
49
|
+
});
|
|
50
|
+
ListBase.displayName = "List";
|
|
51
|
+
|
|
52
|
+
const List = fnWithProps(ListBase, { // it will keep displayName
|
|
53
|
+
Header,
|
|
54
|
+
Item,
|
|
55
|
+
});
|
|
56
|
+
List.toString = () => StyledList.toString();
|
|
57
57
|
|
|
58
|
-
export { List };
|
|
58
|
+
export { List, ListItemInnerContainerClassNameSelector };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
|
-
import type {
|
|
3
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
4
4
|
|
|
5
|
-
import { Value } from "./Value";
|
|
6
|
-
import { List } from "./List";
|
|
7
5
|
import { Item } from "./Item";
|
|
6
|
+
import { List } from "./List";
|
|
7
|
+
import { Value } from "./Value";
|
|
8
8
|
|
|
9
9
|
const meta: Meta = {
|
|
10
10
|
title: "Components/Layout/List/Value",
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
|
-
import type {
|
|
3
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
4
4
|
|
|
5
|
-
import { List } from "../list/List";
|
|
6
5
|
import { Item } from "../list/Item";
|
|
7
|
-
|
|
6
|
+
import { List } from "../list/List";
|
|
8
7
|
import { Section } from "./Section";
|
|
9
8
|
|
|
10
9
|
const meta: Meta = {
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { ReactNode } from "react";
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
3
2
|
|
|
4
3
|
import { omit } from "@ezez/utils";
|
|
5
4
|
|
|
6
|
-
import type {
|
|
5
|
+
import type { ReactNode } from "react";
|
|
7
6
|
import type { ThemeCSS } from "../../../theme";
|
|
7
|
+
import type { ICON } from "../../icons/Icon";
|
|
8
8
|
|
|
9
9
|
import { Icon } from "../../icons/Icon";
|
|
10
|
-
|
|
11
10
|
import { Anchor, Badge, Button, StyledAction } from "./Action.styled";
|
|
12
11
|
|
|
13
12
|
interface LinkProps { // @TODO extract? - same on list item
|
|
@@ -73,7 +72,7 @@ type Props = (NativeLinkProps | RouterLinkProps | ButtonProps) & CommonProps;
|
|
|
73
72
|
*
|
|
74
73
|
* Its label is displayed below the circular shape.
|
|
75
74
|
*/
|
|
76
|
-
const Action
|
|
75
|
+
const Action = forwardRef<HTMLAnchorElement | HTMLButtonElement, Props>((props, ref) => { // eslint-disable-line max-lines-per-function
|
|
77
76
|
const { icon, label, css, ..._restProps } = props;
|
|
78
77
|
const restProps = omit(
|
|
79
78
|
_restProps as Record<string, unknown>, ["to", "Link", "href", "type"],
|
|
@@ -82,7 +81,7 @@ const Action: React.FC<Props> = (props) => {
|
|
|
82
81
|
|
|
83
82
|
let iconElem: ReactNode = icon;
|
|
84
83
|
if (typeof icon === "string") {
|
|
85
|
-
iconElem = <Icon name={icon as ICON} />;
|
|
84
|
+
iconElem = <Icon name={icon as ICON} />;
|
|
86
85
|
}
|
|
87
86
|
|
|
88
87
|
const labelElem = label ? <div>{label}</div> : null;
|
|
@@ -101,22 +100,47 @@ const Action: React.FC<Props> = (props) => {
|
|
|
101
100
|
|
|
102
101
|
return (
|
|
103
102
|
<props.Link href={props.to} {...restProps}>
|
|
104
|
-
<Anchor className={props.className} {...maybeCss}>
|
|
103
|
+
<Anchor ref={ref as React.Ref<HTMLAnchorElement>} className={props.className} {...maybeCss}>
|
|
104
|
+
{content}
|
|
105
|
+
</Anchor>
|
|
105
106
|
</props.Link>
|
|
106
107
|
);
|
|
107
108
|
}
|
|
108
109
|
|
|
109
110
|
if ("href" in props) {
|
|
110
|
-
return
|
|
111
|
+
return (
|
|
112
|
+
<Anchor
|
|
113
|
+
ref={ref as React.Ref<HTMLAnchorElement>}
|
|
114
|
+
href={props.href}
|
|
115
|
+
className={props.className}
|
|
116
|
+
{...restProps}
|
|
117
|
+
{...maybeCss}
|
|
118
|
+
>
|
|
119
|
+
{content}
|
|
120
|
+
</Anchor>
|
|
121
|
+
);
|
|
111
122
|
}
|
|
112
123
|
|
|
113
124
|
return (
|
|
114
|
-
|
|
125
|
+
|
|
126
|
+
<Button
|
|
127
|
+
ref={ref as React.Ref<HTMLButtonElement>}
|
|
128
|
+
onClick={props.onClick}
|
|
129
|
+
className={props.className}
|
|
130
|
+
{...maybeCss}
|
|
131
|
+
type={props.type ?? "button"}
|
|
132
|
+
>
|
|
115
133
|
{content}
|
|
116
134
|
</Button>
|
|
117
135
|
);
|
|
118
|
-
};
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
Action.displayName = "Action";
|
|
139
|
+
Action.toString = () => Button.toString();
|
|
140
|
+
|
|
141
|
+
const ActionCircleSelector = StyledAction.toString();
|
|
142
|
+
const ActionBadgeSelector = Badge.toString();
|
|
119
143
|
|
|
120
|
-
export { Action };
|
|
144
|
+
export { Action, ActionCircleSelector, ActionBadgeSelector };
|
|
121
145
|
|
|
122
146
|
export type { Props as ActionProps };
|
|
@@ -3,9 +3,8 @@ import React from "react";
|
|
|
3
3
|
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
4
4
|
|
|
5
5
|
import { ICON } from "../../icons/Icon";
|
|
6
|
-
|
|
7
|
-
import { EqualActions } from "./EqualActions";
|
|
8
6
|
import { Action } from "./Action";
|
|
7
|
+
import { EqualActions } from "./EqualActions";
|
|
9
8
|
|
|
10
9
|
const meta: Meta<typeof EqualActions> = {
|
|
11
10
|
title: "Components/UI/EqualActions",
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React, { useCallback } from "react";
|
|
2
2
|
|
|
3
|
-
import type {
|
|
3
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
4
4
|
|
|
5
5
|
import { styled } from "../../../theme";
|
|
6
|
-
|
|
7
6
|
import { Button } from "./Button";
|
|
8
7
|
|
|
9
8
|
// TODO better docs
|
|
@@ -2,7 +2,7 @@ import React, { forwardRef } from "react";
|
|
|
2
2
|
|
|
3
3
|
import { PadButton as Button, PadButtonDotSelector } from "./Button";
|
|
4
4
|
import { PadMiddle as Middle } from "./Middle";
|
|
5
|
-
import {
|
|
5
|
+
import { StyledLine, StyledPad } from "./Pad.styled";
|
|
6
6
|
|
|
7
7
|
type DirectionPadProps = {
|
|
8
8
|
onUpPress?: () => void;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useCallback, useState } from "react";
|
|
2
2
|
|
|
3
3
|
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
4
4
|
|
|
5
5
|
import { styled } from "../../../theme";
|
|
6
6
|
import { Section } from "../../layout/section/Section";
|
|
7
7
|
import { Button } from "../button/Button";
|
|
8
|
-
|
|
9
8
|
import { Drawer } from "./Drawer";
|
|
10
9
|
|
|
11
10
|
const meta: Meta<typeof Drawer> = {
|
|
@@ -56,7 +55,6 @@ const Default: Story = {
|
|
|
56
55
|
*/
|
|
57
56
|
const NoEscClose: Story = {
|
|
58
57
|
render: () => {
|
|
59
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
60
58
|
const [open, setOpen] = useState(false);
|
|
61
59
|
|
|
62
60
|
const handleToggleOpen = useCallback(() => {
|
|
@@ -106,8 +104,8 @@ const WithLongContent: Story = {
|
|
|
106
104
|
<div style={{ padding: "20px" }}>
|
|
107
105
|
<h2>Drawer with Long Content</h2>
|
|
108
106
|
<p>This drawer has enough content to demonstrate scrolling behavior.</p>
|
|
109
|
-
{Array(20).fill(0).map((_, i) => (
|
|
110
|
-
<Section key={
|
|
107
|
+
{Array(20).fill(0).map((_: number, i) => (
|
|
108
|
+
<Section key={i} vertical={true} horizontal={true}> {/* eslint-disable-line react/no-array-index-key */}
|
|
111
109
|
<h3>Section {i + 1}</h3>
|
|
112
110
|
<p>This is content section {i + 1} in the scrollable drawer.</p>
|
|
113
111
|
</Section>
|
|
@@ -3,8 +3,7 @@ import React, { forwardRef, useEffect, useRef, useState } from "react";
|
|
|
3
3
|
import { Timeout } from "oop-timers";
|
|
4
4
|
|
|
5
5
|
import { HandleEsc } from "../../utils/HandleEsc";
|
|
6
|
-
|
|
7
|
-
import { StyledDrawer, Content } from "./Drawer.styled";
|
|
6
|
+
import { Content, StyledDrawer } from "./Drawer.styled";
|
|
8
7
|
|
|
9
8
|
const RENDER_TIMEOUT = 500;
|
|
10
9
|
|
|
@@ -34,6 +33,7 @@ const Drawer = forwardRef<HTMLDivElement, DrawerProps>((props, ref) => {
|
|
|
34
33
|
useEffect(() => {
|
|
35
34
|
if (props.isOpen) {
|
|
36
35
|
timeoutRef.current?.stop();
|
|
36
|
+
// eslint-disable-next-line react-hooks/set-state-in-effect
|
|
37
37
|
setShouldRenderWhenClosed(true);
|
|
38
38
|
}
|
|
39
39
|
else {
|
|
@@ -5,9 +5,8 @@ import { omit } from "@ezez/utils";
|
|
|
5
5
|
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
6
6
|
|
|
7
7
|
import { styled } from "../../../theme";
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
import { KeyValue, KeyValueKeySelector, KeyValueValueSelector, KeyValueIconSelector } from "./KeyValue";
|
|
8
|
+
import { ICON, Icon } from "../../icons/Icon";
|
|
9
|
+
import { KeyValue, KeyValueIconSelector, KeyValueKeySelector, KeyValueValueSelector } from "./KeyValue";
|
|
11
10
|
|
|
12
11
|
const meta: Meta<typeof KeyValue> = {
|
|
13
12
|
title: "UI/KeyValue",
|
|
@@ -92,7 +91,7 @@ const items = [
|
|
|
92
91
|
*/
|
|
93
92
|
const Default: Story = {
|
|
94
93
|
args: {
|
|
95
|
-
items
|
|
94
|
+
items,
|
|
96
95
|
valueFirst: true,
|
|
97
96
|
cols: 3,
|
|
98
97
|
},
|
|
@@ -103,7 +102,7 @@ const Default: Story = {
|
|
|
103
102
|
*/
|
|
104
103
|
const TwoColumn: Story = {
|
|
105
104
|
args: {
|
|
106
|
-
items
|
|
105
|
+
items,
|
|
107
106
|
valueFirst: false,
|
|
108
107
|
cols: 2,
|
|
109
108
|
},
|
|
@@ -114,7 +113,7 @@ const TwoColumn: Story = {
|
|
|
114
113
|
*/
|
|
115
114
|
const SingleColumn: Story = {
|
|
116
115
|
args: {
|
|
117
|
-
items
|
|
116
|
+
items,
|
|
118
117
|
valueFirst: false,
|
|
119
118
|
cols: 1,
|
|
120
119
|
},
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import type { ReactElement } from "react";
|
|
2
1
|
import React, { forwardRef } from "react";
|
|
3
2
|
|
|
3
|
+
import type { ReactElement } from "react";
|
|
4
|
+
|
|
4
5
|
import {
|
|
5
6
|
Container,
|
|
7
|
+
Icon,
|
|
6
8
|
Item,
|
|
7
9
|
Key,
|
|
8
10
|
KeyValuePair,
|
|
9
11
|
Value,
|
|
10
|
-
Icon,
|
|
11
12
|
} from "./KeyValue.styled";
|
|
12
13
|
|
|
13
14
|
type KeyValueProps = {
|
|
14
|
-
items: { key?: React.ReactNode; value?: React.ReactNode; icon?: React.ReactNode; onClick?: () => void }
|
|
15
|
+
items: Array<{ key?: React.ReactNode; value?: React.ReactNode; icon?: React.ReactNode; onClick?: () => void }>;
|
|
15
16
|
cols?: number;
|
|
16
17
|
valueFirst?: boolean;
|
|
17
18
|
className?: string;
|
|
@@ -43,8 +44,8 @@ const KeyValue = forwardRef<HTMLDivElement, KeyValueProps>((props, ref) => {
|
|
|
43
44
|
const component = value.onClick ? "button" : "div";
|
|
44
45
|
return React.createElement(Item, {
|
|
45
46
|
// eslint-disable-next-line react/no-array-index-key
|
|
46
|
-
key
|
|
47
|
-
style
|
|
47
|
+
key,
|
|
48
|
+
style,
|
|
48
49
|
// @ts-expect-error idk why ts can't figure it out, but it works
|
|
49
50
|
as: component,
|
|
50
51
|
notFirstRow: !isFirstRow,
|
|
@@ -40,6 +40,8 @@ const CoveringLoader = forwardRef<HTMLElement, Props>(({ // eslint-disable-line
|
|
|
40
40
|
const id = "miui-" + useId().replace(/:/gu, "-");
|
|
41
41
|
const stylesheet = useRef<HTMLStyleElement>();
|
|
42
42
|
|
|
43
|
+
const currentRef = innerRef.current;
|
|
44
|
+
|
|
43
45
|
useEffect(() => {
|
|
44
46
|
const styleEl = document.createElement("style");
|
|
45
47
|
document.head.appendChild(styleEl);
|
|
@@ -52,7 +54,7 @@ const CoveringLoader = forwardRef<HTMLElement, Props>(({ // eslint-disable-line
|
|
|
52
54
|
|
|
53
55
|
// eslint-disable-next-line max-lines-per-function,max-statements
|
|
54
56
|
const effect = () => {
|
|
55
|
-
const current =
|
|
57
|
+
const current = currentRef as HTMLElement | null;
|
|
56
58
|
if (current !== null && !(current instanceof HTMLElement)) {
|
|
57
59
|
throw new Error(
|
|
58
60
|
"CoveringLoader child ref is not an HTMLElement, got: (" + typeof current + ") " + String(current),
|
|
@@ -65,13 +67,15 @@ const CoveringLoader = forwardRef<HTMLElement, Props>(({ // eslint-disable-line
|
|
|
65
67
|
let extraLoaderElem: HTMLDivElement | null = null;
|
|
66
68
|
|
|
67
69
|
if (mode === "over") {
|
|
68
|
-
const prnt = current.parentElement
|
|
69
|
-
prnt.classList.add("parent-" + id);
|
|
70
|
+
const prnt = current.parentElement;
|
|
70
71
|
extraLoaderElem = document.createElement("div");
|
|
71
72
|
extraLoaderElem.classList.add(id);
|
|
72
|
-
prnt
|
|
73
|
-
|
|
74
|
-
prnt.
|
|
73
|
+
if (prnt) {
|
|
74
|
+
prnt.classList.add("parent-" + id);
|
|
75
|
+
prnt.appendChild(extraLoaderElem);
|
|
76
|
+
if (inertMode === "block-interaction") {
|
|
77
|
+
prnt.inert = true;
|
|
78
|
+
}
|
|
75
79
|
}
|
|
76
80
|
}
|
|
77
81
|
else {
|
|
@@ -119,11 +123,13 @@ ${inertCss}`;
|
|
|
119
123
|
return () => {
|
|
120
124
|
stylesheet.current!.textContent = "";
|
|
121
125
|
if (mode === "over") {
|
|
122
|
-
const prnt = current.parentElement
|
|
126
|
+
const prnt = current.parentElement;
|
|
123
127
|
extraLoaderElem?.remove();
|
|
124
|
-
prnt
|
|
125
|
-
|
|
126
|
-
|
|
128
|
+
if (prnt) {
|
|
129
|
+
prnt.classList.add("parent-" + id);
|
|
130
|
+
if (inertMode === "block-interaction") {
|
|
131
|
+
prnt.inert = false;
|
|
132
|
+
}
|
|
127
133
|
}
|
|
128
134
|
}
|
|
129
135
|
else {
|
|
@@ -135,7 +141,7 @@ ${inertCss}`;
|
|
|
135
141
|
};
|
|
136
142
|
};
|
|
137
143
|
|
|
138
|
-
useEffect(effect, [
|
|
144
|
+
useEffect(effect, [currentRef, spinnerBg, show, color, size, speed, mode, inertMode, id]);
|
|
139
145
|
|
|
140
146
|
return cloneElement(Children.only(children), {
|
|
141
147
|
ref: innerRef,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
2
|
|
|
3
3
|
import type { LoaderProps } from "./Loader";
|
|
4
4
|
|
|
@@ -16,8 +16,11 @@ const Container = styled("div", {
|
|
|
16
16
|
/**
|
|
17
17
|
* A loader that renders in the middle of available space
|
|
18
18
|
*/
|
|
19
|
-
const FullLoader
|
|
20
|
-
return <Container><Loader {...props} /></Container>;
|
|
21
|
-
};
|
|
19
|
+
const FullLoader = forwardRef<HTMLDivElement, LoaderProps>(({ className, ...props }, ref) => {
|
|
20
|
+
return <Container ref={ref} className={className}><Loader {...props} /></Container>;
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
FullLoader.displayName = "FullLoader";
|
|
24
|
+
FullLoader.toString = () => Container.toString();
|
|
22
25
|
|
|
23
26
|
export { FullLoader };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
2
|
|
|
3
3
|
import { useTailSpin } from "../../../utils";
|
|
4
4
|
import { Div } from "../../native";
|
|
@@ -20,6 +20,7 @@ interface Props {
|
|
|
20
20
|
* Whether to show the spinner or not
|
|
21
21
|
*/
|
|
22
22
|
show?: boolean | undefined | null;
|
|
23
|
+
className?: string;
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
const DEFAULT_SPEED = 400;
|
|
@@ -31,20 +32,28 @@ const DEFAULT_SIZE = "2rem";
|
|
|
31
32
|
* Based on MIT licensed code by Sam Herbert
|
|
32
33
|
* https://github.com/SamHerbert/SVG-Loaders/blob/master/svg-loaders/tail-spin.svg
|
|
33
34
|
*/
|
|
34
|
-
const Loader
|
|
35
|
+
const Loader = forwardRef<HTMLDivElement, Props>(({
|
|
35
36
|
color = "currentColor", speed = DEFAULT_SPEED, size = DEFAULT_SIZE,
|
|
37
|
+
className, show,
|
|
36
38
|
...props
|
|
37
|
-
}) => {
|
|
39
|
+
}, ref) => {
|
|
38
40
|
const spinnerBg = useTailSpin({ size, color, speed });
|
|
39
41
|
|
|
40
|
-
if (
|
|
42
|
+
if (show === false) {
|
|
41
43
|
return null;
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
return (
|
|
45
|
-
<Div
|
|
47
|
+
<Div
|
|
48
|
+
ref={ref}
|
|
49
|
+
className={className}
|
|
50
|
+
css={{ width: size, height: size, backgroundImage: `url('${spinnerBg}')` }}
|
|
51
|
+
/>
|
|
46
52
|
);
|
|
47
|
-
};
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
Loader.displayName = "Loader";
|
|
56
|
+
Loader.toString = () => Div.toString();
|
|
48
57
|
|
|
49
58
|
export { Loader };
|
|
50
59
|
export type { Props as LoaderProps };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
|
-
import type {
|
|
3
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
4
4
|
|
|
5
5
|
import { styled } from "../../../theme";
|
|
6
|
-
|
|
7
6
|
import { Loading } from "./Loading";
|
|
8
7
|
|
|
9
8
|
const meta: Meta = {
|