@fea-ui/react 0.1.0-alpha.7 → 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 +91 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +211 -97
- package/dist/index.d.mts +675 -561
- package/dist/index.mjs +89 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -2
package/dist/index.cjs
CHANGED
|
@@ -1509,13 +1509,32 @@ const ProgressContext = (0, react.createContext)(null);
|
|
|
1509
1509
|
|
|
1510
1510
|
//#endregion
|
|
1511
1511
|
//#region src/components/progress/progress.variants.ts
|
|
1512
|
-
const progressVariants = (0, tailwind_variants.tv)({
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
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
|
+
});
|
|
1519
1538
|
|
|
1520
1539
|
//#endregion
|
|
1521
1540
|
//#region src/components/progress/use-progress.ts
|
|
@@ -1527,8 +1546,11 @@ const useProgress = () => {
|
|
|
1527
1546
|
|
|
1528
1547
|
//#endregion
|
|
1529
1548
|
//#region src/components/progress/progress.tsx
|
|
1530
|
-
const Progress = ({ className, ...props }) => {
|
|
1531
|
-
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]);
|
|
1532
1554
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProgressContext, {
|
|
1533
1555
|
value: { slots },
|
|
1534
1556
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Progress.Root, {
|
|
@@ -1572,6 +1594,62 @@ Progress.Indicator = ProgressIndicator;
|
|
|
1572
1594
|
Progress.Root = Progress;
|
|
1573
1595
|
var progress_default = Progress;
|
|
1574
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
|
+
|
|
1575
1653
|
//#endregion
|
|
1576
1654
|
//#region src/components/slider/slider.context.ts
|
|
1577
1655
|
const SliderContext = (0, react.createContext)(null);
|
|
@@ -1934,6 +2012,8 @@ exports.Meter = meter_default;
|
|
|
1934
2012
|
exports.Navbar = navbar_default;
|
|
1935
2013
|
exports.Popover = popover_default;
|
|
1936
2014
|
exports.Progress = progress_default;
|
|
2015
|
+
exports.Radio = radio_default;
|
|
2016
|
+
exports.RadioGroup = radio_group_default;
|
|
1937
2017
|
exports.Separator = separator_default;
|
|
1938
2018
|
exports.Slider = slider_default;
|
|
1939
2019
|
exports.Switch = switch_default;
|
|
@@ -1973,6 +2053,8 @@ exports.meterVariants = meterVariants;
|
|
|
1973
2053
|
exports.navbarVariants = navbarVariants;
|
|
1974
2054
|
exports.popoverVariants = popoverVariants;
|
|
1975
2055
|
exports.progressVariants = progressVariants;
|
|
2056
|
+
exports.radioGroupVariants = radioGroupVariants;
|
|
2057
|
+
exports.radioVariants = radioVariants;
|
|
1976
2058
|
exports.separatorVariants = separatorVariants;
|
|
1977
2059
|
exports.sliderVariants = sliderVariants;
|
|
1978
2060
|
exports.switchVariants = switchVariants;
|