@quirekit/ui 0.0.0-stage → 0.0.1-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/README.md +41 -2
- package/README.zh-CN.md +42 -0
- package/THIRD_PARTY_NOTICES.md +143 -0
- package/dist/catalog-AqWLE58Z.mjs +7114 -0
- package/dist/catalog-AqWLE58Z.mjs.map +1 -0
- package/dist/chat-BAee3Pg0.mjs +9092 -0
- package/dist/chat-BAee3Pg0.mjs.map +1 -0
- package/dist/chat.d.mts +3 -0
- package/dist/chat.mjs +2 -0
- package/dist/code-block-D1kd-gAB.mjs +731 -0
- package/dist/code-block-D1kd-gAB.mjs.map +1 -0
- package/dist/html-sandbox-BYIni0q6.mjs +531 -0
- package/dist/html-sandbox-BYIni0q6.mjs.map +1 -0
- package/dist/html-sandbox.d.mts +2 -0
- package/dist/html-sandbox.mjs +2 -0
- package/dist/index-DbtTJnJq.d.mts +51 -0
- package/dist/index-DbtTJnJq.d.mts.map +1 -0
- package/dist/index-OJPxl6Iz.d.mts +369 -0
- package/dist/index-OJPxl6Iz.d.mts.map +1 -0
- package/dist/index-Su5SBM61.d.mts +10070 -0
- package/dist/index-Su5SBM61.d.mts.map +1 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.mjs +1053 -0
- package/dist/index.mjs.map +1 -0
- package/dist/model-CeJjdZm_.mjs +1604 -0
- package/dist/model-CeJjdZm_.mjs.map +1 -0
- package/dist/resolve-CGFbhFiM.mjs +1531 -0
- package/dist/resolve-CGFbhFiM.mjs.map +1 -0
- package/dist/style.css +24 -0
- package/dist/vue.d.mts +10667 -0
- package/dist/vue.d.mts.map +1 -0
- package/dist/vue.mjs +31552 -0
- package/dist/vue.mjs.map +1 -0
- package/package.json +72 -3
- package/src/color-palette/conversion.test.ts +23 -0
- package/src/color-palette/conversion.ts +115 -0
- package/src/color-palette/custom/elements.ts +96 -0
- package/src/color-palette/custom/index.ts +1 -0
- package/src/color-palette/custom/panel.test.ts +71 -0
- package/src/color-palette/custom/panel.ts +166 -0
- package/src/color-palette/custom/style.ts +142 -0
- package/src/color-palette/index.ts +22 -0
- package/src/color-palette/labels.ts +36 -0
- package/src/color-palette/palette.test.ts +100 -0
- package/src/color-palette/palette.ts +213 -0
- package/src/color-palette/presets.ts +10 -0
- package/src/color-palette/style.ts +133 -0
- package/src/color-palette/types.ts +115 -0
- package/src/components/accordion/index.ts +5 -0
- package/src/components/accordion/types.ts +19 -0
- package/src/components/action-menu/index.ts +2 -0
- package/src/components/action-menu/types.ts +98 -0
- package/src/components/action-sheet/groups.test.ts +26 -0
- package/src/components/action-sheet/groups.ts +20 -0
- package/src/components/action-sheet/index.ts +1 -0
- package/src/components/action-sheet/types.ts +31 -0
- package/src/components/alert/index.ts +1 -0
- package/src/components/alert/types.ts +8 -0
- package/src/components/attachment/index.ts +1 -0
- package/src/components/attachment/types.ts +60 -0
- package/src/components/avatar/index.ts +12 -0
- package/src/components/avatar/types.ts +63 -0
- package/src/components/badge/create.test.ts +21 -0
- package/src/components/badge/create.ts +34 -0
- package/src/components/badge/index.ts +3 -0
- package/src/components/badge/types.ts +43 -0
- package/src/components/badge/variables/declarations.ts +23 -0
- package/src/components/button/create.test.ts +145 -0
- package/src/components/button/create.ts +153 -0
- package/src/components/button/index.ts +8 -0
- package/src/components/button/types.ts +104 -0
- package/src/components/button/variables/declarations.ts +92 -0
- package/src/components/button/variables/index.ts +6 -0
- package/src/components/button/variables/names.ts +83 -0
- package/src/components/button/variables/references.ts +54 -0
- package/src/components/candidate-list/index.ts +1 -0
- package/src/components/candidate-list/types.ts +23 -0
- package/src/components/chat/composer/types.ts +82 -0
- package/src/components/chat/composer-input/types.ts +33 -0
- package/src/components/chat/composer-submit/types.ts +17 -0
- package/src/components/chat/confirmation/types.ts +35 -0
- package/src/components/chat/index.ts +16 -0
- package/src/components/chat/message/types.ts +72 -0
- package/src/components/chat/message-action/types.ts +9 -0
- package/src/components/chat/message-actions/types.ts +19 -0
- package/src/components/chat/message-branch/types.ts +11 -0
- package/src/components/chat/message-list/types.ts +67 -0
- package/src/components/chat/message-part/types.ts +216 -0
- package/src/components/chat/process/types.ts +27 -0
- package/src/components/chat/question/types.ts +98 -0
- package/src/components/chat/reasoning/types.ts +7 -0
- package/src/components/chat/rich-input/types.ts +99 -0
- package/src/components/chat/shared/types.ts +34 -0
- package/src/components/chat/tool/types.ts +7 -0
- package/src/components/checkbox/index.ts +1 -0
- package/src/components/checkbox/types.ts +7 -0
- package/src/components/checkbox-group/create.ts +10 -0
- package/src/components/checkbox-group/index.ts +3 -0
- package/src/components/checkbox-group/types.ts +63 -0
- package/src/components/checkbox-group/variables/declarations.ts +9 -0
- package/src/components/choice-picker/index.ts +1 -0
- package/src/components/choice-picker/types.ts +104 -0
- package/src/components/clipboard/index.ts +2 -0
- package/src/components/clipboard/types.ts +38 -0
- package/src/components/collapsible/index.ts +1 -0
- package/src/components/collapsible/types.ts +8 -0
- package/src/components/color-picker/color.test.ts +19 -0
- package/src/components/color-picker/color.ts +35 -0
- package/src/components/color-picker/index.ts +13 -0
- package/src/components/color-picker/types.ts +82 -0
- package/src/components/combobox/index.ts +12 -0
- package/src/components/combobox/types.ts +125 -0
- package/src/components/comment-rail/index.ts +2 -0
- package/src/components/comment-rail/layout.test.ts +76 -0
- package/src/components/comment-rail/layout.ts +37 -0
- package/src/components/comment-rail/types.ts +27 -0
- package/src/components/control/index.ts +3 -0
- package/src/components/control/modality.test.ts +30 -0
- package/src/components/control/modality.ts +33 -0
- package/src/components/control/sizes.ts +10 -0
- package/src/components/control/types.ts +5 -0
- package/src/components/dialog/index.ts +1 -0
- package/src/components/dialog/types.ts +5 -0
- package/src/components/diff-viewer/index.ts +1 -0
- package/src/components/diff-viewer/types.ts +20 -0
- package/src/components/drawer/index.ts +1 -0
- package/src/components/drawer/types.ts +67 -0
- package/src/components/editable/index.ts +1 -0
- package/src/components/editable/types.ts +31 -0
- package/src/components/emoji-picker/catalog.ts +61 -0
- package/src/components/emoji-picker/index.ts +3 -0
- package/src/components/emoji-picker/search.test.ts +43 -0
- package/src/components/emoji-picker/search.ts +20 -0
- package/src/components/emoji-picker/sections.test.ts +30 -0
- package/src/components/emoji-picker/sections.ts +40 -0
- package/src/components/emoji-picker/types.ts +34 -0
- package/src/components/empty-state/index.ts +6 -0
- package/src/components/empty-state/types.ts +16 -0
- package/src/components/field/index.ts +5 -0
- package/src/components/field/types.ts +41 -0
- package/src/components/fieldset/index.ts +1 -0
- package/src/components/fieldset/types.ts +15 -0
- package/src/components/file-icon/index.ts +2 -0
- package/src/components/file-icon/resolve.test.ts +17 -0
- package/src/components/file-icon/resolve.ts +42 -0
- package/src/components/file-icon/types.ts +24 -0
- package/src/components/file-upload/index.ts +2 -0
- package/src/components/file-upload/messages.ts +11 -0
- package/src/components/file-upload/types.ts +96 -0
- package/src/components/icon/catalog.test.ts +195 -0
- package/src/components/icon/catalog.ts +80 -0
- package/src/components/icon/custom/formatting.ts +24 -0
- package/src/components/icon/custom/indicators.ts +5 -0
- package/src/components/icon/custom/insert.ts +20 -0
- package/src/components/icon/custom/table.ts +29 -0
- package/src/components/icon/custom.ts +12 -0
- package/src/components/icon/define.test.ts +80 -0
- package/src/components/icon/define.ts +113 -0
- package/src/components/icon/index.ts +25 -0
- package/src/components/icon/labels.test.ts +44 -0
- package/src/components/icon/labels.ts +62 -0
- package/src/components/icon/lucide.ts +359 -0
- package/src/components/icon/metadata.ts +1784 -0
- package/src/components/icon/registry.test.ts +36 -0
- package/src/components/icon/registry.ts +64 -0
- package/src/components/icon/review.ts +19 -0
- package/src/components/icon/types.ts +138 -0
- package/src/components/index.ts +80 -0
- package/src/components/input/index.ts +1 -0
- package/src/components/input/types.ts +58 -0
- package/src/components/input-number/index.ts +8 -0
- package/src/components/input-number/types.ts +98 -0
- package/src/components/input-number-unit/index.ts +1 -0
- package/src/components/input-number-unit/types.ts +34 -0
- package/src/components/inspector/index.ts +1 -0
- package/src/components/inspector/types.ts +14 -0
- package/src/components/json-viewer/index.ts +1 -0
- package/src/components/json-viewer/types.ts +24 -0
- package/src/components/kbd/create.test.ts +16 -0
- package/src/components/kbd/create.ts +37 -0
- package/src/components/kbd/index.ts +3 -0
- package/src/components/kbd/types.ts +35 -0
- package/src/components/kbd/variables/declarations.ts +20 -0
- package/src/components/listbox/index.ts +9 -0
- package/src/components/listbox/types.ts +57 -0
- package/src/components/media-player/index.ts +1 -0
- package/src/components/media-player/types.ts +40 -0
- package/src/components/menu/context/index.ts +5 -0
- package/src/components/menu/context/types.ts +48 -0
- package/src/components/menu/create.test.ts +52 -0
- package/src/components/menu/create.ts +60 -0
- package/src/components/menu/index.ts +19 -0
- package/src/components/menu/types.ts +152 -0
- package/src/components/menu/variables/declarations.ts +48 -0
- package/src/components/menu/variables/index.ts +6 -0
- package/src/components/menu/variables/names.ts +59 -0
- package/src/components/menu/variables/references.ts +42 -0
- package/src/components/pagination/index.ts +1 -0
- package/src/components/pagination/types.ts +42 -0
- package/src/components/popover/create.test.ts +60 -0
- package/src/components/popover/create.ts +45 -0
- package/src/components/popover/index.ts +9 -0
- package/src/components/popover/types.ts +87 -0
- package/src/components/popover/variables/declarations.ts +45 -0
- package/src/components/popover/variables/index.ts +6 -0
- package/src/components/popover/variables/names.ts +42 -0
- package/src/components/popover/variables/references.ts +55 -0
- package/src/components/preset-gallery/geometry.test.ts +19 -0
- package/src/components/preset-gallery/geometry.ts +27 -0
- package/src/components/preset-gallery/index.ts +1 -0
- package/src/components/preset-gallery/types.ts +25 -0
- package/src/components/preset-picker/index.ts +1 -0
- package/src/components/preset-picker/types.ts +52 -0
- package/src/components/progress/index.ts +1 -0
- package/src/components/progress/normalize.ts +25 -0
- package/src/components/progress/types.ts +26 -0
- package/src/components/radio-group/index.ts +5 -0
- package/src/components/radio-group/types.ts +19 -0
- package/src/components/scroll-area/index.ts +7 -0
- package/src/components/scroll-area/types.ts +19 -0
- package/src/components/segmented/create.test.ts +71 -0
- package/src/components/segmented/create.ts +99 -0
- package/src/components/segmented/index.ts +14 -0
- package/src/components/segmented/types.ts +74 -0
- package/src/components/segmented/variables/declarations.ts +64 -0
- package/src/components/segmented/variables/index.ts +6 -0
- package/src/components/segmented/variables/names.ts +54 -0
- package/src/components/segmented/variables/references.ts +52 -0
- package/src/components/select/index.ts +7 -0
- package/src/components/select/types.ts +26 -0
- package/src/components/selection-gesture/index.ts +5 -0
- package/src/components/selection-gesture/mount.ts +128 -0
- package/src/components/selection-gesture/session/controller.test.ts +77 -0
- package/src/components/selection-gesture/session/controller.ts +105 -0
- package/src/components/selection-gesture/session/types.ts +30 -0
- package/src/components/selection-gesture/types.ts +65 -0
- package/src/components/selection-handles/dom/handles.test.ts +53 -0
- package/src/components/selection-handles/dom/handles.ts +73 -0
- package/src/components/selection-handles/dom/types.ts +23 -0
- package/src/components/selection-handles/drag/controller.test.ts +180 -0
- package/src/components/selection-handles/drag/controller.ts +84 -0
- package/src/components/selection-handles/drag/hold.ts +55 -0
- package/src/components/selection-handles/drag/types.ts +64 -0
- package/src/components/selection-handles/index.ts +7 -0
- package/src/components/selection-handles/mount.test.ts +105 -0
- package/src/components/selection-handles/mount.ts +183 -0
- package/src/components/selection-handles/types.ts +120 -0
- package/src/components/sheet/index.ts +1 -0
- package/src/components/sheet/types.ts +5 -0
- package/src/components/shimmer/index.ts +1 -0
- package/src/components/shimmer/types.ts +9 -0
- package/src/components/skeleton/create.test.ts +13 -0
- package/src/components/skeleton/create.ts +10 -0
- package/src/components/skeleton/index.ts +3 -0
- package/src/components/skeleton/types.ts +17 -0
- package/src/components/skeleton/variables/declarations.ts +9 -0
- package/src/components/slider/index.ts +1 -0
- package/src/components/slider/types.ts +5 -0
- package/src/components/sources/index.ts +1 -0
- package/src/components/sources/types.ts +45 -0
- package/src/components/splitter/index.ts +12 -0
- package/src/components/splitter/types.ts +90 -0
- package/src/components/switch/index.ts +1 -0
- package/src/components/switch/types.ts +2 -0
- package/src/components/table/create.test.ts +14 -0
- package/src/components/table/create.ts +21 -0
- package/src/components/table/index.ts +3 -0
- package/src/components/table/types.ts +128 -0
- package/src/components/table/variables/declarations.ts +20 -0
- package/src/components/table-size-picker/index.ts +2 -0
- package/src/components/table-size-picker/model.ts +112 -0
- package/src/components/table-size-picker/types.ts +39 -0
- package/src/components/tabs/index.ts +1 -0
- package/src/components/tabs/types.ts +23 -0
- package/src/components/tag/create.test.ts +22 -0
- package/src/components/tag/create.ts +29 -0
- package/src/components/tag/index.ts +3 -0
- package/src/components/tag/types.ts +35 -0
- package/src/components/tag/variables/declarations.ts +19 -0
- package/src/components/tags-input/index.ts +1 -0
- package/src/components/tags-input/types.ts +42 -0
- package/src/components/task/index.ts +1 -0
- package/src/components/task/types.ts +47 -0
- package/src/components/task-panel/index.ts +1 -0
- package/src/components/task-panel/types.ts +21 -0
- package/src/components/terminal-output/index.ts +1 -0
- package/src/components/terminal-output/types.ts +30 -0
- package/src/components/textarea/index.ts +1 -0
- package/src/components/textarea/types.ts +17 -0
- package/src/components/toast/index.ts +6 -0
- package/src/components/toast/types.ts +22 -0
- package/src/components/toggle-group/create.ts +10 -0
- package/src/components/toggle-group/index.ts +3 -0
- package/src/components/toggle-group/types.ts +54 -0
- package/src/components/toggle-group/variables/declarations.ts +9 -0
- package/src/components/toolbar/collapse.test.ts +17 -0
- package/src/components/toolbar/collapse.ts +31 -0
- package/src/components/toolbar/create.test.ts +95 -0
- package/src/components/toolbar/create.ts +45 -0
- package/src/components/toolbar/index.ts +39 -0
- package/src/components/toolbar/navigation.ts +78 -0
- package/src/components/toolbar/span.test.ts +26 -0
- package/src/components/toolbar/span.ts +41 -0
- package/src/components/toolbar/types.ts +292 -0
- package/src/components/toolbar/variables/declarations.ts +41 -0
- package/src/components/toolbar/variables/index.ts +6 -0
- package/src/components/toolbar/variables/names.ts +44 -0
- package/src/components/toolbar/variables/references.ts +36 -0
- package/src/components/tooltip/create.test.ts +111 -0
- package/src/components/tooltip/create.ts +76 -0
- package/src/components/tooltip/index.ts +13 -0
- package/src/components/tooltip/types.ts +74 -0
- package/src/components/tooltip/variables/declarations.ts +38 -0
- package/src/components/tooltip/variables/index.ts +6 -0
- package/src/components/tooltip/variables/names.ts +33 -0
- package/src/components/tooltip/variables/references.ts +46 -0
- package/src/components/tree-view/index.ts +10 -0
- package/src/components/tree-view/types.ts +73 -0
- package/src/components/typography/index.ts +1 -0
- package/src/components/typography/types.ts +23 -0
- package/src/index.ts +29 -0
- package/src/locale/components/action-menu.ts +33 -0
- package/src/locale/components/action-sheet.ts +15 -0
- package/src/locale/components/alert.ts +11 -0
- package/src/locale/components/anchor.ts +11 -0
- package/src/locale/components/attachment.ts +45 -0
- package/src/locale/components/avatar.ts +39 -0
- package/src/locale/components/badge.ts +11 -0
- package/src/locale/components/breadcrumb.ts +15 -0
- package/src/locale/components/calendar.ts +47 -0
- package/src/locale/components/carousel.ts +35 -0
- package/src/locale/components/cascader.ts +11 -0
- package/src/locale/components/chat.ts +241 -0
- package/src/locale/components/choice-picker.ts +45 -0
- package/src/locale/components/clipboard.ts +40 -0
- package/src/locale/components/code-block.ts +17 -0
- package/src/locale/components/color-picker.ts +87 -0
- package/src/locale/components/combobox.ts +27 -0
- package/src/locale/components/command-palette.ts +29 -0
- package/src/locale/components/comment.ts +115 -0
- package/src/locale/components/date-input.ts +11 -0
- package/src/locale/components/date-picker.ts +11 -0
- package/src/locale/components/date-range-picker.ts +35 -0
- package/src/locale/components/date-time-picker.ts +43 -0
- package/src/locale/components/date-time-range-picker.ts +47 -0
- package/src/locale/components/dialog.ts +11 -0
- package/src/locale/components/diff-viewer.ts +68 -0
- package/src/locale/components/drawer.ts +11 -0
- package/src/locale/components/editable.ts +31 -0
- package/src/locale/components/emoji-picker.ts +124 -0
- package/src/locale/components/field.ts +23 -0
- package/src/locale/components/fieldset.ts +15 -0
- package/src/locale/components/file-upload.ts +64 -0
- package/src/locale/components/form-field.ts +19 -0
- package/src/locale/components/form.ts +15 -0
- package/src/locale/components/hierarchy-picker.ts +33 -0
- package/src/locale/components/html-sandbox.ts +57 -0
- package/src/locale/components/icon-catalog/en.ts +457 -0
- package/src/locale/components/icon-catalog/zh-hans.ts +457 -0
- package/src/locale/components/icon-catalog.ts +19 -0
- package/src/locale/components/image-cropper.ts +51 -0
- package/src/locale/components/image-preview.ts +83 -0
- package/src/locale/components/image.ts +31 -0
- package/src/locale/components/input-number.ts +27 -0
- package/src/locale/components/input.ts +33 -0
- package/src/locale/components/inspector.ts +19 -0
- package/src/locale/components/json-viewer.ts +62 -0
- package/src/locale/components/listbox.ts +11 -0
- package/src/locale/components/media-player.ts +30 -0
- package/src/locale/components/navigation-menu.ts +11 -0
- package/src/locale/components/pagination.ts +47 -0
- package/src/locale/components/picker.ts +95 -0
- package/src/locale/components/pin-input.ts +19 -0
- package/src/locale/components/popconfirm.ts +15 -0
- package/src/locale/components/popover.ts +11 -0
- package/src/locale/components/preset-gallery.ts +11 -0
- package/src/locale/components/preset-picker.ts +37 -0
- package/src/locale/components/progress.ts +11 -0
- package/src/locale/components/prose.ts +29 -0
- package/src/locale/components/qr-code.ts +27 -0
- package/src/locale/components/rating.ts +28 -0
- package/src/locale/components/select.ts +11 -0
- package/src/locale/components/selection-handles.ts +15 -0
- package/src/locale/components/sources.ts +35 -0
- package/src/locale/components/splitter.ts +11 -0
- package/src/locale/components/statistic.ts +13 -0
- package/src/locale/components/steps.ts +15 -0
- package/src/locale/components/table.ts +27 -0
- package/src/locale/components/tag.ts +11 -0
- package/src/locale/components/tags-input.ts +76 -0
- package/src/locale/components/terminal-output.ts +45 -0
- package/src/locale/components/time-input.ts +11 -0
- package/src/locale/components/time-picker.ts +23 -0
- package/src/locale/components/time-range-picker.ts +47 -0
- package/src/locale/components/timeline.ts +32 -0
- package/src/locale/components/toast.ts +11 -0
- package/src/locale/components/toolbar.ts +15 -0
- package/src/locale/components/transfer.ts +44 -0
- package/src/locale/components/tree-select.ts +11 -0
- package/src/locale/index.ts +4 -0
- package/src/locale/packs/en.ts +160 -0
- package/src/locale/packs/zh-cn.ts +160 -0
- package/src/locale/resolve.test.ts +28 -0
- package/src/locale/resolve.ts +52 -0
- package/src/locale/types.ts +253 -0
- package/src/selection-geometry/bands.test.ts +40 -0
- package/src/selection-geometry/bands.ts +43 -0
- package/src/selection-geometry/index.ts +2 -0
- package/src/selection-geometry/types.ts +35 -0
- package/src/styles/index.ts +1 -0
- package/src/styles/theme.test.ts +58 -0
- package/src/styles/theme.ts +48 -0
- package/src/theme/create.ts +218 -0
- package/src/theme/defaults.ts +7 -0
- package/src/theme/feedback.test.ts +79 -0
- package/src/theme/feedback.ts +90 -0
- package/src/theme/index.ts +9 -0
- package/src/theme/palette.test.ts +183 -0
- package/src/theme/text/create.test.ts +80 -0
- package/src/theme/text/create.ts +26 -0
- package/src/theme/text/index.ts +1 -0
- package/src/theme/theme.test.ts +343 -0
- package/src/theme/types.ts +330 -0
- package/src/theme/typography.test.ts +14 -0
- package/src/theme/variables/declarations.ts +71 -0
- package/src/theme/variables/index.ts +7 -0
- package/src/theme/variables/names.ts +192 -0
- package/src/theme/variables/references.ts +163 -0
- package/src/tokens/color/alpha.ts +79 -0
- package/src/tokens/color/conversion/channels.ts +35 -0
- package/src/tokens/color/conversion/contrast.ts +27 -0
- package/src/tokens/color/conversion/hex.ts +77 -0
- package/src/tokens/color/conversion/index.ts +5 -0
- package/src/tokens/color/conversion/oklch.ts +107 -0
- package/src/tokens/color/conversion/types.ts +19 -0
- package/src/tokens/color/generate.ts +202 -0
- package/src/tokens/color/index.ts +22 -0
- package/src/tokens/color/neutral-palettes.ts +25 -0
- package/src/tokens/defaults.ts +125 -0
- package/src/tokens/index.ts +3 -0
- package/src/tokens/types.ts +292 -0
- package/src/vue/accordion/accordion.vue +153 -0
- package/src/vue/accordion/index.ts +1 -0
- package/src/vue/action-menu/anchor.ts +28 -0
- package/src/vue/action-menu/bottom.test.ts +112 -0
- package/src/vue/action-menu/bottom.vue +126 -0
- package/src/vue/action-menu/desktop.vue +61 -0
- package/src/vue/action-menu/directory.test.ts +34 -0
- package/src/vue/action-menu/directory.vue +45 -0
- package/src/vue/action-menu/focus.ts +37 -0
- package/src/vue/action-menu/index.ts +2 -0
- package/src/vue/action-menu/keyboard.ts +59 -0
- package/src/vue/action-menu/path.test.ts +35 -0
- package/src/vue/action-menu/path.ts +56 -0
- package/src/vue/action-menu/root.test.ts +200 -0
- package/src/vue/action-menu/root.vue +62 -0
- package/src/vue/action-menu/rows.vue +57 -0
- package/src/vue/action-menu/search.test.ts +21 -0
- package/src/vue/action-menu/search.ts +7 -0
- package/src/vue/action-menu/types.ts +62 -0
- package/src/vue/action-menu/use-action-menu.ts +163 -0
- package/src/vue/action-sheet/action-sheet.vue +141 -0
- package/src/vue/action-sheet/index.ts +1 -0
- package/src/vue/action-sheet/locale.test.ts +33 -0
- package/src/vue/alert/alert.test.ts +74 -0
- package/src/vue/alert/alert.vue +85 -0
- package/src/vue/alert/index.ts +1 -0
- package/src/vue/alert/locale.test.ts +33 -0
- package/src/vue/anchor/anchor.test.ts +18 -0
- package/src/vue/anchor/anchor.vue +26 -0
- package/src/vue/anchor/dom.ts +47 -0
- package/src/vue/anchor/index.ts +2 -0
- package/src/vue/anchor/lifecycle.test.ts +75 -0
- package/src/vue/anchor/list.vue +24 -0
- package/src/vue/anchor/locale.test.ts +31 -0
- package/src/vue/anchor/position.test.ts +30 -0
- package/src/vue/anchor/position.ts +28 -0
- package/src/vue/anchor/types.ts +49 -0
- package/src/vue/anchor/use-anchor.ts +125 -0
- package/src/vue/attachment/actions.vue +27 -0
- package/src/vue/attachment/attachment.test.ts +113 -0
- package/src/vue/attachment/attachment.vue +53 -0
- package/src/vue/attachment/attachments.vue +72 -0
- package/src/vue/attachment/index.ts +3 -0
- package/src/vue/attachment/model.test.ts +24 -0
- package/src/vue/attachment/model.ts +30 -0
- package/src/vue/avatar/avatar-group.vue +62 -0
- package/src/vue/avatar/avatar.test.ts +46 -0
- package/src/vue/avatar/avatar.vue +115 -0
- package/src/vue/avatar/index.ts +2 -0
- package/src/vue/badge/badge.vue +42 -0
- package/src/vue/badge/count.test.ts +10 -0
- package/src/vue/badge/count.ts +11 -0
- package/src/vue/badge/index.ts +1 -0
- package/src/vue/badge/locale.test.ts +31 -0
- package/src/vue/breadcrumb/breadcrumb.vue +76 -0
- package/src/vue/breadcrumb/crumb.vue +29 -0
- package/src/vue/breadcrumb/index.ts +2 -0
- package/src/vue/breadcrumb/locale.test.ts +31 -0
- package/src/vue/breadcrumb/projection.test.ts +17 -0
- package/src/vue/breadcrumb/projection.ts +15 -0
- package/src/vue/breadcrumb/types.ts +40 -0
- package/src/vue/button/button.vue +100 -0
- package/src/vue/button/icon-button.vue +82 -0
- package/src/vue/button/index.ts +2 -0
- package/src/vue/calendar/announcements.ts +13 -0
- package/src/vue/calendar/calendar.vue +88 -0
- package/src/vue/calendar/day-view.vue +33 -0
- package/src/vue/calendar/index.ts +2 -0
- package/src/vue/calendar/navigation.vue +14 -0
- package/src/vue/calendar/period-view.vue +25 -0
- package/src/vue/calendar/types.ts +53 -0
- package/src/vue/calendar/value.test.ts +16 -0
- package/src/vue/calendar/value.ts +44 -0
- package/src/vue/candidate-list/candidate-list.vue +29 -0
- package/src/vue/candidate-list/index.ts +2 -0
- package/src/vue/card/card.vue +39 -0
- package/src/vue/card/index.ts +2 -0
- package/src/vue/card/types.ts +21 -0
- package/src/vue/carousel/card-stage.test.ts +60 -0
- package/src/vue/carousel/card-stage.vue +138 -0
- package/src/vue/carousel/carousel.test.ts +95 -0
- package/src/vue/carousel/carousel.vue +142 -0
- package/src/vue/carousel/index.ts +2 -0
- package/src/vue/carousel/item.vue +34 -0
- package/src/vue/carousel/types.ts +81 -0
- package/src/vue/cascader/cascader.vue +42 -0
- package/src/vue/cascader/flyout.vue +21 -0
- package/src/vue/cascader/index.ts +2 -0
- package/src/vue/cascader/level.vue +62 -0
- package/src/vue/cascader/locale.test.ts +38 -0
- package/src/vue/cascader/panels.vue +102 -0
- package/src/vue/cascader/types.ts +11 -0
- package/src/vue/cascader/use-flyout.ts +40 -0
- package/src/vue/chat/composer/composer.test.ts +164 -0
- package/src/vue/chat/composer/composer.vue +160 -0
- package/src/vue/chat/composer-input/composer-input.test.ts +24 -0
- package/src/vue/chat/composer-input/composer-input.vue +48 -0
- package/src/vue/chat/composer-submit/composer-submit.test.ts +30 -0
- package/src/vue/chat/composer-submit/composer-submit.vue +35 -0
- package/src/vue/chat/confirmation/confirmation.test.ts +45 -0
- package/src/vue/chat/confirmation/confirmation.vue +36 -0
- package/src/vue/chat/index.ts +16 -0
- package/src/vue/chat/locale.test.ts +80 -0
- package/src/vue/chat/message/message.test.ts +83 -0
- package/src/vue/chat/message/message.vue +98 -0
- package/src/vue/chat/message-action/message-action.vue +32 -0
- package/src/vue/chat/message-actions/message-actions.test.ts +56 -0
- package/src/vue/chat/message-actions/message-actions.vue +68 -0
- package/src/vue/chat/message-branch/message-branch.vue +46 -0
- package/src/vue/chat/message-list/anchors.test.ts +25 -0
- package/src/vue/chat/message-list/anchors.ts +36 -0
- package/src/vue/chat/message-list/message-list.test.ts +111 -0
- package/src/vue/chat/message-list/message-list.vue +117 -0
- package/src/vue/chat/message-list/types.ts +34 -0
- package/src/vue/chat/message-list/use-scroll.test.ts +96 -0
- package/src/vue/chat/message-list/use-scroll.ts +102 -0
- package/src/vue/chat/message-part/message-part.test.ts +134 -0
- package/src/vue/chat/message-part/message-part.vue +83 -0
- package/src/vue/chat/process/process.test.ts +30 -0
- package/src/vue/chat/process/process.vue +16 -0
- package/src/vue/chat/question/question.test.ts +211 -0
- package/src/vue/chat/question/question.vue +182 -0
- package/src/vue/chat/reasoning/reasoning.vue +25 -0
- package/src/vue/chat/rich-input/history.ts +33 -0
- package/src/vue/chat/rich-input/model.test.ts +23 -0
- package/src/vue/chat/rich-input/model.ts +80 -0
- package/src/vue/chat/rich-input/rich-input.test.ts +140 -0
- package/src/vue/chat/rich-input/rich-input.vue +273 -0
- package/src/vue/chat/rich-input/use-candidate-position.ts +36 -0
- package/src/vue/chat/rich-input/use-candidates.ts +78 -0
- package/src/vue/chat/shared/disclosure.vue +53 -0
- package/src/vue/chat/shared/focus-recovery.ts +24 -0
- package/src/vue/chat/shared/locale-direction.vue +7 -0
- package/src/vue/chat/shared/locale-scope.vue +17 -0
- package/src/vue/chat/shared/part-actions.ts +23 -0
- package/src/vue/chat/shared/state-icon.ts +11 -0
- package/src/vue/chat/shared/types.ts +9 -0
- package/src/vue/chat/ssr.test.ts +28 -0
- package/src/vue/chat/tool/tool.vue +35 -0
- package/src/vue/checkbox/checkbox.vue +119 -0
- package/src/vue/checkbox/index.ts +1 -0
- package/src/vue/checkbox/readonly.test.ts +62 -0
- package/src/vue/checkbox-group/checkbox-group.vue +64 -0
- package/src/vue/checkbox-group/contract.test.ts +75 -0
- package/src/vue/checkbox-group/form.test.ts +24 -0
- package/src/vue/checkbox-group/index.ts +1 -0
- package/src/vue/checkbox-group/model.test.ts +12 -0
- package/src/vue/checkbox-group/model.ts +23 -0
- package/src/vue/choice-picker/content.vue +121 -0
- package/src/vue/choice-picker/index.ts +1 -0
- package/src/vue/choice-picker/locale.test.ts +38 -0
- package/src/vue/choice-picker/public-props.test.ts +30 -0
- package/src/vue/choice-picker/root.test.ts +219 -0
- package/src/vue/choice-picker/root.vue +89 -0
- package/src/vue/choice-picker/ssr.test.ts +29 -0
- package/src/vue/choice-picker/types.ts +27 -0
- package/src/vue/choice-picker/use-choice-picker.ts +12 -0
- package/src/vue/clipboard/clipboard.test.ts +126 -0
- package/src/vue/clipboard/clipboard.vue +110 -0
- package/src/vue/clipboard/control.test.ts +25 -0
- package/src/vue/clipboard/index.ts +1 -0
- package/src/vue/clipboard/locale.test.ts +36 -0
- package/src/vue/clipboard/use-copy-feedback.ts +69 -0
- package/src/vue/code-block/appearance.ts +16 -0
- package/src/vue/code-block/code-block-header.vue +29 -0
- package/src/vue/code-block/code-block.test.ts +178 -0
- package/src/vue/code-block/code-block.vue +123 -0
- package/src/vue/code-block/code-lines.vue +29 -0
- package/src/vue/code-block/fixtures/scoped-theme.vue +16 -0
- package/src/vue/code-block/index.ts +10 -0
- package/src/vue/code-block/theme-surface.vue +56 -0
- package/src/vue/code-block/theme.test.ts +170 -0
- package/src/vue/code-block/types.ts +79 -0
- package/src/vue/collapsible/collapsible.test.ts +23 -0
- package/src/vue/collapsible/collapsible.vue +107 -0
- package/src/vue/collapsible/index.ts +1 -0
- package/src/vue/color-picker/color-channel-inputs.vue +136 -0
- package/src/vue/color-picker/color-editor.vue +176 -0
- package/src/vue/color-picker/color-palette.vue +198 -0
- package/src/vue/color-picker/color-picker-root.vue +172 -0
- package/src/vue/color-picker/color-picker.test.ts +253 -0
- package/src/vue/color-picker/color-picker.vue +238 -0
- package/src/vue/color-picker/index.ts +4 -0
- package/src/vue/color-picker/use-reset-state.ts +23 -0
- package/src/vue/combobox/collection.test.ts +19 -0
- package/src/vue/combobox/collection.ts +22 -0
- package/src/vue/combobox/combobox.vue +187 -0
- package/src/vue/combobox/form.test.ts +108 -0
- package/src/vue/combobox/form.ts +69 -0
- package/src/vue/combobox/index.ts +1 -0
- package/src/vue/combobox/lazy-mount.test.ts +88 -0
- package/src/vue/combobox/locale.test.ts +41 -0
- package/src/vue/combobox/model.test.ts +105 -0
- package/src/vue/combobox/types.ts +57 -0
- package/src/vue/combobox/use-combobox-model.ts +167 -0
- package/src/vue/command-list/command-list.vue +165 -0
- package/src/vue/command-list/focus.test.ts +62 -0
- package/src/vue/command-list/focus.ts +22 -0
- package/src/vue/command-list/index.ts +2 -0
- package/src/vue/command-list/navigation.test.ts +22 -0
- package/src/vue/command-list/navigation.ts +29 -0
- package/src/vue/command-list/types.ts +60 -0
- package/src/vue/command-palette/command-palette-dialog.vue +41 -0
- package/src/vue/command-palette/command-palette.vue +104 -0
- package/src/vue/command-palette/index.ts +3 -0
- package/src/vue/command-palette/locale.test.ts +36 -0
- package/src/vue/command-palette/projection.test.ts +14 -0
- package/src/vue/command-palette/projection.ts +16 -0
- package/src/vue/command-palette/types.ts +88 -0
- package/src/vue/comment/comment.test.ts +113 -0
- package/src/vue/comment/draft.vue +60 -0
- package/src/vue/comment/field.vue +97 -0
- package/src/vue/comment/index.ts +7 -0
- package/src/vue/comment/mentions.ts +31 -0
- package/src/vue/comment/message.vue +89 -0
- package/src/vue/comment/presentation.ts +17 -0
- package/src/vue/comment/rail.vue +39 -0
- package/src/vue/comment/thread.vue +146 -0
- package/src/vue/comment/types.ts +123 -0
- package/src/vue/control-group/control-group.vue +21 -0
- package/src/vue/control-group/index.ts +2 -0
- package/src/vue/control-group/types.ts +10 -0
- package/src/vue/date-input/date-input.vue +107 -0
- package/src/vue/date-input/formatter.test.ts +15 -0
- package/src/vue/date-input/formatter.ts +23 -0
- package/src/vue/date-input/index.ts +2 -0
- package/src/vue/date-input/types.ts +46 -0
- package/src/vue/date-input/value.test.ts +9 -0
- package/src/vue/date-input/value.ts +15 -0
- package/src/vue/date-picker/date-picker.vue +45 -0
- package/src/vue/date-picker/family.test.ts +27 -0
- package/src/vue/date-picker/index.ts +2 -0
- package/src/vue/date-picker/single.vue +114 -0
- package/src/vue/date-picker/types.ts +50 -0
- package/src/vue/date-range-picker/date-range-picker.vue +119 -0
- package/src/vue/date-range-picker/endpoint.vue +32 -0
- package/src/vue/date-range-picker/index.ts +2 -0
- package/src/vue/date-range-picker/types.ts +43 -0
- package/src/vue/date-range-picker/value.test.ts +25 -0
- package/src/vue/date-range-picker/value.ts +41 -0
- package/src/vue/date-time-picker/date-time-picker.vue +63 -0
- package/src/vue/date-time-picker/draft.ts +21 -0
- package/src/vue/date-time-picker/editor.vue +60 -0
- package/src/vue/date-time-picker/formatter.ts +19 -0
- package/src/vue/date-time-picker/index.ts +2 -0
- package/src/vue/date-time-picker/input.vue +108 -0
- package/src/vue/date-time-picker/panel.vue +48 -0
- package/src/vue/date-time-picker/rules.ts +56 -0
- package/src/vue/date-time-picker/types.ts +51 -0
- package/src/vue/date-time-picker/value.test.ts +54 -0
- package/src/vue/date-time-picker/value.ts +34 -0
- package/src/vue/date-time-range-picker/date-time-range-picker.vue +85 -0
- package/src/vue/date-time-range-picker/draft.test.ts +30 -0
- package/src/vue/date-time-range-picker/draft.ts +18 -0
- package/src/vue/date-time-range-picker/endpoint.vue +34 -0
- package/src/vue/date-time-range-picker/index.ts +2 -0
- package/src/vue/date-time-range-picker/panel.vue +87 -0
- package/src/vue/date-time-range-picker/types.ts +57 -0
- package/src/vue/date-time-range-picker/value.test.ts +64 -0
- package/src/vue/date-time-range-picker/value.ts +50 -0
- package/src/vue/descriptions/descriptions.test.ts +36 -0
- package/src/vue/descriptions/descriptions.vue +36 -0
- package/src/vue/descriptions/index.ts +2 -0
- package/src/vue/descriptions/types.ts +36 -0
- package/src/vue/dialog/close-trigger.vue +30 -0
- package/src/vue/dialog/content.vue +99 -0
- package/src/vue/dialog/index.ts +4 -0
- package/src/vue/dialog/locale.test.ts +35 -0
- package/src/vue/dialog/presence.test.ts +31 -0
- package/src/vue/dialog/root.vue +116 -0
- package/src/vue/dialog/theme.test.ts +170 -0
- package/src/vue/dialog/trigger.vue +31 -0
- package/src/vue/diff-viewer/diff-hunk.vue +73 -0
- package/src/vue/diff-viewer/diff-viewer.test.ts +97 -0
- package/src/vue/diff-viewer/diff-viewer.vue +67 -0
- package/src/vue/diff-viewer/index.ts +1 -0
- package/src/vue/diff-viewer/parse.ts +81 -0
- package/src/vue/diff-viewer/types.ts +35 -0
- package/src/vue/drawer/close-boundary.test.ts +47 -0
- package/src/vue/drawer/close-boundary.ts +38 -0
- package/src/vue/drawer/close-trigger.vue +33 -0
- package/src/vue/drawer/content-frame.test.ts +82 -0
- package/src/vue/drawer/content-frame.vue +78 -0
- package/src/vue/drawer/content.vue +36 -0
- package/src/vue/drawer/context.ts +9 -0
- package/src/vue/drawer/index.ts +4 -0
- package/src/vue/drawer/locale.test.ts +32 -0
- package/src/vue/drawer/root.vue +75 -0
- package/src/vue/drawer/runtime-identity.test.ts +78 -0
- package/src/vue/drawer/theme.test.ts +105 -0
- package/src/vue/drawer/trigger.vue +31 -0
- package/src/vue/drawer/types.ts +91 -0
- package/src/vue/drawer/use-runtime.test.ts +116 -0
- package/src/vue/drawer/use-runtime.ts +116 -0
- package/src/vue/editable/editable.test.ts +22 -0
- package/src/vue/editable/editable.vue +124 -0
- package/src/vue/editable/index.ts +1 -0
- package/src/vue/editable/locale.test.ts +39 -0
- package/src/vue/emoji-picker/emoji-picker.test.ts +60 -0
- package/src/vue/emoji-picker/emoji-picker.vue +89 -0
- package/src/vue/emoji-picker/index.ts +1 -0
- package/src/vue/emoji-picker/navigation.test.ts +14 -0
- package/src/vue/emoji-picker/navigation.ts +74 -0
- package/src/vue/emoji-picker/types.ts +11 -0
- package/src/vue/empty-state/empty-state.test.ts +37 -0
- package/src/vue/empty-state/empty-state.vue +90 -0
- package/src/vue/empty-state/illustration.vue +73 -0
- package/src/vue/empty-state/index.ts +1 -0
- package/src/vue/field/context.ts +16 -0
- package/src/vue/field/field.test.ts +84 -0
- package/src/vue/field/field.vue +152 -0
- package/src/vue/field/index.ts +1 -0
- package/src/vue/field/locale.test.ts +45 -0
- package/src/vue/field/placeholder.test.ts +54 -0
- package/src/vue/fieldset/fieldset.test.ts +67 -0
- package/src/vue/fieldset/fieldset.vue +128 -0
- package/src/vue/fieldset/index.ts +1 -0
- package/src/vue/file-icon/file-icon.test.ts +12 -0
- package/src/vue/file-icon/file-icon.vue +18 -0
- package/src/vue/file-icon/index.ts +1 -0
- package/src/vue/file-upload/file-list.vue +79 -0
- package/src/vue/file-upload/file-upload.test.ts +209 -0
- package/src/vue/file-upload/file-upload.vue +167 -0
- package/src/vue/file-upload/hidden-input.vue +23 -0
- package/src/vue/file-upload/index.ts +2 -0
- package/src/vue/file-upload/types.ts +68 -0
- package/src/vue/floating-panel/geometry.test.ts +26 -0
- package/src/vue/floating-panel/geometry.ts +22 -0
- package/src/vue/floating-panel/index.ts +2 -0
- package/src/vue/floating-panel/panel.vue +90 -0
- package/src/vue/floating-panel/types.ts +36 -0
- package/src/vue/form/context.ts +15 -0
- package/src/vue/form/contract.test.ts +46 -0
- package/src/vue/form/fixtures/template.vue +40 -0
- package/src/vue/form/focus.ts +20 -0
- package/src/vue/form/form.test.ts +90 -0
- package/src/vue/form/form.vue +39 -0
- package/src/vue/form/index.ts +3 -0
- package/src/vue/form/lifecycle.ts +38 -0
- package/src/vue/form/locale.test.ts +40 -0
- package/src/vue/form/ssr.test.ts +48 -0
- package/src/vue/form/template.test.ts +50 -0
- package/src/vue/form/testing.ts +33 -0
- package/src/vue/form/types.ts +95 -0
- package/src/vue/form/use-controller.ts +116 -0
- package/src/vue/form-field/form-field.vue +64 -0
- package/src/vue/form-field/index.ts +2 -0
- package/src/vue/form-field/path.ts +23 -0
- package/src/vue/form-field/types.ts +74 -0
- package/src/vue/form-field/use-binding.ts +112 -0
- package/src/vue/form-field/validation.test.ts +94 -0
- package/src/vue/hierarchy-picker/data.test.ts +19 -0
- package/src/vue/hierarchy-picker/data.ts +54 -0
- package/src/vue/hierarchy-picker/field.vue +79 -0
- package/src/vue/hierarchy-picker/state.test.ts +43 -0
- package/src/vue/hierarchy-picker/types.ts +65 -0
- package/src/vue/hierarchy-picker/use-form.ts +29 -0
- package/src/vue/hierarchy-picker/use-picker.ts +39 -0
- package/src/vue/hover-card/content.vue +39 -0
- package/src/vue/hover-card/hover-card.test.ts +36 -0
- package/src/vue/hover-card/index.ts +4 -0
- package/src/vue/hover-card/root.vue +39 -0
- package/src/vue/hover-card/trigger.vue +20 -0
- package/src/vue/hover-card/types.ts +19 -0
- package/src/vue/html-sandbox/html-sandbox.vue +68 -0
- package/src/vue/html-sandbox/index.ts +2 -0
- package/src/vue/html-sandbox/lifecycle.test.ts +28 -0
- package/src/vue/html-sandbox/ssr.test.ts +10 -0
- package/src/vue/html-sandbox/types.ts +25 -0
- package/src/vue/html-sandbox/use-runtime.ts +104 -0
- package/src/vue/icon/catalog.test.ts +39 -0
- package/src/vue/icon/catalog.ts +17 -0
- package/src/vue/icon/context.ts +7 -0
- package/src/vue/icon/icon-provider.vue +19 -0
- package/src/vue/icon/icon.vue +65 -0
- package/src/vue/icon/index.ts +4 -0
- package/src/vue/icon/types.ts +10 -0
- package/src/vue/image/image.test.ts +100 -0
- package/src/vue/image/image.vue +73 -0
- package/src/vue/image/index.ts +2 -0
- package/src/vue/image/media.test.ts +35 -0
- package/src/vue/image/media.vue +38 -0
- package/src/vue/image/types.ts +26 -0
- package/src/vue/image-cropper/export.ts +31 -0
- package/src/vue/image-cropper/geometry.test.ts +25 -0
- package/src/vue/image-cropper/geometry.ts +43 -0
- package/src/vue/image-cropper/image-cropper.test.ts +24 -0
- package/src/vue/image-cropper/image-cropper.vue +176 -0
- package/src/vue/image-cropper/index.ts +2 -0
- package/src/vue/image-cropper/session-types.ts +9 -0
- package/src/vue/image-cropper/session.vue +84 -0
- package/src/vue/image-cropper/types.ts +47 -0
- package/src/vue/image-cropper/use-source.ts +41 -0
- package/src/vue/image-preview/appearance.ts +10 -0
- package/src/vue/image-preview/geometry.test.ts +46 -0
- package/src/vue/image-preview/geometry.ts +21 -0
- package/src/vue/image-preview/group/context.ts +5 -0
- package/src/vue/image-preview/group/types.ts +40 -0
- package/src/vue/image-preview/group/use.test.ts +73 -0
- package/src/vue/image-preview/group/use.ts +63 -0
- package/src/vue/image-preview/image-preview.vue +75 -0
- package/src/vue/image-preview/index.ts +3 -0
- package/src/vue/image-preview/lifecycle.test.ts +74 -0
- package/src/vue/image-preview/mask-dismiss.ts +26 -0
- package/src/vue/image-preview/stage.vue +41 -0
- package/src/vue/image-preview/surface.vue +116 -0
- package/src/vue/image-preview/theme-surface.vue +27 -0
- package/src/vue/image-preview/theme.test.ts +145 -0
- package/src/vue/image-preview/toolbar/index.ts +2 -0
- package/src/vue/image-preview/toolbar/layout.test.ts +14 -0
- package/src/vue/image-preview/toolbar/layout.ts +28 -0
- package/src/vue/image-preview/toolbar/toolbar.test.ts +28 -0
- package/src/vue/image-preview/toolbar/toolbar.vue +47 -0
- package/src/vue/image-preview/toolbar/types.ts +17 -0
- package/src/vue/image-preview/types.ts +65 -0
- package/src/vue/image-preview/use-gestures.ts +81 -0
- package/src/vue/image-preview/use-transform.ts +48 -0
- package/src/vue/index.ts +134 -0
- package/src/vue/input/index.ts +1 -0
- package/src/vue/input/input.vue +161 -0
- package/src/vue/input/password-field.vue +64 -0
- package/src/vue/input/ssr.test.ts +123 -0
- package/src/vue/input-number/index.ts +1 -0
- package/src/vue/input-number/input-number.vue +180 -0
- package/src/vue/input-number/locale.test.ts +50 -0
- package/src/vue/input-number-unit/index.ts +1 -0
- package/src/vue/input-number-unit/input-number-unit.test.ts +42 -0
- package/src/vue/input-number-unit/input-number-unit.vue +47 -0
- package/src/vue/inspector/index.ts +2 -0
- package/src/vue/inspector/index.vue +146 -0
- package/src/vue/inspector/inspector.test.ts +61 -0
- package/src/vue/inspector/section.vue +44 -0
- package/src/vue/json-viewer/index.ts +1 -0
- package/src/vue/json-viewer/json-node.vue +75 -0
- package/src/vue/json-viewer/json-viewer.test.ts +89 -0
- package/src/vue/json-viewer/json-viewer.vue +61 -0
- package/src/vue/json-viewer/parse.ts +19 -0
- package/src/vue/kbd/index.ts +1 -0
- package/src/vue/kbd/kbd.vue +19 -0
- package/src/vue/kbd/labels.test.ts +8 -0
- package/src/vue/kbd/labels.ts +9 -0
- package/src/vue/listbox/collection.test.ts +87 -0
- package/src/vue/listbox/collection.ts +95 -0
- package/src/vue/listbox/index.ts +1 -0
- package/src/vue/listbox/item.vue +75 -0
- package/src/vue/listbox/keyboard.test.ts +78 -0
- package/src/vue/listbox/keyboard.ts +29 -0
- package/src/vue/listbox/listbox.vue +210 -0
- package/src/vue/listbox/locale.test.ts +28 -0
- package/src/vue/listbox/pointer.test.ts +73 -0
- package/src/vue/locale-provider/context.ts +27 -0
- package/src/vue/locale-provider/index.ts +3 -0
- package/src/vue/locale-provider/locale-provider.vue +13 -0
- package/src/vue/locale-provider/types.ts +9 -0
- package/src/vue/media-player/action.vue +20 -0
- package/src/vue/media-player/fullscreen.ts +27 -0
- package/src/vue/media-player/index.ts +1 -0
- package/src/vue/media-player/media-player.vue +48 -0
- package/src/vue/media-player/options.vue +33 -0
- package/src/vue/media-player/playback.test.ts +58 -0
- package/src/vue/media-player/playback.ts +96 -0
- package/src/vue/media-player/seek.vue +28 -0
- package/src/vue/media-player/time.ts +6 -0
- package/src/vue/menu/content-size.test.ts +43 -0
- package/src/vue/menu/content-size.ts +78 -0
- package/src/vue/menu/context/anchor.test.ts +66 -0
- package/src/vue/menu/context/anchor.ts +53 -0
- package/src/vue/menu/context/context-menu.vue +119 -0
- package/src/vue/menu/context/focus.test.ts +87 -0
- package/src/vue/menu/context/focus.ts +25 -0
- package/src/vue/menu/context/keyboard.test.ts +29 -0
- package/src/vue/menu/context/keyboard.ts +23 -0
- package/src/vue/menu/context/trigger.vue +184 -0
- package/src/vue/menu/default-state.test.ts +136 -0
- package/src/vue/menu/index.ts +10 -0
- package/src/vue/menu/initial-focus.test.ts +42 -0
- package/src/vue/menu/initial-focus.ts +22 -0
- package/src/vue/menu/items/items.test.ts +109 -0
- package/src/vue/menu/items/items.vue +64 -0
- package/src/vue/menu/menu-checkbox-item.vue +77 -0
- package/src/vue/menu/menu-group.vue +34 -0
- package/src/vue/menu/menu-item.vue +81 -0
- package/src/vue/menu/menu-radio-group.vue +37 -0
- package/src/vue/menu/menu-radio-item.vue +70 -0
- package/src/vue/menu/menu-separator.vue +7 -0
- package/src/vue/menu/menu-submenu.vue +193 -0
- package/src/vue/menu/menu.vue +208 -0
- package/src/vue/menu/submenu.test.ts +137 -0
- package/src/vue/menu/surface/anchor.ts +11 -0
- package/src/vue/menu/surface/portal.test.ts +18 -0
- package/src/vue/menu/surface/portal.ts +14 -0
- package/src/vue/menu/surface/scroll.test.ts +38 -0
- package/src/vue/menu/surface/scroll.ts +35 -0
- package/src/vue/menu/surface/siblings.ts +29 -0
- package/src/vue/menu/surface/trigger.vue +25 -0
- package/src/vue/menu/surface/use-layer.ts +23 -0
- package/src/vue/navigation-menu/collapsed.vue +60 -0
- package/src/vue/navigation-menu/entry-content.vue +10 -0
- package/src/vue/navigation-menu/index.ts +2 -0
- package/src/vue/navigation-menu/interaction.ts +21 -0
- package/src/vue/navigation-menu/link.vue +27 -0
- package/src/vue/navigation-menu/locale.test.ts +33 -0
- package/src/vue/navigation-menu/navigation-menu.vue +89 -0
- package/src/vue/navigation-menu/panel-tree.vue +24 -0
- package/src/vue/navigation-menu/positioned-content.vue +46 -0
- package/src/vue/navigation-menu/projection.test.ts +23 -0
- package/src/vue/navigation-menu/projection.ts +42 -0
- package/src/vue/navigation-menu/types.ts +75 -0
- package/src/vue/navigation-menu/vertical-tree.vue +37 -0
- package/src/vue/overlay-provider/context.test.ts +29 -0
- package/src/vue/overlay-provider/context.ts +19 -0
- package/src/vue/overlay-provider/index.ts +3 -0
- package/src/vue/overlay-provider/provider.vue +9 -0
- package/src/vue/overlay-provider/types.ts +7 -0
- package/src/vue/pagination/index.ts +1 -0
- package/src/vue/pagination/options.vue +79 -0
- package/src/vue/pagination/pagination.test.ts +50 -0
- package/src/vue/pagination/pagination.vue +184 -0
- package/src/vue/pin-input/form.ts +24 -0
- package/src/vue/pin-input/index.ts +2 -0
- package/src/vue/pin-input/locale.test.ts +36 -0
- package/src/vue/pin-input/pin-input.test.ts +95 -0
- package/src/vue/pin-input/pin-input.vue +148 -0
- package/src/vue/pin-input/types.ts +50 -0
- package/src/vue/popconfirm/index.ts +2 -0
- package/src/vue/popconfirm/locale.test.ts +35 -0
- package/src/vue/popconfirm/popconfirm.test.ts +85 -0
- package/src/vue/popconfirm/popconfirm.vue +58 -0
- package/src/vue/popconfirm/types.ts +45 -0
- package/src/vue/popconfirm/use-popconfirm.ts +63 -0
- package/src/vue/popover/anchor.vue +28 -0
- package/src/vue/popover/close-trigger.vue +48 -0
- package/src/vue/popover/content.vue +107 -0
- package/src/vue/popover/description.vue +21 -0
- package/src/vue/popover/index.ts +7 -0
- package/src/vue/popover/locale.test.ts +35 -0
- package/src/vue/popover/modal-layer.test.ts +112 -0
- package/src/vue/popover/modal-owner.test.ts +60 -0
- package/src/vue/popover/root.vue +53 -0
- package/src/vue/popover/title.vue +21 -0
- package/src/vue/popover/trigger.vue +32 -0
- package/src/vue/popover/types.ts +64 -0
- package/src/vue/popover/use-runtime.test.ts +99 -0
- package/src/vue/popover/use-runtime.ts +56 -0
- package/src/vue/preset-gallery/actions.test.ts +35 -0
- package/src/vue/preset-gallery/actions.vue +62 -0
- package/src/vue/preset-gallery/index.ts +1 -0
- package/src/vue/preset-gallery/locale.test.ts +31 -0
- package/src/vue/preset-gallery/preset-gallery.test.ts +37 -0
- package/src/vue/preset-gallery/preset-gallery.vue +136 -0
- package/src/vue/preset-gallery/selection.test.ts +91 -0
- package/src/vue/preset-gallery/types.ts +19 -0
- package/src/vue/preset-gallery/use-gallery-columns.ts +35 -0
- package/src/vue/preset-picker/content.vue +104 -0
- package/src/vue/preset-picker/index.ts +1 -0
- package/src/vue/preset-picker/locale.test.ts +35 -0
- package/src/vue/preset-picker/root.test.ts +261 -0
- package/src/vue/preset-picker/root.vue +69 -0
- package/src/vue/preset-picker/types.ts +18 -0
- package/src/vue/preset-picker/use-preset-picker.ts +55 -0
- package/src/vue/progress/index.ts +2 -0
- package/src/vue/progress/progress-enhancements.test.ts +267 -0
- package/src/vue/progress/progress.test.ts +59 -0
- package/src/vue/progress/progress.vue +129 -0
- package/src/vue/progress/types.ts +45 -0
- package/src/vue/prose/blocks/blockquote.vue +7 -0
- package/src/vue/prose/blocks/hr.vue +3 -0
- package/src/vue/prose/blocks/index.ts +4 -0
- package/src/vue/prose/blocks/p.vue +7 -0
- package/src/vue/prose/blocks/pre.vue +11 -0
- package/src/vue/prose/container/container.test.ts +13 -0
- package/src/vue/prose/container/container.vue +25 -0
- package/src/vue/prose/container/index.ts +2 -0
- package/src/vue/prose/container/types.ts +9 -0
- package/src/vue/prose/elements.test.ts +81 -0
- package/src/vue/prose/files/files.test.ts +33 -0
- package/src/vue/prose/files/files.vue +21 -0
- package/src/vue/prose/files/index.ts +2 -0
- package/src/vue/prose/files/types.ts +13 -0
- package/src/vue/prose/headings/h1.vue +8 -0
- package/src/vue/prose/headings/h2.vue +8 -0
- package/src/vue/prose/headings/h3.vue +8 -0
- package/src/vue/prose/headings/h4.vue +8 -0
- package/src/vue/prose/headings/h5.vue +8 -0
- package/src/vue/prose/headings/h6.vue +8 -0
- package/src/vue/prose/headings/index.ts +6 -0
- package/src/vue/prose/image/image.test.ts +58 -0
- package/src/vue/prose/image/image.vue +60 -0
- package/src/vue/prose/image/index.ts +2 -0
- package/src/vue/prose/image/types.ts +25 -0
- package/src/vue/prose/index.ts +14 -0
- package/src/vue/prose/inline/annotations/abbr.vue +10 -0
- package/src/vue/prose/inline/annotations/del.vue +7 -0
- package/src/vue/prose/inline/annotations/index.ts +9 -0
- package/src/vue/prose/inline/annotations/ins.vue +7 -0
- package/src/vue/prose/inline/annotations/mark.vue +7 -0
- package/src/vue/prose/inline/annotations/s.vue +7 -0
- package/src/vue/prose/inline/annotations/small.vue +7 -0
- package/src/vue/prose/inline/annotations/sub.vue +7 -0
- package/src/vue/prose/inline/annotations/sup.vue +7 -0
- package/src/vue/prose/inline/annotations/u.vue +7 -0
- package/src/vue/prose/inline/code/code.vue +7 -0
- package/src/vue/prose/inline/code/index.ts +3 -0
- package/src/vue/prose/inline/code/kbd.vue +7 -0
- package/src/vue/prose/inline/code/samp.vue +7 -0
- package/src/vue/prose/inline/emphasis/b.vue +7 -0
- package/src/vue/prose/inline/emphasis/cite.vue +7 -0
- package/src/vue/prose/inline/emphasis/dfn.vue +7 -0
- package/src/vue/prose/inline/emphasis/em.vue +7 -0
- package/src/vue/prose/inline/emphasis/i.vue +7 -0
- package/src/vue/prose/inline/emphasis/index.ts +7 -0
- package/src/vue/prose/inline/emphasis/strong.vue +7 -0
- package/src/vue/prose/inline/emphasis/var.vue +7 -0
- package/src/vue/prose/inline/index.ts +4 -0
- package/src/vue/prose/inline/links/a.vue +8 -0
- package/src/vue/prose/inline/links/br.vue +3 -0
- package/src/vue/prose/inline/links/index.ts +2 -0
- package/src/vue/prose/lists/dd.vue +7 -0
- package/src/vue/prose/lists/dl.vue +7 -0
- package/src/vue/prose/lists/dt.vue +7 -0
- package/src/vue/prose/lists/index.ts +6 -0
- package/src/vue/prose/lists/li.vue +7 -0
- package/src/vue/prose/lists/ol.vue +7 -0
- package/src/vue/prose/lists/ul.vue +7 -0
- package/src/vue/prose/locale.test.ts +36 -0
- package/src/vue/prose/mapping/index.ts +2 -0
- package/src/vue/prose/mapping/native.ts +59 -0
- package/src/vue/prose/mapping/rich.ts +6 -0
- package/src/vue/prose/media/figcaption.vue +7 -0
- package/src/vue/prose/media/figure.vue +7 -0
- package/src/vue/prose/media/img.vue +7 -0
- package/src/vue/prose/media/index.ts +3 -0
- package/src/vue/prose/preview/index.ts +2 -0
- package/src/vue/prose/preview/preview.test.ts +25 -0
- package/src/vue/prose/preview/preview.vue +31 -0
- package/src/vue/prose/preview/types.ts +20 -0
- package/src/vue/prose/prose.test.ts +35 -0
- package/src/vue/prose/prose.vue +25 -0
- package/src/vue/prose/shared/image-group.ts +5 -0
- package/src/vue/prose/shared/props.ts +10 -0
- package/src/vue/prose/shared/types.ts +6 -0
- package/src/vue/prose/source/index.ts +2 -0
- package/src/vue/prose/source/source.test.ts +40 -0
- package/src/vue/prose/source/source.vue +50 -0
- package/src/vue/prose/source/types.ts +52 -0
- package/src/vue/prose/table/caption.vue +7 -0
- package/src/vue/prose/table/index.ts +8 -0
- package/src/vue/prose/table/table.vue +9 -0
- package/src/vue/prose/table/tbody.vue +7 -0
- package/src/vue/prose/table/td.vue +7 -0
- package/src/vue/prose/table/tfoot.vue +7 -0
- package/src/vue/prose/table/th.vue +7 -0
- package/src/vue/prose/table/thead.vue +7 -0
- package/src/vue/prose/table/tr.vue +7 -0
- package/src/vue/prose/types.ts +120 -0
- package/src/vue/qr-code/index.ts +2 -0
- package/src/vue/qr-code/qr-code.test.ts +96 -0
- package/src/vue/qr-code/qr-code.vue +80 -0
- package/src/vue/qr-code/types.ts +54 -0
- package/src/vue/radio-group/index.ts +1 -0
- package/src/vue/radio-group/keyboard.ts +13 -0
- package/src/vue/radio-group/radio-group.vue +154 -0
- package/src/vue/radio-group/readonly.test.ts +70 -0
- package/src/vue/rating/index.ts +2 -0
- package/src/vue/rating/locale.test.ts +38 -0
- package/src/vue/rating/rating.test.ts +141 -0
- package/src/vue/rating/rating.vue +138 -0
- package/src/vue/rating/types.ts +50 -0
- package/src/vue/rating/value.ts +18 -0
- package/src/vue/result/illustration.vue +71 -0
- package/src/vue/result/index.ts +2 -0
- package/src/vue/result/result.test.ts +83 -0
- package/src/vue/result/result.vue +56 -0
- package/src/vue/result/types.ts +49 -0
- package/src/vue/schema-form/controls/boolean.vue +51 -0
- package/src/vue/schema-form/controls/registry.ts +23 -0
- package/src/vue/schema-form/index.ts +2 -0
- package/src/vue/schema-form/render-control.ts +29 -0
- package/src/vue/schema-form/schema-form.test.ts +140 -0
- package/src/vue/schema-form/schema-form.vue +41 -0
- package/src/vue/schema-form/tree.ts +67 -0
- package/src/vue/schema-form/types.ts +96 -0
- package/src/vue/schema-form/validate-tree.test.ts +17 -0
- package/src/vue/schema-form/validate-tree.ts +27 -0
- package/src/vue/scroll-area/index.ts +1 -0
- package/src/vue/scroll-area/scroll-area.test.ts +53 -0
- package/src/vue/scroll-area/scroll-area.vue +191 -0
- package/src/vue/scroll-area/use-scroll-sync.ts +203 -0
- package/src/vue/segmented/index.ts +1 -0
- package/src/vue/segmented/segmented.vue +116 -0
- package/src/vue/select/index.ts +1 -0
- package/src/vue/select/lazy-mount.test.ts +71 -0
- package/src/vue/select/locale.test.ts +31 -0
- package/src/vue/select/select.test.ts +78 -0
- package/src/vue/select/select.vue +224 -0
- package/src/vue/select/theme.test.ts +137 -0
- package/src/vue/selection-gesture/index.ts +2 -0
- package/src/vue/selection-gesture/selection-gesture.vue +42 -0
- package/src/vue/selection-handles/index.ts +2 -0
- package/src/vue/selection-handles/locale.test.ts +20 -0
- package/src/vue/selection-handles/selection-handles.vue +47 -0
- package/src/vue/separator/index.ts +2 -0
- package/src/vue/separator/separator.vue +26 -0
- package/src/vue/separator/types.ts +21 -0
- package/src/vue/shared/choice-state/field-item.vue +14 -0
- package/src/vue/shared/choice-state/model.test.ts +52 -0
- package/src/vue/shared/choice-state/model.ts +62 -0
- package/src/vue/shared/choice-state/types.ts +13 -0
- package/src/vue/shared/horizontal-scroll/geometry.ts +33 -0
- package/src/vue/shared/horizontal-scroll/icons.ts +7 -0
- package/src/vue/shared/horizontal-scroll/strip.vue +38 -0
- package/src/vue/shared/horizontal-scroll/types.ts +39 -0
- package/src/vue/shared/horizontal-scroll/use-scroll.ts +129 -0
- package/src/vue/shared/motion/content.ts +26 -0
- package/src/vue/shared/picker/anchor.vue +11 -0
- package/src/vue/shared/picker/content.vue +33 -0
- package/src/vue/shared/picker/context.ts +7 -0
- package/src/vue/shared/picker/control-anchor.vue +13 -0
- package/src/vue/shared/picker/index.ts +4 -0
- package/src/vue/shared/picker/locale.test.ts +109 -0
- package/src/vue/shared/picker/positioning.ts +29 -0
- package/src/vue/shared/picker/root.vue +56 -0
- package/src/vue/shared/picker/trigger.vue +7 -0
- package/src/vue/shared/picker/types.ts +21 -0
- package/src/vue/shared/segmented-input/label.ts +13 -0
- package/src/vue/shared/segmented-input/root.vue +48 -0
- package/src/vue/shared/segmented-input/types.ts +29 -0
- package/src/vue/shared/surface/geometry.ts +4 -0
- package/src/vue/shared/surface/modal-portal.test.ts +146 -0
- package/src/vue/shared/surface/open-default.test.ts +135 -0
- package/src/vue/shared/surface/use-modal-owner.test.ts +24 -0
- package/src/vue/shared/surface/use-modal-owner.ts +35 -0
- package/src/vue/shared/surface/use-modal-portal.ts +17 -0
- package/src/vue/shared/task/presentation/media.ts +61 -0
- package/src/vue/shared/task/presentation/types.ts +66 -0
- package/src/vue/shared/task/presentation/use-adaptive-presentation.ssr.test.ts +21 -0
- package/src/vue/shared/task/presentation/use-adaptive-presentation.test.ts +247 -0
- package/src/vue/shared/task/presentation/use-adaptive-presentation.ts +134 -0
- package/src/vue/shared/task/selection/controller.test.ts +135 -0
- package/src/vue/shared/task/selection/controller.ts +89 -0
- package/src/vue/shared/task/selection/desktop-frame.vue +35 -0
- package/src/vue/shared/task/selection/query.test.ts +33 -0
- package/src/vue/shared/task/selection/query.ts +51 -0
- package/src/vue/shared/task/selection/types.ts +104 -0
- package/src/vue/shared/task/selection/use-picker.ts +98 -0
- package/src/vue/shared/task/selection/value.ts +20 -0
- package/src/vue/shared/task/session/lifecycle.test.ts +99 -0
- package/src/vue/shared/task/session/lifecycle.ts +126 -0
- package/src/vue/shared/task/session/request-types.ts +52 -0
- package/src/vue/shared/task/session/requests.test.ts +175 -0
- package/src/vue/shared/task/session/requests.ts +118 -0
- package/src/vue/shared/task/session/types.ts +67 -0
- package/src/vue/shared/task/trigger.test.ts +296 -0
- package/src/vue/shared/task/trigger.vue +118 -0
- package/src/vue/sheet/index.ts +8 -0
- package/src/vue/shimmer/index.ts +1 -0
- package/src/vue/shimmer/shimmer.test.ts +39 -0
- package/src/vue/shimmer/shimmer.vue +14 -0
- package/src/vue/skeleton/index.ts +1 -0
- package/src/vue/skeleton/skeleton.vue +24 -0
- package/src/vue/slider/index.ts +1 -0
- package/src/vue/slider/slider.test.ts +52 -0
- package/src/vue/slider/slider.vue +116 -0
- package/src/vue/sources/index.ts +3 -0
- package/src/vue/sources/inline-citation.test.ts +45 -0
- package/src/vue/sources/inline-citation.vue +50 -0
- package/src/vue/sources/sources.test.ts +86 -0
- package/src/vue/sources/sources.vue +54 -0
- package/src/vue/space/index.ts +2 -0
- package/src/vue/space/space.vue +26 -0
- package/src/vue/space/spacing.ts +19 -0
- package/src/vue/space/types.ts +29 -0
- package/src/vue/splitter/index.ts +1 -0
- package/src/vue/splitter/locale.test.ts +29 -0
- package/src/vue/splitter/splitter.test.ts +67 -0
- package/src/vue/splitter/splitter.vue +255 -0
- package/src/vue/statistic/index.ts +2 -0
- package/src/vue/statistic/statistic.test.ts +116 -0
- package/src/vue/statistic/statistic.vue +42 -0
- package/src/vue/statistic/types.ts +46 -0
- package/src/vue/steps/index.ts +2 -0
- package/src/vue/steps/locale.test.ts +33 -0
- package/src/vue/steps/position.test.ts +12 -0
- package/src/vue/steps/position.ts +9 -0
- package/src/vue/steps/steps.vue +87 -0
- package/src/vue/steps/types.ts +81 -0
- package/src/vue/switch/default-state.test.ts +97 -0
- package/src/vue/switch/index.ts +1 -0
- package/src/vue/switch/switch.vue +109 -0
- package/src/vue/table/index.ts +2 -0
- package/src/vue/table/model.test.ts +29 -0
- package/src/vue/table/model.ts +40 -0
- package/src/vue/table/selection.test.ts +15 -0
- package/src/vue/table/selection.ts +29 -0
- package/src/vue/table/sorting.test.ts +28 -0
- package/src/vue/table/sorting.ts +65 -0
- package/src/vue/table/ssr.test.ts +83 -0
- package/src/vue/table/table.vue +98 -0
- package/src/vue/table/types.ts +6 -0
- package/src/vue/table/use-table-interaction.test.ts +39 -0
- package/src/vue/table/use-table-interaction.ts +63 -0
- package/src/vue/table-size-picker/index.ts +2 -0
- package/src/vue/table-size-picker/table-size-picker.vue +92 -0
- package/src/vue/tabs/index.ts +1 -0
- package/src/vue/tabs/tabs.test.ts +51 -0
- package/src/vue/tabs/tabs.vue +138 -0
- package/src/vue/tag/index.ts +1 -0
- package/src/vue/tag/locale.test.ts +29 -0
- package/src/vue/tag/tag.vue +77 -0
- package/src/vue/tags-input/index.ts +1 -0
- package/src/vue/tags-input/paste.test.ts +79 -0
- package/src/vue/tags-input/paste.ts +32 -0
- package/src/vue/tags-input/tags-input.test.ts +40 -0
- package/src/vue/tags-input/tags-input.vue +276 -0
- package/src/vue/tags-input/types.ts +23 -0
- package/src/vue/task-panel/index.ts +1 -0
- package/src/vue/task-panel/root.test.ts +38 -0
- package/src/vue/task-panel/root.vue +73 -0
- package/src/vue/task-panel/runtime.ts +69 -0
- package/src/vue/task-panel/types.ts +6 -0
- package/src/vue/task-panel/viewport.test.ts +22 -0
- package/src/vue/task-panel/viewport.ts +24 -0
- package/src/vue/terminal-output/index.ts +2 -0
- package/src/vue/terminal-output/parse.ts +131 -0
- package/src/vue/terminal-output/terminal-output.test.ts +78 -0
- package/src/vue/terminal-output/terminal-output.vue +72 -0
- package/src/vue/textarea/auto-resize.ts +101 -0
- package/src/vue/textarea/index.ts +1 -0
- package/src/vue/textarea/textarea.vue +194 -0
- package/src/vue/textarea/types.ts +9 -0
- package/src/vue/theme-provider/context.ts +33 -0
- package/src/vue/theme-provider/index.ts +3 -0
- package/src/vue/theme-provider/portal.vue +36 -0
- package/src/vue/theme-provider/styles.ts +34 -0
- package/src/vue/theme-provider/surface.vue +36 -0
- package/src/vue/theme-provider/theme-provider.test.ts +129 -0
- package/src/vue/theme-provider/theme-provider.vue +25 -0
- package/src/vue/theme-provider/types.ts +9 -0
- package/src/vue/time-input/formatter.ts +13 -0
- package/src/vue/time-input/index.ts +2 -0
- package/src/vue/time-input/time-input.vue +112 -0
- package/src/vue/time-input/types.ts +48 -0
- package/src/vue/time-input/value.test.ts +8 -0
- package/src/vue/time-input/value.ts +25 -0
- package/src/vue/time-picker/columns.vue +49 -0
- package/src/vue/time-picker/index.ts +2 -0
- package/src/vue/time-picker/options.test.ts +22 -0
- package/src/vue/time-picker/options.ts +53 -0
- package/src/vue/time-picker/panel.vue +43 -0
- package/src/vue/time-picker/single.vue +67 -0
- package/src/vue/time-picker/time-picker.vue +30 -0
- package/src/vue/time-picker/types.ts +60 -0
- package/src/vue/time-picker/value.test.ts +20 -0
- package/src/vue/time-picker/value.ts +61 -0
- package/src/vue/time-range-picker/endpoint.vue +34 -0
- package/src/vue/time-range-picker/index.ts +2 -0
- package/src/vue/time-range-picker/panel.vue +66 -0
- package/src/vue/time-range-picker/time-range-picker.vue +84 -0
- package/src/vue/time-range-picker/types.ts +55 -0
- package/src/vue/time-range-picker/value.test.ts +45 -0
- package/src/vue/time-range-picker/value.ts +56 -0
- package/src/vue/timeline/index.ts +2 -0
- package/src/vue/timeline/locale.test.ts +32 -0
- package/src/vue/timeline/timeline.test.ts +53 -0
- package/src/vue/timeline/timeline.vue +68 -0
- package/src/vue/timeline/types.ts +62 -0
- package/src/vue/toast/create-toaster.ts +30 -0
- package/src/vue/toast/index.ts +9 -0
- package/src/vue/toast/locale.test.ts +33 -0
- package/src/vue/toast/toaster.vue +116 -0
- package/src/vue/toggle-group/index.ts +1 -0
- package/src/vue/toggle-group/toggle-group.vue +43 -0
- package/src/vue/toolbar/activation.test.ts +53 -0
- package/src/vue/toolbar/collapse/layout.test.ts +47 -0
- package/src/vue/toolbar/collapse/more.vue +117 -0
- package/src/vue/toolbar/collapse/separators.test.ts +36 -0
- package/src/vue/toolbar/collapse/separators.ts +52 -0
- package/src/vue/toolbar/collapse/types.ts +42 -0
- package/src/vue/toolbar/collapse/units.test.ts +26 -0
- package/src/vue/toolbar/collapse/units.ts +61 -0
- package/src/vue/toolbar/collapse/use-collapse.ts +124 -0
- package/src/vue/toolbar/context.ts +51 -0
- package/src/vue/toolbar/index.ts +13 -0
- package/src/vue/toolbar/items/body.vue +66 -0
- package/src/vue/toolbar/items/configuration.test.ts +134 -0
- package/src/vue/toolbar/items/control.vue +126 -0
- package/src/vue/toolbar/items/items.test.ts +40 -0
- package/src/vue/toolbar/items/items.vue +67 -0
- package/src/vue/toolbar/items/popup-body.vue +26 -0
- package/src/vue/toolbar/items/rows.test.ts +105 -0
- package/src/vue/toolbar/items/types.ts +35 -0
- package/src/vue/toolbar/items/use-entry.ts +57 -0
- package/src/vue/toolbar/presentation/field.vue +34 -0
- package/src/vue/toolbar/presentation/mobile.test.ts +81 -0
- package/src/vue/toolbar/presentation/mode.test.ts +27 -0
- package/src/vue/toolbar/presentation/mode.ts +27 -0
- package/src/vue/toolbar/presentation/presentation.test.ts +184 -0
- package/src/vue/toolbar/presentation/tooltip.vue +41 -0
- package/src/vue/toolbar/scrolling/icons.ts +1 -0
- package/src/vue/toolbar/scrolling/scrolling.test.ts +232 -0
- package/src/vue/toolbar/scrolling/types.ts +17 -0
- package/src/vue/toolbar/scrolling/use-scroll.ts +12 -0
- package/src/vue/toolbar/toolbar-action.vue +86 -0
- package/src/vue/toolbar/toolbar-color-picker-disclosure.test.ts +94 -0
- package/src/vue/toolbar/toolbar-color-picker-disclosure.vue +89 -0
- package/src/vue/toolbar/toolbar-disclosure.vue +134 -0
- package/src/vue/toolbar/toolbar-group.vue +36 -0
- package/src/vue/toolbar/toolbar-selector.vue +127 -0
- package/src/vue/toolbar/toolbar-separator.vue +20 -0
- package/src/vue/toolbar/toolbar-split-button.test.ts +54 -0
- package/src/vue/toolbar/toolbar-split-button.vue +223 -0
- package/src/vue/toolbar/toolbar-toggle.vue +89 -0
- package/src/vue/toolbar/toolbar.vue +155 -0
- package/src/vue/toolbar/types.ts +55 -0
- package/src/vue/toolbar/use-toolbar-item.ts +48 -0
- package/src/vue/toolbar/use-toolbar-root.ts +161 -0
- package/src/vue/tooltip/content.vue +98 -0
- package/src/vue/tooltip/focus-reveal.test.ts +211 -0
- package/src/vue/tooltip/focus-reveal.ts +120 -0
- package/src/vue/tooltip/hydration.test.ts +73 -0
- package/src/vue/tooltip/index.ts +3 -0
- package/src/vue/tooltip/root.vue +135 -0
- package/src/vue/tooltip/trigger.vue +63 -0
- package/src/vue/tooltip/types.ts +9 -0
- package/src/vue/transfer/index.ts +2 -0
- package/src/vue/transfer/model.test.ts +35 -0
- package/src/vue/transfer/model.ts +54 -0
- package/src/vue/transfer/panel.vue +84 -0
- package/src/vue/transfer/transfer.test.ts +113 -0
- package/src/vue/transfer/transfer.vue +123 -0
- package/src/vue/transfer/types.ts +75 -0
- package/src/vue/tree-select/index.ts +2 -0
- package/src/vue/tree-select/locale.test.ts +39 -0
- package/src/vue/tree-select/tree-select.vue +60 -0
- package/src/vue/tree-select/types.ts +13 -0
- package/src/vue/tree-view/index.ts +1 -0
- package/src/vue/tree-view/tree-checkbox.vue +29 -0
- package/src/vue/tree-view/tree-node.vue +114 -0
- package/src/vue/tree-view/tree-view.test.ts +60 -0
- package/src/vue/tree-view/tree-view.vue +224 -0
- package/src/vue/tree-view/use-collection.ts +63 -0
- package/src/vue/typography/abbreviation.test.ts +38 -0
- package/src/vue/typography/abbreviation.vue +23 -0
- package/src/vue/typography/index.ts +2 -0
- package/src/vue/typography/typography.test.ts +75 -0
- package/src/vue/typography/typography.vue +18 -0
|
@@ -0,0 +1,1531 @@
|
|
|
1
|
+
import { A as quireContrastRatio, P as createThemeCssVariables, k as parseQuireHexColor } from "./catalog-AqWLE58Z.mjs";
|
|
2
|
+
//#region src/components/toggle-group/create.ts
|
|
3
|
+
/**
|
|
4
|
+
* Derives group layout from existing semantic roles; child controls keep their own sizes.
|
|
5
|
+
* @param theme - Current theme.
|
|
6
|
+
* @returns Group-level configuration.
|
|
7
|
+
*/
|
|
8
|
+
function createToggleGroupTokens(theme) {
|
|
9
|
+
return { gap: theme.spacing.inlineTight };
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/components/toggle-group/variables/declarations.ts
|
|
13
|
+
/**
|
|
14
|
+
* Publishes direct component-to-CSS mappings for theme consumers and the atlas.
|
|
15
|
+
* @param tokens - Group configuration.
|
|
16
|
+
* @returns Group CSS declarations.
|
|
17
|
+
*/
|
|
18
|
+
function createToggleGroupCssVariables(tokens) {
|
|
19
|
+
return { "--qk-toggle-group-gap": tokens.gap };
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/components/checkbox-group/create.ts
|
|
23
|
+
/**
|
|
24
|
+
* Derives group layout from existing semantic roles; child controls keep their own sizes.
|
|
25
|
+
* @param theme - Current theme.
|
|
26
|
+
* @returns Group-level configuration.
|
|
27
|
+
*/
|
|
28
|
+
function createCheckboxGroupTokens(theme) {
|
|
29
|
+
return {
|
|
30
|
+
gap: theme.spacing.inline,
|
|
31
|
+
inlineGap: theme.spacing.surface,
|
|
32
|
+
labelColor: theme.color.text.secondary
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/components/checkbox-group/variables/declarations.ts
|
|
37
|
+
/**
|
|
38
|
+
* Publishes direct component-to-CSS mappings for theme consumers and the atlas.
|
|
39
|
+
* @param tokens - Group configuration.
|
|
40
|
+
* @returns Group CSS declarations.
|
|
41
|
+
*/
|
|
42
|
+
function createCheckboxGroupCssVariables(tokens) {
|
|
43
|
+
return {
|
|
44
|
+
"--qk-checkbox-group-gap": tokens.gap,
|
|
45
|
+
"--qk-checkbox-group-inline-gap": tokens.inlineGap,
|
|
46
|
+
"--qk-checkbox-group-label-color": tokens.labelColor
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/components/kbd/create.ts
|
|
51
|
+
/**
|
|
52
|
+
* Derives quiet monospace keycaps that fit inside same-density controls.
|
|
53
|
+
* @param theme - Current semantic theme.
|
|
54
|
+
* @returns Key hint tokens, including three independent typography scales.
|
|
55
|
+
*/
|
|
56
|
+
function createKbdTokens(theme) {
|
|
57
|
+
return {
|
|
58
|
+
foreground: theme.color.text.secondary,
|
|
59
|
+
background: theme.color.surface.subtle,
|
|
60
|
+
borderColor: theme.color.border.default,
|
|
61
|
+
borderWidth: theme.borderWidth.default,
|
|
62
|
+
radius: theme.radius.control,
|
|
63
|
+
fontFamily: theme.typography.code.fontFamily,
|
|
64
|
+
fontWeight: theme.typography.code.fontWeight,
|
|
65
|
+
letterSpacing: theme.typography.code.letterSpacing,
|
|
66
|
+
size: {
|
|
67
|
+
xs: keycapSize(theme, "xs"),
|
|
68
|
+
sm: keycapSize(theme, "sm"),
|
|
69
|
+
md: keycapSize(theme, "md")
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Derives keycaps from typography, independently of surrounding control height.
|
|
75
|
+
* @param theme - Semantic source for dimensions and typography.
|
|
76
|
+
* @param size - Inline typography scale.
|
|
77
|
+
* @returns Keycap dimensions; xs uses helper type to remain readable at compact height.
|
|
78
|
+
*/
|
|
79
|
+
function keycapSize(theme, size) {
|
|
80
|
+
const role = size === "xs" ? "helper" : size === "sm" ? "body" : "heading";
|
|
81
|
+
const { inlineTight, inline } = theme.spacing;
|
|
82
|
+
return {
|
|
83
|
+
minHeight: `calc(${theme.typography[role].fontSize} * ${theme.typography[role].lineHeight})`,
|
|
84
|
+
fontSize: theme.typography[size === "md" ? "compact" : "helper"].fontSize,
|
|
85
|
+
paddingInline: size === "xs" ? inlineTight : size === "sm" ? inline : `calc(${inline} + ${inlineTight} / 2)`
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/components/kbd/variables/declarations.ts
|
|
90
|
+
/**
|
|
91
|
+
* Projects key-hint roles and density mappings to CSS.
|
|
92
|
+
* @param tokens - Key-hint configuration.
|
|
93
|
+
* @returns Explicit CSS declarations.
|
|
94
|
+
*/
|
|
95
|
+
function createKbdCssVariables(tokens) {
|
|
96
|
+
const variables = {
|
|
97
|
+
"--qk-kbd-foreground": tokens.foreground,
|
|
98
|
+
"--qk-kbd-background": tokens.background,
|
|
99
|
+
"--qk-kbd-border-color": tokens.borderColor,
|
|
100
|
+
"--qk-kbd-border-width": tokens.borderWidth,
|
|
101
|
+
"--qk-kbd-radius": tokens.radius,
|
|
102
|
+
"--qk-kbd-font-family": tokens.fontFamily,
|
|
103
|
+
"--qk-kbd-font-weight": String(tokens.fontWeight),
|
|
104
|
+
"--qk-kbd-letter-spacing": tokens.letterSpacing
|
|
105
|
+
};
|
|
106
|
+
for (const [size, roles] of Object.entries(tokens.size)) {
|
|
107
|
+
variables[`--qk-kbd-${size}-min-height`] = roles.minHeight;
|
|
108
|
+
variables[`--qk-kbd-${size}-font-size`] = roles.fontSize;
|
|
109
|
+
variables[`--qk-kbd-${size}-padding-inline`] = roles.paddingInline;
|
|
110
|
+
}
|
|
111
|
+
return Object.freeze(variables);
|
|
112
|
+
}
|
|
113
|
+
//#endregion
|
|
114
|
+
//#region src/components/skeleton/create.ts
|
|
115
|
+
/**
|
|
116
|
+
* Derives decorative placeholder geometry and color from the active theme.
|
|
117
|
+
* @param theme - Current theme.
|
|
118
|
+
* @returns Skeleton configuration.
|
|
119
|
+
*/
|
|
120
|
+
function createSkeletonTokens(theme) {
|
|
121
|
+
return {
|
|
122
|
+
background: theme.color.surface.hover,
|
|
123
|
+
lineHeight: `calc(${theme.typography.body.fontSize} * ${theme.typography.body.lineHeight})`,
|
|
124
|
+
radius: theme.radius.control,
|
|
125
|
+
duration: `calc(${theme.motion.overlayDuration} * 8)`,
|
|
126
|
+
easing: theme.motion.standardEasing,
|
|
127
|
+
minimumOpacity: theme.opacity.muted,
|
|
128
|
+
maximumOpacity: theme.opacity.opaque
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region src/components/skeleton/variables/declarations.ts
|
|
133
|
+
/**
|
|
134
|
+
* Publishes traceable placeholder CSS roles.
|
|
135
|
+
* @param tokens - Skeleton configuration.
|
|
136
|
+
* @returns Direct CSS projections.
|
|
137
|
+
*/
|
|
138
|
+
function createSkeletonCssVariables(tokens) {
|
|
139
|
+
return {
|
|
140
|
+
"--qk-skeleton-background": tokens.background,
|
|
141
|
+
"--qk-skeleton-line-height": tokens.lineHeight,
|
|
142
|
+
"--qk-skeleton-radius": tokens.radius,
|
|
143
|
+
"--qk-skeleton-duration": tokens.duration,
|
|
144
|
+
"--qk-skeleton-easing": tokens.easing,
|
|
145
|
+
"--qk-skeleton-minimum-opacity": String(tokens.minimumOpacity),
|
|
146
|
+
"--qk-skeleton-maximum-opacity": String(tokens.maximumOpacity)
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region src/components/tag/create.ts
|
|
151
|
+
/**
|
|
152
|
+
* Maps static status labels to existing semantic colors, without a separate palette.
|
|
153
|
+
* @param theme - Active semantic theme.
|
|
154
|
+
* @returns Tag color and geometry configuration.
|
|
155
|
+
*/
|
|
156
|
+
function createTagTokens(theme) {
|
|
157
|
+
const color = theme.color;
|
|
158
|
+
return Object.freeze({
|
|
159
|
+
paddingInline: theme.spacing.inline,
|
|
160
|
+
paddingBlock: theme.spacing.inlineTight,
|
|
161
|
+
gap: theme.spacing.inlineTight,
|
|
162
|
+
radius: theme.radius.control,
|
|
163
|
+
borderWidth: theme.borderWidth.default,
|
|
164
|
+
color: {
|
|
165
|
+
neutral: {
|
|
166
|
+
text: color.text.secondary,
|
|
167
|
+
surface: color.surface.subtle,
|
|
168
|
+
border: color.border.default,
|
|
169
|
+
solid: color.surface.inverse,
|
|
170
|
+
onSolid: color.text.inverse
|
|
171
|
+
},
|
|
172
|
+
primary: {
|
|
173
|
+
text: color.action.text,
|
|
174
|
+
surface: color.action.soft,
|
|
175
|
+
border: color.action.primary,
|
|
176
|
+
solid: color.action.primary,
|
|
177
|
+
onSolid: color.action.foreground
|
|
178
|
+
},
|
|
179
|
+
info: feedback$1(color.info),
|
|
180
|
+
success: feedback$1(color.success),
|
|
181
|
+
warning: feedback$1(color.warning),
|
|
182
|
+
danger: feedback$1(color.danger)
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Selects only the five static tag roles from a feedback family.
|
|
188
|
+
* @param color - Existing feedback semantics.
|
|
189
|
+
* @returns The Tag color contract, without unrelated interaction states.
|
|
190
|
+
*/
|
|
191
|
+
function feedback$1(color) {
|
|
192
|
+
return {
|
|
193
|
+
text: color.text,
|
|
194
|
+
surface: color.surface,
|
|
195
|
+
border: color.border,
|
|
196
|
+
solid: color.solid,
|
|
197
|
+
onSolid: color.onSolid
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
//#endregion
|
|
201
|
+
//#region src/components/tag/variables/declarations.ts
|
|
202
|
+
/**
|
|
203
|
+
* Emits direct tag-to-CSS projections for the theme and Token atlas.
|
|
204
|
+
* @param tokens - Tag configuration.
|
|
205
|
+
* @returns Component variable declarations.
|
|
206
|
+
*/
|
|
207
|
+
function createTagCssVariables(tokens) {
|
|
208
|
+
const variables = {
|
|
209
|
+
"--qk-tag-padding-inline": tokens.paddingInline,
|
|
210
|
+
"--qk-tag-padding-block": tokens.paddingBlock,
|
|
211
|
+
"--qk-tag-gap": tokens.gap,
|
|
212
|
+
"--qk-tag-radius": tokens.radius,
|
|
213
|
+
"--qk-tag-border-width": tokens.borderWidth
|
|
214
|
+
};
|
|
215
|
+
for (const [family, roles] of Object.entries(tokens.color)) for (const role of [
|
|
216
|
+
"text",
|
|
217
|
+
"surface",
|
|
218
|
+
"border",
|
|
219
|
+
"solid",
|
|
220
|
+
"onSolid"
|
|
221
|
+
]) variables[`--qk-tag-${family}-${role === "onSolid" ? "on-solid" : role}`] = roles[role];
|
|
222
|
+
return Object.freeze(variables);
|
|
223
|
+
}
|
|
224
|
+
//#endregion
|
|
225
|
+
//#region src/components/badge/create.ts
|
|
226
|
+
/**
|
|
227
|
+
* Maps notification markers to existing semantic colors, without a separate palette.
|
|
228
|
+
* @param theme - Active semantic theme.
|
|
229
|
+
* @returns Badge color and geometry configuration.
|
|
230
|
+
*/
|
|
231
|
+
function createBadgeTokens(theme) {
|
|
232
|
+
const color = theme.color;
|
|
233
|
+
return Object.freeze({
|
|
234
|
+
paddingInline: theme.spacing.inlineTight,
|
|
235
|
+
dotSize: theme.spacing.inline,
|
|
236
|
+
size: {
|
|
237
|
+
xs: {
|
|
238
|
+
height: `calc(${theme.typography.helper.fontSize} * ${theme.typography.helper.lineHeight})`,
|
|
239
|
+
fontSize: theme.typography.helper.fontSize
|
|
240
|
+
},
|
|
241
|
+
sm: {
|
|
242
|
+
height: `calc(${theme.typography.compact.fontSize} * ${theme.typography.compact.lineHeight})`,
|
|
243
|
+
fontSize: theme.typography.helper.fontSize
|
|
244
|
+
},
|
|
245
|
+
md: {
|
|
246
|
+
height: `calc(${theme.typography.body.fontSize} * ${theme.typography.body.lineHeight})`,
|
|
247
|
+
fontSize: theme.typography.compact.fontSize
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
radius: theme.radius.pill,
|
|
251
|
+
borderWidth: theme.borderWidth.default,
|
|
252
|
+
color: {
|
|
253
|
+
neutral: {
|
|
254
|
+
text: color.text.secondary,
|
|
255
|
+
surface: color.surface.subtle,
|
|
256
|
+
border: color.border.default,
|
|
257
|
+
solid: color.surface.inverse,
|
|
258
|
+
onSolid: color.text.inverse
|
|
259
|
+
},
|
|
260
|
+
primary: {
|
|
261
|
+
text: color.action.text,
|
|
262
|
+
surface: color.action.soft,
|
|
263
|
+
border: color.action.primary,
|
|
264
|
+
solid: color.action.primary,
|
|
265
|
+
onSolid: color.action.foreground
|
|
266
|
+
},
|
|
267
|
+
info: feedback(color.info),
|
|
268
|
+
success: feedback(color.success),
|
|
269
|
+
warning: feedback(color.warning),
|
|
270
|
+
danger: feedback(color.danger)
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Selects only the five static badge roles from a feedback family.
|
|
276
|
+
* @param color - Existing feedback semantics.
|
|
277
|
+
* @returns The Badge color contract, without unrelated interaction states.
|
|
278
|
+
*/
|
|
279
|
+
function feedback(color) {
|
|
280
|
+
return {
|
|
281
|
+
text: color.text,
|
|
282
|
+
surface: color.surface,
|
|
283
|
+
border: color.border,
|
|
284
|
+
solid: color.solid,
|
|
285
|
+
onSolid: color.onSolid
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
//#endregion
|
|
289
|
+
//#region src/components/badge/variables/declarations.ts
|
|
290
|
+
/**
|
|
291
|
+
* Emits direct badge-to-CSS projections for the theme and Token atlas.
|
|
292
|
+
* @param tokens - Badge configuration.
|
|
293
|
+
* @returns Component variable declarations.
|
|
294
|
+
*/
|
|
295
|
+
function createBadgeCssVariables(tokens) {
|
|
296
|
+
const variables = {
|
|
297
|
+
"--qk-badge-padding-inline": tokens.paddingInline,
|
|
298
|
+
"--qk-badge-dot-size": tokens.dotSize,
|
|
299
|
+
"--qk-badge-radius": tokens.radius,
|
|
300
|
+
"--qk-badge-border-width": tokens.borderWidth
|
|
301
|
+
};
|
|
302
|
+
for (const [size, roles] of Object.entries(tokens.size)) {
|
|
303
|
+
variables[`--qk-badge-${size}-height`] = roles.height;
|
|
304
|
+
variables[`--qk-badge-${size}-font-size`] = roles.fontSize;
|
|
305
|
+
}
|
|
306
|
+
for (const [family, roles] of Object.entries(tokens.color)) for (const role of [
|
|
307
|
+
"text",
|
|
308
|
+
"surface",
|
|
309
|
+
"border",
|
|
310
|
+
"solid",
|
|
311
|
+
"onSolid"
|
|
312
|
+
]) variables[`--qk-badge-${family}-${role === "onSolid" ? "on-solid" : role}`] = roles[role];
|
|
313
|
+
return Object.freeze(variables);
|
|
314
|
+
}
|
|
315
|
+
//#endregion
|
|
316
|
+
//#region src/components/table/create.ts
|
|
317
|
+
/**
|
|
318
|
+
* Derives table roles without introducing a second palette or row-height scale.
|
|
319
|
+
* @param theme - Current semantic theme.
|
|
320
|
+
* @returns Table display tokens.
|
|
321
|
+
*/
|
|
322
|
+
function createTableTokens(theme) {
|
|
323
|
+
return Object.freeze({
|
|
324
|
+
foreground: theme.color.text.primary,
|
|
325
|
+
mutedForeground: theme.color.text.secondary,
|
|
326
|
+
headerBackground: theme.color.surface.page,
|
|
327
|
+
currentBackground: theme.color.surface.selected,
|
|
328
|
+
borderColor: theme.color.border.subtle,
|
|
329
|
+
borderWidth: theme.borderWidth.default,
|
|
330
|
+
compactPadding: theme.spacing.inline,
|
|
331
|
+
padding: theme.spacing.surfaceCompact,
|
|
332
|
+
comfortablePadding: theme.spacing.surface
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
//#endregion
|
|
336
|
+
//#region src/components/table/variables/declarations.ts
|
|
337
|
+
/**
|
|
338
|
+
* Projects table configuration into directly traceable CSS variables.
|
|
339
|
+
* @param tokens - Theme-derived table configuration.
|
|
340
|
+
* @returns Explicit variable declarations.
|
|
341
|
+
*/
|
|
342
|
+
function createTableCssVariables(tokens) {
|
|
343
|
+
return Object.freeze({
|
|
344
|
+
"--qk-table-foreground": tokens.foreground,
|
|
345
|
+
"--qk-table-muted-foreground": tokens.mutedForeground,
|
|
346
|
+
"--qk-table-header-background": tokens.headerBackground,
|
|
347
|
+
"--qk-table-current-background": tokens.currentBackground,
|
|
348
|
+
"--qk-table-border-color": tokens.borderColor,
|
|
349
|
+
"--qk-table-border-width": tokens.borderWidth,
|
|
350
|
+
"--qk-table-compact-padding": tokens.compactPadding,
|
|
351
|
+
"--qk-table-padding": tokens.padding,
|
|
352
|
+
"--qk-table-comfortable-padding": tokens.comfortablePadding
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
//#endregion
|
|
356
|
+
//#region src/components/control/modality.ts
|
|
357
|
+
/** Keys that move focus and therefore switch the document to keyboard modality. */
|
|
358
|
+
const navigationKeys = /* @__PURE__ */ new Set([
|
|
359
|
+
"Tab",
|
|
360
|
+
"ArrowUp",
|
|
361
|
+
"ArrowDown",
|
|
362
|
+
"ArrowLeft",
|
|
363
|
+
"ArrowRight",
|
|
364
|
+
"Home",
|
|
365
|
+
"End",
|
|
366
|
+
"PageUp",
|
|
367
|
+
"PageDown",
|
|
368
|
+
"F6"
|
|
369
|
+
]);
|
|
370
|
+
/** Documents whose modality listeners are already installed. */
|
|
371
|
+
const trackedDocuments = /* @__PURE__ */ new WeakSet();
|
|
372
|
+
/**
|
|
373
|
+
* Records the most recent input modality on `<html data-qk-modality>`.
|
|
374
|
+
*
|
|
375
|
+
* The keyboard focus ring reads this attribute so that focus returned programmatically after a
|
|
376
|
+
* pointer interaction (closing a menu, popover or dialog) does not show a ring, even when the
|
|
377
|
+
* browser reports `:focus-visible`. Installation is idempotent per document.
|
|
378
|
+
*
|
|
379
|
+
* @param ownerDocument - Document whose root receives the modality attribute.
|
|
380
|
+
*/
|
|
381
|
+
function trackQuireKitInputModality(ownerDocument) {
|
|
382
|
+
if (trackedDocuments.has(ownerDocument)) return;
|
|
383
|
+
trackedDocuments.add(ownerDocument);
|
|
384
|
+
const root = ownerDocument.documentElement;
|
|
385
|
+
const apply = (modality) => {
|
|
386
|
+
if (root.dataset.qkModality !== modality) root.dataset.qkModality = modality;
|
|
387
|
+
};
|
|
388
|
+
if (root.dataset.qkModality === void 0 && ownerDocument.activeElement !== ownerDocument.body) apply(ownerDocument.activeElement?.matches(":focus-visible") ? "keyboard" : "pointer");
|
|
389
|
+
ownerDocument.addEventListener("pointerdown", () => apply("pointer"), {
|
|
390
|
+
capture: true,
|
|
391
|
+
passive: true
|
|
392
|
+
});
|
|
393
|
+
ownerDocument.addEventListener("keydown", (event) => {
|
|
394
|
+
if (navigationKeys.has(event.key) && !event.metaKey && !event.ctrlKey) apply("keyboard");
|
|
395
|
+
}, {
|
|
396
|
+
capture: true,
|
|
397
|
+
passive: true
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
//#endregion
|
|
401
|
+
//#region src/components/control/sizes.ts
|
|
402
|
+
/** 将公开 size 映射到已有语义 token,所有同排控件共用这份对应关系。 */
|
|
403
|
+
const quireKitControlSizes = Object.freeze({
|
|
404
|
+
xs: Object.freeze({
|
|
405
|
+
height: "compact",
|
|
406
|
+
typography: "compact"
|
|
407
|
+
}),
|
|
408
|
+
sm: Object.freeze({
|
|
409
|
+
height: "default",
|
|
410
|
+
typography: "compact"
|
|
411
|
+
}),
|
|
412
|
+
md: Object.freeze({
|
|
413
|
+
height: "regular",
|
|
414
|
+
typography: "control"
|
|
415
|
+
}),
|
|
416
|
+
lg: Object.freeze({
|
|
417
|
+
height: "comfortable",
|
|
418
|
+
typography: "control"
|
|
419
|
+
}),
|
|
420
|
+
xl: Object.freeze({
|
|
421
|
+
height: "large",
|
|
422
|
+
typography: "control"
|
|
423
|
+
})
|
|
424
|
+
});
|
|
425
|
+
//#endregion
|
|
426
|
+
//#region src/components/button/create.ts
|
|
427
|
+
/**
|
|
428
|
+
* Derives the approved Button and IconButton contract from semantic tokens.
|
|
429
|
+
*
|
|
430
|
+
* @param theme - Complete semantic theme selected by the host.
|
|
431
|
+
* @returns Immutable Button and IconButton component tokens.
|
|
432
|
+
*/
|
|
433
|
+
function createButtonTokens(theme) {
|
|
434
|
+
const color = theme.color;
|
|
435
|
+
return Object.freeze({
|
|
436
|
+
fontFamily: theme.typography.control.fontFamily,
|
|
437
|
+
fontWeight: theme.typography.body.fontWeight,
|
|
438
|
+
letterSpacing: theme.typography.control.letterSpacing,
|
|
439
|
+
size: Object.freeze({
|
|
440
|
+
xs: Object.freeze({
|
|
441
|
+
height: theme.control[quireKitControlSizes.xs.height],
|
|
442
|
+
paddingInline: theme.spacing.inline,
|
|
443
|
+
gap: theme.spacing.inlineTight,
|
|
444
|
+
iconSize: theme.control.icon,
|
|
445
|
+
radius: theme.radius.control,
|
|
446
|
+
fontSize: theme.typography[quireKitControlSizes.xs.typography].fontSize,
|
|
447
|
+
lineHeight: theme.typography[quireKitControlSizes.xs.typography].lineHeight
|
|
448
|
+
}),
|
|
449
|
+
sm: Object.freeze({
|
|
450
|
+
height: theme.control[quireKitControlSizes.sm.height],
|
|
451
|
+
paddingInline: theme.spacing.surfaceCompact,
|
|
452
|
+
gap: theme.spacing.inlineTight,
|
|
453
|
+
iconSize: theme.control.icon,
|
|
454
|
+
radius: theme.radius.control,
|
|
455
|
+
fontSize: theme.typography[quireKitControlSizes.sm.typography].fontSize,
|
|
456
|
+
lineHeight: theme.typography[quireKitControlSizes.sm.typography].lineHeight
|
|
457
|
+
}),
|
|
458
|
+
md: Object.freeze({
|
|
459
|
+
height: theme.control[quireKitControlSizes.md.height],
|
|
460
|
+
paddingInline: theme.spacing.surfaceCompact,
|
|
461
|
+
gap: theme.spacing.inline,
|
|
462
|
+
iconSize: theme.control.icon,
|
|
463
|
+
radius: theme.radius.control,
|
|
464
|
+
fontSize: theme.typography[quireKitControlSizes.md.typography].fontSize,
|
|
465
|
+
lineHeight: theme.typography[quireKitControlSizes.md.typography].lineHeight
|
|
466
|
+
}),
|
|
467
|
+
lg: Object.freeze({
|
|
468
|
+
height: theme.control[quireKitControlSizes.lg.height],
|
|
469
|
+
paddingInline: theme.spacing.surface,
|
|
470
|
+
gap: theme.spacing.inline,
|
|
471
|
+
iconSize: theme.control.icon,
|
|
472
|
+
radius: theme.radius.group,
|
|
473
|
+
fontSize: theme.typography[quireKitControlSizes.lg.typography].fontSize,
|
|
474
|
+
lineHeight: theme.typography[quireKitControlSizes.lg.typography].lineHeight
|
|
475
|
+
}),
|
|
476
|
+
xl: Object.freeze({
|
|
477
|
+
height: theme.control[quireKitControlSizes.xl.height],
|
|
478
|
+
paddingInline: theme.spacing.surface,
|
|
479
|
+
gap: theme.spacing.inline,
|
|
480
|
+
iconSize: theme.control.iconLarge,
|
|
481
|
+
radius: theme.radius.group,
|
|
482
|
+
fontSize: theme.typography[quireKitControlSizes.xl.typography].fontSize,
|
|
483
|
+
lineHeight: theme.typography[quireKitControlSizes.xl.typography].lineHeight
|
|
484
|
+
})
|
|
485
|
+
}),
|
|
486
|
+
color: Object.freeze({
|
|
487
|
+
neutral: Object.freeze({
|
|
488
|
+
foreground: color.text.secondary,
|
|
489
|
+
solidForeground: color.text.inverse,
|
|
490
|
+
solidBackground: color.surface.inverse,
|
|
491
|
+
solidHoverBackground: theme.scales.neutral[10],
|
|
492
|
+
solidPressedBackground: theme.scales.neutral[theme.scheme === "light" ? 11 : 9],
|
|
493
|
+
softBackground: theme.scheme === "light" ? color.surface.hover : color.surface.subtle,
|
|
494
|
+
softHoverBackground: theme.color.surface.selected,
|
|
495
|
+
softPressedBackground: color.surface.pressed,
|
|
496
|
+
borderColor: color.border.default
|
|
497
|
+
}),
|
|
498
|
+
primary: Object.freeze({
|
|
499
|
+
foreground: color.action.text,
|
|
500
|
+
solidForeground: color.action.foreground,
|
|
501
|
+
solidBackground: color.action.primary,
|
|
502
|
+
...color.action.primary === theme.scales.neutral[11] ? {
|
|
503
|
+
solidHoverBackground: color.action.hover,
|
|
504
|
+
solidPressedBackground: color.action.pressed
|
|
505
|
+
} : solidBackgrounds(color.action.foreground, theme, theme.scales.primary),
|
|
506
|
+
softBackground: color.action.soft,
|
|
507
|
+
softHoverBackground: color.action.softHover,
|
|
508
|
+
softPressedBackground: color.action.softPressed,
|
|
509
|
+
borderColor: color.action.primary
|
|
510
|
+
}),
|
|
511
|
+
info: feedbackColor(color.info, theme, theme.scales.info),
|
|
512
|
+
success: feedbackColor(color.success, theme, theme.scales.success),
|
|
513
|
+
warning: feedbackColor(color.warning, theme, theme.scales.warning),
|
|
514
|
+
danger: feedbackColor(color.danger, theme, theme.scales.danger)
|
|
515
|
+
}),
|
|
516
|
+
disabled: Object.freeze({
|
|
517
|
+
foreground: color.text.disabled,
|
|
518
|
+
background: color.surface.disabled,
|
|
519
|
+
borderColor: color.border.disabled
|
|
520
|
+
}),
|
|
521
|
+
borderWidth: theme.borderWidth.default,
|
|
522
|
+
focusColor: color.border.focus,
|
|
523
|
+
hoverOpacity: theme.opacity.hover,
|
|
524
|
+
pressedOpacity: theme.opacity.pressed,
|
|
525
|
+
feedbackDuration: theme.motion.feedbackDuration,
|
|
526
|
+
feedbackEasing: theme.motion.standardEasing
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* Maps one semantic feedback family into the common Button color channels.
|
|
531
|
+
*
|
|
532
|
+
* @param color - Semantic feedback roles compiled from one registered base source.
|
|
533
|
+
* @param theme - Theme carrying the interaction strengths.
|
|
534
|
+
* @param scale - Existing eleven-step family palette.
|
|
535
|
+
* @returns Immutable Button color channels shared by every visual variant.
|
|
536
|
+
*/
|
|
537
|
+
function feedbackColor(color, theme, scale) {
|
|
538
|
+
return Object.freeze({
|
|
539
|
+
foreground: color.text,
|
|
540
|
+
solidForeground: color.onSolid,
|
|
541
|
+
solidBackground: color.solid,
|
|
542
|
+
...solidBackgrounds(color.onSolid, theme, scale),
|
|
543
|
+
softBackground: color.surface,
|
|
544
|
+
softHoverBackground: color.hoverSurface,
|
|
545
|
+
softPressedBackground: color.pressedSurface,
|
|
546
|
+
borderColor: color.border
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
/**
|
|
550
|
+
* Selects the regular scheme direction when labels remain readable.
|
|
551
|
+
* @param foreground - Fixed solid label color.
|
|
552
|
+
* @param theme - Owning light or dark scheme.
|
|
553
|
+
* @param scale - Existing eleven-step family palette.
|
|
554
|
+
* @returns Palette hover and pressed fills without generating new colors.
|
|
555
|
+
*/
|
|
556
|
+
function solidBackgrounds(foreground, theme, scale) {
|
|
557
|
+
const regular = theme.scheme === "light" ? [7, 8] : [5, 4];
|
|
558
|
+
const alternate = theme.scheme === "light" ? [5, 4] : [7, 8];
|
|
559
|
+
const label = parseQuireHexColor(foreground);
|
|
560
|
+
const steps = regular.every((step) => quireContrastRatio(label, parseQuireHexColor(scale[step])) >= 4.5) ? regular : alternate;
|
|
561
|
+
return {
|
|
562
|
+
solidHoverBackground: scale[steps[0]],
|
|
563
|
+
solidPressedBackground: scale[steps[1]]
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
//#endregion
|
|
567
|
+
//#region src/components/button/variables/names.ts
|
|
568
|
+
/** Explicit CSS-variable names for the approved Button component contract. */
|
|
569
|
+
const buttonCssVariableNames = Object.freeze({
|
|
570
|
+
typography: Object.freeze({
|
|
571
|
+
fontFamily: "--qk-button-font-family",
|
|
572
|
+
fontWeight: "--qk-button-font-weight",
|
|
573
|
+
letterSpacing: "--qk-button-letter-spacing"
|
|
574
|
+
}),
|
|
575
|
+
size: Object.freeze({
|
|
576
|
+
xs: sizeNames$1("xs"),
|
|
577
|
+
sm: sizeNames$1("sm"),
|
|
578
|
+
md: sizeNames$1("md"),
|
|
579
|
+
lg: sizeNames$1("lg"),
|
|
580
|
+
xl: sizeNames$1("xl")
|
|
581
|
+
}),
|
|
582
|
+
color: Object.freeze({
|
|
583
|
+
neutral: colorNames("neutral"),
|
|
584
|
+
primary: colorNames("primary"),
|
|
585
|
+
info: colorNames("info"),
|
|
586
|
+
success: colorNames("success"),
|
|
587
|
+
warning: colorNames("warning"),
|
|
588
|
+
danger: colorNames("danger")
|
|
589
|
+
}),
|
|
590
|
+
disabled: Object.freeze({
|
|
591
|
+
foreground: "--qk-button-disabled-foreground",
|
|
592
|
+
background: "--qk-button-disabled-background",
|
|
593
|
+
borderColor: "--qk-button-disabled-border-color"
|
|
594
|
+
}),
|
|
595
|
+
borderWidth: "--qk-button-border-width",
|
|
596
|
+
focusColor: "--qk-button-focus-color",
|
|
597
|
+
hoverOpacity: "--qk-button-hover-opacity",
|
|
598
|
+
pressedOpacity: "--qk-button-pressed-opacity",
|
|
599
|
+
feedbackDuration: "--qk-button-feedback-duration",
|
|
600
|
+
feedbackEasing: "--qk-button-feedback-easing"
|
|
601
|
+
});
|
|
602
|
+
/**
|
|
603
|
+
* Declares the fixed CSS-variable fields owned by one public size.
|
|
604
|
+
*
|
|
605
|
+
* @param size - Public size name included in every declared variable.
|
|
606
|
+
* @returns Explicit variable-name group for that size.
|
|
607
|
+
*/
|
|
608
|
+
function sizeNames$1(size) {
|
|
609
|
+
return Object.freeze({
|
|
610
|
+
height: `--qk-button-${size}-height`,
|
|
611
|
+
paddingInline: `--qk-button-${size}-padding-inline`,
|
|
612
|
+
gap: `--qk-button-${size}-gap`,
|
|
613
|
+
iconSize: `--qk-button-${size}-icon-size`,
|
|
614
|
+
radius: `--qk-button-${size}-radius`,
|
|
615
|
+
fontSize: `--qk-button-${size}-font-size`,
|
|
616
|
+
lineHeight: `--qk-button-${size}-line-height`
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
/**
|
|
620
|
+
* Declares the fixed CSS-variable fields owned by one semantic color family.
|
|
621
|
+
*
|
|
622
|
+
* @param color - Public semantic color included in every declared variable.
|
|
623
|
+
* @returns Explicit variable-name group for that color.
|
|
624
|
+
*/
|
|
625
|
+
function colorNames(color) {
|
|
626
|
+
return Object.freeze({
|
|
627
|
+
foreground: `--qk-button-${color}-foreground`,
|
|
628
|
+
solidForeground: `--qk-button-${color}-solid-foreground`,
|
|
629
|
+
solidBackground: `--qk-button-${color}-solid-background`,
|
|
630
|
+
solidHoverBackground: `--qk-button-${color}-solid-hover-background`,
|
|
631
|
+
solidPressedBackground: `--qk-button-${color}-solid-pressed-background`,
|
|
632
|
+
softBackground: `--qk-button-${color}-soft-background`,
|
|
633
|
+
softHoverBackground: `--qk-button-${color}-soft-hover-background`,
|
|
634
|
+
softPressedBackground: `--qk-button-${color}-soft-pressed-background`,
|
|
635
|
+
borderColor: `--qk-button-${color}-border-color`
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
//#endregion
|
|
639
|
+
//#region src/components/button/variables/declarations.ts
|
|
640
|
+
/**
|
|
641
|
+
* Projects one Button token contract to its explicit CSS variables.
|
|
642
|
+
*
|
|
643
|
+
* @param tokens - Approved Button component tokens.
|
|
644
|
+
* @returns Immutable flat declaration map.
|
|
645
|
+
*/
|
|
646
|
+
function createButtonCssVariables(tokens) {
|
|
647
|
+
const name = buttonCssVariableNames;
|
|
648
|
+
return Object.freeze({
|
|
649
|
+
[name.typography.fontFamily]: tokens.fontFamily,
|
|
650
|
+
[name.typography.fontWeight]: String(tokens.fontWeight),
|
|
651
|
+
[name.typography.letterSpacing]: tokens.letterSpacing,
|
|
652
|
+
...sizeDeclarations$1(name.size.xs, tokens.size.xs),
|
|
653
|
+
...sizeDeclarations$1(name.size.sm, tokens.size.sm),
|
|
654
|
+
...sizeDeclarations$1(name.size.md, tokens.size.md),
|
|
655
|
+
...sizeDeclarations$1(name.size.lg, tokens.size.lg),
|
|
656
|
+
...sizeDeclarations$1(name.size.xl, tokens.size.xl),
|
|
657
|
+
...colorDeclarations(name.color.neutral, tokens.color.neutral),
|
|
658
|
+
...colorDeclarations(name.color.primary, tokens.color.primary),
|
|
659
|
+
...colorDeclarations(name.color.info, tokens.color.info),
|
|
660
|
+
...colorDeclarations(name.color.success, tokens.color.success),
|
|
661
|
+
...colorDeclarations(name.color.warning, tokens.color.warning),
|
|
662
|
+
...colorDeclarations(name.color.danger, tokens.color.danger),
|
|
663
|
+
[name.disabled.foreground]: tokens.disabled.foreground,
|
|
664
|
+
[name.disabled.background]: tokens.disabled.background,
|
|
665
|
+
[name.disabled.borderColor]: tokens.disabled.borderColor,
|
|
666
|
+
[name.borderWidth]: tokens.borderWidth,
|
|
667
|
+
[name.focusColor]: tokens.focusColor,
|
|
668
|
+
[name.hoverOpacity]: String(tokens.hoverOpacity),
|
|
669
|
+
[name.pressedOpacity]: String(tokens.pressedOpacity),
|
|
670
|
+
[name.feedbackDuration]: tokens.feedbackDuration,
|
|
671
|
+
[name.feedbackEasing]: tokens.feedbackEasing
|
|
672
|
+
});
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* Pairs one explicit size-variable group with matching component values.
|
|
676
|
+
*
|
|
677
|
+
* @param names - Explicit variable names for one public size.
|
|
678
|
+
* @param value - Matching component-size values.
|
|
679
|
+
* @returns Flat CSS declaration entries.
|
|
680
|
+
*/
|
|
681
|
+
function sizeDeclarations$1(names, value) {
|
|
682
|
+
return {
|
|
683
|
+
[names.height]: value.height,
|
|
684
|
+
[names.paddingInline]: value.paddingInline,
|
|
685
|
+
[names.gap]: value.gap,
|
|
686
|
+
[names.iconSize]: value.iconSize,
|
|
687
|
+
[names.radius]: value.radius,
|
|
688
|
+
[names.fontSize]: value.fontSize,
|
|
689
|
+
[names.lineHeight]: value.lineHeight
|
|
690
|
+
};
|
|
691
|
+
}
|
|
692
|
+
/**
|
|
693
|
+
* Pairs one explicit color-variable group with matching component values.
|
|
694
|
+
*
|
|
695
|
+
* @param names - Explicit variable names for one semantic color.
|
|
696
|
+
* @param value - Matching component-color values.
|
|
697
|
+
* @returns Flat CSS declaration entries.
|
|
698
|
+
*/
|
|
699
|
+
function colorDeclarations(names, value) {
|
|
700
|
+
return {
|
|
701
|
+
[names.foreground]: value.foreground,
|
|
702
|
+
[names.solidForeground]: value.solidForeground,
|
|
703
|
+
[names.solidBackground]: value.solidBackground,
|
|
704
|
+
[names.solidHoverBackground]: value.solidHoverBackground,
|
|
705
|
+
[names.solidPressedBackground]: value.solidPressedBackground,
|
|
706
|
+
[names.softBackground]: value.softBackground,
|
|
707
|
+
[names.softHoverBackground]: value.softHoverBackground,
|
|
708
|
+
[names.softPressedBackground]: value.softPressedBackground,
|
|
709
|
+
[names.borderColor]: value.borderColor
|
|
710
|
+
};
|
|
711
|
+
}
|
|
712
|
+
//#endregion
|
|
713
|
+
//#region src/components/menu/create.ts
|
|
714
|
+
/**
|
|
715
|
+
* Derives Menu component tokens from the approved semantic theme.
|
|
716
|
+
*
|
|
717
|
+
* @param theme - Complete semantic theme selected by the host.
|
|
718
|
+
* @returns Immutable Menu component-token contract.
|
|
719
|
+
*/
|
|
720
|
+
function createMenuTokens(theme) {
|
|
721
|
+
return Object.freeze({
|
|
722
|
+
typography: Object.freeze({
|
|
723
|
+
fontFamily: theme.typography.compact.fontFamily,
|
|
724
|
+
fontSize: theme.typography.compact.fontSize,
|
|
725
|
+
lineHeight: theme.typography.compact.lineHeight,
|
|
726
|
+
fontWeight: theme.typography.control.fontWeight,
|
|
727
|
+
letterSpacing: theme.typography.compact.letterSpacing
|
|
728
|
+
}),
|
|
729
|
+
metadataTypography: Object.freeze({
|
|
730
|
+
fontFamily: theme.typography.code.fontFamily,
|
|
731
|
+
fontSize: theme.typography.helper.fontSize,
|
|
732
|
+
lineHeight: theme.typography.helper.lineHeight
|
|
733
|
+
}),
|
|
734
|
+
color: Object.freeze({
|
|
735
|
+
surface: theme.color.surface.overlay,
|
|
736
|
+
border: theme.color.border.subtle,
|
|
737
|
+
separator: theme.color.border.subtle,
|
|
738
|
+
foreground: theme.color.text.secondary,
|
|
739
|
+
highlightedForeground: theme.color.text.primary,
|
|
740
|
+
highlightedBackground: theme.color.surface.hover,
|
|
741
|
+
checkedBackground: theme.color.surface.selected,
|
|
742
|
+
metadataForeground: theme.color.text.tertiary,
|
|
743
|
+
disabledForeground: theme.color.text.disabled,
|
|
744
|
+
dangerForeground: theme.color.danger.text,
|
|
745
|
+
dangerHighlightedBackground: theme.color.danger.surface
|
|
746
|
+
}),
|
|
747
|
+
geometry: Object.freeze({
|
|
748
|
+
contentWidth: "200px",
|
|
749
|
+
contentPadding: theme.spacing.inlineTight,
|
|
750
|
+
itemHeight: theme.control.regular,
|
|
751
|
+
itemPaddingInline: theme.spacing.surfaceCompact,
|
|
752
|
+
itemGap: theme.spacing.inline,
|
|
753
|
+
iconSize: theme.control.icon,
|
|
754
|
+
overlayRadius: theme.radius.overlay,
|
|
755
|
+
itemRadius: theme.radius.control,
|
|
756
|
+
borderWidth: theme.borderWidth.default,
|
|
757
|
+
separatorWidth: theme.borderWidth.default,
|
|
758
|
+
separatorInset: theme.spacing.inline,
|
|
759
|
+
groupLabelPaddingBlock: theme.spacing.inlineTight,
|
|
760
|
+
groupLabelPaddingInline: theme.spacing.surfaceCompact
|
|
761
|
+
}),
|
|
762
|
+
shadow: theme.elevation.overlay,
|
|
763
|
+
layer: theme.layer.overlay,
|
|
764
|
+
feedbackDuration: theme.motion.feedbackDuration,
|
|
765
|
+
overlayDuration: theme.motion.overlayDuration,
|
|
766
|
+
feedbackEasing: theme.motion.standardEasing,
|
|
767
|
+
enterEasing: theme.motion.enterEasing,
|
|
768
|
+
exitEasing: theme.motion.exitEasing
|
|
769
|
+
});
|
|
770
|
+
}
|
|
771
|
+
//#endregion
|
|
772
|
+
//#region src/components/menu/variables/names.ts
|
|
773
|
+
/** Explicit CSS-variable names for the approved Menu component contract. */
|
|
774
|
+
const menuCssVariableNames = Object.freeze({
|
|
775
|
+
typography: Object.freeze({
|
|
776
|
+
fontFamily: "--qk-menu-font-family",
|
|
777
|
+
fontSize: "--qk-menu-font-size",
|
|
778
|
+
lineHeight: "--qk-menu-line-height",
|
|
779
|
+
fontWeight: "--qk-menu-font-weight",
|
|
780
|
+
letterSpacing: "--qk-menu-letter-spacing"
|
|
781
|
+
}),
|
|
782
|
+
metadataTypography: Object.freeze({
|
|
783
|
+
fontFamily: "--qk-menu-metadata-font-family",
|
|
784
|
+
fontSize: "--qk-menu-metadata-font-size",
|
|
785
|
+
lineHeight: "--qk-menu-metadata-line-height"
|
|
786
|
+
}),
|
|
787
|
+
color: Object.freeze({
|
|
788
|
+
surface: "--qk-menu-surface",
|
|
789
|
+
border: "--qk-menu-border",
|
|
790
|
+
separator: "--qk-menu-separator",
|
|
791
|
+
foreground: "--qk-menu-foreground",
|
|
792
|
+
highlightedForeground: "--qk-menu-highlighted-foreground",
|
|
793
|
+
highlightedBackground: "--qk-menu-highlighted-background",
|
|
794
|
+
checkedBackground: "--qk-menu-checked-background",
|
|
795
|
+
metadataForeground: "--qk-menu-metadata-foreground",
|
|
796
|
+
disabledForeground: "--qk-menu-disabled-foreground",
|
|
797
|
+
dangerForeground: "--qk-menu-danger-foreground",
|
|
798
|
+
dangerHighlightedBackground: "--qk-menu-danger-highlighted-background"
|
|
799
|
+
}),
|
|
800
|
+
geometry: Object.freeze({
|
|
801
|
+
contentWidth: "--qk-menu-content-width",
|
|
802
|
+
contentPadding: "--qk-menu-content-padding",
|
|
803
|
+
itemHeight: "--qk-menu-item-height",
|
|
804
|
+
itemPaddingInline: "--qk-menu-item-padding-inline",
|
|
805
|
+
itemGap: "--qk-menu-item-gap",
|
|
806
|
+
iconSize: "--qk-menu-icon-size",
|
|
807
|
+
overlayRadius: "--qk-menu-overlay-radius",
|
|
808
|
+
itemRadius: "--qk-menu-item-radius",
|
|
809
|
+
borderWidth: "--qk-menu-border-width",
|
|
810
|
+
separatorWidth: "--qk-menu-separator-width",
|
|
811
|
+
separatorInset: "--qk-menu-separator-inset",
|
|
812
|
+
groupLabelPaddingBlock: "--qk-menu-group-label-padding-block",
|
|
813
|
+
groupLabelPaddingInline: "--qk-menu-group-label-padding-inline"
|
|
814
|
+
}),
|
|
815
|
+
shadow: "--qk-menu-shadow",
|
|
816
|
+
layer: "--qk-menu-layer",
|
|
817
|
+
feedbackDuration: "--qk-menu-feedback-duration",
|
|
818
|
+
overlayDuration: "--qk-menu-overlay-duration",
|
|
819
|
+
feedbackEasing: "--qk-menu-feedback-easing",
|
|
820
|
+
enterEasing: "--qk-menu-enter-easing",
|
|
821
|
+
exitEasing: "--qk-menu-exit-easing"
|
|
822
|
+
});
|
|
823
|
+
//#endregion
|
|
824
|
+
//#region src/components/menu/variables/declarations.ts
|
|
825
|
+
/**
|
|
826
|
+
* Projects one Menu token contract to its explicit CSS variables.
|
|
827
|
+
*
|
|
828
|
+
* @param tokens - Approved Menu component tokens.
|
|
829
|
+
* @returns Immutable flat declaration map.
|
|
830
|
+
*/
|
|
831
|
+
function createMenuCssVariables(tokens) {
|
|
832
|
+
const name = menuCssVariableNames;
|
|
833
|
+
return Object.freeze({
|
|
834
|
+
...flatDeclarations$1(name.typography, tokens.typography),
|
|
835
|
+
...flatDeclarations$1(name.metadataTypography, tokens.metadataTypography),
|
|
836
|
+
...flatDeclarations$1(name.color, tokens.color),
|
|
837
|
+
...flatDeclarations$1(name.geometry, tokens.geometry),
|
|
838
|
+
[name.shadow]: tokens.shadow,
|
|
839
|
+
[name.layer]: String(tokens.layer),
|
|
840
|
+
[name.feedbackDuration]: tokens.feedbackDuration,
|
|
841
|
+
[name.overlayDuration]: tokens.overlayDuration,
|
|
842
|
+
[name.feedbackEasing]: tokens.feedbackEasing,
|
|
843
|
+
[name.enterEasing]: tokens.enterEasing,
|
|
844
|
+
[name.exitEasing]: tokens.exitEasing
|
|
845
|
+
});
|
|
846
|
+
}
|
|
847
|
+
/**
|
|
848
|
+
* Pairs one explicit variable-name group with matching component values.
|
|
849
|
+
*
|
|
850
|
+
* @param names - Explicit variable names.
|
|
851
|
+
* @param values - Matching component-token values.
|
|
852
|
+
* @returns Flat CSS declaration entries.
|
|
853
|
+
*/
|
|
854
|
+
function flatDeclarations$1(names, values) {
|
|
855
|
+
return Object.fromEntries(Object.entries(values).map(([key, value]) => [names[key], String(value)]));
|
|
856
|
+
}
|
|
857
|
+
//#endregion
|
|
858
|
+
//#region src/components/menu/variables/references.ts
|
|
859
|
+
/** CSS-reference projection of every Menu component token. */
|
|
860
|
+
const menuVariableReferences = Object.freeze({
|
|
861
|
+
typography: mapReferences(menuCssVariableNames.typography),
|
|
862
|
+
metadataTypography: mapReferences(menuCssVariableNames.metadataTypography),
|
|
863
|
+
color: mapReferences(menuCssVariableNames.color),
|
|
864
|
+
geometry: mapReferences(menuCssVariableNames.geometry),
|
|
865
|
+
shadow: reference(menuCssVariableNames.shadow),
|
|
866
|
+
layer: reference(menuCssVariableNames.layer),
|
|
867
|
+
feedbackDuration: reference(menuCssVariableNames.feedbackDuration),
|
|
868
|
+
overlayDuration: reference(menuCssVariableNames.overlayDuration),
|
|
869
|
+
feedbackEasing: reference(menuCssVariableNames.feedbackEasing),
|
|
870
|
+
enterEasing: reference(menuCssVariableNames.enterEasing),
|
|
871
|
+
exitEasing: reference(menuCssVariableNames.exitEasing)
|
|
872
|
+
});
|
|
873
|
+
/**
|
|
874
|
+
* Creates a CSS reference to an explicitly declared component variable.
|
|
875
|
+
*
|
|
876
|
+
* @param name - Declared CSS custom-property name.
|
|
877
|
+
* @returns CSS variable reference.
|
|
878
|
+
*/
|
|
879
|
+
function reference(name) {
|
|
880
|
+
return `var(${name})`;
|
|
881
|
+
}
|
|
882
|
+
/**
|
|
883
|
+
* Projects one explicit component-variable group to CSS references.
|
|
884
|
+
*
|
|
885
|
+
* @param names - Approved variable names.
|
|
886
|
+
* @returns Same-shaped CSS references.
|
|
887
|
+
*/
|
|
888
|
+
function mapReferences(names) {
|
|
889
|
+
return Object.freeze(Object.fromEntries(Object.entries(names).map(([key, name]) => [key, reference(name)])));
|
|
890
|
+
}
|
|
891
|
+
//#endregion
|
|
892
|
+
//#region src/components/popover/create.ts
|
|
893
|
+
/**
|
|
894
|
+
* 从完整语义主题派生 Popover 组件 token。
|
|
895
|
+
*
|
|
896
|
+
* @param theme - 宿主已经解析完成的语义主题。
|
|
897
|
+
* @returns 不可变的 Popover 组件 token。
|
|
898
|
+
*/
|
|
899
|
+
function createPopoverTokens(theme) {
|
|
900
|
+
return Object.freeze({
|
|
901
|
+
background: theme.color.surface.overlay,
|
|
902
|
+
foreground: theme.color.text.primary,
|
|
903
|
+
mutedForeground: theme.color.text.secondary,
|
|
904
|
+
borderColor: theme.color.border.default,
|
|
905
|
+
borderWidth: theme.borderWidth.default,
|
|
906
|
+
radius: theme.radius.overlay,
|
|
907
|
+
shadow: theme.elevation.overlay,
|
|
908
|
+
padding: theme.spacing.surface,
|
|
909
|
+
gap: theme.spacing.inline,
|
|
910
|
+
arrowSize: theme.spacing.inline,
|
|
911
|
+
closeSize: theme.control.default,
|
|
912
|
+
closeRadius: theme.radius.control,
|
|
913
|
+
closeHoverBackground: theme.color.surface.hover,
|
|
914
|
+
closeForeground: theme.color.icon.secondary,
|
|
915
|
+
focusColor: theme.color.border.focus,
|
|
916
|
+
fontFamily: theme.typography.body.fontFamily,
|
|
917
|
+
title: Object.freeze({
|
|
918
|
+
fontSize: theme.typography.heading.fontSize,
|
|
919
|
+
lineHeight: theme.typography.heading.lineHeight,
|
|
920
|
+
fontWeight: theme.typography.heading.fontWeight,
|
|
921
|
+
letterSpacing: theme.typography.heading.letterSpacing
|
|
922
|
+
}),
|
|
923
|
+
body: Object.freeze({
|
|
924
|
+
fontSize: theme.typography.body.fontSize,
|
|
925
|
+
lineHeight: theme.typography.body.lineHeight
|
|
926
|
+
}),
|
|
927
|
+
motionDuration: theme.motion.overlayDuration,
|
|
928
|
+
enterEasing: theme.motion.enterEasing,
|
|
929
|
+
exitEasing: theme.motion.exitEasing,
|
|
930
|
+
layer: theme.layer.overlay
|
|
931
|
+
});
|
|
932
|
+
}
|
|
933
|
+
//#endregion
|
|
934
|
+
//#region src/components/popover/variables/names.ts
|
|
935
|
+
/** Popover 组件合同的显式 CSS 变量名。 */
|
|
936
|
+
const popoverCssVariableNames = Object.freeze({
|
|
937
|
+
background: "--qk-popover-background",
|
|
938
|
+
foreground: "--qk-popover-foreground",
|
|
939
|
+
mutedForeground: "--qk-popover-muted-foreground",
|
|
940
|
+
borderColor: "--qk-popover-border-color",
|
|
941
|
+
borderWidth: "--qk-popover-border-width",
|
|
942
|
+
radius: "--qk-popover-radius",
|
|
943
|
+
shadow: "--qk-popover-shadow",
|
|
944
|
+
padding: "--qk-popover-padding",
|
|
945
|
+
gap: "--qk-popover-gap",
|
|
946
|
+
arrowSize: "--qk-popover-arrow-size",
|
|
947
|
+
closeSize: "--qk-popover-close-size",
|
|
948
|
+
closeRadius: "--qk-popover-close-radius",
|
|
949
|
+
closeHoverBackground: "--qk-popover-close-hover-background",
|
|
950
|
+
closeForeground: "--qk-popover-close-foreground",
|
|
951
|
+
focusColor: "--qk-popover-focus-color",
|
|
952
|
+
fontFamily: "--qk-popover-font-family",
|
|
953
|
+
title: Object.freeze({
|
|
954
|
+
fontSize: "--qk-popover-title-font-size",
|
|
955
|
+
lineHeight: "--qk-popover-title-line-height",
|
|
956
|
+
fontWeight: "--qk-popover-title-font-weight",
|
|
957
|
+
letterSpacing: "--qk-popover-title-letter-spacing"
|
|
958
|
+
}),
|
|
959
|
+
body: Object.freeze({
|
|
960
|
+
fontSize: "--qk-popover-body-font-size",
|
|
961
|
+
lineHeight: "--qk-popover-body-line-height"
|
|
962
|
+
}),
|
|
963
|
+
motionDuration: "--qk-popover-motion-duration",
|
|
964
|
+
enterEasing: "--qk-popover-enter-easing",
|
|
965
|
+
exitEasing: "--qk-popover-exit-easing",
|
|
966
|
+
layer: "--qk-popover-layer"
|
|
967
|
+
});
|
|
968
|
+
//#endregion
|
|
969
|
+
//#region src/components/popover/variables/declarations.ts
|
|
970
|
+
/**
|
|
971
|
+
* 将 Popover 组件 token 投影为显式 CSS 变量声明。
|
|
972
|
+
*
|
|
973
|
+
* @param tokens - 已批准的 Popover 组件 token。
|
|
974
|
+
* @returns 不可变的扁平 CSS 变量声明。
|
|
975
|
+
*/
|
|
976
|
+
function createPopoverCssVariables(tokens) {
|
|
977
|
+
const name = popoverCssVariableNames;
|
|
978
|
+
return Object.freeze({
|
|
979
|
+
[name.background]: tokens.background,
|
|
980
|
+
[name.foreground]: tokens.foreground,
|
|
981
|
+
[name.mutedForeground]: tokens.mutedForeground,
|
|
982
|
+
[name.borderColor]: tokens.borderColor,
|
|
983
|
+
[name.borderWidth]: tokens.borderWidth,
|
|
984
|
+
[name.radius]: tokens.radius,
|
|
985
|
+
[name.shadow]: tokens.shadow,
|
|
986
|
+
[name.padding]: tokens.padding,
|
|
987
|
+
[name.gap]: tokens.gap,
|
|
988
|
+
[name.arrowSize]: tokens.arrowSize,
|
|
989
|
+
[name.closeSize]: tokens.closeSize,
|
|
990
|
+
[name.closeRadius]: tokens.closeRadius,
|
|
991
|
+
[name.closeHoverBackground]: tokens.closeHoverBackground,
|
|
992
|
+
[name.closeForeground]: tokens.closeForeground,
|
|
993
|
+
[name.focusColor]: tokens.focusColor,
|
|
994
|
+
[name.fontFamily]: tokens.fontFamily,
|
|
995
|
+
[name.title.fontSize]: tokens.title.fontSize,
|
|
996
|
+
[name.title.lineHeight]: tokens.title.lineHeight,
|
|
997
|
+
[name.title.fontWeight]: String(tokens.title.fontWeight),
|
|
998
|
+
[name.title.letterSpacing]: tokens.title.letterSpacing,
|
|
999
|
+
[name.body.fontSize]: tokens.body.fontSize,
|
|
1000
|
+
[name.body.lineHeight]: tokens.body.lineHeight,
|
|
1001
|
+
[name.motionDuration]: tokens.motionDuration,
|
|
1002
|
+
[name.enterEasing]: tokens.enterEasing,
|
|
1003
|
+
[name.exitEasing]: tokens.exitEasing,
|
|
1004
|
+
[name.layer]: String(tokens.layer)
|
|
1005
|
+
});
|
|
1006
|
+
}
|
|
1007
|
+
//#endregion
|
|
1008
|
+
//#region src/components/segmented/create.ts
|
|
1009
|
+
/**
|
|
1010
|
+
* 从完整语义主题派生 Segmented Control 组件 token。
|
|
1011
|
+
*
|
|
1012
|
+
* @param theme - 宿主选择的完整语义主题。
|
|
1013
|
+
* @returns 不可变的 Segmented Control 组件 token。
|
|
1014
|
+
*/
|
|
1015
|
+
function createSegmentedTokens(theme) {
|
|
1016
|
+
return Object.freeze({
|
|
1017
|
+
fontFamily: theme.typography.control.fontFamily,
|
|
1018
|
+
fontWeight: theme.typography.body.fontWeight,
|
|
1019
|
+
letterSpacing: theme.typography.control.letterSpacing,
|
|
1020
|
+
size: Object.freeze({
|
|
1021
|
+
xs: sizeTokens(theme.control[quireKitControlSizes.xs.height], theme.spacing.inline, theme.spacing.inlineTight, theme.control.icon, theme.typography[quireKitControlSizes.xs.typography]),
|
|
1022
|
+
sm: sizeTokens(theme.control[quireKitControlSizes.sm.height], theme.spacing.surfaceCompact, theme.spacing.inlineTight, theme.control.icon, theme.typography[quireKitControlSizes.sm.typography]),
|
|
1023
|
+
md: sizeTokens(theme.control[quireKitControlSizes.md.height], theme.spacing.surfaceCompact, theme.spacing.inline, theme.control.icon, theme.typography[quireKitControlSizes.md.typography]),
|
|
1024
|
+
lg: sizeTokens(theme.control[quireKitControlSizes.lg.height], theme.spacing.surface, theme.spacing.inline, theme.control.icon, theme.typography[quireKitControlSizes.lg.typography]),
|
|
1025
|
+
xl: sizeTokens(theme.control[quireKitControlSizes.xl.height], theme.spacing.surface, theme.spacing.inline, theme.control.iconLarge, theme.typography[quireKitControlSizes.xl.typography])
|
|
1026
|
+
}),
|
|
1027
|
+
trackInset: theme.borderWidth.focus,
|
|
1028
|
+
trackRadius: theme.radius.group,
|
|
1029
|
+
indicatorRadius: theme.radius.control,
|
|
1030
|
+
trackBackground: theme.color.surface.hover,
|
|
1031
|
+
foreground: theme.color.text.secondary,
|
|
1032
|
+
hoverForeground: theme.color.text.primary,
|
|
1033
|
+
hoverBackground: theme.color.surface.pressed,
|
|
1034
|
+
selectedForeground: theme.color.text.primary,
|
|
1035
|
+
selectedBackground: theme.color.surface.raised,
|
|
1036
|
+
disabledForeground: theme.color.text.disabled,
|
|
1037
|
+
focusColor: theme.color.border.focus,
|
|
1038
|
+
transitionDuration: theme.motion.controlDuration,
|
|
1039
|
+
transitionEasing: theme.motion.standardEasing
|
|
1040
|
+
});
|
|
1041
|
+
}
|
|
1042
|
+
/**
|
|
1043
|
+
* 组合一个公开尺寸的几何和排版投影。
|
|
1044
|
+
*
|
|
1045
|
+
* @param height - 语义控件高度。
|
|
1046
|
+
* @param paddingInline - 选项横向内边距。
|
|
1047
|
+
* @param gap - 选项内部内容间距。
|
|
1048
|
+
* @param iconSize - 图标光学盒尺寸。
|
|
1049
|
+
* @param typography - 匹配当前高度的语义排版角色。
|
|
1050
|
+
* @returns 不可变的公开尺寸 token。
|
|
1051
|
+
*/
|
|
1052
|
+
function sizeTokens(height, paddingInline, gap, iconSize, typography) {
|
|
1053
|
+
return Object.freeze({
|
|
1054
|
+
height,
|
|
1055
|
+
paddingInline,
|
|
1056
|
+
gap,
|
|
1057
|
+
iconSize,
|
|
1058
|
+
fontSize: typography.fontSize,
|
|
1059
|
+
lineHeight: typography.lineHeight
|
|
1060
|
+
});
|
|
1061
|
+
}
|
|
1062
|
+
//#endregion
|
|
1063
|
+
//#region src/components/segmented/variables/names.ts
|
|
1064
|
+
/** Segmented Control 获准组件合同的显式 CSS 变量名。 */
|
|
1065
|
+
const segmentedCssVariableNames = Object.freeze({
|
|
1066
|
+
typography: Object.freeze({
|
|
1067
|
+
fontFamily: "--qk-segmented-font-family",
|
|
1068
|
+
fontWeight: "--qk-segmented-font-weight",
|
|
1069
|
+
letterSpacing: "--qk-segmented-letter-spacing"
|
|
1070
|
+
}),
|
|
1071
|
+
size: Object.freeze({
|
|
1072
|
+
xs: sizeNames("xs"),
|
|
1073
|
+
sm: sizeNames("sm"),
|
|
1074
|
+
md: sizeNames("md"),
|
|
1075
|
+
lg: sizeNames("lg"),
|
|
1076
|
+
xl: sizeNames("xl")
|
|
1077
|
+
}),
|
|
1078
|
+
trackInset: "--qk-segmented-track-inset",
|
|
1079
|
+
trackRadius: "--qk-segmented-track-radius",
|
|
1080
|
+
indicatorRadius: "--qk-segmented-indicator-radius",
|
|
1081
|
+
trackBackground: "--qk-segmented-track-background",
|
|
1082
|
+
foreground: "--qk-segmented-foreground",
|
|
1083
|
+
hoverForeground: "--qk-segmented-hover-foreground",
|
|
1084
|
+
hoverBackground: "--qk-segmented-hover-background",
|
|
1085
|
+
selectedForeground: "--qk-segmented-selected-foreground",
|
|
1086
|
+
selectedBackground: "--qk-segmented-selected-background",
|
|
1087
|
+
disabledForeground: "--qk-segmented-disabled-foreground",
|
|
1088
|
+
focusColor: "--qk-segmented-focus-color",
|
|
1089
|
+
transitionDuration: "--qk-segmented-transition-duration",
|
|
1090
|
+
transitionEasing: "--qk-segmented-transition-easing"
|
|
1091
|
+
});
|
|
1092
|
+
/**
|
|
1093
|
+
* 声明一个公开尺寸拥有的固定变量字段。
|
|
1094
|
+
*
|
|
1095
|
+
* @param size - 写入每个变量名的公开尺寸。
|
|
1096
|
+
* @returns 当前尺寸的显式变量名组。
|
|
1097
|
+
*/
|
|
1098
|
+
function sizeNames(size) {
|
|
1099
|
+
return Object.freeze({
|
|
1100
|
+
height: `--qk-segmented-${size}-height`,
|
|
1101
|
+
paddingInline: `--qk-segmented-${size}-padding-inline`,
|
|
1102
|
+
gap: `--qk-segmented-${size}-gap`,
|
|
1103
|
+
iconSize: `--qk-segmented-${size}-icon-size`,
|
|
1104
|
+
fontSize: `--qk-segmented-${size}-font-size`,
|
|
1105
|
+
lineHeight: `--qk-segmented-${size}-line-height`
|
|
1106
|
+
});
|
|
1107
|
+
}
|
|
1108
|
+
//#endregion
|
|
1109
|
+
//#region src/components/segmented/variables/declarations.ts
|
|
1110
|
+
/**
|
|
1111
|
+
* 把 Segmented Control 组件合同投影为显式 CSS 变量。
|
|
1112
|
+
*
|
|
1113
|
+
* @param tokens - 已批准的 Segmented Control 组件 token。
|
|
1114
|
+
* @returns 不可变的扁平声明表。
|
|
1115
|
+
*/
|
|
1116
|
+
function createSegmentedCssVariables(tokens) {
|
|
1117
|
+
const name = segmentedCssVariableNames;
|
|
1118
|
+
return Object.freeze({
|
|
1119
|
+
[name.typography.fontFamily]: tokens.fontFamily,
|
|
1120
|
+
[name.typography.fontWeight]: String(tokens.fontWeight),
|
|
1121
|
+
[name.typography.letterSpacing]: tokens.letterSpacing,
|
|
1122
|
+
...sizeDeclarations(name.size.xs, tokens.size.xs),
|
|
1123
|
+
...sizeDeclarations(name.size.sm, tokens.size.sm),
|
|
1124
|
+
...sizeDeclarations(name.size.md, tokens.size.md),
|
|
1125
|
+
...sizeDeclarations(name.size.lg, tokens.size.lg),
|
|
1126
|
+
...sizeDeclarations(name.size.xl, tokens.size.xl),
|
|
1127
|
+
[name.trackInset]: tokens.trackInset,
|
|
1128
|
+
[name.trackRadius]: tokens.trackRadius,
|
|
1129
|
+
[name.indicatorRadius]: tokens.indicatorRadius,
|
|
1130
|
+
[name.trackBackground]: tokens.trackBackground,
|
|
1131
|
+
[name.foreground]: tokens.foreground,
|
|
1132
|
+
[name.hoverForeground]: tokens.hoverForeground,
|
|
1133
|
+
[name.hoverBackground]: tokens.hoverBackground,
|
|
1134
|
+
[name.selectedForeground]: tokens.selectedForeground,
|
|
1135
|
+
[name.selectedBackground]: tokens.selectedBackground,
|
|
1136
|
+
[name.disabledForeground]: tokens.disabledForeground,
|
|
1137
|
+
[name.focusColor]: tokens.focusColor,
|
|
1138
|
+
[name.transitionDuration]: tokens.transitionDuration,
|
|
1139
|
+
[name.transitionEasing]: tokens.transitionEasing
|
|
1140
|
+
});
|
|
1141
|
+
}
|
|
1142
|
+
/**
|
|
1143
|
+
* 把一个尺寸变量组与对应组件值配对。
|
|
1144
|
+
*
|
|
1145
|
+
* @param names - 一个公开尺寸的显式变量名。
|
|
1146
|
+
* @param value - 同一尺寸的组件 token。
|
|
1147
|
+
* @returns 扁平 CSS 声明条目。
|
|
1148
|
+
*/
|
|
1149
|
+
function sizeDeclarations(names, value) {
|
|
1150
|
+
return {
|
|
1151
|
+
[names.height]: value.height,
|
|
1152
|
+
[names.paddingInline]: value.paddingInline,
|
|
1153
|
+
[names.gap]: value.gap,
|
|
1154
|
+
[names.iconSize]: value.iconSize,
|
|
1155
|
+
[names.fontSize]: value.fontSize,
|
|
1156
|
+
[names.lineHeight]: value.lineHeight
|
|
1157
|
+
};
|
|
1158
|
+
}
|
|
1159
|
+
//#endregion
|
|
1160
|
+
//#region src/components/toolbar/create.ts
|
|
1161
|
+
/**
|
|
1162
|
+
* Derives Toolbar component tokens from the approved semantic theme.
|
|
1163
|
+
*
|
|
1164
|
+
* @param theme - Complete semantic theme selected by the host.
|
|
1165
|
+
* @returns Immutable Toolbar component-token contract.
|
|
1166
|
+
*/
|
|
1167
|
+
function createToolbarTokens(theme) {
|
|
1168
|
+
return Object.freeze({
|
|
1169
|
+
typography: Object.freeze({
|
|
1170
|
+
fontFamily: theme.typography.compact.fontFamily,
|
|
1171
|
+
fontSize: theme.typography.compact.fontSize,
|
|
1172
|
+
lineHeight: theme.typography.compact.lineHeight,
|
|
1173
|
+
fontWeight: theme.typography.control.fontWeight,
|
|
1174
|
+
letterSpacing: theme.typography.compact.letterSpacing
|
|
1175
|
+
}),
|
|
1176
|
+
geometry: Object.freeze({
|
|
1177
|
+
itemHeight: theme.control.default,
|
|
1178
|
+
iconSize: theme.control.icon,
|
|
1179
|
+
splitDisclosureWidth: theme.control.icon,
|
|
1180
|
+
itemPaddingInline: theme.spacing.inline,
|
|
1181
|
+
itemGap: theme.spacing.inlineTight,
|
|
1182
|
+
groupGap: theme.spacing.inlineTight,
|
|
1183
|
+
toolbarGap: theme.spacing.inline,
|
|
1184
|
+
itemRadius: theme.radius.control,
|
|
1185
|
+
borderWidth: theme.borderWidth.default,
|
|
1186
|
+
separatorWidth: theme.borderWidth.default,
|
|
1187
|
+
separatorInset: theme.spacing.inlineTight
|
|
1188
|
+
}),
|
|
1189
|
+
color: Object.freeze({
|
|
1190
|
+
surface: theme.color.surface.chrome,
|
|
1191
|
+
foreground: theme.color.icon.secondary,
|
|
1192
|
+
hoverBackground: theme.color.surface.hover,
|
|
1193
|
+
activeBackground: theme.color.surface.pressed,
|
|
1194
|
+
selectedBackground: theme.color.surface.selected,
|
|
1195
|
+
focusBorder: theme.color.border.focus,
|
|
1196
|
+
disabledForeground: theme.color.icon.disabled,
|
|
1197
|
+
separator: theme.color.border.subtle
|
|
1198
|
+
}),
|
|
1199
|
+
feedbackDuration: theme.motion.feedbackDuration,
|
|
1200
|
+
feedbackEasing: theme.motion.standardEasing
|
|
1201
|
+
});
|
|
1202
|
+
}
|
|
1203
|
+
//#endregion
|
|
1204
|
+
//#region src/components/toolbar/variables/names.ts
|
|
1205
|
+
/** Explicit CSS-variable names for the Toolbar component contract. */
|
|
1206
|
+
const toolbarCssVariableNames = Object.freeze({
|
|
1207
|
+
typography: Object.freeze({
|
|
1208
|
+
fontFamily: "--qk-toolbar-font-family",
|
|
1209
|
+
fontSize: "--qk-toolbar-font-size",
|
|
1210
|
+
lineHeight: "--qk-toolbar-line-height",
|
|
1211
|
+
fontWeight: "--qk-toolbar-font-weight",
|
|
1212
|
+
letterSpacing: "--qk-toolbar-letter-spacing"
|
|
1213
|
+
}),
|
|
1214
|
+
geometry: Object.freeze({
|
|
1215
|
+
itemHeight: "--qk-toolbar-item-height",
|
|
1216
|
+
iconSize: "--qk-toolbar-icon-size",
|
|
1217
|
+
splitDisclosureWidth: "--qk-toolbar-split-disclosure-width",
|
|
1218
|
+
itemPaddingInline: "--qk-toolbar-item-padding-inline",
|
|
1219
|
+
itemGap: "--qk-toolbar-item-gap",
|
|
1220
|
+
groupGap: "--qk-toolbar-group-gap",
|
|
1221
|
+
toolbarGap: "--qk-toolbar-gap",
|
|
1222
|
+
itemRadius: "--qk-toolbar-item-radius",
|
|
1223
|
+
borderWidth: "--qk-toolbar-border-width",
|
|
1224
|
+
separatorWidth: "--qk-toolbar-separator-width",
|
|
1225
|
+
separatorInset: "--qk-toolbar-separator-inset"
|
|
1226
|
+
}),
|
|
1227
|
+
color: Object.freeze({
|
|
1228
|
+
surface: "--qk-toolbar-surface",
|
|
1229
|
+
foreground: "--qk-toolbar-foreground",
|
|
1230
|
+
hoverBackground: "--qk-toolbar-hover-background",
|
|
1231
|
+
activeBackground: "--qk-toolbar-active-background",
|
|
1232
|
+
selectedBackground: "--qk-toolbar-selected-background",
|
|
1233
|
+
focusBorder: "--qk-toolbar-focus-border",
|
|
1234
|
+
disabledForeground: "--qk-toolbar-disabled-foreground",
|
|
1235
|
+
separator: "--qk-toolbar-separator"
|
|
1236
|
+
}),
|
|
1237
|
+
feedbackDuration: "--qk-toolbar-feedback-duration",
|
|
1238
|
+
feedbackEasing: "--qk-toolbar-feedback-easing"
|
|
1239
|
+
});
|
|
1240
|
+
//#endregion
|
|
1241
|
+
//#region src/components/toolbar/variables/declarations.ts
|
|
1242
|
+
/**
|
|
1243
|
+
* Projects one Toolbar token contract to explicit CSS variables.
|
|
1244
|
+
*
|
|
1245
|
+
* @param tokens - Approved Toolbar component tokens.
|
|
1246
|
+
* @returns Immutable flat declaration map.
|
|
1247
|
+
*/
|
|
1248
|
+
function createToolbarCssVariables(tokens) {
|
|
1249
|
+
const names = toolbarCssVariableNames;
|
|
1250
|
+
return Object.freeze({
|
|
1251
|
+
...flatDeclarations(names.typography, tokens.typography),
|
|
1252
|
+
...flatDeclarations(names.geometry, tokens.geometry),
|
|
1253
|
+
...flatDeclarations(names.color, tokens.color),
|
|
1254
|
+
[names.feedbackDuration]: tokens.feedbackDuration,
|
|
1255
|
+
[names.feedbackEasing]: tokens.feedbackEasing
|
|
1256
|
+
});
|
|
1257
|
+
}
|
|
1258
|
+
/**
|
|
1259
|
+
* Pairs one variable-name group with matching Toolbar values.
|
|
1260
|
+
*
|
|
1261
|
+
* @param names - Explicit Toolbar variable names.
|
|
1262
|
+
* @param values - Matching Toolbar token values.
|
|
1263
|
+
* @returns Flat CSS declaration entries.
|
|
1264
|
+
*/
|
|
1265
|
+
function flatDeclarations(names, values) {
|
|
1266
|
+
const entries = Object.entries(values);
|
|
1267
|
+
return Object.fromEntries(entries.map(([key, value]) => [names[key], String(value)]));
|
|
1268
|
+
}
|
|
1269
|
+
//#endregion
|
|
1270
|
+
//#region src/components/tooltip/create.ts
|
|
1271
|
+
/** Tooltip pointer/focus 触发前的默认短延迟。 */
|
|
1272
|
+
const defaultTooltipOpenDelay = 400;
|
|
1273
|
+
/** Tooltip 离开 trigger 后的默认关闭缓冲。 */
|
|
1274
|
+
const defaultTooltipCloseDelay = 100;
|
|
1275
|
+
/**
|
|
1276
|
+
* 从完整语义主题派生 Tooltip 组件 token。
|
|
1277
|
+
*
|
|
1278
|
+
* @param theme - 宿主已经解析完成的语义主题。
|
|
1279
|
+
* @returns 不可变的 Tooltip 组件 token。
|
|
1280
|
+
*/
|
|
1281
|
+
function createTooltipTokens(theme) {
|
|
1282
|
+
const typography = theme.typography.compact;
|
|
1283
|
+
return Object.freeze({
|
|
1284
|
+
background: theme.color.surface.inverse,
|
|
1285
|
+
foreground: theme.color.text.inverse,
|
|
1286
|
+
borderColor: theme.color.surface.transparent,
|
|
1287
|
+
borderWidth: theme.borderWidth.none,
|
|
1288
|
+
radius: theme.radius.control,
|
|
1289
|
+
shadow: theme.elevation.overlay,
|
|
1290
|
+
paddingBlock: theme.spacing.inlineTight,
|
|
1291
|
+
paddingInline: theme.spacing.inline,
|
|
1292
|
+
gap: theme.spacing.inlineTight,
|
|
1293
|
+
arrowSize: theme.spacing.inline,
|
|
1294
|
+
typography: Object.freeze({
|
|
1295
|
+
fontFamily: typography.fontFamily,
|
|
1296
|
+
fontSize: typography.fontSize,
|
|
1297
|
+
lineHeight: typography.lineHeight,
|
|
1298
|
+
fontWeight: typography.fontWeight,
|
|
1299
|
+
letterSpacing: typography.letterSpacing
|
|
1300
|
+
}),
|
|
1301
|
+
motionDuration: theme.motion.feedbackDuration,
|
|
1302
|
+
enterEasing: theme.motion.enterEasing,
|
|
1303
|
+
exitEasing: theme.motion.exitEasing,
|
|
1304
|
+
layer: theme.layer.tooltip
|
|
1305
|
+
});
|
|
1306
|
+
}
|
|
1307
|
+
/**
|
|
1308
|
+
* 解析 Tooltip 当前应显示的标签或禁用原因。
|
|
1309
|
+
*
|
|
1310
|
+
* 禁用原因只在 subject 确实不可用且原因非空时覆盖普通标签;这让
|
|
1311
|
+
* pointer、keyboard focus 与读屏描述消费同一份稳定文案。
|
|
1312
|
+
*
|
|
1313
|
+
* @param options - 普通标签、禁用原因与 subject 状态。
|
|
1314
|
+
* @returns 当前提示文案;没有可展示内容时返回 `undefined`。
|
|
1315
|
+
*/
|
|
1316
|
+
function resolveTooltipContent(options) {
|
|
1317
|
+
const content = normalizeContent(options.content);
|
|
1318
|
+
const disabledReason = normalizeContent(options.disabledReason);
|
|
1319
|
+
if (options.subjectDisabled && disabledReason !== void 0) return disabledReason;
|
|
1320
|
+
return content;
|
|
1321
|
+
}
|
|
1322
|
+
/**
|
|
1323
|
+
* 把空白文案归一化为缺失值,同时保留有效文案的原始内容。
|
|
1324
|
+
*
|
|
1325
|
+
* @param content - 待归一化的可选文案。
|
|
1326
|
+
* @returns 有效文案或 `undefined`。
|
|
1327
|
+
*/
|
|
1328
|
+
function normalizeContent(content) {
|
|
1329
|
+
return content?.trim() ? content : void 0;
|
|
1330
|
+
}
|
|
1331
|
+
//#endregion
|
|
1332
|
+
//#region src/components/tooltip/variables/names.ts
|
|
1333
|
+
/** Tooltip 组件合同的显式 CSS 变量名。 */
|
|
1334
|
+
const tooltipCssVariableNames = Object.freeze({
|
|
1335
|
+
background: "--qk-tooltip-background",
|
|
1336
|
+
foreground: "--qk-tooltip-foreground",
|
|
1337
|
+
borderColor: "--qk-tooltip-border-color",
|
|
1338
|
+
borderWidth: "--qk-tooltip-border-width",
|
|
1339
|
+
radius: "--qk-tooltip-radius",
|
|
1340
|
+
shadow: "--qk-tooltip-shadow",
|
|
1341
|
+
paddingBlock: "--qk-tooltip-padding-block",
|
|
1342
|
+
paddingInline: "--qk-tooltip-padding-inline",
|
|
1343
|
+
gap: "--qk-tooltip-gap",
|
|
1344
|
+
arrowSize: "--qk-tooltip-arrow-size",
|
|
1345
|
+
typography: Object.freeze({
|
|
1346
|
+
fontFamily: "--qk-tooltip-font-family",
|
|
1347
|
+
fontSize: "--qk-tooltip-font-size",
|
|
1348
|
+
lineHeight: "--qk-tooltip-line-height",
|
|
1349
|
+
fontWeight: "--qk-tooltip-font-weight",
|
|
1350
|
+
letterSpacing: "--qk-tooltip-letter-spacing"
|
|
1351
|
+
}),
|
|
1352
|
+
motionDuration: "--qk-tooltip-motion-duration",
|
|
1353
|
+
enterEasing: "--qk-tooltip-enter-easing",
|
|
1354
|
+
exitEasing: "--qk-tooltip-exit-easing",
|
|
1355
|
+
layer: "--qk-tooltip-layer"
|
|
1356
|
+
});
|
|
1357
|
+
//#endregion
|
|
1358
|
+
//#region src/components/tooltip/variables/declarations.ts
|
|
1359
|
+
/**
|
|
1360
|
+
* 将 Tooltip 组件 token 投影为显式 CSS 变量声明。
|
|
1361
|
+
*
|
|
1362
|
+
* @param tokens - 已批准的 Tooltip 组件 token。
|
|
1363
|
+
* @returns 不可变的扁平 CSS 变量声明。
|
|
1364
|
+
*/
|
|
1365
|
+
function createTooltipCssVariables(tokens) {
|
|
1366
|
+
const name = tooltipCssVariableNames;
|
|
1367
|
+
return Object.freeze({
|
|
1368
|
+
[name.background]: tokens.background,
|
|
1369
|
+
[name.foreground]: tokens.foreground,
|
|
1370
|
+
[name.borderColor]: tokens.borderColor,
|
|
1371
|
+
[name.borderWidth]: tokens.borderWidth,
|
|
1372
|
+
[name.radius]: tokens.radius,
|
|
1373
|
+
[name.shadow]: tokens.shadow,
|
|
1374
|
+
[name.paddingBlock]: tokens.paddingBlock,
|
|
1375
|
+
[name.paddingInline]: tokens.paddingInline,
|
|
1376
|
+
[name.gap]: tokens.gap,
|
|
1377
|
+
[name.arrowSize]: tokens.arrowSize,
|
|
1378
|
+
[name.typography.fontFamily]: tokens.typography.fontFamily,
|
|
1379
|
+
[name.typography.fontSize]: tokens.typography.fontSize,
|
|
1380
|
+
[name.typography.lineHeight]: tokens.typography.lineHeight,
|
|
1381
|
+
[name.typography.fontWeight]: String(tokens.typography.fontWeight),
|
|
1382
|
+
[name.typography.letterSpacing]: tokens.typography.letterSpacing,
|
|
1383
|
+
[name.motionDuration]: tokens.motionDuration,
|
|
1384
|
+
[name.enterEasing]: tokens.enterEasing,
|
|
1385
|
+
[name.exitEasing]: tokens.exitEasing,
|
|
1386
|
+
[name.layer]: String(tokens.layer)
|
|
1387
|
+
});
|
|
1388
|
+
}
|
|
1389
|
+
//#endregion
|
|
1390
|
+
//#region src/styles/theme.ts
|
|
1391
|
+
const themeVariables = /* @__PURE__ */ new WeakMap();
|
|
1392
|
+
/**
|
|
1393
|
+
* Projects one theme together with its approved component tokens.
|
|
1394
|
+
* @param theme - Complete immutable semantic theme owned by the consumer.
|
|
1395
|
+
* @returns Stable immutable variables shared by ordinary and teleported roots and static CSS generation.
|
|
1396
|
+
*/
|
|
1397
|
+
function createUiThemeCssVariables(theme) {
|
|
1398
|
+
const retained = themeVariables.get(theme);
|
|
1399
|
+
if (retained !== void 0) return retained;
|
|
1400
|
+
const variables = Object.freeze({
|
|
1401
|
+
...createThemeCssVariables(theme),
|
|
1402
|
+
...createToggleGroupCssVariables(createToggleGroupTokens(theme)),
|
|
1403
|
+
...createCheckboxGroupCssVariables(createCheckboxGroupTokens(theme)),
|
|
1404
|
+
...createKbdCssVariables(createKbdTokens(theme)),
|
|
1405
|
+
...createSkeletonCssVariables(createSkeletonTokens(theme)),
|
|
1406
|
+
...createBadgeCssVariables(createBadgeTokens(theme)),
|
|
1407
|
+
...createTagCssVariables(createTagTokens(theme)),
|
|
1408
|
+
...createTableCssVariables(createTableTokens(theme)),
|
|
1409
|
+
...createButtonCssVariables(createButtonTokens(theme)),
|
|
1410
|
+
...createMenuCssVariables(createMenuTokens(theme)),
|
|
1411
|
+
...createPopoverCssVariables(createPopoverTokens(theme)),
|
|
1412
|
+
...createSegmentedCssVariables(createSegmentedTokens(theme)),
|
|
1413
|
+
...createToolbarCssVariables(createToolbarTokens(theme)),
|
|
1414
|
+
...createTooltipCssVariables(createTooltipTokens(theme))
|
|
1415
|
+
});
|
|
1416
|
+
themeVariables.set(theme, variables);
|
|
1417
|
+
return variables;
|
|
1418
|
+
}
|
|
1419
|
+
//#endregion
|
|
1420
|
+
//#region src/components/file-icon/resolve.ts
|
|
1421
|
+
const families = [
|
|
1422
|
+
[
|
|
1423
|
+
"document",
|
|
1424
|
+
"W",
|
|
1425
|
+
"doc docx docm dot dotx odt rtf pages"
|
|
1426
|
+
],
|
|
1427
|
+
[
|
|
1428
|
+
"spreadsheet",
|
|
1429
|
+
"X",
|
|
1430
|
+
"xls xlsx xlsm xlsb ods csv tsv numbers"
|
|
1431
|
+
],
|
|
1432
|
+
[
|
|
1433
|
+
"presentation",
|
|
1434
|
+
"P",
|
|
1435
|
+
"ppt pptx pptm odp key"
|
|
1436
|
+
],
|
|
1437
|
+
[
|
|
1438
|
+
"pdf",
|
|
1439
|
+
"PDF",
|
|
1440
|
+
"pdf"
|
|
1441
|
+
],
|
|
1442
|
+
[
|
|
1443
|
+
"ofd",
|
|
1444
|
+
"OFD",
|
|
1445
|
+
"ofd"
|
|
1446
|
+
],
|
|
1447
|
+
[
|
|
1448
|
+
"image",
|
|
1449
|
+
"IMG",
|
|
1450
|
+
"png jpg jpeg gif webp svg avif heic heif bmp tif tiff ico"
|
|
1451
|
+
],
|
|
1452
|
+
[
|
|
1453
|
+
"video",
|
|
1454
|
+
"VID",
|
|
1455
|
+
"mp4 mov m4v webm mkv avi wmv flv mpg mpeg 3gp"
|
|
1456
|
+
],
|
|
1457
|
+
[
|
|
1458
|
+
"audio",
|
|
1459
|
+
"AUD",
|
|
1460
|
+
"mp3 wav flac aac m4a ogg opus aiff mid midi"
|
|
1461
|
+
],
|
|
1462
|
+
[
|
|
1463
|
+
"archive",
|
|
1464
|
+
"ZIP",
|
|
1465
|
+
"zip rar 7z tar gz gzip bz2 xz tgz zst"
|
|
1466
|
+
],
|
|
1467
|
+
[
|
|
1468
|
+
"code",
|
|
1469
|
+
"</>",
|
|
1470
|
+
"js jsx ts tsx json jsonc yaml yml xml py rb go rs java c h cpp hpp cs swift kt sh bash zsh sql toml ini vue svelte"
|
|
1471
|
+
],
|
|
1472
|
+
[
|
|
1473
|
+
"web",
|
|
1474
|
+
"WEB",
|
|
1475
|
+
"html htm css scss sass less"
|
|
1476
|
+
],
|
|
1477
|
+
[
|
|
1478
|
+
"markdown",
|
|
1479
|
+
"MD",
|
|
1480
|
+
"md mdx markdown"
|
|
1481
|
+
],
|
|
1482
|
+
[
|
|
1483
|
+
"text",
|
|
1484
|
+
"TXT",
|
|
1485
|
+
"txt log readme"
|
|
1486
|
+
],
|
|
1487
|
+
[
|
|
1488
|
+
"design",
|
|
1489
|
+
"DES",
|
|
1490
|
+
"fig sketch psd ai eps xd afdesign"
|
|
1491
|
+
],
|
|
1492
|
+
[
|
|
1493
|
+
"font",
|
|
1494
|
+
"Aa",
|
|
1495
|
+
"ttf otf woff woff2 eot"
|
|
1496
|
+
],
|
|
1497
|
+
[
|
|
1498
|
+
"file",
|
|
1499
|
+
"FILE",
|
|
1500
|
+
""
|
|
1501
|
+
]
|
|
1502
|
+
];
|
|
1503
|
+
const byExtension = new Map(families.flatMap(([kind, badge, extensions]) => extensions.split(" ").filter(Boolean).map((extension) => [extension, {
|
|
1504
|
+
kind,
|
|
1505
|
+
badge
|
|
1506
|
+
}])));
|
|
1507
|
+
/** Resolve an explicit family, known extension, then MIME; unknown files remain neutral.
|
|
1508
|
+
* @param file - Display metadata, never trusted as a content/security check.
|
|
1509
|
+
* @returns Stable color family and legible short badge.
|
|
1510
|
+
*/
|
|
1511
|
+
function resolveQuireKitFileIdentity(file) {
|
|
1512
|
+
const explicit = file.kind && families.find(([kind]) => kind === file.kind);
|
|
1513
|
+
if (explicit) return {
|
|
1514
|
+
kind: explicit[0],
|
|
1515
|
+
badge: explicit[1]
|
|
1516
|
+
};
|
|
1517
|
+
const name = file.name?.toLowerCase().trim() ?? "";
|
|
1518
|
+
const extension = name.includes(".") ? name.split(".").at(-1) : "";
|
|
1519
|
+
const known = byExtension.get(extension);
|
|
1520
|
+
if (known) return { ...known };
|
|
1521
|
+
const mime = file.mediaType?.toLowerCase().split(";")[0]?.trim() ?? "";
|
|
1522
|
+
const kind = mime.startsWith("image/") ? "image" : mime.startsWith("video/") ? "video" : mime.startsWith("audio/") ? "audio" : /pdf$/.test(mime) ? "pdf" : /word|opendocument.text/.test(mime) ? "document" : /excel|spreadsheet|csv/.test(mime) ? "spreadsheet" : /powerpoint|presentation/.test(mime) ? "presentation" : /zip|compressed|archive|tar$/.test(mime) ? "archive" : /html|css/.test(mime) ? "web" : /markdown/.test(mime) ? "markdown" : /json|javascript|xml/.test(mime) ? "code" : /font/.test(mime) ? "font" : mime.startsWith("text/") ? "text" : "file";
|
|
1523
|
+
return {
|
|
1524
|
+
kind,
|
|
1525
|
+
badge: families.find(([family]) => family === kind)[1]
|
|
1526
|
+
};
|
|
1527
|
+
}
|
|
1528
|
+
//#endregion
|
|
1529
|
+
export { createBadgeTokens as A, createToggleGroupTokens as B, buttonCssVariableNames as C, createTableCssVariables as D, trackQuireKitInputModality as E, createKbdCssVariables as F, createKbdTokens as I, createCheckboxGroupCssVariables as L, createTagTokens as M, createSkeletonCssVariables as N, createTableTokens as O, createSkeletonTokens as P, createCheckboxGroupTokens as R, createButtonCssVariables as S, quireKitControlSizes as T, createPopoverTokens as _, createTooltipTokens as a, menuCssVariableNames as b, resolveTooltipContent as c, createToolbarTokens as d, createSegmentedCssVariables as f, popoverCssVariableNames as g, createPopoverCssVariables as h, tooltipCssVariableNames as i, createTagCssVariables as j, createBadgeCssVariables as k, createToolbarCssVariables as l, createSegmentedTokens as m, createUiThemeCssVariables as n, defaultTooltipCloseDelay as o, segmentedCssVariableNames as p, createTooltipCssVariables as r, defaultTooltipOpenDelay as s, resolveQuireKitFileIdentity as t, toolbarCssVariableNames as u, menuVariableReferences as v, createButtonTokens as w, createMenuTokens as x, createMenuCssVariables as y, createToggleGroupCssVariables as z };
|
|
1530
|
+
|
|
1531
|
+
//# sourceMappingURL=resolve-CGFbhFiM.mjs.map
|