@fea-ui/react 0.1.0-alpha.2 → 0.1.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -90,7 +90,7 @@ const AccordionTrigger = ({ className, ...props }) => {
90
90
  };
91
91
  const AccordionTriggerIcon = ({ className, ...props }) => {
92
92
  const { slots } = useAccordion();
93
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.LucidePlus, {
93
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.LucideChevronDown, {
94
94
  className: (0, tailwind_variants.cn)(className, slots.triggerIcon()),
95
95
  ...props
96
96
  });
@@ -118,6 +118,108 @@ Accordion.Trigger = AccordionTrigger;
118
118
  Accordion.TriggerIcon = AccordionTriggerIcon;
119
119
  var accordion_default = Accordion;
120
120
 
121
+ //#endregion
122
+ //#region src/components/alert-dialog/alert-dialog.context.ts
123
+ const AlertDialogContext = (0, react.createContext)(null);
124
+
125
+ //#endregion
126
+ //#region src/components/alert-dialog/alert-dialog.variants.ts
127
+ const alertDialogVariants = (0, tailwind_variants.tv)({ slots: {
128
+ backdrop: "alert-dialog__backdrop",
129
+ close: "alert-dialog__close",
130
+ description: "alert-dialog__description",
131
+ popup: "alert-dialog__popup",
132
+ portal: "alert-dialog__portal",
133
+ root: "alert-dialog",
134
+ title: "alert-dialog__title",
135
+ trigger: "alert-dialog__trigger",
136
+ viewport: "alert-dialog__viewport"
137
+ } });
138
+
139
+ //#endregion
140
+ //#region src/components/alert-dialog/use-alert-dialog.ts
141
+ const useAlertDialog = () => {
142
+ const context = (0, react.useContext)(AlertDialogContext);
143
+ if (!context) throw new Error("useAlertDialog must be used within a AlertDialogProvider");
144
+ return context;
145
+ };
146
+
147
+ //#endregion
148
+ //#region src/components/alert-dialog/alert-dialog.tsx
149
+ const AlertDialog = ({ ...props }) => {
150
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlertDialogContext, {
151
+ value: { slots: (0, react.useMemo)(() => alertDialogVariants(), []) },
152
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.AlertDialog.Root, { ...props })
153
+ });
154
+ };
155
+ const AlertDialogTrigger = ({ className, ...props }) => {
156
+ const { slots } = useAlertDialog();
157
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.AlertDialog.Trigger, {
158
+ className: (0, tailwind_variants.cn)(slots.trigger(), className),
159
+ ...props
160
+ });
161
+ };
162
+ const AlertDialogPortal = ({ className, ...props }) => {
163
+ const { slots } = useAlertDialog();
164
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.AlertDialog.Portal, {
165
+ className: (0, tailwind_variants.cn)(slots.portal(), className),
166
+ ...props
167
+ });
168
+ };
169
+ const AlertDialogBackdrop = ({ className, ...props }) => {
170
+ const { slots } = useAlertDialog();
171
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.AlertDialog.Backdrop, {
172
+ className: (0, tailwind_variants.cn)(slots.backdrop(), className),
173
+ ...props
174
+ });
175
+ };
176
+ const AlertDialogViewport = ({ className, ...props }) => {
177
+ const { slots } = useAlertDialog();
178
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.AlertDialog.Viewport, {
179
+ className: (0, tailwind_variants.cn)(slots.viewport(), className),
180
+ ...props
181
+ });
182
+ };
183
+ const AlertDialogPopup = ({ className, ...props }) => {
184
+ const { slots } = useAlertDialog();
185
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.AlertDialog.Popup, {
186
+ className: (0, tailwind_variants.cn)(slots.popup(), className),
187
+ ...props
188
+ });
189
+ };
190
+ const AlertDialogTitle = ({ className, ...props }) => {
191
+ const { slots } = useAlertDialog();
192
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.AlertDialog.Title, {
193
+ className: (0, tailwind_variants.cn)(slots.title(), className),
194
+ ...props
195
+ });
196
+ };
197
+ const AlertDialogDescription = ({ className, ...props }) => {
198
+ const { slots } = useAlertDialog();
199
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.AlertDialog.Description, {
200
+ className: (0, tailwind_variants.cn)(slots.description(), className),
201
+ ...props
202
+ });
203
+ };
204
+ const AlertDialogClose = ({ className, children, ...props }) => {
205
+ const { slots } = useAlertDialog();
206
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.AlertDialog.Close, {
207
+ className: (0, tailwind_variants.cn)(slots.close(), className),
208
+ ...props,
209
+ children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.LucideX, {})
210
+ });
211
+ };
212
+ AlertDialog.Root = AlertDialog;
213
+ AlertDialog.Trigger = AlertDialogTrigger;
214
+ AlertDialog.Portal = AlertDialogPortal;
215
+ AlertDialog.Backdrop = AlertDialogBackdrop;
216
+ AlertDialog.Viewport = AlertDialogViewport;
217
+ AlertDialog.Popup = AlertDialogPopup;
218
+ AlertDialog.Title = AlertDialogTitle;
219
+ AlertDialog.Description = AlertDialogDescription;
220
+ AlertDialog.Close = AlertDialogClose;
221
+ var alert_dialog_default = AlertDialog;
222
+
121
223
  //#endregion
