@ttoss/ui 1.30.1 → 1.30.3

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/esm/index.js CHANGED
@@ -1,122 +1,400 @@
1
1
  /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
3
8
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __esm = (fn, res) => function __init() {
10
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
11
+ };
12
+ var __commonJS = (cb, mod) => function __require() {
13
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
14
+ };
15
+ var __copyProps = (to, from, except, desc) => {
16
+ if (from && typeof from === "object" || typeof from === "function") {
17
+ for (let key of __getOwnPropNames(from))
18
+ if (!__hasOwnProp.call(to, key) && key !== except)
19
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
20
+ }
21
+ return to;
22
+ };
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
+ // If the importer is in node compatibility mode or this is not an ESM
25
+ // file that has been converted to a CommonJS file using a Babel-
26
+ // compatible transform (i.e. "__esModule" has not been set), then set
27
+ // "default" to the CommonJS "module.exports" for node compatibility.
28
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
+ mod
30
+ ));
4
31
  var __publicField = (obj, key, value) => {
5
32
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
6
33
  return value;
7
34
  };
8
35
 
36
+ // tsup.inject.js
37
+ import * as React from "react";
38
+ var init_tsup_inject = __esm({
39
+ "tsup.inject.js"() {
40
+ "use strict";
41
+ }
42
+ });
43
+
44
+ // ../../node_modules/deepmerge/dist/cjs.js
45
+ var require_cjs = __commonJS({
46
+ "../../node_modules/deepmerge/dist/cjs.js"(exports, module) {
47
+ "use strict";
48
+ init_tsup_inject();
49
+ var isMergeableObject = function isMergeableObject2(value) {
50
+ return isNonNullObject(value) && !isSpecial(value);
51
+ };
52
+ function isNonNullObject(value) {
53
+ return !!value && typeof value === "object";
54
+ }
55
+ function isSpecial(value) {
56
+ var stringValue = Object.prototype.toString.call(value);
57
+ return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
58
+ }
59
+ var canUseSymbol = typeof Symbol === "function" && Symbol.for;
60
+ var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
61
+ function isReactElement(value) {
62
+ return value.$$typeof === REACT_ELEMENT_TYPE;
63
+ }
64
+ function emptyTarget(val) {
65
+ return Array.isArray(val) ? [] : {};
66
+ }
67
+ function cloneUnlessOtherwiseSpecified(value, options) {
68
+ return options.clone !== false && options.isMergeableObject(value) ? deepmerge2(emptyTarget(value), value, options) : value;
69
+ }
70
+ function defaultArrayMerge(target, source, options) {
71
+ return target.concat(source).map(function(element) {
72
+ return cloneUnlessOtherwiseSpecified(element, options);
73
+ });
74
+ }
75
+ function getMergeFunction(key, options) {
76
+ if (!options.customMerge) {
77
+ return deepmerge2;
78
+ }
79
+ var customMerge = options.customMerge(key);
80
+ return typeof customMerge === "function" ? customMerge : deepmerge2;
81
+ }
82
+ function getEnumerableOwnPropertySymbols(target) {
83
+ return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
84
+ return Object.propertyIsEnumerable.call(target, symbol);
85
+ }) : [];
86
+ }
87
+ function getKeys(target) {
88
+ return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
89
+ }
90
+ function propertyIsOnObject(object, property) {
91
+ try {
92
+ return property in object;
93
+ } catch (_) {
94
+ return false;
95
+ }
96
+ }
97
+ function propertyIsUnsafe(target, key) {
98
+ return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
99
+ }
100
+ function mergeObject(target, source, options) {
101
+ var destination = {};
102
+ if (options.isMergeableObject(target)) {
103
+ getKeys(target).forEach(function(key) {
104
+ destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
105
+ });
106
+ }
107
+ getKeys(source).forEach(function(key) {
108
+ if (propertyIsUnsafe(target, key)) {
109
+ return;
110
+ }
111
+ if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
112
+ destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
113
+ } else {
114
+ destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
115
+ }
116
+ });
117
+ return destination;
118
+ }
119
+ function deepmerge2(target, source, options) {
120
+ options = options || {};
121
+ options.arrayMerge = options.arrayMerge || defaultArrayMerge;
122
+ options.isMergeableObject = options.isMergeableObject || isMergeableObject;
123
+ options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
124
+ var sourceIsArray = Array.isArray(source);
125
+ var targetIsArray = Array.isArray(target);
126
+ var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
127
+ if (!sourceAndTargetTypesMatch) {
128
+ return cloneUnlessOtherwiseSpecified(source, options);
129
+ } else if (sourceIsArray) {
130
+ return options.arrayMerge(target, source, options);
131
+ } else {
132
+ return mergeObject(target, source, options);
133
+ }
134
+ }
135
+ deepmerge2.all = function deepmergeAll(array, options) {
136
+ if (!Array.isArray(array)) {
137
+ throw new Error("first argument should be an array");
138
+ }
139
+ return array.reduce(function(prev, next) {
140
+ return deepmerge2(prev, next, options);
141
+ }, {});
142
+ };
143
+ var deepmerge_1 = deepmerge2;
144
+ module.exports = deepmerge_1;
145
+ }
146
+ });
147
+
9
148
  // src/index.ts
