@opencode/ui 0.0.0-beta-19275
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/actions/button/button.d.ts +10 -0
- package/dist/actions/icon-button/icon-button.d.ts +11 -0
- package/dist/actions/split-button/split-button.d.ts +5 -0
- package/dist/components/animated-number.d.ts +4 -0
- package/dist/components/app-icon.d.ts +6 -0
- package/dist/components/app-icons/types.d.ts +2 -0
- package/dist/components/card.d.ts +22 -0
- package/dist/components/collapsible.d.ts +17 -0
- package/dist/components/context-menu.d.ts +80 -0
- package/dist/components/dock-surface.d.ts +7 -0
- package/dist/components/favicon.d.ts +1 -0
- package/dist/components/file-icon.d.ts +12 -0
- package/dist/components/file-icons/types.d.ts +2 -0
- package/dist/components/font.d.ts +1 -0
- package/dist/components/hover-card.d.ts +9 -0
- package/dist/components/image-preview.d.ts +5 -0
- package/dist/components/list.d.ts +45 -0
- package/dist/components/logo.d.ts +8 -0
- package/dist/components/motion-spring.d.ts +4 -0
- package/dist/components/popover.d.ts +14 -0
- package/dist/components/progress.d.ts +7 -0
- package/dist/components/provider-icon.d.ts +5 -0
- package/dist/components/provider-icons/types.d.ts +2 -0
- package/dist/components/resize-handle.d.ts +14 -0
- package/dist/components/scroll-view.d.ts +42 -0
- package/dist/components/spinner.d.ts +6 -0
- package/dist/components/sticky-accordion-header.d.ts +5 -0
- package/dist/components/text-field.d.ts +13 -0
- package/dist/components/text-reveal.d.ts +13 -0
- package/dist/components/text-strikethrough.d.ts +11 -0
- package/dist/components/typewriter.d.ts +6 -0
- package/dist/context/dialog.d.ts +18 -0
- package/dist/context/file.d.ts +5 -0
- package/dist/context/helper.d.ts +14 -0
- package/dist/context/i18n.d.ts +24 -0
- package/dist/context/index.d.ts +4 -0
- package/dist/context/marked-base.d.ts +3 -0
- package/dist/context/marked-parser.d.ts +1 -0
- package/dist/context/marked-theme-register.d.ts +1 -0
- package/dist/context/marked-theme.d.ts +2 -0
- package/dist/context/marked.d.ts +2 -0
- package/dist/context/worker-pool.d.ts +9 -0
- package/dist/data-display/accordion/accordion.d.ts +24 -0
- package/dist/data-display/avatar/avatar.d.ts +11 -0
- package/dist/data-display/badge/badge.d.ts +7 -0
- package/dist/data-display/diff-changes/diff-changes.d.ts +12 -0
- package/dist/data-display/keybind/keybind.d.ts +7 -0
- package/dist/data-display/line-comment/line-comment.d.ts +32 -0
- package/dist/data-display/project-avatar/project-avatar.d.ts +12 -0
- package/dist/feedback/loader/loader.d.ts +3 -0
- package/dist/feedback/progress-circle/progress-circle.d.ts +9 -0
- package/dist/feedback/toast/toast.d.ts +57 -0
- package/dist/forms/checkbox/checkbox.d.ts +8 -0
- package/dist/forms/field/field.d.ts +22 -0
- package/dist/forms/inline-input/inline-input.d.ts +5 -0
- package/dist/forms/radio/radio.d.ts +16 -0
- package/dist/forms/select/select.d.ts +23 -0
- package/dist/forms/switch/switch.d.ts +9 -0
- package/dist/forms/text-input/text-input.d.ts +24 -0
- package/dist/forms/textarea/textarea.d.ts +7 -0
- package/dist/hooks/create-auto-scroll.d.ts +17 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/use-filtered-list.d.ts +48 -0
- package/dist/i18n/am.d.ts +1 -0
- package/dist/i18n/ar.d.ts +209 -0
- package/dist/i18n/az.d.ts +1 -0
- package/dist/i18n/bg.d.ts +193 -0
- package/dist/i18n/bn.d.ts +1 -0
- package/dist/i18n/br.d.ts +197 -0
- package/dist/i18n/bs.d.ts +197 -0
- package/dist/i18n/ca.d.ts +1 -0
- package/dist/i18n/cs.d.ts +1 -0
- package/dist/i18n/da.d.ts +193 -0
- package/dist/i18n/de.d.ts +193 -0
- package/dist/i18n/dv.d.ts +1 -0
- package/dist/i18n/dz.d.ts +1 -0
- package/dist/i18n/el.d.ts +1 -0
- package/dist/i18n/en.d.ts +244 -0
- package/dist/i18n/es.d.ts +197 -0
- package/dist/i18n/et.d.ts +1 -0
- package/dist/i18n/fa.d.ts +1 -0
- package/dist/i18n/fi.d.ts +1 -0
- package/dist/i18n/fo.d.ts +1 -0
- package/dist/i18n/fr.d.ts +197 -0
- package/dist/i18n/he.d.ts +197 -0
- package/dist/i18n/hi.d.ts +1 -0
- package/dist/i18n/hr.d.ts +1 -0
- package/dist/i18n/hu.d.ts +1 -0
- package/dist/i18n/hy.d.ts +1 -0
- package/dist/i18n/id.d.ts +1 -0
- package/dist/i18n/is.d.ts +1 -0
- package/dist/i18n/it.d.ts +1 -0
- package/dist/i18n/ja.d.ts +193 -0
- package/dist/i18n/ka.d.ts +1 -0
- package/dist/i18n/km.d.ts +193 -0
- package/dist/i18n/ko.d.ts +193 -0
- package/dist/i18n/lo.d.ts +193 -0
- package/dist/i18n/lt.d.ts +1 -0
- package/dist/i18n/lv.d.ts +1 -0
- package/dist/i18n/mk.d.ts +193 -0
- package/dist/i18n/mn.d.ts +193 -0
- package/dist/i18n/ms.d.ts +1 -0
- package/dist/i18n/my.d.ts +193 -0
- package/dist/i18n/ne.d.ts +1 -0
- package/dist/i18n/nl.d.ts +1 -0
- package/dist/i18n/no.d.ts +4 -0
- package/dist/i18n/pa.d.ts +1 -0
- package/dist/i18n/pl.d.ts +201 -0
- package/dist/i18n/ro.d.ts +1 -0
- package/dist/i18n/ru.d.ts +201 -0
- package/dist/i18n/si.d.ts +1 -0
- package/dist/i18n/sk.d.ts +1 -0
- package/dist/i18n/sl.d.ts +1 -0
- package/dist/i18n/sq.d.ts +1 -0
- package/dist/i18n/sr.d.ts +197 -0
- package/dist/i18n/sv.d.ts +1 -0
- package/dist/i18n/tg.d.ts +193 -0
- package/dist/i18n/th.d.ts +193 -0
- package/dist/i18n/tk.d.ts +1 -0
- package/dist/i18n/tr.d.ts +193 -0
- package/dist/i18n/uk.d.ts +1 -0
- package/dist/i18n/ur.d.ts +1 -0
- package/dist/i18n/uz.d.ts +1 -0
- package/dist/i18n/vi.d.ts +1 -0
- package/dist/i18n/zh.d.ts +193 -0
- package/dist/i18n/zht.d.ts +193 -0
- package/dist/icons/icon/additional-icons.d.ts +105 -0
- package/dist/icons/icon/icon.d.ts +216 -0
- package/dist/layout/divider/divider.d.ts +5 -0
- package/dist/navigation/menu/menu.d.ts +59 -0
- package/dist/navigation/segmented-control/segmented-control.d.ts +21 -0
- package/dist/navigation/tab-state-indicator.d.ts +2 -0
- package/dist/navigation/tabs/tabs.d.ts +39 -0
- package/dist/overlays/dialog/dialog.d.ts +26 -0
- package/dist/overlays/tooltip/tooltip.d.ts +15 -0
- package/dist/storybook/fixtures.d.ts +19 -0
- package/dist/storybook/scaffold.d.ts +16 -0
- package/dist/theme/color.d.ts +30 -0
- package/dist/theme/context.d.ts +21 -0
- package/dist/theme/default-themes.d.ts +39 -0
- package/dist/theme/index.d.ts +7 -0
- package/dist/theme/loader.d.ts +6 -0
- package/dist/theme/resolve.d.ts +7 -0
- package/dist/theme/types.d.ts +56 -0
- package/dist/theme/v2/avatar.d.ts +5 -0
- package/dist/theme/v2/default-primitives.d.ts +3 -0
- package/dist/theme/v2/foreground.d.ts +2 -0
- package/dist/theme/v2/mapping.d.ts +3 -0
- package/dist/theme/v2/resolve.d.ts +9 -0
- package/dist/typography/text-shimmer/text-shimmer.d.ts +9 -0
- package/dist/typography/wordmark/wordmark.d.ts +5 -0
- package/package.json +261 -0
- package/src/actions/button/button.css +292 -0
- package/src/actions/button/button.tsx +41 -0
- package/src/actions/icon-button/icon-button.css +177 -0
- package/src/actions/icon-button/icon-button.tsx +32 -0
- package/src/actions/split-button/split-button.css +95 -0
- package/src/actions/split-button/split-button.tsx +48 -0
- package/src/assets/audio/alert-01.aac +0 -0
- package/src/assets/audio/alert-01.mp3 +0 -0
- package/src/assets/audio/alert-02.aac +0 -0
- package/src/assets/audio/alert-02.mp3 +0 -0
- package/src/assets/audio/alert-03.aac +0 -0
- package/src/assets/audio/alert-03.mp3 +0 -0
- package/src/assets/audio/alert-04.aac +0 -0
- package/src/assets/audio/alert-04.mp3 +0 -0
- package/src/assets/audio/alert-05.aac +0 -0
- package/src/assets/audio/alert-05.mp3 +0 -0
- package/src/assets/audio/alert-06.aac +0 -0
- package/src/assets/audio/alert-06.mp3 +0 -0
- package/src/assets/audio/alert-07.aac +0 -0
- package/src/assets/audio/alert-07.mp3 +0 -0
- package/src/assets/audio/alert-08.aac +0 -0
- package/src/assets/audio/alert-08.mp3 +0 -0
- package/src/assets/audio/alert-09.aac +0 -0
- package/src/assets/audio/alert-09.mp3 +0 -0
- package/src/assets/audio/alert-10.aac +0 -0
- package/src/assets/audio/alert-10.mp3 +0 -0
- package/src/assets/audio/bip-bop-01.aac +0 -0
- package/src/assets/audio/bip-bop-01.mp3 +0 -0
- package/src/assets/audio/bip-bop-02.aac +0 -0
- package/src/assets/audio/bip-bop-02.mp3 +0 -0
- package/src/assets/audio/bip-bop-03.aac +0 -0
- package/src/assets/audio/bip-bop-03.mp3 +0 -0
- package/src/assets/audio/bip-bop-04.aac +0 -0
- package/src/assets/audio/bip-bop-04.mp3 +0 -0
- package/src/assets/audio/bip-bop-05.aac +0 -0
- package/src/assets/audio/bip-bop-05.mp3 +0 -0
- package/src/assets/audio/bip-bop-06.aac +0 -0
- package/src/assets/audio/bip-bop-06.mp3 +0 -0
- package/src/assets/audio/bip-bop-07.aac +0 -0
- package/src/assets/audio/bip-bop-07.mp3 +0 -0
- package/src/assets/audio/bip-bop-08.aac +0 -0
- package/src/assets/audio/bip-bop-08.mp3 +0 -0
- package/src/assets/audio/bip-bop-09.aac +0 -0
- package/src/assets/audio/bip-bop-09.mp3 +0 -0
- package/src/assets/audio/bip-bop-10.aac +0 -0
- package/src/assets/audio/bip-bop-10.mp3 +0 -0
- package/src/assets/audio/nope-01.aac +0 -0
- package/src/assets/audio/nope-01.mp3 +0 -0
- package/src/assets/audio/nope-02.aac +0 -0
- package/src/assets/audio/nope-02.mp3 +0 -0
- package/src/assets/audio/nope-03.aac +0 -0
- package/src/assets/audio/nope-03.mp3 +0 -0
- package/src/assets/audio/nope-04.aac +0 -0
- package/src/assets/audio/nope-04.mp3 +0 -0
- package/src/assets/audio/nope-05.aac +0 -0
- package/src/assets/audio/nope-05.mp3 +0 -0
- package/src/assets/audio/nope-06.aac +0 -0
- package/src/assets/audio/nope-06.mp3 +0 -0
- package/src/assets/audio/nope-07.aac +0 -0
- package/src/assets/audio/nope-07.mp3 +0 -0
- package/src/assets/audio/nope-08.aac +0 -0
- package/src/assets/audio/nope-08.mp3 +0 -0
- package/src/assets/audio/nope-09.aac +0 -0
- package/src/assets/audio/nope-09.mp3 +0 -0
- package/src/assets/audio/nope-10.aac +0 -0
- package/src/assets/audio/nope-10.mp3 +0 -0
- package/src/assets/audio/nope-11.aac +0 -0
- package/src/assets/audio/nope-11.mp3 +0 -0
- package/src/assets/audio/nope-12.aac +0 -0
- package/src/assets/audio/nope-12.mp3 +0 -0
- package/src/assets/audio/staplebops-01.aac +0 -0
- package/src/assets/audio/staplebops-01.mp3 +0 -0
- package/src/assets/audio/staplebops-02.aac +0 -0
- package/src/assets/audio/staplebops-02.mp3 +0 -0
- package/src/assets/audio/staplebops-03.aac +0 -0
- package/src/assets/audio/staplebops-03.mp3 +0 -0
- package/src/assets/audio/staplebops-04.aac +0 -0
- package/src/assets/audio/staplebops-04.mp3 +0 -0
- package/src/assets/audio/staplebops-05.aac +0 -0
- package/src/assets/audio/staplebops-05.mp3 +0 -0
- package/src/assets/audio/staplebops-06.aac +0 -0
- package/src/assets/audio/staplebops-06.mp3 +0 -0
- package/src/assets/audio/staplebops-07.aac +0 -0
- package/src/assets/audio/staplebops-07.mp3 +0 -0
- package/src/assets/audio/yup-01.aac +0 -0
- package/src/assets/audio/yup-01.mp3 +0 -0
- package/src/assets/audio/yup-02.aac +0 -0
- package/src/assets/audio/yup-02.mp3 +0 -0
- package/src/assets/audio/yup-03.aac +0 -0
- package/src/assets/audio/yup-03.mp3 +0 -0
- package/src/assets/audio/yup-04.aac +0 -0
- package/src/assets/audio/yup-04.mp3 +0 -0
- package/src/assets/audio/yup-05.aac +0 -0
- package/src/assets/audio/yup-05.mp3 +0 -0
- package/src/assets/audio/yup-06.aac +0 -0
- package/src/assets/audio/yup-06.mp3 +0 -0
- package/src/assets/fonts/Inter.ttf +0 -0
- package/src/assets/fonts/JetBrainsMonoNerdFontMono-Regular.woff2 +0 -0
- package/src/assets/icons/app/android-studio.svg +369 -0
- package/src/assets/icons/app/antigravity.svg +97 -0
- package/src/assets/icons/app/cursor.svg +16 -0
- package/src/assets/icons/app/file-explorer.svg +20 -0
- package/src/assets/icons/app/finder.png +0 -0
- package/src/assets/icons/app/ghostty.svg +13 -0
- package/src/assets/icons/app/iterm2.svg +13 -0
- package/src/assets/icons/app/powershell.svg +14 -0
- package/src/assets/icons/app/sublimetext.svg +17 -0
- package/src/assets/icons/app/terminal.png +0 -0
- package/src/assets/icons/app/textmate.png +0 -0
- package/src/assets/icons/app/vscode.svg +39 -0
- package/src/assets/icons/app/warp.png +0 -0
- package/src/assets/icons/app/xcode.png +0 -0
- package/src/assets/icons/app/zed-dark.svg +15 -0
- package/src/assets/icons/app/zed.svg +15 -0
- package/src/components/animated-number.css +93 -0
- package/src/components/animated-number.tsx +109 -0
- package/src/components/app-icon.css +5 -0
- package/src/components/app-icon.tsx +85 -0
- package/src/components/app-icons/sprite.svg +114 -0
- package/src/components/app-icons/types.ts +21 -0
- package/src/components/card.css +94 -0
- package/src/components/card.tsx +123 -0
- package/src/components/collapsible.css +154 -0
- package/src/components/collapsible.tsx +48 -0
- package/src/components/context-menu.css +134 -0
- package/src/components/context-menu.tsx +308 -0
- package/src/components/dock-surface.css +30 -0
- package/src/components/dock-surface.tsx +54 -0
- package/src/components/favicon.tsx +13 -0
- package/src/components/file-icon.css +26 -0
- package/src/components/file-icon.tsx +588 -0
- package/src/components/file-icons/sprite.svg +11707 -0
- package/src/components/file-icons/types.ts +1095 -0
- package/src/components/font.tsx +1 -0
- package/src/components/hover-card.css +61 -0
- package/src/components/hover-card.tsx +32 -0
- package/src/components/image-preview.css +63 -0
- package/src/components/image-preview.tsx +33 -0
- package/src/components/list.css +331 -0
- package/src/components/list.tsx +396 -0
- package/src/components/logo.css +4 -0
- package/src/components/logo.tsx +62 -0
- package/src/components/motion-spring.tsx +58 -0
- package/src/components/popover.css +98 -0
- package/src/components/popover.tsx +154 -0
- package/src/components/progress.css +63 -0
- package/src/components/progress.tsx +39 -0
- package/src/components/provider-icon.css +5 -0
- package/src/components/provider-icon.tsx +25 -0
- package/src/components/provider-icons/sprite.svg +1110 -0
- package/src/components/provider-icons/types.ts +105 -0
- package/src/components/resize-handle.css +70 -0
- package/src/components/resize-handle.tsx +102 -0
- package/src/components/scroll-view.css +99 -0
- package/src/components/scroll-view.tsx +453 -0
- package/src/components/spinner.css +6 -0
- package/src/components/spinner.tsx +52 -0
- package/src/components/sticky-accordion-header.css +6 -0
- package/src/components/sticky-accordion-header.tsx +18 -0
- package/src/components/text-field.css +134 -0
- package/src/components/text-field.tsx +136 -0
- package/src/components/text-reveal.css +150 -0
- package/src/components/text-reveal.tsx +143 -0
- package/src/components/text-strikethrough.css +27 -0
- package/src/components/text-strikethrough.tsx +84 -0
- package/src/components/typewriter.css +14 -0
- package/src/components/typewriter.tsx +55 -0
- package/src/context/dialog.tsx +198 -0
- package/src/context/file.tsx +10 -0
- package/src/context/helper.tsx +38 -0
- package/src/context/i18n.tsx +77 -0
- package/src/context/index.ts +4 -0
- package/src/context/marked-base.tsx +27 -0
- package/src/context/marked-parser.tsx +58 -0
- package/src/context/marked-theme-register.tsx +10 -0
- package/src/context/marked-theme.tsx +372 -0
- package/src/context/marked.tsx +28 -0
- package/src/context/worker-pool.tsx +20 -0
- package/src/custom-elements.d.ts +17 -0
- package/src/data-display/accordion/accordion.css +121 -0
- package/src/data-display/accordion/accordion.tsx +92 -0
- package/src/data-display/avatar/avatar.css +70 -0
- package/src/data-display/avatar/avatar.tsx +59 -0
- package/src/data-display/badge/badge.css +52 -0
- package/src/data-display/badge/badge.tsx +25 -0
- package/src/data-display/diff-changes/diff-changes.css +47 -0
- package/src/data-display/diff-changes/diff-changes.tsx +33 -0
- package/src/data-display/keybind/keybind.css +76 -0
- package/src/data-display/keybind/keybind.tsx +30 -0
- package/src/data-display/line-comment/line-comment.css +258 -0
- package/src/data-display/line-comment/line-comment.tsx +308 -0
- package/src/data-display/project-avatar/project-avatar.css +132 -0
- package/src/data-display/project-avatar/project-avatar.tsx +66 -0
- package/src/feedback/loader/loader.css +32 -0
- package/src/feedback/loader/loader.tsx +31 -0
- package/src/feedback/progress-circle/progress-circle.css +28 -0
- package/src/feedback/progress-circle/progress-circle.tsx +64 -0
- package/src/feedback/toast/toast.css +225 -0
- package/src/feedback/toast/toast.tsx +283 -0
- package/src/forms/checkbox/checkbox.css +125 -0
- package/src/forms/checkbox/checkbox.tsx +43 -0
- package/src/forms/field/field.css +94 -0
- package/src/forms/field/field.tsx +263 -0
- package/src/forms/inline-input/inline-input.css +17 -0
- package/src/forms/inline-input/inline-input.tsx +22 -0
- package/src/forms/radio/radio.css +202 -0
- package/src/forms/radio/radio.tsx +82 -0
- package/src/forms/select/select.css +291 -0
- package/src/forms/select/select.tsx +219 -0
- package/src/forms/switch/switch.css +272 -0
- package/src/forms/switch/switch.tsx +34 -0
- package/src/forms/text-input/text-input.css +181 -0
- package/src/forms/text-input/text-input.tsx +99 -0
- package/src/forms/textarea/textarea.css +78 -0
- package/src/forms/textarea/textarea.tsx +31 -0
- package/src/hooks/create-auto-scroll.tsx +257 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/use-filtered-list.tsx +134 -0
- package/src/i18n/am.ts +194 -0
- package/src/i18n/ar.ts +231 -0
- package/src/i18n/az.ts +195 -0
- package/src/i18n/bg.ts +195 -0
- package/src/i18n/bn.ts +197 -0
- package/src/i18n/br.ts +219 -0
- package/src/i18n/bs.ts +223 -0
- package/src/i18n/ca.ts +199 -0
- package/src/i18n/cs.ts +203 -0
- package/src/i18n/da.ts +214 -0
- package/src/i18n/de.ts +219 -0
- package/src/i18n/dv.ts +196 -0
- package/src/i18n/dz.ts +197 -0
- package/src/i18n/el.ts +195 -0
- package/src/i18n/en.ts +269 -0
- package/src/i18n/es.ts +219 -0
- package/src/i18n/et.ts +195 -0
- package/src/i18n/fa.ts +195 -0
- package/src/i18n/fi.ts +195 -0
- package/src/i18n/fo.ts +195 -0
- package/src/i18n/fr.ts +221 -0
- package/src/i18n/he.ts +199 -0
- package/src/i18n/hi.ts +197 -0
- package/src/i18n/hr.ts +200 -0
- package/src/i18n/hu.ts +197 -0
- package/src/i18n/hy.ts +195 -0
- package/src/i18n/id.ts +217 -0
- package/src/i18n/is.ts +195 -0
- package/src/i18n/it.ts +200 -0
- package/src/i18n/ja.ts +214 -0
- package/src/i18n/ka.ts +195 -0
- package/src/i18n/km.ts +196 -0
- package/src/i18n/ko.ts +216 -0
- package/src/i18n/lo.ts +195 -0
- package/src/i18n/lt.ts +203 -0
- package/src/i18n/lv.ts +199 -0
- package/src/i18n/mk.ts +195 -0
- package/src/i18n/mn.ts +195 -0
- package/src/i18n/ms.ts +195 -0
- package/src/i18n/my.ts +196 -0
- package/src/i18n/ne.ts +197 -0
- package/src/i18n/nl.ts +195 -0
- package/src/i18n/no.ts +219 -0
- package/src/i18n/pa.ts +196 -0
- package/src/i18n/pl.ts +223 -0
- package/src/i18n/ro.ts +199 -0
- package/src/i18n/ru.ts +222 -0
- package/src/i18n/si.ts +195 -0
- package/src/i18n/sk.ts +203 -0
- package/src/i18n/sl.ts +204 -0
- package/src/i18n/sq.ts +195 -0
- package/src/i18n/sr.ts +200 -0
- package/src/i18n/sv.ts +195 -0
- package/src/i18n/tg.ts +195 -0
- package/src/i18n/th.ts +215 -0
- package/src/i18n/tk.ts +195 -0
- package/src/i18n/tr.ts +221 -0
- package/src/i18n/uk.ts +226 -0
- package/src/i18n/ur.ts +196 -0
- package/src/i18n/uz.ts +198 -0
- package/src/i18n/vi.ts +195 -0
- package/src/i18n/zh.ts +217 -0
- package/src/i18n/zht.ts +217 -0
- package/src/icons/icon/additional-icons.ts +115 -0
- package/src/icons/icon/icon.css +3 -0
- package/src/icons/icon/icon.tsx +293 -0
- package/src/layout/divider/divider.css +11 -0
- package/src/layout/divider/divider.tsx +20 -0
- package/src/navigation/menu/menu.css +312 -0
- package/src/navigation/menu/menu.tsx +289 -0
- package/src/navigation/segmented-control/segmented-control.css +80 -0
- package/src/navigation/segmented-control/segmented-control.tsx +209 -0
- package/src/navigation/tab-state-indicator.tsx +37 -0
- package/src/navigation/tabs/tabs-current.css +239 -0
- package/src/navigation/tabs/tabs.css +710 -0
- package/src/navigation/tabs/tabs.tsx +194 -0
- package/src/overlays/dialog/dialog.css +180 -0
- package/src/overlays/dialog/dialog.tsx +115 -0
- package/src/overlays/tooltip/tooltip.css +102 -0
- package/src/overlays/tooltip/tooltip.tsx +154 -0
- package/src/storybook/fixtures.ts +51 -0
- package/src/storybook/scaffold.tsx +62 -0
- package/src/styles/animations.css +141 -0
- package/src/styles/base.css +409 -0
- package/src/styles/colors.css +772 -0
- package/src/styles/file-tree.css +202 -0
- package/src/styles/index.css +37 -0
- package/src/styles/tailwind/colors.css +288 -0
- package/src/styles/tailwind/index.css +95 -0
- package/src/styles/tailwind/utilities.css +131 -0
- package/src/styles/theme.css +631 -0
- package/src/styles/tokens/colors.css +172 -0
- package/src/styles/tokens/index.css +2 -0
- package/src/styles/tokens/theme.css +510 -0
- package/src/styles/utilities.css +118 -0
- package/src/theme/color.ts +299 -0
- package/src/theme/context.tsx +381 -0
- package/src/theme/default-themes.ts +116 -0
- package/src/theme/index.ts +78 -0
- package/src/theme/loader.ts +112 -0
- package/src/theme/resolve.ts +540 -0
- package/src/theme/themes/amoled.json +49 -0
- package/src/theme/themes/aura.json +51 -0
- package/src/theme/themes/ayu.json +51 -0
- package/src/theme/themes/carbonfox.json +53 -0
- package/src/theme/themes/catppuccin-frappe.json +85 -0
- package/src/theme/themes/catppuccin-macchiato.json +85 -0
- package/src/theme/themes/catppuccin.json +45 -0
- package/src/theme/themes/cobalt2.json +87 -0
- package/src/theme/themes/cursor.json +91 -0
- package/src/theme/themes/dracula.json +49 -0
- package/src/theme/themes/everforest.json +89 -0
- package/src/theme/themes/flexoki.json +86 -0
- package/src/theme/themes/github.json +85 -0
- package/src/theme/themes/gruvbox.json +45 -0
- package/src/theme/themes/kanagawa.json +89 -0
- package/src/theme/themes/lucent-orng.json +87 -0
- package/src/theme/themes/material.json +87 -0
- package/src/theme/themes/matrix.json +113 -0
- package/src/theme/themes/mercury.json +86 -0
- package/src/theme/themes/monokai.json +49 -0
- package/src/theme/themes/nightowl.json +46 -0
- package/src/theme/themes/nord.json +46 -0
- package/src/theme/themes/oc-2.json +507 -0
- package/src/theme/themes/one-dark.json +89 -0
- package/src/theme/themes/onedarkpro.json +45 -0
- package/src/theme/themes/opencode.json +89 -0
- package/src/theme/themes/orng.json +87 -0
- package/src/theme/themes/osaka-jade.json +88 -0
- package/src/theme/themes/palenight.json +85 -0
- package/src/theme/themes/rosepine.json +85 -0
- package/src/theme/themes/shadesofpurple.json +51 -0
- package/src/theme/themes/solarized.json +49 -0
- package/src/theme/themes/synthwave84.json +87 -0
- package/src/theme/themes/tokyonight.json +47 -0
- package/src/theme/themes/vercel.json +90 -0
- package/src/theme/themes/vesper.json +51 -0
- package/src/theme/themes/zenburn.json +87 -0
- package/src/theme/types.ts +75 -0
- package/src/theme/v2/avatar.ts +48 -0
- package/src/theme/v2/default-primitives.ts +114 -0
- package/src/theme/v2/foreground.ts +61 -0
- package/src/theme/v2/mapping.ts +176 -0
- package/src/theme/v2/resolve.ts +153 -0
- package/src/typography/text-shimmer/text-shimmer.css +120 -0
- package/src/typography/text-shimmer/text-shimmer.tsx +63 -0
- package/src/typography/wordmark/wordmark.tsx +39 -0
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import { For, Show, createSignal, onMount, splitProps, type ComponentProps, type JSX } from "solid-js"
|
|
2
|
+
import { FileIcon } from "@opencode/ui/file-icon"
|
|
3
|
+
import { useI18n } from "../../context/i18n"
|
|
4
|
+
import { useFilteredList } from "../../hooks"
|
|
5
|
+
import { Button } from "@opencode/ui/button"
|
|
6
|
+
import "./line-comment.css"
|
|
7
|
+
|
|
8
|
+
/** Horizontal “more” glyph for the display-card overflow control (Figma outline-dots). */
|
|
9
|
+
export function LineCommentOverflowIcon(props: ComponentProps<"svg">) {
|
|
10
|
+
return (
|
|
11
|
+
<svg
|
|
12
|
+
{...props}
|
|
13
|
+
width={props.width ?? 16}
|
|
14
|
+
height={props.height ?? 16}
|
|
15
|
+
viewBox="0 0 16 16"
|
|
16
|
+
fill="none"
|
|
17
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
18
|
+
aria-hidden={props["aria-hidden"] ?? "true"}
|
|
19
|
+
>
|
|
20
|
+
<path d="M2.5 7.5H3.5V8.5H2.5V7.5Z" stroke="currentColor" />
|
|
21
|
+
<path d="M7.5 7.5H8.5V8.5H7.5V7.5Z" stroke="currentColor" />
|
|
22
|
+
<path d="M12.5 7.5H13.5V8.5H12.5V7.5Z" stroke="currentColor" />
|
|
23
|
+
</svg>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface LineCommentProps extends ComponentProps<"div"> {
|
|
28
|
+
/** Main comment body (text or rich content). */
|
|
29
|
+
comment: JSX.Element
|
|
30
|
+
/** Line / selection context (e.g. “Comment on line 40”). */
|
|
31
|
+
selection: JSX.Element
|
|
32
|
+
/** Typically an overflow menu trigger; use `LineCommentOverflowIcon` inside `line-comment-v2-overflow`. */
|
|
33
|
+
actions?: JSX.Element
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function LineComment(props: LineCommentProps) {
|
|
37
|
+
const [local, rest] = splitProps(props, ["comment", "selection", "actions", "class", "classList"])
|
|
38
|
+
return (
|
|
39
|
+
<div
|
|
40
|
+
{...rest}
|
|
41
|
+
data-component="line-comment-v2"
|
|
42
|
+
data-variant="display"
|
|
43
|
+
classList={{
|
|
44
|
+
...local.classList,
|
|
45
|
+
[local.class ?? ""]: !!local.class,
|
|
46
|
+
}}
|
|
47
|
+
>
|
|
48
|
+
<div data-slot="line-comment-v2-shell">
|
|
49
|
+
<div data-slot="line-comment-v2-column">
|
|
50
|
+
<div data-slot="line-comment-v2-text">{local.comment}</div>
|
|
51
|
+
<div data-slot="line-comment-v2-meta">{local.selection}</div>
|
|
52
|
+
</div>
|
|
53
|
+
<Show when={local.actions}>{(actions) => <div data-slot="line-comment-v2-tools">{actions()}</div>}</Show>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export type LineCommentEditorMention = {
|
|
60
|
+
items: (query: string) => string[] | Promise<string[]>
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface LineCommentEditorProps extends Omit<ComponentProps<"div">, "children" | "onInput" | "onSubmit"> {
|
|
64
|
+
/** Visible field label above the textarea (default: “Comment”). */
|
|
65
|
+
heading?: JSX.Element | string
|
|
66
|
+
value: string
|
|
67
|
+
onInput: (value: string) => void
|
|
68
|
+
onCancel: () => void
|
|
69
|
+
onSubmit: (value: string) => void
|
|
70
|
+
selection: JSX.Element
|
|
71
|
+
placeholder?: string
|
|
72
|
+
rows?: number
|
|
73
|
+
cancelLabel?: string
|
|
74
|
+
submitLabel?: string
|
|
75
|
+
autofocus?: boolean
|
|
76
|
+
mention?: LineCommentEditorMention
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function pathFilename(path: string) {
|
|
80
|
+
const index = Math.max(path.lastIndexOf("/"), path.lastIndexOf("\\"))
|
|
81
|
+
return index === -1 ? path : path.slice(index + 1)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function pathDirectory(path: string) {
|
|
85
|
+
const index = Math.max(path.lastIndexOf("/"), path.lastIndexOf("\\"))
|
|
86
|
+
return index === -1 ? "" : path.slice(0, index + 1)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function LineCommentEditor(props: LineCommentEditorProps) {
|
|
90
|
+
const i18n = useI18n()
|
|
91
|
+
let textareaRef: HTMLTextAreaElement | undefined
|
|
92
|
+
const [mentionOpen, setMentionOpen] = createSignal(false)
|
|
93
|
+
|
|
94
|
+
const [local, rest] = splitProps(props, [
|
|
95
|
+
"heading",
|
|
96
|
+
"value",
|
|
97
|
+
"onInput",
|
|
98
|
+
"onCancel",
|
|
99
|
+
"onSubmit",
|
|
100
|
+
"selection",
|
|
101
|
+
"placeholder",
|
|
102
|
+
"rows",
|
|
103
|
+
"cancelLabel",
|
|
104
|
+
"submitLabel",
|
|
105
|
+
"autofocus",
|
|
106
|
+
"mention",
|
|
107
|
+
"class",
|
|
108
|
+
"classList",
|
|
109
|
+
])
|
|
110
|
+
|
|
111
|
+
const heading = () => local.heading ?? i18n.t("ui.lineComment.submit")
|
|
112
|
+
const canSubmit = () => local.value.trim().length > 0
|
|
113
|
+
|
|
114
|
+
const closeMention = () => {
|
|
115
|
+
setMentionOpen(false)
|
|
116
|
+
mention.clear()
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const currentMention = () => {
|
|
120
|
+
const textarea = textareaRef
|
|
121
|
+
if (!textarea) return
|
|
122
|
+
if (!local.mention) return
|
|
123
|
+
if (textarea.selectionStart !== textarea.selectionEnd) return
|
|
124
|
+
|
|
125
|
+
const end = textarea.selectionStart
|
|
126
|
+
const match = textarea.value.slice(0, end).match(/@(\S*)$/)
|
|
127
|
+
if (!match) return
|
|
128
|
+
|
|
129
|
+
return {
|
|
130
|
+
query: match[1] ?? "",
|
|
131
|
+
start: end - match[0].length,
|
|
132
|
+
end,
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function selectMention(item: { path: string } | undefined) {
|
|
137
|
+
if (!item) return
|
|
138
|
+
|
|
139
|
+
const textarea = textareaRef
|
|
140
|
+
const query = currentMention()
|
|
141
|
+
if (!textarea || !query) return
|
|
142
|
+
|
|
143
|
+
const value = `${textarea.value.slice(0, query.start)}@${item.path} ${textarea.value.slice(query.end)}`
|
|
144
|
+
const cursor = query.start + item.path.length + 2
|
|
145
|
+
|
|
146
|
+
local.onInput(value)
|
|
147
|
+
closeMention()
|
|
148
|
+
|
|
149
|
+
requestAnimationFrame(() => {
|
|
150
|
+
textarea.focus()
|
|
151
|
+
textarea.setSelectionRange(cursor, cursor)
|
|
152
|
+
})
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const mention = useFilteredList<{ path: string }>({
|
|
156
|
+
items: async (query) => {
|
|
157
|
+
if (!local.mention) return []
|
|
158
|
+
if (!query.trim()) return []
|
|
159
|
+
const paths = await local.mention.items(query)
|
|
160
|
+
return paths.map((path) => ({ path }))
|
|
161
|
+
},
|
|
162
|
+
key: (item) => item.path,
|
|
163
|
+
filterKeys: ["path"],
|
|
164
|
+
skipFilter: () => true,
|
|
165
|
+
onSelect: selectMention,
|
|
166
|
+
})
|
|
167
|
+
|
|
168
|
+
const syncMention = () => {
|
|
169
|
+
const item = currentMention()
|
|
170
|
+
if (!item) {
|
|
171
|
+
closeMention()
|
|
172
|
+
return
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
setMentionOpen(true)
|
|
176
|
+
mention.onInput(item.query)
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const selectActiveMention = () => {
|
|
180
|
+
const items = mention.flat()
|
|
181
|
+
if (items.length === 0) return
|
|
182
|
+
const active = mention.active()
|
|
183
|
+
selectMention(items.find((item) => item.path === active) ?? items[0])
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const submit = () => {
|
|
187
|
+
const v = local.value.trim()
|
|
188
|
+
if (!v) return
|
|
189
|
+
local.onSubmit(v)
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
onMount(() => {
|
|
193
|
+
if (local.autofocus === false) return
|
|
194
|
+
requestAnimationFrame(() => textareaRef?.focus())
|
|
195
|
+
})
|
|
196
|
+
|
|
197
|
+
return (
|
|
198
|
+
<div
|
|
199
|
+
{...rest}
|
|
200
|
+
data-component="line-comment-v2"
|
|
201
|
+
data-variant="editor"
|
|
202
|
+
classList={{
|
|
203
|
+
...local.classList,
|
|
204
|
+
[local.class ?? ""]: !!local.class,
|
|
205
|
+
}}
|
|
206
|
+
>
|
|
207
|
+
<div data-slot="line-comment-v2-shell">
|
|
208
|
+
<div data-slot="line-comment-v2-field">
|
|
209
|
+
<div data-slot="line-comment-v2-label">{heading()}</div>
|
|
210
|
+
<textarea
|
|
211
|
+
ref={(el) => {
|
|
212
|
+
textareaRef = el
|
|
213
|
+
}}
|
|
214
|
+
data-slot="line-comment-v2-textarea"
|
|
215
|
+
dir="auto"
|
|
216
|
+
rows={local.rows ?? 3}
|
|
217
|
+
placeholder={local.placeholder ?? i18n.t("ui.lineComment.contextPlaceholder")}
|
|
218
|
+
value={local.value}
|
|
219
|
+
style={{ "unicode-bidi": "plaintext", "text-align": "start" }}
|
|
220
|
+
onInput={(e) => {
|
|
221
|
+
local.onInput(e.currentTarget.value)
|
|
222
|
+
syncMention()
|
|
223
|
+
}}
|
|
224
|
+
onClick={() => syncMention()}
|
|
225
|
+
onSelect={() => syncMention()}
|
|
226
|
+
onKeyDown={(e) => {
|
|
227
|
+
e.stopPropagation()
|
|
228
|
+
if (e.isComposing || e.keyCode === 229) return
|
|
229
|
+
|
|
230
|
+
if (mentionOpen()) {
|
|
231
|
+
if (e.key === "Escape") {
|
|
232
|
+
e.preventDefault()
|
|
233
|
+
closeMention()
|
|
234
|
+
return
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
if (e.key === "Tab") {
|
|
238
|
+
if (mention.flat().length === 0) return
|
|
239
|
+
e.preventDefault()
|
|
240
|
+
selectActiveMention()
|
|
241
|
+
return
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
const nav = e.key === "ArrowUp" || e.key === "ArrowDown" || e.key === "Enter"
|
|
245
|
+
const ctrlNav = e.ctrlKey && !e.metaKey && !e.altKey && !e.shiftKey && (e.key === "n" || e.key === "p")
|
|
246
|
+
if ((nav || ctrlNav) && mention.flat().length > 0) {
|
|
247
|
+
mention.onKeyDown(e)
|
|
248
|
+
e.preventDefault()
|
|
249
|
+
return
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
if (e.key === "Escape") {
|
|
254
|
+
e.preventDefault()
|
|
255
|
+
e.currentTarget.blur()
|
|
256
|
+
local.onCancel()
|
|
257
|
+
return
|
|
258
|
+
}
|
|
259
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
260
|
+
e.preventDefault()
|
|
261
|
+
submit()
|
|
262
|
+
}
|
|
263
|
+
}}
|
|
264
|
+
/>
|
|
265
|
+
<Show when={mentionOpen() && mention.flat().length > 0}>
|
|
266
|
+
<div data-slot="line-comment-v2-mention-list">
|
|
267
|
+
<For each={mention.flat().slice(0, 10)}>
|
|
268
|
+
{(item) => {
|
|
269
|
+
const directory = item.path.endsWith("/") ? item.path : pathDirectory(item.path)
|
|
270
|
+
const name = item.path.endsWith("/") ? "" : pathFilename(item.path)
|
|
271
|
+
return (
|
|
272
|
+
<button
|
|
273
|
+
type="button"
|
|
274
|
+
data-slot="line-comment-v2-mention-item"
|
|
275
|
+
data-active={mention.active() === item.path ? "" : undefined}
|
|
276
|
+
onMouseDown={(event) => event.preventDefault()}
|
|
277
|
+
onMouseEnter={() => mention.setActive(item.path)}
|
|
278
|
+
onClick={() => selectMention(item)}
|
|
279
|
+
>
|
|
280
|
+
<FileIcon node={{ path: item.path, type: "file" }} class="shrink-0 size-4" />
|
|
281
|
+
<div data-slot="line-comment-v2-mention-path">
|
|
282
|
+
<span data-slot="line-comment-v2-mention-dir">{directory}</span>
|
|
283
|
+
<Show when={name}>
|
|
284
|
+
<span data-slot="line-comment-v2-mention-file">{name}</span>
|
|
285
|
+
</Show>
|
|
286
|
+
</div>
|
|
287
|
+
</button>
|
|
288
|
+
)
|
|
289
|
+
}}
|
|
290
|
+
</For>
|
|
291
|
+
</div>
|
|
292
|
+
</Show>
|
|
293
|
+
</div>
|
|
294
|
+
<div data-slot="line-comment-v2-footer">
|
|
295
|
+
<div data-slot="line-comment-v2-footer-meta">{local.selection}</div>
|
|
296
|
+
<div data-slot="line-comment-v2-footer-actions">
|
|
297
|
+
<Button type="button" size="normal" variant="ghost" onClick={() => local.onCancel()}>
|
|
298
|
+
{local.cancelLabel ?? i18n.t("ui.lineComment.cancel")}
|
|
299
|
+
</Button>
|
|
300
|
+
<Button type="button" size="normal" variant="contrast" disabled={!canSubmit()} onClick={submit}>
|
|
301
|
+
{local.submitLabel ?? i18n.t("ui.lineComment.submit")}
|
|
302
|
+
</Button>
|
|
303
|
+
</div>
|
|
304
|
+
</div>
|
|
305
|
+
</div>
|
|
306
|
+
</div>
|
|
307
|
+
)
|
|
308
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
[data-component="project-avatar-v2"] {
|
|
2
|
+
position: relative;
|
|
3
|
+
flex-shrink: 0;
|
|
4
|
+
width: 16px;
|
|
5
|
+
height: 16px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
[data-component="project-avatar-v2"][data-unread] {
|
|
9
|
+
overflow: visible;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
[data-slot="project-avatar-surface"] {
|
|
13
|
+
--project-avatar-bg: var(--v2-avatar-bg-gray);
|
|
14
|
+
--project-avatar-border: var(--v2-avatar-border-gray);
|
|
15
|
+
position: relative;
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
display: flex;
|
|
18
|
+
width: 100%;
|
|
19
|
+
height: 100%;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
border-radius: 4px;
|
|
24
|
+
background:
|
|
25
|
+
linear-gradient(180deg, var(--v2-alpha-light-16) 0%, var(--v2-alpha-light-0) 100%), var(--project-avatar-bg);
|
|
26
|
+
box-shadow: inset 0 0 0 0.5px var(--project-avatar-border);
|
|
27
|
+
font-weight: 530;
|
|
28
|
+
font-size: 11px;
|
|
29
|
+
line-height: 1;
|
|
30
|
+
letter-spacing: 0.05px;
|
|
31
|
+
font-variant-numeric: tabular-nums;
|
|
32
|
+
text-transform: uppercase;
|
|
33
|
+
color: var(--v2-avatar-fg);
|
|
34
|
+
text-shadow: 0 0 4px var(--v2-alpha-dark-20);
|
|
35
|
+
user-select: none;
|
|
36
|
+
-webkit-user-select: none;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
[data-slot="project-avatar-surface"][data-variant="orange"] {
|
|
40
|
+
--project-avatar-bg: var(--v2-avatar-bg-orange);
|
|
41
|
+
--project-avatar-border: var(--v2-avatar-border-orange);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
[data-slot="project-avatar-surface"][data-variant="yellow"] {
|
|
45
|
+
--project-avatar-bg: var(--v2-avatar-bg-yellow);
|
|
46
|
+
--project-avatar-border: var(--v2-avatar-border-yellow);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
[data-slot="project-avatar-surface"][data-variant="cyan"] {
|
|
50
|
+
--project-avatar-bg: var(--v2-avatar-bg-cyan);
|
|
51
|
+
--project-avatar-border: var(--v2-avatar-border-cyan);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
[data-slot="project-avatar-surface"][data-variant="green"] {
|
|
55
|
+
--project-avatar-bg: var(--v2-avatar-bg-green);
|
|
56
|
+
--project-avatar-border: var(--v2-avatar-border-green);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
[data-slot="project-avatar-surface"][data-variant="red"] {
|
|
60
|
+
--project-avatar-bg: var(--v2-avatar-bg-red);
|
|
61
|
+
--project-avatar-border: var(--v2-avatar-border-red);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
[data-slot="project-avatar-surface"][data-variant="pink"] {
|
|
65
|
+
--project-avatar-bg: var(--v2-avatar-bg-pink);
|
|
66
|
+
--project-avatar-border: var(--v2-avatar-border-pink);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
[data-slot="project-avatar-surface"][data-variant="blue"] {
|
|
70
|
+
--project-avatar-bg: var(--v2-avatar-bg-blue);
|
|
71
|
+
--project-avatar-border: var(--v2-avatar-border-blue);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
[data-slot="project-avatar-surface"][data-variant="purple"] {
|
|
75
|
+
--project-avatar-bg: var(--v2-avatar-bg-purple);
|
|
76
|
+
--project-avatar-border: var(--v2-avatar-border-purple);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
[data-slot="project-avatar-surface"][data-variant="gray"] {
|
|
80
|
+
--project-avatar-bg: var(--v2-avatar-bg-gray);
|
|
81
|
+
--project-avatar-border: var(--v2-avatar-border-gray);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
[data-slot="project-avatar-surface"][data-variant="outline"] {
|
|
85
|
+
--project-avatar-bg: var(--v2-background-bg-base);
|
|
86
|
+
--project-avatar-border: var(--v2-border-border-strong);
|
|
87
|
+
color: var(--v2-text-text-muted);
|
|
88
|
+
text-shadow: none;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
[data-slot="project-avatar-surface"][data-has-image] {
|
|
92
|
+
background: var(--project-avatar-bg);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
[data-slot="project-avatar-surface"] [data-slot="project-avatar-image"] {
|
|
96
|
+
position: relative;
|
|
97
|
+
display: block;
|
|
98
|
+
width: 100%;
|
|
99
|
+
height: 100%;
|
|
100
|
+
border-radius: inherit;
|
|
101
|
+
object-fit: cover;
|
|
102
|
+
user-select: none;
|
|
103
|
+
-webkit-user-select: none;
|
|
104
|
+
-webkit-user-drag: none;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
[data-component="project-avatar-v2"][data-unread] [data-slot="project-avatar-surface"] {
|
|
108
|
+
-webkit-mask-image: radial-gradient(circle 4.5px at 100% 0, transparent 4px, black 5px);
|
|
109
|
+
mask-image: radial-gradient(circle 4.5px at 100% 0, transparent 4px, black 5px);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
[data-slot="project-avatar-unread-dot"] {
|
|
113
|
+
position: absolute;
|
|
114
|
+
z-index: 3;
|
|
115
|
+
width: 6px;
|
|
116
|
+
height: 6px;
|
|
117
|
+
right: -3px;
|
|
118
|
+
top: -3px;
|
|
119
|
+
border-radius: 9999px;
|
|
120
|
+
background: var(--v2-background-bg-accent);
|
|
121
|
+
pointer-events: none;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
[data-slot="project-avatar-slot"] {
|
|
125
|
+
display: flex;
|
|
126
|
+
flex-shrink: 0;
|
|
127
|
+
align-items: center;
|
|
128
|
+
justify-content: center;
|
|
129
|
+
width: 16px;
|
|
130
|
+
height: 16px;
|
|
131
|
+
overflow: visible;
|
|
132
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type ComponentProps, splitProps, Show } from "solid-js"
|
|
2
|
+
import "./project-avatar.css"
|
|
3
|
+
|
|
4
|
+
const segmenter =
|
|
5
|
+
typeof Intl !== "undefined" && "Segmenter" in Intl
|
|
6
|
+
? new Intl.Segmenter(undefined, { granularity: "grapheme" })
|
|
7
|
+
: undefined
|
|
8
|
+
|
|
9
|
+
function first(value: string) {
|
|
10
|
+
if (!value) return ""
|
|
11
|
+
if (!segmenter) return Array.from(value)[0] ?? ""
|
|
12
|
+
return segmenter.segment(value)[Symbol.iterator]().next().value?.segment ?? Array.from(value)[0] ?? ""
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const PROJECT_AVATAR_VARIANTS = [
|
|
16
|
+
"orange",
|
|
17
|
+
"yellow",
|
|
18
|
+
"cyan",
|
|
19
|
+
"green",
|
|
20
|
+
"red",
|
|
21
|
+
"pink",
|
|
22
|
+
"blue",
|
|
23
|
+
"purple",
|
|
24
|
+
"gray",
|
|
25
|
+
] as const
|
|
26
|
+
|
|
27
|
+
export type ProjectAvatarVariant = (typeof PROJECT_AVATAR_VARIANTS)[number]
|
|
28
|
+
|
|
29
|
+
// "outline" is a neutral, muted style (e.g. recently closed projects) and is not part of the color rotation.
|
|
30
|
+
export type ProjectAvatarStyle = ProjectAvatarVariant | "outline"
|
|
31
|
+
|
|
32
|
+
export interface ProjectAvatarProps extends ComponentProps<"div"> {
|
|
33
|
+
fallback: string
|
|
34
|
+
src?: string
|
|
35
|
+
variant?: ProjectAvatarStyle
|
|
36
|
+
unread?: boolean
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function ProjectAvatar(props: ProjectAvatarProps) {
|
|
40
|
+
const [split, rest] = splitProps(props, ["fallback", "src", "variant", "unread", "class", "classList", "style"])
|
|
41
|
+
return (
|
|
42
|
+
<div
|
|
43
|
+
{...rest}
|
|
44
|
+
data-component="project-avatar-v2"
|
|
45
|
+
data-unread={split.unread ? "" : undefined}
|
|
46
|
+
classList={{
|
|
47
|
+
...split.classList,
|
|
48
|
+
[split.class ?? ""]: !!split.class,
|
|
49
|
+
}}
|
|
50
|
+
style={typeof split.style === "object" ? split.style : undefined}
|
|
51
|
+
>
|
|
52
|
+
<div
|
|
53
|
+
data-slot="project-avatar-surface"
|
|
54
|
+
data-variant={split.variant ?? "gray"}
|
|
55
|
+
data-has-image={split.src ? "" : undefined}
|
|
56
|
+
>
|
|
57
|
+
<Show when={split.src} fallback={first(split.fallback)}>
|
|
58
|
+
{(value) => <img src={value()} draggable={false} data-slot="project-avatar-image" />}
|
|
59
|
+
</Show>
|
|
60
|
+
</div>
|
|
61
|
+
<Show when={split.unread}>
|
|
62
|
+
<span data-slot="project-avatar-unread-dot" aria-hidden="true" />
|
|
63
|
+
</Show>
|
|
64
|
+
</div>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
[data-component="loader-v2"] {
|
|
2
|
+
--_duration: 900ms;
|
|
3
|
+
display: block;
|
|
4
|
+
flex-shrink: 0;
|
|
5
|
+
color: var(--v2-icon-icon-muted, #808080);
|
|
6
|
+
animation: loader-v2-spin var(--_duration) linear infinite;
|
|
7
|
+
transform-origin: center;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
[data-component="loader-v2"] [data-slot="loader-v2-background"] {
|
|
11
|
+
stroke: currentColor;
|
|
12
|
+
opacity: 0.2;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
[data-component="loader-v2"] [data-slot="loader-v2-progress"] {
|
|
16
|
+
stroke: currentColor;
|
|
17
|
+
stroke-linecap: round;
|
|
18
|
+
transform: rotate(-90deg);
|
|
19
|
+
transform-origin: center;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@keyframes loader-v2-spin {
|
|
23
|
+
to {
|
|
24
|
+
transform: rotate(360deg);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@media (prefers-reduced-motion: reduce) {
|
|
29
|
+
[data-component="loader-v2"] {
|
|
30
|
+
animation: none;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { splitProps, type ComponentProps } from "solid-js"
|
|
2
|
+
import "./loader.css"
|
|
3
|
+
|
|
4
|
+
export function Loader(props: ComponentProps<"svg">) {
|
|
5
|
+
const [local, rest] = splitProps(props, ["class", "classList", "width", "height"])
|
|
6
|
+
return (
|
|
7
|
+
<svg
|
|
8
|
+
{...rest}
|
|
9
|
+
class={local.class}
|
|
10
|
+
classList={local.classList}
|
|
11
|
+
width={local.width ?? 16}
|
|
12
|
+
height={local.height ?? 16}
|
|
13
|
+
viewBox="0 0 16 16"
|
|
14
|
+
fill="none"
|
|
15
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
16
|
+
data-component="loader-v2"
|
|
17
|
+
aria-hidden={rest["aria-hidden"] ?? "true"}
|
|
18
|
+
>
|
|
19
|
+
<circle cx="8" cy="8" r="6" data-slot="loader-v2-background" stroke-width="2" />
|
|
20
|
+
<circle
|
|
21
|
+
cx="8"
|
|
22
|
+
cy="8"
|
|
23
|
+
r="6"
|
|
24
|
+
data-slot="loader-v2-progress"
|
|
25
|
+
pathLength="100"
|
|
26
|
+
stroke-width="2"
|
|
27
|
+
stroke-dasharray="33 67"
|
|
28
|
+
/>
|
|
29
|
+
</svg>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
[data-component="progress-circle"] {
|
|
2
|
+
display: block;
|
|
3
|
+
transform: rotate(-90deg);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
[data-component="progress-circle"][data-appearance="compact"] [data-slot="progress-circle-background"] {
|
|
7
|
+
stroke: var(--v2-background-bg-layer-04);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
[data-component="progress-circle"][data-appearance="compact"] [data-slot="progress-circle-progress"] {
|
|
11
|
+
stroke: var(--v2-icon-icon-base);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
[data-component="progress-circle"][data-appearance="indicator"] [data-slot="progress-circle-background"] {
|
|
15
|
+
stroke: var(--progress-circle-background, var(--border-weak-base));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
[data-component="progress-circle"][data-appearance="indicator"] [data-slot="progress-circle-background-overlay"] {
|
|
19
|
+
stroke: var(--progress-circle-background-overlay, transparent);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
[data-component="progress-circle"][data-appearance="indicator"] [data-slot="progress-circle-progress"] {
|
|
23
|
+
stroke: var(--progress-circle-progress, var(--border-active));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
[data-component="progress-circle"] [data-slot="progress-circle-progress"] {
|
|
27
|
+
transition: stroke-dashoffset 0.35s cubic-bezier(0.65, 0, 0.35, 1);
|
|
28
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type ComponentProps, createMemo, Show, splitProps } from "solid-js"
|
|
2
|
+
import "./progress-circle.css"
|
|
3
|
+
|
|
4
|
+
export interface ProgressCircleProps extends Pick<ComponentProps<"svg">, "class" | "classList" | "style"> {
|
|
5
|
+
percentage: number
|
|
6
|
+
appearance?: "compact" | "indicator"
|
|
7
|
+
size?: number
|
|
8
|
+
strokeWidth?: number
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function ProgressCircle(props: ProgressCircleProps) {
|
|
12
|
+
const [local, rest] = splitProps(props, ["percentage", "appearance", "size", "strokeWidth", "class", "classList"])
|
|
13
|
+
|
|
14
|
+
const appearance = () => local.appearance ?? "compact"
|
|
15
|
+
const viewBoxSize = () => (appearance() === "indicator" ? 16 : 14)
|
|
16
|
+
const size = () => local.size ?? viewBoxSize()
|
|
17
|
+
const strokeWidth = () => local.strokeWidth ?? (appearance() === "indicator" ? 3 : 1.5)
|
|
18
|
+
const center = () => viewBoxSize() / 2
|
|
19
|
+
const radius = () => center() - strokeWidth() / 2
|
|
20
|
+
const circumference = createMemo(() => 2 * Math.PI * radius())
|
|
21
|
+
const offset = createMemo(() => circumference() * (1 - Math.max(0, Math.min(100, local.percentage || 0)) / 100))
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<svg
|
|
25
|
+
{...rest}
|
|
26
|
+
width={size()}
|
|
27
|
+
height={size()}
|
|
28
|
+
viewBox={`0 0 ${viewBoxSize()} ${viewBoxSize()}`}
|
|
29
|
+
fill="none"
|
|
30
|
+
data-component="progress-circle"
|
|
31
|
+
data-appearance={appearance()}
|
|
32
|
+
classList={{
|
|
33
|
+
...local.classList,
|
|
34
|
+
[local.class ?? ""]: !!local.class,
|
|
35
|
+
}}
|
|
36
|
+
>
|
|
37
|
+
<circle
|
|
38
|
+
cx={center()}
|
|
39
|
+
cy={center()}
|
|
40
|
+
r={radius()}
|
|
41
|
+
data-slot="progress-circle-background"
|
|
42
|
+
stroke-width={strokeWidth()}
|
|
43
|
+
/>
|
|
44
|
+
<Show when={appearance() === "indicator"}>
|
|
45
|
+
<circle
|
|
46
|
+
cx={center()}
|
|
47
|
+
cy={center()}
|
|
48
|
+
r={radius()}
|
|
49
|
+
data-slot="progress-circle-background-overlay"
|
|
50
|
+
stroke-width={strokeWidth()}
|
|
51
|
+
/>
|
|
52
|
+
</Show>
|
|
53
|
+
<circle
|
|
54
|
+
cx={center()}
|
|
55
|
+
cy={center()}
|
|
56
|
+
r={radius()}
|
|
57
|
+
data-slot="progress-circle-progress"
|
|
58
|
+
stroke-width={strokeWidth()}
|
|
59
|
+
stroke-dasharray={circumference().toString()}
|
|
60
|
+
stroke-dashoffset={offset()}
|
|
61
|
+
/>
|
|
62
|
+
</svg>
|
|
63
|
+
)
|
|
64
|
+
}
|