@basic-ui/material 0.1.11 → 0.1.14
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 +33 -28
- package/build/cjs/index.js.map +1 -1
- package/build/esm/Alert/Alert.d.ts +1 -1
- package/build/esm/AppBar/AppBar.d.ts +1 -1
- package/build/esm/AppBar/AppBarButton.d.ts +1 -1
- package/build/esm/Badge/Badge.d.ts +1 -1
- package/build/esm/BottomSheet/BottomSheet.d.ts +1 -1
- package/build/esm/BottomSheet/BottomSheetSurface.d.ts +1 -1
- package/build/esm/Button/BaseButton.d.ts +1 -1
- package/build/esm/Button/Button.d.ts +1 -1
- package/build/esm/Button/FilledButton.d.ts +1 -1
- package/build/esm/Button/FloatingActionButton.d.ts +7 -0
- package/build/esm/Button/FloatingActionButton.js +8 -0
- package/build/esm/Button/FloatingActionButton.js.map +1 -0
- package/build/esm/Button/OutlinedButton.d.ts +1 -1
- package/build/esm/Button/TransparentButton.d.ts +1 -1
- package/build/esm/CheckBox/CheckBox.d.ts +1 -1
- package/build/esm/CheckBox/CheckBoxIcon.d.ts +1 -1
- package/build/esm/Chip/ButtonChip.d.ts +1 -1
- package/build/esm/Chip/ChoiceChip.d.ts +1 -1
- package/build/esm/ColorMode/ColorModeProvider.js +10 -3
- package/build/esm/ColorMode/ColorModeProvider.js.map +1 -1
- package/build/esm/Combobox/Combobox.d.ts +7 -7
- package/build/esm/Dialog/Dialog.d.ts +1 -1
- package/build/esm/Dialog/DialogBackdrop.d.ts +1 -1
- package/build/esm/Dialog/DialogSurface.d.ts +1 -1
- package/build/esm/Dialog/useDialogAnimation.js +1 -1
- package/build/esm/Dialog/useDialogAnimation.js.map +1 -1
- package/build/esm/Divider/Divider.d.ts +1 -1
- package/build/esm/LineRipple/LineRipple.d.ts +1 -1
- package/build/esm/Link/Link.d.ts +1 -1
- package/build/esm/List/List.d.ts +1 -1
- package/build/esm/ListItem/ListItem.d.ts +1 -1
- package/build/esm/Menu/Menu.d.ts +4 -4
- package/build/esm/Paper/Paper.d.ts +1 -1
- package/build/esm/RadioButton/RadioGroup.d.ts +1 -1
- package/build/esm/Ripple/keyframes.js +0 -2
- package/build/esm/Ripple/keyframes.js.map +1 -1
- package/build/esm/Ripple/useRipple.js +1 -1
- package/build/esm/Ripple/useRipple.js.map +1 -1
- package/build/esm/Select/SelectIcon.d.ts +1 -1
- package/build/esm/SelectItem/SelectItem.d.ts +1 -1
- package/build/esm/SelectionControl/SelectionControlLabel.d.ts +1 -1
- package/build/esm/SelectionControl/SelectionControlText.d.ts +1 -1
- package/build/esm/Skeleton/DelayAppearance.d.ts +1 -1
- package/build/esm/Skeleton/Skeleton.d.ts +1 -1
- package/build/esm/Snackbar/Snackbar.d.ts +1 -1
- package/build/esm/Switch/Switch.d.ts +1 -1
- package/build/esm/Tab/Tab.d.ts +1 -1
- package/build/esm/Tab/TabList.d.ts +1 -1
- package/build/esm/Tab/TabPanel.d.ts +1 -1
- package/build/esm/TabIndicator/TabIndicator.d.ts +1 -1
- package/build/esm/Table/Table.d.ts +1 -1
- package/build/esm/Table/TableHead.d.ts +1 -1
- package/build/esm/Table/TableRow.d.ts +1 -1
- package/build/esm/Text/Text.d.ts +1 -1
- package/build/esm/TextField/FilledContainer.d.ts +1 -1
- package/build/esm/TextField/HelperText.d.ts +1 -1
- package/build/esm/TextField/Input.d.ts +1 -1
- package/build/esm/TextField/OutlinedContainer.d.ts +1 -1
- package/build/esm/TextField/TextField.d.ts +1 -1
- package/build/esm/ThemeExplorer/ColorPicker.d.ts +8 -0
- package/build/esm/ThemeExplorer/ColorPicker.js +76 -0
- package/build/esm/ThemeExplorer/ColorPicker.js.map +1 -0
- package/build/esm/ThemeExplorer/TextFieldColorPicker.d.ts +9 -0
- package/build/esm/ThemeExplorer/TextFieldColorPicker.js +100 -0
- package/build/esm/ThemeExplorer/TextFieldColorPicker.js.map +1 -0
- package/build/esm/ThemeExplorer/ThemeColors.d.ts +5 -0
- package/build/esm/ThemeExplorer/ThemeColors.js +80 -0
- package/build/esm/ThemeExplorer/ThemeColors.js.map +1 -0
- package/build/esm/ThemeExplorer/components.d.ts +31 -0
- package/build/esm/ThemeExplorer/components.js +184 -0
- package/build/esm/ThemeExplorer/components.js.map +1 -0
- package/build/esm/ThemeExplorer/makeColorScheme.d.ts +66 -0
- package/build/esm/ThemeExplorer/makeColorScheme.js +66 -0
- package/build/esm/ThemeExplorer/makeColorScheme.js.map +1 -0
- package/build/esm/ThemeExplorer/useDeferredColor.d.ts +3 -0
- package/build/esm/ThemeExplorer/useDeferredColor.js +11 -0
- package/build/esm/ThemeExplorer/useDeferredColor.js.map +1 -0
- package/build/esm/ThemeExplorer/useLocalStorageCachedState.d.ts +1 -0
- package/build/esm/ThemeExplorer/useLocalStorageCachedState.js +11 -0
- package/build/esm/ThemeExplorer/useLocalStorageCachedState.js.map +1 -0
- package/build/esm/Tooltip/Tooltip.d.ts +1 -1
- package/build/esm/hooks/useAnimation.js +22 -21
- package/build/esm/hooks/useAnimation.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +54 -54
- package/package.json +3 -3
- package/src/Alert/Alert.story.tsx +5 -6
- package/src/AppBar/AppBar.story.tsx +11 -20
- package/src/BottomSheet/BottomSheet.story.tsx +5 -6
- package/src/Button/Button.story.tsx +14 -14
- package/src/Button/SpinnerButton.story.tsx +6 -6
- package/src/CheckBox/CheckBox.story.tsx +7 -6
- package/src/Chip/Chip.story.tsx +5 -7
- package/src/ColorMode/ColorModeProvider.tsx +9 -3
- package/src/Combobox/Combobox.story.tsx +12 -10
- package/src/Dialog/Dialog.story.tsx +7 -8
- package/src/Dialog/useDialogAnimation.tsx +1 -1
- package/src/Divider/Divider.story.tsx +6 -5
- package/src/FloatingLabel/FloatingLabel.story.tsx +10 -9
- package/src/LineRipple/LineRipple.story.tsx +5 -4
- package/src/Link/Link.story.tsx +3 -4
- package/src/ListItem/ListItem.story.tsx +6 -5
- package/src/Menu/Menu.story.tsx +8 -7
- package/src/NotchedOutline/NotchedOutline.story.tsx +5 -4
- package/src/Paper/Paper.story.tsx +5 -4
- package/src/ProgressSpinner/ProgressSpinner.story.tsx +5 -4
- package/src/RadioButton/RadioButton.story.tsx +12 -10
- package/src/Ripple/Ripple.story.tsx +5 -4
- package/src/Ripple/keyframes.ts +0 -2
- package/src/Ripple/useRipple.ts +3 -1
- package/src/Select/Select.story.tsx +8 -7
- package/src/Skeleton/Skeleton.story.tsx +7 -6
- package/src/Snackbar/Snackbar.story.tsx +7 -6
- package/src/Switch/Switch.story.tsx +5 -4
- package/src/Tab/Tab.story.tsx +7 -5
- package/src/Table/Table.story.tsx +5 -4
- package/src/Text/Text.story.tsx +5 -4
- package/src/TextField/TextField.story.tsx +7 -6
- package/src/Tooltip/Tooltip.story.tsx +5 -4
- package/src/hooks/useAnimation.ts +42 -32
package/build/cjs/index.js
CHANGED
|
@@ -560,16 +560,22 @@ const ColorModeProvider = props => {
|
|
|
560
560
|
}, [setColorMode]);
|
|
561
561
|
const globalStyles = react$1.useMemo(() => {
|
|
562
562
|
const ret = {
|
|
563
|
-
body:
|
|
563
|
+
body: _extends__default['default']({
|
|
564
|
+
colorScheme: 'light'
|
|
565
|
+
}, styles['default'] || {})
|
|
564
566
|
};
|
|
565
|
-
ret[`.${DEFAULT_THEME_CLASS}`] =
|
|
567
|
+
ret[`.${DEFAULT_THEME_CLASS}`] = _extends__default['default']({
|
|
568
|
+
colorScheme: 'light'
|
|
569
|
+
}, styles['default'] || {});
|
|
566
570
|
|
|
567
571
|
for (const key in styles) {
|
|
568
572
|
if (key === 'default') {
|
|
569
573
|
continue;
|
|
570
574
|
}
|
|
571
575
|
|
|
572
|
-
ret[`.${DARK_THEME_CLASS}`] =
|
|
576
|
+
ret[`.${DARK_THEME_CLASS}`] = _extends__default['default']({
|
|
577
|
+
colorScheme: 'dark'
|
|
578
|
+
}, styles[key]);
|
|
573
579
|
}
|
|
574
580
|
|
|
575
581
|
return ret;
|
|
@@ -930,11 +936,9 @@ const opacityIn = react.keyframes({
|
|
|
930
936
|
});
|
|
931
937
|
const opacityOut = react.keyframes({
|
|
932
938
|
from: {
|
|
933
|
-
transform: `translate(var(${RIPPLE_TRANSLATE_END}, 0)) scale(var(${RIPPLE_SCALE_END}, 1))`,
|
|
934
939
|
opacity: `var(${RIPPLE_OPACITY_END})`
|
|
935
940
|
},
|
|
936
941
|
to: {
|
|
937
|
-
transform: `translate(var(${RIPPLE_TRANSLATE_END}, 0)) scale(var(${RIPPLE_SCALE_END}, 1))`,
|
|
938
942
|
opacity: '0'
|
|
939
943
|
}
|
|
940
944
|
});
|
|
@@ -1063,7 +1067,7 @@ const useRipple = opts => {
|
|
|
1063
1067
|
break;
|
|
1064
1068
|
|
|
1065
1069
|
case 'leaving':
|
|
1066
|
-
animation = `${opacityOut} ${leaveDuration}ms forwards`;
|
|
1070
|
+
animation = `${radiusIn} ${enterDuration}ms forwards,` + `${opacityOut} ${leaveDuration}ms forwards`;
|
|
1067
1071
|
break;
|
|
1068
1072
|
}
|
|
1069
1073
|
|
|
@@ -1600,45 +1604,46 @@ function useAnimation(opts) {
|
|
|
1600
1604
|
open: openProp
|
|
1601
1605
|
});
|
|
1602
1606
|
const handleClose = react$1.useCallback(() => {
|
|
1603
|
-
setAnimation(animation => _extends__default['default']({}, animation, {
|
|
1607
|
+
setAnimation(animation => animation.state === 'closed' ? animation : _extends__default['default']({}, animation, {
|
|
1604
1608
|
state: 'close',
|
|
1605
1609
|
style: animationStyle.close || animationStyle.closed,
|
|
1606
1610
|
timing: closeTimeoutInMilliseconds
|
|
1607
1611
|
}));
|
|
1608
|
-
return setTimeout(() => {
|
|
1609
|
-
setAnimation({
|
|
1610
|
-
state: 'closed',
|
|
1611
|
-
style: animationStyle.closed,
|
|
1612
|
-
open: false,
|
|
1613
|
-
timing: closeTimeoutInMilliseconds
|
|
1614
|
-
});
|
|
1615
|
-
}, closeTimeoutInMilliseconds);
|
|
1616
1612
|
}, [animationStyle, closeTimeoutInMilliseconds]);
|
|
1617
1613
|
const handleOpen = react$1.useCallback(() => {
|
|
1618
|
-
setAnimation(animation => _extends__default['default']({}, animation, {
|
|
1614
|
+
setAnimation(animation => animation.state === 'open' ? animation : _extends__default['default']({}, animation, {
|
|
1619
1615
|
open: true,
|
|
1620
1616
|
state: 'opening',
|
|
1621
1617
|
style: animationStyle.opening || animationStyle.closed
|
|
1622
1618
|
}));
|
|
1623
|
-
|
|
1619
|
+
}, [animationStyle]);
|
|
1620
|
+
react$1.useEffect(() => {
|
|
1621
|
+
if (state === 'opening') {
|
|
1624
1622
|
setAnimation(animation => _extends__default['default']({}, animation, {
|
|
1625
1623
|
state: 'open',
|
|
1626
1624
|
style: animationStyle.open,
|
|
1627
1625
|
timing: openTimeoutInMilliseconds
|
|
1628
1626
|
}));
|
|
1629
|
-
}
|
|
1630
|
-
}, [animationStyle, openTimeoutInMilliseconds]);
|
|
1627
|
+
}
|
|
1628
|
+
}, [animationStyle.open, openTimeoutInMilliseconds, state]);
|
|
1629
|
+
react$1.useEffect(() => {
|
|
1630
|
+
if (state === 'close') {
|
|
1631
|
+
const timeout = setTimeout(() => {
|
|
1632
|
+
setAnimation({
|
|
1633
|
+
state: 'closed',
|
|
1634
|
+
style: animationStyle.closed,
|
|
1635
|
+
open: false,
|
|
1636
|
+
timing: closeTimeoutInMilliseconds
|
|
1637
|
+
});
|
|
1638
|
+
}, closeTimeoutInMilliseconds);
|
|
1639
|
+
return () => clearTimeout(timeout);
|
|
1640
|
+
}
|
|
1641
|
+
}, [animationStyle.closed, closeTimeoutInMilliseconds, state]);
|
|
1631
1642
|
react$1.useEffect(() => {
|
|
1632
1643
|
if (openProp) {
|
|
1633
|
-
|
|
1634
|
-
return () => {
|
|
1635
|
-
cancelAnimationFrame(frameHandler);
|
|
1636
|
-
};
|
|
1644
|
+
handleOpen();
|
|
1637
1645
|
} else {
|
|
1638
|
-
|
|
1639
|
-
return () => {
|
|
1640
|
-
clearTimeout(timeoutHandler);
|
|
1641
|
-
};
|
|
1646
|
+
handleClose();
|
|
1642
1647
|
}
|
|
1643
1648
|
}, [handleClose, handleOpen, openProp]);
|
|
1644
1649
|
return {
|
|
@@ -1661,7 +1666,7 @@ const styles = {
|
|
|
1661
1666
|
},
|
|
1662
1667
|
close: {
|
|
1663
1668
|
opacity: 0,
|
|
1664
|
-
transform: 'translateY(
|
|
1669
|
+
transform: 'translateY(10%)'
|
|
1665
1670
|
}
|
|
1666
1671
|
},
|
|
1667
1672
|
grow: {
|