@opencode/ui 0.0.0-beta-19275
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/actions/button/button.d.ts +10 -0
- package/dist/actions/icon-button/icon-button.d.ts +11 -0
- package/dist/actions/split-button/split-button.d.ts +5 -0
- package/dist/components/animated-number.d.ts +4 -0
- package/dist/components/app-icon.d.ts +6 -0
- package/dist/components/app-icons/types.d.ts +2 -0
- package/dist/components/card.d.ts +22 -0
- package/dist/components/collapsible.d.ts +17 -0
- package/dist/components/context-menu.d.ts +80 -0
- package/dist/components/dock-surface.d.ts +7 -0
- package/dist/components/favicon.d.ts +1 -0
- package/dist/components/file-icon.d.ts +12 -0
- package/dist/components/file-icons/types.d.ts +2 -0
- package/dist/components/font.d.ts +1 -0
- package/dist/components/hover-card.d.ts +9 -0
- package/dist/components/image-preview.d.ts +5 -0
- package/dist/components/list.d.ts +45 -0
- package/dist/components/logo.d.ts +8 -0
- package/dist/components/motion-spring.d.ts +4 -0
- package/dist/components/popover.d.ts +14 -0
- package/dist/components/progress.d.ts +7 -0
- package/dist/components/provider-icon.d.ts +5 -0
- package/dist/components/provider-icons/types.d.ts +2 -0
- package/dist/components/resize-handle.d.ts +14 -0
- package/dist/components/scroll-view.d.ts +42 -0
- package/dist/components/spinner.d.ts +6 -0
- package/dist/components/sticky-accordion-header.d.ts +5 -0
- package/dist/components/text-field.d.ts +13 -0
- package/dist/components/text-reveal.d.ts +13 -0
- package/dist/components/text-strikethrough.d.ts +11 -0
- package/dist/components/typewriter.d.ts +6 -0
- package/dist/context/dialog.d.ts +18 -0
- package/dist/context/file.d.ts +5 -0
- package/dist/context/helper.d.ts +14 -0
- package/dist/context/i18n.d.ts +24 -0
- package/dist/context/index.d.ts +4 -0
- package/dist/context/marked-base.d.ts +3 -0
- package/dist/context/marked-parser.d.ts +1 -0
- package/dist/context/marked-theme-register.d.ts +1 -0
- package/dist/context/marked-theme.d.ts +2 -0
- package/dist/context/marked.d.ts +2 -0
- package/dist/context/worker-pool.d.ts +9 -0
- package/dist/data-display/accordion/accordion.d.ts +24 -0
- package/dist/data-display/avatar/avatar.d.ts +11 -0
- package/dist/data-display/badge/badge.d.ts +7 -0
- package/dist/data-display/diff-changes/diff-changes.d.ts +12 -0
- package/dist/data-display/keybind/keybind.d.ts +7 -0
- package/dist/data-display/line-comment/line-comment.d.ts +32 -0
- package/dist/data-display/project-avatar/project-avatar.d.ts +12 -0
- package/dist/feedback/loader/loader.d.ts +3 -0
- package/dist/feedback/progress-circle/progress-circle.d.ts +9 -0
- package/dist/feedback/toast/toast.d.ts +57 -0
- package/dist/forms/checkbox/checkbox.d.ts +8 -0
- package/dist/forms/field/field.d.ts +22 -0
- package/dist/forms/inline-input/inline-input.d.ts +5 -0
- package/dist/forms/radio/radio.d.ts +16 -0
- package/dist/forms/select/select.d.ts +23 -0
- package/dist/forms/switch/switch.d.ts +9 -0
- package/dist/forms/text-input/text-input.d.ts +24 -0
- package/dist/forms/textarea/textarea.d.ts +7 -0
- package/dist/hooks/create-auto-scroll.d.ts +17 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/use-filtered-list.d.ts +48 -0
- package/dist/i18n/am.d.ts +1 -0
- package/dist/i18n/ar.d.ts +209 -0
- package/dist/i18n/az.d.ts +1 -0
- package/dist/i18n/bg.d.ts +193 -0
- package/dist/i18n/bn.d.ts +1 -0
- package/dist/i18n/br.d.ts +197 -0
- package/dist/i18n/bs.d.ts +197 -0
- package/dist/i18n/ca.d.ts +1 -0
- package/dist/i18n/cs.d.ts +1 -0
- package/dist/i18n/da.d.ts +193 -0
- package/dist/i18n/de.d.ts +193 -0
- package/dist/i18n/dv.d.ts +1 -0
- package/dist/i18n/dz.d.ts +1 -0
- package/dist/i18n/el.d.ts +1 -0
- package/dist/i18n/en.d.ts +244 -0
- package/dist/i18n/es.d.ts +197 -0
- package/dist/i18n/et.d.ts +1 -0
- package/dist/i18n/fa.d.ts +1 -0
- package/dist/i18n/fi.d.ts +1 -0
- package/dist/i18n/fo.d.ts +1 -0
- package/dist/i18n/fr.d.ts +197 -0
- package/dist/i18n/he.d.ts +197 -0
- package/dist/i18n/hi.d.ts +1 -0
- package/dist/i18n/hr.d.ts +1 -0
- package/dist/i18n/hu.d.ts +1 -0
- package/dist/i18n/hy.d.ts +1 -0
- package/dist/i18n/id.d.ts +1 -0
- package/dist/i18n/is.d.ts +1 -0
- package/dist/i18n/it.d.ts +1 -0
- package/dist/i18n/ja.d.ts +193 -0
- package/dist/i18n/ka.d.ts +1 -0
- package/dist/i18n/km.d.ts +193 -0
- package/dist/i18n/ko.d.ts +193 -0
- package/dist/i18n/lo.d.ts +193 -0
- package/dist/i18n/lt.d.ts +1 -0
- package/dist/i18n/lv.d.ts +1 -0
- package/dist/i18n/mk.d.ts +193 -0
- package/dist/i18n/mn.d.ts +193 -0
- package/dist/i18n/ms.d.ts +1 -0
- package/dist/i18n/my.d.ts +193 -0
- package/dist/i18n/ne.d.ts +1 -0
- package/dist/i18n/nl.d.ts +1 -0
- package/dist/i18n/no.d.ts +4 -0
- package/dist/i18n/pa.d.ts +1 -0
- package/dist/i18n/pl.d.ts +201 -0
- package/dist/i18n/ro.d.ts +1 -0
- package/dist/i18n/ru.d.ts +201 -0
- package/dist/i18n/si.d.ts +1 -0
- package/dist/i18n/sk.d.ts +1 -0
- package/dist/i18n/sl.d.ts +1 -0
- package/dist/i18n/sq.d.ts +1 -0
- package/dist/i18n/sr.d.ts +197 -0
- package/dist/i18n/sv.d.ts +1 -0
- package/dist/i18n/tg.d.ts +193 -0
- package/dist/i18n/th.d.ts +193 -0
- package/dist/i18n/tk.d.ts +1 -0
- package/dist/i18n/tr.d.ts +193 -0
- package/dist/i18n/uk.d.ts +1 -0
- package/dist/i18n/ur.d.ts +1 -0
- package/dist/i18n/uz.d.ts +1 -0
- package/dist/i18n/vi.d.ts +1 -0
- package/dist/i18n/zh.d.ts +193 -0
- package/dist/i18n/zht.d.ts +193 -0
- package/dist/icons/icon/additional-icons.d.ts +105 -0
- package/dist/icons/icon/icon.d.ts +216 -0
- package/dist/layout/divider/divider.d.ts +5 -0
- package/dist/navigation/menu/menu.d.ts +59 -0
- package/dist/navigation/segmented-control/segmented-control.d.ts +21 -0
- package/dist/navigation/tab-state-indicator.d.ts +2 -0
- package/dist/navigation/tabs/tabs.d.ts +39 -0
- package/dist/overlays/dialog/dialog.d.ts +26 -0
- package/dist/overlays/tooltip/tooltip.d.ts +15 -0
- package/dist/storybook/fixtures.d.ts +19 -0
- package/dist/storybook/scaffold.d.ts +16 -0
- package/dist/theme/color.d.ts +30 -0
- package/dist/theme/context.d.ts +21 -0
- package/dist/theme/default-themes.d.ts +39 -0
- package/dist/theme/index.d.ts +7 -0
- package/dist/theme/loader.d.ts +6 -0
- package/dist/theme/resolve.d.ts +7 -0
- package/dist/theme/types.d.ts +56 -0
- package/dist/theme/v2/avatar.d.ts +5 -0
- package/dist/theme/v2/default-primitives.d.ts +3 -0
- package/dist/theme/v2/foreground.d.ts +2 -0
- package/dist/theme/v2/mapping.d.ts +3 -0
- package/dist/theme/v2/resolve.d.ts +9 -0
- package/dist/typography/text-shimmer/text-shimmer.d.ts +9 -0
- package/dist/typography/wordmark/wordmark.d.ts +5 -0
- package/package.json +261 -0
- package/src/actions/button/button.css +292 -0
- package/src/actions/button/button.tsx +41 -0
- package/src/actions/icon-button/icon-button.css +177 -0
- package/src/actions/icon-button/icon-button.tsx +32 -0
- package/src/actions/split-button/split-button.css +95 -0
- package/src/actions/split-button/split-button.tsx +48 -0
- package/src/assets/audio/alert-01.aac +0 -0
- package/src/assets/audio/alert-01.mp3 +0 -0
- package/src/assets/audio/alert-02.aac +0 -0
- package/src/assets/audio/alert-02.mp3 +0 -0
- package/src/assets/audio/alert-03.aac +0 -0
- package/src/assets/audio/alert-03.mp3 +0 -0
- package/src/assets/audio/alert-04.aac +0 -0
- package/src/assets/audio/alert-04.mp3 +0 -0
- package/src/assets/audio/alert-05.aac +0 -0
- package/src/assets/audio/alert-05.mp3 +0 -0
- package/src/assets/audio/alert-06.aac +0 -0
- package/src/assets/audio/alert-06.mp3 +0 -0
- package/src/assets/audio/alert-07.aac +0 -0
- package/src/assets/audio/alert-07.mp3 +0 -0
- package/src/assets/audio/alert-08.aac +0 -0
- package/src/assets/audio/alert-08.mp3 +0 -0
- package/src/assets/audio/alert-09.aac +0 -0
- package/src/assets/audio/alert-09.mp3 +0 -0
- package/src/assets/audio/alert-10.aac +0 -0
- package/src/assets/audio/alert-10.mp3 +0 -0
- package/src/assets/audio/bip-bop-01.aac +0 -0
- package/src/assets/audio/bip-bop-01.mp3 +0 -0
- package/src/assets/audio/bip-bop-02.aac +0 -0
- package/src/assets/audio/bip-bop-02.mp3 +0 -0
- package/src/assets/audio/bip-bop-03.aac +0 -0
- package/src/assets/audio/bip-bop-03.mp3 +0 -0
- package/src/assets/audio/bip-bop-04.aac +0 -0
- package/src/assets/audio/bip-bop-04.mp3 +0 -0
- package/src/assets/audio/bip-bop-05.aac +0 -0
- package/src/assets/audio/bip-bop-05.mp3 +0 -0
- package/src/assets/audio/bip-bop-06.aac +0 -0
- package/src/assets/audio/bip-bop-06.mp3 +0 -0
- package/src/assets/audio/bip-bop-07.aac +0 -0
- package/src/assets/audio/bip-bop-07.mp3 +0 -0
- package/src/assets/audio/bip-bop-08.aac +0 -0
- package/src/assets/audio/bip-bop-08.mp3 +0 -0
- package/src/assets/audio/bip-bop-09.aac +0 -0
- package/src/assets/audio/bip-bop-09.mp3 +0 -0
- package/src/assets/audio/bip-bop-10.aac +0 -0
- package/src/assets/audio/bip-bop-10.mp3 +0 -0
- package/src/assets/audio/nope-01.aac +0 -0
- package/src/assets/audio/nope-01.mp3 +0 -0
- package/src/assets/audio/nope-02.aac +0 -0
- package/src/assets/audio/nope-02.mp3 +0 -0
- package/src/assets/audio/nope-03.aac +0 -0
- package/src/assets/audio/nope-03.mp3 +0 -0
- package/src/assets/audio/nope-04.aac +0 -0
- package/src/assets/audio/nope-04.mp3 +0 -0
- package/src/assets/audio/nope-05.aac +0 -0
- package/src/assets/audio/nope-05.mp3 +0 -0
- package/src/assets/audio/nope-06.aac +0 -0
- package/src/assets/audio/nope-06.mp3 +0 -0
- package/src/assets/audio/nope-07.aac +0 -0
- package/src/assets/audio/nope-07.mp3 +0 -0
- package/src/assets/audio/nope-08.aac +0 -0
- package/src/assets/audio/nope-08.mp3 +0 -0
- package/src/assets/audio/nope-09.aac +0 -0
- package/src/assets/audio/nope-09.mp3 +0 -0
- package/src/assets/audio/nope-10.aac +0 -0
- package/src/assets/audio/nope-10.mp3 +0 -0
- package/src/assets/audio/nope-11.aac +0 -0
- package/src/assets/audio/nope-11.mp3 +0 -0
- package/src/assets/audio/nope-12.aac +0 -0
- package/src/assets/audio/nope-12.mp3 +0 -0
- package/src/assets/audio/staplebops-01.aac +0 -0
- package/src/assets/audio/staplebops-01.mp3 +0 -0
- package/src/assets/audio/staplebops-02.aac +0 -0
- package/src/assets/audio/staplebops-02.mp3 +0 -0
- package/src/assets/audio/staplebops-03.aac +0 -0
- package/src/assets/audio/staplebops-03.mp3 +0 -0
- package/src/assets/audio/staplebops-04.aac +0 -0
- package/src/assets/audio/staplebops-04.mp3 +0 -0
- package/src/assets/audio/staplebops-05.aac +0 -0
- package/src/assets/audio/staplebops-05.mp3 +0 -0
- package/src/assets/audio/staplebops-06.aac +0 -0
- package/src/assets/audio/staplebops-06.mp3 +0 -0
- package/src/assets/audio/staplebops-07.aac +0 -0
- package/src/assets/audio/staplebops-07.mp3 +0 -0
- package/src/assets/audio/yup-01.aac +0 -0
- package/src/assets/audio/yup-01.mp3 +0 -0
- package/src/assets/audio/yup-02.aac +0 -0
- package/src/assets/audio/yup-02.mp3 +0 -0
- package/src/assets/audio/yup-03.aac +0 -0
- package/src/assets/audio/yup-03.mp3 +0 -0
- package/src/assets/audio/yup-04.aac +0 -0
- package/src/assets/audio/yup-04.mp3 +0 -0
- package/src/assets/audio/yup-05.aac +0 -0
- package/src/assets/audio/yup-05.mp3 +0 -0
- package/src/assets/audio/yup-06.aac +0 -0
- package/src/assets/audio/yup-06.mp3 +0 -0
- package/src/assets/fonts/Inter.ttf +0 -0
- package/src/assets/fonts/JetBrainsMonoNerdFontMono-Regular.woff2 +0 -0
- package/src/assets/icons/app/android-studio.svg +369 -0
- package/src/assets/icons/app/antigravity.svg +97 -0
- package/src/assets/icons/app/cursor.svg +16 -0
- package/src/assets/icons/app/file-explorer.svg +20 -0
- package/src/assets/icons/app/finder.png +0 -0
- package/src/assets/icons/app/ghostty.svg +13 -0
- package/src/assets/icons/app/iterm2.svg +13 -0
- package/src/assets/icons/app/powershell.svg +14 -0
- package/src/assets/icons/app/sublimetext.svg +17 -0
- package/src/assets/icons/app/terminal.png +0 -0
- package/src/assets/icons/app/textmate.png +0 -0
- package/src/assets/icons/app/vscode.svg +39 -0
- package/src/assets/icons/app/warp.png +0 -0
- package/src/assets/icons/app/xcode.png +0 -0
- package/src/assets/icons/app/zed-dark.svg +15 -0
- package/src/assets/icons/app/zed.svg +15 -0
- package/src/components/animated-number.css +93 -0
- package/src/components/animated-number.tsx +109 -0
- package/src/components/app-icon.css +5 -0
- package/src/components/app-icon.tsx +85 -0
- package/src/components/app-icons/sprite.svg +114 -0
- package/src/components/app-icons/types.ts +21 -0
- package/src/components/card.css +94 -0
- package/src/components/card.tsx +123 -0
- package/src/components/collapsible.css +154 -0
- package/src/components/collapsible.tsx +48 -0
- package/src/components/context-menu.css +134 -0
- package/src/components/context-menu.tsx +308 -0
- package/src/components/dock-surface.css +30 -0
- package/src/components/dock-surface.tsx +54 -0
- package/src/components/favicon.tsx +13 -0
- package/src/components/file-icon.css +26 -0
- package/src/components/file-icon.tsx +588 -0
- package/src/components/file-icons/sprite.svg +11707 -0
- package/src/components/file-icons/types.ts +1095 -0
- package/src/components/font.tsx +1 -0
- package/src/components/hover-card.css +61 -0
- package/src/components/hover-card.tsx +32 -0
- package/src/components/image-preview.css +63 -0
- package/src/components/image-preview.tsx +33 -0
- package/src/components/list.css +331 -0
- package/src/components/list.tsx +396 -0
- package/src/components/logo.css +4 -0
- package/src/components/logo.tsx +62 -0
- package/src/components/motion-spring.tsx +58 -0
- package/src/components/popover.css +98 -0
- package/src/components/popover.tsx +154 -0
- package/src/components/progress.css +63 -0
- package/src/components/progress.tsx +39 -0
- package/src/components/provider-icon.css +5 -0
- package/src/components/provider-icon.tsx +25 -0
- package/src/components/provider-icons/sprite.svg +1110 -0
- package/src/components/provider-icons/types.ts +105 -0
- package/src/components/resize-handle.css +70 -0
- package/src/components/resize-handle.tsx +102 -0
- package/src/components/scroll-view.css +99 -0
- package/src/components/scroll-view.tsx +453 -0
- package/src/components/spinner.css +6 -0
- package/src/components/spinner.tsx +52 -0
- package/src/components/sticky-accordion-header.css +6 -0
- package/src/components/sticky-accordion-header.tsx +18 -0
- package/src/components/text-field.css +134 -0
- package/src/components/text-field.tsx +136 -0
- package/src/components/text-reveal.css +150 -0
- package/src/components/text-reveal.tsx +143 -0
- package/src/components/text-strikethrough.css +27 -0
- package/src/components/text-strikethrough.tsx +84 -0
- package/src/components/typewriter.css +14 -0
- package/src/components/typewriter.tsx +55 -0
- package/src/context/dialog.tsx +198 -0
- package/src/context/file.tsx +10 -0
- package/src/context/helper.tsx +38 -0
- package/src/context/i18n.tsx +77 -0
- package/src/context/index.ts +4 -0
- package/src/context/marked-base.tsx +27 -0
- package/src/context/marked-parser.tsx +58 -0
- package/src/context/marked-theme-register.tsx +10 -0
- package/src/context/marked-theme.tsx +372 -0
- package/src/context/marked.tsx +28 -0
- package/src/context/worker-pool.tsx +20 -0
- package/src/custom-elements.d.ts +17 -0
- package/src/data-display/accordion/accordion.css +121 -0
- package/src/data-display/accordion/accordion.tsx +92 -0
- package/src/data-display/avatar/avatar.css +70 -0
- package/src/data-display/avatar/avatar.tsx +59 -0
- package/src/data-display/badge/badge.css +52 -0
- package/src/data-display/badge/badge.tsx +25 -0
- package/src/data-display/diff-changes/diff-changes.css +47 -0
- package/src/data-display/diff-changes/diff-changes.tsx +33 -0
- package/src/data-display/keybind/keybind.css +76 -0
- package/src/data-display/keybind/keybind.tsx +30 -0
- package/src/data-display/line-comment/line-comment.css +258 -0
- package/src/data-display/line-comment/line-comment.tsx +308 -0
- package/src/data-display/project-avatar/project-avatar.css +132 -0
- package/src/data-display/project-avatar/project-avatar.tsx +66 -0
- package/src/feedback/loader/loader.css +32 -0
- package/src/feedback/loader/loader.tsx +31 -0
- package/src/feedback/progress-circle/progress-circle.css +28 -0
- package/src/feedback/progress-circle/progress-circle.tsx +64 -0
- package/src/feedback/toast/toast.css +225 -0
- package/src/feedback/toast/toast.tsx +283 -0
- package/src/forms/checkbox/checkbox.css +125 -0
- package/src/forms/checkbox/checkbox.tsx +43 -0
- package/src/forms/field/field.css +94 -0
- package/src/forms/field/field.tsx +263 -0
- package/src/forms/inline-input/inline-input.css +17 -0
- package/src/forms/inline-input/inline-input.tsx +22 -0
- package/src/forms/radio/radio.css +202 -0
- package/src/forms/radio/radio.tsx +82 -0
- package/src/forms/select/select.css +291 -0
- package/src/forms/select/select.tsx +219 -0
- package/src/forms/switch/switch.css +272 -0
- package/src/forms/switch/switch.tsx +34 -0
- package/src/forms/text-input/text-input.css +181 -0
- package/src/forms/text-input/text-input.tsx +99 -0
- package/src/forms/textarea/textarea.css +78 -0
- package/src/forms/textarea/textarea.tsx +31 -0
- package/src/hooks/create-auto-scroll.tsx +257 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/use-filtered-list.tsx +134 -0
- package/src/i18n/am.ts +194 -0
- package/src/i18n/ar.ts +231 -0
- package/src/i18n/az.ts +195 -0
- package/src/i18n/bg.ts +195 -0
- package/src/i18n/bn.ts +197 -0
- package/src/i18n/br.ts +219 -0
- package/src/i18n/bs.ts +223 -0
- package/src/i18n/ca.ts +199 -0
- package/src/i18n/cs.ts +203 -0
- package/src/i18n/da.ts +214 -0
- package/src/i18n/de.ts +219 -0
- package/src/i18n/dv.ts +196 -0
- package/src/i18n/dz.ts +197 -0
- package/src/i18n/el.ts +195 -0
- package/src/i18n/en.ts +269 -0
- package/src/i18n/es.ts +219 -0
- package/src/i18n/et.ts +195 -0
- package/src/i18n/fa.ts +195 -0
- package/src/i18n/fi.ts +195 -0
- package/src/i18n/fo.ts +195 -0
- package/src/i18n/fr.ts +221 -0
- package/src/i18n/he.ts +199 -0
- package/src/i18n/hi.ts +197 -0
- package/src/i18n/hr.ts +200 -0
- package/src/i18n/hu.ts +197 -0
- package/src/i18n/hy.ts +195 -0
- package/src/i18n/id.ts +217 -0
- package/src/i18n/is.ts +195 -0
- package/src/i18n/it.ts +200 -0
- package/src/i18n/ja.ts +214 -0
- package/src/i18n/ka.ts +195 -0
- package/src/i18n/km.ts +196 -0
- package/src/i18n/ko.ts +216 -0
- package/src/i18n/lo.ts +195 -0
- package/src/i18n/lt.ts +203 -0
- package/src/i18n/lv.ts +199 -0
- package/src/i18n/mk.ts +195 -0
- package/src/i18n/mn.ts +195 -0
- package/src/i18n/ms.ts +195 -0
- package/src/i18n/my.ts +196 -0
- package/src/i18n/ne.ts +197 -0
- package/src/i18n/nl.ts +195 -0
- package/src/i18n/no.ts +219 -0
- package/src/i18n/pa.ts +196 -0
- package/src/i18n/pl.ts +223 -0
- package/src/i18n/ro.ts +199 -0
- package/src/i18n/ru.ts +222 -0
- package/src/i18n/si.ts +195 -0
- package/src/i18n/sk.ts +203 -0
- package/src/i18n/sl.ts +204 -0
- package/src/i18n/sq.ts +195 -0
- package/src/i18n/sr.ts +200 -0
- package/src/i18n/sv.ts +195 -0
- package/src/i18n/tg.ts +195 -0
- package/src/i18n/th.ts +215 -0
- package/src/i18n/tk.ts +195 -0
- package/src/i18n/tr.ts +221 -0
- package/src/i18n/uk.ts +226 -0
- package/src/i18n/ur.ts +196 -0
- package/src/i18n/uz.ts +198 -0
- package/src/i18n/vi.ts +195 -0
- package/src/i18n/zh.ts +217 -0
- package/src/i18n/zht.ts +217 -0
- package/src/icons/icon/additional-icons.ts +115 -0
- package/src/icons/icon/icon.css +3 -0
- package/src/icons/icon/icon.tsx +293 -0
- package/src/layout/divider/divider.css +11 -0
- package/src/layout/divider/divider.tsx +20 -0
- package/src/navigation/menu/menu.css +312 -0
- package/src/navigation/menu/menu.tsx +289 -0
- package/src/navigation/segmented-control/segmented-control.css +80 -0
- package/src/navigation/segmented-control/segmented-control.tsx +209 -0
- package/src/navigation/tab-state-indicator.tsx +37 -0
- package/src/navigation/tabs/tabs-current.css +239 -0
- package/src/navigation/tabs/tabs.css +710 -0
- package/src/navigation/tabs/tabs.tsx +194 -0
- package/src/overlays/dialog/dialog.css +180 -0
- package/src/overlays/dialog/dialog.tsx +115 -0
- package/src/overlays/tooltip/tooltip.css +102 -0
- package/src/overlays/tooltip/tooltip.tsx +154 -0
- package/src/storybook/fixtures.ts +51 -0
- package/src/storybook/scaffold.tsx +62 -0
- package/src/styles/animations.css +141 -0
- package/src/styles/base.css +409 -0
- package/src/styles/colors.css +772 -0
- package/src/styles/file-tree.css +202 -0
- package/src/styles/index.css +37 -0
- package/src/styles/tailwind/colors.css +288 -0
- package/src/styles/tailwind/index.css +95 -0
- package/src/styles/tailwind/utilities.css +131 -0
- package/src/styles/theme.css +631 -0
- package/src/styles/tokens/colors.css +172 -0
- package/src/styles/tokens/index.css +2 -0
- package/src/styles/tokens/theme.css +510 -0
- package/src/styles/utilities.css +118 -0
- package/src/theme/color.ts +299 -0
- package/src/theme/context.tsx +381 -0
- package/src/theme/default-themes.ts +116 -0
- package/src/theme/index.ts +78 -0
- package/src/theme/loader.ts +112 -0
- package/src/theme/resolve.ts +540 -0
- package/src/theme/themes/amoled.json +49 -0
- package/src/theme/themes/aura.json +51 -0
- package/src/theme/themes/ayu.json +51 -0
- package/src/theme/themes/carbonfox.json +53 -0
- package/src/theme/themes/catppuccin-frappe.json +85 -0
- package/src/theme/themes/catppuccin-macchiato.json +85 -0
- package/src/theme/themes/catppuccin.json +45 -0
- package/src/theme/themes/cobalt2.json +87 -0
- package/src/theme/themes/cursor.json +91 -0
- package/src/theme/themes/dracula.json +49 -0
- package/src/theme/themes/everforest.json +89 -0
- package/src/theme/themes/flexoki.json +86 -0
- package/src/theme/themes/github.json +85 -0
- package/src/theme/themes/gruvbox.json +45 -0
- package/src/theme/themes/kanagawa.json +89 -0
- package/src/theme/themes/lucent-orng.json +87 -0
- package/src/theme/themes/material.json +87 -0
- package/src/theme/themes/matrix.json +113 -0
- package/src/theme/themes/mercury.json +86 -0
- package/src/theme/themes/monokai.json +49 -0
- package/src/theme/themes/nightowl.json +46 -0
- package/src/theme/themes/nord.json +46 -0
- package/src/theme/themes/oc-2.json +507 -0
- package/src/theme/themes/one-dark.json +89 -0
- package/src/theme/themes/onedarkpro.json +45 -0
- package/src/theme/themes/opencode.json +89 -0
- package/src/theme/themes/orng.json +87 -0
- package/src/theme/themes/osaka-jade.json +88 -0
- package/src/theme/themes/palenight.json +85 -0
- package/src/theme/themes/rosepine.json +85 -0
- package/src/theme/themes/shadesofpurple.json +51 -0
- package/src/theme/themes/solarized.json +49 -0
- package/src/theme/themes/synthwave84.json +87 -0
- package/src/theme/themes/tokyonight.json +47 -0
- package/src/theme/themes/vercel.json +90 -0
- package/src/theme/themes/vesper.json +51 -0
- package/src/theme/themes/zenburn.json +87 -0
- package/src/theme/types.ts +75 -0
- package/src/theme/v2/avatar.ts +48 -0
- package/src/theme/v2/default-primitives.ts +114 -0
- package/src/theme/v2/foreground.ts +61 -0
- package/src/theme/v2/mapping.ts +176 -0
- package/src/theme/v2/resolve.ts +153 -0
- package/src/typography/text-shimmer/text-shimmer.css +120 -0
- package/src/typography/text-shimmer/text-shimmer.tsx +63 -0
- package/src/typography/wordmark/wordmark.tsx +39 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
[data-component="field-v2"] {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
align-items: flex-start;
|
|
5
|
+
gap: 8px;
|
|
6
|
+
width: 100%;
|
|
7
|
+
min-width: 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
[data-component="field-v2"] [data-slot="field-v2-label"] {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: row;
|
|
13
|
+
align-items: center;
|
|
14
|
+
align-self: stretch;
|
|
15
|
+
gap: 4px;
|
|
16
|
+
min-height: 16px;
|
|
17
|
+
margin: 0;
|
|
18
|
+
padding: 0;
|
|
19
|
+
border: 0;
|
|
20
|
+
font-style: normal;
|
|
21
|
+
font-weight: 530;
|
|
22
|
+
font-size: 13px;
|
|
23
|
+
line-height: var(--line-height-compact);
|
|
24
|
+
letter-spacing: -0.04px;
|
|
25
|
+
color: var(--v2-text-text-base);
|
|
26
|
+
font-variation-settings: "slnt" 0;
|
|
27
|
+
cursor: default;
|
|
28
|
+
user-select: none;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
[data-component="field-v2"] [data-slot="field-v2-label-text"] {
|
|
32
|
+
display: inline-flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
[data-component="field-v2"] [data-slot="field-v2-label"] [data-component="tooltip-v2-trigger"] {
|
|
37
|
+
display: inline-flex;
|
|
38
|
+
flex: none;
|
|
39
|
+
width: 16px;
|
|
40
|
+
height: 16px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
[data-component="field-v2"] [data-slot="field-v2-label-info"] {
|
|
44
|
+
display: inline-flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
flex: none;
|
|
48
|
+
width: 16px;
|
|
49
|
+
height: 16px;
|
|
50
|
+
padding: 0;
|
|
51
|
+
border: 0;
|
|
52
|
+
border-radius: 0;
|
|
53
|
+
background: transparent;
|
|
54
|
+
color: var(--v2-icon-icon-muted);
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
outline: none;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
[data-component="field-v2"] [data-slot="field-v2-label-info"]:is(:hover, [data-state="hover"]) {
|
|
60
|
+
color: var(--v2-text-text-base);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
[data-component="field-v2"] [data-slot="field-v2-label-info"]:focus {
|
|
64
|
+
outline: none;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
[data-component="field-v2"] [data-slot="field-v2-label-info"]:focus-visible {
|
|
68
|
+
outline: 2px solid var(--v2-border-border-focus);
|
|
69
|
+
outline-offset: 1px;
|
|
70
|
+
border-radius: 2px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
[data-component="field-v2"] [data-slot="field-v2-prefix"],
|
|
74
|
+
[data-component="field-v2"] [data-slot="field-v2-suffix"] {
|
|
75
|
+
align-self: stretch;
|
|
76
|
+
width: 100%;
|
|
77
|
+
min-height: 11px;
|
|
78
|
+
font-style: normal;
|
|
79
|
+
font-weight: 440;
|
|
80
|
+
font-size: 11px;
|
|
81
|
+
line-height: 1;
|
|
82
|
+
letter-spacing: 0.05px;
|
|
83
|
+
color: var(--v2-text-text-muted);
|
|
84
|
+
font-variation-settings: "slnt" 0;
|
|
85
|
+
user-select: none;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
[data-component="field-v2"] [data-slot="field-v2-control"] {
|
|
89
|
+
display: flex;
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
align-items: flex-start;
|
|
92
|
+
width: 100%;
|
|
93
|
+
min-width: 0;
|
|
94
|
+
}
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createContext,
|
|
3
|
+
createEffect,
|
|
4
|
+
createSignal,
|
|
5
|
+
createUniqueId,
|
|
6
|
+
onCleanup,
|
|
7
|
+
onMount,
|
|
8
|
+
splitProps,
|
|
9
|
+
useContext,
|
|
10
|
+
Show,
|
|
11
|
+
type ComponentProps,
|
|
12
|
+
type ParentProps,
|
|
13
|
+
} from "solid-js"
|
|
14
|
+
import { Tooltip } from "@opencode/ui/tooltip"
|
|
15
|
+
import "./field.css"
|
|
16
|
+
|
|
17
|
+
type FieldContextValue = {
|
|
18
|
+
controlId: string
|
|
19
|
+
labelId: string
|
|
20
|
+
prefixId: string
|
|
21
|
+
suffixId: string
|
|
22
|
+
invalid: () => boolean
|
|
23
|
+
registerPrefix: () => void
|
|
24
|
+
unregisterPrefix: () => void
|
|
25
|
+
registerSuffix: () => void
|
|
26
|
+
unregisterSuffix: () => void
|
|
27
|
+
getDescribedBy: () => string | undefined
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const FieldContext = createContext<FieldContextValue>()
|
|
31
|
+
|
|
32
|
+
function useField() {
|
|
33
|
+
const ctx = useContext(FieldContext)
|
|
34
|
+
if (!ctx) {
|
|
35
|
+
throw new Error("Field subcomponents must be used within <Field>")
|
|
36
|
+
}
|
|
37
|
+
return ctx
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const CONTROL_SELECTOR = [
|
|
41
|
+
"[data-slot='text-input-v2-input']",
|
|
42
|
+
"[data-slot='textarea-v2-textarea']",
|
|
43
|
+
"[data-component='inline-input']",
|
|
44
|
+
].join(", ")
|
|
45
|
+
|
|
46
|
+
export interface FieldProps extends ComponentProps<"div"> {
|
|
47
|
+
invalid?: boolean
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function FieldRoot(props: ParentProps<FieldProps>) {
|
|
51
|
+
const [local, rest] = splitProps(props, ["invalid", "class", "classList", "children"])
|
|
52
|
+
|
|
53
|
+
const controlId = `field-control-${createUniqueId()}`
|
|
54
|
+
const labelId = `field-label-${createUniqueId()}`
|
|
55
|
+
const prefixId = `field-prefix-${createUniqueId()}`
|
|
56
|
+
const suffixId = `field-suffix-${createUniqueId()}`
|
|
57
|
+
|
|
58
|
+
const [prefixCount, setPrefixCount] = createSignal(0)
|
|
59
|
+
const [suffixCount, setSuffixCount] = createSignal(0)
|
|
60
|
+
|
|
61
|
+
let rootRef: HTMLDivElement | undefined
|
|
62
|
+
|
|
63
|
+
const ctx: FieldContextValue = {
|
|
64
|
+
controlId,
|
|
65
|
+
labelId,
|
|
66
|
+
prefixId,
|
|
67
|
+
suffixId,
|
|
68
|
+
invalid: () => !!local.invalid,
|
|
69
|
+
registerPrefix: () => setPrefixCount((n) => n + 1),
|
|
70
|
+
unregisterPrefix: () => setPrefixCount((n) => Math.max(0, n - 1)),
|
|
71
|
+
registerSuffix: () => setSuffixCount((n) => n + 1),
|
|
72
|
+
unregisterSuffix: () => setSuffixCount((n) => Math.max(0, n - 1)),
|
|
73
|
+
getDescribedBy: () => {
|
|
74
|
+
const ids: string[] = []
|
|
75
|
+
if (prefixCount() > 0) ids.push(prefixId)
|
|
76
|
+
if (suffixCount() > 0) ids.push(suffixId)
|
|
77
|
+
return ids.length > 0 ? ids.join(" ") : undefined
|
|
78
|
+
},
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const syncControlA11y = () => {
|
|
82
|
+
const root = rootRef
|
|
83
|
+
if (!root) return
|
|
84
|
+
|
|
85
|
+
const control = root.querySelector(CONTROL_SELECTOR) as HTMLInputElement | HTMLTextAreaElement | null
|
|
86
|
+
if (!control) return
|
|
87
|
+
|
|
88
|
+
const shell = control.closest(
|
|
89
|
+
"[data-component='text-input-v2'], [data-component='textarea-v2'], [data-component='inline-input']",
|
|
90
|
+
) as HTMLElement | null
|
|
91
|
+
|
|
92
|
+
control.id = controlId
|
|
93
|
+
control.setAttribute("aria-labelledby", labelId)
|
|
94
|
+
|
|
95
|
+
const describedBy = ctx.getDescribedBy()
|
|
96
|
+
if (describedBy) {
|
|
97
|
+
control.setAttribute("aria-describedby", describedBy)
|
|
98
|
+
} else {
|
|
99
|
+
control.removeAttribute("aria-describedby")
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (ctx.invalid()) {
|
|
103
|
+
control.setAttribute("aria-invalid", "true")
|
|
104
|
+
shell?.setAttribute("data-invalid", "")
|
|
105
|
+
} else {
|
|
106
|
+
control.removeAttribute("aria-invalid")
|
|
107
|
+
shell?.removeAttribute("data-invalid")
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
onMount(() => {
|
|
112
|
+
syncControlA11y()
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
createEffect(() => {
|
|
116
|
+
prefixCount()
|
|
117
|
+
suffixCount()
|
|
118
|
+
local.invalid
|
|
119
|
+
syncControlA11y()
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
return (
|
|
123
|
+
<FieldContext.Provider value={ctx}>
|
|
124
|
+
<div
|
|
125
|
+
{...rest}
|
|
126
|
+
ref={rootRef}
|
|
127
|
+
data-component="field-v2"
|
|
128
|
+
data-invalid={local.invalid ? "" : undefined}
|
|
129
|
+
classList={{
|
|
130
|
+
...local.classList,
|
|
131
|
+
[local.class ?? ""]: !!local.class,
|
|
132
|
+
}}
|
|
133
|
+
>
|
|
134
|
+
{local.children}
|
|
135
|
+
</div>
|
|
136
|
+
</FieldContext.Provider>
|
|
137
|
+
)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function FieldLabelInfoIcon() {
|
|
141
|
+
return (
|
|
142
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
|
143
|
+
<path
|
|
144
|
+
fill-rule="evenodd"
|
|
145
|
+
clip-rule="evenodd"
|
|
146
|
+
d="M13 13H3V3H13V13ZM6.46777 6.81641V7.81641H7.5791V11.3721H8.5791V6.81641H6.46777ZM7.30078 4.62891V5.62891H8.85645V4.62891H7.30078Z"
|
|
147
|
+
fill="currentColor"
|
|
148
|
+
/>
|
|
149
|
+
</svg>
|
|
150
|
+
)
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export interface FieldLabelProps extends ComponentProps<"label"> {
|
|
154
|
+
/** When set, shows the info icon with a tooltip containing this text. */
|
|
155
|
+
tooltip?: string
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function FieldLabel(props: ParentProps<FieldLabelProps>) {
|
|
159
|
+
const [local, rest] = splitProps(props, ["class", "classList", "children", "tooltip"])
|
|
160
|
+
const field = useField()
|
|
161
|
+
|
|
162
|
+
return (
|
|
163
|
+
<label
|
|
164
|
+
{...rest}
|
|
165
|
+
id={field.labelId}
|
|
166
|
+
for={field.controlId}
|
|
167
|
+
data-slot="field-v2-label"
|
|
168
|
+
classList={{
|
|
169
|
+
...local.classList,
|
|
170
|
+
[local.class ?? ""]: !!local.class,
|
|
171
|
+
}}
|
|
172
|
+
>
|
|
173
|
+
<span data-slot="field-v2-label-text">{local.children}</span>
|
|
174
|
+
<Show when={local.tooltip}>
|
|
175
|
+
{(tooltip) => (
|
|
176
|
+
<Tooltip value={tooltip()}>
|
|
177
|
+
<button
|
|
178
|
+
type="button"
|
|
179
|
+
data-slot="field-v2-label-info"
|
|
180
|
+
aria-label={tooltip()}
|
|
181
|
+
onClick={(e) => e.stopPropagation()}
|
|
182
|
+
>
|
|
183
|
+
<FieldLabelInfoIcon />
|
|
184
|
+
</button>
|
|
185
|
+
</Tooltip>
|
|
186
|
+
)}
|
|
187
|
+
</Show>
|
|
188
|
+
</label>
|
|
189
|
+
)
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function FieldPrefix(props: ParentProps<ComponentProps<"div">>) {
|
|
193
|
+
const [local, rest] = splitProps(props, ["class", "classList", "children"])
|
|
194
|
+
const field = useField()
|
|
195
|
+
|
|
196
|
+
onMount(() => {
|
|
197
|
+
field.registerPrefix()
|
|
198
|
+
onCleanup(() => field.unregisterPrefix())
|
|
199
|
+
})
|
|
200
|
+
|
|
201
|
+
return (
|
|
202
|
+
<div
|
|
203
|
+
{...rest}
|
|
204
|
+
id={field.prefixId}
|
|
205
|
+
data-slot="field-v2-prefix"
|
|
206
|
+
classList={{
|
|
207
|
+
...local.classList,
|
|
208
|
+
[local.class ?? ""]: !!local.class,
|
|
209
|
+
}}
|
|
210
|
+
>
|
|
211
|
+
{local.children}
|
|
212
|
+
</div>
|
|
213
|
+
)
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
function FieldSuffix(props: ParentProps<ComponentProps<"div">>) {
|
|
217
|
+
const [local, rest] = splitProps(props, ["class", "classList", "children"])
|
|
218
|
+
const field = useField()
|
|
219
|
+
|
|
220
|
+
onMount(() => {
|
|
221
|
+
field.registerSuffix()
|
|
222
|
+
onCleanup(() => field.unregisterSuffix())
|
|
223
|
+
})
|
|
224
|
+
|
|
225
|
+
return (
|
|
226
|
+
<div
|
|
227
|
+
{...rest}
|
|
228
|
+
id={field.suffixId}
|
|
229
|
+
data-slot="field-v2-suffix"
|
|
230
|
+
classList={{
|
|
231
|
+
...local.classList,
|
|
232
|
+
[local.class ?? ""]: !!local.class,
|
|
233
|
+
}}
|
|
234
|
+
>
|
|
235
|
+
{local.children}
|
|
236
|
+
</div>
|
|
237
|
+
)
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/** Optional layout wrapper around the control. */
|
|
241
|
+
function FieldControl(props: ParentProps<ComponentProps<"div">>) {
|
|
242
|
+
const [local, rest] = splitProps(props, ["class", "classList", "children"])
|
|
243
|
+
|
|
244
|
+
return (
|
|
245
|
+
<div
|
|
246
|
+
{...rest}
|
|
247
|
+
data-slot="field-v2-control"
|
|
248
|
+
classList={{
|
|
249
|
+
...local.classList,
|
|
250
|
+
[local.class ?? ""]: !!local.class,
|
|
251
|
+
}}
|
|
252
|
+
>
|
|
253
|
+
{local.children}
|
|
254
|
+
</div>
|
|
255
|
+
)
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export const Field = Object.assign(FieldRoot, {
|
|
259
|
+
Label: FieldLabel,
|
|
260
|
+
Prefix: FieldPrefix,
|
|
261
|
+
Suffix: FieldSuffix,
|
|
262
|
+
Control: FieldControl,
|
|
263
|
+
})
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
[data-component="inline-input"] {
|
|
2
|
+
color: inherit;
|
|
3
|
+
background: transparent;
|
|
4
|
+
border: 0;
|
|
5
|
+
border-radius: var(--radius-md);
|
|
6
|
+
padding: 0;
|
|
7
|
+
min-width: 0;
|
|
8
|
+
font: inherit;
|
|
9
|
+
letter-spacing: inherit;
|
|
10
|
+
line-height: inherit;
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
|
|
13
|
+
&:focus {
|
|
14
|
+
outline: none;
|
|
15
|
+
box-shadow: var(--inline-input-shadow, 0 0 0 1px var(--border-interactive-focus));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ComponentProps } from "solid-js"
|
|
2
|
+
import { splitProps } from "solid-js"
|
|
3
|
+
|
|
4
|
+
export type InlineInputProps = ComponentProps<"input"> & {
|
|
5
|
+
width?: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function InlineInput(props: InlineInputProps) {
|
|
9
|
+
const [local, others] = splitProps(props, ["class", "width", "style"])
|
|
10
|
+
|
|
11
|
+
const style = () => {
|
|
12
|
+
if (!local.style) return { width: local.width }
|
|
13
|
+
if (typeof local.style === "string") {
|
|
14
|
+
if (!local.width) return local.style
|
|
15
|
+
return `${local.style};width:${local.width}`
|
|
16
|
+
}
|
|
17
|
+
if (!local.width) return local.style
|
|
18
|
+
return { ...local.style, width: local.width }
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return <input data-component="inline-input" class={local.class} style={style()} {...others} />
|
|
22
|
+
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
[data-component="radio-v2"] {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 8px;
|
|
5
|
+
cursor: default;
|
|
6
|
+
|
|
7
|
+
[data-slot="radio-v2-label"] {
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
user-select: none;
|
|
11
|
+
color: var(--v2-text-text-faint);
|
|
12
|
+
font-size: 11px;
|
|
13
|
+
font-style: normal;
|
|
14
|
+
font-weight: 440;
|
|
15
|
+
line-height: 1;
|
|
16
|
+
letter-spacing: 0.05px;
|
|
17
|
+
font-variation-settings: "slnt" 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
[data-slot="radio-v2-description"] {
|
|
21
|
+
color: var(--v2-text-text-faint);
|
|
22
|
+
font-size: 11px;
|
|
23
|
+
font-weight: 440;
|
|
24
|
+
line-height: 1.2;
|
|
25
|
+
letter-spacing: 0.05px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
[data-slot="radio-v2-items"] {
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
gap: 12px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
[data-slot="radio-v2-error"] {
|
|
35
|
+
color: var(--v2-state-fg-danger);
|
|
36
|
+
font-size: 12px;
|
|
37
|
+
font-weight: var(--font-weight-regular);
|
|
38
|
+
line-height: var(--line-height-normal);
|
|
39
|
+
letter-spacing: var(--letter-spacing-normal);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
[data-slot="radio-v2-error"]:empty {
|
|
43
|
+
display: none;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
[data-slot="radio-v2-item"] {
|
|
48
|
+
position: relative;
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: row;
|
|
51
|
+
align-items: flex-start;
|
|
52
|
+
padding: 0px;
|
|
53
|
+
gap: 8px;
|
|
54
|
+
|
|
55
|
+
&:where([data-disabled]) {
|
|
56
|
+
cursor: not-allowed;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
[data-slot="radio-v2-item-input"] {
|
|
60
|
+
position: absolute;
|
|
61
|
+
width: 1px;
|
|
62
|
+
height: 1px;
|
|
63
|
+
padding: 0;
|
|
64
|
+
margin: -1px;
|
|
65
|
+
overflow: hidden;
|
|
66
|
+
clip: rect(0, 0, 0, 0);
|
|
67
|
+
white-space: nowrap;
|
|
68
|
+
border-width: 0;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
[data-slot="radio-v2-item-control-stack"] {
|
|
72
|
+
position: relative;
|
|
73
|
+
width: 16px;
|
|
74
|
+
height: 20px;
|
|
75
|
+
flex: none;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
[data-slot="radio-v2-item-control"] {
|
|
79
|
+
box-sizing: border-box;
|
|
80
|
+
position: absolute;
|
|
81
|
+
width: 16px;
|
|
82
|
+
height: 16px;
|
|
83
|
+
flex: none;
|
|
84
|
+
flex-shrink: 0;
|
|
85
|
+
left: 0;
|
|
86
|
+
top: calc(50% - 16px / 2);
|
|
87
|
+
|
|
88
|
+
border-radius: 9999px;
|
|
89
|
+
border: none;
|
|
90
|
+
box-shadow: inset 0 0 0 0.5px var(--v2-border-border-strong);
|
|
91
|
+
|
|
92
|
+
background:
|
|
93
|
+
linear-gradient(180deg, var(--v2-alpha-light-6) 0%, var(--v2-alpha-light-0) 100%), var(--v2-background-bg-base);
|
|
94
|
+
transition:
|
|
95
|
+
background 170ms ease-out,
|
|
96
|
+
opacity 170ms ease-out,
|
|
97
|
+
outline-color 170ms ease-out;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&:where(:not([data-readonly]))
|
|
101
|
+
[data-slot="radio-v2-item-input"]:focus-visible
|
|
102
|
+
~ [data-slot="radio-v2-item-control-stack"]
|
|
103
|
+
[data-slot="radio-v2-item-control"] {
|
|
104
|
+
outline: 2px solid var(--v2-border-border-focus);
|
|
105
|
+
outline-offset: 1px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&:where(:hover):where(:not([data-disabled], [data-readonly])):where(:not([data-checked]))
|
|
109
|
+
[data-slot="radio-v2-item-control"] {
|
|
110
|
+
background:
|
|
111
|
+
linear-gradient(0deg, var(--v2-overlay-simple-overlay-hover), var(--v2-overlay-simple-overlay-hover)),
|
|
112
|
+
linear-gradient(180deg, var(--v2-alpha-light-6) 0%, var(--v2-alpha-light-0) 100%), var(--v2-background-bg-base);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&:where([data-disabled]) [data-slot="radio-v2-item-control"] {
|
|
116
|
+
opacity: 0.5;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&:where([data-checked]) [data-slot="radio-v2-item-control"] {
|
|
120
|
+
background:
|
|
121
|
+
linear-gradient(180deg, var(--v2-alpha-light-20) 0%, var(--v2-alpha-light-0) 100%), var(--v2-background-bg-accent);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&:where([data-checked]):where(:hover):where(:not([data-disabled], [data-readonly]))
|
|
125
|
+
[data-slot="radio-v2-item-control"] {
|
|
126
|
+
background:
|
|
127
|
+
linear-gradient(
|
|
128
|
+
0deg,
|
|
129
|
+
var(--v2-overlay-simple-overlay-contrast-hover),
|
|
130
|
+
var(--v2-overlay-simple-overlay-contrast-hover)
|
|
131
|
+
),
|
|
132
|
+
linear-gradient(180deg, var(--v2-alpha-light-20) 0%, var(--v2-alpha-light-0) 100%), var(--v2-background-bg-accent);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&:where([data-invalid]):where(:not([data-checked])) [data-slot="radio-v2-item-control"] {
|
|
136
|
+
background: var(--v2-state-bg-danger);
|
|
137
|
+
box-shadow: inset 0 0 0 0.5px var(--v2-state-border-danger);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
[data-slot="radio-v2-item-indicator"] {
|
|
141
|
+
box-sizing: border-box;
|
|
142
|
+
position: absolute;
|
|
143
|
+
width: 6px;
|
|
144
|
+
height: 6px;
|
|
145
|
+
left: calc(50% - 6px / 2);
|
|
146
|
+
top: calc(50% - 6px / 2);
|
|
147
|
+
border-radius: 9999px;
|
|
148
|
+
|
|
149
|
+
background: var(--v2-grey-300);
|
|
150
|
+
border: none;
|
|
151
|
+
box-shadow:
|
|
152
|
+
inset 0 0 0 0.5px var(--v2-overlay-gradient-depth-overlay-depth-top),
|
|
153
|
+
0px 0.5px 0.5px rgba(0, 0, 0, 0.4);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
[data-slot="radio-v2-item-text"] {
|
|
157
|
+
display: flex;
|
|
158
|
+
flex-direction: column;
|
|
159
|
+
justify-content: center;
|
|
160
|
+
align-items: flex-start;
|
|
161
|
+
padding: 0px;
|
|
162
|
+
gap: 6px;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
[data-slot="radio-v2-item-label"] {
|
|
166
|
+
display: inline-flex;
|
|
167
|
+
user-select: none;
|
|
168
|
+
color: inherit;
|
|
169
|
+
font-style: normal;
|
|
170
|
+
font-weight: 440;
|
|
171
|
+
font-variant-numeric: tabular-nums;
|
|
172
|
+
font-variation-settings: "slnt" 0;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
[data-slot="radio-v2-item-label-text"] {
|
|
176
|
+
display: inline-flex;
|
|
177
|
+
align-items: center;
|
|
178
|
+
user-select: none;
|
|
179
|
+
color: var(--v2-text-text-base);
|
|
180
|
+
font-size: 13px;
|
|
181
|
+
line-height: 20px;
|
|
182
|
+
letter-spacing: -0.04px;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
[data-slot="radio-v2-item-description"] {
|
|
186
|
+
color: var(--v2-text-text-muted);
|
|
187
|
+
font-size: 11px;
|
|
188
|
+
font-weight: 440;
|
|
189
|
+
line-height: 1;
|
|
190
|
+
letter-spacing: 0.05px;
|
|
191
|
+
font-variant-numeric: tabular-nums;
|
|
192
|
+
user-select: none;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
&:where([data-disabled]) [data-slot="radio-v2-item-label-text"] {
|
|
196
|
+
color: var(--v2-text-text-muted);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
&:where([data-disabled]) [data-slot="radio-v2-item-description"] {
|
|
200
|
+
color: var(--v2-text-text-faint);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Description,
|
|
3
|
+
ErrorMessage,
|
|
4
|
+
Item,
|
|
5
|
+
ItemControl,
|
|
6
|
+
ItemIndicator,
|
|
7
|
+
ItemInput,
|
|
8
|
+
ItemLabel,
|
|
9
|
+
Label,
|
|
10
|
+
Root,
|
|
11
|
+
} from "@kobalte/core/radio-group"
|
|
12
|
+
import { Show, splitProps, type JSX } from "solid-js"
|
|
13
|
+
import type { ComponentProps, ParentProps } from "solid-js"
|
|
14
|
+
import "./radio.css"
|
|
15
|
+
|
|
16
|
+
export interface RadioGroupProps extends ParentProps<ComponentProps<typeof Root>> {
|
|
17
|
+
label?: JSX.Element
|
|
18
|
+
description?: JSX.Element
|
|
19
|
+
hideLabel?: boolean
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function RadioGroup(props: RadioGroupProps) {
|
|
23
|
+
const [local, others] = splitProps(props, ["class", "classList", "children", "label", "description", "hideLabel"])
|
|
24
|
+
return (
|
|
25
|
+
<Root
|
|
26
|
+
{...others}
|
|
27
|
+
data-component="radio-v2"
|
|
28
|
+
classList={{
|
|
29
|
+
...local.classList,
|
|
30
|
+
[local.class ?? ""]: !!local.class,
|
|
31
|
+
}}
|
|
32
|
+
>
|
|
33
|
+
<Show when={local.label}>
|
|
34
|
+
{(label) => (
|
|
35
|
+
<Label data-slot="radio-v2-label" classList={{ "sr-only": local.hideLabel }}>
|
|
36
|
+
{label()}
|
|
37
|
+
</Label>
|
|
38
|
+
)}
|
|
39
|
+
</Show>
|
|
40
|
+
<Show when={local.description}>
|
|
41
|
+
{(description) => <Description data-slot="radio-v2-description">{description()}</Description>}
|
|
42
|
+
</Show>
|
|
43
|
+
<div data-slot="radio-v2-items">{local.children}</div>
|
|
44
|
+
<ErrorMessage data-slot="radio-v2-error" />
|
|
45
|
+
</Root>
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface RadioItemProps extends ComponentProps<typeof Item> {
|
|
50
|
+
label: JSX.Element
|
|
51
|
+
description?: JSX.Element
|
|
52
|
+
hideLabel?: boolean
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function RadioItem(props: RadioItemProps) {
|
|
56
|
+
const [local, others] = splitProps(props, ["class", "classList", "label", "description", "hideLabel"])
|
|
57
|
+
return (
|
|
58
|
+
<Item
|
|
59
|
+
{...others}
|
|
60
|
+
data-slot="radio-v2-item"
|
|
61
|
+
classList={{
|
|
62
|
+
...local.classList,
|
|
63
|
+
[local.class ?? ""]: !!local.class,
|
|
64
|
+
}}
|
|
65
|
+
>
|
|
66
|
+
<ItemInput data-slot="radio-v2-item-input" />
|
|
67
|
+
<div data-slot="radio-v2-item-control-stack">
|
|
68
|
+
<ItemControl data-slot="radio-v2-item-control">
|
|
69
|
+
<ItemIndicator data-slot="radio-v2-item-indicator" />
|
|
70
|
+
</ItemControl>
|
|
71
|
+
</div>
|
|
72
|
+
<ItemLabel data-slot="radio-v2-item-label" classList={{ "sr-only": local.hideLabel }}>
|
|
73
|
+
<div data-slot="radio-v2-item-text">
|
|
74
|
+
<span data-slot="radio-v2-item-label-text">{local.label}</span>
|
|
75
|
+
<Show when={local.description}>
|
|
76
|
+
{(description) => <span data-slot="radio-v2-item-description">{description()}</span>}
|
|
77
|
+
</Show>
|
|
78
|
+
</div>
|
|
79
|
+
</ItemLabel>
|
|
80
|
+
</Item>
|
|
81
|
+
)
|
|
82
|
+
}
|