meowtail 0.0.0-stage → 0.1.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/ASSISTANT.md +52 -0
- package/JSON.md +48 -0
- package/LICENSE +21 -0
- package/README.md +474 -2
- package/THIRD_PARTY_NOTICES.md +27 -0
- package/dist/src/chat/assistant-composer.d.ts +8 -0
- package/dist/src/chat/assistant-composer.js +246 -0
- package/dist/src/chat/assistant-content.d.ts +20 -0
- package/dist/src/chat/assistant-content.js +66 -0
- package/dist/src/chat/assistant-draft.d.ts +5 -0
- package/dist/src/chat/assistant-draft.js +23 -0
- package/dist/src/chat/assistant-markdown.d.ts +11 -0
- package/dist/src/chat/assistant-markdown.js +33 -0
- package/dist/src/chat/assistant-question.d.ts +12 -0
- package/dist/src/chat/assistant-question.js +95 -0
- package/dist/src/chat/assistant-scroll.d.ts +7 -0
- package/dist/src/chat/assistant-scroll.js +72 -0
- package/dist/src/chat/assistant-types.d.ts +174 -0
- package/dist/src/chat/assistant-types.js +40 -0
- package/dist/src/chat/assistant.d.ts +9 -0
- package/dist/src/chat/assistant.js +294 -0
- package/dist/src/chat/attachments.d.ts +23 -0
- package/dist/src/chat/attachments.js +81 -0
- package/dist/src/chat/bubble.d.ts +17 -0
- package/dist/src/chat/bubble.js +18 -0
- package/dist/src/chat/composer.d.ts +36 -0
- package/dist/src/chat/composer.js +31 -0
- package/dist/src/chat/conversation-scroll.d.ts +9 -0
- package/dist/src/chat/conversation-scroll.js +36 -0
- package/dist/src/chat/conversation.d.ts +16 -0
- package/dist/src/chat/conversation.js +62 -0
- package/dist/src/chat/frame.d.ts +9 -0
- package/dist/src/chat/frame.js +6 -0
- package/dist/src/chat/header.d.ts +14 -0
- package/dist/src/chat/header.js +15 -0
- package/dist/src/chat/index.d.ts +15 -0
- package/dist/src/chat/index.js +15 -0
- package/dist/src/chat/message-actions.d.ts +9 -0
- package/dist/src/chat/message-actions.js +6 -0
- package/dist/src/chat/message-context.d.ts +2 -0
- package/dist/src/chat/message-context.js +2 -0
- package/dist/src/chat/message-list.d.ts +25 -0
- package/dist/src/chat/message-list.js +23 -0
- package/dist/src/chat/message.d.ts +24 -0
- package/dist/src/chat/message.js +36 -0
- package/dist/src/chat/process.d.ts +11 -0
- package/dist/src/chat/process.js +9 -0
- package/dist/src/chat/question.d.ts +15 -0
- package/dist/src/chat/question.js +7 -0
- package/dist/src/chat/sources.d.ts +15 -0
- package/dist/src/chat/sources.js +19 -0
- package/dist/src/chat/status.d.ts +18 -0
- package/dist/src/chat/status.js +16 -0
- package/dist/src/chat/tool-call.d.ts +21 -0
- package/dist/src/chat/tool-call.js +40 -0
- package/dist/src/clipboard.d.ts +2 -0
- package/dist/src/clipboard.js +44 -0
- package/dist/src/components/add-button.d.ts +4 -0
- package/dist/src/components/add-button.js +8 -0
- package/dist/src/components/alert.d.ts +20 -0
- package/dist/src/components/alert.js +16 -0
- package/dist/src/components/aspect-ratio.d.ts +11 -0
- package/dist/src/components/aspect-ratio.js +19 -0
- package/dist/src/components/badge.d.ts +18 -0
- package/dist/src/components/badge.js +16 -0
- package/dist/src/components/breadcrumb.d.ts +15 -0
- package/dist/src/components/breadcrumb.js +10 -0
- package/dist/src/components/button.d.ts +31 -0
- package/dist/src/components/button.js +26 -0
- package/dist/src/components/card-action.d.ts +9 -0
- package/dist/src/components/card-action.js +6 -0
- package/dist/src/components/card-content.d.ts +9 -0
- package/dist/src/components/card-content.js +6 -0
- package/dist/src/components/card-description.d.ts +9 -0
- package/dist/src/components/card-description.js +6 -0
- package/dist/src/components/card-footer.d.ts +9 -0
- package/dist/src/components/card-footer.js +6 -0
- package/dist/src/components/card-header.d.ts +9 -0
- package/dist/src/components/card-header.js +6 -0
- package/dist/src/components/card-title.d.ts +10 -0
- package/dist/src/components/card-title.js +6 -0
- package/dist/src/components/card.d.ts +17 -0
- package/dist/src/components/card.js +19 -0
- package/dist/src/components/checkbox.d.ts +18 -0
- package/dist/src/components/checkbox.js +44 -0
- package/dist/src/components/choice-group.d.ts +27 -0
- package/dist/src/components/choice-group.js +85 -0
- package/dist/src/components/choice-select.d.ts +31 -0
- package/dist/src/components/choice-select.js +353 -0
- package/dist/src/components/code-block.d.ts +13 -0
- package/dist/src/components/code-block.js +71 -0
- package/dist/src/components/container.d.ts +17 -0
- package/dist/src/components/container.js +16 -0
- package/dist/src/components/credential-source.d.ts +22 -0
- package/dist/src/components/credential-source.js +34 -0
- package/dist/src/components/description-list.d.ts +20 -0
- package/dist/src/components/description-list.js +13 -0
- package/dist/src/components/detail-section.d.ts +16 -0
- package/dist/src/components/detail-section.js +12 -0
- package/dist/src/components/dialog.d.ts +43 -0
- package/dist/src/components/dialog.js +29 -0
- package/dist/src/components/diff-block.d.ts +21 -0
- package/dist/src/components/diff-block.js +24 -0
- package/dist/src/components/disclosure.d.ts +15 -0
- package/dist/src/components/disclosure.js +14 -0
- package/dist/src/components/drawer.d.ts +19 -0
- package/dist/src/components/drawer.js +56 -0
- package/dist/src/components/empty-state.d.ts +19 -0
- package/dist/src/components/empty-state.js +11 -0
- package/dist/src/components/field-group.d.ts +13 -0
- package/dist/src/components/field-group.js +20 -0
- package/dist/src/components/field.d.ts +16 -0
- package/dist/src/components/field.js +48 -0
- package/dist/src/components/grid.d.ts +27 -0
- package/dist/src/components/grid.js +29 -0
- package/dist/src/components/hover-card.d.ts +22 -0
- package/dist/src/components/hover-card.js +147 -0
- package/dist/src/components/icon-button.d.ts +17 -0
- package/dist/src/components/icon-button.js +17 -0
- package/dist/src/components/icon-rail.d.ts +20 -0
- package/dist/src/components/icon-rail.js +14 -0
- package/dist/src/components/image-lightbox.d.ts +14 -0
- package/dist/src/components/image-lightbox.js +51 -0
- package/dist/src/components/image-preview.d.ts +16 -0
- package/dist/src/components/image-preview.js +42 -0
- package/dist/src/components/index.d.ts +88 -0
- package/dist/src/components/index.js +87 -0
- package/dist/src/components/inline.d.ts +14 -0
- package/dist/src/components/inline.js +23 -0
- package/dist/src/components/input.d.ts +10 -0
- package/dist/src/components/input.js +6 -0
- package/dist/src/components/item.d.ts +26 -0
- package/dist/src/components/item.js +19 -0
- package/dist/src/components/json-block.d.ts +18 -0
- package/dist/src/components/json-block.js +49 -0
- package/dist/src/components/json-tree.d.ts +16 -0
- package/dist/src/components/json-tree.js +76 -0
- package/dist/src/components/layout-item.d.ts +15 -0
- package/dist/src/components/layout-item.js +16 -0
- package/dist/src/components/layout-types.d.ts +18 -0
- package/dist/src/components/layout-types.js +13 -0
- package/dist/src/components/list-group.d.ts +30 -0
- package/dist/src/components/list-group.js +32 -0
- package/dist/src/components/menu.d.ts +45 -0
- package/dist/src/components/menu.js +227 -0
- package/dist/src/components/nav-item.d.ts +13 -0
- package/dist/src/components/nav-item.js +19 -0
- package/dist/src/components/output-block.d.ts +20 -0
- package/dist/src/components/output-block.js +66 -0
- package/dist/src/components/page-frame.d.ts +21 -0
- package/dist/src/components/page-frame.js +16 -0
- package/dist/src/components/page-header.d.ts +15 -0
- package/dist/src/components/page-header.js +9 -0
- package/dist/src/components/path-label.d.ts +11 -0
- package/dist/src/components/path-label.js +37 -0
- package/dist/src/components/path-picker.d.ts +18 -0
- package/dist/src/components/path-picker.js +83 -0
- package/dist/src/components/pill.d.ts +11 -0
- package/dist/src/components/pill.js +14 -0
- package/dist/src/components/popover.d.ts +31 -0
- package/dist/src/components/popover.js +232 -0
- package/dist/src/components/process-group.d.ts +17 -0
- package/dist/src/components/process-group.js +8 -0
- package/dist/src/components/process-step.d.ts +13 -0
- package/dist/src/components/process-step.js +7 -0
- package/dist/src/components/rail-item.d.ts +25 -0
- package/dist/src/components/rail-item.js +16 -0
- package/dist/src/components/rail-section.d.ts +18 -0
- package/dist/src/components/rail-section.js +11 -0
- package/dist/src/components/read-block.d.ts +24 -0
- package/dist/src/components/read-block.js +82 -0
- package/dist/src/components/region-layout-types.d.ts +19 -0
- package/dist/src/components/region-layout-types.js +78 -0
- package/dist/src/components/region-layout.d.ts +19 -0
- package/dist/src/components/region-layout.js +254 -0
- package/dist/src/components/resource-card.d.ts +22 -0
- package/dist/src/components/resource-card.js +20 -0
- package/dist/src/components/resource-link.d.ts +18 -0
- package/dist/src/components/resource-link.js +14 -0
- package/dist/src/components/risk-confirmation.d.ts +22 -0
- package/dist/src/components/risk-confirmation.js +45 -0
- package/dist/src/components/search-block.d.ts +28 -0
- package/dist/src/components/search-block.js +40 -0
- package/dist/src/components/search-input.d.ts +18 -0
- package/dist/src/components/search-input.js +13 -0
- package/dist/src/components/segmented-control.d.ts +24 -0
- package/dist/src/components/segmented-control.js +63 -0
- package/dist/src/components/select.d.ts +17 -0
- package/dist/src/components/select.js +6 -0
- package/dist/src/components/separator.d.ts +10 -0
- package/dist/src/components/separator.js +11 -0
- package/dist/src/components/shortcut-keys.d.ts +12 -0
- package/dist/src/components/shortcut-keys.js +7 -0
- package/dist/src/components/skeleton-boundary.d.ts +12 -0
- package/dist/src/components/skeleton-boundary.js +73 -0
- package/dist/src/components/skeleton.d.ts +17 -0
- package/dist/src/components/skeleton.js +15 -0
- package/dist/src/components/spinner.d.ts +10 -0
- package/dist/src/components/spinner.js +7 -0
- package/dist/src/components/stack.d.ts +13 -0
- package/dist/src/components/stack.js +22 -0
- package/dist/src/components/state-dot.d.ts +14 -0
- package/dist/src/components/state-dot.js +28 -0
- package/dist/src/components/status-dot.d.ts +34 -0
- package/dist/src/components/status-dot.js +25 -0
- package/dist/src/components/switch.d.ts +9 -0
- package/dist/src/components/switch.js +8 -0
- package/dist/src/components/tabs.d.ts +24 -0
- package/dist/src/components/tabs.js +90 -0
- package/dist/src/components/tag.d.ts +23 -0
- package/dist/src/components/tag.js +16 -0
- package/dist/src/components/terminal-block.d.ts +24 -0
- package/dist/src/components/terminal-block.js +103 -0
- package/dist/src/components/text-shimmer.d.ts +15 -0
- package/dist/src/components/text-shimmer.js +17 -0
- package/dist/src/components/textarea.d.ts +9 -0
- package/dist/src/components/textarea.js +6 -0
- package/dist/src/components/timeline.d.ts +26 -0
- package/dist/src/components/timeline.js +17 -0
- package/dist/src/components/toast.d.ts +14 -0
- package/dist/src/components/toast.js +7 -0
- package/dist/src/components/toolbar.d.ts +12 -0
- package/dist/src/components/toolbar.js +155 -0
- package/dist/src/components/tooltip.d.ts +19 -0
- package/dist/src/components/tooltip.js +81 -0
- package/dist/src/components/web-block.d.ts +24 -0
- package/dist/src/components/web-block.js +40 -0
- package/dist/src/components/window-title-bar.d.ts +25 -0
- package/dist/src/components/window-title-bar.js +16 -0
- package/dist/src/components/work-card.d.ts +21 -0
- package/dist/src/components/work-card.js +11 -0
- package/dist/src/icons/LUCIDE-LICENSE +43 -0
- package/dist/src/icons/README.md +9 -0
- package/dist/src/icons/doodle-cat.d.ts +5 -0
- package/dist/src/icons/doodle-cat.js +8 -0
- package/dist/src/icons/external-arrow.d.ts +2 -0
- package/dist/src/icons/external-arrow.js +5 -0
- package/dist/src/icons/file-type-icon.d.ts +29 -0
- package/dist/src/icons/file-type-icon.js +211 -0
- package/dist/src/icons/github.d.ts +2 -0
- package/dist/src/icons/github.js +5 -0
- package/dist/src/icons/icon.d.ts +51 -0
- package/dist/src/icons/icon.js +135 -0
- package/dist/src/icons/index.d.ts +10 -0
- package/dist/src/icons/index.js +10 -0
- package/dist/src/icons/meowland-mark.d.ts +5 -0
- package/dist/src/icons/meowland-mark.js +5 -0
- package/dist/src/icons/notes.d.ts +2 -0
- package/dist/src/icons/notes.js +5 -0
- package/dist/src/icons/plus.d.ts +2 -0
- package/dist/src/icons/plus.js +5 -0
- package/dist/src/icons/search.d.ts +2 -0
- package/dist/src/icons/search.js +5 -0
- package/dist/src/icons/tasks.d.ts +2 -0
- package/dist/src/icons/tasks.js +5 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.js +5 -0
- package/dist/src/json/catalog.d.ts +169 -0
- package/dist/src/json/catalog.js +164 -0
- package/dist/src/json/index.d.ts +1 -0
- package/dist/src/json/index.js +1 -0
- package/dist/src/registry/index.d.ts +833 -0
- package/dist/src/registry/index.js +235 -0
- package/dist/src/registry.d.ts +1 -0
- package/dist/src/registry.js +1 -0
- package/dist/src/shared/dom-root.d.ts +3 -0
- package/dist/src/shared/dom-root.js +8 -0
- package/dist/src/shared/layout-style.d.ts +4 -0
- package/dist/src/shared/layout-style.js +13 -0
- package/dist/src/syntax-highlight.d.ts +26 -0
- package/dist/src/syntax-highlight.js +116 -0
- package/dist/src/theme/base.styles.d.ts +2 -0
- package/dist/src/theme/base.styles.js +26 -0
- package/dist/src/theme/chat/assistant.styles.d.ts +2 -0
- package/dist/src/theme/chat/assistant.styles.js +289 -0
- package/dist/src/theme/chat/attachments.styles.d.ts +1 -0
- package/dist/src/theme/chat/attachments.styles.js +255 -0
- package/dist/src/theme/chat/composer.styles.d.ts +1 -0
- package/dist/src/theme/chat/composer.styles.js +519 -0
- package/dist/src/theme/chat/conversation.styles.d.ts +1 -0
- package/dist/src/theme/chat/conversation.styles.js +57 -0
- package/dist/src/theme/chat/frame.styles.d.ts +1 -0
- package/dist/src/theme/chat/frame.styles.js +107 -0
- package/dist/src/theme/chat/header.styles.d.ts +1 -0
- package/dist/src/theme/chat/header.styles.js +93 -0
- package/dist/src/theme/chat/message.styles.d.ts +1 -0
- package/dist/src/theme/chat/message.styles.js +423 -0
- package/dist/src/theme/chat/question.styles.d.ts +1 -0
- package/dist/src/theme/chat/question.styles.js +57 -0
- package/dist/src/theme/chat/records.styles.d.ts +1 -0
- package/dist/src/theme/chat/records.styles.js +546 -0
- package/dist/src/theme/chat/status.styles.d.ts +1 -0
- package/dist/src/theme/chat/status.styles.js +75 -0
- package/dist/src/theme/components/alert.styles.d.ts +1 -0
- package/dist/src/theme/components/alert.styles.js +28 -0
- package/dist/src/theme/components/badge.styles.d.ts +1 -0
- package/dist/src/theme/components/badge.styles.js +66 -0
- package/dist/src/theme/components/breadcrumb.styles.d.ts +1 -0
- package/dist/src/theme/components/breadcrumb.styles.js +44 -0
- package/dist/src/theme/components/button.styles.d.ts +1 -0
- package/dist/src/theme/components/button.styles.js +143 -0
- package/dist/src/theme/components/card.styles.d.ts +1 -0
- package/dist/src/theme/components/card.styles.js +108 -0
- package/dist/src/theme/components/choice-group.styles.d.ts +1 -0
- package/dist/src/theme/components/choice-group.styles.js +87 -0
- package/dist/src/theme/components/choice-select.styles.d.ts +1 -0
- package/dist/src/theme/components/choice-select.styles.js +182 -0
- package/dist/src/theme/components/code-block.styles.d.ts +1 -0
- package/dist/src/theme/components/code-block.styles.js +77 -0
- package/dist/src/theme/components/description-list.styles.d.ts +1 -0
- package/dist/src/theme/components/description-list.styles.js +39 -0
- package/dist/src/theme/components/detail-section.styles.d.ts +1 -0
- package/dist/src/theme/components/detail-section.styles.js +43 -0
- package/dist/src/theme/components/dialog.styles.d.ts +1 -0
- package/dist/src/theme/components/dialog.styles.js +91 -0
- package/dist/src/theme/components/disclosure.styles.d.ts +1 -0
- package/dist/src/theme/components/disclosure.styles.js +79 -0
- package/dist/src/theme/components/drawer.styles.d.ts +2 -0
- package/dist/src/theme/components/drawer.styles.js +67 -0
- package/dist/src/theme/components/empty-state.styles.d.ts +1 -0
- package/dist/src/theme/components/empty-state.styles.js +51 -0
- package/dist/src/theme/components/field-group.styles.d.ts +1 -0
- package/dist/src/theme/components/field-group.styles.js +31 -0
- package/dist/src/theme/components/field.styles.d.ts +1 -0
- package/dist/src/theme/components/field.styles.js +31 -0
- package/dist/src/theme/components/hover-card.styles.d.ts +1 -0
- package/dist/src/theme/components/hover-card.styles.js +59 -0
- package/dist/src/theme/components/icon-rail.styles.d.ts +1 -0
- package/dist/src/theme/components/icon-rail.styles.js +236 -0
- package/dist/src/theme/components/image-lightbox.styles.d.ts +1 -0
- package/dist/src/theme/components/image-lightbox.styles.js +67 -0
- package/dist/src/theme/components/image-preview.styles.d.ts +1 -0
- package/dist/src/theme/components/image-preview.styles.js +68 -0
- package/dist/src/theme/components/item.styles.d.ts +1 -0
- package/dist/src/theme/components/item.styles.js +101 -0
- package/dist/src/theme/components/json.styles.d.ts +1 -0
- package/dist/src/theme/components/json.styles.js +127 -0
- package/dist/src/theme/components/layout.styles.d.ts +1 -0
- package/dist/src/theme/components/layout.styles.js +103 -0
- package/dist/src/theme/components/list-group.styles.d.ts +1 -0
- package/dist/src/theme/components/list-group.styles.js +98 -0
- package/dist/src/theme/components/menu.styles.d.ts +1 -0
- package/dist/src/theme/components/menu.styles.js +77 -0
- package/dist/src/theme/components/native-input.styles.d.ts +1 -0
- package/dist/src/theme/components/native-input.styles.js +113 -0
- package/dist/src/theme/components/nav-item.styles.d.ts +1 -0
- package/dist/src/theme/components/nav-item.styles.js +68 -0
- package/dist/src/theme/components/output-block.styles.d.ts +1 -0
- package/dist/src/theme/components/output-block.styles.js +226 -0
- package/dist/src/theme/components/page-frame.styles.d.ts +1 -0
- package/dist/src/theme/components/page-frame.styles.js +57 -0
- package/dist/src/theme/components/page-header.styles.d.ts +1 -0
- package/dist/src/theme/components/page-header.styles.js +39 -0
- package/dist/src/theme/components/path-label.styles.d.ts +1 -0
- package/dist/src/theme/components/path-label.styles.js +27 -0
- package/dist/src/theme/components/path-picker.styles.d.ts +1 -0
- package/dist/src/theme/components/path-picker.styles.js +33 -0
- package/dist/src/theme/components/pill.styles.d.ts +1 -0
- package/dist/src/theme/components/pill.styles.js +39 -0
- package/dist/src/theme/components/popover.styles.d.ts +1 -0
- package/dist/src/theme/components/popover.styles.js +49 -0
- package/dist/src/theme/components/process-group.styles.d.ts +1 -0
- package/dist/src/theme/components/process-group.styles.js +141 -0
- package/dist/src/theme/components/region-layout.styles.d.ts +1 -0
- package/dist/src/theme/components/region-layout.styles.js +57 -0
- package/dist/src/theme/components/resource-card.styles.d.ts +1 -0
- package/dist/src/theme/components/resource-card.styles.js +105 -0
- package/dist/src/theme/components/resource-card.tokens.d.ts +5 -0
- package/dist/src/theme/components/resource-card.tokens.js +6 -0
- package/dist/src/theme/components/resource-link.styles.d.ts +1 -0
- package/dist/src/theme/components/resource-link.styles.js +78 -0
- package/dist/src/theme/components/risk-confirmation.styles.d.ts +1 -0
- package/dist/src/theme/components/risk-confirmation.styles.js +9 -0
- package/dist/src/theme/components/search-input.styles.d.ts +1 -0
- package/dist/src/theme/components/search-input.styles.js +63 -0
- package/dist/src/theme/components/segmented-control.styles.d.ts +1 -0
- package/dist/src/theme/components/segmented-control.styles.js +63 -0
- package/dist/src/theme/components/separator.styles.d.ts +1 -0
- package/dist/src/theme/components/separator.styles.js +15 -0
- package/dist/src/theme/components/shortcut-keys.styles.d.ts +1 -0
- package/dist/src/theme/components/shortcut-keys.styles.js +34 -0
- package/dist/src/theme/components/skeleton.styles.d.ts +1 -0
- package/dist/src/theme/components/skeleton.styles.js +43 -0
- package/dist/src/theme/components/spinner.styles.d.ts +1 -0
- package/dist/src/theme/components/spinner.styles.js +27 -0
- package/dist/src/theme/components/state-dot.styles.d.ts +1 -0
- package/dist/src/theme/components/state-dot.styles.js +68 -0
- package/dist/src/theme/components/status-dot.styles.d.ts +1 -0
- package/dist/src/theme/components/status-dot.styles.js +72 -0
- package/dist/src/theme/components/tabs.styles.d.ts +1 -0
- package/dist/src/theme/components/tabs.styles.js +93 -0
- package/dist/src/theme/components/tag.styles.d.ts +1 -0
- package/dist/src/theme/components/tag.styles.js +55 -0
- package/dist/src/theme/components/text-shimmer.styles.d.ts +1 -0
- package/dist/src/theme/components/text-shimmer.styles.js +59 -0
- package/dist/src/theme/components/timeline.styles.d.ts +1 -0
- package/dist/src/theme/components/timeline.styles.js +87 -0
- package/dist/src/theme/components/toast.styles.d.ts +1 -0
- package/dist/src/theme/components/toast.styles.js +48 -0
- package/dist/src/theme/components/toggle.styles.d.ts +1 -0
- package/dist/src/theme/components/toggle.styles.js +85 -0
- package/dist/src/theme/components/toolbar.styles.d.ts +1 -0
- package/dist/src/theme/components/toolbar.styles.js +22 -0
- package/dist/src/theme/components/tooltip.styles.d.ts +1 -0
- package/dist/src/theme/components/tooltip.styles.js +26 -0
- package/dist/src/theme/components/web-block.styles.d.ts +1 -0
- package/dist/src/theme/components/web-block.styles.js +48 -0
- package/dist/src/theme/components/window-title-bar.styles.d.ts +6 -0
- package/dist/src/theme/components/window-title-bar.styles.js +57 -0
- package/dist/src/theme/components/work-card.styles.d.ts +1 -0
- package/dist/src/theme/components/work-card.styles.js +78 -0
- package/dist/src/theme/icons/icons.styles.d.ts +1 -0
- package/dist/src/theme/icons/icons.styles.js +29 -0
- package/dist/src/theme/index.d.ts +3 -0
- package/dist/src/theme/index.js +168 -0
- package/dist/src/theme/palette.d.ts +55 -0
- package/dist/src/theme/palette.js +56 -0
- package/dist/src/theme/shared/code-highlight.styles.d.ts +1 -0
- package/dist/src/theme/shared/code-highlight.styles.js +20 -0
- package/dist/src/theme/shared/code-highlight.tokens.d.ts +12 -0
- package/dist/src/theme/shared/code-highlight.tokens.js +13 -0
- package/dist/src/theme/tokens.d.ts +111 -0
- package/dist/src/theme/tokens.js +128 -0
- package/package.json +62 -4
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { defineComponent, h } from "meowjsx";
|
|
2
|
+
import { PageFrame } from "./page-frame.js";
|
|
3
|
+
export const dialogContract = {
|
|
4
|
+
name: "dialog",
|
|
5
|
+
parts: ["root"],
|
|
6
|
+
};
|
|
7
|
+
export const Dialog = defineComponent(dialogContract, ({ labelledBy, describedBy, className, children, ...props }, context) => context.part("root", "dialog", {
|
|
8
|
+
...props,
|
|
9
|
+
className,
|
|
10
|
+
"aria-labelledby": labelledBy,
|
|
11
|
+
"aria-describedby": describedBy,
|
|
12
|
+
}, children));
|
|
13
|
+
export const dialogPanelContract = {
|
|
14
|
+
name: "dialog-panel",
|
|
15
|
+
parts: ["root"],
|
|
16
|
+
};
|
|
17
|
+
export const DialogPanel = defineComponent(dialogPanelContract, ({ as = "div", header, className, children, ...props }, context) => context.part("root", as, { ...props, className }, h(PageFrame, { variant: "workspace", scrollOwner: "layout", header }, children)));
|
|
18
|
+
export const dialogHeaderContract = {
|
|
19
|
+
name: "dialog-header",
|
|
20
|
+
parts: ["root", "identity", "eyebrow", "title", "description", "actions"],
|
|
21
|
+
};
|
|
22
|
+
export const DialogHeader = defineComponent(dialogHeaderContract, ({ title, eyebrow, description, actions, titleId, descriptionId, className }, context) => context.part("root", "header", { className }, context.part("identity", "div", null, eyebrow ? context.part("eyebrow", "span", null, eyebrow) : null, context.part("title", "h2", titleId ? { id: titleId } : null, title), description
|
|
23
|
+
? context.part("description", "p", descriptionId ? { id: descriptionId } : null, description)
|
|
24
|
+
: null), actions ? context.part("actions", "div", null, actions) : null));
|
|
25
|
+
export const dialogActionsContract = {
|
|
26
|
+
name: "dialog-actions",
|
|
27
|
+
parts: ["root"],
|
|
28
|
+
};
|
|
29
|
+
export const DialogActions = defineComponent(dialogActionsContract, ({ children, className, ...props }, context) => context.part("root", "div", { ...props, className }, children));
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type Props } from "meowjsx";
|
|
2
|
+
export declare const diffBlockContract: {
|
|
3
|
+
readonly name: "diff-block";
|
|
4
|
+
readonly parts: readonly ["root", "line", "path"];
|
|
5
|
+
};
|
|
6
|
+
export interface DiffBlockLine {
|
|
7
|
+
kind: "added" | "removed" | "context";
|
|
8
|
+
text: string;
|
|
9
|
+
}
|
|
10
|
+
export interface DiffBlockFile {
|
|
11
|
+
path: string;
|
|
12
|
+
lines: readonly DiffBlockLine[];
|
|
13
|
+
}
|
|
14
|
+
export interface DiffBlockProps extends Props {
|
|
15
|
+
files: readonly DiffBlockFile[];
|
|
16
|
+
maxLines?: number;
|
|
17
|
+
onCopy?: (text: string) => Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export declare function diffBlockText(files: readonly DiffBlockFile[]): string;
|
|
20
|
+
/** Hosts provide semantic diff rows; this view does not infer changes or apply patches. */
|
|
21
|
+
export declare const DiffBlock: import("meowjsx").Component<DiffBlockProps, "diff-block", "line" | "path" | "root">;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defineComponent, h } from "meowjsx";
|
|
2
|
+
import { OutputBlock } from "./output-block.js";
|
|
3
|
+
export const diffBlockContract = {
|
|
4
|
+
name: "diff-block",
|
|
5
|
+
parts: ["root", "line", "path"],
|
|
6
|
+
};
|
|
7
|
+
const marker = { added: "+", removed: "-", context: " " };
|
|
8
|
+
export function diffBlockText(files) {
|
|
9
|
+
return files
|
|
10
|
+
.map((file) => [file.path, ...file.lines.map((line) => marker[line.kind] + line.text)].join("\n"))
|
|
11
|
+
.join("\n\n");
|
|
12
|
+
}
|
|
13
|
+
/** Hosts provide semantic diff rows; this view does not infer changes or apply patches. */
|
|
14
|
+
export const DiffBlock = defineComponent(diffBlockContract, ({ files, maxLines, onCopy, ...props }, context) => {
|
|
15
|
+
const added = files.reduce((sum, file) => sum + file.lines.filter((line) => line.kind === "added").length, 0);
|
|
16
|
+
const removed = files.reduce((sum, file) => sum + file.lines.filter((line) => line.kind === "removed").length, 0);
|
|
17
|
+
return context.part("root", "div", props, h(OutputBlock, { title: `变更 · +${added} −${removed}`, maxLines: maxLines, onCopy: onCopy, copyText: diffBlockText(files), rows: files.flatMap((file) => [
|
|
18
|
+
context.part("path", "div", {}, file.path),
|
|
19
|
+
...file.lines.map((line) => context.part("line", "div", { "data-diff-kind": line.kind }, [
|
|
20
|
+
marker[line.kind],
|
|
21
|
+
line.text,
|
|
22
|
+
])),
|
|
23
|
+
]) }));
|
|
24
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Child, type Props } from "meowjsx";
|
|
2
|
+
export declare const disclosureContract: {
|
|
3
|
+
readonly name: "disclosure";
|
|
4
|
+
readonly parts: readonly ["root", "summary", "icon", "content"];
|
|
5
|
+
};
|
|
6
|
+
export interface DisclosureProps extends Props {
|
|
7
|
+
summary: Child;
|
|
8
|
+
open?: boolean;
|
|
9
|
+
onToggle?: (event: Event) => void;
|
|
10
|
+
className?: string;
|
|
11
|
+
summaryClassName?: string;
|
|
12
|
+
contentClassName?: string;
|
|
13
|
+
}
|
|
14
|
+
/** Native details owns expansion and keyboard behavior, independently of the theme. */
|
|
15
|
+
export declare const Disclosure: import("meowjsx").Component<DisclosureProps, "disclosure", "content" | "icon" | "root" | "summary">;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { defineComponent, h } from "meowjsx";
|
|
2
|
+
import { Icon } from "../icons/icon.js";
|
|
3
|
+
export const disclosureContract = {
|
|
4
|
+
name: "disclosure",
|
|
5
|
+
parts: ["root", "summary", "icon", "content"],
|
|
6
|
+
};
|
|
7
|
+
/** Native details owns expansion and keyboard behavior, independently of the theme. */
|
|
8
|
+
export const Disclosure = defineComponent(disclosureContract, ({ summary, children, className, summaryClassName, contentClassName, ...props }, context) => context.part("root", "details", { ...props, className }, [
|
|
9
|
+
context.part("summary", "summary", { className: summaryClassName }, [
|
|
10
|
+
context.part("icon", "span", { "aria-hidden": "true" }, h(Icon, { name: "chevron-right" })),
|
|
11
|
+
summary,
|
|
12
|
+
]),
|
|
13
|
+
context.part("content", "div", { className: contentClassName }, children),
|
|
14
|
+
]));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type Child, type MaybeSignal, type Props } from "meowjsx";
|
|
2
|
+
export declare const drawerContract: {
|
|
3
|
+
readonly name: "drawer";
|
|
4
|
+
readonly parts: readonly ["root", "panel"];
|
|
5
|
+
};
|
|
6
|
+
export interface DrawerProps extends Props {
|
|
7
|
+
/** Accessible name of the drawer. */
|
|
8
|
+
label: string;
|
|
9
|
+
open: MaybeSignal<boolean>;
|
|
10
|
+
/** Called when the reader dismisses the drawer (scrim, Escape); the owner updates `open`. */
|
|
11
|
+
onOpenChange: (open: boolean) => void;
|
|
12
|
+
header?: Child;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A modal panel that slides in from the start edge over a scrim, for navigation on narrow
|
|
17
|
+
* screens. The native dialog supplies focus containment and Escape; the scrim dismisses.
|
|
18
|
+
*/
|
|
19
|
+
export declare const Drawer: import("meowjsx").Component<DrawerProps, "drawer", "panel" | "root">;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { defineComponent, h, unwrap, } from "meowjsx";
|
|
2
|
+
import { PageFrame } from "./page-frame.js";
|
|
3
|
+
export const drawerContract = {
|
|
4
|
+
name: "drawer",
|
|
5
|
+
parts: ["root", "panel"],
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* A modal panel that slides in from the start edge over a scrim, for navigation on narrow
|
|
9
|
+
* screens. The native dialog supplies focus containment and Escape; the scrim dismisses.
|
|
10
|
+
*/
|
|
11
|
+
export const Drawer = defineComponent(drawerContract, ({ label, open, onOpenChange, header, className, children, ...props }, context) => {
|
|
12
|
+
let dialog;
|
|
13
|
+
const sync = () => {
|
|
14
|
+
// Read first: the effect must subscribe to `open` even before the dialog is mounted.
|
|
15
|
+
const next = unwrap(open);
|
|
16
|
+
if (!dialog?.isConnected)
|
|
17
|
+
return;
|
|
18
|
+
if (next && !dialog.open)
|
|
19
|
+
dialog.showModal();
|
|
20
|
+
else if (!next && dialog.open)
|
|
21
|
+
dialog.close();
|
|
22
|
+
};
|
|
23
|
+
context.effect(sync);
|
|
24
|
+
return context.part("root", "dialog", {
|
|
25
|
+
...props,
|
|
26
|
+
className,
|
|
27
|
+
"aria-label": label,
|
|
28
|
+
ref: (element) => {
|
|
29
|
+
dialog = element;
|
|
30
|
+
sync();
|
|
31
|
+
const dismiss = (event) => {
|
|
32
|
+
event.preventDefault();
|
|
33
|
+
onOpenChange(false);
|
|
34
|
+
};
|
|
35
|
+
const closed = () => {
|
|
36
|
+
if (unwrap(open))
|
|
37
|
+
onOpenChange(false);
|
|
38
|
+
};
|
|
39
|
+
const scrim = (event) => {
|
|
40
|
+
if (event.target === element)
|
|
41
|
+
onOpenChange(false);
|
|
42
|
+
};
|
|
43
|
+
element.addEventListener("cancel", dismiss);
|
|
44
|
+
element.addEventListener("close", closed);
|
|
45
|
+
element.addEventListener("click", scrim);
|
|
46
|
+
return () => {
|
|
47
|
+
element.removeEventListener("cancel", dismiss);
|
|
48
|
+
element.removeEventListener("close", closed);
|
|
49
|
+
element.removeEventListener("click", scrim);
|
|
50
|
+
if (element.open)
|
|
51
|
+
element.close();
|
|
52
|
+
dialog = undefined;
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
}, context.part("panel", "div", null, h(PageFrame, { variant: "workspace", scrollOwner: "layout", header }, children)));
|
|
56
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type Child, type Props } from "meowjsx";
|
|
2
|
+
import { type ThemedProps } from "meowcss/meowjsx";
|
|
3
|
+
export declare const emptyStateOptions: import("meowcss").Options<{
|
|
4
|
+
readonly size: readonly ["default", "compact"];
|
|
5
|
+
}>;
|
|
6
|
+
export declare const emptyStateContract: {
|
|
7
|
+
readonly name: "empty-state";
|
|
8
|
+
readonly parts: readonly ["root", "illustration", "title", "description", "action"];
|
|
9
|
+
readonly styleProps: import("meowcss/meowjsx").StylePropsBinding<import("meowcss").Options<{
|
|
10
|
+
readonly size: readonly ["default", "compact"];
|
|
11
|
+
}>>;
|
|
12
|
+
};
|
|
13
|
+
export interface EmptyStateProps extends Props, ThemedProps<typeof emptyStateOptions> {
|
|
14
|
+
title: string;
|
|
15
|
+
copy?: string;
|
|
16
|
+
action?: Child;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const EmptyState: import("meowjsx").Component<EmptyStateProps, "empty-state", "action" | "description" | "illustration" | "root" | "title">;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { defineComponent, h } from "meowjsx";
|
|
2
|
+
import { DoodleCat } from "../icons/doodle-cat.js";
|
|
3
|
+
import { defineOptions } from "meowcss";
|
|
4
|
+
import { defineStyleProps } from "meowcss/meowjsx";
|
|
5
|
+
export const emptyStateOptions = defineOptions("empty-state", { size: ["default", "compact"] });
|
|
6
|
+
export const emptyStateContract = {
|
|
7
|
+
name: "empty-state",
|
|
8
|
+
parts: ["root", "illustration", "title", "description", "action"],
|
|
9
|
+
styleProps: defineStyleProps(emptyStateOptions, { defaults: { size: "default" } }),
|
|
10
|
+
};
|
|
11
|
+
export const EmptyState = defineComponent(emptyStateContract, ({ title, copy, action, className, ...props }, context) => context.part("root", "div", { ...props, className }, context.part("illustration", "div", null, h(DoodleCat, null)), context.part("title", "strong", null, title), copy ? context.part("description", "span", null, copy) : null, action ? context.part("action", "div", null, action) : null));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Child, type Props } from "meowjsx";
|
|
2
|
+
export declare const fieldGroupContract: {
|
|
3
|
+
readonly name: "field-group";
|
|
4
|
+
readonly parts: readonly ["root", "legend", "description", "content"];
|
|
5
|
+
};
|
|
6
|
+
export interface FieldGroupProps extends Props {
|
|
7
|
+
legend: Child;
|
|
8
|
+
description?: Child;
|
|
9
|
+
descriptionId?: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const FieldGroup: import("meowjsx").Component<FieldGroupProps, "field-group", "content" | "description" | "legend" | "root">;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defineComponent } from "meowjsx";
|
|
2
|
+
export const fieldGroupContract = {
|
|
3
|
+
name: "field-group",
|
|
4
|
+
parts: ["root", "legend", "description", "content"],
|
|
5
|
+
};
|
|
6
|
+
let nextFieldGroupId = 0;
|
|
7
|
+
export const FieldGroup = defineComponent(fieldGroupContract, ({ legend, description, descriptionId, disabled, children, className, ...props }, context) => {
|
|
8
|
+
const hasDescription = description !== undefined && description !== null && description !== false;
|
|
9
|
+
const resolvedDescriptionId = hasDescription
|
|
10
|
+
? (descriptionId ?? `field-group-${++nextFieldGroupId}-description`)
|
|
11
|
+
: undefined;
|
|
12
|
+
return context.part("root", "fieldset", {
|
|
13
|
+
...props,
|
|
14
|
+
disabled,
|
|
15
|
+
className,
|
|
16
|
+
"aria-describedby": [props["aria-describedby"], resolvedDescriptionId].filter(Boolean).join(" ") || undefined,
|
|
17
|
+
}, context.part("legend", "legend", null, legend), hasDescription
|
|
18
|
+
? context.part("description", "p", { id: resolvedDescriptionId }, description)
|
|
19
|
+
: null, context.part("content", "div", null, children));
|
|
20
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Child, type Props } from "meowjsx";
|
|
2
|
+
export declare const fieldContract: {
|
|
3
|
+
readonly name: "field";
|
|
4
|
+
readonly parts: readonly ["root", "label", "description", "error", "control"];
|
|
5
|
+
};
|
|
6
|
+
export interface FieldProps extends Props {
|
|
7
|
+
label: Child;
|
|
8
|
+
description?: Child;
|
|
9
|
+
error?: Child;
|
|
10
|
+
htmlFor?: string;
|
|
11
|
+
descriptionId?: string;
|
|
12
|
+
errorId?: string;
|
|
13
|
+
invalid?: boolean;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const Field: import("meowjsx").Component<FieldProps, "field", "control" | "description" | "error" | "label" | "root">;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defineComponent, } from "meowjsx";
|
|
2
|
+
export const fieldContract = {
|
|
3
|
+
name: "field",
|
|
4
|
+
parts: ["root", "label", "description", "error", "control"],
|
|
5
|
+
};
|
|
6
|
+
export const Field = defineComponent(fieldContract, ({ label, description, error, htmlFor, descriptionId, errorId, invalid, children, className }, context) => {
|
|
7
|
+
const hasDescription = description !== undefined && description !== null && description !== false;
|
|
8
|
+
const hasError = error !== undefined && error !== null && error !== false;
|
|
9
|
+
const resolvedDescriptionId = hasDescription
|
|
10
|
+
? (descriptionId ?? (htmlFor ? `${htmlFor}-description` : undefined))
|
|
11
|
+
: undefined;
|
|
12
|
+
const resolvedErrorId = hasError
|
|
13
|
+
? (errorId ?? (htmlFor ? `${htmlFor}-error` : undefined))
|
|
14
|
+
: undefined;
|
|
15
|
+
const describedBy = [resolvedDescriptionId, resolvedErrorId].filter(Boolean).join(" ");
|
|
16
|
+
const invalidState = invalid ?? hasError;
|
|
17
|
+
const control = enhanceControl(children, {
|
|
18
|
+
describedBy,
|
|
19
|
+
invalid: invalidState,
|
|
20
|
+
setInvalid: invalid !== undefined || hasError,
|
|
21
|
+
});
|
|
22
|
+
return context.part("root", "div", { className, "data-invalid": invalidState ? "true" : undefined }, context.part("label", "label", { htmlFor }, label), hasDescription
|
|
23
|
+
? context.part("description", "span", resolvedDescriptionId ? { id: resolvedDescriptionId } : null, description)
|
|
24
|
+
: null, context.part("control", "div", null, control), hasError
|
|
25
|
+
? context.part("error", "span", resolvedErrorId ? { id: resolvedErrorId } : null, error)
|
|
26
|
+
: null);
|
|
27
|
+
});
|
|
28
|
+
function enhanceControl(children, options) {
|
|
29
|
+
if (!children || Array.isArray(children) || !isVNode(children))
|
|
30
|
+
return children;
|
|
31
|
+
const existingDescribedBy = children.props["aria-describedby"];
|
|
32
|
+
const describedBy = options.describedBy && typeof existingDescribedBy === "string"
|
|
33
|
+
? `${existingDescribedBy} ${options.describedBy}`
|
|
34
|
+
: options.describedBy || existingDescribedBy;
|
|
35
|
+
const props = { ...children.props };
|
|
36
|
+
if (describedBy)
|
|
37
|
+
props["aria-describedby"] = describedBy;
|
|
38
|
+
if (options.setInvalid)
|
|
39
|
+
props["aria-invalid"] = options.invalid ? "true" : "false";
|
|
40
|
+
return { ...children, props };
|
|
41
|
+
}
|
|
42
|
+
function isVNode(value) {
|
|
43
|
+
return (typeof value === "object" &&
|
|
44
|
+
value !== null &&
|
|
45
|
+
!Array.isArray(value) &&
|
|
46
|
+
"type" in value &&
|
|
47
|
+
"props" in value);
|
|
48
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ThemedProps } from "meowcss/meowjsx";
|
|
2
|
+
import { type Props } from "meowjsx";
|
|
3
|
+
import type { LayoutAlign, LayoutElement } from "./layout-types.js";
|
|
4
|
+
export declare const gridOptions: import("meowcss").Options<{
|
|
5
|
+
readonly gap: readonly ["none", "compact", "normal", "relaxed"];
|
|
6
|
+
readonly rowGap: readonly ["auto", "none", "compact", "normal", "relaxed"];
|
|
7
|
+
readonly columnGap: readonly ["auto", "none", "compact", "normal", "relaxed"];
|
|
8
|
+
readonly minColumnWidth: readonly ["compact", "normal", "wide"];
|
|
9
|
+
}>;
|
|
10
|
+
export declare const gridMinColumn: import("meowcss").TokenRef;
|
|
11
|
+
export declare const gridContract: {
|
|
12
|
+
readonly name: "grid";
|
|
13
|
+
readonly parts: readonly ["root"];
|
|
14
|
+
readonly styleProps: import("meowcss/meowjsx").StylePropsBinding<import("meowcss").Options<{
|
|
15
|
+
readonly gap: readonly ["none", "compact", "normal", "relaxed"];
|
|
16
|
+
readonly rowGap: readonly ["auto", "none", "compact", "normal", "relaxed"];
|
|
17
|
+
readonly columnGap: readonly ["auto", "none", "compact", "normal", "relaxed"];
|
|
18
|
+
readonly minColumnWidth: readonly ["compact", "normal", "wide"];
|
|
19
|
+
}>>;
|
|
20
|
+
};
|
|
21
|
+
export interface GridProps extends Props, ThemedProps<typeof gridOptions> {
|
|
22
|
+
as?: LayoutElement;
|
|
23
|
+
align?: LayoutAlign;
|
|
24
|
+
className?: string;
|
|
25
|
+
columns?: "auto" | 1 | 2 | 3 | 4;
|
|
26
|
+
}
|
|
27
|
+
export declare const Grid: import("meowjsx").Component<GridProps, "grid", "root">;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { defineOptions, tokenRef } from "meowcss";
|
|
2
|
+
import { defineStyleProps } from "meowcss/meowjsx";
|
|
3
|
+
import { defineComponent } from "meowjsx";
|
|
4
|
+
import { layoutStyle } from "../shared/layout-style.js";
|
|
5
|
+
export const gridOptions = defineOptions("grid", {
|
|
6
|
+
gap: ["none", "compact", "normal", "relaxed"],
|
|
7
|
+
rowGap: ["auto", "none", "compact", "normal", "relaxed"],
|
|
8
|
+
columnGap: ["auto", "none", "compact", "normal", "relaxed"],
|
|
9
|
+
minColumnWidth: ["compact", "normal", "wide"],
|
|
10
|
+
});
|
|
11
|
+
export const gridMinColumn = tokenRef("grid", "minColumn");
|
|
12
|
+
export const gridContract = {
|
|
13
|
+
name: "grid",
|
|
14
|
+
parts: ["root"],
|
|
15
|
+
styleProps: defineStyleProps(gridOptions, {
|
|
16
|
+
defaults: { gap: "normal", rowGap: "auto", columnGap: "auto", minColumnWidth: "normal" },
|
|
17
|
+
}),
|
|
18
|
+
};
|
|
19
|
+
export const Grid = defineComponent(gridContract, ({ as = "div", align = "stretch", columns = "auto", children, ...props }, context) => context.part("root", as, {
|
|
20
|
+
...props,
|
|
21
|
+
style: layoutStyle(props.style, {
|
|
22
|
+
display: "grid",
|
|
23
|
+
gridTemplateColumns: columns === "auto"
|
|
24
|
+
? `repeat(auto-fit, minmax(min(100%, var(${gridMinColumn.name}, 100%)), 1fr))`
|
|
25
|
+
: `repeat(${columns}, minmax(0, 1fr))`,
|
|
26
|
+
alignItems: align,
|
|
27
|
+
minWidth: 0,
|
|
28
|
+
}),
|
|
29
|
+
}, children));
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Child, type Props } from "meowjsx";
|
|
2
|
+
import { type PopoverTriggerBindings } from "./popover.js";
|
|
3
|
+
export declare const hoverCardContract: {
|
|
4
|
+
readonly name: "hover-card";
|
|
5
|
+
readonly parts: readonly ["root", "content", "feedback"];
|
|
6
|
+
};
|
|
7
|
+
export interface HoverCardProps extends Props {
|
|
8
|
+
id: string;
|
|
9
|
+
trigger: (bindings: PopoverTriggerBindings) => Child;
|
|
10
|
+
content: Child;
|
|
11
|
+
openDelay?: number;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
className?: string;
|
|
14
|
+
variant?: "compact" | "preview";
|
|
15
|
+
widthAnchor?: () => HTMLElement | null;
|
|
16
|
+
copyText?: string;
|
|
17
|
+
copyLabel?: string;
|
|
18
|
+
copiedLabel?: string;
|
|
19
|
+
onCopy?: (text: string) => Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
/** Selectable preview. Popover owns positioning, Escape, outside dismissal and focus. */
|
|
22
|
+
export declare const HoverCard: import("meowjsx").Component<HoverCardProps, "hover-card", "content" | "feedback" | "root">;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { defineComponent, h } from "meowjsx";
|
|
2
|
+
import { Popover } from "./popover.js";
|
|
3
|
+
import { copyTextToClipboard } from "../clipboard.js";
|
|
4
|
+
export const hoverCardContract = {
|
|
5
|
+
name: "hover-card",
|
|
6
|
+
parts: ["root", "content", "feedback"],
|
|
7
|
+
};
|
|
8
|
+
/** Selectable preview. Popover owns positioning, Escape, outside dismissal and focus. */
|
|
9
|
+
export const HoverCard = defineComponent(hoverCardContract, ({ id, trigger, content, openDelay = 500, disabled = false, className, variant = "compact", widthAnchor, copyText, copyLabel = "复制", copiedLabel = "已复制", onCopy, }, context) => {
|
|
10
|
+
const open = context.signal(false);
|
|
11
|
+
let timer;
|
|
12
|
+
let hovered = false;
|
|
13
|
+
let focused = false;
|
|
14
|
+
let dismissed = false;
|
|
15
|
+
let root;
|
|
16
|
+
let alive = true;
|
|
17
|
+
let copying = false;
|
|
18
|
+
let copySession = {};
|
|
19
|
+
let feedbackTimer;
|
|
20
|
+
const feedback = context.signal("");
|
|
21
|
+
const clear = () => {
|
|
22
|
+
if (timer !== undefined)
|
|
23
|
+
clearTimeout(timer);
|
|
24
|
+
timer = undefined;
|
|
25
|
+
};
|
|
26
|
+
const close = () => {
|
|
27
|
+
clear();
|
|
28
|
+
open.value = false;
|
|
29
|
+
copySession = {};
|
|
30
|
+
clearTimeout(feedbackTimer);
|
|
31
|
+
feedback.value = "";
|
|
32
|
+
};
|
|
33
|
+
context.onCleanup(clear);
|
|
34
|
+
context.onCleanup(() => {
|
|
35
|
+
alive = false;
|
|
36
|
+
clearTimeout(feedbackTimer);
|
|
37
|
+
});
|
|
38
|
+
const copy = async (event) => {
|
|
39
|
+
if (copyText === undefined || copying)
|
|
40
|
+
return;
|
|
41
|
+
const selection = root?.ownerDocument.getSelection();
|
|
42
|
+
if (selection && !selection.isCollapsed && event.currentTarget instanceof Node) {
|
|
43
|
+
for (let index = 0; index < selection.rangeCount; index++)
|
|
44
|
+
if (selection.getRangeAt(index).intersectsNode(event.currentTarget))
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
copying = true;
|
|
48
|
+
const session = copySession;
|
|
49
|
+
try {
|
|
50
|
+
await (onCopy ?? copyTextToClipboard)(copyText);
|
|
51
|
+
if (alive && open.value && session === copySession)
|
|
52
|
+
feedback.value = copiedLabel;
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
if (alive && open.value && session === copySession)
|
|
56
|
+
feedback.value = "复制失败,请选择文本后重试。";
|
|
57
|
+
}
|
|
58
|
+
finally {
|
|
59
|
+
copying = false;
|
|
60
|
+
if (alive && session === copySession)
|
|
61
|
+
feedbackTimer = setTimeout(() => {
|
|
62
|
+
feedback.value = "";
|
|
63
|
+
}, 1000);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
return context.part("root", "span", {
|
|
67
|
+
className,
|
|
68
|
+
"data-variant": variant,
|
|
69
|
+
ref: (element) => {
|
|
70
|
+
root = element;
|
|
71
|
+
return () => {
|
|
72
|
+
root = undefined;
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
|
+
onPointerEnter: (event) => {
|
|
76
|
+
if (event.pointerType === "touch")
|
|
77
|
+
return;
|
|
78
|
+
hovered = true;
|
|
79
|
+
clear();
|
|
80
|
+
if (!disabled && !dismissed)
|
|
81
|
+
timer = setTimeout(() => {
|
|
82
|
+
open.value = true;
|
|
83
|
+
}, Math.max(0, openDelay));
|
|
84
|
+
},
|
|
85
|
+
onPointerLeave: () => {
|
|
86
|
+
hovered = false;
|
|
87
|
+
dismissed = false;
|
|
88
|
+
clear();
|
|
89
|
+
if (!focused)
|
|
90
|
+
timer = setTimeout(close, 120);
|
|
91
|
+
},
|
|
92
|
+
onFocusIn: () => {
|
|
93
|
+
focused = true;
|
|
94
|
+
clear();
|
|
95
|
+
if (!disabled && !dismissed)
|
|
96
|
+
open.value = true;
|
|
97
|
+
},
|
|
98
|
+
onFocusOut: (event) => {
|
|
99
|
+
if (event.currentTarget.contains(event.relatedTarget))
|
|
100
|
+
return;
|
|
101
|
+
focused = false;
|
|
102
|
+
dismissed = false;
|
|
103
|
+
if (!hovered)
|
|
104
|
+
close();
|
|
105
|
+
},
|
|
106
|
+
}, h(Popover, { id: id, open: open, labelledBy: `${id}-trigger`, matchTriggerWidth: variant === "preview", anchorElement: variant === "preview" ? () => widthAnchor?.() ?? root ?? null : undefined, anchorRect: variant === "preview"
|
|
107
|
+
? () => {
|
|
108
|
+
const triggerRect = root.ownerDocument
|
|
109
|
+
.getElementById(`${id}-trigger`)
|
|
110
|
+
.getBoundingClientRect();
|
|
111
|
+
const wide = (widthAnchor?.() ?? root).getBoundingClientRect();
|
|
112
|
+
return new DOMRect(wide.left + 24, triggerRect.top, Math.max(0, wide.width - 48), triggerRect.height);
|
|
113
|
+
}
|
|
114
|
+
: undefined, onOpenChange: (next) => {
|
|
115
|
+
if (!next) {
|
|
116
|
+
dismissed = true;
|
|
117
|
+
close();
|
|
118
|
+
}
|
|
119
|
+
else if (!disabled)
|
|
120
|
+
open.value = true;
|
|
121
|
+
}, trigger: (bindings) => trigger({
|
|
122
|
+
...bindings,
|
|
123
|
+
onClick: () => {
|
|
124
|
+
if (!disabled)
|
|
125
|
+
open.value = true;
|
|
126
|
+
},
|
|
127
|
+
}) }, context.part("content", "div", {
|
|
128
|
+
"data-variant": variant,
|
|
129
|
+
role: copyText === undefined ? undefined : "button",
|
|
130
|
+
tabIndex: copyText === undefined ? undefined : 0,
|
|
131
|
+
"aria-label": copyText === undefined ? undefined : `${copyLabel}: ${copyText}`,
|
|
132
|
+
onClick: copyText === undefined
|
|
133
|
+
? undefined
|
|
134
|
+
: (event) => {
|
|
135
|
+
void copy(event);
|
|
136
|
+
},
|
|
137
|
+
onKeyDown: copyText === undefined
|
|
138
|
+
? undefined
|
|
139
|
+
: (event) => {
|
|
140
|
+
if (event.target !== event.currentTarget ||
|
|
141
|
+
(event.key !== "Enter" && event.key !== " "))
|
|
142
|
+
return;
|
|
143
|
+
event.preventDefault();
|
|
144
|
+
void copy(event);
|
|
145
|
+
},
|
|
146
|
+
}, content, context.part("feedback", "span", { role: "status", "aria-live": "polite" }, feedback))));
|
|
147
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type ThemedProps } from "meowcss/meowjsx";
|
|
2
|
+
import { type Props } from "meowjsx";
|
|
3
|
+
export declare const iconButtonOptions: import("meowcss").Options<{
|
|
4
|
+
readonly size: readonly ["small", "default", "large"];
|
|
5
|
+
}>;
|
|
6
|
+
export declare const iconButtonContract: {
|
|
7
|
+
readonly name: "icon-button";
|
|
8
|
+
readonly parts: readonly ["root"];
|
|
9
|
+
readonly styleProps: import("meowcss/meowjsx").StylePropsBinding<import("meowcss").Options<{
|
|
10
|
+
readonly size: readonly ["small", "default", "large"];
|
|
11
|
+
}>>;
|
|
12
|
+
};
|
|
13
|
+
export interface IconButtonProps extends Props, ThemedProps<typeof iconButtonOptions> {
|
|
14
|
+
label: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const IconButton: import("meowjsx").Component<IconButtonProps, "icon-button", "root">;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineOptions } from "meowcss";
|
|
2
|
+
import { defineStyleProps } from "meowcss/meowjsx";
|
|
3
|
+
import { defineComponent } from "meowjsx";
|
|
4
|
+
export const iconButtonOptions = defineOptions("icon-button", {
|
|
5
|
+
size: ["small", "default", "large"],
|
|
6
|
+
});
|
|
7
|
+
export const iconButtonContract = {
|
|
8
|
+
name: "icon-button",
|
|
9
|
+
parts: ["root"],
|
|
10
|
+
styleProps: defineStyleProps(iconButtonOptions, { defaults: { size: "default" } }),
|
|
11
|
+
};
|
|
12
|
+
export const IconButton = defineComponent(iconButtonContract, ({ children, className, label, ...props }, context) => context.part("root", "button", {
|
|
13
|
+
...props,
|
|
14
|
+
type: props.type ?? "button",
|
|
15
|
+
className,
|
|
16
|
+
"aria-label": label,
|
|
17
|
+
}, children));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Child, type MaybeSignal, type Props } from "meowjsx";
|
|
2
|
+
export declare const iconRailContract: {
|
|
3
|
+
readonly name: "icon-rail";
|
|
4
|
+
readonly parts: readonly ["root", "drawer", "brand", "items", "footer"];
|
|
5
|
+
};
|
|
6
|
+
export interface IconRailProps extends Props {
|
|
7
|
+
/** Accessible name of the navigation. */
|
|
8
|
+
label: string;
|
|
9
|
+
brand?: Child;
|
|
10
|
+
/** Pinned to the bottom, for example settings. */
|
|
11
|
+
footer?: Child;
|
|
12
|
+
/** Keep the drawer open; by default it expands over the page on hover or keyboard focus. */
|
|
13
|
+
expanded?: MaybeSignal<boolean>;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A narrow icon column that expands into a labelled drawer over the page. The column keeps its
|
|
18
|
+
* width in the layout, so expanding never reflows the content beside it.
|
|
19
|
+
*/
|
|
20
|
+
export declare const IconRail: import("meowjsx").Component<IconRailProps, "icon-rail", "brand" | "drawer" | "footer" | "items" | "root">;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { defineComponent, isSignal, mapSignal, } from "meowjsx";
|
|
2
|
+
export const iconRailContract = {
|
|
3
|
+
name: "icon-rail",
|
|
4
|
+
parts: ["root", "drawer", "brand", "items", "footer"],
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* A narrow icon column that expands into a labelled drawer over the page. The column keeps its
|
|
8
|
+
* width in the layout, so expanding never reflows the content beside it.
|
|
9
|
+
*/
|
|
10
|
+
export const IconRail = defineComponent(iconRailContract, ({ label, brand, footer, expanded = false, className, children, ...props }, context) => context.part("root", "nav", { ...props, className, "aria-label": label }, context.part("drawer", "div", {
|
|
11
|
+
"data-expanded": isSignal(expanded)
|
|
12
|
+
? mapSignal(expanded, (value) => String(value))
|
|
13
|
+
: String(expanded),
|
|
14
|
+
}, brand ? context.part("brand", "div", null, brand) : null, context.part("items", "div", null, children), footer ? context.part("footer", "div", null, footer) : null)));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Child, type Props } from "meowjsx";
|
|
2
|
+
export declare const imageLightboxContract: {
|
|
3
|
+
readonly name: "image-lightbox";
|
|
4
|
+
readonly parts: readonly ["root", "trigger", "dialog", "image", "caption", "close"];
|
|
5
|
+
};
|
|
6
|
+
export interface ImageLightboxProps extends Props {
|
|
7
|
+
src: string;
|
|
8
|
+
alt: string;
|
|
9
|
+
caption?: string;
|
|
10
|
+
trigger?: Child;
|
|
11
|
+
onClose?: () => void;
|
|
12
|
+
}
|
|
13
|
+
/** Native modal top layer keeps the preview independent of transformed ancestors. */
|
|
14
|
+
export declare const ImageLightbox: import("meowjsx").Component<ImageLightboxProps, "image-lightbox", "caption" | "close" | "dialog" | "image" | "root" | "trigger">;
|