@neurocode-ai/ui 1.18.8
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 +113 -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 +147 -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 +115 -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 +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/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 +37 -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 +170 -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 +16 -0
- package/src/components/progress-circle.tsx +64 -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 +98 -0
- package/src/components/scroll-view.css +67 -0
- package/src/components/scroll-view.tsx +388 -0
- package/src/components/select.css +199 -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 +861 -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 +163 -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-code-span.ts +17 -0
- package/src/context/marked.tsx +570 -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 +193 -0
- package/src/i18n/br.ts +193 -0
- package/src/i18n/bs.ts +197 -0
- package/src/i18n/da.ts +192 -0
- package/src/i18n/de.ts +199 -0
- package/src/i18n/en.ts +196 -0
- package/src/i18n/es.ts +193 -0
- package/src/i18n/fr.ts +193 -0
- package/src/i18n/ja.ts +192 -0
- package/src/i18n/ko.ts +194 -0
- package/src/i18n/no.ts +197 -0
- package/src/i18n/pl.ts +192 -0
- package/src/i18n/ru.ts +192 -0
- package/src/i18n/th.ts +194 -0
- package/src/i18n/tr.ts +199 -0
- package/src/i18n/uk.ts +196 -0
- package/src/i18n/zh.ts +196 -0
- package/src/i18n/zht.ts +196 -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 +286 -0
- package/src/styles/tailwind/index.css +78 -0
- package/src/styles/tailwind/utilities.css +131 -0
- package/src/styles/theme.css +631 -0
- package/src/styles/utilities.css +118 -0
- package/src/theme/color.ts +299 -0
- package/src/theme/context.tsx +373 -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 +474 -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 +170 -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 +33 -0
- package/src/v2/components/badge-v2.tsx +23 -0
- package/src/v2/components/button-v2.css +262 -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 +177 -0
- package/src/v2/components/dialog-v2.tsx +115 -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/divider-v2.css +11 -0
- package/src/v2/components/divider-v2.tsx +20 -0
- package/src/v2/components/field-v2.css +94 -0
- package/src/v2/components/field-v2.tsx +265 -0
- package/src/v2/components/file-tree-v2.css +137 -0
- package/src/v2/components/icon-button-v2.css +159 -0
- package/src/v2/components/icon-button-v2.tsx +37 -0
- package/src/v2/components/icon.tsx +209 -0
- package/src/v2/components/inline-input-v2.css +225 -0
- package/src/v2/components/inline-input-v2.tsx +105 -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 +258 -0
- package/src/v2/components/line-comment-v2.tsx +304 -0
- package/src/v2/components/loader-v2.css +32 -0
- package/src/v2/components/loader-v2.tsx +31 -0
- package/src/v2/components/menu-v2.css +190 -0
- package/src/v2/components/menu-v2.tsx +225 -0
- package/src/v2/components/progress-circle-v2.css +13 -0
- package/src/v2/components/progress-circle-v2.tsx +52 -0
- package/src/v2/components/project-avatar-v2.css +132 -0
- package/src/v2/components/project-avatar-v2.tsx +66 -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 +286 -0
- package/src/v2/components/select-v2.tsx +208 -0
- package/src/v2/components/split-button-v2.css +99 -0
- package/src/v2/components/split-button-v2.tsx +48 -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 +226 -0
- package/src/v2/components/tabs-v2.tsx +147 -0
- package/src/v2/components/text-input-v2.css +179 -0
- package/src/v2/components/text-input-v2.tsx +93 -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 +146 -0
- package/src/v2/components/tooltip-v2.css +69 -0
- package/src/v2/components/tooltip-v2.tsx +147 -0
- package/src/v2/components/wordmark-v2.tsx +71 -0
- package/src/v2/styles/colors.css +172 -0
- package/src/v2/styles/tailwind.css +2 -0
- package/src/v2/styles/theme.css +503 -0
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
@import "./menu-v2.css";
|
|
2
|
+
|
|
3
|
+
/* Above modal dialogs (z-index 50); matches legacy select-content. */
|
|
4
|
+
[data-popper-positioner]:has([data-slot="select-v2-content"]) {
|
|
5
|
+
z-index: 60;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/* Dropdown surface (Type=menu) — overrides shared menu-v2 defaults for selects only. */
|
|
9
|
+
[data-component="menu-v2-content"][data-slot="select-v2-content"] {
|
|
10
|
+
padding: 0;
|
|
11
|
+
min-width: 160px;
|
|
12
|
+
max-width: 23rem;
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
z-index: 60;
|
|
15
|
+
pointer-events: auto;
|
|
16
|
+
background: var(--v2-background-bg-layer-01);
|
|
17
|
+
border-radius: 6px;
|
|
18
|
+
box-shadow: var(--v2-elevation-floating);
|
|
19
|
+
transform-origin: top center;
|
|
20
|
+
animation: select-v2-content-in 120ms ease-out;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
[data-component="menu-v2-content"][data-slot="select-v2-content"][data-closed] {
|
|
24
|
+
animation: select-v2-content-out 80ms ease-in forwards;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@keyframes select-v2-content-in {
|
|
28
|
+
from {
|
|
29
|
+
opacity: 0;
|
|
30
|
+
transform: translateY(-2px);
|
|
31
|
+
}
|
|
32
|
+
to {
|
|
33
|
+
opacity: 1;
|
|
34
|
+
transform: translateY(0);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@keyframes select-v2-content-out {
|
|
39
|
+
from {
|
|
40
|
+
opacity: 1;
|
|
41
|
+
transform: translateY(0);
|
|
42
|
+
}
|
|
43
|
+
to {
|
|
44
|
+
opacity: 0;
|
|
45
|
+
transform: translateY(-2px);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* Trigger shell — aligned with text-input-v2 */
|
|
50
|
+
[data-component="select-v2"] {
|
|
51
|
+
box-sizing: border-box;
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: row;
|
|
54
|
+
align-items: stretch;
|
|
55
|
+
padding: 0 6px 0 0;
|
|
56
|
+
gap: 8px;
|
|
57
|
+
width: 280px;
|
|
58
|
+
height: 28px;
|
|
59
|
+
border: 0;
|
|
60
|
+
border-radius: 6px;
|
|
61
|
+
outline: 1px solid transparent;
|
|
62
|
+
outline-offset: 0;
|
|
63
|
+
background:
|
|
64
|
+
linear-gradient(180deg, var(--v2-alpha-light-2) 0%, var(--v2-alpha-light-0) 100%), var(--v2-background-bg-base);
|
|
65
|
+
box-shadow: var(--v2-elevation-button-neutral);
|
|
66
|
+
flex: none;
|
|
67
|
+
align-self: stretch;
|
|
68
|
+
user-select: none;
|
|
69
|
+
transition:
|
|
70
|
+
background 85ms ease-out,
|
|
71
|
+
outline-color 85ms ease-out,
|
|
72
|
+
box-shadow 85ms ease-out;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
[data-component="select-v2"][data-appearance="large"] {
|
|
76
|
+
height: 32px;
|
|
77
|
+
padding: 0 8px 0 0;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
[data-component="select-v2"]:where(:hover):not([data-disabled], [data-invalid]):not(:focus-within):not(
|
|
81
|
+
[data-expanded]
|
|
82
|
+
) {
|
|
83
|
+
background:
|
|
84
|
+
linear-gradient(0deg, var(--v2-overlay-simple-overlay-hover), var(--v2-overlay-simple-overlay-hover)),
|
|
85
|
+
linear-gradient(180deg, var(--v2-alpha-light-2) 0%, var(--v2-alpha-light-0) 100%), var(--v2-background-bg-base);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
[data-component="select-v2"]:where([data-expanded]):not([data-disabled], [data-invalid]) {
|
|
89
|
+
background:
|
|
90
|
+
linear-gradient(0deg, var(--v2-overlay-simple-overlay-hover), var(--v2-overlay-simple-overlay-hover)),
|
|
91
|
+
linear-gradient(180deg, var(--v2-alpha-light-2) 0%, var(--v2-alpha-light-0) 100%), var(--v2-background-bg-base);
|
|
92
|
+
outline-color: transparent;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
[data-component="select-v2"]:where(:focus-within):not([data-disabled], [data-invalid]):not([data-expanded]) {
|
|
96
|
+
outline-color: var(--v2-border-border-focus);
|
|
97
|
+
box-shadow: none;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
[data-component="select-v2"]:where([data-invalid]):not([data-disabled]) {
|
|
101
|
+
outline-color: var(--v2-state-fg-danger);
|
|
102
|
+
box-shadow: none;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
[data-component="select-v2"]:where([data-disabled]) {
|
|
106
|
+
opacity: 0.5;
|
|
107
|
+
cursor: not-allowed;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
[data-component="select-v2"] [data-slot="select-v2-value"] {
|
|
111
|
+
display: flex;
|
|
112
|
+
flex-direction: row;
|
|
113
|
+
align-items: center;
|
|
114
|
+
align-self: stretch;
|
|
115
|
+
padding: 0;
|
|
116
|
+
min-width: 0;
|
|
117
|
+
flex: 1 1 auto;
|
|
118
|
+
min-height: 0;
|
|
119
|
+
cursor: default;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
[data-component="select-v2"] [data-slot="select-v2-value-text"] {
|
|
123
|
+
display: block;
|
|
124
|
+
width: 100%;
|
|
125
|
+
min-width: 0;
|
|
126
|
+
overflow: hidden;
|
|
127
|
+
text-overflow: ellipsis;
|
|
128
|
+
white-space: nowrap;
|
|
129
|
+
padding: 0 0 0 8px;
|
|
130
|
+
margin: 0;
|
|
131
|
+
border: 0;
|
|
132
|
+
background: transparent;
|
|
133
|
+
outline: none;
|
|
134
|
+
text-align: left;
|
|
135
|
+
font-style: normal;
|
|
136
|
+
font-weight: 440;
|
|
137
|
+
font-size: 13px;
|
|
138
|
+
line-height: 16px;
|
|
139
|
+
letter-spacing: -0.04px;
|
|
140
|
+
color: var(--v2-text-text-base);
|
|
141
|
+
font-variation-settings: "slnt" 0;
|
|
142
|
+
cursor: default;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
[data-component="select-v2"] [data-slot="select-v2-value-text"][data-placeholder-shown] {
|
|
146
|
+
color: var(--v2-text-text-faint);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
[data-component="select-v2"][data-numeric] [data-slot="select-v2-value-text"] {
|
|
150
|
+
font-variant-numeric: tabular-nums;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
[data-component="select-v2"]:where([data-invalid]):not([data-disabled]) [data-slot="select-v2-value-text"] {
|
|
154
|
+
color: var(--v2-state-fg-danger);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
[data-component="select-v2"] [data-slot="select-v2-chevron"] {
|
|
158
|
+
display: flex;
|
|
159
|
+
flex-direction: row;
|
|
160
|
+
justify-content: center;
|
|
161
|
+
align-items: center;
|
|
162
|
+
align-self: 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
|
+
pointer-events: none;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
[data-component="select-v2"] [data-slot="select-v2-chevron"] svg {
|
|
176
|
+
display: block;
|
|
177
|
+
flex: none;
|
|
178
|
+
transform: rotate(180deg);
|
|
179
|
+
transform-origin: 50% 50%;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
[data-component="select-v2"][data-expanded] [data-slot="select-v2-chevron"] svg {
|
|
183
|
+
transform: rotate(0deg);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/* Compact trigger for settings rows and similar inline contexts. */
|
|
187
|
+
[data-component="select-v2"][data-appearance="inline"] {
|
|
188
|
+
width: fit-content;
|
|
189
|
+
max-width: 100%;
|
|
190
|
+
height: 24px;
|
|
191
|
+
padding: 4px 4px 4px 8px;
|
|
192
|
+
gap: 4px;
|
|
193
|
+
border-radius: 4px;
|
|
194
|
+
background: transparent;
|
|
195
|
+
box-shadow: none;
|
|
196
|
+
outline: none;
|
|
197
|
+
align-self: auto;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
[data-component="select-v2"][data-appearance="inline"]:where(:hover):not([data-disabled], [data-invalid]):not(
|
|
201
|
+
:focus-within
|
|
202
|
+
):not([data-expanded]) {
|
|
203
|
+
background: var(--v2-overlay-simple-overlay-hover);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
[data-component="select-v2"][data-appearance="inline"]:where([data-expanded]):not([data-disabled], [data-invalid]) {
|
|
207
|
+
background: var(--v2-overlay-simple-overlay-hover);
|
|
208
|
+
outline: none;
|
|
209
|
+
box-shadow: none;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
[data-component="select-v2"][data-appearance="inline"]:where(:active):not([data-disabled], [data-invalid]):not(
|
|
213
|
+
[data-expanded]
|
|
214
|
+
) {
|
|
215
|
+
background: var(--v2-overlay-simple-overlay-pressed);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
[data-component="select-v2"][data-appearance="inline"] [data-slot="select-v2-value-text"] {
|
|
219
|
+
padding: 0;
|
|
220
|
+
font-weight: 530;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
[data-component="select-v2"][data-appearance="inline"] [data-slot="select-v2-chevron"] {
|
|
224
|
+
width: 16px;
|
|
225
|
+
height: 16px;
|
|
226
|
+
padding: 0;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/* Listbox inside menu surface */
|
|
230
|
+
[data-component="menu-v2-content"][data-slot="select-v2-content"] [data-slot="select-v2-listbox"] {
|
|
231
|
+
box-sizing: border-box;
|
|
232
|
+
display: flex;
|
|
233
|
+
flex-direction: column;
|
|
234
|
+
align-items: stretch;
|
|
235
|
+
margin: 0;
|
|
236
|
+
padding: 4px;
|
|
237
|
+
list-style: none;
|
|
238
|
+
min-width: 0;
|
|
239
|
+
width: 100%;
|
|
240
|
+
max-height: 12rem;
|
|
241
|
+
overflow-x: hidden;
|
|
242
|
+
overflow-y: auto;
|
|
243
|
+
outline: none;
|
|
244
|
+
white-space: nowrap;
|
|
245
|
+
|
|
246
|
+
&:focus {
|
|
247
|
+
outline: none;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
> *:not([role="presentation"]) + *:not([role="presentation"]) {
|
|
251
|
+
margin-top: 2px;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
[data-slot="select-v2-listbox"] [data-component="menu-v2-item"],
|
|
256
|
+
[data-slot="select-v2-listbox"] [data-slot="menu-v2-group-label"] {
|
|
257
|
+
flex: none;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
[data-slot="select-v2-listbox"] [data-component="menu-v2-item"] {
|
|
261
|
+
--menu-v2-fg: var(--v2-text-text-base);
|
|
262
|
+
--menu-v2-fg-muted: var(--v2-text-text-faint);
|
|
263
|
+
--menu-v2-fg-subtle: var(--v2-text-text-muted);
|
|
264
|
+
--menu-v2-icon: var(--v2-icon-icon-base);
|
|
265
|
+
--menu-v2-accent: var(--v2-text-text-accent);
|
|
266
|
+
--menu-v2-badge-bg: var(--v2-background-bg-layer-02);
|
|
267
|
+
--menu-v2-badge-border: var(--v2-border-border-base);
|
|
268
|
+
--menu-v2-hover: var(--v2-overlay-simple-overlay-hover);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/* Listbox uses data-selected; menu item CSS uses data-checked — mirror accent */
|
|
272
|
+
[data-slot="select-v2-listbox"] [data-component="menu-v2-item"][data-selected] [data-slot="menu-v2-item-content"] {
|
|
273
|
+
font-weight: 530;
|
|
274
|
+
color: var(--menu-v2-accent);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
[data-slot="select-v2-listbox"] [data-component="menu-v2-item"][data-selected] [data-slot="menu-v2-item-indicator"] {
|
|
278
|
+
color: var(--menu-v2-accent);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
[data-slot="select-v2-listbox"]
|
|
282
|
+
[data-component="menu-v2-item"]:not([data-selected])
|
|
283
|
+
[data-slot="menu-v2-item-indicator"]
|
|
284
|
+
svg {
|
|
285
|
+
visibility: hidden;
|
|
286
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { Select as Kobalte } from "@kobalte/core/select"
|
|
2
|
+
import { Show, createMemo, onCleanup, splitProps, type ComponentProps, type JSX } from "solid-js"
|
|
3
|
+
import "./select-v2.css"
|
|
4
|
+
|
|
5
|
+
function groupOptions<T>(options: T[], groupBy?: (x: T) => string): { category: string; options: T[] }[] {
|
|
6
|
+
if (!groupBy) {
|
|
7
|
+
return [{ category: "", options }]
|
|
8
|
+
}
|
|
9
|
+
const map = new Map<string, T[]>()
|
|
10
|
+
for (const opt of options) {
|
|
11
|
+
const key = groupBy(opt)
|
|
12
|
+
const arr = map.get(key)
|
|
13
|
+
if (arr) arr.push(opt)
|
|
14
|
+
else map.set(key, [opt])
|
|
15
|
+
}
|
|
16
|
+
return [...map.entries()].map(([category, opts]) => ({ category, options: opts }))
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const ChevronDown = () => (
|
|
20
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
|
21
|
+
<path
|
|
22
|
+
d="M11 9.5L8 6.5L5 9.5"
|
|
23
|
+
stroke="currentColor"
|
|
24
|
+
stroke-width="1"
|
|
25
|
+
stroke-linecap="round"
|
|
26
|
+
stroke-linejoin="round"
|
|
27
|
+
/>
|
|
28
|
+
</svg>
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
const CheckSmall = () => (
|
|
32
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
|
33
|
+
<path
|
|
34
|
+
d="M3.53564 8.17857L6.39279 11.75L12.4642 4.25"
|
|
35
|
+
stroke="currentColor"
|
|
36
|
+
stroke-width="1"
|
|
37
|
+
stroke-linecap="round"
|
|
38
|
+
stroke-linejoin="round"
|
|
39
|
+
/>
|
|
40
|
+
</svg>
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
export type SelectV2Props<T> = Omit<
|
|
44
|
+
ComponentProps<typeof Kobalte<T, { category: string; options: T[] }>>,
|
|
45
|
+
"value" | "onSelect" | "children" | "options" | "itemComponent" | "sectionComponent" | "defaultValue" | "multiple"
|
|
46
|
+
> & {
|
|
47
|
+
placeholder?: string
|
|
48
|
+
options: T[]
|
|
49
|
+
/** Selected option (single selection). */
|
|
50
|
+
current?: T
|
|
51
|
+
value?: (x: T) => string
|
|
52
|
+
label?: (x: T) => string
|
|
53
|
+
groupBy?: (x: T) => string
|
|
54
|
+
onSelect?: (value: T | null) => void
|
|
55
|
+
onHighlight?: (value: T | undefined) => void | (() => void)
|
|
56
|
+
/** `base` / `large` match text-input-v2; `inline` is a compact settings-row trigger. */
|
|
57
|
+
appearance?: "base" | "large" | "inline"
|
|
58
|
+
invalid?: boolean
|
|
59
|
+
numeric?: boolean
|
|
60
|
+
children?: (item: T) => JSX.Element
|
|
61
|
+
valueClass?: string
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function SelectV2<T>(props: SelectV2Props<T>) {
|
|
65
|
+
const [local, others] = splitProps(props, [
|
|
66
|
+
"class",
|
|
67
|
+
"classList",
|
|
68
|
+
"placeholder",
|
|
69
|
+
"options",
|
|
70
|
+
"current",
|
|
71
|
+
"value",
|
|
72
|
+
"label",
|
|
73
|
+
"groupBy",
|
|
74
|
+
"onSelect",
|
|
75
|
+
"onHighlight",
|
|
76
|
+
"onOpenChange",
|
|
77
|
+
"children",
|
|
78
|
+
"appearance",
|
|
79
|
+
"invalid",
|
|
80
|
+
"numeric",
|
|
81
|
+
"disabled",
|
|
82
|
+
"valueClass",
|
|
83
|
+
"placement",
|
|
84
|
+
"gutter",
|
|
85
|
+
"sameWidth",
|
|
86
|
+
"flip",
|
|
87
|
+
"slide",
|
|
88
|
+
"fitViewport",
|
|
89
|
+
])
|
|
90
|
+
|
|
91
|
+
const inline = () => (local.appearance ?? "base") === "inline"
|
|
92
|
+
|
|
93
|
+
const state: { key?: string; cleanup?: void | (() => void) } = {}
|
|
94
|
+
|
|
95
|
+
const stop = () => {
|
|
96
|
+
state.cleanup?.()
|
|
97
|
+
state.cleanup = undefined
|
|
98
|
+
state.key = undefined
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const keyFor = (item: T) => (local.value ? local.value(item) : String(item as string))
|
|
102
|
+
|
|
103
|
+
const move = (item: T | undefined) => {
|
|
104
|
+
if (!local.onHighlight) return
|
|
105
|
+
if (!item) {
|
|
106
|
+
stop()
|
|
107
|
+
return
|
|
108
|
+
}
|
|
109
|
+
const key = keyFor(item)
|
|
110
|
+
if (state.key === key) return
|
|
111
|
+
state.cleanup?.()
|
|
112
|
+
state.cleanup = local.onHighlight(item)
|
|
113
|
+
state.key = key
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
onCleanup(stop)
|
|
117
|
+
|
|
118
|
+
const grouped = createMemo(() => groupOptions(local.options, local.groupBy))
|
|
119
|
+
|
|
120
|
+
return (
|
|
121
|
+
<Kobalte<T, { category: string; options: T[] }>
|
|
122
|
+
{...others}
|
|
123
|
+
multiple={false}
|
|
124
|
+
disabled={local.disabled}
|
|
125
|
+
data-component="select-v2-root"
|
|
126
|
+
placement={local.placement ?? (inline() ? "bottom-end" : "bottom-start")}
|
|
127
|
+
gutter={local.gutter ?? 4}
|
|
128
|
+
sameWidth={local.sameWidth ?? !inline()}
|
|
129
|
+
flip={local.flip ?? true}
|
|
130
|
+
slide={local.slide ?? true}
|
|
131
|
+
fitViewport={local.fitViewport ?? false}
|
|
132
|
+
value={local.current}
|
|
133
|
+
options={grouped()}
|
|
134
|
+
optionValue={(x) => (local.value ? local.value(x) : String(x as string))}
|
|
135
|
+
optionTextValue={(x) => (local.label ? local.label(x) : String(x as string))}
|
|
136
|
+
optionGroupChildren="options"
|
|
137
|
+
placeholder={local.placeholder}
|
|
138
|
+
sectionComponent={(sectionProps) => (
|
|
139
|
+
<Kobalte.Section>
|
|
140
|
+
<Show when={sectionProps.section.rawValue.category}>
|
|
141
|
+
<div data-slot="menu-v2-group-label">{sectionProps.section.rawValue.category}</div>
|
|
142
|
+
</Show>
|
|
143
|
+
</Kobalte.Section>
|
|
144
|
+
)}
|
|
145
|
+
itemComponent={(itemProps) => (
|
|
146
|
+
<Kobalte.Item
|
|
147
|
+
{...itemProps}
|
|
148
|
+
data-component="menu-v2-item"
|
|
149
|
+
onPointerEnter={() => move(itemProps.item.rawValue)}
|
|
150
|
+
onPointerMove={() => move(itemProps.item.rawValue)}
|
|
151
|
+
onFocus={() => move(itemProps.item.rawValue)}
|
|
152
|
+
>
|
|
153
|
+
<Kobalte.ItemLabel data-slot="menu-v2-item-content" as="span">
|
|
154
|
+
{local.children
|
|
155
|
+
? local.children(itemProps.item.rawValue)
|
|
156
|
+
: local.label
|
|
157
|
+
? local.label(itemProps.item.rawValue)
|
|
158
|
+
: String(itemProps.item.rawValue as string)}
|
|
159
|
+
</Kobalte.ItemLabel>
|
|
160
|
+
<Kobalte.ItemIndicator data-slot="menu-v2-item-indicator" forceMount>
|
|
161
|
+
<CheckSmall />
|
|
162
|
+
</Kobalte.ItemIndicator>
|
|
163
|
+
</Kobalte.Item>
|
|
164
|
+
)}
|
|
165
|
+
onChange={(next) => {
|
|
166
|
+
const v = next == null ? null : Array.isArray(next) ? ((next[0] as T) ?? null) : (next as T)
|
|
167
|
+
local.onSelect?.(v)
|
|
168
|
+
stop()
|
|
169
|
+
}}
|
|
170
|
+
onOpenChange={(open) => {
|
|
171
|
+
local.onOpenChange?.(open)
|
|
172
|
+
if (!open) stop()
|
|
173
|
+
}}
|
|
174
|
+
>
|
|
175
|
+
<Kobalte.Trigger
|
|
176
|
+
as="div"
|
|
177
|
+
data-component="select-v2"
|
|
178
|
+
data-appearance={local.appearance ?? "base"}
|
|
179
|
+
data-invalid={local.invalid ? "" : undefined}
|
|
180
|
+
data-numeric={local.numeric ? "" : undefined}
|
|
181
|
+
disabled={local.disabled}
|
|
182
|
+
data-disabled={local.disabled ? "" : undefined}
|
|
183
|
+
classList={{
|
|
184
|
+
...local.classList,
|
|
185
|
+
[local.class ?? ""]: !!local.class,
|
|
186
|
+
}}
|
|
187
|
+
>
|
|
188
|
+
<div data-slot="select-v2-value">
|
|
189
|
+
<Kobalte.Value<T> data-slot="select-v2-value-text" class={local.valueClass}>
|
|
190
|
+
{(st) => {
|
|
191
|
+
const selected = st.selectedOption()
|
|
192
|
+
if (local.label && selected != null) return local.label(selected)
|
|
193
|
+
return selected != null ? (selected as string) : ""
|
|
194
|
+
}}
|
|
195
|
+
</Kobalte.Value>
|
|
196
|
+
</div>
|
|
197
|
+
<span data-slot="select-v2-chevron" aria-hidden="true">
|
|
198
|
+
<ChevronDown />
|
|
199
|
+
</span>
|
|
200
|
+
</Kobalte.Trigger>
|
|
201
|
+
<Kobalte.Portal>
|
|
202
|
+
<Kobalte.Content data-component="menu-v2-content" data-slot="select-v2-content">
|
|
203
|
+
<Kobalte.Listbox data-slot="select-v2-listbox" />
|
|
204
|
+
</Kobalte.Content>
|
|
205
|
+
</Kobalte.Portal>
|
|
206
|
+
</Kobalte>
|
|
207
|
+
)
|
|
208
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
[data-component="split-button-v2"] {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: stretch;
|
|
4
|
+
flex-shrink: 0;
|
|
5
|
+
height: 28px;
|
|
6
|
+
border-radius: 6px;
|
|
7
|
+
background-color: transparent;
|
|
8
|
+
box-shadow: none;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
[data-component="split-button-v2"]:is(:hover, :has([data-component="split-button-v2-menu-trigger"][data-expanded])) {
|
|
13
|
+
box-shadow: inset 0 0 0 1px var(--v2-border-border-muted);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
[data-component="split-button-v2-action"],
|
|
17
|
+
[data-component="split-button-v2-menu-trigger"] {
|
|
18
|
+
display: inline-flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
justify-content: center;
|
|
21
|
+
height: 28px;
|
|
22
|
+
margin: 0;
|
|
23
|
+
padding: 0;
|
|
24
|
+
border: none;
|
|
25
|
+
background: transparent;
|
|
26
|
+
color: var(--v2-icon-icon-base);
|
|
27
|
+
cursor: default;
|
|
28
|
+
outline: none;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
[data-component="split-button-v2-action"] {
|
|
32
|
+
width: 28px;
|
|
33
|
+
flex-shrink: 0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
[data-component="split-button-v2-action"]:hover:not(:disabled) {
|
|
37
|
+
background-color: var(--v2-overlay-simple-overlay-hover);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
[data-component="split-button-v2-action"]:is(:active, [data-pressed]):not(:disabled) {
|
|
41
|
+
background-color: var(--v2-overlay-simple-overlay-pressed);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
[data-component="split-button-v2-action"]:is(:focus-visible, [data-focus]) {
|
|
45
|
+
outline: 2px solid var(--v2-border-border-focus);
|
|
46
|
+
outline-offset: -2px;
|
|
47
|
+
z-index: 1;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
[data-component="split-button-v2-action"]:disabled {
|
|
51
|
+
opacity: 0.5;
|
|
52
|
+
cursor: not-allowed;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
[data-component="split-button-v2-menu-trigger"] {
|
|
56
|
+
width: 20px;
|
|
57
|
+
flex-shrink: 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
[data-component="split-button-v2-menu-trigger"]:is(:hover, [data-expanded]):not(:disabled) {
|
|
61
|
+
background-color: var(--v2-overlay-simple-overlay-hover);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
[data-component="split-button-v2-menu-trigger"]:is(:active, [data-pressed]):not(:disabled) {
|
|
65
|
+
background-color: var(--v2-overlay-simple-overlay-pressed);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
[data-component="split-button-v2-menu-trigger"]:is(:focus-visible, [data-focus]) {
|
|
69
|
+
outline: 2px solid var(--v2-border-border-focus);
|
|
70
|
+
outline-offset: -2px;
|
|
71
|
+
z-index: 1;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
[data-component="split-button-v2-menu-trigger"]:disabled {
|
|
75
|
+
opacity: 0.5;
|
|
76
|
+
cursor: not-allowed;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
[data-component="split-button-v2-action"] [data-component="app-icon"] {
|
|
80
|
+
width: 16px;
|
|
81
|
+
height: 16px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
[data-component="menu-v2-content"].open-in-app-v2-menu [data-component="app-icon"] {
|
|
85
|
+
width: 16px;
|
|
86
|
+
height: 16px;
|
|
87
|
+
flex-shrink: 0;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
[data-component="menu-v2-content"].open-in-app-v2-menu [data-component="icon"] {
|
|
91
|
+
width: 16px;
|
|
92
|
+
height: 16px;
|
|
93
|
+
flex-shrink: 0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
[data-component="menu-v2-content"].open-in-app-v2-menu [data-component="icon"] [data-slot="icon-svg"] {
|
|
97
|
+
width: 16px;
|
|
98
|
+
height: 16px;
|
|
99
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { splitProps, type ComponentProps, type ParentProps } from "solid-js"
|
|
2
|
+
import "./split-button-v2.css"
|
|
3
|
+
|
|
4
|
+
export function SplitButtonV2(props: ParentProps<ComponentProps<"div">>) {
|
|
5
|
+
const [split, rest] = splitProps(props, ["class", "classList", "children"])
|
|
6
|
+
return (
|
|
7
|
+
<div
|
|
8
|
+
data-component="split-button-v2"
|
|
9
|
+
classList={{
|
|
10
|
+
...split.classList,
|
|
11
|
+
[split.class ?? ""]: !!split.class,
|
|
12
|
+
}}
|
|
13
|
+
{...rest}
|
|
14
|
+
>
|
|
15
|
+
{split.children}
|
|
16
|
+
</div>
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function SplitButtonV2Action(props: ComponentProps<"button">) {
|
|
21
|
+
const [split, rest] = splitProps(props, ["class", "classList"])
|
|
22
|
+
return (
|
|
23
|
+
<button
|
|
24
|
+
type="button"
|
|
25
|
+
data-component="split-button-v2-action"
|
|
26
|
+
classList={{
|
|
27
|
+
...split.classList,
|
|
28
|
+
[split.class ?? ""]: !!split.class,
|
|
29
|
+
}}
|
|
30
|
+
{...rest}
|
|
31
|
+
/>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function SplitButtonV2MenuTrigger(props: ComponentProps<"button">) {
|
|
36
|
+
const [split, rest] = splitProps(props, ["class", "classList"])
|
|
37
|
+
return (
|
|
38
|
+
<button
|
|
39
|
+
type="button"
|
|
40
|
+
data-component="split-button-v2-menu-trigger"
|
|
41
|
+
classList={{
|
|
42
|
+
...split.classList,
|
|
43
|
+
[split.class ?? ""]: !!split.class,
|
|
44
|
+
}}
|
|
45
|
+
{...rest}
|
|
46
|
+
/>
|
|
47
|
+
)
|
|
48
|
+
}
|