122
224
  //#region src/components/avatar/avatar.context.ts
123
225
  const AvatarContext = (0, react.createContext)(null);
@@ -1078,6 +1180,75 @@ Navbar.Menu = NavbarMenu;
1078
1180
  Navbar.MenuItem = NavbarMenuItem;
1079
1181
  var navbar_default = Navbar;
1080
1182
 
1183
+ //#endregion
1184
+ //#region src/components/progress/progress.context.ts
1185
+ const ProgressContext = (0, react.createContext)(null);
1186
+
1187
+ //#endregion
1188
+ //#region src/components/progress/progress.variants.ts
1189
+ const progressVariants = (0, tailwind_variants.tv)({ slots: {
1190
+ indicator: "progress__indicator",
1191
+ label: "progress__label",
1192
+ root: "progress",
1193
+ track: "progress__track",
1194
+ value: "progress__value"
1195
+ } });
1196
+
1197
+ //#endregion
1198
+ //#region src/components/progress/use-progress.ts
1199
+ const useProgress = () => {
1200
+ const context = (0, react.useContext)(ProgressContext);
1201
+ if (!context) throw new Error("useProgress must be used within a ProgressProvider");
1202
+ return context;
1203
+ };
1204
+
1205
+ //#endregion
1206
+ //#region src/components/progress/progress.tsx
1207
+ const Progress = ({ className, ...props }) => {
1208
+ const slots = (0, react.useMemo)(() => progressVariants(), []);
1209
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProgressContext, {
1210
+ value: { slots },
1211
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Progress.Root, {
1212
+ className: (0, tailwind_variants.cn)(className, slots.root()),
1213
+ ...props
1214
+ })
1215
+ });
1216
+ };
1217
+ const ProgressLabel = ({ className, ...props }) => {
1218
+ const { slots } = useProgress();
1219
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Progress.Label, {
1220
+ className: (0, tailwind_variants.cn)(className, slots.label()),
1221
+ ...props
1222
+ });
1223
+ };
1224
+ const ProgressValue = ({ className, ...props }) => {
1225
+ const { slots } = useProgress();
1226
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Progress.Value, {
1227
+ className: (0, tailwind_variants.cn)(className, slots.value()),
1228
+ ...props
1229
+ });
1230
+ };
1231
+ const ProgressTrack = ({ className, ...props }) => {
1232
+ const { slots } = useProgress();
1233
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Progress.Track, {
1234
+ className: (0, tailwind_variants.cn)(className, slots.track()),
1235
+ ...props
1236
+ });
1237
+ };
1238
+ const ProgressIndicator = ({ className, ...props }) => {
1239
+ const { slots } = useProgress();
1240
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Progress.Indicator, {
1241
+ className: (0, tailwind_variants.cn)(className, slots.indicator()),
1242
+ ...props
1243
+ });
1244
+ };
1245
+ Progress.Label = ProgressLabel;
1246
+ Progress.Value = ProgressValue;
1247
+ Progress.Track = ProgressTrack;
1248
+ Progress.Indicator = ProgressIndicator;
1249
+ Progress.Root = Progress;
1250
+ var progress_default = Progress;
1251
+
1081
1252
  //#endregion
1082
1253
  //#region src/components/separator/separator.variants.ts