149
+ init_tsup_inject();
150
+ import { BaseStyles } from "theme-ui";
10
151
  import { useResponsiveValue, useBreakpointIndex } from "@theme-ui/match-media";
11
152
 
12
153
  // src/theme/ThemeProvider.tsx
13
- import * as React2 from "react";
154
+ init_tsup_inject();
14
155
 
15
156
  // ../theme/dist/esm/index.js
157
+ init_tsup_inject();
158
+ var import_deepmerge = __toESM(require_cjs());
159
+ var fontSizes = {
160
+ "2xs": "0.5rem",
161
+ xs: "0.75rem",
162
+ sm: "0.875rem",
163
+ base: "1rem",
164
+ lg: "1.125rem",
165
+ xl: "1.25rem",
166
+ "2xl": "1.5rem",
167
+ "3xl": "1.875rem",
168
+ "4xl": "2.25rem",
169
+ "5xl": "3rem",
170
+ "6xl": "3.75rem",
171
+ "7xl": "4.5rem",
172
+ "8xl": "6rem",
173
+ "9xl": "8rem"
174
+ };
175
+ var fontWeights = {
176
+ thin: 100,
177
+ extralight: 200,
178
+ light: 300,
179
+ normal: 400,
180
+ medium: 500,
181
+ semibold: 600,
182
+ bold: 700,
183
+ extrabold: 800
184
+ };
185
+ var letterSpacings = {
186
+ tighter: "-0.05em",
187
+ tight: "-0.025em",
188
+ normal: "0em",
189
+ wide: "0.025em",
190
+ wider: "0.05em",
191
+ widest: "0.1em"
192
+ };
193
+ var space = {
194
+ none: 0,
195
+ "2xs": "2px",
196
+ xs: "3px",
197
+ sm: "5px",
198
+ md: "8px",
199
+ lg: "13px",
200
+ xl: "21px",
201
+ "2xl": "34px",
202
+ "3xl": "55px",
203
+ "4xl": "89px",
204
+ "5xl": "144px",
205
+ "6xl": "233px",
206
+ "7xl": "377px"
207
+ };
208
+ var coreFonts = {
209
+ main: '"Atkinson Hyperlegible", sans-serif',
210
+ contrast: '"Work Sans", sans-serif',
211
+ monospace: '"Inconsolata", sans-serif'
212
+ };
213
+ var brandColors = {
214
+ complimentary: "#f5f5f5",
215
+ main: "#292c2a",
216
+ darkNeutral: "#515389",
217
+ accent: "#0000ff",
218
+ lightNeutral: "#e3e3e3"
219
+ };
220
+ var coreColors = {
221
+ ...brandColors,
222
+ gray100: "#f0f1f3",
223
+ gray200: "#ced1d7",
224
+ gray300: "#acb1ba",
225
+ gray400: "#8b919e",
226
+ gray500: "#6b7280",
227
+ gray600: "#535863",
228
+ gray700: "#3b3f46",
229
+ gray800: "#23252a",
230
+ gray900: "#0b0b0d",
231
+ black: "#000000",
232
+ red100: "#ffebeb",
233
+ red200: "#fdbfbf",
234
+ red300: "#f99595",
235
+ red400: "#f56c6c",
236
+ red500: "#ef4444",
237
+ red600: "#e42828",
238
+ red700: "#c62121",
239
+ white: "#ffffff"
240
+ };
241
+ var coreBorders = {
242
+ none: "0px solid",
243
+ thin: "1px solid",
244
+ medium: "2px solid",
245
+ thick: "4px solid"
246
+ };
247
+ var coreRadii = {
248
+ sharp: "0px",
249
+ xs: "2px",
250
+ sm: "4px",
251
+ md: "6px",
252
+ lg: "8px",
253
+ xl: "12px",
254
+ "2xl": "16px",
255
+ "3xl": "24px",
256
+ circle: "9999px"
257
+ };
16
258
  var BruttalTheme = {
259
+ /**
260
+ * Tokens
261
+ */
262
+ fontSizes,
263
+ fontWeights,
264
+ letterSpacings,
265
+ space,
17
266
  colors: {
18
- text: "#0D0D0D",
19
- background: "#fff",
20
- backgroundBrand: "#C2C2C2",
21
- primary: "#0D0D0D",
22
- secondary: "#639",
23
- gray: "#555",
24
- muted: "#f6f6f6",
25
- danger: "red",
26
- accent: "#0000FF",
27
- textOnSurface: "#FFFFFF"
267
+ background: coreColors.lightNeutral,
268
+ text: coreColors.gray900,
269
+ muted: coreColors.gray200,
270
+ outline: coreColors.gray200,
271
+ primary: coreColors.main,
272
+ onPrimary: coreColors.white,
273
+ secondary: coreColors.gray500,
274
+ onSecondary: coreColors.white,
275
+ highlight: coreColors.darkNeutral,
276
+ onHighlight: coreColors.white,
277
+ accent: coreColors.accent,
278
+ onAccent: coreColors.white,
279
+ neutral: coreColors.white,
280
+ onNeutral: coreColors.gray900
28
281
  },
29
- space: [0, 4, 8, 16, 32, 64, 128, 256, 512, 1024],
30
282
  fonts: {
31
- body: '"Inconsolata", sans-serif',
32
- heading: '"Work Sans", sans-serif',
33
- monospace: '"Inconsolata", sans-serif'
283
+ h1: coreFonts.contrast,
284
+ h2: coreFonts.contrast,
285
+ h3: coreFonts.contrast,
286
+ h4: coreFonts.contrast,
287
+ h5: coreFonts.contrast,
288
+ h6: coreFonts.contrast,
289
+ body: coreFonts.main,
290
+ highlight: coreFonts.main,
291
+ caption: coreFonts.monospace
34
292
  },
35
- fontSizes: {
36
- xxs: "0.5rem",
37
- xs: "0.75rem",
38
- sm: "0.875rem",
39
- base: "1rem",
40
- lg: "1.125rem",
41
- xl: "1.25rem",
42
- "2xl": "1.5rem",
43
- "3xl": "1.875rem",
44
- "4xl": "2.25rem",
45
- "5xl": "3rem",
46
- "6xl": "3.75rem",
47
- "7xl": "4.5rem",
48
- "8xl": "6rem",
49
- "9xl": "8rem"
293
+ borders: {
294
+ default: coreBorders.medium
50
295
  },
51
- fontWeights: {
52
- thin: 100,
53
- extralight: 200,
54
- light: 300,
55
- normal: 400,
56
- medium: 500,
57
- semibold: 600,
58
- bold: 700,
59
- extrabold: 800
60
- },
61
- letterSpacings: {
62
- tighter: "-0.05em",
63
- tight: "-0.025em",
64
- normal: "0em",
65
- wide: "0.025em",
66
- wider: "0.05em",
67
- widest: "0.1em"
296
+ radii: {
297
+ default: coreRadii.sm
68
298
  },
299
+ /**
300
+ * Global styles
301
+ */
69
302
  styles: {
70
303
  root: {
71
304
  fontFamily: "body",
72
305
  fontWeight: "normal"
73
- },
74
- a: {
75
- color: "primary",
76
- textDecoration: "underline",
77
- cursor: "pointer",
78
- fontFamily: "body"
79
- },
80
- progress: {
81
- color: "primary",
82
- backgroundColor: "background"
83
306
  }
84
307
  },
85
- borders: [0, "3px solid #0D0D0D"],
308
+ /**
309
+ * Components
310
+ */
86
311
  buttons: {
87
- cta: {
88
- color: "white",
89
- backgroundColor: "primary"
90
- },
91
- muted: {
92
- color: "text",
93
- backgroundColor: "muted"
94
- },
95
- danger: {
96
- color: "white",
97
- backgroundColor: "danger"
312
+ accent: {
313
+ backgroundColor: "accent",
314
+ color: "onAccent",
315
+ fontFamily: "highlight",
316
+ fontWeight: "bold",
317
+ border: "default",
318
+ borderRadius: "default",
319
+ borderColor: "accent",
320
+ ":hover:not(:active,[disabled])": {
321
+ backgroundColor: "highlight",
322
+ color: "onHighlight",
323
+ borderColor: "highlight"
324
+ },
325
+ ":disabled": {
326
+ cursor: "default",
327
+ backgroundColor: "muted",
328
+ borderColor: "muted"
329
+ }
98
330
  },
99
331
  primary: {
332
+ backgroundColor: "primary",
333
+ color: "onPrimary",
334
+ fontFamily: "body",
335
+ border: "default",
336
+ borderRadius: "default",
337
+ borderColor: "outline",
338
+ ":hover:not(:active,[disabled])": {
339
+ backgroundColor: "highlight",
340
+ color: "onHighlight",
341
+ borderColor: "highlight"
342
+ },
343
+ ":active": {
344
+ backgroundColor: "primary",
345
+ color: "onPrimary",
346
+ borderColor: "outline"
347
+ },
100
348
  ":disabled": {
101
- backgroundColor: "backgroundBrand",
102
- cursor: "default"
349
+ cursor: "default",
350
+ backgroundColor: "muted",
351
+ borderColor: "muted"
103
352
  }
104
353
  },
105
354
  secondary: {
106
- color: "text",
107
- backgroundColor: "white",
108
- borderColor: "text",
109
- borderWidth: 1,
110
- borderStyle: "solid",
355
+ backgroundColor: "secondary",
356
+ color: "onSecondary",
357
+ fontFamily: "body",
358
+ border: "default",
359
+ borderRadius: "default",
360
+ borderColor: "outline",
361
+ ":hover:not(:active,[disabled])": {
362
+ backgroundColor: "highlight",
363
+ color: "onHighlight",
364
+ borderColor: "highlight"
365
+ },
366
+ ":disabled": {
367
+ cursor: "default",
368
+ backgroundColor: "muted",
369
+ borderColor: "muted"
370
+ }
371
+ },
372
+ neutral: {
373
+ backgroundColor: "neutral",
374
+ color: "onNeutral",
375
+ fontFamily: "body",
376
+ border: "default",
377
+ borderRadius: "default",
378
+ borderColor: "outline",
379
+ ":hover:not(:active,[disabled])": {
380
+ backgroundColor: "highlight",
381
+ color: "onHighlight",
382
+ borderColor: "highlight"
383
+ },
111
384
  ":disabled": {
112
- opacity: 0.5,
113
- cursor: "default"
385
+ cursor: "default",
386
+ backgroundColor: "muted",
387
+ borderColor: "muted"
114
388
  }
389
+ },
390
+ danger: {
391
+ color: "white",
392
+ backgroundColor: "danger"
115
393
  }
116
394
  },
117
395
  cards: {
118
396
  primary: {
119
- backgroundColor: "background",
397
+ backgroundColor: "primary",
120
398
  border: "1px solid black",
121
399
  padding: [4, 5],
122
400
  display: "flex",
@@ -174,109 +452,59 @@ var BruttalTheme = {
174
452
  };
175
453
  var BruttalFonts = [
176
454
  "https://fonts.googleapis.com/css?family=Inconsolata:wght@100;200;300;400;500;700;800;900",
177
- "https://fonts.googleapis.com/css?family=Work+Sans:wght@100;200;300;400;500;700;800;900"
455
+ "https://fonts.googleapis.com/css?family=Work+Sans:wght@100;200;300;400;500;700;800;900",
456
+ "https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400;1,700&display=swap"
178
457
  ];
179
458
 
180
459
  // src/theme/ThemeProvider.tsx
181
460
  import { Global, css } from "@emotion/react";
182
- import { ThemeProvider as ThemeUiProvider, merge } from "theme-ui";
461
+ import { ThemeProvider as ThemeUiProvider } from "theme-ui";
183
462
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
184
463
  var ThemeProvider = ({
185
464
  children,
186
- theme = {},
465
+ theme = BruttalTheme,
187
466
  fonts = BruttalFonts
188
467
  }) => {
189
- const mergedTheme = React2.useMemo(() => {
190
- if (typeof theme === "function") {
191
- return theme;
192
- }
193
- return merge(BruttalTheme, theme);
194
- }, [theme]);
195
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(ThemeUiProvider, { theme: mergedTheme, children: [
196
- fonts.map((url) => {
197
- return /* @__PURE__ */ jsx(
198
- Global,
199
- {
200
- styles: css`
201
- @import url('${url}');
202
- `
203
- },
204
- url
205
- );
206
- }),
468
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(ThemeUiProvider, { theme, children: [
469
+ /* @__PURE__ */ jsx(
470
+ Global,
471
+ {
472
+ styles: css`
473
+ ${fonts.map((url) => {
474
+ return `@import url('${url}');`;
475
+ }).join("\n")}
476
+ `
477
+ }
478
+ ),
207
479
  children
208
480
  ] }) });
209
481
  };
210
- var ThemeProvider_default = ThemeProvider;
211
482
 
212
483
  // src/theme/useTheme.ts
484
+ init_tsup_inject();
213
485
  import { useThemeUI } from "theme-ui";
214
486
  var useTheme = useThemeUI;
215
487
 
216
488
  // src/components/Box.tsx
489
+ init_tsup_inject();
217
490
  import { Box } from "theme-ui";
218
491
 
219
492
  // src/components/Button.tsx
220
- import { Button as ButtonUi } from "theme-ui";
221
- import { jsx as jsx2 } from "react/jsx-runtime";
222
- var Button = (props) => {
223
- return /* @__PURE__ */ jsx2(
224
- ButtonUi,
225
- {
226
- ...props,
227
- sx: { cursor: "pointer", fontFamily: "body", ...props.sx }
228
- }
229
- );
230
- };
231
-
232
- // src/components/Card.tsx
233
- import { Card } from "theme-ui";
234
-
235
- // src/components/Divider.tsx
236
- import { Divider } from "theme-ui";
237
-
238
- // src/components/Flex.tsx
239
- import { Flex } from "theme-ui";
240
-
241
- // src/components/Grid.tsx
242
- import { Grid } from "theme-ui";
243
-
244
- // src/components/Heading.tsx
245
- import { Heading } from "theme-ui";
246
-
247
- // src/components/Image.tsx
248
- import { Image } from "theme-ui";
249
-
250
- // src/components/Input.tsx
251
- import { Input } from "theme-ui";
252
-
253
- // src/components/Label.tsx
254
- import { Label } from "theme-ui";
255
-
256
- // src/components/Link.tsx
257
- import { Link } from "theme-ui";
258
-
259
- // src/components/LinearProgress.tsx
493
+ init_tsup_inject();
494
+ import * as React3 from "react";
260
495
  import {
261
- Progress
496
+ Button as ButtonUi
262
497
  } from "theme-ui";
263
498
 
264
- // src/components/Text.tsx
265
- import { Text } from "theme-ui";
266
-
267
- // src/components/Select.tsx
268
- import { Select } from "theme-ui";
269
-
270
- // src/components/Spinner.tsx
271
- import { Spinner } from "theme-ui";
272
-
273
- // src/components/Radio.tsx
274
- import { Radio } from "theme-ui";
499
+ // src/components/Icon.tsx
500
+ init_tsup_inject();
275
501
 
276
502
  // ../../node_modules/@iconify-icon/react/dist/iconify.mjs
277
- import React3 from "react";
503
+ init_tsup_inject();
504
+ import React2 from "react";
278
505
 
279
506
  // ../../node_modules/iconify-icon/dist/iconify-icon.mjs
507
+ init_tsup_inject();
280
508
  var defaultIconDimensions = Object.freeze(
281
509
  {
282
510
  left: 0,
@@ -1468,6 +1696,7 @@ function parseIconValue(value, onload) {
1468
1696
  value,
1469
1697
  name,
1470
1698
  data
1699
+ // could be 'null' -> icon is missing
1471
1700
  };
1472
1701
  }
1473
1702
  const loading = loadIcons$1([name], () => onload(value, name, getIconData(name)));
@@ -1819,7 +2048,12 @@ function exportFunctions() {
1819
2048
  if (typeof preload === "object" && preload !== null) {
1820
2049
  (preload instanceof Array ? preload : [preload]).forEach((item) => {
1821
2050
  try {
1822
- if (typeof item !== "object" || item === null || item instanceof Array || typeof item.icons !== "object" || typeof item.prefix !== "string" || !addCollection$1(item)) {
2051
+ if (
2052
+ // Check if item is an object and not null/array
2053
+ typeof item !== "object" || item === null || item instanceof Array || // Check for 'icons' and 'prefix'
2054
+ typeof item.icons !== "object" || typeof item.prefix !== "string" || // Add icon set
2055
+ !addCollection$1(item)
2056
+ ) {
1823
2057
  console.error(err);
1824
2058
  }
1825
2059
  } catch (e) {
@@ -2000,19 +2234,28 @@ function defineIconifyIcon(name = "iconify-icon") {
2000
2234
  return ConflictingClass;
2001
2235
  }
2002
2236
  const attributes = [
2237
+ // Icon
2003
2238
  "icon",
2239
+ // Mode
2004
2240
  "mode",
2005
2241
  "inline",
2242
+ // Customisations
2006
2243
  "width",
2007
2244
  "height",
2008
2245
  "rotate",
2009
2246
  "flip"
2010
2247
  ];
2011
2248
  const IconifyIcon = class extends ParentClass {
2249
+ /**
2250
+ * Constructor
2251
+ */
2012
2252
  constructor() {
2013
2253
  super();
2254
+ // Root
2014
2255
  __publicField(this, "_shadowRoot");
2256
+ // State
2015
2257
  __publicField(this, "_state");
2258
+ // Attributes check queued
2016
2259
  __publicField(this, "_checkQueued", false);
2017
2260
  const root = this._shadowRoot = this.attachShadow({
2018
2261
  mode: "open"
@@ -2024,9 +2267,32 @@ function defineIconifyIcon(name = "iconify-icon") {
2024
2267
  }, inline);
2025
2268
  this._queueCheck();
2026
2269
  }
2270
+ /**
2271
+ * Observed attributes
2272
+ */
2027
2273
  static get observedAttributes() {
2028
2274
  return attributes.slice(0);
2029
2275
  }
2276
+ /**
2277
+ * Observed properties that are different from attributes
2278
+ *
2279
+ * Experimental! Need to test with various frameworks that support it
2280
+ */
2281
+ /*
2282
+ static get properties() {
2283
+ return {
2284
+ inline: {
2285
+ type: Boolean,
2286
+ reflect: true,
2287
+ },
2288
+ // Not listing other attributes because they are strings or combination
2289
+ // of string and another type. Cannot have multiple types
2290
+ };
2291
+ }
2292
+ */
2293
+ /**
2294
+ * Attribute has changed
2295
+ */
2030
2296
  attributeChangedCallback(name2) {
2031
2297
  if (name2 === "inline") {
2032
2298
  const newInline = getInline(this);
@@ -2039,6 +2305,9 @@ function defineIconifyIcon(name = "iconify-icon") {
2039
2305
  this._queueCheck();
2040
2306
  }
2041
2307
  }
2308
+ /**
2309
+ * Get/set icon
2310
+ */
2042
2311
  get icon() {
2043
2312
  const value = this.getAttribute("icon");
2044
2313
  if (value && value.slice(0, 1) === "{") {
@@ -2055,12 +2324,22 @@ function defineIconifyIcon(name = "iconify-icon") {
2055
2324
  }
2056
2325
  this.setAttribute("icon", value);
2057
2326
  }
2327
+ /**
2328
+ * Get/set inline
2329
+ */
2058
2330
  get inline() {
2059
2331
  return getInline(this);
2060
2332
  }
2061
2333
  set inline(value) {
2062
- this.setAttribute("inline", value ? "true" : null);
2334
+ if (value) {
2335
+ this.setAttribute("inline", "true");
2336
+ } else {
2337
+ this.removeAttribute("inline");
2338
+ }
2063
2339
  }
2340
+ /**
2341
+ * Restart animation
2342
+ */
2064
2343
  restartAnimation() {
2065
2344
  const state = this._state;
2066
2345
  if (state.rendered) {
@@ -2075,10 +2354,16 @@ function defineIconifyIcon(name = "iconify-icon") {
2075
2354
  renderIcon(root, state);
2076
2355
  }
2077
2356
  }
2357
+ /**
2358
+ * Get status
2359
+ */
2078
2360
  get status() {
2079
2361
  const state = this._state;
2080
2362
  return state.rendered ? "rendered" : state.icon.data === null ? "failed" : "loading";
2081
2363
  }
2364
+ /**
2365
+ * Queue attributes re-check
2366
+ */
2082
2367
  _queueCheck() {
2083
2368
  if (!this._checkQueued) {
2084
2369
  this._checkQueued = true;
@@ -2087,6 +2372,9 @@ function defineIconifyIcon(name = "iconify-icon") {
2087
2372
  });
2088
2373
  }
2089
2374
  }
2375
+ /**
2376
+ * Check for changes
2377
+ */
2090
2378
  _check() {
2091
2379
  if (!this._checkQueued) {
2092
2380
  return;
@@ -2107,6 +2395,9 @@ function defineIconifyIcon(name = "iconify-icon") {
2107
2395
  this._renderIcon(state.icon, customisations, mode);
2108
2396
  }
2109
2397
  }
2398
+ /**
2399
+ * Icon value has changed
2400
+ */
2110
2401
  _iconChanged(newValue) {
2111
2402
  const icon = parseIconValue(newValue, (value, name2, data) => {
2112
2403
  const state = this._state;
@@ -2130,10 +2421,16 @@ function defineIconifyIcon(name = "iconify-icon") {
2130
2421
  this._state = setPendingState(icon, this._state.inline, this._state);
2131
2422
  }
2132
2423
  }
2424
+ /**
2425
+ * Got new icon data, icon is ready to (re)render
2426
+ */
2133
2427
  _gotIconData(icon) {
2134
2428
  this._checkQueued = false;
2135
2429
  this._renderIcon(icon, getCustomisations(this), this.getAttribute("mode"));
2136
2430
  }
2431
+ /**
2432
+ * Re-render based on icon data
2433
+ */
2137
2434
  _renderIcon(icon, customisations, attrMode) {
2138
2435
  const renderedMode = getRenderMode(icon.data.body, attrMode);
2139
2436
  const inline = this._state.inline;
@@ -2154,7 +2451,11 @@ function defineIconifyIcon(name = "iconify-icon") {
2154
2451
  return this.getAttribute(attr);
2155
2452
  },
2156
2453
  set: function(value) {
2157
- this.setAttribute(attr, value);
2454
+ if (value !== null) {
2455
+ this.setAttribute(attr, value);
2456
+ } else {
2457
+ this.removeAttribute(attr);
2458
+ }
2158
2459
  }
2159
2460
  });
2160
2461
  }
@@ -2170,7 +2471,7 @@ var IconifyIconComponent = defineIconifyIcon() || exportFunctions();
2170
2471
  var { enableCache, disableCache, iconExists, getIcon, listIcons, addIcon, addCollection, calculateSize, buildIcon, loadIcons, loadIcon, addAPIProvider, _api } = IconifyIconComponent;
2171
2472
 
2172
2473
  // ../../node_modules/@iconify-icon/react/dist/iconify.mjs
2173
- var Icon = React3.forwardRef(
2474
+ var Icon = React2.forwardRef(
2174
2475
  (props, ref) => {
2175
2476
  const newProps = {
2176
2477
  ...props,
@@ -2185,23 +2486,124 @@ var Icon = React3.forwardRef(
2185
2486
  if (props.className) {
2186
2487
  newProps["class"] = props.className;
2187
2488
  }
2188
- return React3.createElement("iconify-icon", newProps);
2489
+ return React2.createElement("iconify-icon", newProps);
2189
2490
  }
2190
2491
  );
2191
2492
 
2192
2493
  // src/components/Icon.tsx
2193
- import { jsx as jsx3 } from "react/jsx-runtime";
2494
+ import { jsx as jsx2 } from "react/jsx-runtime";
2194
2495
  var Icon2 = (props) => {
2195
- return /* @__PURE__ */ jsx3(Icon, { ...props });
2496
+ return /* @__PURE__ */ jsx2(Icon, { ...props });
2196
2497
  };
2197
2498
 
2499
+ // src/components/Button.tsx
2500
+ import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
2501
+ var RenderIcon = ({ icon }) => {
2502
+ if (!icon) {
2503
+ return null;
2504
+ }
2505
+ if (typeof icon === "string") {
2506
+ return /* @__PURE__ */ jsx3(Fragment2, { children: /* @__PURE__ */ jsx3(Icon2, { icon }) });
2507
+ }
2508
+ return /* @__PURE__ */ jsx3(Fragment2, { children: icon });
2509
+ };
2510
+ var MemoizedRenderIcon = React3.memo(RenderIcon);
2511
+ var Button = React3.forwardRef(
2512
+ (props, ref) => {
2513
+ const { children, leftIcon, rightIcon, ...restProps } = props;
2514
+ return /* @__PURE__ */ jsxs2(
2515
+ ButtonUi,
2516
+ {
2517
+ ref,
2518
+ ...restProps,
2519
+ sx: {
2520
+ cursor: "pointer",
2521
+ paddingX: "lg",
2522
+ paddingY: "md",
2523
+ display: "inline-flex",
2524
+ alignItems: "center",
2525
+ gap: "lg",
2526
+ ...restProps.sx
2527
+ },
2528
+ children: [
2529
+ /* @__PURE__ */ jsx3(MemoizedRenderIcon, { icon: leftIcon }),
2530
+ children,
2531
+ /* @__PURE__ */ jsx3(MemoizedRenderIcon, { icon: rightIcon })
2532
+ ]
2533
+ }
2534
+ );
2535
+ }
2536
+ );
2537
+ Button.displayName = "Button";
2538
+
2539
+ // src/components/Card.tsx
2540
+ init_tsup_inject();
2541
+ import { Card } from "theme-ui";
2542
+
2543
+ // src/components/Divider.tsx
2544
+ init_tsup_inject();
2545
+ import { Divider } from "theme-ui";
2546
+
2547
+ // src/components/Flex.tsx
2548
+ init_tsup_inject();
2549
+ import { Flex } from "theme-ui";
2550
+
2551
+ // src/components/Grid.tsx
2552
+ init_tsup_inject();
2553
+ import { Grid } from "theme-ui";
2554
+
2555
+ // src/components/Heading.tsx
2556
+ init_tsup_inject();
2557
+ import { Heading } from "theme-ui";
2558
+
2559
+ // src/components/Image.tsx
2560
+ init_tsup_inject();
2561
+ import { Image } from "theme-ui";
2562
+
2563
+ // src/components/Input.tsx
2564
+ init_tsup_inject();
2565
+ import { Input } from "theme-ui";
2566
+
2567
+ // src/components/Label.tsx
2568
+ init_tsup_inject();
2569
+ import { Label } from "theme-ui";
2570
+
2571
+ // src/components/Link.tsx
2572
+ init_tsup_inject();
2573
+ import { Link } from "theme-ui";
2574
+
2575
+ // src/components/LinearProgress.tsx
2576
+ init_tsup_inject();
2577
+ import {
2578
+ Progress
2579
+ } from "theme-ui";
2580
+
2581
+ // src/components/Text.tsx
2582
+ init_tsup_inject();
2583
+ import { Text } from "theme-ui";
2584
+
2585
+ // src/components/Select.tsx
2586
+ init_tsup_inject();
2587
+ import { Select } from "theme-ui";
2588
+
2589
+ // src/components/Spinner.tsx
2590
+ init_tsup_inject();
2591
+ import { Spinner } from "theme-ui";
2592
+
2593
+ // src/components/Radio.tsx
2594
+ init_tsup_inject();
2595
+ import { Radio } from "theme-ui";
2596
+
2198
2597
  // src/components/Slider.tsx
2598
+ init_tsup_inject();
2199
2599
  import { Slider } from "theme-ui";
2200
2600
 
2201
2601
  // src/components/Checkbox.tsx
2602
+ init_tsup_inject();
2202
2603
  import { Checkbox } from "theme-ui";
2203
2604
 
2204
2605
  // src/components/InfiniteLinearProgress.tsx
2606
+ init_tsup_inject();
2205
2607
  import * as React4 from "react";
2206
2608
  import { jsx as jsx4 } from "react/jsx-runtime";
2207
2609
  var MAX_PROGRESS = 100;
@@ -2232,11 +2634,14 @@ var InfiniteLinearProgress = () => {
2232
2634
  };
2233
2635
 
2234
2636
  // src/components/Textarea.tsx
2637
+ init_tsup_inject();
2235
2638
  import { Textarea } from "theme-ui";
2236
2639
 
2237
2640
  // src/components/Container.tsx
2641
+ init_tsup_inject();
2238
2642
  import { Container } from "theme-ui";
2239
2643
  export {
2644
+ BaseStyles,
2240
2645
  Box,
2241
2646
  Button,
2242
2647
  Card,
@@ -2259,19 +2664,23 @@ export {
2259
2664
  Spinner,
2260
2665
  Text,
2261
2666
  Textarea,
2262
- ThemeProvider_default as ThemeProvider,
2667
+ ThemeProvider,
2263
2668
  useBreakpointIndex,
2264
2669
  useResponsiveValue,
2265
2670
  useTheme
2266
2671
  };
2267
- /**
2268
- * (c) Iconify
2269
- *
2270
- * For the full copyright and license information, please view the license.txt
2271
- * files at https://github.com/iconify/iconify
2272
- *
2273
- * Licensed under MIT.
2274
- *
2275
- * @license MIT
2276
- * @version 1.0.3
2672
+ /*! Bundled license information:
2673
+
2674
+ iconify-icon/dist/iconify-icon.mjs:
2675
+ (**
2676
+ * (c) Iconify
2677
+ *
2678
+ * For the full copyright and license information, please view the license.txt
2679
+ * files at https://github.com/iconify/iconify
2680
+ *
2681
+ * Licensed under MIT.
2682
+ *
2683
+ * @license MIT
2684
+ * @version 1.0.5
2685
+ *)
2277
2686
  */