@ttoss/ui 1.30.1 → 1.30.2

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.js CHANGED
@@ -7,6 +7,12 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
7
7
  var __getProtoOf = Object.getPrototypeOf;
8
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
9
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
+ var __esm = (fn, res) => function __init() {
11
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
12
+ };
13
+ var __commonJS = (cb, mod) => function __require() {
14
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
15
+ };
10
16
  var __export = (target, all) => {
11
17
  for (var name in all)
12
18
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -20,6 +26,10 @@ var __copyProps = (to, from, except, desc) => {
20
26
  return to;
21
27
  };
22
28
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
29
+ // If the importer is in node compatibility mode or this is not an ESM
30
+ // file that has been converted to a CommonJS file using a Babel-
31
+ // compatible transform (i.e. "__esModule" has not been set), then set
32
+ // "default" to the CommonJS "module.exports" for node compatibility.
23
33
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24
34
  mod
25
35
  ));
@@ -29,9 +39,123 @@ var __publicField = (obj, key, value) => {
29
39
  return value;
30
40
  };
31
41
 
42
+ // tsup.inject.js
43
+ var React;
44
+ var init_tsup_inject = __esm({
45
+ "tsup.inject.js"() {
46
+ "use strict";
47
+ React = __toESM(require("react"));
48
+ }
49
+ });
50
+
51
+ // ../../node_modules/deepmerge/dist/cjs.js
52
+ var require_cjs = __commonJS({
53
+ "../../node_modules/deepmerge/dist/cjs.js"(exports, module2) {
54
+ "use strict";
55
+ init_tsup_inject();
56
+ var isMergeableObject = function isMergeableObject2(value) {
57
+ return isNonNullObject(value) && !isSpecial(value);
58
+ };
59
+ function isNonNullObject(value) {
60
+ return !!value && typeof value === "object";
61
+ }
62
+ function isSpecial(value) {
63
+ var stringValue = Object.prototype.toString.call(value);
64
+ return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
65
+ }
66
+ var canUseSymbol = typeof Symbol === "function" && Symbol.for;
67
+ var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
68
+ function isReactElement(value) {
69
+ return value.$$typeof === REACT_ELEMENT_TYPE;
70
+ }
71
+ function emptyTarget(val) {
72
+ return Array.isArray(val) ? [] : {};
73
+ }
74
+ function cloneUnlessOtherwiseSpecified(value, options) {
75
+ return options.clone !== false && options.isMergeableObject(value) ? deepmerge2(emptyTarget(value), value, options) : value;
76
+ }
77
+ function defaultArrayMerge(target, source, options) {
78
+ return target.concat(source).map(function(element) {
79
+ return cloneUnlessOtherwiseSpecified(element, options);
80
+ });
81
+ }
82
+ function getMergeFunction(key, options) {
83
+ if (!options.customMerge) {
84
+ return deepmerge2;
85
+ }
86
+ var customMerge = options.customMerge(key);
87
+ return typeof customMerge === "function" ? customMerge : deepmerge2;
88
+ }
89
+ function getEnumerableOwnPropertySymbols(target) {
90
+ return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
91
+ return Object.propertyIsEnumerable.call(target, symbol);
92
+ }) : [];
93
+ }
94
+ function getKeys(target) {
95
+ return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
96
+ }
97
+ function propertyIsOnObject(object, property) {
98
+ try {
99
+ return property in object;
100
+ } catch (_) {
101
+ return false;
102
+ }
103
+ }
104
+ function propertyIsUnsafe(target, key) {
105
+ return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
106
+ }
107
+ function mergeObject(target, source, options) {
108
+ var destination = {};
109
+ if (options.isMergeableObject(target)) {
110
+ getKeys(target).forEach(function(key) {
111
+ destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
112
+ });
113
+ }
114
+ getKeys(source).forEach(function(key) {
115
+ if (propertyIsUnsafe(target, key)) {
116
+ return;
117
+ }
118
+ if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
119
+ destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
120
+ } else {
121
+ destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
122
+ }
123
+ });
124
+ return destination;
125
+ }
126
+ function deepmerge2(target, source, options) {
127
+ options = options || {};
128
+ options.arrayMerge = options.arrayMerge || defaultArrayMerge;
129
+ options.isMergeableObject = options.isMergeableObject || isMergeableObject;
130
+ options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
131
+ var sourceIsArray = Array.isArray(source);
132
+ var targetIsArray = Array.isArray(target);
133
+ var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
134
+ if (!sourceAndTargetTypesMatch) {
135
+ return cloneUnlessOtherwiseSpecified(source, options);
136
+ } else if (sourceIsArray) {
137
+ return options.arrayMerge(target, source, options);
138
+ } else {
139
+ return mergeObject(target, source, options);
140
+ }
141
+ }
142
+ deepmerge2.all = function deepmergeAll(array, options) {
143
+ if (!Array.isArray(array)) {
144
+ throw new Error("first argument should be an array");
145
+ }
146
+ return array.reduce(function(prev, next) {
147
+ return deepmerge2(prev, next, options);
148
+ }, {});
149
+ };
150
+ var deepmerge_1 = deepmerge2;
151
+ module2.exports = deepmerge_1;
152
+ }
153
+ });
154
+
32
155
  // src/index.ts
