@taicode/common-web 3.1.0 → 3.2.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/cn/index.d.ts +3 -0
- package/output/utils/cn/index.d.ts.map +1 -0
- package/output/utils/cn/index.js +5 -0
- package/output/utils/cn/index.test.d.ts +2 -0
- package/output/utils/cn/index.test.d.ts.map +1 -0
- package/output/utils/cn/index.test.js +7 -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/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 +111 -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,11 @@
|
|
|
1
|
+
import 'jsoneditor/dist/jsoneditor.css';
|
|
2
|
+
export interface JsonViewProps {
|
|
3
|
+
value?: unknown;
|
|
4
|
+
onChange?: (value: unknown) => void;
|
|
5
|
+
readonly?: boolean;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const JsonView: ((props: JsonViewProps) => import("react").JSX.Element) & {
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/components/json-view/index.tsx"],"names":[],"mappings":"AAAA,OAAO,gCAAgC,CAAA;AAkBvC,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,eAAO,MAAM,QAAQ,WAAoB,aAAa;;CA+CpD,CAAA"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import 'jsoneditor/dist/jsoneditor.css';
|
|
3
|
+
import JSONEditor from 'jsoneditor';
|
|
4
|
+
import { observer } from 'mobx-react-lite';
|
|
5
|
+
import { useEffect, useRef } from 'react';
|
|
6
|
+
import { cn } from '../../utils/cn/index.js';
|
|
7
|
+
export const JsonView = observer((props) => {
|
|
8
|
+
const { value, onChange, readonly = false, className } = props;
|
|
9
|
+
const containerRef = useRef(null);
|
|
10
|
+
const editorRef = useRef(null);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (!containerRef.current)
|
|
13
|
+
return;
|
|
14
|
+
const options = {
|
|
15
|
+
mode: 'code',
|
|
16
|
+
modes: readonly ? ['view', 'code'] : ['tree', 'code', 'form', 'view'],
|
|
17
|
+
onChange: () => {
|
|
18
|
+
if (onChange && editorRef.current && !readonly) {
|
|
19
|
+
try {
|
|
20
|
+
const json = editorRef.current.get();
|
|
21
|
+
onChange(json);
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
console.error('Invalid JSON', error);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
const EditorCtor = JSONEditor;
|
|
30
|
+
editorRef.current = new EditorCtor(containerRef.current, options);
|
|
31
|
+
editorRef.current.set(value || {});
|
|
32
|
+
return () => {
|
|
33
|
+
var _a;
|
|
34
|
+
(_a = editorRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
35
|
+
};
|
|
36
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
37
|
+
}, []);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (editorRef.current) {
|
|
40
|
+
try {
|
|
41
|
+
const currentValue = editorRef.current.get();
|
|
42
|
+
if (JSON.stringify(currentValue) !== JSON.stringify(value)) {
|
|
43
|
+
editorRef.current.set(value || {});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
catch (_a) {
|
|
47
|
+
editorRef.current.set(value || {});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}, [value]);
|
|
51
|
+
return _jsx("div", { ref: containerRef, className: cn('h-96 w-full', className) });
|
|
52
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kbd.d.ts","sourceRoot":"","sources":["../../source/components/kbd.tsx"],"names":[],"mappings":"AAEA,iBAAS,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,+BAY/C;AAED,iBAAS,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,+BASpD;AAED,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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 { cn } from "../utils/cn/index.js";
|
|
14
|
+
function Kbd(params) {
|
|
15
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
16
|
+
return (_jsx("kbd", Object.assign({ "data-slot": "kbd", className: cn("bg-muted text-muted-foreground [[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10 h-5 w-fit min-w-5 gap-1 rounded-sm px-1 font-sans text-xs font-medium [&_svg:not([class*='size-'])]:size-3 pointer-events-none inline-flex items-center justify-center select-none", className) }, props)));
|
|
17
|
+
}
|
|
18
|
+
function KbdGroup(params) {
|
|
19
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
20
|
+
return (_jsx("kbd", Object.assign({ "data-slot": "kbd-group", className: cn("gap-1 inline-flex items-center", className) }, props)));
|
|
21
|
+
}
|
|
22
|
+
export { Kbd, KbdGroup };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../source/components/label.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,KAAK,IAAI,cAAc,EAAE,MAAM,UAAU,CAAA;AAIlD,iBAAS,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,IAAI,CAAC,qBAYtE;AAED,OAAO,EAAE,KAAK,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 { Label as LabelPrimitive } from 'radix-ui';
|
|
15
|
+
import { cn } from '../utils/cn/index.js';
|
|
16
|
+
function Label(params) {
|
|
17
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
18
|
+
return (_jsx(LabelPrimitive.Root, Object.assign({ "data-slot": "label", className: cn('gap-2 text-sm leading-none font-medium group-data-[disabled=true]:opacity-50 peer-disabled:opacity-50 flex items-center select-none group-data-[disabled=true]:pointer-events-none peer-disabled:cursor-not-allowed', className) }, props)));
|
|
19
|
+
}
|
|
20
|
+
export { Label };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/components/loading-button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAqC,KAAK,wBAAwB,EAAE,KAAK,WAAW,EAAE,MAAM,OAAO,CAAA;AAkCjH;;GAEG;AACH,KAAK,gBAAgB,CAAC,CAAC,SAAS,WAAW,IAAI;IAC7C,EAAE,CAAC,EAAE,CAAC,CAAA;IACN,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC9E,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,GAAG,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE,IAAI,GAAG,SAAS,GAAG,aAAa,GAAG,aAAa,GAAG,SAAS,CAAC,CAAA;AAEnG;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,aAAa,4HAkEzB,CAAA"}
|
|
@@ -56,15 +56,11 @@ export const LoadingButton = forwardRef(function LoadingButton(_a, ref) {
|
|
|
56
56
|
if (!onClick || loading || disabled)
|
|
57
57
|
return;
|
|
58
58
|
const result = onClick(event);
|
|
59
|
-
// 如果返回 Promise-like,自动管理 loading
|
|
59
|
+
// 如果返回 Promise-like,自动管理 loading 状态
|
|
60
60
|
// 使用 then 而不是 finally,因为 PromiseLike 不保证有 finally 方法
|
|
61
|
-
// 在 rejected 回调中重新抛出,让异常传播到全局错误处理机制(如 Toaster)
|
|
62
61
|
if (isPromiseLike(result)) {
|
|
63
62
|
setInternalLoading(true);
|
|
64
|
-
result.then(() => setInternalLoading(false), (
|
|
65
|
-
setInternalLoading(false);
|
|
66
|
-
throw error;
|
|
67
|
-
});
|
|
63
|
+
result.then(() => setInternalLoading(false), () => setInternalLoading(false));
|
|
68
64
|
}
|
|
69
65
|
}, [onClick, loading, disabled]);
|
|
70
66
|
// 使用 as prop 或默认 button
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../source/components/loading-button/index.test.tsx"],"names":[],"mappings":"AAAA,OAAO,kCAAkC,CAAA"}
|
|
@@ -48,7 +48,7 @@ describe('LoadingButton', () => {
|
|
|
48
48
|
const handleClick = vi.fn(async () => {
|
|
49
49
|
await new Promise(resolve => setTimeout(resolve, 100));
|
|
50
50
|
});
|
|
51
|
-
render(_jsx(LoadingButton, { children: "\u4FDD\u5B58" }));
|
|
51
|
+
render(_jsx(LoadingButton, { onClick: handleClick, children: "\u4FDD\u5B58" }));
|
|
52
52
|
const button = screen.getByRole('button');
|
|
53
53
|
fireEvent.click(button);
|
|
54
54
|
// 应该立即显示 loading
|
|
@@ -191,13 +191,13 @@ describe('LoadingButton', () => {
|
|
|
191
191
|
const button = screen.getByRole('button');
|
|
192
192
|
// 检查是否包含默认样式类
|
|
193
193
|
expect(button.className).toContain('inline-flex');
|
|
194
|
-
expect(button.className).toContain('bg-primary');
|
|
194
|
+
expect(button.className).toContain('bg-[var(--primary)]');
|
|
195
195
|
});
|
|
196
196
|
it('使用 as prop 时不应该应用默认样式', () => {
|
|
197
197
|
render(_jsx(LoadingButton, { as: "a", children: "\u94FE\u63A5" }));
|
|
198
198
|
const link = screen.getByText('链接');
|
|
199
199
|
// 不应该包含默认 button 样式
|
|
200
|
-
expect(link.className).not.toContain('bg-primary');
|
|
200
|
+
expect(link.className).not.toContain('bg-[var(--primary)]');
|
|
201
201
|
});
|
|
202
202
|
});
|
|
203
203
|
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type NativeSelectProps = Omit<React.ComponentProps<"select">, "size"> & {
|
|
3
|
+
size?: "sm" | "default";
|
|
4
|
+
};
|
|
5
|
+
declare function NativeSelect(params: NativeSelectProps): React.JSX.Element;
|
|
6
|
+
declare function NativeSelectOption(params: React.ComponentProps<"option">): React.JSX.Element;
|
|
7
|
+
declare function NativeSelectOptGroup(params: React.ComponentProps<"optgroup">): React.JSX.Element;
|
|
8
|
+
export { NativeSelect, NativeSelectOptGroup, NativeSelectOption };
|
|
9
|
+
//# sourceMappingURL=native-select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native-select.d.ts","sourceRoot":"","sources":["../../source/components/native-select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,KAAK,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,GAAG;IACtE,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;CACxB,CAAA;AAED,iBAAS,YAAY,CAAC,MAAM,EAAE,iBAAiB,qBAwB9C;AAED,iBAAS,kBAAkB,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,qBAGjE;AAED,iBAAS,oBAAoB,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,qBAYrE;AAED,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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 { cn } from "../utils/cn/index.js";
|
|
15
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
16
|
+
function NativeSelect(params) {
|
|
17
|
+
const { className, size = "default" } = params, props = __rest(params, ["className", "size"]);
|
|
18
|
+
return (_jsxs("div", { className: cn("group/native-select relative w-fit has-[select:disabled]:opacity-50", className), "data-slot": "native-select-wrapper", "data-size": size, children: [_jsx("select", Object.assign({ "data-slot": "native-select", "data-size": size, className: "border-input placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 dark:hover:bg-input/50 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 h-9 w-full min-w-0 appearance-none rounded-md border bg-transparent py-1 pr-8 pl-2.5 text-sm shadow-xs transition-[color,box-shadow] select-none focus-visible:ring-[3px] aria-invalid:ring-[3px] data-[size=sm]:h-8 outline-none disabled:pointer-events-none disabled:cursor-not-allowed" }, props)), _jsx(ChevronDownIcon, { className: "text-muted-foreground top-1/2 right-2.5 size-4 -translate-y-1/2 pointer-events-none absolute select-none", "aria-hidden": "true", "data-slot": "native-select-icon" })] }));
|
|
19
|
+
}
|
|
20
|
+
function NativeSelectOption(params) {
|
|
21
|
+
const props = __rest(params, []);
|
|
22
|
+
return _jsx("option", Object.assign({ "data-slot": "native-select-option" }, props));
|
|
23
|
+
}
|
|
24
|
+
function NativeSelectOptGroup(params) {
|
|
25
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
26
|
+
return (_jsx("optgroup", Object.assign({ "data-slot": "native-select-optgroup", className: cn(className) }, props)));
|
|
27
|
+
}
|
|
28
|
+
export { NativeSelect, NativeSelectOptGroup, NativeSelectOption };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface EmptyProps {
|
|
3
|
+
icon?: ReactNode;
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
action?: {
|
|
7
|
+
label: string;
|
|
8
|
+
onClick: () => void;
|
|
9
|
+
icon?: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export interface LoadingStateProps {
|
|
13
|
+
title: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
fullscreen?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare function LoadingState(props: LoadingStateProps): import("react").JSX.Element;
|
|
18
|
+
export declare function Empty(props: EmptyProps): import("react").JSX.Element;
|
|
19
|
+
//# sourceMappingURL=page-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-state.d.ts","sourceRoot":"","sources":["../../source/components/page-state.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKtC,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE;QACP,KAAK,EAAE,MAAM,CAAA;QACb,OAAO,EAAE,MAAM,IAAI,CAAA;QACnB,IAAI,CAAC,EAAE,SAAS,CAAA;KACjB,CAAA;CACF;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,+BAmBpD;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,+BAsBtC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { LoaderCircleIcon, PlusIcon } from 'lucide-react';
|
|
3
|
+
import { Button } from './button.js';
|
|
4
|
+
export function LoadingState(props) {
|
|
5
|
+
const { title, description, fullscreen = false } = props;
|
|
6
|
+
return (_jsx("div", { className: fullscreen
|
|
7
|
+
? 'flex min-h-screen items-center justify-center'
|
|
8
|
+
: 'flex min-h-75 items-center justify-center rounded-lg border border-dashed py-8 md:min-h-100 md:py-12', role: "status", "aria-live": "polite", "aria-busy": "true", children: _jsxs("div", { className: "flex flex-col items-center gap-3 text-center", children: [_jsx(LoaderCircleIcon, { className: "size-8 animate-spin text-muted-foreground" }), _jsx("div", { className: "text-sm text-muted-foreground md:text-base", children: title }), description && _jsx("p", { className: "max-w-sm px-4 text-xs text-muted-foreground md:text-sm", children: description })] }) }));
|
|
9
|
+
}
|
|
10
|
+
export function Empty(props) {
|
|
11
|
+
const { icon, title, description, action } = props;
|
|
12
|
+
return (_jsxs("div", { className: "flex min-h-75 flex-col items-center justify-center rounded-lg border border-dashed py-8 md:min-h-100 md:py-12", children: [icon && (_jsx("div", { className: "mb-3 flex size-10 items-center justify-center rounded-full bg-muted md:mb-4 md:size-12", children: _jsx("div", { className: "size-5 text-muted-foreground md:size-6", children: icon }) })), _jsx("h3", { className: "mt-2 text-sm font-semibold md:text-base", children: title }), description && _jsx("p", { className: "mt-1 max-w-sm px-4 text-center text-xs text-muted-foreground md:text-sm", children: description }), action && (_jsx("div", { className: "mt-4 md:mt-6", children: _jsxs(Button, { onClick: action.onClick, size: "sm", children: [action.icon || _jsx(PlusIcon, { className: "size-4" }), action.label] }) }))] }));
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Popover as PopoverPrimitive } from "radix-ui";
|
|
3
|
+
declare function Popover(params: React.ComponentProps<typeof PopoverPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function PopoverTrigger(params: React.ComponentProps<typeof PopoverPrimitive.Trigger>): React.JSX.Element;
|
|
5
|
+
declare function PopoverContent(params: React.ComponentProps<typeof PopoverPrimitive.Content>): React.JSX.Element;
|
|
6
|
+
declare function PopoverAnchor(params: React.ComponentProps<typeof PopoverPrimitive.Anchor>): React.JSX.Element;
|
|
7
|
+
declare function PopoverHeader(params: React.ComponentProps<"div">): React.JSX.Element;
|
|
8
|
+
declare function PopoverTitle(params: React.ComponentProps<"h2">): React.JSX.Element;
|
|
9
|
+
declare function PopoverDescription(params: React.ComponentProps<"p">): React.JSX.Element;
|
|
10
|
+
export { Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, };
|
|
11
|
+
//# sourceMappingURL=popover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../source/components/popover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAItD,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,qBAqBpF;AAED,iBAAS,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,MAAM,CAAC,qBAKlF;AAED,iBAAS,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBASzD;AAED,iBAAS,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,qBASvD;AAED,iBAAS,kBAAkB,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,qBAY5D;AAED,OAAO,EACL,OAAO,EACP,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,cAAc,GACf,CAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
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 { Popover as PopoverPrimitive } from "radix-ui";
|
|
15
|
+
import { cn } from "../utils/cn/index.js";
|
|
16
|
+
function Popover(params) {
|
|
17
|
+
const props = __rest(params, []);
|
|
18
|
+
return _jsx(PopoverPrimitive.Root, Object.assign({ "data-slot": "popover" }, props));
|
|
19
|
+
}
|
|
20
|
+
function PopoverTrigger(params) {
|
|
21
|
+
const props = __rest(params, []);
|
|
22
|
+
return _jsx(PopoverPrimitive.Trigger, Object.assign({ "data-slot": "popover-trigger" }, props));
|
|
23
|
+
}
|
|
24
|
+
function PopoverContent(params) {
|
|
25
|
+
const { className, align = "center", sideOffset = 4 } = params, props = __rest(params, ["className", "align", "sideOffset"]);
|
|
26
|
+
return (_jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content, Object.assign({ "data-slot": "popover-content", align: align, sideOffset: sideOffset, className: cn("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-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 ring-foreground/10 flex flex-col gap-4 rounded-md p-4 text-sm shadow-md ring-1 duration-100 z-50 w-72 origin-(--radix-popover-content-transform-origin) outline-hidden", className) }, props)) }));
|
|
27
|
+
}
|
|
28
|
+
function PopoverAnchor(params) {
|
|
29
|
+
const props = __rest(params, []);
|
|
30
|
+
return _jsx(PopoverPrimitive.Anchor, Object.assign({ "data-slot": "popover-anchor" }, props));
|
|
31
|
+
}
|
|
32
|
+
function PopoverHeader(params) {
|
|
33
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
34
|
+
return (_jsx("div", Object.assign({ "data-slot": "popover-header", className: cn("flex flex-col gap-1 text-sm", className) }, props)));
|
|
35
|
+
}
|
|
36
|
+
function PopoverTitle(params) {
|
|
37
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
38
|
+
return (_jsx("div", Object.assign({ "data-slot": "popover-title", className: cn("font-medium", className) }, props)));
|
|
39
|
+
}
|
|
40
|
+
function PopoverDescription(params) {
|
|
41
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
42
|
+
return (_jsx("p", Object.assign({ "data-slot": "popover-description", className: cn("text-muted-foreground", className) }, props)));
|
|
43
|
+
}
|
|
44
|
+
export { Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../source/components/progress.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAIxD,iBAAS,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,iBAAiB,CAAC,IAAI,CAAC,qBAsB5E;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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 { Progress as ProgressPrimitive } from "radix-ui";
|
|
16
|
+
import { cn } from "../utils/cn/index.js";
|
|
17
|
+
function Progress(params) {
|
|
18
|
+
const { className, value } = params, props = __rest(params, ["className", "value"]);
|
|
19
|
+
return (_jsx(ProgressPrimitive.Root, Object.assign({ "data-slot": "progress", className: cn("bg-muted h-1.5 rounded-full relative flex w-full items-center overflow-x-hidden", className) }, props, { children: _jsx(ProgressPrimitive.Indicator, { "data-slot": "progress-indicator", className: "bg-primary size-full flex-1 transition-all", style: { transform: `translateX(-${100 - (value || 0)}%)` } }) })));
|
|
20
|
+
}
|
|
21
|
+
export { Progress };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { RadioGroup as RadioGroupPrimitive } from 'radix-ui';
|
|
3
|
+
declare function RadioGroup(params: React.ComponentProps<typeof RadioGroupPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function RadioGroupItem(params: React.ComponentProps<typeof RadioGroupPrimitive.Item>): React.JSX.Element;
|
|
5
|
+
export { RadioGroup, RadioGroupItem };
|
|
6
|
+
//# sourceMappingURL=radio-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-group.d.ts","sourceRoot":"","sources":["../../source/components/radio-group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,UAAU,IAAI,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAK5D,iBAAS,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,mBAAmB,CAAC,IAAI,CAAC,qBAGhF;AAED,iBAAS,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,mBAAmB,CAAC,IAAI,CAAC,qBAgBpF;AAED,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
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 { RadioGroup as RadioGroupPrimitive } from 'radix-ui';
|
|
15
|
+
import { CircleIcon } from 'lucide-react';
|
|
16
|
+
import { cn } from '../utils/cn/index.js';
|
|
17
|
+
function RadioGroup(params) {
|
|
18
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
19
|
+
return _jsx(RadioGroupPrimitive.Root, Object.assign({ "data-slot": "radio-group", className: cn('grid gap-3 w-full', className) }, props));
|
|
20
|
+
}
|
|
21
|
+
function RadioGroupItem(params) {
|
|
22
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
23
|
+
return (_jsx(RadioGroupPrimitive.Item, Object.assign({ "data-slot": "radio-group-item", className: cn('border-input text-primary 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 flex size-4 rounded-full shadow-xs focus-visible:ring-[3px] aria-invalid:ring-[3px] group/radio-group-item peer relative aspect-square shrink-0 border outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50', className) }, props, { children: _jsx(RadioGroupPrimitive.Indicator, { "data-slot": "radio-group-indicator", className: "group-aria-invalid/radio-group-item:text-destructive text-primary flex size-4 items-center justify-center", children: _jsx(CircleIcon, { className: "absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 fill-current" }) }) })));
|
|
24
|
+
}
|
|
25
|
+
export { RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { ScrollArea as ScrollAreaPrimitive } from "radix-ui";
|
|
3
|
+
declare function ScrollArea(params: React.ComponentProps<typeof ScrollAreaPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function ScrollBar(params: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>): React.JSX.Element;
|
|
5
|
+
export { ScrollArea, ScrollBar };
|
|
6
|
+
//# sourceMappingURL=scroll-area.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll-area.d.ts","sourceRoot":"","sources":["../../source/components/scroll-area.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,UAAU,IAAI,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAI5D,iBAAS,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,mBAAmB,CAAC,IAAI,CAAC,qBAsBhF;AAED,iBAAS,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,mBAAmB,CAAC,mBAAmB,CAAC,qBAuB9F;AAED,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
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 { ScrollArea as ScrollAreaPrimitive } from "radix-ui";
|
|
15
|
+
import { cn } from "../utils/cn/index.js";
|
|
16
|
+
function ScrollArea(params) {
|
|
17
|
+
const { className, children } = params, props = __rest(params, ["className", "children"]);
|
|
18
|
+
return (_jsxs(ScrollAreaPrimitive.Root, Object.assign({ "data-slot": "scroll-area", className: cn("relative", className) }, props, { children: [_jsx(ScrollAreaPrimitive.Viewport, { "data-slot": "scroll-area-viewport", className: "focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1", children: children }), _jsx(ScrollBar, {}), _jsx(ScrollAreaPrimitive.Corner, {})] })));
|
|
19
|
+
}
|
|
20
|
+
function ScrollBar(params) {
|
|
21
|
+
const { className, orientation = "vertical" } = params, props = __rest(params, ["className", "orientation"]);
|
|
22
|
+
return (_jsx(ScrollAreaPrimitive.ScrollAreaScrollbar, Object.assign({ "data-slot": "scroll-area-scrollbar", "data-orientation": orientation, orientation: orientation, className: cn("data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent flex touch-none p-px transition-colors select-none", className) }, props, { children: _jsx(ScrollAreaPrimitive.ScrollAreaThumb, { "data-slot": "scroll-area-thumb", className: "rounded-full bg-border relative flex-1" }) })));
|
|
23
|
+
}
|
|
24
|
+
export { ScrollArea, ScrollBar };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Select as SelectPrimitive } from "radix-ui";
|
|
3
|
+
type SelectTriggerParams = {
|
|
4
|
+
size?: "sm" | "default";
|
|
5
|
+
};
|
|
6
|
+
declare function Select(params: React.ComponentProps<typeof SelectPrimitive.Root>): React.JSX.Element;
|
|
7
|
+
declare function SelectGroup(params: React.ComponentProps<typeof SelectPrimitive.Group>): React.JSX.Element;
|
|
8
|
+
declare function SelectValue(params: React.ComponentProps<typeof SelectPrimitive.Value>): React.JSX.Element;
|
|
9
|
+
declare function SelectTrigger(params: React.ComponentProps<typeof SelectPrimitive.Trigger> & SelectTriggerParams): React.JSX.Element;
|
|
10
|
+
declare function SelectContent(params: React.ComponentProps<typeof SelectPrimitive.Content>): React.JSX.Element;
|
|
11
|
+
declare function SelectLabel(params: React.ComponentProps<typeof SelectPrimitive.Label>): React.JSX.Element;
|
|
12
|
+
declare function SelectItem(params: React.ComponentProps<typeof SelectPrimitive.Item>): React.JSX.Element;
|
|
13
|
+
declare function SelectSeparator(params: React.ComponentProps<typeof SelectPrimitive.Separator>): React.JSX.Element;
|
|
14
|
+
declare function SelectScrollUpButton(params: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>): React.JSX.Element;
|
|
15
|
+
declare function SelectScrollDownButton(params: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>): React.JSX.Element;
|
|
16
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
|
|
17
|
+
//# sourceMappingURL=select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../source/components/select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAA;AAKpD,KAAK,mBAAmB,GAAG;IACzB,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;CACxB,CAAA;AAED,iBAAS,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,qBAKxE;AAED,iBAAS,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,qBAY9E;AAED,iBAAS,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,qBAK9E;AAED,iBAAS,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,GAAG,mBAAmB,qBAuBxG;AAED,iBAAS,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,qBAgClF;AAED,iBAAS,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,qBAY9E;AAED,iBAAS,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,qBAuB5E;AAED,iBAAS,eAAe,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,SAAS,CAAC,qBAYtF;AAED,iBAAS,oBAAoB,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,cAAc,CAAC,qBAehG;AAED,iBAAS,sBAAsB,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,gBAAgB,CAAC,qBAepG;AAED,OAAO,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,UAAU,EACV,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,WAAW,GACZ,CAAA"}
|
|
@@ -0,0 +1,58 @@
|
|
|
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 { Select as SelectPrimitive } from "radix-ui";
|
|
16
|
+
import { cn } from "../utils/cn/index.js";
|
|
17
|
+
import { ChevronDownIcon, CheckIcon, ChevronUpIcon } from "lucide-react";
|
|
18
|
+
function Select(params) {
|
|
19
|
+
const props = __rest(params, []);
|
|
20
|
+
return _jsx(SelectPrimitive.Root, Object.assign({ "data-slot": "select" }, props));
|
|
21
|
+
}
|
|
22
|
+
function SelectGroup(params) {
|
|
23
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
24
|
+
return (_jsx(SelectPrimitive.Group, Object.assign({ "data-slot": "select-group", className: cn("scroll-my-1 p-1", className) }, props)));
|
|
25
|
+
}
|
|
26
|
+
function SelectValue(params) {
|
|
27
|
+
const props = __rest(params, []);
|
|
28
|
+
return _jsx(SelectPrimitive.Value, Object.assign({ "data-slot": "select-value" }, props));
|
|
29
|
+
}
|
|
30
|
+
function SelectTrigger(params) {
|
|
31
|
+
const { className, size = "default", children } = params, props = __rest(params, ["className", "size", "children"]);
|
|
32
|
+
return (_jsxs(SelectPrimitive.Trigger, Object.assign({ "data-slot": "select-trigger", "data-size": size, className: cn("border-input data-[placeholder]:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 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 gap-1.5 rounded-md border bg-transparent py-2 pr-2 pl-2.5 text-sm shadow-xs transition-[color,box-shadow] focus-visible:ring-[3px] aria-invalid:ring-[3px] data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:flex *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-4 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0", className) }, props, { children: [children, _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDownIcon, { className: "text-muted-foreground size-4 pointer-events-none" }) })] })));
|
|
33
|
+
}
|
|
34
|
+
function SelectContent(params) {
|
|
35
|
+
const { className, children, position = "item-aligned", align = "center" } = params, props = __rest(params, ["className", "children", "position", "align"]);
|
|
36
|
+
return (_jsx(SelectPrimitive.Portal, { children: _jsxs(SelectPrimitive.Content, Object.assign({ "data-slot": "select-content", "data-align-trigger": position === "item-aligned", className: cn("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-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 ring-foreground/10 min-w-36 rounded-md shadow-md ring-1 duration-100 relative z-50 max-h-(--radix-select-content-available-height) origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto data-[align-trigger=true]:animate-none", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className), position: position, align: align }, props, { children: [_jsx(SelectScrollUpButton, {}), _jsx(SelectPrimitive.Viewport, { "data-position": position, className: cn("data-[position=popper]:h-[var(--radix-select-trigger-height)] data-[position=popper]:w-full data-[position=popper]:min-w-[var(--radix-select-trigger-width)]", position === "popper" && ""), children: children }), _jsx(SelectScrollDownButton, {})] })) }));
|
|
37
|
+
}
|
|
38
|
+
function SelectLabel(params) {
|
|
39
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
40
|
+
return (_jsx(SelectPrimitive.Label, Object.assign({ "data-slot": "select-label", className: cn("text-muted-foreground px-2 py-1.5 text-xs", className) }, props)));
|
|
41
|
+
}
|
|
42
|
+
function SelectItem(params) {
|
|
43
|
+
const { className, children } = params, props = __rest(params, ["className", "children"]);
|
|
44
|
+
return (_jsxs(SelectPrimitive.Item, Object.assign({ "data-slot": "select-item", className: cn("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", className) }, props, { children: [_jsx("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center", children: _jsx(SelectPrimitive.ItemIndicator, { children: _jsx(CheckIcon, { className: "pointer-events-none" }) }) }), _jsx(SelectPrimitive.ItemText, { children: children })] })));
|
|
45
|
+
}
|
|
46
|
+
function SelectSeparator(params) {
|
|
47
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
48
|
+
return (_jsx(SelectPrimitive.Separator, Object.assign({ "data-slot": "select-separator", className: cn("bg-border -mx-1 my-1 h-px pointer-events-none", className) }, props)));
|
|
49
|
+
}
|
|
50
|
+
function SelectScrollUpButton(params) {
|
|
51
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
52
|
+
return (_jsx(SelectPrimitive.ScrollUpButton, Object.assign({ "data-slot": "select-scroll-up-button", className: cn("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4", className) }, props, { children: _jsx(ChevronUpIcon, {}) })));
|
|
53
|
+
}
|
|
54
|
+
function SelectScrollDownButton(params) {
|
|
55
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
56
|
+
return (_jsx(SelectPrimitive.ScrollDownButton, Object.assign({ "data-slot": "select-scroll-down-button", className: cn("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4", className) }, props, { children: _jsx(ChevronDownIcon, {}) })));
|
|
57
|
+
}
|
|
58
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
export interface SeparatorProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
orientation?: 'horizontal' | 'vertical';
|
|
4
|
+
}
|
|
5
|
+
export declare const Separator: import("react").ForwardRefExoticComponent<SeparatorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
|
+
//# sourceMappingURL=separator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separator.d.ts","sourceRoot":"","sources":["../../source/components/separator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAA;AAIvD,MAAM,WAAW,cAAe,SAAQ,cAAc,CAAC,cAAc,CAAC;IACpE,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;CACxC;AAED,eAAO,MAAM,SAAS,2GAKpB,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 { forwardRef } from 'react';
|
|
14
|
+
import { cn } from '../utils/cn/index.js';
|
|
15
|
+
export const Separator = forwardRef(function Separator(_a, ref) {
|
|
16
|
+
var { className, orientation = 'horizontal' } = _a, props = __rest(_a, ["className", "orientation"]);
|
|
17
|
+
return _jsx("div", Object.assign({ ref: ref, role: "separator", "aria-orientation": orientation, className: cn('shrink-0 bg-border', orientation === 'horizontal' ? 'h-px w-full' : 'h-full w-px', className) }, props));
|
|
18
|
+
});
|
|
19
|
+
Separator.displayName = 'Separator';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Dialog as SheetPrimitive } from "radix-ui";
|
|
3
|
+
type SheetContentParams = {
|
|
4
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
5
|
+
showCloseButton?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare function Sheet(params: React.ComponentProps<typeof SheetPrimitive.Root>): React.JSX.Element;
|
|
8
|
+
declare function SheetTrigger(params: React.ComponentProps<typeof SheetPrimitive.Trigger>): React.JSX.Element;
|
|
9
|
+
declare function SheetClose(params: React.ComponentProps<typeof SheetPrimitive.Close>): React.JSX.Element;
|
|
10
|
+
declare function SheetContent(params: React.ComponentProps<typeof SheetPrimitive.Content> & SheetContentParams): React.JSX.Element;
|
|
11
|
+
declare function SheetHeader(params: React.ComponentProps<"div">): React.JSX.Element;
|
|
12
|
+
declare function SheetFooter(params: React.ComponentProps<"div">): React.JSX.Element;
|
|
13
|
+
declare function SheetTitle(params: React.ComponentProps<typeof SheetPrimitive.Title>): React.JSX.Element;
|
|
14
|
+
declare function SheetDescription(params: React.ComponentProps<typeof SheetPrimitive.Description>): React.JSX.Element;
|
|
15
|
+
export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
|
|
16
|
+
//# sourceMappingURL=sheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../source/components/sheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,UAAU,CAAA;AAMnD,KAAK,kBAAkB,GAAG;IACxB,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;IAC1C,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED,iBAAS,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,IAAI,CAAC,qBAGtE;AAED,iBAAS,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,OAAO,CAAC,qBAKhF;AAED,iBAAS,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,KAAK,CAAC,qBAK5E;AAuBD,iBAAS,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,OAAO,CAAC,GAAG,kBAAkB,qBA8BrG;AAED,iBAAS,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBASvD;AAED,iBAAS,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBASvD;AAED,iBAAS,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,KAAK,CAAC,qBAY5E;AAED,iBAAS,gBAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,WAAW,CAAC,qBAYxF;AAED,OAAO,EACL,KAAK,EACL,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,WAAW,EACX,WAAW,EACX,UAAU,EACV,gBAAgB,GACjB,CAAA"}
|