1083
1254
  const separatorVariants = (0, tailwind_variants.tv)({
@@ -1099,6 +1270,84 @@ const Separator = ({ className, orientation, ...props }) => {
1099
1270
  };
1100
1271
  var separator_default = Separator;
1101
1272
 
1273
+ //#endregion
1274
+ //#region src/components/slider/slider.context.ts
1275
+ const SliderContext = (0, react.createContext)(null);
1276
+
1277
+ //#endregion
1278
+ //#region src/components/slider/slider.variants.ts
1279
+ const sliderVariants = (0, tailwind_variants.tv)({ slots: {
1280
+ control: "slider__control",
1281
+ indicator: "slider__indicator",
1282
+ root: "slider",
1283
+ thumb: "slider__thumb",
1284
+ track: "slider__track",
1285
+ value: "slider__value"
1286
+ } });
1287
+
1288
+ //#endregion
1289
+ //#region src/components/slider/use-slider.tsx
1290
+ const useSlider = () => {
1291
+ const context = (0, react.useContext)(SliderContext);
1292
+ if (!context) throw new Error("useSlider must be used within a SliderProvider");
1293
+ return context;
1294
+ };
1295
+
1296
+ //#endregion
1297
+ //#region src/components/slider/slider.tsx
1298
+ const Slider = ({ className, ...props }) => {
1299
+ const slots = (0, react.useMemo)(() => sliderVariants(), []);
1300
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SliderContext, {
1301
+ value: { slots },
1302
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Slider.Root, {
1303
+ className: (0, tailwind_variants.cn)(className, slots.root()),
1304
+ ...props
1305
+ })
1306
+ });
1307
+ };
1308
+ const SliderValue = ({ className, ...props }) => {
1309
+ const { slots } = useSlider();
1310
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Slider.Value, {
1311
+ className: (0, tailwind_variants.cn)(className, slots.value()),
1312
+ ...props
1313
+ });
1314
+ };
1315
+ const SliderControl = ({ className, ...props }) => {
1316
+ const { slots } = useSlider();
1317
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Slider.Control, {
1318
+ className: (0, tailwind_variants.cn)(className, slots.control()),
1319
+ ...props
1320
+ });
1321
+ };
1322
+ const SliderTrack = ({ className, ...props }) => {
1323
+ const { slots } = useSlider();
1324
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Slider.Track, {
1325
+ className: (0, tailwind_variants.cn)(className, slots.track()),
1326
+ ...props
1327
+ });
1328
+ };
1329
+ const SliderIndicator = ({ className, ...props }) => {
1330
+ const { slots } = useSlider();
1331
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Slider.Indicator, {
1332
+ className: (0, tailwind_variants.cn)(className, slots.indicator()),
1333
+ ...props
1334
+ });
1335
+ };
1336
+ const SliderThumb = ({ className, ...props }) => {
1337
+ const { slots } = useSlider();
1338
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Slider.Thumb, {
1339
+ className: (0, tailwind_variants.cn)(className, slots.thumb()),
1340
+ ...props
1341
+ });
1342
+ };
1343
+ Slider.Value = SliderValue;
1344
+ Slider.Control = SliderControl;
1345
+ Slider.Track = SliderTrack;
1346
+ Slider.Indicator = SliderIndicator;
1347
+ Slider.Thumb = SliderThumb;
1348
+ Slider.Root = Slider;
1349
+ var slider_default = Slider;
1350
+
1102
1351
  //#endregion
1103
1352
  //#region src/components/switch/switch.context.ts
1104
1353
  const SwitchContext = (0, react.createContext)(null);
@@ -1149,6 +1398,93 @@ Switch.Thumb = SwitchThumb;
1149
1398
  Switch.Root = Switch;
1150
1399
  var switch_default = Switch;
1151
1400
 
