@basic-ui/material 1.0.0-alpha.5 → 1.0.0-alpha.51
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 +2263 -1469
- package/build/cjs/index.js.map +1 -1
- package/build/esm/Alert/Alert.d.ts +6 -6
- package/build/esm/Alert/Alert.js +3 -2
- 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 +6 -5
- package/build/esm/AppBar/AppBar.js.map +1 -1
- package/build/esm/AppBar/AppBarButton.d.ts +4 -4
- package/build/esm/AppBar/AppBarButton.js +2 -1
- package/build/esm/AppBar/AppBarButton.js.map +1 -1
- package/build/esm/AppBar/context.d.ts +5 -5
- 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 +6 -6
- package/build/esm/Badge/Badge.js +28 -2
- 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 +1 -1
- 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 +7 -7
- package/build/esm/BottomSheet/BottomSheet.js +2 -1
- package/build/esm/BottomSheet/BottomSheet.js.map +1 -1
- package/build/esm/BottomSheet/BottomSheetSurface.d.ts +5 -5
- package/build/esm/BottomSheet/BottomSheetSurface.js +2 -2
- 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 +1 -2
- 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 +7 -7
- package/build/esm/Button/BaseButton.js +6 -5
- package/build/esm/Button/BaseButton.js.map +1 -1
- package/build/esm/Button/Button.d.ts +13 -13
- package/build/esm/Button/Button.js +6 -6
- package/build/esm/Button/Button.js.map +1 -1
- package/build/esm/Button/ButtonGroup.d.ts +5 -5
- package/build/esm/Button/ButtonGroup.js +3 -2
- package/build/esm/Button/ButtonGroup.js.map +1 -1
- package/build/esm/Button/FilledButton.d.ts +11 -11
- package/build/esm/Button/FilledButton.js +22 -9
- package/build/esm/Button/FilledButton.js.map +1 -1
- package/build/esm/Button/FloatingActionButton.d.ts +7 -7
- package/build/esm/Button/FloatingActionButton.js +1 -1
- package/build/esm/Button/FloatingActionButton.js.map +1 -1
- package/build/esm/Button/IconButton.d.ts +8 -8
- package/build/esm/Button/IconButton.js +1 -1
- package/build/esm/Button/IconButton.js.map +1 -1
- package/build/esm/Button/OutlinedButton.d.ts +4 -4
- package/build/esm/Button/OutlinedButton.js +18 -3
- package/build/esm/Button/OutlinedButton.js.map +1 -1
- package/build/esm/Button/TransparentButton.d.ts +11 -11
- package/build/esm/Button/TransparentButton.js +17 -2
- package/build/esm/Button/TransparentButton.js.map +1 -1
- package/build/esm/Button/context.d.ts +8 -8
- package/build/esm/Button/context.js.map +1 -1
- package/build/esm/Button/index.d.ts +2 -2
- package/build/esm/Button/index.js.map +1 -1
- package/build/esm/CheckBox/CheckBox.d.ts +13 -13
- package/build/esm/CheckBox/CheckBox.js +6 -5
- package/build/esm/CheckBox/CheckBox.js.map +1 -1
- package/build/esm/CheckBox/CheckBoxIcon.d.ts +10 -10
- package/build/esm/CheckBox/CheckBoxIcon.js +6 -5
- package/build/esm/CheckBox/CheckBoxIcon.js.map +1 -1
- package/build/esm/CheckBox/CheckPath.d.ts +3 -4
- package/build/esm/CheckBox/CheckPath.js +1 -1
- package/build/esm/CheckBox/CheckPath.js.map +1 -1
- package/build/esm/CheckBox/IndeterminatePath.d.ts +3 -4
- package/build/esm/CheckBox/IndeterminatePath.js +1 -1
- 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 +4 -4
- 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 +10 -10
- package/build/esm/Chip/ChipBase.js.map +1 -1
- package/build/esm/Chip/ChoiceChip.d.ts +10 -10
- package/build/esm/Chip/ChoiceChip.js +6 -5
- 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 +25 -16
- 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 +20 -20
- package/build/esm/Dialog/Dialog.js +6 -5
- package/build/esm/Dialog/Dialog.js.map +1 -1
- package/build/esm/Dialog/DialogBackdrop.d.ts +7 -7
- package/build/esm/Dialog/DialogBackdrop.js +2 -2
- package/build/esm/Dialog/DialogBackdrop.js.map +1 -1
- package/build/esm/Dialog/DialogContainer.d.ts +4 -4
- package/build/esm/Dialog/DialogContainer.js +2 -1
- package/build/esm/Dialog/DialogContainer.js.map +1 -1
- package/build/esm/Dialog/DialogSurface.d.ts +7 -7
- package/build/esm/Dialog/DialogSurface.js +4 -4
- package/build/esm/Dialog/DialogSurface.js.map +1 -1
- package/build/esm/Dialog/Scrim.d.ts +4 -4
- package/build/esm/Dialog/Scrim.js +2 -1
- package/build/esm/Dialog/Scrim.js.map +1 -1
- package/build/esm/Dialog/index.d.ts +2 -2
- package/build/esm/Dialog/index.js +1 -0
- package/build/esm/Dialog/index.js.map +1 -1
- package/build/esm/Dialog/useDialogAnimation.d.ts +824 -824
- package/build/esm/Dialog/useDialogAnimation.js +6 -4
- package/build/esm/Dialog/useDialogAnimation.js.map +1 -1
- package/build/esm/Divider/Divider.d.ts +7 -7
- package/build/esm/Divider/Divider.js +9 -10
- 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 +7 -6
- 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 +5 -4
- 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 +14 -2
- 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 +2 -2
- 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 -12
- package/build/esm/ListItem/ListItem.js +50 -47
- package/build/esm/ListItem/ListItem.js.map +1 -1
- package/build/esm/ListItem/ListItemText.d.ts +7 -7
- package/build/esm/ListItem/ListItemText.js +5 -5
- 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 -16
- package/build/esm/Menu/Menu.js +31 -11
- package/build/esm/Menu/Menu.js.map +1 -1
- package/build/esm/Menu/animation.d.ts +2 -2
- package/build/esm/Menu/animation.js.map +1 -1
- package/build/esm/Menu/index.d.ts +2 -1
- package/build/esm/Menu/index.js +1 -0
- package/build/esm/Menu/index.js.map +1 -1
- package/build/esm/NavRail/NavRailItem.d.ts +15 -0
- package/build/esm/NavRail/NavRailItem.js +149 -0
- package/build/esm/NavRail/NavRailItem.js.map +1 -0
- package/build/esm/NavRail/icons/test-icons.d.ts +4 -0
- package/build/esm/NavRail/icons/test-icons.js +42 -0
- package/build/esm/NavRail/icons/test-icons.js.map +1 -0
- package/build/esm/NavRail/index.d.ts +1 -0
- package/build/esm/NavRail/index.js +2 -0
- package/build/esm/NavRail/index.js.map +1 -0
- package/build/esm/NotchedOutline/NotchedOutline.d.ts +14 -14
- package/build/esm/NotchedOutline/NotchedOutline.js +4 -4
- package/build/esm/NotchedOutline/NotchedOutline.js.map +1 -1
- package/build/esm/NotchedOutline/context.d.ts +6 -6
- 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 +575 -485
- package/build/esm/NotchedOutline/styledComponents.js +3 -2
- package/build/esm/NotchedOutline/styledComponents.js.map +1 -1
- package/build/esm/Paper/Paper.d.ts +11 -11
- package/build/esm/Paper/Paper.js +8 -8
- 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 +14 -0
- package/build/esm/Popover/Popover.js +74 -0
- package/build/esm/Popover/Popover.js.map +1 -0
- package/build/esm/Popover/PopoverContainer.d.ts +4 -0
- package/build/esm/Popover/PopoverContainer.js +20 -0
- package/build/esm/Popover/PopoverContainer.js.map +1 -0
- package/build/esm/Popover/PopoverSurface.d.ts +5 -0
- package/build/esm/Popover/PopoverSurface.js +41 -0
- package/build/esm/Popover/PopoverSurface.js.map +1 -0
- package/build/esm/Popover/index.d.ts +1 -0
- package/build/esm/Popover/index.js +2 -0
- package/build/esm/Popover/index.js.map +1 -0
- package/build/esm/ProgressSpinner/ProgressSpinner.d.ts +8 -8
- package/build/esm/ProgressSpinner/ProgressSpinner.js +14 -14
- 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 +4 -4
- package/build/esm/RadioButton/RadioButton.js +4 -2
- package/build/esm/RadioButton/RadioButton.js.map +1 -1
- package/build/esm/RadioButton/RadioButtonIcon.d.ts +6 -6
- package/build/esm/RadioButton/RadioButtonIcon.js +6 -5
- package/build/esm/RadioButton/RadioButtonIcon.js.map +1 -1
- package/build/esm/RadioButton/RadioGroup.d.ts +5 -5
- package/build/esm/RadioButton/RadioGroup.js +2 -1
- 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 +11 -11
- package/build/esm/Ripple/Ripple.js +1 -1
- package/build/esm/Ripple/Ripple.js.map +1 -1
- package/build/esm/Ripple/RippleBox.d.ts +5 -6
- package/build/esm/Ripple/RippleBox.js +7 -6
- package/build/esm/Ripple/RippleBox.js.map +1 -1
- package/build/esm/Ripple/constants.d.ts +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.map +1 -1
- package/build/esm/Ripple/useRipple.d.ts +14 -14
- package/build/esm/Ripple/useRipple.js +2 -2
- package/build/esm/Ripple/useRipple.js.map +1 -1
- package/build/esm/Ripple/useRippleHandlers.d.ts +8 -8
- package/build/esm/Ripple/useRippleHandlers.js +2 -1
- package/build/esm/Ripple/useRippleHandlers.js.map +1 -1
- package/build/esm/Ripple/useRippleSurface.d.ts +787 -786
- package/build/esm/Ripple/useRippleSurface.js +65 -60
- package/build/esm/Ripple/useRippleSurface.js.map +1 -1
- package/build/esm/SearchBar/SearchBar.d.ts +15 -0
- package/build/esm/SearchBar/SearchBar.js +90 -0
- package/build/esm/SearchBar/SearchBar.js.map +1 -0
- package/build/esm/SearchBar/index.d.ts +1 -0
- package/build/esm/SearchBar/index.js +2 -0
- package/build/esm/SearchBar/index.js.map +1 -0
- package/build/esm/Select/CustomContainerExample.d.ts +3 -0
- package/build/esm/Select/CustomContainerExample.js +59 -0
- package/build/esm/Select/CustomContainerExample.js.map +1 -0
- package/build/esm/Select/Select.d.ts +32 -18
- package/build/esm/Select/Select.js +67 -15
- package/build/esm/Select/Select.js.map +1 -1
- package/build/esm/Select/SelectIcon.d.ts +6 -6
- package/build/esm/Select/SelectIcon.js +6 -5
- package/build/esm/Select/SelectIcon.js.map +1 -1
- package/build/esm/Select/context.d.ts +9 -8
- package/build/esm/Select/context.js +2 -1
- package/build/esm/Select/context.js.map +1 -1
- package/build/esm/Select/defaultRender.d.ts +3 -1
- package/build/esm/Select/defaultRender.js +33 -4
- 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 +13 -22
- package/build/esm/Select/styledComponents.js.map +1 -1
- package/build/esm/SelectItem/SelectItem.d.ts +11 -4
- package/build/esm/SelectItem/SelectItem.js +34 -9
- 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 +4 -3
- package/build/esm/SelectionControl/SelectionControlLabel.js.map +1 -1
- package/build/esm/SelectionControl/SelectionControlText.d.ts +8 -8
- package/build/esm/SelectionControl/SelectionControlText.js +4 -4
- 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 +5 -5
- package/build/esm/Skeleton/DelayAppearance.js.map +1 -1
- package/build/esm/Skeleton/Skeleton.d.ts +9 -9
- package/build/esm/Skeleton/Skeleton.js +4 -4
- package/build/esm/Skeleton/Skeleton.js.map +1 -1
- package/build/esm/Skeleton/animation.d.ts +8 -8
- 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 -0
- package/build/esm/Slider/Slider.js +224 -0
- package/build/esm/Slider/Slider.js.map +1 -0
- package/build/esm/Slider/index.d.ts +1 -0
- package/build/esm/Slider/index.js +2 -0
- package/build/esm/Slider/index.js.map +1 -0
- package/build/esm/Snackbar/Snackbar.d.ts +8 -8
- package/build/esm/Snackbar/Snackbar.js +12 -12
- package/build/esm/Snackbar/Snackbar.js.map +1 -1
- package/build/esm/Snackbar/Stack.d.ts +31 -32
- package/build/esm/Snackbar/Stack.js +11 -10
- package/build/esm/Snackbar/Stack.js.map +1 -1
- package/build/esm/Snackbar/index.d.ts +3 -2
- package/build/esm/Snackbar/index.js +1 -0
- package/build/esm/Snackbar/index.js.map +1 -1
- package/build/esm/Snackbar/useSnackbarAnimation.d.ts +6 -70
- package/build/esm/Snackbar/useSnackbarAnimation.js +9 -8
- package/build/esm/Snackbar/useSnackbarAnimation.js.map +1 -1
- package/build/esm/Switch/Switch.d.ts +13 -8
- package/build/esm/Switch/Switch.js +70 -48
- 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 +34 -25
- package/build/esm/Switch/styledComponents.js.map +1 -1
- package/build/esm/Tab/Tab.d.ts +5 -5
- package/build/esm/Tab/Tab.js +51 -14
- package/build/esm/Tab/Tab.js.map +1 -1
- package/build/esm/Tab/TabList.d.ts +10 -9
- package/build/esm/Tab/TabList.js +8 -3
- package/build/esm/Tab/TabList.js.map +1 -1
- package/build/esm/Tab/TabPanel.d.ts +5 -5
- package/build/esm/Tab/TabPanel.js +4 -2
- 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 +9 -8
- package/build/esm/Tab/context.js +2 -1
- 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 -7
- package/build/esm/TabIndicator/TabIndicator.js +78 -10
- package/build/esm/TabIndicator/TabIndicator.js.map +1 -1
- package/build/esm/TabIndicator/context.d.ts +6 -6
- 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 +4 -4
- package/build/esm/Table/Table.js +13 -11
- package/build/esm/Table/Table.js.map +1 -1
- package/build/esm/Table/TableBody.d.ts +4 -4
- package/build/esm/Table/TableBody.js +4 -3
- package/build/esm/Table/TableBody.js.map +1 -1
- package/build/esm/Table/TableCell.d.ts +4 -4
- package/build/esm/Table/TableCell.js +9 -6
- package/build/esm/Table/TableCell.js.map +1 -1
- package/build/esm/Table/TableHead.d.ts +4 -4
- package/build/esm/Table/TableHead.js +5 -5
- package/build/esm/Table/TableHead.js.map +1 -1
- package/build/esm/Table/TableRow.d.ts +4 -4
- package/build/esm/Table/TableRow.js +9 -9
- package/build/esm/Table/TableRow.js.map +1 -1
- package/build/esm/Table/context.d.ts +3 -3
- 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 +1 -1
- package/build/esm/Text/LoremIpsum.js.map +1 -1
- package/build/esm/Text/Text.d.ts +11 -7
- package/build/esm/Text/Text.js +7 -3
- 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 -15
- package/build/esm/TextField/FilledContainer.js +11 -11
- package/build/esm/TextField/FilledContainer.js.map +1 -1
- package/build/esm/TextField/HelperText.d.ts +10 -10
- package/build/esm/TextField/HelperText.js +5 -5
- package/build/esm/TextField/HelperText.js.map +1 -1
- package/build/esm/TextField/IconContainer.d.ts +5 -6
- package/build/esm/TextField/IconContainer.js +1 -1
- package/build/esm/TextField/IconContainer.js.map +1 -1
- package/build/esm/TextField/Input.d.ts +11 -11
- package/build/esm/TextField/Input.js +12 -10
- package/build/esm/TextField/Input.js.map +1 -1
- package/build/esm/TextField/OutlinedContainer.d.ts +17 -17
- package/build/esm/TextField/OutlinedContainer.js +17 -9
- package/build/esm/TextField/OutlinedContainer.js.map +1 -1
- package/build/esm/TextField/TextField.d.ts +19 -19
- package/build/esm/TextField/TextField.js +4 -4
- package/build/esm/TextField/TextField.js.map +1 -1
- package/build/esm/TextField/consts.d.ts +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 -0
- package/build/esm/ThemeExplorer/BorderSlider.js +78 -0
- package/build/esm/ThemeExplorer/BorderSlider.js.map +1 -0
- package/build/esm/ThemeExplorer/ColorPicker.d.ts +8 -8
- package/build/esm/ThemeExplorer/ColorPicker.js +4 -3
- package/build/esm/ThemeExplorer/ColorPicker.js.map +1 -1
- package/build/esm/ThemeExplorer/ColorSchemePicker.d.ts +10 -0
- package/build/esm/ThemeExplorer/ColorSchemePicker.js +54 -0
- package/build/esm/ThemeExplorer/ColorSchemePicker.js.map +1 -0
- package/build/esm/ThemeExplorer/FontAutoComplete.d.ts +9 -0
- package/build/esm/ThemeExplorer/FontAutoComplete.js +128 -0
- package/build/esm/ThemeExplorer/FontAutoComplete.js.map +1 -0
- package/build/esm/ThemeExplorer/TextFieldColorPicker.d.ts +9 -9
- package/build/esm/ThemeExplorer/TextFieldColorPicker.js +4 -3
- package/build/esm/ThemeExplorer/TextFieldColorPicker.js.map +1 -1
- package/build/esm/ThemeExplorer/ThemeBuilder.d.ts +11 -0
- package/build/esm/ThemeExplorer/ThemeBuilder.js +400 -0
- package/build/esm/ThemeExplorer/ThemeBuilder.js.map +1 -0
- package/build/esm/ThemeExplorer/ThemeColors.d.ts +5 -5
- package/build/esm/ThemeExplorer/ThemeColors.js +38 -16
- package/build/esm/ThemeExplorer/ThemeColors.js.map +1 -1
- package/build/esm/ThemeExplorer/components.d.ts +31 -32
- package/build/esm/ThemeExplorer/components.js +29 -28
- package/build/esm/ThemeExplorer/components.js.map +1 -1
- package/build/esm/ThemeExplorer/googleFonts.d.ts +1 -0
- package/build/esm/ThemeExplorer/googleFonts.js +7 -0
- package/build/esm/ThemeExplorer/googleFonts.js.map +1 -0
- package/build/esm/ThemeExplorer/index.d.ts +1 -0
- package/build/esm/ThemeExplorer/index.js +2 -0
- package/build/esm/ThemeExplorer/index.js.map +1 -0
- package/build/esm/ThemeExplorer/makeColorScheme.d.ts +98 -66
- package/build/esm/ThemeExplorer/makeColorScheme.js +46 -10
- package/build/esm/ThemeExplorer/makeColorScheme.js.map +1 -1
- package/build/esm/ThemeExplorer/makeTailwindTheme.d.ts +2 -0
- package/build/esm/ThemeExplorer/makeTailwindTheme.js +30 -0
- package/build/esm/ThemeExplorer/makeTailwindTheme.js.map +1 -0
- package/build/esm/ThemeExplorer/updateGoogleFonts.js +70 -0
- package/build/esm/ThemeExplorer/updateGoogleFonts.js.map +1 -0
- package/build/esm/ThemeExplorer/useDeferredColor.d.ts +3 -3
- package/build/esm/ThemeExplorer/useDeferredColor.js +6 -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 +1 -1
- package/build/esm/ThemeExplorer/useLocalStorageCachedState.js.map +1 -1
- package/build/esm/Tooltip/Tooltip.d.ts +8 -8
- package/build/esm/Tooltip/Tooltip.js +30 -16
- 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 -6
- package/build/esm/color.js +14 -5
- 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 +3 -3
- package/build/esm/hooks/useAnimation.js.map +1 -1
- package/build/esm/index.d.ts +42 -37
- package/build/esm/index.js +6 -1
- package/build/esm/index.js.map +1 -1
- package/build/esm/motion.d.ts +7 -0
- package/build/esm/motion.js +8 -0
- package/build/esm/motion.js.map +1 -0
- package/build/esm/tailwind/extendColors.d.ts +5 -0
- package/build/esm/tailwind/extendColors.js +59 -0
- package/build/esm/tailwind/extendColors.js.map +1 -0
- package/build/esm/tailwind/index.d.ts +8 -0
- package/build/esm/tailwind/index.js +45 -0
- package/build/esm/tailwind/index.js.map +1 -0
- 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 +562 -472
- package/build/esm/theme/theme.js +54 -42
- 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.map +1 -1
- package/build/esm/theme/typography-roboto.d.ts +111 -111
- package/build/esm/theme/typography-roboto.js.map +1 -1
- package/build/esm/theme/useTheme.d.ts +566 -6
- package/build/esm/theme/useTheme.js.map +1 -1
- package/build/tsconfig-build.tsbuildinfo +1 -0
- package/package.json +22 -13
- package/src/Alert/Alert.tsx +1 -1
- package/src/Alert/index.ts +1 -1
- package/src/AppBar/AppBar.story.tsx +69 -69
- package/src/AppBar/AppBar.tsx +85 -84
- 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 -0
- package/src/Badge/Badge.tsx +47 -17
- 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 +127 -129
- package/src/Box/index.ts +1 -1
- package/src/Button/BaseButton.tsx +4 -11
- package/src/Button/Button.story.tsx +10 -1
- package/src/Button/Button.tsx +4 -4
- package/src/Button/ButtonGroup.story.tsx +68 -43
- package/src/Button/ButtonGroup.tsx +1 -1
- package/src/Button/FilledButton.tsx +20 -10
- package/src/Button/FloatingActionButton.tsx +9 -9
- package/src/Button/OutlinedButton.tsx +17 -2
- package/src/Button/SpinnerButton.story.tsx +91 -91
- package/src/Button/TransparentButton.tsx +16 -1
- package/src/Button/context.tsx +17 -17
- package/src/Button/index.ts +2 -2
- package/src/CheckBox/CheckBox.story.tsx +155 -154
- package/src/CheckBox/CheckBox.tsx +170 -174
- package/src/CheckBox/CheckBoxIcon.tsx +64 -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.story.tsx +3 -3
- package/src/Combobox/Combobox.tsx +274 -272
- 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 -57
- package/src/Dialog/Scrim.tsx +35 -35
- package/src/Dialog/index.ts +2 -2
- package/src/Dialog/useDialogAnimation.tsx +49 -50
- package/src/Divider/Divider.story.tsx +39 -39
- package/src/Divider/Divider.tsx +48 -49
- package/src/Divider/index.ts +1 -1
- package/src/FloatingLabel/FloatingLabel.story.tsx +55 -55
- package/src/FloatingLabel/FloatingLabel.tsx +77 -76
- 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 -56
- 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 -99
- package/src/ListItem/ListItemText.tsx +35 -36
- package/src/ListItem/index.ts +2 -2
- package/src/Menu/ContextMenu.story.tsx +34 -0
- package/src/Menu/Menu.story.tsx +54 -54
- package/src/Menu/Menu.tsx +124 -110
- package/src/Menu/animation.ts +16 -16
- package/src/Menu/index.ts +2 -1
- package/src/NavRail/NavRail.story.tsx +146 -0
- package/src/NavRail/NavRailItem.tsx +175 -0
- package/src/NavRail/icons/test-icons.tsx +46 -0
- package/src/NavRail/index.ts +1 -0
- package/src/NotchedOutline/NotchedOutline.story.tsx +99 -99
- package/src/NotchedOutline/NotchedOutline.tsx +80 -81
- package/src/NotchedOutline/context.ts +12 -12
- package/src/NotchedOutline/index.ts +1 -1
- package/src/NotchedOutline/styledComponents.ts +122 -121
- package/src/Paper/Paper.story.tsx +50 -50
- package/src/Paper/Paper.tsx +67 -71
- package/src/Paper/index.ts +1 -1
- package/src/Popover/Popover.story.tsx +34 -0
- package/src/Popover/Popover.tsx +97 -0
- package/src/Popover/PopoverContainer.tsx +25 -0
- package/src/Popover/PopoverSurface.tsx +51 -0
- package/src/Popover/index.ts +1 -0
- 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 -45
- package/src/RadioButton/RadioGroup.tsx +27 -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 -53
- 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 +155 -133
- package/src/SearchBar/SearchBar.story.tsx +98 -0
- package/src/SearchBar/SearchBar.tsx +105 -0
- package/src/SearchBar/index.ts +1 -0
- package/src/Select/CustomContainerExample.tsx +59 -0
- package/src/Select/PaymentMethodSelect.story.tsx +316 -323
- package/src/Select/Select.story.tsx +225 -226
- package/src/Select/Select.tsx +283 -197
- package/src/Select/SelectIcon.tsx +43 -44
- package/src/Select/SelectMultiple.story.tsx +215 -0
- package/src/Select/context.ts +22 -19
- package/src/Select/defaultRender.tsx +49 -0
- package/src/Select/index.ts +1 -1
- package/src/Select/styledComponents.tsx +38 -48
- package/src/SelectItem/SelectItem.tsx +92 -60
- package/src/SelectItem/index.ts +1 -1
- package/src/SelectionControl/SelectionControlLabel.tsx +34 -37
- 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 -0
- package/src/Slider/Slider.tsx +275 -0
- package/src/Slider/index.ts +1 -0
- package/src/Snackbar/Snackbar.story.tsx +99 -99
- package/src/Snackbar/Snackbar.tsx +10 -10
- package/src/Snackbar/Stack.tsx +13 -12
- package/src/Snackbar/index.ts +1 -0
- package/src/Snackbar/useSnackbarAnimation.ts +5 -4
- package/src/Switch/Switch.story.tsx +98 -27
- package/src/Switch/Switch.tsx +170 -127
- package/src/Switch/index.ts +1 -1
- package/src/Switch/styledComponents.tsx +117 -110
- package/src/Tab/Tab.story.tsx +209 -53
- package/src/Tab/Tab.tsx +120 -82
- package/src/Tab/TabList.tsx +61 -57
- 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 -15
- package/src/Tab/index.ts +5 -5
- package/src/TabIndicator/TabIndicator.tsx +146 -69
- package/src/TabIndicator/context.ts +13 -12
- package/src/TabIndicator/index.ts +2 -2
- package/src/Table/Table.tsx +12 -9
- package/src/Table/TableCell.tsx +5 -2
- package/src/Table/TableHead.tsx +1 -2
- package/src/Table/TableRow.tsx +5 -6
- package/src/Table/context.ts +6 -6
- package/src/Text/LoremIpsum.tsx +18 -18
- package/src/Text/Text.story.tsx +75 -40
- package/src/Text/Text.tsx +84 -64
- package/src/Text/index.ts +1 -1
- package/src/TextField/FilledContainer.tsx +173 -172
- package/src/TextField/HelperText.tsx +63 -63
- package/src/TextField/IconContainer.tsx +3 -3
- package/src/TextField/Input.tsx +6 -5
- package/src/TextField/OutlinedContainer.tsx +116 -111
- package/src/TextField/TextField.story.tsx +2 -3
- package/src/TextField/TextField.tsx +4 -4
- package/src/TextField/consts.ts +7 -7
- package/src/TextField/index.ts +4 -4
- package/src/ThemeExplorer/BorderSlider.tsx +73 -0
- package/src/ThemeExplorer/ColorPicker.tsx +104 -104
- package/src/ThemeExplorer/ColorSchemePicker.tsx +55 -0
- package/src/ThemeExplorer/FontAutoComplete.tsx +139 -0
- package/src/ThemeExplorer/TextFieldColorPicker.tsx +115 -115
- package/src/ThemeExplorer/ThemeBuilder.story.tsx +8 -165
- package/src/ThemeExplorer/ThemeBuilder.tsx +353 -0
- package/src/ThemeExplorer/ThemeColors.tsx +118 -89
- package/src/ThemeExplorer/components.tsx +195 -195
- package/src/ThemeExplorer/googleFonts.ts +1436 -0
- package/src/ThemeExplorer/index.ts +1 -0
- package/src/ThemeExplorer/makeColorScheme.tsx +111 -74
- package/src/ThemeExplorer/makeTailwindTheme.ts +44 -0
- package/src/ThemeExplorer/updateGoogleFonts.js +33 -0
- package/src/ThemeExplorer/useDeferredColor.tsx +21 -25
- package/src/ThemeExplorer/useLocalStorageCachedState.ts +18 -18
- package/src/Tooltip/Tooltip.story.tsx +35 -35
- package/src/Tooltip/Tooltip.tsx +67 -50
- package/src/Tooltip/index.ts +1 -1
- package/src/color.ts +30 -6
- package/src/css.ts +2 -2
- package/src/hooks/useAnimation.ts +111 -111
- package/src/index.ts +6 -1
- package/src/motion.ts +7 -0
- package/src/tailwind/extendColors.ts +51 -0
- package/src/tailwind/index.ts +56 -0
- package/src/tailwind/tests/extendColors.test.ts +123 -0
- package/src/theme/index.ts +2 -2
- package/src/theme/theme.ts +57 -39
- package/src/theme/typography-raleway.ts +114 -114
- package/src/theme/typography-roboto.ts +113 -113
- package/src/theme/useTheme.ts +18 -18
- package/tailwind/package.json +5 -0
- package/theme-explorer/package.json +5 -0
- package/build/esm/ColorMode/ColorModeProvider.d.ts +0 -7
- package/build/esm/ColorMode/ColorModeProvider.js +0 -92
- package/build/esm/ColorMode/ColorModeProvider.js.map +0 -1
- package/build/esm/ColorMode/color-mode.d.ts +0 -8
- package/build/esm/ColorMode/color-mode.js +0 -11
- package/build/esm/ColorMode/color-mode.js.map +0 -1
- package/build/esm/ColorMode/color-vars.d.ts +0 -4
- package/build/esm/ColorMode/color-vars.js +0 -58
- package/build/esm/ColorMode/color-vars.js.map +0 -1
- package/build/esm/ColorMode/constants.d.ts +0 -3
- package/build/esm/ColorMode/constants.js +0 -5
- package/build/esm/ColorMode/constants.js.map +0 -1
- package/build/esm/ColorMode/index.d.ts +0 -4
- package/build/esm/ColorMode/index.js +0 -5
- package/build/esm/ColorMode/index.js.map +0 -1
- package/build/esm/ListItem/context.d.ts +0 -7
- package/build/esm/ListItem/context.js +0 -10
- package/build/esm/ListItem/context.js.map +0 -1
- package/build/tsconfig.tsbuildinfo +0 -1
- package/src/ColorMode/ColorModeProvider.tsx +0 -97
- package/src/ColorMode/color-mode.ts +0 -20
- package/src/ColorMode/color-vars.ts +0 -56
- package/src/ColorMode/constants.ts +0 -5
- package/src/ColorMode/index.ts +0 -4
- package/src/ColorMode/tests/color-vars.test.ts +0 -9
- package/src/Select/defaultRender.ts +0 -18
- package/src/ThemeExplorer/ThemeExplorer.story.tsx +0 -43
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { hexFromArgb } from '@material/material-color-utilities';
|
|
2
|
-
|
|
1
|
+
import { hexFromArgb } from '@material/material-color-utilities';
|
|
3
2
|
export function makeColorScheme(opts) {
|
|
4
3
|
function c(palette, tone) {
|
|
5
4
|
return hexFromArgb(palette.tone(tone));
|
|
@@ -14,10 +13,19 @@ export function makeColorScheme(opts) {
|
|
|
14
13
|
'secondary-container': c(opts.secondary, 90),
|
|
15
14
|
'tertiary-container': c(opts.tertiary, 90),
|
|
16
15
|
'error-container': c(opts.error, 90),
|
|
17
|
-
background: c(opts.neutral,
|
|
18
|
-
surface: c(opts.neutral, 99),
|
|
16
|
+
background: c(opts.neutral, 98),
|
|
19
17
|
'surface-variant': c(opts.neutralVariant, 90),
|
|
20
18
|
outline: c(opts.neutralVariant, 50),
|
|
19
|
+
'outline-variant': c(opts.neutralVariant, 80),
|
|
20
|
+
// https://material.io/blog/tone-based-surface-color-m3
|
|
21
|
+
'surface-dim': c(opts.neutral, 87),
|
|
22
|
+
surface: c(opts.neutral, 98),
|
|
23
|
+
'surface-bright': c(opts.neutral, 98),
|
|
24
|
+
'surface-container-lowest': c(opts.neutral, 100),
|
|
25
|
+
'surface-container-low': c(opts.neutral, 96),
|
|
26
|
+
'surface-container': c(opts.neutral, 94),
|
|
27
|
+
'surface-container-high': c(opts.neutral, 92),
|
|
28
|
+
'surface-container-highest': c(opts.neutral, 90),
|
|
21
29
|
on: {
|
|
22
30
|
primary: c(opts.primary, 100),
|
|
23
31
|
secondary: c(opts.secondary, 100),
|
|
@@ -28,9 +36,18 @@ export function makeColorScheme(opts) {
|
|
|
28
36
|
'tertiary-container': c(opts.tertiary, 10),
|
|
29
37
|
'error-container': c(opts.error, 10),
|
|
30
38
|
background: c(opts.neutral, 10),
|
|
31
|
-
surface: c(opts.neutral, 10),
|
|
32
39
|
'surface-variant': c(opts.neutralVariant, 30),
|
|
33
|
-
outline: c(opts.neutralVariant, 95)
|
|
40
|
+
outline: c(opts.neutralVariant, 95),
|
|
41
|
+
'outline-variant': c(opts.neutralVariant, 10),
|
|
42
|
+
// https://material.io/blog/tone-based-surface-color-m3
|
|
43
|
+
'surface-dim': c(opts.neutral, 10),
|
|
44
|
+
surface: c(opts.neutral, 10),
|
|
45
|
+
'surface-bright': c(opts.neutral, 10),
|
|
46
|
+
'surface-container-lowest': c(opts.neutral, 10),
|
|
47
|
+
'surface-container-low': c(opts.neutral, 10),
|
|
48
|
+
'surface-container': c(opts.neutral, 10),
|
|
49
|
+
'surface-container-high': c(opts.neutral, 10),
|
|
50
|
+
'surface-container-highest': c(opts.neutral, 10)
|
|
34
51
|
},
|
|
35
52
|
modes: {
|
|
36
53
|
dark: {
|
|
@@ -42,10 +59,20 @@ export function makeColorScheme(opts) {
|
|
|
42
59
|
'secondary-container': c(opts.secondary, 30),
|
|
43
60
|
'tertiary-container': c(opts.tertiary, 30),
|
|
44
61
|
'error-container': c(opts.error, 30),
|
|
45
|
-
background: c(opts.neutral,
|
|
46
|
-
surface: c(opts.neutral, 10),
|
|
62
|
+
background: c(opts.neutral, 6),
|
|
47
63
|
'surface-variant': c(opts.neutralVariant, 30),
|
|
48
64
|
outline: c(opts.neutralVariant, 60),
|
|
65
|
+
'outline-variant': c(opts.neutralVariant, 30),
|
|
66
|
+
// https://material.io/blog/tone-based-surface-color-m3
|
|
67
|
+
// TODO: get the actual values from here once updated: https://github.com/material-foundation/material-color-utilities/blob/main/dart/lib/scheme/scheme.dart#L126-L156
|
|
68
|
+
'surface-dim': c(opts.neutral, 6),
|
|
69
|
+
surface: c(opts.neutral, 6),
|
|
70
|
+
'surface-bright': c(opts.neutral, 24),
|
|
71
|
+
'surface-container-lowest': c(opts.neutral, 4),
|
|
72
|
+
'surface-container-low': c(opts.neutral, 10),
|
|
73
|
+
'surface-container': c(opts.neutral, 12),
|
|
74
|
+
'surface-container-high': c(opts.neutral, 17),
|
|
75
|
+
'surface-container-highest': c(opts.neutral, 22),
|
|
49
76
|
on: {
|
|
50
77
|
primary: c(opts.primary, 20),
|
|
51
78
|
secondary: c(opts.secondary, 20),
|
|
@@ -56,9 +83,18 @@ export function makeColorScheme(opts) {
|
|
|
56
83
|
'tertiary-container': c(opts.tertiary, 90),
|
|
57
84
|
'error-container': c(opts.error, 90),
|
|
58
85
|
background: c(opts.neutral, 90),
|
|
59
|
-
surface: c(opts.neutral, 90),
|
|
60
86
|
'surface-variant': c(opts.neutralVariant, 80),
|
|
61
|
-
outline: c(opts.neutralVariant, 10)
|
|
87
|
+
outline: c(opts.neutralVariant, 10),
|
|
88
|
+
'outline-variant': c(opts.neutralVariant, 90),
|
|
89
|
+
// https://material.io/blog/tone-based-surface-color-m3
|
|
90
|
+
'surface-dim': c(opts.neutral, 90),
|
|
91
|
+
surface: c(opts.neutral, 90),
|
|
92
|
+
'surface-bright': c(opts.neutral, 90),
|
|
93
|
+
'surface-container-lowest': c(opts.neutral, 90),
|
|
94
|
+
'surface-container-low': c(opts.neutral, 90),
|
|
95
|
+
'surface-container': c(opts.neutral, 90),
|
|
96
|
+
'surface-container-high': c(opts.neutral, 90),
|
|
97
|
+
'surface-container-highest': c(opts.neutral, 90)
|
|
62
98
|
}
|
|
63
99
|
}
|
|
64
100
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/ThemeExplorer/makeColorScheme.tsx"],"names":["hexFromArgb","makeColorScheme","opts","c","palette","tone","primary","secondary","tertiary","error","background","neutral","surface","neutralVariant","outline","on","modes","dark"],"mappings":"AACA,SAASA,WAAT,QAA4B,oCAA5B,C,CAAkE;;AAElE,OAAO,SAASC,eAAT,CAAyBC,IAAzB,EAOJ;AACD,WAASC,CAAT,CAAWC,OAAX,EAAkCC,IAAlC,EAAgD;AAC9C,WAAOL,WAAW,CAACI,OAAO,CAACC,IAAR,CAAaA,IAAb,CAAD,CAAlB;AACD;;AAED,SAAO;AACLC,IAAAA,OAAO,EAAEH,CAAC,CAACD,IAAI,CAACI,OAAN,EAAe,EAAf,CADL;AAELC,IAAAA,SAAS,EAAEJ,CAAC,CAACD,IAAI,C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EAAtB,CAXhB;AAYJC,QAAAA,OAAO,EAAEX,CAAC,CAACD,IAAI,CAACW,cAAN,EAAsB,EAAtB,CAZN;AAaJE,QAAAA,EAAE,EAAE;AACFT,UAAAA,OAAO,EAAEH,CAAC,CAACD,IAAI,CAACI,OAAN,EAAe,EAAf,CADR;AAEFC,UAAAA,SAAS,EAAEJ,CAAC,CAACD,IAAI,CAACK,SAAN,EAAiB,EAAjB,CAFV;AAGFC,UAAAA,QAAQ,EAAEL,CAAC,CAACD,IAAI,CAACM,QAAN,EAAgB,EAAhB,CAHT;AAIFC,UAAAA,KAAK,EAAEN,CAAC,CAACD,IAAI,CAACO,KAAN,EAAa,EAAb,CAJN;AAKF,+BAAqBN,CAAC,CAACD,IAAI,CAACI,OAAN,EAAe,EAAf,CALpB;AAMF,iCAAuBH,CAAC,CAACD,IAAI,CAACK,SAAN,EAAiB,EAAjB,CANtB;AAOF,gCAAsBJ,CAAC,CAACD,IAAI,CAACM,QAAN,EAAgB,EAAhB,CAPrB;AAQF,6BAAmBL,CAAC,CAACD,IAAI,CAACO,KAAN,EAAa,EAAb,CARlB;AASFC,UAAAA,UAAU,EAAEP,CAAC,CAACD,IAAI,CAACS,OAAN,EAAe,EAAf,CATX;AAUFC,UAAAA,OAAO,EAAET,CAAC,CAACD,IAAI,CAACS,OAAN,EAAe,EAAf,CAVR;AAWF,6BAAmBR,CAAC,CAACD,IAAI,CAACW,cAAN,EAAsB,EAAtB,CAXlB;AAYFC,UAAAA,OAAO,EAAEX,CAAC,CAACD,IAAI,CAACW,cAAN,EAAsB,EAAtB;AAZR;AAbA;AADD;AA3BF,GAAP;AA0DD","sourcesContent":["import type { TonalPalette } from '@material/material-color-utilities';\nimport { hexFromArgb } from '@material/material-color-utilities'; // eslint-disable-line import/no-unresolved\n\nexport function makeColorScheme(opts: {\n primary: TonalPalette;\n secondary: TonalPalette;\n tertiary: TonalPalette;\n error: TonalPalette;\n neutral: TonalPalette;\n neutralVariant: TonalPalette;\n}) {\n function c(palette: TonalPalette, tone: number) {\n return hexFromArgb(palette.tone(tone));\n }\n\n return {\n primary: c(opts.primary, 40),\n secondary: c(opts.secondary, 40),\n tertiary: c(opts.tertiary, 40),\n error: c(opts.error, 40),\n 'primary-container': c(opts.primary, 90),\n 'secondary-container': c(opts.secondary, 90),\n 'tertiary-container': c(opts.tertiary, 90),\n 'error-container': c(opts.error, 90),\n background: c(opts.neutral, 99),\n surface: c(opts.neutral, 99),\n 'surface-variant': c(opts.neutralVariant, 90),\n outline: c(opts.neutralVariant, 50),\n on: {\n primary: c(opts.primary, 100),\n secondary: c(opts.secondary, 100),\n tertiary: c(opts.tertiary, 100),\n error: c(opts.error, 100),\n 'primary-container': c(opts.primary, 10),\n 'secondary-container': c(opts.secondary, 10),\n 'tertiary-container': c(opts.tertiary, 10),\n 'error-container': c(opts.error, 10),\n background: c(opts.neutral, 10),\n surface: c(opts.neutral, 10),\n 'surface-variant': c(opts.neutralVariant, 30),\n outline: c(opts.neutralVariant, 95),\n },\n modes: {\n dark: {\n primary: c(opts.primary, 80),\n secondary: c(opts.secondary, 80),\n tertiary: c(opts.tertiary, 80),\n error: c(opts.error, 80),\n 'primary-container': c(opts.primary, 30),\n 'secondary-container': c(opts.secondary, 30),\n 'tertiary-container': c(opts.tertiary, 30),\n 'error-container': c(opts.error, 30),\n background: c(opts.neutral, 10),\n surface: c(opts.neutral, 10),\n 'surface-variant': c(opts.neutralVariant, 30),\n outline: c(opts.neutralVariant, 60),\n on: {\n primary: c(opts.primary, 20),\n secondary: c(opts.secondary, 20),\n tertiary: c(opts.tertiary, 20),\n error: c(opts.error, 20),\n 'primary-container': c(opts.primary, 90),\n 'secondary-container': c(opts.secondary, 90),\n 'tertiary-container': c(opts.tertiary, 90),\n 'error-container': c(opts.error, 90),\n background: c(opts.neutral, 90),\n surface: c(opts.neutral, 90),\n 'surface-variant': c(opts.neutralVariant, 80),\n outline: c(opts.neutralVariant, 10),\n },\n },\n },\n };\n}\n"],"file":"makeColorScheme.js"}
|
|
1
|
+
{"version":3,"file":"makeColorScheme.js","names":["hexFromArgb","makeColorScheme","opts","c","palette","tone","primary","secondary","tertiary","error","background","neutral","neutralVariant","outline","surface","on","modes","dark"],"sources":["../../../src/ThemeExplorer/makeColorScheme.tsx"],"sourcesContent":["import type { TonalPalette } from '@material/material-color-utilities';\r\nimport { hexFromArgb } from '@material/material-color-utilities';\r\n\r\nexport function makeColorScheme(opts: {\r\n primary: TonalPalette;\r\n secondary: TonalPalette;\r\n tertiary: TonalPalette;\r\n error: TonalPalette;\r\n neutral: TonalPalette;\r\n neutralVariant: TonalPalette;\r\n}) {\r\n function c(palette: TonalPalette, tone: number) {\r\n return hexFromArgb(palette.tone(tone));\r\n }\r\n\r\n return {\r\n primary: c(opts.primary, 40),\r\n secondary: c(opts.secondary, 40),\r\n tertiary: c(opts.tertiary, 40),\r\n error: c(opts.error, 40),\r\n 'primary-container': c(opts.primary, 90),\r\n 'secondary-container': c(opts.secondary, 90),\r\n 'tertiary-container': c(opts.tertiary, 90),\r\n 'error-container': c(opts.error, 90),\r\n background: c(opts.neutral, 98),\r\n 'surface-variant': c(opts.neutralVariant, 90),\r\n outline: c(opts.neutralVariant, 50),\r\n 'outline-variant': c(opts.neutralVariant, 80),\r\n // https://material.io/blog/tone-based-surface-color-m3\r\n 'surface-dim': c(opts.neutral, 87),\r\n surface: c(opts.neutral, 98),\r\n 'surface-bright': c(opts.neutral, 98),\r\n 'surface-container-lowest': c(opts.neutral, 100),\r\n 'surface-container-low': c(opts.neutral, 96),\r\n 'surface-container': c(opts.neutral, 94),\r\n 'surface-container-high': c(opts.neutral, 92),\r\n 'surface-container-highest': c(opts.neutral, 90),\r\n on: {\r\n primary: c(opts.primary, 100),\r\n secondary: c(opts.secondary, 100),\r\n tertiary: c(opts.tertiary, 100),\r\n error: c(opts.error, 100),\r\n 'primary-container': c(opts.primary, 10),\r\n 'secondary-container': c(opts.secondary, 10),\r\n 'tertiary-container': c(opts.tertiary, 10),\r\n 'error-container': c(opts.error, 10),\r\n background: c(opts.neutral, 10),\r\n 'surface-variant': c(opts.neutralVariant, 30),\r\n outline: c(opts.neutralVariant, 95),\r\n 'outline-variant': c(opts.neutralVariant, 10),\r\n // https://material.io/blog/tone-based-surface-color-m3\r\n 'surface-dim': c(opts.neutral, 10),\r\n surface: c(opts.neutral, 10),\r\n 'surface-bright': c(opts.neutral, 10),\r\n 'surface-container-lowest': c(opts.neutral, 10),\r\n 'surface-container-low': c(opts.neutral, 10),\r\n 'surface-container': c(opts.neutral, 10),\r\n 'surface-container-high': c(opts.neutral, 10),\r\n 'surface-container-highest': c(opts.neutral, 10),\r\n },\r\n modes: {\r\n dark: {\r\n primary: c(opts.primary, 80),\r\n secondary: c(opts.secondary, 80),\r\n tertiary: c(opts.tertiary, 80),\r\n error: c(opts.error, 80),\r\n 'primary-container': c(opts.primary, 30),\r\n 'secondary-container': c(opts.secondary, 30),\r\n 'tertiary-container': c(opts.tertiary, 30),\r\n 'error-container': c(opts.error, 30),\r\n background: c(opts.neutral, 6),\r\n 'surface-variant': c(opts.neutralVariant, 30),\r\n outline: c(opts.neutralVariant, 60),\r\n 'outline-variant': c(opts.neutralVariant, 30),\r\n // https://material.io/blog/tone-based-surface-color-m3\r\n // TODO: get the actual values from here once updated: https://github.com/material-foundation/material-color-utilities/blob/main/dart/lib/scheme/scheme.dart#L126-L156\r\n 'surface-dim': c(opts.neutral, 6),\r\n surface: c(opts.neutral, 6),\r\n 'surface-bright': c(opts.neutral, 24),\r\n 'surface-container-lowest': c(opts.neutral, 4),\r\n 'surface-container-low': c(opts.neutral, 10),\r\n 'surface-container': c(opts.neutral, 12),\r\n 'surface-container-high': c(opts.neutral, 17),\r\n 'surface-container-highest': c(opts.neutral, 22),\r\n on: {\r\n primary: c(opts.primary, 20),\r\n secondary: c(opts.secondary, 20),\r\n tertiary: c(opts.tertiary, 20),\r\n error: c(opts.error, 20),\r\n 'primary-container': c(opts.primary, 90),\r\n 'secondary-container': c(opts.secondary, 90),\r\n 'tertiary-container': c(opts.tertiary, 90),\r\n 'error-container': c(opts.error, 90),\r\n background: c(opts.neutral, 90),\r\n 'surface-variant': c(opts.neutralVariant, 80),\r\n outline: c(opts.neutralVariant, 10),\r\n 'outline-variant': c(opts.neutralVariant, 90),\r\n // https://material.io/blog/tone-based-surface-color-m3\r\n 'surface-dim': c(opts.neutral, 90),\r\n surface: c(opts.neutral, 90),\r\n 'surface-bright': c(opts.neutral, 90),\r\n 'surface-container-lowest': c(opts.neutral, 90),\r\n 'surface-container-low': c(opts.neutral, 90),\r\n 'surface-container': c(opts.neutral, 90),\r\n 'surface-container-high': c(opts.neutral, 90),\r\n 'surface-container-highest': c(opts.neutral, 90),\r\n },\r\n },\r\n },\r\n };\r\n}\r\n"],"mappings":"AACA,SAASA,WAAT,QAA4B,oCAA5B;AAEA,OAAO,SAASC,eAAT,CAAyBC,IAAzB,EAOJ;EACD,SAASC,CAAT,CAAWC,OAAX,EAAkCC,IAAlC,EAAgD;IAC9C,OAAOL,WAAW,CAACI,OAAO,CAACC,IAAR,CAAaA,IAAb,CAAD,CAAlB;EACD;;EAED,OAAO;IACLC,OAAO,EAAEH,CAAC,CAACD,IAAI,CAACI,OAAN,EAAe,EAAf,CADL;IAELC,SAAS,EAAEJ,CAAC,CAACD,IAAI,CAACK,SAAN,EAAiB,EAAjB,CAFP;IAGLC,QAAQ,EAAEL,CAAC,CAACD,IAAI,CAACM,QAAN,EAAgB,EAAhB,CAHN;IAILC,KAAK,EAAEN,CAAC,CAACD,IAAI,CAACO,KAAN,EAAa,EAAb,CAJH;IAKL,qBAAqBN,CAAC,CAACD,IAAI,CAACI,OAAN,EAAe,EAAf,CALjB;IAML,uBAAuBH,CAAC,CAACD,IAAI,CAACK,SAAN,EAAiB,EAAjB,CANnB;IAOL,sBAAsBJ,CAAC,CAACD,IAAI,CAACM,QAAN,EAAgB,EAAhB,CAPlB;IAQL,mBAAmBL,CAAC,CAACD,IAAI,CAACO,KAAN,EAAa,EAAb,CARf;IAS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AI,CAACS,OAAN,EAAe,EAAf;QArB5B;MAvBA;IADD;EA7CF,CAAP;AA+FD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { DARK_SCHEME_CLASS, LIGHT_SCHEME_CLASS, transformTheme } from '@basic-ui/dynamic-theme';
|
|
2
|
+
export function makeTailwindThemeCSS(theme) {
|
|
3
|
+
var transformedTheme = transformTheme(theme, []);
|
|
4
|
+
var _transformedTheme$col = transformedTheme.colorModes,
|
|
5
|
+
light = _transformedTheme$col.light,
|
|
6
|
+
dark = _transformedTheme$col.dark;
|
|
7
|
+
|
|
8
|
+
var parseColorMode = function parseColorMode(colors) {
|
|
9
|
+
var keys = Object.keys(colors);
|
|
10
|
+
var cssLines = []; // let css = '';
|
|
11
|
+
|
|
12
|
+
for (var _i = 0, _keys = keys; _i < _keys.length; _i++) {
|
|
13
|
+
var key = _keys[_i];
|
|
14
|
+
|
|
15
|
+
if (!key.endsWith('--rgb')) {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
cssLines.push(" " + key + ': ' + colors[key]);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return cssLines.join(';\n') + ';';
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
var bodySelector = "body";
|
|
26
|
+
var lightThemeSelector = ['' + bodySelector, '' + bodySelector + '.' + LIGHT_SCHEME_CLASS, '' + bodySelector + ' .' + LIGHT_SCHEME_CLASS].join(',\n');
|
|
27
|
+
var darkThemeSelector = ['' + bodySelector + '.' + DARK_SCHEME_CLASS, '' + bodySelector + ' .' + DARK_SCHEME_CLASS].join(',\n');
|
|
28
|
+
return "".concat(lightThemeSelector, " {\n").concat(parseColorMode(light), "\n}\n").concat(darkThemeSelector, " {\n").concat(parseColorMode(dark), "\n}");
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=makeTailwindTheme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"makeTailwindTheme.js","names":["DARK_SCHEME_CLASS","LIGHT_SCHEME_CLASS","transformTheme","makeTailwindThemeCSS","theme","transformedTheme","colorModes","light","dark","parseColorMode","colors","keys","Object","cssLines","key","endsWith","push","join","bodySelector","lightThemeSelector","darkThemeSelector"],"sources":["../../../src/ThemeExplorer/makeTailwindTheme.ts"],"sourcesContent":["import {\r\n DARK_SCHEME_CLASS,\r\n LIGHT_SCHEME_CLASS,\r\n transformTheme,\r\n} from '@basic-ui/dynamic-theme';\r\n\r\nimport type { Theme } from '../theme/theme';\r\n\r\nexport function makeTailwindThemeCSS(theme: Theme) {\r\n const transformedTheme = transformTheme(theme, []);\r\n const { light, dark } = transformedTheme.colorModes;\r\n\r\n const parseColorMode = (colors: Record<string, string>) => {\r\n const keys = Object.keys(colors);\r\n const cssLines: string[] = [];\r\n // let css = '';\r\n for (const key of keys) {\r\n if (!key.endsWith('--rgb')) {\r\n continue;\r\n }\r\n\r\n cssLines.push(` ` + key + ': ' + colors[key]);\r\n }\r\n return cssLines.join(';\\n') + ';';\r\n };\r\n\r\n const bodySelector = `body`;\r\n const lightThemeSelector = [\r\n '' + bodySelector,\r\n '' + bodySelector + '.' + LIGHT_SCHEME_CLASS,\r\n '' + bodySelector + ' .' + LIGHT_SCHEME_CLASS,\r\n ].join(',\\n');\r\n const darkThemeSelector = [\r\n '' + bodySelector + '.' + DARK_SCHEME_CLASS,\r\n '' + bodySelector + ' .' + DARK_SCHEME_CLASS,\r\n ].join(',\\n');\r\n\r\n return `${lightThemeSelector} {\r\n${parseColorMode(light)}\r\n}\r\n${darkThemeSelector} {\r\n${parseColorMode(dark)}\r\n}`;\r\n}\r\n"],"mappings":"AAAA,SACEA,iBADF,EAEEC,kBAFF,EAGEC,cAHF,QAIO,yBAJP;AAQA,OAAO,SAASC,oBAAT,CAA8BC,KAA9B,EAA4C;EACjD,IAAMC,gBAAgB,GAAGH,cAAc,CAACE,KAAD,EAAQ,EAAR,CAAvC;EACA,4BAAwBC,gBAAgB,CAACC,UAAzC;EAAA,IAAQC,KAAR,yBAAQA,KAAR;EAAA,IAAeC,IAAf,yBAAeA,IAAf;;EAEA,IAAMC,cAAc,GAAG,SAAjBA,cAAiB,CAACC,MAAD,EAAoC;IACzD,IAAMC,IAAI,GAAGC,MAAM,CAACD,IAAP,CAAYD,MAAZ,CAAb;IACA,IAAMG,QAAkB,GAAG,EAA3B,CAFyD,CAGzD;;IACA,yBAAkBF,IAAlB,2BAAwB;MAAnB,IAAMG,GAAG,YAAT;;MACH,IAAI,CAACA,GAAG,CAACC,QAAJ,CAAa,OAAb,CAAL,EAA4B;QAC1B;MACD;;MAEDF,QAAQ,CAACG,IAAT,CAAc,OAAOF,GAAP,GAAa,IAAb,GAAoBJ,MAAM,CAACI,GAAD,CAAxC;IACD;;IACD,OAAOD,QAAQ,CAACI,IAAT,CAAc,KAAd,IAAuB,GAA9B;EACD,CAZD;;EAcA,IAAMC,YAAY,SAAlB;EACA,IAAMC,kBAAkB,GAAG,CACzB,KAAKD,YADoB,EAEzB,KAAKA,YAAL,GAAoB,GAApB,GAA0BjB,kBAFD,EAGzB,KAAKiB,YAAL,GAAoB,IAApB,GAA2BjB,kBAHF,EAIzBgB,IAJyB,CAIpB,KAJoB,CAA3B;EAKA,IAAMG,iBAAiB,GAAG,CACxB,KAAKF,YAAL,GAAoB,GAApB,GAA0BlB,iBADF,EAExB,KAAKkB,YAAL,GAAoB,IAApB,GAA2BlB,iBAFH,EAGxBiB,IAHwB,CAGnB,KAHmB,CAA1B;EAKA,iBAAUE,kBAAV,iBACAV,cAAc,CAACF,KAAD,CADd,kBAGAa,iBAHA,iBAIAX,cAAc,CAACD,IAAD,CAJd;AAMD"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
+
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
5
|
+
var _require = require('fs'),
|
|
6
|
+
writeFileSync = _require.writeFileSync; // This file auto generates our googleFonts.ts file
|
|
7
|
+
// You can generate an API key from here
|
|
8
|
+
// https://developers.google.com/fonts/docs/developer_api#APIKey
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
var API_KEY = process.env.GOOGLE_FONTS_API_KEY;
|
|
12
|
+
|
|
13
|
+
function main() {
|
|
14
|
+
return _main.apply(this, arguments);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function _main() {
|
|
18
|
+
_main = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
19
|
+
var res, json, fonts, str;
|
|
20
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
21
|
+
while (1) {
|
|
22
|
+
switch (_context.prev = _context.next) {
|
|
23
|
+
case 0:
|
|
24
|
+
_context.next = 2;
|
|
25
|
+
return fetch("https://content-webfonts.googleapis.com/v1/webfonts?sort=POPULARITY&key=".concat(API_KEY));
|
|
26
|
+
|
|
27
|
+
case 2:
|
|
28
|
+
res = _context.sent;
|
|
29
|
+
_context.next = 5;
|
|
30
|
+
return res.json();
|
|
31
|
+
|
|
32
|
+
case 5:
|
|
33
|
+
json = _context.sent;
|
|
34
|
+
|
|
35
|
+
if (!json.error) {
|
|
36
|
+
_context.next = 9;
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
console.error(json.error);
|
|
41
|
+
return _context.abrupt("return");
|
|
42
|
+
|
|
43
|
+
case 9:
|
|
44
|
+
fonts = json.items.map(function (item) {
|
|
45
|
+
return item.family;
|
|
46
|
+
});
|
|
47
|
+
str = '';
|
|
48
|
+
str += "// THIS FILE WAS AUTOGENERATED BY updateGoogleFonts.js\n";
|
|
49
|
+
str += "// TO UPDATE IT RUN THE FOLLOWING WITH Node.js v18+\n";
|
|
50
|
+
str += "// GOOGLE_FONTS_API_KEY=\"<SECRET>\" node updateGoogleFonts.js";
|
|
51
|
+
str += "\n\n/* eslint-disable prettier/prettier */\n";
|
|
52
|
+
str += "export const googleFonts = [\n";
|
|
53
|
+
str += fonts.map(function (f) {
|
|
54
|
+
return ' ' + JSON.stringify(f);
|
|
55
|
+
}).join(',\n');
|
|
56
|
+
str += '\n];\n';
|
|
57
|
+
writeFileSync('./googleFonts.ts', str, 'utf-8');
|
|
58
|
+
|
|
59
|
+
case 19:
|
|
60
|
+
case "end":
|
|
61
|
+
return _context.stop();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}, _callee);
|
|
65
|
+
}));
|
|
66
|
+
return _main.apply(this, arguments);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
main();
|
|
70
|
+
//# sourceMappingURL=updateGoogleFonts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateGoogleFonts.js","names":["require","writeFileSync","API_KEY","process","env","GOOGLE_FONTS_API_KEY","main","fetch","res","json","error","console","fonts","items","map","item","family","str","f","JSON","stringify","join"],"sources":["../../../src/ThemeExplorer/updateGoogleFonts.js"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/no-var-requires\r\nconst { writeFileSync } = require('fs');\r\n\r\n// This file auto generates our googleFonts.ts file\r\n\r\n// You can generate an API key from here\r\n// https://developers.google.com/fonts/docs/developer_api#APIKey\r\nconst API_KEY = process.env.GOOGLE_FONTS_API_KEY;\r\n\r\nasync function main() {\r\n const res = await fetch(\r\n `https://content-webfonts.googleapis.com/v1/webfonts?sort=POPULARITY&key=${API_KEY}`\r\n );\r\n\r\n const json = await res.json();\r\n if (json.error) {\r\n console.error(json.error);\r\n return;\r\n }\r\n const fonts = json.items.map((item) => item.family);\r\n let str = '';\r\n str += `// THIS FILE WAS AUTOGENERATED BY updateGoogleFonts.js\\n`;\r\n str += `// TO UPDATE IT RUN THE FOLLOWING WITH Node.js v18+\\n`;\r\n str += `// GOOGLE_FONTS_API_KEY=\"<SECRET>\" node updateGoogleFonts.js`;\r\n str += `\\n\\n/* eslint-disable prettier/prettier */\\n`;\r\n str += `export const googleFonts = [\\n`;\r\n str += fonts.map((f) => ' ' + JSON.stringify(f)).join(',\\n');\r\n str += '\\n];\\n';\r\n\r\n writeFileSync('./googleFonts.ts', str, 'utf-8');\r\n}\r\n\r\nmain();\r\n"],"mappings":";;;AAAA;AACA,eAA0BA,OAAO,CAAC,IAAD,CAAjC;AAAA,IAAQC,aAAR,YAAQA,aAAR,C,CAEA;AAEA;AACA;;;AACA,IAAMC,OAAO,GAAGC,OAAO,CAACC,GAAR,CAAYC,oBAA5B;;SAEeC,I;;;;;mEAAf;IAAA;IAAA;MAAA;QAAA;UAAA;YAAA;YAAA,OACoBC,KAAK,mFACsDL,OADtD,EADzB;;UAAA;YACQM,GADR;YAAA;YAAA,OAKqBA,GAAG,CAACC,IAAJ,EALrB;;UAAA;YAKQA,IALR;;YAAA,KAMMA,IAAI,CAACC,KANX;cAAA;cAAA;YAAA;;YAOIC,OAAO,CAACD,KAAR,CAAcD,IAAI,CAACC,KAAnB;YAPJ;;UAAA;YAUQE,KAVR,GAUgBH,IAAI,CAACI,KAAL,CAAWC,GAAX,CAAe,UAACC,IAAD;cAAA,OAAUA,IAAI,CAACC,MAAf;YAAA,CAAf,CAVhB;YAWMC,GAXN,GAWY,EAXZ;YAYEA,GAAG,8DAAH;YACAA,GAAG,2DAAH;YACAA,GAAG,oEAAH;YACAA,GAAG,kDAAH;YACAA,GAAG,oCAAH;YACAA,GAAG,IAAIL,KAAK,CAACE,GAAN,CAAU,UAACI,CAAD;cAAA,OAAO,OAAOC,IAAI,CAACC,SAAL,CAAeF,CAAf,CAAd;YAAA,CAAV,EAA2CG,IAA3C,CAAgD,KAAhD,CAAP;YACAJ,GAAG,IAAI,QAAP;YAEAhB,aAAa,CAAC,kBAAD,EAAqBgB,GAArB,EAA0B,OAA1B,CAAb;;UApBF;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,C;;;;AAuBAX,IAAI"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { TonalPalette } from '@material/material-color-utilities';
|
|
2
|
-
import type { Color } from '@basic-ui/color-picker';
|
|
3
|
-
export declare function useDeferredColor(key: string, fallbackValue: TonalPalette): [Color | null, TonalPalette, (c: Color | null) => void];
|
|
1
|
+
import { TonalPalette } from '@material/material-color-utilities';
|
|
2
|
+
import type { Color } from '@basic-ui/color-picker';
|
|
3
|
+
export declare function useDeferredColor(key: string, fallbackValue: TonalPalette): [Color | null, TonalPalette, (c: Color | null) => void];
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import { useMemo
|
|
3
|
-
import { TonalPalette, argbFromHex } from '@material/material-color-utilities';
|
|
4
|
-
|
|
5
|
-
import { useLocalStorageCachedState } from './useLocalStorageCachedState'; // import './styles.css';
|
|
6
|
-
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { TonalPalette, argbFromHex } from '@material/material-color-utilities';
|
|
4
|
+
import { useLocalStorageCachedState } from './useLocalStorageCachedState';
|
|
7
5
|
export function useDeferredColor(key, fallbackValue) {
|
|
8
|
-
var _useLocalStorageCache = useLocalStorageCachedState('theme-builder.' + key
|
|
6
|
+
var _useLocalStorageCache = useLocalStorageCachedState(null, 'theme-builder.' + key),
|
|
9
7
|
_useLocalStorageCache2 = _slicedToArray(_useLocalStorageCache, 2),
|
|
10
8
|
color = _useLocalStorageCache2[0],
|
|
11
9
|
setColor = _useLocalStorageCache2[1];
|
|
12
10
|
|
|
13
|
-
var deferredColor = useDeferredValue(color);
|
|
14
11
|
var colorTonal = useMemo(function () {
|
|
15
|
-
return
|
|
16
|
-
}, [
|
|
12
|
+
return color !== null && color !== void 0 && color.hex ? TonalPalette.fromInt(argbFromHex(color.hex)) : fallbackValue;
|
|
13
|
+
}, [color === null || color === void 0 ? void 0 : color.hex, fallbackValue]);
|
|
17
14
|
return [color, colorTonal, setColor];
|
|
18
15
|
}
|
|
19
16
|
//# sourceMappingURL=useDeferredColor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"useDeferredColor.js","names":["useMemo","TonalPalette","argbFromHex","useLocalStorageCachedState","useDeferredColor","key","fallbackValue","color","setColor","colorTonal","hex","fromInt"],"sources":["../../../src/ThemeExplorer/useDeferredColor.tsx"],"sourcesContent":["import { useMemo } from 'react';\r\nimport { TonalPalette, argbFromHex } from '@material/material-color-utilities';\r\nimport type { Color } from '@basic-ui/color-picker';\r\n\r\nimport { useLocalStorageCachedState } from './useLocalStorageCachedState';\r\n\r\nexport function useDeferredColor(\r\n key: string,\r\n fallbackValue: TonalPalette\r\n): [Color | null, TonalPalette, (c: Color | null) => void] {\r\n const [color, setColor] = useLocalStorageCachedState<Color | null>(\r\n null,\r\n 'theme-builder.' + key\r\n );\r\n const colorTonal = useMemo(\r\n () =>\r\n color?.hex ? TonalPalette.fromInt(argbFromHex(color.hex)) : fallbackValue,\r\n [color?.hex, fallbackValue]\r\n );\r\n return [color, colorTonal, setColor];\r\n}\r\n"],"mappings":";AAAA,SAASA,OAAT,QAAwB,OAAxB;AACA,SAASC,YAAT,EAAuBC,WAAvB,QAA0C,oCAA1C;AAGA,SAASC,0BAAT,QAA2C,8BAA3C;AAEA,OAAO,SAASC,gBAAT,CACLC,GADK,EAELC,aAFK,EAGoD;EACzD,4BAA0BH,0BAA0B,CAClD,IADkD,EAElD,mBAAmBE,GAF+B,CAApD;EAAA;EAAA,IAAOE,KAAP;EAAA,IAAcC,QAAd;;EAIA,IAAMC,UAAU,GAAGT,OAAO,CACxB;IAAA,OACEO,KAAK,SAAL,IAAAA,KAAK,WAAL,IAAAA,KAAK,CAAEG,GAAP,GAAaT,YAAY,CAACU,OAAb,CAAqBT,WAAW,CAACK,KAAK,CAACG,GAAP,CAAhC,CAAb,GAA4DJ,aAD9D;EAAA,CADwB,EAGxB,CAACC,KAAD,aAACA,KAAD,uBAACA,KAAK,CAAEG,GAAR,EAAaJ,aAAb,CAHwB,CAA1B;EAKA,OAAO,CAACC,KAAD,EAAQE,UAAR,EAAoBD,QAApB,CAAP;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function useLocalStorageCachedState<T>(
|
|
1
|
+
export declare function useLocalStorageCachedState<T>(initialValue: T, key: string): [T, (c: T) => void];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import { useCallback, useState } from 'react';
|
|
3
|
-
export function useLocalStorageCachedState(
|
|
3
|
+
export function useLocalStorageCachedState(initialValue, key) {
|
|
4
4
|
var _useState = useState(function () {
|
|
5
5
|
return JSON.parse(localStorage.getItem(key) || 'null') || initialValue;
|
|
6
6
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"useLocalStorageCachedState.js","names":["useCallback","useState","useLocalStorageCachedState","initialValue","key","JSON","parse","localStorage","getItem","state","_setState","setState","c","setItem","stringify"],"sources":["../../../src/ThemeExplorer/useLocalStorageCachedState.ts"],"sourcesContent":["import { useCallback, useState } from 'react';\r\n\r\nexport function useLocalStorageCachedState<T>(\r\n initialValue: T,\r\n key: string\r\n): [T, (c: T) => void] {\r\n const [state, _setState] = useState<T>(\r\n () => JSON.parse(localStorage.getItem(key) || 'null') || initialValue\r\n );\r\n const setState = useCallback(\r\n (c: T): void => {\r\n _setState(c);\r\n localStorage.setItem(key, JSON.stringify(c));\r\n },\r\n [key]\r\n );\r\n return [state, setState];\r\n}\r\n"],"mappings":";AAAA,SAASA,WAAT,EAAsBC,QAAtB,QAAsC,OAAtC;AAEA,OAAO,SAASC,0BAAT,CACLC,YADK,EAELC,GAFK,EAGgB;EACrB,gBAA2BH,QAAQ,CACjC;IAAA,OAAMI,IAAI,CAACC,KAAL,CAAWC,YAAY,CAACC,OAAb,CAAqBJ,GAArB,KAA6B,MAAxC,KAAmDD,YAAzD;EAAA,CADiC,CAAnC;EAAA;EAAA,IAAOM,KAAP;EAAA,IAAcC,SAAd;;EAGA,IAAMC,QAAQ,GAAGX,WAAW,CAC1B,UAACY,CAAD,EAAgB;IACdF,SAAS,CAACE,CAAD,CAAT;;IACAL,YAAY,CAACM,OAAb,CAAqBT,GAArB,EAA0BC,IAAI,CAACS,SAAL,CAAeF,CAAf,CAA1B;EACD,CAJyB,EAK1B,CAACR,GAAD,CAL0B,CAA5B;EAOA,OAAO,CAACK,KAAD,EAAQE,QAAR,CAAP;AACD"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { PopperProps } from '@basic-ui/core';
|
|
2
|
-
import
|
|
3
|
-
import type { BoxProps } from '../Box';
|
|
4
|
-
export interface TooltipProps extends BoxProps, Omit<PopperProps, 'color' | 'anchorEl'> {
|
|
5
|
-
label:
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare const Tooltip:
|
|
1
|
+
import type { PopperProps } from '@basic-ui/core';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import type { BoxProps } from '../Box';
|
|
4
|
+
export interface TooltipProps extends BoxProps, Omit<PopperProps, 'color' | 'anchorEl'> {
|
|
5
|
+
label: ReactNode;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const Tooltip: import("react").ForwardRefExoticComponent<Pick<TooltipProps, "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "backgroundColor" | "backgroundImage" | "backgroundPosition" | "backgroundRepeat" | "backgroundSize" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "bottom" | "color" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflowX" | "overflowY" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "textAlign" | "textShadow" | "top" | "translate" | "verticalAlign" | "width" | "background" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderStyle" | "borderTop" | "borderWidth" | "flex" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bg" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "label" | "slot" | "style" | "title" | "hidden" | "as" | "sx" | "__css" | "variant" | "tx" | "theme" | "size" | "borderX" | "borderY" | "gridGap" | "gridColumnGap" | "gridRowGap" | "disabled" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "innerAs" | "placement" | "strategy" | "modifiers" | "usePortal" | "portalSelector" | "skidding" | "distance" | "offsetFn" | "arrowPadding"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["placement", "children", "label", "__css"];
|
|
3
4
|
import { Tooltip as _BaseTooltip, Popper } from '@basic-ui/core';
|
|
4
|
-
import
|
|
5
|
+
import { forwardRef } from 'react';
|
|
5
6
|
import { Box } from '../Box';
|
|
6
7
|
import { alpha } from '../color';
|
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -9,27 +10,40 @@ var BaseTooltip = _BaseTooltip;
|
|
|
9
10
|
export var Tooltip = /*#__PURE__*/forwardRef(function Tooltip(props, forwardedRef) {
|
|
10
11
|
var _props$placement = props.placement,
|
|
11
12
|
placement = _props$placement === void 0 ? 'bottom' : _props$placement,
|
|
13
|
+
children = props.children,
|
|
14
|
+
label = props.label,
|
|
12
15
|
__css = props.__css,
|
|
13
|
-
otherProps = _objectWithoutProperties(props,
|
|
16
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
14
17
|
|
|
15
|
-
|
|
18
|
+
var cssStyle = _extends({
|
|
19
|
+
variant: ['text.body-medium', 'text.body-small'],
|
|
20
|
+
bg: alpha('#616161', 0.9),
|
|
21
|
+
color: '#fff',
|
|
22
|
+
px: 2,
|
|
23
|
+
py: 1,
|
|
24
|
+
borderRadius: 'extra-small',
|
|
25
|
+
zIndex: 'tooltip'
|
|
26
|
+
}, __css);
|
|
27
|
+
|
|
28
|
+
if (!children) {
|
|
29
|
+
return /*#__PURE__*/_jsx(Box, _extends(_extends({
|
|
30
|
+
ref: forwardedRef,
|
|
31
|
+
__css: cssStyle
|
|
32
|
+
}, otherProps), {}, {
|
|
33
|
+
children: label
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return /*#__PURE__*/_jsx(BaseTooltip, _extends(_extends({
|
|
16
38
|
as: Popper,
|
|
17
39
|
innerAs: Box,
|
|
18
40
|
ref: forwardedRef,
|
|
19
41
|
placement: placement,
|
|
20
42
|
distance: 8,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
fontWeight: 'regular',
|
|
27
|
-
lineHeight: [1.2, 1.2, 1.33],
|
|
28
|
-
px: [3, 3, 2],
|
|
29
|
-
py: [2, 2, 1],
|
|
30
|
-
borderRadius: '4px',
|
|
31
|
-
zIndex: 'tooltip'
|
|
32
|
-
}, __css)
|
|
33
|
-
}, otherProps));
|
|
43
|
+
label: label,
|
|
44
|
+
__css: cssStyle
|
|
45
|
+
}, otherProps), {}, {
|
|
46
|
+
children: children
|
|
47
|
+
}));
|
|
34
48
|
});
|
|
35
49
|
//# sourceMappingURL=Tooltip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Tooltip.js","names":["Tooltip","_BaseTooltip","Popper","forwardRef","Box","alpha","BaseTooltip","props","forwardedRef","placement","children","label","__css","otherProps","cssStyle","variant","bg","color","px","py","borderRadius","zIndex"],"sources":["../../../src/Tooltip/Tooltip.tsx"],"sourcesContent":["import type { PopperProps } from '@basic-ui/core';\r\nimport { Tooltip as _BaseTooltip, Popper } from '@basic-ui/core';\r\nimport type { ElementType, FC, ReactNode } from 'react';\r\nimport { forwardRef } from 'react';\r\n\r\nimport type { BoxProps } from '../Box';\r\nimport { Box } from '../Box';\r\nimport { alpha } from '../color';\r\n\r\nexport interface TooltipProps\r\n extends BoxProps,\r\n Omit<PopperProps, 'color' | 'anchorEl'> {\r\n label: ReactNode;\r\n disabled?: boolean;\r\n}\r\n\r\nconst BaseTooltip: FC<\r\n BoxProps & {\r\n innerAs?: ElementType<any>;\r\n label: ReactNode;\r\n } & Omit<PopperProps, 'color' | 'anchorEl'>\r\n> = _BaseTooltip as any;\r\n\r\nexport const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(\r\n function Tooltip(props, forwardedRef) {\r\n const {\r\n placement = 'bottom',\r\n children,\r\n label,\r\n __css,\r\n ...otherProps\r\n } = props;\r\n const cssStyle = {\r\n variant: ['text.body-medium', 'text.body-small'],\r\n bg: alpha('#616161', 0.9),\r\n color: '#fff',\r\n px: 2,\r\n py: 1,\r\n borderRadius: 'extra-small',\r\n zIndex: 'tooltip',\r\n ...__css,\r\n };\r\n\r\n if (!children) {\r\n return (\r\n <Box ref={forwardedRef} __css={cssStyle} {...otherProps}>\r\n {label}\r\n </Box>\r\n );\r\n }\r\n\r\n return (\r\n <BaseTooltip\r\n as={Popper}\r\n innerAs={Box}\r\n ref={forwardedRef}\r\n placement={placement}\r\n distance={8}\r\n label={label}\r\n __css={cssStyle}\r\n {...otherProps}\r\n >\r\n {children}\r\n </BaseTooltip>\r\n );\r\n }\r\n);\r\n"],"mappings":";;;AACA,SAASA,OAAO,IAAIC,YAApB,EAAkCC,MAAlC,QAAgD,gBAAhD;AAEA,SAASC,UAAT,QAA2B,OAA3B;AAGA,SAASC,GAAT,QAAoB,QAApB;AACA,SAASC,KAAT,QAAsB,UAAtB;;AASA,IAAMC,WAKL,GAAGL,YALJ;AAOA,OAAO,IAAMD,OAAO,gBAAGG,UAAU,CAC/B,SAASH,OAAT,CAAiBO,KAAjB,EAAwBC,YAAxB,EAAsC;EACpC,uBAMID,KANJ,CACEE,SADF;EAAA,IACEA,SADF,iCACc,QADd;EAAA,IAEEC,QAFF,GAMIH,KANJ,CAEEG,QAFF;EAAA,IAGEC,KAHF,GAMIJ,KANJ,CAGEI,KAHF;EAAA,IAIEC,KAJF,GAMIL,KANJ,CAIEK,KAJF;EAAA,IAKKC,UALL,4BAMIN,KANJ;;EAOA,IAAMO,QAAQ;IACZC,OAAO,EAAE,CAAC,kBAAD,EAAqB,iBAArB,CADG;IAEZC,EAAE,EAAEX,KAAK,CAAC,SAAD,EAAY,GAAZ,CAFG;IAGZY,KAAK,EAAE,MAHK;IAIZC,EAAE,EAAE,CAJQ;IAKZC,EAAE,EAAE,CALQ;IAMZC,YAAY,EAAE,aANF;IAOZC,MAAM,EAAE;EAPI,GAQTT,KARS,CAAd;;EAWA,IAAI,CAACF,QAAL,EAAe;IACb,oBACE,KAAC,GAAD;MAAK,GAAG,EAAEF,YAAV;MAAwB,KAAK,EAAEM;IAA/B,GAA6CD,UAA7C;MAAA,UACGF;IADH,GADF;EAKD;;EAED,oBACE,KAAC,WAAD;IACE,EAAE,EAAET,MADN;IAEE,OAAO,EAAEE,GAFX;IAGE,GAAG,EAAEI,YAHP;IAIE,SAAS,EAAEC,SAJb;IAKE,QAAQ,EAAE,CALZ;IAME,KAAK,EAAEE,KANT;IAOE,KAAK,EAAEG;EAPT,GAQMD,UARN;IAAA,UAUGH;EAVH,GADF;AAcD,CA1C8B,CAA1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './Tooltip';
|
|
1
|
+
export * from './Tooltip';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/Tooltip/index.ts"],"sourcesContent":["export * from './Tooltip';\r\n"],"mappings":"AAAA,cAAc,WAAd"}
|
package/build/esm/color.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import type { SystemStyleObject } from '@styled-system/css';
|
|
2
|
-
import type { Theme } from './theme';
|
|
3
|
-
export declare const alpha: (colorString: string, alphaValue: number) => (theme: any) =>
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function
|
|
1
|
+
import type { SystemStyleObject } from '@styled-system/css';
|
|
2
|
+
import type { Theme } from './theme';
|
|
3
|
+
export declare const alpha: (colorString: string, alphaValue: number) => (theme: any) => any;
|
|
4
|
+
export declare function mixColor(baseColor: string, overlayColor: string): (theme: any) => string;
|
|
5
|
+
export declare function mixColor(baseColor: string, overlayColor: string, overlayOpacity: number): (theme: any) => string;
|
|
6
|
+
export declare function getColorOverlay(theme: Theme, baseColor: string, overlayColor: string, overlayOpacity: number): SystemStyleObject;
|
|
7
|
+
export declare function getBackgroundOverlay(theme: Theme, backgroundOverlay: number | string, overlayColor?: string): SystemStyleObject;
|
|
8
|
+
export declare function getDarkThemeBackgroundOverlay(theme: Theme, backgroundOverlay: number | string, overlayColor?: string): SystemStyleObject;
|
package/build/esm/color.js
CHANGED
|
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import { get } from '@styled-system/css';
|
|
4
4
|
import { parseToRgb } from 'polished';
|
|
5
|
-
import {
|
|
5
|
+
import { DARK_SCHEME_CLASS } from '@basic-ui/dynamic-theme';
|
|
6
6
|
export var alpha = function alpha(colorString, alphaValue) {
|
|
7
7
|
return function (theme) {
|
|
8
8
|
var color = get(theme, 'colors.' + colorString, colorString);
|
|
@@ -13,15 +13,24 @@ export var alpha = function alpha(colorString, alphaValue) {
|
|
|
13
13
|
return "rgba(".concat(_color, ",").concat(alphaValue, ")");
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
if (color.startsWith('rgba(')) {
|
|
17
|
+
return color;
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
var rgb = parseToRgb(color);
|
|
17
21
|
return "rgba(".concat(rgb.red, ",").concat(rgb.green, ",").concat(rgb.blue, ",").concat(alphaValue, ")");
|
|
18
22
|
};
|
|
19
23
|
};
|
|
24
|
+
export function mixColor(baseColor, overlayColor, overlayOpacity) {
|
|
25
|
+
return function (theme) {
|
|
26
|
+
baseColor = get(theme, "colors.".concat(baseColor), baseColor);
|
|
27
|
+
overlayColor = overlayOpacity ? alpha(overlayColor, overlayOpacity)(theme) : get(theme, "colors.".concat(overlayColor), overlayColor);
|
|
28
|
+
return "linear-gradient(".concat(overlayColor, ", ").concat(overlayColor, "), ").concat(baseColor);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
20
31
|
export function getColorOverlay(theme, baseColor, overlayColor, overlayOpacity) {
|
|
21
|
-
baseColor = get(theme, "colors.".concat(baseColor)) || baseColor;
|
|
22
|
-
overlayColor = alpha(overlayColor, overlayOpacity)(theme);
|
|
23
32
|
return {
|
|
24
|
-
background:
|
|
33
|
+
background: mixColor(baseColor, overlayColor, overlayOpacity)(theme)
|
|
25
34
|
};
|
|
26
35
|
}
|
|
27
36
|
export function getBackgroundOverlay(theme, backgroundOverlay) {
|
|
@@ -41,6 +50,6 @@ export function getDarkThemeBackgroundOverlay(theme, backgroundOverlay) {
|
|
|
41
50
|
return {};
|
|
42
51
|
}
|
|
43
52
|
|
|
44
|
-
return _defineProperty({}, ".".concat(
|
|
53
|
+
return _defineProperty({}, ".".concat(DARK_SCHEME_CLASS, " &, &.").concat(DARK_SCHEME_CLASS), _extends({}, getBackgroundOverlay(theme, backgroundOverlay, overlayColor)));
|
|
45
54
|
}
|
|
46
55
|
//# sourceMappingURL=color.js.map
|
package/build/esm/color.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"color.js","names":["get","parseToRgb","DARK_SCHEME_CLASS","alpha","colorString","alphaValue","theme","color","startsWith","rgb","red","green","blue","mixColor","baseColor","overlayColor","overlayOpacity","getColorOverlay","background","getBackgroundOverlay","backgroundOverlay","Number","overlay","getDarkThemeBackgroundOverlay"],"sources":["../../src/color.ts"],"sourcesContent":["import type { SystemStyleObject } from '@styled-system/css';\nimport { get } from '@styled-system/css';\nimport { parseToRgb } from 'polished';\nimport { DARK_SCHEME_CLASS } from '@basic-ui/dynamic-theme';\n\nimport type { Theme } from './theme';\n\nexport const alpha =\n (colorString: string, alphaValue: number) => (theme: any) => {\n const color = get(theme, 'colors.' + colorString, colorString);\n if (color.startsWith('var')) {\n const color = get(theme, 'colors.' + colorString + '_rgb', colorString);\n return `rgba(${color},${alphaValue})`;\n }\n if (color.startsWith('rgba(')) {\n return color;\n }\n\n const rgb = parseToRgb(color);\n return `rgba(${rgb.red},${rgb.green},${rgb.blue},${alphaValue})`;\n };\n\nexport function mixColor(\n baseColor: string,\n overlayColor: string\n): (theme: any) => string;\nexport function mixColor(\n baseColor: string,\n overlayColor: string,\n overlayOpacity: number\n): (theme: any) => string;\nexport function mixColor(\n baseColor: string,\n overlayColor: string,\n overlayOpacity?: number\n): (theme: any) => string {\n return (theme) => {\n baseColor = get(theme, `colors.${baseColor}`, baseColor);\n overlayColor = overlayOpacity\n ? alpha(overlayColor, overlayOpacity)(theme)\n : get(theme, `colors.${overlayColor}`, overlayColor);\n\n return `linear-gradient(${overlayColor}, ${overlayColor}), ${baseColor}`;\n };\n}\n\nexport function getColorOverlay(\n theme: Theme,\n baseColor: string,\n overlayColor: string,\n overlayOpacity: number\n): SystemStyleObject {\n return {\n background: mixColor(baseColor, overlayColor, overlayOpacity)(theme),\n };\n}\n\nexport function getBackgroundOverlay(\n theme: Theme,\n backgroundOverlay: number | string,\n overlayColor = 'on.surface'\n): SystemStyleObject {\n if (Number(backgroundOverlay) <= 0) {\n return {};\n }\n const overlay = get(theme, `paper.overlays.${backgroundOverlay}`) || 0;\n return getColorOverlay(theme, 'surface', overlayColor, overlay);\n}\n\nexport function getDarkThemeBackgroundOverlay(\n theme: Theme,\n backgroundOverlay: number | string,\n overlayColor = 'on.surface'\n): SystemStyleObject {\n if (Number(backgroundOverlay) <= 0) {\n return {};\n }\n\n return {\n [`.${DARK_SCHEME_CLASS} &, &.${DARK_SCHEME_CLASS}`]: {\n ...getBackgroundOverlay(theme, backgroundOverlay, overlayColor),\n },\n };\n}\n"],"mappings":";;AACA,SAASA,GAAT,QAAoB,oBAApB;AACA,SAASC,UAAT,QAA2B,UAA3B;AACA,SAASC,iBAAT,QAAkC,yBAAlC;AAIA,OAAO,IAAMC,KAAK,GAChB,SADWA,KACX,CAACC,WAAD,EAAsBC,UAAtB;EAAA,OAA6C,UAACC,KAAD,EAAgB;IAC3D,IAAMC,KAAK,GAAGP,GAAG,CAACM,KAAD,EAAQ,YAAYF,WAApB,EAAiCA,WAAjC,CAAjB;;IACA,IAAIG,KAAK,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OAAO,GAAGtB,GAAG,CAACM,KAAD,2BAA0Bc,iBAA1B,EAAH,IAAqD,CAArE;EACA,OAAOH,eAAe,CAACX,KAAD,EAAQ,SAAR,EAAmBS,YAAnB,EAAiCO,OAAjC,CAAtB;AACD;AAED,OAAO,SAASC,6BAAT,CACLjB,KADK,EAELc,iBAFK,EAIc;EAAA,IADnBL,YACmB,uEADJ,YACI;;EACnB,IAAIM,MAAM,CAACD,iBAAD,CAAN,IAA6B,CAAjC,EAAoC;IAClC,OAAO,EAAP;EACD;;EAED,sCACOlB,iBADP,mBACiCA,iBADjC,gBAEOiB,oBAAoB,CAACb,KAAD,EAAQc,iBAAR,EAA2BL,YAA3B,CAF3B;AAKD"}
|
package/build/esm/css.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '@styled-system/css';
|
|
1
|
+
export * from '@styled-system/css';
|
package/build/esm/css.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"css.js","names":[],"sources":["../../src/css.ts"],"sourcesContent":["// eslint-disable-next-line prettier/prettier\r\nexport * from '@styled-system/css';\r\n"],"mappings":"AAAA;AACA,cAAc,oBAAd"}
|