@deepseek-ai/dsh-client-ui-primitives 0.2.2-alpha.3 → 0.2.2-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.i18n.yaml +16 -16
- package/README.md +21 -14
- package/README.zh.md +21 -14
- package/lib/HoverCard.module.css +8 -3
- package/lib/JsonTree.module.css +7 -17
- package/lib/Menu.module.css +157 -37
- package/lib/Modal.module.css +16 -0
- package/lib/QuotePreview.module.css +37 -0
- package/lib/RiskConfirmation.module.css +11 -37
- package/lib/Toast.module.css +2 -3
- package/lib/Tooltip.module.css +2 -1
- package/lib/index.js +1447 -776
- package/lib/index.js.map +1 -0
- package/lib/markdown/CodeBlock.module.css +64 -0
- package/lib/markdown/MarkdownText.module.css +20 -1
- package/lib/types/AnimatedRows.d.ts +3 -0
- package/lib/types/AnimatedRows.d.ts.map +1 -0
- package/lib/types/AnimatedRows.js.map +1 -0
- package/lib/types/BrandWordmark.d.ts.map +1 -0
- package/lib/types/BrandWordmark.js.map +1 -0
- package/lib/types/Button.d.ts.map +1 -0
- package/lib/types/Button.js.map +1 -0
- package/lib/types/Checkbox.d.ts +3 -1
- package/lib/types/Checkbox.d.ts.map +1 -0
- package/lib/types/Checkbox.js.map +1 -0
- package/lib/types/CodeFileIcon.d.ts.map +1 -0
- package/lib/types/CodeFileIcon.js.map +1 -0
- package/lib/types/CodeToolbar.d.ts.map +1 -0
- package/lib/types/CodeToolbar.js.map +1 -0
- package/lib/types/CommandText.d.ts.map +1 -0
- package/lib/types/CommandText.js.map +1 -0
- package/lib/types/ConfigField.d.ts.map +1 -0
- package/lib/types/ConfigField.js.map +1 -0
- package/lib/types/ConnectionIndicator.d.ts.map +1 -0
- package/lib/types/ConnectionIndicator.js.map +1 -0
- package/lib/types/DetailDocument.d.ts.map +1 -0
- package/lib/types/DetailDocument.js.map +1 -0
- package/lib/types/DiffBlock.d.ts.map +1 -0
- package/lib/types/DiffBlock.js.map +1 -0
- package/lib/types/DisclosureRow.d.ts.map +1 -0
- package/lib/types/DisclosureRow.js.map +1 -0
- package/lib/types/DraggableImage.d.ts.map +1 -0
- package/lib/types/DraggableImage.js.map +1 -0
- package/lib/types/FileTypeIcon.d.ts.map +1 -0
- package/lib/types/FileTypeIcon.js.map +1 -0
- package/lib/types/FishLogo.d.ts.map +1 -0
- package/lib/types/FishLogo.js.map +1 -0
- package/lib/types/FoldToggle.d.ts.map +1 -0
- package/lib/types/FoldToggle.js.map +1 -0
- package/lib/types/HoverCard.d.ts.map +1 -0
- package/lib/types/HoverCard.js.map +1 -0
- package/lib/types/HoverCardGroup.d.ts.map +1 -0
- package/lib/types/HoverCardGroup.js.map +1 -0
- package/lib/types/ImageLightbox.d.ts.map +1 -0
- package/lib/types/ImageLightbox.js.map +1 -0
- package/lib/types/ImagePreview.d.ts.map +1 -0
- package/lib/types/ImagePreview.js.map +1 -0
- package/lib/types/InlineEditor.d.ts.map +1 -0
- package/lib/types/InlineEditor.js.map +1 -0
- package/lib/types/Input.d.ts.map +1 -0
- package/lib/types/Input.js.map +1 -0
- package/lib/types/JsonTree.d.ts.map +1 -0
- package/lib/types/JsonTree.js.map +1 -0
- package/lib/types/LinkIcon.d.ts.map +1 -0
- package/lib/types/LinkIcon.js.map +1 -0
- package/lib/types/Menu.d.ts +26 -14
- package/lib/types/Menu.d.ts.map +1 -0
- package/lib/types/Menu.js.map +1 -0
- package/lib/types/MenuGroup.d.ts.map +1 -0
- package/lib/types/MenuGroup.js.map +1 -0
- package/lib/types/MenuRow.d.ts +37 -0
- package/lib/types/MenuRow.d.ts.map +1 -0
- package/lib/types/MenuRow.js.map +1 -0
- package/lib/types/MenuSurface.d.ts.map +1 -0
- package/lib/types/MenuSurface.js.map +1 -0
- package/lib/types/Modal.d.ts +3 -1
- package/lib/types/Modal.d.ts.map +1 -0
- package/lib/types/Modal.js.map +1 -0
- package/lib/types/PathLabel.d.ts.map +1 -0
- package/lib/types/PathLabel.js.map +1 -0
- package/lib/types/PermissionIcon.d.ts.map +1 -0
- package/lib/types/PermissionIcon.js.map +1 -0
- package/lib/types/Pill.d.ts.map +1 -0
- package/lib/types/Pill.js.map +1 -0
- package/lib/types/QuotePreview.d.ts +17 -4
- package/lib/types/QuotePreview.d.ts.map +1 -0
- package/lib/types/QuotePreview.js.map +1 -0
- package/lib/types/ReadBlock.d.ts.map +1 -0
- package/lib/types/ReadBlock.js.map +1 -0
- package/lib/types/ReferenceIcon.d.ts.map +1 -0
- package/lib/types/ReferenceIcon.js.map +1 -0
- package/lib/types/RiskConfirmation.d.ts.map +1 -0
- package/lib/types/RiskConfirmation.js.map +1 -0
- package/lib/types/SearchBlock.d.ts.map +1 -0
- package/lib/types/SearchBlock.js.map +1 -0
- package/lib/types/SegmentedControl.d.ts.map +1 -0
- package/lib/types/SegmentedControl.js.map +1 -0
- package/lib/types/SegmentedTabs.d.ts.map +1 -0
- package/lib/types/SegmentedTabs.js.map +1 -0
- package/lib/types/ShortcutKeys.d.ts.map +1 -0
- package/lib/types/ShortcutKeys.js.map +1 -0
- package/lib/types/SiteGlyph.d.ts.map +1 -0
- package/lib/types/SiteGlyph.js.map +1 -0
- package/lib/types/StateDot.d.ts.map +1 -0
- package/lib/types/StateDot.js.map +1 -0
- package/lib/types/SubmenuPanel.d.ts +19 -0
- package/lib/types/SubmenuPanel.d.ts.map +1 -0
- package/lib/types/SubmenuPanel.js.map +1 -0
- package/lib/types/Switch.d.ts.map +1 -0
- package/lib/types/Switch.js.map +1 -0
- package/lib/types/Tag.d.ts.map +1 -0
- package/lib/types/Tag.js.map +1 -0
- package/lib/types/TerminalBlock.d.ts.map +1 -0
- package/lib/types/TerminalBlock.js.map +1 -0
- package/lib/types/TextShimmer.d.ts.map +1 -0
- package/lib/types/TextShimmer.js.map +1 -0
- package/lib/types/Toast.d.ts.map +1 -0
- package/lib/types/Toast.js.map +1 -0
- package/lib/types/Tooltip.d.ts.map +1 -0
- package/lib/types/Tooltip.js.map +1 -0
- package/lib/types/UserMessageBubble.d.ts.map +1 -0
- package/lib/types/UserMessageBubble.js.map +1 -0
- package/lib/types/WebBlock.d.ts.map +1 -0
- package/lib/types/WebBlock.js.map +1 -0
- package/lib/types/ZoomControls.d.ts.map +1 -0
- package/lib/types/ZoomControls.js.map +1 -0
- package/lib/types/ansi.d.ts.map +1 -0
- package/lib/types/ansi.js.map +1 -0
- package/lib/types/clipboard.d.ts.map +1 -0
- package/lib/types/clipboard.js.map +1 -0
- package/lib/types/code-file-icon-artwork.d.ts.map +1 -0
- package/lib/types/code-file-icon-artwork.js.map +1 -0
- package/lib/types/code-file-types.d.ts.map +1 -0
- package/lib/types/code-file-types.js.map +1 -0
- package/lib/types/code-highlighting.d.ts.map +1 -0
- package/lib/types/code-highlighting.js.map +1 -0
- package/lib/types/darwin-desktop.d.ts.map +1 -0
- package/lib/types/darwin-desktop.js.map +1 -0
- package/lib/types/document-zoom.d.ts.map +1 -0
- package/lib/types/document-zoom.js.map +1 -0
- package/lib/types/file-drag-actions.d.ts.map +1 -0
- package/lib/types/file-drag-actions.js.map +1 -0
- package/lib/types/file-size.d.ts.map +1 -0
- package/lib/types/file-size.js.map +1 -0
- package/lib/types/focus.d.ts.map +1 -0
- package/lib/types/focus.js.map +1 -0
- package/lib/types/guide-artwork.d.ts.map +1 -0
- package/lib/types/guide-artwork.js.map +1 -0
- package/lib/types/head-tail-cap.d.ts.map +1 -0
- package/lib/types/head-tail-cap.js.map +1 -0
- package/lib/types/icons/artwork.d.ts +12 -0
- package/lib/types/icons/artwork.d.ts.map +1 -0
- package/lib/types/icons/artwork.js.map +1 -0
- package/lib/types/icons/index.d.ts +12 -0
- package/lib/types/icons/index.d.ts.map +1 -0
- package/lib/types/icons/index.js.map +1 -0
- package/lib/types/icons/props.d.ts.map +1 -0
- package/lib/types/icons/props.js.map +1 -0
- package/lib/types/icons/shared-artwork.d.ts.map +1 -0
- package/lib/types/icons/shared-artwork.js.map +1 -0
- package/lib/types/image-drag.d.ts.map +1 -0
- package/lib/types/image-drag.js.map +1 -0
- package/lib/types/index.d.ts +5 -4
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/input-modality.d.ts.map +1 -0
- package/lib/types/input-modality.js.map +1 -0
- package/lib/types/keyboard-composition.d.ts.map +1 -0
- package/lib/types/keyboard-composition.js.map +1 -0
- package/lib/types/markdown/CodeBlock.d.ts +8 -1
- package/lib/types/markdown/CodeBlock.d.ts.map +1 -0
- package/lib/types/markdown/CodeBlock.js.map +1 -0
- package/lib/types/markdown/FenceBlocks.d.ts +31 -0
- package/lib/types/markdown/FenceBlocks.d.ts.map +1 -0
- package/lib/types/markdown/FenceBlocks.js.map +1 -0
- package/lib/types/markdown/JsonBlock.d.ts.map +1 -0
- package/lib/types/markdown/JsonBlock.js.map +1 -0
- package/lib/types/markdown/MarkdownDelegate.d.ts +23 -1
- package/lib/types/markdown/MarkdownDelegate.d.ts.map +1 -0
- package/lib/types/markdown/MarkdownDelegate.js.map +1 -0
- package/lib/types/markdown/MarkdownText.d.ts +2 -0
- package/lib/types/markdown/MarkdownText.d.ts.map +1 -0
- package/lib/types/markdown/MarkdownText.js.map +1 -0
- package/lib/types/markdown/cjkFriendlyStrong.d.ts.map +1 -0
- package/lib/types/markdown/cjkFriendlyStrong.js.map +1 -0
- package/lib/types/markdown/copy-tex.d.ts +14 -0
- package/lib/types/markdown/copy-tex.d.ts.map +1 -0
- package/lib/types/markdown/copy-tex.js.map +1 -0
- package/lib/types/markdown/diff-fence.d.ts +58 -0
- package/lib/types/markdown/diff-fence.d.ts.map +1 -0
- package/lib/types/markdown/diff-fence.js.map +1 -0
- package/lib/types/markdown/file-link.d.ts.map +1 -0
- package/lib/types/markdown/file-link.js.map +1 -0
- package/lib/types/markdown/highlight.d.ts +18 -0
- package/lib/types/markdown/highlight.d.ts.map +1 -0
- package/lib/types/markdown/highlight.js.map +1 -0
- package/lib/types/markdown/incremental.d.ts.map +1 -0
- package/lib/types/markdown/incremental.js.map +1 -0
- package/lib/types/markdown/katex.d.ts.map +1 -0
- package/lib/types/markdown/katex.js.map +1 -0
- package/lib/types/markdown/local-image-syntax.d.ts.map +1 -0
- package/lib/types/markdown/local-image-syntax.js.map +1 -0
- package/lib/types/markdown/mathCompatibility.d.ts.map +1 -0
- package/lib/types/markdown/mathCompatibility.js.map +1 -0
- package/lib/types/markdown/parse.d.ts.map +1 -0
- package/lib/types/markdown/parse.js.map +1 -0
- package/lib/types/markdown/plain-text.d.ts.map +1 -0
- package/lib/types/markdown/plain-text.js.map +1 -0
- package/lib/types/markdown/quote-text.d.ts.map +1 -0
- package/lib/types/markdown/quote-text.js.map +1 -0
- package/lib/types/markdown/render.d.ts.map +1 -0
- package/lib/types/markdown/render.js.map +1 -0
- package/lib/types/markdown/useViewportHighlighting.d.ts.map +1 -0
- package/lib/types/markdown/useViewportHighlighting.js.map +1 -0
- package/lib/types/markdown/windows-path-destinations.d.ts.map +1 -0
- package/lib/types/markdown/windows-path-destinations.js.map +1 -0
- package/lib/types/menu-submenu-position.d.ts +15 -0
- package/lib/types/menu-submenu-position.d.ts.map +1 -0
- package/lib/types/menu-submenu-position.js.map +1 -0
- package/lib/types/overlay-top-margin.d.ts.map +1 -0
- package/lib/types/overlay-top-margin.js.map +1 -0
- package/lib/types/plugin-artwork.d.ts.map +1 -0
- package/lib/types/plugin-artwork.js.map +1 -0
- package/lib/types/pointer-grace.d.ts.map +1 -0
- package/lib/types/pointer-grace.js.map +1 -0
- package/lib/types/rank-by-name.d.ts.map +1 -0
- package/lib/types/rank-by-name.js.map +1 -0
- package/lib/types/relative-time.d.ts.map +1 -0
- package/lib/types/relative-time.js.map +1 -0
- package/lib/types/settings-form/SettingsForm.d.ts.map +1 -0
- package/lib/types/settings-form/SettingsForm.js.map +1 -0
- package/lib/types/settings-form/fields.d.ts.map +1 -0
- package/lib/types/settings-form/fields.js.map +1 -0
- package/lib/types/settings-form/form-model.d.ts.map +1 -0
- package/lib/types/settings-form/form-model.js.map +1 -0
- package/lib/types/tooltip-placement.d.ts.map +1 -0
- package/lib/types/tooltip-placement.js.map +1 -0
- package/lib/types/use-clipboard-copy.d.ts.map +1 -0
- package/lib/types/use-clipboard-copy.js.map +1 -0
- package/lib/types/useAnchoredMaxHeight.d.ts.map +1 -0
- package/lib/types/useAnchoredMaxHeight.js.map +1 -0
- package/lib/types/useDismissOnOutsidePointer.d.ts.map +1 -0
- package/lib/types/useDismissOnOutsidePointer.js.map +1 -0
- package/lib/types/useMenuSubmenu.d.ts +43 -0
- package/lib/types/useMenuSubmenu.d.ts.map +1 -0
- package/lib/types/useMenuSubmenu.js.map +1 -0
- package/lib/types/useModalLayer.d.ts.map +1 -0
- package/lib/types/useModalLayer.js.map +1 -0
- package/lib/types/useRowDragPreview.d.ts.map +1 -0
- package/lib/types/useRowDragPreview.js.map +1 -0
- package/lib/types/user-text.d.ts.map +1 -0
- package/lib/types/user-text.js.map +1 -0
- package/package.json +11 -8
- package/src/AnimatedRows.module.css +7 -0
- package/src/AnimatedRows.tsx +195 -0
- package/src/BrandWordmark.tsx +59 -0
- package/src/Button.module.css +84 -0
- package/src/Button.tsx +36 -0
- package/src/Checkbox.module.css +28 -0
- package/src/Checkbox.tsx +34 -0
- package/src/CodeCard.module.css +85 -0
- package/src/CodeFileIcon.tsx +28 -0
- package/src/CodeToolbar.tsx +62 -0
- package/src/CommandText.module.css +12 -0
- package/src/CommandText.tsx +46 -0
- package/src/ConfigField.module.css +12 -0
- package/src/ConfigField.tsx +53 -0
- package/src/ConnectionIndicator.module.css +120 -0
- package/src/ConnectionIndicator.tsx +103 -0
- package/src/DetailDocument.module.css +67 -0
- package/src/DetailDocument.tsx +120 -0
- package/src/DiffBlock.module.css +82 -0
- package/src/DiffBlock.tsx +221 -0
- package/src/DisclosureRow.module.css +115 -0
- package/src/DisclosureRow.tsx +124 -0
- package/src/DraggableImage.tsx +26 -0
- package/src/FileTypeIcon.module.css +50 -0
- package/src/FileTypeIcon.tsx +285 -0
- package/src/FishLogo.tsx +28 -0
- package/src/FoldToggle.tsx +33 -0
- package/src/HoverCard.module.css +108 -0
- package/src/HoverCard.tsx +356 -0
- package/src/HoverCardGroup.tsx +77 -0
- package/src/ImageLightbox.module.css +54 -0
- package/src/ImageLightbox.tsx +72 -0
- package/src/ImagePreview.module.css +24 -0
- package/src/ImagePreview.tsx +36 -0
- package/src/InlineEditor.module.css +23 -0
- package/src/InlineEditor.tsx +69 -0
- package/src/Input.module.css +38 -0
- package/src/Input.tsx +24 -0
- package/src/JsonTree.module.css +371 -0
- package/src/JsonTree.tsx +850 -0
- package/src/LinkIcon.tsx +118 -0
- package/src/Menu.module.css +443 -0
- package/src/Menu.tsx +553 -0
- package/src/MenuGroup.module.css +37 -0
- package/src/MenuGroup.tsx +103 -0
- package/src/MenuRow.tsx +89 -0
- package/src/MenuSurface.module.css +65 -0
- package/src/MenuSurface.tsx +54 -0
- package/src/Modal.module.css +147 -0
- package/src/Modal.tsx +96 -0
- package/src/PathLabel.module.css +28 -0
- package/src/PathLabel.tsx +41 -0
- package/src/PermissionIcon.tsx +119 -0
- package/src/Pill.module.css +30 -0
- package/src/Pill.tsx +36 -0
- package/src/QuotePreview.module.css +138 -0
- package/src/QuotePreview.tsx +133 -0
- package/src/ReadBlock.module.css +45 -0
- package/src/ReadBlock.tsx +151 -0
- package/src/ReferenceIcon.tsx +49 -0
- package/src/RiskConfirmation.module.css +47 -0
- package/src/RiskConfirmation.tsx +79 -0
- package/src/RowDragPreview.module.css +12 -0
- package/src/SearchBlock.module.css +114 -0
- package/src/SearchBlock.tsx +281 -0
- package/src/SegmentedControl.module.css +81 -0
- package/src/SegmentedControl.tsx +140 -0
- package/src/SegmentedTabs.module.css +77 -0
- package/src/SegmentedTabs.tsx +84 -0
- package/src/ShortcutKeys.module.css +33 -0
- package/src/ShortcutKeys.tsx +12 -0
- package/src/SiteGlyph.tsx +149 -0
- package/src/StateDot.module.css +100 -0
- package/src/StateDot.tsx +77 -0
- package/src/SubmenuPanel.tsx +51 -0
- package/src/Switch.module.css +49 -0
- package/src/Switch.tsx +42 -0
- package/src/Tag.module.css +57 -0
- package/src/Tag.tsx +42 -0
- package/src/TerminalBlock.module.css +207 -0
- package/src/TerminalBlock.tsx +294 -0
- package/src/TextShimmer.module.css +88 -0
- package/src/TextShimmer.tsx +58 -0
- package/src/Toast.module.css +102 -0
- package/src/Toast.tsx +101 -0
- package/src/Tooltip.module.css +68 -0
- package/src/Tooltip.tsx +273 -0
- package/src/UserMessageBubble.module.css +11 -0
- package/src/UserMessageBubble.tsx +16 -0
- package/src/WebBlock.module.css +153 -0
- package/src/WebBlock.tsx +196 -0
- package/src/ZoomControls.module.css +54 -0
- package/src/ZoomControls.tsx +92 -0
- package/src/ansi.ts +447 -0
- package/src/clipboard.ts +47 -0
- package/src/code-file-icon-artwork.manifest.json +71 -0
- package/src/code-file-icon-artwork.ts +60 -0
- package/src/code-file-types.ts +340 -0
- package/src/code-highlighting.ts +25 -0
- package/src/css-modules.d.ts +6 -0
- package/src/darwin-desktop.ts +11 -0
- package/src/document-zoom.ts +12 -0
- package/src/file-drag-actions.ts +29 -0
- package/src/file-size.ts +16 -0
- package/src/focus.ts +44 -0
- package/src/guide-artwork.tsx +32 -0
- package/src/head-tail-cap.ts +27 -0
- package/src/icons/artwork.ts +156 -0
- package/src/icons/index.tsx +634 -0
- package/src/icons/props.ts +8 -0
- package/src/icons/shared-artwork.tsx +71 -0
- package/src/image-drag.ts +84 -0
- package/src/index.ts +142 -0
- package/src/input-modality.ts +59 -0
- package/src/keyboard-composition.ts +36 -0
- package/src/markdown/CodeBlock.module.css +209 -0
- package/src/markdown/CodeBlock.tsx +268 -0
- package/src/markdown/FenceBlocks.tsx +51 -0
- package/src/markdown/JsonBlock.module.css +34 -0
- package/src/markdown/JsonBlock.tsx +36 -0
- package/src/markdown/MarkdownDelegate.tsx +102 -0
- package/src/markdown/MarkdownText.module.css +511 -0
- package/src/markdown/MarkdownText.tsx +218 -0
- package/src/markdown/cjkFriendlyStrong.ts +83 -0
- package/src/markdown/copy-tex.ts +53 -0
- package/src/markdown/diff-fence.ts +212 -0
- package/src/markdown/file-link.ts +45 -0
- package/src/markdown/highlight.ts +689 -0
- package/src/markdown/incremental.ts +360 -0
- package/src/markdown/katex.tsx +90 -0
- package/src/markdown/local-image-syntax.ts +29 -0
- package/src/markdown/mathCompatibility.ts +349 -0
- package/src/markdown/parse.ts +49 -0
- package/src/markdown/plain-text.ts +121 -0
- package/src/markdown/quote-text.ts +10 -0
- package/src/markdown/render.tsx +834 -0
- package/src/markdown/useViewportHighlighting.ts +72 -0
- package/src/markdown/windows-path-destinations.ts +34 -0
- package/src/menu-submenu-position.ts +20 -0
- package/src/overlay-top-margin.ts +18 -0
- package/src/plugin-artwork.tsx +110 -0
- package/src/pointer-grace.ts +47 -0
- package/src/rank-by-name.ts +93 -0
- package/src/relative-time.ts +36 -0
- package/src/settings-form/SettingsForm.module.css +53 -0
- package/src/settings-form/SettingsForm.tsx +74 -0
- package/src/settings-form/fields.module.css +153 -0
- package/src/settings-form/fields.tsx +151 -0
- package/src/settings-form/form-model.ts +393 -0
- package/src/tooltip-placement.ts +60 -0
- package/src/use-clipboard-copy.ts +44 -0
- package/src/useAnchoredMaxHeight.ts +45 -0
- package/src/useDismissOnOutsidePointer.ts +34 -0
- package/src/useMenuSubmenu.ts +182 -0
- package/src/useModalLayer.ts +108 -0
- package/src/useRowDragPreview.ts +76 -0
- package/src/user-text.module.css +46 -0
- package/src/user-text.tsx +67 -0
- package/lib/types/useAnchoredPosition.d.ts +0 -36
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/* Shared disclosure header: [16px leading] gap 6 [title 13/24] at the default
|
|
2
|
+
size. The Settings font-size preference moves the row through the
|
|
3
|
+
body-published axis: title size follows the secondary tier
|
|
4
|
+
(--dsh-content-font-size-secondary: one step under the body — setting −1 at
|
|
5
|
+
≤14, setting −2 above), and the row height, leading box, and glyph edge
|
|
6
|
+
shift by the body px delta so the icon keeps its optical share of the
|
|
7
|
+
line. */
|
|
8
|
+
|
|
9
|
+
.root {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
width: 100%;
|
|
13
|
+
min-width: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.header {
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
min-width: 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.header[data-has-accessory] {
|
|
23
|
+
gap: 8px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.header[data-has-accessory] .row {
|
|
27
|
+
flex: 0 1 auto;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.row {
|
|
31
|
+
flex: 1 1 auto;
|
|
32
|
+
position: relative;
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
height: calc(24px + var(--dsh-content-font-delta, 0px));
|
|
37
|
+
min-width: 0;
|
|
38
|
+
color: var(--dsw-alias-label-tertiary);
|
|
39
|
+
transition: color 100ms ease;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.row[data-expandable] {
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@media (hover: hover) {
|
|
47
|
+
.row:hover {
|
|
48
|
+
color: var(--dsw-alias-label-secondary);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.leading {
|
|
53
|
+
position: relative;
|
|
54
|
+
flex: none;
|
|
55
|
+
width: calc(16px + var(--dsh-content-font-delta, 0px));
|
|
56
|
+
height: calc(16px + var(--dsh-content-font-delta, 0px));
|
|
57
|
+
display: inline-flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
justify-content: center;
|
|
60
|
+
margin-right: 6px;
|
|
61
|
+
padding: 0;
|
|
62
|
+
border: none;
|
|
63
|
+
background: none;
|
|
64
|
+
color: inherit;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* Flow-row glyphs render at 14px inside the 16px box; the CSS edge overrides
|
|
68
|
+
each svg's own width/height attributes so every registered icon scales
|
|
69
|
+
without a per-callsite size prop. StateDot (its svg carries data-state)
|
|
70
|
+
stays at its fixed figma size — it is a status mark, not text furniture. */
|
|
71
|
+
.leading svg:not([data-state]) {
|
|
72
|
+
width: calc(14px + var(--dsh-content-font-delta, 0px));
|
|
73
|
+
height: calc(14px + var(--dsh-content-font-delta, 0px));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
button.leading {
|
|
77
|
+
cursor: pointer;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.iconIdle {
|
|
81
|
+
display: inline-flex;
|
|
82
|
+
opacity: 1;
|
|
83
|
+
transition: opacity 100ms ease;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.chevronHover {
|
|
87
|
+
position: absolute;
|
|
88
|
+
inset: 0;
|
|
89
|
+
margin: auto;
|
|
90
|
+
opacity: 0;
|
|
91
|
+
transition: opacity 100ms ease;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
@media (hover: hover) {
|
|
95
|
+
.row:hover .iconIdle {
|
|
96
|
+
opacity: 0;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.row:hover .chevronHover {
|
|
100
|
+
opacity: 1;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.title {
|
|
105
|
+
flex: none;
|
|
106
|
+
font-size: var(--dsh-content-font-size-secondary, 13px);
|
|
107
|
+
line-height: calc(24px + var(--dsh-content-font-delta, 0px));
|
|
108
|
+
color: inherit;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@media (prefers-reduced-motion: reduce) {
|
|
112
|
+
.row {
|
|
113
|
+
transition: none;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { memo, type KeyboardEvent, type MouseEvent, type ReactNode } from 'react'
|
|
2
|
+
import clsx from 'clsx'
|
|
3
|
+
import { IconChevronDownOutlineRegular, IconChevronUpOutlineRegular } from './icons/index.tsx'
|
|
4
|
+
import { TextShimmer } from './TextShimmer.tsx'
|
|
5
|
+
import css from './DisclosureRow.module.css'
|
|
6
|
+
|
|
7
|
+
/** Shared 24px process row: tertiary text and icons, secondary on hover. */
|
|
8
|
+
export interface DisclosureRowProps {
|
|
9
|
+
icon: ReactNode
|
|
10
|
+
title: string
|
|
11
|
+
open: boolean
|
|
12
|
+
expandable: boolean
|
|
13
|
+
onToggle: () => void
|
|
14
|
+
/** Animate the complete header while its owning operation is running. */
|
|
15
|
+
running?: boolean | undefined
|
|
16
|
+
/** Makes the title row the disclosure target; with an accessory, it shrinks to its content width. */
|
|
17
|
+
expandOnRowClick?: boolean | undefined
|
|
18
|
+
/** Replaces the collapsed icon with a chevron while the row is hovered. */
|
|
19
|
+
previewChevron?: boolean | undefined
|
|
20
|
+
/** Keeps `collapsedContent` inline while open. */
|
|
21
|
+
keepContentWhenOpen?: boolean | undefined
|
|
22
|
+
collapsedContent?: ReactNode
|
|
23
|
+
/** Independent action beside the title, outside the disclosure target and shimmer. */
|
|
24
|
+
headerAccessory?: ReactNode
|
|
25
|
+
children?: ReactNode
|
|
26
|
+
className?: string | undefined
|
|
27
|
+
rowClassName?: string | undefined
|
|
28
|
+
/** Sizing class for the header text area, beside the leading icon. */
|
|
29
|
+
contentClassName?: string | undefined
|
|
30
|
+
/** Layout class shared by the header text and its decorative copy. */
|
|
31
|
+
contentLayoutClassName?: string | undefined
|
|
32
|
+
leadingClassName?: string | undefined
|
|
33
|
+
chevronClassName?: string | undefined
|
|
34
|
+
titleClassName?: string | undefined
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Render one disclosure header and its controlled expanded content.
|
|
39
|
+
* Shallow prop comparison requires stable callbacks and React nodes to skip unchanged renders.
|
|
40
|
+
* @param props - Visual content, controlled state, and interaction policy.
|
|
41
|
+
* @returns the disclosure row.
|
|
42
|
+
*/
|
|
43
|
+
export const DisclosureRow = memo(function DisclosureRow({
|
|
44
|
+
icon,
|
|
45
|
+
title,
|
|
46
|
+
open,
|
|
47
|
+
expandable,
|
|
48
|
+
onToggle,
|
|
49
|
+
running = false,
|
|
50
|
+
expandOnRowClick = false,
|
|
51
|
+
previewChevron = expandable,
|
|
52
|
+
keepContentWhenOpen = false,
|
|
53
|
+
collapsedContent,
|
|
54
|
+
headerAccessory,
|
|
55
|
+
children,
|
|
56
|
+
className,
|
|
57
|
+
rowClassName,
|
|
58
|
+
contentClassName,
|
|
59
|
+
contentLayoutClassName,
|
|
60
|
+
leadingClassName,
|
|
61
|
+
chevronClassName,
|
|
62
|
+
titleClassName,
|
|
63
|
+
}: DisclosureRowProps) {
|
|
64
|
+
const rowExpands = expandable && expandOnRowClick
|
|
65
|
+
const toggleFromLeading = (event: MouseEvent<HTMLButtonElement>) => {
|
|
66
|
+
event.stopPropagation()
|
|
67
|
+
onToggle()
|
|
68
|
+
}
|
|
69
|
+
const toggleFromKeyboard = (event: KeyboardEvent<HTMLDivElement>) => {
|
|
70
|
+
if (!rowExpands || (event.key !== 'Enter' && event.key !== ' ')) return
|
|
71
|
+
event.preventDefault()
|
|
72
|
+
onToggle()
|
|
73
|
+
}
|
|
74
|
+
const collapsedLeading = previewChevron
|
|
75
|
+
? (
|
|
76
|
+
<>
|
|
77
|
+
<span className={css.iconIdle}>{icon}</span>
|
|
78
|
+
<IconChevronDownOutlineRegular className={clsx(chevronClassName, css.chevronHover)} />
|
|
79
|
+
</>
|
|
80
|
+
)
|
|
81
|
+
: icon
|
|
82
|
+
const leading = open
|
|
83
|
+
? <IconChevronUpOutlineRegular className={chevronClassName} />
|
|
84
|
+
: collapsedLeading
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<div className={clsx(css.root, className)} data-open={open || undefined}>
|
|
88
|
+
<div className={css.header} data-disclosure-header data-has-accessory={!!headerAccessory || undefined}>
|
|
89
|
+
<div
|
|
90
|
+
className={clsx(css.row, rowClassName)}
|
|
91
|
+
data-disclosure-row
|
|
92
|
+
data-expandable={rowExpands || undefined}
|
|
93
|
+
role={rowExpands ? 'button' : undefined}
|
|
94
|
+
tabIndex={rowExpands ? 0 : undefined}
|
|
95
|
+
aria-expanded={rowExpands ? open : undefined}
|
|
96
|
+
onClick={rowExpands ? onToggle : undefined}
|
|
97
|
+
onKeyDown={rowExpands ? toggleFromKeyboard : undefined}
|
|
98
|
+
>
|
|
99
|
+
{expandable && !rowExpands ? (
|
|
100
|
+
<button
|
|
101
|
+
type="button"
|
|
102
|
+
className={clsx(css.leading, leadingClassName)}
|
|
103
|
+
aria-label={title}
|
|
104
|
+
aria-expanded={open}
|
|
105
|
+
onClick={toggleFromLeading}
|
|
106
|
+
>
|
|
107
|
+
{leading}
|
|
108
|
+
</button>
|
|
109
|
+
) : (
|
|
110
|
+
<span className={clsx(css.leading, leadingClassName)}>
|
|
111
|
+
{leading}
|
|
112
|
+
</span>
|
|
113
|
+
)}
|
|
114
|
+
<TextShimmer active={running} className={contentClassName} contentClassName={contentLayoutClassName}>
|
|
115
|
+
<TextShimmer className={clsx(css.title, titleClassName)}>{title}</TextShimmer>
|
|
116
|
+
{(keepContentWhenOpen || !open) && collapsedContent}
|
|
117
|
+
</TextShimmer>
|
|
118
|
+
</div>
|
|
119
|
+
{headerAccessory}
|
|
120
|
+
</div>
|
|
121
|
+
{open && children}
|
|
122
|
+
</div>
|
|
123
|
+
)
|
|
124
|
+
})
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Original-image drag gestures owned by a presentation primitive. */
|
|
2
|
+
import { forwardRef, type ImgHTMLAttributes } from 'react'
|
|
3
|
+
import { useImageDrag } from './image-drag.ts'
|
|
4
|
+
import type { FileDragActions } from './file-drag-actions.ts'
|
|
5
|
+
|
|
6
|
+
/** Image presentation plus original content and explicit file preparation callbacks. */
|
|
7
|
+
export interface DraggableImageProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, 'src' | 'draggable' | 'onDragStart' | 'onDragEnd' | 'onPointerEnter' | 'onPointerLeave' | 'onPointerDown' | 'onPointerUp' | 'onClickCapture'> {
|
|
8
|
+
readonly fileDrag: FileDragActions
|
|
9
|
+
readonly src: string
|
|
10
|
+
readonly name: string
|
|
11
|
+
readonly resourceAddress?: string | undefined
|
|
12
|
+
readonly original?: File | undefined
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Render an image with original-file dragging; using explicit application-owned callbacks.
|
|
17
|
+
* @param props - image attributes, original filename and file preparation callbacks.
|
|
18
|
+
* @param ref - image element for measurement and pointer-mode bindings.
|
|
19
|
+
* @returns a draggable image that suppresses only the mouse click following its drag.
|
|
20
|
+
*/
|
|
21
|
+
export const DraggableImage = forwardRef<HTMLImageElement, DraggableImageProps>(function DraggableImage(
|
|
22
|
+
{ fileDrag, src, name, original, resourceAddress, ...props }, ref,
|
|
23
|
+
) {
|
|
24
|
+
const drag = useImageDrag(fileDrag, src, name, original, resourceAddress)
|
|
25
|
+
return <img {...props} {...drag} src={src} ref={ref} draggable />
|
|
26
|
+
})
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
.icon {
|
|
2
|
+
/* The design platform has no violet token matching the supplied image/video artwork. */
|
|
3
|
+
--dsh-file-type-violet: rgb(139, 118, 246);
|
|
4
|
+
|
|
5
|
+
color: var(--dsh-file-type-icon-color, var(--dsh-file-type-default-color));
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.code {
|
|
9
|
+
--dsh-file-type-default-color: var(--dsw-static-deepseek-500);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.excel {
|
|
13
|
+
--dsh-file-type-default-color: var(--dsw-static-green-500);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.folder {
|
|
17
|
+
--dsh-file-type-default-color: var(--dsw-static-amber-400);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.html {
|
|
21
|
+
--dsh-file-type-default-color: var(--dsw-static-deepseek-500);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.image {
|
|
25
|
+
--dsh-file-type-default-color: var(--dsh-file-type-violet);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.markdown {
|
|
29
|
+
--dsh-file-type-default-color: var(--dsw-static-deepseek-500);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.other {
|
|
33
|
+
--dsh-file-type-default-color: var(--dsw-static-neutral-bluish-300);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.pdf {
|
|
37
|
+
--dsh-file-type-default-color: var(--dsw-static-red-600);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.ppt {
|
|
41
|
+
--dsh-file-type-default-color: var(--dsw-static-amber-500);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.video {
|
|
45
|
+
--dsh-file-type-default-color: var(--dsh-file-type-violet);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.word {
|
|
49
|
+
--dsh-file-type-default-color: var(--dsw-static-deepseek-450);
|
|
50
|
+
}
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import type { ReactNode } from 'react'
|
|
2
|
+
import clsx from 'clsx'
|
|
3
|
+
import { CodeFileIcon } from './CodeFileIcon.tsx'
|
|
4
|
+
import {
|
|
5
|
+
classifyCodeFileType, isCodeFileType, type CodeFileType, type FileTypeProjectContext,
|
|
6
|
+
} from './code-file-types.ts'
|
|
7
|
+
import type { IconProps } from './icons/props.ts'
|
|
8
|
+
import css from './FileTypeIcon.module.css'
|
|
9
|
+
|
|
10
|
+
/** File categories with distinct 28px glyphs. */
|
|
11
|
+
export type FileType =
|
|
12
|
+
| CodeFileType
|
|
13
|
+
| 'code'
|
|
14
|
+
| 'excel'
|
|
15
|
+
| 'folder'
|
|
16
|
+
| 'html'
|
|
17
|
+
| 'image'
|
|
18
|
+
| 'markdown'
|
|
19
|
+
| 'other'
|
|
20
|
+
| 'pdf'
|
|
21
|
+
| 'ppt'
|
|
22
|
+
| 'video'
|
|
23
|
+
| 'word'
|
|
24
|
+
|
|
25
|
+
/** Compatibility name for consumers that pass an already resolved category. */
|
|
26
|
+
export type FileTypeKind = FileType
|
|
27
|
+
|
|
28
|
+
type ClassifiedFileType = Exclude<FileType, 'folder'>
|
|
29
|
+
type TraditionalFileType = Exclude<FileType, CodeFileType>
|
|
30
|
+
|
|
31
|
+
export type { CodeFileType, FileTypeProjectContext } from './code-file-types.ts'
|
|
32
|
+
|
|
33
|
+
/** Props for {@link FileTypeIcon}: either a path to classify or an already resolved kind. */
|
|
34
|
+
export type FileTypeIconProps = IconProps & (
|
|
35
|
+
| {
|
|
36
|
+
/** File path or name to classify. */
|
|
37
|
+
readonly path: string
|
|
38
|
+
/** Optional project-file snapshot for context-sensitive code icons such as Flutter. */
|
|
39
|
+
readonly context?: FileTypeProjectContext | undefined
|
|
40
|
+
}
|
|
41
|
+
| {
|
|
42
|
+
/** Explicit category for callers that already resolved the file type. */
|
|
43
|
+
readonly kind: FileTypeKind
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
// Maps, not objects: a basename or extension equal to an `Object.prototype` key
|
|
48
|
+
// (`constructor`, `__proto__`) must miss instead of resolving the inherited member.
|
|
49
|
+
const EXTENSION_TYPES: ReadonlyMap<string, ClassifiedFileType> = new Map(Object.entries({
|
|
50
|
+
scss: 'code',
|
|
51
|
+
sass: 'code',
|
|
52
|
+
less: 'code',
|
|
53
|
+
vue: 'code',
|
|
54
|
+
svelte: 'code',
|
|
55
|
+
astro: 'code',
|
|
56
|
+
bat: 'code',
|
|
57
|
+
cmd: 'code',
|
|
58
|
+
csv: 'excel',
|
|
59
|
+
tsv: 'excel',
|
|
60
|
+
html: 'html',
|
|
61
|
+
htm: 'html',
|
|
62
|
+
png: 'image',
|
|
63
|
+
jpg: 'image',
|
|
64
|
+
jpeg: 'image',
|
|
65
|
+
gif: 'image',
|
|
66
|
+
svg: 'image',
|
|
67
|
+
webp: 'image',
|
|
68
|
+
avif: 'image',
|
|
69
|
+
bmp: 'image',
|
|
70
|
+
ico: 'image',
|
|
71
|
+
tif: 'image',
|
|
72
|
+
tiff: 'image',
|
|
73
|
+
heic: 'image',
|
|
74
|
+
heif: 'image',
|
|
75
|
+
md: 'markdown',
|
|
76
|
+
mdx: 'markdown',
|
|
77
|
+
markdown: 'markdown',
|
|
78
|
+
pdf: 'pdf',
|
|
79
|
+
ppt: 'ppt',
|
|
80
|
+
pptx: 'ppt',
|
|
81
|
+
key: 'ppt',
|
|
82
|
+
mp4: 'video',
|
|
83
|
+
mov: 'video',
|
|
84
|
+
m4v: 'video',
|
|
85
|
+
webm: 'video',
|
|
86
|
+
mkv: 'video',
|
|
87
|
+
avi: 'video',
|
|
88
|
+
mpg: 'video',
|
|
89
|
+
mpeg: 'video',
|
|
90
|
+
doc: 'word',
|
|
91
|
+
docx: 'word',
|
|
92
|
+
rtf: 'word',
|
|
93
|
+
odt: 'word',
|
|
94
|
+
pages: 'word',
|
|
95
|
+
xls: 'excel',
|
|
96
|
+
xlsx: 'excel',
|
|
97
|
+
xlsm: 'excel',
|
|
98
|
+
xlsb: 'excel',
|
|
99
|
+
xlt: 'excel',
|
|
100
|
+
xltx: 'excel',
|
|
101
|
+
xltm: 'excel',
|
|
102
|
+
ods: 'excel',
|
|
103
|
+
ots: 'excel',
|
|
104
|
+
fods: 'excel',
|
|
105
|
+
numbers: 'excel',
|
|
106
|
+
}))
|
|
107
|
+
|
|
108
|
+
const NAME_TYPES: ReadonlyMap<string, ClassifiedFileType> = new Map(Object.entries({
|
|
109
|
+
changelog: 'markdown',
|
|
110
|
+
contributing: 'markdown',
|
|
111
|
+
readme: 'markdown',
|
|
112
|
+
}))
|
|
113
|
+
|
|
114
|
+
function basename(path: string): string {
|
|
115
|
+
return path.slice(Math.max(path.lastIndexOf('/'), path.lastIndexOf('\\')) + 1)
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Extract the final suffix from a file path without changing its case.
|
|
120
|
+
* A leading dot starts a suffix, while a missing or trailing dot returns an empty string.
|
|
121
|
+
* @param path - File path or basename using either path separator.
|
|
122
|
+
* @returns The characters after the basename's final dot.
|
|
123
|
+
*/
|
|
124
|
+
export function fileExtension(path: string): string {
|
|
125
|
+
const name = basename(path)
|
|
126
|
+
const dot = name.lastIndexOf('.')
|
|
127
|
+
return dot < 0 ? '' : name.slice(dot + 1)
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Classify a file path or name for file-card presentation.
|
|
132
|
+
* Matching is case-insensitive and applies code filename rules before extension rules;
|
|
133
|
+
* unknown names fall back to `other`.
|
|
134
|
+
* @param path - File path or basename using either path separator.
|
|
135
|
+
* @param context - Optional project files used by context-sensitive code mappings.
|
|
136
|
+
* @returns The file's closed presentation category.
|
|
137
|
+
*/
|
|
138
|
+
export function classifyFileType(
|
|
139
|
+
path: string,
|
|
140
|
+
context?: FileTypeProjectContext,
|
|
141
|
+
): ClassifiedFileType {
|
|
142
|
+
const name = basename(path).toLowerCase()
|
|
143
|
+
const extension = fileExtension(name).toLowerCase()
|
|
144
|
+
return classifyCodeFileType(name, extension, context)
|
|
145
|
+
?? NAME_TYPES.get(name)
|
|
146
|
+
?? EXTENSION_TYPES.get(extension)
|
|
147
|
+
?? 'other'
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const FILE_BODY = 'M8.48924 28H19.5108C21.6479 28 22.7165 28 23.5594 27.6509C24.6833 27.1853 25.5762 26.2924 26.0417 25.1685C26.3909 24.3256 26.3909 23.257 26.3909 21.1199V8.79443C26.3909 8.32877 26.3909 8.09593 26.3471 7.87507C26.2887 7.58058 26.173 7.30042 26.0067 7.05048C25.882 6.86303 25.7177 6.69799 25.3893 6.36792L20.0611 1.01354C19.7304 0.681235 19.5651 0.515081 19.3769 0.38885C19.126 0.220541 18.8443 0.103463 18.5481 0.0443412C18.3259 0 18.0915 0 17.6226 0H8.48924C6.35209 0 5.28351 0 4.4406 0.349145C3.31672 0.814671 2.4238 1.70759 1.95828 2.83147C1.60913 3.67438 1.60913 4.74296 1.60913 6.88011V21.1199C1.60913 23.257 1.60913 24.3256 1.95828 25.1685C2.4238 26.2924 3.31672 27.1853 4.4406 27.6509C5.28351 28 6.35209 28 8.48924 28Z'
|
|
151
|
+
const FILE_FOLD = 'M26.3909 7.37445L19.0525 0V3.77445C19.0525 4.89271 19.0525 5.45184 19.2352 5.89289C19.4788 6.48096 19.946 6.94818 20.5341 7.19176C20.9751 7.37445 21.5342 7.37445 22.6525 7.37445H26.3909Z'
|
|
152
|
+
const FILE_MARK_TRANSFORM = 'translate(14 16) scale(1.12) translate(-14 -16)'
|
|
153
|
+
const LARGE_FILE_MARK_TRANSFORM = 'translate(14 16) scale(1.22) translate(-14 -16)'
|
|
154
|
+
const FOLDER_MARK_TRANSFORM = 'translate(14 13.0693) scale(1.12) translate(-14 -13.0693)'
|
|
155
|
+
|
|
156
|
+
function FileGlyph({
|
|
157
|
+
size, className, children, markTransform, muted = false,
|
|
158
|
+
}: IconProps & { children?: ReactNode; markTransform?: string; muted?: boolean }): ReactNode {
|
|
159
|
+
return (
|
|
160
|
+
<svg width={size} height={size} className={className} viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden>
|
|
161
|
+
<path d={FILE_BODY} fill="currentColor" />
|
|
162
|
+
{muted
|
|
163
|
+
? <path d={FILE_FOLD} fill="var(--dsw-static-neutral-400)" />
|
|
164
|
+
: <path d={FILE_FOLD} fill="var(--dsw-static-neutral-00)" fillOpacity=".7" />}
|
|
165
|
+
{children !== undefined && (
|
|
166
|
+
<g color="var(--dsw-static-neutral-00)" data-file-type-mark transform={markTransform}>{children}</g>
|
|
167
|
+
)}
|
|
168
|
+
</svg>
|
|
169
|
+
)
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function FolderGlyph({ size, className }: IconProps): ReactNode {
|
|
173
|
+
return (
|
|
174
|
+
<svg width={size} height={size} className={className} viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden>
|
|
175
|
+
<path
|
|
176
|
+
d="M2.80078 10.2112C2.80078 9.52802 2.80078 9.18642 2.85314 8.866C2.98648 8.05 3.36942 7.29538 3.94925 6.70595C4.17694 6.4745 4.45264 6.2728 5.00404 5.86939C5.29197 5.65874 5.43594 5.55342 5.58711 5.46632C5.97089 5.24521 6.39638 5.10618 6.83667 5.05803C7.01011 5.03906 7.18849 5.03906 7.54524 5.03906H11.6543C12.4669 5.03906 12.8732 5.03906 13.2599 5.13697C13.3882 5.16945 13.5143 5.20986 13.6375 5.25795C14.0091 5.40294 14.3398 5.63902 15.0012 6.1112L16.2632 7.01224C16.5526 7.21881 16.6972 7.3221 16.8598 7.38553C16.9137 7.40657 16.9689 7.42425 17.025 7.43846C17.1942 7.4813 17.372 7.4813 17.7275 7.4813H19.8008C22.0506 7.4813 23.1755 7.4813 23.9641 8.05425C24.2188 8.23928 24.4428 8.46326 24.6278 8.71794C25.2008 9.50654 25.2008 10.6315 25.2008 12.8813V18.7283C25.2008 20.9781 25.2008 22.1031 24.6278 22.8917C24.4428 23.1463 24.2188 23.3703 23.9641 23.5554C23.1755 24.1283 22.0506 24.1283 19.8008 24.1283H8.20077C5.95094 24.1283 4.82602 24.1283 4.03743 23.5554C3.78274 23.3703 3.55877 23.1463 3.37373 22.8917C2.80078 22.1031 2.80078 20.9781 2.80078 18.7283V10.2112Z"
|
|
177
|
+
fill="currentColor"
|
|
178
|
+
/>
|
|
179
|
+
<g color="var(--dsw-static-neutral-00)" data-file-type-mark transform={FOLDER_MARK_TRANSFORM}>
|
|
180
|
+
<path d="M6.31445 13.0693H21.6893" stroke="currentColor" strokeWidth="2.38" />
|
|
181
|
+
</g>
|
|
182
|
+
</svg>
|
|
183
|
+
)
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function SpreadsheetGlyph({ size, className }: IconProps): ReactNode {
|
|
187
|
+
return (
|
|
188
|
+
<FileGlyph size={size} className={className}>
|
|
189
|
+
<path
|
|
190
|
+
d="M14 11.5H11.4C10.5599 11.5 10.1399 11.5 9.81901 11.6635C9.53677 11.8073 9.3073 12.0368 9.16349 12.319C9 12.6399 9 13.0599 9 13.9V16.5M14 11.5H16.6C17.4401 11.5 17.8601 11.5 18.181 11.6635C18.4632 11.8073 18.6927 12.0368 18.8365 12.319C19 12.6399 19 13.0599 19 13.9V16.5M14 11.5V21.5M14 21.5H16.6C17.4401 21.5 17.8601 21.5 18.181 21.3365C18.4632 21.1927 18.6927 20.9632 18.8365 20.681C19 20.3601 19 19.9401 19 19.1V16.5M14 21.5H11.4C10.5599 21.5 10.1399 21.5 9.81901 21.3365C9.53677 21.1927 9.3073 20.9632 9.16349 20.681C9 20.3601 9 19.9401 9 19.1V16.5M19 16.5H9"
|
|
191
|
+
stroke="currentColor"
|
|
192
|
+
strokeWidth="1.2"
|
|
193
|
+
/>
|
|
194
|
+
</FileGlyph>
|
|
195
|
+
)
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function glyph(type: TraditionalFileType, size: number, className: string | undefined): ReactNode {
|
|
199
|
+
switch (type) {
|
|
200
|
+
case 'code':
|
|
201
|
+
return (
|
|
202
|
+
<FileGlyph size={size} className={className}>
|
|
203
|
+
<path d="M10.0053 13.126L7.0236 16.3788C6.96052 16.4476 6.96052 16.5532 7.0236 16.622L10.0053 19.8748" stroke="currentColor" strokeWidth="1.35" />
|
|
204
|
+
<path d="M17.9941 13.126L20.9759 16.3788C21.039 16.4476 21.039 16.5532 20.9759 16.622L17.9941 19.8748" stroke="currentColor" strokeWidth="1.35" />
|
|
205
|
+
<path d="M15.2652 12.957L12.7344 20.0433" stroke="currentColor" strokeWidth="1.35" />
|
|
206
|
+
</FileGlyph>
|
|
207
|
+
)
|
|
208
|
+
case 'excel': return <SpreadsheetGlyph size={size} className={className} />
|
|
209
|
+
case 'folder': return <FolderGlyph size={size} className={className} />
|
|
210
|
+
case 'html':
|
|
211
|
+
return (
|
|
212
|
+
<FileGlyph size={size} className={className} markTransform={FILE_MARK_TRANSFORM}>
|
|
213
|
+
<path
|
|
214
|
+
fillRule="evenodd"
|
|
215
|
+
clipRule="evenodd"
|
|
216
|
+
d="M13.9994 9.68298C17.212 9.68298 19.8167 12.2872 19.8168 15.4997C19.8168 18.7123 17.2121 21.3171 13.9994 21.3171C10.7869 21.3169 8.18274 18.7122 8.18274 15.4997C8.1829 12.2873 10.787 9.68315 13.9994 9.68298ZM9.26213 16.0247C9.47025 17.9241 10.7936 19.4876 12.5639 20.0463C12.42 19.7977 12.2952 19.5152 12.1879 19.2116C11.885 18.3541 11.693 17.2434 11.6424 16.0247H9.26213ZM16.3565 16.0247C16.3059 17.2434 16.1145 18.3542 15.8116 19.2116C15.7044 19.5151 15.5788 19.7971 15.435 20.0456C17.2054 19.487 18.5293 17.9242 18.7374 16.0247H16.3565ZM12.6938 16.0247C12.7439 17.1459 12.9212 18.1334 13.1784 18.8616C13.332 19.2962 13.503 19.61 13.6686 19.805C13.834 19.9996 13.9473 20.0256 13.9994 20.0258C14.0514 20.0258 14.1651 20.0002 14.331 19.805C14.4966 19.61 14.6676 19.2962 14.8211 18.8616C15.0784 18.1334 15.2557 17.1459 15.3058 16.0247H12.6938ZM13.9994 10.733C13.9473 10.7331 13.834 10.7598 13.6686 10.9545C13.503 11.1494 13.3319 11.4633 13.1784 11.8978C12.903 12.6777 12.7188 13.7545 12.6849 14.9747H15.3147C15.2808 13.7545 15.0966 12.6777 14.8211 11.8978C14.6676 11.4633 14.4965 11.1494 14.331 10.9545C14.1651 10.7593 14.0514 10.733 13.9994 10.733ZM15.5888 11.0051C15.6701 11.1756 15.7444 11.3576 15.8116 11.5478C16.1343 12.4613 16.3308 13.6619 16.3647 14.9747H18.7374C18.5352 13.1307 17.2817 11.6036 15.5888 11.0051ZM12.4101 11.0051C10.7174 11.6037 9.46428 13.1308 9.26213 14.9747H11.6349C11.6688 13.6619 11.8652 12.4613 12.1879 11.5478C12.2551 11.3577 12.3288 11.1756 12.4101 11.0051Z"
|
|
217
|
+
fill="currentColor"
|
|
218
|
+
/>
|
|
219
|
+
</FileGlyph>
|
|
220
|
+
)
|
|
221
|
+
case 'image':
|
|
222
|
+
return (
|
|
223
|
+
<FileGlyph size={size} className={className} markTransform={FILE_MARK_TRANSFORM}>
|
|
224
|
+
<path d="M10.4212 15.9204C10.5756 15.6558 10.9579 15.6558 11.1123 15.9204L13.6493 20.2696C13.8048 20.5362 13.6125 20.8711 13.3037 20.8711H8.22974C7.92102 20.8711 7.72868 20.5362 7.88423 20.2696L10.4212 15.9204Z" fill="currentColor" />
|
|
225
|
+
<path d="M15.4981 13.186C15.6505 12.9117 16.0451 12.9117 16.1975 13.186L20.1368 20.2769C20.2849 20.5435 20.0922 20.8711 19.7872 20.8711H11.9084C11.6034 20.8711 11.4107 20.5435 11.5588 20.2769L15.4981 13.186Z" fill="currentColor" />
|
|
226
|
+
<path d="M11.8603 11.3997C11.8603 12.286 11.1418 13.0045 10.2555 13.0045C9.36924 13.0045 8.65076 12.286 8.65076 11.3997C8.65076 10.5134 9.36924 9.79492 10.2555 9.79492C11.1418 9.79492 11.8603 10.5134 11.8603 11.3997Z" fill="currentColor" />
|
|
227
|
+
</FileGlyph>
|
|
228
|
+
)
|
|
229
|
+
case 'markdown':
|
|
230
|
+
return (
|
|
231
|
+
<FileGlyph size={size} className={className} markTransform={LARGE_FILE_MARK_TRANSFORM}>
|
|
232
|
+
<path d="M8.7588 19.5V14.6H9.8998L11.9298 17.932H11.3278L13.3018 14.6H14.4428L14.4568 19.5H13.1828L13.1688 16.539H13.3858L11.9088 19.017H11.2928L9.7738 16.539H10.0398V19.5H8.7588ZM15.4375 19.5V14.6H17.7545C18.2958 14.6 18.7718 14.7003 19.1825 14.901C19.5932 15.1017 19.9128 15.384 20.1415 15.748C20.3748 16.112 20.4915 16.546 20.4915 17.05C20.4915 17.5493 20.3748 17.9833 20.1415 18.352C19.9128 18.716 19.5932 18.9983 19.1825 19.199C18.7718 19.3997 18.2958 19.5 17.7545 19.5H15.4375ZM16.8235 18.394H17.6985C17.9785 18.394 18.2212 18.3427 18.4265 18.24C18.6365 18.1327 18.7998 17.9787 18.9165 17.778C19.0332 17.5727 19.0915 17.33 19.0915 17.05C19.0915 16.7653 19.0332 16.5227 18.9165 16.322C18.7998 16.1213 18.6365 15.9697 18.4265 15.867C18.2212 15.7597 17.9785 15.706 17.6985 15.706H16.8235V18.394Z" fill="currentColor" />
|
|
233
|
+
</FileGlyph>
|
|
234
|
+
)
|
|
235
|
+
case 'other': return <FileGlyph size={size} className={className} muted />
|
|
236
|
+
case 'pdf':
|
|
237
|
+
return (
|
|
238
|
+
<FileGlyph size={size} className={className} markTransform={LARGE_FILE_MARK_TRANSFORM}>
|
|
239
|
+
<path d="M6.80616 19.5V14.6H9.04616C9.49416 14.6 9.87916 14.6723 10.2012 14.817C10.5278 14.9617 10.7798 15.1717 10.9572 15.447C11.1345 15.7177 11.2232 16.0397 11.2232 16.413C11.2232 16.7817 11.1345 17.1013 10.9572 17.372C10.7798 17.6427 10.5278 17.8527 10.2012 18.002C9.87916 18.1467 9.49416 18.219 9.04616 18.219H7.57616L8.19216 17.617V19.5H6.80616ZM8.19216 17.764L7.57616 17.127H8.96216C9.2515 17.127 9.46616 17.064 9.60616 16.938C9.75083 16.812 9.82316 16.637 9.82316 16.413C9.82316 16.1843 9.75083 16.007 9.60616 15.881C9.46616 15.755 9.2515 15.692 8.96216 15.692H7.57616L8.19216 15.055V17.764ZM11.8989 19.5V14.6H14.2159C14.7573 14.6 15.2333 14.7003 15.6439 14.901C16.0546 15.1017 16.3743 15.384 16.6029 15.748C16.8363 16.112 16.9529 16.546 16.9529 17.05C16.9529 17.5493 16.8363 17.9833 16.6029 18.352C16.3743 18.716 16.0546 18.9983 15.6439 19.199C15.2333 19.3997 14.7573 19.5 14.2159 19.5H11.8989ZM13.2849 18.394H14.1599C14.4399 18.394 14.6826 18.3427 14.8879 18.24C15.0979 18.1327 15.2613 17.9787 15.3779 17.778C15.4946 17.5727 15.5529 17.33 15.5529 17.05C15.5529 16.7653 15.4946 16.5227 15.3779 16.322C15.2613 16.1213 15.0979 15.9697 14.8879 15.867C14.6826 15.7597 14.4399 15.706 14.1599 15.706H13.2849V18.394ZM17.6821 19.5V14.6H21.5251V15.671H19.0681V19.5H17.6821ZM18.9701 17.82V16.749H21.2311V17.82H18.9701Z" fill="currentColor" />
|
|
240
|
+
</FileGlyph>
|
|
241
|
+
)
|
|
242
|
+
case 'ppt':
|
|
243
|
+
return (
|
|
244
|
+
<FileGlyph size={size} className={className} markTransform={LARGE_FILE_MARK_TRANSFORM}>
|
|
245
|
+
<path d="M11.0132 20.5V13.5H14.2132C14.8532 13.5 15.4032 13.6033 15.8632 13.81C16.3299 14.0167 16.6899 14.3167 16.9432 14.71C17.1966 15.0967 17.3232 15.5567 17.3232 16.09C17.3232 16.6167 17.1966 17.0733 16.9432 17.46C16.6899 17.8467 16.3299 18.1467 15.8632 18.36C15.4032 18.5667 14.8532 18.67 14.2132 18.67H12.1132L12.9932 17.81V20.5H11.0132ZM12.9932 18.02L12.1132 17.11H14.0932C14.5066 17.11 14.8132 17.02 15.0132 16.84C15.2199 16.66 15.3232 16.41 15.3232 16.09C15.3232 15.7633 15.2199 15.51 15.0132 15.33C14.8132 15.15 14.5066 15.06 14.0932 15.06H12.1132L12.9932 14.15V18.02Z" fill="currentColor" />
|
|
246
|
+
</FileGlyph>
|
|
247
|
+
)
|
|
248
|
+
case 'video':
|
|
249
|
+
return (
|
|
250
|
+
<FileGlyph size={size} className={className} markTransform={FILE_MARK_TRANSFORM}>
|
|
251
|
+
<path d="M17.5 14.634C18.1667 15.0189 18.1667 15.9811 17.5 16.366L11.5 19.8301C10.8333 20.215 10 19.7339 10 18.9641L10 12.0359C10 11.2661 10.8333 10.785 11.5 11.1699L17.5 14.634Z" fill="currentColor" />
|
|
252
|
+
</FileGlyph>
|
|
253
|
+
)
|
|
254
|
+
case 'word':
|
|
255
|
+
return (
|
|
256
|
+
<FileGlyph size={size} className={className} markTransform={LARGE_FILE_MARK_TRANSFORM}>
|
|
257
|
+
<path d="M10.5118 20.5L8.24179 13.5H10.2818L12.1918 19.56H11.1618L13.1718 13.5H14.9918L16.8918 19.56H15.9018L17.8718 13.5H19.7618L17.4918 20.5H15.3718L13.7518 15.35H14.3218L12.6318 20.5H10.5118Z" fill="currentColor" />
|
|
258
|
+
</FileGlyph>
|
|
259
|
+
)
|
|
260
|
+
/* v8 ignore next -- closed-union backstop; only reached if a type is forged */
|
|
261
|
+
default: return assertNever(type)
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/** Closed-union exhaustiveness guard for traditional file artwork. */
|
|
266
|
+
/* v8 ignore next 3 -- only reachable when an untyped caller forges a traditional file type */
|
|
267
|
+
function assertNever(value: never): never {
|
|
268
|
+
throw new Error(`unreachable traditional file type: ${String(value)}`)
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Render a decorative file-type glyph for a path or an explicitly resolved kind.
|
|
273
|
+
* @param props - Path or kind selection, optional project context, size, and CSS class.
|
|
274
|
+
* @returns The category-colored SVG; the caller owns the accessible name and may override
|
|
275
|
+
* the color through `--dsh-file-type-icon-color`.
|
|
276
|
+
*/
|
|
277
|
+
export function FileTypeIcon(props: FileTypeIconProps): ReactNode {
|
|
278
|
+
const { size = 28, className } = props
|
|
279
|
+
const resolvedType = 'path' in props
|
|
280
|
+
? classifyFileType(props.path, props.context)
|
|
281
|
+
: props.kind
|
|
282
|
+
return isCodeFileType(resolvedType)
|
|
283
|
+
? <CodeFileIcon type={resolvedType} size={size} className={className} />
|
|
284
|
+
: glyph(resolvedType, size, clsx(css.icon, css[resolvedType], className))
|
|
285
|
+
}
|
package/src/FishLogo.tsx
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { IconProps } from './icons/props.ts'
|
|
2
|
+
|
|
3
|
+
/** Native viewBox of {@link FISH_LOGO_PATH} (width and height in user units). */
|
|
4
|
+
export const FISH_LOGO_VIEWBOX = { width: 23.16, height: 17.04 }
|
|
5
|
+
|
|
6
|
+
/** The fish silhouette path data, exported for consumers that compose their own svg (entrance effects, masks) around the same geometry. */
|
|
7
|
+
export const FISH_LOGO_PATH = 'M22.9168 1.43018C22.6713 1.31018 22.5658 1.53918 22.4223 1.65519C22.3733 1.69269 22.3318 1.74169 22.2903 1.78669C21.9317 2.1697 21.5127 2.42121 20.9657 2.39121C20.1657 2.34621 19.4827 2.59771 18.8787 3.20973C18.7502 2.45521 18.3236 2.0047 17.6746 1.71569C17.3351 1.56568 16.9916 1.41518 16.7536 1.08867C16.5876 0.856163 16.5421 0.597155 16.4591 0.341647C16.4061 0.187643 16.3536 0.0301382 16.1761 0.00363739C15.9836 -0.0263635 15.9081 0.135141 15.8326 0.270145C15.5306 0.822162 15.4136 1.43018 15.4251 2.0462C15.4516 3.43174 16.0366 4.53527 17.1991 5.3203C17.3311 5.4103 17.3651 5.5003 17.3236 5.63181C17.2441 5.90231 17.1501 6.16482 17.0671 6.43533C17.0141 6.60784 16.9351 6.64584 16.7501 6.57033C16.1121 6.30383 15.5611 5.90931 15.074 5.4328C14.2475 4.63328 13.5 3.75075 12.568 3.05973C12.349 2.89822 12.13 2.74822 11.9034 2.60522C10.9524 1.68169 12.028 0.923165 12.277 0.833162C12.5375 0.739159 12.3675 0.41615 11.5259 0.42015C10.6844 0.42365 9.91439 0.705658 8.93286 1.08117C8.78935 1.13767 8.63835 1.17867 8.48384 1.21267C7.59332 1.04367 6.66829 1.00617 5.70226 1.11517C3.88321 1.31768 2.43016 2.1777 1.36213 3.64575C0.0790928 5.4103 -0.222916 7.41536 0.146595 9.50642C0.535106 11.7105 1.66014 13.535 3.38869 14.9616C5.18125 16.4406 7.24581 17.1657 9.60138 17.0266C11.0319 16.9441 12.6245 16.7526 14.421 15.2321C14.874 15.4576 15.3496 15.5476 16.1381 15.6151C16.7456 15.6716 17.3306 15.5851 17.7836 15.4911C18.4931 15.3411 18.4441 14.6841 18.1876 14.5636C16.1081 13.595 16.5646 13.9891 16.1496 13.67C17.2061 12.42 18.8202 10.1979 19.3182 7.17235C19.3672 6.83834 19.4297 6.36783 19.4222 6.09732C19.4182 5.93231 19.4562 5.86831 19.6447 5.84931C20.1657 5.78931 20.6712 5.64681 21.1357 5.3913C22.4833 4.65528 23.0268 3.44624 23.1548 1.9972C23.1738 1.77569 23.1508 1.54668 22.9168 1.43018ZM11.1749 14.4736C9.15936 12.889 8.18184 12.3675 7.77832 12.39C7.40081 12.4125 7.46881 12.8445 7.55182 13.126C7.63882 13.404 7.75182 13.5955 7.91033 13.8396C8.01983 14.0011 8.09533 14.2411 7.80083 14.4216C7.15181 14.8231 6.02327 14.2866 5.97027 14.2601C4.65673 13.4865 3.5587 12.4655 2.78467 11.069C2.03715 9.72493 1.60314 8.28289 1.53164 6.74384C1.51264 6.37233 1.62214 6.24082 1.99215 6.17332C2.47916 6.08332 2.98118 6.06432 3.46769 6.13582C5.52476 6.43633 7.27581 7.35586 8.74385 8.8129C9.58188 9.64243 10.2159 10.634 10.8689 11.6025C11.5634 12.631 12.3105 13.611 13.262 14.4146C13.598 14.6961 13.866 14.9101 14.1225 15.0681C13.349 15.1546 12.058 15.1731 11.1749 14.4746L11.1749 14.4736ZM12.141 8.25988C12.141 8.09488 12.273 7.96338 12.439 7.96338C12.4765 7.96338 12.5105 7.97088 12.541 7.98188C12.5825 7.99688 12.6205 8.01938 12.6505 8.05338C12.7035 8.10588 12.7335 8.18088 12.7335 8.25988C12.7335 8.42489 12.6015 8.55639 12.4355 8.55639C12.2695 8.55639 12.141 8.42489 12.141 8.25988ZM15.1415 9.79893C14.949 9.87793 14.7565 9.94544 14.5715 9.95294C14.2845 9.96794 13.9715 9.85143 13.8015 9.70893C13.5375 9.48742 13.3485 9.36342 13.2695 8.97691C13.2355 8.8119 13.2545 8.55639 13.2845 8.40989C13.3525 8.09438 13.277 7.89187 13.0545 7.70787C12.8735 7.55786 12.643 7.51636 12.39 7.51636C12.2955 7.51636 12.209 7.47486 12.1445 7.44136C12.039 7.38886 11.9519 7.25735 12.035 7.09585C12.0615 7.04335 12.19 6.91584 12.22 6.89334C12.5635 6.69784 12.9595 6.76184 13.326 6.90834C13.6655 7.04735 13.9225 7.30236 14.292 7.66287C14.6695 8.09838 14.7375 8.21838 14.9525 8.54539C15.1225 8.8009 15.277 9.06341 15.3831 9.36392C15.4471 9.55142 15.3641 9.70493 15.1415 9.79893Z'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Render the fish logo.
|
|
11
|
+
* @param props.size - width in px (default 24; height keeps the 23.16:17.04 ratio).
|
|
12
|
+
* @param props.className - extra class for layout placement.
|
|
13
|
+
* @returns the logo svg (aria-hidden; pair with the wordmark for accessibility).
|
|
14
|
+
*/
|
|
15
|
+
export function FishLogo({ size = 24, className }: IconProps) {
|
|
16
|
+
return (
|
|
17
|
+
<svg
|
|
18
|
+
width={size}
|
|
19
|
+
height={(size * FISH_LOGO_VIEWBOX.height) / FISH_LOGO_VIEWBOX.width}
|
|
20
|
+
className={className}
|
|
21
|
+
viewBox={`0 0 ${FISH_LOGO_VIEWBOX.width} ${FISH_LOGO_VIEWBOX.height}`}
|
|
22
|
+
fill="none"
|
|
23
|
+
aria-hidden="true"
|
|
24
|
+
>
|
|
25
|
+
<path d={FISH_LOGO_PATH} fill="currentColor" />
|
|
26
|
+
</svg>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
interface FoldToggleProps {
|
|
2
|
+
className: string | undefined
|
|
3
|
+
expanded: boolean
|
|
4
|
+
hidden: number
|
|
5
|
+
labels: {
|
|
6
|
+
collapseAria: string
|
|
7
|
+
expandAria: (hidden: number) => string
|
|
8
|
+
collapse: string
|
|
9
|
+
expand: (hidden: number) => string
|
|
10
|
+
}
|
|
11
|
+
onToggle: () => void
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Render the shared head-tail fold control with caller-owned localized copy.
|
|
16
|
+
* @param props - Fold state, localized labels, and toggle callback.
|
|
17
|
+
* @returns The accessible expand or collapse button.
|
|
18
|
+
*/
|
|
19
|
+
export function FoldToggle({
|
|
20
|
+
className, expanded, hidden, labels, onToggle,
|
|
21
|
+
}: FoldToggleProps) {
|
|
22
|
+
return (
|
|
23
|
+
<button
|
|
24
|
+
type="button"
|
|
25
|
+
className={className}
|
|
26
|
+
aria-expanded={expanded}
|
|
27
|
+
aria-label={expanded ? labels.collapseAria : labels.expandAria(hidden)}
|
|
28
|
+
onClick={onToggle}
|
|
29
|
+
>
|
|
30
|
+
{expanded ? labels.collapse : labels.expand(hidden)}
|
|
31
|
+
</button>
|
|
32
|
+
)
|
|
33
|
+
}
|