@basic-ui/material 0.1.15 → 1.0.0-alpha.1
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/build/cjs/index.js +641 -378
- package/build/cjs/index.js.map +1 -1
- package/build/esm/Alert/Alert.d.ts +2 -2
- package/build/esm/Alert/Alert.js +9 -9
- package/build/esm/Alert/Alert.js.map +1 -1
- package/build/esm/Alert/index.d.ts +0 -0
- package/build/esm/Alert/index.js +0 -0
- package/build/esm/Alert/index.js.map +0 -0
- package/build/esm/AppBar/AppBar.d.ts +3 -3
- package/build/esm/AppBar/AppBar.js +25 -18
- package/build/esm/AppBar/AppBar.js.map +1 -1
- package/build/esm/AppBar/AppBarButton.d.ts +2 -2
- package/build/esm/AppBar/AppBarButton.js +8 -9
- package/build/esm/AppBar/AppBarButton.js.map +1 -1
- package/build/esm/AppBar/context.d.ts +1 -1
- package/build/esm/AppBar/context.js +6 -5
- package/build/esm/AppBar/context.js.map +1 -1
- package/build/esm/AppBar/index.d.ts +0 -0
- package/build/esm/AppBar/index.js +0 -0
- package/build/esm/AppBar/index.js.map +0 -0
- package/build/esm/Badge/Badge.d.ts +2 -2
- package/build/esm/Badge/Badge.js +2 -2
- package/build/esm/Badge/Badge.js.map +1 -1
- package/build/esm/Badge/index.d.ts +0 -0
- package/build/esm/Badge/index.js +0 -0
- package/build/esm/Badge/index.js.map +0 -0
- package/build/esm/BaseLine/BaseLine.d.ts +0 -1
- package/build/esm/BaseLine/BaseLine.js +4 -4
- package/build/esm/BaseLine/BaseLine.js.map +1 -1
- package/build/esm/BaseLine/index.d.ts +0 -0
- package/build/esm/BaseLine/index.js +0 -0
- package/build/esm/BaseLine/index.js.map +0 -0
- package/build/esm/BottomSheet/BottomSheet.d.ts +2 -2
- package/build/esm/BottomSheet/BottomSheet.js +11 -13
- package/build/esm/BottomSheet/BottomSheet.js.map +1 -1
- package/build/esm/BottomSheet/BottomSheetSurface.d.ts +4 -4
- package/build/esm/BottomSheet/BottomSheetSurface.js +8 -9
- package/build/esm/BottomSheet/BottomSheetSurface.js.map +1 -1
- package/build/esm/BottomSheet/index.d.ts +0 -0
- package/build/esm/BottomSheet/index.js +0 -0
- package/build/esm/BottomSheet/index.js.map +0 -0
- package/build/esm/Box/Box.d.ts +5 -5
- package/build/esm/Box/Box.js +27 -19
- package/build/esm/Box/Box.js.map +1 -1
- package/build/esm/Box/index.d.ts +0 -0
- package/build/esm/Box/index.js +0 -0
- package/build/esm/Box/index.js.map +0 -0
- package/build/esm/Button/BaseButton.d.ts +4 -3
- package/build/esm/Button/BaseButton.js +11 -12
- package/build/esm/Button/BaseButton.js.map +1 -1
- package/build/esm/Button/Button.d.ts +5 -5
- package/build/esm/Button/Button.js +45 -24
- package/build/esm/Button/Button.js.map +1 -1
- package/build/esm/Button/ButtonGroup.d.ts +5 -0
- package/build/esm/Button/ButtonGroup.js +31 -0
- package/build/esm/Button/ButtonGroup.js.map +1 -0
- package/build/esm/Button/FilledButton.d.ts +3 -2
- package/build/esm/Button/FilledButton.js +62 -21
- package/build/esm/Button/FilledButton.js.map +1 -1
- package/build/esm/Button/FloatingActionButton.d.ts +1 -1
- package/build/esm/Button/FloatingActionButton.js +0 -0
- package/build/esm/Button/FloatingActionButton.js.map +1 -1
- package/build/esm/Button/IconButton.d.ts +2 -1
- package/build/esm/Button/IconButton.js +2 -1
- package/build/esm/Button/IconButton.js.map +1 -1
- package/build/esm/Button/OutlinedButton.d.ts +1 -1
- package/build/esm/Button/OutlinedButton.js +36 -4
- package/build/esm/Button/OutlinedButton.js.map +1 -1
- package/build/esm/Button/TransparentButton.d.ts +3 -2
- package/build/esm/Button/TransparentButton.js +49 -15
- package/build/esm/Button/TransparentButton.js.map +1 -1
- package/build/esm/Button/context.d.ts +8 -0
- package/build/esm/Button/context.js +7 -0
- package/build/esm/Button/context.js.map +1 -0
- package/build/esm/Button/index.d.ts +1 -0
- package/build/esm/Button/index.js +1 -0
- package/build/esm/Button/index.js.map +1 -1
- package/build/esm/CheckBox/CheckBox.d.ts +3 -3
- package/build/esm/CheckBox/CheckBox.js +43 -36
- package/build/esm/CheckBox/CheckBox.js.map +1 -1
- package/build/esm/CheckBox/CheckBoxIcon.d.ts +3 -3
- package/build/esm/CheckBox/CheckBoxIcon.js +15 -13
- package/build/esm/CheckBox/CheckBoxIcon.js.map +1 -1
- package/build/esm/CheckBox/CheckPath.d.ts +0 -0
- package/build/esm/CheckBox/CheckPath.js +15 -14
- package/build/esm/CheckBox/CheckPath.js.map +1 -1
- package/build/esm/CheckBox/IndeterminatePath.d.ts +0 -0
- package/build/esm/CheckBox/IndeterminatePath.js +14 -13
- package/build/esm/CheckBox/IndeterminatePath.js.map +1 -1
- package/build/esm/CheckBox/index.d.ts +0 -0
- package/build/esm/CheckBox/index.js +0 -0
- package/build/esm/CheckBox/index.js.map +0 -0
- package/build/esm/Chip/ButtonChip.d.ts +5 -5
- package/build/esm/Chip/ButtonChip.js +49 -65
- package/build/esm/Chip/ButtonChip.js.map +1 -1
- package/build/esm/Chip/Chip.d.ts +0 -0
- package/build/esm/Chip/Chip.js +0 -0
- package/build/esm/Chip/Chip.js.map +0 -0
- package/build/esm/Chip/ChipBase.d.ts +2 -2
- package/build/esm/Chip/ChipBase.js +42 -29
- package/build/esm/Chip/ChipBase.js.map +1 -1
- package/build/esm/Chip/ChoiceChip.d.ts +5 -4
- package/build/esm/Chip/ChoiceChip.js +38 -45
- package/build/esm/Chip/ChoiceChip.js.map +1 -1
- package/build/esm/Chip/index.d.ts +0 -0
- package/build/esm/Chip/index.js +0 -0
- package/build/esm/Chip/index.js.map +0 -0
- package/build/esm/ColorMode/ColorModeProvider.d.ts +1 -1
- package/build/esm/ColorMode/ColorModeProvider.js +32 -19
- package/build/esm/ColorMode/ColorModeProvider.js.map +1 -1
- package/build/esm/ColorMode/color-mode.d.ts +0 -0
- package/build/esm/ColorMode/color-mode.js +3 -3
- package/build/esm/ColorMode/color-mode.js.map +1 -1
- package/build/esm/ColorMode/color-vars.d.ts +0 -0
- package/build/esm/ColorMode/color-vars.js +20 -12
- package/build/esm/ColorMode/color-vars.js.map +1 -1
- package/build/esm/ColorMode/constants.d.ts +0 -0
- package/build/esm/ColorMode/constants.js +3 -3
- package/build/esm/ColorMode/constants.js.map +1 -1
- package/build/esm/ColorMode/index.d.ts +0 -0
- package/build/esm/ColorMode/index.js +0 -0
- package/build/esm/ColorMode/index.js.map +0 -0
- package/build/esm/Combobox/Combobox.d.ts +14 -14
- package/build/esm/Combobox/Combobox.js +52 -57
- package/build/esm/Combobox/Combobox.js.map +1 -1
- package/build/esm/Combobox/index.d.ts +0 -0
- package/build/esm/Combobox/index.js +0 -0
- package/build/esm/Combobox/index.js.map +0 -0
- package/build/esm/Dialog/Dialog.d.ts +5 -5
- package/build/esm/Dialog/Dialog.js +22 -23
- package/build/esm/Dialog/Dialog.js.map +1 -1
- package/build/esm/Dialog/DialogBackdrop.d.ts +4 -4
- package/build/esm/Dialog/DialogBackdrop.js +10 -11
- package/build/esm/Dialog/DialogBackdrop.js.map +1 -1
- package/build/esm/Dialog/DialogContainer.d.ts +1 -1
- package/build/esm/Dialog/DialogContainer.js +4 -6
- package/build/esm/Dialog/DialogContainer.js.map +1 -1
- package/build/esm/Dialog/DialogSurface.d.ts +7 -5
- package/build/esm/Dialog/DialogSurface.js +24 -12
- package/build/esm/Dialog/DialogSurface.js.map +1 -1
- package/build/esm/Dialog/Scrim.d.ts +1 -1
- package/build/esm/Dialog/Scrim.js +4 -6
- package/build/esm/Dialog/Scrim.js.map +1 -1
- package/build/esm/Dialog/index.d.ts +0 -0
- package/build/esm/Dialog/index.js +0 -0
- package/build/esm/Dialog/index.js.map +0 -0
- package/build/esm/Dialog/useDialogAnimation.d.ts +0 -0
- package/build/esm/Dialog/useDialogAnimation.js +19 -20
- package/build/esm/Dialog/useDialogAnimation.js.map +1 -1
- package/build/esm/Divider/Divider.d.ts +3 -3
- package/build/esm/Divider/Divider.js +9 -8
- package/build/esm/Divider/Divider.js.map +1 -1
- package/build/esm/Divider/index.d.ts +0 -0
- package/build/esm/Divider/index.js +0 -0
- package/build/esm/Divider/index.js.map +0 -0
- package/build/esm/FloatingLabel/FloatingLabel.d.ts +1 -2
- package/build/esm/FloatingLabel/FloatingLabel.js +26 -24
- package/build/esm/FloatingLabel/FloatingLabel.js.map +1 -1
- package/build/esm/FloatingLabel/index.d.ts +0 -0
- package/build/esm/FloatingLabel/index.js +0 -0
- package/build/esm/FloatingLabel/index.js.map +0 -0
- package/build/esm/LineRipple/LineRipple.d.ts +3 -3
- package/build/esm/LineRipple/LineRipple.js +27 -18
- package/build/esm/LineRipple/LineRipple.js.map +1 -1
- package/build/esm/LineRipple/index.d.ts +0 -0
- package/build/esm/LineRipple/index.js +0 -0
- package/build/esm/LineRipple/index.js.map +0 -0
- package/build/esm/Link/Link.d.ts +3 -3
- package/build/esm/Link/Link.js +10 -9
- package/build/esm/Link/Link.js.map +1 -1
- package/build/esm/Link/index.d.ts +0 -0
- package/build/esm/Link/index.js +0 -0
- package/build/esm/Link/index.js.map +0 -0
- package/build/esm/List/List.d.ts +3 -3
- package/build/esm/List/List.js +20 -13
- package/build/esm/List/List.js.map +1 -1
- package/build/esm/List/index.d.ts +0 -0
- package/build/esm/List/index.js +0 -0
- package/build/esm/List/index.js.map +0 -0
- package/build/esm/ListItem/ListItem.d.ts +3 -3
- package/build/esm/ListItem/ListItem.js +72 -50
- package/build/esm/ListItem/ListItem.js.map +1 -1
- package/build/esm/ListItem/ListItemText.d.ts +1 -1
- package/build/esm/ListItem/ListItemText.js +10 -15
- package/build/esm/ListItem/ListItemText.js.map +1 -1
- package/build/esm/ListItem/context.d.ts +0 -0
- package/build/esm/ListItem/context.js +0 -0
- package/build/esm/ListItem/context.js.map +0 -0
- package/build/esm/ListItem/index.d.ts +0 -0
- package/build/esm/ListItem/index.js +0 -0
- package/build/esm/ListItem/index.js.map +0 -0
- package/build/esm/Menu/Menu.d.ts +10 -10
- package/build/esm/Menu/Menu.js +24 -27
- package/build/esm/Menu/Menu.js.map +1 -1
- package/build/esm/Menu/animation.d.ts +1 -1
- package/build/esm/Menu/animation.js +1 -1
- package/build/esm/Menu/animation.js.map +1 -1
- package/build/esm/Menu/index.d.ts +0 -0
- package/build/esm/Menu/index.js +0 -0
- package/build/esm/Menu/index.js.map +0 -0
- package/build/esm/NotchedOutline/NotchedOutline.d.ts +1 -1
- package/build/esm/NotchedOutline/NotchedOutline.js +25 -21
- package/build/esm/NotchedOutline/NotchedOutline.js.map +1 -1
- package/build/esm/NotchedOutline/context.d.ts +0 -0
- package/build/esm/NotchedOutline/context.js +6 -5
- package/build/esm/NotchedOutline/context.js.map +1 -1
- package/build/esm/NotchedOutline/index.d.ts +0 -0
- package/build/esm/NotchedOutline/index.js +0 -0
- package/build/esm/NotchedOutline/index.js.map +0 -0
- package/build/esm/NotchedOutline/styledComponents.d.ts +96 -50
- package/build/esm/NotchedOutline/styledComponents.js +58 -63
- package/build/esm/NotchedOutline/styledComponents.js.map +1 -1
- package/build/esm/Paper/Paper.d.ts +4 -3
- package/build/esm/Paper/Paper.js +15 -13
- package/build/esm/Paper/Paper.js.map +1 -1
- package/build/esm/Paper/index.d.ts +0 -0
- package/build/esm/Paper/index.js +0 -0
- package/build/esm/Paper/index.js.map +0 -0
- package/build/esm/ProgressSpinner/ProgressSpinner.d.ts +1 -1
- package/build/esm/ProgressSpinner/ProgressSpinner.js +16 -16
- package/build/esm/ProgressSpinner/ProgressSpinner.js.map +1 -1
- package/build/esm/ProgressSpinner/index.d.ts +0 -0
- package/build/esm/ProgressSpinner/index.js +0 -0
- package/build/esm/ProgressSpinner/index.js.map +0 -0
- package/build/esm/RadioButton/RadioButton.d.ts +1 -1
- package/build/esm/RadioButton/RadioButton.js +17 -20
- package/build/esm/RadioButton/RadioButton.js.map +1 -1
- package/build/esm/RadioButton/RadioButtonIcon.d.ts +1 -1
- package/build/esm/RadioButton/RadioButtonIcon.js +7 -8
- package/build/esm/RadioButton/RadioButtonIcon.js.map +1 -1
- package/build/esm/RadioButton/RadioGroup.d.ts +3 -3
- package/build/esm/RadioButton/RadioGroup.js +5 -4
- package/build/esm/RadioButton/RadioGroup.js.map +1 -1
- package/build/esm/RadioButton/index.d.ts +0 -0
- package/build/esm/RadioButton/index.js +0 -0
- package/build/esm/RadioButton/index.js.map +0 -0
- package/build/esm/Ripple/Ripple.d.ts +1 -1
- package/build/esm/Ripple/Ripple.js +21 -20
- package/build/esm/Ripple/Ripple.js.map +1 -1
- package/build/esm/Ripple/RippleBox.d.ts +4 -4
- package/build/esm/Ripple/RippleBox.js +22 -15
- package/build/esm/Ripple/RippleBox.js.map +1 -1
- package/build/esm/Ripple/constants.d.ts +0 -0
- package/build/esm/Ripple/constants.js +7 -7
- package/build/esm/Ripple/constants.js.map +1 -1
- package/build/esm/Ripple/index.d.ts +0 -0
- package/build/esm/Ripple/index.js +0 -0
- package/build/esm/Ripple/index.js.map +0 -0
- package/build/esm/Ripple/keyframes.d.ts +1 -1
- package/build/esm/Ripple/keyframes.js +3 -3
- package/build/esm/Ripple/keyframes.js.map +1 -1
- package/build/esm/Ripple/useRipple.d.ts +0 -0
- package/build/esm/Ripple/useRipple.js +55 -48
- package/build/esm/Ripple/useRipple.js.map +1 -1
- package/build/esm/Ripple/useRippleHandlers.d.ts +1 -1
- package/build/esm/Ripple/useRippleHandlers.js +13 -15
- package/build/esm/Ripple/useRippleHandlers.js.map +1 -1
- package/build/esm/Ripple/useRippleSurface.d.ts +6 -5
- package/build/esm/Ripple/useRippleSurface.js +60 -37
- package/build/esm/Ripple/useRippleSurface.js.map +1 -1
- package/build/esm/Select/Select.d.ts +5 -5
- package/build/esm/Select/Select.js +72 -59
- package/build/esm/Select/Select.js.map +1 -1
- package/build/esm/Select/SelectIcon.d.ts +3 -3
- package/build/esm/Select/SelectIcon.js +8 -7
- package/build/esm/Select/SelectIcon.js.map +1 -1
- package/build/esm/Select/context.d.ts +0 -0
- package/build/esm/Select/context.js +7 -6
- package/build/esm/Select/context.js.map +1 -1
- package/build/esm/Select/defaultRender.d.ts +0 -0
- package/build/esm/Select/defaultRender.js +12 -10
- package/build/esm/Select/defaultRender.js.map +1 -1
- package/build/esm/Select/index.d.ts +0 -0
- package/build/esm/Select/index.js +0 -0
- package/build/esm/Select/index.js.map +0 -0
- package/build/esm/Select/styledComponents.d.ts +2 -2
- package/build/esm/Select/styledComponents.js +21 -20
- package/build/esm/Select/styledComponents.js.map +1 -1
- package/build/esm/SelectItem/SelectItem.d.ts +2 -2
- package/build/esm/SelectItem/SelectItem.js +18 -19
- package/build/esm/SelectItem/SelectItem.js.map +1 -1
- package/build/esm/SelectItem/index.d.ts +0 -0
- package/build/esm/SelectItem/index.js +0 -0
- package/build/esm/SelectItem/index.js.map +0 -0
- package/build/esm/SelectionControl/SelectionControlLabel.d.ts +3 -3
- package/build/esm/SelectionControl/SelectionControlLabel.js +7 -7
- package/build/esm/SelectionControl/SelectionControlLabel.js.map +1 -1
- package/build/esm/SelectionControl/SelectionControlText.d.ts +3 -3
- package/build/esm/SelectionControl/SelectionControlText.js +8 -8
- package/build/esm/SelectionControl/SelectionControlText.js.map +1 -1
- package/build/esm/SelectionControl/index.d.ts +0 -0
- package/build/esm/SelectionControl/index.js +0 -0
- package/build/esm/SelectionControl/index.js.map +0 -0
- package/build/esm/Skeleton/DelayAppearance.d.ts +4 -4
- package/build/esm/Skeleton/DelayAppearance.js +9 -9
- package/build/esm/Skeleton/DelayAppearance.js.map +1 -1
- package/build/esm/Skeleton/Skeleton.d.ts +3 -3
- package/build/esm/Skeleton/Skeleton.js +11 -10
- package/build/esm/Skeleton/Skeleton.js.map +1 -1
- package/build/esm/Skeleton/animation.d.ts +2 -2
- package/build/esm/Skeleton/animation.js +25 -22
- package/build/esm/Skeleton/animation.js.map +1 -1
- package/build/esm/Skeleton/index.d.ts +0 -0
- package/build/esm/Skeleton/index.js +0 -0
- package/build/esm/Skeleton/index.js.map +0 -0
- package/build/esm/Snackbar/Snackbar.d.ts +3 -3
- package/build/esm/Snackbar/Snackbar.js +24 -24
- package/build/esm/Snackbar/Snackbar.js.map +1 -1
- package/build/esm/Snackbar/Stack.d.ts +2 -3
- package/build/esm/Snackbar/Stack.js +78 -65
- package/build/esm/Snackbar/Stack.js.map +1 -1
- package/build/esm/Snackbar/index.d.ts +0 -0
- package/build/esm/Snackbar/index.js +0 -0
- package/build/esm/Snackbar/index.js.map +0 -0
- package/build/esm/Snackbar/useSnackbarAnimation.d.ts +1 -1
- package/build/esm/Snackbar/useSnackbarAnimation.js +113 -78
- package/build/esm/Snackbar/useSnackbarAnimation.js.map +1 -1
- package/build/esm/Switch/Switch.d.ts +3 -3
- package/build/esm/Switch/Switch.js +29 -28
- package/build/esm/Switch/Switch.js.map +1 -1
- package/build/esm/Switch/index.d.ts +0 -0
- package/build/esm/Switch/index.js +0 -0
- package/build/esm/Switch/index.js.map +0 -0
- package/build/esm/Switch/styledComponents.d.ts +2 -2
- package/build/esm/Switch/styledComponents.js +66 -40
- package/build/esm/Switch/styledComponents.js.map +1 -1
- package/build/esm/Tab/Tab.d.ts +4 -4
- package/build/esm/Tab/Tab.js +17 -19
- package/build/esm/Tab/Tab.js.map +1 -1
- package/build/esm/Tab/TabList.d.ts +3 -3
- package/build/esm/Tab/TabList.js +18 -19
- package/build/esm/Tab/TabList.js.map +1 -1
- package/build/esm/Tab/TabPanel.d.ts +3 -3
- package/build/esm/Tab/TabPanel.js +8 -11
- package/build/esm/Tab/TabPanel.js.map +1 -1
- package/build/esm/Tab/TabPanels.d.ts +0 -0
- package/build/esm/Tab/TabPanels.js +0 -0
- package/build/esm/Tab/TabPanels.js.map +0 -0
- package/build/esm/Tab/Tabs.d.ts +0 -0
- package/build/esm/Tab/Tabs.js +0 -0
- package/build/esm/Tab/Tabs.js.map +0 -0
- package/build/esm/Tab/context.d.ts +0 -0
- package/build/esm/Tab/context.js +6 -5
- package/build/esm/Tab/context.js.map +1 -1
- package/build/esm/Tab/index.d.ts +0 -0
- package/build/esm/Tab/index.js +0 -0
- package/build/esm/Tab/index.js.map +0 -0
- package/build/esm/TabIndicator/TabIndicator.d.ts +2 -2
- package/build/esm/TabIndicator/TabIndicator.js +22 -21
- package/build/esm/TabIndicator/TabIndicator.js.map +1 -1
- package/build/esm/TabIndicator/context.d.ts +0 -0
- package/build/esm/TabIndicator/context.js +6 -5
- package/build/esm/TabIndicator/context.js.map +1 -1
- package/build/esm/TabIndicator/index.d.ts +0 -0
- package/build/esm/TabIndicator/index.js +0 -0
- package/build/esm/TabIndicator/index.js.map +0 -0
- package/build/esm/Table/Table.d.ts +2 -2
- package/build/esm/Table/Table.js +8 -8
- package/build/esm/Table/Table.js.map +1 -1
- package/build/esm/Table/TableBody.d.ts +1 -1
- package/build/esm/Table/TableBody.js +4 -6
- package/build/esm/Table/TableBody.js.map +1 -1
- package/build/esm/Table/TableCell.d.ts +1 -1
- package/build/esm/Table/TableCell.js +6 -8
- package/build/esm/Table/TableCell.js.map +1 -1
- package/build/esm/Table/TableHead.d.ts +1 -1
- package/build/esm/Table/TableHead.js +5 -7
- package/build/esm/Table/TableHead.js.map +1 -1
- package/build/esm/Table/TableRow.d.ts +2 -2
- package/build/esm/Table/TableRow.js +5 -7
- package/build/esm/Table/TableRow.js.map +1 -1
- package/build/esm/Table/context.d.ts +0 -0
- package/build/esm/Table/context.js +6 -5
- package/build/esm/Table/context.js.map +1 -1
- package/build/esm/Table/index.d.ts +0 -0
- package/build/esm/Table/index.js +0 -0
- package/build/esm/Table/index.js.map +0 -0
- package/build/esm/Text/LoremIpsum.d.ts +1 -1
- package/build/esm/Text/LoremIpsum.js +6 -6
- package/build/esm/Text/LoremIpsum.js.map +1 -1
- package/build/esm/Text/Text.d.ts +3 -3
- package/build/esm/Text/Text.js +9 -9
- package/build/esm/Text/Text.js.map +1 -1
- package/build/esm/Text/index.d.ts +0 -0
- package/build/esm/Text/index.js +0 -0
- package/build/esm/Text/index.js.map +0 -0
- package/build/esm/TextField/FilledContainer.d.ts +3 -3
- package/build/esm/TextField/FilledContainer.js +70 -60
- package/build/esm/TextField/FilledContainer.js.map +1 -1
- package/build/esm/TextField/HelperText.d.ts +3 -3
- package/build/esm/TextField/HelperText.js +14 -13
- package/build/esm/TextField/HelperText.js.map +1 -1
- package/build/esm/TextField/IconContainer.d.ts +3 -3
- package/build/esm/TextField/IconContainer.js +17 -23
- package/build/esm/TextField/IconContainer.js.map +1 -1
- package/build/esm/TextField/Input.d.ts +3 -3
- package/build/esm/TextField/Input.js +30 -22
- package/build/esm/TextField/Input.js.map +1 -1
- package/build/esm/TextField/OutlinedContainer.d.ts +4 -4
- package/build/esm/TextField/OutlinedContainer.js +34 -25
- package/build/esm/TextField/OutlinedContainer.js.map +1 -1
- package/build/esm/TextField/TextField.d.ts +4 -4
- package/build/esm/TextField/TextField.js +59 -41
- package/build/esm/TextField/TextField.js.map +1 -1
- package/build/esm/TextField/consts.d.ts +5 -0
- package/build/esm/TextField/consts.js +6 -0
- package/build/esm/TextField/consts.js.map +1 -0
- package/build/esm/TextField/index.d.ts +0 -0
- package/build/esm/TextField/index.js +0 -0
- package/build/esm/TextField/index.js.map +0 -0
- package/build/esm/ThemeExplorer/ColorPicker.d.ts +4 -4
- package/build/esm/ThemeExplorer/ColorPicker.js +16 -16
- package/build/esm/ThemeExplorer/ColorPicker.js.map +1 -1
- package/build/esm/ThemeExplorer/TextFieldColorPicker.d.ts +2 -2
- package/build/esm/ThemeExplorer/TextFieldColorPicker.js +49 -29
- package/build/esm/ThemeExplorer/TextFieldColorPicker.js.map +1 -1
- package/build/esm/ThemeExplorer/ThemeColors.d.ts +1 -1
- package/build/esm/ThemeExplorer/ThemeColors.js +3 -3
- package/build/esm/ThemeExplorer/ThemeColors.js.map +1 -1
- package/build/esm/ThemeExplorer/components.d.ts +2 -1
- package/build/esm/ThemeExplorer/components.js +64 -56
- package/build/esm/ThemeExplorer/components.js.map +1 -1
- package/build/esm/ThemeExplorer/makeColorScheme.d.ts +1 -1
- package/build/esm/ThemeExplorer/makeColorScheme.js +0 -0
- package/build/esm/ThemeExplorer/makeColorScheme.js.map +1 -1
- package/build/esm/ThemeExplorer/useDeferredColor.d.ts +1 -1
- package/build/esm/ThemeExplorer/useDeferredColor.js +10 -3
- package/build/esm/ThemeExplorer/useDeferredColor.js.map +1 -1
- package/build/esm/ThemeExplorer/useLocalStorageCachedState.d.ts +0 -0
- package/build/esm/ThemeExplorer/useLocalStorageCachedState.js +9 -2
- package/build/esm/ThemeExplorer/useLocalStorageCachedState.js.map +1 -1
- package/build/esm/Tooltip/Tooltip.d.ts +3 -3
- package/build/esm/Tooltip/Tooltip.js +7 -8
- package/build/esm/Tooltip/Tooltip.js.map +1 -1
- package/build/esm/Tooltip/index.d.ts +0 -0
- package/build/esm/Tooltip/index.js +0 -0
- package/build/esm/Tooltip/index.js.map +0 -0
- package/build/esm/color.d.ts +5 -4
- package/build/esm/color.js +26 -16
- package/build/esm/color.js.map +1 -1
- package/build/esm/css.d.ts +0 -0
- package/build/esm/css.js +0 -0
- package/build/esm/css.js.map +0 -0
- package/build/esm/hooks/useAnimation.d.ts +1 -1
- package/build/esm/hooks/useAnimation.js +54 -41
- package/build/esm/hooks/useAnimation.js.map +1 -1
- package/build/esm/index.d.ts +0 -0
- package/build/esm/index.js +0 -0
- package/build/esm/index.js.map +0 -0
- package/build/esm/theme/index.d.ts +0 -0
- package/build/esm/theme/index.js +0 -0
- package/build/esm/theme/index.js.map +0 -0
- package/build/esm/theme/theme.d.ts +96 -50
- package/build/esm/theme/theme.js +134 -94
- package/build/esm/theme/theme.js.map +1 -1
- package/build/esm/theme/typography-raleway.d.ts +0 -0
- 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 +0 -0
- 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 +1 -1
- package/build/esm/theme/useTheme.js +1 -1
- package/build/esm/theme/useTheme.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -4
- package/src/Alert/Alert.tsx +4 -2
- package/src/AppBar/AppBar.story.tsx +7 -6
- package/src/AppBar/AppBar.tsx +10 -9
- package/src/AppBar/AppBarButton.tsx +3 -1
- package/src/AppBar/context.ts +2 -1
- package/src/Badge/Badge.tsx +3 -1
- package/src/BaseLine/BaseLine.tsx +15 -11
- package/src/BottomSheet/BottomSheet.story.tsx +1 -0
- package/src/BottomSheet/BottomSheet.tsx +2 -1
- package/src/BottomSheet/BottomSheetSurface.tsx +8 -5
- package/src/Box/Box.tsx +21 -18
- package/src/Button/BaseButton.tsx +5 -2
- package/src/Button/Button.story.tsx +21 -33
- package/src/Button/Button.tsx +23 -8
- package/src/Button/ButtonGroup.story.tsx +106 -0
- package/src/Button/ButtonGroup.tsx +35 -0
- package/src/Button/FilledButton.tsx +41 -6
- package/src/Button/FloatingActionButton.tsx +9 -0
- package/src/Button/IconButton.tsx +2 -1
- package/src/Button/OutlinedButton.tsx +33 -4
- package/src/Button/SpinnerButton.story.tsx +10 -11
- package/src/Button/TransparentButton.tsx +35 -4
- package/src/Button/context.tsx +17 -0
- package/src/Button/index.ts +1 -0
- package/src/CheckBox/CheckBox.story.tsx +3 -2
- package/src/CheckBox/CheckBox.tsx +10 -6
- package/src/CheckBox/CheckBoxIcon.tsx +4 -2
- package/src/Chip/ButtonChip.tsx +47 -51
- package/src/Chip/Chip.story.tsx +48 -27
- package/src/Chip/ChipBase.tsx +44 -14
- package/src/Chip/ChoiceChip.tsx +28 -24
- package/src/ColorMode/ColorModeProvider.tsx +4 -2
- package/src/Combobox/Combobox.story.tsx +2 -1
- package/src/Combobox/Combobox.tsx +31 -18
- package/src/Dialog/Dialog.story.tsx +3 -1
- package/src/Dialog/Dialog.tsx +9 -4
- package/src/Dialog/DialogBackdrop.tsx +6 -6
- package/src/Dialog/DialogContainer.tsx +3 -1
- package/src/Dialog/DialogSurface.tsx +26 -9
- package/src/Dialog/Scrim.tsx +3 -1
- package/src/Divider/Divider.tsx +4 -2
- package/src/FloatingLabel/FloatingLabel.story.tsx +1 -0
- package/src/FloatingLabel/FloatingLabel.tsx +3 -5
- package/src/LineRipple/LineRipple.story.tsx +1 -0
- package/src/LineRipple/LineRipple.tsx +6 -3
- package/src/Link/Link.tsx +4 -2
- package/src/List/List.tsx +5 -2
- package/src/ListItem/ListItem.story.tsx +1 -0
- package/src/ListItem/ListItem.tsx +59 -34
- package/src/ListItem/ListItemText.tsx +4 -5
- package/src/Menu/Menu.tsx +22 -14
- package/src/Menu/animation.ts +1 -1
- package/src/NotchedOutline/NotchedOutline.story.tsx +3 -2
- package/src/NotchedOutline/NotchedOutline.tsx +2 -1
- package/src/NotchedOutline/styledComponents.ts +9 -8
- package/src/Paper/Paper.story.tsx +17 -3
- package/src/Paper/Paper.tsx +22 -5
- package/src/ProgressSpinner/ProgressSpinner.story.tsx +1 -0
- package/src/ProgressSpinner/ProgressSpinner.tsx +5 -2
- package/src/RadioButton/RadioButton.story.tsx +2 -1
- package/src/RadioButton/RadioButton.tsx +10 -8
- package/src/RadioButton/RadioButtonIcon.tsx +4 -3
- package/src/RadioButton/RadioGroup.tsx +5 -5
- package/src/Ripple/Ripple.story.tsx +9 -3
- package/src/Ripple/Ripple.tsx +3 -2
- package/src/Ripple/RippleBox.tsx +9 -4
- package/src/Ripple/keyframes.ts +2 -1
- package/src/Ripple/useRipple.ts +1 -0
- package/src/Ripple/useRippleHandlers.ts +3 -1
- package/src/Ripple/useRippleSurface.ts +39 -13
- package/src/Select/PaymentMethodSelect.story.tsx +323 -0
- package/src/Select/Select.story.tsx +27 -1
- package/src/Select/Select.tsx +16 -36
- package/src/Select/SelectIcon.tsx +8 -4
- package/src/Select/defaultRender.ts +13 -13
- package/src/Select/styledComponents.tsx +13 -7
- package/src/SelectItem/SelectItem.tsx +4 -2
- package/src/SelectionControl/SelectionControlLabel.tsx +6 -3
- package/src/SelectionControl/SelectionControlText.tsx +4 -2
- package/src/Skeleton/DelayAppearance.tsx +5 -3
- package/src/Skeleton/Skeleton.story.tsx +2 -2
- package/src/Skeleton/Skeleton.tsx +4 -2
- package/src/Skeleton/animation.ts +3 -2
- package/src/Snackbar/Snackbar.story.tsx +1 -0
- package/src/Snackbar/Snackbar.tsx +8 -6
- package/src/Snackbar/Stack.tsx +3 -3
- package/src/Snackbar/useSnackbarAnimation.ts +3 -1
- package/src/Switch/Switch.tsx +16 -11
- package/src/Switch/styledComponents.tsx +72 -22
- package/src/Tab/Tab.tsx +8 -4
- package/src/Tab/TabList.tsx +5 -5
- package/src/Tab/TabPanel.tsx +5 -5
- package/src/TabIndicator/TabIndicator.tsx +6 -3
- package/src/Table/Table.tsx +5 -2
- package/src/Table/TableBody.tsx +3 -1
- package/src/Table/TableCell.tsx +3 -1
- package/src/Table/TableHead.tsx +4 -2
- package/src/Table/TableRow.tsx +4 -2
- package/src/Text/LoremIpsum.tsx +2 -1
- package/src/Text/Text.tsx +4 -2
- package/src/TextField/FilledContainer.tsx +35 -13
- package/src/TextField/HelperText.tsx +3 -2
- package/src/TextField/IconContainer.tsx +7 -5
- package/src/TextField/Input.tsx +37 -12
- package/src/TextField/OutlinedContainer.tsx +23 -7
- package/src/TextField/TextField.story.tsx +15 -1
- package/src/TextField/TextField.tsx +6 -3
- package/src/TextField/consts.ts +7 -0
- package/src/ThemeExplorer/ColorPicker.tsx +104 -0
- package/src/ThemeExplorer/TextFieldColorPicker.tsx +115 -0
- package/src/ThemeExplorer/ThemeBuilder.story.tsx +165 -0
- package/src/ThemeExplorer/ThemeColors.tsx +89 -0
- package/src/ThemeExplorer/ThemeExplorer.story.tsx +43 -0
- package/src/ThemeExplorer/components.tsx +195 -0
- package/src/ThemeExplorer/makeColorScheme.tsx +74 -0
- package/src/ThemeExplorer/useDeferredColor.tsx +25 -0
- package/src/ThemeExplorer/useLocalStorageCachedState.ts +18 -0
- package/src/Tooltip/Tooltip.story.tsx +1 -0
- package/src/Tooltip/Tooltip.tsx +8 -4
- package/src/color.ts +36 -29
- package/src/hooks/useAnimation.ts +2 -1
- package/src/theme/theme.ts +131 -92
- package/src/theme/useTheme.ts +3 -1
- package/src/ListItem/context.ts +0 -13
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
4
|
import { forwardRef, useState, useId } from 'react';
|
|
5
|
+
import * as React from 'react';
|
|
4
6
|
import { wrapEvent, useControlledState } from '@basic-ui/core';
|
|
5
7
|
import { Input } from './Input';
|
|
6
8
|
import { useTheme } from '../theme';
|
|
@@ -11,7 +13,7 @@ import { Box } from '../Box';
|
|
|
11
13
|
import { IconContainer } from './IconContainer';
|
|
12
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
15
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
|
|
16
|
+
var componentMap = {
|
|
15
17
|
outlined: OutlinedContainer,
|
|
16
18
|
filled: FilledContainer
|
|
17
19
|
};
|
|
@@ -24,53 +26,69 @@ function characterCounter(value, maxLength) {
|
|
|
24
26
|
return "".concat(typeof value === 'string' ? value.length : 0, " / ").concat(maxLength);
|
|
25
27
|
}
|
|
26
28
|
|
|
27
|
-
export
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
29
|
+
export var TextField = /*#__PURE__*/forwardRef(function TextField(props, forwardedRef) {
|
|
30
|
+
var _props$type = props.type,
|
|
31
|
+
type = _props$type === void 0 ? 'text' : _props$type,
|
|
32
|
+
idProp = props.id,
|
|
33
|
+
_props$variant = props.variant,
|
|
34
|
+
variant = _props$variant === void 0 ? 'outlined' : _props$variant,
|
|
35
|
+
_props$color = props.color,
|
|
36
|
+
color = _props$color === void 0 ? 'primary' : _props$color,
|
|
37
|
+
valueProp = props.value,
|
|
38
|
+
_props$defaultValue = props.defaultValue,
|
|
39
|
+
defaultValue = _props$defaultValue === void 0 ? '' : _props$defaultValue,
|
|
40
|
+
error = props.error,
|
|
41
|
+
disabled = props.disabled,
|
|
42
|
+
maxLength = props.maxLength,
|
|
43
|
+
_props$hideCharacterC = props.hideCharacterCounter,
|
|
44
|
+
hideCharacterCounter = _props$hideCharacterC === void 0 ? false : _props$hideCharacterC,
|
|
45
|
+
_props$label = props.label,
|
|
46
|
+
label = _props$label === void 0 ? null : _props$label,
|
|
47
|
+
placeholder = props.placeholder,
|
|
48
|
+
helperTextProp = props.helperText,
|
|
49
|
+
multiline = props.multiline,
|
|
50
|
+
onChangeProp = props.onChange,
|
|
51
|
+
onFocus = props.onFocus,
|
|
52
|
+
onBlur = props.onBlur,
|
|
53
|
+
_props$leadingIcon = props.leadingIcon,
|
|
54
|
+
leadingIcon = _props$leadingIcon === void 0 ? null : _props$leadingIcon,
|
|
55
|
+
_props$trailingIcon = props.trailingIcon,
|
|
56
|
+
trailingIcon = _props$trailingIcon === void 0 ? null : _props$trailingIcon,
|
|
57
|
+
containerProps = props.containerProps,
|
|
58
|
+
otherProps = _objectWithoutProperties(props, ["type", "id", "variant", "color", "value", "defaultValue", "error", "disabled", "maxLength", "hideCharacterCounter", "label", "placeholder", "helperText", "multiline", "onChange", "onFocus", "onBlur", "leadingIcon", "trailingIcon", "containerProps"]);
|
|
51
59
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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();
|
|
59
77
|
|
|
60
|
-
|
|
78
|
+
var handleFocus = function handleFocus() {
|
|
61
79
|
setHasFocus(true);
|
|
62
80
|
};
|
|
63
81
|
|
|
64
|
-
|
|
82
|
+
var handleBlur = function handleBlur() {
|
|
65
83
|
setHasFocus(false);
|
|
66
84
|
};
|
|
67
85
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
86
|
+
var hasError = Boolean(error);
|
|
87
|
+
var helperText = typeof error === 'string' ? error : helperTextProp;
|
|
88
|
+
var id = idProp || fallbackId;
|
|
89
|
+
var inputId = "".concat(id, "-text-field");
|
|
90
|
+
var helperTextId = helperText ? "".concat(id, "-helper-text") : undefined;
|
|
91
|
+
var labelIsFloating = hasFocus || typeof value === 'string' && value.length > 0;
|
|
74
92
|
return /*#__PURE__*/_jsxs(Box, {
|
|
75
93
|
display: "inline-flex",
|
|
76
94
|
flexDirection: "column",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/TextField/TextField.tsx"],"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,"sources":["../../../src/TextField/TextField.tsx"],"names":["forwardRef","useState","useId","React","wrapEvent","useControlledState","Input","useTheme","FilledContainer","OutlinedContainer","HelperText","Box","IconContainer","componentMap","outlined","filled","characterCounter","value","maxLength","undefined","length","TextField","props","forwardedRef","type","idProp","id","variant","color","valueProp","defaultValue","error","disabled","hideCharacterCounter","label","placeholder","helperTextProp","helperText","multiline","onChangeProp","onChange","onFocus","onBlur","leadingIcon","trailingIcon","containerProps","otherProps","setState","e","target","hasFocus","setHasFocus","Container","fallbackId","theme","handleFocus","handleBlur","hasError","Boolean","inputId","helperTextId","labelIsFloating"],"mappings":";;;AAAA,SAASA,UAAT,EAAqBC,QAArB,EAA+BC,KAA/B,QAA4C,OAA5C;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SAASC,SAAT,EAAoBC,kBAApB,QAA8C,gBAA9C;AAGA,SAASC,KAAT,QAAsB,SAAtB;AACA,SAASC,QAAT,QAAyB,UAAzB;AACA,SAASC,eAAT,QAAgC,mBAAhC;AACA,SAASC,iBAAT,QAAkC,qBAAlC;AACA,SAASC,UAAT,QAA2B,cAA3B;AAEA,SAASC,GAAT,QAAoB,QAApB;AACA,SAASC,aAAT,QAA8B,iBAA9B;;;AAEA,IAAMC,YAAY,GAAG;AACnBC,EAAAA,QAAQ,EAAEL,iBADS;AAEnBM,EAAAA,MAAM,EAAEP;AAFW,CAArB;;AAKA,SAASQ,gBAAT,CACEC,KADF,EAEEC,SAFF,EAGE;AACA,MAAIA,SAAS,KAAKC,SAAlB,EAA6B;AAC3B,WAAO,IAAP;AACD;;AAED,mBAAU,OAAOF,KAAP,KAAiB,QAAjB,GAA4BA,KAAK,CAACG,MAAlC,GAA2C,CAArD,gBAA4DF,SAA5D;AACD;;AAkBD,OAAO,IAAMG,SAAS,gBAAGrB,UAAU,CACjC,SAASqB,SAAT,CAAmBC,KAAnB,EAA0BC,YAA1B,EAAwC;AAAA,oBAuBlCD,KAvBkC,CAEpCE,IAFoC;AAAA,MAE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EAAEwB,OAAO,CAACf,WAAD,CAlBtB;AAmBE,QAAA,YAAY,EAAEe,OAAO,CAACd,YAAD;AAnBvB,SAoBME,UApBN,EAfF,EAqCGF,YAAY,iBACX,KAAC,aAAD;AAAe,QAAA,QAAQ,EAAC,KAAxB;AAAA,kBAA+BA;AAA/B,QAtCJ;AAAA,OADF,eA2CE,KAAC,UAAD;AACE,MAAA,KAAK,EAAEa,QADT;AAEE,MAAA,QAAQ,EAAEzB,QAFZ;AAGE,MAAA,QAAQ,EAAEK,UAAU,iBAAI;AAAM,QAAA,EAAE,EAAEuB,YAAV;AAAA,kBAAyBvB;AAAzB,QAH1B;AAIE,MAAA,SAAS,EACP,CAACJ,oBAAD,IACAjB,gBAAgB,CAACC,KAAD,EAAkBC,SAAlB;AANpB,MA3CF;AAAA,IADF;AAuDD,CAlHgC,CAA5B","sourcesContent":["import { forwardRef, useState, useId } from 'react';\nimport * as React 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?: React.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?: React.ReactNode;\n trailingIcon?: React.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"],"file":"TextField.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/TextField/consts.ts"],"names":["PADDING_LEFT_WITH_ICON","PADDING_LEFT_WITHOUT_ICON","ICON_WIDTH","PADDING_RIGHT_WITH_ICON","PADDING_RIGHT_WITHOUT_ICON"],"mappings":"AAAA,OAAO,IAAMA,sBAAsB,GAAG,EAA/B;AACP,OAAO,IAAMC,yBAAyB,GAAG,EAAlC;AAEP,OAAO,IAAMC,UAAU,GAAG,EAAnB;AAEP,OAAO,IAAMC,uBAAuB,GAAG,EAAhC;AACP,OAAO,IAAMC,0BAA0B,GAAG,EAAnC","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"],"file":"consts.js"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Color, ColorPickerProps as BaseColorPickerProps } from '@basic-ui/color-picker';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
4
|
export declare type ColorPickerProps = (Omit<BoxProps, 'color' | 'onChange'> & BaseColorPickerProps) & {
|
|
5
5
|
color: Color;
|
|
6
6
|
onChange: (color: Color) => void;
|
|
7
7
|
};
|
|
8
|
-
export declare const ColorPicker:
|
|
8
|
+
export declare const ColorPicker: FC<ColorPickerProps>;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
import { ColorPicker as _BaseColorPicker, Hue as _Hue, HueCursor as _HueCursor, Saturation as _Saturation, SaturationCursor as _SaturationCursor } from '@basic-ui/color-picker';
|
|
4
4
|
import { Box } from '../Box';
|
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
6
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
otherProps =
|
|
7
|
+
var BaseColorPicker = _BaseColorPicker;
|
|
8
|
+
var Hue = _Hue;
|
|
9
|
+
var HueCursor = _HueCursor;
|
|
10
|
+
var Saturation = _Saturation;
|
|
11
|
+
var SaturationCursor = _SaturationCursor;
|
|
12
|
+
export var ColorPicker = function ColorPicker(_ref) {
|
|
13
|
+
var color = _ref.color,
|
|
14
|
+
onChange = _ref.onChange,
|
|
15
|
+
_ref$width = _ref.width,
|
|
16
|
+
width = _ref$width === void 0 ? 450 : _ref$width,
|
|
17
|
+
_ref$height = _ref.height,
|
|
18
|
+
height = _ref$height === void 0 ? 225 : _ref$height,
|
|
19
|
+
otherProps = _objectWithoutProperties(_ref, ["color", "onChange", "width", "height"]);
|
|
20
20
|
|
|
21
21
|
return /*#__PURE__*/_jsxs(BaseColorPicker, _extends({
|
|
22
22
|
as: Box,
|
|
@@ -41,7 +41,7 @@ export const ColorPicker = (_ref) => {
|
|
|
41
41
|
width: '20px',
|
|
42
42
|
height: '20px',
|
|
43
43
|
border: '2px solid #ffffff',
|
|
44
|
-
borderRadius: '
|
|
44
|
+
borderRadius: 'full',
|
|
45
45
|
boxShadow: '0 0 15px 0 rgba(0, 0, 0, 0.15)',
|
|
46
46
|
boxSizing: 'border-box',
|
|
47
47
|
transform: 'translate(-10px, -10px)'
|
|
@@ -64,7 +64,7 @@ export const ColorPicker = (_ref) => {
|
|
|
64
64
|
width: '20px',
|
|
65
65
|
height: '20px',
|
|
66
66
|
border: '2px solid #ffffff',
|
|
67
|
-
borderRadius: '
|
|
67
|
+
borderRadius: 'full',
|
|
68
68
|
boxShadow: 'rgba(0, 0, 0, 0.2) 0px 0px 0px 0.5px',
|
|
69
69
|
boxSizing: 'border-box',
|
|
70
70
|
transform: 'translate(-10px, -4px)'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/ThemeExplorer/ColorPicker.tsx"],"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"],"mappings":";;
|
|
1
|
+
{"version":3,"sources":["../../../src/ThemeExplorer/ColorPicker.tsx"],"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"],"mappings":";;AAQA,SACEA,WAAW,IAAIC,gBADjB,EAEEC,GAAG,IAAIC,IAFT,EAGEC,SAAS,IAAIC,UAHf,EAIEC,UAAU,IAAIC,WAJhB,EAKEC,gBAAgB,IAAIC,iBALtB,QAMO,wBANP;AAUA,SAASC,GAAT,QAAoB,QAApB;;;AAQA,IAAMC,eAEL,GAAGV,gBAFJ;AAGA,IAAMC,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A,QAAQ,EAAE,UADR;AAEFC,QAAAA,WAAW,EAAE,MAFX;AAGFC,QAAAA,UAAU,EAAE,MAHV;AAIFL,QAAAA,KAAK,EAAE,MAJL;AAKFC,QAAAA,MAAM,EAAE,MALN;AAMFK,QAAAA,eAAe;AANb,OAFN;AAAA,6BAWE,KAAC,SAAD;AACE,QAAA,EAAE,EAAEV,GADN;AAEE,QAAA,EAAE,EAAE;AACFO,UAAAA,QAAQ,EAAE,UADR;AAEFH,UAAAA,KAAK,EAAE,MAFL;AAGFC,UAAAA,MAAM,EAAE,MAHN;AAIFM,UAAAA,MAAM,EAAE,mBAJN;AAKFC,UAAAA,YAAY,EAAE,MALZ;AAMFC,UAAAA,SAAS,EAAE,sCANT;AAOFC,UAAAA,SAAS,EAAE,YAPT;AAQFC,UAAAA,SAAS,EAAE;AART;AAFN;AAXF,MAjCF;AAAA,KADF;AA6DD,CApEM","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"],"file":"ColorPicker.js"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { Color } from '@basic-ui/color-picker';
|
|
3
|
-
import { TextFieldProps } from '../';
|
|
2
|
+
import type { Color } from '@basic-ui/color-picker';
|
|
3
|
+
import type { TextFieldProps } from '../';
|
|
4
4
|
export interface TextFieldColorPickerProps extends Omit<TextFieldProps, 'value' | 'defaultValue' | 'onChange'> {
|
|
5
5
|
value?: Color;
|
|
6
6
|
defaultValue?: Color;
|
|
@@ -1,37 +1,52 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
4
|
import { toColor } from '@basic-ui/color-picker';
|
|
4
5
|
import { Popper, useControlledState, useOnClickOutside } from '@basic-ui/core';
|
|
5
|
-
import { alpha, Box, TextField, Button } from '../';
|
|
6
6
|
import { useRef, useState, memo, useCallback } from 'react';
|
|
7
|
+
import { alpha, Box, TextField, Button } from '../';
|
|
7
8
|
import { ColorPicker } from './ColorPicker';
|
|
8
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
10
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
export var TextFieldColorPicker = /*#__PURE__*/memo(function (props) {
|
|
13
|
+
var valueProp = props.value,
|
|
14
|
+
_props$defaultValue = props.defaultValue,
|
|
15
|
+
defaultValue = _props$defaultValue === void 0 ? toColor('hex', '#33ff33') : _props$defaultValue,
|
|
16
|
+
onChangeProp = props.onChange,
|
|
17
|
+
disabled = props.disabled,
|
|
18
|
+
otherProps = _objectWithoutProperties(props, ["value", "defaultValue", "onChange", "disabled"]);
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
var _useState = useState(false),
|
|
21
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
22
|
+
popoverOpen = _useState2[0],
|
|
23
|
+
setPopoverOpen = _useState2[1];
|
|
24
|
+
|
|
25
|
+
var _useState3 = useState((valueProp == null ? void 0 : valueProp.hex) || defaultValue.hex),
|
|
26
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
27
|
+
text = _useState4[0],
|
|
28
|
+
setText = _useState4[1];
|
|
29
|
+
|
|
30
|
+
var _useControlledState = useControlledState(valueProp, onChangeProp, defaultValue, function (setState) {
|
|
31
|
+
return function (v) {
|
|
32
|
+
setState(v);
|
|
33
|
+
setText(v.hex);
|
|
34
|
+
};
|
|
35
|
+
}),
|
|
36
|
+
_useControlledState2 = _slicedToArray(_useControlledState, 2),
|
|
37
|
+
value = _useControlledState2[0],
|
|
38
|
+
_onChange = _useControlledState2[1];
|
|
39
|
+
|
|
40
|
+
var _onChange2 = useCallback(function (color) {
|
|
27
41
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
28
42
|
_onChange(color);
|
|
29
43
|
|
|
30
44
|
setText(color.hex.replace('#', ''));
|
|
31
45
|
}, [_onChange]);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
46
|
+
|
|
47
|
+
var popoverRef = useRef(null);
|
|
48
|
+
var buttonRef = useRef(null);
|
|
49
|
+
useOnClickOutside(popoverRef, function (e) {
|
|
35
50
|
if (e.target === (buttonRef == null ? void 0 : buttonRef.current)) {
|
|
36
51
|
return;
|
|
37
52
|
}
|
|
@@ -49,14 +64,18 @@ export const TextFieldColorPicker = /*#__PURE__*/memo(props => {
|
|
|
49
64
|
},
|
|
50
65
|
color: "on.surface",
|
|
51
66
|
ref: buttonRef,
|
|
52
|
-
onClick: ()
|
|
67
|
+
onClick: function onClick() {
|
|
68
|
+
return setPopoverOpen(function (open) {
|
|
69
|
+
return !open;
|
|
70
|
+
});
|
|
71
|
+
},
|
|
53
72
|
disabled: disabled,
|
|
54
73
|
sx: {
|
|
55
74
|
pointerEvents: 'all',
|
|
56
75
|
cursor: 'pointer',
|
|
57
76
|
width: 32,
|
|
58
77
|
height: 32,
|
|
59
|
-
borderRadius: '
|
|
78
|
+
borderRadius: 'extra-small',
|
|
60
79
|
borderWidth: '1px',
|
|
61
80
|
borderColor: alpha('on.surface', 0.38),
|
|
62
81
|
borderStyle: 'solid',
|
|
@@ -65,10 +84,11 @@ export const TextFieldColorPicker = /*#__PURE__*/memo(props => {
|
|
|
65
84
|
}),
|
|
66
85
|
maxLength: 6,
|
|
67
86
|
hideCharacterCounter: true,
|
|
68
|
-
onChange: e
|
|
87
|
+
onChange: function onChange(e) {
|
|
69
88
|
if (e.target.value.match(/^[a-fA-F0-9]{6}$/)) {
|
|
70
89
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
71
|
-
|
|
90
|
+
_onChange2(toColor('hex', '#' + e.target.value));
|
|
91
|
+
|
|
72
92
|
return;
|
|
73
93
|
}
|
|
74
94
|
|
|
@@ -80,19 +100,19 @@ export const TextFieldColorPicker = /*#__PURE__*/memo(props => {
|
|
|
80
100
|
style: {
|
|
81
101
|
zIndex: 2
|
|
82
102
|
},
|
|
83
|
-
children: /*#__PURE__*/
|
|
103
|
+
children: /*#__PURE__*/_jsx(Box, {
|
|
84
104
|
ref: popoverRef,
|
|
85
105
|
py: 2,
|
|
86
|
-
children:
|
|
106
|
+
children: /*#__PURE__*/_jsx(Box, {
|
|
87
107
|
boxShadow: 4,
|
|
88
108
|
children: /*#__PURE__*/_jsx(ColorPicker, {
|
|
89
109
|
color: value // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
90
110
|
,
|
|
91
|
-
onChange:
|
|
111
|
+
onChange: _onChange2,
|
|
92
112
|
width: 220,
|
|
93
113
|
height: 220
|
|
94
114
|
})
|
|
95
|
-
})
|
|
115
|
+
})
|
|
96
116
|
})
|
|
97
117
|
})]
|
|
98
118
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/ThemeExplorer/TextFieldColorPicker.tsx"],"names":["toColor","Popper","useControlledState","useOnClickOutside","
|
|
1
|
+
{"version":3,"sources":["../../../src/ThemeExplorer/TextFieldColorPicker.tsx"],"names":["toColor","Popper","useControlledState","useOnClickOutside","useRef","useState","memo","useCallback","alpha","Box","TextField","Button","ColorPicker","TextFieldColorPicker","props","valueProp","value","defaultValue","onChangeProp","onChange","disabled","otherProps","popoverOpen","setPopoverOpen","hex","text","setText","setState","v","_onChange","color","replace","popoverRef","buttonRef","e","target","current","backgroundColor","open","pointerEvents","cursor","width","height","borderRadius","borderWidth","borderColor","borderStyle","outlineColor","match","zIndex"],"mappings":";;;AACA,SAASA,OAAT,QAAwB,wBAAxB;AACA,SAASC,MAAT,EAAiBC,kBAAjB,EAAqCC,iBAArC,QAA8D,gBAA9D;AACA,SAASC,MAAT,EAAiBC,QAAjB,EAA2BC,IAA3B,EAAiCC,WAAjC,QAAoD,OAApD;AAGA,SAASC,KAAT,EAAgBC,GAAhB,EAAqBC,SAArB,EAAgCC,MAAhC,QAA8C,KAA9C;AACA,SAASC,WAAT,QAA4B,eAA5B;;;;AASA,OAAO,IAAMC,oBAAoB,gBAAGP,IAAI,CAA4B,UAACQ,KAAD,EAAW;AAAA,MAEpEC,SAFoE,GAOzED,KAPyE,CAE3EE,KAF2E;AAAA,4BAOzEF,KAPyE,CAG3EG,YAH2E;AAAA,MAG3EA,YAH2E,oCAG5DjB,OAAO,CAAC,KAAD,EAAQ,SAAR,CAHqD;AAAA,MAIjEkB,YAJiE,GAOzEJ,KAPyE,CAI3EK,QAJ2E;AAAA,MAK3EC,QAL2E,GAOzEN,KAPyE,CAK3EM,QAL2E;AAAA,MAMxEC,UANwE,4BAOzEP,KAPyE;;AAAA,kBASvCT,QAAQ,CAAC,KAAD,CAT+B;AAAA;AAAA,MAStEiB,WATsE;AAAA,MASzDC,cATyD;;AAAA,mBAUrDlB,QAAQ,CAAC,CAAAU,SAAS,QAAT,YAAAA,SAAS,CAAES,GAAX,KAAkBP,YAAY,CAACO,GAAhC,CAV6C;AAAA;AAAA,MAUtEC,IAVsE;AAAA,MAUhEC,OAVgE;;AAAA,4BAWlDxB,kBAAkB,CAC3Ca,SAD2C,EAE3CG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GE,YAAA,QAAQ,EAAEG,UAHZ;AAIE,YAAA,KAAK,EAAE,GAJT;AAKE,YAAA,MAAM,EAAE;AALV;AADF;AADF;AALF,MAtCJ;AAAA,IADF;AA2DD,CAlGuC,CAAjC","sourcesContent":["import type { Color } from '@basic-ui/color-picker';\nimport { toColor } from '@basic-ui/color-picker';\nimport { Popper, useControlledState, useOnClickOutside } from '@basic-ui/core';\nimport { useRef, useState, memo, useCallback } from 'react';\n\nimport type { TextFieldProps } from '../';\nimport { alpha, Box, TextField, Button } from '../';\nimport { ColorPicker } from './ColorPicker';\n\nexport interface TextFieldColorPickerProps\n extends Omit<TextFieldProps, 'value' | 'defaultValue' | 'onChange'> {\n value?: Color;\n defaultValue?: Color;\n onChange?: (color: Color) => void;\n}\n\nexport const TextFieldColorPicker = memo<TextFieldColorPickerProps>((props) => {\n const {\n value: valueProp,\n defaultValue = toColor('hex', '#33ff33'),\n onChange: onChangeProp,\n disabled,\n ...otherProps\n } = props;\n\n const [popoverOpen, setPopoverOpen] = useState(false);\n const [text, setText] = useState(valueProp?.hex || defaultValue.hex);\n const [value, _onChange] = useControlledState<Color, any, []>(\n valueProp,\n onChangeProp as any,\n defaultValue,\n (setState) => (v: any) => {\n setState(v);\n setText(v.hex);\n }\n );\n\n const onChange = useCallback(\n (color: Color) => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n _onChange!(color);\n setText(color.hex.replace('#', ''));\n },\n [_onChange]\n );\n\n const popoverRef = useRef<HTMLDivElement>(null);\n const buttonRef = useRef<HTMLButtonElement>(null);\n useOnClickOutside(popoverRef, (e) => {\n if (e.target === buttonRef?.current) {\n return;\n }\n setPopoverOpen(false);\n });\n\n return (\n <>\n <TextField\n disabled={disabled}\n value={text.replace('#', '')}\n leadingIcon={'#'}\n trailingIcon={\n <Button\n style={{ backgroundColor: value.hex }}\n color=\"on.surface\"\n ref={buttonRef}\n onClick={() => setPopoverOpen((open) => !open)}\n disabled={disabled}\n sx={{\n pointerEvents: 'all',\n cursor: 'pointer',\n width: 32,\n height: 32,\n borderRadius: 'extra-small',\n borderWidth: '1px',\n borderColor: alpha('on.surface', 0.38),\n borderStyle: 'solid',\n outlineColor: 'transparent',\n }}\n />\n }\n maxLength={6}\n hideCharacterCounter\n onChange={(e) => {\n if (e.target.value.match(/^[a-fA-F0-9]{6}$/)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n onChange!(toColor('hex', '#' + e.target.value));\n return;\n }\n setText(e.target.value);\n }}\n {...otherProps}\n />\n {popoverOpen && (\n <Popper\n anchorEl={buttonRef}\n placement=\"bottom-end\"\n style={{ zIndex: 2 }}\n >\n <Box ref={popoverRef} py={2}>\n <Box boxShadow={4}>\n <ColorPicker\n color={value}\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n onChange={onChange!}\n width={220}\n height={220}\n />\n </Box>\n </Box>\n </Popper>\n )}\n </>\n );\n});\n"],"file":"TextFieldColorPicker.js"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { makeColorScheme } from './makeColorScheme';
|
|
2
|
+
import type { makeColorScheme } from './makeColorScheme';
|
|
3
3
|
export declare const ThemeColors: React.MemoExoticComponent<({ scheme, }: {
|
|
4
4
|
scheme: Omit<ReturnType<typeof makeColorScheme>, 'modes'>;
|
|
5
5
|
}) => JSX.Element>;
|
|
@@ -3,9 +3,9 @@ import { Box } from '..';
|
|
|
3
3
|
import { ColorRow } from './components';
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
5
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
-
export
|
|
7
|
-
scheme
|
|
8
|
-
|
|
6
|
+
export var ThemeColors = /*#__PURE__*/memo(function (_ref) {
|
|
7
|
+
var scheme = _ref.scheme;
|
|
8
|
+
|
|
9
9
|
function makeColorArrayForToken(token) {
|
|
10
10
|
return [{
|
|
11
11
|
token: "".concat(token),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/ThemeExplorer/ThemeColors.tsx"],"names":["React","memo","Box","ColorRow","ThemeColors","scheme","makeColorArrayForToken","token","bg","color","on","gap","background","surface","outline"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,IAAhB,QAA4B,OAA5B;
|
|
1
|
+
{"version":3,"sources":["../../../src/ThemeExplorer/ThemeColors.tsx"],"names":["React","memo","Box","ColorRow","ThemeColors","scheme","makeColorArrayForToken","token","bg","color","on","gap","background","surface","outline"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,IAAhB,QAA4B,OAA5B;AAEA,SAASC,GAAT,QAAoB,IAApB;AACA,SAASC,QAAT,QAAyB,cAAzB;;;AAGA,OAAO,IAAMC,WAAW,gBAAGH,IAAI,CAC7B,gBAIM;AAAA,MAHJI,MAGI,QAHJA,MAGI;;AACJ,WAASC,sBAAT,CAAgCC,KAAhC,EAA+C;AAC7C,WAAO,CACL;AACEA,MAAAA,KAAK,YAAKA,KAAL,CADP;AAEEC,MAAAA,EAAE,EAAEH,MAAM,CAACE,KAAD,CAFZ;AAGEE,MAAAA,KAAK,EAAEJ,MAAM,CAACK,EAAP,CAAUH,KAAV;AAHT,KADK,EAML;AACEA,MAAAA,KAAK,eAAQA,KAAR,CADP;AAEEC,MAAAA,EAAE,EAAEH,MAAM,CAACK,EAAP,CAAUH,KAAV,CAFN;AAGEE,MAAAA,KAAK,EAAEJ,MAAM,CAACE,KAAD;AAHf,KANK,EAWL;AACEA,MAAAA,KAAK,YAAKA,KAAL,eADP;AAEEC,MAAAA,EAAE,EAAEH,MAAM,WAAIE,KAAJ,gBAFZ;AAGEE,MAAAA,KAAK,EAAEJ,MAAM,CAACK,EAAP,WAAaH,KAAb;AAHT,KAXK,EAgBL;AACEA,MAAAA,KAAK,eAAQA,KAAR,eADP;AAEEC,MAAAA,EAAE,EAAEH,MAAM,CAACK,EAAP,WAAaH,KAAb,gBAFN;AAGEE,MAAAA,KAAK,EAAEJ,MAAM,WAAIE,KAAJ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ACN;AACEN,QAAAA,KAAK,mBADP;AAEEC,QAAAA,EAAE,EAAEH,MAAM,CAAC,iBAAD,CAFZ;AAGEI,QAAAA,KAAK,EAAEJ,MAAM,CAACK,EAAP,CAAU,iBAAV;AAHT,OADM,EAMN;AACEH,QAAAA,KAAK,sBADP;AAEEC,QAAAA,EAAE,EAAEH,MAAM,CAACK,EAAP,CAAU,iBAAV,CAFN;AAGED,QAAAA,KAAK,EAAEJ,MAAM,CAAC,iBAAD;AAHf,OANM,EAWN;AACEE,QAAAA,KAAK,WADP;AAEEC,QAAAA,EAAE,EAAEH,MAAM,CAACS,OAFb;AAGEL,QAAAA,KAAK,EAAEJ,MAAM,CAACK,EAAP,CAAUI;AAHnB,OAXM;AADV,MA7BF;AAAA,IADF;AAmDD,CAjF4B,CAAxB","sourcesContent":["import React, { memo } from 'react';\n\nimport { Box } from '..';\nimport { ColorRow } from './components';\nimport type { makeColorScheme } from './makeColorScheme';\n\nexport const ThemeColors = memo(\n ({\n scheme,\n }: {\n scheme: Omit<ReturnType<typeof makeColorScheme>, 'modes'>;\n }) => {\n function makeColorArrayForToken(token: string) {\n return [\n {\n token: `${token}`,\n bg: scheme[token],\n color: scheme.on[token],\n },\n {\n token: `on.${token}`,\n bg: scheme.on[token],\n color: scheme[token],\n },\n {\n token: `${token}-container`,\n bg: scheme[`${token}-container`],\n color: scheme.on[`${token}-container`],\n },\n {\n token: `on.${token}-container`,\n bg: scheme.on[`${token}-container`],\n color: scheme[`${token}-container`],\n },\n ];\n }\n return (\n <Box width=\"600\" display=\"flex\" flexDirection=\"column\" sx={{ gap: 2 }}>\n <ColorRow colors={makeColorArrayForToken('primary')} height={118} />\n <ColorRow colors={makeColorArrayForToken('secondary')} />\n <ColorRow colors={makeColorArrayForToken('tertiary')} />\n <ColorRow colors={makeColorArrayForToken('error')} />\n <ColorRow\n colors={[\n {\n token: `background`,\n bg: scheme.background,\n color: scheme.on.background,\n },\n {\n token: `on.background`,\n bg: scheme.on.background,\n color: scheme.background,\n },\n {\n token: `surface`,\n bg: scheme.surface,\n color: scheme.on.surface,\n },\n {\n token: `on.surface`,\n bg: scheme.on.surface,\n color: scheme.surface,\n },\n ]}\n />\n <ColorRow\n colors={[\n {\n token: `surface-variant`,\n bg: scheme['surface-variant'],\n color: scheme.on['surface-variant'],\n },\n {\n token: `on.surface-variant`,\n bg: scheme.on['surface-variant'],\n color: scheme['surface-variant'],\n },\n {\n token: `outline`,\n bg: scheme.outline,\n color: scheme.on.outline,\n },\n ]}\n />\n </Box>\n );\n }\n);\n"],"file":"ThemeColors.js"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import { TonalPalette } from '@material/material-color-utilities';
|
|
3
4
|
export declare const ColorItem: React.MemoExoticComponent<(props: {
|
|
4
5
|
token: string;
|