@ug666/ui-react 0.2.0 → 0.3.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/THIRD_PARTY_NOTICES.txt +98 -0
- package/dist/aliases.d.ts +107 -0
- package/dist/aliases.d.ts.map +1 -0
- package/dist/blocks/feature-grid.d.ts +48 -0
- package/dist/blocks/feature-grid.d.ts.map +1 -0
- package/dist/blocks/index.cjs +1 -238
- package/dist/blocks/index.cjs.map +1 -1
- package/dist/blocks/index.d.ts +6 -84
- package/dist/blocks/index.d.ts.map +1 -0
- package/dist/blocks/index.js +1 -153
- package/dist/blocks/index.js.map +1 -1
- package/dist/blocks/landing-hero.d.ts +61 -0
- package/dist/blocks/landing-hero.d.ts.map +1 -0
- package/dist/chunk-2EJWWTLH.cjs +1 -0
- package/dist/chunk-2EJWWTLH.cjs.map +1 -0
- package/dist/chunk-D63UPGP5.cjs +1 -0
- package/dist/chunk-D63UPGP5.cjs.map +1 -0
- package/dist/chunk-J4NAYP4L.cjs +1 -0
- package/dist/chunk-J4NAYP4L.cjs.map +1 -0
- package/dist/chunk-JY5S7YLF.cjs +1 -0
- package/dist/chunk-JY5S7YLF.cjs.map +1 -0
- package/dist/chunk-NRCPYVJW.js +1 -0
- package/dist/chunk-NRCPYVJW.js.map +1 -0
- package/dist/chunk-PXVCZ6AZ.js +1 -0
- package/dist/chunk-PXVCZ6AZ.js.map +1 -0
- package/dist/chunk-PZ4UH6BC.js +1 -0
- package/dist/chunk-PZ4UH6BC.js.map +1 -0
- package/dist/chunk-UBZ2ZCEJ.cjs +1 -0
- package/dist/chunk-UBZ2ZCEJ.cjs.map +1 -0
- package/dist/chunk-UEJM2SLH.js +1 -0
- package/dist/chunk-UEJM2SLH.js.map +1 -0
- package/dist/chunk-UESSLLSC.js +1 -0
- package/dist/chunk-UESSLLSC.js.map +1 -0
- package/dist/chunk-VDBATAZ3.js +1 -0
- package/dist/chunk-VDBATAZ3.js.map +1 -0
- package/dist/chunk-WQHHSYYD.js +1 -0
- package/dist/chunk-WQHHSYYD.js.map +1 -0
- package/dist/chunk-X4EMYHLY.cjs +1 -0
- package/dist/chunk-X4EMYHLY.cjs.map +1 -0
- package/dist/chunk-XN7GQRSF.js +1 -0
- package/dist/chunk-XN7GQRSF.js.map +1 -0
- package/dist/chunk-XVFRKGM7.cjs +1 -0
- package/dist/chunk-XVFRKGM7.cjs.map +1 -0
- package/dist/chunk-ZDO5A2IZ.cjs +1 -0
- package/dist/chunk-ZDO5A2IZ.cjs.map +1 -0
- package/dist/components/accordion.d.ts +65 -0
- package/dist/components/accordion.d.ts.map +1 -0
- package/dist/components/alert.d.ts +23 -0
- package/dist/components/alert.d.ts.map +1 -0
- package/dist/components/autocomplete.d.ts +21 -0
- package/dist/components/autocomplete.d.ts.map +1 -0
- package/dist/components/avatar-group.d.ts +20 -0
- package/dist/components/avatar-group.d.ts.map +1 -0
- package/dist/components/avatar.d.ts +34 -0
- package/dist/components/avatar.d.ts.map +1 -0
- package/dist/components/backtop.d.ts +11 -0
- package/dist/components/backtop.d.ts.map +1 -0
- package/dist/components/badge.d.ts +33 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/bar-chart.d.ts +23 -0
- package/dist/components/bar-chart.d.ts.map +1 -0
- package/dist/components/breadcrumb.d.ts +37 -0
- package/dist/components/breadcrumb.d.ts.map +1 -0
- package/dist/components/button-group.d.ts +26 -0
- package/dist/components/button-group.d.ts.map +1 -0
- package/dist/components/button.d.ts +45 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/calendar.d.ts +40 -0
- package/dist/components/calendar.d.ts.map +1 -0
- package/dist/components/card.d.ts +33 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/carousel.d.ts +29 -0
- package/dist/components/carousel.d.ts.map +1 -0
- package/dist/components/cascader.d.ts +54 -0
- package/dist/components/cascader.d.ts.map +1 -0
- package/dist/components/checkbox-group-context.d.ts +14 -0
- package/dist/components/checkbox-group-context.d.ts.map +1 -0
- package/dist/components/checkbox-group.d.ts +18 -0
- package/dist/components/checkbox-group.d.ts.map +1 -0
- package/dist/components/checkbox.d.ts +32 -0
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/collapsible.d.ts +23 -0
- package/dist/components/collapsible.d.ts.map +1 -0
- package/dist/components/color-picker.d.ts +19 -0
- package/dist/components/color-picker.d.ts.map +1 -0
- package/dist/components/config-provider.d.ts +31 -0
- package/dist/components/config-provider.d.ts.map +1 -0
- package/dist/components/container.d.ts +27 -0
- package/dist/components/container.d.ts.map +1 -0
- package/dist/components/context/form-context.d.ts +41 -0
- package/dist/components/context/form-context.d.ts.map +1 -0
- package/dist/components/context-menu.d.ts +39 -0
- package/dist/components/context-menu.d.ts.map +1 -0
- package/dist/components/data-panel.d.ts +38 -0
- package/dist/components/data-panel.d.ts.map +1 -0
- package/dist/components/date-picker.d.ts +16 -0
- package/dist/components/date-picker.d.ts.map +1 -0
- package/dist/components/date-range-picker.d.ts +42 -0
- package/dist/components/date-range-picker.d.ts.map +1 -0
- package/dist/components/date-time-picker.d.ts +12 -0
- package/dist/components/date-time-picker.d.ts.map +1 -0
- package/dist/components/descriptions.d.ts +40 -0
- package/dist/components/descriptions.d.ts.map +1 -0
- package/dist/components/dialog.d.ts +64 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dock.d.ts +29 -0
- package/dist/components/dock.d.ts.map +1 -0
- package/dist/components/donut-chart.d.ts +30 -0
- package/dist/components/donut-chart.d.ts.map +1 -0
- package/dist/components/drawer.d.ts +47 -0
- package/dist/components/drawer.d.ts.map +1 -0
- package/dist/components/dropdown.d.ts +50 -0
- package/dist/components/dropdown.d.ts.map +1 -0
- package/dist/components/empty-state.d.ts +27 -0
- package/dist/components/empty-state.d.ts.map +1 -0
- package/dist/components/fab.d.ts +38 -0
- package/dist/components/fab.d.ts.map +1 -0
- package/dist/components/fieldset.d.ts +13 -0
- package/dist/components/fieldset.d.ts.map +1 -0
- package/dist/components/file-input.d.ts +17 -0
- package/dist/components/file-input.d.ts.map +1 -0
- package/dist/components/form.d.ts +127 -0
- package/dist/components/form.d.ts.map +1 -0
- package/dist/components/gauge-chart.d.ts +19 -0
- package/dist/components/gauge-chart.d.ts.map +1 -0
- package/dist/components/heatmap-chart.d.ts +28 -0
- package/dist/components/heatmap-chart.d.ts.map +1 -0
- package/dist/components/icon.d.ts +16 -0
- package/dist/components/icon.d.ts.map +1 -0
- package/dist/components/image-viewer.d.ts +15 -0
- package/dist/components/image-viewer.d.ts.map +1 -0
- package/dist/components/image.d.ts +14 -0
- package/dist/components/image.d.ts.map +1 -0
- package/dist/components/index.cjs +1 -3993
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.ts +107 -1096
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +1 -330
- package/dist/components/indicator.d.ts +20 -0
- package/dist/components/indicator.d.ts.map +1 -0
- package/dist/components/infinite-scroll.d.ts +20 -0
- package/dist/components/infinite-scroll.d.ts.map +1 -0
- package/dist/components/input.d.ts +28 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/join.d.ts +20 -0
- package/dist/components/join.d.ts.map +1 -0
- package/dist/components/kbd.d.ts +8 -0
- package/dist/components/kbd.d.ts.map +1 -0
- package/dist/components/label.d.ts +18 -0
- package/dist/components/label.d.ts.map +1 -0
- package/dist/components/layout.d.ts +34 -0
- package/dist/components/layout.d.ts.map +1 -0
- package/dist/components/link.d.ts +18 -0
- package/dist/components/link.d.ts.map +1 -0
- package/dist/components/list.d.ts +21 -0
- package/dist/components/list.d.ts.map +1 -0
- package/dist/components/loading.d.ts +10 -0
- package/dist/components/loading.d.ts.map +1 -0
- package/dist/components/modal.d.ts +63 -0
- package/dist/components/modal.d.ts.map +1 -0
- package/dist/components/navbar.d.ts +23 -0
- package/dist/components/navbar.d.ts.map +1 -0
- package/dist/components/navigation-menu.d.ts +54 -0
- package/dist/components/navigation-menu.d.ts.map +1 -0
- package/dist/components/notification.d.ts +22 -0
- package/dist/components/notification.d.ts.map +1 -0
- package/dist/components/number-input.d.ts +35 -0
- package/dist/components/number-input.d.ts.map +1 -0
- package/dist/components/otp-input.d.ts +45 -0
- package/dist/components/otp-input.d.ts.map +1 -0
- package/dist/components/pagination.d.ts +19 -0
- package/dist/components/pagination.d.ts.map +1 -0
- package/dist/components/popconfirm.d.ts +20 -0
- package/dist/components/popconfirm.d.ts.map +1 -0
- package/dist/components/popover.d.ts +37 -0
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/progress.d.ts +30 -0
- package/dist/components/progress.d.ts.map +1 -0
- package/dist/components/radar-chart.d.ts +24 -0
- package/dist/components/radar-chart.d.ts.map +1 -0
- package/dist/components/radial-progress.d.ts +18 -0
- package/dist/components/radial-progress.d.ts.map +1 -0
- package/dist/components/radio.d.ts +79 -0
- package/dist/components/radio.d.ts.map +1 -0
- package/dist/components/ranking-list.d.ts +31 -0
- package/dist/components/ranking-list.d.ts.map +1 -0
- package/dist/components/rating.d.ts +20 -0
- package/dist/components/rating.d.ts.map +1 -0
- package/dist/components/result.d.ts +13 -0
- package/dist/components/result.d.ts.map +1 -0
- package/dist/components/scrollbar.d.ts +29 -0
- package/dist/components/scrollbar.d.ts.map +1 -0
- package/dist/components/select.d.ts +48 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/separator.d.ts +28 -0
- package/dist/components/separator.d.ts.map +1 -0
- package/dist/components/sheet.d.ts +35 -0
- package/dist/components/sheet.d.ts.map +1 -0
- package/dist/components/sidebar.d.ts +84 -0
- package/dist/components/sidebar.d.ts.map +1 -0
- package/dist/components/skeleton.d.ts +16 -0
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/slider.d.ts +44 -0
- package/dist/components/slider.d.ts.map +1 -0
- package/dist/components/space.d.ts +19 -0
- package/dist/components/space.d.ts.map +1 -0
- package/dist/components/spinner.d.ts +22 -0
- package/dist/components/spinner.d.ts.map +1 -0
- package/dist/components/splitter.d.ts +52 -0
- package/dist/components/splitter.d.ts.map +1 -0
- package/dist/components/stack.d.ts +16 -0
- package/dist/components/stack.d.ts.map +1 -0
- package/dist/components/stacked-bar-chart.d.ts +25 -0
- package/dist/components/stacked-bar-chart.d.ts.map +1 -0
- package/dist/components/statistic-card.d.ts +50 -0
- package/dist/components/statistic-card.d.ts.map +1 -0
- package/dist/components/statistic.d.ts +35 -0
- package/dist/components/statistic.d.ts.map +1 -0
- package/dist/components/steps.d.ts +35 -0
- package/dist/components/steps.d.ts.map +1 -0
- package/dist/components/switch.d.ts +49 -0
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/table.d.ts +46 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/tabs.d.ts +40 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tag.d.ts +29 -0
- package/dist/components/tag.d.ts.map +1 -0
- package/dist/components/text.d.ts +16 -0
- package/dist/components/text.d.ts.map +1 -0
- package/dist/components/textarea.d.ts +26 -0
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/theme-controller.d.ts +24 -0
- package/dist/components/theme-controller.d.ts.map +1 -0
- package/dist/components/time-picker.d.ts +8 -0
- package/dist/components/time-picker.d.ts.map +1 -0
- package/dist/components/time-range-picker.d.ts +30 -0
- package/dist/components/time-range-picker.d.ts.map +1 -0
- package/dist/components/time-select.d.ts +15 -0
- package/dist/components/time-select.d.ts.map +1 -0
- package/dist/components/timeline.d.ts +22 -0
- package/dist/components/timeline.d.ts.map +1 -0
- package/dist/components/toast.d.ts +72 -0
- package/dist/components/toast.d.ts.map +1 -0
- package/dist/components/tooltip.d.ts +32 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/transfer.d.ts +51 -0
- package/dist/components/transfer.d.ts.map +1 -0
- package/dist/components/tree-select.d.ts +29 -0
- package/dist/components/tree-select.d.ts.map +1 -0
- package/dist/components/tree.d.ts +56 -0
- package/dist/components/tree.d.ts.map +1 -0
- package/dist/components/trend-chart.d.ts +43 -0
- package/dist/components/trend-chart.d.ts.map +1 -0
- package/dist/components/upload.d.ts +28 -0
- package/dist/components/upload.d.ts.map +1 -0
- package/dist/hooks/index.cjs +1 -352
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.ts +19 -231
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +1 -32
- package/dist/hooks/use-click-outside.d.ts +9 -0
- package/dist/hooks/use-click-outside.d.ts.map +1 -0
- package/dist/hooks/use-copy-to-clipboard.d.ts +12 -0
- package/dist/hooks/use-copy-to-clipboard.d.ts.map +1 -0
- package/dist/hooks/use-debounce.d.ts +7 -0
- package/dist/hooks/use-debounce.d.ts.map +1 -0
- package/dist/hooks/use-escape-key.d.ts +17 -0
- package/dist/hooks/use-escape-key.d.ts.map +1 -0
- package/dist/hooks/use-event-listener.d.ts +27 -0
- package/dist/hooks/use-event-listener.d.ts.map +1 -0
- package/dist/hooks/use-form.d.ts +49 -0
- package/dist/hooks/use-form.d.ts.map +1 -0
- package/dist/hooks/use-hotkeys.d.ts +30 -0
- package/dist/hooks/use-hotkeys.d.ts.map +1 -0
- package/dist/hooks/use-interval.d.ts +19 -0
- package/dist/hooks/use-interval.d.ts.map +1 -0
- package/dist/hooks/use-local-storage.d.ts +9 -0
- package/dist/hooks/use-local-storage.d.ts.map +1 -0
- package/dist/hooks/use-media-query.d.ts +8 -0
- package/dist/hooks/use-media-query.d.ts.map +1 -0
- package/dist/hooks/use-mounted.d.ts +18 -0
- package/dist/hooks/use-mounted.d.ts.map +1 -0
- package/dist/hooks/use-pagination.d.ts +36 -0
- package/dist/hooks/use-pagination.d.ts.map +1 -0
- package/dist/hooks/use-timeout.d.ts +19 -0
- package/dist/hooks/use-timeout.d.ts.map +1 -0
- package/dist/hooks/use-toggle.d.ts +9 -0
- package/dist/hooks/use-toggle.d.ts.map +1 -0
- package/dist/index.cjs +1 -4499
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +120 -294
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -539
- package/dist/index.js.map +1 -1
- package/dist/internal/admin-horizontal-navigation.d.ts +9 -0
- package/dist/internal/admin-horizontal-navigation.d.ts.map +1 -0
- package/dist/internal/button-group-context.d.ts +11 -0
- package/dist/internal/button-group-context.d.ts.map +1 -0
- package/dist/internal/cn.d.ts +8 -0
- package/dist/internal/cn.d.ts.map +1 -0
- package/dist/internal/data-table-header.d.ts +20 -0
- package/dist/internal/data-table-header.d.ts.map +1 -0
- package/dist/internal/date-mode-panel.d.ts +9 -0
- package/dist/internal/date-mode-panel.d.ts.map +1 -0
- package/dist/internal/date-time-control.d.ts +33 -0
- package/dist/internal/date-time-control.d.ts.map +1 -0
- package/dist/internal/date-time-range-control.d.ts +27 -0
- package/dist/internal/date-time-range-control.d.ts.map +1 -0
- package/dist/internal/option-window.d.ts +9 -0
- package/dist/internal/option-window.d.ts.map +1 -0
- package/dist/internal/sidebar-navigation.d.ts +55 -0
- package/dist/internal/sidebar-navigation.d.ts.map +1 -0
- package/dist/internal/time-panel.d.ts +8 -0
- package/dist/internal/time-panel.d.ts.map +1 -0
- package/dist/internal/use-cascader-lazy.d.ts +8 -0
- package/dist/internal/use-cascader-lazy.d.ts.map +1 -0
- package/dist/internal/use-floating-layout-observer.d.ts +8 -0
- package/dist/internal/use-floating-layout-observer.d.ts.map +1 -0
- package/dist/internal/use-overlay-focus.d.ts +9 -0
- package/dist/internal/use-overlay-focus.d.ts.map +1 -0
- package/dist/internal/use-portal-container.d.ts +2 -0
- package/dist/internal/use-portal-container.d.ts.map +1 -0
- package/dist/internal/use-presence.d.ts +13 -0
- package/dist/internal/use-presence.d.ts.map +1 -0
- package/dist/internal/use-transfer-remote.d.ts +20 -0
- package/dist/internal/use-transfer-remote.d.ts.map +1 -0
- package/dist/internal/use-tree-data.d.ts +8 -0
- package/dist/internal/use-tree-data.d.ts.map +1 -0
- package/dist/patterns/admin-shell.d.ts +118 -0
- package/dist/patterns/admin-shell.d.ts.map +1 -0
- package/dist/patterns/app-tabs.d.ts +33 -0
- package/dist/patterns/app-tabs.d.ts.map +1 -0
- package/dist/patterns/attachment-list.d.ts +36 -0
- package/dist/patterns/attachment-list.d.ts.map +1 -0
- package/dist/patterns/confirm-dialog.d.ts +50 -0
- package/dist/patterns/confirm-dialog.d.ts.map +1 -0
- package/dist/patterns/conversation-list.d.ts +27 -0
- package/dist/patterns/conversation-list.d.ts.map +1 -0
- package/dist/patterns/copy-field.d.ts +35 -0
- package/dist/patterns/copy-field.d.ts.map +1 -0
- package/dist/patterns/data-table-identity.d.ts +14 -0
- package/dist/patterns/data-table-identity.d.ts.map +1 -0
- package/dist/patterns/data-table-toolbar.d.ts +18 -0
- package/dist/patterns/data-table-toolbar.d.ts.map +1 -0
- package/dist/patterns/data-table.d.ts +69 -0
- package/dist/patterns/data-table.d.ts.map +1 -0
- package/dist/patterns/index.cjs +1 -758
- package/dist/patterns/index.cjs.map +1 -1
- package/dist/patterns/index.d.ts +18 -158
- package/dist/patterns/index.d.ts.map +1 -0
- package/dist/patterns/index.js +1 -320
- package/dist/patterns/index.js.map +1 -1
- package/dist/patterns/message.d.ts +30 -0
- package/dist/patterns/message.d.ts.map +1 -0
- package/dist/patterns/page-header.d.ts +41 -0
- package/dist/patterns/page-header.d.ts.map +1 -0
- package/dist/patterns/prompt-composer.d.ts +55 -0
- package/dist/patterns/prompt-composer.d.ts.map +1 -0
- package/dist/patterns/quick-access.d.ts +39 -0
- package/dist/patterns/quick-access.d.ts.map +1 -0
- package/dist/patterns/selection-list.d.ts +34 -0
- package/dist/patterns/selection-list.d.ts.map +1 -0
- package/dist/patterns/theme-configurator-dialog.d.ts +21 -0
- package/dist/patterns/theme-configurator-dialog.d.ts.map +1 -0
- package/dist/patterns/theme-configurator.d.ts +24 -0
- package/dist/patterns/theme-configurator.d.ts.map +1 -0
- package/dist/patterns/tree-table.d.ts +18 -0
- package/dist/patterns/tree-table.d.ts.map +1 -0
- package/dist/primitives/index.cjs +1 -384
- package/dist/primitives/index.cjs.map +1 -1
- package/dist/primitives/index.d.ts +26 -135
- package/dist/primitives/index.d.ts.map +1 -0
- package/dist/primitives/index.js +1 -56
- package/dist/styles.css +2 -2499
- package/dist/theme.cjs +1 -0
- package/dist/theme.cjs.map +1 -0
- package/dist/theme.d.ts +46 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +1 -0
- package/dist/theme.js.map +1 -0
- package/dist/themes/default.css +1 -0
- package/dist/themes/mecha.css +1 -0
- package/dist/themes/minimal.css +1 -0
- package/dist/tokens.css +2 -86
- package/package.json +24 -18
- package/dist/blocks/index.d.cts +0 -86
- package/dist/button-CaLZig8j.d.cts +0 -22
- package/dist/button-CaLZig8j.d.ts +0 -22
- package/dist/chunk-2IVRUJKO.js +0 -377
- package/dist/chunk-2IVRUJKO.js.map +0 -1
- package/dist/chunk-73WQAE3E.js +0 -3003
- package/dist/chunk-73WQAE3E.js.map +0 -1
- package/dist/chunk-MGXIF756.js +0 -313
- package/dist/chunk-MGXIF756.js.map +0 -1
- package/dist/chunk-RUDEZA5Q.js +0 -62
- package/dist/chunk-RUDEZA5Q.js.map +0 -1
- package/dist/chunk-S45GP6IB.js +0 -254
- package/dist/chunk-S45GP6IB.js.map +0 -1
- package/dist/components/index.d.cts +0 -1097
- package/dist/hooks/index.d.cts +0 -232
- package/dist/index.d.cts +0 -297
- package/dist/labs/index.cjs +0 -34
- package/dist/labs/index.cjs.map +0 -1
- package/dist/labs/index.d.cts +0 -12
- package/dist/labs/index.d.ts +0 -12
- package/dist/labs/index.js +0 -9
- package/dist/labs/index.js.map +0 -1
- package/dist/patterns/index.d.cts +0 -158
- package/dist/primitives/index.d.cts +0 -137
- package/dist/sidebar-vl00Z2o-.d.cts +0 -93
- package/dist/sidebar-vl00Z2o-.d.ts +0 -93
package/dist/patterns/index.js
CHANGED
|
@@ -1,320 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
Modal,
|
|
4
|
-
ModalContent,
|
|
5
|
-
ModalFooter,
|
|
6
|
-
ModalHeader,
|
|
7
|
-
ModalTitle,
|
|
8
|
-
Sidebar
|
|
9
|
-
} from "../chunk-2IVRUJKO.js";
|
|
10
|
-
import {
|
|
11
|
-
Button,
|
|
12
|
-
cn
|
|
13
|
-
} from "../chunk-RUDEZA5Q.js";
|
|
14
|
-
|
|
15
|
-
// src/patterns/admin-shell.tsx
|
|
16
|
-
import { forwardRef, useState } from "react";
|
|
17
|
-
import { Menu } from "lucide-react";
|
|
18
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
19
|
-
var AdminShell = forwardRef(
|
|
20
|
-
({
|
|
21
|
-
navItems,
|
|
22
|
-
sidebarHeader,
|
|
23
|
-
sidebarFooter,
|
|
24
|
-
sidebarVariant = "dark",
|
|
25
|
-
sidebarSearchable = false,
|
|
26
|
-
sidebarCollapsible = true,
|
|
27
|
-
sidebarCollapsed,
|
|
28
|
-
defaultSidebarCollapsed = false,
|
|
29
|
-
onSidebarCollapsedChange,
|
|
30
|
-
mobileSidebarOpen,
|
|
31
|
-
onMobileSidebarOpenChange,
|
|
32
|
-
topbarStart,
|
|
33
|
-
topbarEnd,
|
|
34
|
-
topbar,
|
|
35
|
-
mainClassName,
|
|
36
|
-
contentClassName,
|
|
37
|
-
children,
|
|
38
|
-
className,
|
|
39
|
-
...props
|
|
40
|
-
}, ref) => {
|
|
41
|
-
const [internalMobileOpen, setInternalMobileOpen] = useState(false);
|
|
42
|
-
const effectiveMobileOpen = mobileSidebarOpen ?? internalMobileOpen;
|
|
43
|
-
function setMobileOpen(open) {
|
|
44
|
-
if (mobileSidebarOpen === void 0) {
|
|
45
|
-
setInternalMobileOpen(open);
|
|
46
|
-
}
|
|
47
|
-
onMobileSidebarOpenChange?.(open);
|
|
48
|
-
}
|
|
49
|
-
return /* @__PURE__ */ jsx(
|
|
50
|
-
"div",
|
|
51
|
-
{
|
|
52
|
-
ref,
|
|
53
|
-
className: cn("min-h-screen bg-surface-0 text-text-primary", className),
|
|
54
|
-
...props,
|
|
55
|
-
children: /* @__PURE__ */ jsxs("div", { className: "flex min-h-screen min-w-0", children: [
|
|
56
|
-
/* @__PURE__ */ jsx(
|
|
57
|
-
Sidebar,
|
|
58
|
-
{
|
|
59
|
-
items: navItems,
|
|
60
|
-
variant: sidebarVariant,
|
|
61
|
-
header: sidebarHeader,
|
|
62
|
-
footer: sidebarFooter,
|
|
63
|
-
searchable: sidebarSearchable,
|
|
64
|
-
collapsible: sidebarCollapsible,
|
|
65
|
-
collapsed: sidebarCollapsed,
|
|
66
|
-
defaultCollapsed: defaultSidebarCollapsed,
|
|
67
|
-
onCollapsedChange: onSidebarCollapsedChange,
|
|
68
|
-
responsive: true,
|
|
69
|
-
mobileOpen: effectiveMobileOpen,
|
|
70
|
-
onMobileOpenChange: setMobileOpen,
|
|
71
|
-
className: "shrink-0"
|
|
72
|
-
}
|
|
73
|
-
),
|
|
74
|
-
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
75
|
-
/* @__PURE__ */ jsxs("header", { className: "sticky top-0 z-30 flex min-h-14 items-center gap-3 border-b border-border-base bg-surface-0/95 px-4 backdrop-blur sm:px-6 lg:px-8", children: [
|
|
76
|
-
/* @__PURE__ */ jsx(
|
|
77
|
-
Button,
|
|
78
|
-
{
|
|
79
|
-
type: "button",
|
|
80
|
-
variant: "ghost",
|
|
81
|
-
size: "icon",
|
|
82
|
-
className: "md:hidden",
|
|
83
|
-
"aria-label": "\u6253\u5F00\u4FA7\u8FB9\u680F",
|
|
84
|
-
onClick: () => setMobileOpen(true),
|
|
85
|
-
children: /* @__PURE__ */ jsx(Menu, { size: 18 })
|
|
86
|
-
}
|
|
87
|
-
),
|
|
88
|
-
topbar ? /* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: topbar }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
89
|
-
/* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: topbarStart }),
|
|
90
|
-
topbarEnd ? /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-2", children: topbarEnd }) : null
|
|
91
|
-
] })
|
|
92
|
-
] }),
|
|
93
|
-
/* @__PURE__ */ jsx("main", { className: cn("min-w-0 flex-1 overflow-x-hidden", mainClassName), children: /* @__PURE__ */ jsx("div", { className: cn("mx-auto w-full max-w-7xl px-4 py-6 sm:px-6 lg:px-8", contentClassName), children }) })
|
|
94
|
-
] })
|
|
95
|
-
] })
|
|
96
|
-
}
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
);
|
|
100
|
-
AdminShell.displayName = "AdminShell";
|
|
101
|
-
|
|
102
|
-
// src/patterns/confirm-dialog.tsx
|
|
103
|
-
import { forwardRef as forwardRef2 } from "react";
|
|
104
|
-
import { AlertTriangle, HelpCircle } from "lucide-react";
|
|
105
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
106
|
-
var ConfirmDialog = forwardRef2(
|
|
107
|
-
({
|
|
108
|
-
open,
|
|
109
|
-
onOpenChange,
|
|
110
|
-
title,
|
|
111
|
-
description,
|
|
112
|
-
children,
|
|
113
|
-
variant = "destructive",
|
|
114
|
-
icon,
|
|
115
|
-
cancelText = "\u53D6\u6D88",
|
|
116
|
-
confirmText = "\u786E\u8BA4",
|
|
117
|
-
loading = false,
|
|
118
|
-
disabled = false,
|
|
119
|
-
closeOnConfirm = true,
|
|
120
|
-
onCancel,
|
|
121
|
-
onConfirm,
|
|
122
|
-
className,
|
|
123
|
-
...props
|
|
124
|
-
}, ref) => {
|
|
125
|
-
const Icon = icon ?? (variant === "destructive" ? AlertTriangle : HelpCircle);
|
|
126
|
-
function handleCancel() {
|
|
127
|
-
onCancel?.();
|
|
128
|
-
onOpenChange(false);
|
|
129
|
-
}
|
|
130
|
-
function handleConfirm() {
|
|
131
|
-
const result = onConfirm?.();
|
|
132
|
-
if (closeOnConfirm) onOpenChange(false);
|
|
133
|
-
return result;
|
|
134
|
-
}
|
|
135
|
-
return /* @__PURE__ */ jsx2(Modal, { open, onClose: handleCancel, children: /* @__PURE__ */ jsxs2(
|
|
136
|
-
ModalContent,
|
|
137
|
-
{
|
|
138
|
-
ref,
|
|
139
|
-
className: cn("max-w-md", className),
|
|
140
|
-
...props,
|
|
141
|
-
children: [
|
|
142
|
-
/* @__PURE__ */ jsxs2(ModalHeader, { className: "items-start gap-3", children: [
|
|
143
|
-
/* @__PURE__ */ jsx2(
|
|
144
|
-
"div",
|
|
145
|
-
{
|
|
146
|
-
className: cn(
|
|
147
|
-
"flex h-10 w-10 shrink-0 items-center justify-center rounded-md",
|
|
148
|
-
variant === "destructive" ? "bg-danger-soft text-danger-soft-fg" : "bg-primary-soft text-primary-soft-fg"
|
|
149
|
-
),
|
|
150
|
-
children: /* @__PURE__ */ jsx2(Icon, { size: 20, "aria-hidden": "true" })
|
|
151
|
-
}
|
|
152
|
-
),
|
|
153
|
-
/* @__PURE__ */ jsxs2("div", { className: "min-w-0 flex-1 space-y-1", children: [
|
|
154
|
-
/* @__PURE__ */ jsx2(ModalTitle, { className: "break-words text-base", children: title }),
|
|
155
|
-
description ? /* @__PURE__ */ jsx2("p", { className: "text-sm leading-6 text-text-secondary", children: description }) : null
|
|
156
|
-
] })
|
|
157
|
-
] }),
|
|
158
|
-
children ? /* @__PURE__ */ jsx2("div", { className: "px-6 py-4 text-sm text-text-secondary", children }) : null,
|
|
159
|
-
/* @__PURE__ */ jsxs2(ModalFooter, { className: "flex-col-reverse gap-2 sm:flex-row", children: [
|
|
160
|
-
/* @__PURE__ */ jsx2(Button, { type: "button", variant: "outline", disabled: loading, onClick: handleCancel, children: cancelText }),
|
|
161
|
-
/* @__PURE__ */ jsx2(
|
|
162
|
-
Button,
|
|
163
|
-
{
|
|
164
|
-
type: "button",
|
|
165
|
-
variant: variant === "destructive" ? "destructive" : "default",
|
|
166
|
-
loading,
|
|
167
|
-
disabled,
|
|
168
|
-
onClick: handleConfirm,
|
|
169
|
-
children: confirmText
|
|
170
|
-
}
|
|
171
|
-
)
|
|
172
|
-
] })
|
|
173
|
-
]
|
|
174
|
-
}
|
|
175
|
-
) });
|
|
176
|
-
}
|
|
177
|
-
);
|
|
178
|
-
ConfirmDialog.displayName = "ConfirmDialog";
|
|
179
|
-
|
|
180
|
-
// src/patterns/copy-field.tsx
|
|
181
|
-
import { forwardRef as forwardRef3, useEffect, useRef, useState as useState2 } from "react";
|
|
182
|
-
import { Check, Copy } from "lucide-react";
|
|
183
|
-
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
184
|
-
var CopyField = forwardRef3(
|
|
185
|
-
({
|
|
186
|
-
value,
|
|
187
|
-
label,
|
|
188
|
-
displayValue,
|
|
189
|
-
monospace = true,
|
|
190
|
-
disabled = false,
|
|
191
|
-
copyLabel = "\u590D\u5236",
|
|
192
|
-
copiedLabel = "\u5DF2\u590D\u5236",
|
|
193
|
-
onCopied,
|
|
194
|
-
onCopyError,
|
|
195
|
-
className,
|
|
196
|
-
...props
|
|
197
|
-
}, ref) => {
|
|
198
|
-
const [copied, setCopied] = useState2(false);
|
|
199
|
-
const timeoutRef = useRef(null);
|
|
200
|
-
useEffect(() => {
|
|
201
|
-
return () => {
|
|
202
|
-
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
203
|
-
};
|
|
204
|
-
}, []);
|
|
205
|
-
async function handleCopy() {
|
|
206
|
-
if (disabled) return;
|
|
207
|
-
try {
|
|
208
|
-
if (!navigator.clipboard?.writeText) {
|
|
209
|
-
throw new Error("Clipboard API is not available");
|
|
210
|
-
}
|
|
211
|
-
await navigator.clipboard.writeText(value);
|
|
212
|
-
setCopied(true);
|
|
213
|
-
onCopied?.(value);
|
|
214
|
-
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
215
|
-
timeoutRef.current = setTimeout(() => setCopied(false), 1400);
|
|
216
|
-
} catch (error) {
|
|
217
|
-
onCopyError?.(error);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
return /* @__PURE__ */ jsxs3("div", { ref, className: cn("space-y-2", className), ...props, children: [
|
|
221
|
-
label ? /* @__PURE__ */ jsx3("div", { className: "text-xs font-medium text-text-secondary", children: label }) : null,
|
|
222
|
-
/* @__PURE__ */ jsxs3(
|
|
223
|
-
"div",
|
|
224
|
-
{
|
|
225
|
-
className: cn(
|
|
226
|
-
"flex min-w-0 items-stretch overflow-hidden rounded-md border border-border-base bg-surface-1",
|
|
227
|
-
disabled && "opacity-60"
|
|
228
|
-
),
|
|
229
|
-
children: [
|
|
230
|
-
/* @__PURE__ */ jsx3(
|
|
231
|
-
"div",
|
|
232
|
-
{
|
|
233
|
-
className: cn(
|
|
234
|
-
"min-w-0 flex-1 truncate px-3 py-2 text-sm text-text-primary",
|
|
235
|
-
monospace && "font-mono"
|
|
236
|
-
),
|
|
237
|
-
title: typeof displayValue === "string" ? displayValue : value,
|
|
238
|
-
children: displayValue ?? value
|
|
239
|
-
}
|
|
240
|
-
),
|
|
241
|
-
/* @__PURE__ */ jsx3("div", { className: "flex shrink-0 items-center border-l border-border-base bg-surface-2 px-1.5", children: /* @__PURE__ */ jsxs3(
|
|
242
|
-
Button,
|
|
243
|
-
{
|
|
244
|
-
type: "button",
|
|
245
|
-
variant: "ghost",
|
|
246
|
-
size: "sm",
|
|
247
|
-
disabled,
|
|
248
|
-
onClick: handleCopy,
|
|
249
|
-
"aria-live": "polite",
|
|
250
|
-
children: [
|
|
251
|
-
copied ? /* @__PURE__ */ jsx3(Check, { size: 15 }) : /* @__PURE__ */ jsx3(Copy, { size: 15 }),
|
|
252
|
-
copied ? copiedLabel : copyLabel
|
|
253
|
-
]
|
|
254
|
-
}
|
|
255
|
-
) })
|
|
256
|
-
]
|
|
257
|
-
}
|
|
258
|
-
)
|
|
259
|
-
] });
|
|
260
|
-
}
|
|
261
|
-
);
|
|
262
|
-
CopyField.displayName = "CopyField";
|
|
263
|
-
|
|
264
|
-
// src/patterns/page-header.tsx
|
|
265
|
-
import { forwardRef as forwardRef4 } from "react";
|
|
266
|
-
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
267
|
-
var PageHeader = forwardRef4(
|
|
268
|
-
({
|
|
269
|
-
eyebrow,
|
|
270
|
-
title,
|
|
271
|
-
description,
|
|
272
|
-
badge,
|
|
273
|
-
breadcrumb,
|
|
274
|
-
actions,
|
|
275
|
-
meta,
|
|
276
|
-
children,
|
|
277
|
-
className,
|
|
278
|
-
...props
|
|
279
|
-
}, ref) => {
|
|
280
|
-
return /* @__PURE__ */ jsxs4(
|
|
281
|
-
"header",
|
|
282
|
-
{
|
|
283
|
-
ref,
|
|
284
|
-
className: cn(
|
|
285
|
-
"flex min-w-0 flex-col gap-5 border-b border-border-base pb-6",
|
|
286
|
-
className
|
|
287
|
-
),
|
|
288
|
-
...props,
|
|
289
|
-
children: [
|
|
290
|
-
breadcrumb ? /* @__PURE__ */ jsx4("div", { className: "min-w-0", children: breadcrumb }) : null,
|
|
291
|
-
/* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 flex-col gap-4 lg:flex-row lg:items-start lg:justify-between", children: [
|
|
292
|
-
/* @__PURE__ */ jsxs4("div", { className: "min-w-0 space-y-3", children: [
|
|
293
|
-
eyebrow ? /* @__PURE__ */ jsx4("div", { className: "text-xs font-semibold uppercase text-primary", children: eyebrow }) : null,
|
|
294
|
-
/* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 flex-wrap items-center gap-2.5", children: [
|
|
295
|
-
/* @__PURE__ */ jsx4("h1", { className: "min-w-0 break-words text-2xl font-bold leading-tight text-text-primary sm:text-3xl", children: title }),
|
|
296
|
-
badge ? /* @__PURE__ */ jsx4("div", { className: "shrink-0", children: badge }) : null
|
|
297
|
-
] }),
|
|
298
|
-
description ? /* @__PURE__ */ jsx4("p", { className: "max-w-3xl text-sm leading-6 text-text-secondary", children: description }) : null,
|
|
299
|
-
meta ? /* @__PURE__ */ jsx4("div", { className: "flex min-w-0 flex-wrap items-center gap-x-4 gap-y-2 text-xs text-text-tertiary", children: meta }) : null
|
|
300
|
-
] }),
|
|
301
|
-
actions ? /* @__PURE__ */ jsx4("div", { className: "flex shrink-0 flex-wrap items-center gap-2 lg:justify-end", children: actions }) : null
|
|
302
|
-
] }),
|
|
303
|
-
children ? /* @__PURE__ */ jsx4("div", { className: "min-w-0", children }) : null
|
|
304
|
-
]
|
|
305
|
-
}
|
|
306
|
-
);
|
|
307
|
-
}
|
|
308
|
-
);
|
|
309
|
-
PageHeader.displayName = "PageHeader";
|
|
310
|
-
export {
|
|
311
|
-
AdminShell,
|
|
312
|
-
ConfirmDialog,
|
|
313
|
-
CopyField,
|
|
314
|
-
PageHeader,
|
|
315
|
-
AdminShell as UGAdminShell,
|
|
316
|
-
ConfirmDialog as UGConfirmDialog,
|
|
317
|
-
CopyField as UGCopyField,
|
|
318
|
-
PageHeader as UGPageHeader
|
|
319
|
-
};
|
|
320
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use client";import{Alert as e,AlertDescription as a,AlertTitle as t,Checkbox as r,CheckboxGroup as n,EmptyState as i,Fieldset as l,FieldsetLegend as o,Modal as s,ModalBody as d,ModalCloseButton as c,ModalContent as u,ModalFooter as m,ModalHeader as g,ModalTitle as h,NavigationMenu as p,NavigationMenuContent as v,NavigationMenuItem as b,NavigationMenuLink as f,NavigationMenuTrigger as x,Pagination as w,Radio as y,RadioGroup as N,Select as C,Sidebar as k,Skeleton as S,Table as z,TableBody as T,TableCell as j,TableHead as I,TableHeader as L,TableRow as R,Tabs as A,TabsContent as D,TabsList as E,TabsTrigger as G,Textarea as V}from"../chunk-UEJM2SLH.js";import"../chunk-PZ4UH6BC.js";import{useMediaQuery as $}from"../chunk-XN7GQRSF.js";import{Input as M}from"../chunk-UESSLLSC.js";import{Button as B,cn as P,resolveControlSize as U,resolveDisabled as F,useUIConfig as W}from"../chunk-NRCPYVJW.js";import{forwardRef as O,useEffect as H,useId as _,useRef as q,useState as Q}from"react";import{filterSelectionListOptions as K,getSelectionListScope as J,groupSelectionListOptions as X,updateSelectionListScope as Y}from"@ug666/ui-core";import{ChevronDown as Z,ChevronRight as ee}from"lucide-react";import{jsx as ae,jsxs as te}from"react/jsx-runtime";var re=O(({options:e,value:a,defaultValue:t=[],onValueChange:i,searchable:s=!0,searchPlaceholder:d="搜索选项",emptyLabel:c="没有匹配项",disabled:u,size:m,name:g,form:h,layout:p="stack",collapsibleGroups:v=!1,expandedGroups:b,defaultExpandedGroups:f,onExpandedGroupsChange:x,showSelectAll:w=!0,showSummary:y=!0,showGroupCount:N=!0,className:C,...k},S)=>{const z=W(),T=_(),j=q(null),[I,L]=Q([...t]),[R,A]=Q(""),D=q({value:a,defaultValue:t});D.current={value:a,defaultValue:t};const[E,G]=Q(()=>void 0===f?[]:X(e).filter(e=>!f.includes(e.key)).map(e=>e.key)),V=a??I,$=F(u,z.disabled),O=U(m,z.size),re=K(e,s?R:""),ne=X(re),ie=J(re,V),le=X(e),oe=b??le.filter(e=>!E.includes(e.key)).map(e=>e.key),se=s&&R.trim().length>0,de=ne.every(e=>oe.includes(e.key));function changeExpanded(e){void 0===b&&G(le.filter(a=>!e.includes(a.key)).map(e=>e.key)),x?.(e)}function change(e){$||(void 0===a&&L(e),i?.(e))}return H(()=>{const e=h?document.getElementById(h):j.current?.closest("form");if(!e)return;const a=new Set;function reset(e){const t=setTimeout(()=>{a.delete(t),e.defaultPrevented||(void 0===D.current.value&&L([...D.current.defaultValue]),A(""))},0);a.add(t)}return e.addEventListener("reset",reset),()=>{e.removeEventListener("reset",reset),a.forEach(clearTimeout)}},[h]),te("div",{...k,ref:e=>{j.current=e,"function"==typeof S?S(e):S&&(S.current=e)},className:P("grid min-w-0 gap-[var(--content-gap)] text-text-primary",C),"data-ug":"selection-list","data-ug-slot":"root","data-size":O,"data-layout":p,"data-state":$?"disabled":0===re.length?"empty":"default","data-variant":"grouped",role:"group","aria-label":k["aria-label"]??"选项列表","aria-disabled":$||void 0,children:[s?ae("div",{"data-ug-slot":"search",children:ae(M,{value:R,onValueChange:A,clearable:!0,"aria-label":d,placeholder:d,size:O,disabled:$})}):null,w||y?te("div",{"data-ug-slot":"bulk",className:"flex flex-wrap items-center justify-between gap-[calc(var(--content-gap)*0.5)]",children:[w?ae(r,{checked:ie.checked,indeterminate:ie.indeterminate,size:O,disabled:$||0===ie.available,"aria-describedby":y?`${T}-summary`:void 0,onCheckedChange:e=>change(Y(V,re,e)),label:"全选当前结果"}):null,y?te("span",{id:`${T}-summary`,"data-ug-slot":"summary",className:"text-xs text-text-secondary","aria-live":"polite",children:["已选 ",new Set(V).size," 项;当前 ",ie.total," 项,",ie.available," 项可操作",ie.disabled>0?`,${ie.disabled} 项不可操作`:""]}):null]}):null,v?te("div",{"data-ug-slot":"group-actions",children:[ae(B,{type:"button",size:"default",variant:"ghost",disabled:se||0===ne.length,title:se?"清空搜索后可折叠分组":void 0,onClick:()=>changeExpanded(de?oe.filter(e=>!ne.some(a=>a.key===e)):[...new Set([...oe,...ne.map(e=>e.key)])]),children:de?"全部收起":"全部展开"}),se?ae("span",{"data-ug-slot":"search-hint",children:"搜索时展开匹配分组"}):null]}):null,te("div",{"data-ug-slot":"groups",className:"grid min-w-0 gap-[var(--content-gap)]",children:[ne.map(e=>{const a=J(e.options,V),t=!v||se||oe.includes(e.key),i=`${T}-group-${encodeURIComponent(e.key)}`;return te(l,{variant:"card",size:"sm","data-ug-slot":"group",children:[ae(o,{children:e.label}),te("div",{"data-ug-slot":"group-heading",className:"flex flex-wrap items-center justify-between gap-[calc(var(--content-gap)*0.5)]",children:[ae(r,{checked:a.checked,indeterminate:a.indeterminate,size:O,disabled:$||0===a.available,onCheckedChange:a=>change(Y(V,e.options,a)),label:`全选${e.label}`}),N?te("span",{"data-ug-slot":"group-count",className:"text-xs text-text-secondary",children:["已选 ",a.selected,"/",a.total,a.disabled>0?`,${a.disabled} 项不可操作`:""]}):null,v?ae(B,{type:"button",variant:"ghost",size:"icon",disabled:se,className:N?void 0:"ml-auto","aria-label":`${t?"收起":"展开"}${e.label}选项`,"aria-expanded":t,"aria-controls":i,title:se?"清空搜索后可折叠分组":`${t?"收起":"展开"}${e.label}选项`,onClick:()=>changeExpanded(t?oe.filter(a=>a!==e.key):[...oe,e.key]),children:ae(t?Z:ee,{size:16,"aria-hidden":"true"})}):null]}),ae("div",{id:i,"data-ug-slot":"options",hidden:!t,children:ae(n,{value:V,disabled:$,size:O,orientation:"vertical","aria-label":`${e.label}选项`,onValueChange:e=>change(e.map(String)),children:e.options.map(e=>ae(r,{value:e.id,disabled:e.disabled,"aria-label":e.label,"aria-describedby":[e.description&&`${T}-description-${encodeURIComponent(e.id)}`,e.disabled&&`${T}-locked-${encodeURIComponent(e.id)}`].filter(Boolean).join(" ")||void 0,label:te("span",{"data-ug-slot":"option-label",className:"grid min-w-0 [overflow-wrap:anywhere]",children:[te("span",{children:[e.label,e.disabled?ae("span",{id:`${T}-locked-${encodeURIComponent(e.id)}`,"data-ug-slot":"locked",className:"ml-1 text-xs text-text-secondary",children:"(不可操作)"}):null]}),e.description?ae("span",{id:`${T}-description-${encodeURIComponent(e.id)}`,"data-ug-slot":"option-description",className:"text-xs text-text-secondary",children:e.description}):null]})},e.id))})})]},e.key)}),0===re.length?ae("p",{"data-ug-slot":"empty",className:"text-sm text-text-secondary",role:"status",children:c}):null]}),g?[...new Set(V)].map(e=>ae("input",{type:"hidden",name:g,form:h,value:e,disabled:$},e)):null]})});re.displayName="SelectionList";import{useMemo as ne,useState as ie}from"react";import{ChevronDown as le,ChevronRight as oe}from"lucide-react";import{projectTreeTableRows as se,getTableStructure as de}from"@ug666/ui-core";import{useLayoutEffect as ce,useRef as ue,useState as me}from"react";import{getTableColumnFixed as ge,getTableColumnStyle as he,resolveTableFixedColumns as pe,tableColumnLength as ve,getTableStructure as be,moveTableColumn as fe,getTableSpanGrid as xe}from"@ug666/ui-core";import{observeTableColumnWidths as we}from"@ug666/ui-web";import{Database as ye,RefreshCw as Ne}from"lucide-react";import{useRef as Ce}from"react";import{getTableColumnFixed as ke,getTableColumnStyle as Se}from"@ug666/ui-core";import{ArrowDown as ze,ArrowUp as Te,ArrowUpDown as je,ChevronLeft as Ie,ChevronRight as Le}from"lucide-react";import{jsx as Re,jsxs as Ae}from"react/jsx-runtime";function DataTableHeader({headers:e,layout:a,widths:t,offset:r,selection:n,actions:i,sort:l,order:o,onSortChange:s,reorderable:d,move:c}){const u=Ce(void 0);return Re(L,{children:e.map((m,g)=>Ae(R,{children:[0===g&&null!=n&&Re(I,{rowSpan:e.length,scope:"col","data-leaf-index":0,className:"text-center","data-fixed":ke(a[0]),style:Se(a,0,t),children:n}),m.map(e=>{const{column:n,leafIndex:i,colSpan:m,rowSpan:g,siblingIds:h}=e,p=i+r,v=a.slice(p,p+m),b=ke(v[0]),f=v.every(e=>ke(e)===b),x=Se(a,"right"===b?p+m-1:p,t),w=h.indexOf(n.id),y=n.sortLabel??("string"==typeof n.header||"number"==typeof n.header?String(n.header):n.id),N=Boolean(n.children?.length);return Re(I,{scope:N?"colgroup":"col",colSpan:m,rowSpan:g,"data-leaf-index":N?void 0:p,"data-fixed":f?b:void 0,style:N?{...x,width:void 0,minWidth:void 0}:x,className:n.className,"aria-sort":!N&&n.sortable&&l===n.id?"asc"===o?"ascending":"descending":void 0,draggable:d||void 0,onDragStart:e=>{u.current=n.id,e.dataTransfer.setData("text/plain",n.id),e.dataTransfer.effectAllowed="move"},onDragEnd:()=>{u.current=void 0},onDragOver:e=>{d&&u.current&&h.includes(u.current)&&e.preventDefault()},onDrop:e=>{d&&u.current&&h.includes(u.current)&&(e.preventDefault(),c(u.current,n.id),u.current=void 0)},children:Ae("span",{"data-ug-slot":"header",className:"contents",children:[!N&&n.sortable&&s?Ae(B,{"aria-label":`按${y}排序`,style:{fontWeight:"inherit"},type:"button",size:"sm",tone:"neutral",variant:"text",onClick:()=>s(n.id,l===n.id&&"asc"===o?"desc":"asc"),children:[n.header,l!==n.id?Re(je,{"aria-hidden":!0,size:14}):Re("asc"===o?Te:ze,{"aria-hidden":!0,size:14})]}):n.header,d&&Ae("span",{"data-ug-slot":"column-reorder",children:[Re(B,{type:"button",variant:"text",size:"icon-sm","aria-label":`向左移动${y}`,disabled:0===w,onClick:()=>c(n.id,h[w-1]),children:Re(Ie,{size:14,"aria-hidden":!0})}),Re(B,{type:"button",variant:"text",size:"icon-sm","aria-label":`向右移动${y}`,disabled:w===h.length-1,onClick:()=>c(n.id,h[w+1],!0),children:Re(Le,{size:14,"aria-hidden":!0})})]})]})},n.id)}),0===g&&null!=i&&Re(I,{rowSpan:e.length,scope:"col","data-leaf-index":a.length-1,className:"whitespace-nowrap text-right","data-ug-slot":"action-column","data-fixed":ke(a.at(-1)),children:i})]},g))})}import{Fragment as De,jsx as Ee,jsxs as Ge}from"react/jsx-runtime";var Ve=["loading-a","loading-b","loading-c","loading-d","loading-e"];function DataTable({rows:n,columns:l,getRowId:o,loading:s=!1,error:d,errorTitle:c="数据加载失败",emptyTitle:u="暂无数据",emptyDescription:m="当前条件下没有可展示的记录。",selectedIds:g=new Set,onSelectionChange:h,sort:p,order:v="asc",onSortChange:b,rowActions:f,actionsLabel:x="操作",page:y=1,total:N=n.length,pageSize:k=20,onPageChange:I,pageSizeOptions:L,onPageSizeChange:A,onRetry:D,retryLabel:E="重试",scrollRegionLabel:G="数据表格",size:V="sm",bordered:$=!0,striped:M=!1,tableClassName:U,fill:F=!1,pagination:W=!0,spanMethod:O,summaryMethod:H,columnOrder:_,defaultColumnOrder:q=[],onColumnOrderChange:Q,reorderableColumns:K=!1,className:J,...X}){const[Y,Z]=me(q),ee=be(l,_??Y),ae=ee.leaves,te=xe(n.length,ae.length,(e,a)=>O?.({row:n[e],column:ae[a],rowIndex:e,columnIndex:a})),re=!s&&H?H({rows:n,columns:ae}):void 0;const ne=ue(null),[ie,le]=me({widths:[],regionWidth:1/0}),oe=ie.widths,se=ae.some(e=>"left"===ge(e)),de=[...h?[{width:"var(--control-height-lg)",fixed:se?"left":void 0}]:[],...ae,...f?[{fixed:"right"}]:[]],Ce=h?1:0,ke=pe(de,oe,ie.regionWidth,f?de.length-1:void 0),Se=JSON.stringify([ee.order,de.map(({width:e,minWidth:a,align:t,fixed:r})=>({width:e,minWidth:a,align:t,fixed:r}))]),ze=n.map(o),Te=ze.length>0&&ze.every(e=>g.has(e)),je=ze.some(e=>g.has(e))&&!Te,Ie=Math.max(Math.ceil(N/Math.max(k,1)),1),Le=[...new Set([...L??[],k])].filter(e=>Number.isSafeInteger(e)&&e>0).sort((e,a)=>e-a),Re=d?"error":s?"loading":0===n.length?"empty":"ready";return ce(()=>(f||ae.some(e=>ge(e)))&&ne.current?we(ne.current,(e,a)=>le({widths:e,regionWidth:a})):void 0,[Se,Re]),Ee("div",{ref:ne,className:P("min-w-0",!F&&"space-y-[calc(var(--content-gap)*0.75)]",J),"data-ug":"data-table","data-fill":F||void 0,"data-state":Re,"data-variant":$?"bordered":"default","data-size":V,...X,children:d?Ge("div",{className:"grid min-h-[calc(var(--control-height-lg)*3)] content-center gap-[calc(var(--content-gap)*0.75)]","data-ug-slot":"feedback",children:[Ge(e,{variant:"destructive",children:[Ee(t,{children:c}),Ee(a,{children:d})]}),D?Ee("div",{children:Ge(B,{onClick:D,size:"sm",type:"button",variant:"default",children:[Ee(Ne,{"aria-hidden":"true",size:16}),E]})}):null]}):Ge(De,{children:[Ee("div",{"data-ug-slot":"table",children:Ge(z,{bordered:$,className:P("min-w-[48rem] table-auto",U),scrollRegionLabel:G,size:V,striped:M,children:[Ee("colgroup",{children:de.map((e,a)=>Ee("col",{style:{width:ve(e.width)}},a))}),Ee(DataTableHeader,{headers:ee.headers,layout:ke,widths:oe,offset:Ce,sort:p,order:v,onSortChange:b,reorderable:K,move:function moveColumn(e,a,t=!1){const r=fe(l,ee.order,e,a,t);r.every((e,a)=>e===ee.order[a])||(void 0===_&&Z(r),Q?.(r))},selection:h?Ee("span",{className:"inline-flex","data-ug-slot":"selection",children:Ee(r,{"aria-label":"选择当前页全部记录",checked:Te,indeterminate:je,onCheckedChange:function toggleAll(e){const a=new Set(g);for(const t of ze)e?a.add(t):a.delete(t);h?.(a)}})}):void 0,actions:f?Ee("span",{"data-ug-slot":"header",children:x}):void 0}),Ge(T,{children:[s?Ve.map(e=>Ge(R,{children:[h?Ee(j,{className:"text-center","data-fixed":ge(ke[0]),style:he(ke,0,oe),children:Ee("span",{className:"inline-flex","data-ug-slot":"selection",children:Ee(S,{className:"size-[calc(var(--control-height-sm)*0.5)]",variant:"rect"})})}):null,ae.map((e,a)=>Ee(j,{className:e.className,"data-fixed":ge(ke[a+Ce]),style:he(ke,a+Ce,oe),children:Ee("span",{"data-ug-slot":"loading",children:Ee(S,{variant:"text"})})},e.id)),f?Ee(j,{className:"whitespace-nowrap text-right","data-ug-slot":"action-column","data-fixed":ge(ke[de.length-1]),children:Ee("span",{"data-ug-slot":"loading",children:Ee(S,{variant:"text"})})}):null]},e)):n.map((e,a)=>{const t=o(e),n=g.has(t);return Ge(R,{"data-state":n?"selected":"default",children:[h?Ee(j,{className:"text-center","data-fixed":ge(ke[0]),style:he(ke,0,oe),children:Ee("span",{className:"inline-flex","data-ug-slot":"selection",children:Ee(r,{"aria-label":`选择记录 ${t}`,checked:n,onCheckedChange:e=>function toggleOne(e,a){const t=new Set(g);a?t.add(e):t.delete(e),h?.(t)}(t,e)})})}):null,ae.map((t,r)=>te[a][r].rowSpan>0?Ee(j,{rowSpan:te[a][r].rowSpan,colSpan:te[a][r].colSpan,className:t.className,"data-fixed":1===te[a][r].colSpan?ge(ke[r+Ce]):void 0,style:he(ke,r+Ce,oe),children:Ee("span",{className:"contents","data-ug-slot":"cell",children:t.cell?t.cell(e):String(e[t.id]??"—")})},t.id):null),f?Ee(j,{className:"whitespace-nowrap text-right","data-ug-slot":"action-column","data-fixed":ge(ke[de.length-1]),children:Ee("div",{"data-ug-slot":"actions",children:f(e)})}):null]},t)}),s||0!==n.length?null:Ee(R,{children:Ee(j,{colSpan:ae.length+(h?1:0)+(f?1:0),children:Ee("div",{"data-ug-slot":"empty",children:Ee(i,{description:m,icon:ye,size:"sm",title:u})})})})]}),re&&n.length>0&&Ee("tfoot",{"data-ug-slot":"aggregate",children:Ge(R,{children:[h&&Ee(j,{}),ae.map((e,a)=>Ee(j,{"data-fixed":ge(ke[a+Ce]),style:he(ke,a+Ce,oe),children:re[a]},e.id)),f&&Ee(j,{"data-ug-slot":"action-column","data-fixed":ge(ke[de.length-1])})]})})]})}),W&&!s&&(N>0||L&&A)?Ge("div",{className:"flex min-w-0 flex-wrap items-center justify-between gap-[var(--content-gap)] text-sm text-text-secondary max-sm:items-stretch max-sm:flex-col","data-ug-slot":"pagination",children:[Ge("span",{"data-ug-slot":"summary",children:["共 ",N," 条,第 ",y," / ",Ie," 页"]}),Ge("div",{"data-ug-slot":"pagination-controls",children:[L&&A?Ee(C,{"aria-label":"每页条数",options:Le.map(e=>({label:`每页 ${e} 条`,value:e})),size:"sm",value:k,onValueChange:e=>{"number"==typeof e&&A(e)}}):null,I&&Ie>1?Ee(w,{onPageChange:I,page:y,totalPages:Ie,size:"sm"}):null]})]}):null]})})}import{jsx as $e,jsxs as Me}from"react/jsx-runtime";function defaultChildren(e){return e.children}function TreeTable({rows:e,columns:a,getRowId:t,getChildren:r=defaultChildren,getRowLabel:n,treeColumnId:i=de(a).leaves[0]?.id,expandedIds:l,defaultExpandedIds:o,defaultExpandAll:s=!1,onExpandedChange:d,onExpandChange:c,indent:u=16,expansionDisabled:m=!1,expansionDisabledReason:g,fill:h=!1,size:p="sm",bordered:v=!0,className:b,...f}){const[x,w]=ie(()=>o?new Set(o):void 0),y=l??x,N=ne(()=>se(e,{getRowId:t,getChildren:r,expandedIds:y,defaultExpandAll:s}),[e,t,r,y,s]),C=new Map(N.visibleRows.map(e=>[e.id,e]));function toggle(e,a){if(m)return;const r=t(e),n=new Set(y??(s?N.expandableIds:[]));a?n.add(r):n.delete(r),void 0===l&&w(n),d?.(n),c?.(e,a)}const decorate=e=>e.map(e=>e.children?.length?{...e,children:decorate(e.children)}:e.id!==i?e:{...e,cell:a=>{const r=C.get(t(a)),i=n?.(a)??`记录 ${r.id}`;return Me("div",{"data-ug-slot":"tree-cell","data-depth":r.depth,style:{paddingInlineStart:r.depth*Math.max(u,0)},children:[Me("span",{"data-ug-slot":"level",children:["层级 ",r.depth+1,","]}),r.hasChildren?$e(B,{type:"button",size:"icon-sm",variant:"ghost",tone:"neutral","aria-label":`${r.expanded?"收起":"展开"}${i}`,"aria-expanded":r.expanded,disabled:m,"aria-description":g,onClick:()=>toggle(a,!r.expanded),onKeyDown:e=>{m||("ArrowRight"!==e.key||r.expanded||(e.preventDefault(),toggle(a,!0)),"ArrowLeft"===e.key&&r.expanded&&(e.preventDefault(),toggle(a,!1)))},children:r.expanded?$e(le,{size:16,"aria-hidden":!0}):$e(oe,{size:16,"aria-hidden":!0})}):$e("span",{"data-ug-slot":"tree-spacer","aria-hidden":!0}),$e("span",{"data-ug-slot":"tree-content",title:i,children:e.cell?e.cell(a):String(a[e.id]??"—")})]})}}),k=decorate(a);return $e("div",{className:b,"data-ug":"tree-table","data-ug-slot":"root","data-fill":h||void 0,"data-size":p,"data-variant":v?"bordered":"default","data-state":f.error?"error":f.loading?"loading":N.visibleRows.length?"ready":"empty",children:$e(DataTable,{...f,rows:N.visibleRows.map(e=>e.record),columns:k,getRowId:t,pagination:!1,fill:h,size:p,bordered:v})})}import{resolveUGNavigationColors as Be,resolveUGNavigationPalette as Pe}from"@ug666/ui-core/theme";import{forwardRef as Ue,useState as Fe}from"react";import{Menu as We,PanelLeftClose as Oe,PanelLeftOpen as He}from"lucide-react";import{memo as _e,useCallback as qe,useLayoutEffect as Qe,useMemo as Ke,useRef as Je,useState as Xe}from"react";import{ChevronDown as Ye,MoreHorizontal as Ze}from"lucide-react";import{createSidebarTreeMeta as ea}from"@ug666/ui-web/sidebar";import{jsx as aa,jsxs as ta}from"react/jsx-runtime";function activeClass(e,a){return e?"indicator"===a?"bg-transparent text-[var(--ug-navigation-active-text)] hover:bg-[var(--ug-navigation-hover-bg)] hover:text-[var(--ug-navigation-active-text)] data-[state=open]:bg-[var(--ug-navigation-hover-bg)] data-[state=open]:text-[var(--ug-navigation-active-text)] after:absolute after:inset-x-2 after:bottom-0 after:h-0.5 after:bg-[var(--ug-navigation-active-text)]":"bg-[var(--ug-navigation-active-bg)] text-[var(--ug-navigation-active-text)] hover:bg-[var(--ug-navigation-active-bg)] hover:text-[var(--ug-navigation-active-text)] data-[state=open]:bg-[var(--ug-navigation-active-bg)] data-[state=open]:text-[var(--ug-navigation-active-text)]":"bg-transparent text-[var(--ug-navigation-text)] hover:bg-[var(--ug-navigation-hover-bg)] hover:text-[var(--ug-navigation-text)] data-[state=open]:bg-[var(--ug-navigation-hover-bg)] data-[state=open]:text-[var(--ug-navigation-text)]"}function topItemClass(e,a,t){return P("relative flex max-w-40 items-center gap-1.5 rounded-[var(--radius-control)] px-2.5 font-medium","compact"===t?"h-8 text-xs":"h-9 text-sm",activeClass(e,a))}function moreItemClass(e,a,t){return P("relative flex shrink-0 items-center gap-1 px-2.5","compact"===t?"h-8 text-xs":"h-9 text-sm",activeClass(e,a))}var ra=_e(function DropdownItems2({items:e,level:a=0}){return aa("div",{className:P("grid min-w-52 gap-1 p-1.5",a>0&&"min-w-48 border-l border-[var(--ug-navigation-border)] pl-2"),children:e.map((e,t)=>{const r=e.icon,n=e.id??e.href??`${a}-${t}-${e.label}`;return e.children?.length?ta("div",{className:"grid gap-1",children:[ta("div",{className:"flex items-center gap-2 px-2 py-1.5 text-xs font-semibold text-[var(--ug-navigation-text)] opacity-75",children:[aa(r,{"aria-hidden":"true",size:14}),aa("span",{className:"truncate",children:e.label})]}),aa(DropdownItems2,{items:e.children,level:a+1})]},n):ta(f,{active:e.active,className:P("flex w-full items-center gap-2 px-2.5 py-2",(i=Boolean(e.active),i?"bg-[var(--ug-navigation-active-bg)] text-[var(--ug-navigation-active-text)] hover:bg-[var(--ug-navigation-active-bg)] hover:text-[var(--ug-navigation-active-text)]":"bg-transparent text-[var(--ug-navigation-text)] hover:bg-[var(--ug-navigation-hover-bg)] hover:text-[var(--ug-navigation-text)]")),href:e.href,children:[aa(r,{"aria-hidden":"true",size:15}),aa("span",{className:"min-w-0 flex-1 truncate",children:e.label}),void 0!==e.badge?aa("span",{className:"text-xs opacity-70",children:e.badge}):null]},n);var i})})}),na=_e(function TopItem2({item:e,active:a,activeStyle:t,density:r}){const n=e.icon,i=topItemClass(a,t,r);return e.children?.length?ta(b,{children:[ta(x,{active:a,className:i,children:[aa(n,{"aria-hidden":"true",size:15}),aa("span",{className:"truncate",children:e.label})]}),aa(v,{className:"max-h-[min(70dvh,32rem)] overflow-y-auto overscroll-contain border-[var(--ug-navigation-border)] bg-[var(--ug-navigation-bg)] text-[var(--ug-navigation-text)]",children:aa(ra,{items:e.children})})]}):aa(b,{children:ta(f,{active:a,className:i,href:e.href,children:[aa(n,{"aria-hidden":"true",size:15}),aa("span",{className:"truncate",children:e.label})]})})});function AdminHorizontalNavigation({items:e,activeStyle:a,density:t}){const r=Ke(()=>function normalizeItems(e){const a=1===e.length?e[0]:void 0;return a?.children?.length?a.href?[{...a,children:void 0},...a.children]:a.children:e}(e),[e]),n=Ke(()=>ea(r),[r]),[i,l]=Xe(()=>Math.min(r.length,6)),o=Je(null),s=Je(null),d=Je(null),c=Ke(()=>r.slice(0,i),[r,i]),u=Ke(()=>r.slice(i),[r,i]),m=qe(e=>Boolean(e.active||n.activeBranches.has(e)),[n]),g=Ke(()=>u.some(m),[m,u]),h=qe(()=>{const e=o.current,a=s.current;if(!e||!a||e.clientWidth<=0)return void l(Math.min(r.length,6));const t=Array.from(a.querySelectorAll('[data-ug-navigation-measure="item"]')),n=a.querySelector('[data-ug-navigation-measure="more"]'),i=Number.parseFloat(window.getComputedStyle(a).columnGap)||4,d=n?.getBoundingClientRect().width??0;let c=0,u=0;for(let a=0;a<t.length;a+=1){const r=t[a]?.getBoundingClientRect().width??0,n=a>0?i:0;if(c+n+r+(a<t.length-1?i+d:0)>e.clientWidth+.5)break;c+=n+r,u+=1}l(u)},[r]),f=qe(()=>{null===d.current&&(d.current=window.requestAnimationFrame(()=>{d.current=null,h()}))},[h]);return Qe(()=>{let e=!1;const a="undefined"==typeof ResizeObserver?void 0:new ResizeObserver(f);return o.current&&a?.observe(o.current),f(),document.fonts?.ready.then(()=>{e||f()}),()=>{e=!0,null!==d.current&&window.cancelAnimationFrame(d.current),d.current=null,a?.disconnect()}},[t,f]),ta("div",{className:"relative min-w-0 flex-1",ref:o,children:[ta("div",{"aria-hidden":"true",className:"pointer-events-none absolute invisible flex max-w-none items-center gap-1 whitespace-nowrap","data-ug-slot":"measure",inert:!0,ref:s,children:[r.map((e,r)=>{const n=e.icon;return ta("span",{className:P(topItemClass(m(e),a,t),"max-w-none shrink-0"),"data-ug-navigation-measure":"item",children:[aa(n,{"aria-hidden":"true",size:15}),aa("span",{children:e.label}),e.children?.length?aa(Ye,{"aria-hidden":"true",size:14}):null]},e.id??e.href??`measure-${r}-${e.label}`)}),ta("span",{className:moreItemClass(!1,a,t),"data-ug-navigation-measure":"more",children:[aa(Ze,{"aria-hidden":"true",size:16}),aa("span",{children:"更多"})]})]}),ta(p,{activation:"click",tone:"inherit",className:"min-w-0 w-full overflow-visible","data-ug-context":"admin-horizontal-navigation",children:[c.map((e,r)=>aa(na,{active:m(e),activeStyle:a,density:t,item:e},e.id??e.href??`${r}-${e.label}`)),u.length?ta(b,{children:[ta(x,{active:g,className:moreItemClass(g,a,t),children:[aa(Ze,{"aria-hidden":"true",size:16}),aa("span",{children:"更多"})]}),aa(v,{className:"right-0 left-auto max-h-[min(70dvh,32rem)] overflow-y-auto overscroll-contain border-[var(--ug-navigation-border)] bg-[var(--ug-navigation-bg)] text-[var(--ug-navigation-text)]",children:aa(ra,{items:u})})]}):null]})]})}import{Fragment as ia,jsx as la,jsxs as oa}from"react/jsx-runtime";var sa=Ue(({navItems:e,sidebarHeader:a,sidebarCollapsedHeader:t,sidebarHeaderAlign:r="start",sidebarHeaderDivider:n=!0,sidebarContextSwitcher:i,sidebarContextSwitcherVisible:l=!1,sidebarContextSwitcherDividers:o=!1,sidebarContextSwitcherPlacement:s="after-search",sidebarScrollActiveItemIntoView:d=!0,sidebarFooter:c,sidebarVariant:u="dark",navigationMode:m="sidebar",navigationPalette:g,themePreset:h="default",themeMode:p,themeAccent:v="theme",navigationColors:b,navigationActiveStyle:f,navigationDensity:x,sidebarActiveStyle:w="highlight",sidebarDensity:y="comfortable",sidebarSearchable:N=!1,sidebarSearchPlaceholder:C="搜索菜单...",sidebarSearchDividers:S=!0,sidebarCollapsible:z=!0,sidebarTogglePlacement:T="sidebar",sidebarResizable:j=!1,sidebarWidth:I,defaultSidebarWidth:L=256,sidebarMinWidth:R=208,sidebarMaxWidth:A=480,onSidebarWidthChange:D,sidebarCollapsed:E,defaultSidebarCollapsed:G=!1,onSidebarCollapsedChange:V,mobileSidebarOpen:M,onMobileSidebarOpenChange:U,topbarStart:F,topbarEnd:W,topbar:O,secondaryBar:H,topbarBordered:_=!0,secondaryBarBordered:q=!1,fluidContent:Q=!1,contentPadding:K=!0,mainClassName:J,contentClassName:X,children:Y,className:Z,...ee},ae)=>{const te=$("(prefers-color-scheme: dark)"),[re,ne]=Fe(G),[ie,le]=Fe(!1),oe=E??re,se=M??ie,de=g??("primary"===u?"light":"dark"),ce=void 0===p?de:Pe(p,te),ue=b?de:ce,me=Be(h,ue,b,v),ge=f??w,he=x??y,pe="light"===ue?"primary":"dark",ve={"--ug-navigation-bg":me.background,"--ug-navigation-text":me.text,"--ug-navigation-active-bg":me.activeBackground,"--ug-navigation-active-text":me.activeText,"--ug-navigation-hover-bg":me.hoverBackground,"--ug-navigation-border":`color-mix(in srgb, ${me.text} 18%, ${me.background})`};function setSidebarCollapsed(e){void 0===E&&ne(e),V?.(e)}function setMobileOpen(e){void 0===M&&le(e),U?.(e)}return la("div",{ref:ae,className:P("text-text-primary",Z),...ee,"data-ug":"admin-shell","data-state":se?"mobile-open":"default","data-variant":pe,"data-navigation-mode":m,"data-navigation-palette":ue,"data-sidebar-active-style":ge,"data-sidebar-density":he,"data-size":"md",children:oa("div",{className:"flex min-h-screen min-w-0",children:[la(k,{items:e,variant:pe,activeStyle:ge,density:he,colors:me,header:a,headerAlign:r,headerDivider:n,collapsedHeader:t,contextSwitcher:i,contextSwitcherVisible:l,contextSwitcherDividers:o,contextSwitcherPlacement:s,scrollActiveItemIntoView:d,footer:c,searchable:N,searchPlaceholder:C,searchDividers:S,collapsible:z&&"sidebar"===T,bottomCollapsible:z&&"bottom"===T,resizable:j,width:I,defaultWidth:L,minWidth:R,maxWidth:A,onWidthChange:D,collapsed:oe,onCollapsedChange:setSidebarCollapsed,responsive:!0,mobileOpen:se,onMobileOpenChange:setMobileOpen,className:P("shrink-0","header"===m&&"lg:hidden"),"data-ug-slot":"sidebar"}),oa("div",{className:"flex min-w-0 flex-1 flex-col",children:[oa("header",{className:P("sticky top-0 z-30 flex items-center gap-[calc(var(--content-gap)*0.75)] px-[var(--content-gap)] sm:px-[calc(var(--content-gap)*1.25)] lg:px-[calc(var(--content-gap)*1.5)]",_?"border-b":"border-b-0","header"===m?"border-[var(--ug-navigation-border)] bg-[var(--ug-navigation-bg)] text-[var(--ug-navigation-text)]":"border-border-base bg-surface-0"),style:"header"===m?ve:void 0,"data-ug-slot":"topbar",children:[la(B,{type:"button",variant:"ghost",size:"icon",className:"md:hidden","aria-label":"打开侧边栏",onClick:()=>setMobileOpen(!0),"data-ug-slot":"mobile-trigger",children:la(We,{"aria-hidden":"true",focusable:"false",size:18})}),"sidebar"===m&&z&&"topbar"===T?la(B,{type:"button",variant:"ghost",size:"icon",className:"hidden md:inline-flex","aria-label":oe?"展开侧边栏":"折叠侧边栏",onClick:()=>setSidebarCollapsed(!oe),"data-ug-slot":"desktop-sidebar-trigger",children:la(oe?He:Oe,{"aria-hidden":"true",focusable:"false",size:18})}):null,"header"===m?oa(ia,{children:[la("div",{className:"hidden shrink-0 items-center lg:flex",children:a}),la("div",{className:"hidden min-w-0 flex-1 lg:flex",children:la(AdminHorizontalNavigation,{activeStyle:ge,density:he,items:e})}),la("div",{className:"min-w-0 flex-1 lg:hidden","data-ug-slot":"topbar-start",children:F})]}):la("div",O?{className:"min-w-0 flex-1","data-ug-slot":"topbar-content",children:O}:{className:"min-w-0 flex-1","data-ug-slot":"topbar-start",children:F}),"header"!==m&&O||!W?null:la("div",{className:"flex shrink-0 items-center gap-[calc(var(--content-gap)*0.5)]","data-ug-slot":"topbar-end",children:W},"topbar-end")]}),H?la("div",{className:P("sticky top-[var(--ug-admin-shell-topbar-height)] z-20 bg-surface-1",q&&"border-b border-border-base"),"data-ug-slot":"secondary-bar",children:H}):null,la("main",{className:P("flex-1 overflow-x-clip",J),"data-ug-slot":"main",children:la("div",{className:P("mx-auto",Q?"max-w-none":"max-w-7xl",K?"px-[var(--content-gap)] py-[calc(var(--content-gap)*1.5)] sm:px-[calc(var(--content-gap)*1.25)] lg:px-[calc(var(--content-gap)*1.5)]":"!p-0",X),"data-ug-context":"admin-shell","data-ug-slot":"content",children:Y})})]})]})})});sa.displayName="AdminShell";import{ChevronLeft as da,ChevronRight as ca,X as ua}from"lucide-react";import{forwardRef as ma,memo as ga,useCallback as ha,useEffect as pa,useLayoutEffect as va,useMemo as ba,useRef as fa,useState as xa}from"react";import{jsx as wa,jsxs as ya}from"react/jsx-runtime";function getScrollBehavior(e){return e.closest('[data-ug-motion="reduced"]')||"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth"}function getTabElements(e){return Array.from(e.children).filter(e=>e instanceof HTMLLIElement&&"item"===e.dataset.ugSlot)}function clearItemMotion(e){delete e.dataset.motion,e.style.removeProperty("--ug-app-tabs-motion-x")}function playItemMotion(e,a,t=0){const r=Boolean(e.dataset.motion);clearItemMotion(e),r&&e.offsetWidth,"move"===a&&e.style.setProperty("--ug-app-tabs-motion-x",`${t}px`),e.dataset.motion=a}var Na=ga(({active:e,activeItemRef:a,closable:t,closeEnabled:r,icon:n,label:i,onActivate:l,onClose:o,value:s})=>ya("li",{"data-closable":t||void 0,"data-state":e?"active":"default","data-ug-slot":"item","data-value":s,ref:e?a:void 0,children:[ya("button",{"aria-current":e?"page":void 0,"data-ug-slot":"trigger",onAuxClick:e=>{1===e.button&&t&&r&&(e.preventDefault(),o(s))},onClick:()=>l(s),title:i,type:"button",children:[n?wa("span",{"aria-hidden":"true","data-ug-slot":"icon",children:n}):null,wa("span",{"data-ug-slot":"label",children:i})]}),t&&r?wa("button",{"aria-label":`关闭页面 ${i}`,"data-ug-slot":"close",onClick:()=>o(s),type:"button",children:wa(ua,{"aria-hidden":"true",size:13})}):null]}));Na.displayName="AppTabView";var Ca=ma(({items:e,value:a,density:t="comfortable",showIcons:r=!0,closable:n=!0,bordered:i=!0,onValueChange:l,onClose:o,className:s,"aria-label":d="页面标签",...c},u)=>{const m=fa(null),g=fa(null),h=fa(null),p=fa(null),v=fa(null),b=fa(new Map),f=fa(null),x=fa(e),w=fa(l),y=fa(o),[N,C]=xa({canScrollStart:!1,canScrollEnd:!1}),k=N.canScrollStart||N.canScrollEnd,S=ba(()=>e.map(e=>`${e.value}${e.label}${n&&e.closable?"1":"0"}${r&&e.icon?"1":"0"}`).join(""),[n,e,r]);x.current=e,w.current=l,y.current=o;const z=ha(e=>{const a=x.current.find(a=>a.value===e);a&&w.current(a)},[]),T=ha(e=>{const a=x.current.find(a=>a.value===e);if(!a)return;const t=g.current,r=t?getTabElements(t).find(a=>a.dataset.value===e):null;r?.contains(document.activeElement)&&(f.current=e),y.current?.(a)},[]),j=ha(()=>{null===p.current&&(p.current=window.requestAnimationFrame(()=>{p.current=null;const e=g.current;if(!e)return;const a=Math.max(0,e.scrollWidth-e.clientWidth),t={canScrollStart:e.scrollLeft>1,canScrollEnd:e.scrollLeft<a-1};C(e=>e.canScrollStart===t.canScrollStart&&e.canScrollEnd===t.canScrollEnd?e:t)}))},[]),I=ha(e=>{const a=g.current,t=h.current;if(!a||!t)return;const r=getTabElements(a);if(t===r[0]&&a.scrollLeft>1)return void a.scrollBy({behavior:e,left:-a.scrollLeft});const n=Math.max(0,a.scrollWidth-a.clientWidth);if(t===r[r.length-1]&&a.scrollLeft<n-1)return void a.scrollBy({behavior:e,left:n-a.scrollLeft});const i=t.offsetLeft-a.scrollLeft,l=i+t.offsetWidth-a.clientWidth;i<0?a.scrollBy({behavior:e,left:i-2}):l>0&&a.scrollBy({behavior:e,left:l+2})},[]);function scrollTabs(e){const a=g.current;a&&a.scrollBy({behavior:getScrollBehavior(a),left:e*Math.max(160,.6*a.clientWidth)})}return va(()=>{const e=g.current;if(!e)return;const a=getTabElements(e),t=new Map;for(const e of a){const a=e.dataset.value;a&&t.set(a,e.offsetLeft)}const r=b.current;if(r.size>0&&"auto"!==getScrollBehavior(e))for(const e of a){const a=e.dataset.value;if(!a)continue;const n=r.get(a),i=t.get(a)??0,l=void 0===n?0:n-i;void 0!==n&&Math.abs(l)<.5||playItemMotion(e,void 0===n?"enter":"move",l)}b.current=t},[S]),va(()=>{const e=f.current;if(!e||x.current.some(a=>a.value===e))return;const a=g.current?.querySelector('[data-ug-slot="item"][data-state="active"] [data-ug-slot="trigger"]');a&&(f.current=null,a.focus({preventScroll:!0}))},[S,a]),pa(()=>{const e=m.current,a=g.current;if(!e||!a)return;j(),a.addEventListener("scroll",j,{passive:!0});const handleContainerResize=()=>{j(),null!==v.current&&window.cancelAnimationFrame(v.current),v.current=window.requestAnimationFrame(()=>{v.current=window.requestAnimationFrame(()=>{v.current=null,I("auto"),j()})})},t="undefined"==typeof ResizeObserver?null:new ResizeObserver(handleContainerResize);return t?t.observe(e):window.addEventListener("resize",handleContainerResize),()=>{a.removeEventListener("scroll",j),t?t.disconnect():window.removeEventListener("resize",handleContainerResize),null!==p.current&&(window.cancelAnimationFrame(p.current),p.current=null),null!==v.current&&(window.cancelAnimationFrame(v.current),v.current=null)}},[I,j]),pa(()=>{if(!e.some(e=>e.value===a))return;const t=g.current;t&&(I(getScrollBehavior(t)),j())},[e,I,j,a]),wa("nav",{ref:u,...c,"aria-label":d,className:P("text-text-primary",!i&&"[background-image:none]",s),"data-density":t,"data-overflow":k||void 0,"data-size":"md","data-state":k?"overflow":"default","data-ug":"app-tabs","data-variant":"browser",children:ya("div",{"data-ug-slot":"track",ref:m,children:[wa("button",{"aria-label":"向左滚动页面标签","data-ug-slot":"scroll-start","data-visible":k&&N.canScrollStart||void 0,disabled:!N.canScrollStart,onClick:()=>scrollTabs(-1),type:"button",children:wa(da,{"aria-hidden":"true",size:15})}),wa("ul",{ref:g,"aria-label":"页面标签列表","data-ug-slot":"list",onAnimationEnd:e=>{["ug-motion-app-tab-enter","ug-motion-app-tab-layout-shift"].includes(e.animationName)&&clearItemMotion(e.target)},children:e.map(e=>wa(Na,{active:e.value===a,activeItemRef:h,closable:n&&Boolean(e.closable),closeEnabled:n&&Boolean(o),icon:r?e.icon:void 0,label:e.label,onActivate:z,onClose:T,value:e.value},e.value))}),wa("button",{"aria-label":"向右滚动页面标签","data-ug-slot":"scroll-end","data-visible":k&&N.canScrollEnd||void 0,disabled:!N.canScrollEnd,onClick:()=>scrollTabs(1),type:"button",children:wa(ca,{"aria-hidden":"true",size:15})})]})})});Ca.displayName="AppTabs";import{forwardRef as ka}from"react";import{AlertTriangle as Sa,HelpCircle as za}from"lucide-react";import{jsx as Ta,jsxs as ja}from"react/jsx-runtime";var Ia=ka(({open:e,onOpenChange:a,title:t,description:r,children:n,variant:i="destructive",icon:l,cancelText:o="取消",confirmText:d="确认",loading:c=!1,disabled:p=!1,closeOnConfirm:v=!0,onCancel:b,onConfirm:f,className:x,...w},y)=>{const N=l??("destructive"===i?Sa:za);function handleCancel(){c||(b?.(),a(!1))}return Ta(s,{open:e,onClose:handleCancel,closeOnEsc:!c,closeOnOverlay:!c,children:ja(u,{ref:y,className:P("max-w-md",x),...w,"data-ug":"confirm-dialog","data-state":e?"open":"default","data-variant":i,"data-size":"md",children:[ja(g,{className:"items-start gap-[calc(var(--content-gap)*0.75)]","data-ug-slot":"header",children:[Ta("div",{className:P("flex h-[var(--control-height-md)] w-[var(--control-height-md)] shrink-0 items-center justify-center rounded-[var(--radius-control)]","destructive"===i?"bg-danger-soft text-danger-soft-fg":"bg-primary-soft text-primary-soft-fg"),"data-ug-slot":"icon",children:Ta(N,{size:20,"aria-hidden":"true"})}),ja("div",{className:"min-w-0 flex-1 space-y-[calc(var(--content-gap)*0.25)]","data-ug-slot":"content",children:[Ta(h,{className:"break-words text-base","data-ug-slot":"title",children:t}),r?Ta("p",{className:"text-sm leading-6 text-text-secondary","data-ug-slot":"description",children:r}):null]})]}),n?Ta("div",{className:"px-[var(--content-gap)] py-[var(--content-gap)] text-sm text-text-secondary","data-ug-slot":"body",children:n}):null,ja(m,{className:"flex-col-reverse gap-[calc(var(--content-gap)*0.5)] sm:flex-row","data-ug-slot":"footer",children:[Ta(B,{type:"button",variant:"outline",disabled:c,onClick:handleCancel,"data-ug-slot":"cancel",children:o}),Ta(B,{type:"button",variant:"destructive"===i?"destructive":"default",loading:c,disabled:p,onClick:function handleConfirm(){const e=f?.();return v&&a(!1),e},"data-ug-slot":"confirm",children:d})]})]})})});Ia.displayName="ConfirmDialog";import{forwardRef as La,useEffect as Ra,useRef as Aa,useState as Da}from"react";import{Check as Ea,Copy as Ga}from"lucide-react";import{jsx as Va,jsxs as $a}from"react/jsx-runtime";var Ma=La(({value:e,label:a,displayValue:t,monospace:r=!0,disabled:n=!1,bordered:i=!0,showIcon:l=!0,showCopyText:o=!0,copyLabel:s="复制",copiedLabel:d="已复制",onCopied:c,onCopyError:u,className:m,...g},h)=>{const[p,v]=Da(!1),b=Aa(null),f=Aa({value:e,generation:0,mounted:!0});return f.current.value!==e&&(f.current.value=e,f.current.generation++),Ra(()=>(f.current.mounted=!0,()=>{f.current.mounted=!1,f.current.generation++,b.current&&clearTimeout(b.current)}),[]),Ra(()=>{v(!1),b.current&&(clearTimeout(b.current),b.current=null)},[e]),$a("div",{ref:h,className:P("space-y-[calc(var(--content-gap)*0.5)]",m),...g,"data-ug":"copy-field","data-state":n?"disabled":p?"copied":"default","data-variant":r?"monospace":"default","data-bordered":i?"true":"false","data-size":"md",children:[a?Va("div",{className:"text-xs font-medium text-text-secondary","data-ug-slot":"label",children:a}):null,$a("div",{className:P("flex min-w-0 items-stretch overflow-hidden rounded-[var(--radius-control)] bg-surface-1",i&&"border border-border-base",n&&"opacity-60"),"data-ug-slot":"field",children:[Va("div",{className:P("min-w-0 flex-1 self-center truncate px-[var(--control-padding-x-sm)] py-[calc(var(--content-gap)*0.5)] text-sm text-text-primary",r&&"font-mono"),title:"string"==typeof t?t:e,"data-ug-slot":"value",children:t??e}),Va("div",{className:P("flex shrink-0 items-center bg-surface-2 px-[calc(var(--content-gap)*0.375)]",i&&"border-l border-border-base"),"data-ug-slot":"action",children:$a(B,{type:"button",variant:"ghost",size:"sm",disabled:n,onClick:async function handleCopy(){if(n)return;const a=e,t=++f.current.generation,isCurrent=()=>f.current.mounted&&f.current.generation===t&&f.current.value===a;v(!1),b.current&&(clearTimeout(b.current),b.current=null);try{if(!navigator.clipboard?.writeText)throw new Error("Clipboard API is not available");if(await navigator.clipboard.writeText(a),!isCurrent())return;if(v(!0),c?.(a),!isCurrent())return;b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{isCurrent()&&v(!1),b.current=null},1400)}catch(e){isCurrent()&&u?.(e)}},"aria-label":o?void 0:p?d:s,"aria-live":"polite","data-ug-slot":"button",children:[l?Va(p?Ea:Ga,{"aria-hidden":"true",focusable:"false",size:15}):null,o?p?d:s:null]})})]})]})});Ma.displayName="CopyField";import{jsx as Ba,jsxs as Pa}from"react/jsx-runtime";function DataTableIdentity({title:e,description:a,leading:t,showLeading:r=!0,showDescription:n=!0,className:i,...l}){return Pa("span",{className:P("gap-[calc(var(--content-gap)*0.5)]",i),...l,"data-size":"md","data-state":"default","data-ug":"data-table-identity","data-variant":"default",children:[r&&t?Ba("span",{"data-ug-slot":"leading",children:t}):null,Pa("span",{"data-ug-slot":"copy",children:[Ba("strong",{"data-ug-slot":"title",children:e}),n&&a?Ba("small",{className:"text-text-secondary","data-ug-slot":"description",children:a}):null]})]})}import{jsx as Ua,jsxs as Fa}from"react/jsx-runtime";function DataTableToolbar({title:e,description:a,showDescription:t=!0,bordered:r=!0,compact:n=!1,actions:i,children:l,className:o,...s}){return Fa("div",{className:P("gap-[var(--content-gap)] border-border-base",!r&&"border-b-0",n&&"py-[calc(var(--content-gap)*0.5)]",o),...s,"data-size":n?"sm":"md","data-state":"default","data-ug":"data-table-toolbar","data-variant":"default",children:[Fa("div",{"data-ug-slot":"heading",children:[Ua("strong",{"data-ug-slot":"title",children:e}),t&&a?Ua("span",{"data-ug-slot":"description",children:a}):null]}),l?Ua("div",{"data-ug-slot":"filters",children:l}):null,i?Ua("div",{className:"flex shrink-0 flex-wrap items-center gap-[calc(var(--content-gap)*0.5)]","data-ug-slot":"actions",children:i}):null]})}import{forwardRef as Wa}from"react";import{jsx as Oa,jsxs as Ha}from"react/jsx-runtime";var _a=Wa(({eyebrow:e,title:a,description:t,badge:r,breadcrumb:n,actions:i,meta:l,bordered:o=!0,compact:s=!1,children:d,className:c,...u},m)=>Ha("header",{ref:m,className:P("flex min-w-0 flex-col",s?"gap-[calc(var(--content-gap)*0.875)]":"gap-[calc(var(--content-gap)*1.25)]",o&&(s?"border-b border-border-base pb-[var(--content-gap)]":"border-b border-border-base pb-[calc(var(--content-gap)*1.5)]"),c),...u,"data-ug":"page-header","data-state":"default","data-variant":o?"default":"borderless","data-size":s?"sm":"md",children:[n?Oa("div",{className:"min-w-0","data-ug-slot":"breadcrumb",children:n}):null,Ha("div",{className:"flex min-w-0 flex-col gap-[var(--content-gap)] lg:flex-row lg:items-start lg:justify-between","data-ug-slot":"body",children:[Ha("div",{className:"min-w-0 space-y-[calc(var(--content-gap)*0.75)]","data-ug-slot":"content",children:[e?Oa("div",{className:"text-xs font-semibold uppercase text-primary","data-ug-slot":"eyebrow",children:e}):null,Ha("div",{className:"flex min-w-0 flex-wrap items-center gap-[calc(var(--content-gap)*0.625)]",children:[Oa("h1",{className:"min-w-0 break-words text-2xl font-bold leading-tight text-text-primary sm:text-3xl","data-ug-slot":"title",children:a}),r?Oa("div",{className:"shrink-0","data-ug-slot":"badge",children:r}):null]}),t?Oa("p",{className:"max-w-3xl text-sm leading-6 text-text-secondary","data-ug-slot":"description",children:t}):null,l?Oa("div",{className:"flex min-w-0 flex-wrap items-center gap-x-[var(--content-gap)] gap-y-[calc(var(--content-gap)*0.5)] text-xs text-text-tertiary","data-ug-slot":"meta",children:l}):null]}),i?Oa("div",{className:"flex shrink-0 flex-wrap items-center gap-[calc(var(--content-gap)*0.5)] lg:justify-end","data-ug-slot":"actions",children:i}):null]}),d?Oa("div",{className:"min-w-0","data-ug-slot":"footer",children:d}):null]}));_a.displayName="PageHeader";import{forwardRef as qa}from"react";import{ArrowRight as Qa}from"lucide-react";import{Fragment as Ka,jsx as Ja,jsxs as Xa}from"react/jsx-runtime";var Ya={2:"md:grid-cols-2 xl:grid-cols-2",3:"md:grid-cols-2 lg:grid-cols-3",4:"md:grid-cols-2 xl:grid-cols-4"};function QuickAccessContent({item:e,showIcon:a,showIndicator:t}){const r=e.icon,n=Boolean(a&&r);return Xa(Ka,{children:[n&&r?Ja("span",{"aria-hidden":"true",className:"flex h-[var(--control-height-lg)] w-[var(--control-height-lg)] shrink-0 items-center justify-center rounded-[var(--radius-control)] bg-primary-soft text-primary-soft-fg","data-ug-slot":"icon",children:Ja(r,{size:20})}):null,Xa("span",{className:P("min-w-0",!n&&"col-start-1"),"data-ug-slot":"content",children:[Xa("span",{className:"flex min-w-0 flex-wrap items-center gap-x-[calc(var(--content-gap)*0.5)] gap-y-1",children:[Ja("strong",{className:"min-w-0 break-words text-sm font-semibold leading-5","data-ug-slot":"item-title",children:e.title}),e.meta?Ja("span",{className:"text-xs leading-5 text-text-tertiary","data-ug-slot":"meta",children:e.meta}):null]}),e.description?Ja("span",{className:"mt-1 block break-words text-xs leading-5 text-text-secondary","data-ug-slot":"item-description",children:e.description}):null]}),t?Ja(Qa,{"aria-hidden":"true",className:P("shrink-0 text-text-tertiary transition-[color] duration-[var(--motion-duration-state)] ease-[var(--motion-easing-state)] group-hover:text-primary",!n&&"col-start-2"),"data-ug-slot":"indicator",size:16}):null]})}var Za=qa(({title:e,description:a,items:t,columns:r=4,showIndicator:n=!0,showIcon:i=!0,bordered:l=!0,onSelect:o,className:s,...d},c)=>Xa("section",{ref:c,...d,className:P("min-w-0 space-y-[var(--content-gap)]",s),"data-ug":"quick-access","data-state":t.length>0?"ready":"empty","data-variant":r,"data-size":"md",children:[e||a?Xa("div",{className:"min-w-0 space-y-1","data-ug-slot":"header",children:[e?Ja("h2",{className:"text-base font-semibold leading-6 text-text-primary","data-ug-slot":"title",children:e}):null,a?Ja("p",{className:"text-sm leading-6 text-text-secondary","data-ug-slot":"description",children:a}):null]}):null,Ja("div",{className:P("grid min-w-0 gap-[var(--content-gap)]",Ya[r]),"data-ug-slot":"grid",children:t.map(e=>{const a=e.disabled?"disabled":"interactive",t=function getItemClasses(e,a,t){return P("group grid min-h-[calc(var(--control-height-lg)*2)] min-w-0 w-full items-center gap-[var(--content-gap)]",a&&t?"grid-cols-[auto_minmax(0,1fr)_auto]":a?"grid-cols-[auto_minmax(0,1fr)]":t?"grid-cols-[minmax(0,1fr)_auto]":"grid-cols-[minmax(0,1fr)]","rounded-[var(--radius-panel)] bg-surface-1 p-[var(--content-gap)] text-left text-text-primary shadow-sm",e?"border border-border-base hover:border-border-strong":"border border-transparent","transition-[background-color,border-color,box-shadow] duration-[var(--motion-duration-state)] ease-[var(--motion-easing-state)]","hover:bg-surface-2 hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-border-base disabled:hover:bg-surface-1 disabled:hover:shadow-sm")}(l,Boolean(i&&e.icon),n);return e.href&&!e.disabled?Ja("a",{className:t,"data-state":a,"data-ug-slot":"item",href:e.href,onClick:()=>o?.(e),children:Ja(QuickAccessContent,{item:e,showIcon:i,showIndicator:n})},e.id):Ja("button",{className:t,"data-state":a,"data-ug-slot":"item",disabled:e.disabled,onClick:()=>o?.(e),type:"button",children:Ja(QuickAccessContent,{item:e,showIcon:i,showIndicator:n})},e.id)})})]}));Za.displayName="QuickAccess";import{forwardRef as et}from"react";import{Send as at,Square as tt}from"lucide-react";import{jsx as rt,jsxs as nt}from"react/jsx-runtime";var it=et(({value:e,onValueChange:a,onSubmit:t,onStop:r,onPasteFiles:n,header:i,leading:l,trailing:o,footer:s,submitting:d=!1,disabled:c=!1,submitDisabled:u=!1,allowEmpty:m=!1,submitOnEnter:g=!0,inputLabel:h="消息输入",placeholder:p,submitLabel:v="发送",stopLabel:b="停止",bordered:f=!0,showCharacterCount:x=!1,maxLength:w,shortcutHint:y,showShortcutHint:N,textareaProps:C,className:k,...S},z)=>{const T=!c&&!d&&!u&&(m||e.trim().length>0);function submit(){T&&t(e)}const j=N??Boolean(y)?y??(g?"Enter 发送 · Shift+Enter 换行":null):null,I=x||Boolean(j);return nt("div",{className:P("grid min-w-0 gap-[calc(var(--content-gap)*0.625)] rounded-[var(--radius-panel)] bg-surface-1 p-[calc(var(--content-gap)*0.75)] shadow-sm transition-[border-color,box-shadow]",f?"border border-border-strong focus-within:border-primary/70":"border border-transparent",c&&"opacity-60",k),...S,"data-ug":"prompt-composer","data-state":c?"disabled":d?"submitting":"default","data-variant":"default","data-size":"md",children:[i?rt("div",{className:"min-w-0","data-ug-slot":"header",children:i}):null,nt("div",{className:"flex min-w-0 items-end gap-[calc(var(--content-gap)*0.5)]","data-ug-slot":"body",children:[l?rt("div",{className:"flex h-[var(--control-height-md)] shrink-0 items-center","data-ug-slot":"leading",children:l}):null,rt("div",{className:"min-w-0 flex-1","data-ug-slot":"input",children:rt(V,{...C,ref:z,"aria-label":C?.["aria-label"]??h,autosize:C?.autosize??{minRows:1,maxRows:8},className:P("min-h-[var(--control-height-md)] border-transparent bg-transparent px-[calc(var(--control-padding-x-sm)*0.5)] py-[var(--ug-prompt-input-padding-y)] shadow-none focus-visible:!border-transparent focus-visible:!ring-0 focus-visible:!ring-offset-0",C?.className),disabled:c,maxLength:w??C?.maxLength,onKeyDown:function handleKeyDown(e){g&&"Enter"===e.key&&(e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),submit()))},onPaste:function handlePaste(e){if(!n)return;const a=Array.from(e.clipboardData.files);a.length>0&&n(a,e)},onValueChange:a,placeholder:p??C?.placeholder,resize:"none",value:e})}),o?rt("div",{className:"flex h-[var(--control-height-md)] shrink-0 items-center gap-1","data-ug-slot":"trailing",children:o}):null,rt(B,d&&r?{"aria-label":b,onClick:r,size:"icon",tone:"danger",type:"button",variant:"soft","data-ug-slot":"submit",children:rt(tt,{"aria-hidden":"true",size:15})}:{"aria-label":v,disabled:!T,onClick:submit,size:"icon",tone:"primary",type:"button",variant:"solid","data-ug-slot":"submit",children:rt(at,{"aria-hidden":"true",size:16})})]}),s||I?nt("div",{className:"flex min-w-0 flex-wrap items-center justify-between gap-2 text-xs text-text-tertiary","data-ug-slot":"footer",children:[s?rt("div",{className:"min-w-0 flex-1",children:s}):null,I?nt("div",{className:"ml-auto flex shrink-0 items-center gap-3 tabular-nums","data-ug-slot":"footer-meta",children:[j?rt("span",{"data-ug-slot":"shortcut-hint",children:j}):null,x?rt("span",{"data-ug-slot":"character-count",children:void 0!==w?`${e.length}/${w}`:`${e.length}`}):null]}):null]}):null]})});it.displayName="PromptComposer";import{Children as lt,forwardRef as ot,useEffect as st,useRef as dt}from"react";import{jsx as ct,jsxs as ut}from"react/jsx-runtime";var mt=ot(({messageRole:e,status:a="idle",avatar:t,header:r,footer:n,children:i,className:l,...o},s)=>ut("article",{ref:s,className:P("flex min-w-0 gap-[calc(var(--content-gap)*0.75)]","user"===e&&"justify-end",l),...o,"data-ug":"message","data-state":a,"data-variant":e,"data-size":"md",children:[t&&"user"!==e?ct("div",{className:"shrink-0","data-ug-slot":"avatar",children:t}):null,ut("div",{className:P("grid min-w-0 gap-[calc(var(--content-gap)*0.5)]","user"===e?"max-w-[min(85%,44rem)] rounded-[var(--radius-panel)] bg-surface-2 px-[var(--control-padding-x-lg)] py-[calc(var(--content-gap)*0.75)]":"w-full","error"===a&&"text-danger"),"data-ug-slot":"body",children:[r?ct("div",{className:"text-xs font-medium text-text-secondary","data-ug-slot":"header",children:r}):null,ut("div",{className:"min-w-0 break-words text-sm leading-7 text-text-primary","data-ug-slot":"content",children:[i,"streaming"===a?ct("span",{"aria-label":"正在生成",className:"ml-1 inline-block size-1.5 animate-pulse rounded-full bg-primary motion-reduce:animate-none","data-ug-slot":"streaming"}):null]}),n?ct("div",{className:"flex min-w-0 flex-wrap items-center gap-2 text-xs text-text-tertiary","data-ug-slot":"footer",children:n}):null]}),t&&"user"===e?ct("div",{className:"shrink-0","data-ug-slot":"avatar",children:t}):null]}));mt.displayName="Message";var gt=ot(({empty:e,followOutput:a=!0,followThreshold:t=80,children:r,className:n,onScroll:i,...l},o)=>{const s=dt(null),d=dt(!0),c=lt.count(r)>0;return st(()=>{const e=s.current;a&&e&&d.current&&e.scrollTo?.({top:e.scrollHeight,behavior:"auto"})},[r,a]),ct("div",{ref:function setRef(e){s.current=e,"function"==typeof o?o(e):o&&(o.current=e)},"aria-live":"polite","aria-relevant":"additions text",className:P("grid min-w-0 gap-[calc(var(--content-gap)*1.5)] overflow-y-auto overscroll-contain [min-height:0] [scrollbar-color:var(--color-border-strong)_transparent] [scrollbar-width:thin]",c?"content-start":"content-center",n),onScroll:function handleScroll(e){const a=e.currentTarget;d.current=a.scrollHeight-a.scrollTop-a.clientHeight<=Math.max(0,t),i?.(e)},role:"log",tabIndex:0,...l,"data-ug":"message-list","data-state":c?"populated":"empty","data-variant":a?"follow":"static","data-size":"md",children:c?r:ct("div",{className:"grid place-items-center text-center text-sm text-text-secondary [min-height:calc(var(--control-height-lg)*4)]","data-ug-slot":"empty",children:e})})});gt.displayName="MessageList";import{forwardRef as ht}from"react";import{CircleCheck as pt,File as vt,LoaderCircle as bt,TriangleAlert as ft,X as xt}from"lucide-react";import{jsx as wt,jsxs as yt}from"react/jsx-runtime";var Nt=ht(({items:e,onRemove:a,renderPreview:t,orientation:r="horizontal",showPreview:n=!0,showStatus:i=!0,showMeta:l=!0,bordered:o=!0,compact:s=!1,getRemoveLabel:d=e=>`移除附件:${e.name}`,empty:c,className:u,tabIndex:m,...g},h)=>0!==e.length||c?wt("ul",{ref:h,"aria-label":"附件",className:P("min-w-0 gap-[calc(var(--content-gap)*0.5)]","horizontal"===r?"flex overflow-x-auto pb-1 [scrollbar-width:thin]":"grid",u),tabIndex:m??("horizontal"===r?0:void 0),...g,"data-ug":"attachment-list","data-state":e.length>0?"populated":"empty","data-variant":r,"data-size":s?"xs":"sm",children:0===e.length?wt("li",{className:"text-sm text-text-secondary","data-ug-slot":"empty",children:c}):e.map(e=>{const c=e.mime?.startsWith("image/")&&e.previewUrl,u=e.status??"ready",m=i?e.statusLabel??{uploading:"正在上传",success:"上传完成",error:"上传失败"}[u]:void 0,g="uploading"===u?bt:"success"===u?pt:"error"===u?ft:null,h=l?e.meta:null;return yt("li",{"aria-busy":"uploading"===u||void 0,"aria-invalid":"error"===u||void 0,className:P("group flex shrink-0 items-center rounded-[var(--radius-control)] bg-surface-2","horizontal"===r?"min-w-52 max-w-72":"w-full min-w-0",o?"border border-border-base":"border border-transparent",s?"gap-1.5 p-1.5":"gap-2 p-2"),"data-state":u,"data-ug-slot":"item",children:[n?wt("div",{className:P("grid shrink-0 place-items-center overflow-hidden rounded-[var(--radius-control)] bg-surface-1 text-text-secondary",s?"size-[var(--control-height-md)]":"size-[var(--control-height-lg)]"),"data-ug-slot":"preview",children:t?t(e):c?wt("img",{alt:e.name,className:"size-full object-cover",src:e.previewUrl}):wt(vt,{"aria-hidden":"true",size:s?15:17})}):null,yt("div",{className:"min-w-0 flex-1","data-ug-slot":"content",children:[wt("p",{className:"truncate text-xs font-medium text-text-primary",title:e.name,children:e.name}),m||h?yt("div",{className:"mt-1 flex min-w-0 items-center gap-1.5 text-xs text-text-tertiary","data-ug-slot":"meta",children:[m?yt("span",{className:P("inline-flex min-w-0 items-center gap-1 truncate","uploading"===u&&"text-primary","success"===u&&"text-success-soft-fg","error"===u&&"text-danger"),"data-ug-slot":"status",role:"ready"===u?void 0:"status",children:[g?wt(g,{"aria-hidden":"true",className:P("size-3.5 shrink-0","uploading"===u&&"animate-spin motion-reduce:animate-none")}):null,wt("span",{className:"truncate",children:m})]}):null,h?wt("span",{className:"min-w-0 truncate","data-ug-slot":"detail",children:h}):null]}):null]}),a?wt(B,{"aria-label":d(e),onClick:()=>a(e),size:"icon-sm",type:"button",variant:"ghost","data-ug-slot":"remove",children:wt(xt,{"aria-hidden":"true",size:13})}):null]},e.id)})}):null);Nt.displayName="AttachmentList";import{forwardRef as Ct}from"react";import{jsx as kt,jsxs as St}from"react/jsx-runtime";var zt=Ct(({items:e,activeId:a,onSelect:t,renderActions:r,empty:n="暂无会话",orientation:i="vertical",activeStyle:l="soft",showBadge:o=!0,showDescription:s=!0,listLabel:d="会话列表",className:c,tabIndex:u,...m},g)=>kt("div",{ref:g,"aria-label":d,className:P("horizontal"===i?"flex min-w-0 gap-1 overflow-x-auto pb-1 [scrollbar-width:thin]":"grid min-w-0 content-start gap-1",c),role:"list",tabIndex:u??("horizontal"===i?0:void 0),...m,"data-ug":"conversation-list","data-active-style":l,"data-state":e.length>0?"populated":"empty","data-variant":i,"data-size":"md",children:0===e.length?kt("div",{className:"px-[var(--control-padding-x-md)] py-[var(--content-gap)] text-sm text-text-secondary","data-ug-slot":"empty",children:n}):e.map(e=>{const n=e.id===a;return St("div",{className:P("group relative flex min-w-0 items-center rounded-[var(--radius-control)] transition-[background-color,color] duration-[var(--motion-duration-state)] ease-[var(--motion-easing-state)] motion-reduce:transition-none","horizontal"===i&&"min-w-52 shrink-0",n?P("bg-primary-soft","bordered"===l&&"ring-1 ring-inset ring-primary/30","indicator"===l&&"before:absolute before:left-0 before:top-1/2 before:h-[calc(var(--control-height-sm)*0.6)] before:w-[3px] before:-translate-y-1/2 before:rounded-r-[var(--radius-control)] before:bg-primary before:content-['']"):"hover:bg-surface-2",e.disabled&&"opacity-50"),"data-state":e.disabled?"disabled":n?"active":"default","data-ug-slot":"item",role:"listitem",children:[St("button",{"aria-current":n?"page":void 0,className:"min-w-0 flex-1 rounded-[var(--radius-control)] px-[var(--control-padding-x-md)] py-[calc(var(--content-gap)*0.625)] text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/40",disabled:e.disabled,onClick:()=>t(e),type:"button","data-ug-slot":"trigger",children:[St("span",{className:"flex min-w-0 items-center gap-2",children:[kt("span",{className:P("min-w-0 flex-1 truncate text-sm text-text-primary",n?"font-semibold":"font-medium"),"data-ug-slot":"title",children:e.title}),o&&e.badge?kt("span",{className:"shrink-0","data-ug-slot":"badge",children:e.badge}):null]}),s&&e.description?kt("span",{className:P("mt-0.5 block truncate text-xs",n?"text-primary-soft-fg":"text-text-tertiary"),"data-ug-slot":"description",children:e.description}):null]}),r?kt("div",{className:"flex shrink-0 items-center gap-1 pr-2","data-ug-slot":"actions",children:r(e)}):null]},e.id)})}));zt.displayName="ConversationList";import{defaultUGThemeConfiguratorOptions as Tt,resolveUGNavigationColors as jt,resolveUGNavigationPalette as It}from"@ug666/ui-core/theme";import{Check as Lt,Monitor as Rt,Moon as At,PanelTop as Dt,Sun as Et,SwatchBook as Gt}from"lucide-react";import{forwardRef as Vt,useEffect as $t,useId as Mt,useMemo as Bt,useRef as Pt,useState as Ut}from"react";import{jsx as Ft,jsxs as Wt}from"react/jsx-runtime";var Ot=[{value:"sidebar",label:"左侧导航"},{value:"header",label:"顶部导航"}],Ht=[{value:"light",label:"浅色"},{value:"dark",label:"深色"}],_t=[{value:"highlight",label:"主题色块",description:"使用柔和主题底色突出当前菜单。"},{value:"indicator",label:"侧边标记",description:"使用淡色背景叠加左侧标记,定位更清楚。"}],qt=[{value:"comfortable",label:"舒适"},{value:"compact",label:"紧凑"}];function ModeIcon({value:e}){return"system"===e?Ft(Rt,{"aria-hidden":"true",size:16}):"light"===e?Ft(Et,{"aria-hidden":"true",size:16}):"dark"===e?Ft(At,{"aria-hidden":"true",size:16}):null}function ThemePresetPreview({selected:e,value:a}){const t="mecha"===a;return Wt("span",{"aria-hidden":"true",className:P("relative flex h-[calc(var(--control-height-lg)*1.75)] w-full overflow-hidden rounded-[calc(var(--radius-control)*0.75)] border bg-surface-0 transition-[border-color,box-shadow,transform] duration-[var(--motion-duration-state)] ease-[var(--motion-easing-state)]",e?"border-primary shadow-sm ring-1 ring-primary/20":"border-border-base shadow-xs"),"data-ug-mode":"light","data-ug":"theme-preview","data-ug-theme":a,children:[e?Ft("span",{className:"absolute right-1.5 top-1.5 z-10 inline-flex h-[calc(var(--control-height-sm)*0.75)] w-[calc(var(--control-height-sm)*0.75)] items-center justify-center rounded-full bg-primary text-primary-fg shadow-sm",children:Ft(Lt,{"aria-hidden":"true",size:12,strokeWidth:3})}):null,Wt("span",{className:"flex w-[24%] flex-col gap-1 border-r border-border-base bg-text-primary p-[calc(var(--content-gap)*0.375)]",children:[Ft("span",{className:"h-[calc(var(--control-height-sm)*0.2)] w-8 rounded-full bg-primary"}),Ft("span",{className:"mt-1 h-[calc(var(--control-height-sm)*0.16)] w-full rounded-full bg-surface-3"}),Ft("span",{className:"h-[calc(var(--control-height-sm)*0.16)] w-4/5 rounded-full bg-surface-3"}),Ft("span",{className:"h-[calc(var(--control-height-sm)*0.16)] w-3/4 rounded-full bg-surface-3"}),Ft("span",{className:"mt-auto h-[calc(var(--control-height-sm)*0.16)] w-2/3 rounded-full bg-surface-3"})]}),Wt("span",{className:P("flex min-w-0 flex-1 flex-col",t?"bg-text-primary":"bg-surface-0"),children:[Ft("span",{className:P("h-[calc(var(--control-height-sm)*0.48)] border-b border-border-base",t?"bg-text-primary":"bg-surface-1")}),Wt("span",{className:"grid flex-1 grid-cols-3 gap-1.5 p-[calc(var(--content-gap)*0.375)]",children:[[0,1,2].map(e=>Ft("span",{className:P("h-[calc(var(--control-height-sm)*0.42)] rounded-[calc(var(--radius-control)*0.35)] border border-border-base",t?"bg-text-secondary":1===e?"bg-primary-soft":"bg-surface-1")},e)),Wt("span",{className:P("relative col-span-3 overflow-hidden rounded-[calc(var(--radius-control)*0.4)] border border-border-base",t?"bg-text-secondary":"bg-surface-1"),children:[Ft("span",{className:"absolute inset-x-2 bottom-2 top-2 border-b border-l border-border-base"}),Ft("svg",{className:"absolute inset-2 h-[calc(100%_-_var(--content-gap))] w-[calc(100%_-_var(--content-gap))] overflow-visible text-primary",preserveAspectRatio:"none",viewBox:"0 0 100 32",children:Ft("path",{d:"M0 25 C12 22, 16 14, 28 18 S45 27, 56 14 S74 8, 100 4",fill:"none",stroke:"currentColor",strokeWidth:"2",vectorEffect:"non-scaling-stroke"})})]})]})]})]})}function ChoiceGroup({title:e,description:a,value:t,options:r,onValueChange:n,presentation:i="compact",swatch:l,iconSet:o}){const s=Mt(),d=Mt(),c="card"===i,u="preview"===i,m=void 0!==l,g=!c&&!u&&!m;return Wt("section",{className:P("min-w-0",(g||m)&&"ug-theme-config-row"),"data-presentation":m?"swatch":i,"data-ug-slot":"group",children:[Wt("div",{className:"min-w-0",children:[Ft("h3",{id:s,className:"m-0 text-sm font-semibold leading-5 text-text-primary",children:e}),Ft("p",{id:d,className:"ug-theme-config-description",children:a})]}),Ft(N,{"aria-describedby":d,"aria-labelledby":s,className:P("min-w-0",u&&"mt-2.5 grid grid-cols-1 gap-2.5 sm:grid-cols-3",c&&"mt-2 grid grid-cols-1 gap-2 sm:grid-cols-2",m&&"flex flex-wrap items-center gap-2.5",g&&"auto-cols-[minmax(max-content,1fr)]"),"data-ug-slot":"options",onValueChange:e=>n(String(e)),orientation:"horizontal",presentation:g?"segmented":"default",size:"default",sizing:g?"fill":"content",value:t,children:r.map(e=>Ft(y,{"aria-label":m?e.label:void 0,className:"hidden",controlClassName:m?void 0:"absolute",value:e.value,variant:c||u?"card":g?"segmented":"default",labelClassName:u?"group/theme flex min-h-[0] w-full cursor-pointer flex-col items-stretch gap-1.5 rounded-[var(--radius-control)] border-0 bg-transparent p-0 text-center shadow-none hover:bg-transparent focus-within:outline-none focus-within:ring-2 focus-within:ring-ring/30 data-[state=checked]:border-0 data-[state=checked]:bg-transparent data-[state=checked]:shadow-none":c?"min-h-[calc(var(--control-height-lg)*1.5)] gap-0 rounded-[var(--radius-control)] px-[calc(var(--content-gap)*0.75)] py-[calc(var(--content-gap)*0.5)]":m?"group/swatch min-h-[0] cursor-pointer gap-0 rounded-full p-0 focus-within:outline-none":g?"min-w-max px-[calc(var(--control-padding-x-sm)*0.75)]":void 0,label:Wt("span",{className:P("flex min-w-0",c||u?"flex-col gap-1":"items-center gap-2",m&&"block"),children:[u?Ft(ThemePresetPreview,{selected:e.value===t,value:e.value}):null,Wt("span",{className:"inline-flex min-w-0 items-center gap-2",children:["mode"===o?Ft(ModeIcon,{value:e.value}):null,m?Ft("span",{"aria-hidden":"true","data-ug-swatch":"accent","data-ug-accent":e.value,children:Ft(Lt,{"aria-hidden":"true",className:e.value===t?void 0:"invisible","data-ug-swatch-check":e.value===t?"":void 0,size:13,strokeWidth:3})}):null,Ft("span",{className:P("min-w-0",c?"font-semibold text-text-primary":u?"w-full text-center font-medium text-text-primary":m?"sr-only":"truncate"),children:e.label})]}),c&&e.description?Ft("span",{className:"text-xs font-normal leading-4 text-text-secondary",children:e.description}):null]})},e.value))})]})}var Qt=[{key:"background",label:"导航背景"},{key:"text",label:"普通文字"},{key:"activeBackground",label:"选中背景"},{key:"activeText",label:"选中文字"},{key:"hoverBackground",label:"悬停背景"}];function NavigationColorInput({label:e,value:a,onValueCommit:t}){const r=Pt(null),n=Pt(t);return n.current=t,$t(()=>{const e=r.current;if(!e)return;const commitValue=()=>n.current(e.value);return e.addEventListener("change",commitValue),()=>e.removeEventListener("change",commitValue)},[]),$t(()=>{r.current&&r.current.value!==a&&(r.current.value=a)},[a]),Ft("input",{ref:r,"aria-label":e,"data-ug-slot":"color-swatch",defaultValue:a,type:"color"})}function NavigationColorGroup({customized:e,value:a,onReset:t,onValueChange:r}){return Wt("section",{className:"ug-theme-config-row min-w-0","data-presentation":"colors","data-ug":"navigation-colors","data-ug-slot":"group",children:[Wt("div",{className:"min-w-0","data-ug-slot":"group-label",children:[Ft("h3",{className:"m-0 text-sm font-semibold leading-5 text-text-primary",children:"导航颜色"}),e?Ft(B,{onClick:t,size:"sm",tone:"neutral",variant:"ghost",children:"恢复主题配色"}):null]}),Ft("div",{"data-ug-slot":"options",children:Qt.map(e=>Wt("label",{"data-ug-slot":"color-option",children:[Ft(NavigationColorInput,{label:e.label,onValueCommit:t=>r({...a,[e.key]:t}),value:a[e.key]}),Ft("span",{"data-ug-slot":"color-label",children:e.label}),Ft("code",{"data-ug-slot":"color-value",children:a[e.key].toUpperCase()})]},e.key))})]})}function TabLabel({icon:e,children:a}){return Wt("span",{className:"gap-[calc(var(--content-gap)*0.625)]","data-ug-slot":"tab-label",children:[Ft("span",{"data-ug-slot":"tab-icon",children:e}),Ft("span",{className:"truncate",children:a})]})}var Kt=Vt(({value:e,onValueChange:a,options:t,sidebarValue:r,onSidebarValueChange:n,appearanceAddon:i,sidebarAddon:l,className:o,...s},d)=>{const[c,u]=Ut("appearance"),m=$("(prefers-color-scheme: dark)"),g=Bt(()=>({...Tt,...t}),[t]),h=r.palette??("primary"===r.variant?"light":"dark"),p=r.colors?h:It(e.mode,m),v=jt(e.preset,p,r.colors,e.accent);function updateField(t,r){a({...e,[t]:r})}function updateSidebarField(e,a){n({...r,[e]:a})}return Ft("div",{ref:d,className:P("h-full min-h-[0] min-w-0 text-text-primary",o),"data-ug":"theme-configurator","data-state":"ready","data-variant":"panel","data-size":"default",...s,children:Ft(A,{className:"h-full",onValueChange:e=>u(e),size:"md",value:c,variant:"rail",children:Wt("div",{"data-ug-slot":"configurator-layout",children:[Ft("div",{"data-ug-slot":"navigation",children:Wt(E,{"aria-label":"外观设置分类",orientation:"vertical",children:[Ft(G,{value:"appearance",children:Ft(TabLabel,{icon:Ft(Gt,{"aria-hidden":"true",size:16}),children:"主题外观"})}),Ft(G,{value:"sidebar",children:Ft(TabLabel,{icon:Ft(Dt,{"aria-hidden":"true",size:16}),children:"导航菜单"})})]})}),Wt("div",{className:"min-h-[0]","data-ug-slot":"settings",children:[Wt(D,{className:"ug-theme-config-appearance min-w-0",value:"appearance",children:[Ft(ChoiceGroup,{title:"主题风格",description:"选择整套界面的基础视觉气质。",value:e.preset,options:g.presets,presentation:"preview",onValueChange:e=>updateField("preset",e)}),Ft(ChoiceGroup,{title:"显示模式",description:"使用亮色、暗色,或自动跟随操作系统。",value:e.mode,options:g.modes,iconSet:"mode",onValueChange:e=>updateField("mode",e)}),Ft(ChoiceGroup,{title:"主题色",description:"统一按钮、链接、当前项和焦点状态。",value:e.accent,options:g.accents,swatch:"accent",onValueChange:e=>updateField("accent",e)}),Wt("section",{"data-ug-slot":"detail-section",children:[Ft("div",{"data-ug-slot":"section-heading",children:Ft("h3",{className:"m-0 text-sm font-semibold leading-5 text-text-primary",children:"界面细节"})}),Wt("div",{"data-ug-slot":"detail-grid",children:[Ft(ChoiceGroup,{title:"界面密度",description:"控制页面留白与控件间距。",value:e.density,options:g.densities,onValueChange:e=>updateField("density",e)}),Ft(ChoiceGroup,{title:"圆角风格",description:"统一控件和面板的边角语言。",value:e.radius,options:g.radii,onValueChange:e=>updateField("radius",e)}),Ft(ChoiceGroup,{title:"阴影层级",description:"调整浮层与卡片的空间层次。",value:e.shadow,options:g.shadows,onValueChange:e=>updateField("shadow",e)}),Ft(ChoiceGroup,{title:"字体排版",description:"选择阅读性或信息密度取向。",value:e.font,options:g.fonts,onValueChange:e=>updateField("font",e)}),Ft(ChoiceGroup,{title:"文字对比",description:"调整正文和次要信息的清晰度。",value:e.contrast,options:g.contrasts,onValueChange:e=>updateField("contrast",e)}),Ft(ChoiceGroup,{title:"界面动效",description:"控制过渡反馈的强弱。",value:e.motion,options:g.motions,onValueChange:e=>updateField("motion",e)}),Ft(ChoiceGroup,{title:"页面背景",description:"选择纯净、网格或柔光背景。",value:e.background,options:g.backgrounds,onValueChange:e=>updateField("background",e)})]})]}),i?Ft("div",{"data-ug-slot":"appearance-addon",children:i}):null]}),Wt(D,{className:"min-w-0",value:"sidebar",children:[Wt("div",{className:"ug-theme-config-sidebar-grid",children:[Ft(ChoiceGroup,{title:"导航位置",description:"选择左侧栏或桌面端顶栏导航。",value:r.mode??"sidebar",options:Ot,onValueChange:e=>updateSidebarField("mode",e)}),Ft(ChoiceGroup,{title:"配色基准",description:"默认跟随显示模式;选择后作为导航颜色覆盖。",value:p,options:Ht,onValueChange:a=>n({...r,palette:a,variant:"light"===a?"primary":"dark",colors:jt(e.preset,a,void 0,e.accent)})}),Ft(NavigationColorGroup,{customized:Boolean(r.colors),value:v,onReset:()=>updateSidebarField("colors",void 0),onValueChange:e=>n({...r,palette:p,variant:"light"===p?"primary":"dark",colors:e})}),Ft(ChoiceGroup,{title:"当前菜单",description:"选择当前页面在导航中的强调方式。",value:r.activeStyle,options:_t,onValueChange:e=>updateSidebarField("activeStyle",e)}),Ft(ChoiceGroup,{title:"菜单密度",description:"调整导航菜单的行高与间距。",value:r.density,options:qt,onValueChange:e=>updateSidebarField("density",e)})]}),l?Ft("div",{"data-ug-slot":"sidebar-addon",children:l}):null]})]})]})})})});Kt.displayName="ThemeConfigurator";import{resolveUGNavigationColors as Jt,resolveUGNavigationPalette as Xt}from"@ug666/ui-core/theme";import{RotateCcw as Yt}from"lucide-react";import{jsx as Zt,jsxs as er}from"react/jsx-runtime";function DefaultThemePreview({value:e,sidebarValue:a}){const t=$("(prefers-color-scheme: dark)"),r=a.palette??("primary"===a.variant?"light":"dark"),n=a.colors?r:Xt(e.mode,t),i=Jt(e.preset,n,a.colors,e.accent),l={"--ug-preview-navigation-bg":i.background,"--ug-preview-navigation-text":i.text,"--ug-preview-navigation-active-bg":i.activeBackground,"--ug-preview-navigation-active-text":i.activeText,"--ug-preview-navigation-hover-bg":i.hoverBackground};return er("section",{"aria-label":"实时预览",className:"[--ug-theme-preview-gap:var(--content-gap)] border-border-base","data-ug":"theme-configurator-preview",children:[Zt("h3",{"data-ug-preview":"title",children:"实时预览"}),er("div",{"data-navigation-active-style":a.activeStyle,"data-navigation-density":a.density,"data-navigation-mode":a.mode??"sidebar","data-ug-accent":e.accent,"data-ug-background":e.background,"data-ug-contrast":e.contrast,"data-ug-density":e.density,"data-ug-font":e.font,"data-ug-mode":e.mode,"data-ug-motion":e.motion,"data-ug-radius":e.radius,"data-ug-shadow":e.shadow,"data-ug-preview":"frame","data-ug-surface":e.surface,"data-ug-theme":e.preset,style:l,children:[er("aside",{"data-ug-preview":"navigation",children:[Zt("strong",{"data-ug-preview":"brand",children:"UG Admin"}),Zt("div",{"data-ug-preview":"menu",children:["工作台","任务中心","数据分析","系统设置"].map((e,a)=>er("span",{"data-state":0===a?"active":"default","data-ug-preview":"menu-item",children:[Zt("i",{"aria-hidden":"true","data-ug-preview":"menu-icon"}),Zt("span",{children:e})]},e))})]}),er("div",{"data-ug-preview":"content",children:[er("header",{"data-ug-preview":"topbar",children:[Zt("strong",{"data-ug-preview":"topbar-title",children:"工作台"}),er("span",{"aria-hidden":"true","data-ug-preview":"topbar-actions",children:[Zt("i",{}),Zt("i",{}),Zt("i",{})]})]}),er("div",{"data-ug-preview":"tabs",children:[Zt("span",{"data-state":"active",children:"工作台"}),Zt("span",{children:"任务中心"}),Zt("span",{children:"报表"})]}),er("main",{"data-ug-preview":"main",children:[Zt("div",{"data-ug-preview":"stats",children:[["待办任务","12"],["团队成员","8"],["进行项目","24"]].map(([e,a])=>er("span",{"data-ug-preview":"stat",children:[Zt("small",{children:e}),Zt("strong",{children:a})]},e))}),er("div",{"data-ug-preview":"chart",children:[Zt("strong",{children:"工作概览"}),Zt("svg",{"aria-hidden":"true",preserveAspectRatio:"none",viewBox:"0 0 240 72",children:Zt("path",{d:"M0 58 C28 48, 38 24, 66 36 S102 58, 130 28 S172 42, 240 12",fill:"none",stroke:"currentColor",strokeWidth:"3",vectorEffect:"non-scaling-stroke"})})]}),Zt("div",{"data-ug-preview":"table",children:["整理发布计划","复核访问权限","更新项目进度"].map((e,a)=>er("span",{"data-ug-preview":"table-row",children:[Zt("span",{children:e}),Zt("i",{"data-state":1===a?"warning":"success",children:1===a?"待处理":"已完成"})]},e))})]})]})]})]})}function ThemeConfiguratorDialog({open:e,onOpenChange:a,onReset:t,onCancel:r,onApply:n,title:i="外观设置",preview:l,showPreview:o=!0,resetLabel:p="恢复默认",cancelLabel:v="取消",applyLabel:b,doneLabel:f,...x}){const w=b??f??"应用",y=void 0===l?Zt(DefaultThemePreview,{value:x.value,sidebarValue:x.sidebarValue}):l,N=o&&null!==y&&!1!==y;function closeAsCancel(){r?.(),a(!1)}return Zt(s,{ariaLabel:"string"==typeof i?i:"外观设置",onClose:closeAsCancel,open:e,size:"2xl",children:er(u,{"data-ug":"theme-configurator-dialog","data-state":e?"open":"closed","data-variant":N?"preview":"default","data-size":"2xl",children:[er(g,{children:[Zt(h,{children:i}),Zt(c,{})]}),Zt(d,{className:"overflow-hidden p-0",children:er("div",{"data-ug-layout":"dialog",children:[Zt("div",{className:"h-full min-h-[0] min-w-0","data-ug-slot":"panel",children:Zt(Kt,{...x})}),N?Zt("div",{"data-ug-slot":"preview",children:y}):null]})}),er(m,{className:"justify-between",children:[Zt("div",{className:"flex min-w-0 items-center gap-3",children:t?er(B,{onClick:t,type:"button",variant:"default",children:[Zt(Yt,{"aria-hidden":"true",size:16}),p]}):null}),er("div",{className:"flex shrink-0 items-center gap-2",children:[r?Zt(B,{onClick:closeAsCancel,type:"button",variant:"default",children:v}):null,Zt(B,{onClick:function closeAsApply(){n?.(),a(!1)},type:"button",variant:"primary",children:w})]})]})]})})}export{sa as AdminShell,Ca as AppTabs,Nt as AttachmentList,Ia as ConfirmDialog,zt as ConversationList,Ma as CopyField,DataTable,DataTableIdentity,DataTableToolbar,mt as Message,gt as MessageList,_a as PageHeader,it as PromptComposer,Za as QuickAccess,re as SelectionList,Kt as ThemeConfigurator,ThemeConfiguratorDialog,TreeTable,sa as UGAdminShell,Ca as UGAppTabs,Nt as UGAttachmentList,Ia as UGConfirmDialog,zt as UGConversationList,Ma as UGCopyField,DataTable as UGDataTable,DataTableIdentity as UGDataTableIdentity,DataTableToolbar as UGDataTableToolbar,mt as UGMessage,gt as UGMessageList,_a as UGPageHeader,it as UGPromptComposer,Za as UGQuickAccess,re as UGSelectionList,Kt as UGThemeConfigurator,ThemeConfiguratorDialog as UGThemeConfiguratorDialog,TreeTable as UGTreeTable};//# sourceMappingURL=index.js.map
|