33
156
  var src_exports = {};
34
157
  __export(src_exports, {
158
+ BaseStyles: () => import_theme_ui23.BaseStyles,
35
159
  Box: () => import_theme_ui3.Box,
36
160
  Button: () => Button,
37
161
  Card: () => import_theme_ui5.Card,
@@ -54,122 +178,261 @@ __export(src_exports, {
54
178
  Spinner: () => import_theme_ui17.Spinner,
55
179
  Text: () => import_theme_ui15.Text,
56
180
  Textarea: () => import_theme_ui21.Textarea,
57
- ThemeProvider: () => ThemeProvider_default,
181
+ ThemeProvider: () => ThemeProvider,
58
182
  useBreakpointIndex: () => import_match_media.useBreakpointIndex,
59
183
  useResponsiveValue: () => import_match_media.useResponsiveValue,
60
184
  useTheme: () => useTheme
61
185
  });
62
186
  module.exports = __toCommonJS(src_exports);
187
+ init_tsup_inject();
188
+ var import_theme_ui23 = require("theme-ui");
63
189
  var import_match_media = require("@theme-ui/match-media");
64
190
 
65
191
  // src/theme/ThemeProvider.tsx
66
- var React2 = __toESM(require("react"));
192
+ init_tsup_inject();
67
193
 
68
194
  // ../theme/dist/esm/index.js
195
+ init_tsup_inject();
196
+ var import_deepmerge = __toESM(require_cjs());
197
+ var fontSizes = {
198
+ "2xs": "0.5rem",
199
+ xs: "0.75rem",
200
+ sm: "0.875rem",
201
+ base: "1rem",
202
+ lg: "1.125rem",
203
+ xl: "1.25rem",
204
+ "2xl": "1.5rem",
205
+ "3xl": "1.875rem",
206
+ "4xl": "2.25rem",
207
+ "5xl": "3rem",
208
+ "6xl": "3.75rem",
209
+ "7xl": "4.5rem",
210
+ "8xl": "6rem",
211
+ "9xl": "8rem"
212
+ };
213
+ var fontWeights = {
214
+ thin: 100,
215
+ extralight: 200,
216
+ light: 300,
217
+ normal: 400,
218
+ medium: 500,
219
+ semibold: 600,
220
+ bold: 700,
221
+ extrabold: 800
222
+ };
223
+ var letterSpacings = {
224
+ tighter: "-0.05em",
225
+ tight: "-0.025em",
226
+ normal: "0em",
227
+ wide: "0.025em",
228
+ wider: "0.05em",
229
+ widest: "0.1em"
230
+ };
231
+ var space = {
232
+ none: 0,
233
+ "2xs": "2px",
234
+ xs: "3px",
235
+ sm: "5px",
236
+ md: "8px",
237
+ lg: "13px",
238
+ xl: "21px",
239
+ "2xl": "34px",
240
+ "3xl": "55px",
241
+ "4xl": "89px",
242
+ "5xl": "144px",
243
+ "6xl": "233px",
244
+ "7xl": "377px"
245
+ };
246
+ var coreFonts = {
247
+ main: '"Atkinson Hyperlegible", sans-serif',
248
+ contrast: '"Work Sans", sans-serif',
249
+ monospace: '"Inconsolata", sans-serif'
250
+ };
251
+ var brandColors = {
252
+ complimentary: "#f5f5f5",
253
+ main: "#292c2a",
254
+ darkNeutral: "#515389",
255
+ accent: "#0000ff",
256
+ lightNeutral: "#e3e3e3"
257
+ };
258
+ var coreColors = {
259
+ ...brandColors,
260
+ gray100: "#f0f1f3",
261
+ gray200: "#ced1d7",
262
+ gray300: "#acb1ba",
263
+ gray400: "#8b919e",
264
+ gray500: "#6b7280",
265
+ gray600: "#535863",
266
+ gray700: "#3b3f46",
267
+ gray800: "#23252a",
268
+ gray900: "#0b0b0d",
269
+ black: "#000000",
270
+ red100: "#ffebeb",
271
+ red200: "#fdbfbf",
272
+ red300: "#f99595",
273
+ red400: "#f56c6c",
274
+ red500: "#ef4444",
275
+ red600: "#e42828",
276
+ red700: "#c62121",
277
+ white: "#ffffff"
278
+ };
279
+ var coreBorders = {
280
+ none: "0px solid",
281
+ thin: "1px solid",
282
+ medium: "2px solid",
283
+ thick: "4px solid"
284
+ };
285
+ var coreRadii = {
286
+ sharp: "0px",
287
+ xs: "2px",
288
+ sm: "4px",
289
+ md: "6px",
290
+ lg: "8px",
291
+ xl: "12px",
292
+ "2xl": "16px",
293
+ "3xl": "24px",
294
+ circle: "9999px"
295
+ };
69
296
  var BruttalTheme = {
297
+ /**
298
+ * Tokens
299
+ */
300
+ fontSizes,
301
+ fontWeights,
302
+ letterSpacings,
303
+ space,
70
304
  colors: {
71
- text: "#0D0D0D",
72
- background: "#fff",
73
- backgroundBrand: "#C2C2C2",
74
- primary: "#0D0D0D",
75
- secondary: "#639",
76
- gray: "#555",
77
- muted: "#f6f6f6",
78
- danger: "red",
79
- accent: "#0000FF",
80
- textOnSurface: "#FFFFFF"
305
+ background: coreColors.lightNeutral,
306
+ text: coreColors.gray900,
307
+ muted: coreColors.gray200,
308
+ outline: coreColors.gray200,
309
+ primary: coreColors.main,
310
+ onPrimary: coreColors.white,
311
+ secondary: coreColors.gray500,
312
+ onSecondary: coreColors.white,
313
+ highlight: coreColors.darkNeutral,
314
+ onHighlight: coreColors.white,
315
+ accent: coreColors.accent,
316
+ onAccent: coreColors.white,
317
+ neutral: coreColors.white,
318
+ onNeutral: coreColors.gray900
81
319
  },
82
- space: [0, 4, 8, 16, 32, 64, 128, 256, 512, 1024],
83
320
  fonts: {
84
- body: '"Inconsolata", sans-serif',
85
- heading: '"Work Sans", sans-serif',
86
- monospace: '"Inconsolata", sans-serif'
321
+ h1: coreFonts.contrast,
322
+ h2: coreFonts.contrast,
323
+ h3: coreFonts.contrast,
324
+ h4: coreFonts.contrast,
325
+ h5: coreFonts.contrast,
326
+ h6: coreFonts.contrast,
327
+ body: coreFonts.main,
328
+ highlight: coreFonts.main,
329
+ caption: coreFonts.monospace
87
330
  },
88
- fontSizes: {
89
- xxs: "0.5rem",
90
- xs: "0.75rem",
91
- sm: "0.875rem",
92
- base: "1rem",
93
- lg: "1.125rem",
94
- xl: "1.25rem",
95
- "2xl": "1.5rem",
96
- "3xl": "1.875rem",
97
- "4xl": "2.25rem",
98
- "5xl": "3rem",
99
- "6xl": "3.75rem",
100
- "7xl": "4.5rem",
101
- "8xl": "6rem",
102
- "9xl": "8rem"
331
+ borders: {
332
+ default: coreBorders.medium
103
333
  },
104
- fontWeights: {
105
- thin: 100,
106
- extralight: 200,
107
- light: 300,
108
- normal: 400,
109
- medium: 500,
110
- semibold: 600,
111
- bold: 700,
112
- extrabold: 800
113
- },
114
- letterSpacings: {
115
- tighter: "-0.05em",
116
- tight: "-0.025em",
117
- normal: "0em",
118
- wide: "0.025em",
119
- wider: "0.05em",
120
- widest: "0.1em"
334
+ radii: {
335
+ default: coreRadii.sm
121
336
  },
337
+ /**
338
+ * Global styles
339
+ */
122
340
  styles: {
123
341
  root: {
124
342
  fontFamily: "body",
125
343
  fontWeight: "normal"
126
- },
127
- a: {
128
- color: "primary",
129
- textDecoration: "underline",
130
- cursor: "pointer",
131
- fontFamily: "body"
132
- },
133
- progress: {
134
- color: "primary",
135
- backgroundColor: "background"
136
344
  }
137
345
  },
138
- borders: [0, "3px solid #0D0D0D"],
346
+ /**
347
+ * Components
348
+ */
139
349
  buttons: {
140
- cta: {
141
- color: "white",
142
- backgroundColor: "primary"
143
- },
144
- muted: {
145
- color: "text",
146
- backgroundColor: "muted"
147
- },
148
- danger: {
149
- color: "white",
150
- backgroundColor: "danger"
350
+ accent: {
351
+ backgroundColor: "accent",
352
+ color: "onAccent",
353
+ fontFamily: "highlight",
354
+ fontWeight: "bold",
355
+ border: "default",
356
+ borderRadius: "default",
357
+ borderColor: "accent",
358
+ ":hover:not(:active,[disabled])": {
359
+ backgroundColor: "highlight",
360
+ color: "onHighlight",
361
+ borderColor: "highlight"
362
+ },
363
+ ":disabled": {
364
+ cursor: "default",
365
+ backgroundColor: "muted",
366
+ borderColor: "muted"
367
+ }
151
368
  },
152
369
  primary: {
370
+ backgroundColor: "primary",
371
+ color: "onPrimary",
372
+ fontFamily: "body",
373
+ border: "default",
374
+ borderRadius: "default",
375
+ borderColor: "outline",
376
+ ":hover:not(:active,[disabled])": {
377
+ backgroundColor: "highlight",
378
+ color: "onHighlight",
379
+ borderColor: "highlight"
380
+ },
381
+ ":active": {
382
+ backgroundColor: "primary",
383
+ color: "onPrimary",
384
+ borderColor: "outline"
385
+ },
153
386
  ":disabled": {
154
- backgroundColor: "backgroundBrand",
155
- cursor: "default"
387
+ cursor: "default",
388
+ backgroundColor: "muted",
389
+ borderColor: "muted"
156
390
  }
157
391
  },
158
392
  secondary: {
159
- color: "text",
160
- backgroundColor: "white",
161
- borderColor: "text",
162
- borderWidth: 1,
163
- borderStyle: "solid",
393
+ backgroundColor: "secondary",
394
+ color: "onSecondary",
395
+ fontFamily: "body",
396
+ border: "default",
397
+ borderRadius: "default",
398
+ borderColor: "outline",
399
+ ":hover:not(:active,[disabled])": {
400
+ backgroundColor: "highlight",
401
+ color: "onHighlight",
402
+ borderColor: "highlight"
403
+ },
164
404
  ":disabled": {
165
- opacity: 0.5,
166
- cursor: "default"
405
+ cursor: "default",
406
+ backgroundColor: "muted",
407
+ borderColor: "muted"
167
408
  }
409
+ },
410
+ neutral: {
411
+ backgroundColor: "neutral",
412
+ color: "onNeutral",
413
+ fontFamily: "body",
414
+ border: "default",
415
+ borderRadius: "default",
416
+ borderColor: "outline",
417
+ ":hover:not(:active,[disabled])": {
418
+ backgroundColor: "highlight",
419
+ color: "onHighlight",
420
+ borderColor: "highlight"
421
+ },
422
+ ":disabled": {
423
+ cursor: "default",
424
+ backgroundColor: "muted",
425
+ borderColor: "muted"
426
+ }
427
+ },
428
+ danger: {
429
+ color: "white",
430
+ backgroundColor: "danger"
168
431
  }
169
432
  },
170
433
  cards: {
171
434
  primary: {
172
- backgroundColor: "background",
435
+ backgroundColor: "primary",
173
436
  border: "1px solid black",
174
437
  padding: [4, 5],
175
438
  display: "flex",
@@ -227,7 +490,8 @@ var BruttalTheme = {
227
490
  };
228
491
  var BruttalFonts = [
229
492
  "https://fonts.googleapis.com/css?family=Inconsolata:wght@100;200;300;400;500;700;800;900",
230
- "https://fonts.googleapis.com/css?family=Work+Sans:wght@100;200;300;400;500;700;800;900"
493
+ "https://fonts.googleapis.com/css?family=Work+Sans:wght@100;200;300;400;500;700;800;900",
494
+ "https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400;1,700&display=swap"
231
495
  ];
232
496
 
233
497
  // src/theme/ThemeProvider.tsx
@@ -236,98 +500,47 @@ var import_theme_ui = require("theme-ui");
236
500
  var import_jsx_runtime = require("react/jsx-runtime");
237
501
  var ThemeProvider = ({
238
502
  children,
239
- theme = {},
503
+ theme = BruttalTheme,
240
504
  fonts = BruttalFonts
241
505
  }) => {
242
- const mergedTheme = React2.useMemo(() => {
243
- if (typeof theme === "function") {
244
- return theme;
245
- }
246
- return (0, import_theme_ui.merge)(BruttalTheme, theme);
247
- }, [theme]);
248
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_theme_ui.ThemeProvider, { theme: mergedTheme, children: [
249
- fonts.map((url) => {
250
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
251
- import_react.Global,
252
- {
253
- styles: import_react.css`
254
- @import url('${url}');
255
- `
256
- },
257
- url
258
- );
259
- }),
506
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_theme_ui.ThemeProvider, { theme, children: [
507
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
508
+ import_react.Global,
509
+ {
510
+ styles: import_react.css`
511
+ ${fonts.map((url) => {
512
+ return `@import url('${url}');`;
513
+ }).join("\n")}
514
+ `
515
+ }
516
+ ),
260
517
  children
261
518
  ] }) });
262
519
  };
263
- var ThemeProvider_default = ThemeProvider;
264
520
 
265
521
  // src/theme/useTheme.ts
522
+ init_tsup_inject();
266
523
  var import_theme_ui2 = require("theme-ui");
267
524
  var useTheme = import_theme_ui2.useThemeUI;
268
525
 
269
526
  // src/components/Box.tsx
527
+ init_tsup_inject();
270
528
  var import_theme_ui3 = require("theme-ui");
271
529
 
272
530
  // src/components/Button.tsx
531
+ init_tsup_inject();
532
+ var React3 = __toESM(require("react"));
273
533
  var import_theme_ui4 = require("theme-ui");
274
- var import_jsx_runtime2 = require("react/jsx-runtime");
275
- var Button = (props) => {
276
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
277
- import_theme_ui4.Button,
278
- {
279
- ...props,
280
- sx: { cursor: "pointer", fontFamily: "body", ...props.sx }
281
- }
282
- );
283
- };
284
-
285
- // src/components/Card.tsx
286
- var import_theme_ui5 = require("theme-ui");
287
534
 
288
- // src/components/Divider.tsx
289
- var import_theme_ui6 = require("theme-ui");
290
-
291
- // src/components/Flex.tsx
292
- var import_theme_ui7 = require("theme-ui");
293
-
294
- // src/components/Grid.tsx
295
- var import_theme_ui8 = require("theme-ui");
296
-
297
- // src/components/Heading.tsx
298
- var import_theme_ui9 = require("theme-ui");
299
-
300
- // src/components/Image.tsx
301
- var import_theme_ui10 = require("theme-ui");
302
-
303
- // src/components/Input.tsx
304
- var import_theme_ui11 = require("theme-ui");
305
-
306
- // src/components/Label.tsx
307
- var import_theme_ui12 = require("theme-ui");
308
-
309
- // src/components/Link.tsx
310
- var import_theme_ui13 = require("theme-ui");
311
-
312
- // src/components/LinearProgress.tsx
313
- var import_theme_ui14 = require("theme-ui");
314
-
315
- // src/components/Text.tsx
316
- var import_theme_ui15 = require("theme-ui");
317
-
318
- // src/components/Select.tsx
319
- var import_theme_ui16 = require("theme-ui");
320
-
321
- // src/components/Spinner.tsx
322
- var import_theme_ui17 = require("theme-ui");
323
-
324
- // src/components/Radio.tsx
325
- var import_theme_ui18 = require("theme-ui");
535
+ // src/components/Icon.tsx
536
+ init_tsup_inject();
326
537
 
327
538
  // ../../node_modules/@iconify-icon/react/dist/iconify.mjs
539
+ init_tsup_inject();
328
540
  var import_react2 = __toESM(require("react"), 1);
329
541
 
330
542
  // ../../node_modules/iconify-icon/dist/iconify-icon.mjs
543
+ init_tsup_inject();
331
544
  var defaultIconDimensions = Object.freeze(
332
545
  {
333
546
  left: 0,
@@ -1519,6 +1732,7 @@ function parseIconValue(value, onload) {
1519
1732
  value,
1520
1733
  name,
1521
1734
  data
1735
+ // could be 'null' -> icon is missing
1522
1736
  };
1523
1737
  }
1524
1738
  const loading = loadIcons$1([name], () => onload(value, name, getIconData(name)));
@@ -1870,7 +2084,12 @@ function exportFunctions() {
1870
2084
  if (typeof preload === "object" && preload !== null) {
1871
2085
  (preload instanceof Array ? preload : [preload]).forEach((item) => {
1872
2086
  try {
1873
- if (typeof item !== "object" || item === null || item instanceof Array || typeof item.icons !== "object" || typeof item.prefix !== "string" || !addCollection$1(item)) {
2087
+ if (
2088
+ // Check if item is an object and not null/array
2089
+ typeof item !== "object" || item === null || item instanceof Array || // Check for 'icons' and 'prefix'
2090
+ typeof item.icons !== "object" || typeof item.prefix !== "string" || // Add icon set
2091
+ !addCollection$1(item)
2092
+ ) {
1874
2093
  console.error(err);
1875
2094
  }
1876
2095
  } catch (e) {
@@ -2051,19 +2270,28 @@ function defineIconifyIcon(name = "iconify-icon") {
2051
2270
  return ConflictingClass;
2052
2271
  }
2053
2272
  const attributes = [
2273
+ // Icon
2054
2274
  "icon",
2275
+ // Mode
2055
2276
  "mode",
2056
2277
  "inline",
2278
+ // Customisations
2057
2279
  "width",
2058
2280
  "height",
2059
2281
  "rotate",
2060
2282
  "flip"
2061
2283
  ];
2062
2284
  const IconifyIcon = class extends ParentClass {
2285
+ /**
2286
+ * Constructor
2287
+ */
2063
2288
  constructor() {
2064
2289
  super();
2290
+ // Root
2065
2291
  __publicField(this, "_shadowRoot");
2292
+ // State
2066
2293
  __publicField(this, "_state");
2294
+ // Attributes check queued
2067
2295
  __publicField(this, "_checkQueued", false);
2068
2296
  const root = this._shadowRoot = this.attachShadow({
2069
2297
  mode: "open"
@@ -2075,9 +2303,32 @@ function defineIconifyIcon(name = "iconify-icon") {
2075
2303
  }, inline);
2076
2304
  this._queueCheck();
2077
2305
  }
2306
+ /**
2307
+ * Observed attributes
2308
+ */
2078
2309
  static get observedAttributes() {
2079
2310
  return attributes.slice(0);
2080
2311
  }
2312
+ /**
2313
+ * Observed properties that are different from attributes
2314
+ *
2315
+ * Experimental! Need to test with various frameworks that support it
2316
+ */
2317
+ /*
2318
+ static get properties() {
2319
+ return {
2320
+ inline: {
2321
+ type: Boolean,
2322
+ reflect: true,
2323
+ },
2324
+ // Not listing other attributes because they are strings or combination
2325
+ // of string and another type. Cannot have multiple types
2326
+ };
2327
+ }
2328
+ */
2329
+ /**
2330
+ * Attribute has changed
2331
+ */
2081
2332
  attributeChangedCallback(name2) {
2082
2333
  if (name2 === "inline") {
2083
2334
  const newInline = getInline(this);
@@ -2090,6 +2341,9 @@ function defineIconifyIcon(name = "iconify-icon") {
2090
2341
  this._queueCheck();
2091
2342
  }
2092
2343
  }
2344
+ /**
2345
+ * Get/set icon
2346
+ */
2093
2347
  get icon() {
2094
2348
  const value = this.getAttribute("icon");
2095
2349
  if (value && value.slice(0, 1) === "{") {
@@ -2106,12 +2360,22 @@ function defineIconifyIcon(name = "iconify-icon") {
2106
2360
  }
2107
2361
  this.setAttribute("icon", value);
2108
2362
  }
2363
+ /**
2364
+ * Get/set inline
2365
+ */
2109
2366
  get inline() {
2110
2367
  return getInline(this);
2111
2368
  }
2112
2369
  set inline(value) {
2113
- this.setAttribute("inline", value ? "true" : null);
2370
+ if (value) {
2371
+ this.setAttribute("inline", "true");
2372
+ } else {
2373
+ this.removeAttribute("inline");
2374
+ }
2114
2375
  }
2376
+ /**
2377
+ * Restart animation
2378
+ */
2115
2379
  restartAnimation() {
2116
2380
  const state = this._state;
2117
2381
  if (state.rendered) {
@@ -2126,10 +2390,16 @@ function defineIconifyIcon(name = "iconify-icon") {
2126
2390
  renderIcon(root, state);
2127
2391
  }
2128
2392
  }
2393
+ /**
2394
+ * Get status
2395
+ */
2129
2396
  get status() {
2130
2397
  const state = this._state;
2131
2398
  return state.rendered ? "rendered" : state.icon.data === null ? "failed" : "loading";
2132
2399
  }
2400
+ /**
2401
+ * Queue attributes re-check
2402
+ */
2133
2403
  _queueCheck() {
2134
2404
  if (!this._checkQueued) {
2135
2405
  this._checkQueued = true;
@@ -2138,6 +2408,9 @@ function defineIconifyIcon(name = "iconify-icon") {
2138
2408
  });
2139
2409
  }
2140
2410
  }
2411
+ /**
2412
+ * Check for changes
2413
+ */
2141
2414
  _check() {
2142
2415
  if (!this._checkQueued) {
2143
2416
  return;
@@ -2158,6 +2431,9 @@ function defineIconifyIcon(name = "iconify-icon") {
2158
2431
  this._renderIcon(state.icon, customisations, mode);
2159
2432
  }
2160
2433
  }
2434
+ /**
2435
+ * Icon value has changed
2436
+ */
2161
2437
  _iconChanged(newValue) {
2162
2438
  const icon = parseIconValue(newValue, (value, name2, data) => {
2163
2439
  const state = this._state;
@@ -2181,10 +2457,16 @@ function defineIconifyIcon(name = "iconify-icon") {
2181
2457
  this._state = setPendingState(icon, this._state.inline, this._state);
2182
2458
  }
2183
2459
  }
2460
+ /**
2461
+ * Got new icon data, icon is ready to (re)render
2462
+ */
2184
2463
  _gotIconData(icon) {
2185
2464
  this._checkQueued = false;
2186
2465
  this._renderIcon(icon, getCustomisations(this), this.getAttribute("mode"));
2187
2466
  }
2467
+ /**
2468
+ * Re-render based on icon data
2469
+ */
2188
2470
  _renderIcon(icon, customisations, attrMode) {
2189
2471
  const renderedMode = getRenderMode(icon.data.body, attrMode);
2190
2472
  const inline = this._state.inline;
@@ -2205,7 +2487,11 @@ function defineIconifyIcon(name = "iconify-icon") {
2205
2487
  return this.getAttribute(attr);
2206
2488
  },
2207
2489
  set: function(value) {
2208
- this.setAttribute(attr, value);
2490
+ if (value !== null) {
2491
+ this.setAttribute(attr, value);
2492
+ } else {
2493
+ this.removeAttribute(attr);
2494
+ }
2209
2495
  }
2210
2496
  });
2211
2497
  }
@@ -2241,18 +2527,117 @@ var Icon = import_react2.default.forwardRef(
2241
2527
  );
2242
2528
 
2243
2529
  // src/components/Icon.tsx
2244
- var import_jsx_runtime3 = require("react/jsx-runtime");
2530
+ var import_jsx_runtime2 = require("react/jsx-runtime");
2245
2531
  var Icon2 = (props) => {
2246
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Icon, { ...props });
2532
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Icon, { ...props });
2247
2533
  };
2248
2534
 
2535
+ // src/components/Button.tsx
2536
+ var import_jsx_runtime3 = require("react/jsx-runtime");
2537
+ var RenderIcon = ({ icon }) => {
2538
+ if (!icon) {
2539
+ return null;
2540
+ }
2541
+ if (typeof icon === "string") {
2542
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Icon2, { icon }) });
2543
+ }
2544
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: icon });
2545
+ };
2546
+ var MemoizedRenderIcon = React3.memo(RenderIcon);
2547
+ var Button = React3.forwardRef(
2548
+ (props, ref) => {
2549
+ const { children, leftIcon, rightIcon, ...restProps } = props;
2550
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
2551
+ import_theme_ui4.Button,
2552
+ {
2553
+ ref,
2554
+ ...restProps,
2555
+ sx: {
2556
+ cursor: "pointer",
2557
+ paddingX: "lg",
2558
+ paddingY: "md",
2559
+ display: "inline-flex",
2560
+ alignItems: "center",
2561
+ gap: "lg",
2562
+ ...restProps.sx
2563
+ },
2564
+ children: [
2565
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MemoizedRenderIcon, { icon: leftIcon }),
2566
+ children,
2567
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MemoizedRenderIcon, { icon: rightIcon })
2568
+ ]
2569
+ }
2570
+ );
2571
+ }
2572
+ );
2573
+ Button.displayName = "Button";
2574
+
2575
+ // src/components/Card.tsx
2576
+ init_tsup_inject();
2577
+ var import_theme_ui5 = require("theme-ui");
2578
+
2579
+ // src/components/Divider.tsx
2580
+ init_tsup_inject();
2581
+ var import_theme_ui6 = require("theme-ui");
2582
+
2583
+ // src/components/Flex.tsx
2584
+ init_tsup_inject();
2585
+ var import_theme_ui7 = require("theme-ui");
2586
+
2587
+ // src/components/Grid.tsx
2588
+ init_tsup_inject();
2589
+ var import_theme_ui8 = require("theme-ui");
2590
+
2591
+ // src/components/Heading.tsx
2592
+ init_tsup_inject();
2593
+ var import_theme_ui9 = require("theme-ui");
2594
+
2595
+ // src/components/Image.tsx
2596
+ init_tsup_inject();
2597
+ var import_theme_ui10 = require("theme-ui");
2598
+
2599
+ // src/components/Input.tsx
2600
+ init_tsup_inject();
2601
+ var import_theme_ui11 = require("theme-ui");
2602
+
2603
+ // src/components/Label.tsx
2604
+ init_tsup_inject();
2605
+ var import_theme_ui12 = require("theme-ui");
2606
+
2607
+ // src/components/Link.tsx
2608
+ init_tsup_inject();
2609
+ var import_theme_ui13 = require("theme-ui");
2610
+
2611
+ // src/components/LinearProgress.tsx
2612
+ init_tsup_inject();
2613
+ var import_theme_ui14 = require("theme-ui");
2614
+
2615
+ // src/components/Text.tsx
2616
+ init_tsup_inject();
2617
+ var import_theme_ui15 = require("theme-ui");
2618
+
2619
+ // src/components/Select.tsx
2620
+ init_tsup_inject();
2621
+ var import_theme_ui16 = require("theme-ui");
2622
+
2623
+ // src/components/Spinner.tsx
2624
+ init_tsup_inject();
2625
+ var import_theme_ui17 = require("theme-ui");
2626
+
2627
+ // src/components/Radio.tsx
2628
+ init_tsup_inject();
2629
+ var import_theme_ui18 = require("theme-ui");
2630
+
2249
2631
  // src/components/Slider.tsx
2632
+ init_tsup_inject();
2250
2633
  var import_theme_ui19 = require("theme-ui");
2251
2634
 
2252
2635
  // src/components/Checkbox.tsx
2636
+ init_tsup_inject();
2253
2637
  var import_theme_ui20 = require("theme-ui");
2254
2638
 
2255
2639
  // src/components/InfiniteLinearProgress.tsx
2640
+ init_tsup_inject();
2256
2641
  var React4 = __toESM(require("react"));
2257
2642
  var import_jsx_runtime4 = require("react/jsx-runtime");
2258
2643
  var MAX_PROGRESS = 100;
@@ -2283,12 +2668,15 @@ var InfiniteLinearProgress = () => {
2283
2668
  };
2284
2669
 
2285
2670
  // src/components/Textarea.tsx
2671
+ init_tsup_inject();
2286
2672
  var import_theme_ui21 = require("theme-ui");
2287
2673
 
2288
2674
  // src/components/Container.tsx
2675
+ init_tsup_inject();
2289
2676
  var import_theme_ui22 = require("theme-ui");
2290
2677
  // Annotate the CommonJS export names for ESM import in node:
2291
2678
  0 && (module.exports = {
2679
+ BaseStyles,
2292
2680
  Box,
2293
2681
  Button,
2294
2682
  Card,
@@ -2316,14 +2704,18 @@ var import_theme_ui22 = require("theme-ui");
2316
2704
  useResponsiveValue,
2317
2705
  useTheme
2318
2706
  });
2319
- /**
2320
- * (c) Iconify
2321
- *
2322
- * For the full copyright and license information, please view the license.txt
2323
- * files at https://github.com/iconify/iconify
2324
- *
2325
- * Licensed under MIT.
2326
- *
2327
- * @license MIT
2328
- * @version 1.0.3
2707
+ /*! Bundled license information:
2708
+
2709
+ iconify-icon/dist/iconify-icon.mjs:
2710
+ (**
2711
+ * (c) Iconify
2712
+ *
2713
+ * For the full copyright and license information, please view the license.txt
2714
+ * files at https://github.com/iconify/iconify
2715
+ *
2716
+ * Licensed under MIT.
2717
+ *
2718
+ * @license MIT
2719
+ * @version 1.0.5
2720
+ *)
2329
2721
  */