@rynt/sdk 0.9.53
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/README.md +122 -0
- package/REGISTRIES.md +189 -0
- package/env.d.ts +11 -0
- package/host-shims.d.ts +30 -0
- package/package.json +88 -0
- package/src/extension-marketplace/api-types.ts +141 -0
- package/src/extension-marketplace/client.ts +296 -0
- package/src/extension-marketplace/index.ts +22 -0
- package/src/extension-marketplace/schemas.ts +178 -0
- package/src/extensions/ExtensionRoutePage.vue +17 -0
- package/src/extensions/context.ts +37 -0
- package/src/extensions/disabled-folder.ts +21 -0
- package/src/extensions/extension-expose-map.ts +5 -0
- package/src/extensions/extension-expose.ts +48 -0
- package/src/extensions/graph.ts +67 -0
- package/src/extensions/index.ts +251 -0
- package/src/extensions/invite-handler/types.ts +20 -0
- package/src/extensions/launcher-entities/create-launcher-entity.ts +25 -0
- package/src/extensions/launcher-entities/keys.ts +46 -0
- package/src/extensions/launcher-entities/launcher-entity-components.ts +177 -0
- package/src/extensions/launcher-entities/props-map.ts +69 -0
- package/src/extensions/launcher-entities/registry.ts +32 -0
- package/src/extensions/launcher-models/apis/accounts-contracts.ts +102 -0
- package/src/extensions/launcher-models/apis/launcher-model-apis.ts +553 -0
- package/src/extensions/launcher-models/keys.ts +23 -0
- package/src/extensions/launcher-models/public.ts +9 -0
- package/src/extensions/launcher-models/registry-core.ts +34 -0
- package/src/extensions/manifest-types.ts +22 -0
- package/src/extensions/manifest.ts +46 -0
- package/src/extensions/marketplace-open-key.ts +26 -0
- package/src/extensions/plugin-types.ts +44 -0
- package/src/extensions/plugin.ts +62 -0
- package/src/extensions/registries/bootstrap.ts +11 -0
- package/src/extensions/registries/builtins/account-provider.ts +6 -0
- package/src/extensions/registries/builtins/app-topbar-left-widgets.ts +6 -0
- package/src/extensions/registries/builtins/app-topbar-right-widgets.ts +6 -0
- package/src/extensions/registries/builtins/app-topbar-status-widgets.ts +6 -0
- package/src/extensions/registries/builtins/build-card-actions.ts +6 -0
- package/src/extensions/registries/builtins/build-card-after-meta.ts +6 -0
- package/src/extensions/registries/builtins/build-card-before-media.ts +6 -0
- package/src/extensions/registries/builtins/build-card-before-meta.ts +6 -0
- package/src/extensions/registries/builtins/build-card-footer-actions.ts +6 -0
- package/src/extensions/registries/builtins/build-detail-after-content.ts +6 -0
- package/src/extensions/registries/builtins/build-detail-before-content.ts +6 -0
- package/src/extensions/registries/builtins/build-detail-before-hero.ts +6 -0
- package/src/extensions/registries/builtins/build-detail-header-actions.ts +6 -0
- package/src/extensions/registries/builtins/build-detail-mod-row-actions.ts +6 -0
- package/src/extensions/registries/builtins/build-detail-resourcepack-row-actions.ts +6 -0
- package/src/extensions/registries/builtins/build-detail-right-column-bottom.ts +6 -0
- package/src/extensions/registries/builtins/build-detail-right-column-top.ts +6 -0
- package/src/extensions/registries/builtins/dialog-footer-actions.ts +6 -0
- package/src/extensions/registries/builtins/feed-after-content.ts +6 -0
- package/src/extensions/registries/builtins/feed-before-content.ts +6 -0
- package/src/extensions/registries/builtins/file-editor.ts +19 -0
- package/src/extensions/registries/builtins/friends-after-list.ts +6 -0
- package/src/extensions/registries/builtins/friends-before-list.ts +6 -0
- package/src/extensions/registries/builtins/index.ts +141 -0
- package/src/extensions/registries/builtins/invite-handler.ts +7 -0
- package/src/extensions/registries/builtins/library-after-content.ts +6 -0
- package/src/extensions/registries/builtins/library-before-content.ts +6 -0
- package/src/extensions/registries/builtins/loader.ts +8 -0
- package/src/extensions/registries/builtins/map-card-actions.ts +6 -0
- package/src/extensions/registries/builtins/map-card-after-meta.ts +6 -0
- package/src/extensions/registries/builtins/map-card-before-meta.ts +6 -0
- package/src/extensions/registries/builtins/map-card-footer-actions.ts +6 -0
- package/src/extensions/registries/builtins/map-detail-after-content.ts +6 -0
- package/src/extensions/registries/builtins/map-detail-before-content.ts +6 -0
- package/src/extensions/registries/builtins/map-detail-header-actions.ts +6 -0
- package/src/extensions/registries/builtins/markdown-editor-tiptap-extensions.ts +7 -0
- package/src/extensions/registries/builtins/markdown-editor-toolbar-actions.ts +6 -0
- package/src/extensions/registries/builtins/markdown-renderer-after-content.ts +6 -0
- package/src/extensions/registries/builtins/markdown-renderer-before-content.ts +6 -0
- package/src/extensions/registries/builtins/mod-details-footer-actions.ts +6 -0
- package/src/extensions/registries/builtins/mod-manage-actions.ts +6 -0
- package/src/extensions/registries/builtins/mod-provider.ts +5 -0
- package/src/extensions/registries/builtins/nav.ts +7 -0
- package/src/extensions/registries/builtins/page.ts +13 -0
- package/src/extensions/registries/builtins/projects-after-content.ts +6 -0
- package/src/extensions/registries/builtins/projects-before-content.ts +6 -0
- package/src/extensions/registries/builtins/resourcepack-manage-actions.ts +7 -0
- package/src/extensions/registries/builtins/server-card-actions.ts +6 -0
- package/src/extensions/registries/builtins/server-card-after-meta.ts +6 -0
- package/src/extensions/registries/builtins/server-card-before-meta.ts +6 -0
- package/src/extensions/registries/builtins/server-card-footer-actions.ts +6 -0
- package/src/extensions/registries/builtins/server-detail-after-content.ts +6 -0
- package/src/extensions/registries/builtins/server-detail-before-content.ts +6 -0
- package/src/extensions/registries/builtins/server-detail-header-actions.ts +6 -0
- package/src/extensions/registries/builtins/settings-after-sections.ts +6 -0
- package/src/extensions/registries/builtins/settings-before-sections.ts +6 -0
- package/src/extensions/registries/builtins/settings-section-widgets.ts +6 -0
- package/src/extensions/registries/builtins/shaderpack-manage-actions.ts +7 -0
- package/src/extensions/registries/builtins/shell.ts +5 -0
- package/src/extensions/registries/builtins/sidebar-after-content.ts +6 -0
- package/src/extensions/registries/builtins/sidebar-before-content.ts +6 -0
- package/src/extensions/registries/builtins/sidebar-footer-widgets.ts +6 -0
- package/src/extensions/registries/builtins/sidebar-header-widgets.ts +6 -0
- package/src/extensions/registries/builtins/sidebar.ts +11 -0
- package/src/extensions/registries/builtins/theme.ts +5 -0
- package/src/extensions/registries/builtins/user-card-after-meta.ts +6 -0
- package/src/extensions/registries/builtins/user-card-before-meta.ts +6 -0
- package/src/extensions/registries/builtins/user-menu-actions.ts +6 -0
- package/src/extensions/registries/builtins/user-menu-after-actions.ts +6 -0
- package/src/extensions/registries/builtins/user-menu-before-actions.ts +6 -0
- package/src/extensions/registries/builtins/user-strip.ts +5 -0
- package/src/extensions/registries/clear-extension-ui-registries.ts +15 -0
- package/src/extensions/registries/define-extension-registry.ts +58 -0
- package/src/extensions/registries/extension-host-api.ts +41 -0
- package/src/extensions/registries/extension-registry-api.ts +103 -0
- package/src/extensions/registries/extension-registry-payload-map.ts +9 -0
- package/src/extensions/registries/extension-scope.ts +41 -0
- package/src/extensions/registries/get-registry.ts +23 -0
- package/src/extensions/registries/index.ts +58 -0
- package/src/extensions/registries/manifest-rynt.ts +193 -0
- package/src/extensions/registries/registry-slot.ts +40 -0
- package/src/extensions/registries/registry-value-map.ts +89 -0
- package/src/extensions/registries/store.ts +206 -0
- package/src/extensions/resolve-extensions.ts +245 -0
- package/src/extensions/router-bridge.ts +103 -0
- package/src/extensions/session.ts +6 -0
- package/src/extensions/slug.ts +23 -0
- package/src/extensions/version.ts +147 -0
- package/src/host/extensions-composables.ts +33 -0
- package/src/host/extensions-init.ts +194 -0
- package/src/host/index.ts +11 -0
- package/src/host/launcher-models/index.ts +4 -0
- package/src/index.ts +229 -0
- package/src/minecraft-loader/base-loader.ts +102 -0
- package/src/minecraft-loader/index.ts +11 -0
- package/src/minecraft-loader/loader-registry.ts +72 -0
- package/src/shared/api/assets.ts +112 -0
- package/src/shared/api/auth.ts +283 -0
- package/src/shared/api/builds.ts +647 -0
- package/src/shared/api/config.ts +19 -0
- package/src/shared/api/download-stats.ts +103 -0
- package/src/shared/api/downloads.ts +36 -0
- package/src/shared/api/entity-authorship.ts +60 -0
- package/src/shared/api/events.ts +393 -0
- package/src/shared/api/friends.ts +140 -0
- package/src/shared/api/graphql.ts +87 -0
- package/src/shared/api/index.ts +23 -0
- package/src/shared/api/invites.ts +262 -0
- package/src/shared/api/library.ts +44 -0
- package/src/shared/api/maps.ts +385 -0
- package/src/shared/api/notify-websocket.ts +140 -0
- package/src/shared/api/posts.ts +357 -0
- package/src/shared/api/projectServers.ts +379 -0
- package/src/shared/api/serverMembers.ts +173 -0
- package/src/shared/api/users.ts +294 -0
- package/src/shared/composables/buildEditor/useBuildEditor.ts +66 -0
- package/src/shared/composables/buildManifest/buildManifest.ts +447 -0
- package/src/shared/composables/filesEditor/filesEditor.ts +346 -0
- package/src/shared/composables/index.ts +10 -0
- package/src/shared/composables/modsEditor/modsEditor.ts +1678 -0
- package/src/shared/composables/registrySlot/registry-slot-utils.ts +25 -0
- package/src/shared/composables/registrySlot/useRegistrySlotMissing.ts +35 -0
- package/src/shared/composables/resourcePacksEditor/resourcePacksEditor.ts +448 -0
- package/src/shared/composables/shaderPacksEditor/shaderPacksEditor.ts +395 -0
- package/src/shared/composables/useSkinRender.ts +70 -0
- package/src/shared/composables/useZlDeepLink.ts +178 -0
- package/src/shared/definitions/defineGraphCache.ts +216 -0
- package/src/shared/definitions/defineStore.ts +32 -0
- package/src/shared/definitions/index.ts +2 -0
- package/src/shared/minecraft-types/build-manifest.ts +611 -0
- package/src/shared/minecraft-types/index.ts +3 -0
- package/src/shared/minecraft-types/launcher-versions.ts +32 -0
- package/src/shared/minecraft-types/minecraft-launcher-types.ts +276 -0
- package/src/shared/mocks/index.ts +1 -0
- package/src/shared/mocks/navigation.ts +17 -0
- package/src/shared/mods/http.ts +45 -0
- package/src/shared/mods/index.ts +5 -0
- package/src/shared/mods/marketplace-editor-search.ts +266 -0
- package/src/shared/mods/marketplace-search-utils.ts +42 -0
- package/src/shared/mods/mod-marketplace-registry.ts +66 -0
- package/src/shared/mods/mod-marketplace-types.ts +28 -0
- package/src/shared/mods/providers/curseforge.ts +464 -0
- package/src/shared/mods/providers/index.ts +8 -0
- package/src/shared/mods/providers/modrinth.ts +402 -0
- package/src/shared/mods/resolve-mods-provider-loader-ids.ts +77 -0
- package/src/shared/mods/types.ts +76 -0
- package/src/shared/styles/index.css +713 -0
- package/src/shared/themes/index.ts +23 -0
- package/src/shared/themes/theme-tokens-black.json +126 -0
- package/src/shared/themes/theme-tokens-classic.json +126 -0
- package/src/shared/themes/theme-tokens-pink.json +126 -0
- package/src/shared/themes/theme-tokens.json +126 -0
- package/src/shared/themes/types.ts +85 -0
- package/src/shared/types/API_DOCUMENTATION.md +422 -0
- package/src/shared/types/account.ts +40 -0
- package/src/shared/types/build.ts +8 -0
- package/src/shared/types/entities.ts +181 -0
- package/src/shared/types/index.ts +6 -0
- package/src/shared/types/invite-payloads.ts +60 -0
- package/src/shared/types/navigation.ts +16 -0
- package/src/shared/types/running-build.ts +51 -0
- package/src/shared/types/serverMember.ts +17 -0
- package/src/shared/types/user.ts +55 -0
- package/src/shared/ui/base/Avatar.vue +262 -0
- package/src/shared/ui/base/Badge.vue +47 -0
- package/src/shared/ui/base/Button.vue +78 -0
- package/src/shared/ui/base/Divider.vue +42 -0
- package/src/shared/ui/base/Icon.vue +597 -0
- package/src/shared/ui/base/StatusIndicator.vue +44 -0
- package/src/shared/ui/base/index.ts +7 -0
- package/src/shared/ui/cards/InviteCard.vue +47 -0
- package/src/shared/ui/cards/index.ts +2 -0
- package/src/shared/ui/dialog/Dialog.vue +71 -0
- package/src/shared/ui/dialog/DialogContent.vue +31 -0
- package/src/shared/ui/dialog/DialogFooter.vue +14 -0
- package/src/shared/ui/dialog/DialogHeader.vue +41 -0
- package/src/shared/ui/dialog/index.ts +5 -0
- package/src/shared/ui/editors/AttachmentImagesEditor.vue +133 -0
- package/src/shared/ui/editors/ContentAttachmentsDisplay.vue +76 -0
- package/src/shared/ui/editors/MarkdownEditor.vue +956 -0
- package/src/shared/ui/editors/MarkdownRenderer.vue +299 -0
- package/src/shared/ui/editors/RichContentImageViewer.vue +85 -0
- package/src/shared/ui/editors/SocialPostMediaZone.vue +320 -0
- package/src/shared/ui/editors/index.ts +6 -0
- package/src/shared/ui/editors/markdown-editor-gallery.ts +234 -0
- package/src/shared/ui/editors/markdown-editor-image.ts +178 -0
- package/src/shared/ui/form/Checkbox.vue +38 -0
- package/src/shared/ui/form/FormField.vue +30 -0
- package/src/shared/ui/form/FormGrid.vue +38 -0
- package/src/shared/ui/form/ImageEditor.vue +598 -0
- package/src/shared/ui/form/Input.vue +72 -0
- package/src/shared/ui/form/Range.vue +65 -0
- package/src/shared/ui/form/Select.vue +76 -0
- package/src/shared/ui/form/Switch.vue +38 -0
- package/src/shared/ui/form/Textarea.vue +144 -0
- package/src/shared/ui/form/index.ts +9 -0
- package/src/shared/ui/index.ts +9 -0
- package/src/shared/ui/layout/BusyOverlay.vue +31 -0
- package/src/shared/ui/layout/Callout.vue +44 -0
- package/src/shared/ui/layout/Card.vue +38 -0
- package/src/shared/ui/layout/Container.vue +36 -0
- package/src/shared/ui/layout/EmptyState.vue +99 -0
- package/src/shared/ui/layout/EntityMediaRow.vue +54 -0
- package/src/shared/ui/layout/FilterResultsLayout.vue +22 -0
- package/src/shared/ui/layout/FloatingPanel.vue +37 -0
- package/src/shared/ui/layout/FullscreenDimmer.vue +11 -0
- package/src/shared/ui/layout/Grid.vue +40 -0
- package/src/shared/ui/layout/Inline.vue +59 -0
- package/src/shared/ui/layout/LoadingState.vue +39 -0
- package/src/shared/ui/layout/MediaBox.vue +47 -0
- package/src/shared/ui/layout/OverlayPanel.vue +28 -0
- package/src/shared/ui/layout/OverlayWaitPanel.vue +22 -0
- package/src/shared/ui/layout/PageSection.vue +43 -0
- package/src/shared/ui/layout/PageToolbar.vue +29 -0
- package/src/shared/ui/layout/Panel.vue +39 -0
- package/src/shared/ui/layout/ProgressBar.vue +49 -0
- package/src/shared/ui/layout/Section.vue +30 -0
- package/src/shared/ui/layout/SegmentedControl.vue +43 -0
- package/src/shared/ui/layout/SelectableCard.vue +46 -0
- package/src/shared/ui/layout/SelectableRow.vue +41 -0
- package/src/shared/ui/layout/Skeleton.vue +25 -0
- package/src/shared/ui/layout/SkeletonAvatar.vue +30 -0
- package/src/shared/ui/layout/SkeletonEntityCard.vue +20 -0
- package/src/shared/ui/layout/SkeletonFeedPost.vue +22 -0
- package/src/shared/ui/layout/SkeletonGrid.vue +18 -0
- package/src/shared/ui/layout/SkeletonListRow.vue +31 -0
- package/src/shared/ui/layout/SkeletonText.vue +25 -0
- package/src/shared/ui/layout/Stack.vue +42 -0
- package/src/shared/ui/layout/StateBlock.vue +44 -0
- package/src/shared/ui/layout/TwoPaneLayout.vue +35 -0
- package/src/shared/ui/layout/VirtualList.vue +160 -0
- package/src/shared/ui/layout/index.ts +35 -0
- package/src/shared/ui/layout/skeletonSurfaceStyles.ts +24 -0
- package/src/shared/ui/navigation/NavItem.vue +139 -0
- package/src/shared/ui/navigation/Tab.vue +61 -0
- package/src/shared/ui/navigation/Tabs.vue +37 -0
- package/src/shared/ui/navigation/index.ts +4 -0
- package/src/shared/ui/primitives/Action.vue +19 -0
- package/src/shared/ui/primitives/Block.vue +28 -0
- package/src/shared/ui/primitives/CanvasView.vue +19 -0
- package/src/shared/ui/primitives/Control.vue +24 -0
- package/src/shared/ui/primitives/ControlSelect.vue +19 -0
- package/src/shared/ui/primitives/ControlTextarea.vue +17 -0
- package/src/shared/ui/primitives/FieldLabel.vue +19 -0
- package/src/shared/ui/primitives/Form.vue +19 -0
- package/src/shared/ui/primitives/Heading.vue +29 -0
- package/src/shared/ui/primitives/Image.vue +17 -0
- package/src/shared/ui/primitives/LineBreak.vue +3 -0
- package/src/shared/ui/primitives/Link.vue +19 -0
- package/src/shared/ui/primitives/List.vue +28 -0
- package/src/shared/ui/primitives/ListItem.vue +19 -0
- package/src/shared/ui/primitives/OptionItem.vue +19 -0
- package/src/shared/ui/primitives/Text.vue +28 -0
- package/src/shared/ui/primitives/VideoView.vue +19 -0
- package/src/shared/ui/primitives/index.ts +19 -0
- package/src/shared/ui/primitives/resolveElement.ts +25 -0
- package/src/shared/ui/special/AngularAccent.vue +106 -0
- package/src/shared/ui/special/ExtensionRegistrySlotButton.vue +143 -0
- package/src/shared/ui/special/InfoRow.vue +39 -0
- package/src/shared/ui/special/LogViewer.vue +53 -0
- package/src/shared/ui/special/PageHeader.vue +23 -0
- package/src/shared/ui/special/RegistrySlotMissingCallout.vue +48 -0
- package/src/shared/ui/special/WelcomeCard.vue +32 -0
- package/src/shared/ui/special/index.ts +9 -0
- package/src/shared/utils/app-paths.ts +50 -0
- package/src/shared/utils/attachments.ts +16 -0
- package/src/shared/utils/autostart.ts +213 -0
- package/src/shared/utils/build-files.ts +439 -0
- package/src/shared/utils/build-manifest-init.ts +176 -0
- package/src/shared/utils/cloudinary.ts +67 -0
- package/src/shared/utils/cn.ts +7 -0
- package/src/shared/utils/download-stats-week.ts +165 -0
- package/src/shared/utils/entity-api-to-cache.ts +84 -0
- package/src/shared/utils/entity-build-from-api.ts +1 -0
- package/src/shared/utils/entity-display.ts +27 -0
- package/src/shared/utils/entity-map-from-api.ts +1 -0
- package/src/shared/utils/file-hash.ts +65 -0
- package/src/shared/utils/formatSize.ts +5 -0
- package/src/shared/utils/formatTime.ts +157 -0
- package/src/shared/utils/getAccountSkinRender.ts +32 -0
- package/src/shared/utils/index.ts +34 -0
- package/src/shared/utils/local-mods.ts +678 -0
- package/src/shared/utils/local-settings.ts +217 -0
- package/src/shared/utils/member-join-stats.ts +35 -0
- package/src/shared/utils/platform.ts +86 -0
- package/src/shared/utils/play-host-slug.ts +92 -0
- package/src/shared/utils/rich-content.ts +294 -0
- package/src/shared/utils/safeRequest.ts +23 -0
- package/src/shared/utils/semver.ts +81 -0
- package/src/shared/utils/serverPermissions.ts +155 -0
- package/src/shared/utils/skin-render-cache.ts +372 -0
- package/src/shared/utils/stripMarkdown.ts +45 -0
- package/src/shared/utils/transliterate.ts +74 -0
- package/src/shared/utils/updateAccountSkinRender.ts +64 -0
- package/src/shared/utils/updater.ts +218 -0
- package/src/shared/utils/uploadImage.ts +195 -0
- package/src/shared/utils/user-status.ts +9 -0
- package/src/tiptap/index.ts +7 -0
- package/tsconfig.json +13 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="space-y-1.5">
|
|
3
|
+
<label v-if="label" class="block text-muted-foreground mb-1.5 text-sm font-medium">
|
|
4
|
+
{{ label }}
|
|
5
|
+
<span v-if="showValue" class="text-accent-secondary">{{ formattedValue }}</span>
|
|
6
|
+
</label>
|
|
7
|
+
<div class="relative">
|
|
8
|
+
<input :id="inputId" type="range" :min="min" :max="max" :step="step" :value="modelValue" :disabled="disabled"
|
|
9
|
+
class="w-full h-2 bg-surface-overlay appearance-none cursor-pointer accent-primary disabled:opacity-50 disabled:cursor-not-allowed"
|
|
10
|
+
:class="inputClass" @input="handleInput" />
|
|
11
|
+
</div>
|
|
12
|
+
<div v-if="showLabels" class="flex justify-between text-xs text-muted-foreground">
|
|
13
|
+
<span>{{ minLabel || min }}</span>
|
|
14
|
+
<span>{{ maxLabel || max }}</span>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
import { computed } from 'vue';
|
|
21
|
+
|
|
22
|
+
const props = withDefaults(
|
|
23
|
+
defineProps<{
|
|
24
|
+
modelValue: number;
|
|
25
|
+
min?: number;
|
|
26
|
+
max?: number;
|
|
27
|
+
step?: number;
|
|
28
|
+
label?: string;
|
|
29
|
+
showValue?: boolean;
|
|
30
|
+
showLabels?: boolean;
|
|
31
|
+
minLabel?: string;
|
|
32
|
+
maxLabel?: string;
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
inputClass?: string;
|
|
35
|
+
unit?: string;
|
|
36
|
+
}>(),
|
|
37
|
+
{
|
|
38
|
+
min: 0,
|
|
39
|
+
max: 100,
|
|
40
|
+
step: 1,
|
|
41
|
+
showValue: false,
|
|
42
|
+
showLabels: false,
|
|
43
|
+
disabled: false,
|
|
44
|
+
unit: '',
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
const emit = defineEmits<{
|
|
49
|
+
'update:modelValue': [value: number];
|
|
50
|
+
}>();
|
|
51
|
+
|
|
52
|
+
const inputId = `range-${Math.random().toString(36).substr(2, 9)}`;
|
|
53
|
+
|
|
54
|
+
const formattedValue = computed(() => {
|
|
55
|
+
if (props.unit) {
|
|
56
|
+
return `${props.modelValue} ${props.unit}`;
|
|
57
|
+
}
|
|
58
|
+
return props.modelValue.toString();
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const handleInput = (event: Event) => {
|
|
62
|
+
const target = event.target as HTMLInputElement;
|
|
63
|
+
emit('update:modelValue', Number(target.value));
|
|
64
|
+
};
|
|
65
|
+
</script>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="relative">
|
|
3
|
+
<select
|
|
4
|
+
:value="modelValue"
|
|
5
|
+
:disabled="disabled"
|
|
6
|
+
:class="selectClasses"
|
|
7
|
+
@change="handleChange"
|
|
8
|
+
>
|
|
9
|
+
<option v-if="placeholder" value="" disabled>{{ placeholder }}</option>
|
|
10
|
+
<option
|
|
11
|
+
v-for="option in options"
|
|
12
|
+
:key="String(option.value)"
|
|
13
|
+
:value="String(option.value)"
|
|
14
|
+
>
|
|
15
|
+
{{ option.label }}
|
|
16
|
+
</option>
|
|
17
|
+
<slot />
|
|
18
|
+
</select>
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script setup lang="ts">
|
|
23
|
+
import { computed } from 'vue';
|
|
24
|
+
import { cn } from '../../utils/cn';
|
|
25
|
+
|
|
26
|
+
interface Option {
|
|
27
|
+
label: string;
|
|
28
|
+
value: string | number | boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface Props {
|
|
32
|
+
modelValue?: string | number | boolean;
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
size?: 'sm' | 'md' | 'lg';
|
|
35
|
+
error?: boolean;
|
|
36
|
+
options?: Option[];
|
|
37
|
+
placeholder?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
41
|
+
size: 'md',
|
|
42
|
+
disabled: false,
|
|
43
|
+
error: false,
|
|
44
|
+
options: () => [],
|
|
45
|
+
placeholder: '',
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const emit = defineEmits<{
|
|
49
|
+
'update:modelValue': [value: string | number | boolean];
|
|
50
|
+
}>();
|
|
51
|
+
|
|
52
|
+
const handleChange = (event: Event) => {
|
|
53
|
+
const target = event.target as HTMLSelectElement;
|
|
54
|
+
const value = target.value;
|
|
55
|
+
// Преобразуем значение обратно в нужный тип
|
|
56
|
+
const option = props.options.find((opt) => String(opt.value) === value);
|
|
57
|
+
emit('update:modelValue', option ? option.value : value);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const sizeClasses = {
|
|
61
|
+
sm: 'px-2 py-1 text-xs',
|
|
62
|
+
md: 'px-3 py-2 text-sm',
|
|
63
|
+
lg: 'px-4 py-2.5 text-base',
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const selectClasses = computed(() => {
|
|
67
|
+
return cn(
|
|
68
|
+
'w-full bg-surface-overlay text-foreground border border-border focus:outline-none transition-colors appearance-none rounded',
|
|
69
|
+
sizeClasses[props.size],
|
|
70
|
+
props.error
|
|
71
|
+
? 'border-destructive focus:ring-2 focus:ring-destructive'
|
|
72
|
+
: 'focus:border-accent-secondary focus:ring-2 focus:ring-ring/60',
|
|
73
|
+
props.disabled && 'opacity-50 cursor-not-allowed',
|
|
74
|
+
);
|
|
75
|
+
});
|
|
76
|
+
</script>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<label :class="labelClasses">
|
|
3
|
+
<input
|
|
4
|
+
type="checkbox"
|
|
5
|
+
:checked="modelValue"
|
|
6
|
+
:disabled="disabled"
|
|
7
|
+
class="rnt-switch-input"
|
|
8
|
+
@change="
|
|
9
|
+
$emit('update:modelValue', ($event.target as HTMLInputElement).checked)
|
|
10
|
+
"
|
|
11
|
+
/>
|
|
12
|
+
<span class="rnt-switch-track" aria-hidden="true">
|
|
13
|
+
<span class="rnt-switch-thumb" />
|
|
14
|
+
</span>
|
|
15
|
+
</label>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script setup lang="ts">
|
|
19
|
+
import { computed } from 'vue';
|
|
20
|
+
import { cn } from '../../utils/cn';
|
|
21
|
+
|
|
22
|
+
interface Props {
|
|
23
|
+
modelValue?: boolean;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
28
|
+
disabled: false,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
defineEmits<{
|
|
32
|
+
'update:modelValue': [value: boolean];
|
|
33
|
+
}>();
|
|
34
|
+
|
|
35
|
+
const labelClasses = computed(() => {
|
|
36
|
+
return cn('rnt-switch', props.disabled && 'rnt-switch--disabled');
|
|
37
|
+
});
|
|
38
|
+
</script>
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="relative">
|
|
3
|
+
<textarea
|
|
4
|
+
ref="textareaRef"
|
|
5
|
+
:value="modelValue"
|
|
6
|
+
:placeholder="placeholder"
|
|
7
|
+
:disabled="disabled"
|
|
8
|
+
:rows="rows"
|
|
9
|
+
:maxlength="maxlength"
|
|
10
|
+
:class="textareaClasses"
|
|
11
|
+
:style="textareaStyle"
|
|
12
|
+
@input="handleInput"
|
|
13
|
+
@blur="$emit('blur', $event)"
|
|
14
|
+
@focus="$emit('focus', $event)"
|
|
15
|
+
/>
|
|
16
|
+
<div
|
|
17
|
+
v-if="isShowCount && maxlength"
|
|
18
|
+
class="absolute bottom-2 right-2 text-xs text-subtle-fg pointer-events-none"
|
|
19
|
+
>
|
|
20
|
+
{{ charCount }}/{{ maxlength }}
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script setup lang="ts">
|
|
26
|
+
import type { CSSProperties } from 'vue';
|
|
27
|
+
import { computed, ref, watch, nextTick, onMounted } from 'vue';
|
|
28
|
+
import { cn } from '../../utils/cn';
|
|
29
|
+
|
|
30
|
+
interface Props {
|
|
31
|
+
modelValue?: string;
|
|
32
|
+
placeholder?: string;
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
rows?: number;
|
|
35
|
+
error?: boolean;
|
|
36
|
+
resize?: boolean;
|
|
37
|
+
maxlength?: number;
|
|
38
|
+
showCharCount?: boolean | number;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
42
|
+
rows: 4,
|
|
43
|
+
disabled: false,
|
|
44
|
+
error: false,
|
|
45
|
+
resize: false,
|
|
46
|
+
showCharCount: false,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const isShowCount = computed(() =>
|
|
50
|
+
typeof props.showCharCount === 'number'
|
|
51
|
+
? (props.modelValue || '').length >= props.showCharCount
|
|
52
|
+
: props.showCharCount,
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
const emit = defineEmits<{
|
|
56
|
+
'update:modelValue': [value: string];
|
|
57
|
+
blur: [event: FocusEvent];
|
|
58
|
+
focus: [event: FocusEvent];
|
|
59
|
+
}>();
|
|
60
|
+
|
|
61
|
+
const textareaRef = ref<HTMLTextAreaElement | null>(null);
|
|
62
|
+
const textareaHeight = ref<number | null>(null);
|
|
63
|
+
const isMaxHeight = ref(false);
|
|
64
|
+
|
|
65
|
+
const charCount = computed(() => {
|
|
66
|
+
return props.modelValue?.length || 0;
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const textareaClasses = computed(() => {
|
|
70
|
+
return cn(
|
|
71
|
+
'w-full bg-surface-overlay text-foreground border border-border px-3 py-2 text-sm focus:outline-none transition-colors rounded',
|
|
72
|
+
props.error
|
|
73
|
+
? 'border-destructive focus:ring-2 focus:ring-destructive'
|
|
74
|
+
: 'focus:border-accent-secondary focus:ring-2 focus:ring-ring/60',
|
|
75
|
+
!props.resize && 'resize-none',
|
|
76
|
+
props.disabled && 'opacity-50 cursor-not-allowed',
|
|
77
|
+
isShowCount.value && 'pb-6', // Добавляем отступ снизу для счетчика
|
|
78
|
+
);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
const textareaStyle = computed((): CSSProperties => {
|
|
82
|
+
if (textareaHeight.value !== null) {
|
|
83
|
+
return {
|
|
84
|
+
height: `${textareaHeight.value}px`,
|
|
85
|
+
overflowY: isMaxHeight.value ? 'auto' : 'hidden',
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
return {};
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
// Автоматическое изменение высоты при изменении содержимого
|
|
92
|
+
const adjustHeight = () => {
|
|
93
|
+
if (!textareaRef.value) return;
|
|
94
|
+
|
|
95
|
+
const textarea = textareaRef.value;
|
|
96
|
+
|
|
97
|
+
// Сбрасываем высоту, чтобы получить правильный scrollHeight
|
|
98
|
+
if (textareaHeight.value !== null) {
|
|
99
|
+
textarea.style.height = 'auto';
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Получаем scrollHeight (высота содержимого)
|
|
103
|
+
const scrollHeight = textarea.scrollHeight;
|
|
104
|
+
|
|
105
|
+
// Вычисляем минимальную высоту на основе rows
|
|
106
|
+
const lineHeight = parseFloat(getComputedStyle(textarea).lineHeight) || 20;
|
|
107
|
+
const minHeight = lineHeight * props.rows;
|
|
108
|
+
|
|
109
|
+
// Максимальная высота (примерно 10 строк)
|
|
110
|
+
const maxHeight = lineHeight * 10;
|
|
111
|
+
|
|
112
|
+
// Устанавливаем высоту (минимум minHeight, максимум maxHeight или scrollHeight)
|
|
113
|
+
const newHeight = Math.min(Math.max(minHeight, scrollHeight), maxHeight);
|
|
114
|
+
textareaHeight.value = newHeight;
|
|
115
|
+
isMaxHeight.value = scrollHeight > maxHeight;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
const handleInput = (event: Event) => {
|
|
119
|
+
const target = event.target as HTMLTextAreaElement;
|
|
120
|
+
emit('update:modelValue', target.value);
|
|
121
|
+
|
|
122
|
+
// Автоматически изменяем высоту
|
|
123
|
+
nextTick(() => {
|
|
124
|
+
adjustHeight();
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
// Отслеживаем изменения modelValue для автоизменения высоты
|
|
129
|
+
watch(
|
|
130
|
+
() => props.modelValue,
|
|
131
|
+
() => {
|
|
132
|
+
nextTick(() => {
|
|
133
|
+
adjustHeight();
|
|
134
|
+
});
|
|
135
|
+
},
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
// Инициализируем высоту при монтировании
|
|
139
|
+
onMounted(() => {
|
|
140
|
+
nextTick(() => {
|
|
141
|
+
adjustHeight();
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
</script>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as Input } from './Input.vue';
|
|
2
|
+
export { default as Textarea } from './Textarea.vue';
|
|
3
|
+
export { default as Select } from './Select.vue';
|
|
4
|
+
export { default as Checkbox } from './Checkbox.vue';
|
|
5
|
+
export { default as Switch } from './Switch.vue';
|
|
6
|
+
export { default as Range } from './Range.vue';
|
|
7
|
+
export { default as ImageEditor } from './ImageEditor.vue';
|
|
8
|
+
export { default as FormField } from './FormField.vue';
|
|
9
|
+
export { default as FormGrid } from './FormGrid.vue';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Block
|
|
3
|
+
class="absolute inset-0 bg-background/65 backdrop-blur-sm z-10 flex items-center justify-center pointer-events-none"
|
|
4
|
+
>
|
|
5
|
+
<Block class="text-center pointer-events-auto">
|
|
6
|
+
<Icon
|
|
7
|
+
:name="icon"
|
|
8
|
+
size="lg"
|
|
9
|
+
class="mx-auto mb-2 animate-spin text-accent-secondary"
|
|
10
|
+
/>
|
|
11
|
+
<Text class="text-muted-foreground text-sm">{{ message }}</Text>
|
|
12
|
+
</Block>
|
|
13
|
+
</Block>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup lang="ts">
|
|
17
|
+
import { Icon } from '../base';
|
|
18
|
+
import Block from '../primitives/Block.vue';
|
|
19
|
+
import Text from '../primitives/Text.vue';
|
|
20
|
+
|
|
21
|
+
withDefaults(
|
|
22
|
+
defineProps<{
|
|
23
|
+
message?: string;
|
|
24
|
+
icon?: string;
|
|
25
|
+
}>(),
|
|
26
|
+
{
|
|
27
|
+
message: 'Загрузка...',
|
|
28
|
+
icon: 'refresh-cw',
|
|
29
|
+
},
|
|
30
|
+
);
|
|
31
|
+
</script>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="classes">
|
|
3
|
+
<Icon v-if="icon" :name="icon" size="sm" class="mt-0.5 shrink-0" />
|
|
4
|
+
<div class="min-w-0">
|
|
5
|
+
<div v-if="title" class="font-medium">
|
|
6
|
+
{{ title }}
|
|
7
|
+
</div>
|
|
8
|
+
<div v-if="description" class="text-sm opacity-90">
|
|
9
|
+
{{ description }}
|
|
10
|
+
</div>
|
|
11
|
+
<slot />
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup lang="ts">
|
|
17
|
+
import { computed } from 'vue';
|
|
18
|
+
import { Icon } from '../base';
|
|
19
|
+
import { cn } from '../../utils/cn';
|
|
20
|
+
|
|
21
|
+
const props = withDefaults(
|
|
22
|
+
defineProps<{
|
|
23
|
+
tone?: 'info' | 'success' | 'warning' | 'error';
|
|
24
|
+
icon?: string;
|
|
25
|
+
title?: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
class?: string;
|
|
28
|
+
}>(),
|
|
29
|
+
{
|
|
30
|
+
tone: 'info',
|
|
31
|
+
},
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
const toneClasses = {
|
|
35
|
+
info: 'border-primary/40 bg-primary/10 text-primary',
|
|
36
|
+
success: 'border-success/40 bg-success/10 text-success',
|
|
37
|
+
warning: 'border-warning/40 bg-warning/10 text-warning',
|
|
38
|
+
error: 'border-destructive/40 bg-destructive/10 text-destructive-soft',
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const classes = computed(() =>
|
|
42
|
+
cn('flex gap-2 border p-3', toneClasses[props.tone], props.class),
|
|
43
|
+
);
|
|
44
|
+
</script>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="cardClasses">
|
|
3
|
+
<slot />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
import { computed } from 'vue';
|
|
9
|
+
import { cn } from '../../utils/cn';
|
|
10
|
+
|
|
11
|
+
interface Props {
|
|
12
|
+
variant?: 'default' | 'hover';
|
|
13
|
+
angular?: boolean;
|
|
14
|
+
border?: boolean;
|
|
15
|
+
plain?: boolean;
|
|
16
|
+
class?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
20
|
+
variant: 'default',
|
|
21
|
+
angular: true,
|
|
22
|
+
border: false,
|
|
23
|
+
plain: false,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const cardClasses = computed(() => {
|
|
27
|
+
if (props.plain) {
|
|
28
|
+
return cn('rnt-card', props.class);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return cn(
|
|
32
|
+
'rnt-card',
|
|
33
|
+
'rnt-card--raised',
|
|
34
|
+
props.variant === 'hover' ? 'rnt-card--interactive group' : '',
|
|
35
|
+
props.class,
|
|
36
|
+
);
|
|
37
|
+
});
|
|
38
|
+
</script>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="containerClasses">
|
|
3
|
+
<slot />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
import { computed } from 'vue';
|
|
9
|
+
import { cn } from '../../utils/cn';
|
|
10
|
+
|
|
11
|
+
interface Props {
|
|
12
|
+
maxWidth?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '6xl' | 'full';
|
|
13
|
+
class?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
17
|
+
maxWidth: '6xl',
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const maxWidthClasses = {
|
|
21
|
+
sm: 'max-w-sm',
|
|
22
|
+
md: 'max-w-md',
|
|
23
|
+
lg: 'max-w-lg',
|
|
24
|
+
xl: 'max-w-xl',
|
|
25
|
+
'2xl': 'max-w-2xl',
|
|
26
|
+
'6xl': 'max-w-6xl',
|
|
27
|
+
full: 'max-w-full',
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const containerClasses = computed(() => {
|
|
31
|
+
return cn('mx-auto', maxWidthClasses[props.maxWidth], props.class);
|
|
32
|
+
});
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Card
|
|
3
|
+
v-if="variant === 'panel'"
|
|
4
|
+
border
|
|
5
|
+
:class="cn('text-center', density === 'comfortable' ? 'p-8' : 'p-6', containerClass)"
|
|
6
|
+
>
|
|
7
|
+
<Icon
|
|
8
|
+
v-if="icon"
|
|
9
|
+
:name="icon"
|
|
10
|
+
size="xl"
|
|
11
|
+
class="mx-auto mb-4 text-subtle-fg"
|
|
12
|
+
/>
|
|
13
|
+
<Text class="text-muted-foreground text-lg mb-2">{{ title }}</Text>
|
|
14
|
+
<Text v-if="description" class="text-subtle-fg text-sm mb-4">{{
|
|
15
|
+
description
|
|
16
|
+
}}</Text>
|
|
17
|
+
<Block v-if="actionLabel || $slots.action" class="mt-4 flex flex-col items-center gap-2">
|
|
18
|
+
<Button
|
|
19
|
+
v-if="actionLabel"
|
|
20
|
+
:variant="actionVariant"
|
|
21
|
+
size="md"
|
|
22
|
+
:angular="angularAction"
|
|
23
|
+
@click="$emit('action', $event)"
|
|
24
|
+
>
|
|
25
|
+
<Icon v-if="actionIcon" :name="actionIcon" size="sm" />
|
|
26
|
+
{{ actionLabel }}
|
|
27
|
+
</Button>
|
|
28
|
+
<slot name="action" />
|
|
29
|
+
</Block>
|
|
30
|
+
<slot />
|
|
31
|
+
</Card>
|
|
32
|
+
<Block v-else :class="wrapperClass">
|
|
33
|
+
<Icon
|
|
34
|
+
v-if="icon"
|
|
35
|
+
:name="icon"
|
|
36
|
+
size="xl"
|
|
37
|
+
class="mx-auto mb-4 text-subtle-fg"
|
|
38
|
+
/>
|
|
39
|
+
<Text class="text-muted-foreground text-lg mb-2">{{ title }}</Text>
|
|
40
|
+
<Text v-if="description" class="text-subtle-fg text-sm">{{ description }}</Text>
|
|
41
|
+
<Block v-if="actionLabel || $slots.action" class="mt-4 flex flex-col items-center gap-2">
|
|
42
|
+
<Button
|
|
43
|
+
v-if="actionLabel"
|
|
44
|
+
:variant="actionVariant"
|
|
45
|
+
size="md"
|
|
46
|
+
:angular="angularAction"
|
|
47
|
+
@click="$emit('action', $event)"
|
|
48
|
+
>
|
|
49
|
+
<Icon v-if="actionIcon" :name="actionIcon" size="sm" />
|
|
50
|
+
{{ actionLabel }}
|
|
51
|
+
</Button>
|
|
52
|
+
<slot name="action" />
|
|
53
|
+
</Block>
|
|
54
|
+
<slot />
|
|
55
|
+
</Block>
|
|
56
|
+
</template>
|
|
57
|
+
|
|
58
|
+
<script setup lang="ts">
|
|
59
|
+
import { computed } from 'vue';
|
|
60
|
+
import { cn } from '../../utils/cn';
|
|
61
|
+
import { Icon } from '../base';
|
|
62
|
+
import { Button } from '../base';
|
|
63
|
+
import Block from '../primitives/Block.vue';
|
|
64
|
+
import Card from './Card.vue';
|
|
65
|
+
import Text from '../primitives/Text.vue';
|
|
66
|
+
|
|
67
|
+
const props = withDefaults(
|
|
68
|
+
defineProps<{
|
|
69
|
+
title: string;
|
|
70
|
+
description?: string;
|
|
71
|
+
icon?: string;
|
|
72
|
+
density?: 'comfortable' | 'compact';
|
|
73
|
+
containerClass?: string;
|
|
74
|
+
variant?: 'plain' | 'panel';
|
|
75
|
+
actionLabel?: string;
|
|
76
|
+
actionIcon?: string;
|
|
77
|
+
actionVariant?: 'primary' | 'secondary' | 'danger' | 'ghost' | 'success' | 'warning';
|
|
78
|
+
angularAction?: boolean;
|
|
79
|
+
}>(),
|
|
80
|
+
{
|
|
81
|
+
density: 'comfortable',
|
|
82
|
+
variant: 'plain',
|
|
83
|
+
actionVariant: 'primary',
|
|
84
|
+
angularAction: true,
|
|
85
|
+
},
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
defineEmits<{
|
|
89
|
+
action: [event: MouseEvent];
|
|
90
|
+
}>();
|
|
91
|
+
|
|
92
|
+
const wrapperClass = computed(() =>
|
|
93
|
+
cn(
|
|
94
|
+
'text-center',
|
|
95
|
+
props.density === 'comfortable' ? 'py-12' : 'py-8',
|
|
96
|
+
props.containerClass,
|
|
97
|
+
),
|
|
98
|
+
);
|
|
99
|
+
</script>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="classes">
|
|
3
|
+
<MediaBox :src="image" :alt="title" :icon="icon" :size="mediaSize" />
|
|
4
|
+
<div class="min-w-0 flex-1">
|
|
5
|
+
<div class="flex items-center gap-2">
|
|
6
|
+
<div class="truncate text-sm font-medium text-foreground">
|
|
7
|
+
{{ title }}
|
|
8
|
+
</div>
|
|
9
|
+
<slot name="badges" />
|
|
10
|
+
</div>
|
|
11
|
+
<div v-if="description" class="mt-1 line-clamp-2 text-xs text-muted-foreground">
|
|
12
|
+
{{ description }}
|
|
13
|
+
</div>
|
|
14
|
+
<div
|
|
15
|
+
v-if="$slots.meta"
|
|
16
|
+
class="mt-1 flex items-center gap-2 text-xs text-subtle-fg"
|
|
17
|
+
>
|
|
18
|
+
<slot name="meta" />
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
<div v-if="$slots.actions" class="flex shrink-0 items-center gap-2">
|
|
22
|
+
<slot name="actions" />
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script setup lang="ts">
|
|
28
|
+
import { computed } from 'vue';
|
|
29
|
+
import type { ClassValue } from 'clsx';
|
|
30
|
+
import MediaBox from './MediaBox.vue';
|
|
31
|
+
import { cn } from '../../utils/cn';
|
|
32
|
+
|
|
33
|
+
const props = withDefaults(
|
|
34
|
+
defineProps<{
|
|
35
|
+
title: string;
|
|
36
|
+
description?: string | null;
|
|
37
|
+
image?: string | null;
|
|
38
|
+
icon?: string;
|
|
39
|
+
mediaSize?: 'sm' | 'md' | 'lg';
|
|
40
|
+
class?: ClassValue;
|
|
41
|
+
}>(),
|
|
42
|
+
{
|
|
43
|
+
icon: 'image',
|
|
44
|
+
mediaSize: 'md',
|
|
45
|
+
},
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
const classes = computed(() =>
|
|
49
|
+
cn(
|
|
50
|
+
'flex items-center gap-3 bg-surface-list p-3 transition-colors',
|
|
51
|
+
props.class,
|
|
52
|
+
),
|
|
53
|
+
);
|
|
54
|
+
</script>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<TwoPaneLayout :left-width="sidebarWidth" :class="wrapperClass">
|
|
3
|
+
<template #left>
|
|
4
|
+
<slot name="filters" />
|
|
5
|
+
</template>
|
|
6
|
+
<slot />
|
|
7
|
+
</TwoPaneLayout>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script setup lang="ts">
|
|
11
|
+
import TwoPaneLayout from './TwoPaneLayout.vue';
|
|
12
|
+
|
|
13
|
+
withDefaults(
|
|
14
|
+
defineProps<{
|
|
15
|
+
sidebarWidth?: 'sm' | 'md' | 'lg';
|
|
16
|
+
wrapperClass?: string;
|
|
17
|
+
}>(),
|
|
18
|
+
{
|
|
19
|
+
sidebarWidth: 'md',
|
|
20
|
+
},
|
|
21
|
+
);
|
|
22
|
+
</script>
|