@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,105 @@
|
|
|
1
|
+
// This file is generated by icon spritesheet generator
|
|
2
|
+
|
|
3
|
+
export const iconNames = [
|
|
4
|
+
"zhipuai",
|
|
5
|
+
"zhipuai-coding-plan",
|
|
6
|
+
"zenmux",
|
|
7
|
+
"zai",
|
|
8
|
+
"zai-coding-plan",
|
|
9
|
+
"xiaomi",
|
|
10
|
+
"xai",
|
|
11
|
+
"wandb",
|
|
12
|
+
"vultr",
|
|
13
|
+
"vivgrid",
|
|
14
|
+
"vercel",
|
|
15
|
+
"venice",
|
|
16
|
+
"v0",
|
|
17
|
+
"upstage",
|
|
18
|
+
"togetherai",
|
|
19
|
+
"synthetic",
|
|
20
|
+
"submodel",
|
|
21
|
+
"stepfun",
|
|
22
|
+
"stackit",
|
|
23
|
+
"siliconflow",
|
|
24
|
+
"siliconflow-cn",
|
|
25
|
+
"scaleway",
|
|
26
|
+
"sap-ai-core",
|
|
27
|
+
"requesty",
|
|
28
|
+
"qiniu-ai",
|
|
29
|
+
"qihang-ai",
|
|
30
|
+
"privatemode-ai",
|
|
31
|
+
"poe",
|
|
32
|
+
"perplexity",
|
|
33
|
+
"ovhcloud",
|
|
34
|
+
"openrouter",
|
|
35
|
+
"llmgateway",
|
|
36
|
+
"opencode",
|
|
37
|
+
"opencode-go",
|
|
38
|
+
"openai",
|
|
39
|
+
"ollama-cloud",
|
|
40
|
+
"nvidia",
|
|
41
|
+
"novita-ai",
|
|
42
|
+
"nova",
|
|
43
|
+
"nebius",
|
|
44
|
+
"nano-gpt",
|
|
45
|
+
"morph",
|
|
46
|
+
"moonshotai",
|
|
47
|
+
"moonshotai-cn",
|
|
48
|
+
"modelscope",
|
|
49
|
+
"moark",
|
|
50
|
+
"mistral",
|
|
51
|
+
"minimax",
|
|
52
|
+
"minimax-coding-plan",
|
|
53
|
+
"minimax-cn",
|
|
54
|
+
"minimax-cn-coding-plan",
|
|
55
|
+
"meganova",
|
|
56
|
+
"lucidquery",
|
|
57
|
+
"lmstudio",
|
|
58
|
+
"llama",
|
|
59
|
+
"kuae-cloud-coding-plan",
|
|
60
|
+
"kimi-for-coding",
|
|
61
|
+
"kilo",
|
|
62
|
+
"jiekou",
|
|
63
|
+
"io-net",
|
|
64
|
+
"inference",
|
|
65
|
+
"inception",
|
|
66
|
+
"iflowcn",
|
|
67
|
+
"huggingface",
|
|
68
|
+
"helicone",
|
|
69
|
+
"groq",
|
|
70
|
+
"google",
|
|
71
|
+
"google-vertex",
|
|
72
|
+
"google-vertex-anthropic",
|
|
73
|
+
"gitlab",
|
|
74
|
+
"github-models",
|
|
75
|
+
"github-copilot",
|
|
76
|
+
"friendli",
|
|
77
|
+
"firmware",
|
|
78
|
+
"fireworks-ai",
|
|
79
|
+
"fastrouter",
|
|
80
|
+
"evroc",
|
|
81
|
+
"digitalocean",
|
|
82
|
+
"deepseek",
|
|
83
|
+
"deepinfra",
|
|
84
|
+
"cortecs",
|
|
85
|
+
"cohere",
|
|
86
|
+
"cloudflare-workers-ai",
|
|
87
|
+
"cloudflare-ai-gateway",
|
|
88
|
+
"cloudferro-sherlock",
|
|
89
|
+
"chutes",
|
|
90
|
+
"cerebras",
|
|
91
|
+
"berget",
|
|
92
|
+
"baseten",
|
|
93
|
+
"bailing",
|
|
94
|
+
"azure",
|
|
95
|
+
"azure-cognitive-services",
|
|
96
|
+
"anthropic",
|
|
97
|
+
"amazon-bedrock",
|
|
98
|
+
"alibaba",
|
|
99
|
+
"alibaba-cn",
|
|
100
|
+
"aihubmix",
|
|
101
|
+
"abacus",
|
|
102
|
+
"302ai",
|
|
103
|
+
] as const
|
|
104
|
+
|
|
105
|
+
export type IconName = (typeof iconNames)[number]
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
[data-component="radio-group"] {
|
|
2
|
+
--radio-group-height: 28px;
|
|
3
|
+
--radio-group-gap: 4px;
|
|
4
|
+
--radio-group-padding: 2px;
|
|
5
|
+
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
|
|
8
|
+
[data-slot="radio-group-wrapper"] {
|
|
9
|
+
all: unset;
|
|
10
|
+
background-color: var(--surface-inset-base);
|
|
11
|
+
border-radius: var(--radius-sm);
|
|
12
|
+
box-shadow: var(--shadow-xxs-border);
|
|
13
|
+
display: inline-flex;
|
|
14
|
+
height: var(--radio-group-height);
|
|
15
|
+
margin: 0;
|
|
16
|
+
overflow: visible;
|
|
17
|
+
padding: 0;
|
|
18
|
+
position: relative;
|
|
19
|
+
width: fit-content;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&[data-fill] [data-slot="radio-group-wrapper"] {
|
|
23
|
+
width: 100%;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
[data-slot="radio-group-items"] {
|
|
27
|
+
display: inline-flex;
|
|
28
|
+
flex-direction: row;
|
|
29
|
+
gap: var(--radio-group-gap);
|
|
30
|
+
height: 100%;
|
|
31
|
+
list-style: none;
|
|
32
|
+
position: relative;
|
|
33
|
+
z-index: 1;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&[data-fill] [data-slot="radio-group-items"] {
|
|
37
|
+
width: 100%;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
[data-slot="radio-group-indicator"] {
|
|
41
|
+
background: var(--button-secondary-base);
|
|
42
|
+
border-radius: var(--radius-sm);
|
|
43
|
+
box-shadow: var(--shadow-xs-border-base);
|
|
44
|
+
content: "";
|
|
45
|
+
opacity: var(--indicator-opacity, 1);
|
|
46
|
+
pointer-events: none;
|
|
47
|
+
position: absolute;
|
|
48
|
+
transition:
|
|
49
|
+
opacity 200ms ease-out,
|
|
50
|
+
box-shadow 100ms ease-in-out,
|
|
51
|
+
width 200ms cubic-bezier(0.22, 1.2, 0.36, 1),
|
|
52
|
+
height 200ms cubic-bezier(0.22, 1.2, 0.36, 1),
|
|
53
|
+
transform 300ms cubic-bezier(0.22, 1.2, 0.36, 1);
|
|
54
|
+
will-change: transform;
|
|
55
|
+
z-index: 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
[data-slot="radio-group-item"] {
|
|
59
|
+
display: flex;
|
|
60
|
+
height: 100%;
|
|
61
|
+
min-width: 0;
|
|
62
|
+
position: relative;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&[data-fill] [data-slot="radio-group-item"] {
|
|
66
|
+
flex: 1;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
[data-slot="radio-group-item-input"] {
|
|
70
|
+
border-width: 0;
|
|
71
|
+
clip: rect(0 0 0 0);
|
|
72
|
+
height: 1px;
|
|
73
|
+
margin: -1px;
|
|
74
|
+
overflow: hidden;
|
|
75
|
+
padding: 0;
|
|
76
|
+
position: absolute;
|
|
77
|
+
white-space: nowrap;
|
|
78
|
+
width: 1px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
[data-slot="radio-group-item-label"] {
|
|
82
|
+
color: var(--text-weak);
|
|
83
|
+
cursor: default;
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
justify-content: center;
|
|
87
|
+
font-family: var(--font-family-sans);
|
|
88
|
+
font-size: var(--font-size-small);
|
|
89
|
+
font-weight: var(--font-weight-medium);
|
|
90
|
+
flex: 1;
|
|
91
|
+
height: 100%;
|
|
92
|
+
line-height: 1;
|
|
93
|
+
padding: var(--radio-group-padding);
|
|
94
|
+
position: relative;
|
|
95
|
+
transition:
|
|
96
|
+
color 200ms ease-out,
|
|
97
|
+
opacity 200ms ease-out;
|
|
98
|
+
user-select: none;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
[data-slot="radio-group-item-control"] {
|
|
102
|
+
align-items: center;
|
|
103
|
+
border-radius: var(--radius-xs);
|
|
104
|
+
display: inline-flex;
|
|
105
|
+
height: 100%;
|
|
106
|
+
justify-content: center;
|
|
107
|
+
min-width: 0;
|
|
108
|
+
padding: var(--radio-group-control-padding, 0 10px);
|
|
109
|
+
transition: background-color 200ms ease-out;
|
|
110
|
+
width: 100%;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&[data-pad="none"] {
|
|
114
|
+
--radio-group-control-padding: 0;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&[data-pad="normal"] {
|
|
118
|
+
--radio-group-control-padding: 0 10px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/* Checked state */
|
|
122
|
+
[data-slot="radio-group-item-input"][data-checked] + [data-slot="radio-group-item-label"] {
|
|
123
|
+
color: var(--text-strong);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* Hover state: match the inset background (adds subtle density) */
|
|
127
|
+
[data-slot="radio-group-item-input"]:not([data-checked], [data-disabled])
|
|
128
|
+
+ [data-slot="radio-group-item-label"]:hover
|
|
129
|
+
[data-slot="radio-group-item-control"] {
|
|
130
|
+
background-color: var(--surface-inset-base);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/* Do not overlay hover on the active segment */
|
|
134
|
+
[data-slot="radio-group-item-input"][data-checked]
|
|
135
|
+
+ [data-slot="radio-group-item-label"]:hover
|
|
136
|
+
[data-slot="radio-group-item-control"] {
|
|
137
|
+
background-color: transparent;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* Disabled state */
|
|
141
|
+
[data-slot="radio-group-item-input"][data-disabled] + [data-slot="radio-group-item-label"] {
|
|
142
|
+
cursor: not-allowed;
|
|
143
|
+
opacity: 0.5;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/* Focus state */
|
|
147
|
+
[data-slot="radio-group-wrapper"]:has([data-slot="radio-group-item-input"]:focus-visible)
|
|
148
|
+
[data-slot="radio-group-indicator"] {
|
|
149
|
+
box-shadow: var(--shadow-xs-border-focus);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/* Hide indicator when nothing is checked */
|
|
153
|
+
[data-slot="radio-group-wrapper"]:not(:has([data-slot="radio-group-item-input"][data-checked]))
|
|
154
|
+
[data-slot="radio-group-indicator"] {
|
|
155
|
+
--indicator-opacity: 0;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* Vertical orientation */
|
|
159
|
+
&[aria-orientation="vertical"] [data-slot="radio-group-items"] {
|
|
160
|
+
flex-direction: column;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* Small size variant */
|
|
164
|
+
&[data-size="small"] {
|
|
165
|
+
--radio-group-height: 24px;
|
|
166
|
+
--radio-group-gap: 3px;
|
|
167
|
+
--radio-group-padding: 2px;
|
|
168
|
+
|
|
169
|
+
[data-slot="radio-group-item-label"] {
|
|
170
|
+
font-size: 12px;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
[data-slot="radio-group-item-control"] {
|
|
174
|
+
padding: var(--radio-group-control-padding, 0 8px);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
&[data-size="small"][data-pad="normal"] {
|
|
179
|
+
--radio-group-control-padding: 0 8px;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/* Disabled root state */
|
|
183
|
+
&[data-disabled] {
|
|
184
|
+
opacity: 0.5;
|
|
185
|
+
cursor: not-allowed;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { SegmentedControl as Kobalte } from "@kobalte/core/segmented-control"
|
|
2
|
+
import { For, splitProps } from "solid-js"
|
|
3
|
+
import type { ComponentProps, JSX } from "solid-js"
|
|
4
|
+
|
|
5
|
+
export type RadioGroupProps<T> = Omit<
|
|
6
|
+
ComponentProps<typeof Kobalte>,
|
|
7
|
+
"value" | "defaultValue" | "onChange" | "children"
|
|
8
|
+
> & {
|
|
9
|
+
options: T[]
|
|
10
|
+
current?: T
|
|
11
|
+
defaultValue?: T
|
|
12
|
+
value?: (x: T) => string
|
|
13
|
+
label?: (x: T) => JSX.Element | string
|
|
14
|
+
onSelect?: (value: T | undefined) => void
|
|
15
|
+
class?: ComponentProps<"div">["class"]
|
|
16
|
+
classList?: ComponentProps<"div">["classList"]
|
|
17
|
+
size?: "small" | "medium"
|
|
18
|
+
fill?: boolean
|
|
19
|
+
pad?: "none" | "normal"
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function RadioGroup<T>(props: RadioGroupProps<T>) {
|
|
23
|
+
const [local, others] = splitProps(props, [
|
|
24
|
+
"class",
|
|
25
|
+
"classList",
|
|
26
|
+
"options",
|
|
27
|
+
"current",
|
|
28
|
+
"defaultValue",
|
|
29
|
+
"value",
|
|
30
|
+
"label",
|
|
31
|
+
"onSelect",
|
|
32
|
+
"size",
|
|
33
|
+
"fill",
|
|
34
|
+
"pad",
|
|
35
|
+
])
|
|
36
|
+
|
|
37
|
+
const getValue = (item: T): string => {
|
|
38
|
+
if (local.value) return local.value(item)
|
|
39
|
+
return String(item)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const getLabel = (item: T): JSX.Element | string => {
|
|
43
|
+
if (local.label) return local.label(item)
|
|
44
|
+
return String(item)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const findOption = (v: string): T | undefined => {
|
|
48
|
+
return local.options.find((opt) => getValue(opt) === v)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<Kobalte
|
|
53
|
+
{...others}
|
|
54
|
+
data-component="radio-group"
|
|
55
|
+
data-size={local.size ?? "medium"}
|
|
56
|
+
data-fill={local.fill ? "" : undefined}
|
|
57
|
+
data-pad={local.pad ?? "normal"}
|
|
58
|
+
classList={{
|
|
59
|
+
...local.classList,
|
|
60
|
+
[local.class ?? ""]: !!local.class,
|
|
61
|
+
}}
|
|
62
|
+
value={local.current ? getValue(local.current) : undefined}
|
|
63
|
+
defaultValue={local.defaultValue ? getValue(local.defaultValue) : undefined}
|
|
64
|
+
onChange={(v) => local.onSelect?.(findOption(v))}
|
|
65
|
+
>
|
|
66
|
+
<div role="presentation" data-slot="radio-group-wrapper">
|
|
67
|
+
<Kobalte.Indicator data-slot="radio-group-indicator" />
|
|
68
|
+
<div role="presentation" data-slot="radio-group-items">
|
|
69
|
+
<For each={local.options}>
|
|
70
|
+
{(option) => (
|
|
71
|
+
<Kobalte.Item value={getValue(option)} data-slot="radio-group-item" data-value={getValue(option)}>
|
|
72
|
+
<Kobalte.ItemInput data-slot="radio-group-item-input" />
|
|
73
|
+
<Kobalte.ItemLabel data-slot="radio-group-item-label">
|
|
74
|
+
<span data-slot="radio-group-item-control">{getLabel(option)}</span>
|
|
75
|
+
</Kobalte.ItemLabel>
|
|
76
|
+
</Kobalte.Item>
|
|
77
|
+
)}
|
|
78
|
+
</For>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</Kobalte>
|
|
82
|
+
)
|
|
83
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
[data-component="resize-handle"] {
|
|
2
|
+
position: absolute;
|
|
3
|
+
z-index: 10;
|
|
4
|
+
|
|
5
|
+
&::after {
|
|
6
|
+
content: "";
|
|
7
|
+
position: absolute;
|
|
8
|
+
opacity: 0;
|
|
9
|
+
transition: opacity 0.15s ease-in-out;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&:hover::after,
|
|
13
|
+
&:active::after {
|
|
14
|
+
opacity: 1;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&[data-direction="horizontal"] {
|
|
18
|
+
inset-block: 0;
|
|
19
|
+
inset-inline-end: 0;
|
|
20
|
+
width: 8px;
|
|
21
|
+
transform: translateX(50%);
|
|
22
|
+
cursor: col-resize;
|
|
23
|
+
|
|
24
|
+
&[data-edge="start"] {
|
|
25
|
+
inset-inline-start: 0;
|
|
26
|
+
inset-inline-end: auto;
|
|
27
|
+
transform: translateX(-50%);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&::after {
|
|
31
|
+
width: 3px;
|
|
32
|
+
inset-block: 0;
|
|
33
|
+
inset-inline-start: 50%;
|
|
34
|
+
transform: translateX(-50%);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&[data-direction="vertical"] {
|
|
39
|
+
inset-inline: 0;
|
|
40
|
+
inset-block-start: 0;
|
|
41
|
+
height: 8px;
|
|
42
|
+
transform: translateY(-50%);
|
|
43
|
+
cursor: row-resize;
|
|
44
|
+
|
|
45
|
+
&[data-edge="end"] {
|
|
46
|
+
inset-block-start: auto;
|
|
47
|
+
inset-block-end: 0;
|
|
48
|
+
transform: translateY(50%);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&::after {
|
|
52
|
+
height: 3px;
|
|
53
|
+
inset-inline: 0;
|
|
54
|
+
inset-block-start: 50%;
|
|
55
|
+
transform: translateY(-50%);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { splitProps, type JSX } from "solid-js"
|
|
2
|
+
|
|
3
|
+
export interface ResizeHandleProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "onResize"> {
|
|
4
|
+
direction: "horizontal" | "vertical"
|
|
5
|
+
edge?: "start" | "end"
|
|
6
|
+
size: number
|
|
7
|
+
min: number
|
|
8
|
+
max: number
|
|
9
|
+
onResize: (size: number) => void
|
|
10
|
+
onCollapse?: () => void
|
|
11
|
+
collapseThreshold?: number
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function ResizeHandle(props: ResizeHandleProps) {
|
|
15
|
+
const [local, rest] = splitProps(props, [
|
|
16
|
+
"direction",
|
|
17
|
+
"edge",
|
|
18
|
+
"size",
|
|
19
|
+
"min",
|
|
20
|
+
"max",
|
|
21
|
+
"onResize",
|
|
22
|
+
"onCollapse",
|
|
23
|
+
"collapseThreshold",
|
|
24
|
+
"class",
|
|
25
|
+
"classList",
|
|
26
|
+
])
|
|
27
|
+
|
|
28
|
+
const handleMouseDown = (e: MouseEvent) => {
|
|
29
|
+
e.preventDefault()
|
|
30
|
+
const edge = local.edge ?? (local.direction === "vertical" ? "start" : "end")
|
|
31
|
+
const start = local.direction === "horizontal" ? e.clientX : e.clientY
|
|
32
|
+
const startSize = local.size
|
|
33
|
+
let current = startSize
|
|
34
|
+
|
|
35
|
+
document.body.style.userSelect = "none"
|
|
36
|
+
document.body.style.overflow = "hidden"
|
|
37
|
+
|
|
38
|
+
const onMouseMove = (moveEvent: MouseEvent) => {
|
|
39
|
+
const pos = local.direction === "horizontal" ? moveEvent.clientX : moveEvent.clientY
|
|
40
|
+
const delta =
|
|
41
|
+
local.direction === "vertical"
|
|
42
|
+
? edge === "end"
|
|
43
|
+
? pos - start
|
|
44
|
+
: start - pos
|
|
45
|
+
: edge === "start"
|
|
46
|
+
? start - pos
|
|
47
|
+
: pos - start
|
|
48
|
+
current = startSize + delta
|
|
49
|
+
const clamped = Math.min(local.max, Math.max(local.min, current))
|
|
50
|
+
local.onResize(clamped)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const onMouseUp = () => {
|
|
54
|
+
document.body.style.userSelect = ""
|
|
55
|
+
document.body.style.overflow = ""
|
|
56
|
+
document.removeEventListener("mousemove", onMouseMove)
|
|
57
|
+
document.removeEventListener("mouseup", onMouseUp)
|
|
58
|
+
|
|
59
|
+
const threshold = local.collapseThreshold ?? 0
|
|
60
|
+
if (local.onCollapse && threshold > 0 && current < threshold) {
|
|
61
|
+
local.onCollapse()
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
document.addEventListener("mousemove", onMouseMove)
|
|
66
|
+
document.addEventListener("mouseup", onMouseUp)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<div
|
|
71
|
+
{...rest}
|
|
72
|
+
data-component="resize-handle"
|
|
73
|
+
data-direction={local.direction}
|
|
74
|
+
data-edge={local.edge ?? (local.direction === "vertical" ? "start" : "end")}
|
|
75
|
+
classList={{
|
|
76
|
+
...local.classList,
|
|
77
|
+
[local.class ?? ""]: !!local.class,
|
|
78
|
+
}}
|
|
79
|
+
onMouseDown={handleMouseDown}
|
|
80
|
+
/>
|
|
81
|
+
)
|
|
82
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
.scroll-view {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
min-height: 0;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.scroll-view__viewport {
|
|
10
|
+
flex: 1 1 auto;
|
|
11
|
+
min-height: 0;
|
|
12
|
+
width: 100%;
|
|
13
|
+
overflow-y: auto;
|
|
14
|
+
scrollbar-width: none;
|
|
15
|
+
outline: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.scroll-view__viewport::-webkit-scrollbar {
|
|
19
|
+
display: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.scroll-view__thumb {
|
|
23
|
+
position: absolute;
|
|
24
|
+
right: 0;
|
|
25
|
+
top: 0;
|
|
26
|
+
width: 12px;
|
|
27
|
+
transition: opacity 200ms ease;
|
|
28
|
+
cursor: default;
|
|
29
|
+
user-select: none;
|
|
30
|
+
opacity: 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.scroll-view__thumb::after {
|
|
34
|
+
content: "";
|
|
35
|
+
position: absolute;
|
|
36
|
+
left: 50%;
|
|
37
|
+
transform: translateX(-50%);
|
|
38
|
+
top: 0;
|
|
39
|
+
bottom: 0;
|
|
40
|
+
width: 4px;
|
|
41
|
+
border-radius: 9999px;
|
|
42
|
+
background-color: var(--border-weak-base);
|
|
43
|
+
backdrop-filter: blur(4px);
|
|
44
|
+
transition: background-color 150ms ease;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.scroll-view__thumb:hover::after,
|
|
48
|
+
.scroll-view__thumb[data-dragging="true"]::after {
|
|
49
|
+
background-color: var(--border-strong-base);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.dark .scroll-view__thumb::after,
|
|
53
|
+
[data-theme="dark"] .scroll-view__thumb::after {
|
|
54
|
+
background-color: var(--border-weak-base);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.dark .scroll-view__thumb:hover::after,
|
|
58
|
+
[data-theme="dark"] .scroll-view__thumb:hover::after,
|
|
59
|
+
.dark .scroll-view__thumb[data-dragging="true"]::after,
|
|
60
|
+
[data-theme="dark"] .scroll-view__thumb[data-dragging="true"]::after {
|
|
61
|
+
background-color: var(--border-strong-base);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.scroll-view__thumb[data-visible="true"] {
|
|
65
|
+
opacity: 1;
|
|
66
|
+
}
|