react-miui 0.34.0 → 0.36.0
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 +2 -1
- package/CHANGELOG.md +17 -0
- package/dist/components/form/index.d.ts +1 -0
- package/dist/components/form/index.d.ts.map +1 -1
- package/dist/components/form/index.js +1 -0
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/form/input/Input.d.ts.map +1 -1
- package/dist/components/form/input/Input.js +9 -5
- package/dist/components/form/input/Input.js.map +1 -1
- package/dist/components/form/timepicker/TimePicker.css.d.ts +99 -0
- package/dist/components/form/timepicker/TimePicker.css.d.ts.map +1 -0
- package/dist/components/form/timepicker/TimePicker.css.js +116 -0
- package/dist/components/form/timepicker/TimePicker.css.js.map +1 -0
- package/dist/components/form/timepicker/TimePicker.d.ts +22 -0
- package/dist/components/form/timepicker/TimePicker.d.ts.map +1 -0
- package/dist/components/form/timepicker/TimePicker.js +141 -0
- package/dist/components/form/timepicker/TimePicker.js.map +1 -0
- package/dist/components/form/timepicker/TimePicker.styled.d.ts +936 -0
- package/dist/components/form/timepicker/TimePicker.styled.d.ts.map +1 -0
- package/dist/components/form/timepicker/TimePicker.styled.js +29 -0
- package/dist/components/form/timepicker/TimePicker.styled.js.map +1 -0
- package/dist/components/form/timepicker/TimePickerModal.d.ts +17 -0
- package/dist/components/form/timepicker/TimePickerModal.d.ts.map +1 -0
- package/dist/components/form/timepicker/TimePickerModal.js +92 -0
- package/dist/components/form/timepicker/TimePickerModal.js.map +1 -0
- package/dist/components/form/timepicker/Wheel.d.ts +12 -0
- package/dist/components/form/timepicker/Wheel.d.ts.map +1 -0
- package/dist/components/form/timepicker/Wheel.js +187 -0
- package/dist/components/form/timepicker/Wheel.js.map +1 -0
- package/dist/components/form/timepicker/utils.d.ts +4 -0
- package/dist/components/form/timepicker/utils.d.ts.map +1 -0
- package/dist/components/form/timepicker/utils.js +62 -0
- package/dist/components/form/timepicker/utils.js.map +1 -0
- package/dist/components/icons/Clock.d.ts +7 -0
- package/dist/components/icons/Clock.d.ts.map +1 -0
- package/dist/components/icons/Clock.js +45 -0
- package/dist/components/icons/Clock.js.map +1 -0
- package/dist/components/icons/Icon.d.ts +2 -1
- package/dist/components/icons/Icon.d.ts.map +1 -1
- package/dist/components/icons/Icon.js +3 -0
- package/dist/components/icons/Icon.js.map +1 -1
- package/dist/components/layout/header/HeaderIconAction.d.ts.map +1 -1
- package/dist/components/layout/header/HeaderIconAction.js +13 -3
- package/dist/components/layout/header/HeaderIconAction.js.map +1 -1
- package/dist/components/layout/header/HeaderIconAction.styled.d.ts.map +1 -1
- package/dist/components/layout/header/HeaderIconAction.styled.js +11 -17
- package/dist/components/layout/header/HeaderIconAction.styled.js.map +1 -1
- package/dist/components/layout/list/Item.d.ts.map +1 -1
- package/dist/components/layout/list/Item.js +17 -7
- package/dist/components/layout/list/Item.js.map +1 -1
- package/dist/components/layout/list/Item.styled.d.ts.map +1 -1
- package/dist/components/layout/list/Item.styled.js +2 -1
- package/dist/components/layout/list/Item.styled.js.map +1 -1
- package/dist/components/ui/button/Button.d.ts +94 -1
- package/dist/components/ui/button/Button.d.ts.map +1 -1
- package/dist/components/ui/button/Button.js +59 -2
- package/dist/components/ui/button/Button.js.map +1 -1
- package/dist/components/ui/button/Button.styled.d.ts +2 -2
- package/dist/components/ui/button/Button.styled.d.ts.map +1 -1
- package/dist/components/ui/button/Button.styled.js +4 -3
- package/dist/components/ui/button/Button.styled.js.map +1 -1
- package/dist/components/ui/directionPad/Button.d.ts.map +1 -1
- package/dist/components/ui/directionPad/Button.js +7 -2
- package/dist/components/ui/directionPad/Button.js.map +1 -1
- package/dist/components/ui/directionPad/Button.styled.d.ts.map +1 -1
- package/dist/components/ui/directionPad/Button.styled.js +2 -1
- package/dist/components/ui/directionPad/Button.styled.js.map +1 -1
- package/dist/components/ui/directionPad/Middle.d.ts.map +1 -1
- package/dist/components/ui/directionPad/Middle.js +7 -1
- package/dist/components/ui/directionPad/Middle.js.map +1 -1
- package/dist/components/ui/directionPad/Middle.styled.d.ts.map +1 -1
- package/dist/components/ui/directionPad/Middle.styled.js +2 -1
- package/dist/components/ui/directionPad/Middle.styled.js.map +1 -1
- package/dist/components/ui/modal/Modal.d.ts +1 -2
- package/dist/components/ui/modal/Modal.d.ts.map +1 -1
- package/dist/components/ui/modal/Modal.js +114 -42
- package/dist/components/ui/modal/Modal.js.map +1 -1
- package/dist/components/ui/modal/Modal.styled.d.ts +1 -1
- package/dist/components/ui/modal/Modal.styled.d.ts.map +1 -1
- package/dist/components/ui/modal/Modal.styled.js +40 -25
- package/dist/components/ui/modal/Modal.styled.js.map +1 -1
- package/dist/components/ui/modal/ModalButtons.d.ts +179 -1
- package/dist/components/ui/modal/ModalButtons.d.ts.map +1 -1
- package/dist/components/ui/modal/ModalButtons.js +63 -2
- package/dist/components/ui/modal/ModalButtons.js.map +1 -1
- package/dist/components/ui/modal/ModalButtons.styled.d.ts +90 -91
- package/dist/components/ui/modal/ModalButtons.styled.d.ts.map +1 -1
- package/dist/components/ui/modal/ModalButtons.styled.js +5 -7
- package/dist/components/ui/modal/ModalButtons.styled.js.map +1 -1
- package/dist/components/ui/pop/Pop.styled.d.ts.map +1 -1
- package/dist/components/ui/pop/Pop.styled.js +15 -17
- package/dist/components/ui/pop/Pop.styled.js.map +1 -1
- package/dist/components/ui/pop/PopOption.d.ts.map +1 -1
- package/dist/components/ui/pop/PopOption.js +7 -2
- package/dist/components/ui/pop/PopOption.js.map +1 -1
- package/dist/components/ui/toolButton/ToolButton.d.ts +94 -1
- package/dist/components/ui/toolButton/ToolButton.d.ts.map +1 -1
- package/dist/components/ui/toolButton/ToolButton.js +59 -2
- package/dist/components/ui/toolButton/ToolButton.js.map +1 -1
- package/dist/components/ui/toolButton/ToolButton.styled.d.ts +2 -2
- package/dist/components/ui/toolButton/ToolButton.styled.d.ts.map +1 -1
- package/dist/components/ui/toolButton/ToolButton.styled.js +20 -25
- package/dist/components/ui/toolButton/ToolButton.styled.js.map +1 -1
- package/dist/theme.css-global.d.ts.map +1 -1
- package/dist/theme.css-global.js +0 -1
- package/dist/theme.css-global.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/useNativeValidity.d.ts +11 -0
- package/dist/utils/useNativeValidity.d.ts.map +1 -0
- package/dist/utils/useNativeValidity.js +32 -0
- package/dist/utils/useNativeValidity.js.map +1 -0
- package/dist/utils/useRipple.d.ts +15 -0
- package/dist/utils/useRipple.d.ts.map +1 -0
- package/dist/utils/useRipple.js +120 -0
- package/dist/utils/useRipple.js.map +1 -0
- package/dist/utils/useRipple.styled.d.ts +28 -0
- package/dist/utils/useRipple.styled.d.ts.map +1 -0
- package/dist/utils/useRipple.styled.js +36 -0
- package/dist/utils/useRipple.styled.js.map +1 -0
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/index.Pop.html +7 -7
- package/docs/documents/Test.html +2 -2
- package/docs/enums/index.ICON.html +3 -2
- package/docs/functions/index.Action.html +3 -3
- package/docs/functions/index.Button.html +3 -9
- 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 +3 -3
- 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 +3 -3
- package/docs/functions/index.Icon-1.html +2 -2
- 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 +2 -2
- package/docs/functions/index.Loader.html +3 -3
- package/docs/functions/index.Loading.html +3 -3
- package/docs/functions/index.Message.html +3 -3
- package/docs/functions/index.Modal.html +2 -2
- package/docs/functions/index.ModalButtons.html +3 -3
- package/docs/functions/index.PopLoader.html +3 -3
- package/docs/functions/index.PopOption.html +2 -2
- 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.TimePicker.html +10 -0
- package/docs/functions/index.ToasterProvider.html +3 -3
- package/docs/functions/index.Toggle.html +3 -3
- package/docs/functions/index.ToolButton.html +3 -9
- package/docs/functions/index.Tooltip.html +3 -3
- package/docs/functions/index.TooltipProvider.html +2 -2
- 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.toast.html +2 -2
- 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 +3 -3
- package/docs/interfaces/index.LoaderProps.html +6 -6
- package/docs/interfaces/index.StickyHeaderProps.html +4 -4
- package/docs/interfaces/index.ToasterProviderProps.html +3 -3
- package/docs/interfaces/index.TooltipProps.html +14 -14
- package/docs/interfaces/index.TooltipProviderProps.html +5 -5
- 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.DrawerFrom.html +1 -1
- package/docs/types/index.DrawerProps.html +2 -2
- 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.TimePickerProps.html +1 -0
- package/docs/types/index.ToggleProps.html +2 -2
- package/docs/variables/index.ActionBadgeSelector.html +1 -1
- package/docs/variables/index.ActionCircleSelector.html +1 -1
- 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 -1
- package/docs/variables/index.InputContainerSelector.html +1 -1
- package/docs/variables/index.InputInputSelector.html +1 -1
- package/docs/variables/index.InputLabelSelector.html +1 -1
- package/docs/variables/index.InputPrefixSelector.html +1 -1
- package/docs/variables/index.InputSuffixSelector.html +1 -1
- 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 -1
- package/docs/variables/index.ModalContainerSelector.html +1 -1
- package/docs/variables/index.ModalRemovePaddingSelector.html +1 -1
- package/docs/variables/index.ModalTitleSelector.html +1 -1
- package/docs/variables/index.PopListSelector.html +1 -1
- package/docs/variables/index.PopOptionButtonSelector.html +1 -1
- package/docs/variables/index.PopOptionIconSelector.html +1 -1
- package/docs/variables/index.PopOverlaySelector.html +1 -1
- 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.TextAreaLabelSelector.html +1 -1
- package/docs/variables/index.TextAreaTextAreaSelector.html +1 -1
- package/docs/variables/index.TextAreaWrapperSelector.html +1 -1
- package/docs/variables/index.ToggleStyledToggleSelector.html +1 -1
- package/docs/variables/index.TooltipContentSelector.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/index.d.ts +1 -0
- package/esm/components/form/index.d.ts.map +1 -1
- package/esm/components/form/index.js +1 -0
- package/esm/components/form/index.js.map +1 -1
- package/esm/components/form/input/Input.d.ts.map +1 -1
- package/esm/components/form/input/Input.js +9 -5
- package/esm/components/form/input/Input.js.map +1 -1
- package/esm/components/form/timepicker/TimePicker.css.d.ts +99 -0
- package/esm/components/form/timepicker/TimePicker.css.d.ts.map +1 -0
- package/esm/components/form/timepicker/TimePicker.css.js +102 -0
- package/esm/components/form/timepicker/TimePicker.css.js.map +1 -0
- package/esm/components/form/timepicker/TimePicker.d.ts +22 -0
- package/esm/components/form/timepicker/TimePicker.d.ts.map +1 -0
- package/esm/components/form/timepicker/TimePicker.js +93 -0
- package/esm/components/form/timepicker/TimePicker.js.map +1 -0
- package/esm/components/form/timepicker/TimePicker.styled.d.ts +936 -0
- package/esm/components/form/timepicker/TimePicker.styled.d.ts.map +1 -0
- package/esm/components/form/timepicker/TimePicker.styled.js +20 -0
- package/esm/components/form/timepicker/TimePicker.styled.js.map +1 -0
- package/esm/components/form/timepicker/TimePickerModal.d.ts +17 -0
- package/esm/components/form/timepicker/TimePickerModal.d.ts.map +1 -0
- package/esm/components/form/timepicker/TimePickerModal.js +56 -0
- package/esm/components/form/timepicker/TimePickerModal.js.map +1 -0
- package/esm/components/form/timepicker/Wheel.d.ts +12 -0
- package/esm/components/form/timepicker/Wheel.d.ts.map +1 -0
- package/esm/components/form/timepicker/Wheel.js +151 -0
- package/esm/components/form/timepicker/Wheel.js.map +1 -0
- package/esm/components/form/timepicker/utils.d.ts +4 -0
- package/esm/components/form/timepicker/utils.d.ts.map +1 -0
- package/esm/components/form/timepicker/utils.js +58 -0
- package/esm/components/form/timepicker/utils.js.map +1 -0
- package/esm/components/icons/Clock.d.ts +7 -0
- package/esm/components/icons/Clock.d.ts.map +1 -0
- package/esm/components/icons/Clock.js +9 -0
- package/esm/components/icons/Clock.js.map +1 -0
- package/esm/components/icons/Icon.d.ts +2 -1
- package/esm/components/icons/Icon.d.ts.map +1 -1
- package/esm/components/icons/Icon.js +3 -0
- package/esm/components/icons/Icon.js.map +1 -1
- package/esm/components/layout/header/HeaderIconAction.d.ts.map +1 -1
- package/esm/components/layout/header/HeaderIconAction.js +13 -3
- package/esm/components/layout/header/HeaderIconAction.js.map +1 -1
- package/esm/components/layout/header/HeaderIconAction.styled.d.ts.map +1 -1
- package/esm/components/layout/header/HeaderIconAction.styled.js +11 -17
- package/esm/components/layout/header/HeaderIconAction.styled.js.map +1 -1
- package/esm/components/layout/list/Item.d.ts.map +1 -1
- package/esm/components/layout/list/Item.js +18 -8
- package/esm/components/layout/list/Item.js.map +1 -1
- package/esm/components/layout/list/Item.styled.d.ts.map +1 -1
- package/esm/components/layout/list/Item.styled.js +2 -1
- package/esm/components/layout/list/Item.styled.js.map +1 -1
- package/esm/components/ui/button/Button.d.ts +94 -1
- package/esm/components/ui/button/Button.d.ts.map +1 -1
- package/esm/components/ui/button/Button.js +15 -1
- package/esm/components/ui/button/Button.js.map +1 -1
- package/esm/components/ui/button/Button.styled.d.ts +2 -2
- package/esm/components/ui/button/Button.styled.d.ts.map +1 -1
- package/esm/components/ui/button/Button.styled.js +3 -2
- package/esm/components/ui/button/Button.styled.js.map +1 -1
- package/esm/components/ui/directionPad/Button.d.ts.map +1 -1
- package/esm/components/ui/directionPad/Button.js +7 -2
- package/esm/components/ui/directionPad/Button.js.map +1 -1
- package/esm/components/ui/directionPad/Button.styled.d.ts.map +1 -1
- package/esm/components/ui/directionPad/Button.styled.js +2 -1
- package/esm/components/ui/directionPad/Button.styled.js.map +1 -1
- package/esm/components/ui/directionPad/Middle.d.ts.map +1 -1
- package/esm/components/ui/directionPad/Middle.js +7 -1
- package/esm/components/ui/directionPad/Middle.js.map +1 -1
- package/esm/components/ui/directionPad/Middle.styled.d.ts.map +1 -1
- package/esm/components/ui/directionPad/Middle.styled.js +2 -1
- package/esm/components/ui/directionPad/Middle.styled.js.map +1 -1
- package/esm/components/ui/modal/Modal.d.ts +1 -2
- package/esm/components/ui/modal/Modal.d.ts.map +1 -1
- package/esm/components/ui/modal/Modal.js +103 -43
- package/esm/components/ui/modal/Modal.js.map +1 -1
- package/esm/components/ui/modal/Modal.styled.d.ts +1 -1
- package/esm/components/ui/modal/Modal.styled.d.ts.map +1 -1
- package/esm/components/ui/modal/Modal.styled.js +40 -25
- package/esm/components/ui/modal/Modal.styled.js.map +1 -1
- package/esm/components/ui/modal/ModalButtons.d.ts +179 -1
- package/esm/components/ui/modal/ModalButtons.d.ts.map +1 -1
- package/esm/components/ui/modal/ModalButtons.js +19 -1
- package/esm/components/ui/modal/ModalButtons.js.map +1 -1
- package/esm/components/ui/modal/ModalButtons.styled.d.ts +90 -91
- package/esm/components/ui/modal/ModalButtons.styled.d.ts.map +1 -1
- package/esm/components/ui/modal/ModalButtons.styled.js +3 -6
- package/esm/components/ui/modal/ModalButtons.styled.js.map +1 -1
- package/esm/components/ui/pop/Pop.styled.d.ts.map +1 -1
- package/esm/components/ui/pop/Pop.styled.js +15 -17
- package/esm/components/ui/pop/Pop.styled.js.map +1 -1
- package/esm/components/ui/pop/PopOption.d.ts.map +1 -1
- package/esm/components/ui/pop/PopOption.js +7 -2
- package/esm/components/ui/pop/PopOption.js.map +1 -1
- package/esm/components/ui/toolButton/ToolButton.d.ts +94 -1
- package/esm/components/ui/toolButton/ToolButton.d.ts.map +1 -1
- package/esm/components/ui/toolButton/ToolButton.js +15 -1
- package/esm/components/ui/toolButton/ToolButton.js.map +1 -1
- package/esm/components/ui/toolButton/ToolButton.styled.d.ts +2 -2
- package/esm/components/ui/toolButton/ToolButton.styled.d.ts.map +1 -1
- package/esm/components/ui/toolButton/ToolButton.styled.js +19 -24
- package/esm/components/ui/toolButton/ToolButton.styled.js.map +1 -1
- package/esm/theme.css-global.d.ts.map +1 -1
- package/esm/theme.css-global.js +0 -1
- package/esm/theme.css-global.js.map +1 -1
- package/esm/utils/index.d.ts +1 -0
- package/esm/utils/index.d.ts.map +1 -1
- package/esm/utils/index.js +1 -0
- package/esm/utils/index.js.map +1 -1
- package/esm/utils/useNativeValidity.d.ts +11 -0
- package/esm/utils/useNativeValidity.d.ts.map +1 -0
- package/esm/utils/useNativeValidity.js +29 -0
- package/esm/utils/useNativeValidity.js.map +1 -0
- package/esm/utils/useRipple.d.ts +15 -0
- package/esm/utils/useRipple.d.ts.map +1 -0
- package/esm/utils/useRipple.js +84 -0
- package/esm/utils/useRipple.js.map +1 -0
- package/esm/utils/useRipple.styled.d.ts +28 -0
- package/esm/utils/useRipple.styled.d.ts.map +1 -0
- package/esm/utils/useRipple.styled.js +33 -0
- package/esm/utils/useRipple.styled.js.map +1 -0
- package/package.json +1 -1
- package/src/components/form/index.ts +1 -0
- package/src/components/form/input/Input.stories.tsx +47 -1
- package/src/components/form/input/Input.tsx +11 -5
- package/src/components/form/timepicker/TimePicker.css.ts +132 -0
- package/src/components/form/timepicker/TimePicker.stories.tsx +107 -0
- package/src/components/form/timepicker/TimePicker.styled.ts +52 -0
- package/src/components/form/timepicker/TimePicker.tsx +229 -0
- package/src/components/form/timepicker/TimePickerModal.tsx +131 -0
- package/src/components/form/timepicker/Wheel.tsx +201 -0
- package/src/components/form/timepicker/utils.ts +66 -0
- package/src/components/icons/Clock.tsx +38 -0
- package/src/components/icons/Icon.tsx +3 -0
- package/src/components/layout/header/HeaderIconAction.styled.ts +11 -18
- package/src/components/layout/header/HeaderIconAction.tsx +32 -5
- package/src/components/layout/list/Item.styled.ts +2 -1
- package/src/components/layout/list/Item.tsx +38 -5
- package/src/components/ui/button/Button.styled.ts +3 -2
- package/src/components/ui/button/Button.tsx +33 -1
- package/src/components/ui/directionPad/Button.styled.ts +2 -1
- package/src/components/ui/directionPad/Button.tsx +13 -1
- package/src/components/ui/directionPad/Middle.styled.ts +2 -1
- package/src/components/ui/directionPad/Middle.tsx +13 -1
- package/src/components/ui/modal/Modal.stories.tsx +43 -7
- package/src/components/ui/modal/Modal.styled.ts +46 -25
- package/src/components/ui/modal/Modal.tsx +135 -52
- package/src/components/ui/modal/ModalButtons.styled.ts +4 -7
- package/src/components/ui/modal/ModalButtons.tsx +38 -1
- package/src/components/ui/pop/Pop.styled.ts +15 -18
- package/src/components/ui/pop/PopOption.tsx +15 -1
- package/src/components/ui/toolButton/ToolButton.styled.ts +20 -26
- package/src/components/ui/toolButton/ToolButton.tsx +33 -0
- package/src/theme.css-global.ts +0 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/useNativeValidity.ts +57 -0
- package/src/utils/useRipple.styled.ts +56 -0
- package/src/utils/useRipple.tsx +139 -0
- package/src/components/ui/toolButton/ToolButton.ts +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { dimensionsPxToRem, fontPxToRem, styled } from "../../../theme.js";
|
|
2
|
+
import { rippleHostStyles } from "../../../utils/useRipple.styled.js";
|
|
2
3
|
const Overlay = styled("div", {
|
|
3
4
|
position: "fixed",
|
|
4
5
|
background: "#0000004c",
|
|
@@ -21,23 +22,20 @@ const ListItem = styled("li", {
|
|
|
21
22
|
borderTop: "1px solid $border",
|
|
22
23
|
},
|
|
23
24
|
});
|
|
24
|
-
const Button = styled("button", {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"&:hover": {
|
|
39
|
-
background: "$activeBg",
|
|
40
|
-
},
|
|
25
|
+
const Button = styled("button", rippleHostStyles, {
|
|
26
|
+
border: "none",
|
|
27
|
+
background: "$background",
|
|
28
|
+
height: dimensionsPxToRem(116),
|
|
29
|
+
padding: `0 ${dimensionsPxToRem(42)}`,
|
|
30
|
+
boxSizing: "border-box",
|
|
31
|
+
width: "100%",
|
|
32
|
+
minWidth: dimensionsPxToRem(460),
|
|
33
|
+
textAlign: "left",
|
|
34
|
+
color: "$popText",
|
|
35
|
+
fontSize: fontPxToRem(26),
|
|
36
|
+
fontWeight: "revert",
|
|
37
|
+
display: "flex",
|
|
38
|
+
alignItems: "center",
|
|
41
39
|
});
|
|
42
40
|
const Icon = styled("div", {
|
|
43
41
|
fill: "currentColor",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pop.styled.js","sourceRoot":"","sources":["../../../../src/components/ui/pop/Pop.styled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Pop.styled.js","sourceRoot":"","sources":["../../../../src/components/ui/pop/Pop.styled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,EAAE;IAC1B,QAAQ,EAAE,OAAO;IACjB,UAAU,EAAE,WAAW;IACvB,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,CAAC;CACZ,CAAC,CAAC;AAEH,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,EAAE;IACtB,MAAM,EAAE,CAAC;IACT,QAAQ,EAAE,UAAU;IACpB,UAAU,EAAE,aAAa;IACzB,MAAM,EAAE,CAAC;IACT,OAAO,EAAE,CAAC;IACV,aAAa,EAAE,MAAM;CACxB,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,EAAE;IAC1B,QAAQ,EAAE,CAAC;IACX,SAAS,EAAE,CAAC;IACZ,eAAe,EAAE,MAAM;IAEvB,OAAO,EAAE;QACL,SAAS,EAAE,mBAAmB;KACjC;CACJ,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,EAAE,gBAAgB,EAAE;IAC9C,MAAM,EAAE,MAAM;IACd,UAAU,EAAE,aAAa;IACzB,MAAM,EAAE,iBAAiB,CAAC,GAAG,CAAC;IAC9B,OAAO,EAAE,KAAK,iBAAiB,CAAC,EAAE,CAAC,EAAE;IACrC,SAAS,EAAE,YAAY;IACvB,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,iBAAiB,CAAC,GAAG,CAAC;IAChC,SAAS,EAAE,MAAM;IACjB,KAAK,EAAE,UAAU;IACjB,QAAQ,EAAE,WAAW,CAAC,EAAE,CAAC;IACzB,UAAU,EAAE,QAAQ;IACpB,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,QAAQ;CACvB,CAAC,CAAC;AAEH,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,EAAE;IACvB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,iBAAiB,CAAC,EAAE,CAAC;CACrC,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE;IAC5B,OAAO,EAAE,cAAc;IACvB,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,EAAE;IACV,WAAW,EAAE,iBAAiB,CAAC,EAAE,CAAC;CACrC,CAAC,CAAC;AAEH,OAAO,EACH,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,QAAQ,GACX,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopOption.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/pop/PopOption.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"PopOption.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/pop/PopOption.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAO1C,UAAU,KAAK;IACX,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED,QAAA,MAAM,SAAS,6EAqBb,CAAC;AAKH,QAAA,MAAM,uBAAuB,QAAoB,CAAC;AAClD,QAAA,MAAM,qBAAqB,QAAkB,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import React, { forwardRef } from "react";
|
|
2
|
+
import { useForwardedRef } from "@bedrock-layout/use-forwarded-ref";
|
|
3
|
+
import { useRipple } from "../../../utils/useRipple.js";
|
|
2
4
|
import { Button, FakeIcon, Icon, ListItem } from "./Pop.styled.js";
|
|
3
5
|
const PopOption = forwardRef((props, ref) => {
|
|
4
6
|
var _a;
|
|
7
|
+
const buttonRef = useForwardedRef(null);
|
|
8
|
+
const ripple = useRipple({ ref: buttonRef });
|
|
5
9
|
const ic = props.icon
|
|
6
10
|
? React.createElement(Icon, null, props.icon)
|
|
7
11
|
: (((_a = props.forceEmptyIcon) !== null && _a !== void 0 ? _a : true) ? React.createElement(FakeIcon, null) : null);
|
|
8
12
|
return (React.createElement(ListItem, { ref: ref, className: props.className },
|
|
9
|
-
React.createElement(Button, { onClick: props.onClick },
|
|
13
|
+
React.createElement(Button, { ref: buttonRef, onClick: props.onClick, onPointerDown: ripple.onPointerDown, onKeyDown: ripple.onKeyDown },
|
|
10
14
|
ic,
|
|
11
|
-
props.children
|
|
15
|
+
props.children,
|
|
16
|
+
ripple.ripples)));
|
|
12
17
|
});
|
|
13
18
|
PopOption.displayName = "PopOption";
|
|
14
19
|
PopOption.toString = () => ListItem.toString();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopOption.js","sourceRoot":"","sources":["../../../../src/components/ui/pop/PopOption.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAUhE,MAAM,SAAS,GAAG,UAAU,CAAuB,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;;IAC9D,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI;QACjB,CAAC,CAAC,oBAAC,IAAI,QAAE,KAAK,CAAC,IAAI,CAAQ;QAC3B,CAAC,CAAC,CAAC,CAAC,MAAA,KAAK,CAAC,cAAc,mCAAI,IAAI,CAAC,CAAC,CAAC,CAAC,oBAAC,QAAQ,OAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAE7D,OAAO,CACH,oBAAC,QAAQ,IAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1C,oBAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"PopOption.js","sourceRoot":"","sources":["../../../../src/components/ui/pop/PopOption.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEpE,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAUhE,MAAM,SAAS,GAAG,UAAU,CAAuB,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;;IAC9D,MAAM,SAAS,GAAG,eAAe,CAA2B,IAAI,CAAC,CAAC;IAClE,MAAM,MAAM,GAAG,SAAS,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC;IAE7C,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI;QACjB,CAAC,CAAC,oBAAC,IAAI,QAAE,KAAK,CAAC,IAAI,CAAQ;QAC3B,CAAC,CAAC,CAAC,CAAC,MAAA,KAAK,CAAC,cAAc,mCAAI,IAAI,CAAC,CAAC,CAAC,CAAC,oBAAC,QAAQ,OAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAE7D,OAAO,CACH,oBAAC,QAAQ,IAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1C,oBAAC,MAAM,IACH,GAAG,EAAE,SAAS,EACd,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,aAAa,EAAE,MAAM,CAAC,aAAa,EACnC,SAAS,EAAE,MAAM,CAAC,SAAS;YAE1B,EAAE;YAAE,KAAK,CAAC,QAAQ;YAClB,MAAM,CAAC,OAAO,CACV,CACF,CACd,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC;AACpC,SAAS,CAAC,QAAQ,GAAG,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;AAE/C,MAAM,uBAAuB,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;AAClD,MAAM,qBAAqB,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -1,2 +1,95 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const ToolButton: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
3
|
+
ref?: ((instance: HTMLButtonElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLButtonElement> | null | undefined;
|
|
4
|
+
}, "css" | "inline" | "variant"> & import("../../../../node_modules/@stitches/react/types/styled-component").TransformProps<{
|
|
5
|
+
inline?: boolean | "true";
|
|
6
|
+
variant?: "secondary" | "secondaryOnLight";
|
|
7
|
+
}, {}> & {
|
|
8
|
+
css?: import("../../../../node_modules/@stitches/react/types/css-util").CSS<{}, {
|
|
9
|
+
colors: {
|
|
10
|
+
background: "white";
|
|
11
|
+
mainColor: "#008ad2";
|
|
12
|
+
mainColorAlt: "#006AA9";
|
|
13
|
+
activeBg: "#e7e7e7";
|
|
14
|
+
inactiveBg: "#d3d3de";
|
|
15
|
+
inactiveDarkBg: "#999";
|
|
16
|
+
toggleHandleBg: "#e0e0e0";
|
|
17
|
+
toggleHandleBorder: "#cdcdcd";
|
|
18
|
+
toggleBgDisabled: "#f0f0f0";
|
|
19
|
+
toggleHandleBorderDisabled: "#c29f7d";
|
|
20
|
+
toggleHandleBgDisabled: "#deae84";
|
|
21
|
+
icon: "#636363";
|
|
22
|
+
border: "#d5d5d5";
|
|
23
|
+
buttonBorder: "#bababa";
|
|
24
|
+
headerBorder: "#c8c8c9";
|
|
25
|
+
headerBg: "#efeff0";
|
|
26
|
+
headerText: "#484848";
|
|
27
|
+
text: "#323232";
|
|
28
|
+
text2: "#181818";
|
|
29
|
+
text3: "#000000";
|
|
30
|
+
sub: "#959595";
|
|
31
|
+
popText: "#666";
|
|
32
|
+
toolbarBorder: "#ababab";
|
|
33
|
+
toolbarBg: "#f8f8f8";
|
|
34
|
+
modalBg: "#f7f7f7";
|
|
35
|
+
modalButtonBg: "#f8f8f8";
|
|
36
|
+
modalButtonBorder: "#c2c2c2";
|
|
37
|
+
inputDisabledBg: "#f3f3f3";
|
|
38
|
+
inputDisabledText: "#959595";
|
|
39
|
+
choiceBg: "#ffffff";
|
|
40
|
+
choiceText: "#999999";
|
|
41
|
+
choiceActiveBg: "#f3f3f3";
|
|
42
|
+
choiceActiveText: "#313131";
|
|
43
|
+
choiceBorder: "#cfcfcf";
|
|
44
|
+
selectorText: "#606060";
|
|
45
|
+
selectorActive: "#008ad2";
|
|
46
|
+
blue1: "#038bf4";
|
|
47
|
+
blue2: "#b7d6f5";
|
|
48
|
+
blue3: "#dbe6ff";
|
|
49
|
+
blue4: "#33b4ff";
|
|
50
|
+
blue5: "#30a2e6";
|
|
51
|
+
orange1: "#ff7200";
|
|
52
|
+
orange1Darker: "#cc5b00";
|
|
53
|
+
purple1: "#7357e8";
|
|
54
|
+
green1: "#3ec234";
|
|
55
|
+
green1Darker: "#38af2f";
|
|
56
|
+
pink1: "#ff388f";
|
|
57
|
+
red1: "#ea2700";
|
|
58
|
+
yellow1: "#ffde9d";
|
|
59
|
+
yellow2: "#e4a429";
|
|
60
|
+
yellow3: "#fff5db";
|
|
61
|
+
pinky1: "#f5c0b7";
|
|
62
|
+
pinky2: "#e07b67";
|
|
63
|
+
pinky3: "#ffe1db";
|
|
64
|
+
grey1: "#737373";
|
|
65
|
+
focusColor: "#dcaf00";
|
|
66
|
+
scrollbarsThumb: "#737373";
|
|
67
|
+
scrollbarsBg: "transparent";
|
|
68
|
+
tableStripedBg: "#fafafa";
|
|
69
|
+
toolButtonText: "#666e80";
|
|
70
|
+
};
|
|
71
|
+
}, import("../../../../node_modules/@stitches/react/types/config").DefaultThemeMap, {
|
|
72
|
+
mx: (value: string | number) => {
|
|
73
|
+
marginLeft: string | number;
|
|
74
|
+
marginRight: string | number;
|
|
75
|
+
};
|
|
76
|
+
my: (value: string | number) => {
|
|
77
|
+
marginTop: string | number;
|
|
78
|
+
marginBottom: string | number;
|
|
79
|
+
};
|
|
80
|
+
px: (value: string | number) => {
|
|
81
|
+
paddingLeft: string | number;
|
|
82
|
+
paddingRight: string | number;
|
|
83
|
+
};
|
|
84
|
+
py: (value: string | number) => {
|
|
85
|
+
paddingTop: string | number;
|
|
86
|
+
paddingBottom: string | number;
|
|
87
|
+
};
|
|
88
|
+
size: (value: string | number) => {
|
|
89
|
+
width: string | number;
|
|
90
|
+
height: string | number;
|
|
91
|
+
};
|
|
92
|
+
}>;
|
|
93
|
+
}, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
94
|
+
export { ToolButton, };
|
|
2
95
|
//# sourceMappingURL=ToolButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolButton.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/toolButton/ToolButton.
|
|
1
|
+
{"version":3,"file":"ToolButton.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/toolButton/ToolButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAS1C,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mDAgBd,CAAC;AAKH,OAAO,EACH,UAAU,GACb,CAAC"}
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import { useForwardedRef } from "@bedrock-layout/use-forwarded-ref";
|
|
3
|
+
import { useRipple } from "../../../utils/useRipple.js";
|
|
4
|
+
import { StyledToolButton } from "./ToolButton.styled.js";
|
|
5
|
+
const ToolButton = forwardRef((props, ref) => {
|
|
6
|
+
const { children, onPointerDown, onKeyDown, ...rest } = props;
|
|
7
|
+
const innerRef = useForwardedRef(ref);
|
|
8
|
+
const ripple = useRipple({ ref: innerRef, onPointerDown, onKeyDown });
|
|
9
|
+
return (React.createElement(StyledToolButton, { ref: innerRef, onPointerDown: ripple.onPointerDown, onKeyDown: ripple.onKeyDown, ...rest },
|
|
10
|
+
children,
|
|
11
|
+
ripple.ripples));
|
|
12
|
+
});
|
|
13
|
+
ToolButton.displayName = "ToolButton";
|
|
14
|
+
ToolButton.toString = () => StyledToolButton.toString();
|
|
15
|
+
export { ToolButton, };
|
|
2
16
|
//# sourceMappingURL=ToolButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolButton.js","sourceRoot":"","sources":["../../../../src/components/ui/toolButton/ToolButton.
|
|
1
|
+
{"version":3,"file":"ToolButton.js","sourceRoot":"","sources":["../../../../src/components/ui/toolButton/ToolButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEpE,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAIvD,MAAM,UAAU,GAAG,UAAU,CAA2B,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACnE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAC9D,MAAM,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;IACtC,MAAM,MAAM,GAAG,SAAS,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC,CAAC;IAEtE,OAAO,CACH,oBAAC,gBAAgB,IACb,GAAG,EAAE,QAAQ,EACb,aAAa,EAAE,MAAM,CAAC,aAAa,EACnC,SAAS,EAAE,MAAM,CAAC,SAAS,KACvB,IAAI;QAEP,QAAQ;QACR,MAAM,CAAC,OAAO,CACA,CACtB,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC;AACtC,UAAU,CAAC,QAAQ,GAAG,GAAG,EAAE,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC;AAExD,OAAO,EACH,UAAU,GACb,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
declare const StyledToolButton: import("../../../../node_modules/@stitches/react/types/styled-component").StyledComponent<"button", {
|
|
2
2
|
inline?: boolean | "true";
|
|
3
3
|
variant?: "secondary" | "secondaryOnLight";
|
|
4
4
|
}, {}, import("../../../../node_modules/@stitches/react/types/css-util").CSS<{}, {
|
|
@@ -86,5 +86,5 @@ declare const ToolButton: import("../../../../node_modules/@stitches/react/types
|
|
|
86
86
|
height: string | number;
|
|
87
87
|
};
|
|
88
88
|
}>>;
|
|
89
|
-
export {
|
|
89
|
+
export { StyledToolButton, };
|
|
90
90
|
//# sourceMappingURL=ToolButton.styled.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolButton.styled.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/toolButton/ToolButton.styled.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ToolButton.styled.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/toolButton/ToolButton.styled.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCpB,CAAC;AAEH,OAAO,EACH,gBAAgB,GACnB,CAAC"}
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
import { dimensionsPxToRem, fontPxToRem, styled } from "../../../theme.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"border"
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
"variants": {
|
|
2
|
+
import { rippleHostStyles } from "../../../utils/useRipple.styled.js";
|
|
3
|
+
const StyledToolButton = styled("button", rippleHostStyles, {
|
|
4
|
+
height: dimensionsPxToRem(79),
|
|
5
|
+
borderRadius: dimensionsPxToRem(10),
|
|
6
|
+
fontWeight: "bold",
|
|
7
|
+
fontSize: fontPxToRem(23),
|
|
8
|
+
display: "flex",
|
|
9
|
+
alignItems: "center",
|
|
10
|
+
justifyContent: "center",
|
|
11
|
+
paddingInline: dimensionsPxToRem(16),
|
|
12
|
+
background: "white",
|
|
13
|
+
boxSizing: "border-box",
|
|
14
|
+
border: `${dimensionsPxToRem(6)} solid transparent`,
|
|
15
|
+
color: "$toolButtonText",
|
|
16
|
+
variants: {
|
|
19
17
|
inline: {
|
|
20
18
|
true: {
|
|
21
19
|
width: "auto",
|
|
@@ -24,12 +22,9 @@ const ToolButton = styled("button", {
|
|
|
24
22
|
},
|
|
25
23
|
variant: {
|
|
26
24
|
secondary: {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
background: "#ffffff22",
|
|
31
|
-
},
|
|
32
|
-
"color": "white",
|
|
25
|
+
border: `${dimensionsPxToRem(6)} solid #ffffff42`,
|
|
26
|
+
background: "none",
|
|
27
|
+
color: "white",
|
|
33
28
|
},
|
|
34
29
|
secondaryOnLight: {
|
|
35
30
|
"border": `${dimensionsPxToRem(6)} solid $border`,
|
|
@@ -42,5 +37,5 @@ const ToolButton = styled("button", {
|
|
|
42
37
|
},
|
|
43
38
|
},
|
|
44
39
|
});
|
|
45
|
-
export {
|
|
40
|
+
export { StyledToolButton, };
|
|
46
41
|
//# sourceMappingURL=ToolButton.styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolButton.styled.js","sourceRoot":"","sources":["../../../../src/components/ui/toolButton/ToolButton.styled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"ToolButton.styled.js","sourceRoot":"","sources":["../../../../src/components/ui/toolButton/ToolButton.styled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAKnE,MAAM,gBAAgB,GAAG,MAAM,CAAC,QAAQ,EAAE,gBAAgB,EAAE;IACxD,MAAM,EAAE,iBAAiB,CAAC,EAAE,CAAC;IAC7B,YAAY,EAAE,iBAAiB,CAAC,EAAE,CAAC;IACnC,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,WAAW,CAAC,EAAE,CAAC;IACzB,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,QAAQ;IACpB,cAAc,EAAE,QAAQ;IACxB,aAAa,EAAE,iBAAiB,CAAC,EAAE,CAAC;IACpC,UAAU,EAAE,OAAO;IACnB,SAAS,EAAE,YAAY;IACvB,MAAM,EAAE,GAAG,iBAAiB,CAAC,CAAC,CAAC,oBAAoB;IACnD,KAAK,EAAE,iBAAiB;IAExB,QAAQ,EAAE;QACN,MAAM,EAAE;YACJ,IAAI,EAAE;gBACF,KAAK,EAAE,MAAM;gBACb,OAAO,EAAE,aAAa;aACzB;SACJ;QACD,OAAO,EAAE;YACL,SAAS,EAAE;gBACP,MAAM,EAAE,GAAG,iBAAiB,CAAC,CAAC,CAAC,kBAAkB;gBACjD,UAAU,EAAE,MAAM;gBAClB,KAAK,EAAE,OAAO;aACjB;YACD,gBAAgB,EAAE;gBACd,QAAQ,EAAE,GAAG,iBAAiB,CAAC,CAAC,CAAC,gBAAgB;gBACjD,YAAY,EAAE,MAAM;gBACpB,OAAO,EAAE,OAAO;gBAGhB,SAAS,EAAE;oBACP,WAAW,EAAE,eAAe;iBAC/B;aACJ;SACJ;KACJ;CACJ,CAAC,CAAC;AAEH,OAAO,EACH,gBAAgB,GACnB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.css-global.d.ts","sourceRoot":"","sources":["../src/theme.css-global.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"theme.css-global.d.ts","sourceRoot":"","sources":["../src/theme.css-global.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,kBAAkB,cAWtB,CAAC;AAEH,OAAO,EACH,kBAAkB,GACrB,CAAC"}
|
package/esm/theme.css-global.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.css-global.js","sourceRoot":"","sources":["../src/theme.css-global.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,MAAM,kBAAkB,GAAG,SAAS,CAAC;IACjC,SAAS,EAAE;QACP,OAAO,EAAE,iBAAiB;KAC7B;IACD,+BAA+B,EAAE;QAC7B,OAAO,EAAE,iBAAiB;QAC1B,WAAW,EAAE,aAAa;
|
|
1
|
+
{"version":3,"file":"theme.css-global.js","sourceRoot":"","sources":["../src/theme.css-global.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,MAAM,kBAAkB,GAAG,SAAS,CAAC;IACjC,SAAS,EAAE;QACP,OAAO,EAAE,iBAAiB;KAC7B;IACD,+BAA+B,EAAE;QAC7B,OAAO,EAAE,iBAAiB;QAC1B,WAAW,EAAE,aAAa;KAC7B;IACD,MAAM,EAAE;QACJ,KAAK,EAAE,OAAO;KACjB;CACJ,CAAC,CAAC;AAEH,OAAO,EACH,kBAAkB,GACrB,CAAC"}
|
package/esm/utils/index.d.ts
CHANGED
package/esm/utils/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC"}
|
package/esm/utils/index.js
CHANGED
package/esm/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
interface UseNativeValidityResult {
|
|
3
|
+
finalError: boolean;
|
|
4
|
+
onBlur: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
5
|
+
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
6
|
+
onInvalid: () => void;
|
|
7
|
+
revalidate: (input: HTMLInputElement | null) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const useNativeValidity: (error: boolean | undefined) => UseNativeValidityResult;
|
|
10
|
+
export { useNativeValidity };
|
|
11
|
+
//# sourceMappingURL=useNativeValidity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNativeValidity.d.ts","sourceRoot":"","sources":["../../src/utils/useNativeValidity.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,UAAU,uBAAuB;IAE7B,UAAU,EAAE,OAAO,CAAC;IAEpB,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAExD,QAAQ,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAE3D,SAAS,EAAE,MAAM,IAAI,CAAC;IAEtB,UAAU,EAAE,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,KAAK,IAAI,CAAC;CACxD;AASD,QAAA,MAAM,iBAAiB,GAAI,OAAO,OAAO,GAAG,SAAS,KAAG,uBA8BvD,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useCallback, useState } from "react";
|
|
2
|
+
const useNativeValidity = (error) => {
|
|
3
|
+
const [nativeInvalid, setNativeInvalid] = useState(false);
|
|
4
|
+
const onBlur = useCallback((e) => {
|
|
5
|
+
setNativeInvalid(!e.currentTarget.checkValidity());
|
|
6
|
+
}, []);
|
|
7
|
+
const onChange = useCallback((e) => {
|
|
8
|
+
if (e.currentTarget.checkValidity()) {
|
|
9
|
+
setNativeInvalid(false);
|
|
10
|
+
}
|
|
11
|
+
}, []);
|
|
12
|
+
const onInvalid = useCallback(() => {
|
|
13
|
+
setNativeInvalid(true);
|
|
14
|
+
}, []);
|
|
15
|
+
const revalidate = useCallback((input) => {
|
|
16
|
+
if (input === null || input === void 0 ? void 0 : input.checkValidity()) {
|
|
17
|
+
setNativeInvalid(false);
|
|
18
|
+
}
|
|
19
|
+
}, []);
|
|
20
|
+
return {
|
|
21
|
+
finalError: Boolean(error) || nativeInvalid,
|
|
22
|
+
onBlur,
|
|
23
|
+
onChange,
|
|
24
|
+
onInvalid,
|
|
25
|
+
revalidate,
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export { useNativeValidity };
|
|
29
|
+
//# sourceMappingURL=useNativeValidity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNativeValidity.js","sourceRoot":"","sources":["../../src/utils/useNativeValidity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAwB9C,MAAM,iBAAiB,GAAG,CAAC,KAA0B,EAA2B,EAAE;IAC9E,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE1D,MAAM,MAAM,GAAG,WAAW,CAAC,CAAC,CAAqC,EAAE,EAAE;QACjE,gBAAgB,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC,CAAC;IACvD,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,QAAQ,GAAG,WAAW,CAAC,CAAC,CAAsC,EAAE,EAAE;QACpE,IAAI,CAAC,CAAC,aAAa,CAAC,aAAa,EAAE,EAAE,CAAC;YAClC,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC;IACL,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE;QAC/B,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,UAAU,GAAG,WAAW,CAAC,CAAC,KAA8B,EAAE,EAAE;QAC9D,IAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,aAAa,EAAE,EAAE,CAAC;YACzB,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC;IACL,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACH,UAAU,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,aAAa;QAC3C,MAAM;QACN,QAAQ;QACR,SAAS;QACT,UAAU;KACb,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type UseRippleArgs<T extends HTMLElement> = {
|
|
3
|
+
ref: React.RefObject<T | null>;
|
|
4
|
+
onPointerDown?: React.PointerEventHandler<T> | undefined;
|
|
5
|
+
onKeyDown?: React.KeyboardEventHandler<T> | undefined;
|
|
6
|
+
fromCenter?: boolean | undefined;
|
|
7
|
+
};
|
|
8
|
+
type UseRippleResult<T extends HTMLElement> = {
|
|
9
|
+
onPointerDown: React.PointerEventHandler<T>;
|
|
10
|
+
onKeyDown: React.KeyboardEventHandler<T>;
|
|
11
|
+
ripples: React.ReactNode;
|
|
12
|
+
};
|
|
13
|
+
declare const useRipple: <T extends HTMLElement>(args: UseRippleArgs<T>) => UseRippleResult<T>;
|
|
14
|
+
export { useRipple };
|
|
15
|
+
//# sourceMappingURL=useRipple.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRipple.d.ts","sourceRoot":"","sources":["../../src/utils/useRipple.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAmC7D,KAAK,aAAa,CAAC,CAAC,SAAS,WAAW,IAAI;IACxC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAC/B,aAAa,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IACzD,SAAS,CAAC,EAAE,KAAK,CAAC,oBAAoB,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IAKtD,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACpC,CAAC;AAEF,KAAK,eAAe,CAAC,CAAC,SAAS,WAAW,IAAI;IAC1C,aAAa,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC;IAC5C,SAAS,EAAE,KAAK,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;IACzC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAYF,QAAA,MAAM,SAAS,GAAI,CAAC,SAAS,WAAW,EAAE,MAAM,aAAa,CAAC,CAAC,CAAC,KAAG,eAAe,CAAC,CAAC,CA0EnF,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import React, { useCallback, useRef, useState } from "react";
|
|
2
|
+
const HALF = 2;
|
|
3
|
+
const RIPPLE_SPEED_PX_PER_MS = 1.5;
|
|
4
|
+
const RIPPLE_MIN_DURATION_MS = 250;
|
|
5
|
+
const prefersReducedMotion = () => {
|
|
6
|
+
if (typeof window === "undefined") {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
10
|
+
};
|
|
11
|
+
const isDisabled = (el) => {
|
|
12
|
+
if ("disabled" in el && el.disabled) {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
return el.getAttribute("aria-disabled") === "true";
|
|
16
|
+
};
|
|
17
|
+
const isRippleDisabledByCssVar = (el) => {
|
|
18
|
+
if (typeof window === "undefined") {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
return window.getComputedStyle(el).getPropertyValue("--miui-ripple").trim() === "0";
|
|
22
|
+
};
|
|
23
|
+
const useRipple = (args) => {
|
|
24
|
+
const { ref, onPointerDown, onKeyDown, fromCenter = false } = args;
|
|
25
|
+
const [ripples, setRipples] = useState([]);
|
|
26
|
+
const idCounter = useRef(0);
|
|
27
|
+
const addRippleAt = useCallback((clientX, clientY) => {
|
|
28
|
+
const el = ref.current;
|
|
29
|
+
if (!el || isDisabled(el) || prefersReducedMotion() || isRippleDisabledByCssVar(el)) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const rect = el.getBoundingClientRect();
|
|
33
|
+
const x = clientX - rect.left;
|
|
34
|
+
const y = clientY - rect.top;
|
|
35
|
+
const maxX = Math.max(x, rect.width - x);
|
|
36
|
+
const maxY = Math.max(y, rect.height - y);
|
|
37
|
+
const size = Math.hypot(maxX, maxY) * HALF;
|
|
38
|
+
const duration = Math.max(RIPPLE_MIN_DURATION_MS, size / RIPPLE_SPEED_PX_PER_MS);
|
|
39
|
+
idCounter.current += 1;
|
|
40
|
+
const id = idCounter.current;
|
|
41
|
+
setRipples((arr) => [...arr, { id, x, y, size, duration }]);
|
|
42
|
+
}, [ref]);
|
|
43
|
+
const handlePointerDown = useCallback((evt) => {
|
|
44
|
+
if (fromCenter) {
|
|
45
|
+
const el = ref.current;
|
|
46
|
+
if (el) {
|
|
47
|
+
const rect = el.getBoundingClientRect();
|
|
48
|
+
addRippleAt(rect.left + (rect.width / HALF), rect.top + (rect.height / HALF));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
addRippleAt(evt.clientX, evt.clientY);
|
|
53
|
+
}
|
|
54
|
+
onPointerDown === null || onPointerDown === void 0 ? void 0 : onPointerDown(evt);
|
|
55
|
+
}, [addRippleAt, onPointerDown, fromCenter, ref]);
|
|
56
|
+
const handleKeyDown = useCallback((evt) => {
|
|
57
|
+
if (!evt.repeat && (evt.key === "Enter" || evt.key === " ")) {
|
|
58
|
+
const el = ref.current;
|
|
59
|
+
if (el) {
|
|
60
|
+
const rect = el.getBoundingClientRect();
|
|
61
|
+
addRippleAt(rect.left + (rect.width / HALF), rect.top + (rect.height / HALF));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(evt);
|
|
65
|
+
}, [addRippleAt, ref, onKeyDown]);
|
|
66
|
+
const handleAnimationEnd = useCallback((evt) => {
|
|
67
|
+
const id = Number(evt.currentTarget.dataset.rippleId);
|
|
68
|
+
setRipples((arr) => arr.filter((r) => r.id !== id));
|
|
69
|
+
}, []);
|
|
70
|
+
const elements = ripples.map((r) => (React.createElement("span", { key: r.id, "data-miui-ripple": true, "data-ripple-id": r.id, "aria-hidden": true, style: {
|
|
71
|
+
left: `${String(r.x - (r.size / HALF))}px`,
|
|
72
|
+
top: `${String(r.y - (r.size / HALF))}px`,
|
|
73
|
+
width: `${String(r.size)}px`,
|
|
74
|
+
height: `${String(r.size)}px`,
|
|
75
|
+
animationDuration: `${String(r.duration)}ms`,
|
|
76
|
+
}, onAnimationEnd: handleAnimationEnd })));
|
|
77
|
+
return {
|
|
78
|
+
onPointerDown: handlePointerDown,
|
|
79
|
+
onKeyDown: handleKeyDown,
|
|
80
|
+
ripples: elements,
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
export { useRipple };
|
|
84
|
+
//# sourceMappingURL=useRipple.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRipple.js","sourceRoot":"","sources":["../../src/utils/useRipple.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare const rippleHostStyles: {
|
|
2
|
+
position: string;
|
|
3
|
+
overflow: string;
|
|
4
|
+
WebkitTapHighlightColor: string;
|
|
5
|
+
transition: string;
|
|
6
|
+
"&:where(a, button):hover:not(:disabled):not([aria-disabled='true'])": {
|
|
7
|
+
boxShadow: string;
|
|
8
|
+
};
|
|
9
|
+
"&:where(a, button):active:not(:disabled):not([aria-disabled='true'])": {
|
|
10
|
+
boxShadow: string;
|
|
11
|
+
};
|
|
12
|
+
"@media (prefers-reduced-motion: reduce)": {
|
|
13
|
+
transition: string;
|
|
14
|
+
};
|
|
15
|
+
"& > span[data-miui-ripple]": {
|
|
16
|
+
position: string;
|
|
17
|
+
pointerEvents: string;
|
|
18
|
+
borderRadius: string;
|
|
19
|
+
backgroundColor: string;
|
|
20
|
+
transform: string;
|
|
21
|
+
opacity: number;
|
|
22
|
+
animationName: string;
|
|
23
|
+
animationTimingFunction: string;
|
|
24
|
+
animationFillMode: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export { rippleHostStyles, };
|
|
28
|
+
//# sourceMappingURL=useRipple.styled.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRipple.styled.d.ts","sourceRoot":"","sources":["../../src/utils/useRipple.styled.ts"],"names":[],"mappings":"AAkBA,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;CAiCrB,CAAC;AAEF,OAAO,EACH,gBAAgB,GACnB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { keyframes } from "../theme.js";
|
|
2
|
+
const rippleKeyframes = keyframes({
|
|
3
|
+
"0%": { transform: "scale(0)", opacity: 0.35 },
|
|
4
|
+
"100%": { transform: "scale(1)", opacity: 0 },
|
|
5
|
+
});
|
|
6
|
+
const rippleHostStyles = {
|
|
7
|
+
"position": "relative",
|
|
8
|
+
"overflow": "hidden",
|
|
9
|
+
"WebkitTapHighlightColor": "transparent",
|
|
10
|
+
"transition": "box-shadow 150ms ease-out",
|
|
11
|
+
"&:where(a, button):hover:not(:disabled):not([aria-disabled='true'])": {
|
|
12
|
+
boxShadow: "inset 0 0 0 9999px color-mix(in srgb, currentColor calc(6% * var(--miui-ripple, 1)), transparent)",
|
|
13
|
+
},
|
|
14
|
+
"&:where(a, button):active:not(:disabled):not([aria-disabled='true'])": {
|
|
15
|
+
boxShadow: "inset 0 0 0 9999px color-mix(in srgb, currentColor calc(12% * var(--miui-ripple, 1)), transparent)",
|
|
16
|
+
},
|
|
17
|
+
"@media (prefers-reduced-motion: reduce)": {
|
|
18
|
+
transition: "none",
|
|
19
|
+
},
|
|
20
|
+
"& > span[data-miui-ripple]": {
|
|
21
|
+
position: "absolute",
|
|
22
|
+
pointerEvents: "none",
|
|
23
|
+
borderRadius: "50%",
|
|
24
|
+
backgroundColor: "currentColor",
|
|
25
|
+
transform: "scale(0)",
|
|
26
|
+
opacity: 0,
|
|
27
|
+
animationName: String(rippleKeyframes),
|
|
28
|
+
animationTimingFunction: "ease-out",
|
|
29
|
+
animationFillMode: "forwards",
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
export { rippleHostStyles, };
|
|
33
|
+
//# sourceMappingURL=useRipple.styled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRipple.styled.js","sourceRoot":"","sources":["../../src/utils/useRipple.styled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,MAAM,eAAe,GAAG,SAAS,CAAC;IAC9B,IAAI,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE;IAC9C,MAAM,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,EAAE;CAChD,CAAC,CAAC;AAaH,MAAM,gBAAgB,GAAG;IACrB,UAAU,EAAE,UAAU;IACtB,UAAU,EAAE,QAAQ;IACpB,yBAAyB,EAAE,aAAa;IACxC,YAAY,EAAE,2BAA2B;IAOzC,qEAAqE,EAAE;QACnE,SAAS,EAAE,mGAAmG;KACjH;IACD,sEAAsE,EAAE;QACpE,SAAS,EAAE,oGAAoG;KAClH;IAED,yCAAyC,EAAE;QACvC,UAAU,EAAE,MAAM;KACrB;IAED,4BAA4B,EAAE;QAC1B,QAAQ,EAAE,UAAU;QACpB,aAAa,EAAE,MAAM;QACrB,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,cAAc;QAC/B,SAAS,EAAE,UAAU;QACrB,OAAO,EAAE,CAAC;QACV,aAAa,EAAE,MAAM,CAAC,eAAe,CAAC;QACtC,uBAAuB,EAAE,UAAU;QACnC,iBAAiB,EAAE,UAAU;KAChC;CACJ,CAAC;AAEF,OAAO,EACH,gBAAgB,GACnB,CAAC"}
|
package/package.json
CHANGED