@yimingliao/cms 0.0.136 → 0.0.138
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/export/client/index.js +47 -27
- package/dist/export/client/shadcn/index.js +2 -0
- package/dist/src/client/interfaces/components/shadcn/badge.js +37 -0
- package/dist/src/client/interfaces/components/shadcn/dialog.js +132 -0
- package/dist/src/client/interfaces/components/shadcn/sheet.js +10 -10
- package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/list-cards-container.js +3 -2
- package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/page-size-selector.js +2 -1
- package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/pagination.js +3 -2
- package/dist/src/client/interfaces/components/ui/blocks/page-header/page-header.js +2 -1
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/batch-create.js +2 -1
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/create.js +2 -1
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/edit.js +2 -1
- package/dist/src/client/interfaces/components/ui/buttons/button.js +3 -2
- package/dist/src/client/interfaces/components/ui/cards/action-buttons-card.js +82 -0
- package/dist/src/client/interfaces/components/ui/cards/resource-card/card-status-bar.js +51 -0
- package/dist/src/client/interfaces/components/ui/cards/resource-card/card-text-content.js +38 -0
- package/dist/src/client/interfaces/components/ui/cards/resource-card/resource-card.js +77 -0
- package/dist/src/client/interfaces/components/ui/display/array-list.js +69 -0
- package/dist/src/client/interfaces/components/ui/display/badge.js +41 -0
- package/dist/src/client/interfaces/components/ui/display/html-display.js +32 -0
- package/dist/src/client/interfaces/components/ui/display/object-array-list.js +75 -0
- package/dist/src/client/interfaces/components/ui/features/accordion/accordion-container.js +31 -0
- package/dist/src/client/interfaces/components/ui/features/accordion/accordion-header.js +34 -0
- package/dist/src/client/interfaces/components/ui/features/accordion/accordion.js +81 -0
- package/dist/src/client/interfaces/components/ui/features/expandable-list/expand-bar.js +2 -1
- package/dist/src/client/interfaces/components/ui/features/external-link.js +15 -0
- package/dist/src/client/interfaces/components/ui/features/file/file-picker/file-picker-container.js +74 -0
- package/dist/src/client/interfaces/components/ui/features/file/file-picker/file-picker-placeholder.js +48 -0
- package/dist/src/client/interfaces/components/ui/features/file/file-picker/file-picker.js +109 -0
- package/dist/src/client/interfaces/components/ui/features/file/file-preview/file-preview-list.js +85 -0
- package/dist/src/client/interfaces/components/ui/features/file/file-preview/file-preview-meta.js +40 -0
- package/dist/src/client/interfaces/components/ui/features/file/file-preview/file-preview.js +113 -0
- package/dist/src/client/interfaces/components/ui/features/file/uploader.js +101 -0
- package/dist/src/client/interfaces/components/ui/features/pick-modal/pick-modal-body.js +112 -0
- package/dist/src/client/interfaces/components/ui/features/pick-modal/pick-modal-trigger.js +97 -0
- package/dist/src/client/interfaces/components/ui/features/pick-modal/pick-modal.js +77 -0
- package/dist/src/client/interfaces/components/ui/features/smart-image.js +60 -0
- package/dist/src/client/interfaces/components/ui/features/tick.js +27 -0
- package/dist/src/client/interfaces/components/ui/form/control-fields/control-fields-display.js +2 -1
- package/dist/src/client/interfaces/components/ui/form/control-fields/control-fields-input.js +2 -1
- package/dist/src/client/interfaces/components/ui/form/control-fields/control-fields.js +3 -2
- package/dist/src/client/interfaces/components/ui/form/field-body.js +3 -2
- package/dist/src/client/interfaces/components/ui/form/field.js +2 -1
- package/dist/src/client/interfaces/components/ui/form/index-field.js +2 -1
- package/dist/src/client/interfaces/components/ui/form/slug-field.js +2 -1
- package/dist/src/client/interfaces/components/ui/inputs/array-input.js +2 -1
- package/dist/src/client/interfaces/components/ui/inputs/checkbox.js +3 -2
- package/dist/src/client/interfaces/components/ui/inputs/input.js +3 -2
- package/dist/src/client/interfaces/components/ui/inputs/password-input.js +2 -1
- package/dist/src/client/interfaces/components/ui/inputs/search-input.js +2 -1
- package/dist/src/client/interfaces/components/ui/inputs/select.js +3 -2
- package/dist/src/client/interfaces/components/ui/inputs/textarea.js +3 -2
- package/dist/src/client/interfaces/components/ui/layouts/auth-skeleton.js +3 -2
- package/dist/src/client/interfaces/components/ui/layouts/dashboard-skeleton.js +3 -2
- package/dist/src/client/interfaces/components/ui/layouts/navbar/i18n-selector.js +2 -1
- package/dist/src/client/interfaces/components/ui/layouts/navbar/nav-user.js +2 -1
- package/dist/src/client/interfaces/components/ui/layouts/navbar/navbar.js +5 -4
- package/dist/src/client/interfaces/components/ui/layouts/navbar/sign-out-button.js +5 -4
- package/dist/src/client/interfaces/components/ui/layouts/navbar/theme-selector.js +2 -1
- package/dist/src/client/interfaces/components/ui/layouts/sidebar/nav-main.js +2 -1
- package/dist/src/client/interfaces/pages/auth/change-password/page.js +11 -8
- package/dist/src/client/interfaces/pages/auth/email-unverified/page.js +9 -6
- package/dist/src/client/interfaces/pages/auth/forgot-password/page.js +11 -8
- package/dist/src/client/interfaces/pages/auth/layout.js +9 -6
- package/dist/src/client/interfaces/pages/auth/reset-password/page.js +11 -8
- package/dist/src/client/interfaces/pages/auth/sign-in/page.js +9 -6
- package/dist/src/client/interfaces/pages/auth/verify-email/page.js +3 -2
- package/dist/src/client/interfaces/pages/dashboard/layout.js +9 -6
- package/dist/src/constants/file.js +27 -0
- package/dist/src/server/infrastructure/zod/schemas/schemas.js +1 -1
- package/dist/src/server/interfaces/actions/resources/post/commands/create/post-create-validator.js +1 -1
- package/dist/src/server/interfaces/actions/resources/post/commands/update/post-update-validator.js +1 -1
- package/dist/types/export/client/index.d.ts +1 -1
- package/dist/types/export/client/index.d.ts.map +1 -1
- package/dist/types/src/client/index.d.ts +1 -1
- package/dist/types/src/client/index.d.ts.map +1 -1
- package/dist/types/src/client/infrastructure/index.d.ts +3 -2
- package/dist/types/src/client/infrastructure/index.d.ts.map +1 -1
- package/dist/types/src/client/infrastructure/internal-api/file-upload-api.d.ts +5 -0
- package/dist/types/src/client/infrastructure/internal-api/file-upload-api.d.ts.map +1 -0
- package/dist/types/src/client/infrastructure/internal-api/index.d.ts +3 -0
- package/dist/types/src/client/infrastructure/internal-api/index.d.ts.map +1 -0
- package/dist/types/src/client/infrastructure/internal-api/multi-files-upload-api.d.ts +5 -0
- package/dist/types/src/client/infrastructure/internal-api/multi-files-upload-api.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/index.d.ts +1 -1
- package/dist/types/src/client/interfaces/components/index.d.ts.map +1 -1
- package/dist/types/src/client/interfaces/components/shadcn/badge.d.ts +11 -0
- package/dist/types/src/client/interfaces/components/shadcn/badge.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/shadcn/button.d.ts +1 -1
- package/dist/types/src/client/interfaces/components/shadcn/dialog.d.ts +16 -0
- package/dist/types/src/client/interfaces/components/shadcn/dialog.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/shadcn/index.d.ts +2 -0
- package/dist/types/src/client/interfaces/components/shadcn/index.d.ts.map +1 -1
- package/dist/types/src/client/interfaces/components/shadcn/input-group.d.ts +1 -1
- package/dist/types/src/client/interfaces/components/ui/cards/action-buttons-card.d.ts +11 -0
- package/dist/types/src/client/interfaces/components/ui/cards/action-buttons-card.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/cards/index.d.ts +3 -0
- package/dist/types/src/client/interfaces/components/ui/cards/index.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/cards/resource-card/card-status-bar.d.ts +8 -0
- package/dist/types/src/client/interfaces/components/ui/cards/resource-card/card-status-bar.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/cards/resource-card/card-text-content.d.ts +7 -0
- package/dist/types/src/client/interfaces/components/ui/cards/resource-card/card-text-content.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/cards/resource-card/index.d.ts +2 -0
- package/dist/types/src/client/interfaces/components/ui/cards/resource-card/index.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/cards/resource-card/resource-card.d.ts +15 -0
- package/dist/types/src/client/interfaces/components/ui/cards/resource-card/resource-card.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/display/array-list.d.ts +8 -0
- package/dist/types/src/client/interfaces/components/ui/display/array-list.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/display/badge.d.ts +5 -0
- package/dist/types/src/client/interfaces/components/ui/display/badge.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/display/html-display.d.ts +8 -0
- package/dist/types/src/client/interfaces/components/ui/display/html-display.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/display/index.d.ts +5 -0
- package/dist/types/src/client/interfaces/components/ui/display/index.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/display/object-array-list.d.ts +13 -0
- package/dist/types/src/client/interfaces/components/ui/display/object-array-list.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/features/accordion/accordion-container.d.ts +3 -0
- package/dist/types/src/client/interfaces/components/ui/features/accordion/accordion-container.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/features/accordion/accordion-header.d.ts +8 -0
- package/dist/types/src/client/interfaces/components/ui/features/accordion/accordion-header.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/features/accordion/accordion.d.ts +13 -0
- package/dist/types/src/client/interfaces/components/ui/features/accordion/accordion.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/features/accordion/index.d.ts +3 -0
- package/dist/types/src/client/interfaces/components/ui/features/accordion/index.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/features/external-link.d.ts +4 -0
- package/dist/types/src/client/interfaces/components/ui/features/external-link.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/features/file/file-info/file-info.d.ts +12 -0
- package/dist/types/src/client/interfaces/components/ui/features/file/file-info/file-info.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/features/file/file-info/file-name.d.ts +4 -0
- package/dist/types/src/client/interfaces/components/ui/features/file/file-info/file-name.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/features/file/file-info/index.d.ts +2 -0
- package/dist/types/src/client/interfaces/components/ui/features/file/file-info/index.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/features/file/file-picker/file-picker-container.d.ts +13 -0
- package/dist/types/src/client/interfaces/components/ui/features/file/file-picker/file-picker-container.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/features/file/file-picker/file-picker-placeholder.d.ts +2 -0
- package/dist/types/src/client/interfaces/components/ui/features/file/file-picker/file-picker-placeholder.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/features/file/file-picker/file-picker.d.ts +15 -0
- package/dist/types/src/client/interfaces/components/ui/features/file/file-picker/file-picker.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/features/file/file-picker/index.d.ts +2 -0
- package/dist/types/src/client/interfaces/components/ui/features/file/file-picker/index.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/features/file/file-preview/file-preview-list.d.ts +11 -0
- package/dist/types/src/client/interfaces/components/ui/features/file/file-preview/file-preview-list.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/features/file/file-preview/file-preview-meta.d.ts +6 -0
- package/dist/types/src/client/interfaces/components/ui/features/file/file-preview/file-preview-meta.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/features/file/file-preview/file-preview.d.ts +13 -0
- package/dist/types/src/client/interfaces/components/ui/features/file/file-preview/file-preview.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/features/file/file-preview/index.d.ts +3 -0
- package/dist/types/src/client/interfaces/components/ui/features/file/file-preview/index.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/features/file/index.d.ts +4 -0
- package/dist/types/src/client/interfaces/components/ui/features/file/index.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/features/file/uploader.d.ts +19 -0
- package/dist/types/src/client/interfaces/components/ui/features/file/uploader.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/features/index.d.ts +6 -0
- package/dist/types/src/client/interfaces/components/ui/features/index.d.ts.map +1 -1
- package/dist/types/src/client/interfaces/components/ui/features/pick-modal/index.d.ts +2 -0
- package/dist/types/src/client/interfaces/components/ui/features/pick-modal/index.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/features/pick-modal/pick-modal-body.d.ts +15 -0
- package/dist/types/src/client/interfaces/components/ui/features/pick-modal/pick-modal-body.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/features/pick-modal/pick-modal-trigger.d.ts +12 -0
- package/dist/types/src/client/interfaces/components/ui/features/pick-modal/pick-modal-trigger.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/features/pick-modal/pick-modal.d.ts +14 -0
- package/dist/types/src/client/interfaces/components/ui/features/pick-modal/pick-modal.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/features/smart-image.d.ts +15 -0
- package/dist/types/src/client/interfaces/components/ui/features/smart-image.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/features/tick.d.ts +8 -0
- package/dist/types/src/client/interfaces/components/ui/features/tick.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/ui/index.d.ts +5 -2
- package/dist/types/src/client/interfaces/components/ui/index.d.ts.map +1 -1
- package/dist/types/src/client/interfaces/index.d.ts +1 -1
- package/dist/types/src/client/interfaces/index.d.ts.map +1 -1
- package/dist/types/src/client/interfaces/pages/auth/layout.d.ts +1 -1
- package/dist/types/src/constants/file.d.ts +3 -0
- package/dist/types/src/constants/file.d.ts.map +1 -0
- package/dist/types/src/constants/index.d.ts +1 -0
- package/dist/types/src/constants/index.d.ts.map +1 -1
- package/dist/types/src/server/infrastructure/zod/schemas/schemas.d.ts +1 -1
- package/dist/types/src/server/interfaces/actions/resources/admin/commands/create/admin-create-validator.d.ts +2 -2
- package/dist/types/src/server/interfaces/actions/resources/admin/commands/update/admin-update-validator.d.ts +2 -2
- package/dist/types/src/server/interfaces/actions/resources/post/commands/create/post-create-validator.d.ts +1 -1
- package/dist/types/src/server/interfaces/actions/resources/post/commands/update/post-update-validator.d.ts +1 -1
- package/dist/types/src/server/interfaces/actions/resources/seo-metadata/commands/upsert/seo-metadata-upsert-validator.d.ts +8 -8
- package/dist/types/src/shared/index.d.ts +1 -0
- package/dist/types/src/shared/index.d.ts.map +1 -1
- package/dist/types/src/shared/list-items.d.ts +9 -0
- package/dist/types/src/shared/list-items.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import 'react';
|
|
3
|
+
import 'ua-parser-js';
|
|
4
|
+
import { cn } from '../../../../../applications/shadcn/utils.js';
|
|
5
|
+
import 'next/navigation';
|
|
6
|
+
import 'next/link';
|
|
7
|
+
import '../../../../../../constants/paths/auth.js';
|
|
8
|
+
import '../../../../../../constants/paths/main.js';
|
|
9
|
+
import '../../../../../../constants/paths/resources.js';
|
|
10
|
+
import '../../../../../../constants/redirect-paths.js';
|
|
11
|
+
import '@radix-ui/react-avatar';
|
|
12
|
+
import '../../../shadcn/badge.js';
|
|
13
|
+
import '../../../shadcn/button.js';
|
|
14
|
+
import '@radix-ui/react-collapsible';
|
|
15
|
+
import '@radix-ui/react-dialog';
|
|
16
|
+
import 'lucide-react';
|
|
17
|
+
import '@radix-ui/react-dropdown-menu';
|
|
18
|
+
import '../../../shadcn/input-group.js';
|
|
19
|
+
import '@radix-ui/react-label';
|
|
20
|
+
import '@radix-ui/react-select';
|
|
21
|
+
import '@radix-ui/react-separator';
|
|
22
|
+
import '../../../shadcn/sidebar.js';
|
|
23
|
+
import '@radix-ui/react-tooltip';
|
|
24
|
+
import 'intor/react';
|
|
25
|
+
import 'mime-types';
|
|
26
|
+
import { Badge } from '../../display/badge.js';
|
|
27
|
+
|
|
28
|
+
function CardStatusBar({
|
|
29
|
+
badge,
|
|
30
|
+
className,
|
|
31
|
+
children
|
|
32
|
+
}) {
|
|
33
|
+
return /* @__PURE__ */ jsx("div", { className: cn("h-10", "relative z-10", "bg-background"), children: /* @__PURE__ */ jsxs(
|
|
34
|
+
"div",
|
|
35
|
+
{
|
|
36
|
+
className: cn(
|
|
37
|
+
className,
|
|
38
|
+
"size-full",
|
|
39
|
+
"flex items-center gap-1",
|
|
40
|
+
"px-4 py-1",
|
|
41
|
+
"bg-background group-hover:bg-accent/50 transition"
|
|
42
|
+
),
|
|
43
|
+
children: [
|
|
44
|
+
children,
|
|
45
|
+
badge && /* @__PURE__ */ jsx("div", { className: "absolute top-[50%] left-[50%] translate-x-[-50%] translate-y-[-50%]", children: /* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "h-6 w-20", children: badge }) })
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
) });
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export { CardStatusBar };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import 'react';
|
|
3
|
+
import 'ua-parser-js';
|
|
4
|
+
import { cn } from '../../../../../applications/shadcn/utils.js';
|
|
5
|
+
import 'next/navigation';
|
|
6
|
+
import '@radix-ui/react-avatar';
|
|
7
|
+
import '../../../shadcn/badge.js';
|
|
8
|
+
import '../../../shadcn/button.js';
|
|
9
|
+
import '@radix-ui/react-collapsible';
|
|
10
|
+
import '@radix-ui/react-dialog';
|
|
11
|
+
import 'lucide-react';
|
|
12
|
+
import '@radix-ui/react-dropdown-menu';
|
|
13
|
+
import '../../../shadcn/input-group.js';
|
|
14
|
+
import '@radix-ui/react-label';
|
|
15
|
+
import '@radix-ui/react-select';
|
|
16
|
+
import { Separator } from '../../../shadcn/separator.js';
|
|
17
|
+
import '../../../shadcn/sidebar.js';
|
|
18
|
+
import '@radix-ui/react-tooltip';
|
|
19
|
+
|
|
20
|
+
function CardTextContent({ title, children }) {
|
|
21
|
+
return /* @__PURE__ */ jsx("div", { className: cn("relative z-10 h-fit", "mt-auto", "bg-background"), children: /* @__PURE__ */ jsxs(
|
|
22
|
+
"div",
|
|
23
|
+
{
|
|
24
|
+
className: cn(
|
|
25
|
+
"flex flex-col",
|
|
26
|
+
"bg-background group-hover:bg-accent/50 transition"
|
|
27
|
+
),
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ jsx(Separator, {}),
|
|
30
|
+
/* @__PURE__ */ jsx("div", { className: cn("h-10", "px-4", "flex items-center"), children: /* @__PURE__ */ jsx("p", { className: "truncate", children: title }) }),
|
|
31
|
+
children && /* @__PURE__ */ jsx(Separator, {}),
|
|
32
|
+
children && /* @__PURE__ */ jsx("div", { className: cn("px-4 py-2", "text-sm"), children })
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
) });
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { CardTextContent };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import Link from 'next/link';
|
|
3
|
+
import '../../../../../../constants/paths/auth.js';
|
|
4
|
+
import '../../../../../../constants/paths/main.js';
|
|
5
|
+
import '../../../../../../constants/paths/resources.js';
|
|
6
|
+
import { NEW_TAB_REL, NEW_TAB_TARGET } from '../../../../../../constants/anchor.js';
|
|
7
|
+
import '../../../../../../constants/redirect-paths.js';
|
|
8
|
+
import 'react';
|
|
9
|
+
import 'ua-parser-js';
|
|
10
|
+
import { cn } from '../../../../../applications/shadcn/utils.js';
|
|
11
|
+
import 'next/navigation';
|
|
12
|
+
import '@radix-ui/react-avatar';
|
|
13
|
+
import '../../../shadcn/badge.js';
|
|
14
|
+
import '../../../shadcn/button.js';
|
|
15
|
+
import { Card } from '../../../shadcn/card.js';
|
|
16
|
+
import '@radix-ui/react-collapsible';
|
|
17
|
+
import '@radix-ui/react-dialog';
|
|
18
|
+
import 'lucide-react';
|
|
19
|
+
import '@radix-ui/react-dropdown-menu';
|
|
20
|
+
import '../../../shadcn/input-group.js';
|
|
21
|
+
import '@radix-ui/react-label';
|
|
22
|
+
import '@radix-ui/react-select';
|
|
23
|
+
import { Separator } from '../../../shadcn/separator.js';
|
|
24
|
+
import '../../../shadcn/sidebar.js';
|
|
25
|
+
import '@radix-ui/react-tooltip';
|
|
26
|
+
import { CardStatusBar } from './card-status-bar.js';
|
|
27
|
+
import { CardTextContent } from './card-text-content.js';
|
|
28
|
+
|
|
29
|
+
function ResourceCard({
|
|
30
|
+
// link
|
|
31
|
+
href = "",
|
|
32
|
+
openNewTab = false,
|
|
33
|
+
anchorProps,
|
|
34
|
+
// card
|
|
35
|
+
cardStatusBarProps,
|
|
36
|
+
cardTextContentProps,
|
|
37
|
+
// base
|
|
38
|
+
className = "",
|
|
39
|
+
style,
|
|
40
|
+
children
|
|
41
|
+
}) {
|
|
42
|
+
return /* @__PURE__ */ jsx(
|
|
43
|
+
Link,
|
|
44
|
+
{
|
|
45
|
+
href: href ?? "",
|
|
46
|
+
target: openNewTab ? NEW_TAB_TARGET : void 0,
|
|
47
|
+
rel: openNewTab ? NEW_TAB_REL : void 0,
|
|
48
|
+
onClick: (e) => e.stopPropagation(),
|
|
49
|
+
...anchorProps,
|
|
50
|
+
children: /* @__PURE__ */ jsxs(
|
|
51
|
+
Card,
|
|
52
|
+
{
|
|
53
|
+
className: cn(
|
|
54
|
+
"gap-0 p-0",
|
|
55
|
+
// reset
|
|
56
|
+
"group",
|
|
57
|
+
"hover:bg-accent/50 transition-colors duration-100",
|
|
58
|
+
// button-hover like
|
|
59
|
+
"relative size-full",
|
|
60
|
+
"flex flex-col",
|
|
61
|
+
"overflow-hidden",
|
|
62
|
+
className
|
|
63
|
+
),
|
|
64
|
+
style,
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ jsx(CardStatusBar, { ...cardStatusBarProps }),
|
|
67
|
+
children,
|
|
68
|
+
children && /* @__PURE__ */ jsx(Separator, {}),
|
|
69
|
+
/* @__PURE__ */ jsx(CardTextContent, { ...cardTextContentProps })
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export { ResourceCard };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import Link from 'next/link';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
import '../../../../../constants/paths/auth.js';
|
|
6
|
+
import '../../../../../constants/paths/main.js';
|
|
7
|
+
import '../../../../../constants/paths/resources.js';
|
|
8
|
+
import { NEW_TAB_REL, NEW_TAB_TARGET } from '../../../../../constants/anchor.js';
|
|
9
|
+
import '../../../../../constants/redirect-paths.js';
|
|
10
|
+
import 'ua-parser-js';
|
|
11
|
+
import { cn } from '../../../../applications/shadcn/utils.js';
|
|
12
|
+
import 'next/navigation';
|
|
13
|
+
import '@radix-ui/react-avatar';
|
|
14
|
+
import '../../shadcn/badge.js';
|
|
15
|
+
import '../../shadcn/button.js';
|
|
16
|
+
import '@radix-ui/react-collapsible';
|
|
17
|
+
import '@radix-ui/react-dialog';
|
|
18
|
+
import 'lucide-react';
|
|
19
|
+
import '@radix-ui/react-dropdown-menu';
|
|
20
|
+
import '../../shadcn/input-group.js';
|
|
21
|
+
import '@radix-ui/react-label';
|
|
22
|
+
import '@radix-ui/react-select';
|
|
23
|
+
import { Separator } from '../../shadcn/separator.js';
|
|
24
|
+
import '../../shadcn/sidebar.js';
|
|
25
|
+
import '@radix-ui/react-tooltip';
|
|
26
|
+
import { FieldBody } from '../form/field-body.js';
|
|
27
|
+
import 'mime-types';
|
|
28
|
+
import 'intor/react';
|
|
29
|
+
|
|
30
|
+
function ArrayList({ values, isLink, isLoading }) {
|
|
31
|
+
const [expandedIndex, setExpandedIndex] = useState(null);
|
|
32
|
+
const toggle = (i) => setExpandedIndex((p) => p === i ? null : i);
|
|
33
|
+
const items = values?.filter((v) => typeof v === "string") ?? [];
|
|
34
|
+
if (items.length === 0) return /* @__PURE__ */ jsx(FieldBody, { isEmpty: true });
|
|
35
|
+
return /* @__PURE__ */ jsx(Fragment, { children: items.map((value, index) => {
|
|
36
|
+
const expanded = expandedIndex === index;
|
|
37
|
+
return /* @__PURE__ */ jsxs(
|
|
38
|
+
FieldBody,
|
|
39
|
+
{
|
|
40
|
+
isLoading,
|
|
41
|
+
className: cn(expanded ? "cursor-zoom-out" : "cursor-zoom-in"),
|
|
42
|
+
onClick: () => toggle(index),
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-center absolute top-0 left-0 z-10 h-full", children: [
|
|
45
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-10 px-2 text-center text-sm opacity-50", children: index + 1 }),
|
|
46
|
+
/* @__PURE__ */ jsx(Separator, { orientation: "vertical", className: "py-2" })
|
|
47
|
+
] }),
|
|
48
|
+
isLink ? /* @__PURE__ */ jsx(
|
|
49
|
+
Link,
|
|
50
|
+
{
|
|
51
|
+
href: value,
|
|
52
|
+
target: NEW_TAB_TARGET,
|
|
53
|
+
rel: NEW_TAB_REL,
|
|
54
|
+
className: cn(
|
|
55
|
+
"ml-11 text-blue-500/80 underline underline-offset-2",
|
|
56
|
+
!expanded && "line-clamp-1"
|
|
57
|
+
),
|
|
58
|
+
onClick: (e) => e.stopPropagation(),
|
|
59
|
+
children: value
|
|
60
|
+
}
|
|
61
|
+
) : /* @__PURE__ */ jsx("p", { className: cn("ml-11", !expanded && "line-clamp-1"), children: value })
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
`${value}-${index}`
|
|
65
|
+
);
|
|
66
|
+
}) });
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export { ArrayList };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import 'react';
|
|
3
|
+
import 'ua-parser-js';
|
|
4
|
+
import { cn } from '../../../../applications/shadcn/utils.js';
|
|
5
|
+
import 'next/navigation';
|
|
6
|
+
import '@radix-ui/react-avatar';
|
|
7
|
+
import { Badge as Badge$1 } from '../../shadcn/badge.js';
|
|
8
|
+
import '../../shadcn/button.js';
|
|
9
|
+
import '@radix-ui/react-collapsible';
|
|
10
|
+
import '@radix-ui/react-dialog';
|
|
11
|
+
import 'lucide-react';
|
|
12
|
+
import '@radix-ui/react-dropdown-menu';
|
|
13
|
+
import '../../shadcn/input-group.js';
|
|
14
|
+
import '@radix-ui/react-label';
|
|
15
|
+
import '@radix-ui/react-select';
|
|
16
|
+
import '@radix-ui/react-separator';
|
|
17
|
+
import '../../shadcn/sidebar.js';
|
|
18
|
+
import { Spinner } from '../../shadcn/spinner.js';
|
|
19
|
+
import '@radix-ui/react-tooltip';
|
|
20
|
+
|
|
21
|
+
function Badge({
|
|
22
|
+
// Processing States
|
|
23
|
+
isLoading = false,
|
|
24
|
+
// Base
|
|
25
|
+
variant = "secondary",
|
|
26
|
+
className,
|
|
27
|
+
children,
|
|
28
|
+
...props
|
|
29
|
+
}) {
|
|
30
|
+
return /* @__PURE__ */ jsx(
|
|
31
|
+
Badge$1,
|
|
32
|
+
{
|
|
33
|
+
variant,
|
|
34
|
+
className: cn("h-6 w-20", className),
|
|
35
|
+
...props,
|
|
36
|
+
children: /* @__PURE__ */ jsx("span", { className: "truncate", children: isLoading ? /* @__PURE__ */ jsx(Spinner, {}) : children })
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export { Badge };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import 'react';
|
|
3
|
+
import 'ua-parser-js';
|
|
4
|
+
import { cn } from '../../../../applications/shadcn/utils.js';
|
|
5
|
+
import 'next/navigation';
|
|
6
|
+
|
|
7
|
+
function HtmlDisplay({
|
|
8
|
+
html = "",
|
|
9
|
+
textOnly,
|
|
10
|
+
className = "",
|
|
11
|
+
...props
|
|
12
|
+
}) {
|
|
13
|
+
const content = textOnly ? normalizeHtmlText(html) : html ?? "";
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
className: cn(
|
|
18
|
+
className,
|
|
19
|
+
"ck ck-content"
|
|
20
|
+
// CKEditor styles prefix: .ck (ckeditor.css)
|
|
21
|
+
),
|
|
22
|
+
dangerouslySetInnerHTML: { __html: content },
|
|
23
|
+
...props
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
function normalizeHtmlText(html) {
|
|
28
|
+
if (!html) return "";
|
|
29
|
+
return html.replace(/<br\s*\/?>/gi, " ").replace(/<[^>]+>/g, "").replace(/\r?\n|\r/g, " ").replace(/\s{2,}/g, " ").trim();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { HtmlDisplay };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import Link from 'next/link';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
import '../../../../../constants/paths/auth.js';
|
|
6
|
+
import '../../../../../constants/paths/main.js';
|
|
7
|
+
import '../../../../../constants/paths/resources.js';
|
|
8
|
+
import { NEW_TAB_REL, NEW_TAB_TARGET } from '../../../../../constants/anchor.js';
|
|
9
|
+
import '../../../../../constants/redirect-paths.js';
|
|
10
|
+
import 'ua-parser-js';
|
|
11
|
+
import { cn } from '../../../../applications/shadcn/utils.js';
|
|
12
|
+
import 'next/navigation';
|
|
13
|
+
import '@radix-ui/react-avatar';
|
|
14
|
+
import '../../shadcn/badge.js';
|
|
15
|
+
import '../../shadcn/button.js';
|
|
16
|
+
import '@radix-ui/react-collapsible';
|
|
17
|
+
import '@radix-ui/react-dialog';
|
|
18
|
+
import 'lucide-react';
|
|
19
|
+
import '@radix-ui/react-dropdown-menu';
|
|
20
|
+
import '../../shadcn/input-group.js';
|
|
21
|
+
import '@radix-ui/react-label';
|
|
22
|
+
import '@radix-ui/react-select';
|
|
23
|
+
import { Separator } from '../../shadcn/separator.js';
|
|
24
|
+
import '../../shadcn/sidebar.js';
|
|
25
|
+
import '@radix-ui/react-tooltip';
|
|
26
|
+
import { FieldBody } from '../form/field-body.js';
|
|
27
|
+
import 'mime-types';
|
|
28
|
+
import 'intor/react';
|
|
29
|
+
|
|
30
|
+
function ObjectArrayList({
|
|
31
|
+
items,
|
|
32
|
+
fields,
|
|
33
|
+
isLoading
|
|
34
|
+
}) {
|
|
35
|
+
const [expandedIndex, setExpandedIndex] = useState(null);
|
|
36
|
+
const toggle = (i) => setExpandedIndex((p) => p === i ? null : i);
|
|
37
|
+
const validItems = items?.filter(
|
|
38
|
+
(item) => typeof item === "object" && item !== null && Object.values(item).every((v) => typeof v === "string")
|
|
39
|
+
) ?? [];
|
|
40
|
+
if (!fields?.length || validItems.length === 0) return /* @__PURE__ */ jsx(FieldBody, { isEmpty: true });
|
|
41
|
+
return /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2", children: validItems.map((item, index) => {
|
|
42
|
+
const expanded = expandedIndex === index;
|
|
43
|
+
return /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-1", children: fields.map((field) => /* @__PURE__ */ jsxs(
|
|
44
|
+
FieldBody,
|
|
45
|
+
{
|
|
46
|
+
isLoading,
|
|
47
|
+
className: cn(expanded ? "cursor-zoom-out" : "cursor-zoom-in"),
|
|
48
|
+
onClick: () => toggle(index),
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-center absolute top-0 left-0 z-10 h-full", children: [
|
|
51
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-10 px-2 text-center text-sm opacity-50", children: index + 1 }),
|
|
52
|
+
/* @__PURE__ */ jsx(Separator, { orientation: "vertical", className: "py-2" })
|
|
53
|
+
] }),
|
|
54
|
+
field.isLink ? /* @__PURE__ */ jsx(
|
|
55
|
+
Link,
|
|
56
|
+
{
|
|
57
|
+
href: item[field.key] ?? "",
|
|
58
|
+
target: NEW_TAB_TARGET,
|
|
59
|
+
rel: NEW_TAB_REL,
|
|
60
|
+
className: cn(
|
|
61
|
+
"ml-11 text-blue-500/80 underline underline-offset-2",
|
|
62
|
+
!expanded && "line-clamp-1"
|
|
63
|
+
),
|
|
64
|
+
onClick: (e) => e.stopPropagation(),
|
|
65
|
+
children: item[field.key]
|
|
66
|
+
}
|
|
67
|
+
) : /* @__PURE__ */ jsx("p", { className: cn("ml-11", !expanded && "line-clamp-1"), children: item[field.key] })
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
field.key
|
|
71
|
+
)) }, index);
|
|
72
|
+
}) });
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export { ObjectArrayList };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import '@radix-ui/react-avatar';
|
|
3
|
+
import 'react';
|
|
4
|
+
import 'ua-parser-js';
|
|
5
|
+
import 'clsx';
|
|
6
|
+
import 'tailwind-merge';
|
|
7
|
+
import 'next/navigation';
|
|
8
|
+
import '../../../shadcn/badge.js';
|
|
9
|
+
import '../../../shadcn/button.js';
|
|
10
|
+
import '@radix-ui/react-collapsible';
|
|
11
|
+
import '@radix-ui/react-dialog';
|
|
12
|
+
import 'lucide-react';
|
|
13
|
+
import '@radix-ui/react-dropdown-menu';
|
|
14
|
+
import '../../../shadcn/input-group.js';
|
|
15
|
+
import '@radix-ui/react-label';
|
|
16
|
+
import '@radix-ui/react-select';
|
|
17
|
+
import { Separator } from '../../../shadcn/separator.js';
|
|
18
|
+
import '../../../shadcn/sidebar.js';
|
|
19
|
+
import '@radix-ui/react-tooltip';
|
|
20
|
+
|
|
21
|
+
function AccordionContainer({
|
|
22
|
+
children,
|
|
23
|
+
...props
|
|
24
|
+
}) {
|
|
25
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6", ...props, children: [
|
|
26
|
+
/* @__PURE__ */ jsx(Separator, { className: "my-4" }),
|
|
27
|
+
children
|
|
28
|
+
] });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { AccordionContainer };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useTranslator } from 'intor/react';
|
|
3
|
+
import 'react';
|
|
4
|
+
import 'ua-parser-js';
|
|
5
|
+
import { cn } from '../../../../../applications/shadcn/utils.js';
|
|
6
|
+
import 'next/navigation';
|
|
7
|
+
|
|
8
|
+
function AccordionHeader({
|
|
9
|
+
isRelated = false,
|
|
10
|
+
count,
|
|
11
|
+
children
|
|
12
|
+
}) {
|
|
13
|
+
const { t } = useTranslator();
|
|
14
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex h-full items-center gap-3 font-medium", children: [
|
|
15
|
+
count !== void 0 && /* @__PURE__ */ jsx(
|
|
16
|
+
"div",
|
|
17
|
+
{
|
|
18
|
+
className: cn(
|
|
19
|
+
"flex-center",
|
|
20
|
+
"h-5 rounded-full px-3",
|
|
21
|
+
"bg-primary-foreground",
|
|
22
|
+
"shadow-xs"
|
|
23
|
+
),
|
|
24
|
+
children: /* @__PURE__ */ jsx("p", { className: "text-xs", children: count })
|
|
25
|
+
}
|
|
26
|
+
),
|
|
27
|
+
/* @__PURE__ */ jsxs("p", { className: cn("text-sm", "font-500"), children: [
|
|
28
|
+
isRelated && t("resources.related.text"),
|
|
29
|
+
children
|
|
30
|
+
] })
|
|
31
|
+
] });
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { AccordionHeader as default };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { CircleChevronDown } from 'lucide-react';
|
|
3
|
+
import { useState, useRef, useEffect } from 'react';
|
|
4
|
+
import 'ua-parser-js';
|
|
5
|
+
import { cn } from '../../../../../applications/shadcn/utils.js';
|
|
6
|
+
import 'next/navigation';
|
|
7
|
+
import AccordionHeader from './accordion-header.js';
|
|
8
|
+
|
|
9
|
+
function Accordion({
|
|
10
|
+
initialOpen = false,
|
|
11
|
+
deps,
|
|
12
|
+
// children
|
|
13
|
+
children,
|
|
14
|
+
accordionHeaderProps,
|
|
15
|
+
// base
|
|
16
|
+
hasBorder,
|
|
17
|
+
className,
|
|
18
|
+
...props
|
|
19
|
+
}) {
|
|
20
|
+
const [isOpen, setIsOpen] = useState(initialOpen);
|
|
21
|
+
const containerRef = useRef(null);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
const el = containerRef.current;
|
|
24
|
+
if (el) el.style.maxHeight = initialOpen ? `${el.scrollHeight}px` : "0";
|
|
25
|
+
}, [initialOpen]);
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
const el = containerRef.current;
|
|
28
|
+
if (el) el.style.maxHeight = isOpen ? `${el.scrollHeight}px` : "0";
|
|
29
|
+
}, [isOpen, deps]);
|
|
30
|
+
return /* @__PURE__ */ jsxs(
|
|
31
|
+
"section",
|
|
32
|
+
{
|
|
33
|
+
className: cn(
|
|
34
|
+
className,
|
|
35
|
+
"rounded-lg",
|
|
36
|
+
hasBorder && "border-secondary overflow-hidden border-2"
|
|
37
|
+
),
|
|
38
|
+
...props,
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ jsxs(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
onClick: () => setIsOpen((prev) => !prev),
|
|
44
|
+
className: cn(
|
|
45
|
+
"h-9 w-full",
|
|
46
|
+
"flex items-center justify-between",
|
|
47
|
+
"px-3",
|
|
48
|
+
"bg-secondary",
|
|
49
|
+
"cursor-pointer",
|
|
50
|
+
hasBorder ? "" : "border-secondary rounded-lg border",
|
|
51
|
+
"transition"
|
|
52
|
+
),
|
|
53
|
+
children: [
|
|
54
|
+
accordionHeaderProps && /* @__PURE__ */ jsx(AccordionHeader, { ...accordionHeaderProps }),
|
|
55
|
+
/* @__PURE__ */ jsx(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
className: cn("opacity-50", !isOpen && "-rotate-90", "transition"),
|
|
59
|
+
children: /* @__PURE__ */ jsx(CircleChevronDown, { className: "size-5" })
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ jsx(
|
|
66
|
+
"div",
|
|
67
|
+
{
|
|
68
|
+
className: cn(
|
|
69
|
+
"transition-[max-height] duration-300",
|
|
70
|
+
"overflow-hidden"
|
|
71
|
+
),
|
|
72
|
+
ref: containerRef,
|
|
73
|
+
children: /* @__PURE__ */ jsx("div", { className: "p-6", children })
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export { Accordion };
|
|
@@ -5,14 +5,15 @@ import 'ua-parser-js';
|
|
|
5
5
|
import { cn } from '../../../../../applications/shadcn/utils.js';
|
|
6
6
|
import 'next/navigation';
|
|
7
7
|
import '@radix-ui/react-avatar';
|
|
8
|
+
import '../../../shadcn/badge.js';
|
|
8
9
|
import '../../../shadcn/button.js';
|
|
9
10
|
import '@radix-ui/react-collapsible';
|
|
11
|
+
import '@radix-ui/react-dialog';
|
|
10
12
|
import '@radix-ui/react-dropdown-menu';
|
|
11
13
|
import '../../../shadcn/input-group.js';
|
|
12
14
|
import '@radix-ui/react-label';
|
|
13
15
|
import '@radix-ui/react-select';
|
|
14
16
|
import { Separator } from '../../../shadcn/separator.js';
|
|
15
|
-
import '@radix-ui/react-dialog';
|
|
16
17
|
import '../../../shadcn/sidebar.js';
|
|
17
18
|
import '@radix-ui/react-tooltip';
|
|
18
19
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { SquareArrowOutUpRight } from 'lucide-react';
|
|
3
|
+
import { Button } from '../buttons/button.js';
|
|
4
|
+
import 'intor/react';
|
|
5
|
+
import 'next/navigation';
|
|
6
|
+
import 'react';
|
|
7
|
+
import 'ua-parser-js';
|
|
8
|
+
import 'clsx';
|
|
9
|
+
import 'tailwind-merge';
|
|
10
|
+
|
|
11
|
+
function ExternalLink({ href = "" }) {
|
|
12
|
+
return /* @__PURE__ */ jsx(Button, { variant: "outline", size: "icon", href, openNewTab: true, children: /* @__PURE__ */ jsx(SquareArrowOutUpRight, {}) });
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { ExternalLink };
|
package/dist/src/client/interfaces/components/ui/features/file/file-picker/file-picker-container.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import 'react';
|
|
4
|
+
import 'ua-parser-js';
|
|
5
|
+
import { cn } from '../../../../../../applications/shadcn/utils.js';
|
|
6
|
+
import 'next/navigation';
|
|
7
|
+
import '@radix-ui/react-avatar';
|
|
8
|
+
import '../../../../shadcn/badge.js';
|
|
9
|
+
import '../../../../shadcn/button.js';
|
|
10
|
+
import '@radix-ui/react-collapsible';
|
|
11
|
+
import '@radix-ui/react-dialog';
|
|
12
|
+
import 'lucide-react';
|
|
13
|
+
import '@radix-ui/react-dropdown-menu';
|
|
14
|
+
import '../../../../shadcn/input-group.js';
|
|
15
|
+
import '@radix-ui/react-label';
|
|
16
|
+
import '@radix-ui/react-select';
|
|
17
|
+
import '@radix-ui/react-separator';
|
|
18
|
+
import '../../../../shadcn/sidebar.js';
|
|
19
|
+
import { Spinner } from '../../../../shadcn/spinner.js';
|
|
20
|
+
import '@radix-ui/react-tooltip';
|
|
21
|
+
import { FilePickerPlaceholder } from './file-picker-placeholder.js';
|
|
22
|
+
|
|
23
|
+
function FilePickerContainer({
|
|
24
|
+
inputRef,
|
|
25
|
+
hasSingleFile = false,
|
|
26
|
+
isDragOver,
|
|
27
|
+
setIsDragOver,
|
|
28
|
+
processFiles,
|
|
29
|
+
// ui states
|
|
30
|
+
isLoading = false,
|
|
31
|
+
isDisabled = false,
|
|
32
|
+
isDisplay = false,
|
|
33
|
+
// base
|
|
34
|
+
className = "",
|
|
35
|
+
children
|
|
36
|
+
}) {
|
|
37
|
+
const handleDrop = (e) => {
|
|
38
|
+
e.preventDefault();
|
|
39
|
+
setIsDragOver(false);
|
|
40
|
+
if (e.dataTransfer.files) void processFiles(e.dataTransfer.files);
|
|
41
|
+
};
|
|
42
|
+
return /* @__PURE__ */ jsx(
|
|
43
|
+
"div",
|
|
44
|
+
{
|
|
45
|
+
className: cn(
|
|
46
|
+
className,
|
|
47
|
+
"relative",
|
|
48
|
+
"flex-center",
|
|
49
|
+
"overflow-hidden",
|
|
50
|
+
"rounded-xl",
|
|
51
|
+
"bg-secondary",
|
|
52
|
+
"border-dashed",
|
|
53
|
+
!isDisplay && "cursor-pointer",
|
|
54
|
+
"transition",
|
|
55
|
+
isDragOver && "opacity-50",
|
|
56
|
+
hasSingleFile || isLoading ? "border-0" : "border-4 hover:opacity-50",
|
|
57
|
+
(isDisabled || isLoading) && "pointer-events-none"
|
|
58
|
+
),
|
|
59
|
+
onClick: () => inputRef.current && inputRef.current.click(),
|
|
60
|
+
onDrop: handleDrop,
|
|
61
|
+
onDragOver: (e) => {
|
|
62
|
+
e.preventDefault();
|
|
63
|
+
setIsDragOver(true);
|
|
64
|
+
},
|
|
65
|
+
onDragLeave: () => setIsDragOver(false),
|
|
66
|
+
children: isLoading ? /* @__PURE__ */ jsx(Spinner, { className: "size-16" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
67
|
+
!hasSingleFile && /* @__PURE__ */ jsx("div", { className: "absolute size-full", children: /* @__PURE__ */ jsx(FilePickerPlaceholder, {}) }),
|
|
68
|
+
children
|
|
69
|
+
] })
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export { FilePickerContainer };
|