@opencode-ai/ui 0.0.0-beta-202606251302
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/package.json +110 -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/accordion.css +123 -0
- package/src/components/accordion.tsx +92 -0
- package/src/components/animated-number.css +75 -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/avatar.css +49 -0
- package/src/components/avatar.tsx +55 -0
- package/src/components/button.css +194 -0
- package/src/components/button.tsx +33 -0
- package/src/components/card.css +94 -0
- package/src/components/card.tsx +123 -0
- package/src/components/checkbox.css +131 -0
- package/src/components/checkbox.tsx +43 -0
- package/src/components/collapsible.css +148 -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/dialog.css +181 -0
- package/src/components/dialog.tsx +72 -0
- package/src/components/diff-changes.css +42 -0
- package/src/components/diff-changes.tsx +115 -0
- package/src/components/dock-surface.css +23 -0
- package/src/components/dock-surface.tsx +54 -0
- package/src/components/dropdown-menu.css +135 -0
- package/src/components/dropdown-menu.tsx +308 -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/icon-button.css +181 -0
- package/src/components/icon-button.tsx +29 -0
- package/src/components/icon.css +34 -0
- package/src/components/icon.tsx +169 -0
- package/src/components/image-preview.css +63 -0
- package/src/components/image-preview.tsx +32 -0
- package/src/components/inline-input.css +17 -0
- package/src/components/inline-input.tsx +22 -0
- package/src/components/keybind.css +18 -0
- package/src/components/keybind.tsx +20 -0
- package/src/components/list.css +331 -0
- package/src/components/list.tsx +394 -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 +153 -0
- package/src/components/progress-circle.css +12 -0
- package/src/components/progress-circle.tsx +57 -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 +1135 -0
- package/src/components/provider-icons/types.ts +105 -0
- package/src/components/radio-group.css +187 -0
- package/src/components/radio-group.tsx +83 -0
- package/src/components/resize-handle.css +58 -0
- package/src/components/resize-handle.tsx +82 -0
- package/src/components/scroll-view.css +66 -0
- package/src/components/scroll-view.tsx +250 -0
- package/src/components/select.css +202 -0
- package/src/components/select.tsx +174 -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/switch.css +132 -0
- package/src/components/switch.tsx +29 -0
- package/src/components/tabs.css +635 -0
- package/src/components/tabs.tsx +125 -0
- package/src/components/tag.css +37 -0
- package/src/components/tag.tsx +22 -0
- package/src/components/text-field.css +134 -0
- package/src/components/text-field.tsx +128 -0
- package/src/components/text-reveal.css +150 -0
- package/src/components/text-reveal.tsx +143 -0
- package/src/components/text-shimmer.css +119 -0
- package/src/components/text-shimmer.tsx +62 -0
- package/src/components/text-strikethrough.css +27 -0
- package/src/components/text-strikethrough.tsx +84 -0
- package/src/components/toast.css +236 -0
- package/src/components/toast.tsx +185 -0
- package/src/components/tooltip.css +74 -0
- package/src/components/tooltip.tsx +161 -0
- package/src/components/typewriter.css +14 -0
- package/src/components/typewriter.tsx +55 -0
- package/src/context/dialog.tsx +197 -0
- package/src/context/file.tsx +10 -0
- package/src/context/helper.tsx +38 -0
- package/src/context/i18n.tsx +38 -0
- package/src/context/index.ts +4 -0
- package/src/context/marked.tsx +522 -0
- package/src/context/worker-pool.tsx +20 -0
- package/src/custom-elements.d.ts +17 -0
- package/src/hooks/create-auto-scroll.tsx +237 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/use-filtered-list.tsx +134 -0
- package/src/i18n/ar.ts +168 -0
- package/src/i18n/br.ts +168 -0
- package/src/i18n/bs.ts +172 -0
- package/src/i18n/da.ts +167 -0
- package/src/i18n/de.ts +173 -0
- package/src/i18n/en.ts +176 -0
- package/src/i18n/es.ts +168 -0
- package/src/i18n/fr.ts +168 -0
- package/src/i18n/ja.ts +167 -0
- package/src/i18n/ko.ts +168 -0
- package/src/i18n/no.ts +171 -0
- package/src/i18n/pl.ts +167 -0
- package/src/i18n/ru.ts +167 -0
- package/src/i18n/th.ts +169 -0
- package/src/i18n/tr.ts +174 -0
- package/src/i18n/uk.ts +167 -0
- package/src/i18n/zh.ts +171 -0
- package/src/i18n/zht.ts +171 -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 +404 -0
- package/src/styles/colors.css +772 -0
- package/src/styles/index.css +53 -0
- package/src/styles/tailwind/colors.css +285 -0
- package/src/styles/tailwind/index.css +78 -0
- package/src/styles/tailwind/utilities.css +131 -0
- package/src/styles/theme.css +609 -0
- package/src/styles/utilities.css +118 -0
- package/src/theme/color.ts +299 -0
- package/src/theme/context.tsx +370 -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 +468 -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 +60 -0
- package/src/theme/v2/mapping.ts +138 -0
- package/src/theme/v2/resolve.ts +153 -0
- package/src/v2/components/accordion-v2.css +139 -0
- package/src/v2/components/accordion-v2.tsx +86 -0
- package/src/v2/components/avatar-v2.css +70 -0
- package/src/v2/components/avatar-v2.tsx +59 -0
- package/src/v2/components/badge-v2.css +27 -0
- package/src/v2/components/badge-v2.tsx +20 -0
- package/src/v2/components/button-v2.css +186 -0
- package/src/v2/components/button-v2.tsx +35 -0
- package/src/v2/components/checkbox-v2.css +184 -0
- package/src/v2/components/checkbox-v2.tsx +65 -0
- package/src/v2/components/dialog-v2.css +150 -0
- package/src/v2/components/dialog-v2.tsx +93 -0
- package/src/v2/components/diff-changes-v2.css +24 -0
- package/src/v2/components/diff-changes-v2.tsx +28 -0
- package/src/v2/components/field-v2.css +94 -0
- package/src/v2/components/field-v2.tsx +265 -0
- package/src/v2/components/icon-button-v2.css +155 -0
- package/src/v2/components/icon-button-v2.tsx +37 -0
- package/src/v2/components/icon.tsx +129 -0
- package/src/v2/components/inline-input-v2.css +218 -0
- package/src/v2/components/inline-input-v2.tsx +90 -0
- package/src/v2/components/keybind-v2.css +76 -0
- package/src/v2/components/keybind-v2.tsx +30 -0
- package/src/v2/components/line-comment-v2.css +204 -0
- package/src/v2/components/line-comment-v2.tsx +155 -0
- package/src/v2/components/menu-v2.css +190 -0
- package/src/v2/components/menu-v2.tsx +225 -0
- package/src/v2/components/project-avatar-v2.css +126 -0
- package/src/v2/components/project-avatar-v2.tsx +64 -0
- package/src/v2/components/radio-v2.css +202 -0
- package/src/v2/components/radio-v2.tsx +72 -0
- package/src/v2/components/segmented-control-v2.css +80 -0
- package/src/v2/components/segmented-control-v2.tsx +208 -0
- package/src/v2/components/select-v2.css +285 -0
- package/src/v2/components/select-v2.tsx +208 -0
- package/src/v2/components/switch-v2.css +154 -0
- package/src/v2/components/switch-v2.tsx +28 -0
- package/src/v2/components/tab-state-indicator.tsx +37 -0
- package/src/v2/components/tabs-v2.css +225 -0
- package/src/v2/components/tabs-v2.tsx +147 -0
- package/src/v2/components/text-input-v2.css +145 -0
- package/src/v2/components/text-input-v2.tsx +67 -0
- package/src/v2/components/text-shimmer-v2.css +125 -0
- package/src/v2/components/text-shimmer-v2.tsx +63 -0
- package/src/v2/components/textarea-v2.css +78 -0
- package/src/v2/components/textarea-v2.tsx +31 -0
- package/src/v2/components/toast-v2.css +215 -0
- package/src/v2/components/toast-v2.tsx +144 -0
- package/src/v2/components/tooltip-v2.css +53 -0
- package/src/v2/components/tooltip-v2.tsx +146 -0
- package/src/v2/components/wordmark-v2.tsx +92 -0
- package/src/v2/styles/colors.css +172 -0
- package/src/v2/styles/tailwind.css +2 -0
- package/src/v2/styles/theme.css +441 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { onMount, type ComponentProps, splitProps } from "solid-js"
|
|
2
|
+
|
|
3
|
+
const icons = {
|
|
4
|
+
edit: {
|
|
5
|
+
viewBox: "0 0 16 16",
|
|
6
|
+
body: `<path d="M13.5555 8.21534V13.5556H2.44434L2.44434 2.4445H7.78462M6.88878 9.11119C6.88878 9.11119 8.96327 9.0367 9.69678 8.3032L14.0301 3.96986C14.5824 3.4176 14.5824 2.52213 14.0301 1.96986C13.4778 1.4176 12.5824 1.4176 12.0301 1.96986L7.69678 6.3032C7.00513 6.99484 6.88878 9.11119 6.88878 9.11119Z" stroke="currentColor"/>`,
|
|
7
|
+
},
|
|
8
|
+
"folder-add-left": {
|
|
9
|
+
viewBox: "0 0 16 16",
|
|
10
|
+
body: `<path d="M7.5 13.3333H1.5V2H6.83333L8.83333 4H14.8333V6M10.1667 11.3333H15.5M12.8333 8.66667V14" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="square"/>`,
|
|
11
|
+
},
|
|
12
|
+
"grid-plus": {
|
|
13
|
+
viewBox: "0 0 16 16",
|
|
14
|
+
body: `<path d="M13.9948 11.668H9.32812M11.6641 9.33203V13.9987M6.66667 9.33203V13.9987H2V9.33203H6.66667ZM6.66667 2V6.66667H2V2H6.66667ZM13.9948 2V6.66667H9.32812V2H13.9948Z" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="square"/>`,
|
|
15
|
+
},
|
|
16
|
+
help: {
|
|
17
|
+
viewBox: "0 0 16 16",
|
|
18
|
+
body: `<path d="M6.33345 6.33349V5.00015H9.66679V7.00015L8.00015 8.00015V9.66679M8.27485 11.6819H7.71897M14.4446 8.00011C14.4446 11.5593 11.5593 14.4446 8.00011 14.4446C4.44094 14.4446 1.55566 11.5593 1.55566 8.00011C1.55566 4.44094 4.44094 1.55566 8.00011 1.55566C11.5593 1.55566 14.4446 4.44094 14.4446 8.00011Z" stroke="currentColor" stroke-linecap="square"/>`,
|
|
19
|
+
},
|
|
20
|
+
"sidebar-right": {
|
|
21
|
+
viewBox: "0 0 20 20",
|
|
22
|
+
body: `<path d="M2.91536 2.91406H2.36536V2.36406H2.91536V2.91406ZM2.91536 17.0807V17.6307H2.36536V17.0807H2.91536ZM17.082 17.0807H17.632V17.6307H17.082V17.0807ZM17.082 2.91406V2.36406H17.632V2.91406H17.082ZM6.9987 2.91406H6.4487V2.36406H6.9987V2.91406ZM6.9987 17.0807V17.6307H6.4487V17.0807H6.9987ZM2.91536 2.91406H3.46536V17.0807H2.91536H2.36536V2.91406H2.91536ZM2.91536 17.0807V16.5307H17.082V17.0807V17.6307H2.91536V17.0807ZM17.082 17.0807H16.532V2.91406H17.082H17.632V17.0807H17.082ZM17.082 2.91406V3.46406H2.91536V2.91406V2.36406H17.082V2.91406ZM6.9987 2.91406H7.5487V17.0807H6.9987H6.4487V2.91406H6.9987ZM17.082 17.0807L17.082 17.6307L6.9987 17.6307V17.0807V16.5307L17.082 16.5307L17.082 17.0807ZM6.9987 2.91406V2.36406H17.082V2.91406V3.46406H6.9987V2.91406Z" fill="currentColor"/>`,
|
|
23
|
+
},
|
|
24
|
+
status: {
|
|
25
|
+
viewBox: "0 0 20 20",
|
|
26
|
+
body: `<path d="M2 10V18H18V10M2 10V2H18V10M2 10H18M5 6H9M5 14H9" stroke="currentColor"/>`,
|
|
27
|
+
},
|
|
28
|
+
"status-active": {
|
|
29
|
+
viewBox: "0 0 20 20",
|
|
30
|
+
body: `<path d="M18 2H2V10H18V2Z" fill="currentColor" fill-opacity="0.1"/><path d="M2 18H18V10H2V18Z" fill="currentColor" fill-opacity="0.1"/><path d="M2 10V18H18V10M2 10V2H18V10M2 10H18M5 6H9M5 14H9" stroke="currentColor"/>`,
|
|
31
|
+
},
|
|
32
|
+
"magnifying-glass": {
|
|
33
|
+
viewBox: "0 0 16 16",
|
|
34
|
+
body: `<path d="M14 14L10.3454 10.3454M6.88889 11.7778C9.58889 11.7778 11.7778 9.58889 11.7778 6.88889C11.7778 4.18889 9.58889 2 6.88889 2C4.18889 2 2 4.18889 2 6.88889C2 9.58889 4.18889 11.7778 6.88889 11.7778Z" stroke="currentColor"/>`,
|
|
35
|
+
},
|
|
36
|
+
menu: {
|
|
37
|
+
viewBox: "0 0 16 16",
|
|
38
|
+
body: `<path d="M2 8H14M2 4.664H14M2 11.336H14" stroke="currentColor"/>`,
|
|
39
|
+
},
|
|
40
|
+
plus: {
|
|
41
|
+
viewBox: "0 0 16 16",
|
|
42
|
+
body: `<path d="M8 2.88867V13.1109" stroke="currentColor" stroke-linejoin="round"/><path d="M2.88867 8H13.1109" stroke="currentColor" stroke-linejoin="round"/>`,
|
|
43
|
+
},
|
|
44
|
+
"settings-gear": {
|
|
45
|
+
viewBox: "0 0 16 16",
|
|
46
|
+
body: `<path d="M7.99998 1.3335L14 4.66683V11.3335L7.99998 14.6668L2 11.3335V4.66683L7.99998 1.3335Z" stroke="currentColor"/><path d="M9.99998 8.00016C9.99998 9.10476 9.10458 10.0002 7.99998 10.0002C6.89538 10.0002 5.99998 9.10476 5.99998 8.00016C5.99998 6.89556 6.89538 6.00016 7.99998 6.00016C9.10458 6.00016 9.99998 6.89556 9.99998 8.00016Z" stroke="currentColor"/>`,
|
|
47
|
+
},
|
|
48
|
+
"chevron-down": {
|
|
49
|
+
viewBox: "0 0 16 16",
|
|
50
|
+
body: `<path d="M5 6.5L8 9.5L11 6.5" stroke="currentColor"/>`,
|
|
51
|
+
},
|
|
52
|
+
close: {
|
|
53
|
+
viewBox: "0 0 20 20",
|
|
54
|
+
body: `<path d="M14.4446 5.55566L5.55566 14.4446M5.55566 5.55566L14.4446 14.4446" stroke="currentColor" stroke-linejoin="round"/>`,
|
|
55
|
+
},
|
|
56
|
+
"xmark-small": {
|
|
57
|
+
viewBox: "0 0 16 16",
|
|
58
|
+
body: `<path d="M4.25 11.75L11.75 4.25M11.75 11.75L4.25 4.25" stroke="currentColor"/>`,
|
|
59
|
+
},
|
|
60
|
+
"outline-chevron-down": {
|
|
61
|
+
viewBox: "0 0 16 16",
|
|
62
|
+
body: `<path d="M5 6.5L8 9.5L11 6.5" stroke="currentColor"/>`,
|
|
63
|
+
},
|
|
64
|
+
"outline-dots": {
|
|
65
|
+
viewBox: "0 0 16 16",
|
|
66
|
+
body: `<path d="M2.5 7.5H3.5V8.5H2.5V7.5Z" stroke="currentColor"/><path d="M7.5 7.5H8.5V8.5H7.5V7.5Z" stroke="currentColor"/><path d="M12.5 7.5H13.5V8.5H12.5V7.5Z" stroke="currentColor"/>`,
|
|
67
|
+
},
|
|
68
|
+
archive: {
|
|
69
|
+
viewBox: "0 0 16 16",
|
|
70
|
+
body: `<path d="M13.1112 13.5555V14.0555H13.6112V13.5555H13.1112ZM2.889 13.5555H2.389L2.389 14.0555H2.889V13.5555ZM3.38901 5.55546L3.38901 5.05546L2.38901 5.05546L2.38901 5.55546L2.88901 5.55546L3.38901 5.55546ZM14.4446 2.44434H14.9446V1.94434L14.4446 1.94434L14.4446 2.44434ZM14.4446 5.55545L14.4446 6.05545L14.9446 6.05545V5.55545H14.4446ZM1.55566 5.55546L1.05566 5.55545L1.05566 6.05546L1.55566 6.05546L1.55566 5.55546ZM1.5557 2.44436L1.5557 1.94436L1.05571 1.94436L1.0557 2.44435L1.5557 2.44436ZM13.1112 5.55546H12.6112V13.5555H13.1112H13.6112V5.55546H13.1112ZM2.889 13.5555H3.389L3.38901 5.55546L2.88901 5.55546L2.38901 5.55546L2.389 13.5555H2.889ZM14.4446 2.44434H13.9446V5.55545H14.4446H14.9446V2.44434H14.4446ZM1.55566 5.55546L2.05566 5.55547L2.0557 2.44436L1.5557 2.44436L1.0557 2.44435L1.05566 5.55545L1.55566 5.55546ZM6.22234 8.22213V8.72213H9.7779V8.22213V7.72213H6.22234V8.22213ZM13.1112 13.5555V13.0555H2.889V13.5555V14.0555H13.1112V13.5555ZM1.5557 2.44436L1.5557 2.94436L14.4446 2.94434L14.4446 2.44434L14.4446 1.94434L1.5557 1.94436L1.5557 2.44436ZM14.4446 5.55545L14.4446 5.05545L1.55566 5.05546L1.55566 5.55546L1.55566 6.05546L14.4446 6.05545L14.4446 5.55545Z" fill="currentColor"/>`,
|
|
71
|
+
},
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const spriteID = "opencode-v2-icon-sprite"
|
|
75
|
+
const symbol = (name: keyof typeof icons) => `opencode-v2-icon-${name}`
|
|
76
|
+
let spriteInserted = false
|
|
77
|
+
|
|
78
|
+
function ensureSprite() {
|
|
79
|
+
if (spriteInserted) return
|
|
80
|
+
if (typeof document === "undefined") return
|
|
81
|
+
if (document.getElementById(spriteID)) {
|
|
82
|
+
spriteInserted = true
|
|
83
|
+
return
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg")
|
|
87
|
+
svg.id = spriteID
|
|
88
|
+
svg.setAttribute("aria-hidden", "true")
|
|
89
|
+
svg.setAttribute("width", "0")
|
|
90
|
+
svg.setAttribute("height", "0")
|
|
91
|
+
svg.style.position = "absolute"
|
|
92
|
+
svg.style.overflow = "hidden"
|
|
93
|
+
svg.innerHTML = Object.entries(icons)
|
|
94
|
+
.map(
|
|
95
|
+
([name, icon]) =>
|
|
96
|
+
`<symbol id="${symbol(name as keyof typeof icons)}" viewBox="${icon.viewBox}">${icon.body}</symbol>`,
|
|
97
|
+
)
|
|
98
|
+
.join("")
|
|
99
|
+
document.body.insertBefore(svg, document.body.firstChild)
|
|
100
|
+
spriteInserted = true
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface IconProps extends ComponentProps<"svg"> {
|
|
104
|
+
name: keyof typeof icons | (string & {})
|
|
105
|
+
size?: "small" | "normal" | "large"
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function Icon(props: IconProps) {
|
|
109
|
+
const [split, rest] = splitProps(props, ["name", "size"])
|
|
110
|
+
const iconName = () => (icons[split.name as keyof typeof icons] ? (split.name as keyof typeof icons) : "plus")
|
|
111
|
+
const icon = () => icons[iconName()]
|
|
112
|
+
const pixelSize = split.size === "small" ? 14 : split.size === "large" ? 20 : 16
|
|
113
|
+
onMount(ensureSprite)
|
|
114
|
+
|
|
115
|
+
return (
|
|
116
|
+
<svg
|
|
117
|
+
{...rest}
|
|
118
|
+
data-slot="icon-svg"
|
|
119
|
+
width={pixelSize}
|
|
120
|
+
height={pixelSize}
|
|
121
|
+
viewBox={icon().viewBox}
|
|
122
|
+
fill="none"
|
|
123
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
124
|
+
aria-hidden={rest["aria-hidden"] ?? "true"}
|
|
125
|
+
>
|
|
126
|
+
<use href={`#${symbol(iconName())}`} />
|
|
127
|
+
</svg>
|
|
128
|
+
)
|
|
129
|
+
}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
[data-component="inline-input-v2"] {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: row;
|
|
5
|
+
align-items: stretch;
|
|
6
|
+
padding: 0;
|
|
7
|
+
width: 280px;
|
|
8
|
+
height: 28px;
|
|
9
|
+
border: 0;
|
|
10
|
+
border-radius: 6px;
|
|
11
|
+
outline: 1px solid transparent;
|
|
12
|
+
outline-offset: 0;
|
|
13
|
+
background:
|
|
14
|
+
linear-gradient(180deg, var(--v2-alpha-light-2) 0%, var(--v2-alpha-light-0) 100%), var(--v2-background-bg-base);
|
|
15
|
+
box-shadow: var(--v2-elevation-button-neutral);
|
|
16
|
+
flex: none;
|
|
17
|
+
align-self: stretch;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
transition:
|
|
20
|
+
background 85ms ease-out,
|
|
21
|
+
outline-color 85ms ease-out,
|
|
22
|
+
box-shadow 85ms ease-out;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
[data-component="inline-input-v2"][data-appearance="large"] {
|
|
26
|
+
height: 32px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
[data-component="inline-input-v2"]:where(:hover):not([data-disabled], [data-invalid]):not(:focus-within) {
|
|
30
|
+
background:
|
|
31
|
+
linear-gradient(0deg, var(--v2-overlay-simple-overlay-hover), var(--v2-overlay-simple-overlay-hover)),
|
|
32
|
+
linear-gradient(180deg, var(--v2-alpha-light-2) 0%, var(--v2-alpha-light-0) 100%), var(--v2-background-bg-base);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
[data-component="inline-input-v2"]:where(:hover):not([data-disabled], [data-invalid]):not(:focus-within)
|
|
36
|
+
[data-slot="inline-input-v2-prefix"] {
|
|
37
|
+
background: transparent;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
[data-component="inline-input-v2"]:where(:focus-within):not([data-disabled], [data-invalid]) {
|
|
41
|
+
outline-color: var(--v2-border-border-focus);
|
|
42
|
+
box-shadow: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
[data-component="inline-input-v2"]:where([data-invalid]):not([data-disabled]) {
|
|
46
|
+
outline-color: var(--v2-state-fg-danger);
|
|
47
|
+
box-shadow: none;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
[data-component="inline-input-v2"]:where([data-disabled]) {
|
|
51
|
+
opacity: 0.5;
|
|
52
|
+
cursor: not-allowed;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
[data-component="inline-input-v2"] [data-slot="inline-input-v2-prefix"] {
|
|
56
|
+
box-sizing: border-box;
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
justify-content: center;
|
|
60
|
+
align-items: flex-start;
|
|
61
|
+
flex: none;
|
|
62
|
+
align-self: stretch;
|
|
63
|
+
width: fit-content;
|
|
64
|
+
min-width: 0;
|
|
65
|
+
max-width: 100%;
|
|
66
|
+
padding: 4px 8px;
|
|
67
|
+
gap: 4px;
|
|
68
|
+
background: var(--v2-background-bg-layer-01);
|
|
69
|
+
border-radius: 4px 0 0 4px;
|
|
70
|
+
transition: background 85ms ease-out;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
[data-component="inline-input-v2"][data-label-width] [data-slot="inline-input-v2-prefix"] {
|
|
74
|
+
width: var(--inline-input-v2-label-width);
|
|
75
|
+
min-width: var(--inline-input-v2-label-width);
|
|
76
|
+
max-width: var(--inline-input-v2-label-width);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
[data-component="inline-input-v2"] [data-slot="inline-input-v2-prefix-text"] {
|
|
80
|
+
display: block;
|
|
81
|
+
width: 100%;
|
|
82
|
+
overflow: hidden;
|
|
83
|
+
text-overflow: ellipsis;
|
|
84
|
+
white-space: nowrap;
|
|
85
|
+
font-style: normal;
|
|
86
|
+
font-weight: 440;
|
|
87
|
+
font-size: 13px;
|
|
88
|
+
line-height: 1;
|
|
89
|
+
letter-spacing: -0.04px;
|
|
90
|
+
color: var(--v2-text-text-muted);
|
|
91
|
+
font-variation-settings: "slnt" 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
[data-component="inline-input-v2"][data-numeric] [data-slot="inline-input-v2-prefix-text"] {
|
|
95
|
+
font-variant-numeric: tabular-nums;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
[data-component="inline-input-v2"] [data-slot="inline-input-v2-divider"] {
|
|
99
|
+
flex: none;
|
|
100
|
+
align-self: stretch;
|
|
101
|
+
width: 0.5px;
|
|
102
|
+
min-width: 0.5px;
|
|
103
|
+
background: var(--v2-border-border-base);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
[data-component="inline-input-v2"] [data-slot="inline-input-v2-field"] {
|
|
107
|
+
display: flex;
|
|
108
|
+
flex-direction: row;
|
|
109
|
+
align-items: center;
|
|
110
|
+
align-self: stretch;
|
|
111
|
+
flex: 1 1 auto;
|
|
112
|
+
min-width: 0;
|
|
113
|
+
padding: 4px 8px;
|
|
114
|
+
gap: 8px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
[data-component="inline-input-v2"][data-appearance="large"] [data-slot="inline-input-v2-field"] {
|
|
118
|
+
padding-top: 6px;
|
|
119
|
+
padding-bottom: 6px;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
[data-component="inline-input-v2"] [data-slot="inline-input-v2-value"] {
|
|
123
|
+
display: flex;
|
|
124
|
+
flex-direction: row;
|
|
125
|
+
align-items: center;
|
|
126
|
+
flex: 1 1 auto;
|
|
127
|
+
min-width: 0;
|
|
128
|
+
min-height: 0;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
[data-component="inline-input-v2"] [data-slot="inline-input-v2-input"] {
|
|
132
|
+
display: block;
|
|
133
|
+
width: 100%;
|
|
134
|
+
min-width: 0;
|
|
135
|
+
height: 100%;
|
|
136
|
+
padding: 0;
|
|
137
|
+
margin: 0;
|
|
138
|
+
border: 0;
|
|
139
|
+
background: transparent;
|
|
140
|
+
outline: none;
|
|
141
|
+
font-style: normal;
|
|
142
|
+
font-weight: 440;
|
|
143
|
+
font-size: 13px;
|
|
144
|
+
line-height: 1;
|
|
145
|
+
letter-spacing: -0.04px;
|
|
146
|
+
color: var(--v2-text-text-base);
|
|
147
|
+
font-variation-settings: "slnt" 0;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
[data-component="inline-input-v2"] [data-slot="inline-input-v2-input"]::placeholder {
|
|
151
|
+
color: var(--v2-text-text-faint);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
[data-component="inline-input-v2"][data-numeric] [data-slot="inline-input-v2-input"] {
|
|
155
|
+
font-variant-numeric: tabular-nums;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
[data-component="inline-input-v2"] [data-slot="inline-input-v2-icon-button"] {
|
|
159
|
+
display: flex;
|
|
160
|
+
flex-direction: row;
|
|
161
|
+
justify-content: center;
|
|
162
|
+
align-items: center;
|
|
163
|
+
flex: none;
|
|
164
|
+
width: 20px;
|
|
165
|
+
height: 20px;
|
|
166
|
+
padding: 2px;
|
|
167
|
+
gap: 3px;
|
|
168
|
+
border: 0;
|
|
169
|
+
border-radius: 4px;
|
|
170
|
+
background: transparent;
|
|
171
|
+
color: var(--v2-icon-icon-muted);
|
|
172
|
+
cursor: pointer;
|
|
173
|
+
outline: none;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
[data-component="inline-input-v2"]
|
|
177
|
+
[data-slot="inline-input-v2-icon-button"]:is(:hover, [data-state="hover"]):not(:disabled) {
|
|
178
|
+
background-color: var(--v2-overlay-simple-overlay-hover);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
[data-component="inline-input-v2"]
|
|
182
|
+
[data-slot="inline-input-v2-icon-button"]:is(:active, [data-state="pressed"]):not(:disabled) {
|
|
183
|
+
background-color: var(--v2-overlay-simple-overlay-pressed);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
[data-component="inline-input-v2"] [data-slot="inline-input-v2-icon-button"]:focus {
|
|
187
|
+
outline: none;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
[data-component="inline-input-v2"] [data-slot="inline-input-v2-icon-button"]:focus-visible {
|
|
191
|
+
outline: 2px solid var(--v2-border-border-focus);
|
|
192
|
+
outline-offset: 1px;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
[data-component="inline-input-v2"]:where([data-disabled]) [data-slot="inline-input-v2-icon-button"] {
|
|
196
|
+
cursor: not-allowed;
|
|
197
|
+
pointer-events: none;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
[data-component="inline-input-v2"] [data-slot="inline-input-v2-icon-button"] [data-slot="icon-svg"] {
|
|
201
|
+
display: block;
|
|
202
|
+
flex: none;
|
|
203
|
+
color: currentColor;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
[data-component="inline-input-v2"][data-invalid]:not([data-disabled]) [data-slot="inline-input-v2-prefix-text"] {
|
|
207
|
+
color: var(--v2-text-text-muted);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
[data-component="inline-input-v2"][data-invalid]:not([data-disabled]) [data-slot="inline-input-v2-input"] {
|
|
211
|
+
color: var(--v2-state-fg-danger);
|
|
212
|
+
caret-color: var(--v2-state-fg-danger);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
[data-component="inline-input-v2"][data-invalid]:not([data-disabled]) [data-slot="inline-input-v2-input"]::placeholder {
|
|
216
|
+
color: var(--v2-state-fg-danger);
|
|
217
|
+
opacity: 1;
|
|
218
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { type ComponentProps, type JSX, Show, splitProps } from "solid-js"
|
|
2
|
+
import { Icon } from "./icon"
|
|
3
|
+
import "./inline-input-v2.css"
|
|
4
|
+
|
|
5
|
+
export interface InlineInputV2Props extends Omit<ComponentProps<"input">, "type" | "prefix"> {
|
|
6
|
+
/** Inline label shown before the field (prefix segment). */
|
|
7
|
+
prefix: JSX.Element
|
|
8
|
+
/** Fixed width for the prefix segment (px number or CSS length). Omit for fit-content. */
|
|
9
|
+
labelWidth?: number | string
|
|
10
|
+
/** Show the trailing copy action. */
|
|
11
|
+
showCopyButton?: boolean
|
|
12
|
+
/** Accessible label for the copy button. */
|
|
13
|
+
copyLabel?: string
|
|
14
|
+
onCopyClick?: (event: MouseEvent) => void
|
|
15
|
+
/** Apply tabular numerals to the prefix and field value. */
|
|
16
|
+
numeric?: boolean
|
|
17
|
+
/** Error styling for the field and value text. */
|
|
18
|
+
invalid?: boolean
|
|
19
|
+
/** `base` is 28px tall; `large` is 32px tall. */
|
|
20
|
+
appearance?: "base" | "large"
|
|
21
|
+
type?: ComponentProps<"input">["type"]
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function InlineInputV2(props: InlineInputV2Props) {
|
|
25
|
+
const [local, inputProps] = splitProps(props, [
|
|
26
|
+
"class",
|
|
27
|
+
"classList",
|
|
28
|
+
"prefix",
|
|
29
|
+
"labelWidth",
|
|
30
|
+
"showCopyButton",
|
|
31
|
+
"copyLabel",
|
|
32
|
+
"onCopyClick",
|
|
33
|
+
"numeric",
|
|
34
|
+
"invalid",
|
|
35
|
+
"appearance",
|
|
36
|
+
"disabled",
|
|
37
|
+
"style",
|
|
38
|
+
])
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<div
|
|
42
|
+
data-component="inline-input-v2"
|
|
43
|
+
data-disabled={local.disabled ? "" : undefined}
|
|
44
|
+
data-invalid={local.invalid ? "" : undefined}
|
|
45
|
+
data-numeric={local.numeric ? "" : undefined}
|
|
46
|
+
data-appearance={local.appearance ?? "base"}
|
|
47
|
+
data-label-width={local.labelWidth != null ? "" : undefined}
|
|
48
|
+
classList={{
|
|
49
|
+
...local.classList,
|
|
50
|
+
[local.class ?? ""]: !!local.class,
|
|
51
|
+
}}
|
|
52
|
+
style={{
|
|
53
|
+
...(typeof local.style === "object" && local.style != null ? local.style : {}),
|
|
54
|
+
...(local.labelWidth != null
|
|
55
|
+
? {
|
|
56
|
+
"--inline-input-v2-label-width":
|
|
57
|
+
typeof local.labelWidth === "number" ? `${local.labelWidth}px` : local.labelWidth,
|
|
58
|
+
}
|
|
59
|
+
: {}),
|
|
60
|
+
}}
|
|
61
|
+
>
|
|
62
|
+
<div data-slot="inline-input-v2-prefix">
|
|
63
|
+
<span data-slot="inline-input-v2-prefix-text">{local.prefix}</span>
|
|
64
|
+
</div>
|
|
65
|
+
<div data-slot="inline-input-v2-divider" aria-hidden="true" />
|
|
66
|
+
<div data-slot="inline-input-v2-field">
|
|
67
|
+
<div data-slot="inline-input-v2-value">
|
|
68
|
+
<input
|
|
69
|
+
{...inputProps}
|
|
70
|
+
type={inputProps.type ?? "text"}
|
|
71
|
+
disabled={local.disabled}
|
|
72
|
+
aria-invalid={local.invalid ? true : undefined}
|
|
73
|
+
data-slot="inline-input-v2-input"
|
|
74
|
+
/>
|
|
75
|
+
</div>
|
|
76
|
+
<Show when={local.showCopyButton}>
|
|
77
|
+
<button
|
|
78
|
+
type="button"
|
|
79
|
+
data-slot="inline-input-v2-icon-button"
|
|
80
|
+
aria-label={local.copyLabel ?? "Copy"}
|
|
81
|
+
disabled={local.disabled}
|
|
82
|
+
onClick={local.onCopyClick}
|
|
83
|
+
>
|
|
84
|
+
<Icon name="copy" />
|
|
85
|
+
</button>
|
|
86
|
+
</Show>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
)
|
|
90
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
* {
|
|
2
|
+
-webkit-font-smoothing: antialiased;
|
|
3
|
+
-moz-osx-font-smoothing: grayscale;
|
|
4
|
+
text-rendering: geometricPrecision;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
[data-component="keybind-v2"] {
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
font-variant-numeric: tabular-nums;
|
|
10
|
+
display: inline-flex;
|
|
11
|
+
flex-direction: row;
|
|
12
|
+
align-items: center;
|
|
13
|
+
padding: 0;
|
|
14
|
+
gap: 2px;
|
|
15
|
+
flex-shrink: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
[data-component="keybind-v2"] *,
|
|
19
|
+
[data-component="keybind-v2"] *::before,
|
|
20
|
+
[data-component="keybind-v2"] *::after {
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
[data-component="keybind-v2"] [data-slot="keybind-v2-key"] {
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: row;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
align-items: center;
|
|
29
|
+
padding: 0;
|
|
30
|
+
gap: 4px;
|
|
31
|
+
min-width: 14px;
|
|
32
|
+
height: 14px;
|
|
33
|
+
border-radius: 2px;
|
|
34
|
+
flex: none;
|
|
35
|
+
flex-grow: 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
[data-component="keybind-v2"][data-variant="neutral"] [data-slot="keybind-v2-key"] {
|
|
39
|
+
background: var(--v2-background-bg-layer-03);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
[data-component="keybind-v2"][data-variant="ghost"] [data-slot="keybind-v2-key"] {
|
|
43
|
+
background: transparent;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
[data-component="keybind-v2"] [data-slot="keybind-v2-label"] {
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: row;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
align-items: center;
|
|
51
|
+
min-width: 14px;
|
|
52
|
+
height: 11px;
|
|
53
|
+
padding: 0;
|
|
54
|
+
flex: none;
|
|
55
|
+
font-style: normal;
|
|
56
|
+
font-weight: 530;
|
|
57
|
+
font-size: 11px;
|
|
58
|
+
line-height: 1;
|
|
59
|
+
text-align: center;
|
|
60
|
+
letter-spacing: 0.05px;
|
|
61
|
+
text-transform: uppercase;
|
|
62
|
+
font-variant-numeric: tabular-nums;
|
|
63
|
+
font-feature-settings:
|
|
64
|
+
"tnum" on,
|
|
65
|
+
"lnum" on;
|
|
66
|
+
font-variation-settings: "slnt" 0;
|
|
67
|
+
user-select: none;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
[data-component="keybind-v2"][data-variant="neutral"] [data-slot="keybind-v2-label"] {
|
|
71
|
+
color: var(--v2-text-text-muted);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
[data-component="keybind-v2"][data-variant="ghost"] [data-slot="keybind-v2-label"] {
|
|
75
|
+
color: var(--v2-text-text-faint);
|
|
76
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type ComponentProps, For, splitProps } from "solid-js"
|
|
2
|
+
import "./keybind-v2.css"
|
|
3
|
+
|
|
4
|
+
export interface KeybindV2Props extends ComponentProps<"div"> {
|
|
5
|
+
keys: string[]
|
|
6
|
+
variant?: "neutral" | "ghost"
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function KeybindV2(props: KeybindV2Props) {
|
|
10
|
+
const [local, rest] = splitProps(props, ["keys", "variant", "class", "classList"])
|
|
11
|
+
return (
|
|
12
|
+
<div
|
|
13
|
+
{...rest}
|
|
14
|
+
data-component="keybind-v2"
|
|
15
|
+
data-variant={local.variant || "neutral"}
|
|
16
|
+
classList={{
|
|
17
|
+
...local.classList,
|
|
18
|
+
[local.class ?? ""]: !!local.class,
|
|
19
|
+
}}
|
|
20
|
+
>
|
|
21
|
+
<For each={local.keys}>
|
|
22
|
+
{(key) => (
|
|
23
|
+
<div data-slot="keybind-v2-key">
|
|
24
|
+
<span data-slot="keybind-v2-label">{key}</span>
|
|
25
|
+
</div>
|
|
26
|
+
)}
|
|
27
|
+
</For>
|
|
28
|
+
</div>
|
|
29
|
+
)
|
|
30
|
+
}
|