@basic-ui/material 1.0.0-alpha.51 → 1.0.0-alpha.54
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/README.md +3 -3
- package/build/cjs/index.js +520 -447
- package/build/cjs/index.js.map +1 -1
- package/build/esm/Alert/Alert.d.ts +5 -6
- package/build/esm/Alert/Alert.js +14 -16
- package/build/esm/Alert/Alert.js.map +1 -1
- package/build/esm/Alert/index.d.ts +1 -1
- package/build/esm/Alert/index.js.map +1 -1
- package/build/esm/AppBar/AppBar.d.ts +9 -9
- package/build/esm/AppBar/AppBar.js +25 -34
- package/build/esm/AppBar/AppBar.js.map +1 -1
- package/build/esm/AppBar/AppBarButton.d.ts +3 -4
- package/build/esm/AppBar/AppBarButton.js +12 -14
- package/build/esm/AppBar/AppBarButton.js.map +1 -1
- package/build/esm/AppBar/context.d.ts +4 -5
- package/build/esm/AppBar/context.js +8 -6
- package/build/esm/AppBar/context.js.map +1 -1
- package/build/esm/AppBar/index.d.ts +3 -3
- package/build/esm/AppBar/index.js.map +1 -1
- package/build/esm/Badge/Badge.d.ts +5 -6
- package/build/esm/Badge/Badge.js +25 -26
- package/build/esm/Badge/Badge.js.map +1 -1
- package/build/esm/Badge/index.d.ts +1 -1
- package/build/esm/Badge/index.js.map +1 -1
- package/build/esm/BaseLine/BaseLine.d.ts +1 -1
- package/build/esm/BaseLine/BaseLine.js +4 -6
- package/build/esm/BaseLine/BaseLine.js.map +1 -1
- package/build/esm/BaseLine/index.d.ts +1 -1
- package/build/esm/BaseLine/index.js.map +1 -1
- package/build/esm/BottomSheet/BottomSheet.d.ts +6 -7
- package/build/esm/BottomSheet/BottomSheet.js +17 -21
- package/build/esm/BottomSheet/BottomSheet.js.map +1 -1
- package/build/esm/BottomSheet/BottomSheetSurface.d.ts +4 -5
- package/build/esm/BottomSheet/BottomSheetSurface.js +14 -14
- package/build/esm/BottomSheet/BottomSheetSurface.js.map +1 -1
- package/build/esm/BottomSheet/index.d.ts +1 -1
- package/build/esm/BottomSheet/index.js.map +1 -1
- package/build/esm/Box/Box.d.ts +23 -23
- package/build/esm/Box/Box.js +26 -26
- package/build/esm/Box/Box.js.map +1 -1
- package/build/esm/Box/index.d.ts +1 -1
- package/build/esm/Box/index.js.map +1 -1
- package/build/esm/Button/BaseButton.d.ts +14 -7
- package/build/esm/Button/BaseButton.js +107 -36
- package/build/esm/Button/BaseButton.js.map +1 -1
- package/build/esm/Button/Button.d.ts +14 -13
- package/build/esm/Button/Button.js +66 -48
- package/build/esm/Button/Button.js.map +1 -1
- package/build/esm/Button/ButtonGroup.d.ts +4 -5
- package/build/esm/Button/ButtonGroup.js +119 -21
- package/build/esm/Button/ButtonGroup.js.map +1 -1
- package/build/esm/Button/FilledButton.d.ts +10 -11
- package/build/esm/Button/FilledButton.js +18 -60
- package/build/esm/Button/FilledButton.js.map +1 -1
- package/build/esm/Button/FloatingActionButton.d.ts +9 -7
- package/build/esm/Button/FloatingActionButton.js +5 -4
- package/build/esm/Button/FloatingActionButton.js.map +1 -1
- package/build/esm/Button/IconButton.d.ts +8 -8
- package/build/esm/Button/IconButton.js +3 -3
- package/build/esm/Button/IconButton.js.map +1 -1
- package/build/esm/Button/IconFilledButton.d.ts +2 -0
- package/build/esm/Button/IconFilledButton.js +3 -0
- package/build/esm/Button/IconFilledButton.js.map +1 -0
- package/build/esm/Button/IconOutlinedButton.d.ts +2 -0
- package/build/esm/Button/IconOutlinedButton.js +3 -0
- package/build/esm/Button/IconOutlinedButton.js.map +1 -0
- package/build/esm/Button/OutlinedButton.d.ts +3 -4
- package/build/esm/Button/OutlinedButton.js +3 -43
- package/build/esm/Button/OutlinedButton.js.map +1 -1
- package/build/esm/Button/SplitButton.d.ts +9 -0
- package/build/esm/Button/SplitButton.js +32 -0
- package/build/esm/Button/SplitButton.js.map +1 -0
- package/build/esm/Button/TransparentButton.d.ts +10 -11
- package/build/esm/Button/TransparentButton.js +11 -54
- package/build/esm/Button/TransparentButton.js.map +1 -1
- package/build/esm/Button/context.d.ts +9 -8
- package/build/esm/Button/context.js +5 -4
- package/build/esm/Button/context.js.map +1 -1
- package/build/esm/Button/index.d.ts +3 -2
- package/build/esm/Button/index.js +1 -0
- package/build/esm/Button/index.js.map +1 -1
- package/build/esm/CheckBox/CheckBox.d.ts +13 -13
- package/build/esm/CheckBox/CheckBox.js +45 -61
- package/build/esm/CheckBox/CheckBox.js.map +1 -1
- package/build/esm/CheckBox/CheckBoxIcon.d.ts +10 -10
- package/build/esm/CheckBox/CheckBoxIcon.js +19 -24
- package/build/esm/CheckBox/CheckBoxIcon.js.map +1 -1
- package/build/esm/CheckBox/CheckPath.d.ts +3 -3
- package/build/esm/CheckBox/CheckPath.js +15 -16
- package/build/esm/CheckBox/CheckPath.js.map +1 -1
- package/build/esm/CheckBox/IndeterminatePath.d.ts +3 -3
- package/build/esm/CheckBox/IndeterminatePath.js +14 -16
- package/build/esm/CheckBox/IndeterminatePath.js.map +1 -1
- package/build/esm/CheckBox/index.d.ts +1 -1
- package/build/esm/CheckBox/index.js.map +1 -1
- package/build/esm/Chip/ButtonChip.d.ts +9 -9
- package/build/esm/Chip/ButtonChip.js +20 -24
- package/build/esm/Chip/ButtonChip.js.map +1 -1
- package/build/esm/Chip/Chip.d.ts +4 -4
- package/build/esm/Chip/Chip.js.map +1 -1
- package/build/esm/Chip/ChipBase.d.ts +10 -10
- package/build/esm/Chip/ChipBase.js +50 -54
- package/build/esm/Chip/ChipBase.js.map +1 -1
- package/build/esm/Chip/ChoiceChip.d.ts +10 -10
- package/build/esm/Chip/ChoiceChip.js +34 -38
- package/build/esm/Chip/ChoiceChip.js.map +1 -1
- package/build/esm/Chip/index.d.ts +2 -2
- package/build/esm/Chip/index.js.map +1 -1
- package/build/esm/Combobox/Combobox.d.ts +23 -23
- package/build/esm/Combobox/Combobox.js +126 -107
- package/build/esm/Combobox/Combobox.js.map +1 -1
- package/build/esm/Combobox/index.d.ts +1 -1
- package/build/esm/Combobox/index.js.map +1 -1
- package/build/esm/Dialog/Dialog.d.ts +19 -20
- package/build/esm/Dialog/Dialog.js +38 -42
- package/build/esm/Dialog/Dialog.js.map +1 -1
- package/build/esm/Dialog/DialogBackdrop.d.ts +6 -7
- package/build/esm/Dialog/DialogBackdrop.js +18 -17
- package/build/esm/Dialog/DialogBackdrop.js.map +1 -1
- package/build/esm/Dialog/DialogContainer.d.ts +3 -4
- package/build/esm/Dialog/DialogContainer.js +12 -12
- package/build/esm/Dialog/DialogContainer.js.map +1 -1
- package/build/esm/Dialog/DialogSurface.d.ts +6 -7
- package/build/esm/Dialog/DialogSurface.js +26 -26
- package/build/esm/Dialog/DialogSurface.js.map +1 -1
- package/build/esm/Dialog/Scrim.d.ts +3 -4
- package/build/esm/Dialog/Scrim.js +12 -12
- package/build/esm/Dialog/Scrim.js.map +1 -1
- package/build/esm/Dialog/index.d.ts +2 -2
- package/build/esm/Dialog/index.js.map +1 -1
- package/build/esm/Dialog/useDialogAnimation.d.ts +57 -824
- package/build/esm/Dialog/useDialogAnimation.js +23 -24
- package/build/esm/Dialog/useDialogAnimation.js.map +1 -1
- package/build/esm/Divider/Divider.d.ts +7 -7
- package/build/esm/Divider/Divider.js +27 -28
- package/build/esm/Divider/Divider.js.map +1 -1
- package/build/esm/Divider/index.d.ts +1 -1
- package/build/esm/Divider/index.js.map +1 -1
- package/build/esm/FloatingLabel/FloatingLabel.d.ts +13 -13
- package/build/esm/FloatingLabel/FloatingLabel.js +27 -33
- package/build/esm/FloatingLabel/FloatingLabel.js.map +1 -1
- package/build/esm/FloatingLabel/index.d.ts +1 -1
- package/build/esm/FloatingLabel/index.js.map +1 -1
- package/build/esm/LineRipple/LineRipple.d.ts +9 -9
- package/build/esm/LineRipple/LineRipple.js +30 -38
- package/build/esm/LineRipple/LineRipple.js.map +1 -1
- package/build/esm/LineRipple/index.d.ts +1 -1
- package/build/esm/LineRipple/index.js.map +1 -1
- package/build/esm/Link/Link.d.ts +9 -9
- package/build/esm/Link/Link.js +15 -17
- package/build/esm/Link/Link.js.map +1 -1
- package/build/esm/Link/index.d.ts +1 -1
- package/build/esm/Link/index.js.map +1 -1
- package/build/esm/List/List.d.ts +8 -8
- package/build/esm/List/List.js +19 -26
- package/build/esm/List/List.js.map +1 -1
- package/build/esm/List/index.d.ts +1 -1
- package/build/esm/List/index.js.map +1 -1
- package/build/esm/ListItem/ListItem.d.ts +14 -14
- package/build/esm/ListItem/ListItem.js +28 -31
- package/build/esm/ListItem/ListItem.js.map +1 -1
- package/build/esm/ListItem/ListItemText.d.ts +7 -7
- package/build/esm/ListItem/ListItemText.js +12 -16
- package/build/esm/ListItem/ListItemText.js.map +1 -1
- package/build/esm/ListItem/index.d.ts +2 -2
- package/build/esm/ListItem/index.js.map +1 -1
- package/build/esm/Menu/Menu.d.ts +18 -18
- package/build/esm/Menu/Menu.js +70 -60
- package/build/esm/Menu/Menu.js.map +1 -1
- package/build/esm/Menu/animation.d.ts +2 -2
- package/build/esm/Menu/animation.js +3 -3
- package/build/esm/Menu/animation.js.map +1 -1
- package/build/esm/Menu/index.d.ts +2 -2
- package/build/esm/Menu/index.js.map +1 -1
- package/build/esm/NavRail/NavRailItem.d.ts +15 -15
- package/build/esm/NavRail/NavRailItem.js +82 -86
- package/build/esm/NavRail/NavRailItem.js.map +1 -1
- package/build/esm/NavRail/icons/test-icons.d.ts +4 -4
- package/build/esm/NavRail/icons/test-icons.js +33 -40
- package/build/esm/NavRail/icons/test-icons.js.map +1 -1
- package/build/esm/NavRail/index.d.ts +1 -1
- package/build/esm/NavRail/index.js.map +1 -1
- package/build/esm/NotchedOutline/NotchedOutline.d.ts +14 -14
- package/build/esm/NotchedOutline/NotchedOutline.js +26 -34
- package/build/esm/NotchedOutline/NotchedOutline.js.map +1 -1
- package/build/esm/NotchedOutline/context.d.ts +5 -6
- package/build/esm/NotchedOutline/context.js +8 -7
- package/build/esm/NotchedOutline/context.js.map +1 -1
- package/build/esm/NotchedOutline/index.d.ts +1 -1
- package/build/esm/NotchedOutline/index.js.map +1 -1
- package/build/esm/NotchedOutline/styledComponents.d.ts +15 -575
- package/build/esm/NotchedOutline/styledComponents.js +65 -64
- package/build/esm/NotchedOutline/styledComponents.js.map +1 -1
- package/build/esm/Paper/Paper.d.ts +11 -11
- package/build/esm/Paper/Paper.js +25 -25
- package/build/esm/Paper/Paper.js.map +1 -1
- package/build/esm/Paper/index.d.ts +1 -1
- package/build/esm/Paper/index.js.map +1 -1
- package/build/esm/Popover/Popover.d.ts +13 -14
- package/build/esm/Popover/Popover.js +33 -39
- package/build/esm/Popover/Popover.js.map +1 -1
- package/build/esm/Popover/PopoverContainer.d.ts +3 -4
- package/build/esm/Popover/PopoverContainer.js +12 -12
- package/build/esm/Popover/PopoverContainer.js.map +1 -1
- package/build/esm/Popover/PopoverSurface.d.ts +4 -5
- package/build/esm/Popover/PopoverSurface.js +15 -15
- package/build/esm/Popover/PopoverSurface.js.map +1 -1
- package/build/esm/Popover/index.d.ts +1 -1
- package/build/esm/Popover/index.js.map +1 -1
- package/build/esm/ProgressSpinner/ProgressSpinner.d.ts +7 -8
- package/build/esm/ProgressSpinner/ProgressSpinner.js +31 -33
- package/build/esm/ProgressSpinner/ProgressSpinner.js.map +1 -1
- package/build/esm/ProgressSpinner/index.d.ts +1 -1
- package/build/esm/ProgressSpinner/index.js.map +1 -1
- package/build/esm/RadioButton/RadioButton.d.ts +3 -4
- package/build/esm/RadioButton/RadioButton.js +29 -32
- package/build/esm/RadioButton/RadioButton.js.map +1 -1
- package/build/esm/RadioButton/RadioButtonIcon.d.ts +6 -6
- package/build/esm/RadioButton/RadioButtonIcon.js +10 -12
- package/build/esm/RadioButton/RadioButtonIcon.js.map +1 -1
- package/build/esm/RadioButton/RadioGroup.d.ts +4 -5
- package/build/esm/RadioButton/RadioGroup.js +9 -11
- package/build/esm/RadioButton/RadioGroup.js.map +1 -1
- package/build/esm/RadioButton/index.d.ts +2 -2
- package/build/esm/RadioButton/index.js.map +1 -1
- package/build/esm/Ripple/Ripple.d.ts +10 -11
- package/build/esm/Ripple/Ripple.js +12 -10
- package/build/esm/Ripple/Ripple.js.map +1 -1
- package/build/esm/Ripple/RippleBox.d.ts +5 -5
- package/build/esm/Ripple/RippleBox.js +32 -29
- package/build/esm/Ripple/RippleBox.js.map +1 -1
- package/build/esm/Ripple/constants.d.ts +7 -7
- package/build/esm/Ripple/constants.js +7 -7
- package/build/esm/Ripple/constants.js.map +1 -1
- package/build/esm/Ripple/index.d.ts +5 -5
- package/build/esm/Ripple/index.js.map +1 -1
- package/build/esm/Ripple/keyframes.d.ts +4 -4
- package/build/esm/Ripple/keyframes.js +7 -7
- package/build/esm/Ripple/keyframes.js.map +1 -1
- package/build/esm/Ripple/useRipple.d.ts +14 -14
- package/build/esm/Ripple/useRipple.js +79 -84
- package/build/esm/Ripple/useRipple.js.map +1 -1
- package/build/esm/Ripple/useRippleHandlers.d.ts +8 -8
- package/build/esm/Ripple/useRippleHandlers.js +21 -30
- package/build/esm/Ripple/useRippleHandlers.js.map +1 -1
- package/build/esm/Ripple/useRippleSurface.d.ts +22 -787
- package/build/esm/Ripple/useRippleSurface.js +87 -88
- package/build/esm/Ripple/useRippleSurface.js.map +1 -1
- package/build/esm/SearchBar/SearchBar.d.ts +15 -15
- package/build/esm/SearchBar/SearchBar.js +48 -63
- package/build/esm/SearchBar/SearchBar.js.map +1 -1
- package/build/esm/SearchBar/index.d.ts +1 -1
- package/build/esm/SearchBar/index.js.map +1 -1
- package/build/esm/Select/CustomContainerExample.d.ts +2 -3
- package/build/esm/Select/CustomContainerExample.js +29 -34
- package/build/esm/Select/CustomContainerExample.js.map +1 -1
- package/build/esm/Select/Select.d.ts +33 -32
- package/build/esm/Select/Select.js +68 -113
- package/build/esm/Select/Select.js.map +1 -1
- package/build/esm/Select/SelectIcon.d.ts +6 -6
- package/build/esm/Select/SelectIcon.js +11 -13
- package/build/esm/Select/SelectIcon.js.map +1 -1
- package/build/esm/Select/context.d.ts +9 -9
- package/build/esm/Select/context.js +10 -8
- package/build/esm/Select/context.js.map +1 -1
- package/build/esm/Select/defaultRender.d.ts +3 -3
- package/build/esm/Select/defaultRender.js +33 -38
- package/build/esm/Select/defaultRender.js.map +1 -1
- package/build/esm/Select/index.d.ts +1 -1
- package/build/esm/Select/index.js.map +1 -1
- package/build/esm/Select/styledComponents.d.ts +15 -15
- package/build/esm/Select/styledComponents.js +20 -23
- package/build/esm/Select/styledComponents.js.map +1 -1
- package/build/esm/SelectItem/SelectItem.d.ts +11 -11
- package/build/esm/SelectItem/SelectItem.js +37 -47
- package/build/esm/SelectItem/SelectItem.js.map +1 -1
- package/build/esm/SelectItem/index.d.ts +1 -1
- package/build/esm/SelectItem/index.js.map +1 -1
- package/build/esm/SelectionControl/SelectionControlLabel.d.ts +7 -7
- package/build/esm/SelectionControl/SelectionControlLabel.js +13 -14
- package/build/esm/SelectionControl/SelectionControlLabel.js.map +1 -1
- package/build/esm/SelectionControl/SelectionControlText.d.ts +8 -8
- package/build/esm/SelectionControl/SelectionControlText.js +20 -20
- package/build/esm/SelectionControl/SelectionControlText.js.map +1 -1
- package/build/esm/SelectionControl/index.d.ts +2 -2
- package/build/esm/SelectionControl/index.js.map +1 -1
- package/build/esm/Skeleton/DelayAppearance.d.ts +13 -13
- package/build/esm/Skeleton/DelayAppearance.js +18 -20
- package/build/esm/Skeleton/DelayAppearance.js.map +1 -1
- package/build/esm/Skeleton/Skeleton.d.ts +9 -9
- package/build/esm/Skeleton/Skeleton.js +18 -19
- package/build/esm/Skeleton/Skeleton.js.map +1 -1
- package/build/esm/Skeleton/animation.d.ts +8 -8
- package/build/esm/Skeleton/animation.js +11 -11
- package/build/esm/Skeleton/animation.js.map +1 -1
- package/build/esm/Skeleton/index.d.ts +2 -2
- package/build/esm/Skeleton/index.js.map +1 -1
- package/build/esm/Slider/Slider.d.ts +17 -17
- package/build/esm/Slider/Slider.js +93 -85
- package/build/esm/Slider/Slider.js.map +1 -1
- package/build/esm/Slider/index.d.ts +1 -1
- package/build/esm/Slider/index.js.map +1 -1
- package/build/esm/Snackbar/Snackbar.d.ts +10 -8
- package/build/esm/Snackbar/Snackbar.js +33 -33
- package/build/esm/Snackbar/Snackbar.js.map +1 -1
- package/build/esm/Snackbar/Stack.d.ts +31 -31
- package/build/esm/Snackbar/Stack.js +74 -106
- package/build/esm/Snackbar/Stack.js.map +1 -1
- package/build/esm/Snackbar/index.d.ts +3 -3
- package/build/esm/Snackbar/index.js.map +1 -1
- package/build/esm/Snackbar/useSnackbarAnimation.d.ts +6 -6
- package/build/esm/Snackbar/useSnackbarAnimation.js +103 -132
- package/build/esm/Snackbar/useSnackbarAnimation.js.map +1 -1
- package/build/esm/Switch/Switch.d.ts +13 -13
- package/build/esm/Switch/Switch.js +59 -56
- package/build/esm/Switch/Switch.js.map +1 -1
- package/build/esm/Switch/index.d.ts +1 -1
- package/build/esm/Switch/index.js.map +1 -1
- package/build/esm/Switch/styledComponents.d.ts +13 -13
- package/build/esm/Switch/styledComponents.js +47 -47
- package/build/esm/Switch/styledComponents.js.map +1 -1
- package/build/esm/Tab/Tab.d.ts +5 -5
- package/build/esm/Tab/Tab.js +47 -55
- package/build/esm/Tab/Tab.js.map +1 -1
- package/build/esm/Tab/TabList.d.ts +9 -10
- package/build/esm/Tab/TabList.js +28 -32
- package/build/esm/Tab/TabList.js.map +1 -1
- package/build/esm/Tab/TabPanel.d.ts +4 -5
- package/build/esm/Tab/TabPanel.js +18 -19
- package/build/esm/Tab/TabPanel.js.map +1 -1
- package/build/esm/Tab/TabPanels.d.ts +4 -4
- package/build/esm/Tab/TabPanels.js.map +1 -1
- package/build/esm/Tab/Tabs.d.ts +4 -4
- package/build/esm/Tab/Tabs.js.map +1 -1
- package/build/esm/Tab/context.d.ts +8 -9
- package/build/esm/Tab/context.js +8 -7
- package/build/esm/Tab/context.js.map +1 -1
- package/build/esm/Tab/index.d.ts +5 -5
- package/build/esm/Tab/index.js.map +1 -1
- package/build/esm/TabIndicator/TabIndicator.d.ts +9 -9
- package/build/esm/TabIndicator/TabIndicator.js +69 -86
- package/build/esm/TabIndicator/TabIndicator.js.map +1 -1
- package/build/esm/TabIndicator/context.d.ts +6 -6
- package/build/esm/TabIndicator/context.js +8 -7
- package/build/esm/TabIndicator/context.js.map +1 -1
- package/build/esm/TabIndicator/index.d.ts +2 -2
- package/build/esm/TabIndicator/index.js.map +1 -1
- package/build/esm/Table/Table.d.ts +3 -4
- package/build/esm/Table/Table.js +13 -14
- package/build/esm/Table/Table.js.map +1 -1
- package/build/esm/Table/TableBody.d.ts +3 -4
- package/build/esm/Table/TableBody.js +9 -11
- package/build/esm/Table/TableBody.js.map +1 -1
- package/build/esm/Table/TableCell.d.ts +3 -4
- package/build/esm/Table/TableCell.js +14 -15
- package/build/esm/Table/TableCell.js.map +1 -1
- package/build/esm/Table/TableHead.d.ts +3 -4
- package/build/esm/Table/TableHead.js +13 -14
- package/build/esm/Table/TableHead.js.map +1 -1
- package/build/esm/Table/TableRow.d.ts +3 -4
- package/build/esm/Table/TableRow.js +13 -14
- package/build/esm/Table/TableRow.js.map +1 -1
- package/build/esm/Table/context.d.ts +2 -3
- package/build/esm/Table/context.js +7 -7
- package/build/esm/Table/context.js.map +1 -1
- package/build/esm/Table/index.d.ts +5 -5
- package/build/esm/Table/index.js.map +1 -1
- package/build/esm/Text/LoremIpsum.d.ts +4 -4
- package/build/esm/Text/LoremIpsum.js +10 -12
- package/build/esm/Text/LoremIpsum.js.map +1 -1
- package/build/esm/Text/Text.d.ts +10 -11
- package/build/esm/Text/Text.js +15 -19
- package/build/esm/Text/Text.js.map +1 -1
- package/build/esm/Text/index.d.ts +1 -1
- package/build/esm/Text/index.js.map +1 -1
- package/build/esm/TextField/FilledContainer.d.ts +18 -18
- package/build/esm/TextField/FilledContainer.js +75 -80
- package/build/esm/TextField/FilledContainer.js.map +1 -1
- package/build/esm/TextField/HelperText.d.ts +10 -10
- package/build/esm/TextField/HelperText.js +19 -26
- package/build/esm/TextField/HelperText.js.map +1 -1
- package/build/esm/TextField/IconContainer.d.ts +5 -5
- package/build/esm/TextField/IconContainer.js +21 -9
- package/build/esm/TextField/IconContainer.js.map +1 -1
- package/build/esm/TextField/Input.d.ts +11 -11
- package/build/esm/TextField/Input.js +39 -40
- package/build/esm/TextField/Input.js.map +1 -1
- package/build/esm/TextField/OutlinedContainer.d.ts +17 -17
- package/build/esm/TextField/OutlinedContainer.js +30 -47
- package/build/esm/TextField/OutlinedContainer.js.map +1 -1
- package/build/esm/TextField/TextField.d.ts +19 -19
- package/build/esm/TextField/TextField.js +50 -77
- package/build/esm/TextField/TextField.js.map +1 -1
- package/build/esm/TextField/consts.d.ts +5 -5
- package/build/esm/TextField/consts.js +5 -5
- package/build/esm/TextField/consts.js.map +1 -1
- package/build/esm/TextField/index.d.ts +4 -4
- package/build/esm/TextField/index.js.map +1 -1
- package/build/esm/ThemeExplorer/BorderSlider.d.ts +7 -7
- package/build/esm/ThemeExplorer/BorderSlider.js +8 -14
- package/build/esm/ThemeExplorer/BorderSlider.js.map +1 -1
- package/build/esm/ThemeExplorer/ColorPicker.d.ts +8 -8
- package/build/esm/ThemeExplorer/ColorPicker.js +19 -24
- package/build/esm/ThemeExplorer/ColorPicker.js.map +1 -1
- package/build/esm/ThemeExplorer/ColorSchemePicker.d.ts +10 -10
- package/build/esm/ThemeExplorer/ColorSchemePicker.js +16 -21
- package/build/esm/ThemeExplorer/ColorSchemePicker.js.map +1 -1
- package/build/esm/ThemeExplorer/FontAutoComplete.d.ts +9 -9
- package/build/esm/ThemeExplorer/FontAutoComplete.js +28 -48
- package/build/esm/ThemeExplorer/FontAutoComplete.js.map +1 -1
- package/build/esm/ThemeExplorer/TextFieldColorPicker.d.ts +8 -9
- package/build/esm/ThemeExplorer/TextFieldColorPicker.js +29 -60
- package/build/esm/ThemeExplorer/TextFieldColorPicker.js.map +1 -1
- package/build/esm/ThemeExplorer/ThemeBuilder.d.ts +11 -11
- package/build/esm/ThemeExplorer/ThemeBuilder.js +155 -184
- package/build/esm/ThemeExplorer/ThemeBuilder.js.map +1 -1
- package/build/esm/ThemeExplorer/ThemeColors.d.ts +4 -5
- package/build/esm/ThemeExplorer/ThemeColors.js +54 -54
- package/build/esm/ThemeExplorer/ThemeColors.js.map +1 -1
- package/build/esm/ThemeExplorer/components.d.ts +31 -31
- package/build/esm/ThemeExplorer/components.js +52 -61
- package/build/esm/ThemeExplorer/components.js.map +1 -1
- package/build/esm/ThemeExplorer/googleFonts.d.ts +1 -1
- package/build/esm/ThemeExplorer/googleFonts.js +1 -1
- package/build/esm/ThemeExplorer/googleFonts.js.map +1 -1
- package/build/esm/ThemeExplorer/index.d.ts +1 -1
- package/build/esm/ThemeExplorer/index.js.map +1 -1
- package/build/esm/ThemeExplorer/makeColorScheme.d.ts +98 -98
- package/build/esm/ThemeExplorer/makeColorScheme.js +0 -1
- package/build/esm/ThemeExplorer/makeColorScheme.js.map +1 -1
- package/build/esm/ThemeExplorer/makeTailwindTheme.d.ts +2 -2
- package/build/esm/ThemeExplorer/makeTailwindTheme.js +20 -20
- package/build/esm/ThemeExplorer/makeTailwindTheme.js.map +1 -1
- package/build/esm/ThemeExplorer/updateGoogleFonts.js +23 -64
- package/build/esm/ThemeExplorer/updateGoogleFonts.js.map +1 -1
- package/build/esm/ThemeExplorer/useDeferredColor.d.ts +3 -3
- package/build/esm/ThemeExplorer/useDeferredColor.js +2 -9
- package/build/esm/ThemeExplorer/useDeferredColor.js.map +1 -1
- package/build/esm/ThemeExplorer/useLocalStorageCachedState.d.ts +1 -1
- package/build/esm/ThemeExplorer/useLocalStorageCachedState.js +2 -10
- package/build/esm/ThemeExplorer/useLocalStorageCachedState.js.map +1 -1
- package/build/esm/Tooltip/Tooltip.d.ts +8 -8
- package/build/esm/Tooltip/Tooltip.js +21 -25
- package/build/esm/Tooltip/Tooltip.js.map +1 -1
- package/build/esm/Tooltip/index.d.ts +1 -1
- package/build/esm/Tooltip/index.js.map +1 -1
- package/build/esm/color.d.ts +8 -8
- package/build/esm/color.js +23 -31
- package/build/esm/color.js.map +1 -1
- package/build/esm/css.d.ts +1 -1
- package/build/esm/css.js.map +1 -1
- package/build/esm/hooks/useAnimation.d.ts +20 -20
- package/build/esm/hooks/useAnimation.js +42 -53
- package/build/esm/hooks/useAnimation.js.map +1 -1
- package/build/esm/index.d.ts +42 -42
- package/build/esm/index.js.map +1 -1
- package/build/esm/motion.d.ts +7 -7
- package/build/esm/motion.js +7 -7
- package/build/esm/motion.js.map +1 -1
- package/build/esm/tailwind/extendColors.d.ts +5 -5
- package/build/esm/tailwind/extendColors.js +17 -29
- package/build/esm/tailwind/extendColors.js.map +1 -1
- package/build/esm/tailwind/index.d.ts +8 -8
- package/build/esm/tailwind/index.js +17 -29
- package/build/esm/tailwind/index.js.map +1 -1
- package/build/esm/theme/index.d.ts +2 -2
- package/build/esm/theme/index.js.map +1 -1
- package/build/esm/theme/theme.d.ts +590 -562
- package/build/esm/theme/theme.js +49 -22
- package/build/esm/theme/theme.js.map +1 -1
- package/build/esm/theme/typography-raleway.d.ts +112 -112
- package/build/esm/theme/typography-raleway.js +1 -1
- package/build/esm/theme/typography-raleway.js.map +1 -1
- package/build/esm/theme/typography-roboto.d.ts +111 -111
- package/build/esm/theme/typography-roboto.js +1 -1
- package/build/esm/theme/typography-roboto.js.map +1 -1
- package/build/esm/theme/useTheme.d.ts +594 -566
- package/build/esm/theme/useTheme.js +1 -3
- package/build/esm/theme/useTheme.js.map +1 -1
- package/build/tsconfig-build.tsbuildinfo +1 -1
- package/package.json +12 -11
- package/src/Alert/index.ts +1 -1
- package/src/AppBar/AppBar.story.tsx +69 -69
- package/src/AppBar/AppBar.tsx +85 -85
- package/src/AppBar/AppBarButton.tsx +25 -25
- package/src/AppBar/context.ts +13 -13
- package/src/AppBar/index.ts +3 -3
- package/src/Badge/Badge.story.tsx +68 -68
- package/src/Badge/Badge.tsx +47 -47
- package/src/Badge/index.ts +1 -1
- package/src/BaseLine/BaseLine.tsx +100 -100
- package/src/BaseLine/index.ts +1 -1
- package/src/BottomSheet/BottomSheet.story.tsx +35 -35
- package/src/BottomSheet/BottomSheet.tsx +39 -39
- package/src/BottomSheet/BottomSheetSurface.tsx +49 -49
- package/src/BottomSheet/index.ts +1 -1
- package/src/Box/Box.tsx +133 -127
- package/src/Box/index.ts +1 -1
- package/src/Button/BaseButton.tsx +123 -18
- package/src/Button/Button.story.tsx +236 -72
- package/src/Button/Button.tsx +44 -15
- package/src/Button/ButtonGroup.story.tsx +263 -101
- package/src/Button/ButtonGroup.tsx +103 -7
- package/src/Button/FilledButton.tsx +2 -43
- package/src/Button/FloatingActionButton.tsx +14 -9
- package/src/Button/IconFilledButton.tsx +3 -0
- package/src/Button/IconOutlinedButton.tsx +3 -0
- package/src/Button/OutlinedButton.tsx +2 -41
- package/src/Button/SpinnerButton.story.tsx +91 -91
- package/src/Button/SplitButton.story.tsx +110 -0
- package/src/Button/SplitButton.tsx +40 -0
- package/src/Button/TransparentButton.tsx +1 -43
- package/src/Button/context.tsx +19 -17
- package/src/Button/index.ts +3 -2
- package/src/CheckBox/CheckBox.story.tsx +155 -155
- package/src/CheckBox/CheckBox.tsx +170 -170
- package/src/CheckBox/CheckBoxIcon.tsx +63 -64
- package/src/CheckBox/CheckPath.tsx +18 -18
- package/src/CheckBox/IndeterminatePath.tsx +16 -16
- package/src/CheckBox/index.ts +1 -1
- package/src/Chip/ButtonChip.tsx +86 -86
- package/src/Chip/Chip.story.tsx +242 -242
- package/src/Chip/Chip.tsx +5 -5
- package/src/Chip/ChipBase.tsx +141 -141
- package/src/Chip/ChoiceChip.tsx +127 -127
- package/src/Chip/index.ts +2 -2
- package/src/Combobox/Combobox.tsx +274 -274
- package/src/Combobox/index.ts +1 -1
- package/src/Dialog/Dialog.story.tsx +53 -53
- package/src/Dialog/Dialog.tsx +73 -73
- package/src/Dialog/DialogBackdrop.tsx +42 -42
- package/src/Dialog/DialogContainer.tsx +31 -31
- package/src/Dialog/DialogSurface.tsx +55 -55
- package/src/Dialog/Scrim.tsx +35 -35
- package/src/Dialog/index.ts +2 -2
- package/src/Dialog/useDialogAnimation.tsx +59 -49
- package/src/Divider/Divider.story.tsx +39 -39
- package/src/Divider/Divider.tsx +48 -48
- package/src/Divider/index.ts +1 -1
- package/src/FloatingLabel/FloatingLabel.story.tsx +55 -55
- package/src/FloatingLabel/FloatingLabel.tsx +77 -77
- package/src/FloatingLabel/index.ts +1 -1
- package/src/LineRipple/LineRipple.story.tsx +43 -43
- package/src/LineRipple/LineRipple.tsx +81 -81
- package/src/LineRipple/index.ts +1 -1
- package/src/Link/Link.story.tsx +14 -14
- package/src/Link/Link.tsx +65 -65
- package/src/Link/index.ts +1 -1
- package/src/List/List.tsx +46 -46
- package/src/List/index.ts +1 -1
- package/src/ListItem/ListItem.story.tsx +43 -43
- package/src/ListItem/ListItem.tsx +104 -104
- package/src/ListItem/ListItemText.tsx +35 -35
- package/src/ListItem/index.ts +2 -2
- package/src/Menu/ContextMenu.story.tsx +34 -34
- package/src/Menu/Menu.story.tsx +54 -54
- package/src/Menu/Menu.tsx +124 -124
- package/src/Menu/animation.ts +16 -16
- package/src/Menu/index.ts +2 -2
- package/src/NavRail/NavRail.story.tsx +146 -146
- package/src/NavRail/NavRailItem.tsx +176 -175
- package/src/NavRail/icons/test-icons.tsx +46 -46
- package/src/NavRail/index.ts +1 -1
- package/src/NotchedOutline/NotchedOutline.story.tsx +99 -99
- package/src/NotchedOutline/NotchedOutline.tsx +80 -80
- package/src/NotchedOutline/context.ts +12 -12
- package/src/NotchedOutline/index.ts +1 -1
- package/src/NotchedOutline/styledComponents.ts +122 -122
- package/src/Paper/Paper.story.tsx +50 -50
- package/src/Paper/Paper.tsx +67 -67
- package/src/Paper/index.ts +1 -1
- package/src/Popover/PopoverSurface.tsx +51 -51
- package/src/Popover/index.ts +1 -1
- package/src/ProgressSpinner/ProgressSpinner.story.tsx +35 -35
- package/src/ProgressSpinner/ProgressSpinner.tsx +119 -119
- package/src/ProgressSpinner/index.ts +1 -1
- package/src/RadioButton/RadioButton.story.tsx +109 -109
- package/src/RadioButton/RadioButton.tsx +112 -112
- package/src/RadioButton/RadioButtonIcon.tsx +44 -44
- package/src/RadioButton/RadioGroup.tsx +26 -27
- package/src/RadioButton/index.ts +2 -2
- package/src/Ripple/Ripple.story.tsx +78 -78
- package/src/Ripple/Ripple.tsx +33 -33
- package/src/Ripple/RippleBox.tsx +52 -52
- package/src/Ripple/constants.ts +15 -15
- package/src/Ripple/index.ts +5 -5
- package/src/Ripple/keyframes.ts +36 -36
- package/src/Ripple/useRipple.ts +209 -209
- package/src/Ripple/useRippleHandlers.ts +54 -54
- package/src/Ripple/useRippleSurface.ts +162 -155
- package/src/SearchBar/SearchBar.tsx +5 -6
- package/src/Select/CustomContainerExample.tsx +59 -59
- package/src/Select/PaymentMethodSelect.story.tsx +320 -316
- package/src/Select/Select.story.tsx +225 -225
- package/src/Select/Select.tsx +284 -283
- package/src/Select/SelectIcon.tsx +43 -43
- package/src/Select/SelectMultiple.story.tsx +214 -215
- package/src/Select/context.ts +22 -22
- package/src/Select/defaultRender.tsx +60 -49
- package/src/Select/index.ts +1 -1
- package/src/Select/styledComponents.tsx +38 -38
- package/src/SelectItem/SelectItem.tsx +92 -92
- package/src/SelectItem/index.ts +1 -1
- package/src/SelectionControl/SelectionControlLabel.tsx +34 -34
- package/src/SelectionControl/SelectionControlText.tsx +37 -37
- package/src/SelectionControl/index.ts +2 -2
- package/src/Skeleton/DelayAppearance.tsx +41 -41
- package/src/Skeleton/Skeleton.story.tsx +57 -57
- package/src/Skeleton/Skeleton.tsx +40 -40
- package/src/Skeleton/animation.ts +54 -54
- package/src/Skeleton/index.ts +2 -2
- package/src/Slider/Slider.story.tsx +36 -36
- package/src/Slider/Slider.tsx +275 -275
- package/src/Slider/index.ts +1 -1
- package/src/Snackbar/Snackbar.story.tsx +99 -99
- package/src/Snackbar/Snackbar.tsx +19 -16
- package/src/Switch/Switch.story.tsx +97 -98
- package/src/Switch/Switch.tsx +170 -170
- package/src/Switch/index.ts +1 -1
- package/src/Switch/styledComponents.tsx +117 -117
- package/src/Tab/Tab.story.tsx +209 -209
- package/src/Tab/Tab.tsx +120 -120
- package/src/Tab/TabList.tsx +61 -61
- package/src/Tab/TabPanel.tsx +31 -31
- package/src/Tab/TabPanels.tsx +5 -5
- package/src/Tab/Tabs.tsx +5 -5
- package/src/Tab/context.ts +17 -17
- package/src/Tab/index.ts +5 -5
- package/src/TabIndicator/TabIndicator.tsx +146 -146
- package/src/TabIndicator/context.ts +13 -13
- package/src/TabIndicator/index.ts +2 -2
- package/src/Table/context.ts +6 -6
- package/src/Text/LoremIpsum.tsx +18 -18
- package/src/Text/Text.story.tsx +79 -75
- package/src/Text/Text.tsx +84 -84
- package/src/Text/index.ts +1 -1
- package/src/TextField/FilledContainer.tsx +173 -173
- package/src/TextField/HelperText.tsx +63 -63
- package/src/TextField/OutlinedContainer.tsx +116 -116
- package/src/TextField/consts.ts +7 -7
- package/src/TextField/index.ts +4 -4
- package/src/ThemeExplorer/BorderSlider.tsx +73 -73
- package/src/ThemeExplorer/ColorPicker.tsx +104 -104
- package/src/ThemeExplorer/ColorSchemePicker.tsx +55 -55
- package/src/ThemeExplorer/FontAutoComplete.tsx +139 -139
- package/src/ThemeExplorer/TextFieldColorPicker.tsx +112 -115
- package/src/ThemeExplorer/ThemeBuilder.story.tsx +8 -8
- package/src/ThemeExplorer/ThemeBuilder.tsx +437 -353
- package/src/ThemeExplorer/ThemeColors.tsx +122 -118
- package/src/ThemeExplorer/components.tsx +195 -195
- package/src/ThemeExplorer/googleFonts.ts +1436 -1436
- package/src/ThemeExplorer/index.ts +1 -1
- package/src/ThemeExplorer/makeColorScheme.tsx +111 -111
- package/src/ThemeExplorer/makeTailwindTheme.ts +44 -44
- package/src/ThemeExplorer/updateGoogleFonts.js +32 -33
- package/src/ThemeExplorer/useDeferredColor.tsx +21 -21
- package/src/ThemeExplorer/useLocalStorageCachedState.ts +18 -18
- package/src/Tooltip/Tooltip.story.tsx +35 -35
- package/src/Tooltip/Tooltip.tsx +67 -67
- package/src/Tooltip/index.ts +1 -1
- package/src/css.ts +2 -2
- package/src/hooks/useAnimation.ts +111 -111
- package/src/motion.ts +7 -7
- package/src/tailwind/extendColors.ts +51 -51
- package/src/tailwind/index.ts +57 -56
- package/src/tailwind/tests/extendColors.test.ts +123 -123
- package/src/theme/index.ts +2 -2
- package/src/theme/theme.ts +36 -8
- package/src/theme/typography-raleway.ts +114 -114
- package/src/theme/typography-roboto.ts +113 -113
- package/src/theme/useTheme.ts +17 -18
- package/tailwind/package.json +5 -5
- package/theme-explorer/package.json +5 -5
|
@@ -1,35 +1,33 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
4
1
|
import { useState, useRef, useEffect } from 'react';
|
|
5
2
|
import { radiusIn, opacityIn, opacityOut } from './keyframes';
|
|
6
3
|
import { RIPPLE_TRANSLATE_START, RIPPLE_TRANSLATE_END, RIPPLE_OPACITY_END, RIPPLE_SCALE_END, RIPPLE_SIZE, RIPPLE_BACKGROUND_COLOR, RIPPLE_POSITION } from './constants';
|
|
7
|
-
|
|
4
|
+
const defaultRipple = {
|
|
8
5
|
x: 0,
|
|
9
6
|
y: 0,
|
|
10
7
|
size: 0,
|
|
11
8
|
scale: 0,
|
|
12
9
|
centerX: 0,
|
|
13
10
|
centerY: 0
|
|
14
|
-
};
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// Surface diameter is treated differently for unbounded vs. bounded ripples.
|
|
15
14
|
// Unbounded ripple diameter is calculated smaller since the surface is expected to already be padded appropriately
|
|
16
15
|
// to extend the hitbox, and the ripple is expected to meet the edges of the padded hitbox (which is typically
|
|
17
16
|
// square). Bounded ripples, on the other hand, are fully expected to expand beyond the surface's longest diameter
|
|
18
17
|
// (calculated based on the diagonal plus a constant padding), and are clipped at the surface's border via
|
|
19
18
|
// `overflow: hidden`.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var hypotenuse = Math.sqrt(Math.pow(rect.width, 2) + Math.pow(rect.height, 2));
|
|
19
|
+
const getBoundedRadius = (rect, padding) => {
|
|
20
|
+
const hypotenuse = Math.sqrt(Math.pow(rect.width, 2) + Math.pow(rect.height, 2));
|
|
23
21
|
return hypotenuse + padding;
|
|
24
22
|
};
|
|
25
|
-
|
|
26
23
|
function getScale(rect) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
const maxDim = Math.max(rect.height, rect.width);
|
|
25
|
+
const padding = 10;
|
|
26
|
+
const initialOriginScale = 0.6;
|
|
27
|
+
const maxRadius = getBoundedRadius(rect, padding);
|
|
31
28
|
|
|
32
|
-
|
|
29
|
+
// Ripple is sized as a fraction of the largest dimension of the surface, then scales up using a CSS scale transform
|
|
30
|
+
const initialSize = Math.floor(maxDim * initialOriginScale);
|
|
33
31
|
return {
|
|
34
32
|
size: initialSize,
|
|
35
33
|
scale: maxRadius / initialSize,
|
|
@@ -37,130 +35,127 @@ function getScale(rect) {
|
|
|
37
35
|
centerY: rect.height / 2
|
|
38
36
|
};
|
|
39
37
|
}
|
|
40
|
-
|
|
41
38
|
function calculateRipplePosition(rect, clientX, clientY) {
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
let center = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
40
|
+
const rippleStart = center ? {
|
|
44
41
|
x: rect.width / 2,
|
|
45
42
|
y: rect.height / 2
|
|
46
43
|
} : {
|
|
47
44
|
x: clientX - rect.left,
|
|
48
45
|
y: clientY - rect.top
|
|
49
46
|
};
|
|
50
|
-
return
|
|
51
|
-
state: 'entering'
|
|
52
|
-
|
|
47
|
+
return {
|
|
48
|
+
state: 'entering',
|
|
49
|
+
...rippleStart,
|
|
50
|
+
...getScale(rect)
|
|
51
|
+
};
|
|
53
52
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
leaveDuration = _opts$leaveDuration === void 0 ? 150 : _opts$leaveDuration; // rippleState must be a ref, because it accesses the current value
|
|
53
|
+
export const useRipple = opts => {
|
|
54
|
+
const {
|
|
55
|
+
opacity,
|
|
56
|
+
backgroundColor,
|
|
57
|
+
enterDuration = 225,
|
|
58
|
+
leaveDuration = 150
|
|
59
|
+
} = opts;
|
|
60
|
+
|
|
61
|
+
// rippleState must be a ref, because it accesses the current value
|
|
64
62
|
// inside closures... if we use state, it's gonna recapture
|
|
65
63
|
// the state variable and won't work correctly
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
var restartTimeout = useRef();
|
|
77
|
-
var shouldLeave = useRef(false); // clear timeouts to avoid setting state on unmounted component
|
|
78
|
-
|
|
79
|
-
useEffect(function () {
|
|
80
|
-
return function () {
|
|
64
|
+
const rippleState = useRef('left');
|
|
65
|
+
const [ripple, setRipple] = useState(defaultRipple);
|
|
66
|
+
const leavingTimeout = useRef(undefined);
|
|
67
|
+
const enteringTimeout = useRef(undefined);
|
|
68
|
+
const restartTimeout = useRef(undefined);
|
|
69
|
+
const shouldLeave = useRef(false);
|
|
70
|
+
|
|
71
|
+
// clear timeouts to avoid setting state on unmounted component
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
return () => {
|
|
81
74
|
restartTimeout.current && cancelAnimationFrame(restartTimeout.current);
|
|
82
75
|
clearTimeout(enteringTimeout.current);
|
|
83
76
|
clearTimeout(leavingTimeout.current);
|
|
84
77
|
};
|
|
85
|
-
}, []);
|
|
78
|
+
}, []);
|
|
86
79
|
|
|
87
|
-
|
|
80
|
+
// State handling
|
|
81
|
+
const setLeft = () => {
|
|
88
82
|
rippleState.current = 'left';
|
|
89
|
-
setRipple(
|
|
83
|
+
setRipple({
|
|
84
|
+
...defaultRipple
|
|
85
|
+
});
|
|
90
86
|
};
|
|
91
|
-
|
|
92
|
-
var setLeaving = function setLeaving() {
|
|
87
|
+
const setLeaving = () => {
|
|
93
88
|
clearTimeout(enteringTimeout.current);
|
|
94
89
|
rippleState.current = 'leaving';
|
|
95
|
-
setRipple(
|
|
96
|
-
|
|
97
|
-
});
|
|
90
|
+
setRipple(ripple => ({
|
|
91
|
+
...ripple
|
|
92
|
+
}));
|
|
98
93
|
leavingTimeout.current = window.setTimeout(setLeft, leaveDuration);
|
|
99
94
|
};
|
|
100
|
-
|
|
101
|
-
var setEntered = function setEntered() {
|
|
95
|
+
const setEntered = () => {
|
|
102
96
|
rippleState.current = 'entered';
|
|
103
|
-
setRipple(
|
|
104
|
-
|
|
105
|
-
});
|
|
106
|
-
|
|
97
|
+
setRipple(ripple => ({
|
|
98
|
+
...ripple
|
|
99
|
+
}));
|
|
107
100
|
if (shouldLeave.current) {
|
|
108
101
|
setLeaving();
|
|
109
102
|
}
|
|
110
103
|
};
|
|
111
|
-
|
|
112
|
-
var deactivate = function deactivate() {
|
|
104
|
+
const deactivate = () => {
|
|
113
105
|
shouldLeave.current = true;
|
|
114
|
-
|
|
115
106
|
if (rippleState.current === 'entered') {
|
|
116
107
|
setLeaving();
|
|
117
108
|
}
|
|
118
109
|
};
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
var center = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
110
|
+
const activate = function (rect, clientX, clientY) {
|
|
111
|
+
let center = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
122
112
|
clearTimeout(leavingTimeout.current);
|
|
123
113
|
clearTimeout(enteringTimeout.current);
|
|
124
114
|
shouldLeave.current = false;
|
|
125
115
|
rippleState.current = 'restart';
|
|
126
|
-
setRipple(
|
|
127
|
-
|
|
116
|
+
setRipple({
|
|
117
|
+
...defaultRipple
|
|
118
|
+
});
|
|
119
|
+
restartTimeout.current = requestAnimationFrame(() => {
|
|
128
120
|
rippleState.current = 'entering';
|
|
129
121
|
setRipple(calculateRipplePosition(rect, clientX, clientY, center));
|
|
130
122
|
enteringTimeout.current = window.setTimeout(setEntered, enterDuration);
|
|
131
123
|
});
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
var animation = undefined;
|
|
124
|
+
};
|
|
136
125
|
|
|
126
|
+
// Styling
|
|
127
|
+
let animation = undefined;
|
|
137
128
|
switch (rippleState.current) {
|
|
138
129
|
case 'entering':
|
|
139
130
|
case 'entered':
|
|
140
|
-
animation =
|
|
131
|
+
animation = `${radiusIn} ${enterDuration}ms forwards,` + `${opacityIn} ${enterDuration / 3}ms forwards`;
|
|
141
132
|
break;
|
|
142
|
-
|
|
143
133
|
case 'leaving':
|
|
144
|
-
animation =
|
|
134
|
+
animation = `${radiusIn} ${enterDuration}ms forwards,` + `${opacityOut} ${leaveDuration}ms forwards`;
|
|
145
135
|
break;
|
|
146
136
|
}
|
|
147
|
-
|
|
148
|
-
var style = {};
|
|
149
|
-
|
|
137
|
+
let style = {};
|
|
150
138
|
switch (rippleState.current) {
|
|
151
139
|
case 'entering':
|
|
152
140
|
case 'entered':
|
|
153
141
|
case 'leaving':
|
|
154
|
-
style =
|
|
142
|
+
style = {
|
|
143
|
+
[RIPPLE_SIZE]: `${ripple.size}px`,
|
|
144
|
+
[RIPPLE_POSITION]: `${-ripple.size / 2}px`,
|
|
145
|
+
[RIPPLE_BACKGROUND_COLOR]: backgroundColor,
|
|
146
|
+
[RIPPLE_TRANSLATE_START]: `${ripple.x}px, ${ripple.y}px`,
|
|
147
|
+
[RIPPLE_TRANSLATE_END]: `${ripple.centerX}px, ${ripple.centerY}px`,
|
|
148
|
+
[RIPPLE_OPACITY_END]: opacity,
|
|
149
|
+
[RIPPLE_SCALE_END]: `${ripple.scale}`
|
|
150
|
+
};
|
|
155
151
|
break;
|
|
156
152
|
}
|
|
157
|
-
|
|
158
153
|
return {
|
|
159
|
-
activate
|
|
160
|
-
deactivate
|
|
161
|
-
style
|
|
162
|
-
animation
|
|
163
|
-
|
|
154
|
+
activate,
|
|
155
|
+
deactivate,
|
|
156
|
+
style,
|
|
157
|
+
animation
|
|
158
|
+
// key: counter,
|
|
164
159
|
};
|
|
165
160
|
};
|
|
166
161
|
//# sourceMappingURL=useRipple.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRipple.js","names":["useState","useRef","useEffect","radiusIn","opacityIn","opacityOut","RIPPLE_TRANSLATE_START","RIPPLE_TRANSLATE_END","RIPPLE_OPACITY_END","RIPPLE_SCALE_END","RIPPLE_SIZE","RIPPLE_BACKGROUND_COLOR","RIPPLE_POSITION","defaultRipple","x","y","size","scale","centerX","centerY","getBoundedRadius","rect","padding","hypotenuse","Math","sqrt","pow","width","height","getScale","maxDim","max","initialOriginScale","maxRadius","initialSize","floor","calculateRipplePosition","clientX","clientY","center","rippleStart","left","top","state","useRipple","opts","opacity","backgroundColor","enterDuration","leaveDuration","rippleState","ripple","setRipple","leavingTimeout","enteringTimeout","restartTimeout","shouldLeave","current","cancelAnimationFrame","clearTimeout","setLeft","setLeaving","window","setTimeout","setEntered","deactivate","activate","requestAnimationFrame","animation","undefined","style"],"sources":["../../../src/Ripple/useRipple.ts"],"sourcesContent":["import { useState, useRef, useEffect } from 'react';\r\n\r\nimport { radiusIn, opacityIn, opacityOut } from './keyframes';\r\nimport {\r\n RIPPLE_TRANSLATE_START,\r\n RIPPLE_TRANSLATE_END,\r\n RIPPLE_OPACITY_END,\r\n RIPPLE_SCALE_END,\r\n RIPPLE_SIZE,\r\n RIPPLE_BACKGROUND_COLOR,\r\n RIPPLE_POSITION,\r\n} from './constants';\r\n\r\nconst defaultRipple = {\r\n x: 0,\r\n y: 0,\r\n size: 0,\r\n scale: 0,\r\n centerX: 0,\r\n centerY: 0,\r\n};\r\n\r\n// Surface diameter is treated differently for unbounded vs. bounded ripples.\r\n// Unbounded ripple diameter is calculated smaller since the surface is expected to already be padded appropriately\r\n// to extend the hitbox, and the ripple is expected to meet the edges of the padded hitbox (which is typically\r\n// square). Bounded ripples, on the other hand, are fully expected to expand beyond the surface's longest diameter\r\n// (calculated based on the diagonal plus a constant padding), and are clipped at the surface's border via\r\n// `overflow: hidden`.\r\nconst getBoundedRadius = (rect: ClientRect, padding: number) => {\r\n const hypotenuse = Math.sqrt(\r\n Math.pow(rect.width, 2) + Math.pow(rect.height, 2)\r\n );\r\n return hypotenuse + padding;\r\n};\r\n\r\nfunction getScale(rect: ClientRect) {\r\n const maxDim = Math.max(rect.height, rect.width);\r\n const padding = 10;\r\n const initialOriginScale = 0.6;\r\n const maxRadius = getBoundedRadius(rect, padding);\r\n\r\n // Ripple is sized as a fraction of the largest dimension of the surface, then scales up using a CSS scale transform\r\n const initialSize = Math.floor(maxDim * initialOriginScale);\r\n\r\n return {\r\n size: initialSize,\r\n scale: maxRadius / initialSize,\r\n centerX: rect.width / 2,\r\n centerY: rect.height / 2,\r\n };\r\n}\r\n\r\nfunction calculateRipplePosition(\r\n rect: ClientRect,\r\n clientX: number,\r\n clientY: number,\r\n center = false\r\n) {\r\n const rippleStart = center\r\n ? {\r\n x: rect.width / 2,\r\n y: rect.height / 2,\r\n }\r\n : {\r\n x: clientX - rect.left,\r\n y: clientY - rect.top,\r\n };\r\n\r\n return {\r\n state: 'entering' as const,\r\n ...rippleStart,\r\n ...getScale(rect),\r\n };\r\n}\r\n\r\nexport interface RippleOptions {\r\n opacity: number;\r\n backgroundColor: string;\r\n enterDuration?: number;\r\n leaveDuration?: number;\r\n center?: boolean;\r\n disabled?: boolean;\r\n}\r\n\r\nexport const useRipple = (opts: RippleOptions) => {\r\n const {\r\n opacity,\r\n backgroundColor,\r\n enterDuration = 225,\r\n leaveDuration = 150,\r\n } = opts;\r\n\r\n // rippleState must be a ref, because it accesses the current value\r\n // inside closures... if we use state, it's gonna recapture\r\n // the state variable and won't work correctly\r\n const rippleState = useRef(\r\n 'left' as 'entering' | 'entered' | 'leaving' | 'left' | 'restart'\r\n );\r\n const [ripple, setRipple] = useState(defaultRipple);\r\n const leavingTimeout = useRef<number>();\r\n const enteringTimeout = useRef<number>();\r\n const restartTimeout = useRef<number>();\r\n\r\n const shouldLeave = useRef(false);\r\n\r\n // clear timeouts to avoid setting state on unmounted component\r\n useEffect(() => {\r\n return () => {\r\n restartTimeout.current && cancelAnimationFrame(restartTimeout.current);\r\n clearTimeout(enteringTimeout.current);\r\n clearTimeout(leavingTimeout.current);\r\n };\r\n }, []);\r\n\r\n // State handling\r\n const setLeft = () => {\r\n rippleState.current = 'left';\r\n setRipple({ ...defaultRipple });\r\n };\r\n\r\n const setLeaving = () => {\r\n clearTimeout(enteringTimeout.current);\r\n rippleState.current = 'leaving';\r\n setRipple((ripple) => ({\r\n ...ripple,\r\n }));\r\n\r\n leavingTimeout.current = window.setTimeout(setLeft, leaveDuration);\r\n };\r\n\r\n const setEntered = () => {\r\n rippleState.current = 'entered';\r\n setRipple((ripple) => ({\r\n ...ripple,\r\n }));\r\n\r\n if (shouldLeave.current) {\r\n setLeaving();\r\n }\r\n };\r\n\r\n const deactivate = () => {\r\n shouldLeave.current = true;\r\n if (rippleState.current === 'entered') {\r\n setLeaving();\r\n }\r\n };\r\n\r\n const activate = (\r\n rect: ClientRect,\r\n clientX: number,\r\n clientY: number,\r\n center = false\r\n ) => {\r\n clearTimeout(leavingTimeout.current);\r\n clearTimeout(enteringTimeout.current);\r\n shouldLeave.current = false;\r\n\r\n rippleState.current = 'restart';\r\n setRipple({ ...defaultRipple });\r\n restartTimeout.current = requestAnimationFrame(() => {\r\n rippleState.current = 'entering';\r\n setRipple(calculateRipplePosition(rect, clientX, clientY, center));\r\n\r\n enteringTimeout.current = window.setTimeout(setEntered, enterDuration);\r\n });\r\n };\r\n\r\n // Styling\r\n let animation: string | undefined = undefined;\r\n switch (rippleState.current) {\r\n case 'entering':\r\n case 'entered':\r\n animation =\r\n `${radiusIn} ${enterDuration}ms forwards,` +\r\n `${opacityIn} ${enterDuration / 3}ms forwards`;\r\n break;\r\n case 'leaving':\r\n animation =\r\n `${radiusIn} ${enterDuration}ms forwards,` +\r\n `${opacityOut} ${leaveDuration}ms forwards`;\r\n break;\r\n }\r\n\r\n let style = {};\r\n switch (rippleState.current) {\r\n case 'entering':\r\n case 'entered':\r\n case 'leaving':\r\n style = {\r\n [RIPPLE_SIZE]: `${ripple.size}px`,\r\n [RIPPLE_POSITION]: `${-ripple.size / 2}px`,\r\n [RIPPLE_BACKGROUND_COLOR]: backgroundColor,\r\n [RIPPLE_TRANSLATE_START]: `${ripple.x}px, ${ripple.y}px`,\r\n [RIPPLE_TRANSLATE_END]: `${ripple.centerX}px, ${ripple.centerY}px`,\r\n [RIPPLE_OPACITY_END]: opacity,\r\n [RIPPLE_SCALE_END]: `${ripple.scale}`,\r\n };\r\n break;\r\n }\r\n\r\n return {\r\n activate,\r\n deactivate,\r\n style,\r\n animation,\r\n // key: counter,\r\n };\r\n};\r\n"],"mappings":";;;AAAA,SAASA,QAAT,EAAmBC,MAAnB,EAA2BC,SAA3B,QAA4C,OAA5C;AAEA,SAASC,QAAT,EAAmBC,SAAnB,EAA8BC,UAA9B,QAAgD,aAAhD;AACA,SACEC,sBADF,EAEEC,oBAFF,EAGEC,kBAHF,EAIEC,gBAJF,EAKEC,WALF,EAMEC,uBANF,EAOEC,eAPF,QAQO,aARP;AAUA,IAAMC,aAAa,GAAG;EACpBC,CAAC,EAAE,CADiB;EAEpBC,CAAC,EAAE,CAFiB;EAGpBC,IAAI,EAAE,CAHc;EAIpBC,KAAK,EAAE,CAJa;EAKpBC,OAAO,EAAE,CALW;EAMpBC,OAAO,EAAE;AANW,CAAtB,C,CASA;AACA;AACA;AACA;AACA;AACA;;AACA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,IAAD,EAAmBC,OAAnB,EAAuC;EAC9D,IAAMC,UAAU,GAAGC,IAAI,CAACC,IAAL,CACjBD,IAAI,CAACE,GAAL,CAASL,IAAI,CA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ADH,cACgB4C,aAAa,GAAG,CADhC,gBADF;MAGA;;IACF,KAAK,SAAL;MACEoB,SAAS,GACP,UAAGjE,QAAH,cAAe6C,aAAf,8BACG3C,UADH,cACiB4C,aADjB,gBADF;MAGA;EAXJ;;EAcA,IAAIqB,KAAK,GAAG,EAAZ;;EACA,QAAQpB,WAAW,CAACO,OAApB;IACE,KAAK,UAAL;IACA,KAAK,SAAL;IACA,KAAK,SAAL;MACEa,KAAK,yCACF5D,WADE,YACeyC,MAAM,CAACnC,IADtB,kCAEFJ,eAFE,YAEmB,CAACuC,MAAM,CAACnC,IAAR,GAAe,CAFlC,kCAGFL,uBAHE,EAGwBoC,eAHxB,2BAIFzC,sBAJE,YAI0B6C,MAAM,CAACrC,CAJjC,iBAIyCqC,MAAM,CAACpC,CAJhD,kCAKFR,oBALE,YAKwB4C,MAAM,CAACjC,OAL/B,iBAK6CiC,MAAM,CAAChC,OALpD,kCAMFX,kBANE,EAMmBsC,OANnB,2BAOFrC,gBAPE,YAOoB0C,MAAM,CAAClC,KAP3B,WAAL;MASA;EAbJ;;EAgBA,OAAO;IACLiD,QAAQ,EAARA,QADK;IAELD,UAAU,EAAVA,UAFK;IAGLK,KAAK,EAALA,KAHK;IAILF,SAAS,EAATA,SAJK,CAKL;;EALK,CAAP;AAOD,CA5HM"}
|
|
1
|
+
{"version":3,"file":"useRipple.js","names":["useState","useRef","useEffect","radiusIn","opacityIn","opacityOut","RIPPLE_TRANSLATE_START","RIPPLE_TRANSLATE_END","RIPPLE_OPACITY_END","RIPPLE_SCALE_END","RIPPLE_SIZE","RIPPLE_BACKGROUND_COLOR","RIPPLE_POSITION","defaultRipple","x","y","size","scale","centerX","centerY","getBoundedRadius","rect","padding","hypotenuse","Math","sqrt","pow","width","height","getScale","maxDim","max","initialOriginScale","maxRadius","initialSize","floor","calculateRipplePosition","clientX","clientY","center","arguments","length","undefined","rippleStart","left","top","state","useRipple","opts","opacity","backgroundColor","enterDuration","leaveDuration","rippleState","ripple","setRipple","leavingTimeout","enteringTimeout","restartTimeout","shouldLeave","current","cancelAnimationFrame","clearTimeout","setLeft","setLeaving","window","setTimeout","setEntered","deactivate","activate","requestAnimationFrame","animation","style"],"sources":["../../../src/Ripple/useRipple.ts"],"sourcesContent":["import { useState, useRef, useEffect } from 'react';\n\nimport { radiusIn, opacityIn, opacityOut } from './keyframes';\nimport {\n RIPPLE_TRANSLATE_START,\n RIPPLE_TRANSLATE_END,\n RIPPLE_OPACITY_END,\n RIPPLE_SCALE_END,\n RIPPLE_SIZE,\n RIPPLE_BACKGROUND_COLOR,\n RIPPLE_POSITION,\n} from './constants';\n\nconst defaultRipple = {\n x: 0,\n y: 0,\n size: 0,\n scale: 0,\n centerX: 0,\n centerY: 0,\n};\n\n// Surface diameter is treated differently for unbounded vs. bounded ripples.\n// Unbounded ripple diameter is calculated smaller since the surface is expected to already be padded appropriately\n// to extend the hitbox, and the ripple is expected to meet the edges of the padded hitbox (which is typically\n// square). Bounded ripples, on the other hand, are fully expected to expand beyond the surface's longest diameter\n// (calculated based on the diagonal plus a constant padding), and are clipped at the surface's border via\n// `overflow: hidden`.\nconst getBoundedRadius = (rect: ClientRect, padding: number) => {\n const hypotenuse = Math.sqrt(\n Math.pow(rect.width, 2) + Math.pow(rect.height, 2)\n );\n return hypotenuse + padding;\n};\n\nfunction getScale(rect: ClientRect) {\n const maxDim = Math.max(rect.height, rect.width);\n const padding = 10;\n const initialOriginScale = 0.6;\n const maxRadius = getBoundedRadius(rect, padding);\n\n // Ripple is sized as a fraction of the largest dimension of the surface, then scales up using a CSS scale transform\n const initialSize = Math.floor(maxDim * initialOriginScale);\n\n return {\n size: initialSize,\n scale: maxRadius / initialSize,\n centerX: rect.width / 2,\n centerY: rect.height / 2,\n };\n}\n\nfunction calculateRipplePosition(\n rect: ClientRect,\n clientX: number,\n clientY: number,\n center = false\n) {\n const rippleStart = center\n ? {\n x: rect.width / 2,\n y: rect.height / 2,\n }\n : {\n x: clientX - rect.left,\n y: clientY - rect.top,\n };\n\n return {\n state: 'entering' as const,\n ...rippleStart,\n ...getScale(rect),\n };\n}\n\nexport interface RippleOptions {\n opacity: number;\n backgroundColor: string;\n enterDuration?: number;\n leaveDuration?: number;\n center?: boolean;\n disabled?: boolean;\n}\n\nexport const useRipple = (opts: RippleOptions) => {\n const {\n opacity,\n backgroundColor,\n enterDuration = 225,\n leaveDuration = 150,\n } = opts;\n\n // rippleState must be a ref, because it accesses the current value\n // inside closures... if we use state, it's gonna recapture\n // the state variable and won't work correctly\n const rippleState = useRef(\n 'left' as 'entering' | 'entered' | 'leaving' | 'left' | 'restart'\n );\n const [ripple, setRipple] = useState(defaultRipple);\n const leavingTimeout = useRef<number | undefined>(undefined);\n const enteringTimeout = useRef<number | undefined>(undefined);\n const restartTimeout = useRef<number | undefined>(undefined);\n\n const shouldLeave = useRef(false);\n\n // clear timeouts to avoid setting state on unmounted component\n useEffect(() => {\n return () => {\n restartTimeout.current && cancelAnimationFrame(restartTimeout.current);\n clearTimeout(enteringTimeout.current);\n clearTimeout(leavingTimeout.current);\n };\n }, []);\n\n // State handling\n const setLeft = () => {\n rippleState.current = 'left';\n setRipple({ ...defaultRipple });\n };\n\n const setLeaving = () => {\n clearTimeout(enteringTimeout.current);\n rippleState.current = 'leaving';\n setRipple((ripple) => ({\n ...ripple,\n }));\n\n leavingTimeout.current = window.setTimeout(setLeft, leaveDuration);\n };\n\n const setEntered = () => {\n rippleState.current = 'entered';\n setRipple((ripple) => ({\n ...ripple,\n }));\n\n if (shouldLeave.current) {\n setLeaving();\n }\n };\n\n const deactivate = () => {\n shouldLeave.current = true;\n if (rippleState.current === 'entered') {\n setLeaving();\n }\n };\n\n const activate = (\n rect: ClientRect,\n clientX: number,\n clientY: number,\n center = false\n ) => {\n clearTimeout(leavingTimeout.current);\n clearTimeout(enteringTimeout.current);\n shouldLeave.current = false;\n\n rippleState.current = 'restart';\n setRipple({ ...defaultRipple });\n restartTimeout.current = requestAnimationFrame(() => {\n rippleState.current = 'entering';\n setRipple(calculateRipplePosition(rect, clientX, clientY, center));\n\n enteringTimeout.current = window.setTimeout(setEntered, enterDuration);\n });\n };\n\n // Styling\n let animation: string | undefined = undefined;\n switch (rippleState.current) {\n case 'entering':\n case 'entered':\n animation =\n `${radiusIn} ${enterDuration}ms forwards,` +\n `${opacityIn} ${enterDuration / 3}ms forwards`;\n break;\n case 'leaving':\n animation =\n `${radiusIn} ${enterDuration}ms forwards,` +\n `${opacityOut} ${leaveDuration}ms forwards`;\n break;\n }\n\n let style = {};\n switch (rippleState.current) {\n case 'entering':\n case 'entered':\n case 'leaving':\n style = {\n [RIPPLE_SIZE]: `${ripple.size}px`,\n [RIPPLE_POSITION]: `${-ripple.size / 2}px`,\n [RIPPLE_BACKGROUND_COLOR]: backgroundColor,\n [RIPPLE_TRANSLATE_START]: `${ripple.x}px, ${ripple.y}px`,\n [RIPPLE_TRANSLATE_END]: `${ripple.centerX}px, ${ripple.centerY}px`,\n [RIPPLE_OPACITY_END]: opacity,\n [RIPPLE_SCALE_END]: `${ripple.scale}`,\n };\n break;\n }\n\n return {\n activate,\n deactivate,\n style,\n animation,\n // key: counter,\n };\n};\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,SAAS,QAAQ,OAAO;AAEnD,SAASC,QAAQ,EAAEC,SAAS,EAAEC,UAAU,QAAQ,aAAa;AAC7D,SACEC,sBAAsB,EACtBC,oBAAoB,EACpBC,kBAAkB,EAClBC,gBAAgB,EAChBC,WAAW,EACXC,uBAAuB,EACvBC,eAAe,QACV,aAAa;AAEpB,MAAMC,aAAa,GAAG;EACpBC,CAAC,EAAE,CAAC;EACJC,CAAC,EAAE,CAAC;EACJC,IAAI,EAAE,CAAC;EACPC,KAAK,EAAE,CAAC;EACRC,OAAO,EAAE,CAAC;EACVC,OAAO,EAAE;AACX,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAGA,CAACC,IAAgB,EAAEC,OAAe,KAAK;EAC9D,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,SAAS;MACZW,SAAS,GACP,GAAGpE,QAAQ,IAAIgD,aAAa,cAAc,GAC1C,GAAG/C,SAAS,IAAI+C,aAAa,GAAG,CAAC,aAAa;MAChD;IACF,KAAK,SAAS;MACZoB,SAAS,GACP,GAAGpE,QAAQ,IAAIgD,aAAa,cAAc,GAC1C,GAAG9C,UAAU,IAAI+C,aAAa,aAAa;MAC7C;EACJ;EAEA,IAAIoB,KAAK,GAAG,CAAC,CAAC;EACd,QAAQnB,WAAW,CAACO,OAAO;IACzB,KAAK,UAAU;IACf,KAAK,SAAS;IACd,KAAK,SAAS;MACZY,KAAK,GAAG;QACN,CAAC9D,WAAW,GAAG,GAAG4C,MAAM,CAACtC,IAAI,IAAI;QACjC,CAACJ,eAAe,GAAG,GAAG,CAAC0C,MAAM,CAACtC,IAAI,GAAG,CAAC,IAAI;QAC1C,CAACL,uBAAuB,GAAGuC,eAAe;QAC1C,CAAC5C,sBAAsB,GAAG,GAAGgD,MAAM,CAACxC,CAAC,OAAOwC,MAAM,CAACvC,CAAC,IAAI;QACxD,CAACR,oBAAoB,GAAG,GAAG+C,MAAM,CAACpC,OAAO,OAAOoC,MAAM,CAACnC,OAAO,IAAI;QAClE,CAACX,kBAAkB,GAAGyC,OAAO;QAC7B,CAACxC,gBAAgB,GAAG,GAAG6C,MAAM,CAACrC,KAAK;MACrC,CAAC;MACD;EACJ;EAEA,OAAO;IACLoD,QAAQ;IACRD,UAAU;IACVI,KAAK;IACLD;IACA;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { KeyboardEvent as ReactKeyboardEvent, PointerEvent } from 'react';
|
|
2
|
-
import type { RippleOptions } from './useRipple';
|
|
3
|
-
export declare function useRippleHandlers<T extends HTMLElement>(opts: RippleOptions): {
|
|
4
|
-
style: {};
|
|
5
|
-
animation: string | undefined;
|
|
6
|
-
handleKeyDown: (e: ReactKeyboardEvent<T>) => void;
|
|
7
|
-
handlePointerDown: (e: PointerEvent<T>) => void;
|
|
8
|
-
};
|
|
1
|
+
import type { KeyboardEvent as ReactKeyboardEvent, PointerEvent } from 'react';
|
|
2
|
+
import type { RippleOptions } from './useRipple';
|
|
3
|
+
export declare function useRippleHandlers<T extends HTMLElement>(opts: RippleOptions): {
|
|
4
|
+
style: {};
|
|
5
|
+
animation: string | undefined;
|
|
6
|
+
handleKeyDown: (e: ReactKeyboardEvent<T>) => void;
|
|
7
|
+
handlePointerDown: (e: PointerEvent<T>) => void;
|
|
8
|
+
};
|
|
@@ -1,60 +1,51 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["activate", "deactivate"];
|
|
4
1
|
import { useRef } from 'react';
|
|
5
2
|
import { useRipple } from './useRipple';
|
|
6
|
-
|
|
7
|
-
var disabledHandler = function disabledHandler() {
|
|
3
|
+
const disabledHandler = () => {
|
|
8
4
|
/* When disabled, we don't wanna handle neither keyDown, nor pointerDown */
|
|
9
5
|
};
|
|
10
|
-
|
|
11
6
|
export function useRippleHandlers(opts) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
const {
|
|
8
|
+
activate,
|
|
9
|
+
deactivate,
|
|
10
|
+
...rest
|
|
11
|
+
} = useRipple(opts);
|
|
12
|
+
|
|
13
|
+
// Pointer activation
|
|
14
|
+
const handlePointerUp = () => {
|
|
19
15
|
window.removeEventListener('pointerup', handlePointerUp);
|
|
20
16
|
window.removeEventListener('pointercancel', handlePointerUp);
|
|
21
17
|
deactivate();
|
|
22
18
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var rect = e.currentTarget.getBoundingClientRect();
|
|
19
|
+
const handlePointerDown = e => {
|
|
20
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
26
21
|
activate(rect, e.clientX, e.clientY, opts.center);
|
|
27
22
|
window.addEventListener('pointerup', handlePointerUp);
|
|
28
23
|
window.addEventListener('pointercancel', handlePointerUp);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
var keyReleased = useRef(true);
|
|
24
|
+
};
|
|
33
25
|
|
|
34
|
-
|
|
26
|
+
// Keyboard activation
|
|
27
|
+
const keyReleased = useRef(true);
|
|
28
|
+
const handleKeyUp = e => {
|
|
35
29
|
if (e.key !== ' ') {
|
|
36
30
|
return;
|
|
37
31
|
}
|
|
38
|
-
|
|
39
32
|
window.removeEventListener('keyup', handleKeyUp);
|
|
40
33
|
keyReleased.current = true;
|
|
41
34
|
deactivate();
|
|
42
35
|
};
|
|
43
|
-
|
|
44
|
-
var handleKeyDown = function handleKeyDown(e) {
|
|
36
|
+
const handleKeyDown = e => {
|
|
45
37
|
if (e.key !== ' ' || !keyReleased.current) {
|
|
46
38
|
return;
|
|
47
39
|
}
|
|
48
|
-
|
|
49
|
-
var rect = e.currentTarget.getBoundingClientRect();
|
|
40
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
50
41
|
keyReleased.current = false;
|
|
51
42
|
activate(rect, 0, 0, true);
|
|
52
43
|
window.addEventListener('keyup', handleKeyUp);
|
|
53
44
|
};
|
|
54
|
-
|
|
55
|
-
return _extends({
|
|
45
|
+
return {
|
|
56
46
|
handleKeyDown: opts.disabled ? disabledHandler : handleKeyDown,
|
|
57
|
-
handlePointerDown: opts.disabled ? disabledHandler : handlePointerDown
|
|
58
|
-
|
|
47
|
+
handlePointerDown: opts.disabled ? disabledHandler : handlePointerDown,
|
|
48
|
+
...rest
|
|
49
|
+
};
|
|
59
50
|
}
|
|
60
51
|
//# sourceMappingURL=useRippleHandlers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRippleHandlers.js","names":["useRef","useRipple","disabledHandler","useRippleHandlers","opts","activate","deactivate","rest","handlePointerUp","window","removeEventListener","handlePointerDown","e","rect","currentTarget","getBoundingClientRect","clientX","clientY","center","addEventListener","keyReleased","handleKeyUp","key","current","handleKeyDown","disabled"],"sources":["../../../src/Ripple/useRippleHandlers.ts"],"sourcesContent":["import type { KeyboardEvent as ReactKeyboardEvent, PointerEvent } from 'react';\
|
|
1
|
+
{"version":3,"file":"useRippleHandlers.js","names":["useRef","useRipple","disabledHandler","useRippleHandlers","opts","activate","deactivate","rest","handlePointerUp","window","removeEventListener","handlePointerDown","e","rect","currentTarget","getBoundingClientRect","clientX","clientY","center","addEventListener","keyReleased","handleKeyUp","key","current","handleKeyDown","disabled"],"sources":["../../../src/Ripple/useRippleHandlers.ts"],"sourcesContent":["import type { KeyboardEvent as ReactKeyboardEvent, PointerEvent } from 'react';\nimport { useRef } from 'react';\n\nimport type { RippleOptions } from './useRipple';\nimport { useRipple } from './useRipple';\n\nconst disabledHandler = () => {\n /* When disabled, we don't wanna handle neither keyDown, nor pointerDown */\n};\n\nexport function useRippleHandlers<T extends HTMLElement>(opts: RippleOptions) {\n const { activate, deactivate, ...rest } = useRipple(opts);\n\n // Pointer activation\n const handlePointerUp = () => {\n window.removeEventListener('pointerup', handlePointerUp);\n window.removeEventListener('pointercancel', handlePointerUp);\n deactivate();\n };\n\n const handlePointerDown = (e: PointerEvent<T>) => {\n const rect = e.currentTarget.getBoundingClientRect();\n activate(rect, e.clientX, e.clientY, opts.center);\n window.addEventListener('pointerup', handlePointerUp);\n window.addEventListener('pointercancel', handlePointerUp);\n };\n\n // Keyboard activation\n const keyReleased = useRef(true);\n const handleKeyUp = (e: KeyboardEvent) => {\n if (e.key !== ' ') {\n return;\n }\n window.removeEventListener('keyup', handleKeyUp);\n keyReleased.current = true;\n deactivate();\n };\n\n const handleKeyDown = (e: ReactKeyboardEvent<T>) => {\n if (e.key !== ' ' || !keyReleased.current) {\n return;\n }\n const rect = e.currentTarget.getBoundingClientRect();\n keyReleased.current = false;\n activate(rect, 0, 0, true);\n window.addEventListener('keyup', handleKeyUp);\n };\n\n return {\n handleKeyDown: opts.disabled ? disabledHandler : handleKeyDown,\n handlePointerDown: opts.disabled ? disabledHandler : handlePointerDown,\n ...rest,\n };\n}\n"],"mappings":"AACA,SAASA,MAAM,QAAQ,OAAO;AAG9B,SAASC,SAAS,QAAQ,aAAa;AAEvC,MAAMC,eAAe,GAAGA,CAAA,KAAM;EAC5B;AAAA,CACD;AAED,OAAO,SAASC,iBAAiBA,CAAwBC,IAAmB,EAAE;EAC5E,MAAM;IAAEC,QAAQ;IAAEC,UAAU;IAAE,GAAGC;EAAK,CAAC,GAAGN,SAAS,CAACG,IAAI,CAAC;;EAEzD;EACA,MAAMI,eAAe,GAAGA,CAAA,KAAM;IAC5BC,MAAM,CAACC,mBAAmB,CAAC,WAAW,EAAEF,eAAe,CAAC;IACxDC,MAAM,CAACC,mBAAmB,CAAC,eAAe,EAAEF,eAAe,CAAC;IAC5DF,UAAU,CAAC,CAAC;EACd,CAAC;EAED,MAAMK,iBAAiB,GAAIC,CAAkB,IAAK;IAChD,MAAMC,IAAI,GAAGD,CAAC,CAACE,aAAa,CAACC,qBAAqB,CAAC,CAAC;IACpDV,QAAQ,CAACQ,IAAI,EAAED,CAAC,CAACI,OAAO,EAAEJ,CAAC,CAACK,OAAO,EAAEb,IAAI,CAACc,MAAM,CAAC;IACjDT,MAAM,CAACU,gBAAgB,CAAC,WAAW,EAAEX,eAAe,CAAC;IACrDC,MAAM,CAACU,gBAAgB,CAAC,eAAe,EAAEX,eAAe,CAAC;EAC3D,CAAC;;EAED;EACA,MAAMY,WAAW,GAAGpB,MAAM,CAAC,IAAI,CAAC;EAChC,MAAMqB,WAAW,GAAIT,CAAgB,IAAK;IACxC,IAAIA,CAAC,CAACU,GAAG,KAAK,GAAG,EAAE;MACjB;IACF;IACAb,MAAM,CAACC,mBAAmB,CAAC,OAAO,EAAEW,WAAW,CAAC;IAChDD,WAAW,CAACG,OAAO,GAAG,IAAI;IAC1BjB,UAAU,CAAC,CAAC;EACd,CAAC;EAED,MAAMkB,aAAa,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