@riducms/admin 0.2.3 → 0.3.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 +27 -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 +121 -124
- 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 +157 -0
- package/src/features/{auth → account}/account-security-route.svelte +140 -42
- package/src/features/api-reference/api-reference-code.svelte +64 -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 +20 -51
- package/src/features/auth/create-first-user-route.svelte +83 -122
- package/src/features/auth/forgot-password-route.svelte +31 -23
- package/src/features/auth/login-route.svelte +68 -116
- 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 +27 -22
- package/src/features/auth/reset-password-route.svelte +108 -41
- package/src/features/auth/verify-email-route.svelte +49 -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 +526 -613
- 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 +335 -236
- 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 +132 -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,72 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { DateFormatter, getLocalTimeZone, type DateValue } from "@internationalized/date";
|
|
3
|
-
import type { ComponentProps } from "svelte";
|
|
4
|
-
|
|
5
|
-
import CalendarMonthSelect from "@admin/components/ui/calendar/calendar-month-select.svelte";
|
|
6
|
-
import CalendarYearSelect from "@admin/components/ui/calendar/calendar-year-select.svelte";
|
|
7
|
-
import type Calendar from "@admin/components/ui/calendar/calendar.svelte";
|
|
8
|
-
|
|
9
|
-
let {
|
|
10
|
-
captionLayout,
|
|
11
|
-
months,
|
|
12
|
-
monthFormat,
|
|
13
|
-
years,
|
|
14
|
-
yearFormat,
|
|
15
|
-
month,
|
|
16
|
-
locale,
|
|
17
|
-
placeholder = $bindable(),
|
|
18
|
-
monthIndex = 0,
|
|
19
|
-
}: {
|
|
20
|
-
captionLayout: ComponentProps<typeof Calendar>["captionLayout"];
|
|
21
|
-
months: ComponentProps<typeof CalendarMonthSelect>["months"];
|
|
22
|
-
monthFormat: ComponentProps<typeof CalendarMonthSelect>["monthFormat"];
|
|
23
|
-
years: ComponentProps<typeof CalendarYearSelect>["years"];
|
|
24
|
-
yearFormat: ComponentProps<typeof CalendarYearSelect>["yearFormat"];
|
|
25
|
-
month: DateValue;
|
|
26
|
-
placeholder: DateValue | undefined;
|
|
27
|
-
locale: string;
|
|
28
|
-
monthIndex?: number;
|
|
29
|
-
} = $props();
|
|
30
|
-
|
|
31
|
-
function formatYear(date: DateValue) {
|
|
32
|
-
const dateObject = date.toDate(getLocalTimeZone());
|
|
33
|
-
if (typeof yearFormat === "function") return yearFormat(dateObject.getFullYear());
|
|
34
|
-
return new DateFormatter(locale, { year: yearFormat }).format(dateObject);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function formatMonth(date: DateValue) {
|
|
38
|
-
const dateObject = date.toDate(getLocalTimeZone());
|
|
39
|
-
if (typeof monthFormat === "function") return monthFormat(dateObject.getMonth() + 1);
|
|
40
|
-
return new DateFormatter(locale, { month: monthFormat }).format(dateObject);
|
|
41
|
-
}
|
|
42
|
-
</script>
|
|
43
|
-
|
|
44
|
-
{#snippet monthSelect()}
|
|
45
|
-
<CalendarMonthSelect
|
|
46
|
-
{months}
|
|
47
|
-
{monthFormat}
|
|
48
|
-
value={month.month}
|
|
49
|
-
onchange={(event) => {
|
|
50
|
-
if (placeholder === undefined) return;
|
|
51
|
-
const selectedMonth = Number.parseInt(event.currentTarget.value);
|
|
52
|
-
placeholder = placeholder.set({ month: selectedMonth }).subtract({ months: monthIndex });
|
|
53
|
-
}}
|
|
54
|
-
/>
|
|
55
|
-
{/snippet}
|
|
56
|
-
|
|
57
|
-
{#snippet yearSelect()}
|
|
58
|
-
<CalendarYearSelect {years} {yearFormat} value={month.year} />
|
|
59
|
-
{/snippet}
|
|
60
|
-
|
|
61
|
-
{#if captionLayout === "dropdown"}
|
|
62
|
-
{@render monthSelect()}
|
|
63
|
-
{@render yearSelect()}
|
|
64
|
-
{:else if captionLayout === "dropdown-months"}
|
|
65
|
-
{@render monthSelect()}
|
|
66
|
-
{#if placeholder !== undefined}{formatYear(placeholder)}{/if}
|
|
67
|
-
{:else if captionLayout === "dropdown-years"}
|
|
68
|
-
{#if placeholder !== undefined}{formatMonth(placeholder)}{/if}
|
|
69
|
-
{@render yearSelect()}
|
|
70
|
-
{:else}
|
|
71
|
-
{formatMonth(month)} {formatYear(month)}
|
|
72
|
-
{/if}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Calendar as CalendarPrimitive } from "bits-ui";
|
|
3
|
-
|
|
4
|
-
import { cn } from "@riducms/ui";
|
|
5
|
-
|
|
6
|
-
let {
|
|
7
|
-
ref = $bindable(null),
|
|
8
|
-
class: className,
|
|
9
|
-
...restProps
|
|
10
|
-
}: CalendarPrimitive.CellProps = $props();
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<CalendarPrimitive.Cell
|
|
14
|
-
bind:ref
|
|
15
|
-
class={cn(
|
|
16
|
-
"relative size-(--calendar-cell-size) p-0 text-center text-[12px] focus-within:z-20",
|
|
17
|
-
className
|
|
18
|
-
)}
|
|
19
|
-
{...restProps}
|
|
20
|
-
/>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Calendar as CalendarPrimitive } from "bits-ui";
|
|
3
|
-
|
|
4
|
-
import { buttonVariants } from "@admin/components/ui/button";
|
|
5
|
-
import { cn } from "@riducms/ui";
|
|
6
|
-
|
|
7
|
-
let {
|
|
8
|
-
ref = $bindable(null),
|
|
9
|
-
class: className,
|
|
10
|
-
...restProps
|
|
11
|
-
}: CalendarPrimitive.DayProps = $props();
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<CalendarPrimitive.Day
|
|
15
|
-
bind:ref
|
|
16
|
-
class={cn(
|
|
17
|
-
buttonVariants({ variant: "ghost", size: "icon-sm" }),
|
|
18
|
-
"size-(--calendar-cell-size) rounded-md p-0 text-[12px] font-normal text-foreground-muted",
|
|
19
|
-
"hover:bg-control-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-primary/60 focus-visible:outline-offset-0",
|
|
20
|
-
"data-[selected]:bg-primary data-[selected]:font-medium data-[selected]:text-primary-foreground data-[selected]:hover:bg-primary-hover data-[selected]:hover:text-primary-foreground",
|
|
21
|
-
"data-[today]:not-data-[selected]:bg-primary/12 data-[today]:not-data-[selected]:font-semibold data-[today]:not-data-[selected]:text-foreground",
|
|
22
|
-
"data-[outside-month]:not-data-[selected]:text-foreground-faint",
|
|
23
|
-
"data-[disabled]:pointer-events-none data-[disabled]:opacity-35 data-[unavailable]:line-through",
|
|
24
|
-
className
|
|
25
|
-
)}
|
|
26
|
-
{...restProps}
|
|
27
|
-
/>
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Calendar as CalendarPrimitive } from "bits-ui";
|
|
3
|
-
|
|
4
|
-
import { cn } from "@riducms/ui";
|
|
5
|
-
|
|
6
|
-
let {
|
|
7
|
-
ref = $bindable(null),
|
|
8
|
-
class: className,
|
|
9
|
-
...restProps
|
|
10
|
-
}: CalendarPrimitive.GridRowProps = $props();
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<CalendarPrimitive.GridRow bind:ref class={cn("flex w-full", className)} {...restProps} />
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Calendar as CalendarPrimitive } from "bits-ui";
|
|
3
|
-
|
|
4
|
-
import { cn } from "@riducms/ui";
|
|
5
|
-
|
|
6
|
-
let {
|
|
7
|
-
ref = $bindable(null),
|
|
8
|
-
class: className,
|
|
9
|
-
...restProps
|
|
10
|
-
}: CalendarPrimitive.GridProps = $props();
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<CalendarPrimitive.Grid
|
|
14
|
-
bind:ref
|
|
15
|
-
class={cn("mt-3 flex w-full flex-col gap-1 border-collapse", className)}
|
|
16
|
-
{...restProps}
|
|
17
|
-
/>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Calendar as CalendarPrimitive } from "bits-ui";
|
|
3
|
-
|
|
4
|
-
import { cn } from "@riducms/ui";
|
|
5
|
-
|
|
6
|
-
let {
|
|
7
|
-
ref = $bindable(null),
|
|
8
|
-
class: className,
|
|
9
|
-
...restProps
|
|
10
|
-
}: CalendarPrimitive.HeadCellProps = $props();
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<CalendarPrimitive.HeadCell
|
|
14
|
-
bind:ref
|
|
15
|
-
class={cn(
|
|
16
|
-
"font-mono w-(--calendar-cell-size) text-center text-[9px] font-medium tracking-[0.08em] text-foreground-faint uppercase",
|
|
17
|
-
className
|
|
18
|
-
)}
|
|
19
|
-
{...restProps}
|
|
20
|
-
/>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Calendar as CalendarPrimitive } from "bits-ui";
|
|
3
|
-
|
|
4
|
-
import { cn } from "@riducms/ui";
|
|
5
|
-
|
|
6
|
-
let {
|
|
7
|
-
ref = $bindable(null),
|
|
8
|
-
class: className,
|
|
9
|
-
...restProps
|
|
10
|
-
}: CalendarPrimitive.HeaderProps = $props();
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<CalendarPrimitive.Header
|
|
14
|
-
bind:ref
|
|
15
|
-
class={cn(
|
|
16
|
-
"flex h-(--calendar-cell-size) w-full items-center justify-center gap-1.5 text-[12px] font-medium",
|
|
17
|
-
className
|
|
18
|
-
)}
|
|
19
|
-
{...restProps}
|
|
20
|
-
/>
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Calendar as CalendarPrimitive } from "bits-ui";
|
|
3
|
-
|
|
4
|
-
import { cn } from "@riducms/ui";
|
|
5
|
-
|
|
6
|
-
let {
|
|
7
|
-
ref = $bindable(null),
|
|
8
|
-
class: className,
|
|
9
|
-
...restProps
|
|
10
|
-
}: CalendarPrimitive.HeadingProps = $props();
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<CalendarPrimitive.Heading
|
|
14
|
-
bind:ref
|
|
15
|
-
class={cn("px-(--calendar-cell-size) text-[12px] font-medium", className)}
|
|
16
|
-
{...restProps}
|
|
17
|
-
/>
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Calendar as CalendarPrimitive } from "bits-ui";
|
|
3
|
-
import ChevronDownIcon from "~icons/lucide/chevron-down";
|
|
4
|
-
|
|
5
|
-
import { cn, type WithoutChildrenOrChild } from "@riducms/ui";
|
|
6
|
-
|
|
7
|
-
let {
|
|
8
|
-
ref = $bindable(null),
|
|
9
|
-
class: className,
|
|
10
|
-
value,
|
|
11
|
-
onchange,
|
|
12
|
-
...restProps
|
|
13
|
-
}: WithoutChildrenOrChild<CalendarPrimitive.MonthSelectProps> = $props();
|
|
14
|
-
</script>
|
|
15
|
-
|
|
16
|
-
<span
|
|
17
|
-
class={cn(
|
|
18
|
-
"relative flex rounded-md border border-control-border bg-control transition-colors focus-within:border-primary/60 focus-within:ring-2 focus-within:ring-primary/15",
|
|
19
|
-
className
|
|
20
|
-
)}
|
|
21
|
-
>
|
|
22
|
-
<CalendarPrimitive.MonthSelect bind:ref class="absolute inset-0 opacity-0" {...restProps}>
|
|
23
|
-
{#snippet child({ props, monthItems, selectedMonthItem })}
|
|
24
|
-
<select {...props} {value} {onchange} data-ridu-native-exception>
|
|
25
|
-
{#each monthItems as monthItem (monthItem.value)}
|
|
26
|
-
<option
|
|
27
|
-
value={monthItem.value}
|
|
28
|
-
selected={value === undefined
|
|
29
|
-
? monthItem.value === selectedMonthItem.value
|
|
30
|
-
: monthItem.value === value}
|
|
31
|
-
>
|
|
32
|
-
{monthItem.label}
|
|
33
|
-
</option>
|
|
34
|
-
{/each}
|
|
35
|
-
</select>
|
|
36
|
-
<span
|
|
37
|
-
class="flex h-8 items-center gap-1 ps-2 pe-1 text-[12px] font-medium text-foreground select-none"
|
|
38
|
-
aria-hidden="true"
|
|
39
|
-
>
|
|
40
|
-
{monthItems.find((item) => item.value === value)?.label ?? selectedMonthItem.label}
|
|
41
|
-
<ChevronDownIcon class="size-3 text-foreground-faint" />
|
|
42
|
-
</span>
|
|
43
|
-
{/snippet}
|
|
44
|
-
</CalendarPrimitive.MonthSelect>
|
|
45
|
-
</span>
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
-
|
|
4
|
-
import { cn, type WithElementRef } from "@riducms/ui";
|
|
5
|
-
|
|
6
|
-
let {
|
|
7
|
-
ref = $bindable(null),
|
|
8
|
-
class: className,
|
|
9
|
-
children,
|
|
10
|
-
...restProps
|
|
11
|
-
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<div bind:this={ref} class={cn("flex flex-col", className)} {...restProps}>
|
|
15
|
-
{@render children?.()}
|
|
16
|
-
</div>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
-
|
|
4
|
-
import { cn, type WithElementRef } from "@riducms/ui";
|
|
5
|
-
|
|
6
|
-
let {
|
|
7
|
-
ref = $bindable(null),
|
|
8
|
-
class: className,
|
|
9
|
-
children,
|
|
10
|
-
...restProps
|
|
11
|
-
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<div
|
|
15
|
-
bind:this={ref}
|
|
16
|
-
class={cn("relative flex flex-col gap-4 md:flex-row", className)}
|
|
17
|
-
{...restProps}
|
|
18
|
-
>
|
|
19
|
-
{@render children?.()}
|
|
20
|
-
</div>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
-
|
|
4
|
-
import { cn, type WithElementRef } from "@riducms/ui";
|
|
5
|
-
|
|
6
|
-
let {
|
|
7
|
-
ref = $bindable(null),
|
|
8
|
-
class: className,
|
|
9
|
-
children,
|
|
10
|
-
...restProps
|
|
11
|
-
}: WithElementRef<HTMLAttributes<HTMLElement>> = $props();
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<nav
|
|
15
|
-
bind:this={ref}
|
|
16
|
-
class={cn("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1", className)}
|
|
17
|
-
{...restProps}
|
|
18
|
-
>
|
|
19
|
-
{@render children?.()}
|
|
20
|
-
</nav>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Calendar as CalendarPrimitive } from "bits-ui";
|
|
3
|
-
import ChevronRightIcon from "~icons/lucide/chevron-right";
|
|
4
|
-
|
|
5
|
-
import { buttonVariants, type ButtonVariant } from "@admin/components/ui/button";
|
|
6
|
-
import { cn } from "@riducms/ui";
|
|
7
|
-
|
|
8
|
-
let {
|
|
9
|
-
ref = $bindable(null),
|
|
10
|
-
class: className,
|
|
11
|
-
children,
|
|
12
|
-
variant = "ghost",
|
|
13
|
-
...restProps
|
|
14
|
-
}: CalendarPrimitive.NextButtonProps & { variant?: ButtonVariant } = $props();
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
{#snippet fallback()}
|
|
18
|
-
<ChevronRightIcon class="size-3.5" aria-hidden="true" />
|
|
19
|
-
{/snippet}
|
|
20
|
-
|
|
21
|
-
<CalendarPrimitive.NextButton
|
|
22
|
-
bind:ref
|
|
23
|
-
class={cn(
|
|
24
|
-
buttonVariants({ variant, size: "icon-sm" }),
|
|
25
|
-
"size-(--calendar-cell-size) bg-transparent p-0 disabled:opacity-35 rtl:rotate-180",
|
|
26
|
-
className
|
|
27
|
-
)}
|
|
28
|
-
children={children ?? fallback}
|
|
29
|
-
{...restProps}
|
|
30
|
-
/>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Calendar as CalendarPrimitive } from "bits-ui";
|
|
3
|
-
import ChevronLeftIcon from "~icons/lucide/chevron-left";
|
|
4
|
-
|
|
5
|
-
import { buttonVariants, type ButtonVariant } from "@admin/components/ui/button";
|
|
6
|
-
import { cn } from "@riducms/ui";
|
|
7
|
-
|
|
8
|
-
let {
|
|
9
|
-
ref = $bindable(null),
|
|
10
|
-
class: className,
|
|
11
|
-
children,
|
|
12
|
-
variant = "ghost",
|
|
13
|
-
...restProps
|
|
14
|
-
}: CalendarPrimitive.PrevButtonProps & { variant?: ButtonVariant } = $props();
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
{#snippet fallback()}
|
|
18
|
-
<ChevronLeftIcon class="size-3.5" aria-hidden="true" />
|
|
19
|
-
{/snippet}
|
|
20
|
-
|
|
21
|
-
<CalendarPrimitive.PrevButton
|
|
22
|
-
bind:ref
|
|
23
|
-
class={cn(
|
|
24
|
-
buttonVariants({ variant, size: "icon-sm" }),
|
|
25
|
-
"size-(--calendar-cell-size) bg-transparent p-0 disabled:opacity-35 rtl:rotate-180",
|
|
26
|
-
className
|
|
27
|
-
)}
|
|
28
|
-
children={children ?? fallback}
|
|
29
|
-
{...restProps}
|
|
30
|
-
/>
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Calendar as CalendarPrimitive } from "bits-ui";
|
|
3
|
-
import ChevronDownIcon from "~icons/lucide/chevron-down";
|
|
4
|
-
|
|
5
|
-
import { cn, type WithoutChildrenOrChild } from "@riducms/ui";
|
|
6
|
-
|
|
7
|
-
let {
|
|
8
|
-
ref = $bindable(null),
|
|
9
|
-
class: className,
|
|
10
|
-
value,
|
|
11
|
-
...restProps
|
|
12
|
-
}: WithoutChildrenOrChild<CalendarPrimitive.YearSelectProps> = $props();
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
<span
|
|
16
|
-
class={cn(
|
|
17
|
-
"relative flex rounded-md border border-control-border bg-control transition-colors focus-within:border-primary/60 focus-within:ring-2 focus-within:ring-primary/15",
|
|
18
|
-
className
|
|
19
|
-
)}
|
|
20
|
-
>
|
|
21
|
-
<CalendarPrimitive.YearSelect bind:ref class="absolute inset-0 opacity-0" {...restProps}>
|
|
22
|
-
{#snippet child({ props, yearItems, selectedYearItem })}
|
|
23
|
-
<select {...props} {value} data-ridu-native-exception>
|
|
24
|
-
{#each yearItems as yearItem (yearItem.value)}
|
|
25
|
-
<option
|
|
26
|
-
value={yearItem.value}
|
|
27
|
-
selected={value === undefined
|
|
28
|
-
? yearItem.value === selectedYearItem.value
|
|
29
|
-
: yearItem.value === value}
|
|
30
|
-
>
|
|
31
|
-
{yearItem.label}
|
|
32
|
-
</option>
|
|
33
|
-
{/each}
|
|
34
|
-
</select>
|
|
35
|
-
<span
|
|
36
|
-
class="flex h-8 items-center gap-1 ps-2 pe-1 text-[12px] font-medium text-foreground select-none"
|
|
37
|
-
aria-hidden="true"
|
|
38
|
-
>
|
|
39
|
-
{yearItems.find((item) => item.value === value)?.label ?? selectedYearItem.label}
|
|
40
|
-
<ChevronDownIcon class="size-3 text-foreground-faint" />
|
|
41
|
-
</span>
|
|
42
|
-
{/snippet}
|
|
43
|
-
</CalendarPrimitive.YearSelect>
|
|
44
|
-
</span>
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { isEqualMonth, type DateValue } from "@internationalized/date";
|
|
3
|
-
import { Calendar as CalendarPrimitive } from "bits-ui";
|
|
4
|
-
import type { Snippet } from "svelte";
|
|
5
|
-
|
|
6
|
-
import CalendarCaption from "@admin/components/ui/calendar/calendar-caption.svelte";
|
|
7
|
-
import CalendarCell from "@admin/components/ui/calendar/calendar-cell.svelte";
|
|
8
|
-
import CalendarDay from "@admin/components/ui/calendar/calendar-day.svelte";
|
|
9
|
-
import CalendarGridRow from "@admin/components/ui/calendar/calendar-grid-row.svelte";
|
|
10
|
-
import CalendarGrid from "@admin/components/ui/calendar/calendar-grid.svelte";
|
|
11
|
-
import CalendarHeadCell from "@admin/components/ui/calendar/calendar-head-cell.svelte";
|
|
12
|
-
import CalendarHeader from "@admin/components/ui/calendar/calendar-header.svelte";
|
|
13
|
-
import CalendarMonth from "@admin/components/ui/calendar/calendar-month.svelte";
|
|
14
|
-
import CalendarMonths from "@admin/components/ui/calendar/calendar-months.svelte";
|
|
15
|
-
import CalendarNav from "@admin/components/ui/calendar/calendar-nav.svelte";
|
|
16
|
-
import CalendarNextButton from "@admin/components/ui/calendar/calendar-next-button.svelte";
|
|
17
|
-
import CalendarPrevButton from "@admin/components/ui/calendar/calendar-prev-button.svelte";
|
|
18
|
-
import { cn, type ButtonVariant, type WithoutChildrenOrChild } from "@riducms/ui";
|
|
19
|
-
|
|
20
|
-
let {
|
|
21
|
-
ref = $bindable(null),
|
|
22
|
-
value = $bindable(),
|
|
23
|
-
placeholder = $bindable(),
|
|
24
|
-
class: className,
|
|
25
|
-
weekdayFormat = "short",
|
|
26
|
-
buttonVariant = "ghost",
|
|
27
|
-
captionLayout = "label",
|
|
28
|
-
locale = "en-US",
|
|
29
|
-
months: availableMonths,
|
|
30
|
-
years,
|
|
31
|
-
monthFormat: requestedMonthFormat,
|
|
32
|
-
yearFormat = "numeric",
|
|
33
|
-
day,
|
|
34
|
-
disableDaysOutsideMonth = false,
|
|
35
|
-
...restProps
|
|
36
|
-
}: WithoutChildrenOrChild<CalendarPrimitive.RootProps> & {
|
|
37
|
-
buttonVariant?: ButtonVariant;
|
|
38
|
-
captionLayout?: "dropdown" | "dropdown-months" | "dropdown-years" | "label";
|
|
39
|
-
months?: CalendarPrimitive.MonthSelectProps["months"];
|
|
40
|
-
years?: CalendarPrimitive.YearSelectProps["years"];
|
|
41
|
-
monthFormat?: CalendarPrimitive.MonthSelectProps["monthFormat"];
|
|
42
|
-
yearFormat?: CalendarPrimitive.YearSelectProps["yearFormat"];
|
|
43
|
-
day?: Snippet<[{ day: DateValue; outsideMonth: boolean }]>;
|
|
44
|
-
} = $props();
|
|
45
|
-
|
|
46
|
-
const monthFormat = $derived(
|
|
47
|
-
requestedMonthFormat ?? (captionLayout.startsWith("dropdown") ? "short" : "long")
|
|
48
|
-
);
|
|
49
|
-
</script>
|
|
50
|
-
|
|
51
|
-
<CalendarPrimitive.Root
|
|
52
|
-
bind:value={value as never}
|
|
53
|
-
bind:ref
|
|
54
|
-
bind:placeholder
|
|
55
|
-
{weekdayFormat}
|
|
56
|
-
{disableDaysOutsideMonth}
|
|
57
|
-
class={cn(
|
|
58
|
-
"group/calendar bg-popover p-3 text-popover-foreground [--calendar-cell-size:2rem]",
|
|
59
|
-
className
|
|
60
|
-
)}
|
|
61
|
-
{locale}
|
|
62
|
-
{monthFormat}
|
|
63
|
-
{yearFormat}
|
|
64
|
-
{...restProps}
|
|
65
|
-
>
|
|
66
|
-
{#snippet children({ months, weekdays })}
|
|
67
|
-
<CalendarMonths>
|
|
68
|
-
<CalendarNav>
|
|
69
|
-
<CalendarPrevButton variant={buttonVariant} />
|
|
70
|
-
<CalendarNextButton variant={buttonVariant} />
|
|
71
|
-
</CalendarNav>
|
|
72
|
-
{#each months as month, monthIndex (month.value)}
|
|
73
|
-
<CalendarMonth>
|
|
74
|
-
<CalendarHeader>
|
|
75
|
-
<CalendarCaption
|
|
76
|
-
{captionLayout}
|
|
77
|
-
months={availableMonths}
|
|
78
|
-
{monthFormat}
|
|
79
|
-
{years}
|
|
80
|
-
{yearFormat}
|
|
81
|
-
month={month.value}
|
|
82
|
-
bind:placeholder
|
|
83
|
-
{locale}
|
|
84
|
-
{monthIndex}
|
|
85
|
-
/>
|
|
86
|
-
</CalendarHeader>
|
|
87
|
-
<CalendarGrid>
|
|
88
|
-
<CalendarPrimitive.GridHead>
|
|
89
|
-
<CalendarGridRow>
|
|
90
|
-
{#each weekdays as weekday (weekday)}
|
|
91
|
-
<CalendarHeadCell>{weekday.slice(0, 2)}</CalendarHeadCell>
|
|
92
|
-
{/each}
|
|
93
|
-
</CalendarGridRow>
|
|
94
|
-
</CalendarPrimitive.GridHead>
|
|
95
|
-
<CalendarPrimitive.GridBody>
|
|
96
|
-
{#each month.weeks as weekDates (weekDates)}
|
|
97
|
-
<CalendarGridRow>
|
|
98
|
-
{#each weekDates as date (date)}
|
|
99
|
-
<CalendarCell {date} month={month.value}>
|
|
100
|
-
{#if day}
|
|
101
|
-
{@render day({
|
|
102
|
-
day: date,
|
|
103
|
-
outsideMonth: !isEqualMonth(date, month.value),
|
|
104
|
-
})}
|
|
105
|
-
{:else}
|
|
106
|
-
<CalendarDay />
|
|
107
|
-
{/if}
|
|
108
|
-
</CalendarCell>
|
|
109
|
-
{/each}
|
|
110
|
-
</CalendarGridRow>
|
|
111
|
-
{/each}
|
|
112
|
-
</CalendarPrimitive.GridBody>
|
|
113
|
-
</CalendarGrid>
|
|
114
|
-
</CalendarMonth>
|
|
115
|
-
{/each}
|
|
116
|
-
</CalendarMonths>
|
|
117
|
-
{/snippet}
|
|
118
|
-
</CalendarPrimitive.Root>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Calendar } from "@admin/components/ui/calendar/calendar.svelte";
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Checkbox as CheckboxPrimitive } from "bits-ui";
|
|
3
|
-
import CheckIcon from "~icons/lucide/check";
|
|
4
|
-
import MinusIcon from "~icons/lucide/minus";
|
|
5
|
-
|
|
6
|
-
import { cn, type WithoutChildrenOrChild } from "@riducms/ui";
|
|
7
|
-
|
|
8
|
-
let {
|
|
9
|
-
ref = $bindable(null),
|
|
10
|
-
checked = $bindable(false),
|
|
11
|
-
indeterminate = $bindable(false),
|
|
12
|
-
class: className,
|
|
13
|
-
...restProps
|
|
14
|
-
}: WithoutChildrenOrChild<CheckboxPrimitive.RootProps> = $props();
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<CheckboxPrimitive.Root
|
|
18
|
-
bind:ref
|
|
19
|
-
bind:checked
|
|
20
|
-
bind:indeterminate
|
|
21
|
-
data-slot="checkbox"
|
|
22
|
-
class={cn(
|
|
23
|
-
"grid size-4 shrink-0 place-items-center rounded-[4px] border border-control-border bg-control text-primary-foreground transition-[background-color,border-color,opacity] duration-150 outline-none focus-visible:outline-2 focus-visible:outline-primary/60 focus-visible:outline-offset-2 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary data-[disabled]:cursor-not-allowed data-[disabled]:border-control-border-disabled data-[disabled]:bg-control-disabled data-[disabled]:opacity-50",
|
|
24
|
-
className
|
|
25
|
-
)}
|
|
26
|
-
{...restProps}
|
|
27
|
-
>
|
|
28
|
-
{#snippet children({ checked, indeterminate })}
|
|
29
|
-
{#if indeterminate}
|
|
30
|
-
<MinusIcon class="size-3 stroke-[2.5]" aria-hidden="true" />
|
|
31
|
-
{:else if checked}
|
|
32
|
-
<CheckIcon class="size-3 stroke-[2.5]" aria-hidden="true" />
|
|
33
|
-
{/if}
|
|
34
|
-
{/snippet}
|
|
35
|
-
</CheckboxPrimitive.Root>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Checkbox } from "@admin/components/ui/checkbox/checkbox.svelte";
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Dialog as DialogPrimitive } from "bits-ui";
|
|
3
|
-
|
|
4
|
-
let {
|
|
5
|
-
ref = $bindable(null),
|
|
6
|
-
type = "button",
|
|
7
|
-
...restProps
|
|
8
|
-
}: DialogPrimitive.CloseProps = $props();
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<DialogPrimitive.Close bind:ref data-slot="dialog-close" {type} {...restProps} />
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Dialog as DialogPrimitive } from "bits-ui";
|
|
3
|
-
import XIcon from "~icons/lucide/x";
|
|
4
|
-
import { getAdminI18n } from "@riducms/plugin";
|
|
5
|
-
import { buttonVariants } from "@admin/components/ui/button/index.js";
|
|
6
|
-
import { cn, type WithoutChildrenOrChild } from "@riducms/ui";
|
|
7
|
-
import DialogOverlay from "@admin/components/ui/dialog/dialog-overlay.svelte";
|
|
8
|
-
import type { Snippet } from "svelte";
|
|
9
|
-
|
|
10
|
-
let {
|
|
11
|
-
ref = $bindable(null),
|
|
12
|
-
class: className,
|
|
13
|
-
portalProps,
|
|
14
|
-
children,
|
|
15
|
-
showCloseButton = true,
|
|
16
|
-
...restProps
|
|
17
|
-
}: WithoutChildrenOrChild<DialogPrimitive.ContentProps> & {
|
|
18
|
-
portalProps?: WithoutChildrenOrChild<DialogPrimitive.PortalProps>;
|
|
19
|
-
children: Snippet;
|
|
20
|
-
showCloseButton?: boolean;
|
|
21
|
-
} = $props();
|
|
22
|
-
const i18n = getAdminI18n();
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<DialogPrimitive.Portal {...portalProps}>
|
|
26
|
-
<DialogOverlay />
|
|
27
|
-
<DialogPrimitive.Content
|
|
28
|
-
bind:ref
|
|
29
|
-
data-slot="dialog-content"
|
|
30
|
-
class={cn(
|
|
31
|
-
"ridu-dialog-enter grid max-w-[calc(100%-2rem)] gap-6 rounded-[4px] border border-control-border bg-popover p-6.5 text-[14.5px] text-popover-foreground shadow-[var(--shadow-dialog)] sm:max-w-[460px] fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none",
|
|
32
|
-
className
|
|
33
|
-
)}
|
|
34
|
-
{...restProps}
|
|
35
|
-
>
|
|
36
|
-
{@render children?.()}
|
|
37
|
-
{#if showCloseButton}
|
|
38
|
-
<DialogPrimitive.Close
|
|
39
|
-
type="button"
|
|
40
|
-
data-slot="dialog-close"
|
|
41
|
-
class={buttonVariants({
|
|
42
|
-
variant: "ghost",
|
|
43
|
-
size: "icon-sm",
|
|
44
|
-
class: "absolute top-4 end-4",
|
|
45
|
-
})}
|
|
46
|
-
>
|
|
47
|
-
<XIcon />
|
|
48
|
-
<span class="sr-only">{i18n.t("general:close")}</span>
|
|
49
|
-
</DialogPrimitive.Close>
|
|
50
|
-
{/if}
|
|
51
|
-
</DialogPrimitive.Content>
|
|
52
|
-
</DialogPrimitive.Portal>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Dialog as DialogPrimitive } from "bits-ui";
|
|
3
|
-
import { cn } from "@riducms/ui";
|
|
4
|
-
|
|
5
|
-
let {
|
|
6
|
-
ref = $bindable(null),
|
|
7
|
-
class: className,
|
|
8
|
-
...restProps
|
|
9
|
-
}: DialogPrimitive.DescriptionProps = $props();
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<DialogPrimitive.Description
|
|
13
|
-
bind:ref
|
|
14
|
-
data-slot="dialog-description"
|
|
15
|
-
class={cn(
|
|
16
|
-
"text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
|
|
17
|
-
className
|
|
18
|
-
)}
|
|
19
|
-
{...restProps}
|
|
20
|
-
/>
|