@lark-apaas/coding-template-nestjs-react-fullstack 0.1.0-alpha.1
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/LICENSE +13 -0
- package/README.md +41 -0
- package/hooks/after-install.mjs +3 -0
- package/hooks/after-render.mjs +3 -0
- package/hooks/before-render.mjs +3 -0
- package/package.json +36 -0
- package/template/.codebase/pipelines/ci.yaml +34 -0
- package/template/.codebase/pipelines/coco-code-review.yaml +21 -0
- package/template/.prettierrc +8 -0
- package/template/.spark_project +16 -0
- package/template/.stylelintrc.js +12 -0
- package/template/_env.local +38 -0
- package/template/_gitignore +64 -0
- package/template/_npmrc +1 -0
- package/template/client/index.html +23 -0
- package/template/client/public/favicon.svg +40 -0
- package/template/client/src/api/index.ts +19 -0
- package/template/client/src/app.tsx +22 -0
- package/template/client/src/components/Layout.tsx +11 -0
- package/template/client/src/components/business-ui/README.md +519 -0
- package/template/client/src/components/business-ui/api/chats/queries.ts +39 -0
- package/template/client/src/components/business-ui/api/chats/service.ts +29 -0
- package/template/client/src/components/business-ui/api/departments/queries.ts +42 -0
- package/template/client/src/components/business-ui/api/departments/service.ts +18 -0
- package/template/client/src/components/business-ui/api/files/service.ts +28 -0
- package/template/client/src/components/business-ui/api/user-profiles/queries.ts +42 -0
- package/template/client/src/components/business-ui/api/user-profiles/service.ts +23 -0
- package/template/client/src/components/business-ui/api/users/queries.ts +34 -0
- package/template/client/src/components/business-ui/api/users/service.ts +40 -0
- package/template/client/src/components/business-ui/chat-select/README.md +128 -0
- package/template/client/src/components/business-ui/chat-select/chat-item.tsx +85 -0
- package/template/client/src/components/business-ui/chat-select/chat-select-tag.tsx +83 -0
- package/template/client/src/components/business-ui/chat-select/chat-select.tsx +197 -0
- package/template/client/src/components/business-ui/chat-select/index.tsx +12 -0
- package/template/client/src/components/business-ui/chat-select/types.ts +102 -0
- package/template/client/src/components/business-ui/chat-select/use-chat-value.ts +180 -0
- package/template/client/src/components/business-ui/chat-select/utils.ts +81 -0
- package/template/client/src/components/business-ui/department-select/department-item.tsx +55 -0
- package/template/client/src/components/business-ui/department-select/department-select-field.tsx +86 -0
- package/template/client/src/components/business-ui/department-select/department-select-tag.tsx +56 -0
- package/template/client/src/components/business-ui/department-select/department-select.tsx +168 -0
- package/template/client/src/components/business-ui/department-select/icon-department.tsx +22 -0
- package/template/client/src/components/business-ui/department-select/index.tsx +7 -0
- package/template/client/src/components/business-ui/department-select/types.ts +15 -0
- package/template/client/src/components/business-ui/department-select/utils.ts +17 -0
- package/template/client/src/components/business-ui/entity-combobox/base-combobox-content.tsx +35 -0
- package/template/client/src/components/business-ui/entity-combobox/base-combobox-empty.tsx +28 -0
- package/template/client/src/components/business-ui/entity-combobox/base-combobox-error.tsx +35 -0
- package/template/client/src/components/business-ui/entity-combobox/base-combobox-item.tsx +55 -0
- package/template/client/src/components/business-ui/entity-combobox/base-combobox-list.tsx +174 -0
- package/template/client/src/components/business-ui/entity-combobox/base-combobox-loading.tsx +19 -0
- package/template/client/src/components/business-ui/entity-combobox/base-combobox-search.tsx +31 -0
- package/template/client/src/components/business-ui/entity-combobox/base-combobox-trigger.tsx +281 -0
- package/template/client/src/components/business-ui/entity-combobox/base-combobox.tsx +132 -0
- package/template/client/src/components/business-ui/entity-combobox/context.tsx +19 -0
- package/template/client/src/components/business-ui/entity-combobox/entity-combobox.tsx +145 -0
- package/template/client/src/components/business-ui/entity-combobox/highlight-text.tsx +52 -0
- package/template/client/src/components/business-ui/entity-combobox/hooks.tsx +21 -0
- package/template/client/src/components/business-ui/entity-combobox/index.tsx +31 -0
- package/template/client/src/components/business-ui/entity-combobox/item-pill.tsx +179 -0
- package/template/client/src/components/business-ui/entity-combobox/popover-wrapper.tsx +149 -0
- package/template/client/src/components/business-ui/entity-combobox/search-trigger.tsx +262 -0
- package/template/client/src/components/business-ui/entity-combobox/shared-types.ts +296 -0
- package/template/client/src/components/business-ui/entity-combobox/size-variants.tsx +322 -0
- package/template/client/src/components/business-ui/entity-combobox/types.ts +246 -0
- package/template/client/src/components/business-ui/entity-combobox/use-fetch-data.tsx +81 -0
- package/template/client/src/components/business-ui/entity-combobox/use-infinite-scroll.tsx +99 -0
- package/template/client/src/components/business-ui/entity-combobox/use-popover-outside-click.tsx +32 -0
- package/template/client/src/components/business-ui/form/checkbox-field.tsx +83 -0
- package/template/client/src/components/business-ui/form/context.tsx +38 -0
- package/template/client/src/components/business-ui/form/field-layout.tsx +91 -0
- package/template/client/src/components/business-ui/form/form.tsx +54 -0
- package/template/client/src/components/business-ui/form/hooks/form-context.tsx +4 -0
- package/template/client/src/components/business-ui/form/hooks/form-utils.ts +23 -0
- package/template/client/src/components/business-ui/form/hooks/form.tsx +40 -0
- package/template/client/src/components/business-ui/form/index.tsx +4 -0
- package/template/client/src/components/business-ui/form/input-field.tsx +74 -0
- package/template/client/src/components/business-ui/form/radio-group-field.tsx +138 -0
- package/template/client/src/components/business-ui/form/select-field.tsx +155 -0
- package/template/client/src/components/business-ui/form/switch-field.tsx +66 -0
- package/template/client/src/components/business-ui/form/textarea-field.tsx +72 -0
- package/template/client/src/components/business-ui/form/types.ts +32 -0
- package/template/client/src/components/business-ui/tiptap-editor/README.md +324 -0
- package/template/client/src/components/business-ui/tiptap-editor/components/attachment-toolbar-button.tsx +74 -0
- package/template/client/src/components/business-ui/tiptap-editor/components/blockquote-toolbar-button.tsx +41 -0
- package/template/client/src/components/business-ui/tiptap-editor/components/code-block-toolbar-button.tsx +41 -0
- package/template/client/src/components/business-ui/tiptap-editor/components/color-highlight-toolbar-button.tsx +141 -0
- package/template/client/src/components/business-ui/tiptap-editor/components/heading-toolbar-button.tsx +99 -0
- package/template/client/src/components/business-ui/tiptap-editor/components/horizontal-rule-toolbar-button.tsx +39 -0
- package/template/client/src/components/business-ui/tiptap-editor/components/image-upload-toolbar-button.tsx +65 -0
- package/template/client/src/components/business-ui/tiptap-editor/components/link-edit-form.tsx +127 -0
- package/template/client/src/components/business-ui/tiptap-editor/components/link-hover-toolbar.tsx +380 -0
- package/template/client/src/components/business-ui/tiptap-editor/components/link-toolbar-button.tsx +96 -0
- package/template/client/src/components/business-ui/tiptap-editor/components/list-toolbar-button.tsx +75 -0
- package/template/client/src/components/business-ui/tiptap-editor/components/mark-toolbar-button.tsx +118 -0
- package/template/client/src/components/business-ui/tiptap-editor/components/text-align-toolbar-button.tsx +84 -0
- package/template/client/src/components/business-ui/tiptap-editor/components/undo-redo-toolbar-button.tsx +54 -0
- package/template/client/src/components/business-ui/tiptap-editor/extensions/attachment.tsx +539 -0
- package/template/client/src/components/business-ui/tiptap-editor/extensions/code-block-shiki.tsx +236 -0
- package/template/client/src/components/business-ui/tiptap-editor/extensions/complete-kit.ts +260 -0
- package/template/client/src/components/business-ui/tiptap-editor/extensions/image.tsx +456 -0
- package/template/client/src/components/business-ui/tiptap-editor/hooks/use-tiptap-editor.ts +47 -0
- package/template/client/src/components/business-ui/tiptap-editor/index.ts +38 -0
- package/template/client/src/components/business-ui/tiptap-editor/tiptap-editor-complete.tsx +112 -0
- package/template/client/src/components/business-ui/tiptap-editor/tiptap-editor.tsx +169 -0
- package/template/client/src/components/business-ui/types/user.ts +74 -0
- package/template/client/src/components/business-ui/user-display/index.tsx +2 -0
- package/template/client/src/components/business-ui/user-display/overflow-tooltip-text.tsx +90 -0
- package/template/client/src/components/business-ui/user-display/type.ts +27 -0
- package/template/client/src/components/business-ui/user-display/user-display.tsx +99 -0
- package/template/client/src/components/business-ui/user-display/user-with-avatar.tsx +158 -0
- package/template/client/src/components/business-ui/user-display/utils.ts +37 -0
- package/template/client/src/components/business-ui/user-profile/error-image.tsx +302 -0
- package/template/client/src/components/business-ui/user-profile/user-external-script.ts +73 -0
- package/template/client/src/components/business-ui/user-profile/user-profile.tsx +370 -0
- package/template/client/src/components/business-ui/user-select/index.tsx +28 -0
- package/template/client/src/components/business-ui/user-select/types.ts +109 -0
- package/template/client/src/components/business-ui/user-select/use-user-value.ts +160 -0
- package/template/client/src/components/business-ui/user-select/user-item.tsx +98 -0
- package/template/client/src/components/business-ui/user-select/user-pill.tsx +140 -0
- package/template/client/src/components/business-ui/user-select/user-select-tag.tsx +82 -0
- package/template/client/src/components/business-ui/user-select/user-select.tsx +359 -0
- package/template/client/src/components/business-ui/user-select/utils.tsx +188 -0
- package/template/client/src/components/business-ui/utils/user.ts +72 -0
- package/template/client/src/components/ui/README.md +134 -0
- package/template/client/src/components/ui/accordion.tsx +66 -0
- package/template/client/src/components/ui/alert-dialog.tsx +157 -0
- package/template/client/src/components/ui/alert.tsx +71 -0
- package/template/client/src/components/ui/aspect-ratio.tsx +11 -0
- package/template/client/src/components/ui/avatar.tsx +53 -0
- package/template/client/src/components/ui/badge.tsx +42 -0
- package/template/client/src/components/ui/breadcrumb.tsx +109 -0
- package/template/client/src/components/ui/button-group.tsx +83 -0
- package/template/client/src/components/ui/button.tsx +69 -0
- package/template/client/src/components/ui/calendar.tsx +213 -0
- package/template/client/src/components/ui/card.tsx +82 -0
- package/template/client/src/components/ui/carousel.tsx +241 -0
- package/template/client/src/components/ui/chart.tsx +357 -0
- package/template/client/src/components/ui/checkbox.tsx +32 -0
- package/template/client/src/components/ui/collapsible.tsx +33 -0
- package/template/client/src/components/ui/command.tsx +208 -0
- package/template/client/src/components/ui/context-menu.tsx +324 -0
- package/template/client/src/components/ui/dialog.tsx +143 -0
- package/template/client/src/components/ui/drawer.tsx +135 -0
- package/template/client/src/components/ui/dropdown-menu.tsx +329 -0
- package/template/client/src/components/ui/empty.tsx +104 -0
- package/template/client/src/components/ui/field.tsx +248 -0
- package/template/client/src/components/ui/form.tsx +167 -0
- package/template/client/src/components/ui/hover-card.tsx +44 -0
- package/template/client/src/components/ui/icons/file-ae-colorful-icon.tsx +21 -0
- package/template/client/src/components/ui/icons/file-ai-colorful-icon.tsx +36 -0
- package/template/client/src/components/ui/icons/file-android-colorful-icon.tsx +33 -0
- package/template/client/src/components/ui/icons/file-audio-colorful-icon.tsx +21 -0
- package/template/client/src/components/ui/icons/file-code-colorful-icon.tsx +28 -0
- package/template/client/src/components/ui/icons/file-csv-colorful-icon.tsx +21 -0
- package/template/client/src/components/ui/icons/file-eml-colorful-icon.tsx +29 -0
- package/template/client/src/components/ui/icons/file-ios-colorful-icon.tsx +25 -0
- package/template/client/src/components/ui/icons/file-keynote-colorful-icon.tsx +29 -0
- package/template/client/src/components/ui/icons/file-pages-colorful-icon.tsx +29 -0
- package/template/client/src/components/ui/icons/file-ps-colorful-icon.tsx +21 -0
- package/template/client/src/components/ui/icons/file-sketch-colorful-icon.tsx +21 -0
- package/template/client/src/components/ui/icons/file-slide-colorful-icon.tsx +21 -0
- package/template/client/src/components/ui/icons/file-vcf-colorful-icon.tsx +29 -0
- package/template/client/src/components/ui/icons/file-wiki-excel-colorful-icon.tsx +23 -0
- package/template/client/src/components/ui/icons/file-wiki-image-colorful-icon.tsx +27 -0
- package/template/client/src/components/ui/icons/file-wiki-pdf-colorful-icon.tsx +20 -0
- package/template/client/src/components/ui/icons/file-wiki-ppt-colorful-icon.tsx +21 -0
- package/template/client/src/components/ui/icons/file-wiki-text-colorful-icon.tsx +12 -0
- package/template/client/src/components/ui/icons/file-wiki-unknown-colorful-icon.tsx +14 -0
- package/template/client/src/components/ui/icons/file-wiki-video-colorful-icon.tsx +23 -0
- package/template/client/src/components/ui/icons/file-wiki-word-colorful-icon.tsx +38 -0
- package/template/client/src/components/ui/icons/file-wiki-zip-colorful-icon.tsx +21 -0
- package/template/client/src/components/ui/image.tsx +183 -0
- package/template/client/src/components/ui/input-group.tsx +166 -0
- package/template/client/src/components/ui/input-otp.tsx +77 -0
- package/template/client/src/components/ui/input.tsx +21 -0
- package/template/client/src/components/ui/item.tsx +193 -0
- package/template/client/src/components/ui/kbd.tsx +28 -0
- package/template/client/src/components/ui/label.tsx +24 -0
- package/template/client/src/components/ui/menubar.tsx +348 -0
- package/template/client/src/components/ui/native-select.tsx +48 -0
- package/template/client/src/components/ui/navigation-menu.tsx +168 -0
- package/template/client/src/components/ui/pagination.tsx +127 -0
- package/template/client/src/components/ui/popover.tsx +48 -0
- package/template/client/src/components/ui/progress.tsx +31 -0
- package/template/client/src/components/ui/radio-group.tsx +45 -0
- package/template/client/src/components/ui/resizable.tsx +56 -0
- package/template/client/src/components/ui/scroll-area.tsx +58 -0
- package/template/client/src/components/ui/select.tsx +243 -0
- package/template/client/src/components/ui/separator.tsx +28 -0
- package/template/client/src/components/ui/sheet.tsx +139 -0
- package/template/client/src/components/ui/sidebar.tsx +727 -0
- package/template/client/src/components/ui/skeleton.tsx +13 -0
- package/template/client/src/components/ui/slider.tsx +87 -0
- package/template/client/src/components/ui/sonner.tsx +67 -0
- package/template/client/src/components/ui/spinner.tsx +16 -0
- package/template/client/src/components/ui/streamdown.tsx +186 -0
- package/template/client/src/components/ui/switch.tsx +31 -0
- package/template/client/src/components/ui/table.tsx +116 -0
- package/template/client/src/components/ui/tabs.tsx +66 -0
- package/template/client/src/components/ui/textarea.tsx +18 -0
- package/template/client/src/components/ui/toggle-group.tsx +83 -0
- package/template/client/src/components/ui/toggle.tsx +47 -0
- package/template/client/src/components/ui/tooltip.tsx +61 -0
- package/template/client/src/hooks/use-example.ts +52 -0
- package/template/client/src/hooks/use-mobile.ts +19 -0
- package/template/client/src/index.css +7 -0
- package/template/client/src/index.tsx +36 -0
- package/template/client/src/lib/shiki.ts +92 -0
- package/template/client/src/lib/utils.ts +6 -0
- package/template/client/src/pages/ExamplePage/ExamplePage.tsx +37 -0
- package/template/client/src/pages/NotFound/NotFound.tsx +11 -0
- package/template/client/src/tailwind-theme.css +257 -0
- package/template/client/src/types/common.ts +34 -0
- package/template/client/src/types/global.d.ts +53 -0
- package/template/client/src/types/index.ts +4 -0
- package/template/client/src/typography.css +41 -0
- package/template/client/src/utils/img-resources/avatar-placeholders.ts +12 -0
- package/template/client/src/utils/img-resources/banner-placeholders.ts +29 -0
- package/template/client/src/utils/img-resources/cover-placeholders.ts +47 -0
- package/template/components.json +21 -0
- package/template/eslint.config.js +50 -0
- package/template/nest-cli.json +25 -0
- package/template/package-lock.json +29195 -0
- package/template/package.json +202 -0
- package/template/postcss.config.js +10 -0
- package/template/scripts/build.sh +120 -0
- package/template/scripts/dev.js +295 -0
- package/template/scripts/dev.sh +2 -0
- package/template/scripts/lint.js +150 -0
- package/template/scripts/prune-smart.js +281 -0
- package/template/scripts/run.sh +5 -0
- package/template/server/app.module.ts +27 -0
- package/template/server/common/constants/api_response_code.ts +54 -0
- package/template/server/common/filters/exception.filter.ts +78 -0
- package/template/server/common/interfaces/api_response.interface.ts +21 -0
- package/template/server/common/interfaces/exception.interface.ts +19 -0
- package/template/server/database/schema.ts +90 -0
- package/template/server/main.ts +31 -0
- package/template/server/modules/hello/hello.controller.ts +16 -0
- package/template/server/modules/hello/hello.module.ts +10 -0
- package/template/server/modules/hello/hello.service.ts +28 -0
- package/template/server/modules/view/view.controller.ts +17 -0
- package/template/server/modules/view/view.module.ts +8 -0
- package/template/shared/api.interface.ts +1 -0
- package/template/tailwind.config.ts +9 -0
- package/template/tsconfig.app.json +23 -0
- package/template/tsconfig.json +8 -0
- package/template/tsconfig.node.json +16 -0
- package/template/vite.config.ts +10 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as TogglePrimitive from "@radix-ui/react-toggle"
|
|
5
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
6
|
+
|
|
7
|
+
import { cn } from "@/lib/utils"
|
|
8
|
+
|
|
9
|
+
const toggleVariants = cva(
|
|
10
|
+
"inline-flex items-center justify-center gap-2 rounded-md text-sm font-normal enabled:hover:bg-muted enabled:hover:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",
|
|
11
|
+
{
|
|
12
|
+
variants: {
|
|
13
|
+
variant: {
|
|
14
|
+
default: "bg-transparent",
|
|
15
|
+
outline:
|
|
16
|
+
"border border-input bg-transparent enabled:hover:bg-accent enabled:hover:text-accent-foreground",
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
default: "h-9 px-2 min-w-9",
|
|
20
|
+
sm: "h-8 px-1.5 min-w-8",
|
|
21
|
+
lg: "h-10 px-2.5 min-w-10",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
variant: "default",
|
|
26
|
+
size: "default",
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
function Toggle({
|
|
32
|
+
className,
|
|
33
|
+
variant,
|
|
34
|
+
size,
|
|
35
|
+
...props
|
|
36
|
+
}: React.ComponentProps<typeof TogglePrimitive.Root> &
|
|
37
|
+
VariantProps<typeof toggleVariants>) {
|
|
38
|
+
return (
|
|
39
|
+
<TogglePrimitive.Root
|
|
40
|
+
data-slot="toggle"
|
|
41
|
+
className={cn(toggleVariants({ variant, size, className }))}
|
|
42
|
+
{...props}
|
|
43
|
+
/>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export { Toggle, toggleVariants }
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip"
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
|
|
8
|
+
function TooltipProvider({
|
|
9
|
+
delayDuration = 0,
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
|
|
12
|
+
return (
|
|
13
|
+
<TooltipPrimitive.Provider
|
|
14
|
+
data-slot="tooltip-provider"
|
|
15
|
+
delayDuration={delayDuration}
|
|
16
|
+
{...props}
|
|
17
|
+
/>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function Tooltip({
|
|
22
|
+
...props
|
|
23
|
+
}: React.ComponentProps<typeof TooltipPrimitive.Root>) {
|
|
24
|
+
return (
|
|
25
|
+
<TooltipProvider>
|
|
26
|
+
<TooltipPrimitive.Root data-slot="tooltip" {...props} />
|
|
27
|
+
</TooltipProvider>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function TooltipTrigger({
|
|
32
|
+
...props
|
|
33
|
+
}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
|
|
34
|
+
return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function TooltipContent({
|
|
38
|
+
className,
|
|
39
|
+
sideOffset = 0,
|
|
40
|
+
children,
|
|
41
|
+
...props
|
|
42
|
+
}: React.ComponentProps<typeof TooltipPrimitive.Content>) {
|
|
43
|
+
return (
|
|
44
|
+
<TooltipPrimitive.Portal>
|
|
45
|
+
<TooltipPrimitive.Content
|
|
46
|
+
data-slot="tooltip-content"
|
|
47
|
+
sideOffset={sideOffset}
|
|
48
|
+
className={cn(
|
|
49
|
+
"bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance shadow-md",
|
|
50
|
+
className
|
|
51
|
+
)}
|
|
52
|
+
{...props}
|
|
53
|
+
>
|
|
54
|
+
{children}
|
|
55
|
+
<TooltipPrimitive.Arrow className="bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" />
|
|
56
|
+
</TooltipPrimitive.Content>
|
|
57
|
+
</TooltipPrimitive.Portal>
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// import { useState, useEffect } from 'react';
|
|
2
|
+
// import { axiosForBackend } from '@lark-apaas/client-toolkit/utils/getAxiosForBackend';
|
|
3
|
+
// import { logger } from '@lark-apaas/client-toolkit/logger';
|
|
4
|
+
|
|
5
|
+
// interface RecordData {
|
|
6
|
+
// title?: string,
|
|
7
|
+
// type?: string,
|
|
8
|
+
// creator?: string,
|
|
9
|
+
// speakDate?: string,
|
|
10
|
+
// record: any;
|
|
11
|
+
// loading: boolean;
|
|
12
|
+
// error?: string;
|
|
13
|
+
// }
|
|
14
|
+
|
|
15
|
+
// export function useRecordData() {
|
|
16
|
+
// const [data, setData] = useState<RecordData>({
|
|
17
|
+
// record: {},
|
|
18
|
+
// loading: true,
|
|
19
|
+
// error: null,
|
|
20
|
+
// });
|
|
21
|
+
|
|
22
|
+
// useEffect(() => {
|
|
23
|
+
// fetchRecordData();
|
|
24
|
+
// }, []);
|
|
25
|
+
|
|
26
|
+
// const fetchRecordData = async () => {
|
|
27
|
+
// try {
|
|
28
|
+
// setData(prev => ({ ...prev, loading: true, error: null }));
|
|
29
|
+
|
|
30
|
+
// // 使用axios实例获取数据
|
|
31
|
+
// const response = await axiosForBackend.get('/api/hello');
|
|
32
|
+
|
|
33
|
+
// // 提取响应数据中的 data 字段
|
|
34
|
+
// const record = response.data.data;
|
|
35
|
+
|
|
36
|
+
// setData({
|
|
37
|
+
// record,
|
|
38
|
+
// loading: false,
|
|
39
|
+
// error: null,
|
|
40
|
+
// });
|
|
41
|
+
// } catch (error) {
|
|
42
|
+
// logger.error('获取数据失败', error);
|
|
43
|
+
// setData(prev => ({
|
|
44
|
+
// ...prev,
|
|
45
|
+
// loading: false,
|
|
46
|
+
// error: '获取数据失败,请稍后重试',
|
|
47
|
+
// }));
|
|
48
|
+
// }
|
|
49
|
+
// };
|
|
50
|
+
|
|
51
|
+
// return { ...data, refetch: fetchRecordData };
|
|
52
|
+
// }
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
|
|
3
|
+
const MOBILE_BREAKPOINT = 768
|
|
4
|
+
|
|
5
|
+
export function useIsMobile() {
|
|
6
|
+
const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)
|
|
7
|
+
|
|
8
|
+
React.useEffect(() => {
|
|
9
|
+
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)
|
|
10
|
+
const onChange = () => {
|
|
11
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
|
|
12
|
+
}
|
|
13
|
+
mql.addEventListener("change", onChange)
|
|
14
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
|
|
15
|
+
return () => mql.removeEventListener("change", onChange)
|
|
16
|
+
}, [])
|
|
17
|
+
|
|
18
|
+
return !!isMobile
|
|
19
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createRoot } from 'react-dom/client';
|
|
3
|
+
import { BrowserRouter } from 'react-router-dom';
|
|
4
|
+
import { ErrorBoundary } from 'react-error-boundary';
|
|
5
|
+
|
|
6
|
+
import { AppContainer } from '@lark-apaas/client-toolkit/components/AppContainer';
|
|
7
|
+
import { ErrorRender } from '@lark-apaas/client-toolkit/components/ErrorRender';
|
|
8
|
+
|
|
9
|
+
import RoutesComponent from './app.tsx';
|
|
10
|
+
import './index.css';
|
|
11
|
+
import { createPortal } from 'react-dom';
|
|
12
|
+
import { Toaster } from '@client/src/components/ui/sonner';
|
|
13
|
+
|
|
14
|
+
const CLIENT_BASE_PATH = process.env.CLIENT_BASE_PATH || '/';
|
|
15
|
+
|
|
16
|
+
const MainApp = () => {
|
|
17
|
+
return (
|
|
18
|
+
<BrowserRouter basename={CLIENT_BASE_PATH}>
|
|
19
|
+
<AppContainer defaultTheme="light">
|
|
20
|
+
<ErrorBoundary
|
|
21
|
+
fallbackRender={({ error, resetErrorBoundary }) => (
|
|
22
|
+
<ErrorRender
|
|
23
|
+
error={error as Error}
|
|
24
|
+
resetErrorBoundary={resetErrorBoundary}
|
|
25
|
+
/>
|
|
26
|
+
)}
|
|
27
|
+
>
|
|
28
|
+
<RoutesComponent />
|
|
29
|
+
{createPortal(<Toaster />, document.body)}
|
|
30
|
+
</ErrorBoundary>
|
|
31
|
+
</AppContainer>
|
|
32
|
+
</BrowserRouter>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
createRoot(document.getElementById('root')!).render(<MainApp />);
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createBundledHighlighter,
|
|
3
|
+
createSingletonShorthands,
|
|
4
|
+
} from 'shiki/core';
|
|
5
|
+
import { createJavaScriptRegexEngine } from 'shiki/engine/javascript';
|
|
6
|
+
import type {
|
|
7
|
+
DynamicImportLanguageRegistration,
|
|
8
|
+
DynamicImportThemeRegistration,
|
|
9
|
+
HighlighterGeneric,
|
|
10
|
+
} from 'shiki/types';
|
|
11
|
+
|
|
12
|
+
type BundledLanguage =
|
|
13
|
+
| 'typescript'
|
|
14
|
+
| 'ts'
|
|
15
|
+
| 'cts'
|
|
16
|
+
| 'mts'
|
|
17
|
+
| 'javascript'
|
|
18
|
+
| 'js'
|
|
19
|
+
| 'cjs'
|
|
20
|
+
| 'mjs'
|
|
21
|
+
| 'jsx'
|
|
22
|
+
| 'tsx'
|
|
23
|
+
| 'html'
|
|
24
|
+
| 'css'
|
|
25
|
+
| 'json'
|
|
26
|
+
| 'jsonc'
|
|
27
|
+
| 'json5'
|
|
28
|
+
| 'markdown'
|
|
29
|
+
| 'md';
|
|
30
|
+
type BundledTheme = 'github-light' | 'github-dark';
|
|
31
|
+
type Highlighter = HighlighterGeneric<BundledLanguage, BundledTheme>;
|
|
32
|
+
|
|
33
|
+
const bundledLanguages = {
|
|
34
|
+
typescript: () => import('@shikijs/langs/typescript'),
|
|
35
|
+
ts: () => import('@shikijs/langs/typescript'),
|
|
36
|
+
cts: () => import('@shikijs/langs/typescript'),
|
|
37
|
+
mts: () => import('@shikijs/langs/typescript'),
|
|
38
|
+
javascript: () => import('@shikijs/langs/javascript'),
|
|
39
|
+
js: () => import('@shikijs/langs/javascript'),
|
|
40
|
+
cjs: () => import('@shikijs/langs/javascript'),
|
|
41
|
+
mjs: () => import('@shikijs/langs/javascript'),
|
|
42
|
+
jsx: () => import('@shikijs/langs/jsx'),
|
|
43
|
+
tsx: () => import('@shikijs/langs/tsx'),
|
|
44
|
+
html: () => import('@shikijs/langs/html'),
|
|
45
|
+
css: () => import('@shikijs/langs/css'),
|
|
46
|
+
json: () => import('@shikijs/langs/json'),
|
|
47
|
+
jsonc: () => import('@shikijs/langs/jsonc'),
|
|
48
|
+
json5: () => import('@shikijs/langs/json5'),
|
|
49
|
+
markdown: () => import('@shikijs/langs/markdown'),
|
|
50
|
+
md: () => import('@shikijs/langs/markdown'),
|
|
51
|
+
} as Record<BundledLanguage, DynamicImportLanguageRegistration>;
|
|
52
|
+
|
|
53
|
+
const bundledThemes = {
|
|
54
|
+
'github-light': () => import('@shikijs/themes/github-light'),
|
|
55
|
+
'github-dark': () => import('@shikijs/themes/github-dark'),
|
|
56
|
+
} as Record<BundledTheme, DynamicImportThemeRegistration>;
|
|
57
|
+
|
|
58
|
+
const createHighlighter = /* @__PURE__ */ createBundledHighlighter<
|
|
59
|
+
BundledLanguage,
|
|
60
|
+
BundledTheme
|
|
61
|
+
>({
|
|
62
|
+
langs: bundledLanguages,
|
|
63
|
+
themes: bundledThemes,
|
|
64
|
+
engine: () => createJavaScriptRegexEngine(),
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const {
|
|
68
|
+
codeToHtml,
|
|
69
|
+
codeToHast,
|
|
70
|
+
codeToTokensBase,
|
|
71
|
+
codeToTokens,
|
|
72
|
+
codeToTokensWithThemes,
|
|
73
|
+
getSingletonHighlighter,
|
|
74
|
+
getLastGrammarState,
|
|
75
|
+
} = /* @__PURE__ */ createSingletonShorthands<BundledLanguage, BundledTheme>(
|
|
76
|
+
createHighlighter,
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
export {
|
|
80
|
+
bundledLanguages,
|
|
81
|
+
bundledThemes,
|
|
82
|
+
codeToHast,
|
|
83
|
+
codeToHtml,
|
|
84
|
+
codeToTokens,
|
|
85
|
+
codeToTokensBase,
|
|
86
|
+
codeToTokensWithThemes,
|
|
87
|
+
createHighlighter,
|
|
88
|
+
getLastGrammarState,
|
|
89
|
+
getSingletonHighlighter,
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export type { BundledLanguage, BundledTheme, Highlighter };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// import { useState } from 'react';
|
|
2
|
+
// import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
|
3
|
+
// import { Button } from '@/components/ui/button';
|
|
4
|
+
// import { RefreshCw, TrendingUp, PieChart, Clock } from 'lucide-react';
|
|
5
|
+
// import { Link } from 'react-router-dom';
|
|
6
|
+
// import { useRecordData } from '@/hooks/use-example';
|
|
7
|
+
|
|
8
|
+
// export default function ExamplePage() {
|
|
9
|
+
// const { record, loading, error, refetch } = useRecordData();
|
|
10
|
+
// const [dimension, setDimension] = useState<'month' | 'quarter' | 'year'>('month');
|
|
11
|
+
|
|
12
|
+
// if (loading) {
|
|
13
|
+
// return (
|
|
14
|
+
// <div className="flex items-center justify-center h-64">
|
|
15
|
+
// <div className="text-muted-foreground">加载中...</div>
|
|
16
|
+
// </div>
|
|
17
|
+
// );
|
|
18
|
+
// }
|
|
19
|
+
|
|
20
|
+
// if (error) {
|
|
21
|
+
// return (
|
|
22
|
+
// <div className="flex flex-col items-center justify-center h-64 space-y-4">
|
|
23
|
+
// <div className="text-destructive">{error}</div>
|
|
24
|
+
// <Button onClick={refetch} variant="outline" size="sm">
|
|
25
|
+
// <RefreshCw className="h-4 w-4 mr-2" />
|
|
26
|
+
// 重试
|
|
27
|
+
// </Button>
|
|
28
|
+
// </div>
|
|
29
|
+
// );
|
|
30
|
+
// }
|
|
31
|
+
|
|
32
|
+
// return (
|
|
33
|
+
// <div className="space-y-6">
|
|
34
|
+
// {/* 页面内容 */}
|
|
35
|
+
// </div>
|
|
36
|
+
// );
|
|
37
|
+
// }
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--button-outline: rgba(0,0,0, .10);
|
|
3
|
+
--badge-outline: rgba(0,0,0, .05);
|
|
4
|
+
|
|
5
|
+
/* Automatic computation of border around primary / danger buttons */
|
|
6
|
+
--opaque-button-border-intensity: -8; /* In terms of percentages */
|
|
7
|
+
|
|
8
|
+
/* Backgrounds applied on top of other backgrounds when hovered/active */
|
|
9
|
+
--elevate-1: rgba(0,0,0, .03);
|
|
10
|
+
--elevate-2: rgba(0,0,0, .08);
|
|
11
|
+
|
|
12
|
+
--background: hsl(0 0% 100%);
|
|
13
|
+
--foreground: hsl(220 14% 14%);
|
|
14
|
+
--card: hsl(0 0% 100%);
|
|
15
|
+
--card-foreground: hsl(220 14% 14%);
|
|
16
|
+
--popover: hsl(0 0% 100%);
|
|
17
|
+
--popover-foreground: hsl(220 14% 14%);
|
|
18
|
+
--primary: hsl(221 83% 53%);
|
|
19
|
+
--primary-foreground: hsl(220 14% 98%);
|
|
20
|
+
--secondary: hsl(220 14% 96%);
|
|
21
|
+
--secondary-foreground: hsl(220 14% 14%);
|
|
22
|
+
--muted: hsl(220 14% 96%);
|
|
23
|
+
--muted-foreground: hsl(218 7% 59%);
|
|
24
|
+
--accent: hsl(220 14% 96%);
|
|
25
|
+
--accent-foreground: hsl(220 14% 14%);
|
|
26
|
+
--info: hsl(221 83% 53%);
|
|
27
|
+
--info-foreground: hsl(230 100% 98%);
|
|
28
|
+
--destructive: hsl(2 84% 62%);
|
|
29
|
+
--destructive-foreground: hsl(0 0% 100%);
|
|
30
|
+
--success: hsl(130 54% 42%);
|
|
31
|
+
--success-foreground: hsl(115 77% 97%);
|
|
32
|
+
--warning: hsl(26 90% 49%);
|
|
33
|
+
--warning-foreground: hsl(33 100% 96%);
|
|
34
|
+
--border: hsl(220 14% 89%);
|
|
35
|
+
--input: hsl(220 14% 89%);
|
|
36
|
+
--ring: hsl(221 83% 53%);
|
|
37
|
+
--chart-1: hsl(222 82% 56%);
|
|
38
|
+
--chart-2: hsl(174 77% 46%);
|
|
39
|
+
--chart-3: hsl(46 100% 52%);
|
|
40
|
+
--chart-4: hsl(27 92% 49%);
|
|
41
|
+
--chart-5: hsl(292 54% 76%);
|
|
42
|
+
--sidebar: hsl(220 14% 96%);
|
|
43
|
+
--sidebar-foreground: hsl(220 14% 14%);
|
|
44
|
+
--sidebar-primary: hsl(221 83% 53%);
|
|
45
|
+
--sidebar-primary-foreground: hsl(220 14% 98%);
|
|
46
|
+
--sidebar-accent: hsl(222 100% 94%);
|
|
47
|
+
--sidebar-accent-foreground: hsl(221 83% 53%);
|
|
48
|
+
--sidebar-border: hsl(220 14% 89%);
|
|
49
|
+
--sidebar-ring: hsl(221 83% 53%);
|
|
50
|
+
|
|
51
|
+
/* Computed borders using hsl relative color syntax */
|
|
52
|
+
--primary-border: hsl(from hsl(221 83% 53%) h s calc(l + var(--opaque-button-border-intensity)));
|
|
53
|
+
--secondary-border: hsl(from hsl(220 14% 96%) h s calc(l + var(--opaque-button-border-intensity)));
|
|
54
|
+
--destructive-border: hsl(from hsl(2 84% 62%) h s calc(l + var(--opaque-button-border-intensity)));
|
|
55
|
+
--accent-border: hsl(from hsl(220 14% 96%) h s calc(l + var(--opaque-button-border-intensity)));
|
|
56
|
+
--muted-border: hsl(from hsl(220 14% 96%) h s calc(l + var(--opaque-button-border-intensity)));
|
|
57
|
+
--font-sans:
|
|
58
|
+
'LarkHackSafariFont', 'LarkEmojiFont', 'LarkChineseQuote', '-apple-system',
|
|
59
|
+
'BlinkMacSystemFont', 'Helvetica Neue', 'Tahoma', 'PingFang SC',
|
|
60
|
+
'Microsoft Yahei', 'Arial', 'Hiragino Sans GB', 'sans-serif',
|
|
61
|
+
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
|
62
|
+
--font-serif:
|
|
63
|
+
'Geist', 'Geist Fallback', ui-serif, Georgia, Cambria, 'Times New Roman',
|
|
64
|
+
Times, serif;
|
|
65
|
+
--font-mono: Source Code Pro, monospace;
|
|
66
|
+
--radius: 0.5rem;
|
|
67
|
+
--shadow-x: 0px;
|
|
68
|
+
--shadow-y: 2px;
|
|
69
|
+
--shadow-blur: 12px;
|
|
70
|
+
--shadow-spread: 0px;
|
|
71
|
+
--shadow-opacity: 0.02;
|
|
72
|
+
--shadow-color: #000000;
|
|
73
|
+
--shadow-2xs: 0px 2px 12px 0px hsl(0 0% 0% / 0.01);
|
|
74
|
+
--shadow-xs: 0px 2px 12px 0px hsl(0 0% 0% / 0.01);
|
|
75
|
+
--shadow-sm:
|
|
76
|
+
0px 2px 12px 0px hsl(0 0% 0% / 0.02), 0px 1px 2px -1px hsl(0 0% 0% / 0.02);
|
|
77
|
+
--shadow:
|
|
78
|
+
0px 2px 12px 0px hsl(0 0% 0% / 0.02), 0px 1px 2px -1px hsl(0 0% 0% / 0.02);
|
|
79
|
+
--shadow-md:
|
|
80
|
+
0px 2px 12px 0px hsl(0 0% 0% / 0.02), 0px 2px 4px -1px hsl(0 0% 0% / 0.02);
|
|
81
|
+
--shadow-lg:
|
|
82
|
+
0px 2px 12px 0px hsl(0 0% 0% / 0.02), 0px 4px 6px -1px hsl(0 0% 0% / 0.02);
|
|
83
|
+
--shadow-xl:
|
|
84
|
+
0px 2px 12px 0px hsl(0 0% 0% / 0.02), 0px 8px 10px -1px hsl(0 0% 0% / 0.02);
|
|
85
|
+
--shadow-2xl: 0px 2px 12px 0px hsl(0 0% 0% / 0.05);
|
|
86
|
+
--tracking-normal: 0em;
|
|
87
|
+
--spacing: 0.25rem;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@theme inline {
|
|
91
|
+
--color-background: var(--background);
|
|
92
|
+
--color-foreground: var(--foreground);
|
|
93
|
+
--color-card: var(--card);
|
|
94
|
+
--color-card-foreground: var(--card-foreground);
|
|
95
|
+
--color-popover: var(--popover);
|
|
96
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
97
|
+
--color-primary: var(--primary);
|
|
98
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
99
|
+
--color-secondary: var(--secondary);
|
|
100
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
101
|
+
--color-muted: var(--muted);
|
|
102
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
103
|
+
--color-accent: var(--accent);
|
|
104
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
105
|
+
--color-info: var(--info);
|
|
106
|
+
--color-info-foreground: var(--info-foreground);
|
|
107
|
+
--color-destructive: var(--destructive);
|
|
108
|
+
--color-destructive-foreground: var(--destructive-foreground);
|
|
109
|
+
--color-success: var(--success);
|
|
110
|
+
--color-success-foreground: var(--success-foreground);
|
|
111
|
+
--color-warning: var(--warning);
|
|
112
|
+
--color-warning-foreground: var(--warning-foreground);
|
|
113
|
+
--color-border: var(--border);
|
|
114
|
+
--color-input: var(--input);
|
|
115
|
+
--color-ring: var(--ring);
|
|
116
|
+
--color-chart-1: var(--chart-1);
|
|
117
|
+
--color-chart-2: var(--chart-2);
|
|
118
|
+
--color-chart-3: var(--chart-3);
|
|
119
|
+
--color-chart-4: var(--chart-4);
|
|
120
|
+
--color-chart-5: var(--chart-5);
|
|
121
|
+
--color-sidebar: var(--sidebar);
|
|
122
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
123
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
124
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
125
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
126
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
127
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
128
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
129
|
+
|
|
130
|
+
--font-sans: var(--font-sans);
|
|
131
|
+
--font-mono: var(--font-mono);
|
|
132
|
+
--font-serif: var(--font-serif);
|
|
133
|
+
|
|
134
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
135
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
136
|
+
--radius-lg: var(--radius);
|
|
137
|
+
--radius-xl: calc(var(--radius) + 4px);
|
|
138
|
+
|
|
139
|
+
--shadow-2xs: var(--shadow-2xs);
|
|
140
|
+
--shadow-xs: var(--shadow-xs);
|
|
141
|
+
--shadow-sm: var(--shadow-sm);
|
|
142
|
+
--shadow: var(--shadow);
|
|
143
|
+
--shadow-md: var(--shadow-md);
|
|
144
|
+
--shadow-lg: var(--shadow-lg);
|
|
145
|
+
--shadow-xl: var(--shadow-xl);
|
|
146
|
+
--shadow-2xl: var(--shadow-2xl);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Using the elevate system.
|
|
151
|
+
* Automatic contrast adjustment.
|
|
152
|
+
*
|
|
153
|
+
* <element className="hover-elevate" />
|
|
154
|
+
* <element className="active-elevate-2" />
|
|
155
|
+
*
|
|
156
|
+
* // Using the tailwind utility when a data attribute is "on"
|
|
157
|
+
* <element className="toggle-elevate data-[state=on]:toggle-elevated" />
|
|
158
|
+
* // Or manually controlling the toggle state
|
|
159
|
+
* <element className="toggle-elevate toggle-elevated" />
|
|
160
|
+
*
|
|
161
|
+
* Elevation systems have to handle many states.
|
|
162
|
+
* - not-hovered, vs. hovered vs. active (three mutually exclusive states)
|
|
163
|
+
* - toggled or not
|
|
164
|
+
* - focused or not (this is not handled with these utilities)
|
|
165
|
+
*
|
|
166
|
+
* Even without handling focused or not, this is six possible combinations that
|
|
167
|
+
* need to be distinguished from eachother visually.
|
|
168
|
+
*/
|
|
169
|
+
@layer utilities {
|
|
170
|
+
/* Hide ugly search cancel button in Chrome until we can style it properly */
|
|
171
|
+
input[type="search"]::-webkit-search-cancel-button {
|
|
172
|
+
@apply hidden;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/* Placeholder styling for contentEditable div */
|
|
176
|
+
[contenteditable][data-placeholder]:empty::before {
|
|
177
|
+
content: attr(data-placeholder);
|
|
178
|
+
color: var(--muted-foreground);
|
|
179
|
+
pointer-events: none;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/* .no-default-hover-elevate/no-default-active-elevate is an escape hatch so consumers of
|
|
183
|
+
* buttons/badges can remove the automatic brightness adjustment on interactions
|
|
184
|
+
* and program their own. */
|
|
185
|
+
.no-default-hover-elevate {}
|
|
186
|
+
.no-default-active-elevate {}
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Toggleable backgrounds go behind the content. Hoverable/active goes on top.
|
|
191
|
+
* This way they can stack/compound. Both will overlap the parent's borders!
|
|
192
|
+
* So borders will be automatically adjusted both on toggle, and hover/active,
|
|
193
|
+
* and they will be compounded.
|
|
194
|
+
*/
|
|
195
|
+
.toggle-elevate::before,
|
|
196
|
+
.toggle-elevate-2::before {
|
|
197
|
+
content: "";
|
|
198
|
+
pointer-events: none;
|
|
199
|
+
position: absolute;
|
|
200
|
+
inset: 0px;
|
|
201
|
+
/*border-radius: inherit; match rounded corners */
|
|
202
|
+
border-radius: inherit;
|
|
203
|
+
z-index: -1;
|
|
204
|
+
/* sits behind content but above backdrop */
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.toggle-elevate.toggle-elevated::before {
|
|
208
|
+
background-color: var(--elevate-2);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/* If there's a 1px border, adjust the inset so that it covers that parent's border */
|
|
212
|
+
.border.toggle-elevate::before {
|
|
213
|
+
inset: -1px;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/* Does not work on elements with overflow:hidden! */
|
|
217
|
+
.hover-elevate:not(.no-default-hover-elevate),
|
|
218
|
+
.active-elevate:not(.no-default-active-elevate),
|
|
219
|
+
.hover-elevate-2:not(.no-default-hover-elevate),
|
|
220
|
+
.active-elevate-2:not(.no-default-active-elevate) {
|
|
221
|
+
position: relative;
|
|
222
|
+
z-index: 0;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.hover-elevate:not(.no-default-hover-elevate)::after,
|
|
226
|
+
.active-elevate:not(.no-default-active-elevate)::after,
|
|
227
|
+
.hover-elevate-2:not(.no-default-hover-elevate)::after,
|
|
228
|
+
.active-elevate-2:not(.no-default-active-elevate)::after {
|
|
229
|
+
content: "";
|
|
230
|
+
pointer-events: none;
|
|
231
|
+
position: absolute;
|
|
232
|
+
inset: 0px;
|
|
233
|
+
/*border-radius: inherit; match rounded corners */
|
|
234
|
+
border-radius: inherit;
|
|
235
|
+
z-index: 999;
|
|
236
|
+
/* sits in front of content */
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.hover-elevate:hover:not(.no-default-hover-elevate)::after,
|
|
240
|
+
.active-elevate:active:not(.no-default-active-elevate)::after {
|
|
241
|
+
background-color: var(--elevate-1);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.hover-elevate-2:hover:not(.no-default-hover-elevate)::after,
|
|
245
|
+
.active-elevate-2:active:not(.no-default-active-elevate)::after {
|
|
246
|
+
background-color: var(--elevate-2);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/* If there's a 1px border, adjust the inset so that it covers that parent's border */
|
|
250
|
+
.border.hover-elevate:not(.no-hover-interaction-elevate)::after,
|
|
251
|
+
.border.active-elevate:not(.no-active-interaction-elevate)::after,
|
|
252
|
+
.border.hover-elevate-2:not(.no-hover-interaction-elevate)::after,
|
|
253
|
+
.border.active-elevate-2:not(.no-active-interaction-elevate)::after,
|
|
254
|
+
.border.hover-elevate:not(.no-hover-interaction-elevate)::after {
|
|
255
|
+
inset: -1px;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 用户状态枚举
|
|
3
|
+
*/
|
|
4
|
+
enum IUserStatus {
|
|
5
|
+
active = 1,
|
|
6
|
+
inactive = 2,
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* 用户信息类型
|
|
10
|
+
*/
|
|
11
|
+
export type IUserProfile = {
|
|
12
|
+
user_id: string;
|
|
13
|
+
email: string;
|
|
14
|
+
name: string;
|
|
15
|
+
avatar: string;
|
|
16
|
+
status: IUserStatus;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 文件类型
|
|
23
|
+
*/
|
|
24
|
+
export type IFileAttachment = {
|
|
25
|
+
bucket_id: string;
|
|
26
|
+
file_path: string;
|
|
27
|
+
};
|
|
28
|
+
declare global {
|
|
29
|
+
interface Window {
|
|
30
|
+
userId?: string;
|
|
31
|
+
token?: string;
|
|
32
|
+
csrfToken?: string;
|
|
33
|
+
}
|
|
34
|
+
}
|