@opencode/ui 0.0.0-reserved → 2.0.0
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 +251 -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 +228 -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 +252 -6
- package/src/actions/button/button.css +294 -0
- package/src/actions/button/button.tsx +42 -0
- package/src/actions/icon-button/icon-button.css +124 -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/actions/submit.css +74 -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 +55 -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 +290 -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 +276 -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 +305 -0
- package/src/layout/divider/divider.css +11 -0
- package/src/layout/divider/divider.tsx +20 -0
- package/src/navigation/menu/menu.css +311 -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
- package/README.md +0 -5
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
/* Above modal dialogs (z-index 50); matches select-v2-content. */
|
|
2
|
+
[data-popper-positioner]:has([data-component="menu-v2-content"]) {
|
|
3
|
+
z-index: 60;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
[data-component="menu-v2-content"] {
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
align-items: stretch;
|
|
11
|
+
padding: 2px;
|
|
12
|
+
min-width: 160px;
|
|
13
|
+
z-index: 60;
|
|
14
|
+
pointer-events: auto;
|
|
15
|
+
|
|
16
|
+
background: var(--v2-background-bg-layer-01);
|
|
17
|
+
border-radius: 6px;
|
|
18
|
+
box-shadow: var(--v2-elevation-floating);
|
|
19
|
+
|
|
20
|
+
outline: none;
|
|
21
|
+
|
|
22
|
+
-webkit-font-smoothing: antialiased;
|
|
23
|
+
-moz-osx-font-smoothing: grayscale;
|
|
24
|
+
text-rendering: geometricPrecision;
|
|
25
|
+
|
|
26
|
+
transform-origin: var(--kb-menu-content-transform-origin);
|
|
27
|
+
animation: menu-v2-in 120ms ease-out;
|
|
28
|
+
|
|
29
|
+
&:focus-visible {
|
|
30
|
+
outline: none;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:dir(rtl) [data-slot="menu-v2-item-chevron"] {
|
|
35
|
+
transform: scaleX(-1);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
[data-component="menu-v2-item"] {
|
|
39
|
+
--menu-v2-fg: var(--v2-text-text-base);
|
|
40
|
+
--menu-v2-fg-muted: var(--v2-text-text-faint);
|
|
41
|
+
--menu-v2-fg-subtle: var(--v2-text-text-muted);
|
|
42
|
+
--menu-v2-icon: var(--v2-icon-icon-base);
|
|
43
|
+
--menu-v2-badge-bg: var(--v2-background-bg-layer-02);
|
|
44
|
+
--menu-v2-badge-border: var(--v2-border-border-base);
|
|
45
|
+
--menu-v2-hover: var(--v2-overlay-simple-overlay-hover);
|
|
46
|
+
|
|
47
|
+
-webkit-font-smoothing: antialiased;
|
|
48
|
+
-moz-osx-font-smoothing: grayscale;
|
|
49
|
+
text-rendering: geometricPrecision;
|
|
50
|
+
|
|
51
|
+
box-sizing: border-box;
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-shrink: 0;
|
|
54
|
+
flex-direction: row;
|
|
55
|
+
align-items: center;
|
|
56
|
+
gap: 8px;
|
|
57
|
+
height: 28px;
|
|
58
|
+
padding: 0 12px;
|
|
59
|
+
padding-inline-end: 6px;
|
|
60
|
+
background: transparent;
|
|
61
|
+
border-radius: 4px;
|
|
62
|
+
outline: none;
|
|
63
|
+
cursor: default;
|
|
64
|
+
user-select: none;
|
|
65
|
+
|
|
66
|
+
font-variation-settings: "slnt" 0;
|
|
67
|
+
font-variant-numeric: tabular-nums;
|
|
68
|
+
color: var(--menu-v2-fg);
|
|
69
|
+
|
|
70
|
+
[data-slot="menu-v2-item-content"] {
|
|
71
|
+
display: flex;
|
|
72
|
+
flex: 1 1 auto;
|
|
73
|
+
flex-direction: row;
|
|
74
|
+
align-items: center;
|
|
75
|
+
gap: 8px;
|
|
76
|
+
min-width: 0;
|
|
77
|
+
|
|
78
|
+
font-size: 13px;
|
|
79
|
+
font-weight: 440;
|
|
80
|
+
line-height: var(--line-height-compact);
|
|
81
|
+
letter-spacing: -0.04px;
|
|
82
|
+
color: var(--menu-v2-fg);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
[data-slot="menu-v2-item-shortcut"] {
|
|
86
|
+
display: inline-flex;
|
|
87
|
+
align-items: center;
|
|
88
|
+
flex: none;
|
|
89
|
+
height: 11px;
|
|
90
|
+
|
|
91
|
+
font-size: 11px;
|
|
92
|
+
font-weight: 530;
|
|
93
|
+
line-height: 100%;
|
|
94
|
+
letter-spacing: 0.05px;
|
|
95
|
+
color: var(--menu-v2-fg-muted);
|
|
96
|
+
white-space: nowrap;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
[data-slot="menu-v2-item-badge"] {
|
|
100
|
+
box-sizing: border-box;
|
|
101
|
+
display: inline-flex;
|
|
102
|
+
flex-direction: row;
|
|
103
|
+
align-items: center;
|
|
104
|
+
justify-content: center;
|
|
105
|
+
flex: none;
|
|
106
|
+
gap: 4px;
|
|
107
|
+
height: 16px;
|
|
108
|
+
padding: 0 4px;
|
|
109
|
+
|
|
110
|
+
background: var(--menu-v2-badge-bg);
|
|
111
|
+
border: 0.5px solid var(--menu-v2-badge-border);
|
|
112
|
+
border-radius: 2px;
|
|
113
|
+
|
|
114
|
+
font-size: 11px;
|
|
115
|
+
font-weight: 530;
|
|
116
|
+
line-height: 100%;
|
|
117
|
+
letter-spacing: 0.05px;
|
|
118
|
+
color: var(--menu-v2-fg-subtle);
|
|
119
|
+
white-space: nowrap;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
[data-slot="menu-v2-item-indicator"] {
|
|
123
|
+
display: inline-flex;
|
|
124
|
+
align-items: center;
|
|
125
|
+
justify-content: center;
|
|
126
|
+
flex: none;
|
|
127
|
+
width: 16px;
|
|
128
|
+
height: 16px;
|
|
129
|
+
color: var(--menu-v2-icon);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
[data-slot="menu-v2-item-indicator"]:not([data-checked]) > svg {
|
|
133
|
+
visibility: hidden;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
[data-slot="menu-v2-item-chevron"] {
|
|
137
|
+
flex: none;
|
|
138
|
+
width: 16px;
|
|
139
|
+
height: 16px;
|
|
140
|
+
color: var(--menu-v2-fg-muted);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
&[data-highlighted] {
|
|
144
|
+
background: var(--menu-v2-hover);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
&[data-checked] [data-slot="menu-v2-item-content"] {
|
|
148
|
+
font-weight: 440;
|
|
149
|
+
color: var(--menu-v2-fg);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
&[data-checked] [data-slot="menu-v2-item-indicator"] {
|
|
153
|
+
color: var(--menu-v2-icon);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
&[data-disabled] {
|
|
157
|
+
pointer-events: none;
|
|
158
|
+
opacity: 0.5;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
[data-slot="menu-v2-separator"] {
|
|
163
|
+
height: 1px;
|
|
164
|
+
width: calc(100% + 4px);
|
|
165
|
+
margin: 2px -2px;
|
|
166
|
+
background: var(--v2-border-border-muted);
|
|
167
|
+
border: none;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
[data-slot="menu-v2-group-label"] {
|
|
171
|
+
box-sizing: border-box;
|
|
172
|
+
display: flex;
|
|
173
|
+
align-items: center;
|
|
174
|
+
height: 28px;
|
|
175
|
+
padding: 0 12px;
|
|
176
|
+
|
|
177
|
+
font-size: 11px;
|
|
178
|
+
font-weight: 530;
|
|
179
|
+
letter-spacing: 0.05px;
|
|
180
|
+
color: var(--v2-text-text-faint);
|
|
181
|
+
user-select: none;
|
|
182
|
+
font-variant-numeric: tabular-nums;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
[data-component="menu-v2-content"][data-appearance="standard"] {
|
|
186
|
+
min-width: 8rem;
|
|
187
|
+
padding: 4px;
|
|
188
|
+
overflow: hidden;
|
|
189
|
+
border: 1px solid color-mix(in oklch, var(--border-base) 50%, transparent);
|
|
190
|
+
border-radius: var(--radius-md);
|
|
191
|
+
background: var(--surface-raised-stronger-non-alpha);
|
|
192
|
+
background-clip: padding-box;
|
|
193
|
+
box-shadow: var(--shadow-md);
|
|
194
|
+
z-index: 60;
|
|
195
|
+
animation: dropdown-menu-open 150ms ease-out;
|
|
196
|
+
|
|
197
|
+
&[data-closed] {
|
|
198
|
+
animation: dropdown-menu-close 150ms ease-out;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
[data-component="menu-v2-item"] {
|
|
202
|
+
position: relative;
|
|
203
|
+
height: auto;
|
|
204
|
+
min-height: 0;
|
|
205
|
+
padding: 4px 8px;
|
|
206
|
+
border-radius: var(--radius-sm);
|
|
207
|
+
color: var(--text-strong);
|
|
208
|
+
font-family: var(--font-family-sans);
|
|
209
|
+
font-size: var(--font-size-small);
|
|
210
|
+
font-weight: var(--font-weight-medium);
|
|
211
|
+
line-height: var(--line-height-large);
|
|
212
|
+
letter-spacing: var(--letter-spacing-normal);
|
|
213
|
+
font-variant-numeric: normal;
|
|
214
|
+
-webkit-font-smoothing: auto;
|
|
215
|
+
text-rendering: auto;
|
|
216
|
+
|
|
217
|
+
[data-slot="menu-v2-item-content"] {
|
|
218
|
+
font-family: inherit;
|
|
219
|
+
font-size: inherit;
|
|
220
|
+
font-weight: inherit;
|
|
221
|
+
line-height: inherit;
|
|
222
|
+
letter-spacing: inherit;
|
|
223
|
+
color: inherit;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
&[data-highlighted] {
|
|
227
|
+
background: var(--surface-raised-base-hover);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
&[data-disabled] {
|
|
231
|
+
color: var(--text-weak);
|
|
232
|
+
opacity: 1;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
&[data-checked] {
|
|
236
|
+
padding-inline-end: 28px;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
&[data-checked] [data-slot="menu-v2-item-content"] {
|
|
240
|
+
font-weight: inherit;
|
|
241
|
+
color: inherit;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
[data-slot="menu-v2-item-indicator"] {
|
|
245
|
+
position: absolute;
|
|
246
|
+
inset-inline-end: 8px;
|
|
247
|
+
top: 50%;
|
|
248
|
+
width: 16px;
|
|
249
|
+
height: 16px;
|
|
250
|
+
transform: translateY(-50%);
|
|
251
|
+
color: var(--icon-base);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
[data-slot="menu-v2-item-chevron"] {
|
|
255
|
+
margin-inline-start: auto;
|
|
256
|
+
color: var(--icon-base);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
[data-slot="menu-v2-separator"] {
|
|
261
|
+
width: calc(100% + 8px);
|
|
262
|
+
height: 1px;
|
|
263
|
+
margin: 4px -4px;
|
|
264
|
+
background: var(--border-weak-base);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
[data-slot="menu-v2-group-label"] {
|
|
268
|
+
height: auto;
|
|
269
|
+
padding: 4px 8px;
|
|
270
|
+
color: var(--text-weak);
|
|
271
|
+
font-family: var(--font-family-sans);
|
|
272
|
+
font-size: var(--font-size-x-small);
|
|
273
|
+
font-weight: var(--font-weight-medium);
|
|
274
|
+
line-height: var(--line-height-large);
|
|
275
|
+
letter-spacing: var(--letter-spacing-normal);
|
|
276
|
+
font-variant-numeric: normal;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
@keyframes dropdown-menu-open {
|
|
281
|
+
from {
|
|
282
|
+
opacity: 0;
|
|
283
|
+
transform: scale(0.96);
|
|
284
|
+
}
|
|
285
|
+
to {
|
|
286
|
+
opacity: 1;
|
|
287
|
+
transform: scale(1);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
@keyframes dropdown-menu-close {
|
|
292
|
+
from {
|
|
293
|
+
opacity: 1;
|
|
294
|
+
transform: scale(1);
|
|
295
|
+
}
|
|
296
|
+
to {
|
|
297
|
+
opacity: 0;
|
|
298
|
+
transform: scale(0.96);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
@keyframes menu-v2-in {
|
|
303
|
+
from {
|
|
304
|
+
opacity: 0;
|
|
305
|
+
transform: scale(0.96);
|
|
306
|
+
}
|
|
307
|
+
to {
|
|
308
|
+
opacity: 1;
|
|
309
|
+
transform: scale(1);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import { DropdownMenu } from "@kobalte/core/dropdown-menu"
|
|
2
|
+
import { ContextMenu } from "@kobalte/core/context-menu"
|
|
3
|
+
import {
|
|
4
|
+
createContext,
|
|
5
|
+
Show,
|
|
6
|
+
splitProps,
|
|
7
|
+
useContext,
|
|
8
|
+
type Accessor,
|
|
9
|
+
type Component,
|
|
10
|
+
type ComponentProps,
|
|
11
|
+
type JSX,
|
|
12
|
+
type ParentProps,
|
|
13
|
+
} from "solid-js"
|
|
14
|
+
import "./menu.css"
|
|
15
|
+
|
|
16
|
+
const ChevronRight: Component = () => (
|
|
17
|
+
<svg
|
|
18
|
+
data-slot="menu-v2-item-chevron"
|
|
19
|
+
width="16"
|
|
20
|
+
height="16"
|
|
21
|
+
viewBox="0 0 16 16"
|
|
22
|
+
fill="none"
|
|
23
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
24
|
+
aria-hidden="true"
|
|
25
|
+
>
|
|
26
|
+
<path d="M6 4L10 8L6 12V4Z" fill="currentColor" />
|
|
27
|
+
</svg>
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
const CheckMark: Component = () => (
|
|
31
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
|
32
|
+
<path
|
|
33
|
+
d="M3.53564 8.17857L6.39279 11.75L12.4642 4.25"
|
|
34
|
+
stroke="currentColor"
|
|
35
|
+
stroke-width="1"
|
|
36
|
+
stroke-linecap="round"
|
|
37
|
+
stroke-linejoin="round"
|
|
38
|
+
/>
|
|
39
|
+
</svg>
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
export type MenuAppearance = "standard" | "compact"
|
|
43
|
+
|
|
44
|
+
const MenuAppearanceContext = createContext<{ appearance: Accessor<MenuAppearance> }>({
|
|
45
|
+
appearance: (): MenuAppearance => "compact",
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
function useMenuContext() {
|
|
49
|
+
const ctx = useContext(MenuAppearanceContext)
|
|
50
|
+
if (!ctx) throw new Error("Menu components must be used inside Menu or Menu.Context")
|
|
51
|
+
return ctx
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function ItemBody(
|
|
55
|
+
props: ParentProps<{
|
|
56
|
+
shortcut?: JSX.Element | string
|
|
57
|
+
badge?: JSX.Element | string
|
|
58
|
+
trailing?: JSX.Element
|
|
59
|
+
}>,
|
|
60
|
+
) {
|
|
61
|
+
return (
|
|
62
|
+
<>
|
|
63
|
+
<span data-slot="menu-v2-item-content">{props.children}</span>
|
|
64
|
+
<Show when={props.shortcut}>{(shortcut) => <span data-slot="menu-v2-item-shortcut">{shortcut()}</span>}</Show>
|
|
65
|
+
<Show when={props.badge}>{(badge) => <span data-slot="menu-v2-item-badge">{badge()}</span>}</Show>
|
|
66
|
+
{props.trailing}
|
|
67
|
+
</>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface MenuItemProps extends ComponentProps<typeof DropdownMenu.Item> {
|
|
72
|
+
shortcut?: JSX.Element | string
|
|
73
|
+
badge?: JSX.Element | string
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function MenuItem(props: ParentProps<MenuItemProps>) {
|
|
77
|
+
const ctx = useMenuContext()
|
|
78
|
+
const [s, r] = splitProps(props, ["class", "classList", "children", "shortcut", "badge"])
|
|
79
|
+
return (
|
|
80
|
+
<DropdownMenu.Item
|
|
81
|
+
{...r}
|
|
82
|
+
data-component="menu-v2-item"
|
|
83
|
+
data-appearance={ctx.appearance()}
|
|
84
|
+
classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}
|
|
85
|
+
>
|
|
86
|
+
<ItemBody shortcut={s.shortcut} badge={s.badge}>
|
|
87
|
+
{s.children}
|
|
88
|
+
</ItemBody>
|
|
89
|
+
</DropdownMenu.Item>
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface MenuCheckboxItemProps extends ComponentProps<typeof DropdownMenu.CheckboxItem> {
|
|
94
|
+
shortcut?: JSX.Element | string
|
|
95
|
+
badge?: JSX.Element | string
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function MenuCheckboxItem(props: ParentProps<MenuCheckboxItemProps>) {
|
|
99
|
+
const ctx = useMenuContext()
|
|
100
|
+
const [s, r] = splitProps(props, ["class", "classList", "children", "shortcut", "badge"])
|
|
101
|
+
return (
|
|
102
|
+
<DropdownMenu.CheckboxItem
|
|
103
|
+
{...r}
|
|
104
|
+
data-component="menu-v2-item"
|
|
105
|
+
data-appearance={ctx.appearance()}
|
|
106
|
+
classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}
|
|
107
|
+
>
|
|
108
|
+
<ItemBody
|
|
109
|
+
shortcut={s.shortcut}
|
|
110
|
+
badge={s.badge}
|
|
111
|
+
trailing={
|
|
112
|
+
<DropdownMenu.ItemIndicator data-slot="menu-v2-item-indicator" forceMount>
|
|
113
|
+
<CheckMark />
|
|
114
|
+
</DropdownMenu.ItemIndicator>
|
|
115
|
+
}
|
|
116
|
+
>
|
|
117
|
+
{s.children}
|
|
118
|
+
</ItemBody>
|
|
119
|
+
</DropdownMenu.CheckboxItem>
|
|
120
|
+
)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface MenuRadioItemProps extends ComponentProps<typeof DropdownMenu.RadioItem> {
|
|
124
|
+
shortcut?: JSX.Element | string
|
|
125
|
+
badge?: JSX.Element | string
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function MenuRadioItem(props: ParentProps<MenuRadioItemProps>) {
|
|
129
|
+
const ctx = useMenuContext()
|
|
130
|
+
const [s, r] = splitProps(props, ["class", "classList", "children", "shortcut", "badge"])
|
|
131
|
+
return (
|
|
132
|
+
<DropdownMenu.RadioItem
|
|
133
|
+
{...r}
|
|
134
|
+
data-component="menu-v2-item"
|
|
135
|
+
data-appearance={ctx.appearance()}
|
|
136
|
+
classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}
|
|
137
|
+
>
|
|
138
|
+
<ItemBody
|
|
139
|
+
shortcut={s.shortcut}
|
|
140
|
+
badge={s.badge}
|
|
141
|
+
trailing={
|
|
142
|
+
<DropdownMenu.ItemIndicator data-slot="menu-v2-item-indicator" forceMount>
|
|
143
|
+
<CheckMark />
|
|
144
|
+
</DropdownMenu.ItemIndicator>
|
|
145
|
+
}
|
|
146
|
+
>
|
|
147
|
+
{s.children}
|
|
148
|
+
</ItemBody>
|
|
149
|
+
</DropdownMenu.RadioItem>
|
|
150
|
+
)
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export interface MenuSubTriggerProps extends ComponentProps<typeof DropdownMenu.SubTrigger> {
|
|
154
|
+
shortcut?: JSX.Element | string
|
|
155
|
+
badge?: JSX.Element | string
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function MenuSubTrigger(props: ParentProps<MenuSubTriggerProps>) {
|
|
159
|
+
const ctx = useMenuContext()
|
|
160
|
+
const [s, r] = splitProps(props, ["class", "classList", "children", "shortcut", "badge"])
|
|
161
|
+
return (
|
|
162
|
+
<DropdownMenu.SubTrigger
|
|
163
|
+
{...r}
|
|
164
|
+
data-component="menu-v2-item"
|
|
165
|
+
data-appearance={ctx.appearance()}
|
|
166
|
+
classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}
|
|
167
|
+
>
|
|
168
|
+
<ItemBody shortcut={s.shortcut} badge={s.badge} trailing={<ChevronRight />}>
|
|
169
|
+
{s.children}
|
|
170
|
+
</ItemBody>
|
|
171
|
+
</DropdownMenu.SubTrigger>
|
|
172
|
+
)
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function MenuSubContent(props: ComponentProps<typeof DropdownMenu.SubContent>) {
|
|
176
|
+
const ctx = useMenuContext()
|
|
177
|
+
const [s, r] = splitProps(props, ["class", "classList"])
|
|
178
|
+
return (
|
|
179
|
+
<DropdownMenu.SubContent
|
|
180
|
+
{...r}
|
|
181
|
+
data-component="menu-v2-content"
|
|
182
|
+
data-appearance={ctx.appearance()}
|
|
183
|
+
classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}
|
|
184
|
+
/>
|
|
185
|
+
)
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function MenuGroupLabel(props: ComponentProps<typeof DropdownMenu.GroupLabel>) {
|
|
189
|
+
const ctx = useMenuContext()
|
|
190
|
+
const [s, r] = splitProps(props, ["class", "classList"])
|
|
191
|
+
return (
|
|
192
|
+
<DropdownMenu.GroupLabel
|
|
193
|
+
{...r}
|
|
194
|
+
data-slot="menu-v2-group-label"
|
|
195
|
+
data-appearance={ctx.appearance()}
|
|
196
|
+
classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}
|
|
197
|
+
/>
|
|
198
|
+
)
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function MenuSeparator(props: ComponentProps<typeof DropdownMenu.Separator>) {
|
|
202
|
+
const ctx = useMenuContext()
|
|
203
|
+
const [s, r] = splitProps(props, ["class", "classList"])
|
|
204
|
+
return (
|
|
205
|
+
<DropdownMenu.Separator
|
|
206
|
+
{...r}
|
|
207
|
+
data-slot="menu-v2-separator"
|
|
208
|
+
data-appearance={ctx.appearance()}
|
|
209
|
+
classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}
|
|
210
|
+
/>
|
|
211
|
+
)
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function MenuContent(props: ComponentProps<typeof DropdownMenu.Content>) {
|
|
215
|
+
const ctx = useMenuContext()
|
|
216
|
+
const [s, r] = splitProps(props, ["class", "classList"])
|
|
217
|
+
return (
|
|
218
|
+
<DropdownMenu.Content
|
|
219
|
+
{...r}
|
|
220
|
+
data-component="menu-v2-content"
|
|
221
|
+
data-appearance={ctx.appearance()}
|
|
222
|
+
classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}
|
|
223
|
+
/>
|
|
224
|
+
)
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export interface MenuProps extends ComponentProps<typeof DropdownMenu> {
|
|
228
|
+
appearance?: MenuAppearance
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
function MenuRoot(props: MenuProps) {
|
|
232
|
+
const [local, rest] = splitProps(props, ["appearance", "children"])
|
|
233
|
+
const appearance = () => local.appearance ?? "compact"
|
|
234
|
+
return (
|
|
235
|
+
<MenuAppearanceContext.Provider value={{ appearance }}>
|
|
236
|
+
<DropdownMenu {...rest}>{local.children}</DropdownMenu>
|
|
237
|
+
</MenuAppearanceContext.Provider>
|
|
238
|
+
)
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export interface MenuContextProps extends ComponentProps<typeof ContextMenu> {
|
|
242
|
+
appearance?: MenuAppearance
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function MenuContextRoot(props: MenuContextProps) {
|
|
246
|
+
const [local, rest] = splitProps(props, ["appearance", "children"])
|
|
247
|
+
const appearance = () => local.appearance ?? "compact"
|
|
248
|
+
return (
|
|
249
|
+
<MenuAppearanceContext.Provider value={{ appearance }}>
|
|
250
|
+
<ContextMenu {...rest}>{local.children}</ContextMenu>
|
|
251
|
+
</MenuAppearanceContext.Provider>
|
|
252
|
+
)
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
function MenuContextContent(props: ComponentProps<typeof ContextMenu.Content>) {
|
|
256
|
+
const ctx = useMenuContext()
|
|
257
|
+
const [s, r] = splitProps(props, ["class", "classList"])
|
|
258
|
+
return (
|
|
259
|
+
<ContextMenu.Content
|
|
260
|
+
{...r}
|
|
261
|
+
data-component="menu-v2-content"
|
|
262
|
+
data-appearance={ctx.appearance()}
|
|
263
|
+
classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}
|
|
264
|
+
/>
|
|
265
|
+
)
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
const MenuContext = Object.assign(MenuContextRoot, {
|
|
269
|
+
Trigger: ContextMenu.Trigger,
|
|
270
|
+
Portal: ContextMenu.Portal,
|
|
271
|
+
Content: MenuContextContent,
|
|
272
|
+
})
|
|
273
|
+
|
|
274
|
+
export const Menu = Object.assign(MenuRoot, {
|
|
275
|
+
Trigger: DropdownMenu.Trigger,
|
|
276
|
+
Portal: DropdownMenu.Portal,
|
|
277
|
+
Content: MenuContent,
|
|
278
|
+
Item: MenuItem,
|
|
279
|
+
CheckboxItem: MenuCheckboxItem,
|
|
280
|
+
RadioGroup: DropdownMenu.RadioGroup,
|
|
281
|
+
RadioItem: MenuRadioItem,
|
|
282
|
+
Group: DropdownMenu.Group,
|
|
283
|
+
GroupLabel: MenuGroupLabel,
|
|
284
|
+
Separator: MenuSeparator,
|
|
285
|
+
Sub: DropdownMenu.Sub,
|
|
286
|
+
SubTrigger: MenuSubTrigger,
|
|
287
|
+
SubContent: MenuSubContent,
|
|
288
|
+
Context: MenuContext,
|
|
289
|
+
})
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
[data-slot="segmented-control-v2"].segmented-control-v2--full-width {
|
|
2
|
+
width: 100%;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
[data-slot="segmented-control-v2"] {
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: row;
|
|
9
|
+
align-items: center;
|
|
10
|
+
padding: 0;
|
|
11
|
+
width: 232px;
|
|
12
|
+
max-width: 100%;
|
|
13
|
+
height: 28px;
|
|
14
|
+
background: var(--v2-background-bg-layer-01);
|
|
15
|
+
border: none;
|
|
16
|
+
border-radius: 6px;
|
|
17
|
+
box-shadow: 0 0 0 0.5px var(--v2-border-border-base);
|
|
18
|
+
flex: none;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
[data-slot="segmented-control-v2-item"] {
|
|
22
|
+
box-sizing: border-box;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
align-items: center;
|
|
27
|
+
padding: 0 12px;
|
|
28
|
+
flex: 1 1 0;
|
|
29
|
+
min-width: 0;
|
|
30
|
+
height: 28px;
|
|
31
|
+
margin: 0;
|
|
32
|
+
border: none;
|
|
33
|
+
border-radius: 6px;
|
|
34
|
+
background: transparent;
|
|
35
|
+
box-shadow: none;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
font-style: normal;
|
|
38
|
+
font-weight: 440;
|
|
39
|
+
font-size: 13px;
|
|
40
|
+
line-height: var(--line-height-compact);
|
|
41
|
+
letter-spacing: -0.04px;
|
|
42
|
+
font-variant-numeric: tabular-nums;
|
|
43
|
+
font-variation-settings: "slnt" 0;
|
|
44
|
+
color: var(--v2-text-text-muted);
|
|
45
|
+
transition:
|
|
46
|
+
background-color 0.12s ease,
|
|
47
|
+
color 0.12s ease,
|
|
48
|
+
box-shadow 0.12s ease;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
[data-slot="segmented-control-v2-item"]:where(:disabled) {
|
|
52
|
+
cursor: not-allowed;
|
|
53
|
+
opacity: 0.45;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
[data-slot="segmented-control-v2-item"]:where(:focus-visible) {
|
|
57
|
+
outline: 2px solid var(--v2-border-border-focus);
|
|
58
|
+
outline-offset: 1px;
|
|
59
|
+
z-index: 2;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
[data-slot="segmented-control-v2-item"]:where([data-pressed]) {
|
|
63
|
+
background: var(--v2-background-bg-base);
|
|
64
|
+
color: var(--v2-text-text-base);
|
|
65
|
+
box-shadow: 0 0 0 0.5px var(--v2-border-border-strong);
|
|
66
|
+
z-index: 1;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
[data-slot="segmented-control-v2-item-label"] {
|
|
70
|
+
display: flex;
|
|
71
|
+
flex-direction: row;
|
|
72
|
+
justify-content: center;
|
|
73
|
+
align-items: center;
|
|
74
|
+
padding: 0;
|
|
75
|
+
min-width: 0;
|
|
76
|
+
max-width: 100%;
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
text-overflow: ellipsis;
|
|
79
|
+
white-space: nowrap;
|
|
80
|
+
}
|