@pos-360/horizon 0.11.0 → 0.12.1
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/{chunk-FIYD5CSW.mjs → chunk-3B2NQT6J.mjs} +241 -67
- package/dist/chunk-3B2NQT6J.mjs.map +1 -0
- package/dist/{chunk-HHXZQTVH.js → chunk-BRG5D46G.js} +3 -52
- package/dist/chunk-BRG5D46G.js.map +1 -0
- package/dist/{chunk-6B6UOXJJ.js → chunk-EWYLDJ4P.js} +250 -66
- package/dist/chunk-EWYLDJ4P.js.map +1 -0
- package/dist/{chunk-HAK377GX.mjs → chunk-ZH36QN2D.mjs} +3 -52
- package/dist/chunk-ZH36QN2D.mjs.map +1 -0
- package/dist/enhanced.d.mts +5 -12
- package/dist/enhanced.d.ts +5 -12
- package/dist/enhanced.js +27 -27
- package/dist/enhanced.mjs +1 -1
- package/dist/index.d.mts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +145 -117
- package/dist/index.mjs +2 -2
- package/dist/primitives.d.mts +49 -8
- package/dist/primitives.d.ts +49 -8
- package/dist/primitives.js +118 -90
- package/dist/primitives.mjs +1 -1
- package/package.json +4 -1
- package/dist/chunk-6B6UOXJJ.js.map +0 -1
- package/dist/chunk-FIYD5CSW.mjs.map +0 -1
- package/dist/chunk-HAK377GX.mjs.map +0 -1
- package/dist/chunk-HHXZQTVH.js.map +0 -1
|
@@ -13,6 +13,9 @@ var PopoverPrimitive = require('@radix-ui/react-popover');
|
|
|
13
13
|
var framerMotion = require('framer-motion');
|
|
14
14
|
var SelectPrimitive = require('@radix-ui/react-select');
|
|
15
15
|
var TabsPrimitive = require('@radix-ui/react-tabs');
|
|
16
|
+
var ToggleGroupPrimitive = require('@radix-ui/react-toggle-group');
|
|
17
|
+
var RadioGroupPrimitive = require('@radix-ui/react-radio-group');
|
|
18
|
+
var SwitchPrimitive = require('@radix-ui/react-switch');
|
|
16
19
|
|
|
17
20
|
function _interopNamespace(e) {
|
|
18
21
|
if (e && e.__esModule) return e;
|
|
@@ -39,6 +42,9 @@ var DropdownMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(DropdownMe
|
|
|
39
42
|
var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitive);
|
|
40
43
|
var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
|
|
41
44
|
var TabsPrimitive__namespace = /*#__PURE__*/_interopNamespace(TabsPrimitive);
|
|
45
|
+
var ToggleGroupPrimitive__namespace = /*#__PURE__*/_interopNamespace(ToggleGroupPrimitive);
|
|
46
|
+
var RadioGroupPrimitive__namespace = /*#__PURE__*/_interopNamespace(RadioGroupPrimitive);
|
|
47
|
+
var SwitchPrimitive__namespace = /*#__PURE__*/_interopNamespace(SwitchPrimitive);
|
|
42
48
|
|
|
43
49
|
var buttonVariants = classVarianceAuthority.cva(
|
|
44
50
|
"group inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-hz-md text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
@@ -1271,8 +1277,6 @@ var useTabsContext = () => {
|
|
|
1271
1277
|
}
|
|
1272
1278
|
return context;
|
|
1273
1279
|
};
|
|
1274
|
-
var TabsListContext = React9__namespace.createContext({ color: "default" });
|
|
1275
|
-
var useTabsListContext = () => React9__namespace.useContext(TabsListContext);
|
|
1276
1280
|
var Tabs = React9__namespace.forwardRef(({ defaultValue, value, onValueChange, children, ...props }, ref) => {
|
|
1277
1281
|
const [activeTab, setActiveTabState] = React9__namespace.useState(value ?? defaultValue);
|
|
1278
1282
|
const tabRefs = React9__namespace.useRef(/* @__PURE__ */ new Map()).current;
|
|
@@ -1314,39 +1318,7 @@ var Tabs = React9__namespace.forwardRef(({ defaultValue, value, onValueChange, c
|
|
|
1314
1318
|
);
|
|
1315
1319
|
});
|
|
1316
1320
|
Tabs.displayName = "Tabs";
|
|
1317
|
-
var
|
|
1318
|
-
default: "bg-gray-100 text-gray-500 dark:bg-neutral-700 dark:text-gray-400",
|
|
1319
|
-
primary: "bg-blue-100 text-blue-600 dark:bg-blue-900/40 dark:text-blue-300",
|
|
1320
|
-
success: "bg-green-100 text-green-600 dark:bg-green-900/40 dark:text-green-300",
|
|
1321
|
-
danger: "bg-red-100 text-red-600 dark:bg-red-900/40 dark:text-red-300",
|
|
1322
|
-
warning: "bg-amber-100 text-amber-600 dark:bg-amber-900/40 dark:text-amber-300",
|
|
1323
|
-
secondary: "bg-purple-100 text-purple-600 dark:bg-purple-900/40 dark:text-purple-300"
|
|
1324
|
-
};
|
|
1325
|
-
var indicatorColorStyles = {
|
|
1326
|
-
default: "bg-white dark:bg-neutral-900 shadow-sm",
|
|
1327
|
-
primary: "bg-blue-500 dark:bg-blue-600",
|
|
1328
|
-
success: "bg-green-500 dark:bg-green-600",
|
|
1329
|
-
danger: "bg-red-500 dark:bg-red-600",
|
|
1330
|
-
warning: "bg-amber-500 dark:bg-amber-600",
|
|
1331
|
-
secondary: "bg-purple-500 dark:bg-purple-600"
|
|
1332
|
-
};
|
|
1333
|
-
var activeTextColorStyles = {
|
|
1334
|
-
default: "text-gray-900 dark:text-gray-100",
|
|
1335
|
-
primary: "text-white dark:text-white",
|
|
1336
|
-
success: "text-white dark:text-white",
|
|
1337
|
-
danger: "text-white dark:text-white",
|
|
1338
|
-
warning: "text-white dark:text-white",
|
|
1339
|
-
secondary: "text-white dark:text-white"
|
|
1340
|
-
};
|
|
1341
|
-
var inactiveTextColorStyles = {
|
|
1342
|
-
default: "text-gray-500 dark:text-gray-400",
|
|
1343
|
-
primary: "text-blue-600 dark:text-blue-300",
|
|
1344
|
-
success: "text-green-600 dark:text-green-300",
|
|
1345
|
-
danger: "text-red-600 dark:text-red-300",
|
|
1346
|
-
warning: "text-amber-600 dark:text-amber-300",
|
|
1347
|
-
secondary: "text-purple-600 dark:text-purple-300"
|
|
1348
|
-
};
|
|
1349
|
-
var TabsList = React9__namespace.forwardRef(({ className, children, color = "default", ...props }, ref) => {
|
|
1321
|
+
var TabsList = React9__namespace.forwardRef(({ className, children, ...props }, ref) => {
|
|
1350
1322
|
const { activeTab, tabRefs, listRef } = useTabsContext();
|
|
1351
1323
|
const [indicatorStyle, setIndicatorStyle] = React9__namespace.useState(null);
|
|
1352
1324
|
React9__namespace.useEffect(() => {
|
|
@@ -1365,7 +1337,7 @@ var TabsList = React9__namespace.forwardRef(({ className, children, color = "def
|
|
|
1365
1337
|
window.addEventListener("resize", updateIndicator);
|
|
1366
1338
|
return () => window.removeEventListener("resize", updateIndicator);
|
|
1367
1339
|
}, [activeTab, tabRefs, listRef]);
|
|
1368
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
1340
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1369
1341
|
TabsPrimitive__namespace.List,
|
|
1370
1342
|
{
|
|
1371
1343
|
ref: (node) => {
|
|
@@ -1375,7 +1347,7 @@ var TabsList = React9__namespace.forwardRef(({ className, children, color = "def
|
|
|
1375
1347
|
},
|
|
1376
1348
|
className: chunkYO72COII_js.cn(
|
|
1377
1349
|
"relative inline-flex h-10 items-center justify-center rounded-hz-lg p-1",
|
|
1378
|
-
|
|
1350
|
+
"bg-gray-100 text-gray-500 dark:bg-neutral-700 dark:text-gray-400",
|
|
1379
1351
|
className
|
|
1380
1352
|
),
|
|
1381
1353
|
...props,
|
|
@@ -1383,7 +1355,7 @@ var TabsList = React9__namespace.forwardRef(({ className, children, color = "def
|
|
|
1383
1355
|
indicatorStyle && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1384
1356
|
framerMotion.motion.div,
|
|
1385
1357
|
{
|
|
1386
|
-
className: chunkYO72COII_js.cn("absolute h-8 rounded-hz-md",
|
|
1358
|
+
className: chunkYO72COII_js.cn("absolute h-8 rounded-hz-md", "bg-white dark:bg-neutral-900 shadow-sm"),
|
|
1387
1359
|
initial: false,
|
|
1388
1360
|
animate: {
|
|
1389
1361
|
left: indicatorStyle.left,
|
|
@@ -1399,12 +1371,11 @@ var TabsList = React9__namespace.forwardRef(({ className, children, color = "def
|
|
|
1399
1371
|
children
|
|
1400
1372
|
]
|
|
1401
1373
|
}
|
|
1402
|
-
)
|
|
1374
|
+
);
|
|
1403
1375
|
});
|
|
1404
1376
|
TabsList.displayName = TabsPrimitive__namespace.List.displayName;
|
|
1405
1377
|
var TabsTrigger = React9__namespace.forwardRef(({ className, value, ...props }, ref) => {
|
|
1406
1378
|
const { registerTab, activeTab } = useTabsContext();
|
|
1407
|
-
const { color } = useTabsListContext();
|
|
1408
1379
|
const triggerRef = React9__namespace.useRef(null);
|
|
1409
1380
|
React9__namespace.useEffect(() => {
|
|
1410
1381
|
registerTab(value, triggerRef.current);
|
|
@@ -1422,7 +1393,7 @@ var TabsTrigger = React9__namespace.forwardRef(({ className, value, ...props },
|
|
|
1422
1393
|
value,
|
|
1423
1394
|
className: chunkYO72COII_js.cn(
|
|
1424
1395
|
"relative z-10 inline-flex items-center justify-center whitespace-nowrap rounded-hz-md px-3 py-1.5 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
1425
|
-
isActive ?
|
|
1396
|
+
isActive ? "text-gray-900 dark:text-gray-100" : "text-gray-500 dark:text-gray-400",
|
|
1426
1397
|
className
|
|
1427
1398
|
),
|
|
1428
1399
|
...props
|
|
@@ -1459,7 +1430,7 @@ var Textarea = React9__namespace.forwardRef(
|
|
|
1459
1430
|
);
|
|
1460
1431
|
Textarea.displayName = "Textarea";
|
|
1461
1432
|
var toggleGroupVariants = classVarianceAuthority.cva(
|
|
1462
|
-
"inline-flex w-fit items-stretch
|
|
1433
|
+
"inline-flex w-fit items-stretch border border-gray-200 bg-white dark:border-neutral-700 dark:bg-neutral-900",
|
|
1463
1434
|
{
|
|
1464
1435
|
variants: {
|
|
1465
1436
|
size: {
|
|
@@ -1474,60 +1445,266 @@ var toggleGroupVariants = classVarianceAuthority.cva(
|
|
|
1474
1445
|
}
|
|
1475
1446
|
);
|
|
1476
1447
|
var toggleItemVariants = classVarianceAuthority.cva(
|
|
1477
|
-
"inline-flex flex-1 items-center justify-center whitespace-nowrap
|
|
1448
|
+
"inline-flex flex-1 items-center justify-center gap-2 whitespace-nowrap text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1478
1449
|
{
|
|
1479
1450
|
variants: {
|
|
1480
1451
|
size: {
|
|
1481
|
-
default: "h-full
|
|
1482
|
-
sm: "h-full
|
|
1483
|
-
lg: "h-full
|
|
1452
|
+
default: "h-full px-6",
|
|
1453
|
+
sm: "h-full px-4 text-xs",
|
|
1454
|
+
lg: "h-full px-8 text-base"
|
|
1484
1455
|
},
|
|
1485
|
-
|
|
1486
|
-
true: "
|
|
1487
|
-
false: "
|
|
1456
|
+
iconOnly: {
|
|
1457
|
+
true: "aspect-square px-0 min-w-0",
|
|
1458
|
+
false: "min-w-[120px]"
|
|
1488
1459
|
}
|
|
1489
1460
|
},
|
|
1461
|
+
compoundVariants: [
|
|
1462
|
+
{ size: "sm", iconOnly: false, class: "min-w-[90px]" },
|
|
1463
|
+
{ size: "lg", iconOnly: false, class: "min-w-[140px]" }
|
|
1464
|
+
],
|
|
1490
1465
|
defaultVariants: {
|
|
1491
1466
|
size: "default",
|
|
1492
|
-
|
|
1467
|
+
iconOnly: false
|
|
1493
1468
|
}
|
|
1494
1469
|
}
|
|
1495
1470
|
);
|
|
1471
|
+
var containerRadiusClass = {
|
|
1472
|
+
none: "rounded-hz-lg",
|
|
1473
|
+
sm: "rounded-sm",
|
|
1474
|
+
md: "rounded-md",
|
|
1475
|
+
lg: "rounded-lg",
|
|
1476
|
+
full: "rounded-full"
|
|
1477
|
+
};
|
|
1478
|
+
var itemRadiusClass = {
|
|
1479
|
+
none: "first:rounded-l-hz-lg last:rounded-r-hz-lg",
|
|
1480
|
+
sm: "first:rounded-l-sm last:rounded-r-sm",
|
|
1481
|
+
md: "first:rounded-l-md last:rounded-r-md",
|
|
1482
|
+
lg: "first:rounded-l-lg last:rounded-r-lg",
|
|
1483
|
+
full: "rounded-full"
|
|
1484
|
+
};
|
|
1496
1485
|
function Toggle({
|
|
1497
1486
|
className,
|
|
1498
1487
|
options,
|
|
1499
1488
|
value,
|
|
1500
1489
|
onChange,
|
|
1501
1490
|
size,
|
|
1491
|
+
radius = "none",
|
|
1502
1492
|
...props
|
|
1503
1493
|
}) {
|
|
1504
1494
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1505
|
-
|
|
1495
|
+
ToggleGroupPrimitive__namespace.Root,
|
|
1496
|
+
{
|
|
1497
|
+
...props,
|
|
1498
|
+
type: "multiple",
|
|
1499
|
+
...value !== void 0 ? { value, onValueChange: onChange } : {},
|
|
1500
|
+
className: chunkYO72COII_js.cn(
|
|
1501
|
+
toggleGroupVariants({ size }),
|
|
1502
|
+
containerRadiusClass[radius],
|
|
1503
|
+
className
|
|
1504
|
+
),
|
|
1505
|
+
children: options.map((option) => {
|
|
1506
|
+
const iconOnly = !!option.icon && !option.label;
|
|
1507
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1508
|
+
ToggleGroupPrimitive__namespace.Item,
|
|
1509
|
+
{
|
|
1510
|
+
value: option.value,
|
|
1511
|
+
disabled: option.disabled,
|
|
1512
|
+
"aria-label": iconOnly ? option.ariaLabel ?? option.value : void 0,
|
|
1513
|
+
className: chunkYO72COII_js.cn(
|
|
1514
|
+
toggleItemVariants({ size, iconOnly }),
|
|
1515
|
+
itemRadiusClass[radius],
|
|
1516
|
+
"border border-transparent text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",
|
|
1517
|
+
"data-[state=on]:!bg-blue-50 data-[state=on]:border-blue-500 data-[state=on]:text-blue-600",
|
|
1518
|
+
"dark:data-[state=on]:!bg-blue-950/40 dark:data-[state=on]:border-blue-400 dark:data-[state=on]:text-blue-400"
|
|
1519
|
+
),
|
|
1520
|
+
children: [
|
|
1521
|
+
option.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 inline-flex", children: option.icon }),
|
|
1522
|
+
option.label
|
|
1523
|
+
]
|
|
1524
|
+
},
|
|
1525
|
+
option.value
|
|
1526
|
+
);
|
|
1527
|
+
})
|
|
1528
|
+
}
|
|
1529
|
+
);
|
|
1530
|
+
}
|
|
1531
|
+
var segmentedControlVariants = classVarianceAuthority.cva(
|
|
1532
|
+
"inline-flex w-fit items-stretch border border-gray-200 bg-white dark:border-neutral-700 dark:bg-neutral-900",
|
|
1533
|
+
{
|
|
1534
|
+
variants: {
|
|
1535
|
+
size: {
|
|
1536
|
+
default: "h-[52px]",
|
|
1537
|
+
sm: "h-10",
|
|
1538
|
+
lg: "h-[60px]"
|
|
1539
|
+
}
|
|
1540
|
+
},
|
|
1541
|
+
defaultVariants: {
|
|
1542
|
+
size: "default"
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
);
|
|
1546
|
+
var segmentedControlItemVariants = classVarianceAuthority.cva(
|
|
1547
|
+
"inline-flex flex-1 cursor-pointer items-center justify-center whitespace-nowrap px-6 text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1548
|
+
{
|
|
1549
|
+
variants: {
|
|
1550
|
+
size: {
|
|
1551
|
+
default: "h-full min-w-[120px]",
|
|
1552
|
+
sm: "h-full min-w-[90px] text-xs",
|
|
1553
|
+
lg: "h-full min-w-[140px] text-base"
|
|
1554
|
+
}
|
|
1555
|
+
},
|
|
1556
|
+
defaultVariants: {
|
|
1557
|
+
size: "default"
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
);
|
|
1561
|
+
var containerRadiusClass2 = {
|
|
1562
|
+
none: "rounded-hz-lg",
|
|
1563
|
+
sm: "rounded-sm",
|
|
1564
|
+
md: "rounded-md",
|
|
1565
|
+
lg: "rounded-lg",
|
|
1566
|
+
full: "rounded-full"
|
|
1567
|
+
};
|
|
1568
|
+
var itemRadiusClass2 = {
|
|
1569
|
+
none: "first:rounded-l-hz-lg last:rounded-r-hz-lg",
|
|
1570
|
+
sm: "first:rounded-l-sm last:rounded-r-sm",
|
|
1571
|
+
md: "first:rounded-l-md last:rounded-r-md",
|
|
1572
|
+
lg: "first:rounded-l-lg last:rounded-r-lg",
|
|
1573
|
+
full: "rounded-full"
|
|
1574
|
+
};
|
|
1575
|
+
function SegmentedControl({
|
|
1576
|
+
className,
|
|
1577
|
+
options,
|
|
1578
|
+
value,
|
|
1579
|
+
onChange,
|
|
1580
|
+
size,
|
|
1581
|
+
radius = "none",
|
|
1582
|
+
...props
|
|
1583
|
+
}) {
|
|
1584
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1585
|
+
RadioGroupPrimitive__namespace.Root,
|
|
1506
1586
|
{
|
|
1507
|
-
role: "radiogroup",
|
|
1508
|
-
className: chunkYO72COII_js.cn(toggleGroupVariants({ size }), className),
|
|
1509
1587
|
...props,
|
|
1510
|
-
|
|
1511
|
-
|
|
1588
|
+
...value !== void 0 ? { value, onValueChange: onChange } : {},
|
|
1589
|
+
className: chunkYO72COII_js.cn(
|
|
1590
|
+
segmentedControlVariants({ size }),
|
|
1591
|
+
containerRadiusClass2[radius],
|
|
1592
|
+
className
|
|
1593
|
+
),
|
|
1594
|
+
children: options.map((option) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1595
|
+
RadioGroupPrimitive__namespace.Item,
|
|
1512
1596
|
{
|
|
1513
|
-
|
|
1514
|
-
type: "button",
|
|
1515
|
-
"aria-checked": value === option.value,
|
|
1597
|
+
value: option.value,
|
|
1516
1598
|
disabled: option.disabled,
|
|
1517
1599
|
className: chunkYO72COII_js.cn(
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1600
|
+
segmentedControlItemVariants({ size }),
|
|
1601
|
+
itemRadiusClass2[radius],
|
|
1602
|
+
"border border-transparent text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",
|
|
1603
|
+
"data-[state=checked]:!bg-blue-50 data-[state=checked]:border-blue-500 data-[state=checked]:text-blue-600",
|
|
1604
|
+
"dark:data-[state=checked]:!bg-blue-950/40 dark:data-[state=checked]:border-blue-400 dark:data-[state=checked]:text-blue-400"
|
|
1522
1605
|
),
|
|
1523
|
-
|
|
1524
|
-
|
|
1606
|
+
children: [
|
|
1607
|
+
/* @__PURE__ */ jsxRuntime.jsx(RadioGroupPrimitive__namespace.Indicator, { className: "hidden" }),
|
|
1608
|
+
option.label
|
|
1609
|
+
]
|
|
1525
1610
|
},
|
|
1526
1611
|
option.value
|
|
1527
1612
|
))
|
|
1528
1613
|
}
|
|
1529
1614
|
);
|
|
1530
1615
|
}
|
|
1616
|
+
var switchTrackVariants = classVarianceAuthority.cva(
|
|
1617
|
+
"peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-600 data-[state=unchecked]:bg-gray-200 dark:data-[state=checked]:bg-blue-500 dark:data-[state=unchecked]:bg-neutral-700",
|
|
1618
|
+
{
|
|
1619
|
+
variants: {
|
|
1620
|
+
size: {
|
|
1621
|
+
sm: "h-5 w-9",
|
|
1622
|
+
default: "h-6 w-11",
|
|
1623
|
+
lg: "h-7 w-[52px]"
|
|
1624
|
+
}
|
|
1625
|
+
},
|
|
1626
|
+
defaultVariants: {
|
|
1627
|
+
size: "default"
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
);
|
|
1631
|
+
var switchThumbVariants = classVarianceAuthority.cva(
|
|
1632
|
+
"pointer-events-none block rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=unchecked]:translate-x-0",
|
|
1633
|
+
{
|
|
1634
|
+
variants: {
|
|
1635
|
+
size: {
|
|
1636
|
+
sm: "h-4 w-4 data-[state=checked]:translate-x-4",
|
|
1637
|
+
default: "h-5 w-5 data-[state=checked]:translate-x-5",
|
|
1638
|
+
lg: "h-6 w-6 data-[state=checked]:translate-x-6"
|
|
1639
|
+
}
|
|
1640
|
+
},
|
|
1641
|
+
defaultVariants: {
|
|
1642
|
+
size: "default"
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
);
|
|
1646
|
+
var switchLabelVariants = classVarianceAuthority.cva("select-none", {
|
|
1647
|
+
variants: {
|
|
1648
|
+
size: {
|
|
1649
|
+
sm: "text-xs",
|
|
1650
|
+
default: "text-sm",
|
|
1651
|
+
lg: "text-base"
|
|
1652
|
+
}
|
|
1653
|
+
},
|
|
1654
|
+
defaultVariants: {
|
|
1655
|
+
size: "default"
|
|
1656
|
+
}
|
|
1657
|
+
});
|
|
1658
|
+
var Switch = React9__namespace.forwardRef(({ className, size, label, labelPosition = "right", ...props }, ref) => {
|
|
1659
|
+
const generatedId = React9__namespace.useId();
|
|
1660
|
+
const switchId = props.id ?? generatedId;
|
|
1661
|
+
const switchEl = /* @__PURE__ */ jsxRuntime.jsx(
|
|
1662
|
+
SwitchPrimitive__namespace.Root,
|
|
1663
|
+
{
|
|
1664
|
+
...props,
|
|
1665
|
+
id: switchId,
|
|
1666
|
+
ref,
|
|
1667
|
+
className: chunkYO72COII_js.cn(switchTrackVariants({ size }), className),
|
|
1668
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(SwitchPrimitive__namespace.Thumb, { className: switchThumbVariants({ size }) })
|
|
1669
|
+
}
|
|
1670
|
+
);
|
|
1671
|
+
if (!label) return switchEl;
|
|
1672
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1673
|
+
"div",
|
|
1674
|
+
{
|
|
1675
|
+
className: chunkYO72COII_js.cn(
|
|
1676
|
+
"inline-flex items-center gap-2",
|
|
1677
|
+
props.disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
1678
|
+
),
|
|
1679
|
+
children: [
|
|
1680
|
+
labelPosition === "left" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1681
|
+
"label",
|
|
1682
|
+
{
|
|
1683
|
+
htmlFor: switchId,
|
|
1684
|
+
className: chunkYO72COII_js.cn(
|
|
1685
|
+
switchLabelVariants({ size }),
|
|
1686
|
+
props.disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
1687
|
+
),
|
|
1688
|
+
children: label
|
|
1689
|
+
}
|
|
1690
|
+
),
|
|
1691
|
+
switchEl,
|
|
1692
|
+
labelPosition === "right" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1693
|
+
"label",
|
|
1694
|
+
{
|
|
1695
|
+
htmlFor: switchId,
|
|
1696
|
+
className: chunkYO72COII_js.cn(
|
|
1697
|
+
switchLabelVariants({ size }),
|
|
1698
|
+
props.disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
1699
|
+
),
|
|
1700
|
+
children: label
|
|
1701
|
+
}
|
|
1702
|
+
)
|
|
1703
|
+
]
|
|
1704
|
+
}
|
|
1705
|
+
);
|
|
1706
|
+
});
|
|
1707
|
+
Switch.displayName = "Switch";
|
|
1531
1708
|
|
|
1532
1709
|
exports.Button = Button;
|
|
1533
1710
|
exports.Card = Card;
|
|
@@ -1572,6 +1749,7 @@ exports.Popover = Popover;
|
|
|
1572
1749
|
exports.PopoverAnchor = PopoverAnchor;
|
|
1573
1750
|
exports.PopoverContent = PopoverContent;
|
|
1574
1751
|
exports.PopoverTrigger = PopoverTrigger;
|
|
1752
|
+
exports.SegmentedControl = SegmentedControl;
|
|
1575
1753
|
exports.Select = Select;
|
|
1576
1754
|
exports.SelectContent = SelectContent;
|
|
1577
1755
|
exports.SelectGroup = SelectGroup;
|
|
@@ -1595,6 +1773,7 @@ exports.SkeletonTableRow = SkeletonTableRow;
|
|
|
1595
1773
|
exports.SkeletonTableRows = SkeletonTableRows;
|
|
1596
1774
|
exports.SkeletonText = SkeletonText;
|
|
1597
1775
|
exports.SkeletonTitle = SkeletonTitle;
|
|
1776
|
+
exports.Switch = Switch;
|
|
1598
1777
|
exports.Table = Table;
|
|
1599
1778
|
exports.TableBody = TableBody;
|
|
1600
1779
|
exports.TableCaption = TableCaption;
|
|
@@ -1612,11 +1791,16 @@ exports.TabsTrigger = TabsTrigger;
|
|
|
1612
1791
|
exports.Textarea = Textarea;
|
|
1613
1792
|
exports.Toggle = Toggle;
|
|
1614
1793
|
exports.buttonVariants = buttonVariants;
|
|
1794
|
+
exports.segmentedControlItemVariants = segmentedControlItemVariants;
|
|
1795
|
+
exports.segmentedControlVariants = segmentedControlVariants;
|
|
1615
1796
|
exports.separatorVariants = separatorVariants;
|
|
1797
|
+
exports.switchLabelVariants = switchLabelVariants;
|
|
1798
|
+
exports.switchThumbVariants = switchThumbVariants;
|
|
1799
|
+
exports.switchTrackVariants = switchTrackVariants;
|
|
1616
1800
|
exports.toggleGroupVariants = toggleGroupVariants;
|
|
1617
1801
|
exports.toggleItemVariants = toggleItemVariants;
|
|
1618
1802
|
exports.useFormContext = useFormContext;
|
|
1619
1803
|
exports.useFormFieldContext = useFormFieldContext;
|
|
1620
1804
|
exports.useTableSelection = useTableSelection;
|
|
1621
|
-
//# sourceMappingURL=chunk-
|
|
1622
|
-
//# sourceMappingURL=chunk-
|
|
1805
|
+
//# sourceMappingURL=chunk-EWYLDJ4P.js.map
|
|
1806
|
+
//# sourceMappingURL=chunk-EWYLDJ4P.js.map
|