@riducms/admin 0.2.3 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_NOTICES.md +60 -37
- package/package.json +29 -15
- package/src/app/admin-core-view-route.svelte +38 -53
- package/src/app/admin-extension-route.svelte +19 -0
- package/src/app/admin-layout.scss +175 -0
- package/src/app/admin-layout.svelte +144 -410
- package/src/app/admin-navigation-progress.svelte +11 -77
- package/src/app/admin-page-title.svelte +17 -85
- package/src/app/admin-page-title.ts +136 -0
- package/src/app/admin-route-error.svelte +24 -0
- package/src/app/admin-router-provider.svelte +34 -0
- package/src/app/admin-router-root.svelte +41 -0
- package/src/app/admin-routes.svelte +56 -19
- package/src/app/loading-boundary.svelte +3 -1
- package/src/app-meta.ts +13 -0
- package/src/app.css +138 -496
- package/src/app.svelte +60 -26
- package/src/components/brand/ridu-logo.svelte +19 -5
- package/src/components/data/list-table.scss +63 -0
- package/src/components/icons/LICENSE.md +24 -0
- package/src/components/icons/chevron.svelte +8 -0
- package/src/components/icons/plus.svelte +12 -0
- package/src/components/icons/search.svelte +12 -0
- package/src/components/icons/x.svelte +8 -0
- package/src/components/json-tree/json-tree-node.svelte +61 -67
- package/src/components/json-tree/json-viewer.scss +153 -0
- package/src/components/json-tree/json-viewer.svelte +57 -96
- package/src/components/ui/banner/banner.scss +28 -0
- package/src/components/ui/banner/banner.svelte +9 -8
- package/src/components/ui/banner/index.ts +1 -5
- package/src/components/ui/code-editor/code-editor.scss +20 -0
- package/src/components/ui/code-editor/code-editor.svelte +71 -0
- package/src/components/ui/code-editor/code-editor.ts +151 -0
- package/src/components/ui/code-editor/code-languages.ts +29 -0
- package/src/components/ui/collapsible-panel/collapsible-panel.scss +38 -0
- package/src/components/ui/collapsible-panel/collapsible-panel.svelte +13 -0
- package/src/components/ui/collapsible-panel/index.ts +1 -0
- package/src/components/ui/combobox/combobox.scss +163 -0
- package/src/components/ui/combobox/index.ts +22 -0
- package/src/components/ui/date-value-control/date-value-calendar.svelte +128 -16
- package/src/components/ui/date-value-control/date-value-control-loader.scss +26 -0
- package/src/components/ui/date-value-control/date-value-control-loader.svelte +35 -13
- package/src/components/ui/date-value-control/date-value-control.scss +223 -0
- package/src/components/ui/date-value-control/date-value-control.svelte +62 -44
- package/src/components/ui/drawer/drawer-depth.ts +8 -0
- package/src/components/ui/dropdown-menu/dropdown-menu-content.svelte +2 -5
- package/src/components/ui/dropdown-menu/dropdown-menu-item.svelte +2 -5
- package/src/components/ui/dropdown-menu/dropdown-menu-separator.svelte +2 -2
- package/src/components/ui/dropdown-menu/dropdown-menu.scss +62 -0
- package/src/components/ui/kbd/kbd.scss +17 -0
- package/src/components/ui/kbd/kbd.svelte +3 -10
- package/src/components/ui/navigation-drawer/navigation-drawer.scss +40 -0
- package/src/components/ui/navigation-drawer/navigation-drawer.svelte +38 -0
- package/src/components/ui/popover/popover-content.svelte +3 -5
- package/src/components/ui/popover/popover.scss +18 -0
- package/src/components/ui/radio-group/index.ts +0 -1
- package/src/components/ui/radio-group/radio-card-item.svelte +7 -12
- package/src/components/ui/radio-group/radio-group.svelte +2 -2
- package/src/components/ui/radio-group/radio.scss +45 -0
- package/src/components/ui/select/select-content.svelte +5 -6
- package/src/components/ui/select/select-item.svelte +8 -8
- package/src/components/ui/select/select-scroll-down-button.svelte +3 -5
- package/src/components/ui/select/select-scroll-up-button.svelte +3 -5
- package/src/components/ui/select/select-trigger.svelte +6 -7
- package/src/components/ui/select/select.scss +126 -0
- package/src/components/ui/sheet/sheet-content.svelte +6 -34
- package/src/components/ui/sheet/sheet-description.svelte +2 -2
- package/src/components/ui/sheet/sheet-overlay.svelte +2 -21
- package/src/components/ui/sheet/sheet-title.svelte +2 -2
- package/src/components/ui/sheet/sheet.scss +221 -0
- package/src/components/ui/skeleton/skeleton.scss +20 -0
- package/src/components/ui/skeleton/skeleton.svelte +4 -16
- package/src/components/ui/sonner/sonner.scss +121 -0
- package/src/components/ui/sonner/sonner.svelte +11 -10
- package/src/components/ui/status-indicator/status-indicator.scss +48 -0
- package/src/components/ui/status-indicator/status-indicator.svelte +14 -14
- package/src/components/ui/tabs/tabs-content.svelte +2 -2
- package/src/components/ui/tabs/tabs-list.svelte +7 -7
- package/src/components/ui/tabs/tabs-trigger.svelte +2 -8
- package/src/components/ui/tabs/tabs.scss +86 -0
- package/src/components/ui/tabs/tabs.svelte +2 -2
- package/src/components/ui/timezone-picker/timezone-picker.svelte +152 -0
- package/src/core/api/admin-client.ts +2 -2
- package/src/core/bootstrap/admin-bootstrap.ts +396 -0
- package/src/core/bootstrap/admin-prepared-state.ts +213 -0
- package/src/core/bootstrap/admin-route-modules.ts +66 -0
- package/src/core/clipboard/copy-feedback.svelte.ts +43 -0
- package/src/core/forms/embedded-fields.ts +4 -8
- package/src/core/forms/field-editor-authoring.ts +8 -0
- package/src/core/forms/field-issue-focus.ts +4 -4
- package/src/core/forms/field-occurrence.ts +4 -7
- package/src/core/forms/form-controller.svelte.ts +14 -21
- package/src/core/forms/form-draft-recovery.ts +17 -4
- package/src/core/forms/form-issue-correlation.ts +13 -13
- package/src/core/forms/form-path.ts +17 -0
- package/src/core/forms/form-schema.ts +12 -43
- package/src/core/forms/form-validation.ts +7 -46
- package/src/core/forms/plugin-field-authoring.ts +6 -2
- package/src/core/forms/plugin-field-write.ts +2 -6
- package/src/core/i18n/admin-i18n.svelte.ts +18 -0
- package/src/core/i18n/format-admin-date-time.ts +19 -0
- package/src/core/i18n/humanize-identifier.ts +5 -0
- package/src/core/i18n/time-zone-label.ts +20 -0
- package/src/core/loaders/admin-view-host.svelte +72 -0
- package/src/core/loaders/admin-view-loader.svelte.ts +90 -0
- package/src/core/notifications/validation-toast.svelte +2 -2
- package/src/core/plugins/field-registry.ts +7 -8
- package/src/core/routing/admin-paths.ts +53 -2
- package/src/core/routing/admin-scroll.svelte.ts +74 -0
- package/src/core/routing/admin-view-selection.ts +78 -0
- package/src/core/runtime/admin-runtime.svelte.ts +131 -135
- package/src/core/schema/field-default.ts +33 -0
- package/src/core/schema/field-localization.ts +15 -0
- package/src/core/schema/read-document-path.ts +11 -0
- package/src/features/account/account-menu.scss +37 -0
- package/src/features/account/account-menu.svelte +115 -0
- package/src/features/{auth → account}/account-navigation.svelte +16 -19
- package/src/features/{auth → account}/account-route.svelte +206 -49
- package/src/features/account/account-security-controller.svelte.ts +159 -0
- package/src/features/{auth → account}/account-security-route.svelte +140 -42
- package/src/features/api-reference/api-reference-code.svelte +114 -0
- package/src/features/api-reference/api-reference-content.svelte +258 -0
- package/src/features/api-reference/api-reference-drawer.scss +74 -0
- package/src/features/api-reference/api-reference-examples.ts +381 -0
- package/src/features/api-reference/api-reference-schema.ts +332 -0
- package/src/features/api-reference/api-reference.scss +190 -0
- package/src/features/api-reference/api-reference.svelte +74 -0
- package/src/features/auth/auth-brand.svelte +5 -3
- package/src/features/auth/auth-field.svelte +92 -0
- package/src/features/auth/auth-frame.svelte +5 -8
- package/src/features/auth/auth.scss +122 -0
- package/src/features/auth/create-first-user-controller.svelte.ts +30 -60
- package/src/features/auth/create-first-user-route.svelte +83 -122
- package/src/features/auth/forgot-password-route.svelte +32 -24
- package/src/features/auth/login-route.svelte +69 -117
- package/src/features/auth/logout-button.scss +34 -0
- package/src/features/auth/logout-button.svelte +52 -0
- package/src/features/auth/request-verification-route.svelte +28 -23
- package/src/features/auth/reset-password-route.svelte +111 -41
- package/src/features/auth/verify-email-route.svelte +52 -15
- package/src/features/bulk-edit/bulk-edit-fields.ts +23 -0
- package/src/features/bulk-edit/bulk-edit.scss +152 -0
- package/src/features/bulk-edit/field-picker.svelte +176 -0
- package/src/features/collections/bulk/bulk-actions.svelte +148 -0
- package/src/features/collections/bulk/bulk-confirmation.svelte +153 -0
- package/src/features/collections/bulk/bulk-editor-loader.svelte +95 -0
- package/src/features/collections/bulk/bulk-editor.svelte +186 -0
- package/src/features/collections/collection-list-cell-values.ts +144 -0
- package/src/features/collections/collection-list-controller.svelte.ts +268 -379
- package/src/features/collections/collection-list-preferences-controller.svelte.ts +54 -40
- package/src/features/collections/collection-list-query.ts +223 -0
- package/src/features/collections/collection-list-results.svelte +205 -329
- package/src/features/collections/collection-list-route.svelte +143 -884
- package/src/features/collections/collection-list.scss +261 -0
- package/src/features/collections/collection-list.svelte.ts +362 -0
- package/src/features/collections/controls/column-picker.svelte +110 -0
- package/src/features/collections/controls/column-pill.svelte +62 -0
- package/src/features/collections/controls/filter-builder.svelte +193 -0
- package/src/features/collections/controls/filter-row.svelte +142 -0
- package/src/features/collections/controls/list-controls.scss +196 -0
- package/src/features/collections/controls/list-options.svelte +203 -0
- package/src/features/collections/controls/list-pagination.scss +78 -0
- package/src/features/collections/controls/list-pagination.svelte +115 -0
- package/src/features/collections/controls/list-toolbar.svelte +132 -0
- package/src/features/collections/controls/sort-heading.scss +52 -0
- package/src/features/collections/controls/sort-heading.svelte +78 -0
- package/src/features/collections/list-columns.ts +43 -0
- package/src/features/collections/list-workspace.ts +155 -54
- package/src/features/dashboard/dashboard-route.svelte +82 -86
- package/src/features/dashboard/dashboard.scss +131 -0
- package/src/features/development/development-tools.svelte +20 -36
- package/src/features/documents/document-action-bar.svelte +438 -0
- package/src/features/documents/document-api-view-loader.svelte +17 -6
- package/src/features/documents/document-api-view.scss +120 -0
- package/src/features/documents/document-api-view.svelte +169 -454
- package/src/features/documents/document-controller.svelte.ts +531 -617
- package/src/features/documents/document-credentials.scss +37 -0
- package/src/features/documents/document-credentials.svelte +72 -0
- package/src/features/documents/{document-route-dirty.ts → document-credentials.ts} +25 -0
- package/src/features/documents/document-field-sections.scss +39 -0
- package/src/features/documents/document-field-sections.svelte +4 -13
- package/src/features/documents/document-loading.scss +24 -0
- package/src/features/documents/document-lock-controller.svelte.ts +187 -0
- package/src/features/documents/document-operation-dialogs.svelte +110 -0
- package/src/features/documents/document-route-loader.svelte +17 -5
- package/src/features/documents/document-route.svelte +305 -811
- package/src/features/documents/document-schedule.scss +127 -0
- package/src/features/documents/document-schedule.svelte +323 -0
- package/src/features/documents/document-title.ts +25 -0
- package/src/features/documents/document.scss +274 -0
- package/src/features/documents/live-preview-panel.scss +117 -0
- package/src/features/documents/live-preview-panel.svelte +167 -168
- package/src/features/documents/live-preview.ts +2 -10
- package/src/features/documents/upload-document-preview-loader.svelte +26 -23
- package/src/features/localization/content-locale-switcher.scss +43 -0
- package/src/features/localization/content-locale-switcher.svelte +24 -17
- package/src/features/navigation/admin-breadcrumbs.scss +56 -0
- package/src/features/navigation/admin-breadcrumbs.svelte +102 -37
- package/src/features/navigation/admin-command-menu.svelte +38 -15
- package/src/features/navigation/admin-navigation.scss +133 -0
- package/src/features/navigation/admin-navigation.svelte +169 -0
- package/src/features/navigation/breadcrumb-context.svelte.ts +15 -0
- package/src/features/navigation/navigation-preference.svelte.ts +70 -0
- package/src/features/reference-browser/reference-browser-editor.svelte +180 -0
- package/src/features/reference-browser/reference-browser-list.scss +113 -0
- package/src/features/reference-browser/reference-browser-list.svelte +370 -0
- package/src/features/reference-browser/reference-browser-loader.svelte +26 -8
- package/src/features/reference-browser/reference-browser-workflow.svelte.ts +336 -239
- package/src/features/reference-browser/reference-browser.scss +217 -0
- package/src/features/reference-browser/reference-browser.svelte +154 -797
- package/src/features/reference-browser/reference-collection-picker.svelte +116 -0
- package/src/features/reference-browser/reference-list-query.ts +35 -0
- package/src/features/uploads/bulk-upload-controller.svelte.ts +604 -0
- package/src/features/uploads/bulk-upload-edit-all.svelte +92 -0
- package/src/features/uploads/bulk-upload-editor.svelte +191 -0
- package/src/features/uploads/bulk-upload-file-picker.svelte +70 -0
- package/src/features/uploads/bulk-upload-remote.svelte +100 -0
- package/src/features/uploads/bulk-upload-route-loader.svelte +54 -0
- package/src/features/uploads/bulk-upload-route.svelte +172 -592
- package/src/features/uploads/bulk-upload-sidebar.svelte +125 -0
- package/src/features/uploads/bulk-upload.scss +526 -0
- package/src/features/uploads/bulk-upload.ts +105 -14
- package/src/features/uploads/crop-surface.ts +150 -0
- package/src/features/uploads/image-editor.svelte +231 -0
- package/src/features/uploads/rendition-preview.svelte +64 -0
- package/src/features/uploads/upload-control.svelte +340 -0
- package/src/features/uploads/upload-document-contracts.ts +30 -0
- package/src/features/uploads/upload-draft.svelte.ts +294 -0
- package/src/features/uploads/upload-metadata-fields.scss +32 -0
- package/src/features/uploads/upload-metadata-fields.svelte +8 -7
- package/src/features/uploads/upload-thumbnail.svelte +47 -0
- package/src/features/uploads/upload.scss +361 -0
- package/src/features/versions/version-comparison.svelte +361 -0
- package/src/features/versions/version-diff-fields.svelte +136 -0
- package/src/features/versions/version-diff.ts +296 -41
- package/src/features/versions/version-history-controller.svelte.ts +311 -0
- package/src/features/versions/version-history-route-loader.svelte +32 -0
- package/src/features/versions/version-history-route.svelte +157 -522
- package/src/features/versions/version-history.scss +444 -0
- package/src/features/versions/version-history.ts +45 -0
- package/src/features/versions/version-table.svelte +91 -0
- package/src/fields/embedded-schema-draft-editor.scss +48 -0
- package/src/fields/embedded-schema-draft-editor.svelte +24 -16
- package/src/fields/field-collapsible.svelte +14 -8
- package/src/fields/field-layout.scss +171 -0
- package/src/fields/field-layout.svelte +3 -5
- package/src/fields/field-renderer.svelte +17 -29
- package/src/fields/field-shell.svelte +1 -1
- package/src/fields/field-tab-layout.svelte +25 -19
- package/src/fields/join/join-field-controller.svelte.ts +513 -0
- package/src/fields/join/join-field-values.ts +111 -0
- package/src/fields/join/join-field.scss +189 -0
- package/src/fields/join/join-field.svelte +164 -332
- package/src/fields/live-validation-feedback.svelte +4 -3
- package/src/fields/local-field-editor.svelte +2 -2
- package/src/fields/nested/block-name-input.svelte +11 -12
- package/src/fields/nested/block-picker.scss +128 -0
- package/src/fields/nested/block-picker.svelte +81 -0
- package/src/fields/nested/block-placeholder.svg +2 -0
- package/src/fields/nested/nested-field.scss +331 -0
- package/src/fields/nested/nested-field.svelte +265 -245
- package/src/fields/nested/sortable-row.svelte +9 -7
- package/src/fields/plugin-field.svelte +4 -6
- package/src/fields/point/point-field.svelte +51 -38
- package/src/fields/primitive-list/primitive-list-field.svelte +63 -19
- package/src/fields/primitive-list/primitive-list.scss +109 -0
- package/src/fields/radio/radio-field.svelte +2 -1
- package/src/fields/relationship/relationship-field-controller.svelte.ts +81 -41
- package/src/fields/relationship/relationship-field.svelte +144 -175
- package/src/fields/relationship/relationship-lookup-controller.svelte.ts +58 -30
- package/src/fields/relationship/relationship-query.ts +2 -10
- package/src/fields/relationship/relationship-quick-picker-controller.svelte.ts +36 -62
- package/src/fields/relationship/relationship-quick-picker.svelte +178 -227
- package/src/fields/relationship/relationship-selection.svelte +120 -0
- package/src/fields/relationship/relationship-value.ts +46 -7
- package/src/fields/relationship/relationship.scss +182 -0
- package/src/fields/scalar/code-field.svelte +101 -0
- package/src/fields/scalar/date-control-value.ts +13 -0
- package/src/fields/scalar/scalar-field.svelte +25 -67
- package/src/fields/select/select-field.svelte +148 -94
- package/src/fields/text/slug-field.scss +28 -0
- package/src/fields/text/slug-field.svelte +19 -15
- package/src/fields/text/text-field.svelte +1 -2
- package/src/fields/ui/ui-field.svelte +7 -4
- package/src/fields/virtual/virtual-field.svelte +2 -5
- package/src/index.ts +1 -2
- package/src/routing.ts +2 -0
- package/src/app/deferred-redirect.svelte +0 -23
- package/src/components/code-block/code-block.svelte +0 -107
- package/src/components/ui/bulk-action-bar/bulk-action-bar.svelte +0 -50
- package/src/components/ui/bulk-action-bar/index.ts +0 -1
- package/src/components/ui/button/index.ts +0 -8
- package/src/components/ui/calendar/calendar-caption.svelte +0 -72
- package/src/components/ui/calendar/calendar-cell.svelte +0 -20
- package/src/components/ui/calendar/calendar-day.svelte +0 -27
- package/src/components/ui/calendar/calendar-grid-row.svelte +0 -13
- package/src/components/ui/calendar/calendar-grid.svelte +0 -17
- package/src/components/ui/calendar/calendar-head-cell.svelte +0 -20
- package/src/components/ui/calendar/calendar-header.svelte +0 -20
- package/src/components/ui/calendar/calendar-heading.svelte +0 -17
- package/src/components/ui/calendar/calendar-month-select.svelte +0 -45
- package/src/components/ui/calendar/calendar-month.svelte +0 -16
- package/src/components/ui/calendar/calendar-months.svelte +0 -20
- package/src/components/ui/calendar/calendar-nav.svelte +0 -20
- package/src/components/ui/calendar/calendar-next-button.svelte +0 -30
- package/src/components/ui/calendar/calendar-prev-button.svelte +0 -30
- package/src/components/ui/calendar/calendar-year-select.svelte +0 -44
- package/src/components/ui/calendar/calendar.svelte +0 -118
- package/src/components/ui/calendar/index.ts +0 -1
- package/src/components/ui/checkbox/checkbox.svelte +0 -35
- package/src/components/ui/checkbox/index.ts +0 -1
- package/src/components/ui/dialog/dialog-close.svelte +0 -11
- package/src/components/ui/dialog/dialog-content.svelte +0 -52
- package/src/components/ui/dialog/dialog-description.svelte +0 -20
- package/src/components/ui/dialog/dialog-footer.svelte +0 -20
- package/src/components/ui/dialog/dialog-header.svelte +0 -20
- package/src/components/ui/dialog/dialog-overlay.svelte +0 -20
- package/src/components/ui/dialog/dialog-title.svelte +0 -17
- package/src/components/ui/dialog/dialog-trigger.svelte +0 -11
- package/src/components/ui/dialog/dialog.svelte +0 -7
- package/src/components/ui/dialog/index.ts +0 -8
- package/src/components/ui/empty-state/empty-state.svelte +0 -34
- package/src/components/ui/empty-state/index.ts +0 -1
- package/src/components/ui/input/index.ts +0 -1
- package/src/components/ui/pagination/index.ts +0 -1
- package/src/components/ui/pagination/pagination.svelte +0 -88
- package/src/components/ui/radio-group/radio-group-item.svelte +0 -17
- package/src/components/ui/slider/index.ts +0 -3
- package/src/components/ui/slider/slider-content.svelte +0 -59
- package/src/components/ui/slider/slider.svelte +0 -35
- package/src/components/ui/table/index.ts +0 -6
- package/src/components/ui/table/table-body.svelte +0 -20
- package/src/components/ui/table/table-cell.svelte +0 -23
- package/src/components/ui/table/table-head.svelte +0 -23
- package/src/components/ui/table/table-header.svelte +0 -20
- package/src/components/ui/table/table-row.svelte +0 -23
- package/src/components/ui/table/table.svelte +0 -22
- package/src/components/ui/textarea/index.ts +0 -1
- package/src/components/ui/tooltip/index.ts +0 -4
- package/src/components/ui/tooltip/tooltip-content.svelte +0 -50
- package/src/components/ui/tooltip/tooltip-provider.svelte +0 -7
- package/src/components/ui/tooltip/tooltip-trigger.svelte +0 -7
- package/src/components/ui/tooltip/tooltip.svelte +0 -7
- package/src/features/auth/account-menu.svelte +0 -159
- package/src/features/auth/account-security-controller.svelte.ts +0 -119
- package/src/features/collections/collection-list-bulk-actions.svelte +0 -143
- package/src/features/collections/collection-list-bulk-editor.svelte +0 -157
- package/src/features/collections/collection-list-filter-popover.svelte +0 -238
- package/src/features/collections/collection-list-workspace-toolbar.svelte +0 -409
- package/src/features/collections/collection-table-skeleton.svelte +0 -44
- package/src/features/documents/document-heading.ts +0 -20
- package/src/features/documents/upload-document-preview.svelte +0 -525
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Select as SelectPrimitive } from "bits-ui";
|
|
3
3
|
import ChevronDownIcon from "~icons/lucide/chevron-down";
|
|
4
|
-
import {
|
|
4
|
+
import { type WithoutChildrenOrChild } from "@riducms/ui";
|
|
5
|
+
import "@admin/components/ui/select/select.scss";
|
|
5
6
|
|
|
6
7
|
let {
|
|
7
8
|
ref = $bindable(null),
|
|
@@ -13,10 +14,7 @@
|
|
|
13
14
|
<SelectPrimitive.ScrollDownButton
|
|
14
15
|
bind:ref
|
|
15
16
|
data-slot="select-scroll-down-button"
|
|
16
|
-
class={
|
|
17
|
-
"z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4 bottom-0 w-full",
|
|
18
|
-
className
|
|
19
|
-
)}
|
|
17
|
+
class={["ridu-select__scroll", className]}
|
|
20
18
|
{...restProps}
|
|
21
19
|
>
|
|
22
20
|
<ChevronDownIcon />
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Select as SelectPrimitive } from "bits-ui";
|
|
3
3
|
import ChevronUpIcon from "~icons/lucide/chevron-up";
|
|
4
|
-
import {
|
|
4
|
+
import { type WithoutChildrenOrChild } from "@riducms/ui";
|
|
5
|
+
import "@admin/components/ui/select/select.scss";
|
|
5
6
|
|
|
6
7
|
let {
|
|
7
8
|
ref = $bindable(null),
|
|
@@ -13,10 +14,7 @@
|
|
|
13
14
|
<SelectPrimitive.ScrollUpButton
|
|
14
15
|
bind:ref
|
|
15
16
|
data-slot="select-scroll-up-button"
|
|
16
|
-
class={
|
|
17
|
-
"z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4 top-0 w-full",
|
|
18
|
-
className
|
|
19
|
-
)}
|
|
17
|
+
class={["ridu-select__scroll", className]}
|
|
20
18
|
{...restProps}
|
|
21
19
|
>
|
|
22
20
|
<ChevronUpIcon />
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Select as SelectPrimitive } from "bits-ui";
|
|
3
|
-
import ChevronDownIcon from "
|
|
4
|
-
import {
|
|
3
|
+
import ChevronDownIcon from "@admin/components/icons/chevron.svelte";
|
|
4
|
+
import { type WithoutChild } from "@riducms/ui";
|
|
5
|
+
|
|
6
|
+
import "@admin/components/ui/select/select.scss";
|
|
5
7
|
|
|
6
8
|
let {
|
|
7
9
|
ref = $bindable(null),
|
|
@@ -18,12 +20,9 @@
|
|
|
18
20
|
bind:ref
|
|
19
21
|
data-slot="select-trigger"
|
|
20
22
|
data-size={size}
|
|
21
|
-
class={
|
|
22
|
-
"gap-2 rounded-[3px] border border-control-border bg-control px-3 text-[13.5px] text-foreground-strong transition-[background-color,border-color,color] duration-150 hover:border-control-border-hover focus-visible:border-primary/65 aria-invalid:!border-destructive/65 data-[placeholder]:text-foreground-placeholder data-[size=field]:h-10 data-[size=compact]:h-9 data-[size=toolbar]:h-[34px] data-[size=toolbar]:px-2.5 data-[size=toolbar]:text-[12.5px] *:data-[slot=select-value]:flex *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-3.5 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:border-control-border-disabled disabled:bg-control-disabled disabled:opacity-45 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
23
|
-
className
|
|
24
|
-
)}
|
|
23
|
+
class={["ridu-select__trigger", className]}
|
|
25
24
|
{...restProps}
|
|
26
25
|
>
|
|
27
26
|
{@render children?.()}
|
|
28
|
-
<ChevronDownIcon class="
|
|
27
|
+
<ChevronDownIcon class="ridu-select__chevron" />
|
|
29
28
|
</SelectPrimitive.Trigger>
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
@use "@riducms/ui/styles.scss" as ui;
|
|
2
|
+
@layer ridu.components {
|
|
3
|
+
.ridu-select__trigger {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: space-between;
|
|
7
|
+
gap: 10px;
|
|
8
|
+
min-width: 0;
|
|
9
|
+
height: var(--control-height);
|
|
10
|
+
padding: 0 var(--control-padding-inline);
|
|
11
|
+
@include ui.control-surface;
|
|
12
|
+
color: var(--foreground);
|
|
13
|
+
font: inherit;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
|
|
16
|
+
&:hover {
|
|
17
|
+
border-color: var(--control-border-hover);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&:focus,
|
|
21
|
+
&:active {
|
|
22
|
+
border-color: var(--ring);
|
|
23
|
+
outline: 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&[data-size="compact"] {
|
|
27
|
+
height: 36px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&[data-size="toolbar"] {
|
|
31
|
+
height: 34px;
|
|
32
|
+
padding-inline: 10px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&:disabled {
|
|
36
|
+
opacity: 0.5;
|
|
37
|
+
cursor: not-allowed;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&[aria-invalid="true"] {
|
|
41
|
+
border-color: var(--control-invalid-border);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
.ridu-select__chevron {
|
|
45
|
+
width: 20px;
|
|
46
|
+
height: 20px;
|
|
47
|
+
flex-shrink: 0;
|
|
48
|
+
color: var(--foreground-muted);
|
|
49
|
+
}
|
|
50
|
+
.ridu-select__content {
|
|
51
|
+
position: relative;
|
|
52
|
+
isolation: isolate;
|
|
53
|
+
z-index: 90;
|
|
54
|
+
overflow: auto;
|
|
55
|
+
max-height: var(--bits-select-content-available-height);
|
|
56
|
+
min-width: 140px;
|
|
57
|
+
padding: 5px;
|
|
58
|
+
border: 1px solid var(--control-border);
|
|
59
|
+
border-radius: 3px;
|
|
60
|
+
background: var(--background-surface);
|
|
61
|
+
color: var(--foreground);
|
|
62
|
+
box-shadow: var(--control-shadow);
|
|
63
|
+
}
|
|
64
|
+
.ridu-select__viewport {
|
|
65
|
+
width: 100%;
|
|
66
|
+
min-width: calc(var(--bits-select-anchor-width) - 12px);
|
|
67
|
+
}
|
|
68
|
+
.ridu-select__item {
|
|
69
|
+
position: relative;
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
min-height: 34px;
|
|
73
|
+
padding-block: 7px;
|
|
74
|
+
padding-inline: 10px 30px;
|
|
75
|
+
border-radius: 3px;
|
|
76
|
+
font-size: 13px;
|
|
77
|
+
cursor: pointer;
|
|
78
|
+
outline: none;
|
|
79
|
+
user-select: none;
|
|
80
|
+
|
|
81
|
+
&[data-highlighted] {
|
|
82
|
+
background: var(--control-surface-hover);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&[data-disabled] {
|
|
86
|
+
opacity: 0.5;
|
|
87
|
+
pointer-events: none;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
.ridu-select__indicator {
|
|
91
|
+
position: absolute;
|
|
92
|
+
inset-inline-end: 8px;
|
|
93
|
+
width: 14px;
|
|
94
|
+
height: 14px;
|
|
95
|
+
|
|
96
|
+
svg {
|
|
97
|
+
width: 14px;
|
|
98
|
+
height: 14px;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
.ridu-select__label {
|
|
102
|
+
display: flex;
|
|
103
|
+
gap: 8px;
|
|
104
|
+
white-space: nowrap;
|
|
105
|
+
}
|
|
106
|
+
.ridu-select__scroll {
|
|
107
|
+
position: relative;
|
|
108
|
+
z-index: 1;
|
|
109
|
+
display: flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
justify-content: center;
|
|
112
|
+
width: 100%;
|
|
113
|
+
padding-block: 4px;
|
|
114
|
+
background: var(--popover);
|
|
115
|
+
cursor: default;
|
|
116
|
+
|
|
117
|
+
svg {
|
|
118
|
+
width: 16px;
|
|
119
|
+
height: 16px;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
.ridu-select__item-check {
|
|
123
|
+
width: 14px;
|
|
124
|
+
height: 14px;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -6,9 +6,10 @@
|
|
|
6
6
|
import { Dialog as SheetPrimitive } from "bits-ui";
|
|
7
7
|
import XIcon from "~icons/lucide/x";
|
|
8
8
|
import { getAdminI18n } from "@riducms/plugin";
|
|
9
|
-
import {
|
|
10
|
-
|
|
9
|
+
import { type WithoutChildrenOrChild } from "@riducms/ui";
|
|
10
|
+
|
|
11
11
|
import SheetOverlay from "@admin/components/ui/sheet/sheet-overlay.svelte";
|
|
12
|
+
import "@admin/components/ui/sheet/sheet.scss";
|
|
12
13
|
import type { Snippet } from "svelte";
|
|
13
14
|
|
|
14
15
|
let {
|
|
@@ -34,44 +35,15 @@
|
|
|
34
35
|
bind:ref
|
|
35
36
|
data-slot="sheet-content"
|
|
36
37
|
data-side={side}
|
|
37
|
-
class={
|
|
38
|
-
"fixed z-50 flex flex-col bg-popover bg-clip-padding text-sm text-popover-foreground shadow-xl data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[side=bottom]:data-[state=open]:slide-in-from-bottom data-[side=left]:data-[state=open]:slide-in-from-left data-[side=right]:data-[state=open]:slide-in-from-right data-[side=top]:data-[state=open]:slide-in-from-top data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[side=bottom]:data-[state=closed]:slide-out-to-bottom data-[side=left]:data-[state=closed]:slide-out-to-left data-[side=right]:data-[state=closed]:slide-out-to-right data-[side=top]:data-[state=closed]:slide-out-to-top",
|
|
39
|
-
className
|
|
40
|
-
)}
|
|
38
|
+
class={["ridu-sheet", className]}
|
|
41
39
|
{...restProps}
|
|
42
40
|
>
|
|
43
41
|
{@render children?.()}
|
|
44
42
|
{#if showCloseButton}
|
|
45
|
-
<SheetPrimitive.Close
|
|
46
|
-
type="button"
|
|
47
|
-
data-slot="sheet-close"
|
|
48
|
-
class={buttonVariants({
|
|
49
|
-
variant: "ghost",
|
|
50
|
-
size: "icon-sm",
|
|
51
|
-
class: "absolute top-4 end-4 bg-secondary",
|
|
52
|
-
})}
|
|
53
|
-
>
|
|
43
|
+
<SheetPrimitive.Close type="button" data-slot="sheet-close" class="ridu-sheet__close">
|
|
54
44
|
<XIcon />
|
|
55
|
-
<span class="
|
|
45
|
+
<span class="ridu-sheet__close-label">{i18n.t("general:close")}</span>
|
|
56
46
|
</SheetPrimitive.Close>
|
|
57
47
|
{/if}
|
|
58
48
|
</SheetPrimitive.Content>
|
|
59
49
|
</SheetPrimitive.Portal>
|
|
60
|
-
|
|
61
|
-
<style>
|
|
62
|
-
:global([data-slot="sheet-content"][data-state="open"]) {
|
|
63
|
-
animation-duration: 300ms;
|
|
64
|
-
animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
:global([data-slot="sheet-content"][data-state="closed"]) {
|
|
68
|
-
animation-duration: 220ms;
|
|
69
|
-
animation-timing-function: cubic-bezier(0.4, 0, 1, 1);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
@media (prefers-reduced-motion: reduce) {
|
|
73
|
-
:global([data-slot="sheet-content"]) {
|
|
74
|
-
animation-duration: 1ms;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
</style>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Dialog as SheetPrimitive } from "bits-ui";
|
|
3
|
-
import
|
|
3
|
+
import "@admin/components/ui/sheet/sheet.scss";
|
|
4
4
|
|
|
5
5
|
let {
|
|
6
6
|
ref = $bindable(null),
|
|
@@ -12,6 +12,6 @@
|
|
|
12
12
|
<SheetPrimitive.Description
|
|
13
13
|
bind:ref
|
|
14
14
|
data-slot="sheet-description"
|
|
15
|
-
class={
|
|
15
|
+
class={["ridu-sheet__description", className]}
|
|
16
16
|
{...restProps}
|
|
17
17
|
/>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Dialog as SheetPrimitive } from "bits-ui";
|
|
3
|
-
import
|
|
3
|
+
import "@admin/components/ui/sheet/sheet.scss";
|
|
4
4
|
|
|
5
5
|
let {
|
|
6
6
|
ref = $bindable(null),
|
|
@@ -12,25 +12,6 @@
|
|
|
12
12
|
<SheetPrimitive.Overlay
|
|
13
13
|
bind:ref
|
|
14
14
|
data-slot="sheet-overlay"
|
|
15
|
-
class={
|
|
16
|
-
"fixed inset-0 z-50 bg-backdrop supports-backdrop-filter:backdrop-blur-sm data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0",
|
|
17
|
-
className
|
|
18
|
-
)}
|
|
15
|
+
class={["ridu-sheet-overlay", className]}
|
|
19
16
|
{...restProps}
|
|
20
17
|
/>
|
|
21
|
-
|
|
22
|
-
<style>
|
|
23
|
-
:global([data-slot="sheet-overlay"][data-state="open"]) {
|
|
24
|
-
animation-duration: 240ms;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
:global([data-slot="sheet-overlay"][data-state="closed"]) {
|
|
28
|
-
animation-duration: 180ms;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
@media (prefers-reduced-motion: reduce) {
|
|
32
|
-
:global([data-slot="sheet-overlay"]) {
|
|
33
|
-
animation-duration: 1ms;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
</style>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Dialog as SheetPrimitive } from "bits-ui";
|
|
3
|
-
import
|
|
3
|
+
import "@admin/components/ui/sheet/sheet.scss";
|
|
4
4
|
|
|
5
5
|
let {
|
|
6
6
|
ref = $bindable(null),
|
|
@@ -12,6 +12,6 @@
|
|
|
12
12
|
<SheetPrimitive.Title
|
|
13
13
|
bind:ref
|
|
14
14
|
data-slot="sheet-title"
|
|
15
|
-
class={
|
|
15
|
+
class={["ridu-sheet__title", className]}
|
|
16
16
|
{...restProps}
|
|
17
17
|
/>
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
@use "@riducms/ui/styles.scss" as ui;
|
|
2
|
+
|
|
3
|
+
@layer ridu.components {
|
|
4
|
+
.ridu-sheet-overlay {
|
|
5
|
+
position: fixed;
|
|
6
|
+
inset: 0;
|
|
7
|
+
z-index: 50;
|
|
8
|
+
background: var(--backdrop);
|
|
9
|
+
backdrop-filter: blur(4px);
|
|
10
|
+
animation-fill-mode: both;
|
|
11
|
+
|
|
12
|
+
&[data-state="open"] {
|
|
13
|
+
animation: ridu-sheet-overlay-in 240ms ease-out;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&[data-state="closed"] {
|
|
17
|
+
animation: ridu-sheet-overlay-out 180ms ease-in;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.ridu-sheet {
|
|
22
|
+
position: fixed;
|
|
23
|
+
z-index: 50;
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
background: var(--popover);
|
|
27
|
+
color: var(--popover-foreground);
|
|
28
|
+
font-size: var(--font-size-body);
|
|
29
|
+
box-shadow: var(--shadow-dialog);
|
|
30
|
+
animation-duration: 300ms;
|
|
31
|
+
animation-fill-mode: both;
|
|
32
|
+
animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
|
|
33
|
+
|
|
34
|
+
&[data-state="closed"] {
|
|
35
|
+
animation-duration: 220ms;
|
|
36
|
+
animation-timing-function: cubic-bezier(0.4, 0, 1, 1);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&[data-side="top"] {
|
|
40
|
+
inset: 0 0 auto;
|
|
41
|
+
height: auto;
|
|
42
|
+
border-bottom: 1px solid var(--control-border);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&[data-side="right"] {
|
|
46
|
+
inset: 0 0 0 auto;
|
|
47
|
+
width: 75%;
|
|
48
|
+
border-left: 1px solid var(--control-border);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&[data-side="bottom"] {
|
|
52
|
+
inset: auto 0 0;
|
|
53
|
+
height: auto;
|
|
54
|
+
border-top: 1px solid var(--control-border);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&[data-side="left"] {
|
|
58
|
+
inset: 0 auto 0 0;
|
|
59
|
+
width: 75%;
|
|
60
|
+
border-right: 1px solid var(--control-border);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&[data-state="open"][data-side="top"] {
|
|
64
|
+
animation-name: ridu-sheet-from-top;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&[data-state="open"][data-side="right"] {
|
|
68
|
+
animation-name: ridu-sheet-from-right;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&[data-state="open"][data-side="bottom"] {
|
|
72
|
+
animation-name: ridu-sheet-from-bottom;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&[data-state="open"][data-side="left"] {
|
|
76
|
+
animation-name: ridu-sheet-from-left;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&[data-state="closed"][data-side="top"] {
|
|
80
|
+
animation-name: ridu-sheet-to-top;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&[data-state="closed"][data-side="right"] {
|
|
84
|
+
animation-name: ridu-sheet-to-right;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&[data-state="closed"][data-side="bottom"] {
|
|
88
|
+
animation-name: ridu-sheet-to-bottom;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&[data-state="closed"][data-side="left"] {
|
|
92
|
+
animation-name: ridu-sheet-to-left;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.ridu-sheet__title {
|
|
97
|
+
color: var(--foreground);
|
|
98
|
+
font-size: 16px;
|
|
99
|
+
font-weight: 500;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.ridu-sheet__description {
|
|
103
|
+
color: var(--foreground-muted);
|
|
104
|
+
font-size: 14px;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.ridu-sheet__close {
|
|
108
|
+
position: absolute;
|
|
109
|
+
inset-block-start: 16px;
|
|
110
|
+
inset-inline-end: 16px;
|
|
111
|
+
display: grid;
|
|
112
|
+
place-items: center;
|
|
113
|
+
width: 32px;
|
|
114
|
+
height: 32px;
|
|
115
|
+
border: 0;
|
|
116
|
+
border-radius: 3px;
|
|
117
|
+
background: var(--secondary);
|
|
118
|
+
color: var(--foreground-muted);
|
|
119
|
+
cursor: pointer;
|
|
120
|
+
|
|
121
|
+
&:hover {
|
|
122
|
+
background: var(--control-surface-hover);
|
|
123
|
+
color: var(--foreground);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&:focus-visible {
|
|
127
|
+
@include ui.focus-outline;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
svg {
|
|
131
|
+
width: 16px;
|
|
132
|
+
height: 16px;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.ridu-sheet__close-label {
|
|
137
|
+
@include ui.visually-hidden;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
@media (min-width: 640px) {
|
|
141
|
+
.ridu-sheet[data-side="left"],
|
|
142
|
+
.ridu-sheet[data-side="right"] {
|
|
143
|
+
max-width: 384px;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
@media (prefers-reduced-motion: reduce) {
|
|
148
|
+
.ridu-sheet[data-state][data-side],
|
|
149
|
+
.ridu-sheet-overlay[data-state] {
|
|
150
|
+
animation-duration: 1ms;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
@keyframes ridu-sheet-overlay-in {
|
|
156
|
+
from {
|
|
157
|
+
opacity: 0;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
@keyframes ridu-sheet-overlay-out {
|
|
162
|
+
to {
|
|
163
|
+
opacity: 0;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
@keyframes ridu-sheet-from-top {
|
|
168
|
+
from {
|
|
169
|
+
transform: translateY(-100%);
|
|
170
|
+
opacity: 0;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
@keyframes ridu-sheet-from-right {
|
|
175
|
+
from {
|
|
176
|
+
transform: translateX(100%);
|
|
177
|
+
opacity: 0;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
@keyframes ridu-sheet-from-bottom {
|
|
182
|
+
from {
|
|
183
|
+
transform: translateY(100%);
|
|
184
|
+
opacity: 0;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
@keyframes ridu-sheet-from-left {
|
|
189
|
+
from {
|
|
190
|
+
transform: translateX(-100%);
|
|
191
|
+
opacity: 0;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
@keyframes ridu-sheet-to-top {
|
|
196
|
+
to {
|
|
197
|
+
transform: translateY(-100%);
|
|
198
|
+
opacity: 0;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
@keyframes ridu-sheet-to-right {
|
|
203
|
+
to {
|
|
204
|
+
transform: translateX(100%);
|
|
205
|
+
opacity: 0;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
@keyframes ridu-sheet-to-bottom {
|
|
210
|
+
to {
|
|
211
|
+
transform: translateY(100%);
|
|
212
|
+
opacity: 0;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
@keyframes ridu-sheet-to-left {
|
|
217
|
+
to {
|
|
218
|
+
transform: translateX(-100%);
|
|
219
|
+
opacity: 0;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@layer ridu.components {
|
|
2
|
+
.ridu-skeleton {
|
|
3
|
+
border-radius: 3px;
|
|
4
|
+
background: var(--muted);
|
|
5
|
+
opacity: 0;
|
|
6
|
+
animation: ridu-skeleton-reveal 150ms ease-out 180ms forwards;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@keyframes ridu-skeleton-reveal {
|
|
10
|
+
to {
|
|
11
|
+
opacity: 1;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@media (prefers-reduced-motion: reduce) {
|
|
16
|
+
.ridu-skeleton {
|
|
17
|
+
animation-duration: 0s;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -1,31 +1,19 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
import { onMount } from "svelte";
|
|
2
|
+
import { type WithElementRef, type WithoutChildren } from "@riducms/ui";
|
|
4
3
|
import type { HTMLAttributes } from "svelte/elements";
|
|
5
|
-
|
|
6
|
-
const revealDelayMilliseconds = 180;
|
|
4
|
+
import "@admin/components/ui/skeleton/skeleton.scss";
|
|
7
5
|
|
|
8
6
|
let {
|
|
9
7
|
ref = $bindable(null),
|
|
10
8
|
class: className,
|
|
11
9
|
...restProps
|
|
12
10
|
}: WithoutChildren<WithElementRef<HTMLAttributes<HTMLDivElement>>> = $props();
|
|
13
|
-
let revealed = $state(false);
|
|
14
|
-
|
|
15
|
-
onMount(() => {
|
|
16
|
-
const timer = window.setTimeout(() => (revealed = true), revealDelayMilliseconds);
|
|
17
|
-
return () => window.clearTimeout(timer);
|
|
18
|
-
});
|
|
19
11
|
</script>
|
|
20
12
|
|
|
21
13
|
<div
|
|
22
14
|
bind:this={ref}
|
|
23
15
|
data-slot="skeleton"
|
|
24
|
-
class={
|
|
25
|
-
"rounded bg-muted transition-opacity duration-150 ease-out motion-reduce:transition-none",
|
|
26
|
-
revealed ? "opacity-100" : "opacity-0",
|
|
27
|
-
className
|
|
28
|
-
)}
|
|
16
|
+
class={["ridu-skeleton", className]}
|
|
29
17
|
{...restProps}
|
|
30
|
-
aria-hidden=
|
|
18
|
+
aria-hidden="true"
|
|
31
19
|
></div>
|