@fea-ui/react 0.1.0-alpha.6 → 0.1.0-alpha.8

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.cjs CHANGED
@@ -877,6 +877,28 @@ const Form = ({ className, ...props }) => {
877
877
  };
878
878
  var form_default = Form;
879
879
 
880
+ //#endregion
881
+ //#region src/components/icon-button/icon-button.variants.ts
882
+ const iconButtonVariants = (0, tailwind_variants.tv)({
883
+ base: "icon-button",
884
+ defaultVariants: { isIconOnly: true },
885
+ extend: buttonVariants
886
+ });
887
+
888
+ //#endregion
889
+ //#region src/components/icon-button/icon-button.tsx
890
+ const IconButton = ({ className, variant, size, isIconOnly, ...props }) => {
891
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(button_default, {
892
+ className: (0, tailwind_variants.cn)(className, iconButtonVariants({
893
+ isIconOnly,
894
+ size,
895
+ variant
896
+ })),
897
+ ...props
898
+ });
899
+ };
900
+ var icon_button_default = IconButton;
901
+
880
902
  //#endregion
881
903
  //#region src/components/input/input.variants.ts
882
904
  const inputVariants = (0, tailwind_variants.tv)({
@@ -1362,19 +1384,157 @@ Navbar.Menu = NavbarMenu;
1362
1384
  Navbar.MenuItem = NavbarMenuItem;
1363
1385
  var navbar_default = Navbar;
1364
1386
 
1387
+ //#endregion
1388
+ //#region src/components/popover/popover.context.ts
1389
+ const PopoverContext = (0, react.createContext)(null);
1390
+
1391
+ //#endregion
1392
+ //#region src/components/popover/popover.variants.ts
1393
+ const popoverVariants = (0, tailwind_variants.tv)({ slots: {
1394
+ arrow: "popover__arrow",
1395
+ backdrop: "popover__backdrop",
1396
+ close: "popover__close",
1397
+ description: "popover__description",
1398
+ popup: "popover__popup",
1399
+ portal: "popover__portal",
1400
+ positioner: "popover__positioner",
1401
+ root: "popover",
1402
+ title: "popover__title",
1403
+ trigger: "popover__trigger",
1404
+ viewport: "popover__viewport"
1405
+ } });
1406
+
1407
+ //#endregion
1408
+ //#region src/components/popover/use-popover.ts
1409
+ const usePopover = () => {
1410
+ const context = (0, react.useContext)(PopoverContext);
1411
+ if (!context) throw new Error("usePopover must be used within a PopoverProvider");
1412
+ return context;
1413
+ };
1414
+
1415
+ //#endregion
1416
+ //#region src/components/popover/popover.tsx
1417
+ const Popover = ({ ...props }) => {
1418
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PopoverContext, {
1419
+ value: { slots: (0, react.useMemo)(() => popoverVariants(), []) },
1420
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Popover.Root, { ...props })
1421
+ });
1422
+ };
1423
+ const PopoverTrigger = ({ className, ...props }) => {
1424
+ const { slots } = usePopover();
1425
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Popover.Trigger, {
1426
+ className: (0, tailwind_variants.cn)(slots.trigger(), className),
1427
+ ...props
1428
+ });
1429
+ };
1430
+ const PopoverPortal = ({ className, ...props }) => {
1431
+ const { slots } = usePopover();
1432
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Popover.Portal, {
1433
+ className: (0, tailwind_variants.cn)(slots.portal(), className),
1434
+ ...props
1435
+ });
1436
+ };
1437
+ const PopoverBackdrop = ({ className, ...props }) => {
1438
+ const { slots } = usePopover();
1439
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Popover.Backdrop, {
1440
+ className: (0, tailwind_variants.cn)(slots.backdrop(), className),
1441
+ ...props
1442
+ });
1443
+ };
1444
+ const PopoverPositioner = ({ className, ...props }) => {
1445
+ const { slots } = usePopover();
1446
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Popover.Positioner, {
1447
+ className: (0, tailwind_variants.cn)(slots.positioner(), className),
1448
+ ...props
1449
+ });
1450
+ };
1451
+ const PopoverPopup = ({ className, ...props }) => {
1452
+ const { slots } = usePopover();
1453
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Popover.Popup, {
1454
+ className: (0, tailwind_variants.cn)(slots.popup(), className),
1455
+ ...props
1456
+ });
1457
+ };
1458
+ const PopoverArrow = ({ className, ...props }) => {
1459
+ const { slots } = usePopover();
1460
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Popover.Arrow, {
1461
+ className: (0, tailwind_variants.cn)(slots.arrow(), className),
1462
+ ...props
1463
+ });
1464
+ };
1465
+ const PopoverViewport = ({ className, ...props }) => {
1466
+ const { slots } = usePopover();
1467
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Popover.Viewport, {
1468
+ className: (0, tailwind_variants.cn)(slots.viewport(), className),
1469
+ ...props
1470
+ });
1471
+ };
1472
+ const PopoverTitle = ({ className, ...props }) => {
1473
+ const { slots } = usePopover();
1474
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Popover.Title, {
1475
+ className: (0, tailwind_variants.cn)(slots.title(), className),
1476
+ ...props
1477
+ });
1478
+ };
1479
+ const PopoverDescription = ({ className, ...props }) => {
1480
+ const { slots } = usePopover();
1481
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Popover.Description, {
1482
+ className: (0, tailwind_variants.cn)(slots.description(), className),
1483
+ ...props
1484
+ });
1485
+ };
1486
+ const PopoverClose = ({ className, ...props }) => {
1487
+ const { slots } = usePopover();
1488
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Popover.Close, {
1489
+ className: (0, tailwind_variants.cn)(slots.close(), className),
1490
+ ...props
1491
+ });
1492
+ };
1493
+ Popover.Root = Popover;
1494
+ Popover.Trigger = PopoverTrigger;
1495
+ Popover.Portal = PopoverPortal;
1496
+ Popover.Backdrop = PopoverBackdrop;
1497
+ Popover.Positioner = PopoverPositioner;
1498
+ Popover.Popup = PopoverPopup;
1499
+ Popover.Arrow = PopoverArrow;
1500
+ Popover.Viewport = PopoverViewport;
1501
+ Popover.Title = PopoverTitle;
1502
+ Popover.Description = PopoverDescription;
1503
+ Popover.Close = PopoverClose;
1504
+ var popover_default = Popover;
1505
+
1365
1506
  //#endregion
