@okshaun/components 0.4.5 → 0.5.0
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.d.ts +90 -13
- package/dist/index.js +671 -56
- package/dist/index.js.map +1 -1
- package/dist/panda.buildinfo.json +66 -9
- package/dist/preset.js +617 -77
- package/dist/preset.js.map +1 -1
- package/dist/sprite.symbol.html +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import React__default, { forwardRef, useMemo, createElement, useEffect, useState, useRef,
|
|
2
|
+
import React__default, { forwardRef, useMemo, createElement, useEffect, useState, useRef, createContext, useContext, useCallback, useLayoutEffect, useSyncExternalStore } from "react";
|
|
3
3
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
4
4
|
import * as ReactDOM from "react-dom";
|
|
5
5
|
import { b as breakpoints, c as containerSizes } from "./size.primitives-j2MFgtrT.js";
|
|
@@ -239,7 +239,7 @@ function normalizeHTMLProps(props) {
|
|
|
239
239
|
return Object.fromEntries(Object.entries(props).map(([key, value]) => [convert(key), value]));
|
|
240
240
|
}
|
|
241
241
|
normalizeHTMLProps.keys = htmlProps;
|
|
242
|
-
const conditionsStr = "_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_complete,_incomplete,_dragging,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_grabbed,_underValue,_overValue,_atValue,_default,_optional,_open,_closed,_fullscreen,_loading,_hidden,_current,_currentPage,_currentStep,_today,_unavailable,_rangeStart,_rangeEnd,_now,_topmost,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_icon,_starting,_noscript,_invertedColors,_collapsed,_error,_paused,xs,xsOnly,xsDown,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,2xl,2xlOnly,2xlDown,xsToSm,xsToMd,xsToLg,xsToXl,xsTo2xl,smToMd,smToLg,smToXl,smTo2xl,mdToLg,mdToXl,mdTo2xl,lgToXl,lgTo2xl,xlTo2xl,@/xs,@/sm,@/md,@/lg,@/xl,@/2xl,@/3xl,@/4xl,@/5xl,@/6xl,@/7xl,@/8xl,base";
|
|
242
|
+
const conditionsStr = "_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_complete,_incomplete,_dragging,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_grabbed,_underValue,_overValue,_atValue,_default,_optional,_open,_closed,_fullscreen,_loading,_hidden,_current,_currentPage,_currentStep,_today,_unavailable,_rangeStart,_rangeEnd,_now,_topmost,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_icon,_starting,_noscript,_invertedColors,_deleted,_collapsed,_error,_paused,xs,xsOnly,xsDown,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,2xl,2xlOnly,2xlDown,xsToSm,xsToMd,xsToLg,xsToXl,xsTo2xl,smToMd,smToLg,smToXl,smTo2xl,mdToLg,mdToXl,mdTo2xl,lgToXl,lgTo2xl,xlTo2xl,@/xs,@/sm,@/md,@/lg,@/xl,@/2xl,@/3xl,@/4xl,@/5xl,@/6xl,@/7xl,@/8xl,base";
|
|
243
243
|
const conditions = new Set(conditionsStr.split(","));
|
|
244
244
|
const conditionRegex = /^@|&|&$/;
|
|
245
245
|
function isCondition(value) {
|
|
@@ -449,38 +449,6 @@ const mergeRecipes = (recipeA, recipeB) => {
|
|
|
449
449
|
}
|
|
450
450
|
});
|
|
451
451
|
};
|
|
452
|
-
const badgeFn = /* @__PURE__ */ createRecipe("badge", {
|
|
453
|
-
"variant": "subtle",
|
|
454
|
-
"size": "md"
|
|
455
|
-
}, []);
|
|
456
|
-
const badgeVariantMap = {
|
|
457
|
-
"variant": [
|
|
458
|
-
"solid",
|
|
459
|
-
"subtle",
|
|
460
|
-
"outline"
|
|
461
|
-
],
|
|
462
|
-
"size": [
|
|
463
|
-
"sm",
|
|
464
|
-
"md",
|
|
465
|
-
"lg"
|
|
466
|
-
]
|
|
467
|
-
};
|
|
468
|
-
const badgeVariantKeys = Object.keys(badgeVariantMap);
|
|
469
|
-
const badge = /* @__PURE__ */ Object.assign(memo(badgeFn.recipeFn), {
|
|
470
|
-
__recipe__: true,
|
|
471
|
-
__name__: "badge",
|
|
472
|
-
__getCompoundVariantCss__: badgeFn.__getCompoundVariantCss__,
|
|
473
|
-
raw: (props) => props,
|
|
474
|
-
variantKeys: badgeVariantKeys,
|
|
475
|
-
variantMap: badgeVariantMap,
|
|
476
|
-
merge(recipe) {
|
|
477
|
-
return mergeRecipes(this, recipe);
|
|
478
|
-
},
|
|
479
|
-
splitVariantProps(props) {
|
|
480
|
-
return splitProps$1(props, badgeVariantKeys);
|
|
481
|
-
},
|
|
482
|
-
getVariantProps: badgeFn.getVariantProps
|
|
483
|
-
});
|
|
484
452
|
const boxFn = /* @__PURE__ */ createRecipe("box", {}, []);
|
|
485
453
|
const boxVariantMap = {};
|
|
486
454
|
const boxVariantKeys = Object.keys(boxVariantMap);
|
|
@@ -1284,6 +1252,99 @@ const toggleInput = /* @__PURE__ */ Object.assign(memo(toggleInputFn.recipeFn),
|
|
|
1284
1252
|
},
|
|
1285
1253
|
getVariantProps: toggleInputFn.getVariantProps
|
|
1286
1254
|
});
|
|
1255
|
+
const badgeDefaultVariants = {
|
|
1256
|
+
"size": "md",
|
|
1257
|
+
"appearance": "danger"
|
|
1258
|
+
};
|
|
1259
|
+
const badgeCompoundVariants = [
|
|
1260
|
+
{
|
|
1261
|
+
"dot": false,
|
|
1262
|
+
"size": "sm",
|
|
1263
|
+
"css": {
|
|
1264
|
+
"indicator": {
|
|
1265
|
+
"minW": "16",
|
|
1266
|
+
"h": "fit"
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
},
|
|
1270
|
+
{
|
|
1271
|
+
"dot": false,
|
|
1272
|
+
"size": "md",
|
|
1273
|
+
"css": {
|
|
1274
|
+
"indicator": {
|
|
1275
|
+
"minW": "20",
|
|
1276
|
+
"h": "fit"
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
},
|
|
1280
|
+
{
|
|
1281
|
+
"dot": false,
|
|
1282
|
+
"size": "lg",
|
|
1283
|
+
"css": {
|
|
1284
|
+
"indicator": {
|
|
1285
|
+
"minW": "24",
|
|
1286
|
+
"h": "fit"
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1290
|
+
];
|
|
1291
|
+
const badgeSlotNames = [
|
|
1292
|
+
[
|
|
1293
|
+
"root",
|
|
1294
|
+
"badge__root"
|
|
1295
|
+
],
|
|
1296
|
+
[
|
|
1297
|
+
"indicator",
|
|
1298
|
+
"badge__indicator"
|
|
1299
|
+
]
|
|
1300
|
+
];
|
|
1301
|
+
const badgeSlotFns = /* @__PURE__ */ badgeSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, badgeDefaultVariants, getSlotCompoundVariant(badgeCompoundVariants, slotName))]);
|
|
1302
|
+
const badgeFn = memo((props = {}) => {
|
|
1303
|
+
return Object.fromEntries(badgeSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]));
|
|
1304
|
+
});
|
|
1305
|
+
const badgeVariantKeys = [
|
|
1306
|
+
"size",
|
|
1307
|
+
"standalone",
|
|
1308
|
+
"dot",
|
|
1309
|
+
"appearance"
|
|
1310
|
+
];
|
|
1311
|
+
const getVariantProps$9 = (variants) => ({ ...badgeDefaultVariants, ...compact(variants) });
|
|
1312
|
+
const badge = /* @__PURE__ */ Object.assign(badgeFn, {
|
|
1313
|
+
__recipe__: false,
|
|
1314
|
+
__name__: "badge",
|
|
1315
|
+
raw: (props) => props,
|
|
1316
|
+
classNameMap: {},
|
|
1317
|
+
variantKeys: badgeVariantKeys,
|
|
1318
|
+
variantMap: {
|
|
1319
|
+
"size": [
|
|
1320
|
+
"sm",
|
|
1321
|
+
"md",
|
|
1322
|
+
"lg"
|
|
1323
|
+
],
|
|
1324
|
+
"standalone": [
|
|
1325
|
+
"true",
|
|
1326
|
+
"false"
|
|
1327
|
+
],
|
|
1328
|
+
"dot": [
|
|
1329
|
+
"true",
|
|
1330
|
+
"false"
|
|
1331
|
+
],
|
|
1332
|
+
"appearance": [
|
|
1333
|
+
"neutral",
|
|
1334
|
+
"subtle",
|
|
1335
|
+
"inverted",
|
|
1336
|
+
"subtle-inverted",
|
|
1337
|
+
"success",
|
|
1338
|
+
"danger",
|
|
1339
|
+
"warning",
|
|
1340
|
+
"info"
|
|
1341
|
+
]
|
|
1342
|
+
},
|
|
1343
|
+
splitVariantProps(props) {
|
|
1344
|
+
return splitProps$1(props, badgeVariantKeys);
|
|
1345
|
+
},
|
|
1346
|
+
getVariantProps: getVariantProps$9
|
|
1347
|
+
});
|
|
1287
1348
|
const buttonDefaultVariants = {
|
|
1288
1349
|
"appearance": "default",
|
|
1289
1350
|
"size": "default"
|
|
@@ -1382,7 +1443,7 @@ const buttonVariantKeys = [
|
|
|
1382
1443
|
"iconBefore",
|
|
1383
1444
|
"iconAfter"
|
|
1384
1445
|
];
|
|
1385
|
-
const getVariantProps$
|
|
1446
|
+
const getVariantProps$8 = (variants) => ({ ...buttonDefaultVariants, ...compact(variants) });
|
|
1386
1447
|
const button = /* @__PURE__ */ Object.assign(buttonFn, {
|
|
1387
1448
|
__recipe__: false,
|
|
1388
1449
|
__name__: "button",
|
|
@@ -1412,7 +1473,7 @@ const button = /* @__PURE__ */ Object.assign(buttonFn, {
|
|
|
1412
1473
|
splitVariantProps(props) {
|
|
1413
1474
|
return splitProps$1(props, buttonVariantKeys);
|
|
1414
1475
|
},
|
|
1415
|
-
getVariantProps: getVariantProps$
|
|
1476
|
+
getVariantProps: getVariantProps$8
|
|
1416
1477
|
});
|
|
1417
1478
|
const iconButtonDefaultVariants = {
|
|
1418
1479
|
"appearance": "default",
|
|
@@ -1437,7 +1498,7 @@ const iconButtonVariantKeys = [
|
|
|
1437
1498
|
"appearance",
|
|
1438
1499
|
"size"
|
|
1439
1500
|
];
|
|
1440
|
-
const getVariantProps$
|
|
1501
|
+
const getVariantProps$7 = (variants) => ({ ...iconButtonDefaultVariants, ...compact(variants) });
|
|
1441
1502
|
const iconButton = /* @__PURE__ */ Object.assign(iconButtonFn, {
|
|
1442
1503
|
__recipe__: false,
|
|
1443
1504
|
__name__: "iconButton",
|
|
@@ -1460,7 +1521,7 @@ const iconButton = /* @__PURE__ */ Object.assign(iconButtonFn, {
|
|
|
1460
1521
|
splitVariantProps(props) {
|
|
1461
1522
|
return splitProps$1(props, iconButtonVariantKeys);
|
|
1462
1523
|
},
|
|
1463
|
-
getVariantProps: getVariantProps$
|
|
1524
|
+
getVariantProps: getVariantProps$7
|
|
1464
1525
|
});
|
|
1465
1526
|
const checkboxDefaultVariants = {};
|
|
1466
1527
|
const checkboxCompoundVariants = [];
|
|
@@ -1483,7 +1544,7 @@ const checkboxFn = memo((props = {}) => {
|
|
|
1483
1544
|
return Object.fromEntries(checkboxSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]));
|
|
1484
1545
|
});
|
|
1485
1546
|
const checkboxVariantKeys = [];
|
|
1486
|
-
const getVariantProps$
|
|
1547
|
+
const getVariantProps$6 = (variants) => ({ ...checkboxDefaultVariants, ...compact(variants) });
|
|
1487
1548
|
const checkbox = /* @__PURE__ */ Object.assign(checkboxFn, {
|
|
1488
1549
|
__recipe__: false,
|
|
1489
1550
|
__name__: "checkbox",
|
|
@@ -1494,7 +1555,7 @@ const checkbox = /* @__PURE__ */ Object.assign(checkboxFn, {
|
|
|
1494
1555
|
splitVariantProps(props) {
|
|
1495
1556
|
return splitProps$1(props, checkboxVariantKeys);
|
|
1496
1557
|
},
|
|
1497
|
-
getVariantProps: getVariantProps$
|
|
1558
|
+
getVariantProps: getVariantProps$6
|
|
1498
1559
|
});
|
|
1499
1560
|
const radioDefaultVariants = {};
|
|
1500
1561
|
const radioCompoundVariants = [];
|
|
@@ -1517,7 +1578,7 @@ const radioFn = memo((props = {}) => {
|
|
|
1517
1578
|
return Object.fromEntries(radioSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]));
|
|
1518
1579
|
});
|
|
1519
1580
|
const radioVariantKeys = [];
|
|
1520
|
-
const getVariantProps$
|
|
1581
|
+
const getVariantProps$5 = (variants) => ({ ...radioDefaultVariants, ...compact(variants) });
|
|
1521
1582
|
const radio = /* @__PURE__ */ Object.assign(radioFn, {
|
|
1522
1583
|
__recipe__: false,
|
|
1523
1584
|
__name__: "radio",
|
|
@@ -1528,7 +1589,7 @@ const radio = /* @__PURE__ */ Object.assign(radioFn, {
|
|
|
1528
1589
|
splitVariantProps(props) {
|
|
1529
1590
|
return splitProps$1(props, radioVariantKeys);
|
|
1530
1591
|
},
|
|
1531
|
-
getVariantProps: getVariantProps$
|
|
1592
|
+
getVariantProps: getVariantProps$5
|
|
1532
1593
|
});
|
|
1533
1594
|
const tooltipDefaultVariants = {
|
|
1534
1595
|
"position": "bottom"
|
|
@@ -1657,7 +1718,7 @@ const tooltipVariantKeys = [
|
|
|
1657
1718
|
"position",
|
|
1658
1719
|
"caret"
|
|
1659
1720
|
];
|
|
1660
|
-
const getVariantProps$
|
|
1721
|
+
const getVariantProps$4 = (variants) => ({ ...tooltipDefaultVariants, ...compact(variants) });
|
|
1661
1722
|
const tooltip = /* @__PURE__ */ Object.assign(tooltipFn, {
|
|
1662
1723
|
__recipe__: false,
|
|
1663
1724
|
__name__: "tooltip",
|
|
@@ -1687,7 +1748,7 @@ const tooltip = /* @__PURE__ */ Object.assign(tooltipFn, {
|
|
|
1687
1748
|
splitVariantProps(props) {
|
|
1688
1749
|
return splitProps$1(props, tooltipVariantKeys);
|
|
1689
1750
|
},
|
|
1690
|
-
getVariantProps: getVariantProps$
|
|
1751
|
+
getVariantProps: getVariantProps$4
|
|
1691
1752
|
});
|
|
1692
1753
|
const menuDefaultVariants = {
|
|
1693
1754
|
"size": "default",
|
|
@@ -1748,7 +1809,7 @@ const menuVariantKeys = [
|
|
|
1748
1809
|
"size",
|
|
1749
1810
|
"indicatorPosition"
|
|
1750
1811
|
];
|
|
1751
|
-
const getVariantProps$
|
|
1812
|
+
const getVariantProps$3 = (variants) => ({ ...menuDefaultVariants, ...compact(variants) });
|
|
1752
1813
|
const menu = /* @__PURE__ */ Object.assign(menuFn, {
|
|
1753
1814
|
__recipe__: false,
|
|
1754
1815
|
__name__: "menu",
|
|
@@ -1769,7 +1830,7 @@ const menu = /* @__PURE__ */ Object.assign(menuFn, {
|
|
|
1769
1830
|
splitVariantProps(props) {
|
|
1770
1831
|
return splitProps$1(props, menuVariantKeys);
|
|
1771
1832
|
},
|
|
1772
|
-
getVariantProps: getVariantProps$
|
|
1833
|
+
getVariantProps: getVariantProps$3
|
|
1773
1834
|
});
|
|
1774
1835
|
const toggleDefaultVariants = {};
|
|
1775
1836
|
const toggleCompoundVariants = [];
|
|
@@ -1796,7 +1857,7 @@ const toggleFn = memo((props = {}) => {
|
|
|
1796
1857
|
return Object.fromEntries(toggleSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]));
|
|
1797
1858
|
});
|
|
1798
1859
|
const toggleVariantKeys = [];
|
|
1799
|
-
const getVariantProps = (variants) => ({ ...toggleDefaultVariants, ...compact(variants) });
|
|
1860
|
+
const getVariantProps$2 = (variants) => ({ ...toggleDefaultVariants, ...compact(variants) });
|
|
1800
1861
|
const toggle = /* @__PURE__ */ Object.assign(toggleFn, {
|
|
1801
1862
|
__recipe__: false,
|
|
1802
1863
|
__name__: "toggle",
|
|
@@ -1807,9 +1868,174 @@ const toggle = /* @__PURE__ */ Object.assign(toggleFn, {
|
|
|
1807
1868
|
splitVariantProps(props) {
|
|
1808
1869
|
return splitProps$1(props, toggleVariantKeys);
|
|
1809
1870
|
},
|
|
1871
|
+
getVariantProps: getVariantProps$2
|
|
1872
|
+
});
|
|
1873
|
+
const chipDefaultVariants = {
|
|
1874
|
+
"size": "default"
|
|
1875
|
+
};
|
|
1876
|
+
const chipCompoundVariants = [
|
|
1877
|
+
{
|
|
1878
|
+
"size": "default",
|
|
1879
|
+
"before": true,
|
|
1880
|
+
"css": {
|
|
1881
|
+
"container": {
|
|
1882
|
+
"ps": "2"
|
|
1883
|
+
}
|
|
1884
|
+
}
|
|
1885
|
+
},
|
|
1886
|
+
{
|
|
1887
|
+
"size": "default",
|
|
1888
|
+
"after": true,
|
|
1889
|
+
"css": {
|
|
1890
|
+
"container": {
|
|
1891
|
+
"pe": "2"
|
|
1892
|
+
}
|
|
1893
|
+
}
|
|
1894
|
+
},
|
|
1895
|
+
{
|
|
1896
|
+
"size": "small",
|
|
1897
|
+
"before": true,
|
|
1898
|
+
"css": {
|
|
1899
|
+
"container": {
|
|
1900
|
+
"ps": "2"
|
|
1901
|
+
}
|
|
1902
|
+
}
|
|
1903
|
+
},
|
|
1904
|
+
{
|
|
1905
|
+
"size": "small",
|
|
1906
|
+
"after": true,
|
|
1907
|
+
"css": {
|
|
1908
|
+
"container": {
|
|
1909
|
+
"pe": "2"
|
|
1910
|
+
}
|
|
1911
|
+
}
|
|
1912
|
+
},
|
|
1913
|
+
{
|
|
1914
|
+
"size": "large",
|
|
1915
|
+
"before": true,
|
|
1916
|
+
"css": {
|
|
1917
|
+
"container": {
|
|
1918
|
+
"ps": "4"
|
|
1919
|
+
}
|
|
1920
|
+
}
|
|
1921
|
+
},
|
|
1922
|
+
{
|
|
1923
|
+
"size": "large",
|
|
1924
|
+
"after": true,
|
|
1925
|
+
"css": {
|
|
1926
|
+
"container": {
|
|
1927
|
+
"pe": "4"
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
];
|
|
1932
|
+
const chipSlotNames = [
|
|
1933
|
+
[
|
|
1934
|
+
"container",
|
|
1935
|
+
"chip__container"
|
|
1936
|
+
],
|
|
1937
|
+
[
|
|
1938
|
+
"icon",
|
|
1939
|
+
"chip__icon"
|
|
1940
|
+
]
|
|
1941
|
+
];
|
|
1942
|
+
const chipSlotFns = /* @__PURE__ */ chipSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, chipDefaultVariants, getSlotCompoundVariant(chipCompoundVariants, slotName))]);
|
|
1943
|
+
const chipFn = memo((props = {}) => {
|
|
1944
|
+
return Object.fromEntries(chipSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]));
|
|
1945
|
+
});
|
|
1946
|
+
const chipVariantKeys = [
|
|
1947
|
+
"size",
|
|
1948
|
+
"before",
|
|
1949
|
+
"after"
|
|
1950
|
+
];
|
|
1951
|
+
const getVariantProps$1 = (variants) => ({ ...chipDefaultVariants, ...compact(variants) });
|
|
1952
|
+
const chip = /* @__PURE__ */ Object.assign(chipFn, {
|
|
1953
|
+
__recipe__: false,
|
|
1954
|
+
__name__: "chip",
|
|
1955
|
+
raw: (props) => props,
|
|
1956
|
+
classNameMap: {},
|
|
1957
|
+
variantKeys: chipVariantKeys,
|
|
1958
|
+
variantMap: {
|
|
1959
|
+
"size": [
|
|
1960
|
+
"default",
|
|
1961
|
+
"small",
|
|
1962
|
+
"large"
|
|
1963
|
+
],
|
|
1964
|
+
"before": [
|
|
1965
|
+
"true"
|
|
1966
|
+
],
|
|
1967
|
+
"after": [
|
|
1968
|
+
"true"
|
|
1969
|
+
]
|
|
1970
|
+
},
|
|
1971
|
+
splitVariantProps(props) {
|
|
1972
|
+
return splitProps$1(props, chipVariantKeys);
|
|
1973
|
+
},
|
|
1974
|
+
getVariantProps: getVariantProps$1
|
|
1975
|
+
});
|
|
1976
|
+
const avatarDefaultVariants = {
|
|
1977
|
+
"size": "md",
|
|
1978
|
+
"shape": "circle"
|
|
1979
|
+
};
|
|
1980
|
+
const avatarCompoundVariants = [];
|
|
1981
|
+
const avatarSlotNames = [
|
|
1982
|
+
[
|
|
1983
|
+
"root",
|
|
1984
|
+
"avatar__root"
|
|
1985
|
+
],
|
|
1986
|
+
[
|
|
1987
|
+
"image",
|
|
1988
|
+
"avatar__image"
|
|
1989
|
+
],
|
|
1990
|
+
[
|
|
1991
|
+
"fallback",
|
|
1992
|
+
"avatar__fallback"
|
|
1993
|
+
],
|
|
1994
|
+
[
|
|
1995
|
+
"presence",
|
|
1996
|
+
"avatar__presence"
|
|
1997
|
+
],
|
|
1998
|
+
[
|
|
1999
|
+
"status",
|
|
2000
|
+
"avatar__status"
|
|
2001
|
+
]
|
|
2002
|
+
];
|
|
2003
|
+
const avatarSlotFns = /* @__PURE__ */ avatarSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, avatarDefaultVariants, getSlotCompoundVariant(avatarCompoundVariants, slotName))]);
|
|
2004
|
+
const avatarFn = memo((props = {}) => {
|
|
2005
|
+
return Object.fromEntries(avatarSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]));
|
|
2006
|
+
});
|
|
2007
|
+
const avatarVariantKeys = [
|
|
2008
|
+
"size",
|
|
2009
|
+
"shape"
|
|
2010
|
+
];
|
|
2011
|
+
const getVariantProps = (variants) => ({ ...avatarDefaultVariants, ...compact(variants) });
|
|
2012
|
+
const avatar = /* @__PURE__ */ Object.assign(avatarFn, {
|
|
2013
|
+
__recipe__: false,
|
|
2014
|
+
__name__: "avatar",
|
|
2015
|
+
raw: (props) => props,
|
|
2016
|
+
classNameMap: {},
|
|
2017
|
+
variantKeys: avatarVariantKeys,
|
|
2018
|
+
variantMap: {
|
|
2019
|
+
"size": [
|
|
2020
|
+
"xs",
|
|
2021
|
+
"sm",
|
|
2022
|
+
"md",
|
|
2023
|
+
"lg",
|
|
2024
|
+
"xl",
|
|
2025
|
+
"2xl"
|
|
2026
|
+
],
|
|
2027
|
+
"shape": [
|
|
2028
|
+
"circle",
|
|
2029
|
+
"square",
|
|
2030
|
+
"hexagon"
|
|
2031
|
+
]
|
|
2032
|
+
},
|
|
2033
|
+
splitVariantProps(props) {
|
|
2034
|
+
return splitProps$1(props, avatarVariantKeys);
|
|
2035
|
+
},
|
|
1810
2036
|
getVariantProps
|
|
1811
2037
|
});
|
|
1812
|
-
var userGeneratedStr = "css,pos,insetX,insetY,insetEnd,end,insetStart,start,flexDir,p,pl,pr,pt,pb,py,paddingY,paddingX,px,pe,paddingEnd,ps,paddingStart,ml,mr,mt,mb,m,my,marginY,mx,marginX,me,marginEnd,ms,marginStart,ringWidth,ringColor,ring,ringOffset,w,minW,maxW,h,minH,maxH,textShadowColor,bgPosition,bgPositionX,bgPositionY,bgAttachment,bgClip,bg,bgColor,bgOrigin,bgImage,bgRepeat,bgBlendMode,bgSize,bgGradient,bgLinear,bgRadial,bgConic,rounded,roundedTopLeft,roundedTopRight,roundedBottomRight,roundedBottomLeft,roundedTop,roundedRight,roundedBottom,roundedLeft,roundedStartStart,roundedStartEnd,roundedStart,roundedEndStart,roundedEndEnd,roundedEnd,borderX,borderXWidth,borderXColor,borderY,borderYWidth,borderYColor,borderStart,borderStartWidth,borderStartColor,borderEnd,borderEndWidth,borderEndColor,shadow,shadowColor,x,y,z,scrollMarginY,scrollMarginX,scrollPaddingY,scrollPaddingX,aspectRatio,boxDecorationBreak,zIndex,boxSizing,objectPosition,objectFit,overscrollBehavior,overscrollBehaviorX,overscrollBehaviorY,position,top,left,inset,insetInline,insetBlock,insetBlockEnd,insetBlockStart,insetInlineEnd,insetInlineStart,right,bottom,float,visibility,display,hideFrom,hideBelow,flexBasis,flex,flexDirection,flexGrow,flexShrink,gridTemplateColumns,gridTemplateRows,gridColumn,gridRow,gridColumnStart,gridColumnEnd,gridAutoFlow,gridAutoColumns,gridAutoRows,gap,gridGap,gridRowGap,gridColumnGap,rowGap,columnGap,justifyContent,alignContent,alignItems,alignSelf,padding,paddingLeft,paddingRight,paddingTop,paddingBottom,paddingBlock,paddingBlockEnd,paddingBlockStart,paddingInline,paddingInlineEnd,paddingInlineStart,marginLeft,marginRight,marginTop,marginBottom,margin,marginBlock,marginBlockEnd,marginBlockStart,marginInline,marginInlineEnd,marginInlineStart,spaceX,spaceY,outlineWidth,outlineColor,outline,outlineOffset,focusRing,focusVisibleRing,focusRingColor,focusRingOffset,focusRingWidth,focusRingStyle,divideX,divideY,divideColor,divideStyle,width,inlineSize,minWidth,minInlineSize,maxWidth,maxInlineSize,height,blockSize,minHeight,minBlockSize,maxHeight,maxBlockSize,boxSize,color,fontFamily,fontSize,fontSizeAdjust,fontPalette,fontKerning,fontFeatureSettings,fontWeight,fontSmoothing,fontVariant,fontVariantAlternates,fontVariantCaps,fontVariationSettings,fontVariantNumeric,letterSpacing,lineHeight,textAlign,textDecoration,textDecorationColor,textEmphasisColor,textDecorationStyle,textDecorationThickness,textUnderlineOffset,textTransform,textIndent,textShadow,textOverflow,verticalAlign,wordBreak,textWrap,truncate,lineClamp,listStyleType,listStylePosition,listStyleImage,listStyle,backgroundPosition,backgroundPositionX,backgroundPositionY,backgroundAttachment,backgroundClip,background,backgroundColor,backgroundOrigin,backgroundImage,backgroundRepeat,backgroundBlendMode,backgroundSize,backgroundGradient,backgroundLinear,backgroundRadial,backgroundConic,textGradient,gradientFromPosition,gradientToPosition,gradientFrom,gradientTo,gradientVia,gradientViaPosition,borderRadius,borderTopLeftRadius,borderTopRightRadius,borderBottomRightRadius,borderBottomLeftRadius,borderTopRadius,borderRightRadius,borderBottomRadius,borderLeftRadius,borderStartStartRadius,borderStartEndRadius,borderStartRadius,borderEndStartRadius,borderEndEndRadius,borderEndRadius,border,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,borderBlockStartWidth,borderBlockEndWidth,borderColor,borderInline,borderInlineWidth,borderInlineColor,borderBlock,borderBlockWidth,borderBlockColor,borderLeft,borderLeftColor,borderInlineStart,borderInlineStartWidth,borderInlineStartColor,borderRight,borderRightColor,borderInlineEnd,borderInlineEndWidth,borderInlineEndColor,borderTop,borderTopColor,borderBottom,borderBottomColor,borderBlockEnd,borderBlockEndColor,borderBlockStart,borderBlockStartColor,opacity,boxShadow,boxShadowColor,mixBlendMode,filter,brightness,contrast,grayscale,hueRotate,invert,saturate,sepia,dropShadow,blur,backdropFilter,backdropBlur,backdropBrightness,backdropContrast,backdropGrayscale,backdropHueRotate,backdropInvert,backdropOpacity,backdropSaturate,backdropSepia,borderCollapse,borderSpacing,borderSpacingX,borderSpacingY,tableLayout,transitionTimingFunction,transitionDelay,transitionDuration,transitionProperty,transition,animation,animationName,animationTimingFunction,animationDuration,animationDelay,animationPlayState,animationComposition,animationFillMode,animationDirection,animationIterationCount,animationRange,animationState,animationRangeStart,animationRangeEnd,animationTimeline,transformOrigin,transformBox,transformStyle,transform,rotate,rotateX,rotateY,rotateZ,scale,scaleX,scaleY,translate,translateX,translateY,translateZ,accentColor,caretColor,scrollBehavior,scrollbar,scrollbarColor,scrollbarGutter,scrollbarWidth,scrollMargin,scrollMarginLeft,scrollMarginRight,scrollMarginTop,scrollMarginBottom,scrollMarginBlock,scrollMarginBlockEnd,scrollMarginBlockStart,scrollMarginInline,scrollMarginInlineEnd,scrollMarginInlineStart,scrollPadding,scrollPaddingBlock,scrollPaddingBlockStart,scrollPaddingBlockEnd,scrollPaddingInline,scrollPaddingInlineEnd,scrollPaddingInlineStart,scrollPaddingLeft,scrollPaddingRight,scrollPaddingTop,scrollPaddingBottom,scrollSnapAlign,scrollSnapStop,scrollSnapType,scrollSnapStrictness,scrollSnapMargin,scrollSnapMarginTop,scrollSnapMarginBottom,scrollSnapMarginLeft,scrollSnapMarginRight,scrollSnapCoordinate,scrollSnapDestination,scrollSnapPointsX,scrollSnapPointsY,scrollSnapTypeX,scrollSnapTypeY,scrollTimeline,scrollTimelineAxis,scrollTimelineName,touchAction,userSelect,overflow,overflowWrap,overflowX,overflowY,overflowAnchor,overflowBlock,overflowInline,overflowClipBox,overflowClipMargin,overscrollBehaviorBlock,overscrollBehaviorInline,fill,stroke,strokeWidth,strokeDasharray,strokeDashoffset,strokeLinecap,strokeLinejoin,strokeMiterlimit,strokeOpacity,srOnly,debug,appearance,backfaceVisibility,clipPath,hyphens,mask,maskImage,maskSize,textSizeAdjust,container,containerName,containerType,cursor,colorPalette,_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_complete,_incomplete,_dragging,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_grabbed,_underValue,_overValue,_atValue,_default,_optional,_open,_closed,_fullscreen,_loading,_hidden,_current,_currentPage,_currentStep,_today,_unavailable,_rangeStart,_rangeEnd,_now,_topmost,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_icon,_starting,_noscript,_invertedColors,_collapsed,_error,_paused,xs,xsOnly,xsDown,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,2xl,2xlOnly,2xlDown,xsToSm,xsToMd,xsToLg,xsToXl,xsTo2xl,smToMd,smToLg,smToXl,smTo2xl,mdToLg,mdToXl,mdTo2xl,lgToXl,lgTo2xl,xlTo2xl,@/xs,@/sm,@/md,@/lg,@/xl,@/2xl,@/3xl,@/4xl,@/5xl,@/6xl,@/7xl,@/8xl,textStyle";
|
|
2038
|
+
var userGeneratedStr = "css,pos,insetX,insetY,insetEnd,end,insetStart,start,flexDir,p,pl,pr,pt,pb,py,paddingY,paddingX,px,pe,paddingEnd,ps,paddingStart,ml,mr,mt,mb,m,my,marginY,mx,marginX,me,marginEnd,ms,marginStart,ringWidth,ringColor,ring,ringOffset,w,minW,maxW,h,minH,maxH,textShadowColor,bgPosition,bgPositionX,bgPositionY,bgAttachment,bgClip,bg,bgColor,bgOrigin,bgImage,bgRepeat,bgBlendMode,bgSize,bgGradient,bgLinear,bgRadial,bgConic,rounded,roundedTopLeft,roundedTopRight,roundedBottomRight,roundedBottomLeft,roundedTop,roundedRight,roundedBottom,roundedLeft,roundedStartStart,roundedStartEnd,roundedStart,roundedEndStart,roundedEndEnd,roundedEnd,borderX,borderXWidth,borderXColor,borderY,borderYWidth,borderYColor,borderStart,borderStartWidth,borderStartColor,borderEnd,borderEndWidth,borderEndColor,shadow,shadowColor,x,y,z,scrollMarginY,scrollMarginX,scrollPaddingY,scrollPaddingX,aspectRatio,boxDecorationBreak,zIndex,boxSizing,objectPosition,objectFit,overscrollBehavior,overscrollBehaviorX,overscrollBehaviorY,position,top,left,inset,insetInline,insetBlock,insetBlockEnd,insetBlockStart,insetInlineEnd,insetInlineStart,right,bottom,float,visibility,display,hideFrom,hideBelow,flexBasis,flex,flexDirection,flexGrow,flexShrink,gridTemplateColumns,gridTemplateRows,gridColumn,gridRow,gridColumnStart,gridColumnEnd,gridAutoFlow,gridAutoColumns,gridAutoRows,gap,gridGap,gridRowGap,gridColumnGap,rowGap,columnGap,justifyContent,alignContent,alignItems,alignSelf,padding,paddingLeft,paddingRight,paddingTop,paddingBottom,paddingBlock,paddingBlockEnd,paddingBlockStart,paddingInline,paddingInlineEnd,paddingInlineStart,marginLeft,marginRight,marginTop,marginBottom,margin,marginBlock,marginBlockEnd,marginBlockStart,marginInline,marginInlineEnd,marginInlineStart,spaceX,spaceY,outlineWidth,outlineColor,outline,outlineOffset,focusRing,focusVisibleRing,focusRingColor,focusRingOffset,focusRingWidth,focusRingStyle,divideX,divideY,divideColor,divideStyle,width,inlineSize,minWidth,minInlineSize,maxWidth,maxInlineSize,height,blockSize,minHeight,minBlockSize,maxHeight,maxBlockSize,boxSize,color,fontFamily,fontSize,fontSizeAdjust,fontPalette,fontKerning,fontFeatureSettings,fontWeight,fontSmoothing,fontVariant,fontVariantAlternates,fontVariantCaps,fontVariationSettings,fontVariantNumeric,letterSpacing,lineHeight,textAlign,textDecoration,textDecorationColor,textEmphasisColor,textDecorationStyle,textDecorationThickness,textUnderlineOffset,textTransform,textIndent,textShadow,textOverflow,verticalAlign,wordBreak,textWrap,truncate,lineClamp,listStyleType,listStylePosition,listStyleImage,listStyle,backgroundPosition,backgroundPositionX,backgroundPositionY,backgroundAttachment,backgroundClip,background,backgroundColor,backgroundOrigin,backgroundImage,backgroundRepeat,backgroundBlendMode,backgroundSize,backgroundGradient,backgroundLinear,backgroundRadial,backgroundConic,textGradient,gradientFromPosition,gradientToPosition,gradientFrom,gradientTo,gradientVia,gradientViaPosition,borderRadius,borderTopLeftRadius,borderTopRightRadius,borderBottomRightRadius,borderBottomLeftRadius,borderTopRadius,borderRightRadius,borderBottomRadius,borderLeftRadius,borderStartStartRadius,borderStartEndRadius,borderStartRadius,borderEndStartRadius,borderEndEndRadius,borderEndRadius,border,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,borderBlockStartWidth,borderBlockEndWidth,borderColor,borderInline,borderInlineWidth,borderInlineColor,borderBlock,borderBlockWidth,borderBlockColor,borderLeft,borderLeftColor,borderInlineStart,borderInlineStartWidth,borderInlineStartColor,borderRight,borderRightColor,borderInlineEnd,borderInlineEndWidth,borderInlineEndColor,borderTop,borderTopColor,borderBottom,borderBottomColor,borderBlockEnd,borderBlockEndColor,borderBlockStart,borderBlockStartColor,opacity,boxShadow,boxShadowColor,mixBlendMode,filter,brightness,contrast,grayscale,hueRotate,invert,saturate,sepia,dropShadow,blur,backdropFilter,backdropBlur,backdropBrightness,backdropContrast,backdropGrayscale,backdropHueRotate,backdropInvert,backdropOpacity,backdropSaturate,backdropSepia,borderCollapse,borderSpacing,borderSpacingX,borderSpacingY,tableLayout,transitionTimingFunction,transitionDelay,transitionDuration,transitionProperty,transition,animation,animationName,animationTimingFunction,animationDuration,animationDelay,animationPlayState,animationComposition,animationFillMode,animationDirection,animationIterationCount,animationRange,animationState,animationRangeStart,animationRangeEnd,animationTimeline,transformOrigin,transformBox,transformStyle,transform,rotate,rotateX,rotateY,rotateZ,scale,scaleX,scaleY,translate,translateX,translateY,translateZ,accentColor,caretColor,scrollBehavior,scrollbar,scrollbarColor,scrollbarGutter,scrollbarWidth,scrollMargin,scrollMarginLeft,scrollMarginRight,scrollMarginTop,scrollMarginBottom,scrollMarginBlock,scrollMarginBlockEnd,scrollMarginBlockStart,scrollMarginInline,scrollMarginInlineEnd,scrollMarginInlineStart,scrollPadding,scrollPaddingBlock,scrollPaddingBlockStart,scrollPaddingBlockEnd,scrollPaddingInline,scrollPaddingInlineEnd,scrollPaddingInlineStart,scrollPaddingLeft,scrollPaddingRight,scrollPaddingTop,scrollPaddingBottom,scrollSnapAlign,scrollSnapStop,scrollSnapType,scrollSnapStrictness,scrollSnapMargin,scrollSnapMarginTop,scrollSnapMarginBottom,scrollSnapMarginLeft,scrollSnapMarginRight,scrollSnapCoordinate,scrollSnapDestination,scrollSnapPointsX,scrollSnapPointsY,scrollSnapTypeX,scrollSnapTypeY,scrollTimeline,scrollTimelineAxis,scrollTimelineName,touchAction,userSelect,overflow,overflowWrap,overflowX,overflowY,overflowAnchor,overflowBlock,overflowInline,overflowClipBox,overflowClipMargin,overscrollBehaviorBlock,overscrollBehaviorInline,fill,stroke,strokeWidth,strokeDasharray,strokeDashoffset,strokeLinecap,strokeLinejoin,strokeMiterlimit,strokeOpacity,srOnly,debug,appearance,backfaceVisibility,clipPath,hyphens,mask,maskImage,maskSize,textSizeAdjust,container,containerName,containerType,cursor,colorPalette,_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_complete,_incomplete,_dragging,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_grabbed,_underValue,_overValue,_atValue,_default,_optional,_open,_closed,_fullscreen,_loading,_hidden,_current,_currentPage,_currentStep,_today,_unavailable,_rangeStart,_rangeEnd,_now,_topmost,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_icon,_starting,_noscript,_invertedColors,_deleted,_collapsed,_error,_paused,xs,xsOnly,xsDown,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,2xl,2xlOnly,2xlDown,xsToSm,xsToMd,xsToLg,xsToXl,xsTo2xl,smToMd,smToLg,smToXl,smTo2xl,mdToLg,mdToXl,mdTo2xl,lgToXl,lgTo2xl,xlTo2xl,@/xs,@/sm,@/md,@/lg,@/xl,@/2xl,@/3xl,@/4xl,@/5xl,@/6xl,@/7xl,@/8xl,textStyle";
|
|
1813
2039
|
var userGenerated = userGeneratedStr.split(",");
|
|
1814
2040
|
var cssPropertiesStr = "WebkitAppearance,WebkitBorderBefore,WebkitBorderBeforeColor,WebkitBorderBeforeStyle,WebkitBorderBeforeWidth,WebkitBoxReflect,WebkitLineClamp,WebkitMask,WebkitMaskAttachment,WebkitMaskClip,WebkitMaskComposite,WebkitMaskImage,WebkitMaskOrigin,WebkitMaskPosition,WebkitMaskPositionX,WebkitMaskPositionY,WebkitMaskRepeat,WebkitMaskRepeatX,WebkitMaskRepeatY,WebkitMaskSize,WebkitOverflowScrolling,WebkitTapHighlightColor,WebkitTextFillColor,WebkitTextStroke,WebkitTextStrokeColor,WebkitTextStrokeWidth,WebkitTouchCallout,WebkitUserModify,WebkitUserSelect,accentColor,alignContent,alignItems,alignSelf,alignTracks,all,anchorName,anchorScope,animation,animationComposition,animationDelay,animationDirection,animationDuration,animationFillMode,animationIterationCount,animationName,animationPlayState,animationRange,animationRangeEnd,animationRangeStart,animationTimeline,animationTimingFunction,appearance,aspectRatio,backdropFilter,backfaceVisibility,background,backgroundAttachment,backgroundBlendMode,backgroundClip,backgroundColor,backgroundImage,backgroundOrigin,backgroundPosition,backgroundPositionX,backgroundPositionY,backgroundRepeat,backgroundSize,blockSize,border,borderBlock,borderBlockColor,borderBlockEnd,borderBlockEndColor,borderBlockEndStyle,borderBlockEndWidth,borderBlockStart,borderBlockStartColor,borderBlockStartStyle,borderBlockStartWidth,borderBlockStyle,borderBlockWidth,borderBottom,borderBottomColor,borderBottomLeftRadius,borderBottomRightRadius,borderBottomStyle,borderBottomWidth,borderCollapse,borderColor,borderEndEndRadius,borderEndStartRadius,borderImage,borderImageOutset,borderImageRepeat,borderImageSlice,borderImageSource,borderImageWidth,borderInline,borderInlineColor,borderInlineEnd,borderInlineEndColor,borderInlineEndStyle,borderInlineEndWidth,borderInlineStart,borderInlineStartColor,borderInlineStartStyle,borderInlineStartWidth,borderInlineStyle,borderInlineWidth,borderLeft,borderLeftColor,borderLeftStyle,borderLeftWidth,borderRadius,borderRight,borderRightColor,borderRightStyle,borderRightWidth,borderSpacing,borderStartEndRadius,borderStartStartRadius,borderStyle,borderTop,borderTopColor,borderTopLeftRadius,borderTopRightRadius,borderTopStyle,borderTopWidth,borderWidth,bottom,boxAlign,boxDecorationBreak,boxDirection,boxFlex,boxFlexGroup,boxLines,boxOrdinalGroup,boxOrient,boxPack,boxShadow,boxSizing,breakAfter,breakBefore,breakInside,captionSide,caret,caretColor,caretShape,clear,clip,clipPath,clipRule,color,colorInterpolationFilters,colorScheme,columnCount,columnFill,columnGap,columnRule,columnRuleColor,columnRuleStyle,columnRuleWidth,columnSpan,columnWidth,columns,contain,containIntrinsicBlockSize,containIntrinsicHeight,containIntrinsicInlineSize,containIntrinsicSize,containIntrinsicWidth,container,containerName,containerType,content,contentVisibility,counterIncrement,counterReset,counterSet,cursor,cx,cy,d,direction,display,dominantBaseline,emptyCells,fieldSizing,fill,fillOpacity,fillRule,filter,flex,flexBasis,flexDirection,flexFlow,flexGrow,flexShrink,flexWrap,float,floodColor,floodOpacity,font,fontFamily,fontFeatureSettings,fontKerning,fontLanguageOverride,fontOpticalSizing,fontPalette,fontSize,fontSizeAdjust,fontSmooth,fontStretch,fontStyle,fontSynthesis,fontSynthesisPosition,fontSynthesisSmallCaps,fontSynthesisStyle,fontSynthesisWeight,fontVariant,fontVariantAlternates,fontVariantCaps,fontVariantEastAsian,fontVariantEmoji,fontVariantLigatures,fontVariantNumeric,fontVariantPosition,fontVariationSettings,fontWeight,forcedColorAdjust,gap,grid,gridArea,gridAutoColumns,gridAutoFlow,gridAutoRows,gridColumn,gridColumnEnd,gridColumnGap,gridColumnStart,gridGap,gridRow,gridRowEnd,gridRowGap,gridRowStart,gridTemplate,gridTemplateAreas,gridTemplateColumns,gridTemplateRows,hangingPunctuation,height,hyphenateCharacter,hyphenateLimitChars,hyphens,imageOrientation,imageRendering,imageResolution,imeMode,initialLetter,initialLetterAlign,inlineSize,inset,insetBlock,insetBlockEnd,insetBlockStart,insetInline,insetInlineEnd,insetInlineStart,interpolateSize,isolation,justifyContent,justifyItems,justifySelf,justifyTracks,left,letterSpacing,lightingColor,lineBreak,lineClamp,lineHeight,lineHeightStep,listStyle,listStyleImage,listStylePosition,listStyleType,margin,marginBlock,marginBlockEnd,marginBlockStart,marginBottom,marginInline,marginInlineEnd,marginInlineStart,marginLeft,marginRight,marginTop,marginTrim,marker,markerEnd,markerMid,markerStart,mask,maskBorder,maskBorderMode,maskBorderOutset,maskBorderRepeat,maskBorderSlice,maskBorderSource,maskBorderWidth,maskClip,maskComposite,maskImage,maskMode,maskOrigin,maskPosition,maskRepeat,maskSize,maskType,masonryAutoFlow,mathDepth,mathShift,mathStyle,maxBlockSize,maxHeight,maxInlineSize,maxLines,maxWidth,minBlockSize,minHeight,minInlineSize,minWidth,mixBlendMode,objectFit,objectPosition,offset,offsetAnchor,offsetDistance,offsetPath,offsetPosition,offsetRotate,opacity,order,orphans,outline,outlineColor,outlineOffset,outlineStyle,outlineWidth,overflow,overflowAnchor,overflowBlock,overflowClipBox,overflowClipMargin,overflowInline,overflowWrap,overflowX,overflowY,overlay,overscrollBehavior,overscrollBehaviorBlock,overscrollBehaviorInline,overscrollBehaviorX,overscrollBehaviorY,padding,paddingBlock,paddingBlockEnd,paddingBlockStart,paddingBottom,paddingInline,paddingInlineEnd,paddingInlineStart,paddingLeft,paddingRight,paddingTop,page,pageBreakAfter,pageBreakBefore,pageBreakInside,paintOrder,perspective,perspectiveOrigin,placeContent,placeItems,placeSelf,pointerEvents,position,positionAnchor,positionArea,positionTry,positionTryFallbacks,positionTryOrder,positionVisibility,printColorAdjust,quotes,r,resize,right,rotate,rowGap,rubyAlign,rubyMerge,rubyPosition,rx,ry,scale,scrollBehavior,scrollMargin,scrollMarginBlock,scrollMarginBlockEnd,scrollMarginBlockStart,scrollMarginBottom,scrollMarginInline,scrollMarginInlineEnd,scrollMarginInlineStart,scrollMarginLeft,scrollMarginRight,scrollMarginTop,scrollPadding,scrollPaddingBlock,scrollPaddingBlockEnd,scrollPaddingBlockStart,scrollPaddingBottom,scrollPaddingInline,scrollPaddingInlineEnd,scrollPaddingInlineStart,scrollPaddingLeft,scrollPaddingRight,scrollPaddingTop,scrollSnapAlign,scrollSnapCoordinate,scrollSnapDestination,scrollSnapPointsX,scrollSnapPointsY,scrollSnapStop,scrollSnapType,scrollSnapTypeX,scrollSnapTypeY,scrollTimeline,scrollTimelineAxis,scrollTimelineName,scrollbarColor,scrollbarGutter,scrollbarWidth,shapeImageThreshold,shapeMargin,shapeOutside,shapeRendering,stopColor,stopOpacity,stroke,strokeDasharray,strokeDashoffset,strokeLinecap,strokeLinejoin,strokeMiterlimit,strokeOpacity,strokeWidth,tabSize,tableLayout,textAlign,textAlignLast,textAnchor,textBox,textBoxEdge,textBoxTrim,textCombineUpright,textDecoration,textDecorationColor,textDecorationLine,textDecorationSkip,textDecorationSkipInk,textDecorationStyle,textDecorationThickness,textEmphasis,textEmphasisColor,textEmphasisPosition,textEmphasisStyle,textIndent,textJustify,textOrientation,textOverflow,textRendering,textShadow,textSizeAdjust,textSpacingTrim,textTransform,textUnderlineOffset,textUnderlinePosition,textWrap,textWrapMode,textWrapStyle,timelineScope,top,touchAction,transform,transformBox,transformOrigin,transformStyle,transition,transitionBehavior,transitionDelay,transitionDuration,transitionProperty,transitionTimingFunction,translate,unicodeBidi,userSelect,vectorEffect,verticalAlign,viewTimeline,viewTimelineAxis,viewTimelineInset,viewTimelineName,viewTransitionName,visibility,whiteSpace,whiteSpaceCollapse,widows,width,willChange,wordBreak,wordSpacing,wordWrap,writingMode,x,y,zIndex,zoom,alignmentBaseline,baselineShift,colorInterpolation,colorRendering,glyphOrientationVertical";
|
|
1815
2041
|
var allCssProperties = cssPropertiesStr.split(",").concat(userGenerated);
|
|
@@ -1970,6 +2196,31 @@ const Grid = /* @__PURE__ */ forwardRef(function Grid2(props, ref) {
|
|
|
1970
2196
|
const mergedProps = { ref, ...styleProps, ...restProps };
|
|
1971
2197
|
return createElement(styled.div, mergedProps);
|
|
1972
2198
|
});
|
|
2199
|
+
const wrapConfig = {
|
|
2200
|
+
transform(props) {
|
|
2201
|
+
const { columnGap, rowGap, gap = columnGap || rowGap ? void 0 : "8px", align, justify, ...rest } = props;
|
|
2202
|
+
return {
|
|
2203
|
+
display: "flex",
|
|
2204
|
+
flexWrap: "wrap",
|
|
2205
|
+
alignItems: align,
|
|
2206
|
+
justifyContent: justify,
|
|
2207
|
+
gap,
|
|
2208
|
+
columnGap,
|
|
2209
|
+
rowGap,
|
|
2210
|
+
...rest
|
|
2211
|
+
};
|
|
2212
|
+
}
|
|
2213
|
+
};
|
|
2214
|
+
const getWrapStyle = (styles = {}) => {
|
|
2215
|
+
const _styles = getPatternStyles(wrapConfig, styles);
|
|
2216
|
+
return wrapConfig.transform(_styles, patternFns);
|
|
2217
|
+
};
|
|
2218
|
+
const Wrap = /* @__PURE__ */ forwardRef(function Wrap2(props, ref) {
|
|
2219
|
+
const [patternProps, restProps] = splitProps$1(props, ["gap", "rowGap", "columnGap", "align", "justify"]);
|
|
2220
|
+
const styleProps = getWrapStyle(patternProps);
|
|
2221
|
+
const mergedProps = { ref, ...styleProps, ...restProps };
|
|
2222
|
+
return createElement(styled.div, mergedProps);
|
|
2223
|
+
});
|
|
1973
2224
|
const splitProps = (props) => {
|
|
1974
2225
|
const [cssProps, otherProps] = splitCssProps(props);
|
|
1975
2226
|
const { css: cssProp, ...styleProps } = cssProps;
|
|
@@ -2383,6 +2634,7 @@ const Button = React.forwardRef(
|
|
|
2383
2634
|
disabled,
|
|
2384
2635
|
iconBefore,
|
|
2385
2636
|
iconAfter,
|
|
2637
|
+
gap,
|
|
2386
2638
|
...props
|
|
2387
2639
|
}, ref) => {
|
|
2388
2640
|
const trulyDisabled = loading || disabled;
|
|
@@ -2405,7 +2657,7 @@ const Button = React.forwardRef(
|
|
|
2405
2657
|
type: asComponent === "button" ? "button" : void 0,
|
|
2406
2658
|
...props,
|
|
2407
2659
|
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2408
|
-
/* @__PURE__ */ jsxs(HStack, { gap: "4", opacity: loading ? 0 : 1, children: [
|
|
2660
|
+
/* @__PURE__ */ jsxs(HStack, { gap: gap || "4", opacity: loading ? 0 : 1, children: [
|
|
2409
2661
|
iconBefore && /* @__PURE__ */ jsx(Icon, { name: iconBefore, className: classes.icon }),
|
|
2410
2662
|
children,
|
|
2411
2663
|
iconAfter && /* @__PURE__ */ jsx(Icon, { name: iconAfter, className: classes.icon })
|
|
@@ -2427,20 +2679,165 @@ const Button = React.forwardRef(
|
|
|
2427
2679
|
);
|
|
2428
2680
|
}
|
|
2429
2681
|
);
|
|
2682
|
+
const animationStyles = {
|
|
2683
|
+
pop: css({
|
|
2684
|
+
animation: "badgePop 200ms ease-out"
|
|
2685
|
+
}),
|
|
2686
|
+
popStandalone: css({
|
|
2687
|
+
animation: "badgePopStandalone 200ms ease-out"
|
|
2688
|
+
})
|
|
2689
|
+
};
|
|
2430
2690
|
const Badge = React.forwardRef(
|
|
2431
|
-
({
|
|
2432
|
-
|
|
2433
|
-
|
|
2691
|
+
({
|
|
2692
|
+
count: count2,
|
|
2693
|
+
showZero = false,
|
|
2694
|
+
overflowCount = 99,
|
|
2695
|
+
appearance = "danger",
|
|
2696
|
+
size: size2 = "md",
|
|
2697
|
+
children,
|
|
2698
|
+
...props
|
|
2699
|
+
}, ref) => {
|
|
2700
|
+
const [className, otherProps] = splitProps(props);
|
|
2701
|
+
const prevCountRef = React.useRef(count2);
|
|
2702
|
+
const [isAnimating, setIsAnimating] = React.useState(false);
|
|
2703
|
+
React.useEffect(() => {
|
|
2704
|
+
if (count2 !== void 0 && prevCountRef.current !== count2) {
|
|
2705
|
+
if (prevCountRef.current !== void 0) {
|
|
2706
|
+
setIsAnimating(true);
|
|
2707
|
+
const timer = setTimeout(() => setIsAnimating(false), 200);
|
|
2708
|
+
return () => clearTimeout(timer);
|
|
2709
|
+
}
|
|
2710
|
+
}
|
|
2711
|
+
prevCountRef.current = count2;
|
|
2712
|
+
}, [count2]);
|
|
2713
|
+
const isCountMode = count2 !== void 0;
|
|
2714
|
+
const isDotMode = !isCountMode;
|
|
2715
|
+
const isVisible = isDotMode || count2 !== 0 || showZero;
|
|
2716
|
+
const displayCount = isCountMode && count2 !== void 0 ? count2 > overflowCount ? `${overflowCount}+` : count2 : null;
|
|
2717
|
+
const isStandalone = !children;
|
|
2718
|
+
const classes = badge({
|
|
2719
|
+
size: size2,
|
|
2720
|
+
standalone: isStandalone,
|
|
2721
|
+
dot: isDotMode,
|
|
2722
|
+
appearance
|
|
2723
|
+
});
|
|
2724
|
+
const animationClass = isAnimating ? isStandalone ? animationStyles.popStandalone : animationStyles.pop : "";
|
|
2725
|
+
if (!isVisible && !children) {
|
|
2726
|
+
return null;
|
|
2727
|
+
}
|
|
2728
|
+
const indicator = isVisible ? /* @__PURE__ */ jsx("span", { className: cx(classes.indicator, animationClass), children: displayCount }) : null;
|
|
2729
|
+
if (isStandalone) {
|
|
2730
|
+
return /* @__PURE__ */ jsx("span", { ref, className: cx(classes.root, className), ...otherProps, children: indicator });
|
|
2731
|
+
}
|
|
2732
|
+
return /* @__PURE__ */ jsxs("span", { ref, className: cx(classes.root, className), ...otherProps, children: [
|
|
2733
|
+
children,
|
|
2734
|
+
indicator
|
|
2735
|
+
] });
|
|
2736
|
+
}
|
|
2737
|
+
);
|
|
2738
|
+
Badge.displayName = "Badge";
|
|
2739
|
+
const presenceStyles = {
|
|
2740
|
+
online: css({ bg: "bg.success.bold" }),
|
|
2741
|
+
busy: css({ bg: "bg.danger.bold" }),
|
|
2742
|
+
offline: css({ bg: "bg.neutral.bold" }),
|
|
2743
|
+
focus: css({ bg: "bg.brand.bold" })
|
|
2744
|
+
};
|
|
2745
|
+
const statusStyles = {
|
|
2746
|
+
approved: css({ bg: "bg.success.bold", color: "icon.inverse" }),
|
|
2747
|
+
declined: css({ bg: "bg.danger.bold", color: "icon.inverse" }),
|
|
2748
|
+
locked: css({ bg: "bg.neutral.bold", color: "icon.inverse" })
|
|
2749
|
+
};
|
|
2750
|
+
const sizeToStatusIconSize = {
|
|
2751
|
+
xs: "8",
|
|
2752
|
+
sm: "10",
|
|
2753
|
+
md: "12",
|
|
2754
|
+
lg: "14",
|
|
2755
|
+
xl: "16",
|
|
2756
|
+
"2xl": "20"
|
|
2757
|
+
};
|
|
2758
|
+
function getInitials(name) {
|
|
2759
|
+
const parts = name.trim().split(/\s+/);
|
|
2760
|
+
if (parts.length === 0 || !parts[0]) {
|
|
2761
|
+
return "";
|
|
2762
|
+
}
|
|
2763
|
+
if (parts.length === 1) {
|
|
2764
|
+
return parts[0].charAt(0);
|
|
2765
|
+
}
|
|
2766
|
+
const lastPart = parts[parts.length - 1];
|
|
2767
|
+
return parts[0].charAt(0) + (lastPart ? lastPart.charAt(0) : "");
|
|
2768
|
+
}
|
|
2769
|
+
const Avatar = React.forwardRef(
|
|
2770
|
+
(props, ref) => {
|
|
2771
|
+
const {
|
|
2772
|
+
src,
|
|
2773
|
+
alt = "",
|
|
2774
|
+
name,
|
|
2775
|
+
size: size2 = "md",
|
|
2776
|
+
shape = "circle",
|
|
2777
|
+
presence,
|
|
2778
|
+
status,
|
|
2779
|
+
fallback,
|
|
2780
|
+
borderColor,
|
|
2781
|
+
...rest
|
|
2782
|
+
} = props;
|
|
2783
|
+
const [className, otherProps] = splitProps(rest);
|
|
2784
|
+
const [imageError, setImageError] = React.useState(false);
|
|
2785
|
+
const [imageLoaded, setImageLoaded] = React.useState(false);
|
|
2786
|
+
React.useEffect(() => {
|
|
2787
|
+
setImageError(false);
|
|
2788
|
+
setImageLoaded(false);
|
|
2789
|
+
}, [src]);
|
|
2790
|
+
const safeSize = size2;
|
|
2791
|
+
const classes = avatar({ size: safeSize, shape });
|
|
2792
|
+
const showImage = src && !imageError;
|
|
2793
|
+
const initials = name ? getInitials(name) : null;
|
|
2794
|
+
const iconSize = sizeToStatusIconSize[safeSize];
|
|
2795
|
+
return /* @__PURE__ */ jsxs(
|
|
2796
|
+
"span",
|
|
2434
2797
|
{
|
|
2435
|
-
as: "span",
|
|
2436
2798
|
ref,
|
|
2437
|
-
className: cx(
|
|
2438
|
-
|
|
2439
|
-
|
|
2799
|
+
className: cx(classes.root, className),
|
|
2800
|
+
style: borderColor ? { borderColor } : void 0,
|
|
2801
|
+
...otherProps,
|
|
2802
|
+
children: [
|
|
2803
|
+
showImage && /* @__PURE__ */ jsx(
|
|
2804
|
+
"img",
|
|
2805
|
+
{
|
|
2806
|
+
src,
|
|
2807
|
+
alt,
|
|
2808
|
+
className: classes.image,
|
|
2809
|
+
onError: () => setImageError(true),
|
|
2810
|
+
onLoad: () => setImageLoaded(true),
|
|
2811
|
+
style: { opacity: imageLoaded ? 1 : 0 }
|
|
2812
|
+
}
|
|
2813
|
+
),
|
|
2814
|
+
(!showImage || !imageLoaded) && /* @__PURE__ */ jsx("span", { className: classes.fallback, children: fallback || initials || /* @__PURE__ */ jsx(Icon, { name: "user" }) }),
|
|
2815
|
+
presence && /* @__PURE__ */ jsx(
|
|
2816
|
+
"span",
|
|
2817
|
+
{
|
|
2818
|
+
className: cx(
|
|
2819
|
+
classes.presence,
|
|
2820
|
+
presenceStyles[presence]
|
|
2821
|
+
)
|
|
2822
|
+
}
|
|
2823
|
+
),
|
|
2824
|
+
status && /* @__PURE__ */ jsxs(
|
|
2825
|
+
"span",
|
|
2826
|
+
{
|
|
2827
|
+
className: cx(classes.status, statusStyles[status]),
|
|
2828
|
+
children: [
|
|
2829
|
+
status === "approved" && /* @__PURE__ */ jsx(Icon, { name: "check", size: iconSize }),
|
|
2830
|
+
status === "declined" && /* @__PURE__ */ jsx(Icon, { name: "x", size: iconSize }),
|
|
2831
|
+
status === "locked" && /* @__PURE__ */ jsx(Icon, { name: "lock", size: iconSize })
|
|
2832
|
+
]
|
|
2833
|
+
}
|
|
2834
|
+
)
|
|
2835
|
+
]
|
|
2440
2836
|
}
|
|
2441
2837
|
);
|
|
2442
2838
|
}
|
|
2443
2839
|
);
|
|
2840
|
+
Avatar.displayName = "Avatar";
|
|
2444
2841
|
const IconButton = React.forwardRef(
|
|
2445
2842
|
({
|
|
2446
2843
|
appearance,
|
|
@@ -3073,6 +3470,221 @@ const Tag = ({
|
|
|
3073
3470
|
}
|
|
3074
3471
|
);
|
|
3075
3472
|
};
|
|
3473
|
+
const ChipGroupContext = createContext(
|
|
3474
|
+
null
|
|
3475
|
+
);
|
|
3476
|
+
const useChipGroup = () => {
|
|
3477
|
+
return useContext(ChipGroupContext);
|
|
3478
|
+
};
|
|
3479
|
+
const chipSizeToIconSize = {
|
|
3480
|
+
small: "20",
|
|
3481
|
+
default: "20",
|
|
3482
|
+
large: "24"
|
|
3483
|
+
};
|
|
3484
|
+
const Chip = ({
|
|
3485
|
+
size: size2 = "default",
|
|
3486
|
+
children,
|
|
3487
|
+
loading,
|
|
3488
|
+
disabled,
|
|
3489
|
+
deleted,
|
|
3490
|
+
before,
|
|
3491
|
+
after,
|
|
3492
|
+
dismissable,
|
|
3493
|
+
onDismiss,
|
|
3494
|
+
value,
|
|
3495
|
+
gap,
|
|
3496
|
+
onClick,
|
|
3497
|
+
...props
|
|
3498
|
+
}) => {
|
|
3499
|
+
const [className, otherProps] = splitProps(props);
|
|
3500
|
+
const groupContext = useChipGroup();
|
|
3501
|
+
const buttonRef = useRef(null);
|
|
3502
|
+
const isSelectable = value !== void 0 && groupContext !== null;
|
|
3503
|
+
useEffect(() => {
|
|
3504
|
+
if (isSelectable && value && groupContext) {
|
|
3505
|
+
groupContext.registerChip(value, buttonRef);
|
|
3506
|
+
return () => groupContext.unregisterChip(value);
|
|
3507
|
+
}
|
|
3508
|
+
}, [isSelectable, value, groupContext]);
|
|
3509
|
+
const isSelected = isSelectable ? groupContext.type === "single" ? groupContext.value === value : Array.isArray(groupContext.value) && groupContext.value.includes(value) : false;
|
|
3510
|
+
const isMultiSelected = isSelectable && groupContext.type === "multi" && isSelected;
|
|
3511
|
+
const hasBefore = Boolean(before) || isMultiSelected;
|
|
3512
|
+
const hasAfter = Boolean(after) || dismissable;
|
|
3513
|
+
const classes = chip({
|
|
3514
|
+
size: size2,
|
|
3515
|
+
before: hasBefore,
|
|
3516
|
+
after: hasAfter
|
|
3517
|
+
});
|
|
3518
|
+
const iconSize = chipSizeToIconSize[size2];
|
|
3519
|
+
const handleClick = () => {
|
|
3520
|
+
if (dismissable && onDismiss) {
|
|
3521
|
+
onDismiss();
|
|
3522
|
+
} else if (isSelectable && groupContext) {
|
|
3523
|
+
if (groupContext.type === "single") {
|
|
3524
|
+
groupContext.onChange(value);
|
|
3525
|
+
} else {
|
|
3526
|
+
const currentValues = Array.isArray(groupContext.value) ? groupContext.value : [];
|
|
3527
|
+
const newValues = currentValues.includes(value) ? currentValues.filter((v) => v !== value) : [...currentValues, value];
|
|
3528
|
+
groupContext.onChange(newValues);
|
|
3529
|
+
}
|
|
3530
|
+
} else if (onClick) {
|
|
3531
|
+
onClick();
|
|
3532
|
+
}
|
|
3533
|
+
};
|
|
3534
|
+
const handleKeyDown = (e) => {
|
|
3535
|
+
if (!isSelectable || !groupContext || !value) return;
|
|
3536
|
+
if (groupContext.type === "single") {
|
|
3537
|
+
if (e.key === "ArrowRight" || e.key === "ArrowDown") {
|
|
3538
|
+
e.preventDefault();
|
|
3539
|
+
groupContext.focusChip("next", value);
|
|
3540
|
+
} else if (e.key === "ArrowLeft" || e.key === "ArrowUp") {
|
|
3541
|
+
e.preventDefault();
|
|
3542
|
+
groupContext.focusChip("prev", value);
|
|
3543
|
+
}
|
|
3544
|
+
}
|
|
3545
|
+
};
|
|
3546
|
+
const childText = typeof children === "string" ? children : void 0;
|
|
3547
|
+
const ariaLabel = dismissable && childText ? `${childText}, dismiss` : void 0;
|
|
3548
|
+
const role = isSelectable ? groupContext.type === "single" ? "radio" : "checkbox" : void 0;
|
|
3549
|
+
const getTabIndex3 = () => {
|
|
3550
|
+
if (!isSelectable || !groupContext) return void 0;
|
|
3551
|
+
if (groupContext.type === "single") {
|
|
3552
|
+
if (isSelected) return 0;
|
|
3553
|
+
const hasSelection = groupContext.value !== void 0 && groupContext.value !== "";
|
|
3554
|
+
if (!hasSelection && groupContext.chipValues[0] === value) return 0;
|
|
3555
|
+
return -1;
|
|
3556
|
+
}
|
|
3557
|
+
return 0;
|
|
3558
|
+
};
|
|
3559
|
+
return /* @__PURE__ */ jsxs(
|
|
3560
|
+
Box,
|
|
3561
|
+
{
|
|
3562
|
+
as: "button",
|
|
3563
|
+
ref: buttonRef,
|
|
3564
|
+
className: cx(classes.container, className),
|
|
3565
|
+
onClick: handleClick,
|
|
3566
|
+
onKeyDown: handleKeyDown,
|
|
3567
|
+
tabIndex: getTabIndex3(),
|
|
3568
|
+
disabled: disabled ? true : void 0,
|
|
3569
|
+
"aria-disabled": disabled ? true : void 0,
|
|
3570
|
+
"aria-label": ariaLabel,
|
|
3571
|
+
role,
|
|
3572
|
+
"aria-checked": isSelectable ? isSelected : void 0,
|
|
3573
|
+
"data-selected": isSelected ? true : void 0,
|
|
3574
|
+
"data-loading": loading ? true : void 0,
|
|
3575
|
+
"aria-busy": loading ? true : void 0,
|
|
3576
|
+
type: "button",
|
|
3577
|
+
"data-deleted": deleted ? true : void 0,
|
|
3578
|
+
...otherProps,
|
|
3579
|
+
children: [
|
|
3580
|
+
/* @__PURE__ */ jsxs(HStack, { gap: gap || "4", opacity: loading ? 0 : 1, children: [
|
|
3581
|
+
isMultiSelected && /* @__PURE__ */ jsx(
|
|
3582
|
+
Icon,
|
|
3583
|
+
{
|
|
3584
|
+
name: "check",
|
|
3585
|
+
size: iconSize,
|
|
3586
|
+
className: classes.icon,
|
|
3587
|
+
"aria-hidden": true
|
|
3588
|
+
}
|
|
3589
|
+
),
|
|
3590
|
+
before,
|
|
3591
|
+
children,
|
|
3592
|
+
dismissable ? /* @__PURE__ */ jsx(Icon, { name: "x", size: iconSize, className: classes.icon, "aria-hidden": true }) : after
|
|
3593
|
+
] }),
|
|
3594
|
+
loading && /* @__PURE__ */ jsx(
|
|
3595
|
+
Grid,
|
|
3596
|
+
{
|
|
3597
|
+
position: "absolute",
|
|
3598
|
+
top: "0",
|
|
3599
|
+
left: "0",
|
|
3600
|
+
right: "0",
|
|
3601
|
+
bottom: "0",
|
|
3602
|
+
placeItems: "center",
|
|
3603
|
+
children: /* @__PURE__ */ jsx(Spinner, {})
|
|
3604
|
+
}
|
|
3605
|
+
)
|
|
3606
|
+
]
|
|
3607
|
+
}
|
|
3608
|
+
);
|
|
3609
|
+
};
|
|
3610
|
+
const ChipGroup = ({
|
|
3611
|
+
type,
|
|
3612
|
+
value,
|
|
3613
|
+
onChange,
|
|
3614
|
+
children,
|
|
3615
|
+
label: label2,
|
|
3616
|
+
id,
|
|
3617
|
+
name,
|
|
3618
|
+
gap = "2",
|
|
3619
|
+
...props
|
|
3620
|
+
}) => {
|
|
3621
|
+
const role = type === "single" ? "radiogroup" : "group";
|
|
3622
|
+
const chipRefs = useRef(/* @__PURE__ */ new Map());
|
|
3623
|
+
const chipValuesRef = useRef([]);
|
|
3624
|
+
const registerChip = useCallback(
|
|
3625
|
+
(chipValue, ref) => {
|
|
3626
|
+
chipRefs.current.set(chipValue, ref);
|
|
3627
|
+
if (!chipValuesRef.current.includes(chipValue)) {
|
|
3628
|
+
chipValuesRef.current.push(chipValue);
|
|
3629
|
+
}
|
|
3630
|
+
},
|
|
3631
|
+
[]
|
|
3632
|
+
);
|
|
3633
|
+
const unregisterChip = useCallback((chipValue) => {
|
|
3634
|
+
chipRefs.current.delete(chipValue);
|
|
3635
|
+
chipValuesRef.current = chipValuesRef.current.filter((v) => v !== chipValue);
|
|
3636
|
+
}, []);
|
|
3637
|
+
const focusChip = useCallback(
|
|
3638
|
+
(direction, currentValue) => {
|
|
3639
|
+
var _a;
|
|
3640
|
+
const values = chipValuesRef.current;
|
|
3641
|
+
const currentIndex = values.indexOf(currentValue);
|
|
3642
|
+
if (currentIndex === -1) return;
|
|
3643
|
+
let nextIndex;
|
|
3644
|
+
if (direction === "next") {
|
|
3645
|
+
nextIndex = currentIndex === values.length - 1 ? 0 : currentIndex + 1;
|
|
3646
|
+
} else {
|
|
3647
|
+
nextIndex = currentIndex === 0 ? values.length - 1 : currentIndex - 1;
|
|
3648
|
+
}
|
|
3649
|
+
const nextValue = values[nextIndex];
|
|
3650
|
+
if (nextValue) {
|
|
3651
|
+
const nextRef = chipRefs.current.get(nextValue);
|
|
3652
|
+
(_a = nextRef == null ? void 0 : nextRef.current) == null ? void 0 : _a.focus();
|
|
3653
|
+
if (type === "single") {
|
|
3654
|
+
onChange(nextValue);
|
|
3655
|
+
}
|
|
3656
|
+
}
|
|
3657
|
+
},
|
|
3658
|
+
[type, onChange]
|
|
3659
|
+
);
|
|
3660
|
+
return /* @__PURE__ */ jsx(
|
|
3661
|
+
ChipGroupContext.Provider,
|
|
3662
|
+
{
|
|
3663
|
+
value: {
|
|
3664
|
+
type,
|
|
3665
|
+
value,
|
|
3666
|
+
onChange,
|
|
3667
|
+
name,
|
|
3668
|
+
registerChip,
|
|
3669
|
+
unregisterChip,
|
|
3670
|
+
focusChip,
|
|
3671
|
+
chipValues: chipValuesRef.current
|
|
3672
|
+
},
|
|
3673
|
+
children: /* @__PURE__ */ jsx(
|
|
3674
|
+
Wrap,
|
|
3675
|
+
{
|
|
3676
|
+
role,
|
|
3677
|
+
"aria-label": label2,
|
|
3678
|
+
"aria-labelledby": id ? `${id}-label` : void 0,
|
|
3679
|
+
id,
|
|
3680
|
+
gap,
|
|
3681
|
+
...props,
|
|
3682
|
+
children
|
|
3683
|
+
}
|
|
3684
|
+
)
|
|
3685
|
+
}
|
|
3686
|
+
);
|
|
3687
|
+
};
|
|
3076
3688
|
function hasWindow() {
|
|
3077
3689
|
return typeof window !== "undefined";
|
|
3078
3690
|
}
|
|
@@ -8376,6 +8988,7 @@ function BreakpointIndicator() {
|
|
|
8376
8988
|
}
|
|
8377
8989
|
export {
|
|
8378
8990
|
Autocomplete,
|
|
8991
|
+
Avatar,
|
|
8379
8992
|
Badge,
|
|
8380
8993
|
Box,
|
|
8381
8994
|
Breadcrumbs,
|
|
@@ -8384,6 +8997,8 @@ export {
|
|
|
8384
8997
|
Card,
|
|
8385
8998
|
Checkbox,
|
|
8386
8999
|
CheckboxInput,
|
|
9000
|
+
Chip,
|
|
9001
|
+
ChipGroup,
|
|
8387
9002
|
Code,
|
|
8388
9003
|
Divider,
|
|
8389
9004
|
Dropdown,
|