@taicode/common-web 3.1.0 → 3.3.0
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/output/components/alert-dialog.d.ts +20 -0
- package/output/components/alert-dialog.d.ts.map +1 -0
- package/output/components/alert-dialog.js +65 -0
- package/output/components/alert.d.ts +11 -0
- package/output/components/alert.d.ts.map +1 -0
- package/output/components/alert.js +38 -0
- package/output/components/avatar.d.ts +13 -0
- package/output/components/avatar.d.ts.map +1 -0
- package/output/components/avatar.js +40 -0
- package/output/components/badge.d.ts +10 -0
- package/output/components/badge.d.ts.map +1 -0
- package/output/components/badge.js +31 -0
- package/output/components/button.d.ts +12 -0
- package/output/components/button.d.ts.map +1 -0
- package/output/components/button.js +44 -0
- package/output/components/card.d.ts +8 -0
- package/output/components/card.d.ts.map +1 -0
- package/output/components/card.js +38 -0
- package/output/components/checkbox.d.ts +5 -0
- package/output/components/checkbox.d.ts.map +1 -0
- package/output/components/checkbox.js +21 -0
- package/output/components/command.d.ts +20 -0
- package/output/components/command.d.ts.map +1 -0
- package/output/components/command.js +55 -0
- package/output/components/dialog.d.ts +20 -0
- package/output/components/dialog.d.ts.map +1 -0
- package/output/components/dialog.js +58 -0
- package/output/components/direction.d.ts +9 -0
- package/output/components/direction.d.ts.map +1 -0
- package/output/components/direction.js +10 -0
- package/output/components/dropdown-menu.d.ts +29 -0
- package/output/components/dropdown-menu.d.ts.map +1 -0
- package/output/components/dropdown-menu.js +78 -0
- package/output/components/field.d.ts +39 -0
- package/output/components/field.d.ts.map +1 -0
- package/output/components/field.js +102 -0
- package/output/components/index.d.ts +36 -0
- package/output/components/index.d.ts.map +1 -0
- package/output/components/index.js +35 -0
- package/output/components/input-group.d.ts +17 -0
- package/output/components/input-group.d.ts.map +1 -0
- package/output/components/input-group.js +75 -0
- package/output/components/input.d.ts +3 -0
- package/output/components/input.d.ts.map +1 -0
- package/output/components/input.js +19 -0
- package/output/components/item.d.ts +25 -0
- package/output/components/item.d.ts.map +1 -0
- package/output/components/item.js +89 -0
- package/output/components/json-view/index.d.ts +11 -0
- package/output/components/json-view/index.d.ts.map +1 -0
- package/output/components/json-view/index.js +52 -0
- package/output/components/kbd.d.ts +4 -0
- package/output/components/kbd.d.ts.map +1 -0
- package/output/components/kbd.js +22 -0
- package/output/components/label.d.ts +5 -0
- package/output/components/label.d.ts.map +1 -0
- package/output/components/label.js +20 -0
- package/output/components/loading-button/index.d.ts.map +1 -0
- package/output/{loading-button → components/loading-button}/index.js +2 -6
- package/output/components/loading-button/index.test.d.ts.map +1 -0
- package/output/{loading-button → components/loading-button}/index.test.js +3 -3
- package/output/components/native-select.d.ts +9 -0
- package/output/components/native-select.d.ts.map +1 -0
- package/output/components/native-select.js +28 -0
- package/output/components/page-state.d.ts +19 -0
- package/output/components/page-state.d.ts.map +1 -0
- package/output/components/page-state.js +13 -0
- package/output/components/popover.d.ts +11 -0
- package/output/components/popover.d.ts.map +1 -0
- package/output/components/popover.js +44 -0
- package/output/components/progress.d.ts +5 -0
- package/output/components/progress.d.ts.map +1 -0
- package/output/components/progress.js +21 -0
- package/output/components/radio-group.d.ts +6 -0
- package/output/components/radio-group.d.ts.map +1 -0
- package/output/components/radio-group.js +25 -0
- package/output/components/scroll-area.d.ts +6 -0
- package/output/components/scroll-area.d.ts.map +1 -0
- package/output/components/scroll-area.js +24 -0
- package/output/components/select.d.ts +17 -0
- package/output/components/select.d.ts.map +1 -0
- package/output/components/select.js +58 -0
- package/output/components/separator.d.ts +6 -0
- package/output/components/separator.d.ts.map +1 -0
- package/output/components/separator.js +19 -0
- package/output/components/sheet.d.ts +16 -0
- package/output/components/sheet.d.ts.map +1 -0
- package/output/components/sheet.js +58 -0
- package/output/components/size-provider/index.d.ts.map +1 -0
- package/output/components/size-provider/size-provider.d.ts.map +1 -0
- package/output/components/skeleton.d.ts +3 -0
- package/output/components/skeleton.d.ts.map +1 -0
- package/output/{catalyst/divider.js → components/skeleton.js} +4 -4
- package/output/components/sonner.d.ts +8 -0
- package/output/components/sonner.d.ts.map +1 -0
- package/output/components/sonner.js +34 -0
- package/output/components/spinner.d.ts +3 -0
- package/output/components/spinner.d.ts.map +1 -0
- package/output/components/spinner.js +19 -0
- package/output/components/switch.d.ts +8 -0
- package/output/components/switch.d.ts.map +1 -0
- package/output/components/switch.js +20 -0
- package/output/components/table.d.ts +11 -0
- package/output/components/table.d.ts.map +1 -0
- package/output/components/table.js +47 -0
- package/output/components/tabs.d.ts +12 -0
- package/output/components/tabs.d.ts.map +1 -0
- package/output/components/tabs.js +45 -0
- package/output/components/textarea.d.ts +4 -0
- package/output/components/textarea.d.ts.map +1 -0
- package/output/components/textarea.js +19 -0
- package/output/components/theme-switcher.d.ts +6 -0
- package/output/components/theme-switcher.d.ts.map +1 -0
- package/output/components/theme-switcher.js +19 -0
- package/output/{toaster → components/toaster}/index.d.ts +1 -1
- package/output/components/toaster/index.d.ts.map +1 -0
- package/output/components/tooltip.d.ts +8 -0
- package/output/components/tooltip.d.ts.map +1 -0
- package/output/components/tooltip.js +33 -0
- package/output/features/confirm-dialog/index.d.ts +39 -0
- package/output/features/confirm-dialog/index.d.ts.map +1 -0
- package/output/features/confirm-dialog/index.js +19 -0
- package/output/features/input-confirm/index.d.ts +26 -0
- package/output/features/input-confirm/index.d.ts.map +1 -0
- package/output/features/input-confirm/index.js +59 -0
- package/output/features/signin/context.d.ts.map +1 -0
- package/output/{signin → features/signin}/index.d.ts +1 -1
- package/output/features/signin/index.d.ts.map +1 -0
- package/output/{signin → features/signin}/index.js +1 -1
- package/output/features/signin/service.d.ts.map +1 -0
- package/output/features/signin/service.test.d.ts.map +1 -0
- package/output/features/signin/types.d.ts.map +1 -0
- package/output/hooks/use-loading/index.d.ts +6 -0
- package/output/hooks/use-loading/index.d.ts.map +1 -0
- package/output/hooks/use-loading/index.js +14 -0
- package/output/hooks/use-loading/index.test.d.ts +2 -0
- package/output/hooks/use-loading/index.test.d.ts.map +1 -0
- package/output/hooks/use-loading/index.test.js +24 -0
- package/output/hooks/use-mobile/index.d.ts +2 -0
- package/output/hooks/use-mobile/index.d.ts.map +1 -0
- package/output/hooks/use-mobile/index.js +16 -0
- package/output/hooks/use-observer/index.d.ts.map +1 -0
- package/output/hooks/use-observer/use-observer.d.ts.map +1 -0
- package/output/hooks/use-observer/use-observer.test.d.ts.map +1 -0
- package/output/hooks/use-offline/index.d.ts +6 -0
- package/output/hooks/use-offline/index.d.ts.map +1 -0
- package/output/hooks/use-offline/index.js +19 -0
- package/output/layout/app/index.d.ts +34 -0
- package/output/layout/app/index.d.ts.map +1 -0
- package/output/layout/app/index.js +34 -0
- package/output/layout/dashboard/index.d.ts +58 -0
- package/output/layout/dashboard/index.d.ts.map +1 -0
- package/output/layout/dashboard/index.js +71 -0
- package/output/layout/index.d.ts +3 -0
- package/output/layout/index.d.ts.map +1 -0
- package/output/layout/index.js +2 -0
- package/output/services/cache-api/cache-api.d.ts.map +1 -0
- package/output/services/cache-api/cache-api.test.d.ts.map +1 -0
- package/output/services/cache-api/index.d.ts.map +1 -0
- package/output/services/service/index.d.ts.map +1 -0
- package/output/services/service/service.d.ts +135 -0
- package/output/services/service/service.d.ts.map +1 -0
- package/output/services/service/service.js +276 -0
- package/output/services/service/service.test.d.ts.map +1 -0
- package/output/{service → services/service}/service.test.js +0 -1
- package/output/services/side-cache/index.d.ts.map +1 -0
- package/output/services/side-cache/side-cache.d.ts.map +1 -0
- package/output/services/side-cache/side-cache.test.d.ts.map +1 -0
- package/output/utils/avatar/index.d.ts +28 -0
- package/output/utils/avatar/index.d.ts.map +1 -0
- package/output/utils/avatar/index.js +35 -0
- package/output/utils/delay/index.d.ts +2 -0
- package/output/utils/delay/index.d.ts.map +1 -0
- package/output/utils/delay/index.js +5 -0
- package/output/utils/form/index.d.ts +3 -0
- package/output/utils/form/index.d.ts.map +1 -0
- package/output/utils/form/index.js +1 -0
- package/output/utils/merge-class-names/index.d.ts +3 -0
- package/output/utils/merge-class-names/index.d.ts.map +1 -0
- package/output/utils/merge-class-names/index.js +5 -0
- package/output/utils/merge-class-names/index.test.d.ts +2 -0
- package/output/utils/merge-class-names/index.test.d.ts.map +1 -0
- package/output/utils/merge-class-names/index.test.js +7 -0
- package/output/utils/performance/index.d.ts +82 -0
- package/output/utils/performance/index.d.ts.map +1 -0
- package/output/utils/performance/index.js +129 -0
- package/output/utils/redirect/index.d.ts +6 -0
- package/output/utils/redirect/index.d.ts.map +1 -0
- package/output/utils/redirect/index.js +32 -0
- package/package.json +71 -24
- package/styles.css +123 -0
- package/output/cache-api/cache-api.d.ts.map +0 -1
- package/output/cache-api/cache-api.test.d.ts.map +0 -1
- package/output/cache-api/index.d.ts.map +0 -1
- package/output/catalyst/alert.d.ts +0 -29
- package/output/catalyst/alert.d.ts.map +0 -1
- package/output/catalyst/alert.js +0 -46
- package/output/catalyst/auth-layout.d.ts +0 -5
- package/output/catalyst/auth-layout.d.ts.map +0 -1
- package/output/catalyst/auth-layout.js +0 -4
- package/output/catalyst/avatar.d.ts +0 -16
- package/output/catalyst/avatar.d.ts.map +0 -1
- package/output/catalyst/avatar.js +0 -30
- package/output/catalyst/badge.d.ts +0 -35
- package/output/catalyst/badge.d.ts.map +0 -1
- package/output/catalyst/badge.js +0 -46
- package/output/catalyst/button.d.ts +0 -59
- package/output/catalyst/button.d.ts.map +0 -1
- package/output/catalyst/button.js +0 -181
- package/output/catalyst/checkbox.d.ts +0 -37
- package/output/catalyst/checkbox.d.ts.map +0 -1
- package/output/catalyst/checkbox.js +0 -97
- package/output/catalyst/combobox.d.ts +0 -20
- package/output/catalyst/combobox.d.ts.map +0 -1
- package/output/catalyst/combobox.js +0 -101
- package/output/catalyst/description-list.d.ts +0 -4
- package/output/catalyst/description-list.d.ts.map +0 -1
- package/output/catalyst/description-list.js +0 -25
- package/output/catalyst/dialog.d.ts +0 -29
- package/output/catalyst/dialog.d.ts.map +0 -1
- package/output/catalyst/dialog.js +0 -46
- package/output/catalyst/divider.d.ts +0 -4
- package/output/catalyst/divider.d.ts.map +0 -1
- package/output/catalyst/dropdown.d.ts +0 -33
- package/output/catalyst/dropdown.d.ts.map +0 -1
- package/output/catalyst/dropdown.js +0 -99
- package/output/catalyst/fieldset.d.ts +0 -22
- package/output/catalyst/fieldset.d.ts.map +0 -1
- package/output/catalyst/fieldset.js +0 -42
- package/output/catalyst/heading.d.ts +0 -7
- package/output/catalyst/heading.d.ts.map +0 -1
- package/output/catalyst/heading.js +0 -23
- package/output/catalyst/input.d.ts +0 -11
- package/output/catalyst/input.d.ts.map +0 -1
- package/output/catalyst/input.js +0 -70
- package/output/catalyst/link.d.ts +0 -13
- package/output/catalyst/link.d.ts.map +0 -1
- package/output/catalyst/link.js +0 -37
- package/output/catalyst/listbox.d.ts +0 -16
- package/output/catalyst/listbox.d.ts.map +0 -1
- package/output/catalyst/listbox.js +0 -99
- package/output/catalyst/navbar.d.ts +0 -16
- package/output/catalyst/navbar.d.ts.map +0 -1
- package/output/catalyst/navbar.js +0 -59
- package/output/catalyst/pagination.d.ts +0 -18
- package/output/catalyst/pagination.d.ts.map +0 -1
- package/output/catalyst/pagination.js +0 -35
- package/output/catalyst/radio.d.ts +0 -38
- package/output/catalyst/radio.d.ts.map +0 -1
- package/output/catalyst/radio.js +0 -100
- package/output/catalyst/select.d.ts +0 -6
- package/output/catalyst/select.d.ts.map +0 -1
- package/output/catalyst/select.js +0 -52
- package/output/catalyst/sidebar-layout.d.ts +0 -6
- package/output/catalyst/sidebar-layout.d.ts.map +0 -1
- package/output/catalyst/sidebar-layout.js +0 -18
- package/output/catalyst/sidebar.d.ts +0 -20
- package/output/catalyst/sidebar.d.ts.map +0 -1
- package/output/catalyst/sidebar.js +0 -77
- package/output/catalyst/stacked-layout.d.ts +0 -6
- package/output/catalyst/stacked-layout.d.ts.map +0 -1
- package/output/catalyst/stacked-layout.js +0 -18
- package/output/catalyst/switch.d.ts +0 -37
- package/output/catalyst/switch.d.ts.map +0 -1
- package/output/catalyst/switch.js +0 -160
- package/output/catalyst/table.d.ts +0 -17
- package/output/catalyst/table.d.ts.map +0 -1
- package/output/catalyst/table.js +0 -56
- package/output/catalyst/text.d.ts +0 -6
- package/output/catalyst/text.d.ts.map +0 -1
- package/output/catalyst/text.js +0 -30
- package/output/catalyst/textarea.d.ts +0 -7
- package/output/catalyst/textarea.d.ts.map +0 -1
- package/output/catalyst/textarea.js +0 -48
- package/output/catalyst-config/catalyst-config.d.ts +0 -14
- package/output/catalyst-config/catalyst-config.d.ts.map +0 -1
- package/output/catalyst-config/catalyst-config.js +0 -14
- package/output/catalyst-config/index.d.ts +0 -3
- package/output/catalyst-config/index.d.ts.map +0 -1
- package/output/catalyst-config/index.js +0 -1
- package/output/loading-button/LoadingButtonDemo.d.ts +0 -5
- package/output/loading-button/LoadingButtonDemo.d.ts.map +0 -1
- package/output/loading-button/LoadingButtonDemo.js +0 -33
- package/output/loading-button/index.d.ts.map +0 -1
- package/output/loading-button/index.test.d.ts.map +0 -1
- package/output/service/index.d.ts.map +0 -1
- package/output/service/service.d.ts +0 -286
- package/output/service/service.d.ts.map +0 -1
- package/output/service/service.js +0 -352
- package/output/service/service.test.d.ts.map +0 -1
- package/output/side-cache/index.d.ts.map +0 -1
- package/output/side-cache/side-cache.d.ts.map +0 -1
- package/output/side-cache/side-cache.test.d.ts.map +0 -1
- package/output/signin/context.d.ts.map +0 -1
- package/output/signin/index.d.ts.map +0 -1
- package/output/signin/service.d.ts.map +0 -1
- package/output/signin/service.test.d.ts.map +0 -1
- package/output/signin/types.d.ts.map +0 -1
- package/output/size-provider/index.d.ts.map +0 -1
- package/output/size-provider/size-provider.d.ts.map +0 -1
- package/output/toaster/index.d.ts.map +0 -1
- package/output/use-observer/index.d.ts.map +0 -1
- package/output/use-observer/use-observer.d.ts.map +0 -1
- package/output/use-observer/use-observer.test.d.ts.map +0 -1
- /package/output/{loading-button → components/loading-button}/index.d.ts +0 -0
- /package/output/{loading-button → components/loading-button}/index.test.d.ts +0 -0
- /package/output/{size-provider → components/size-provider}/index.d.ts +0 -0
- /package/output/{size-provider → components/size-provider}/index.js +0 -0
- /package/output/{size-provider → components/size-provider}/size-provider.d.ts +0 -0
- /package/output/{size-provider → components/size-provider}/size-provider.js +0 -0
- /package/output/{toaster → components/toaster}/index.js +0 -0
- /package/output/{signin → features/signin}/context.d.ts +0 -0
- /package/output/{signin → features/signin}/context.js +0 -0
- /package/output/{signin → features/signin}/service.d.ts +0 -0
- /package/output/{signin → features/signin}/service.js +0 -0
- /package/output/{service → features/signin}/service.test.d.ts +0 -0
- /package/output/{signin → features/signin}/service.test.js +0 -0
- /package/output/{signin → features/signin}/types.d.ts +0 -0
- /package/output/{signin → features/signin}/types.js +0 -0
- /package/output/{use-observer → hooks/use-observer}/index.d.ts +0 -0
- /package/output/{use-observer → hooks/use-observer}/index.js +0 -0
- /package/output/{use-observer → hooks/use-observer}/use-observer.d.ts +0 -0
- /package/output/{use-observer → hooks/use-observer}/use-observer.js +0 -0
- /package/output/{use-observer → hooks/use-observer}/use-observer.test.d.ts +0 -0
- /package/output/{use-observer → hooks/use-observer}/use-observer.test.js +0 -0
- /package/output/{cache-api → services/cache-api}/cache-api.d.ts +0 -0
- /package/output/{cache-api → services/cache-api}/cache-api.js +0 -0
- /package/output/{cache-api → services/cache-api}/cache-api.test.d.ts +0 -0
- /package/output/{cache-api → services/cache-api}/cache-api.test.js +0 -0
- /package/output/{cache-api → services/cache-api}/index.d.ts +0 -0
- /package/output/{cache-api → services/cache-api}/index.js +0 -0
- /package/output/{service → services/service}/index.d.ts +0 -0
- /package/output/{service → services/service}/index.js +0 -0
- /package/output/{signin → services/service}/service.test.d.ts +0 -0
- /package/output/{side-cache → services/side-cache}/index.d.ts +0 -0
- /package/output/{side-cache → services/side-cache}/index.js +0 -0
- /package/output/{side-cache → services/side-cache}/side-cache.d.ts +0 -0
- /package/output/{side-cache → services/side-cache}/side-cache.js +0 -0
- /package/output/{side-cache → services/side-cache}/side-cache.test.d.ts +0 -0
- /package/output/{side-cache → services/side-cache}/side-cache.test.js +0 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
import { Dialog as SheetPrimitive } from "radix-ui";
|
|
15
|
+
import { mergeClassNames } from "../utils/merge-class-names/index.js";
|
|
16
|
+
import { Button } from "./button.js";
|
|
17
|
+
import { XIcon } from "lucide-react";
|
|
18
|
+
function Sheet(params) {
|
|
19
|
+
const props = __rest(params, []);
|
|
20
|
+
return _jsx(SheetPrimitive.Root, Object.assign({ "data-slot": "sheet" }, props));
|
|
21
|
+
}
|
|
22
|
+
function SheetTrigger(params) {
|
|
23
|
+
const props = __rest(params, []);
|
|
24
|
+
return _jsx(SheetPrimitive.Trigger, Object.assign({ "data-slot": "sheet-trigger" }, props));
|
|
25
|
+
}
|
|
26
|
+
function SheetClose(params) {
|
|
27
|
+
const props = __rest(params, []);
|
|
28
|
+
return _jsx(SheetPrimitive.Close, Object.assign({ "data-slot": "sheet-close" }, props));
|
|
29
|
+
}
|
|
30
|
+
function SheetPortal(params) {
|
|
31
|
+
const props = __rest(params, []);
|
|
32
|
+
return _jsx(SheetPrimitive.Portal, Object.assign({ "data-slot": "sheet-portal" }, props));
|
|
33
|
+
}
|
|
34
|
+
function SheetOverlay(params) {
|
|
35
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
36
|
+
return (_jsx(SheetPrimitive.Overlay, Object.assign({ "data-slot": "sheet-overlay", className: mergeClassNames("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50", className) }, props)));
|
|
37
|
+
}
|
|
38
|
+
function SheetContent(params) {
|
|
39
|
+
const { className, children, side = "right", showCloseButton = true } = params, props = __rest(params, ["className", "children", "side", "showCloseButton"]);
|
|
40
|
+
return (_jsxs(SheetPortal, { children: [_jsx(SheetOverlay, {}), _jsxs(SheetPrimitive.Content, Object.assign({ "data-slot": "sheet-content", "data-side": side, className: mergeClassNames("bg-background data-open:animate-in data-closed:animate-out data-[side=right]:data-closed:slide-out-to-right-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=top]:data-closed:slide-out-to-top-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:fade-out-0 data-open:fade-in-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=bottom]:data-open:slide-in-from-bottom-10 fixed z-50 flex flex-col gap-4 bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm", className) }, props, { children: [children, showCloseButton && (_jsx(SheetPrimitive.Close, { "data-slot": "sheet-close", asChild: true, children: _jsxs(Button, { variant: "ghost", className: "absolute top-4 right-4", size: "icon-sm", children: [_jsx(XIcon, {}), _jsx("span", { className: "sr-only", children: "Close" })] }) }))] }))] }));
|
|
41
|
+
}
|
|
42
|
+
function SheetHeader(params) {
|
|
43
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
44
|
+
return (_jsx("div", Object.assign({ "data-slot": "sheet-header", className: mergeClassNames("gap-1.5 p-4 flex flex-col", className) }, props)));
|
|
45
|
+
}
|
|
46
|
+
function SheetFooter(params) {
|
|
47
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
48
|
+
return (_jsx("div", Object.assign({ "data-slot": "sheet-footer", className: mergeClassNames("gap-2 p-4 mt-auto flex flex-col", className) }, props)));
|
|
49
|
+
}
|
|
50
|
+
function SheetTitle(params) {
|
|
51
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
52
|
+
return (_jsx(SheetPrimitive.Title, Object.assign({ "data-slot": "sheet-title", className: mergeClassNames("text-foreground font-medium", className) }, props)));
|
|
53
|
+
}
|
|
54
|
+
function SheetDescription(params) {
|
|
55
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
56
|
+
return (_jsx(SheetPrimitive.Description, Object.assign({ "data-slot": "sheet-description", className: mergeClassNames("text-muted-foreground text-sm", className) }, props)));
|
|
57
|
+
}
|
|
58
|
+
export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/components/size-provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"size-provider.d.ts","sourceRoot":"","sources":["../../../source/components/size-provider/size-provider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAA+B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAE1E,UAAU,iBAAiB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,SAAS,CAAA;IACrD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,SAAS,CAAA;CACxD;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAuCpD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../source/components/skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAI3C,wBAAgB,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,cAAc,CAAC,+BAE/E"}
|
|
@@ -10,8 +10,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import
|
|
14
|
-
export function
|
|
15
|
-
var {
|
|
16
|
-
return
|
|
13
|
+
import { mergeClassNames } from '../utils/merge-class-names/index.js';
|
|
14
|
+
export function Skeleton(_a) {
|
|
15
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
16
|
+
return _jsx("div", Object.assign({ className: mergeClassNames('animate-pulse rounded-md bg-muted', className) }, props));
|
|
17
17
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
import { type ToasterProps } from "sonner";
|
|
3
|
+
type ToasterPropsWithTheme = ToasterProps & {
|
|
4
|
+
theme?: "light" | "dark" | "system";
|
|
5
|
+
};
|
|
6
|
+
declare const Toaster: ({ theme, ...props }: ToasterPropsWithTheme) => React.JSX.Element;
|
|
7
|
+
export { Toaster };
|
|
8
|
+
//# sourceMappingURL=sonner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sonner.d.ts","sourceRoot":"","sources":["../../source/components/sonner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAA;AACnC,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAA;AAG7D,KAAK,qBAAqB,GAAG,YAAY,GAAG;IAC1C,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAA;CACpC,CAAA;AAED,QAAA,MAAM,OAAO,GAAI,qBAAgC,qBAAqB,sBAsCrE,CAAA;AAED,OAAO,EAAE,OAAO,EAAE,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { Toaster as Sonner } from "sonner";
|
|
14
|
+
import { CircleCheckIcon, InfoIcon, TriangleAlertIcon, OctagonXIcon, Loader2Icon } from "lucide-react";
|
|
15
|
+
const Toaster = (_a) => {
|
|
16
|
+
var { theme = "system" } = _a, props = __rest(_a, ["theme"]);
|
|
17
|
+
return (_jsx(Sonner, Object.assign({ theme: theme, className: "toaster group", icons: {
|
|
18
|
+
success: (_jsx(CircleCheckIcon, { className: "size-4" })),
|
|
19
|
+
info: (_jsx(InfoIcon, { className: "size-4" })),
|
|
20
|
+
warning: (_jsx(TriangleAlertIcon, { className: "size-4" })),
|
|
21
|
+
error: (_jsx(OctagonXIcon, { className: "size-4" })),
|
|
22
|
+
loading: (_jsx(Loader2Icon, { className: "size-4 animate-spin" })),
|
|
23
|
+
}, style: {
|
|
24
|
+
"--normal-bg": "var(--popover)",
|
|
25
|
+
"--normal-text": "var(--popover-foreground)",
|
|
26
|
+
"--normal-border": "var(--border)",
|
|
27
|
+
"--border-radius": "var(--radius)",
|
|
28
|
+
}, toastOptions: {
|
|
29
|
+
classNames: {
|
|
30
|
+
toast: "cn-toast",
|
|
31
|
+
},
|
|
32
|
+
} }, props)));
|
|
33
|
+
};
|
|
34
|
+
export { Toaster };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../source/components/spinner.tsx"],"names":[],"mappings":"AAGA,iBAAS,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,+BAKnD;AAED,OAAO,EAAE,OAAO,EAAE,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { mergeClassNames } from "../utils/merge-class-names/index.js";
|
|
14
|
+
import { Loader2Icon } from "lucide-react";
|
|
15
|
+
function Spinner(params) {
|
|
16
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
17
|
+
return (_jsx(Loader2Icon, Object.assign({ role: "status", "aria-label": "Loading", className: mergeClassNames("size-4 animate-spin", className) }, props)));
|
|
18
|
+
}
|
|
19
|
+
export { Spinner };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Switch as SwitchPrimitive } from 'radix-ui';
|
|
3
|
+
type SwitchParams = {
|
|
4
|
+
size?: 'sm' | 'default';
|
|
5
|
+
};
|
|
6
|
+
declare function Switch(params: React.ComponentProps<typeof SwitchPrimitive.Root> & SwitchParams): React.JSX.Element;
|
|
7
|
+
export { Switch };
|
|
8
|
+
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../source/components/switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAA;AAIpD,KAAK,YAAY,GAAG;IAAE,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;CAAE,CAAA;AAE/C,iBAAS,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,GAAG,YAAY,qBAevF;AAED,OAAO,EAAE,MAAM,EAAE,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { Switch as SwitchPrimitive } from 'radix-ui';
|
|
15
|
+
import { mergeClassNames } from '../utils/merge-class-names/index.js';
|
|
16
|
+
function Switch(params) {
|
|
17
|
+
const { className, size = 'default' } = params, props = __rest(params, ["className", "size"]);
|
|
18
|
+
return (_jsx(SwitchPrimitive.Root, Object.assign({ "data-slot": "switch", "data-size": size, className: mergeClassNames('data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent shadow-xs focus-visible:ring-[3px] aria-invalid:ring-[3px] data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50', className) }, props, { children: _jsx(SwitchPrimitive.Thumb, { className: "bg-background dark:data-unchecked:bg-foreground dark:data-checked:bg-primary-foreground rounded-full group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 pointer-events-none block ring-0 transition-transform" }) })));
|
|
19
|
+
}
|
|
20
|
+
export { Switch };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function Table(params: React.ComponentProps<"table">): React.JSX.Element;
|
|
3
|
+
declare function TableHeader(params: React.ComponentProps<"thead">): React.JSX.Element;
|
|
4
|
+
declare function TableBody(params: React.ComponentProps<"tbody">): React.JSX.Element;
|
|
5
|
+
declare function TableFooter(params: React.ComponentProps<"tfoot">): React.JSX.Element;
|
|
6
|
+
declare function TableRow(params: React.ComponentProps<"tr">): React.JSX.Element;
|
|
7
|
+
declare function TableHead(params: React.ComponentProps<"th">): React.JSX.Element;
|
|
8
|
+
declare function TableCell(params: React.ComponentProps<"td">): React.JSX.Element;
|
|
9
|
+
declare function TableCaption(params: React.ComponentProps<"caption">): React.JSX.Element;
|
|
10
|
+
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, };
|
|
11
|
+
//# sourceMappingURL=table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../source/components/table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,iBAAS,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,qBAWnD;AAED,iBAAS,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,qBASzD;AAED,iBAAS,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,qBASvD;AAED,iBAAS,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,qBASzD;AAED,iBAAS,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,qBASnD;AAED,iBAAS,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,qBASpD;AAED,iBAAS,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,qBASpD;AAED,iBAAS,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,qBAY5D;AAED,OAAO,EACL,KAAK,EACL,WAAW,EACX,SAAS,EACT,WAAW,EACX,SAAS,EACT,QAAQ,EACR,SAAS,EACT,YAAY,GACb,CAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
import { mergeClassNames } from "../utils/merge-class-names/index.js";
|
|
15
|
+
function Table(params) {
|
|
16
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
17
|
+
return (_jsx("div", { "data-slot": "table-container", className: "relative w-full overflow-x-auto", children: _jsx("table", Object.assign({ "data-slot": "table", className: mergeClassNames("w-full caption-bottom text-sm", className) }, props)) }));
|
|
18
|
+
}
|
|
19
|
+
function TableHeader(params) {
|
|
20
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
21
|
+
return (_jsx("thead", Object.assign({ "data-slot": "table-header", className: mergeClassNames("[&_tr]:border-b", className) }, props)));
|
|
22
|
+
}
|
|
23
|
+
function TableBody(params) {
|
|
24
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
25
|
+
return (_jsx("tbody", Object.assign({ "data-slot": "table-body", className: mergeClassNames("[&_tr:last-child]:border-0", className) }, props)));
|
|
26
|
+
}
|
|
27
|
+
function TableFooter(params) {
|
|
28
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
29
|
+
return (_jsx("tfoot", Object.assign({ "data-slot": "table-footer", className: mergeClassNames("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0", className) }, props)));
|
|
30
|
+
}
|
|
31
|
+
function TableRow(params) {
|
|
32
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
33
|
+
return (_jsx("tr", Object.assign({ "data-slot": "table-row", className: mergeClassNames("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors", className) }, props)));
|
|
34
|
+
}
|
|
35
|
+
function TableHead(params) {
|
|
36
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
37
|
+
return (_jsx("th", Object.assign({ "data-slot": "table-head", className: mergeClassNames("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0", className) }, props)));
|
|
38
|
+
}
|
|
39
|
+
function TableCell(params) {
|
|
40
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
41
|
+
return (_jsx("td", Object.assign({ "data-slot": "table-cell", className: mergeClassNames("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0", className) }, props)));
|
|
42
|
+
}
|
|
43
|
+
function TableCaption(params) {
|
|
44
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
45
|
+
return (_jsx("caption", Object.assign({ "data-slot": "table-caption", className: mergeClassNames("text-muted-foreground mt-4 text-sm", className) }, props)));
|
|
46
|
+
}
|
|
47
|
+
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
4
|
+
declare function Tabs(params: React.ComponentProps<typeof TabsPrimitive.Root>): React.JSX.Element;
|
|
5
|
+
declare const tabsListVariants: (props?: ({
|
|
6
|
+
variant?: "default" | "line" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
declare function TabsList(params: React.ComponentProps<typeof TabsPrimitive.List> & VariantProps<typeof tabsListVariants>): React.JSX.Element;
|
|
9
|
+
declare function TabsTrigger(params: React.ComponentProps<typeof TabsPrimitive.Trigger>): React.JSX.Element;
|
|
10
|
+
declare function TabsContent(params: React.ComponentProps<typeof TabsPrimitive.Content>): React.JSX.Element;
|
|
11
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants };
|
|
12
|
+
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../source/components/tabs.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,UAAU,CAAA;AAIhD,iBAAS,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,IAAI,CAAC,qBAiBpE;AAED,QAAA,MAAM,gBAAgB;;8EAarB,CAAA;AAED,iBAAS,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,IAAI,CAAC,GACvE,YAAY,CAAC,OAAO,gBAAgB,CAAC,qBActC;AAED,iBAAS,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,OAAO,CAAC,qBAkB9E;AAED,iBAAS,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,OAAO,CAAC,qBAY9E;AAED,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import * as React from "react";
|
|
15
|
+
import { cva } from "class-variance-authority";
|
|
16
|
+
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
17
|
+
import { mergeClassNames } from "../utils/merge-class-names/index.js";
|
|
18
|
+
function Tabs(params) {
|
|
19
|
+
const { className, orientation = "horizontal" } = params, props = __rest(params, ["className", "orientation"]);
|
|
20
|
+
return (_jsx(TabsPrimitive.Root, Object.assign({ "data-slot": "tabs", "data-orientation": orientation, className: mergeClassNames("gap-2 group/tabs flex data-[orientation=horizontal]:flex-col", className) }, props)));
|
|
21
|
+
}
|
|
22
|
+
const tabsListVariants = cva("rounded-lg p-[3px] group-data-horizontal/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col", {
|
|
23
|
+
variants: {
|
|
24
|
+
variant: {
|
|
25
|
+
default: "bg-muted",
|
|
26
|
+
line: "gap-1 bg-transparent",
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: {
|
|
30
|
+
variant: "default",
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
function TabsList(params) {
|
|
34
|
+
const { className, variant = "default" } = params, props = __rest(params, ["className", "variant"]);
|
|
35
|
+
return (_jsx(TabsPrimitive.List, Object.assign({ "data-slot": "tabs-list", "data-variant": variant, className: mergeClassNames(tabsListVariants({ variant }), className) }, props)));
|
|
36
|
+
}
|
|
37
|
+
function TabsTrigger(params) {
|
|
38
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
39
|
+
return (_jsx(TabsPrimitive.Trigger, Object.assign({ "data-slot": "tabs-trigger", className: mergeClassNames("gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg:not([class*='size-'])]:size-4 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent", "data-active:bg-background dark:data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 data-active:text-foreground", "after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100", className) }, props)));
|
|
40
|
+
}
|
|
41
|
+
function TabsContent(params) {
|
|
42
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
43
|
+
return (_jsx(TabsPrimitive.Content, Object.assign({ "data-slot": "tabs-content", className: mergeClassNames("text-sm flex-1 outline-none", className) }, props)));
|
|
44
|
+
}
|
|
45
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../source/components/textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,iBAAS,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,qBAYzD;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { mergeClassNames } from '../utils/merge-class-names/index.js';
|
|
15
|
+
function Textarea(params) {
|
|
16
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
17
|
+
return (_jsx("textarea", Object.assign({ "data-slot": "textarea", className: mergeClassNames('border-input dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border bg-transparent px-2.5 py-2 text-base shadow-xs transition-[color,box-shadow] focus-visible:ring-[3px] aria-invalid:ring-[3px] md:text-sm placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-50', className) }, props)));
|
|
18
|
+
}
|
|
19
|
+
export { Textarea };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-switcher.d.ts","sourceRoot":"","sources":["../../source/components/theme-switcher.tsx"],"names":[],"mappings":"AAOA,MAAM,WAAW,kBAAkB;IACjC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,+BA2BtD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { Moon, Sun } from 'lucide-react';
|
|
4
|
+
import { Button } from './button.js';
|
|
5
|
+
export function ThemeSwitcher(props) {
|
|
6
|
+
const { toLightLabel = 'Switch to light mode', toDarkLabel = 'Switch to dark mode' } = props;
|
|
7
|
+
const [theme, setTheme] = useState(() => {
|
|
8
|
+
const savedTheme = localStorage.getItem('theme');
|
|
9
|
+
if (savedTheme === 'dark' || savedTheme === 'light')
|
|
10
|
+
return savedTheme;
|
|
11
|
+
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
12
|
+
});
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
document.documentElement.classList.toggle('dark', theme === 'dark');
|
|
15
|
+
localStorage.setItem('theme', theme);
|
|
16
|
+
}, [theme]);
|
|
17
|
+
const label = theme === 'dark' ? toLightLabel : toDarkLabel;
|
|
18
|
+
return (_jsx(Button, { type: "button", variant: "ghost", size: "icon-sm", onClick: () => setTheme(current => current === 'light' ? 'dark' : 'light'), "aria-label": label, title: label, children: theme === 'dark' ? _jsx(Sun, { className: "size-4" }) : _jsx(Moon, { className: "size-4" }) }));
|
|
19
|
+
}
|
|
@@ -5,7 +5,7 @@ interface ToastCatcherProps {
|
|
|
5
5
|
messages: Partial<Record<string, string>>;
|
|
6
6
|
}
|
|
7
7
|
/** 自动捕获和处理异步错误,无法识别的错误会保持原样 */
|
|
8
|
-
export declare function Toaster(props: ToastCatcherProps):
|
|
8
|
+
export declare function Toaster(props: ToastCatcherProps): React.JSX.Element;
|
|
9
9
|
export declare namespace Toaster {
|
|
10
10
|
var info: (content: React.ReactNode) => void;
|
|
11
11
|
var error: (content: React.ReactNode) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/components/toaster/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAA;AAIhD,UAAU,iBAAiB;IACzB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CAC1C;AAED,+BAA+B;AAC/B,wBAAgB,OAAO,CAAC,KAAK,EAAE,iBAAiB,qBAkE/C;yBAlEe,OAAO;wBA2EE,KAAK,CAAC,SAAS;yBAId,KAAK,CAAC,SAAS;2BAIb,KAAK,CAAC,SAAS;2BAIf,KAAK,CAAC,SAAS"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Tooltip as TooltipPrimitive } from "radix-ui";
|
|
3
|
+
declare function TooltipProvider(params: React.ComponentProps<typeof TooltipPrimitive.Provider>): React.JSX.Element;
|
|
4
|
+
declare function Tooltip(params: React.ComponentProps<typeof TooltipPrimitive.Root>): React.JSX.Element;
|
|
5
|
+
declare function TooltipTrigger(params: React.ComponentProps<typeof TooltipPrimitive.Trigger>): React.JSX.Element;
|
|
6
|
+
declare function TooltipContent(params: React.ComponentProps<typeof TooltipPrimitive.Content>): React.JSX.Element;
|
|
7
|
+
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
8
|
+
//# sourceMappingURL=tooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../source/components/tooltip.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAItD,iBAAS,eAAe,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,QAAQ,CAAC,qBAYtF;AAED,iBAAS,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,qBAK1E;AAED,iBAAS,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,qBAKpF;AAED,iBAAS,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,qBAuBpF;AAED,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import * as React from "react";
|
|
15
|
+
import { Tooltip as TooltipPrimitive } from "radix-ui";
|
|
16
|
+
import { mergeClassNames } from "../utils/merge-class-names/index.js";
|
|
17
|
+
function TooltipProvider(params) {
|
|
18
|
+
const { delayDuration = 0 } = params, props = __rest(params, ["delayDuration"]);
|
|
19
|
+
return (_jsx(TooltipPrimitive.Provider, Object.assign({ "data-slot": "tooltip-provider", delayDuration: delayDuration }, props)));
|
|
20
|
+
}
|
|
21
|
+
function Tooltip(params) {
|
|
22
|
+
const props = __rest(params, []);
|
|
23
|
+
return _jsx(TooltipPrimitive.Root, Object.assign({ "data-slot": "tooltip" }, props));
|
|
24
|
+
}
|
|
25
|
+
function TooltipTrigger(params) {
|
|
26
|
+
const props = __rest(params, []);
|
|
27
|
+
return _jsx(TooltipPrimitive.Trigger, Object.assign({ "data-slot": "tooltip-trigger" }, props));
|
|
28
|
+
}
|
|
29
|
+
function TooltipContent(params) {
|
|
30
|
+
const { className, sideOffset = 0, children } = params, props = __rest(params, ["className", "sideOffset", "children"]);
|
|
31
|
+
return (_jsx(TooltipPrimitive.Portal, { children: _jsxs(TooltipPrimitive.Content, Object.assign({ "data-slot": "tooltip-content", sideOffset: sideOffset, className: mergeClassNames("data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 rounded-md px-3 py-1.5 text-xs bg-foreground text-background z-50 w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin)", className) }, props, { children: [children, _jsx(TooltipPrimitive.Arrow, { className: "size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground z-50 translate-y-[calc(-50%_-_2px)]" })] })) }));
|
|
32
|
+
}
|
|
33
|
+
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { buttonVariants } from '../../components/button.js';
|
|
3
|
+
import type { VariantProps } from 'class-variance-authority';
|
|
4
|
+
interface ConfirmDialogProps {
|
|
5
|
+
/** 是否打开对话框 */
|
|
6
|
+
open: boolean;
|
|
7
|
+
/** 打开状态变化回调 */
|
|
8
|
+
onOpenChange: (open: boolean) => void;
|
|
9
|
+
/** 对话框标题 */
|
|
10
|
+
title: string;
|
|
11
|
+
/** 对话框描述 */
|
|
12
|
+
description?: string | ReactNode;
|
|
13
|
+
/** 确认按钮文本 */
|
|
14
|
+
confirmText?: string;
|
|
15
|
+
/** 取消按钮文本 */
|
|
16
|
+
cancelText?: string;
|
|
17
|
+
/** 确认按钮变体 */
|
|
18
|
+
variant?: VariantProps<typeof buttonVariants>['variant'];
|
|
19
|
+
/** 确认回调 */
|
|
20
|
+
onConfirm: () => void | Promise<void>;
|
|
21
|
+
/** 是否正在执行(显示加载状态) */
|
|
22
|
+
loading?: boolean;
|
|
23
|
+
/** 危险操作的影响范围提示 */
|
|
24
|
+
impact?: ReactNode;
|
|
25
|
+
/** 设置后需要输入完全一致的短语才能确认 */
|
|
26
|
+
confirmPhrase?: string;
|
|
27
|
+
/** 确认短语当前输入值 */
|
|
28
|
+
confirmValue?: string;
|
|
29
|
+
/** 确认短语输入回调 */
|
|
30
|
+
onConfirmValueChange?: (value: string) => void;
|
|
31
|
+
/** 确认短语输入标签模板 */
|
|
32
|
+
confirmPhraseLabel?: (phrase: string) => string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* 统一的确认对话框组件
|
|
36
|
+
*/
|
|
37
|
+
export declare function ConfirmDialog(params: ConfirmDialogProps): import("react").JSX.Element;
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/features/confirm-dialog/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAavD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAI5D,UAAU,kBAAkB;IAC1B,cAAc;IACd,IAAI,EAAE,OAAO,CAAA;IACb,eAAe;IACf,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,YAAY;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,YAAY;IACZ,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,aAAa;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,aAAa;IACb,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa;IACb,OAAO,CAAC,EAAE,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC,SAAS,CAAC,CAAA;IACxD,WAAW;IACX,SAAS,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACrC,qBAAqB;IACrB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,kBAAkB;IAClB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,yBAAyB;IACzB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,gBAAgB;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,eAAe;IACf,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9C,iBAAiB;IACjB,kBAAkB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAA;CAChD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,kBAAkB,+BA0DvD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import {} from 'react';
|
|
3
|
+
import { AlertTriangle } from 'lucide-react';
|
|
4
|
+
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from '../../components/alert-dialog.js';
|
|
5
|
+
import { buttonVariants } from '../../components/button.js';
|
|
6
|
+
import { mergeClassNames } from '../../utils/merge-class-names/index.js';
|
|
7
|
+
/**
|
|
8
|
+
* 统一的确认对话框组件
|
|
9
|
+
*/
|
|
10
|
+
export function ConfirmDialog(params) {
|
|
11
|
+
const { open, onOpenChange, title, description, confirmText = 'Confirm', cancelText = 'Cancel', variant = 'default', onConfirm, loading = false, impact, confirmPhrase, confirmValue = '', onConfirmValueChange, confirmPhraseLabel = (phrase) => `Type "${phrase}" to confirm`, } = params;
|
|
12
|
+
const phraseValid = !confirmPhrase || confirmValue === confirmPhrase;
|
|
13
|
+
return (_jsx(AlertDialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsxs(AlertDialogTitle, { className: mergeClassNames(variant === 'destructive' && 'flex items-center gap-2'), children: [variant === 'destructive' && _jsx(AlertTriangle, { className: "size-5 text-destructive" }), title] }), description && _jsx(AlertDialogDescription, { children: description }), impact && _jsx("div", { className: "rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-destructive", children: impact }), confirmPhrase && onConfirmValueChange && (_jsxs("div", { className: "space-y-2 text-sm", children: [_jsx("label", { htmlFor: "confirm-phrase", children: confirmPhraseLabel(confirmPhrase) }), _jsx("input", { id: "confirm-phrase", value: confirmValue, onChange: event => onConfirmValueChange(event.target.value), className: "w-full rounded-md border bg-background px-3 py-2 outline-none focus-visible:ring-2 focus-visible:ring-ring", autoComplete: "off" })] }))] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { disabled: loading, children: cancelText }), _jsx(AlertDialogAction, { className: mergeClassNames(buttonVariants({ variant }), loading && 'opacity-50 cursor-not-allowed'), onClick: (e) => {
|
|
14
|
+
e.preventDefault();
|
|
15
|
+
if (!loading) {
|
|
16
|
+
onConfirm();
|
|
17
|
+
}
|
|
18
|
+
}, disabled: loading || !phraseValid, children: loading ? 'Processing...' : confirmText })] })] }) }));
|
|
19
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type InputConfirmContextType = {
|
|
3
|
+
resolve: (value: string) => Promise<unknown>;
|
|
4
|
+
};
|
|
5
|
+
interface InputConfirmProviderProps extends React.PropsWithChildren {
|
|
6
|
+
/**
|
|
7
|
+
* 标题文案
|
|
8
|
+
*/
|
|
9
|
+
title?: string;
|
|
10
|
+
/**
|
|
11
|
+
* 描述文案模板
|
|
12
|
+
*/
|
|
13
|
+
description?: (value?: string) => string;
|
|
14
|
+
/**
|
|
15
|
+
* 取消按钮文案
|
|
16
|
+
*/
|
|
17
|
+
cancelText?: string;
|
|
18
|
+
/**
|
|
19
|
+
* 确认按钮文案
|
|
20
|
+
*/
|
|
21
|
+
confirmText?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function InputConfirmProvider(props: InputConfirmProviderProps): React.JSX.Element;
|
|
24
|
+
export declare function useInputConfirm(): InputConfirmContextType;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/features/input-confirm/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAA;AAexE,KAAK,uBAAuB,GAAG;IAC7B,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;CAC7C,CAAA;AAQD,UAAU,yBAA0B,SAAQ,KAAK,CAAC,iBAAiB;IACjE;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;IACxC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,qBAmFpE;AAGD,wBAAgB,eAAe,4BAK9B"}
|