@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,7 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["type", "id", "variant", "color", "value", "defaultValue", "error", "disabled", "maxLength", "hideCharacterCounter", "label", "placeholder", "helperText", "multiline", "onChange", "onFocus", "onBlur", "leadingIcon", "trailingIcon", "containerProps"];
|
|
5
1
|
import { forwardRef, useState, useId } from 'react';
|
|
6
2
|
import { wrapEvent, useControlledState } from '@basic-ui/core';
|
|
7
3
|
import { Input } from './Input';
|
|
@@ -11,89 +7,65 @@ import { OutlinedContainer } from './OutlinedContainer';
|
|
|
11
7
|
import { HelperText } from './HelperText';
|
|
12
8
|
import { Box } from '../Box';
|
|
13
9
|
import { IconContainer } from './IconContainer';
|
|
14
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
-
|
|
16
|
-
var componentMap = {
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
const componentMap = {
|
|
17
12
|
outlined: OutlinedContainer,
|
|
18
13
|
filled: FilledContainer
|
|
19
14
|
};
|
|
20
|
-
|
|
21
15
|
function characterCounter(value, maxLength) {
|
|
22
16
|
if (maxLength === undefined) {
|
|
23
17
|
return null;
|
|
24
18
|
}
|
|
25
|
-
|
|
26
|
-
return "".concat(typeof value === 'string' ? value.length : 0, " / ").concat(maxLength);
|
|
19
|
+
return `${typeof value === 'string' ? value.length : 0} / ${maxLength}`;
|
|
27
20
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
var _useControlledState = useControlledState(valueProp, onChangeProp, defaultValue, function (setState) {
|
|
61
|
-
return function (e) {
|
|
62
|
-
setState(e.target.value);
|
|
63
|
-
};
|
|
64
|
-
}),
|
|
65
|
-
_useControlledState2 = _slicedToArray(_useControlledState, 2),
|
|
66
|
-
value = _useControlledState2[0],
|
|
67
|
-
onChange = _useControlledState2[1];
|
|
68
|
-
|
|
69
|
-
var _useState = useState(false),
|
|
70
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
71
|
-
hasFocus = _useState2[0],
|
|
72
|
-
setHasFocus = _useState2[1];
|
|
73
|
-
|
|
74
|
-
var Container = componentMap[variant] || OutlinedContainer;
|
|
75
|
-
var fallbackId = useId();
|
|
76
|
-
var theme = useTheme();
|
|
77
|
-
|
|
78
|
-
var handleFocus = function handleFocus() {
|
|
21
|
+
export const TextField = /*#__PURE__*/forwardRef(function TextField(props, forwardedRef) {
|
|
22
|
+
const {
|
|
23
|
+
type = 'text',
|
|
24
|
+
id: idProp,
|
|
25
|
+
variant = 'outlined',
|
|
26
|
+
color = 'primary',
|
|
27
|
+
value: valueProp,
|
|
28
|
+
defaultValue = '',
|
|
29
|
+
error,
|
|
30
|
+
disabled,
|
|
31
|
+
maxLength,
|
|
32
|
+
hideCharacterCounter = false,
|
|
33
|
+
label = null,
|
|
34
|
+
placeholder,
|
|
35
|
+
helperText: helperTextProp,
|
|
36
|
+
multiline,
|
|
37
|
+
onChange: onChangeProp,
|
|
38
|
+
onFocus,
|
|
39
|
+
onBlur,
|
|
40
|
+
leadingIcon = null,
|
|
41
|
+
trailingIcon = null,
|
|
42
|
+
containerProps,
|
|
43
|
+
...otherProps
|
|
44
|
+
} = props;
|
|
45
|
+
const [value, onChange] = useControlledState(valueProp, onChangeProp, defaultValue, setState => e => {
|
|
46
|
+
setState(e.target.value);
|
|
47
|
+
});
|
|
48
|
+
const [hasFocus, setHasFocus] = useState(false);
|
|
49
|
+
const Container = componentMap[variant] || OutlinedContainer;
|
|
50
|
+
const fallbackId = useId();
|
|
51
|
+
const theme = useTheme();
|
|
52
|
+
const handleFocus = () => {
|
|
79
53
|
setHasFocus(true);
|
|
80
54
|
};
|
|
81
|
-
|
|
82
|
-
var handleBlur = function handleBlur() {
|
|
55
|
+
const handleBlur = () => {
|
|
83
56
|
setHasFocus(false);
|
|
84
57
|
};
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
var labelIsFloating = hasFocus || typeof value === 'string' && value.length > 0;
|
|
58
|
+
const hasError = Boolean(error);
|
|
59
|
+
const helperText = typeof error === 'string' ? error : helperTextProp;
|
|
60
|
+
const id = idProp || fallbackId;
|
|
61
|
+
const inputId = `${id}-text-field`;
|
|
62
|
+
const helperTextId = helperText ? `${id}-helper-text` : undefined;
|
|
63
|
+
const labelIsFloating = hasFocus || typeof value === 'string' && value.length > 0;
|
|
92
64
|
return /*#__PURE__*/_jsxs(Box, {
|
|
93
65
|
display: "inline-flex",
|
|
94
66
|
flexDirection: "column",
|
|
95
67
|
width: "100%",
|
|
96
|
-
children: [/*#__PURE__*/_jsxs(Container,
|
|
68
|
+
children: [/*#__PURE__*/_jsxs(Container, {
|
|
97
69
|
theme: theme,
|
|
98
70
|
label: label,
|
|
99
71
|
color: color,
|
|
@@ -102,12 +74,12 @@ export var TextField = /*#__PURE__*/forwardRef(function TextField(props, forward
|
|
|
102
74
|
inputId: inputId,
|
|
103
75
|
hasFocus: hasFocus,
|
|
104
76
|
disabled: disabled,
|
|
105
|
-
leadingIcon: Boolean(leadingIcon)
|
|
106
|
-
|
|
77
|
+
leadingIcon: Boolean(leadingIcon),
|
|
78
|
+
...containerProps,
|
|
107
79
|
children: [leadingIcon && /*#__PURE__*/_jsx(IconContainer, {
|
|
108
80
|
position: "start",
|
|
109
81
|
children: leadingIcon
|
|
110
|
-
}), /*#__PURE__*/_jsx(Input,
|
|
82
|
+
}), /*#__PURE__*/_jsx(Input, {
|
|
111
83
|
ref: forwardedRef,
|
|
112
84
|
as: multiline ? 'textarea' : 'input',
|
|
113
85
|
variant: variant,
|
|
@@ -126,12 +98,13 @@ export var TextField = /*#__PURE__*/forwardRef(function TextField(props, forward
|
|
|
126
98
|
"aria-describedby": helperTextId,
|
|
127
99
|
hasLabel: !!label,
|
|
128
100
|
leadingIcon: Boolean(leadingIcon),
|
|
129
|
-
trailingIcon: Boolean(trailingIcon)
|
|
130
|
-
|
|
101
|
+
trailingIcon: Boolean(trailingIcon),
|
|
102
|
+
...otherProps
|
|
103
|
+
}), trailingIcon && /*#__PURE__*/_jsx(IconContainer, {
|
|
131
104
|
position: "end",
|
|
132
105
|
children: trailingIcon
|
|
133
106
|
})]
|
|
134
|
-
})
|
|
107
|
+
}), /*#__PURE__*/_jsx(HelperText, {
|
|
135
108
|
error: hasError,
|
|
136
109
|
disabled: disabled,
|
|
137
110
|
leftSide: helperText && /*#__PURE__*/_jsx("span", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.js","names":["forwardRef","useState","useId","wrapEvent","useControlledState","Input","useTheme","FilledContainer","OutlinedContainer","HelperText","Box","IconContainer","componentMap","outlined","filled","characterCounter","value","maxLength","undefined","length","TextField","props","forwardedRef","type","
|
|
1
|
+
{"version":3,"file":"TextField.js","names":["forwardRef","useState","useId","wrapEvent","useControlledState","Input","useTheme","FilledContainer","OutlinedContainer","HelperText","Box","IconContainer","jsx","_jsx","jsxs","_jsxs","componentMap","outlined","filled","characterCounter","value","maxLength","undefined","length","TextField","props","forwardedRef","type","id","idProp","variant","color","valueProp","defaultValue","error","disabled","hideCharacterCounter","label","placeholder","helperText","helperTextProp","multiline","onChange","onChangeProp","onFocus","onBlur","leadingIcon","trailingIcon","containerProps","otherProps","setState","e","target","hasFocus","setHasFocus","Container","fallbackId","theme","handleFocus","handleBlur","hasError","Boolean","inputId","helperTextId","labelIsFloating","display","flexDirection","width","children","position","ref","as","hasLabel","leftSide","rightSide"],"sources":["../../../src/TextField/TextField.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { forwardRef, useState, useId } from 'react';\nimport { wrapEvent, useControlledState } from '@basic-ui/core';\n\nimport type { InputProps } from './Input';\nimport { Input } from './Input';\nimport { useTheme } from '../theme';\nimport { FilledContainer } from './FilledContainer';\nimport { OutlinedContainer } from './OutlinedContainer';\nimport { HelperText } from './HelperText';\nimport type { BoxProps } from '../Box';\nimport { Box } from '../Box';\nimport { IconContainer } from './IconContainer';\n\nconst componentMap = {\n outlined: OutlinedContainer,\n filled: FilledContainer,\n};\n\nfunction characterCounter(\n value: string | number | string[],\n maxLength?: number\n) {\n if (maxLength === undefined) {\n return null;\n }\n\n return `${typeof value === 'string' ? value.length : 0} / ${maxLength}`;\n}\n\nexport type TextFieldProps = Omit<InputProps, 'value' | 'defaultValue'> & {\n variant?: 'outlined' | 'filled';\n containerProps?: Omit<BoxProps, 'color'>;\n color?: 'primary' | 'secondary';\n label?: ReactNode;\n helperText?: string;\n maxLength?: number;\n hideCharacterCounter?: boolean;\n defaultValue?: string;\n value?: string;\n multiline?: boolean;\n error?: boolean | string;\n leadingIcon?: ReactNode;\n trailingIcon?: ReactNode;\n};\n\nexport const TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n function TextField(props, forwardedRef) {\n const {\n type = 'text',\n id: idProp,\n variant = 'outlined',\n color = 'primary',\n value: valueProp,\n defaultValue = '',\n error,\n disabled,\n maxLength,\n hideCharacterCounter = false,\n label = null,\n placeholder,\n helperText: helperTextProp,\n multiline,\n onChange: onChangeProp,\n onFocus,\n onBlur,\n leadingIcon = null,\n trailingIcon = null,\n containerProps,\n ...otherProps\n } = props;\n const [value, onChange] = useControlledState(\n valueProp,\n onChangeProp,\n defaultValue,\n (setState) => (e) => {\n setState(e.target.value);\n }\n );\n const [hasFocus, setHasFocus] = useState(false);\n\n const Container = componentMap[variant] || OutlinedContainer;\n\n const fallbackId = useId();\n\n const theme = useTheme();\n\n const handleFocus = () => {\n setHasFocus(true);\n };\n\n const handleBlur = () => {\n setHasFocus(false);\n };\n\n const hasError = Boolean(error);\n const helperText = typeof error === 'string' ? error : helperTextProp;\n\n const id = idProp || fallbackId;\n const inputId = `${id}-text-field`;\n const helperTextId = helperText ? `${id}-helper-text` : undefined;\n\n const labelIsFloating =\n hasFocus || (typeof value === 'string' && value.length > 0);\n\n return (\n <Box display=\"inline-flex\" flexDirection=\"column\" width=\"100%\">\n <Container\n theme={theme}\n label={label}\n color={color}\n error={hasError}\n labelIsFloating={labelIsFloating}\n inputId={inputId}\n hasFocus={hasFocus}\n disabled={disabled}\n leadingIcon={Boolean(leadingIcon)}\n {...containerProps}\n >\n {leadingIcon && (\n <IconContainer position=\"start\">{leadingIcon}</IconContainer>\n )}\n <Input\n ref={forwardedRef}\n as={multiline ? 'textarea' : 'input'}\n variant={variant}\n type={type}\n id={inputId}\n onFocus={wrapEvent(onFocus, handleFocus)}\n onBlur={wrapEvent(onBlur, handleBlur)}\n onChange={onChange}\n value={value}\n theme={theme}\n placeholder={placeholder}\n disabled={disabled}\n aria-disabled={disabled ? 'true' : undefined}\n maxLength={maxLength}\n multiline={multiline}\n aria-describedby={helperTextId}\n hasLabel={!!label}\n leadingIcon={Boolean(leadingIcon)}\n trailingIcon={Boolean(trailingIcon)}\n {...otherProps}\n />\n {trailingIcon && (\n <IconContainer position=\"end\">{trailingIcon}</IconContainer>\n )}\n </Container>\n\n <HelperText\n error={hasError}\n disabled={disabled}\n leftSide={helperText && <span id={helperTextId}>{helperText}</span>}\n rightSide={\n !hideCharacterCounter &&\n characterCounter(value as string, maxLength)\n }\n />\n </Box>\n );\n }\n);\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const PADDING_LEFT_WITH_ICON = 14;
|
|
2
|
-
export declare const PADDING_LEFT_WITHOUT_ICON = 16;
|
|
3
|
-
export declare const ICON_WIDTH = 24;
|
|
4
|
-
export declare const PADDING_RIGHT_WITH_ICON = 12;
|
|
5
|
-
export declare const PADDING_RIGHT_WITHOUT_ICON = 16;
|
|
1
|
+
export declare const PADDING_LEFT_WITH_ICON = 14;
|
|
2
|
+
export declare const PADDING_LEFT_WITHOUT_ICON = 16;
|
|
3
|
+
export declare const ICON_WIDTH = 24;
|
|
4
|
+
export declare const PADDING_RIGHT_WITH_ICON = 12;
|
|
5
|
+
export declare const PADDING_RIGHT_WITHOUT_ICON = 16;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
1
|
+
export const PADDING_LEFT_WITH_ICON = 14;
|
|
2
|
+
export const PADDING_LEFT_WITHOUT_ICON = 16;
|
|
3
|
+
export const ICON_WIDTH = 24;
|
|
4
|
+
export const PADDING_RIGHT_WITH_ICON = 12;
|
|
5
|
+
export const PADDING_RIGHT_WITHOUT_ICON = 16;
|
|
6
6
|
//# sourceMappingURL=consts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.js","names":["PADDING_LEFT_WITH_ICON","PADDING_LEFT_WITHOUT_ICON","ICON_WIDTH","PADDING_RIGHT_WITH_ICON","PADDING_RIGHT_WITHOUT_ICON"],"sources":["../../../src/TextField/consts.ts"],"sourcesContent":["export const PADDING_LEFT_WITH_ICON = 14;\
|
|
1
|
+
{"version":3,"file":"consts.js","names":["PADDING_LEFT_WITH_ICON","PADDING_LEFT_WITHOUT_ICON","ICON_WIDTH","PADDING_RIGHT_WITH_ICON","PADDING_RIGHT_WITHOUT_ICON"],"sources":["../../../src/TextField/consts.ts"],"sourcesContent":["export const PADDING_LEFT_WITH_ICON = 14;\nexport const PADDING_LEFT_WITHOUT_ICON = 16;\n\nexport const ICON_WIDTH = 24;\n\nexport const PADDING_RIGHT_WITH_ICON = 12;\nexport const PADDING_RIGHT_WITHOUT_ICON = 16;\n"],"mappings":"AAAA,OAAO,MAAMA,sBAAsB,GAAG,EAAE;AACxC,OAAO,MAAMC,yBAAyB,GAAG,EAAE;AAE3C,OAAO,MAAMC,UAAU,GAAG,EAAE;AAE5B,OAAO,MAAMC,uBAAuB,GAAG,EAAE;AACzC,OAAO,MAAMC,0BAA0B,GAAG,EAAE","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './TextField';
|
|
2
|
-
export * from './FilledContainer';
|
|
3
|
-
export * from './OutlinedContainer';
|
|
4
|
-
export * from './HelperText';
|
|
1
|
+
export * from './TextField';
|
|
2
|
+
export * from './FilledContainer';
|
|
3
|
+
export * from './OutlinedContainer';
|
|
4
|
+
export * from './HelperText';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/TextField/index.ts"],"sourcesContent":["export * from './TextField';\
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/TextField/index.ts"],"sourcesContent":["export * from './TextField';\nexport * from './FilledContainer';\nexport * from './OutlinedContainer';\nexport * from './HelperText';\n"],"mappings":"AAAA,cAAc,aAAa;AAC3B,cAAc,mBAAmB;AACjC,cAAc,qBAAqB;AACnC,cAAc,cAAc","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare function BorderSlider(props: {
|
|
2
|
-
label: string;
|
|
3
|
-
defaultValue: number;
|
|
4
|
-
onChange: (value: number) => void;
|
|
5
|
-
onReset: () => void;
|
|
6
|
-
resetDisabled: boolean;
|
|
7
|
-
}): JSX.Element;
|
|
1
|
+
export declare function BorderSlider(props: {
|
|
2
|
+
label: string;
|
|
3
|
+
defaultValue: number;
|
|
4
|
+
onChange: (value: number) => void;
|
|
5
|
+
onReset: () => void;
|
|
6
|
+
resetDisabled: boolean;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,20 +1,14 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
1
|
import { startTransition, useEffect, useRef, useState } from 'react';
|
|
3
2
|
import { Box } from '../Box';
|
|
4
3
|
import { Link as BaseLink } from '../Link';
|
|
5
4
|
import { Slider, SliderMarker } from '../Slider';
|
|
6
5
|
import { Text } from '../Text';
|
|
7
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
|
|
9
|
-
var Link = BaseLink;
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
const Link = BaseLink;
|
|
10
8
|
export function BorderSlider(props) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
setValue = _useState2[1];
|
|
15
|
-
|
|
16
|
-
var resetting = useRef(false);
|
|
17
|
-
useEffect(function () {
|
|
9
|
+
const [value, setValue] = useState(props.defaultValue);
|
|
10
|
+
const resetting = useRef(false);
|
|
11
|
+
useEffect(() => {
|
|
18
12
|
if (resetting.current) {
|
|
19
13
|
setValue(props.defaultValue);
|
|
20
14
|
resetting.current = false;
|
|
@@ -33,7 +27,7 @@ export function BorderSlider(props) {
|
|
|
33
27
|
children: [props.label, ' ', /*#__PURE__*/_jsx(Link, {
|
|
34
28
|
as: "button",
|
|
35
29
|
disabled: props.resetDisabled ? true : undefined,
|
|
36
|
-
onClick:
|
|
30
|
+
onClick: () => {
|
|
37
31
|
resetting.current = true;
|
|
38
32
|
props.onReset();
|
|
39
33
|
},
|
|
@@ -44,9 +38,9 @@ export function BorderSlider(props) {
|
|
|
44
38
|
})]
|
|
45
39
|
}), /*#__PURE__*/_jsxs(Slider, {
|
|
46
40
|
value: value,
|
|
47
|
-
onChange:
|
|
41
|
+
onChange: (e, v) => {
|
|
48
42
|
setValue(v);
|
|
49
|
-
startTransition(
|
|
43
|
+
startTransition(() => {
|
|
50
44
|
props.onChange(v);
|
|
51
45
|
});
|
|
52
46
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BorderSlider.js","names":["startTransition","useEffect","useRef","useState","Box","Link","BaseLink","Slider","SliderMarker","Text","
|
|
1
|
+
{"version":3,"file":"BorderSlider.js","names":["startTransition","useEffect","useRef","useState","Box","Link","BaseLink","Slider","SliderMarker","Text","jsx","_jsx","jsxs","_jsxs","BorderSlider","props","value","setValue","defaultValue","resetting","current","width","display","flexDirection","children","justifyContent","pb","label","as","disabled","resetDisabled","undefined","onClick","onReset","onChange","e","v","min","max","step"],"sources":["../../../src/ThemeExplorer/BorderSlider.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes, FC } from 'react';\nimport { startTransition, useEffect, useRef, useState } from 'react';\n\nimport type { BoxProps } from '../Box';\nimport { Box } from '../Box';\nimport { Link as BaseLink } from '../Link';\nimport { Slider, SliderMarker } from '../Slider';\nimport { Text } from '../Text';\n\nconst Link: FC<\n BoxProps<HTMLButtonElement, ButtonHTMLAttributes<HTMLButtonElement>>\n> = BaseLink as any;\n\nexport function BorderSlider(props: {\n label: string;\n defaultValue: number;\n onChange: (value: number) => void;\n onReset: () => void;\n resetDisabled: boolean;\n}) {\n const [value, setValue] = useState(props.defaultValue);\n\n const resetting = useRef(false);\n useEffect(() => {\n if (resetting.current) {\n setValue(props.defaultValue);\n resetting.current = false;\n }\n }, [props.defaultValue]);\n\n return (\n <Box width=\"100%\" display=\"flex\" flexDirection=\"column\">\n <Text display=\"flex\" justifyContent=\"space-between\" width=\"100%\" pb={2}>\n <span>\n {props.label}{' '}\n <Link\n as=\"button\"\n disabled={props.resetDisabled ? true : undefined}\n onClick={() => {\n resetting.current = true;\n props.onReset();\n }}\n >\n Reset\n </Link>\n </span>\n <span>{value}px</span>\n </Text>\n <Slider\n value={value}\n onChange={(e, v) => {\n setValue(v);\n startTransition(() => {\n props.onChange(v);\n });\n }}\n min={0}\n max={64}\n step={2}\n >\n <SliderMarker value={2} />\n <SliderMarker value={4} />\n <SliderMarker value={8} />\n <SliderMarker value={12} />\n <SliderMarker value={16} />\n <SliderMarker value={24} />\n <SliderMarker value={32} />\n <SliderMarker value={40} />\n <SliderMarker value={48} />\n </Slider>\n </Box>\n );\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Color, ColorPickerProps as BaseColorPickerProps } from '@basic-ui/color-picker';
|
|
2
|
-
import type { FC } from 'react';
|
|
3
|
-
import type { BoxProps } from '../Box';
|
|
4
|
-
export
|
|
5
|
-
color: Color;
|
|
6
|
-
onChange: (color: Color) => void;
|
|
7
|
-
};
|
|
8
|
-
export declare const ColorPicker: FC<ColorPickerProps>;
|
|
1
|
+
import type { Color, ColorPickerProps as BaseColorPickerProps } from '@basic-ui/color-picker';
|
|
2
|
+
import type { FC } from 'react';
|
|
3
|
+
import type { BoxProps } from '../Box';
|
|
4
|
+
export type ColorPickerProps = (Omit<BoxProps, 'color' | 'onChange'> & BaseColorPickerProps) & {
|
|
5
|
+
color: Color;
|
|
6
|
+
onChange: (color: Color) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare const ColorPicker: FC<ColorPickerProps>;
|
|
@@ -1,31 +1,26 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["color", "onChange", "width", "height"];
|
|
4
1
|
import { ColorPicker as _BaseColorPicker, Hue as _Hue, HueCursor as _HueCursor, Saturation as _Saturation, SaturationCursor as _SaturationCursor } from '@basic-ui/color-picker';
|
|
5
2
|
import { Box } from '../Box';
|
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return /*#__PURE__*/_jsxs(BaseColorPicker, _extends(_extends({
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
const BaseColorPicker = _BaseColorPicker;
|
|
5
|
+
const Hue = _Hue;
|
|
6
|
+
const HueCursor = _HueCursor;
|
|
7
|
+
const Saturation = _Saturation;
|
|
8
|
+
const SaturationCursor = _SaturationCursor;
|
|
9
|
+
export const ColorPicker = _ref => {
|
|
10
|
+
let {
|
|
11
|
+
color,
|
|
12
|
+
onChange,
|
|
13
|
+
width = 450,
|
|
14
|
+
height = 225,
|
|
15
|
+
...otherProps
|
|
16
|
+
} = _ref;
|
|
17
|
+
return /*#__PURE__*/_jsxs(BaseColorPicker, {
|
|
23
18
|
as: Box,
|
|
24
19
|
width: width,
|
|
25
20
|
height: height,
|
|
26
21
|
onChange: onChange,
|
|
27
|
-
color: color
|
|
28
|
-
|
|
22
|
+
color: color,
|
|
23
|
+
...otherProps,
|
|
29
24
|
children: [/*#__PURE__*/_jsx(Saturation, {
|
|
30
25
|
as: Box,
|
|
31
26
|
sx: {
|
|
@@ -56,7 +51,7 @@ export var ColorPicker = function ColorPicker(_ref) {
|
|
|
56
51
|
userSelect: 'none',
|
|
57
52
|
width: '100%',
|
|
58
53
|
height: '12px',
|
|
59
|
-
backgroundImage:
|
|
54
|
+
backgroundImage: `linear-gradient(to right, rgb(255, 0, 0), rgb(255, 255, 0), rgb(0, 255, 0), rgb(0, 255, 255), rgb(0, 0, 255), rgb(255, 0, 255), rgb(255, 0, 0))`
|
|
60
55
|
},
|
|
61
56
|
children: /*#__PURE__*/_jsx(HueCursor, {
|
|
62
57
|
as: Box,
|
|
@@ -72,6 +67,6 @@ export var ColorPicker = function ColorPicker(_ref) {
|
|
|
72
67
|
}
|
|
73
68
|
})
|
|
74
69
|
})]
|
|
75
|
-
})
|
|
70
|
+
});
|
|
76
71
|
};
|
|
77
72
|
//# sourceMappingURL=ColorPicker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPicker.js","names":["ColorPicker","_BaseColorPicker","Hue","_Hue","HueCursor","_HueCursor","Saturation","_Saturation","SaturationCursor","_SaturationCursor","Box","BaseColorPicker","color","onChange","width","height","otherProps","position","touchAction","userSelect","backgroundImage","border","borderRadius","boxShadow","boxSizing","transform"],"sources":["../../../src/ThemeExplorer/ColorPicker.tsx"],"sourcesContent":["import type {\
|
|
1
|
+
{"version":3,"file":"ColorPicker.js","names":["ColorPicker","_BaseColorPicker","Hue","_Hue","HueCursor","_HueCursor","Saturation","_Saturation","SaturationCursor","_SaturationCursor","Box","jsx","_jsx","jsxs","_jsxs","BaseColorPicker","_ref","color","onChange","width","height","otherProps","as","children","sx","position","touchAction","userSelect","backgroundImage","border","borderRadius","boxShadow","boxSizing","transform"],"sources":["../../../src/ThemeExplorer/ColorPicker.tsx"],"sourcesContent":["import type {\n Color,\n ColorPickerProps as BaseColorPickerProps,\n HueProps,\n HueCursorProps,\n SaturationProps,\n SaturationCursorProps,\n} from '@basic-ui/color-picker';\nimport {\n ColorPicker as _BaseColorPicker,\n Hue as _Hue,\n HueCursor as _HueCursor,\n Saturation as _Saturation,\n SaturationCursor as _SaturationCursor,\n} from '@basic-ui/color-picker';\nimport type { FC } from 'react';\n\nimport type { BoxProps } from '../Box';\nimport { Box } from '../Box';\n\nexport type ColorPickerProps = (Omit<BoxProps, 'color' | 'onChange'> &\n BaseColorPickerProps) & {\n color: Color;\n onChange: (color: Color) => void;\n};\n\nconst BaseColorPicker: FC<\n Omit<BoxProps, 'color' | 'onChange'> & BaseColorPickerProps\n> = _BaseColorPicker as any;\nconst Hue: FC<BoxProps & HueProps> = _Hue as any;\nconst HueCursor: FC<BoxProps & HueCursorProps> = _HueCursor as any;\nconst Saturation: FC<BoxProps & SaturationProps> = _Saturation as any;\nconst SaturationCursor: FC<BoxProps & SaturationCursorProps> =\n _SaturationCursor as any;\n\nexport const ColorPicker: FC<ColorPickerProps> = ({\n color,\n onChange,\n width = 450,\n height = 225,\n ...otherProps\n}) => {\n return (\n <BaseColorPicker\n as={Box}\n width={width}\n height={height}\n onChange={onChange}\n color={color}\n {...otherProps}\n >\n <Saturation\n as={Box}\n sx={{\n position: 'relative',\n touchAction: 'none',\n userSelect: 'none',\n width: '100%',\n backgroundImage:\n 'linear-gradient(transparent, black), linear-gradient(to right, white, transparent)',\n }}\n >\n <SaturationCursor\n as={Box}\n sx={{\n position: 'absolute',\n width: '20px',\n height: '20px',\n border: '2px solid #ffffff',\n borderRadius: 'full',\n boxShadow: '0 0 15px 0 rgba(0, 0, 0, 0.15)',\n boxSizing: 'border-box',\n transform: 'translate(-10px, -10px)',\n }}\n />\n </Saturation>\n <Hue\n as={Box}\n sx={{\n position: 'relative',\n touchAction: 'none',\n userSelect: 'none',\n width: '100%',\n height: '12px',\n backgroundImage: `linear-gradient(to right, rgb(255, 0, 0), rgb(255, 255, 0), rgb(0, 255, 0), rgb(0, 255, 255), rgb(0, 0, 255), rgb(255, 0, 255), rgb(255, 0, 0))`,\n }}\n >\n <HueCursor\n as={Box}\n sx={{\n position: 'absolute',\n width: '20px',\n height: '20px',\n border: '2px solid #ffffff',\n borderRadius: 'full',\n boxShadow: 'rgba(0, 0, 0, 0.2) 0px 0px 0px 0.5px',\n boxSizing: 'border-box',\n transform: 'translate(-10px, -4px)',\n }}\n />\n </Hue>\n </BaseColorPicker>\n );\n};\n"],"mappings":"AAQA,SACEA,WAAW,IAAIC,gBAAgB,EAC/BC,GAAG,IAAIC,IAAI,EACXC,SAAS,IAAIC,UAAU,EACvBC,UAAU,IAAIC,WAAW,EACzBC,gBAAgB,IAAIC,iBAAiB,QAChC,wBAAwB;AAI/B,SAASC,GAAG,QAAQ,QAAQ;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAQ7B,MAAMC,eAEL,GAAGd,gBAAuB;AAC3B,MAAMC,GAA4B,GAAGC,IAAW;AAChD,MAAMC,SAAwC,GAAGC,UAAiB;AAClE,MAAMC,UAA0C,GAAGC,WAAkB;AACrE,MAAMC,gBAAsD,GAC1DC,iBAAwB;AAE1B,OAAO,MAAMT,WAAiC,GAAGgB,IAAA,IAM3C;EAAA,IAN4C;IAChDC,KAAK;IACLC,QAAQ;IACRC,KAAK,GAAG,GAAG;IACXC,MAAM,GAAG,GAAG;IACZ,GAAGC;EACL,CAAC,GAAAL,IAAA;EACC,oBACEF,KAAA,CAACC,eAAe;IACdO,EAAE,EAAEZ,GAAI;IACRS,KAAK,EAAEA,KAAM;IACbC,MAAM,EAAEA,MAAO;IACfF,QAAQ,EAAEA,QAAS;IACnBD,KAAK,EAAEA,KAAM;IAAA,GACTI,UAAU;IAAAE,QAAA,gBAEdX,IAAA,CAACN,UAAU;MACTgB,EAAE,EAAEZ,GAAI;MACRc,EAAE,EAAE;QACFC,QAAQ,EAAE,UAAU;QACpBC,WAAW,EAAE,MAAM;QACnBC,UAAU,EAAE,MAAM;QAClBR,KAAK,EAAE,MAAM;QACbS,eAAe,EACb;MACJ,CAAE;MAAAL,QAAA,eAEFX,IAAA,CAACJ,gBAAgB;QACfc,EAAE,EAAEZ,GAAI;QACRc,EAAE,EAAE;UACFC,QAAQ,EAAE,UAAU;UACpBN,KAAK,EAAE,MAAM;UACbC,MAAM,EAAE,MAAM;UACdS,MAAM,EAAE,mBAAmB;UAC3BC,YAAY,EAAE,MAAM;UACpBC,SAAS,EAAE,gCAAgC;UAC3CC,SAAS,EAAE,YAAY;UACvBC,SAAS,EAAE;QACb;MAAE,CACH;IAAC,CACQ,CAAC,eACbrB,IAAA,CAACV,GAAG;MACFoB,EAAE,EAAEZ,GAAI;MACRc,EAAE,EAAE;QACFC,QAAQ,EAAE,UAAU;QACpBC,WAAW,EAAE,MAAM;QACnBC,UAAU,EAAE,MAAM;QAClBR,KAAK,EAAE,MAAM;QACbC,MAAM,EAAE,MAAM;QACdQ,eAAe,EAAE;MACnB,CAAE;MAAAL,QAAA,eAEFX,IAAA,CAACR,SAAS;QACRkB,EAAE,EAAEZ,GAAI;QACRc,EAAE,EAAE;UACFC,QAAQ,EAAE,UAAU;UACpBN,KAAK,EAAE,MAAM;UACbC,MAAM,EAAE,MAAM;UACdS,MAAM,EAAE,mBAAmB;UAC3BC,YAAY,EAAE,MAAM;UACpBC,SAAS,EAAE,sCAAsC;UACjDC,SAAS,EAAE,YAAY;UACvBC,SAAS,EAAE;QACb;MAAE,CACH;IAAC,CACC,CAAC;EAAA,CACS,CAAC;AAEtB,CAAC","ignoreList":[]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { Color } from '@basic-ui/color-picker';
|
|
2
|
-
interface ColorSchemePickerProps {
|
|
3
|
-
label: string;
|
|
4
|
-
initialValue: Color;
|
|
5
|
-
onChange: (c: Color) => void;
|
|
6
|
-
onReset: () => void;
|
|
7
|
-
resetDisabled: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare function ColorSchemePicker(props: ColorSchemePickerProps): JSX.Element;
|
|
10
|
-
export {};
|
|
1
|
+
import type { Color } from '@basic-ui/color-picker';
|
|
2
|
+
interface ColorSchemePickerProps {
|
|
3
|
+
label: string;
|
|
4
|
+
initialValue: Color;
|
|
5
|
+
onChange: (c: Color) => void;
|
|
6
|
+
onReset: () => void;
|
|
7
|
+
resetDisabled: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function ColorSchemePicker(props: ColorSchemePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -1,25 +1,20 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
1
|
import { startTransition, useEffect, useRef, useState } from 'react';
|
|
3
2
|
import { Box } from '../Box';
|
|
4
3
|
import { Button } from '../Button';
|
|
5
4
|
import { TextFieldColorPicker } from './TextFieldColorPicker';
|
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
6
|
export function ColorSchemePicker(props) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var remountKey = useRef(0);
|
|
21
|
-
var resetting = useRef(false);
|
|
22
|
-
useEffect(function () {
|
|
7
|
+
const {
|
|
8
|
+
label,
|
|
9
|
+
initialValue,
|
|
10
|
+
onChange,
|
|
11
|
+
onReset,
|
|
12
|
+
resetDisabled
|
|
13
|
+
} = props;
|
|
14
|
+
const [value, setValue] = useState(initialValue);
|
|
15
|
+
const remountKey = useRef(0);
|
|
16
|
+
const resetting = useRef(false);
|
|
17
|
+
useEffect(() => {
|
|
23
18
|
if (resetting.current) {
|
|
24
19
|
remountKey.current++;
|
|
25
20
|
resetting.current = false;
|
|
@@ -34,16 +29,16 @@ export function ColorSchemePicker(props) {
|
|
|
34
29
|
children: [/*#__PURE__*/_jsx(TextFieldColorPicker, {
|
|
35
30
|
label: label,
|
|
36
31
|
value: value,
|
|
37
|
-
onChange:
|
|
32
|
+
onChange: c => {
|
|
38
33
|
setValue(c);
|
|
39
|
-
startTransition(
|
|
40
|
-
|
|
34
|
+
startTransition(() => {
|
|
35
|
+
onChange(c);
|
|
41
36
|
});
|
|
42
37
|
}
|
|
43
38
|
}, remountKey.current), /*#__PURE__*/_jsx(Button, {
|
|
44
39
|
variant: "text",
|
|
45
40
|
disabled: resetDisabled,
|
|
46
|
-
onClick:
|
|
41
|
+
onClick: () => {
|
|
47
42
|
resetting.current = true;
|
|
48
43
|
onReset();
|
|
49
44
|
},
|