1366
1507
  //#region src/components/progress/progress.context.ts
1367
1508
  const ProgressContext = (0, react.createContext)(null);
1368
1509
 
1369
1510
  //#endregion
1370
1511
  //#region src/components/progress/progress.variants.ts
1371
- const progressVariants = (0, tailwind_variants.tv)({ slots: {
1372
- indicator: "progress__indicator",
1373
- label: "progress__label",
1374
- root: "progress",
1375
- track: "progress__track",
1376
- value: "progress__value"
1377
- } });
1512
+ const progressVariants = (0, tailwind_variants.tv)({
1513
+ defaultVariants: {
1514
+ size: "md",
1515
+ variant: "primary"
1516
+ },
1517
+ slots: {
1518
+ indicator: "progress__indicator",
1519
+ label: "progress__label",
1520
+ root: "progress",
1521
+ track: "progress__track",
1522
+ value: "progress__value"
1523
+ },
1524
+ variants: {
1525
+ size: {
1526
+ lg: { root: "progress--lg" },
1527
+ md: { root: "progress--md" },
1528
+ sm: { root: "progress--sm" }
1529
+ },
1530
+ variant: {
1531
+ danger: { root: "progress--danger" },
1532
+ primary: { root: "progress--primary" },
1533
+ secondary: { root: "progress--secondary" },
1534
+ success: { root: "progress--success" }
1535
+ }
1536
+ }
1537
+ });
1378
1538
 
1379
1539
  //#endregion
1380
1540
  //#region src/components/progress/use-progress.ts
