@opencode-ai/ui 0.0.0-dev-18909 → 0.0.0-dev-202609021553
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/dist/{data-display/accordion → components}/accordion.d.ts +6 -6
- package/dist/components/avatar.d.ts +9 -0
- package/dist/components/button.d.ts +9 -0
- package/dist/components/card.d.ts +1 -1
- package/dist/{forms/checkbox → components}/checkbox.d.ts +2 -2
- package/dist/components/dialog.d.ts +12 -0
- package/dist/{data-display/diff-changes → components}/diff-changes.d.ts +1 -2
- package/dist/components/dropdown-menu.d.ts +80 -0
- package/dist/components/icon-button.d.ts +10 -0
- package/dist/{icons/icon/additional-icons.d.ts → components/icon.d.ts} +8 -8
- package/dist/components/keybind.d.ts +6 -0
- package/dist/components/list.d.ts +1 -1
- package/dist/{feedback/progress-circle → components}/progress-circle.d.ts +0 -2
- package/dist/components/radio-group.d.ts +16 -0
- package/dist/components/scroll-view.d.ts +3 -3
- package/dist/components/select.d.ts +21 -0
- package/dist/{forms/switch → components}/switch.d.ts +2 -4
- package/dist/{navigation/tabs → components}/tabs.d.ts +8 -15
- package/dist/components/tag.d.ts +5 -0
- package/dist/{typography/text-shimmer → components}/text-shimmer.d.ts +0 -1
- package/dist/components/toast.d.ts +56 -0
- package/dist/components/tooltip.d.ts +17 -0
- package/dist/context/i18n.d.ts +7 -10
- package/dist/context/marked-parser.d.ts +2 -1
- package/dist/hooks/use-filtered-list.d.ts +0 -9
- package/dist/i18n/ar.d.ts +2 -0
- package/dist/i18n/bg.d.ts +2 -0
- package/dist/i18n/br.d.ts +2 -0
- package/dist/i18n/bs.d.ts +2 -0
- package/dist/i18n/da.d.ts +2 -0
- package/dist/i18n/de.d.ts +2 -0
- package/dist/i18n/en.d.ts +1 -230
- package/dist/i18n/es.d.ts +2 -0
- package/dist/i18n/fr.d.ts +2 -0
- package/dist/i18n/ja.d.ts +2 -0
- package/dist/i18n/km.d.ts +2 -0
- package/dist/i18n/ko.d.ts +2 -0
- package/dist/i18n/lo.d.ts +2 -0
- package/dist/i18n/mk.d.ts +2 -0
- package/dist/i18n/mn.d.ts +2 -0
- package/dist/i18n/my.d.ts +2 -0
- package/dist/i18n/pl.d.ts +2 -0
- package/dist/i18n/ru.d.ts +2 -0
- package/dist/i18n/sr.d.ts +2 -0
- package/dist/i18n/tg.d.ts +2 -0
- package/dist/i18n/th.d.ts +2 -0
- package/dist/i18n/tr.d.ts +2 -0
- package/dist/i18n/zh.d.ts +2 -0
- package/dist/i18n/zht.d.ts +2 -0
- package/dist/v2/components/accordion-v2.d.ts +26 -0
- package/dist/{data-display/avatar/avatar.d.ts → v2/components/avatar-v2.d.ts} +1 -1
- package/dist/v2/components/badge-v2.d.ts +6 -0
- package/dist/v2/components/button-v2.d.ts +10 -0
- package/dist/v2/components/checkbox-v2.d.ts +10 -0
- package/dist/{overlays/dialog/dialog.d.ts → v2/components/dialog-v2.d.ts} +2 -1
- package/dist/v2/components/diff-changes-v2.d.ts +11 -0
- package/dist/v2/components/divider-v2.d.ts +5 -0
- package/dist/{forms/field/field.d.ts → v2/components/field-v2.d.ts} +10 -4
- package/dist/v2/components/icon-button-v2.d.ts +11 -0
- package/dist/{icons/icon → v2/components}/icon.d.ts +1 -24
- package/dist/v2/components/inline-input-v2.d.ts +21 -0
- package/dist/v2/components/keybind-v2.d.ts +7 -0
- package/dist/{data-display/line-comment/line-comment.d.ts → v2/components/line-comment-v2.d.ts} +9 -9
- package/dist/v2/components/loader-v2.d.ts +3 -0
- package/dist/v2/components/menu-v2.d.ts +52 -0
- package/dist/v2/components/progress-circle-v2.d.ts +8 -0
- package/dist/{data-display/project-avatar/project-avatar.d.ts → v2/components/project-avatar-v2.d.ts} +1 -1
- package/dist/v2/components/radio-v2.d.ts +16 -0
- package/dist/{navigation/segmented-control/segmented-control.d.ts → v2/components/segmented-control-v2.d.ts} +5 -5
- package/dist/{forms/select/select.d.ts → v2/components/select-v2.d.ts} +6 -4
- package/dist/v2/components/split-button-v2.d.ts +5 -0
- package/dist/v2/components/switch-v2.d.ts +7 -0
- package/dist/v2/components/tabs-v2.d.ts +34 -0
- package/dist/{forms/text-input/text-input.d.ts → v2/components/text-input-v2.d.ts} +3 -3
- package/dist/v2/components/text-shimmer-v2.d.ts +9 -0
- package/dist/v2/components/textarea-v2.d.ts +7 -0
- package/dist/v2/components/toast-v2.d.ts +57 -0
- package/dist/v2/components/tooltip-v2.d.ts +13 -0
- package/dist/v2/components/wordmark-v2.d.ts +2 -0
- package/package.json +34 -140
- package/src/{data-display/accordion → components}/accordion.css +31 -5
- package/src/{data-display/accordion → components}/accordion.tsx +14 -14
- package/src/components/animated-number.css +11 -29
- package/src/components/animated-number.tsx +2 -2
- package/src/components/avatar.css +49 -0
- package/src/components/avatar.tsx +55 -0
- package/src/components/button.css +194 -0
- package/src/{actions/button → components}/button.tsx +11 -10
- package/src/components/card.css +23 -2
- package/src/components/card.tsx +4 -4
- package/src/{forms/checkbox → components}/checkbox.css +7 -1
- package/src/{forms/checkbox → components}/checkbox.tsx +13 -13
- package/src/components/collapsible.tsx +2 -2
- package/src/components/dialog.css +181 -0
- package/src/components/dialog.tsx +72 -0
- package/src/{data-display/diff-changes → components}/diff-changes.css +19 -22
- package/src/components/diff-changes.tsx +115 -0
- package/src/components/dock-surface.css +9 -2
- package/src/components/dropdown-menu.css +135 -0
- package/src/components/dropdown-menu.tsx +308 -0
- package/src/components/icon-button.css +181 -0
- package/src/components/icon-button.tsx +29 -0
- package/src/components/icon.css +39 -0
- package/src/{icons/icon/additional-icons.ts → components/icon.tsx} +74 -8
- package/src/components/image-preview.tsx +2 -3
- package/src/components/keybind.css +18 -0
- package/src/components/keybind.tsx +20 -0
- package/src/components/list.css +5 -5
- package/src/components/list.tsx +5 -7
- package/src/components/popover.tsx +2 -3
- package/src/components/progress-circle.css +16 -0
- package/src/components/progress-circle.tsx +64 -0
- package/src/components/radio-group.css +187 -0
- package/src/components/radio-group.tsx +83 -0
- package/src/components/scroll-view.tsx +20 -5
- package/src/components/select.css +201 -0
- package/src/components/select.tsx +174 -0
- package/src/components/sticky-accordion-header.tsx +1 -1
- package/src/components/switch.css +136 -0
- package/src/components/switch.tsx +29 -0
- package/src/{navigation/tabs → components}/tabs.css +229 -39
- package/src/components/tabs.tsx +126 -0
- package/src/components/tag.css +37 -0
- package/src/components/tag.tsx +22 -0
- package/src/components/text-field.tsx +4 -12
- package/src/{typography/text-shimmer → components}/text-shimmer.css +1 -2
- package/src/{typography/text-shimmer → components}/text-shimmer.tsx +0 -1
- package/src/components/toast.css +236 -0
- package/src/components/toast.tsx +185 -0
- package/src/components/tooltip.css +74 -0
- package/src/components/tooltip.tsx +163 -0
- package/src/context/dialog.tsx +0 -1
- package/src/context/i18n.tsx +14 -17
- package/src/context/marked-parser.tsx +13 -3
- package/src/hooks/create-auto-scroll.tsx +0 -20
- package/src/i18n/am.ts +9 -7
- package/src/i18n/ar.ts +9 -7
- package/src/i18n/az.ts +9 -7
- package/src/i18n/bg.ts +9 -7
- package/src/i18n/bn.ts +9 -7
- package/src/i18n/br.ts +9 -7
- package/src/i18n/bs.ts +9 -7
- package/src/i18n/ca.ts +9 -7
- package/src/i18n/cs.ts +9 -7
- package/src/i18n/da.ts +9 -7
- package/src/i18n/de.ts +3 -1
- package/src/i18n/dv.ts +9 -7
- package/src/i18n/dz.ts +7 -5
- package/src/i18n/el.ts +9 -7
- package/src/i18n/en.ts +11 -46
- package/src/i18n/es.ts +8 -6
- package/src/i18n/et.ts +9 -7
- package/src/i18n/fa.ts +9 -7
- package/src/i18n/fi.ts +9 -7
- package/src/i18n/fo.ts +9 -7
- package/src/i18n/fr.ts +8 -6
- package/src/i18n/hi.ts +9 -7
- package/src/i18n/hr.ts +9 -7
- package/src/i18n/hu.ts +9 -7
- package/src/i18n/hy.ts +9 -7
- package/src/i18n/id.ts +9 -7
- package/src/i18n/is.ts +9 -7
- package/src/i18n/it.ts +9 -7
- package/src/i18n/ja.ts +9 -7
- package/src/i18n/ka.ts +9 -7
- package/src/i18n/km.ts +9 -7
- package/src/i18n/ko.ts +9 -7
- package/src/i18n/lo.ts +9 -7
- package/src/i18n/lt.ts +9 -7
- package/src/i18n/lv.ts +9 -7
- package/src/i18n/mk.ts +9 -7
- package/src/i18n/mn.ts +9 -7
- package/src/i18n/ms.ts +9 -7
- package/src/i18n/my.ts +9 -7
- package/src/i18n/ne.ts +9 -7
- package/src/i18n/nl.ts +9 -7
- package/src/i18n/no.ts +9 -7
- package/src/i18n/pa.ts +9 -7
- package/src/i18n/pl.ts +9 -7
- package/src/i18n/ro.ts +9 -7
- package/src/i18n/ru.ts +9 -7
- package/src/i18n/si.ts +9 -7
- package/src/i18n/sk.ts +9 -7
- package/src/i18n/sl.ts +9 -7
- package/src/i18n/sq.ts +9 -7
- package/src/i18n/sr.ts +9 -7
- package/src/i18n/sv.ts +9 -7
- package/src/i18n/tg.ts +9 -7
- package/src/i18n/th.ts +9 -7
- package/src/i18n/tk.ts +9 -7
- package/src/i18n/tr.ts +9 -7
- package/src/i18n/uk.ts +9 -7
- package/src/i18n/ur.ts +9 -7
- package/src/i18n/uz.ts +9 -7
- package/src/i18n/vi.ts +9 -7
- package/src/i18n/zh.ts +9 -7
- package/src/i18n/zht.ts +9 -7
- package/src/styles/base.css +0 -5
- package/src/styles/index.css +20 -4
- package/src/styles/tailwind/colors.css +0 -1
- package/src/styles/tailwind/index.css +1 -18
- package/src/styles/theme.css +2 -2
- package/src/theme/context.tsx +11 -19
- package/src/theme/themes/oc-2.json +1 -3
- package/src/theme/v2/foreground.ts +0 -1
- package/src/theme/v2/mapping.ts +0 -4
- package/src/v2/components/accordion-v2.css +139 -0
- package/src/v2/components/accordion-v2.tsx +86 -0
- package/src/{data-display/avatar/avatar.tsx → v2/components/avatar-v2.tsx} +1 -1
- package/src/{data-display/badge/badge.css → v2/components/badge-v2.css} +0 -19
- package/src/{data-display/badge/badge.tsx → v2/components/badge-v2.tsx} +4 -6
- package/src/v2/components/button-v2.tsx +35 -0
- package/src/v2/components/checkbox-v2.css +184 -0
- package/src/v2/components/checkbox-v2.tsx +65 -0
- package/src/{overlays/dialog/dialog.css → v2/components/dialog-v2.css} +0 -3
- package/src/{overlays/dialog/dialog.tsx → v2/components/dialog-v2.tsx} +13 -11
- package/src/v2/components/diff-changes-v2.css +26 -0
- package/src/{data-display/diff-changes/diff-changes.tsx → v2/components/diff-changes-v2.tsx} +2 -7
- package/src/{layout/divider/divider.tsx → v2/components/divider-v2.tsx} +3 -3
- package/src/{forms/field/field.css → v2/components/field-v2.css} +1 -1
- package/src/{forms/field/field.tsx → v2/components/field-v2.tsx} +11 -9
- package/src/v2/components/icon-button-v2.tsx +37 -0
- package/src/{icons/icon → v2/components}/icon.tsx +9 -50
- package/src/v2/components/inline-input-v2.css +225 -0
- package/src/v2/components/inline-input-v2.tsx +107 -0
- package/src/{data-display/keybind/keybind.css → v2/components/keybind-v2.css} +1 -1
- package/src/{data-display/keybind/keybind.tsx → v2/components/keybind-v2.tsx} +3 -3
- package/src/{data-display/line-comment/line-comment.css → v2/components/line-comment-v2.css} +4 -4
- package/src/{data-display/line-comment/line-comment.tsx → v2/components/line-comment-v2.tsx} +15 -17
- package/src/{feedback/loader/loader.tsx → v2/components/loader-v2.tsx} +2 -2
- package/src/{navigation/menu/menu.css → v2/components/menu-v2.css} +2 -123
- package/src/{navigation/menu/menu.tsx → v2/components/menu-v2.tsx} +32 -96
- package/src/v2/components/progress-circle-v2.css +13 -0
- package/src/v2/components/progress-circle-v2.tsx +52 -0
- package/src/{data-display/project-avatar/project-avatar.tsx → v2/components/project-avatar-v2.tsx} +1 -1
- package/src/{forms/radio/radio.tsx → v2/components/radio-v2.tsx} +20 -30
- package/src/{navigation/segmented-control/segmented-control.css → v2/components/segmented-control-v2.css} +1 -1
- package/src/{navigation/segmented-control/segmented-control.tsx → v2/components/segmented-control-v2.tsx} +8 -9
- package/src/{forms/select/select.css → v2/components/select-v2.css} +8 -2
- package/src/{forms/select/select.tsx → v2/components/select-v2.tsx} +32 -38
- package/src/{actions/split-button/split-button.css → v2/components/split-button-v2.css} +6 -1
- package/src/{actions/split-button/split-button.tsx → v2/components/split-button-v2.tsx} +4 -4
- package/src/{forms/switch/switch.css → v2/components/switch-v2.css} +0 -110
- package/src/v2/components/switch-v2.tsx +28 -0
- package/src/{navigation/tabs/tabs-current.css → v2/components/tabs-v2.css} +10 -25
- package/src/v2/components/tabs-v2.tsx +149 -0
- package/src/{forms/text-input/text-input.css → v2/components/text-input-v2.css} +1 -1
- package/src/{forms/text-input/text-input.tsx → v2/components/text-input-v2.tsx} +4 -4
- package/src/v2/components/text-shimmer-v2.css +125 -0
- package/src/v2/components/text-shimmer-v2.tsx +63 -0
- package/src/{forms/textarea/textarea.tsx → v2/components/textarea-v2.tsx} +3 -3
- package/src/{feedback/toast/toast.tsx → v2/components/toast-v2.tsx} +58 -60
- package/src/{overlays/tooltip/tooltip.css → v2/components/tooltip-v2.css} +0 -26
- package/src/{overlays/tooltip/tooltip.tsx → v2/components/tooltip-v2.tsx} +17 -24
- package/src/{typography/wordmark/wordmark.tsx → v2/components/wordmark-v2.tsx} +1 -1
- package/src/{styles/tokens → v2/styles}/theme.css +14 -18
- package/dist/actions/button/button.d.ts +0 -10
- package/dist/actions/icon-button/icon-button.d.ts +0 -11
- package/dist/actions/split-button/split-button.d.ts +0 -5
- package/dist/context/marked-base.d.ts +0 -3
- package/dist/data-display/badge/badge.d.ts +0 -7
- package/dist/data-display/keybind/keybind.d.ts +0 -7
- package/dist/feedback/loader/loader.d.ts +0 -3
- package/dist/feedback/toast/toast.d.ts +0 -57
- package/dist/forms/radio/radio.d.ts +0 -16
- package/dist/forms/textarea/textarea.d.ts +0 -7
- package/dist/i18n/he.d.ts +0 -197
- package/dist/layout/divider/divider.d.ts +0 -5
- package/dist/navigation/menu/menu.d.ts +0 -59
- package/dist/overlays/tooltip/tooltip.d.ts +0 -15
- package/dist/typography/wordmark/wordmark.d.ts +0 -2
- package/src/actions/icon-button/icon-button.tsx +0 -32
- package/src/context/marked-base.tsx +0 -27
- package/src/feedback/progress-circle/progress-circle.css +0 -28
- package/src/feedback/progress-circle/progress-circle.tsx +0 -64
- package/src/forms/switch/switch.tsx +0 -34
- package/src/i18n/he.ts +0 -199
- package/src/icons/icon/icon.css +0 -3
- package/src/navigation/tabs/tabs.tsx +0 -194
- /package/dist/{forms/inline-input → components}/inline-input.d.ts +0 -0
- /package/dist/{navigation → v2/components}/tab-state-indicator.d.ts +0 -0
- /package/src/{forms/inline-input → components}/inline-input.css +0 -0
- /package/src/{forms/inline-input → components}/inline-input.tsx +0 -0
- /package/src/{data-display/avatar/avatar.css → v2/components/avatar-v2.css} +0 -0
- /package/src/{actions/button/button.css → v2/components/button-v2.css} +0 -0
- /package/src/{layout/divider/divider.css → v2/components/divider-v2.css} +0 -0
- /package/src/{styles/file-tree.css → v2/components/file-tree-v2.css} +0 -0
- /package/src/{actions/icon-button/icon-button.css → v2/components/icon-button-v2.css} +0 -0
- /package/src/{feedback/loader/loader.css → v2/components/loader-v2.css} +0 -0
- /package/src/{data-display/project-avatar/project-avatar.css → v2/components/project-avatar-v2.css} +0 -0
- /package/src/{forms/radio/radio.css → v2/components/radio-v2.css} +0 -0
- /package/src/{navigation → v2/components}/tab-state-indicator.tsx +0 -0
- /package/src/{forms/textarea/textarea.css → v2/components/textarea-v2.css} +0 -0
- /package/src/{feedback/toast/toast.css → v2/components/toast-v2.css} +0 -0
- /package/src/{styles/tokens → v2/styles}/colors.css +0 -0
- /package/src/{styles/tokens/index.css → v2/styles/tailwind.css} +0 -0
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
import { DropdownMenu } from "@kobalte/core/dropdown-menu"
|
|
2
2
|
import { ContextMenu } from "@kobalte/core/context-menu"
|
|
3
|
-
import {
|
|
4
|
-
|
|
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"
|
|
3
|
+
import { Show, splitProps, type Component, type ComponentProps, type JSX, type ParentProps } from "solid-js"
|
|
4
|
+
import "./menu-v2.css"
|
|
15
5
|
|
|
16
6
|
const ChevronRight: Component = () => (
|
|
17
7
|
<svg
|
|
@@ -39,18 +29,6 @@ const CheckMark: Component = () => (
|
|
|
39
29
|
</svg>
|
|
40
30
|
)
|
|
41
31
|
|
|
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
32
|
function ItemBody(
|
|
55
33
|
props: ParentProps<{
|
|
56
34
|
shortcut?: JSX.Element | string
|
|
@@ -68,21 +46,15 @@ function ItemBody(
|
|
|
68
46
|
)
|
|
69
47
|
}
|
|
70
48
|
|
|
71
|
-
export interface
|
|
49
|
+
export interface MenuV2ItemProps extends ComponentProps<typeof DropdownMenu.Item> {
|
|
72
50
|
shortcut?: JSX.Element | string
|
|
73
51
|
badge?: JSX.Element | string
|
|
74
52
|
}
|
|
75
53
|
|
|
76
|
-
function
|
|
77
|
-
const ctx = useMenuContext()
|
|
54
|
+
function MenuV2Item(props: ParentProps<MenuV2ItemProps>) {
|
|
78
55
|
const [s, r] = splitProps(props, ["class", "classList", "children", "shortcut", "badge"])
|
|
79
56
|
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
|
-
>
|
|
57
|
+
<DropdownMenu.Item {...r} data-component="menu-v2-item" classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}>
|
|
86
58
|
<ItemBody shortcut={s.shortcut} badge={s.badge}>
|
|
87
59
|
{s.children}
|
|
88
60
|
</ItemBody>
|
|
@@ -90,19 +62,17 @@ function MenuItem(props: ParentProps<MenuItemProps>) {
|
|
|
90
62
|
)
|
|
91
63
|
}
|
|
92
64
|
|
|
93
|
-
export interface
|
|
65
|
+
export interface MenuV2CheckboxItemProps extends ComponentProps<typeof DropdownMenu.CheckboxItem> {
|
|
94
66
|
shortcut?: JSX.Element | string
|
|
95
67
|
badge?: JSX.Element | string
|
|
96
68
|
}
|
|
97
69
|
|
|
98
|
-
function
|
|
99
|
-
const ctx = useMenuContext()
|
|
70
|
+
function MenuV2CheckboxItem(props: ParentProps<MenuV2CheckboxItemProps>) {
|
|
100
71
|
const [s, r] = splitProps(props, ["class", "classList", "children", "shortcut", "badge"])
|
|
101
72
|
return (
|
|
102
73
|
<DropdownMenu.CheckboxItem
|
|
103
74
|
{...r}
|
|
104
75
|
data-component="menu-v2-item"
|
|
105
|
-
data-appearance={ctx.appearance()}
|
|
106
76
|
classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}
|
|
107
77
|
>
|
|
108
78
|
<ItemBody
|
|
@@ -120,19 +90,17 @@ function MenuCheckboxItem(props: ParentProps<MenuCheckboxItemProps>) {
|
|
|
120
90
|
)
|
|
121
91
|
}
|
|
122
92
|
|
|
123
|
-
export interface
|
|
93
|
+
export interface MenuV2RadioItemProps extends ComponentProps<typeof DropdownMenu.RadioItem> {
|
|
124
94
|
shortcut?: JSX.Element | string
|
|
125
95
|
badge?: JSX.Element | string
|
|
126
96
|
}
|
|
127
97
|
|
|
128
|
-
function
|
|
129
|
-
const ctx = useMenuContext()
|
|
98
|
+
function MenuV2RadioItem(props: ParentProps<MenuV2RadioItemProps>) {
|
|
130
99
|
const [s, r] = splitProps(props, ["class", "classList", "children", "shortcut", "badge"])
|
|
131
100
|
return (
|
|
132
101
|
<DropdownMenu.RadioItem
|
|
133
102
|
{...r}
|
|
134
103
|
data-component="menu-v2-item"
|
|
135
|
-
data-appearance={ctx.appearance()}
|
|
136
104
|
classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}
|
|
137
105
|
>
|
|
138
106
|
<ItemBody
|
|
@@ -150,19 +118,17 @@ function MenuRadioItem(props: ParentProps<MenuRadioItemProps>) {
|
|
|
150
118
|
)
|
|
151
119
|
}
|
|
152
120
|
|
|
153
|
-
export interface
|
|
121
|
+
export interface MenuV2SubTriggerProps extends ComponentProps<typeof DropdownMenu.SubTrigger> {
|
|
154
122
|
shortcut?: JSX.Element | string
|
|
155
123
|
badge?: JSX.Element | string
|
|
156
124
|
}
|
|
157
125
|
|
|
158
|
-
function
|
|
159
|
-
const ctx = useMenuContext()
|
|
126
|
+
function MenuV2SubTrigger(props: ParentProps<MenuV2SubTriggerProps>) {
|
|
160
127
|
const [s, r] = splitProps(props, ["class", "classList", "children", "shortcut", "badge"])
|
|
161
128
|
return (
|
|
162
129
|
<DropdownMenu.SubTrigger
|
|
163
130
|
{...r}
|
|
164
131
|
data-component="menu-v2-item"
|
|
165
|
-
data-appearance={ctx.appearance()}
|
|
166
132
|
classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}
|
|
167
133
|
>
|
|
168
134
|
<ItemBody shortcut={s.shortcut} badge={s.badge} trailing={<ChevronRight />}>
|
|
@@ -172,118 +138,88 @@ function MenuSubTrigger(props: ParentProps<MenuSubTriggerProps>) {
|
|
|
172
138
|
)
|
|
173
139
|
}
|
|
174
140
|
|
|
175
|
-
function
|
|
176
|
-
const ctx = useMenuContext()
|
|
141
|
+
function MenuV2SubContent(props: ComponentProps<typeof DropdownMenu.SubContent>) {
|
|
177
142
|
const [s, r] = splitProps(props, ["class", "classList"])
|
|
178
143
|
return (
|
|
179
144
|
<DropdownMenu.SubContent
|
|
180
145
|
{...r}
|
|
181
146
|
data-component="menu-v2-content"
|
|
182
|
-
data-appearance={ctx.appearance()}
|
|
183
147
|
classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}
|
|
184
148
|
/>
|
|
185
149
|
)
|
|
186
150
|
}
|
|
187
151
|
|
|
188
|
-
function
|
|
189
|
-
const ctx = useMenuContext()
|
|
152
|
+
function MenuV2GroupLabel(props: ComponentProps<typeof DropdownMenu.GroupLabel>) {
|
|
190
153
|
const [s, r] = splitProps(props, ["class", "classList"])
|
|
191
154
|
return (
|
|
192
155
|
<DropdownMenu.GroupLabel
|
|
193
156
|
{...r}
|
|
194
157
|
data-slot="menu-v2-group-label"
|
|
195
|
-
data-appearance={ctx.appearance()}
|
|
196
158
|
classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}
|
|
197
159
|
/>
|
|
198
160
|
)
|
|
199
161
|
}
|
|
200
162
|
|
|
201
|
-
function
|
|
202
|
-
const ctx = useMenuContext()
|
|
163
|
+
function MenuV2Separator(props: ComponentProps<typeof DropdownMenu.Separator>) {
|
|
203
164
|
const [s, r] = splitProps(props, ["class", "classList"])
|
|
204
165
|
return (
|
|
205
166
|
<DropdownMenu.Separator
|
|
206
167
|
{...r}
|
|
207
168
|
data-slot="menu-v2-separator"
|
|
208
|
-
data-appearance={ctx.appearance()}
|
|
209
169
|
classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}
|
|
210
170
|
/>
|
|
211
171
|
)
|
|
212
172
|
}
|
|
213
173
|
|
|
214
|
-
function
|
|
215
|
-
const ctx = useMenuContext()
|
|
174
|
+
function MenuV2Content(props: ComponentProps<typeof DropdownMenu.Content>) {
|
|
216
175
|
const [s, r] = splitProps(props, ["class", "classList"])
|
|
217
176
|
return (
|
|
218
177
|
<DropdownMenu.Content
|
|
219
178
|
{...r}
|
|
220
179
|
data-component="menu-v2-content"
|
|
221
|
-
data-appearance={ctx.appearance()}
|
|
222
180
|
classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}
|
|
223
181
|
/>
|
|
224
182
|
)
|
|
225
183
|
}
|
|
226
184
|
|
|
227
|
-
|
|
228
|
-
|
|
185
|
+
function MenuV2Root(props: ComponentProps<typeof DropdownMenu>) {
|
|
186
|
+
return <DropdownMenu {...props} />
|
|
229
187
|
}
|
|
230
188
|
|
|
231
|
-
function
|
|
232
|
-
|
|
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
|
-
)
|
|
189
|
+
function MenuV2ContextRoot(props: ComponentProps<typeof ContextMenu>) {
|
|
190
|
+
return <ContextMenu {...props} />
|
|
253
191
|
}
|
|
254
192
|
|
|
255
|
-
function
|
|
256
|
-
const ctx = useMenuContext()
|
|
193
|
+
function MenuV2ContextContent(props: ComponentProps<typeof ContextMenu.Content>) {
|
|
257
194
|
const [s, r] = splitProps(props, ["class", "classList"])
|
|
258
195
|
return (
|
|
259
196
|
<ContextMenu.Content
|
|
260
197
|
{...r}
|
|
261
198
|
data-component="menu-v2-content"
|
|
262
|
-
data-appearance={ctx.appearance()}
|
|
263
199
|
classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}
|
|
264
200
|
/>
|
|
265
201
|
)
|
|
266
202
|
}
|
|
267
203
|
|
|
268
|
-
const
|
|
204
|
+
const MenuV2Context = Object.assign(MenuV2ContextRoot, {
|
|
269
205
|
Trigger: ContextMenu.Trigger,
|
|
270
206
|
Portal: ContextMenu.Portal,
|
|
271
|
-
Content:
|
|
207
|
+
Content: MenuV2ContextContent,
|
|
272
208
|
})
|
|
273
209
|
|
|
274
|
-
export const
|
|
210
|
+
export const MenuV2 = Object.assign(MenuV2Root, {
|
|
275
211
|
Trigger: DropdownMenu.Trigger,
|
|
276
212
|
Portal: DropdownMenu.Portal,
|
|
277
|
-
Content:
|
|
278
|
-
Item:
|
|
279
|
-
CheckboxItem:
|
|
213
|
+
Content: MenuV2Content,
|
|
214
|
+
Item: MenuV2Item,
|
|
215
|
+
CheckboxItem: MenuV2CheckboxItem,
|
|
280
216
|
RadioGroup: DropdownMenu.RadioGroup,
|
|
281
|
-
RadioItem:
|
|
217
|
+
RadioItem: MenuV2RadioItem,
|
|
282
218
|
Group: DropdownMenu.Group,
|
|
283
|
-
GroupLabel:
|
|
284
|
-
Separator:
|
|
219
|
+
GroupLabel: MenuV2GroupLabel,
|
|
220
|
+
Separator: MenuV2Separator,
|
|
285
221
|
Sub: DropdownMenu.Sub,
|
|
286
|
-
SubTrigger:
|
|
287
|
-
SubContent:
|
|
288
|
-
Context:
|
|
222
|
+
SubTrigger: MenuV2SubTrigger,
|
|
223
|
+
SubContent: MenuV2SubContent,
|
|
224
|
+
Context: MenuV2Context,
|
|
289
225
|
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[data-component="progress-circle-v2"] {
|
|
2
|
+
display: block;
|
|
3
|
+
transform: rotate(-90deg);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
[data-component="progress-circle-v2"] [data-slot="progress-circle-v2-background"] {
|
|
7
|
+
stroke: var(--v2-background-bg-layer-04);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
[data-component="progress-circle-v2"] [data-slot="progress-circle-v2-progress"] {
|
|
11
|
+
stroke: var(--v2-icon-icon-base);
|
|
12
|
+
transition: stroke-dashoffset 0.35s cubic-bezier(0.65, 0, 0.35, 1);
|
|
13
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type ComponentProps, createMemo, splitProps } from "solid-js"
|
|
2
|
+
import "./progress-circle-v2.css"
|
|
3
|
+
|
|
4
|
+
export interface ProgressCircleV2Props extends Pick<ComponentProps<"svg">, "class" | "classList"> {
|
|
5
|
+
percentage: number
|
|
6
|
+
size?: number
|
|
7
|
+
strokeWidth?: number
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function ProgressCircleV2(props: ProgressCircleV2Props) {
|
|
11
|
+
const [split, rest] = splitProps(props, ["percentage", "size", "strokeWidth", "class", "classList"])
|
|
12
|
+
|
|
13
|
+
const size = () => split.size ?? 14
|
|
14
|
+
const strokeWidth = () => split.strokeWidth ?? 1.5
|
|
15
|
+
const viewBoxSize = 14
|
|
16
|
+
const center = viewBoxSize / 2
|
|
17
|
+
const radius = () => center - strokeWidth() / 2
|
|
18
|
+
const circumference = createMemo(() => 2 * Math.PI * radius())
|
|
19
|
+
const offset = createMemo(() => circumference() * (1 - Math.max(0, Math.min(100, split.percentage || 0)) / 100))
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<svg
|
|
23
|
+
{...rest}
|
|
24
|
+
width={size()}
|
|
25
|
+
height={size()}
|
|
26
|
+
viewBox={`0 0 ${viewBoxSize} ${viewBoxSize}`}
|
|
27
|
+
fill="none"
|
|
28
|
+
data-component="progress-circle-v2"
|
|
29
|
+
classList={{
|
|
30
|
+
...split.classList,
|
|
31
|
+
[split.class ?? ""]: !!split.class,
|
|
32
|
+
}}
|
|
33
|
+
>
|
|
34
|
+
<circle
|
|
35
|
+
cx={center}
|
|
36
|
+
cy={center}
|
|
37
|
+
r={radius()}
|
|
38
|
+
data-slot="progress-circle-v2-background"
|
|
39
|
+
stroke-width={strokeWidth()}
|
|
40
|
+
/>
|
|
41
|
+
<circle
|
|
42
|
+
cx={center}
|
|
43
|
+
cy={center}
|
|
44
|
+
r={radius()}
|
|
45
|
+
data-slot="progress-circle-v2-progress"
|
|
46
|
+
stroke-width={strokeWidth()}
|
|
47
|
+
stroke-dasharray={circumference().toString()}
|
|
48
|
+
stroke-dashoffset={offset()}
|
|
49
|
+
/>
|
|
50
|
+
</svg>
|
|
51
|
+
)
|
|
52
|
+
}
|
|
@@ -1,28 +1,18 @@
|
|
|
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"
|
|
1
|
+
import { RadioGroup as Kobalte } from "@kobalte/core/radio-group"
|
|
12
2
|
import { Show, splitProps, type JSX } from "solid-js"
|
|
13
3
|
import type { ComponentProps, ParentProps } from "solid-js"
|
|
14
|
-
import "./radio.css"
|
|
4
|
+
import "./radio-v2.css"
|
|
15
5
|
|
|
16
|
-
export interface
|
|
6
|
+
export interface RadioGroupV2Props extends ParentProps<ComponentProps<typeof Kobalte>> {
|
|
17
7
|
label?: JSX.Element
|
|
18
8
|
description?: JSX.Element
|
|
19
9
|
hideLabel?: boolean
|
|
20
10
|
}
|
|
21
11
|
|
|
22
|
-
export function
|
|
12
|
+
export function RadioGroupV2(props: RadioGroupV2Props) {
|
|
23
13
|
const [local, others] = splitProps(props, ["class", "classList", "children", "label", "description", "hideLabel"])
|
|
24
14
|
return (
|
|
25
|
-
<
|
|
15
|
+
<Kobalte
|
|
26
16
|
{...others}
|
|
27
17
|
data-component="radio-v2"
|
|
28
18
|
classList={{
|
|
@@ -32,30 +22,30 @@ export function RadioGroup(props: RadioGroupProps) {
|
|
|
32
22
|
>
|
|
33
23
|
<Show when={local.label}>
|
|
34
24
|
{(label) => (
|
|
35
|
-
<Label data-slot="radio-v2-label" classList={{ "sr-only": local.hideLabel }}>
|
|
25
|
+
<Kobalte.Label data-slot="radio-v2-label" classList={{ "sr-only": local.hideLabel }}>
|
|
36
26
|
{label()}
|
|
37
|
-
</Label>
|
|
27
|
+
</Kobalte.Label>
|
|
38
28
|
)}
|
|
39
29
|
</Show>
|
|
40
30
|
<Show when={local.description}>
|
|
41
|
-
{(description) => <Description data-slot="radio-v2-description">{description()}</Description>}
|
|
31
|
+
{(description) => <Kobalte.Description data-slot="radio-v2-description">{description()}</Kobalte.Description>}
|
|
42
32
|
</Show>
|
|
43
33
|
<div data-slot="radio-v2-items">{local.children}</div>
|
|
44
|
-
<ErrorMessage data-slot="radio-v2-error" />
|
|
45
|
-
</
|
|
34
|
+
<Kobalte.ErrorMessage data-slot="radio-v2-error" />
|
|
35
|
+
</Kobalte>
|
|
46
36
|
)
|
|
47
37
|
}
|
|
48
38
|
|
|
49
|
-
export interface
|
|
39
|
+
export interface RadioItemV2Props extends ComponentProps<typeof Kobalte.Item> {
|
|
50
40
|
label: JSX.Element
|
|
51
41
|
description?: JSX.Element
|
|
52
42
|
hideLabel?: boolean
|
|
53
43
|
}
|
|
54
44
|
|
|
55
|
-
export function
|
|
45
|
+
export function RadioItemV2(props: RadioItemV2Props) {
|
|
56
46
|
const [local, others] = splitProps(props, ["class", "classList", "label", "description", "hideLabel"])
|
|
57
47
|
return (
|
|
58
|
-
<Item
|
|
48
|
+
<Kobalte.Item
|
|
59
49
|
{...others}
|
|
60
50
|
data-slot="radio-v2-item"
|
|
61
51
|
classList={{
|
|
@@ -63,20 +53,20 @@ export function RadioItem(props: RadioItemProps) {
|
|
|
63
53
|
[local.class ?? ""]: !!local.class,
|
|
64
54
|
}}
|
|
65
55
|
>
|
|
66
|
-
<ItemInput data-slot="radio-v2-item-input" />
|
|
56
|
+
<Kobalte.ItemInput data-slot="radio-v2-item-input" />
|
|
67
57
|
<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>
|
|
58
|
+
<Kobalte.ItemControl data-slot="radio-v2-item-control">
|
|
59
|
+
<Kobalte.ItemIndicator data-slot="radio-v2-item-indicator" />
|
|
60
|
+
</Kobalte.ItemControl>
|
|
71
61
|
</div>
|
|
72
|
-
<ItemLabel data-slot="radio-v2-item-label" classList={{ "sr-only": local.hideLabel }}>
|
|
62
|
+
<Kobalte.ItemLabel data-slot="radio-v2-item-label" classList={{ "sr-only": local.hideLabel }}>
|
|
73
63
|
<div data-slot="radio-v2-item-text">
|
|
74
64
|
<span data-slot="radio-v2-item-label-text">{local.label}</span>
|
|
75
65
|
<Show when={local.description}>
|
|
76
66
|
{(description) => <span data-slot="radio-v2-item-description">{description()}</span>}
|
|
77
67
|
</Show>
|
|
78
68
|
</div>
|
|
79
|
-
</ItemLabel>
|
|
80
|
-
</Item>
|
|
69
|
+
</Kobalte.ItemLabel>
|
|
70
|
+
</Kobalte.Item>
|
|
81
71
|
)
|
|
82
72
|
}
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
type ParentProps,
|
|
11
11
|
} from "solid-js"
|
|
12
12
|
import type { ComponentProps } from "solid-js"
|
|
13
|
-
import "./segmented-control.css"
|
|
13
|
+
import "./segmented-control-v2.css"
|
|
14
14
|
|
|
15
15
|
type OnChange = (value: string | null) => void
|
|
16
16
|
|
|
@@ -26,11 +26,11 @@ const SegmentedControlContext = createContext<SegmentedControlContextValue>()
|
|
|
26
26
|
|
|
27
27
|
function useSegmentedControlContext() {
|
|
28
28
|
const ctx = useContext(SegmentedControlContext)
|
|
29
|
-
if (!ctx) throw new Error("
|
|
29
|
+
if (!ctx) throw new Error("SegmentedControlItemV2 must be used inside SegmentedControlV2")
|
|
30
30
|
return ctx
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
export type
|
|
33
|
+
export type SegmentedControlV2Props = Omit<ComponentProps<"div">, "onChange"> &
|
|
34
34
|
ParentProps<{
|
|
35
35
|
/** Selected value when controlled (including `null` when empty). Omit key for uncontrolled. */
|
|
36
36
|
value?: string | null
|
|
@@ -42,7 +42,7 @@ export type SegmentedControlProps = Omit<ComponentProps<"div">, "onChange"> &
|
|
|
42
42
|
disabled?: boolean
|
|
43
43
|
}>
|
|
44
44
|
|
|
45
|
-
export function
|
|
45
|
+
export function SegmentedControlV2(props: SegmentedControlV2Props) {
|
|
46
46
|
const isControlled = createMemo(() => Object.hasOwn(props as object, "value"))
|
|
47
47
|
const merged = mergeProps({ allowDeselect: false, disabled: false }, props)
|
|
48
48
|
const [local, rest] = splitProps(merged, [
|
|
@@ -119,7 +119,7 @@ export function SegmentedControl(props: SegmentedControlProps) {
|
|
|
119
119
|
)
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
export type
|
|
122
|
+
export type SegmentedControlItemV2Props = Omit<ComponentProps<"button">, "type" | "children"> &
|
|
123
123
|
ParentProps<{
|
|
124
124
|
value: string
|
|
125
125
|
children: JSX.Element
|
|
@@ -132,7 +132,7 @@ function invokeButtonHandler<E extends Event>(
|
|
|
132
132
|
if (typeof handler === "function") (handler as (ev: typeof e) => void)(e)
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
export function
|
|
135
|
+
export function SegmentedControlItemV2(props: SegmentedControlItemV2Props) {
|
|
136
136
|
const merged = mergeProps({ disabled: false }, props)
|
|
137
137
|
const [local, rest] = splitProps(merged, [
|
|
138
138
|
"class",
|
|
@@ -159,14 +159,13 @@ export function SegmentedControlItem(props: SegmentedControlItemProps) {
|
|
|
159
159
|
invokeButtonHandler(local.onKeyDown, e)
|
|
160
160
|
if (e.defaultPrevented || disabled()) return
|
|
161
161
|
const t = e.currentTarget
|
|
162
|
-
const horizontal = t.closest(`[data-slot="segmented-control-v2"]`)?.matches(":dir(rtl)") ? -1 : 1
|
|
163
162
|
|
|
164
163
|
if (e.key === "ArrowRight") {
|
|
165
164
|
e.preventDefault()
|
|
166
|
-
ctx.focusNext(t,
|
|
165
|
+
ctx.focusNext(t, 1)
|
|
167
166
|
} else if (e.key === "ArrowLeft") {
|
|
168
167
|
e.preventDefault()
|
|
169
|
-
ctx.focusNext(t, -
|
|
168
|
+
ctx.focusNext(t, -1)
|
|
170
169
|
}
|
|
171
170
|
|
|
172
171
|
// accessibility stuff
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import "
|
|
1
|
+
@import "./menu-v2.css";
|
|
2
2
|
|
|
3
3
|
/* Above modal dialogs (z-index 50); matches legacy select-content. */
|
|
4
4
|
[data-popper-positioner]:has([data-slot="select-v2-content"]) {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
/*
|
|
49
|
+
/* Trigger shell — aligned with text-input-v2 */
|
|
50
50
|
[data-component="select-v2"] {
|
|
51
51
|
box-sizing: border-box;
|
|
52
52
|
display: flex;
|
|
@@ -73,6 +73,12 @@
|
|
|
73
73
|
box-shadow 85ms ease-out;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
[data-component="select-v2"][data-appearance="large"] {
|
|
77
|
+
height: 32px;
|
|
78
|
+
padding-block: 0;
|
|
79
|
+
padding-inline: 0 8px;
|
|
80
|
+
}
|
|
81
|
+
|
|
76
82
|
[data-component="select-v2"]:where(:hover):not([data-disabled], [data-invalid]):not(:focus-within):not(
|
|
77
83
|
[data-expanded]
|
|
78
84
|
) {
|