baseui 0.0.0-next-e8c3307 → 0.0.0-next-6acb60a
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/datepicker/calendar-header.js +227 -95
- package/datepicker/calendar-header.js.flow +270 -139
- package/datepicker/constants.js +4 -2
- package/datepicker/constants.js.flow +2 -0
- package/datepicker/utils/calendar-header-helpers.js +51 -0
- package/datepicker/utils/calendar-header-helpers.js.flow +53 -0
- package/drawer/drawer.js +2 -1
- package/drawer/drawer.js.flow +1 -1
- package/es/datepicker/calendar-header.js +184 -84
- package/es/datepicker/constants.js +2 -1
- package/es/datepicker/utils/calendar-header-helpers.js +34 -0
- package/es/drawer/drawer.js +2 -1
- package/es/popover/stateful-container.js +4 -0
- package/es/snackbar/snackbar-context.js +16 -4
- package/es/themes/dark-theme/color-component-tokens.js +1 -1
- package/es/themes/light-theme/color-component-tokens.js +9 -9
- package/esm/datepicker/calendar-header.js +226 -95
- package/esm/datepicker/constants.js +2 -1
- package/esm/datepicker/utils/calendar-header-helpers.js +45 -0
- package/esm/drawer/drawer.js +2 -1
- package/esm/popover/stateful-container.js +4 -0
- package/esm/snackbar/snackbar-context.js +16 -4
- package/esm/themes/dark-theme/color-component-tokens.js +1 -1
- package/esm/themes/light-theme/color-component-tokens.js +9 -9
- package/package.json +1 -1
- package/popover/stateful-container.js +4 -0
- package/popover/stateful-container.js.flow +3 -0
- package/snackbar/snackbar-context.js +15 -4
- package/snackbar/snackbar-context.js.flow +15 -3
- package/themes/dark-theme/color-component-tokens.js +1 -1
- package/themes/dark-theme/color-component-tokens.js.flow +1 -1
- package/themes/light-theme/color-component-tokens.js +9 -9
- package/themes/light-theme/color-component-tokens.js.flow +9 -9
package/package.json
CHANGED
|
@@ -81,6 +81,14 @@ function useSnackbar() {
|
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
+
function usePrevious(value) {
|
|
85
|
+
var ref = React.useRef();
|
|
86
|
+
React.useEffect(function () {
|
|
87
|
+
ref.current = value;
|
|
88
|
+
});
|
|
89
|
+
return ref.current;
|
|
90
|
+
}
|
|
91
|
+
|
|
84
92
|
function SnackbarProvider(_ref) {
|
|
85
93
|
var children = _ref.children,
|
|
86
94
|
_ref$overrides = _ref.overrides,
|
|
@@ -115,10 +123,6 @@ function SnackbarProvider(_ref) {
|
|
|
115
123
|
function enqueue(elementProps) {
|
|
116
124
|
var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultDuration;
|
|
117
125
|
setSnackbars(function (prev) {
|
|
118
|
-
if (prev.length === 0) {
|
|
119
|
-
enter(duration);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
126
|
return [].concat(_toConsumableArray(prev), [{
|
|
123
127
|
elementProps: elementProps,
|
|
124
128
|
duration: duration
|
|
@@ -126,6 +130,13 @@ function SnackbarProvider(_ref) {
|
|
|
126
130
|
});
|
|
127
131
|
}
|
|
128
132
|
|
|
133
|
+
var prevSnackbars = usePrevious(snackbars) || [];
|
|
134
|
+
React.useEffect(function () {
|
|
135
|
+
if (prevSnackbars.length === 0 && snackbars.length >= 1) {
|
|
136
|
+
enter(snackbars[0].duration);
|
|
137
|
+
}
|
|
138
|
+
}, [snackbars, prevSnackbars]);
|
|
139
|
+
|
|
129
140
|
function dequeue() {
|
|
130
141
|
setContainerHeight(0);
|
|
131
142
|
setSnackbars(function (prev) {
|
|
@@ -43,6 +43,14 @@ export function useSnackbar() {
|
|
|
43
43
|
return {enqueue: context.enqueue, dequeue: context.dequeue};
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
function usePrevious(value) {
|
|
47
|
+
const ref = React.useRef();
|
|
48
|
+
React.useEffect(() => {
|
|
49
|
+
ref.current = value;
|
|
50
|
+
});
|
|
51
|
+
return ref.current;
|
|
52
|
+
}
|
|
53
|
+
|
|
46
54
|
export default function SnackbarProvider({
|
|
47
55
|
children,
|
|
48
56
|
overrides = {},
|
|
@@ -61,13 +69,17 @@ export default function SnackbarProvider({
|
|
|
61
69
|
|
|
62
70
|
function enqueue(elementProps, duration = defaultDuration) {
|
|
63
71
|
setSnackbars(prev => {
|
|
64
|
-
if (prev.length === 0) {
|
|
65
|
-
enter(duration);
|
|
66
|
-
}
|
|
67
72
|
return [...prev, {elementProps, duration}];
|
|
68
73
|
});
|
|
69
74
|
}
|
|
70
75
|
|
|
76
|
+
const prevSnackbars = usePrevious(snackbars) || [];
|
|
77
|
+
React.useEffect(() => {
|
|
78
|
+
if (prevSnackbars.length === 0 && snackbars.length >= 1) {
|
|
79
|
+
enter(snackbars[0].duration);
|
|
80
|
+
}
|
|
81
|
+
}, [snackbars, prevSnackbars]);
|
|
82
|
+
|
|
71
83
|
function dequeue() {
|
|
72
84
|
setContainerHeight(0);
|
|
73
85
|
|
|
@@ -103,7 +103,7 @@ var _default = function _default() {
|
|
|
103
103
|
linkActive: themePrimitives.primary300,
|
|
104
104
|
// List
|
|
105
105
|
listHeaderFill: themePrimitives.mono600,
|
|
106
|
-
listBodyFill: themePrimitives.
|
|
106
|
+
listBodyFill: themePrimitives.mono800,
|
|
107
107
|
listIconFill: themePrimitives.mono100,
|
|
108
108
|
listBorder: themePrimitives.mono500,
|
|
109
109
|
// ProgressSteps
|
|
@@ -32,32 +32,32 @@ var _default = function _default() {
|
|
|
32
32
|
buttonPrimaryActive: themePrimitives.primary600,
|
|
33
33
|
buttonPrimarySelectedFill: themePrimitives.primary600,
|
|
34
34
|
buttonPrimarySelectedText: themePrimitives.white,
|
|
35
|
-
buttonPrimarySpinnerForeground: themePrimitives.
|
|
36
|
-
buttonPrimarySpinnerBackground: themePrimitives.
|
|
35
|
+
buttonPrimarySpinnerForeground: themePrimitives.accent,
|
|
36
|
+
buttonPrimarySpinnerBackground: themePrimitives.primaryB,
|
|
37
37
|
buttonSecondaryFill: themePrimitives.primary100,
|
|
38
38
|
buttonSecondaryText: themePrimitives.primary,
|
|
39
39
|
buttonSecondaryHover: themePrimitives.primary200,
|
|
40
40
|
buttonSecondaryActive: themePrimitives.primary300,
|
|
41
41
|
buttonSecondarySelectedFill: themePrimitives.primary300,
|
|
42
42
|
buttonSecondarySelectedText: themePrimitives.primary,
|
|
43
|
-
buttonSecondarySpinnerForeground: themePrimitives.
|
|
44
|
-
buttonSecondarySpinnerBackground: themePrimitives.
|
|
43
|
+
buttonSecondarySpinnerForeground: themePrimitives.accent,
|
|
44
|
+
buttonSecondarySpinnerBackground: themePrimitives.primaryB,
|
|
45
45
|
buttonTertiaryFill: 'transparent',
|
|
46
46
|
buttonTertiaryText: themePrimitives.primary,
|
|
47
47
|
buttonTertiaryHover: themePrimitives.primary50,
|
|
48
48
|
buttonTertiaryActive: themePrimitives.primary100,
|
|
49
49
|
buttonTertiarySelectedFill: themePrimitives.primary100,
|
|
50
50
|
buttonTertiarySelectedText: themePrimitives.primary,
|
|
51
|
-
buttonTertiarySpinnerForeground: themePrimitives.
|
|
52
|
-
buttonTertiarySpinnerBackground: themePrimitives.
|
|
51
|
+
buttonTertiarySpinnerForeground: themePrimitives.accent,
|
|
52
|
+
buttonTertiarySpinnerBackground: themePrimitives.primary100,
|
|
53
53
|
buttonMinimalFill: 'transparent',
|
|
54
54
|
buttonMinimalText: themePrimitives.primary,
|
|
55
55
|
buttonMinimalHover: themePrimitives.primary50,
|
|
56
56
|
buttonMinimalActive: themePrimitives.primary100,
|
|
57
57
|
buttonMinimalSelectedFill: themePrimitives.primary100,
|
|
58
58
|
buttonMinimalSelectedText: themePrimitives.primary,
|
|
59
|
-
buttonMinimalSpinnerForeground: themePrimitives.
|
|
60
|
-
buttonMinimalSpinnerBackground: themePrimitives.
|
|
59
|
+
buttonMinimalSpinnerForeground: themePrimitives.accent,
|
|
60
|
+
buttonMinimalSpinnerBackground: themePrimitives.primary100,
|
|
61
61
|
buttonDisabledFill: themePrimitives.mono200,
|
|
62
62
|
buttonDisabledText: themePrimitives.mono600,
|
|
63
63
|
buttonDisabledSpinnerForeground: themePrimitives.mono600,
|
|
@@ -103,7 +103,7 @@ var _default = function _default() {
|
|
|
103
103
|
linkActive: themePrimitives.primary500,
|
|
104
104
|
// List
|
|
105
105
|
listHeaderFill: themePrimitives.white,
|
|
106
|
-
listBodyFill: themePrimitives.
|
|
106
|
+
listBodyFill: themePrimitives.white,
|
|
107
107
|
listIconFill: themePrimitives.mono500,
|
|
108
108
|
listBorder: themePrimitives.mono500,
|
|
109
109
|
// ProgressSteps
|
|
@@ -25,8 +25,8 @@ export default (
|
|
|
25
25
|
buttonPrimaryActive: themePrimitives.primary600,
|
|
26
26
|
buttonPrimarySelectedFill: themePrimitives.primary600,
|
|
27
27
|
buttonPrimarySelectedText: themePrimitives.white,
|
|
28
|
-
buttonPrimarySpinnerForeground: themePrimitives.
|
|
29
|
-
buttonPrimarySpinnerBackground: themePrimitives.
|
|
28
|
+
buttonPrimarySpinnerForeground: themePrimitives.accent,
|
|
29
|
+
buttonPrimarySpinnerBackground: themePrimitives.primaryB,
|
|
30
30
|
|
|
31
31
|
buttonSecondaryFill: themePrimitives.primary100,
|
|
32
32
|
buttonSecondaryText: themePrimitives.primary,
|
|
@@ -34,8 +34,8 @@ export default (
|
|
|
34
34
|
buttonSecondaryActive: themePrimitives.primary300,
|
|
35
35
|
buttonSecondarySelectedFill: themePrimitives.primary300,
|
|
36
36
|
buttonSecondarySelectedText: themePrimitives.primary,
|
|
37
|
-
buttonSecondarySpinnerForeground: themePrimitives.
|
|
38
|
-
buttonSecondarySpinnerBackground: themePrimitives.
|
|
37
|
+
buttonSecondarySpinnerForeground: themePrimitives.accent,
|
|
38
|
+
buttonSecondarySpinnerBackground: themePrimitives.primaryB,
|
|
39
39
|
|
|
40
40
|
buttonTertiaryFill: 'transparent',
|
|
41
41
|
buttonTertiaryText: themePrimitives.primary,
|
|
@@ -43,8 +43,8 @@ export default (
|
|
|
43
43
|
buttonTertiaryActive: themePrimitives.primary100,
|
|
44
44
|
buttonTertiarySelectedFill: themePrimitives.primary100,
|
|
45
45
|
buttonTertiarySelectedText: themePrimitives.primary,
|
|
46
|
-
buttonTertiarySpinnerForeground: themePrimitives.
|
|
47
|
-
buttonTertiarySpinnerBackground: themePrimitives.
|
|
46
|
+
buttonTertiarySpinnerForeground: themePrimitives.accent,
|
|
47
|
+
buttonTertiarySpinnerBackground: themePrimitives.primary100,
|
|
48
48
|
|
|
49
49
|
buttonMinimalFill: 'transparent',
|
|
50
50
|
buttonMinimalText: themePrimitives.primary,
|
|
@@ -52,8 +52,8 @@ export default (
|
|
|
52
52
|
buttonMinimalActive: themePrimitives.primary100,
|
|
53
53
|
buttonMinimalSelectedFill: themePrimitives.primary100,
|
|
54
54
|
buttonMinimalSelectedText: themePrimitives.primary,
|
|
55
|
-
buttonMinimalSpinnerForeground: themePrimitives.
|
|
56
|
-
buttonMinimalSpinnerBackground: themePrimitives.
|
|
55
|
+
buttonMinimalSpinnerForeground: themePrimitives.accent,
|
|
56
|
+
buttonMinimalSpinnerBackground: themePrimitives.primary100,
|
|
57
57
|
|
|
58
58
|
buttonDisabledFill: themePrimitives.mono200,
|
|
59
59
|
buttonDisabledText: themePrimitives.mono600,
|
|
@@ -107,7 +107,7 @@ export default (
|
|
|
107
107
|
|
|
108
108
|
// List
|
|
109
109
|
listHeaderFill: themePrimitives.white,
|
|
110
|
-
listBodyFill: themePrimitives.
|
|
110
|
+
listBodyFill: themePrimitives.white,
|
|
111
111
|
listIconFill: themePrimitives.mono500,
|
|
112
112
|
listBorder: themePrimitives.mono500,
|
|
113
113
|
|