@@ -1386,8 +1546,11 @@ const useProgress = () => {
1386
1546
 
1387
1547
  //#endregion
1388
1548
  //#region src/components/progress/progress.tsx
1389
- const Progress = ({ className, ...props }) => {
1390
- const slots = (0, react.useMemo)(() => progressVariants(), []);
1549
+ const Progress = ({ className, variant, size, ...props }) => {
1550
+ const slots = (0, react.useMemo)(() => progressVariants({
1551
+ size,
1552
+ variant
1553
+ }), [variant, size]);
1391
1554
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProgressContext, {
1392
1555
  value: { slots },
1393
1556
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Progress.Root, {
@@ -1431,6 +1594,62 @@ Progress.Indicator = ProgressIndicator;
1431
1594
  Progress.Root = Progress;
1432
1595
  var progress_default = Progress;
1433
1596
 
1597
+ //#endregion
1598
+ //#region src/components/radio/radio.context.ts
1599
+ const RadioContext = (0, react.createContext)(null);
1600
+
1601
+ //#endregion
1602
+ //#region src/components/radio/radio.variants.ts
1603
+ const radioVariants = (0, tailwind_variants.tv)({ slots: {
1604
+ indicator: "radio__indicator",
1605
+ root: "radio"
1606
+ } });
1607
+
1608
+ //#endregion
1609
+ //#region src/components/radio/use-radio.ts
1610
+ const useRadio = () => {
1611
+ const context = (0, react.useContext)(RadioContext);
1612
+ if (!context) throw new Error("useRadio must be used within a RadioProvider");
1613
+ return context;
1614
+ };
1615
+
1616
+ //#endregion
1617
+ //#region src/components/radio/radio.tsx
1618
+ const Radio = ({ className, ...props }) => {
1619
+ const slots = (0, react.useMemo)(() => radioVariants({}), []);
1620
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RadioContext, {
1621
+ value: { slots },
1622
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Radio.Root, {
1623
+ className: (0, tailwind_variants.cn)(slots.root(), className),
1624
+ ...props
1625
+ })
1626
+ });
1627
+ };
1628
+ const RadioIndicator = ({ className, ...props }) => {
1629
+ const { slots } = useRadio();
1630
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Radio.Indicator, {
1631
+ className: (0, tailwind_variants.cn)(slots.indicator(), className),
1632
+ ...props
1633
+ });
1634
+ };
1635
+ Radio.Root = Radio;
1636
+ Radio.Indicator = RadioIndicator;
1637
+ var radio_default = Radio;
1638
+
1639
+ //#endregion
1640
+ //#region src/components/radio-group/radio-group.variants.ts
1641
+ const radioGroupVariants = (0, tailwind_variants.tv)({ base: "radio-group" });
1642
+
1643
+ //#endregion
1644
+ //#region src/components/radio-group/radio-group.tsx
1645
+ const RadioGroup = ({ className, ...props }) => {
1646
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.RadioGroup, {
1647
+ className: (0, tailwind_variants.cn)(className, (0, react.useMemo)(() => radioGroupVariants(), [])),
1648
+ ...props
1649
+ });
1650
+ };
1651
+ var radio_group_default = RadioGroup;
1652
+
1434
1653
  //#endregion
1435
1654
  //#region src/components/slider/slider.context.ts
1436
1655
  const SliderContext = (0, react.createContext)(null);
@@ -1783,6 +2002,7 @@ exports.Drawer = drawer_default;
1783
2002
  exports.Field = field_default;
1784
2003
  exports.Fieldset = fieldset_default;
1785
2004
  exports.Form = form_default;
2005
+ exports.IconButton = icon_button_default;
1786
2006
  exports.Input = input_default;
1787
2007
  exports.Label = label_default;
1788
2008
  exports.Link = link_default;
@@ -1790,7 +2010,10 @@ exports.List = list_default;
1790
2010
  exports.Menu = menu_default;
1791
2011
  exports.Meter = meter_default;
1792
2012
  exports.Navbar = navbar_default;
2013
+ exports.Popover = popover_default;
1793
2014
  exports.Progress = progress_default;
2015
+ exports.Radio = radio_default;
2016
+ exports.RadioGroup = radio_group_default;
1794
2017
  exports.Separator = separator_default;
1795
2018
  exports.Slider = slider_default;
1796
2019
  exports.Switch = switch_default;
@@ -1820,6 +2043,7 @@ exports.drawerVariants = drawerVariants;
1820
2043
  exports.fieldVariants = fieldVariants;
1821
2044
  exports.fieldsetVariants = fieldsetVariants;
1822
2045
  exports.formVariants = formVariants;
2046
+ exports.iconButtonVariants = iconButtonVariants;
1823
2047
  exports.inputVariants = inputVariants;
1824
2048
  exports.labelVariants = labelVariants;
1825
2049
  exports.linkVariants = linkVariants;
@@ -1827,7 +2051,10 @@ exports.listVariants = listVariants;
1827
2051
  exports.menuVariants = menuVariants;
1828
2052
  exports.meterVariants = meterVariants;
1829
2053
  exports.navbarVariants = navbarVariants;
2054
+ exports.popoverVariants = popoverVariants;
1830
2055
  exports.progressVariants = progressVariants;
2056
+ exports.radioGroupVariants = radioGroupVariants;
2057
+ exports.radioVariants = radioVariants;
1831
2058
  exports.separatorVariants = separatorVariants;
1832
2059
  exports.sliderVariants = sliderVariants;
1833
2060
  exports.switchVariants = switchVariants;