@sanity/ui 2.0.0-beta.7 → 2.0.0-beta.9
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/dist/index.esm.js +15 -358
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +17 -359
- package/dist/index.js.map +1 -1
- package/dist/theme.d.ts +6 -3
- package/dist/theme.esm.js +127 -152
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +127 -152
- package/dist/theme.js.map +1 -1
- package/package.json +3 -2
- package/src/core/primitives/switch/styles.ts +1 -1
- package/src/theme/build/colorToken/compileColorToken.ts +4 -0
- package/src/theme/build/renderColorValue.ts +8 -1
- package/src/theme/config/system.ts +3 -1
- package/src/theme/config/tokens/parseTokenValue.test.ts +13 -16
- package/src/theme/config/tokens/parseTokenValue.ts +44 -14
- package/src/theme/config/tokens/types.ts +3 -2
- package/src/theme/defaults/colorTokens.ts +83 -136
- package/src/theme/defaults/config.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, '__esModule', {
|
|
|
6
6
|
var theme = require('@sanity/ui/theme');
|
|
7
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
8
8
|
var react = require('react');
|
|
9
|
+
var ReactIs = require('react-is');
|
|
9
10
|
var styled = require('styled-components');
|
|
10
11
|
var icons = require('@sanity/icons');
|
|
11
12
|
var Refractor = require('react-refractor');
|
|
@@ -17,6 +18,7 @@ function _interopDefaultCompat(e) {
|
|
|
17
18
|
default: e
|
|
18
19
|
};
|
|
19
20
|
}
|
|
21
|
+
var ReactIs__default = /*#__PURE__*/_interopDefaultCompat(ReactIs);
|
|
20
22
|
var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
|
|
21
23
|
var Refractor__default = /*#__PURE__*/_interopDefaultCompat(Refractor);
|
|
22
24
|
const createColorTheme = theme.createColorTheme;
|
|
@@ -29,350 +31,6 @@ const rgbToHsl = theme.rgbToHsl;
|
|
|
29
31
|
const rgba = theme.rgba;
|
|
30
32
|
const screen = theme.screen;
|
|
31
33
|
const studioTheme = theme.buildTheme();
|
|
32
|
-
function getDefaultExportFromCjs(x) {
|
|
33
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
34
|
-
}
|
|
35
|
-
var reactIs = {
|
|
36
|
-
exports: {}
|
|
37
|
-
};
|
|
38
|
-
var reactIs_development = {};
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* @license React
|
|
42
|
-
* react-is.development.js
|
|
43
|
-
*
|
|
44
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
45
|
-
*
|
|
46
|
-
* This source code is licensed under the MIT license found in the
|
|
47
|
-
* LICENSE file in the root directory of this source tree.
|
|
48
|
-
*/
|
|
49
|
-
|
|
50
|
-
var hasRequiredReactIs_development;
|
|
51
|
-
function requireReactIs_development() {
|
|
52
|
-
if (hasRequiredReactIs_development) return reactIs_development;
|
|
53
|
-
hasRequiredReactIs_development = 1;
|
|
54
|
-
if (process.env.NODE_ENV !== "production") {
|
|
55
|
-
(function () {
|
|
56
|
-
// ATTENTION
|
|
57
|
-
// When adding new symbols to this file,
|
|
58
|
-
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
59
|
-
// The Symbol used to tag the ReactElement-like types.
|
|
60
|
-
var REACT_ELEMENT_TYPE = Symbol.for('react.element');
|
|
61
|
-
var REACT_PORTAL_TYPE = Symbol.for('react.portal');
|
|
62
|
-
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
|
|
63
|
-
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
|
|
64
|
-
var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
|
|
65
|
-
var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
|
|
66
|
-
var REACT_CONTEXT_TYPE = Symbol.for('react.context');
|
|
67
|
-
var REACT_SERVER_CONTEXT_TYPE = Symbol.for('react.server_context');
|
|
68
|
-
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
|
69
|
-
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
|
70
|
-
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
|
|
71
|
-
var REACT_MEMO_TYPE = Symbol.for('react.memo');
|
|
72
|
-
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
|
73
|
-
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
|
|
74
|
-
|
|
75
|
-
// -----------------------------------------------------------------------------
|
|
76
|
-
|
|
77
|
-
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
78
|
-
var enableCacheElement = false;
|
|
79
|
-
var enableTransitionTracing = false; // No known bugs, but needs performance testing
|
|
80
|
-
|
|
81
|
-
var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
|
|
82
|
-
// stuff. Intended to enable React core members to more easily debug scheduling
|
|
83
|
-
// issues in DEV builds.
|
|
84
|
-
|
|
85
|
-
var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
|
|
86
|
-
|
|
87
|
-
var REACT_MODULE_REFERENCE;
|
|
88
|
-
{
|
|
89
|
-
REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
|
|
90
|
-
}
|
|
91
|
-
function isValidElementType(type) {
|
|
92
|
-
if (typeof type === 'string' || typeof type === 'function') {
|
|
93
|
-
return true;
|
|
94
|
-
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
95
|
-
|
|
96
|
-
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
|
|
97
|
-
return true;
|
|
98
|
-
}
|
|
99
|
-
if (typeof type === 'object' && type !== null) {
|
|
100
|
-
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE ||
|
|
101
|
-
// This needs to include all possible module reference object
|
|
102
|
-
// types supported by any Flight configuration anywhere since
|
|
103
|
-
// we don't know which Flight build this will end up being used
|
|
104
|
-
// with.
|
|
105
|
-
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
|
|
106
|
-
return true;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
return false;
|
|
110
|
-
}
|
|
111
|
-
function typeOf(object) {
|
|
112
|
-
if (typeof object === 'object' && object !== null) {
|
|
113
|
-
var $$typeof = object.$$typeof;
|
|
114
|
-
switch ($$typeof) {
|
|
115
|
-
case REACT_ELEMENT_TYPE:
|
|
116
|
-
var type = object.type;
|
|
117
|
-
switch (type) {
|
|
118
|
-
case REACT_FRAGMENT_TYPE:
|
|
119
|
-
case REACT_PROFILER_TYPE:
|
|
120
|
-
case REACT_STRICT_MODE_TYPE:
|
|
121
|
-
case REACT_SUSPENSE_TYPE:
|
|
122
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
123
|
-
return type;
|
|
124
|
-
default:
|
|
125
|
-
var $$typeofType = type && type.$$typeof;
|
|
126
|
-
switch ($$typeofType) {
|
|
127
|
-
case REACT_SERVER_CONTEXT_TYPE:
|
|
128
|
-
case REACT_CONTEXT_TYPE:
|
|
129
|
-
case REACT_FORWARD_REF_TYPE:
|
|
130
|
-
case REACT_LAZY_TYPE:
|
|
131
|
-
case REACT_MEMO_TYPE:
|
|
132
|
-
case REACT_PROVIDER_TYPE:
|
|
133
|
-
return $$typeofType;
|
|
134
|
-
default:
|
|
135
|
-
return $$typeof;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
case REACT_PORTAL_TYPE:
|
|
139
|
-
return $$typeof;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
return undefined;
|
|
143
|
-
}
|
|
144
|
-
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
145
|
-
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
146
|
-
var Element = REACT_ELEMENT_TYPE;
|
|
147
|
-
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
148
|
-
var Fragment = REACT_FRAGMENT_TYPE;
|
|
149
|
-
var Lazy = REACT_LAZY_TYPE;
|
|
150
|
-
var Memo = REACT_MEMO_TYPE;
|
|
151
|
-
var Portal = REACT_PORTAL_TYPE;
|
|
152
|
-
var Profiler = REACT_PROFILER_TYPE;
|
|
153
|
-
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
154
|
-
var Suspense = REACT_SUSPENSE_TYPE;
|
|
155
|
-
var SuspenseList = REACT_SUSPENSE_LIST_TYPE;
|
|
156
|
-
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
157
|
-
var hasWarnedAboutDeprecatedIsConcurrentMode = false; // AsyncMode should be deprecated
|
|
158
|
-
|
|
159
|
-
function isAsyncMode(object) {
|
|
160
|
-
{
|
|
161
|
-
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
162
|
-
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
163
|
-
|
|
164
|
-
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
return false;
|
|
168
|
-
}
|
|
169
|
-
function isConcurrentMode(object) {
|
|
170
|
-
{
|
|
171
|
-
if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
|
|
172
|
-
hasWarnedAboutDeprecatedIsConcurrentMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
173
|
-
|
|
174
|
-
console['warn']('The ReactIs.isConcurrentMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
return false;
|
|
178
|
-
}
|
|
179
|
-
function isContextConsumer(object) {
|
|
180
|
-
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
181
|
-
}
|
|
182
|
-
function isContextProvider(object) {
|
|
183
|
-
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
184
|
-
}
|
|
185
|
-
function isElement(object) {
|
|
186
|
-
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
187
|
-
}
|
|
188
|
-
function isForwardRef(object) {
|
|
189
|
-
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
190
|
-
}
|
|
191
|
-
function isFragment(object) {
|
|
192
|
-
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
193
|
-
}
|
|
194
|
-
function isLazy(object) {
|
|
195
|
-
return typeOf(object) === REACT_LAZY_TYPE;
|
|
196
|
-
}
|
|
197
|
-
function isMemo(object) {
|
|
198
|
-
return typeOf(object) === REACT_MEMO_TYPE;
|
|
199
|
-
}
|
|
200
|
-
function isPortal(object) {
|
|
201
|
-
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
202
|
-
}
|
|
203
|
-
function isProfiler(object) {
|
|
204
|
-
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
205
|
-
}
|
|
206
|
-
function isStrictMode(object) {
|
|
207
|
-
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
208
|
-
}
|
|
209
|
-
function isSuspense(object) {
|
|
210
|
-
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
211
|
-
}
|
|
212
|
-
function isSuspenseList(object) {
|
|
213
|
-
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
|
|
214
|
-
}
|
|
215
|
-
reactIs_development.ContextConsumer = ContextConsumer;
|
|
216
|
-
reactIs_development.ContextProvider = ContextProvider;
|
|
217
|
-
reactIs_development.Element = Element;
|
|
218
|
-
reactIs_development.ForwardRef = ForwardRef;
|
|
219
|
-
reactIs_development.Fragment = Fragment;
|
|
220
|
-
reactIs_development.Lazy = Lazy;
|
|
221
|
-
reactIs_development.Memo = Memo;
|
|
222
|
-
reactIs_development.Portal = Portal;
|
|
223
|
-
reactIs_development.Profiler = Profiler;
|
|
224
|
-
reactIs_development.StrictMode = StrictMode;
|
|
225
|
-
reactIs_development.Suspense = Suspense;
|
|
226
|
-
reactIs_development.SuspenseList = SuspenseList;
|
|
227
|
-
reactIs_development.isAsyncMode = isAsyncMode;
|
|
228
|
-
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
229
|
-
reactIs_development.isContextConsumer = isContextConsumer;
|
|
230
|
-
reactIs_development.isContextProvider = isContextProvider;
|
|
231
|
-
reactIs_development.isElement = isElement;
|
|
232
|
-
reactIs_development.isForwardRef = isForwardRef;
|
|
233
|
-
reactIs_development.isFragment = isFragment;
|
|
234
|
-
reactIs_development.isLazy = isLazy;
|
|
235
|
-
reactIs_development.isMemo = isMemo;
|
|
236
|
-
reactIs_development.isPortal = isPortal;
|
|
237
|
-
reactIs_development.isProfiler = isProfiler;
|
|
238
|
-
reactIs_development.isStrictMode = isStrictMode;
|
|
239
|
-
reactIs_development.isSuspense = isSuspense;
|
|
240
|
-
reactIs_development.isSuspenseList = isSuspenseList;
|
|
241
|
-
reactIs_development.isValidElementType = isValidElementType;
|
|
242
|
-
reactIs_development.typeOf = typeOf;
|
|
243
|
-
})();
|
|
244
|
-
}
|
|
245
|
-
return reactIs_development;
|
|
246
|
-
}
|
|
247
|
-
var reactIs_production_min = {};
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* @license React
|
|
251
|
-
* react-is.production.min.js
|
|
252
|
-
*
|
|
253
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
254
|
-
*
|
|
255
|
-
* This source code is licensed under the MIT license found in the
|
|
256
|
-
* LICENSE file in the root directory of this source tree.
|
|
257
|
-
*/
|
|
258
|
-
|
|
259
|
-
var hasRequiredReactIs_production_min;
|
|
260
|
-
function requireReactIs_production_min() {
|
|
261
|
-
if (hasRequiredReactIs_production_min) return reactIs_production_min;
|
|
262
|
-
hasRequiredReactIs_production_min = 1;
|
|
263
|
-
var b = Symbol.for("react.element"),
|
|
264
|
-
c = Symbol.for("react.portal"),
|
|
265
|
-
d = Symbol.for("react.fragment"),
|
|
266
|
-
e = Symbol.for("react.strict_mode"),
|
|
267
|
-
f = Symbol.for("react.profiler"),
|
|
268
|
-
g = Symbol.for("react.provider"),
|
|
269
|
-
h = Symbol.for("react.context"),
|
|
270
|
-
k = Symbol.for("react.server_context"),
|
|
271
|
-
l = Symbol.for("react.forward_ref"),
|
|
272
|
-
m = Symbol.for("react.suspense"),
|
|
273
|
-
n = Symbol.for("react.suspense_list"),
|
|
274
|
-
p = Symbol.for("react.memo"),
|
|
275
|
-
q = Symbol.for("react.lazy"),
|
|
276
|
-
t = Symbol.for("react.offscreen"),
|
|
277
|
-
u;
|
|
278
|
-
u = Symbol.for("react.module.reference");
|
|
279
|
-
function v(a) {
|
|
280
|
-
if ("object" === typeof a && null !== a) {
|
|
281
|
-
var r = a.$$typeof;
|
|
282
|
-
switch (r) {
|
|
283
|
-
case b:
|
|
284
|
-
switch (a = a.type, a) {
|
|
285
|
-
case d:
|
|
286
|
-
case f:
|
|
287
|
-
case e:
|
|
288
|
-
case m:
|
|
289
|
-
case n:
|
|
290
|
-
return a;
|
|
291
|
-
default:
|
|
292
|
-
switch (a = a && a.$$typeof, a) {
|
|
293
|
-
case k:
|
|
294
|
-
case h:
|
|
295
|
-
case l:
|
|
296
|
-
case q:
|
|
297
|
-
case p:
|
|
298
|
-
case g:
|
|
299
|
-
return a;
|
|
300
|
-
default:
|
|
301
|
-
return r;
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
case c:
|
|
305
|
-
return r;
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
reactIs_production_min.ContextConsumer = h;
|
|
310
|
-
reactIs_production_min.ContextProvider = g;
|
|
311
|
-
reactIs_production_min.Element = b;
|
|
312
|
-
reactIs_production_min.ForwardRef = l;
|
|
313
|
-
reactIs_production_min.Fragment = d;
|
|
314
|
-
reactIs_production_min.Lazy = q;
|
|
315
|
-
reactIs_production_min.Memo = p;
|
|
316
|
-
reactIs_production_min.Portal = c;
|
|
317
|
-
reactIs_production_min.Profiler = f;
|
|
318
|
-
reactIs_production_min.StrictMode = e;
|
|
319
|
-
reactIs_production_min.Suspense = m;
|
|
320
|
-
reactIs_production_min.SuspenseList = n;
|
|
321
|
-
reactIs_production_min.isAsyncMode = function () {
|
|
322
|
-
return !1;
|
|
323
|
-
};
|
|
324
|
-
reactIs_production_min.isConcurrentMode = function () {
|
|
325
|
-
return !1;
|
|
326
|
-
};
|
|
327
|
-
reactIs_production_min.isContextConsumer = function (a) {
|
|
328
|
-
return v(a) === h;
|
|
329
|
-
};
|
|
330
|
-
reactIs_production_min.isContextProvider = function (a) {
|
|
331
|
-
return v(a) === g;
|
|
332
|
-
};
|
|
333
|
-
reactIs_production_min.isElement = function (a) {
|
|
334
|
-
return "object" === typeof a && null !== a && a.$$typeof === b;
|
|
335
|
-
};
|
|
336
|
-
reactIs_production_min.isForwardRef = function (a) {
|
|
337
|
-
return v(a) === l;
|
|
338
|
-
};
|
|
339
|
-
reactIs_production_min.isFragment = function (a) {
|
|
340
|
-
return v(a) === d;
|
|
341
|
-
};
|
|
342
|
-
reactIs_production_min.isLazy = function (a) {
|
|
343
|
-
return v(a) === q;
|
|
344
|
-
};
|
|
345
|
-
reactIs_production_min.isMemo = function (a) {
|
|
346
|
-
return v(a) === p;
|
|
347
|
-
};
|
|
348
|
-
reactIs_production_min.isPortal = function (a) {
|
|
349
|
-
return v(a) === c;
|
|
350
|
-
};
|
|
351
|
-
reactIs_production_min.isProfiler = function (a) {
|
|
352
|
-
return v(a) === f;
|
|
353
|
-
};
|
|
354
|
-
reactIs_production_min.isStrictMode = function (a) {
|
|
355
|
-
return v(a) === e;
|
|
356
|
-
};
|
|
357
|
-
reactIs_production_min.isSuspense = function (a) {
|
|
358
|
-
return v(a) === m;
|
|
359
|
-
};
|
|
360
|
-
reactIs_production_min.isSuspenseList = function (a) {
|
|
361
|
-
return v(a) === n;
|
|
362
|
-
};
|
|
363
|
-
reactIs_production_min.isValidElementType = function (a) {
|
|
364
|
-
return "string" === typeof a || "function" === typeof a || a === d || a === f || a === e || a === m || a === n || a === t || "object" === typeof a && null !== a && (a.$$typeof === q || a.$$typeof === p || a.$$typeof === g || a.$$typeof === h || a.$$typeof === l || a.$$typeof === u || void 0 !== a.getModuleId) ? !0 : !1;
|
|
365
|
-
};
|
|
366
|
-
reactIs_production_min.typeOf = v;
|
|
367
|
-
return reactIs_production_min;
|
|
368
|
-
}
|
|
369
|
-
if (process.env.NODE_ENV === 'production') {
|
|
370
|
-
reactIs.exports = requireReactIs_production_min();
|
|
371
|
-
} else {
|
|
372
|
-
reactIs.exports = requireReactIs_development();
|
|
373
|
-
}
|
|
374
|
-
var reactIsExports = reactIs.exports;
|
|
375
|
-
var ReactIs = /*@__PURE__*/getDefaultExportFromCjs(reactIsExports);
|
|
376
34
|
const EMPTY_ARRAY = [];
|
|
377
35
|
const EMPTY_RECORD = {};
|
|
378
36
|
const POPOVER_MOTION_PROPS = {
|
|
@@ -884,7 +542,7 @@ var gatherActiveObservationsAtDepth = function (depth) {
|
|
|
884
542
|
});
|
|
885
543
|
});
|
|
886
544
|
};
|
|
887
|
-
var process
|
|
545
|
+
var process = function () {
|
|
888
546
|
var depth = 0;
|
|
889
547
|
gatherActiveObservationsAtDepth(depth);
|
|
890
548
|
while (hasActiveObservations()) {
|
|
@@ -965,7 +623,7 @@ var Scheduler = function () {
|
|
|
965
623
|
queueResizeObserver(function () {
|
|
966
624
|
var elementsHaveResized = false;
|
|
967
625
|
try {
|
|
968
|
-
elementsHaveResized = process
|
|
626
|
+
elementsHaveResized = process();
|
|
969
627
|
} finally {
|
|
970
628
|
scheduled = false;
|
|
971
629
|
timeout = until - time();
|
|
@@ -2203,7 +1861,7 @@ const Avatar = react.forwardRef(function Avatar2(props, ref) {
|
|
|
2203
1861
|
const {
|
|
2204
1862
|
avatar
|
|
2205
1863
|
} = useTheme_v2();
|
|
2206
|
-
const as =
|
|
1864
|
+
const as = ReactIs__default.default.isValidElementType(asProp) ? asProp : "div";
|
|
2207
1865
|
const size = useArrayProp(sizeProp);
|
|
2208
1866
|
const avatarSize = avatar.sizes[size[0]] || avatar.sizes[0];
|
|
2209
1867
|
const _sizeRem = avatarSize.size;
|
|
@@ -2355,7 +2013,7 @@ const AvatarCounter = react.forwardRef(function AvatarCounter2(props, ref) {
|
|
|
2355
2013
|
});
|
|
2356
2014
|
function childrenToElementArray(children) {
|
|
2357
2015
|
const childrenArray = Array.isArray(children) ? children : [children];
|
|
2358
|
-
return childrenArray.filter(node =>
|
|
2016
|
+
return childrenArray.filter(node => ReactIs.isElement(node) || ReactIs.isFragment(node) || typeof node === "string");
|
|
2359
2017
|
}
|
|
2360
2018
|
var __freeze$B = Object.freeze;
|
|
2361
2019
|
var __defProp$C = Object.defineProperty;
|
|
@@ -2840,7 +2498,7 @@ const Button = react.forwardRef(function Button2(props, ref) {
|
|
|
2840
2498
|
gap: space,
|
|
2841
2499
|
children: [icon && /* @__PURE__ */jsxRuntime.jsxs(Text, {
|
|
2842
2500
|
size: fontSize,
|
|
2843
|
-
children: [react.isValidElement(icon) && icon,
|
|
2501
|
+
children: [react.isValidElement(icon) && icon, ReactIs.isValidElementType(icon) && react.createElement(icon)]
|
|
2844
2502
|
}), text && /* @__PURE__ */jsxRuntime.jsx(Box, {
|
|
2845
2503
|
flex: iconRight ? 1 : void 0,
|
|
2846
2504
|
children: /* @__PURE__ */jsxRuntime.jsx(Text, {
|
|
@@ -2853,7 +2511,7 @@ const Button = react.forwardRef(function Button2(props, ref) {
|
|
|
2853
2511
|
})
|
|
2854
2512
|
}), iconRight && /* @__PURE__ */jsxRuntime.jsxs(Text, {
|
|
2855
2513
|
size: fontSize,
|
|
2856
|
-
children: [react.isValidElement(iconRight) && iconRight,
|
|
2514
|
+
children: [react.isValidElement(iconRight) && iconRight, ReactIs.isValidElementType(iconRight) && react.createElement(iconRight)]
|
|
2857
2515
|
})]
|
|
2858
2516
|
})
|
|
2859
2517
|
}), children && /* @__PURE__ */jsxRuntime.jsx(Box, {
|
|
@@ -2925,7 +2583,7 @@ const Card = react.forwardRef(function Card2(props, ref) {
|
|
|
2925
2583
|
tone: toneProp = "default",
|
|
2926
2584
|
...restProps
|
|
2927
2585
|
} = props;
|
|
2928
|
-
const as =
|
|
2586
|
+
const as = ReactIs.isValidElementType(asProp) ? asProp : "div";
|
|
2929
2587
|
const rootTheme = useRootTheme();
|
|
2930
2588
|
const tone = toneProp === "inherit" ? rootTheme.tone : toneProp;
|
|
2931
2589
|
return /* @__PURE__ */jsxRuntime.jsx(ThemeColorProvider, {
|
|
@@ -4871,7 +4529,7 @@ function switchThumbStyles(props) {
|
|
|
4871
4529
|
const checkedOffset = trackWidth - trackPadding * 2 - size;
|
|
4872
4530
|
const indeterminateOffset = trackWidth / 2 - size / 2 - trackPadding;
|
|
4873
4531
|
const checked = $indeterminate !== true && props.$checked === true;
|
|
4874
|
-
return styled.css(_g || (_g = __template$j(["\n &:not([hidden]) {\n display: block;\n }\n position: absolute;\n left: ", ";\n top: ", ";\n height: ", ";\n width: ", ";\n border-radius: ", ";\n transition-property: transform;\n transition-duration: ", "ms;\n transition-timing-function: ", ";\n background: var(--switch-fg-color);\n transform: translate3d(0, 0, 0);\n box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.
|
|
4532
|
+
return styled.css(_g || (_g = __template$j(["\n &:not([hidden]) {\n display: block;\n }\n position: absolute;\n left: ", ";\n top: ", ";\n height: ", ";\n width: ", ";\n border-radius: ", ";\n transition-property: transform;\n transition-duration: ", "ms;\n transition-timing-function: ", ";\n background: var(--switch-fg-color);\n transform: translate3d(0, 0, 0);\n box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.05);\n\n ", "\n\n ", "\n "])), rem(trackPadding), rem(trackPadding), rem(size), rem(size), rem(size / 2), input.switch.transitionDurationMs, input.switch.transitionTimingFunction, checked && styled.css(_e$2 || (_e$2 = __template$j(["\n transform: translate3d(", "px, 0, 0);\n "])), checkedOffset), $indeterminate && styled.css(_f$2 || (_f$2 = __template$j(["\n transform: translate3d(", "px, 0, 0);\n "])), indeterminateOffset));
|
|
4875
4533
|
}
|
|
4876
4534
|
const Root$d = styled__default.default.span(switchBaseStyles);
|
|
4877
4535
|
const Input$2 = styled__default.default.input(switchInputStyles);
|
|
@@ -5064,13 +4722,13 @@ const TextInput = react.forwardRef(function TextInput2(props, forwardedRef) {
|
|
|
5064
4722
|
padding,
|
|
5065
4723
|
children: /* @__PURE__ */jsxRuntime.jsxs(Text, {
|
|
5066
4724
|
size: fontSize,
|
|
5067
|
-
children: [react.isValidElement(icon) && icon,
|
|
4725
|
+
children: [react.isValidElement(icon) && icon, ReactIs.isValidElementType(icon) && react.createElement(icon)]
|
|
5068
4726
|
})
|
|
5069
4727
|
}), !$hasClearButton && iconRight && /* @__PURE__ */jsxRuntime.jsx(RightBox, {
|
|
5070
4728
|
padding,
|
|
5071
4729
|
children: /* @__PURE__ */jsxRuntime.jsxs(Text, {
|
|
5072
4730
|
size: fontSize,
|
|
5073
|
-
children: [react.isValidElement(iconRight) && iconRight,
|
|
4731
|
+
children: [react.isValidElement(iconRight) && iconRight, ReactIs.isValidElementType(iconRight) && react.createElement(iconRight)]
|
|
5074
4732
|
})
|
|
5075
4733
|
})]
|
|
5076
4734
|
}), [__unstable_disableFocusRing, border, fontSize, icon, iconRight, padding, radius, rootTheme, $hasClearButton, $hasPrefix, $hasSuffix]);
|
|
@@ -6874,7 +6532,7 @@ const MenuButton = react.forwardRef(function MenuButton2(props, ref) {
|
|
|
6874
6532
|
registerElement,
|
|
6875
6533
|
shouldFocus
|
|
6876
6534
|
}), [buttonElement, handleMenuClickOutside, handleMenuEscape, handleItemClick, id, handleBlur, registerElement, shouldFocus]);
|
|
6877
|
-
const menu =
|
|
6535
|
+
const menu = ReactIs.isElement(menuProp) ? react.cloneElement(menuProp, menuProps) : null;
|
|
6878
6536
|
const setButtonRef = react.useCallback(el => {
|
|
6879
6537
|
if (typeof ref === "function") {
|
|
6880
6538
|
ref(el);
|
|
@@ -6883,7 +6541,7 @@ const MenuButton = react.forwardRef(function MenuButton2(props, ref) {
|
|
|
6883
6541
|
}
|
|
6884
6542
|
setButtonElement(el);
|
|
6885
6543
|
}, [ref]);
|
|
6886
|
-
const button = react.useMemo(() =>
|
|
6544
|
+
const button = react.useMemo(() => ReactIs.isElement(buttonProp) ? react.cloneElement(buttonProp, {
|
|
6887
6545
|
"data-ui": "MenuButton",
|
|
6888
6546
|
id,
|
|
6889
6547
|
onClick: handleButtonClick,
|
|
@@ -7070,7 +6728,7 @@ function MenuGroup(props) {
|
|
|
7070
6728
|
padding,
|
|
7071
6729
|
children: [icon && /* @__PURE__ */jsxRuntime.jsxs(Text, {
|
|
7072
6730
|
size: fontSize,
|
|
7073
|
-
children: [react.isValidElement(icon) && icon,
|
|
6731
|
+
children: [react.isValidElement(icon) && icon, ReactIs.isValidElementType(icon) && react.createElement(icon)]
|
|
7074
6732
|
}), /* @__PURE__ */jsxRuntime.jsx(Box, {
|
|
7075
6733
|
flex: 1,
|
|
7076
6734
|
children: /* @__PURE__ */jsxRuntime.jsx(Text, {
|
|
@@ -7173,7 +6831,7 @@ const MenuItem = react.forwardRef(function MenuItem2(props, forwardedRef) {
|
|
|
7173
6831
|
...paddingProps,
|
|
7174
6832
|
children: [icon && /* @__PURE__ */jsxRuntime.jsxs(Text, {
|
|
7175
6833
|
size: fontSize,
|
|
7176
|
-
children: [react.isValidElement(icon) && icon,
|
|
6834
|
+
children: [react.isValidElement(icon) && icon, ReactIs.isValidElementType(icon) && react.createElement(icon)]
|
|
7177
6835
|
}), text && /* @__PURE__ */jsxRuntime.jsx(Box, {
|
|
7178
6836
|
flex: 1,
|
|
7179
6837
|
children: /* @__PURE__ */jsxRuntime.jsx(Text, {
|
|
@@ -7191,7 +6849,7 @@ const MenuItem = react.forwardRef(function MenuItem2(props, forwardedRef) {
|
|
|
7191
6849
|
}
|
|
7192
6850
|
}), iconRight && /* @__PURE__ */jsxRuntime.jsxs(Text, {
|
|
7193
6851
|
size: fontSize,
|
|
7194
|
-
children: [react.isValidElement(iconRight) && iconRight,
|
|
6852
|
+
children: [react.isValidElement(iconRight) && iconRight, ReactIs.isValidElementType(iconRight) && react.createElement(iconRight)]
|
|
7195
6853
|
})]
|
|
7196
6854
|
}), children && /* @__PURE__ */jsxRuntime.jsx(Box, {
|
|
7197
6855
|
as: "span",
|