@fea-ui/react 0.0.1 → 0.0.2

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
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  //#region rolldown:runtime
2
3
  var __create = Object.create;
3
4
  var __defProp = Object.defineProperty;
@@ -3406,101 +3407,6 @@ var tabs_default = Object.assign(Tabs, {
3406
3407
  Tab: TabsTab
3407
3408
  });
3408
3409
 
3409
- //#endregion
3410
- //#region src/components/toast/toast.context.ts
3411
- const ToastContext = (0, react.createContext)(null);
3412
-
3413
- //#endregion
3414
- //#region src/components/toast/toast.variants.ts
3415
- const toastVariants = (0, tailwind_variants.tv)({
3416
- defaultVariants: { variant: "default" },
3417
- slots: {
3418
- action: "toast__action",
3419
- close: "toast__close",
3420
- description: "toast__description",
3421
- root: "toast group",
3422
- title: "toast__title",
3423
- viewport: "toast__viewport"
3424
- },
3425
- variants: { variant: {
3426
- default: { root: "bg-background text-foreground" },
3427
- destructive: { root: "destructive group border-danger bg-danger text-danger-foreground" }
3428
- } }
3429
- });
3430
-
3431
- //#endregion
3432
- //#region src/components/toast/use-toast.ts
3433
- const useToast$1 = () => {
3434
- const context = (0, react.useContext)(ToastContext);
3435
- if (!context) throw new Error("useToast must be used within a ToastProvider");
3436
- return context;
3437
- };
3438
-
3439
- //#endregion
3440
- //#region src/components/toast/toast.tsx
3441
- const Toast = ({ className, variant, ...props }) => {
3442
- const slots = (0, react.useMemo)(() => toastVariants({ variant }), [variant]);
3443
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToastContext, {
3444
- value: { slots },
3445
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Toast.Root, {
3446
- className: (0, tailwind_variants.cn)(className, slots.root()),
3447
- ...props
3448
- })
3449
- });
3450
- };
3451
- const ToastTitle = ({ className, ...props }) => {
3452
- const { slots } = useToast$1();
3453
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Toast.Title, {
3454
- className: (0, tailwind_variants.cn)(className, slots.title()),
3455
- ...props
3456
- });
3457
- };
3458
- const ToastDescription = ({ className, ...props }) => {
3459
- const { slots } = useToast$1();
3460
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Toast.Description, {
3461
- className: (0, tailwind_variants.cn)(className, slots.description()),
3462
- ...props
3463
- });
3464
- };
3465
- const ToastAction = ({ className, ...props }) => {
3466
- const { slots } = useToast$1();
3467
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Toast.Action, {
3468
- className: (0, tailwind_variants.cn)(className, slots.action()),
3469
- ...props
3470
- });
3471
- };
3472
- const ToastClose = ({ className, children, ...props }) => {
3473
- const { slots } = useToast$1();
3474
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Toast.Close, {
3475
- className: (0, tailwind_variants.cn)(className, slots.close()),
3476
- ...props,
3477
- children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.LucideX, { className: "size-4" })
3478
- });
3479
- };
3480
- const ToastProvider = _base_ui_react.Toast.Provider;
3481
- const ToastPortal = _base_ui_react.Toast.Portal;
3482
- const ToastViewport = ({ className, ...props }) => {
3483
- const { viewport } = toastVariants();
3484
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Toast.Viewport, {
3485
- className: (0, tailwind_variants.cn)(className, viewport()),
3486
- ...props
3487
- });
3488
- };
3489
- var toast_default = Object.assign(Toast, {
3490
- Action: ToastAction,
3491
- Close: ToastClose,
3492
- Description: ToastDescription,
3493
- Portal: ToastPortal,
3494
- Provider: ToastProvider,
3495
- Root: Toast,
3496
- Title: ToastTitle,
3497
- Viewport: ToastViewport
3498
- });
3499
-
3500
- //#endregion
3501
- //#region src/components/toast/index.ts
3502
- const useToast = _base_ui_react.Toast.useToastManager;
3503
-
3504
3410
  //#endregion
3505
3411
  //#region src/components/toggle-button/toggle-button.variants.ts
3506
3412
  const toggleButtonVariants = (0, tailwind_variants.tv)({
@@ -3642,7 +3548,6 @@ exports.Spinner = spinner_default;
3642
3548
  exports.Switch = switch_default;
3643
3549
  exports.Table = table_default;
3644
3550
  exports.Tabs = tabs_default;
3645
- exports.Toast = toast_default;
3646
3551
  exports.ToggleButton = toggle_button_default;
3647
3552
  exports.Tooltip = tooltip_default;
3648
3553
  exports.accordionVariants = accordionVariants;
@@ -3695,5 +3600,4 @@ exports.switchVariants = switchVariants;
3695
3600
  exports.tableVariants = tableVariants;
3696
3601
  exports.tabsVariants = tabsVariants;
3697
3602
  exports.toggleButtonVariants = toggleButtonVariants;
3698
- exports.useToast = useToast;
3699
3603
  //# sourceMappingURL=index.cjs.map