1401
+ //#endregion
1402
+ //#region src/components/table/table.context.ts
1403
+ const TableContext = (0, react.createContext)(null);
1404
+
1405
+ //#endregion
1406
+ //#region src/components/table/table.variants.ts
1407
+ const tableVariants = (0, tailwind_variants.tv)({ slots: {
1408
+ root: "table",
1409
+ tbody: "table__tbody",
1410
+ td: "table__td",
1411
+ tfoot: "table__tfoot",
1412
+ th: "table__th",
1413
+ thead: "table__thead",
1414
+ tr: "table__tr"
1415
+ } });
1416
+
1417
+ //#endregion
1418
+ //#region src/components/table/use-table.ts
1419
+ const useTable = () => {
1420
+ const context = (0, react.useContext)(TableContext);
1421
+ if (!context) throw new Error("useTable must be used within a TableProvider");
1422
+ return context;
1423
+ };
1424
+
1425
+ //#endregion
1426
+ //#region src/components/table/table.tsx
1427
+ const Table = ({ className, ...props }) => {
1428
+ const slots = (0, react.useMemo)(() => tableVariants(), []);
1429
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableContext, {
1430
+ value: { slots },
1431
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("table", {
1432
+ className: (0, tailwind_variants.cn)(className, slots.root()),
1433
+ ...props
1434
+ })
1435
+ });
1436
+ };
1437
+ const TableHead = ({ className, ...props }) => {
1438
+ const { slots } = useTable();
1439
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("thead", {
1440
+ className: (0, tailwind_variants.cn)(className, slots.thead()),
1441
+ ...props
1442
+ });
1443
+ };
1444
+ const TableRow = ({ className, ...props }) => {
1445
+ const { slots } = useTable();
1446
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tr", {
1447
+ className: (0, tailwind_variants.cn)(className, slots.tr()),
1448
+ ...props
1449
+ });
1450
+ };
1451
+ const TableHeaderCell = ({ className, ...props }) => {
1452
+ const { slots } = useTable();
1453
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", {
1454
+ className: (0, tailwind_variants.cn)(className, slots.th()),
1455
+ ...props
1456
+ });
1457
+ };
1458
+ const TableBody = ({ className, ...props }) => {
1459
+ const { slots } = useTable();
1460
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tbody", {
1461
+ className: (0, tailwind_variants.cn)(className, slots.tbody()),
1462
+ ...props
1463
+ });
1464
+ };
1465
+ const TableDataCell = ({ className, ...props }) => {
1466
+ const { slots } = useTable();
1467
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
1468
+ className: (0, tailwind_variants.cn)(className, slots.td()),
1469
+ ...props
1470
+ });
1471
+ };
1472
+ const TableFooter = ({ className, ...props }) => {
1473
+ const { slots } = useTable();
1474
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tfoot", {
1475
+ className: (0, tailwind_variants.cn)(className, slots.tfoot()),
1476
+ ...props
1477
+ });
1478
+ };
1479
+ Table.Root = Table;
1480
+ Table.Head = TableHead;
1481
+ Table.Row = TableRow;
1482
+ Table.HeaderCell = TableHeaderCell;
1483
+ Table.Body = TableBody;
1484
+ Table.DataCell = TableDataCell;
1485
+ Table.Footer = TableFooter;
1486
+ var table_default = Table;
1487
+
1152
1488
  //#endregion
1153
1489
  //#region src/components/tabs/tabs.context.ts
1154
1490
  const TabsContext = (0, react.createContext)(null);
@@ -1272,6 +1608,7 @@ var toggle_button_default = ToggleButton;
1272
1608
 
1273
1609
  //#endregion
1274
1610
  exports.Accordion = accordion_default;
1611
+ exports.AlertDialog = alert_dialog_default;
1275
1612
  exports.Avatar = avatar_default;
1276
1613
  exports.Button = button_default;
1277
1614
  exports.ButtonGroup = button_group_default;
@@ -1290,13 +1627,17 @@ exports.List = list_default;
1290
1627
  exports.Menu = menu_default;
1291
1628
  exports.Meter = meter_default;
1292
1629
  exports.Navbar = navbar_default;
1630
+ exports.Progress = progress_default;
1293
1631
  exports.Separator = separator_default;
1632
+ exports.Slider = slider_default;
1294
1633
  exports.Switch = switch_default;
1634
+ exports.Table = table_default;
1295
1635
  exports.Tabs = tabs_default;
1296
1636
  exports.Text = text_default;
1297
1637
  exports.Textarea = textarea_default;
1298
1638
  exports.ToggleButton = toggle_button_default;
1299
1639
  exports.accordionVariants = accordionVariants;
1640
+ exports.alertDialogVariants = alertDialogVariants;
1300
1641
  exports.avatarVariants = avatarVariants;
1301
1642
  exports.buttonGroupVariants = buttonGroupVariants;
1302
1643
  exports.buttonVariants = buttonVariants;
@@ -1321,8 +1662,11 @@ exports.listVariants = listVariants;
1321
1662
  exports.menuVariants = menuVariants;
1322
1663
  exports.meterVariants = meterVariants;
1323
1664
  exports.navbarVariants = navbarVariants;
1665
+ exports.progressVariants = progressVariants;
1324
1666
  exports.separatorVariants = separatorVariants;
1667
+ exports.sliderVariants = sliderVariants;
1325
1668
  exports.switchVariants = switchVariants;
1669
+ exports.tableVariants = tableVariants;
1326
1670
  exports.tabsVariants = tabsVariants;
1327
1671
  exports.textVariants = textVariants;
1328
1672
  exports.textareaVariants = textareaVariants;