@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,32 @@
|
|
|
1
|
+
const LOCALE_SEGMENT_REGEX = /^\/(zh-CN|en-US)(\/|$)/;
|
|
2
|
+
function withLocalePrefix(pathname, locale) {
|
|
3
|
+
const normalizedPathname = pathname.startsWith('/') ? pathname : `/${pathname}`;
|
|
4
|
+
if (LOCALE_SEGMENT_REGEX.test(normalizedPathname)) {
|
|
5
|
+
return normalizedPathname;
|
|
6
|
+
}
|
|
7
|
+
if (normalizedPathname === '/') {
|
|
8
|
+
return `/${locale}`;
|
|
9
|
+
}
|
|
10
|
+
return `/${locale}${normalizedPathname}`;
|
|
11
|
+
}
|
|
12
|
+
export function resolveSafeRedirect(redirect, locale) {
|
|
13
|
+
if (!(redirect === null || redirect === void 0 ? void 0 : redirect.trim())) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
try {
|
|
17
|
+
const url = new URL(redirect, window.location.origin);
|
|
18
|
+
if (!['http:', 'https:'].includes(url.protocol)) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
if (url.origin !== window.location.origin) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
const pathname = withLocalePrefix(url.pathname, locale);
|
|
25
|
+
return {
|
|
26
|
+
target: `${pathname}${url.search}${url.hash}`,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
catch (_a) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taicode/common-web",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"author": "Alain",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"description": "",
|
|
@@ -9,29 +9,100 @@
|
|
|
9
9
|
"node": ">=16.0.0"
|
|
10
10
|
},
|
|
11
11
|
"exports": {
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
"
|
|
12
|
+
"./styles.css": "./styles.css",
|
|
13
|
+
"./ui": {
|
|
14
|
+
"types": "./output/components/index.d.ts",
|
|
15
|
+
"default": "./output/components/index.js"
|
|
15
16
|
},
|
|
16
|
-
"./
|
|
17
|
-
"types": "./output/
|
|
18
|
-
"default": "./output/
|
|
17
|
+
"./service": {
|
|
18
|
+
"types": "./output/services/service/index.d.ts",
|
|
19
|
+
"default": "./output/services/service/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./toaster": {
|
|
22
|
+
"types": "./output/components/toaster/index.d.ts",
|
|
23
|
+
"default": "./output/components/toaster/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./loading-button": {
|
|
26
|
+
"types": "./output/components/loading-button/index.d.ts",
|
|
27
|
+
"default": "./output/components/loading-button/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./size-provider": {
|
|
30
|
+
"types": "./output/components/size-provider/index.d.ts",
|
|
31
|
+
"default": "./output/components/size-provider/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./use-loading": {
|
|
34
|
+
"types": "./output/hooks/use-loading/index.d.ts",
|
|
35
|
+
"default": "./output/hooks/use-loading/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./use-observer": {
|
|
38
|
+
"types": "./output/hooks/use-observer/index.d.ts",
|
|
39
|
+
"default": "./output/hooks/use-observer/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./cn": {
|
|
42
|
+
"types": "./output/utils/cn/index.d.ts",
|
|
43
|
+
"default": "./output/utils/cn/index.js"
|
|
44
|
+
},
|
|
45
|
+
"./cache-api": {
|
|
46
|
+
"types": "./output/services/cache-api/index.d.ts",
|
|
47
|
+
"default": "./output/services/cache-api/index.js"
|
|
48
|
+
},
|
|
49
|
+
"./side-cache": {
|
|
50
|
+
"types": "./output/services/side-cache/index.d.ts",
|
|
51
|
+
"default": "./output/services/side-cache/index.js"
|
|
52
|
+
},
|
|
53
|
+
"./signin": {
|
|
54
|
+
"types": "./output/features/signin/index.d.ts",
|
|
55
|
+
"default": "./output/features/signin/index.js"
|
|
56
|
+
},
|
|
57
|
+
"./vite-config": {
|
|
58
|
+
"types": "./output/vite-config/index.d.ts",
|
|
59
|
+
"default": "./output/vite-config/index.js"
|
|
60
|
+
},
|
|
61
|
+
"./features/*": {
|
|
62
|
+
"types": "./output/features/*/index.d.ts",
|
|
63
|
+
"default": "./output/features/*/index.js"
|
|
64
|
+
},
|
|
65
|
+
"./components/*": {
|
|
66
|
+
"types": "./output/components/*/index.d.ts",
|
|
67
|
+
"default": "./output/components/*/index.js"
|
|
68
|
+
},
|
|
69
|
+
"./hooks/*": {
|
|
70
|
+
"types": "./output/hooks/*/index.d.ts",
|
|
71
|
+
"default": "./output/hooks/*/index.js"
|
|
72
|
+
},
|
|
73
|
+
"./services/*": {
|
|
74
|
+
"types": "./output/services/*/index.d.ts",
|
|
75
|
+
"default": "./output/services/*/index.js"
|
|
76
|
+
},
|
|
77
|
+
"./utils/*": {
|
|
78
|
+
"types": "./output/utils/*/index.d.ts",
|
|
79
|
+
"default": "./output/utils/*/index.js"
|
|
80
|
+
},
|
|
81
|
+
"./layout": {
|
|
82
|
+
"types": "./output/layout/index.d.ts",
|
|
83
|
+
"default": "./output/layout/index.js"
|
|
84
|
+
},
|
|
85
|
+
"./layout/*": {
|
|
86
|
+
"types": "./output/layout/*/index.d.ts",
|
|
87
|
+
"default": "./output/layout/*/index.js"
|
|
19
88
|
}
|
|
20
89
|
},
|
|
21
90
|
"files": [
|
|
22
|
-
"output"
|
|
91
|
+
"output",
|
|
92
|
+
"styles.css"
|
|
23
93
|
],
|
|
24
94
|
"scripts": {
|
|
25
95
|
"test": "vitest",
|
|
26
96
|
"test:ui": "vitest --ui",
|
|
27
97
|
"test:run": "vitest run",
|
|
28
98
|
"prepublishOnly": "npm run build",
|
|
29
|
-
"build": "tsc -p tsconfig.json",
|
|
30
|
-
"dev": "tsc -p tsconfig.json --watch"
|
|
99
|
+
"build": "node ../../node_modules/typescript/bin/tsc -p tsconfig.json",
|
|
100
|
+
"dev": "node ../../node_modules/typescript/bin/tsc -p tsconfig.json --watch",
|
|
101
|
+
"pack:local": "pnpm build && mkdir -p ../../.local-packages && pnpm pack --pack-destination ../../.local-packages"
|
|
31
102
|
},
|
|
32
103
|
"peerDependencies": {
|
|
33
|
-
"@heroicons/react": "^2.2.0",
|
|
34
104
|
"@needle-di/core": ">=1.0.0",
|
|
105
|
+
"@heroicons/react": "^2.2.0",
|
|
35
106
|
"@taicode/common-base": "^3.1.0",
|
|
36
107
|
"@types/react": ">=18",
|
|
37
108
|
"mobx": ">=6",
|
|
@@ -39,28 +110,44 @@
|
|
|
39
110
|
"react": ">=18"
|
|
40
111
|
},
|
|
41
112
|
"dependencies": {
|
|
42
|
-
"@headlessui/react": "^2.2.
|
|
113
|
+
"@headlessui/react": "^2.2.9",
|
|
43
114
|
"@heroicons/react": "^2.2.0",
|
|
44
115
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
45
116
|
"@radix-ui/react-slot": "^1.2.4",
|
|
46
117
|
"class-variance-authority": "^0.7.1",
|
|
47
118
|
"clsx": "^2.1.1",
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
119
|
+
"cmdk": "^1.1.1",
|
|
120
|
+
"framer-motion": "^12.34.3",
|
|
121
|
+
"jsoneditor": "^10.4.2",
|
|
122
|
+
"lucide-react": "^0.468.0",
|
|
123
|
+
"radix-ui": "^1.4.3",
|
|
124
|
+
"react-hook-form": "^7.71.2",
|
|
125
|
+
"sonner": "^1.7.4",
|
|
126
|
+
"tailwind-merge": "^3.5.0",
|
|
127
|
+
"web-vitals": "^5.1.0"
|
|
51
128
|
},
|
|
52
129
|
"devDependencies": {
|
|
53
|
-
"@
|
|
54
|
-
"@
|
|
55
|
-
"@testing-library/
|
|
56
|
-
"@
|
|
57
|
-
"@
|
|
130
|
+
"@babel/plugin-proposal-decorators": "^7.28.0",
|
|
131
|
+
"@needle-di/core": "^1.1.1",
|
|
132
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
133
|
+
"@testing-library/react": "^14.3.1",
|
|
134
|
+
"@types/react": "^18.3.28",
|
|
135
|
+
"@tailwindcss/vite": "^4.1.13",
|
|
136
|
+
"@types/jsoneditor": "^9.9.6",
|
|
137
|
+
"@vitejs/plugin-react": "^4.7.0",
|
|
138
|
+
"@vitest/ui": "^3.2.7",
|
|
58
139
|
"execa": "^8.0.1",
|
|
59
|
-
"jsdom": "^23.
|
|
60
|
-
"mobx": "^6.
|
|
140
|
+
"jsdom": "^23.2.0",
|
|
141
|
+
"mobx": "^6.15.0",
|
|
61
142
|
"mobx-react-lite": "^4.1.1",
|
|
62
|
-
"react": "^18.
|
|
143
|
+
"react": "^18.3.1",
|
|
144
|
+
"rollup-plugin-visualizer": "^5.14.0",
|
|
63
145
|
"type-detect": "^4.1.0",
|
|
64
|
-
"
|
|
146
|
+
"vite": "^5.4.20",
|
|
147
|
+
"vite-plugin-i18next-loader": "^3.0.1",
|
|
148
|
+
"vite-plugin-pwa": "^0.21.2",
|
|
149
|
+
"vite-plugin-svgr": "^4.5.0",
|
|
150
|
+
"vite-tsconfig-paths": "^5.1.4",
|
|
151
|
+
"vitest": "^3.2.7"
|
|
65
152
|
}
|
|
66
153
|
}
|
package/styles.css
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
@custom-variant dark (&:is(.dark *));
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
--background: oklch(1 0 0);
|
|
5
|
+
--foreground: oklch(0.145 0 0);
|
|
6
|
+
--card: oklch(1 0 0);
|
|
7
|
+
--card-foreground: oklch(0.145 0 0);
|
|
8
|
+
--popover: oklch(1 0 0);
|
|
9
|
+
--popover-foreground: oklch(0.145 0 0);
|
|
10
|
+
--primary: oklch(0.205 0 0);
|
|
11
|
+
--primary-foreground: oklch(0.985 0 0);
|
|
12
|
+
--secondary: oklch(0.97 0 0);
|
|
13
|
+
--secondary-foreground: oklch(0.205 0 0);
|
|
14
|
+
--muted: oklch(0.97 0 0);
|
|
15
|
+
--muted-foreground: oklch(0.556 0 0);
|
|
16
|
+
--accent: oklch(0.97 0 0);
|
|
17
|
+
--accent-foreground: oklch(0.205 0 0);
|
|
18
|
+
--destructive: oklch(0.58 0.22 27);
|
|
19
|
+
--border: oklch(0.922 0 0);
|
|
20
|
+
--input: oklch(0.922 0 0);
|
|
21
|
+
--ring: oklch(0.708 0 0);
|
|
22
|
+
--chart-1: oklch(0.809 0.105 251.813);
|
|
23
|
+
--chart-2: oklch(0.623 0.214 259.815);
|
|
24
|
+
--chart-3: oklch(0.546 0.245 262.881);
|
|
25
|
+
--chart-4: oklch(0.488 0.243 264.376);
|
|
26
|
+
--chart-5: oklch(0.424 0.199 265.638);
|
|
27
|
+
--radius: 0.625rem;
|
|
28
|
+
--sidebar: oklch(0.985 0 0);
|
|
29
|
+
--sidebar-foreground: oklch(0.145 0 0);
|
|
30
|
+
--sidebar-primary: oklch(0.205 0 0);
|
|
31
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
32
|
+
--sidebar-accent: oklch(0.97 0 0);
|
|
33
|
+
--sidebar-accent-foreground: oklch(0.205 0 0);
|
|
34
|
+
--sidebar-border: oklch(0.922 0 0);
|
|
35
|
+
--sidebar-ring: oklch(0.708 0 0);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.dark {
|
|
39
|
+
--background: oklch(0.145 0 0);
|
|
40
|
+
--foreground: oklch(0.985 0 0);
|
|
41
|
+
--card: oklch(0.205 0 0);
|
|
42
|
+
--card-foreground: oklch(0.985 0 0);
|
|
43
|
+
--popover: oklch(0.205 0 0);
|
|
44
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
45
|
+
--primary: oklch(0.87 0 0);
|
|
46
|
+
--primary-foreground: oklch(0.205 0 0);
|
|
47
|
+
--secondary: oklch(0.269 0 0);
|
|
48
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
49
|
+
--muted: oklch(0.269 0 0);
|
|
50
|
+
--muted-foreground: oklch(0.708 0 0);
|
|
51
|
+
--accent: oklch(0.371 0 0);
|
|
52
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
53
|
+
--destructive: oklch(0.704 0.191 22.216);
|
|
54
|
+
--border: oklch(1 0 0 / 10%);
|
|
55
|
+
--input: oklch(1 0 0 / 15%);
|
|
56
|
+
--ring: oklch(0.556 0 0);
|
|
57
|
+
--chart-1: oklch(0.809 0.105 251.813);
|
|
58
|
+
--chart-2: oklch(0.623 0.214 259.815);
|
|
59
|
+
--chart-3: oklch(0.546 0.245 262.881);
|
|
60
|
+
--chart-4: oklch(0.488 0.243 264.376);
|
|
61
|
+
--chart-5: oklch(0.424 0.199 265.638);
|
|
62
|
+
--sidebar: oklch(0.205 0 0);
|
|
63
|
+
--sidebar-foreground: oklch(0.985 0 0);
|
|
64
|
+
--sidebar-primary: oklch(0.488 0.243 264.376);
|
|
65
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
66
|
+
--sidebar-accent: oklch(0.269 0 0);
|
|
67
|
+
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
68
|
+
--sidebar-border: oklch(1 0 0 / 10%);
|
|
69
|
+
--sidebar-ring: oklch(0.556 0 0);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@theme inline {
|
|
73
|
+
--font-sans: 'Inter Variable', sans-serif;
|
|
74
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
75
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
76
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
77
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
78
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
79
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
80
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
81
|
+
--color-sidebar: var(--sidebar);
|
|
82
|
+
--color-chart-5: var(--chart-5);
|
|
83
|
+
--color-chart-4: var(--chart-4);
|
|
84
|
+
--color-chart-3: var(--chart-3);
|
|
85
|
+
--color-chart-2: var(--chart-2);
|
|
86
|
+
--color-chart-1: var(--chart-1);
|
|
87
|
+
--color-ring: var(--ring);
|
|
88
|
+
--color-input: var(--input);
|
|
89
|
+
--color-border: var(--border);
|
|
90
|
+
--color-destructive: var(--destructive);
|
|
91
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
92
|
+
--color-accent: var(--accent);
|
|
93
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
94
|
+
--color-muted: var(--muted);
|
|
95
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
96
|
+
--color-secondary: var(--secondary);
|
|
97
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
98
|
+
--color-primary: var(--primary);
|
|
99
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
100
|
+
--color-popover: var(--popover);
|
|
101
|
+
--color-card-foreground: var(--card-foreground);
|
|
102
|
+
--color-card: var(--card);
|
|
103
|
+
--color-foreground: var(--foreground);
|
|
104
|
+
--color-background: var(--background);
|
|
105
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
106
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
107
|
+
--radius-lg: var(--radius);
|
|
108
|
+
--radius-xl: calc(var(--radius) + 4px);
|
|
109
|
+
--radius-2xl: calc(var(--radius) + 8px);
|
|
110
|
+
--radius-3xl: calc(var(--radius) + 12px);
|
|
111
|
+
--radius-4xl: calc(var(--radius) + 16px);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@layer base {
|
|
115
|
+
* {
|
|
116
|
+
@apply border-border outline-ring/50;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
html,
|
|
120
|
+
body {
|
|
121
|
+
@apply font-sans bg-background text-foreground;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cache-api.d.ts","sourceRoot":"","sources":["../../source/cache-api/cache-api.ts"],"names":[],"mappings":"AAKA,KAAK,OAAO,CAAC,CAAC,SAAS,OAAO,EAAE,EAAE,CAAC,GAAG,OAAO,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAA;AAE3E,qBAAa,QAAQ,CAAC,CAAC,SAAS,OAAO,EAAE,EAAE,CAAC;IAW9B,OAAO,CAAC,IAAI;IATxB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAqB;IAG3C,OAAO,CAAC,QAAQ,CAAe;IAI/B,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAI;gBAEhB,IAAI,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;IAIvC,IACI,OAAO,IAAI,OAAO,CAErB;IAED,IACI,KAAK,IAAI,OAAO,CAEnB;IAED,IACI,KAAK,IAAI,CAAC,GAAG,SAAS,CAEzB;IAGK,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAuBlC;;;OAGG;IAEG,OAAO,CAAC,KAAK,GAAE,OAAe,GAAG,OAAO,CAAC,CAAC,CAAC;IAcjD;;OAEG;IAEG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAK7B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cache-api.test.d.ts","sourceRoot":"","sources":["../../source/cache-api/cache-api.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/cache-api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import * as Headless from '@headlessui/react';
|
|
2
|
-
import type React from 'react';
|
|
3
|
-
import { Text } from './text';
|
|
4
|
-
declare const sizes: {
|
|
5
|
-
xs: string;
|
|
6
|
-
sm: string;
|
|
7
|
-
md: string;
|
|
8
|
-
lg: string;
|
|
9
|
-
xl: string;
|
|
10
|
-
'2xl': string;
|
|
11
|
-
'3xl': string;
|
|
12
|
-
'4xl': string;
|
|
13
|
-
'5xl': string;
|
|
14
|
-
};
|
|
15
|
-
export declare function Alert({ size, className, children, ...props }: {
|
|
16
|
-
size?: keyof typeof sizes;
|
|
17
|
-
className?: string;
|
|
18
|
-
children: React.ReactNode;
|
|
19
|
-
} & Omit<Headless.DialogProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
export declare function AlertTitle({ className, ...props }: {
|
|
21
|
-
className?: string;
|
|
22
|
-
} & Omit<Headless.DialogTitleProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
export declare function AlertDescription({ className, ...props }: {
|
|
24
|
-
className?: string;
|
|
25
|
-
} & Omit<Headless.DescriptionProps<typeof Text>, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
export declare function AlertBody({ className, ...props }: React.ComponentPropsWithoutRef<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
27
|
-
export declare function AlertActions({ className, ...props }: React.ComponentPropsWithoutRef<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
export {};
|
|
29
|
-
//# sourceMappingURL=alert.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../source/catalyst/alert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAE7C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,QAAA,MAAM,KAAK;;;;;;;;;;CAUV,CAAA;AAED,wBAAgB,KAAK,CAAC,EACpB,IAAW,EACX,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,OAAO,KAAK,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,GAAG,IAAI,CACpF,QAAQ,CAAC,WAAW,EACpB,IAAI,GAAG,WAAW,CACnB,2CAyBA;AAED,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,IAAI,GAAG,WAAW,CAAC,2CAU9E;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,OAAO,IAAI,CAAC,EAAE,IAAI,GAAG,WAAW,CAAC,2CAQ3F;AAED,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,2CAEvF;AAED,wBAAgB,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,2CAU1F"}
|
package/output/catalyst/alert.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
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 Headless from '@headlessui/react';
|
|
14
|
-
import clsx from 'clsx';
|
|
15
|
-
import { Text } from './text';
|
|
16
|
-
const sizes = {
|
|
17
|
-
xs: 'sm:max-w-xs',
|
|
18
|
-
sm: 'sm:max-w-sm',
|
|
19
|
-
md: 'sm:max-w-md',
|
|
20
|
-
lg: 'sm:max-w-lg',
|
|
21
|
-
xl: 'sm:max-w-xl',
|
|
22
|
-
'2xl': 'sm:max-w-2xl',
|
|
23
|
-
'3xl': 'sm:max-w-3xl',
|
|
24
|
-
'4xl': 'sm:max-w-4xl',
|
|
25
|
-
'5xl': 'sm:max-w-5xl',
|
|
26
|
-
};
|
|
27
|
-
export function Alert(_a) {
|
|
28
|
-
var { size = 'md', className, children } = _a, props = __rest(_a, ["size", "className", "children"]);
|
|
29
|
-
return (_jsxs(Headless.Dialog, Object.assign({}, props, { children: [_jsx(Headless.DialogBackdrop, { transition: true, className: "fixed inset-0 flex w-screen justify-center overflow-y-auto bg-zinc-950/15 px-2 py-2 transition duration-100 focus:outline-0 data-closed:opacity-0 data-enter:ease-out data-leave:ease-in sm:px-6 sm:py-8 lg:px-8 lg:py-16 dark:bg-zinc-950/50" }), _jsx("div", { className: "fixed inset-0 w-screen overflow-y-auto pt-6 sm:pt-0", children: _jsx("div", { className: "grid min-h-full grid-rows-[1fr_auto_1fr] justify-items-center p-8 sm:grid-rows-[1fr_auto_3fr] sm:p-4", children: _jsx(Headless.DialogPanel, { transition: true, className: clsx(className, sizes[size], 'row-start-2 w-full rounded-2xl bg-white p-8 shadow-lg ring-1 ring-zinc-950/10 sm:rounded-2xl sm:p-6 dark:bg-zinc-900 dark:ring-white/10 forced-colors:outline', 'transition duration-100 will-change-transform data-closed:opacity-0 data-enter:ease-out data-closed:data-enter:scale-95 data-leave:ease-in'), children: children }) }) })] })));
|
|
30
|
-
}
|
|
31
|
-
export function AlertTitle(_a) {
|
|
32
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
33
|
-
return (_jsx(Headless.DialogTitle, Object.assign({}, props, { className: clsx(className, 'text-center text-base/6 font-semibold text-balance text-zinc-950 sm:text-left sm:text-sm/6 sm:text-wrap dark:text-white') })));
|
|
34
|
-
}
|
|
35
|
-
export function AlertDescription(_a) {
|
|
36
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
37
|
-
return (_jsx(Headless.Description, Object.assign({ as: Text }, props, { className: clsx(className, 'mt-2 text-center text-pretty sm:text-left') })));
|
|
38
|
-
}
|
|
39
|
-
export function AlertBody(_a) {
|
|
40
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
41
|
-
return _jsx("div", Object.assign({}, props, { className: clsx(className, 'mt-4') }));
|
|
42
|
-
}
|
|
43
|
-
export function AlertActions(_a) {
|
|
44
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
45
|
-
return (_jsx("div", Object.assign({}, props, { className: clsx(className, 'mt-6 flex flex-col-reverse items-center justify-end gap-3 *:w-full sm:mt-4 sm:flex-row sm:*:w-auto') })));
|
|
46
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth-layout.d.ts","sourceRoot":"","sources":["../../source/catalyst/auth-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CAQrE"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
export function AuthLayout({ children }) {
|
|
3
|
-
return (_jsx("main", { className: "flex min-h-dvh flex-col p-2", children: _jsx("div", { className: "flex grow items-center justify-center p-6 lg:rounded-lg lg:bg-white lg:p-10 lg:shadow-xs lg:ring-1 lg:ring-zinc-950/5 dark:lg:bg-zinc-900 dark:lg:ring-white/10", children: children }) }));
|
|
4
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as Headless from '@headlessui/react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
type AvatarProps = {
|
|
4
|
-
src?: string | null;
|
|
5
|
-
square?: boolean;
|
|
6
|
-
initials?: string;
|
|
7
|
-
alt?: string;
|
|
8
|
-
className?: string;
|
|
9
|
-
};
|
|
10
|
-
export declare function Avatar({ src, square, initials, alt, className, ...props }: AvatarProps & React.ComponentPropsWithoutRef<'span'>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export declare const AvatarButton: React.ForwardRefExoticComponent<(AvatarProps & (Omit<Headless.ButtonProps<"button">, "className" | "as"> | Omit<Omit<{
|
|
12
|
-
href: string;
|
|
13
|
-
as?: React.ElementType;
|
|
14
|
-
} & Omit<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & React.RefAttributes<HTMLAnchorElement>, "ref">, "className">)) & React.RefAttributes<HTMLElement>>;
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=avatar.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../source/catalyst/avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAE7C,OAAO,KAAqB,MAAM,OAAO,CAAA;AAIzC,KAAK,WAAW,GAAG;IACjB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,wBAAgB,MAAM,CAAC,EACrB,GAAU,EACV,MAAc,EACd,QAAQ,EACR,GAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,WAAW,GAAG,KAAK,CAAC,wBAAwB,CAAC,MAAM,CAAC,2CA6BtD;AAED,eAAO,MAAM,YAAY;;;+MA+BvB,CAAA"}
|
|
@@ -1,30 +0,0 @@
|
|
|
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 Headless from '@headlessui/react';
|
|
14
|
-
import clsx from 'clsx';
|
|
15
|
-
import { forwardRef } from 'react';
|
|
16
|
-
import { TouchTarget } from './button';
|
|
17
|
-
import { Link } from './link';
|
|
18
|
-
export function Avatar(_a) {
|
|
19
|
-
var { src = null, square = false, initials, alt = '', className } = _a, props = __rest(_a, ["src", "square", "initials", "alt", "className"]);
|
|
20
|
-
return (_jsxs("span", Object.assign({ "data-slot": "avatar" }, props, { className: clsx(className,
|
|
21
|
-
// Basic layout
|
|
22
|
-
'inline-grid shrink-0 align-middle [--avatar-radius:20%] *:col-start-1 *:row-start-1', 'outline -outline-offset-1 outline-black/10 dark:outline-white/10',
|
|
23
|
-
// Border radius
|
|
24
|
-
square ? 'rounded-(--avatar-radius) *:rounded-(--avatar-radius)' : 'rounded-full *:rounded-full'), children: [initials && (_jsxs("svg", { className: "size-full fill-current p-[5%] text-[48px] font-medium uppercase select-none", viewBox: "0 0 100 100", "aria-hidden": alt ? undefined : 'true', children: [alt && _jsx("title", { children: alt }), _jsx("text", { x: "50%", y: "50%", alignmentBaseline: "middle", dominantBaseline: "middle", textAnchor: "middle", dy: ".125em", children: initials })] })), src && _jsx("img", { className: "size-full", src: src, alt: alt })] })));
|
|
25
|
-
}
|
|
26
|
-
export const AvatarButton = forwardRef(function AvatarButton(_a, ref) {
|
|
27
|
-
var { src, square = false, initials, alt, className } = _a, props = __rest(_a, ["src", "square", "initials", "alt", "className"]);
|
|
28
|
-
let classes = clsx(className, square ? 'rounded-[20%]' : 'rounded-full', 'relative inline-grid focus:not-data-focus:outline-hidden data-focus:outline-2 data-focus:outline-offset-2 data-focus:outline-blue-500');
|
|
29
|
-
return 'href' in props ? (_jsx(Link, Object.assign({}, props, { className: classes, ref: ref, children: _jsx(TouchTarget, { children: _jsx(Avatar, { src: src, square: square, initials: initials, alt: alt }) }) }))) : (_jsx(Headless.Button, Object.assign({}, props, { className: classes, ref: ref, children: _jsx(TouchTarget, { children: _jsx(Avatar, { src: src, square: square, initials: initials, alt: alt }) }) })));
|
|
30
|
-
});
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import * as Headless from '@headlessui/react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
declare const colors: {
|
|
4
|
-
red: string;
|
|
5
|
-
orange: string;
|
|
6
|
-
amber: string;
|
|
7
|
-
yellow: string;
|
|
8
|
-
lime: string;
|
|
9
|
-
green: string;
|
|
10
|
-
emerald: string;
|
|
11
|
-
teal: string;
|
|
12
|
-
cyan: string;
|
|
13
|
-
sky: string;
|
|
14
|
-
blue: string;
|
|
15
|
-
indigo: string;
|
|
16
|
-
violet: string;
|
|
17
|
-
purple: string;
|
|
18
|
-
fuchsia: string;
|
|
19
|
-
pink: string;
|
|
20
|
-
rose: string;
|
|
21
|
-
zinc: string;
|
|
22
|
-
};
|
|
23
|
-
type BadgeProps = {
|
|
24
|
-
color?: keyof typeof colors;
|
|
25
|
-
};
|
|
26
|
-
export declare function Badge({ color, className, ...props }: BadgeProps & React.ComponentPropsWithoutRef<'span'>): import("react/jsx-runtime").JSX.Element;
|
|
27
|
-
export declare const BadgeButton: React.ForwardRefExoticComponent<(BadgeProps & ({
|
|
28
|
-
className?: string;
|
|
29
|
-
children: React.ReactNode;
|
|
30
|
-
} & (Omit<Headless.ButtonProps<"button">, "className" | "as"> | Omit<Omit<{
|
|
31
|
-
href: string;
|
|
32
|
-
as?: React.ElementType;
|
|
33
|
-
} & Omit<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & React.RefAttributes<HTMLAnchorElement>, "ref">, "className">))) & React.RefAttributes<HTMLElement>>;
|
|
34
|
-
export {};
|
|
35
|
-
//# sourceMappingURL=badge.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../source/catalyst/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAE7C,OAAO,KAAqB,MAAM,OAAO,CAAA;AAIzC,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;CA4BX,CAAA;AAED,KAAK,UAAU,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,OAAO,MAAM,CAAA;CAAE,CAAA;AAEjD,wBAAgB,KAAK,CAAC,EAAE,KAAc,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,GAAG,KAAK,CAAC,wBAAwB,CAAC,MAAM,CAAC,2CAWjH;AAED,eAAO,MAAM,WAAW;gBAMQ,MAAM;cAAY,KAAK,CAAC,SAAS;;;;gNAwB/D,CAAA"}
|
package/output/catalyst/badge.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
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 Headless from '@headlessui/react';
|
|
14
|
-
import clsx from 'clsx';
|
|
15
|
-
import { forwardRef } from 'react';
|
|
16
|
-
import { TouchTarget } from './button';
|
|
17
|
-
import { Link } from './link';
|
|
18
|
-
const colors = {
|
|
19
|
-
red: 'bg-red-500/15 text-red-700 group-data-hover:bg-red-500/25 dark:bg-red-500/10 dark:text-red-400 dark:group-data-hover:bg-red-500/20',
|
|
20
|
-
orange: 'bg-orange-500/15 text-orange-700 group-data-hover:bg-orange-500/25 dark:bg-orange-500/10 dark:text-orange-400 dark:group-data-hover:bg-orange-500/20',
|
|
21
|
-
amber: 'bg-amber-400/20 text-amber-700 group-data-hover:bg-amber-400/30 dark:bg-amber-400/10 dark:text-amber-400 dark:group-data-hover:bg-amber-400/15',
|
|
22
|
-
yellow: 'bg-yellow-400/20 text-yellow-700 group-data-hover:bg-yellow-400/30 dark:bg-yellow-400/10 dark:text-yellow-300 dark:group-data-hover:bg-yellow-400/15',
|
|
23
|
-
lime: 'bg-lime-400/20 text-lime-700 group-data-hover:bg-lime-400/30 dark:bg-lime-400/10 dark:text-lime-300 dark:group-data-hover:bg-lime-400/15',
|
|
24
|
-
green: 'bg-green-500/15 text-green-700 group-data-hover:bg-green-500/25 dark:bg-green-500/10 dark:text-green-400 dark:group-data-hover:bg-green-500/20',
|
|
25
|
-
emerald: 'bg-emerald-500/15 text-emerald-700 group-data-hover:bg-emerald-500/25 dark:bg-emerald-500/10 dark:text-emerald-400 dark:group-data-hover:bg-emerald-500/20',
|
|
26
|
-
teal: 'bg-teal-500/15 text-teal-700 group-data-hover:bg-teal-500/25 dark:bg-teal-500/10 dark:text-teal-300 dark:group-data-hover:bg-teal-500/20',
|
|
27
|
-
cyan: 'bg-cyan-400/20 text-cyan-700 group-data-hover:bg-cyan-400/30 dark:bg-cyan-400/10 dark:text-cyan-300 dark:group-data-hover:bg-cyan-400/15',
|
|
28
|
-
sky: 'bg-sky-500/15 text-sky-700 group-data-hover:bg-sky-500/25 dark:bg-sky-500/10 dark:text-sky-300 dark:group-data-hover:bg-sky-500/20',
|
|
29
|
-
blue: 'bg-blue-500/15 text-blue-700 group-data-hover:bg-blue-500/25 dark:text-blue-400 dark:group-data-hover:bg-blue-500/25',
|
|
30
|
-
indigo: 'bg-indigo-500/15 text-indigo-700 group-data-hover:bg-indigo-500/25 dark:text-indigo-400 dark:group-data-hover:bg-indigo-500/20',
|
|
31
|
-
violet: 'bg-violet-500/15 text-violet-700 group-data-hover:bg-violet-500/25 dark:text-violet-400 dark:group-data-hover:bg-violet-500/20',
|
|
32
|
-
purple: 'bg-purple-500/15 text-purple-700 group-data-hover:bg-purple-500/25 dark:text-purple-400 dark:group-data-hover:bg-purple-500/20',
|
|
33
|
-
fuchsia: 'bg-fuchsia-400/15 text-fuchsia-700 group-data-hover:bg-fuchsia-400/25 dark:bg-fuchsia-400/10 dark:text-fuchsia-400 dark:group-data-hover:bg-fuchsia-400/20',
|
|
34
|
-
pink: 'bg-pink-400/15 text-pink-700 group-data-hover:bg-pink-400/25 dark:bg-pink-400/10 dark:text-pink-400 dark:group-data-hover:bg-pink-400/20',
|
|
35
|
-
rose: 'bg-rose-400/15 text-rose-700 group-data-hover:bg-rose-400/25 dark:bg-rose-400/10 dark:text-rose-400 dark:group-data-hover:bg-rose-400/20',
|
|
36
|
-
zinc: 'bg-zinc-600/10 text-zinc-700 group-data-hover:bg-zinc-600/20 dark:bg-white/5 dark:text-zinc-400 dark:group-data-hover:bg-white/10',
|
|
37
|
-
};
|
|
38
|
-
export function Badge(_a) {
|
|
39
|
-
var { color = 'zinc', className } = _a, props = __rest(_a, ["color", "className"]);
|
|
40
|
-
return (_jsx("span", Object.assign({}, props, { className: clsx(className, 'inline-flex items-center gap-x-1.5 rounded-md px-1.5 py-0.5 text-sm/5 font-medium sm:text-xs/5 forced-colors:outline', colors[color]) })));
|
|
41
|
-
}
|
|
42
|
-
export const BadgeButton = forwardRef(function BadgeButton(_a, ref) {
|
|
43
|
-
var { color = 'zinc', className, children } = _a, props = __rest(_a, ["color", "className", "children"]);
|
|
44
|
-
let classes = clsx(className, 'group relative inline-flex rounded-md focus:not-data-focus:outline-hidden data-focus:outline-2 data-focus:outline-offset-2 data-focus:outline-blue-500');
|
|
45
|
-
return 'href' in props ? (_jsx(Link, Object.assign({}, props, { className: classes, ref: ref, children: _jsx(TouchTarget, { children: _jsx(Badge, { color: color, children: children }) }) }))) : (_jsx(Headless.Button, Object.assign({}, props, { className: classes, ref: ref, children: _jsx(TouchTarget, { children: _jsx(Badge, { color: color, children: children }) }) })));
|
|
46
|
-
});
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import * as Headless from '@headlessui/react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Link } from './link';
|
|
4
|
-
declare const styles: {
|
|
5
|
-
base: string[];
|
|
6
|
-
solid: string[];
|
|
7
|
-
outline: string[];
|
|
8
|
-
plain: string[];
|
|
9
|
-
colors: {
|
|
10
|
-
'dark/zinc': string[];
|
|
11
|
-
light: string[];
|
|
12
|
-
'dark/white': string[];
|
|
13
|
-
dark: string[];
|
|
14
|
-
white: string[];
|
|
15
|
-
zinc: string[];
|
|
16
|
-
indigo: string[];
|
|
17
|
-
cyan: string[];
|
|
18
|
-
red: string[];
|
|
19
|
-
orange: string[];
|
|
20
|
-
amber: string[];
|
|
21
|
-
yellow: string[];
|
|
22
|
-
lime: string[];
|
|
23
|
-
green: string[];
|
|
24
|
-
emerald: string[];
|
|
25
|
-
teal: string[];
|
|
26
|
-
sky: string[];
|
|
27
|
-
blue: string[];
|
|
28
|
-
violet: string[];
|
|
29
|
-
purple: string[];
|
|
30
|
-
fuchsia: string[];
|
|
31
|
-
pink: string[];
|
|
32
|
-
rose: string[];
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
export type ButtonProps = ({
|
|
36
|
-
color?: keyof typeof styles.colors;
|
|
37
|
-
outline?: never;
|
|
38
|
-
plain?: never;
|
|
39
|
-
} | {
|
|
40
|
-
color?: never;
|
|
41
|
-
outline: true;
|
|
42
|
-
plain?: never;
|
|
43
|
-
} | {
|
|
44
|
-
color?: never;
|
|
45
|
-
outline?: never;
|
|
46
|
-
plain: true;
|
|
47
|
-
}) & {
|
|
48
|
-
className?: string;
|
|
49
|
-
children: React.ReactNode;
|
|
50
|
-
} & (Omit<Headless.ButtonProps, 'as' | 'className'> | Omit<React.ComponentPropsWithoutRef<typeof Link>, 'className'>);
|
|
51
|
-
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLElement>>;
|
|
52
|
-
/**
|
|
53
|
-
* Expand the hit area to at least 44×44px on touch devices
|
|
54
|
-
*/
|
|
55
|
-
export declare function TouchTarget({ children }: {
|
|
56
|
-
children: React.ReactNode;
|
|
57
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
58
|
-
export {};
|
|
59
|
-
//# sourceMappingURL=button.d.ts.map
|