@fea-ui/react 0.0.0-canary.4 → 0.0.0-canary.5
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 +374 -46
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +461 -108
- package/dist/index.d.mts +1059 -706
- package/dist/index.mjs +375 -51
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -2
package/dist/index.cjs
CHANGED
|
@@ -1752,12 +1752,19 @@ const SelectContext = (0, react.createContext)(null);
|
|
|
1752
1752
|
//#endregion
|
|
1753
1753
|
//#region src/components/select/select.variants.ts
|
|
1754
1754
|
const selectVariants = (0, tailwind_variants.tv)({ slots: {
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1755
|
+
group: "select__group",
|
|
1756
|
+
groupLabel: "select__group-label",
|
|
1757
|
+
icon: "select__icon",
|
|
1758
|
+
item: "select__item",
|
|
1759
|
+
itemIndicator: "select__item-indicator",
|
|
1760
|
+
popup: "select__popup",
|
|
1761
|
+
positioner: "select__positioner",
|
|
1762
|
+
root: "select",
|
|
1763
|
+
scrollDownArrow: "select__scroll-down-arrow",
|
|
1764
|
+
scrollUpArrow: "select__scroll-up-arrow",
|
|
1765
|
+
separator: "select__separator",
|
|
1766
|
+
trigger: "select__trigger",
|
|
1767
|
+
value: "select__value"
|
|
1761
1768
|
} });
|
|
1762
1769
|
|
|
1763
1770
|
//#endregion
|
|
@@ -1770,65 +1777,109 @@ const useSelect = () => {
|
|
|
1770
1777
|
|
|
1771
1778
|
//#endregion
|
|
1772
1779
|
//#region src/components/select/select.tsx
|
|
1773
|
-
const Select = ({
|
|
1780
|
+
const Select = ({ ...props }) => {
|
|
1774
1781
|
const slots = (0, react.useMemo)(() => selectVariants(), []);
|
|
1775
|
-
const generatedId = (0, react.useId)();
|
|
1776
|
-
const inputId = props.id || generatedId;
|
|
1777
1782
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectContext.Provider, {
|
|
1778
|
-
value: {
|
|
1779
|
-
|
|
1780
|
-
slots
|
|
1781
|
-
},
|
|
1782
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1783
|
-
className: (0, tailwind_variants.cn)(className, slots.root()),
|
|
1784
|
-
...props
|
|
1785
|
-
})
|
|
1783
|
+
value: { slots },
|
|
1784
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Select.Root, { ...props })
|
|
1786
1785
|
});
|
|
1787
1786
|
};
|
|
1788
|
-
const
|
|
1789
|
-
const { slots
|
|
1790
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.
|
|
1791
|
-
className: (0, tailwind_variants.cn)(
|
|
1792
|
-
|
|
1787
|
+
const SelectTrigger = ({ className, children, ...props }) => {
|
|
1788
|
+
const { slots } = useSelect();
|
|
1789
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_base_ui_react.Select.Trigger, {
|
|
1790
|
+
className: (0, tailwind_variants.cn)(slots.trigger(), className),
|
|
1791
|
+
...props,
|
|
1792
|
+
children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Select.Icon, {
|
|
1793
|
+
className: slots.icon(),
|
|
1794
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronDown, {})
|
|
1795
|
+
})]
|
|
1796
|
+
});
|
|
1797
|
+
};
|
|
1798
|
+
const SelectValue = ({ className, ...props }) => {
|
|
1799
|
+
const { slots } = useSelect();
|
|
1800
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Select.Value, {
|
|
1801
|
+
className: (0, tailwind_variants.cn)(slots.value(), className),
|
|
1793
1802
|
...props
|
|
1794
1803
|
});
|
|
1795
1804
|
};
|
|
1796
|
-
const
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1805
|
+
const SelectPortal = ({ ...props }) => {
|
|
1806
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Select.Portal, { ...props });
|
|
1807
|
+
};
|
|
1808
|
+
const SelectPositioner = ({ className, ...props }) => {
|
|
1809
|
+
const { slots } = useSelect();
|
|
1810
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Select.Positioner, {
|
|
1811
|
+
className: (0, tailwind_variants.cn)(slots.positioner(), className),
|
|
1801
1812
|
...props
|
|
1802
1813
|
});
|
|
1803
1814
|
};
|
|
1804
|
-
const
|
|
1815
|
+
const SelectPopup = ({ className, ...props }) => {
|
|
1805
1816
|
const { slots } = useSelect();
|
|
1806
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1807
|
-
className: (0, tailwind_variants.cn)(
|
|
1817
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Select.Popup, {
|
|
1818
|
+
className: (0, tailwind_variants.cn)(slots.popup(), className),
|
|
1808
1819
|
...props
|
|
1809
1820
|
});
|
|
1810
1821
|
};
|
|
1811
|
-
const
|
|
1822
|
+
const SelectItem = ({ className, children, ...props }) => {
|
|
1812
1823
|
const { slots } = useSelect();
|
|
1813
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.
|
|
1814
|
-
className: (0, tailwind_variants.cn)(
|
|
1824
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_base_ui_react.Select.Item, {
|
|
1825
|
+
className: (0, tailwind_variants.cn)(slots.item(), className),
|
|
1826
|
+
...props,
|
|
1827
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Select.ItemIndicator, {
|
|
1828
|
+
className: slots.itemIndicator(),
|
|
1829
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "h-4 w-4" })
|
|
1830
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Select.ItemText, { children })]
|
|
1831
|
+
});
|
|
1832
|
+
};
|
|
1833
|
+
const SelectGroup = ({ className, ...props }) => {
|
|
1834
|
+
const { slots } = useSelect();
|
|
1835
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Select.Group, {
|
|
1836
|
+
className: (0, tailwind_variants.cn)(slots.group(), className),
|
|
1815
1837
|
...props
|
|
1816
1838
|
});
|
|
1817
1839
|
};
|
|
1818
|
-
const
|
|
1840
|
+
const SelectGroupLabel = ({ className, ...props }) => {
|
|
1819
1841
|
const { slots } = useSelect();
|
|
1820
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1821
|
-
className: (0, tailwind_variants.cn)(
|
|
1842
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Select.GroupLabel, {
|
|
1843
|
+
className: (0, tailwind_variants.cn)(slots.groupLabel(), className),
|
|
1844
|
+
...props
|
|
1845
|
+
});
|
|
1846
|
+
};
|
|
1847
|
+
const SelectSeparator = ({ className, ...props }) => {
|
|
1848
|
+
const { slots } = useSelect();
|
|
1849
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Select.Separator, {
|
|
1850
|
+
className: (0, tailwind_variants.cn)(slots.separator(), className),
|
|
1822
1851
|
...props
|
|
1823
1852
|
});
|
|
1824
1853
|
};
|
|
1854
|
+
const SelectScrollUpArrow = ({ className, ...props }) => {
|
|
1855
|
+
const { slots } = useSelect();
|
|
1856
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Select.ScrollUpArrow, {
|
|
1857
|
+
className: (0, tailwind_variants.cn)(slots.scrollUpArrow(), className),
|
|
1858
|
+
...props,
|
|
1859
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronUp, { className: "h-4 w-4" })
|
|
1860
|
+
});
|
|
1861
|
+
};
|
|
1862
|
+
const SelectScrollDownArrow = ({ className, ...props }) => {
|
|
1863
|
+
const { slots } = useSelect();
|
|
1864
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Select.ScrollDownArrow, {
|
|
1865
|
+
className: (0, tailwind_variants.cn)(slots.scrollDownArrow(), className),
|
|
1866
|
+
...props,
|
|
1867
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronDown, { className: "h-4 w-4" })
|
|
1868
|
+
});
|
|
1869
|
+
};
|
|
1825
1870
|
var select_default = Object.assign(Select, {
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1871
|
+
Group: SelectGroup,
|
|
1872
|
+
GroupLabel: SelectGroupLabel,
|
|
1873
|
+
Item: SelectItem,
|
|
1874
|
+
Popup: SelectPopup,
|
|
1875
|
+
Portal: SelectPortal,
|
|
1876
|
+
Positioner: SelectPositioner,
|
|
1877
|
+
Root: Select,
|
|
1878
|
+
ScrollDownArrow: SelectScrollDownArrow,
|
|
1879
|
+
ScrollUpArrow: SelectScrollUpArrow,
|
|
1880
|
+
Separator: SelectSeparator,
|
|
1881
|
+
Trigger: SelectTrigger,
|
|
1882
|
+
Value: SelectValue
|
|
1832
1883
|
});
|
|
1833
1884
|
|
|
1834
1885
|
//#endregion
|
|
@@ -2061,12 +2112,12 @@ const spinnerVariants = (0, tailwind_variants.tv)({
|
|
|
2061
2112
|
|
|
2062
2113
|
//#endregion
|
|
2063
2114
|
//#region src/components/spinner/spinner.tsx
|
|
2064
|
-
const Spinner = ({ className,
|
|
2115
|
+
const Spinner = ({ className, size, variant, asChild, ...props }) => {
|
|
2065
2116
|
const styles = spinnerVariants({
|
|
2066
2117
|
size,
|
|
2067
2118
|
variant
|
|
2068
2119
|
});
|
|
2069
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.
|
|
2120
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.LucideLoader, {
|
|
2070
2121
|
"aria-label": "Loading",
|
|
2071
2122
|
className: (0, tailwind_variants.cn)(className, styles),
|
|
2072
2123
|
role: "status",
|
|
@@ -2240,8 +2291,37 @@ const useTabs = () => {
|
|
|
2240
2291
|
//#region src/components/tabs/tabs.tsx
|
|
2241
2292
|
const Tabs = ({ className, ...props }) => {
|
|
2242
2293
|
const slots = (0, react.useMemo)(() => tabsVariants(), []);
|
|
2294
|
+
const [listRef, setListRef] = react.default.useState(null);
|
|
2295
|
+
react.default.useEffect(() => {
|
|
2296
|
+
if (!listRef) return;
|
|
2297
|
+
const updateIndicator = () => {
|
|
2298
|
+
const activeTab = listRef.querySelector("[data-state=\"active\"]");
|
|
2299
|
+
if (activeTab) {
|
|
2300
|
+
const listRect = listRef.getBoundingClientRect();
|
|
2301
|
+
const tabRect = activeTab.getBoundingClientRect();
|
|
2302
|
+
listRef.style.setProperty("--active-tab-width", `${tabRect.width}px`);
|
|
2303
|
+
listRef.style.setProperty("--active-tab-left", `${tabRect.left - listRect.left + tabRect.width / 2}px`);
|
|
2304
|
+
}
|
|
2305
|
+
};
|
|
2306
|
+
updateIndicator();
|
|
2307
|
+
const observer = new MutationObserver(updateIndicator);
|
|
2308
|
+
observer.observe(listRef, {
|
|
2309
|
+
attributeFilter: ["data-state"],
|
|
2310
|
+
attributes: true,
|
|
2311
|
+
subtree: true
|
|
2312
|
+
});
|
|
2313
|
+
window.addEventListener("resize", updateIndicator);
|
|
2314
|
+
return () => {
|
|
2315
|
+
observer.disconnect();
|
|
2316
|
+
window.removeEventListener("resize", updateIndicator);
|
|
2317
|
+
};
|
|
2318
|
+
}, [listRef]);
|
|
2243
2319
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TabsContext.Provider, {
|
|
2244
|
-
value: {
|
|
2320
|
+
value: {
|
|
2321
|
+
listRef,
|
|
2322
|
+
setListRef,
|
|
2323
|
+
slots
|
|
2324
|
+
},
|
|
2245
2325
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Tabs.Root, {
|
|
2246
2326
|
className: (0, tailwind_variants.cn)(className, slots.root()),
|
|
2247
2327
|
...props
|
|
@@ -2249,9 +2329,10 @@ const Tabs = ({ className, ...props }) => {
|
|
|
2249
2329
|
});
|
|
2250
2330
|
};
|
|
2251
2331
|
const TabsList = ({ className, ...props }) => {
|
|
2252
|
-
const { slots } = useTabs();
|
|
2332
|
+
const { slots, setListRef } = useTabs();
|
|
2253
2333
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Tabs.List, {
|
|
2254
2334
|
className: (0, tailwind_variants.cn)(slots.list(), className),
|
|
2335
|
+
ref: setListRef,
|
|
2255
2336
|
...props
|
|
2256
2337
|
});
|
|
2257
2338
|
};
|
|
@@ -2304,6 +2385,249 @@ const ToggleButton = ({ className, variant, size, ...props }) => {
|
|
|
2304
2385
|
};
|
|
2305
2386
|
var toggle_button_default = ToggleButton;
|
|
2306
2387
|
|
|
2388
|
+
//#endregion
|
|
2389
|
+
//#region src/components/tooltip/tooltip.context.ts
|
|
2390
|
+
const TooltipContext = (0, react.createContext)(null);
|
|
2391
|
+
|
|
2392
|
+
//#endregion
|
|
2393
|
+
//#region src/components/tooltip/tooltip.variants.ts
|
|
2394
|
+
const tooltipVariants = (0, tailwind_variants.tv)({ slots: {
|
|
2395
|
+
arrow: "tooltip__arrow",
|
|
2396
|
+
popup: "tooltip__popup",
|
|
2397
|
+
portal: "tooltip__portal",
|
|
2398
|
+
positioner: "tooltip__positioner",
|
|
2399
|
+
root: "tooltip",
|
|
2400
|
+
trigger: "tooltip__trigger"
|
|
2401
|
+
} });
|
|
2402
|
+
|
|
2403
|
+
//#endregion
|
|
2404
|
+
//#region src/components/tooltip/use-tooltip.ts
|
|
2405
|
+
const useTooltip = () => {
|
|
2406
|
+
const context = (0, react.useContext)(TooltipContext);
|
|
2407
|
+
if (!context) throw new Error("useTooltip must be used within a TooltipProvider");
|
|
2408
|
+
return context;
|
|
2409
|
+
};
|
|
2410
|
+
|
|
2411
|
+
//#endregion
|
|
2412
|
+
//#region src/components/tooltip/tooltip.tsx
|
|
2413
|
+
const Tooltip = ({ ...props }) => {
|
|
2414
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TooltipContext, {
|
|
2415
|
+
value: { slots: (0, react.useMemo)(() => tooltipVariants({}), []) },
|
|
2416
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Tooltip.Root, { ...props })
|
|
2417
|
+
});
|
|
2418
|
+
};
|
|
2419
|
+
const TooltipTrigger = ({ className, ...props }) => {
|
|
2420
|
+
const { slots } = useTooltip();
|
|
2421
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Tooltip.Trigger, {
|
|
2422
|
+
className: (0, tailwind_variants.cn)(className, slots.trigger()),
|
|
2423
|
+
...props
|
|
2424
|
+
});
|
|
2425
|
+
};
|
|
2426
|
+
const TooltipPortal = ({ className, ...props }) => {
|
|
2427
|
+
const { slots } = useTooltip();
|
|
2428
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Tooltip.Portal, {
|
|
2429
|
+
className: (0, tailwind_variants.cn)(className, slots.portal()),
|
|
2430
|
+
...props
|
|
2431
|
+
});
|
|
2432
|
+
};
|
|
2433
|
+
const TooltipPositioner = ({ className, ...props }) => {
|
|
2434
|
+
const { slots } = useTooltip();
|
|
2435
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Tooltip.Positioner, {
|
|
2436
|
+
className: (0, tailwind_variants.cn)(className, slots.positioner()),
|
|
2437
|
+
...props
|
|
2438
|
+
});
|
|
2439
|
+
};
|
|
2440
|
+
const TooltipPopup = ({ className, ...props }) => {
|
|
2441
|
+
const { slots } = useTooltip();
|
|
2442
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Tooltip.Popup, {
|
|
2443
|
+
className: (0, tailwind_variants.cn)(className, slots.popup()),
|
|
2444
|
+
...props
|
|
2445
|
+
});
|
|
2446
|
+
};
|
|
2447
|
+
const TooltipArrow = ({ className, ...props }) => {
|
|
2448
|
+
const { slots } = useTooltip();
|
|
2449
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Tooltip.Arrow, {
|
|
2450
|
+
className: (0, tailwind_variants.cn)(className, slots.arrow()),
|
|
2451
|
+
...props
|
|
2452
|
+
});
|
|
2453
|
+
};
|
|
2454
|
+
var tooltip_default = Object.assign(Tooltip, {
|
|
2455
|
+
Arrow: TooltipArrow,
|
|
2456
|
+
Popup: TooltipPopup,
|
|
2457
|
+
Portal: TooltipPortal,
|
|
2458
|
+
Positioner: TooltipPositioner,
|
|
2459
|
+
Provider: _base_ui_react.Tooltip.Provider,
|
|
2460
|
+
Root: Tooltip,
|
|
2461
|
+
Trigger: TooltipTrigger
|
|
2462
|
+
});
|
|
2463
|
+
|
|
2464
|
+
//#endregion
|
|
2465
|
+
//#region src/components/toast/toast.context.ts
|
|
2466
|
+
const ToastContext = (0, react.createContext)(null);
|
|
2467
|
+
|
|
2468
|
+
//#endregion
|
|
2469
|
+
//#region src/components/toast/toast.variants.ts
|
|
2470
|
+
const toastVariants = (0, tailwind_variants.tv)({
|
|
2471
|
+
slots: {
|
|
2472
|
+
action: "toast__action",
|
|
2473
|
+
close: "toast__close",
|
|
2474
|
+
description: "toast__description",
|
|
2475
|
+
root: "toast group",
|
|
2476
|
+
title: "toast__title",
|
|
2477
|
+
viewport: "toast__viewport"
|
|
2478
|
+
},
|
|
2479
|
+
variants: { variant: {
|
|
2480
|
+
default: { root: "bg-background text-foreground" },
|
|
2481
|
+
destructive: { root: "destructive group border-danger bg-danger text-danger-foreground" }
|
|
2482
|
+
} },
|
|
2483
|
+
defaultVariants: { variant: "default" }
|
|
2484
|
+
});
|
|
2485
|
+
|
|
2486
|
+
//#endregion
|
|
2487
|
+
//#region src/components/toast/use-toast.ts
|
|
2488
|
+
const useToast$1 = () => {
|
|
2489
|
+
const context = (0, react.useContext)(ToastContext);
|
|
2490
|
+
if (!context) throw new Error("useToast must be used within a ToastProvider");
|
|
2491
|
+
return context;
|
|
2492
|
+
};
|
|
2493
|
+
|
|
2494
|
+
//#endregion
|
|
2495
|
+
//#region src/components/toast/toast.tsx
|
|
2496
|
+
const Toast = ({ className, variant, ...props }) => {
|
|
2497
|
+
const slots = (0, react.useMemo)(() => toastVariants({ variant }), [variant]);
|
|
2498
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToastContext, {
|
|
2499
|
+
value: { slots },
|
|
2500
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Toast.Root, {
|
|
2501
|
+
className: (0, tailwind_variants.cn)(className, slots.root()),
|
|
2502
|
+
...props
|
|
2503
|
+
})
|
|
2504
|
+
});
|
|
2505
|
+
};
|
|
2506
|
+
const ToastTitle = ({ className, ...props }) => {
|
|
2507
|
+
const { slots } = useToast$1();
|
|
2508
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Toast.Title, {
|
|
2509
|
+
className: (0, tailwind_variants.cn)(className, slots.title()),
|
|
2510
|
+
...props
|
|
2511
|
+
});
|
|
2512
|
+
};
|
|
2513
|
+
const ToastDescription = ({ className, ...props }) => {
|
|
2514
|
+
const { slots } = useToast$1();
|
|
2515
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Toast.Description, {
|
|
2516
|
+
className: (0, tailwind_variants.cn)(className, slots.description()),
|
|
2517
|
+
...props
|
|
2518
|
+
});
|
|
2519
|
+
};
|
|
2520
|
+
const ToastAction = ({ className, ...props }) => {
|
|
2521
|
+
const { slots } = useToast$1();
|
|
2522
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Toast.Action, {
|
|
2523
|
+
className: (0, tailwind_variants.cn)(className, slots.action()),
|
|
2524
|
+
...props
|
|
2525
|
+
});
|
|
2526
|
+
};
|
|
2527
|
+
const ToastClose = ({ className, children, ...props }) => {
|
|
2528
|
+
const { slots } = useToast$1();
|
|
2529
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Toast.Close, {
|
|
2530
|
+
className: (0, tailwind_variants.cn)(className, slots.close()),
|
|
2531
|
+
...props,
|
|
2532
|
+
children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.LucideX, { className: "size-4" })
|
|
2533
|
+
});
|
|
2534
|
+
};
|
|
2535
|
+
const ToastProvider = _base_ui_react.Toast.Provider;
|
|
2536
|
+
const ToastPortal = _base_ui_react.Toast.Portal;
|
|
2537
|
+
const ToastViewport = ({ className, ...props }) => {
|
|
2538
|
+
const { viewport } = toastVariants();
|
|
2539
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Toast.Viewport, {
|
|
2540
|
+
className: (0, tailwind_variants.cn)(className, viewport()),
|
|
2541
|
+
...props
|
|
2542
|
+
});
|
|
2543
|
+
};
|
|
2544
|
+
var toast_default = Object.assign(Toast, {
|
|
2545
|
+
Action: ToastAction,
|
|
2546
|
+
Close: ToastClose,
|
|
2547
|
+
Description: ToastDescription,
|
|
2548
|
+
Provider: ToastProvider,
|
|
2549
|
+
Portal: ToastPortal,
|
|
2550
|
+
Root: Toast,
|
|
2551
|
+
Title: ToastTitle,
|
|
2552
|
+
Viewport: ToastViewport
|
|
2553
|
+
});
|
|
2554
|
+
|
|
2555
|
+
//#endregion
|
|
2556
|
+
//#region src/components/toast/index.ts
|
|
2557
|
+
const useToast = _base_ui_react.Toast.useToastManager;
|
|
2558
|
+
|
|
2559
|
+
//#endregion
|
|
2560
|
+
//#region src/components/collapsible/collapsible.context.ts
|
|
2561
|
+
const CollapsibleContext = (0, react.createContext)(null);
|
|
2562
|
+
|
|
2563
|
+
//#endregion
|
|
2564
|
+
//#region src/components/collapsible/collapsible.variants.ts
|
|
2565
|
+
const collapsibleVariants = (0, tailwind_variants.tv)({ slots: {
|
|
2566
|
+
content: "collapsible__content",
|
|
2567
|
+
panel: "collapsible__panel",
|
|
2568
|
+
root: "collapsible",
|
|
2569
|
+
trigger: "collapsible__trigger",
|
|
2570
|
+
triggerIcon: "collapsible__trigger-icon"
|
|
2571
|
+
} });
|
|
2572
|
+
|
|
2573
|
+
//#endregion
|
|
2574
|
+
//#region src/components/collapsible/use-collapsible.ts
|
|
2575
|
+
const useCollapsible = () => {
|
|
2576
|
+
const context = (0, react.useContext)(CollapsibleContext);
|
|
2577
|
+
if (!context) throw new Error("useCollapsible must be used within a CollapsibleProvider");
|
|
2578
|
+
return context;
|
|
2579
|
+
};
|
|
2580
|
+
|
|
2581
|
+
//#endregion
|
|
2582
|
+
//#region src/components/collapsible/collapsible.tsx
|
|
2583
|
+
const Collapsible = ({ className, ...props }) => {
|
|
2584
|
+
const slots = (0, react.useMemo)(() => collapsibleVariants({}), []);
|
|
2585
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CollapsibleContext, {
|
|
2586
|
+
value: { slots },
|
|
2587
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Collapsible.Root, {
|
|
2588
|
+
className: (0, tailwind_variants.cn)(className, slots.root()),
|
|
2589
|
+
...props
|
|
2590
|
+
})
|
|
2591
|
+
});
|
|
2592
|
+
};
|
|
2593
|
+
const CollapsibleTrigger = ({ className, children, ...props }) => {
|
|
2594
|
+
const { slots } = useCollapsible();
|
|
2595
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Collapsible.Trigger, {
|
|
2596
|
+
className: (0, tailwind_variants.cn)(className, slots.trigger()),
|
|
2597
|
+
...props,
|
|
2598
|
+
children
|
|
2599
|
+
});
|
|
2600
|
+
};
|
|
2601
|
+
const CollapsibleTriggerIcon = ({ className, ...props }) => {
|
|
2602
|
+
const { slots } = useCollapsible();
|
|
2603
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.LucideChevronDown, {
|
|
2604
|
+
className: (0, tailwind_variants.cn)(className, slots.triggerIcon()),
|
|
2605
|
+
...props
|
|
2606
|
+
});
|
|
2607
|
+
};
|
|
2608
|
+
const CollapsiblePanel = ({ className, children, ...props }) => {
|
|
2609
|
+
const { slots } = useCollapsible();
|
|
2610
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.Collapsible.Panel, {
|
|
2611
|
+
className: (0, tailwind_variants.cn)(className, slots.panel()),
|
|
2612
|
+
...props,
|
|
2613
|
+
children
|
|
2614
|
+
});
|
|
2615
|
+
};
|
|
2616
|
+
const CollapsibleContent = ({ className, ...props }) => {
|
|
2617
|
+
const { slots } = useCollapsible();
|
|
2618
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2619
|
+
className: (0, tailwind_variants.cn)(className, slots.content()),
|
|
2620
|
+
...props
|
|
2621
|
+
});
|
|
2622
|
+
};
|
|
2623
|
+
var collapsible_default = Object.assign(Collapsible, {
|
|
2624
|
+
Content: CollapsibleContent,
|
|
2625
|
+
Panel: CollapsiblePanel,
|
|
2626
|
+
Root: Collapsible,
|
|
2627
|
+
Trigger: CollapsibleTrigger,
|
|
2628
|
+
TriggerIcon: CollapsibleTriggerIcon
|
|
2629
|
+
});
|
|
2630
|
+
|
|
2307
2631
|
//#endregion
|
|
2308
2632
|
exports.Accordion = accordion_default;
|
|
2309
2633
|
exports.Alert = alert_default;
|
|
@@ -2315,6 +2639,7 @@ exports.Card = card_default;
|
|
|
2315
2639
|
exports.Checkbox = checkbox_default;
|
|
2316
2640
|
exports.CheckboxGroup = checkbox_group_default;
|
|
2317
2641
|
exports.Chip = chip_default;
|
|
2642
|
+
exports.Collapsible = collapsible_default;
|
|
2318
2643
|
exports.Container = container_default;
|
|
2319
2644
|
exports.Dialog = dialog_default;
|
|
2320
2645
|
exports.Drawer = drawer_default;
|
|
@@ -2341,7 +2666,9 @@ exports.Spinner = spinner_default;
|
|
|
2341
2666
|
exports.Switch = switch_default;
|
|
2342
2667
|
exports.Table = table_default;
|
|
2343
2668
|
exports.Tabs = tabs_default;
|
|
2669
|
+
exports.Toast = toast_default;
|
|
2344
2670
|
exports.ToggleButton = toggle_button_default;
|
|
2671
|
+
exports.Tooltip = tooltip_default;
|
|
2345
2672
|
exports.accordionVariants = accordionVariants;
|
|
2346
2673
|
exports.alertDialogVariants = alertDialogVariants;
|
|
2347
2674
|
exports.alertVariants = alertVariants;
|
|
@@ -2385,4 +2712,5 @@ exports.switchVariants = switchVariants;
|
|
|
2385
2712
|
exports.tableVariants = tableVariants;
|
|
2386
2713
|
exports.tabsVariants = tabsVariants;
|
|
2387
2714
|
exports.toggleButtonVariants = toggleButtonVariants;
|
|
2715
|
+
exports.useToast = useToast;
|
|
2388
2716
|
//# sourceMappingURL=index.cjs.map
|