@sanity/ui 2.0.0-beta.5 → 2.0.0-beta.6
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 +359 -16
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +360 -18
- package/dist/index.js.map +1 -1
- package/dist/theme.esm.js +21 -21
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +21 -21
- package/dist/theme.js.map +1 -1
- package/package.json +6 -4
- package/src/core/primitives/badge/badge.tsx +1 -3
- package/src/core/primitives/select/select.tsx +1 -1
- package/src/core/styles/card/_cardColorStyle.ts +2 -0
- package/src/theme/defaults/colorTokens.ts +21 -21
package/dist/index.js
CHANGED
|
@@ -6,7 +6,6 @@ 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');
|
|
10
9
|
var styled = require('styled-components');
|
|
11
10
|
var icons = require('@sanity/icons');
|
|
12
11
|
var Refractor = require('react-refractor');
|
|
@@ -18,7 +17,6 @@ function _interopDefaultCompat(e) {
|
|
|
18
17
|
default: e
|
|
19
18
|
};
|
|
20
19
|
}
|
|
21
|
-
var ReactIs__default = /*#__PURE__*/_interopDefaultCompat(ReactIs);
|
|
22
20
|
var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
|
|
23
21
|
var Refractor__default = /*#__PURE__*/_interopDefaultCompat(Refractor);
|
|
24
22
|
const createColorTheme = theme.createColorTheme;
|
|
@@ -31,6 +29,350 @@ const rgbToHsl = theme.rgbToHsl;
|
|
|
31
29
|
const rgba = theme.rgba;
|
|
32
30
|
const screen = theme.screen;
|
|
33
31
|
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);
|
|
34
376
|
const EMPTY_ARRAY = [];
|
|
35
377
|
const EMPTY_RECORD = {};
|
|
36
378
|
const POPOVER_MOTION_PROPS = {
|
|
@@ -542,7 +884,7 @@ var gatherActiveObservationsAtDepth = function (depth) {
|
|
|
542
884
|
});
|
|
543
885
|
});
|
|
544
886
|
};
|
|
545
|
-
var process = function () {
|
|
887
|
+
var process$1 = function () {
|
|
546
888
|
var depth = 0;
|
|
547
889
|
gatherActiveObservationsAtDepth(depth);
|
|
548
890
|
while (hasActiveObservations()) {
|
|
@@ -623,7 +965,7 @@ var Scheduler = function () {
|
|
|
623
965
|
queueResizeObserver(function () {
|
|
624
966
|
var elementsHaveResized = false;
|
|
625
967
|
try {
|
|
626
|
-
elementsHaveResized = process();
|
|
968
|
+
elementsHaveResized = process$1();
|
|
627
969
|
} finally {
|
|
628
970
|
scheduled = false;
|
|
629
971
|
timeout = until - time();
|
|
@@ -1861,7 +2203,7 @@ const Avatar = react.forwardRef(function Avatar2(props, ref) {
|
|
|
1861
2203
|
const {
|
|
1862
2204
|
avatar
|
|
1863
2205
|
} = useTheme_v2();
|
|
1864
|
-
const as =
|
|
2206
|
+
const as = ReactIs.isValidElementType(asProp) ? asProp : "div";
|
|
1865
2207
|
const size = useArrayProp(sizeProp);
|
|
1866
2208
|
const avatarSize = avatar.sizes[size[0]] || avatar.sizes[0];
|
|
1867
2209
|
const _sizeRem = avatarSize.size;
|
|
@@ -2013,7 +2355,7 @@ const AvatarCounter = react.forwardRef(function AvatarCounter2(props, ref) {
|
|
|
2013
2355
|
});
|
|
2014
2356
|
function childrenToElementArray(children) {
|
|
2015
2357
|
const childrenArray = Array.isArray(children) ? children : [children];
|
|
2016
|
-
return childrenArray.filter(node =>
|
|
2358
|
+
return childrenArray.filter(node => reactIsExports.isElement(node) || reactIsExports.isFragment(node) || typeof node === "string");
|
|
2017
2359
|
}
|
|
2018
2360
|
var __freeze$B = Object.freeze;
|
|
2019
2361
|
var __defProp$C = Object.defineProperty;
|
|
@@ -2233,7 +2575,6 @@ const Badge = react.forwardRef(function Badge2(props, ref) {
|
|
|
2233
2575
|
ref,
|
|
2234
2576
|
children: /* @__PURE__ */jsxRuntime.jsx(Text, {
|
|
2235
2577
|
size: fontSize,
|
|
2236
|
-
weight: "medium",
|
|
2237
2578
|
children
|
|
2238
2579
|
})
|
|
2239
2580
|
});
|
|
@@ -2281,6 +2622,7 @@ function _cardColorStyle(base, color) {
|
|
|
2281
2622
|
let checkered = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
2282
2623
|
return {
|
|
2283
2624
|
// from base
|
|
2625
|
+
"--card-backdrop-color": base.backdrop,
|
|
2284
2626
|
"--card-focus-ring-color": base.focusRing,
|
|
2285
2627
|
"--card-shadow-outline-color": base.shadow.outline,
|
|
2286
2628
|
"--card-shadow-umbra-color": base.shadow.umbra,
|
|
@@ -2498,7 +2840,7 @@ const Button = react.forwardRef(function Button2(props, ref) {
|
|
|
2498
2840
|
gap: space,
|
|
2499
2841
|
children: [icon && /* @__PURE__ */jsxRuntime.jsxs(Text, {
|
|
2500
2842
|
size: fontSize,
|
|
2501
|
-
children: [react.isValidElement(icon) && icon,
|
|
2843
|
+
children: [react.isValidElement(icon) && icon, reactIsExports.isValidElementType(icon) && react.createElement(icon)]
|
|
2502
2844
|
}), text && /* @__PURE__ */jsxRuntime.jsx(Box, {
|
|
2503
2845
|
flex: iconRight ? 1 : void 0,
|
|
2504
2846
|
children: /* @__PURE__ */jsxRuntime.jsx(Text, {
|
|
@@ -2511,7 +2853,7 @@ const Button = react.forwardRef(function Button2(props, ref) {
|
|
|
2511
2853
|
})
|
|
2512
2854
|
}), iconRight && /* @__PURE__ */jsxRuntime.jsxs(Text, {
|
|
2513
2855
|
size: fontSize,
|
|
2514
|
-
children: [react.isValidElement(iconRight) && iconRight,
|
|
2856
|
+
children: [react.isValidElement(iconRight) && iconRight, reactIsExports.isValidElementType(iconRight) && react.createElement(iconRight)]
|
|
2515
2857
|
})]
|
|
2516
2858
|
})
|
|
2517
2859
|
}), children && /* @__PURE__ */jsxRuntime.jsx(Box, {
|
|
@@ -2583,7 +2925,7 @@ const Card = react.forwardRef(function Card2(props, ref) {
|
|
|
2583
2925
|
tone: toneProp = "default",
|
|
2584
2926
|
...restProps
|
|
2585
2927
|
} = props;
|
|
2586
|
-
const as =
|
|
2928
|
+
const as = reactIsExports.isValidElementType(asProp) ? asProp : "div";
|
|
2587
2929
|
const rootTheme = useRootTheme();
|
|
2588
2930
|
const tone = toneProp === "inherit" ? rootTheme.tone : toneProp;
|
|
2589
2931
|
return /* @__PURE__ */jsxRuntime.jsx(ThemeColorProvider, {
|
|
@@ -4421,7 +4763,7 @@ const Select = react.forwardRef(function Select2(props, forwardedRef) {
|
|
|
4421
4763
|
disabled,
|
|
4422
4764
|
fontSize = 2,
|
|
4423
4765
|
padding = 3,
|
|
4424
|
-
radius =
|
|
4766
|
+
radius = 2,
|
|
4425
4767
|
readOnly,
|
|
4426
4768
|
space = 3,
|
|
4427
4769
|
...restProps
|
|
@@ -4722,13 +5064,13 @@ const TextInput = react.forwardRef(function TextInput2(props, forwardedRef) {
|
|
|
4722
5064
|
padding,
|
|
4723
5065
|
children: /* @__PURE__ */jsxRuntime.jsxs(Text, {
|
|
4724
5066
|
size: fontSize,
|
|
4725
|
-
children: [react.isValidElement(icon) && icon,
|
|
5067
|
+
children: [react.isValidElement(icon) && icon, reactIsExports.isValidElementType(icon) && react.createElement(icon)]
|
|
4726
5068
|
})
|
|
4727
5069
|
}), !$hasClearButton && iconRight && /* @__PURE__ */jsxRuntime.jsx(RightBox, {
|
|
4728
5070
|
padding,
|
|
4729
5071
|
children: /* @__PURE__ */jsxRuntime.jsxs(Text, {
|
|
4730
5072
|
size: fontSize,
|
|
4731
|
-
children: [react.isValidElement(iconRight) && iconRight,
|
|
5073
|
+
children: [react.isValidElement(iconRight) && iconRight, reactIsExports.isValidElementType(iconRight) && react.createElement(iconRight)]
|
|
4732
5074
|
})
|
|
4733
5075
|
})]
|
|
4734
5076
|
}), [__unstable_disableFocusRing, border, fontSize, icon, iconRight, padding, radius, rootTheme, $hasClearButton, $hasPrefix, $hasSuffix]);
|
|
@@ -6532,7 +6874,7 @@ const MenuButton = react.forwardRef(function MenuButton2(props, ref) {
|
|
|
6532
6874
|
registerElement,
|
|
6533
6875
|
shouldFocus
|
|
6534
6876
|
}), [buttonElement, handleMenuClickOutside, handleMenuEscape, handleItemClick, id, handleBlur, registerElement, shouldFocus]);
|
|
6535
|
-
const menu =
|
|
6877
|
+
const menu = reactIsExports.isElement(menuProp) ? react.cloneElement(menuProp, menuProps) : null;
|
|
6536
6878
|
const setButtonRef = react.useCallback(el => {
|
|
6537
6879
|
if (typeof ref === "function") {
|
|
6538
6880
|
ref(el);
|
|
@@ -6541,7 +6883,7 @@ const MenuButton = react.forwardRef(function MenuButton2(props, ref) {
|
|
|
6541
6883
|
}
|
|
6542
6884
|
setButtonElement(el);
|
|
6543
6885
|
}, [ref]);
|
|
6544
|
-
const button = react.useMemo(() =>
|
|
6886
|
+
const button = react.useMemo(() => reactIsExports.isElement(buttonProp) ? react.cloneElement(buttonProp, {
|
|
6545
6887
|
"data-ui": "MenuButton",
|
|
6546
6888
|
id,
|
|
6547
6889
|
onClick: handleButtonClick,
|
|
@@ -6728,7 +7070,7 @@ function MenuGroup(props) {
|
|
|
6728
7070
|
padding,
|
|
6729
7071
|
children: [icon && /* @__PURE__ */jsxRuntime.jsxs(Text, {
|
|
6730
7072
|
size: fontSize,
|
|
6731
|
-
children: [react.isValidElement(icon) && icon,
|
|
7073
|
+
children: [react.isValidElement(icon) && icon, reactIsExports.isValidElementType(icon) && react.createElement(icon)]
|
|
6732
7074
|
}), /* @__PURE__ */jsxRuntime.jsx(Box, {
|
|
6733
7075
|
flex: 1,
|
|
6734
7076
|
children: /* @__PURE__ */jsxRuntime.jsx(Text, {
|
|
@@ -6831,7 +7173,7 @@ const MenuItem = react.forwardRef(function MenuItem2(props, forwardedRef) {
|
|
|
6831
7173
|
...paddingProps,
|
|
6832
7174
|
children: [icon && /* @__PURE__ */jsxRuntime.jsxs(Text, {
|
|
6833
7175
|
size: fontSize,
|
|
6834
|
-
children: [react.isValidElement(icon) && icon,
|
|
7176
|
+
children: [react.isValidElement(icon) && icon, reactIsExports.isValidElementType(icon) && react.createElement(icon)]
|
|
6835
7177
|
}), text && /* @__PURE__ */jsxRuntime.jsx(Box, {
|
|
6836
7178
|
flex: 1,
|
|
6837
7179
|
children: /* @__PURE__ */jsxRuntime.jsx(Text, {
|
|
@@ -6849,7 +7191,7 @@ const MenuItem = react.forwardRef(function MenuItem2(props, forwardedRef) {
|
|
|
6849
7191
|
}
|
|
6850
7192
|
}), iconRight && /* @__PURE__ */jsxRuntime.jsxs(Text, {
|
|
6851
7193
|
size: fontSize,
|
|
6852
|
-
children: [react.isValidElement(iconRight) && iconRight,
|
|
7194
|
+
children: [react.isValidElement(iconRight) && iconRight, reactIsExports.isValidElementType(iconRight) && react.createElement(iconRight)]
|
|
6853
7195
|
})]
|
|
6854
7196
|
}), children && /* @__PURE__ */jsxRuntime.jsx(Box, {
|
|
6855
7197
|
as: "span",
|