@opencode-ai/ui 0.0.0-dev-17746 → 0.0.0-dev-202608201733
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/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 -209
- 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 -16
- 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 +13 -131
- package/src/{data-display/accordion → components}/accordion.css +26 -1
- 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/components/button.tsx +33 -0
- 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 +1 -1
- 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/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/provider-icon.tsx +1 -1
- 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/i18n.tsx +14 -17
- package/src/hooks/create-auto-scroll.tsx +0 -20
- package/src/i18n/am.ts +2 -0
- package/src/i18n/ar.ts +2 -0
- package/src/i18n/az.ts +2 -0
- package/src/i18n/bg.ts +2 -0
- package/src/i18n/bn.ts +2 -0
- package/src/i18n/br.ts +2 -0
- package/src/i18n/bs.ts +2 -0
- package/src/i18n/ca.ts +2 -0
- package/src/i18n/cs.ts +2 -0
- package/src/i18n/da.ts +2 -0
- package/src/i18n/de.ts +2 -0
- package/src/i18n/dv.ts +2 -0
- package/src/i18n/dz.ts +2 -0
- package/src/i18n/el.ts +2 -0
- package/src/i18n/en.ts +4 -18
- package/src/i18n/es.ts +2 -0
- package/src/i18n/et.ts +2 -0
- package/src/i18n/fa.ts +2 -0
- package/src/i18n/fi.ts +2 -0
- package/src/i18n/fo.ts +2 -0
- package/src/i18n/fr.ts +2 -0
- package/src/i18n/hi.ts +2 -0
- package/src/i18n/hr.ts +2 -0
- package/src/i18n/hu.ts +2 -0
- package/src/i18n/hy.ts +2 -0
- package/src/i18n/id.ts +2 -0
- package/src/i18n/is.ts +2 -0
- package/src/i18n/it.ts +2 -0
- package/src/i18n/ja.ts +2 -0
- package/src/i18n/ka.ts +2 -0
- package/src/i18n/km.ts +2 -0
- package/src/i18n/ko.ts +2 -0
- package/src/i18n/lo.ts +2 -0
- package/src/i18n/lt.ts +2 -0
- package/src/i18n/lv.ts +2 -0
- package/src/i18n/mk.ts +2 -0
- package/src/i18n/mn.ts +2 -0
- package/src/i18n/ms.ts +2 -0
- package/src/i18n/my.ts +2 -0
- package/src/i18n/ne.ts +2 -0
- package/src/i18n/nl.ts +2 -0
- package/src/i18n/no.ts +2 -0
- package/src/i18n/pa.ts +2 -0
- package/src/i18n/pl.ts +2 -0
- package/src/i18n/ro.ts +2 -0
- package/src/i18n/ru.ts +2 -0
- package/src/i18n/si.ts +2 -0
- package/src/i18n/sk.ts +2 -0
- package/src/i18n/sl.ts +2 -0
- package/src/i18n/sq.ts +2 -0
- package/src/i18n/sr.ts +2 -0
- package/src/i18n/sv.ts +2 -0
- package/src/i18n/tg.ts +2 -0
- package/src/i18n/th.ts +2 -0
- package/src/i18n/tk.ts +2 -0
- package/src/i18n/tr.ts +2 -0
- package/src/i18n/uk.ts +2 -0
- package/src/i18n/ur.ts +2 -0
- package/src/i18n/uz.ts +2 -0
- package/src/i18n/vi.ts +2 -0
- package/src/i18n/zh.ts +2 -0
- package/src/i18n/zht.ts +2 -0
- package/src/styles/index.css +20 -4
- package/src/styles/tailwind/index.css +1 -15
- package/src/theme/context.tsx +11 -19
- package/src/theme/themes/oc-2.json +1 -1
- 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/{actions/button/button.tsx → v2/components/button-v2.tsx} +8 -8
- 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.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 -42
- 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.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} +0 -121
- 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.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} +9 -24
- package/src/v2/components/tabs-v2.tsx +149 -0
- 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} +14 -18
- package/src/{typography/wordmark/wordmark.tsx → v2/components/wordmark-v2.tsx} +1 -1
- package/src/{styles/tokens → v2/styles}/theme.css +12 -0
- 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/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 -14
- package/dist/typography/wordmark/wordmark.d.ts +0 -2
- package/src/actions/icon-button/icon-button.tsx +0 -32
- 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/{forms/field/field.css → v2/components/field-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/{data-display/line-comment/line-comment.css → v2/components/line-comment-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/segmented-control/segmented-control.css → v2/components/segmented-control-v2.css} +0 -0
- /package/src/{navigation → v2/components}/tab-state-indicator.tsx +0 -0
- /package/src/{forms/text-input/text-input.css → v2/components/text-input-v2.css} +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,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Content,
|
|
3
|
-
Item,
|
|
4
|
-
ItemIndicator,
|
|
5
|
-
ItemLabel,
|
|
6
|
-
Listbox,
|
|
7
|
-
Portal,
|
|
8
|
-
Root,
|
|
9
|
-
Section,
|
|
10
|
-
Trigger,
|
|
11
|
-
Value,
|
|
12
|
-
} from "@kobalte/core/select"
|
|
1
|
+
import { Select as Kobalte } from "@kobalte/core/select"
|
|
13
2
|
import { Show, createMemo, onCleanup, splitProps, type ComponentProps, type JSX } from "solid-js"
|
|
14
|
-
import "./select.css"
|
|
3
|
+
import "./select-v2.css"
|
|
15
4
|
|
|
16
5
|
function groupOptions<T>(options: T[], groupBy?: (x: T) => string): { category: string; options: T[] }[] {
|
|
17
6
|
if (!groupBy) {
|
|
@@ -51,8 +40,8 @@ const CheckSmall = () => (
|
|
|
51
40
|
</svg>
|
|
52
41
|
)
|
|
53
42
|
|
|
54
|
-
export type
|
|
55
|
-
ComponentProps<typeof
|
|
43
|
+
export type SelectV2Props<T> = Omit<
|
|
44
|
+
ComponentProps<typeof Kobalte<T, { category: string; options: T[] }>>,
|
|
56
45
|
"value" | "onSelect" | "children" | "options" | "itemComponent" | "sectionComponent" | "defaultValue" | "multiple"
|
|
57
46
|
> & {
|
|
58
47
|
placeholder?: string
|
|
@@ -64,13 +53,15 @@ export type SelectProps<T> = Omit<
|
|
|
64
53
|
groupBy?: (x: T) => string
|
|
65
54
|
onSelect?: (value: T | null) => void
|
|
66
55
|
onHighlight?: (value: T | undefined) => void | (() => void)
|
|
56
|
+
/** `base` / `large` match text-input-v2; `inline` is a compact settings-row trigger. */
|
|
57
|
+
appearance?: "base" | "large" | "inline"
|
|
67
58
|
invalid?: boolean
|
|
68
59
|
numeric?: boolean
|
|
69
60
|
children?: (item: T) => JSX.Element
|
|
70
61
|
valueClass?: string
|
|
71
62
|
}
|
|
72
63
|
|
|
73
|
-
export function
|
|
64
|
+
export function SelectV2<T>(props: SelectV2Props<T>) {
|
|
74
65
|
const [local, others] = splitProps(props, [
|
|
75
66
|
"class",
|
|
76
67
|
"classList",
|
|
@@ -84,6 +75,7 @@ export function Select<T>(props: SelectProps<T>) {
|
|
|
84
75
|
"onHighlight",
|
|
85
76
|
"onOpenChange",
|
|
86
77
|
"children",
|
|
78
|
+
"appearance",
|
|
87
79
|
"invalid",
|
|
88
80
|
"numeric",
|
|
89
81
|
"disabled",
|
|
@@ -96,6 +88,8 @@ export function Select<T>(props: SelectProps<T>) {
|
|
|
96
88
|
"fitViewport",
|
|
97
89
|
])
|
|
98
90
|
|
|
91
|
+
const inline = () => (local.appearance ?? "base") === "inline"
|
|
92
|
+
|
|
99
93
|
const state: { key?: string; cleanup?: void | (() => void) } = {}
|
|
100
94
|
|
|
101
95
|
const stop = () => {
|
|
@@ -124,15 +118,15 @@ export function Select<T>(props: SelectProps<T>) {
|
|
|
124
118
|
const grouped = createMemo(() => groupOptions(local.options, local.groupBy))
|
|
125
119
|
|
|
126
120
|
return (
|
|
127
|
-
<
|
|
121
|
+
<Kobalte<T, { category: string; options: T[] }>
|
|
128
122
|
{...others}
|
|
129
123
|
multiple={false}
|
|
130
124
|
allowDuplicateSelectionEvents={false}
|
|
131
125
|
disabled={local.disabled}
|
|
132
126
|
data-component="select-v2-root"
|
|
133
|
-
placement={local.placement ?? "bottom-end"}
|
|
127
|
+
placement={local.placement ?? (inline() ? "bottom-end" : "bottom-start")}
|
|
134
128
|
gutter={local.gutter ?? 4}
|
|
135
|
-
sameWidth={local.sameWidth ??
|
|
129
|
+
sameWidth={local.sameWidth ?? !inline()}
|
|
136
130
|
flip={local.flip ?? true}
|
|
137
131
|
slide={local.slide ?? true}
|
|
138
132
|
fitViewport={local.fitViewport ?? false}
|
|
@@ -143,31 +137,31 @@ export function Select<T>(props: SelectProps<T>) {
|
|
|
143
137
|
optionGroupChildren="options"
|
|
144
138
|
placeholder={local.placeholder}
|
|
145
139
|
sectionComponent={(sectionProps) => (
|
|
146
|
-
<Section>
|
|
140
|
+
<Kobalte.Section>
|
|
147
141
|
<Show when={sectionProps.section.rawValue.category}>
|
|
148
142
|
<div data-slot="menu-v2-group-label">{sectionProps.section.rawValue.category}</div>
|
|
149
143
|
</Show>
|
|
150
|
-
</Section>
|
|
144
|
+
</Kobalte.Section>
|
|
151
145
|
)}
|
|
152
146
|
itemComponent={(itemProps) => (
|
|
153
|
-
<Item
|
|
147
|
+
<Kobalte.Item
|
|
154
148
|
{...itemProps}
|
|
155
149
|
data-component="menu-v2-item"
|
|
156
150
|
onPointerEnter={() => move(itemProps.item.rawValue)}
|
|
157
151
|
onPointerMove={() => move(itemProps.item.rawValue)}
|
|
158
152
|
onFocus={() => move(itemProps.item.rawValue)}
|
|
159
153
|
>
|
|
160
|
-
<ItemLabel data-slot="menu-v2-item-content" as="span">
|
|
154
|
+
<Kobalte.ItemLabel data-slot="menu-v2-item-content" as="span">
|
|
161
155
|
{local.children
|
|
162
156
|
? local.children(itemProps.item.rawValue)
|
|
163
157
|
: local.label
|
|
164
158
|
? local.label(itemProps.item.rawValue)
|
|
165
159
|
: String(itemProps.item.rawValue as string)}
|
|
166
|
-
</ItemLabel>
|
|
167
|
-
<ItemIndicator data-slot="menu-v2-item-indicator" forceMount>
|
|
160
|
+
</Kobalte.ItemLabel>
|
|
161
|
+
<Kobalte.ItemIndicator data-slot="menu-v2-item-indicator" forceMount>
|
|
168
162
|
<CheckSmall />
|
|
169
|
-
</ItemIndicator>
|
|
170
|
-
</Item>
|
|
163
|
+
</Kobalte.ItemIndicator>
|
|
164
|
+
</Kobalte.Item>
|
|
171
165
|
)}
|
|
172
166
|
onChange={(next) => {
|
|
173
167
|
const v = next == null ? null : Array.isArray(next) ? ((next[0] as T) ?? null) : (next as T)
|
|
@@ -179,10 +173,10 @@ export function Select<T>(props: SelectProps<T>) {
|
|
|
179
173
|
if (!open) stop()
|
|
180
174
|
}}
|
|
181
175
|
>
|
|
182
|
-
<Trigger
|
|
176
|
+
<Kobalte.Trigger
|
|
183
177
|
as="div"
|
|
184
178
|
data-component="select-v2"
|
|
185
|
-
data-appearance="
|
|
179
|
+
data-appearance={local.appearance ?? "base"}
|
|
186
180
|
data-invalid={local.invalid ? "" : undefined}
|
|
187
181
|
data-numeric={local.numeric ? "" : undefined}
|
|
188
182
|
disabled={local.disabled}
|
|
@@ -193,23 +187,23 @@ export function Select<T>(props: SelectProps<T>) {
|
|
|
193
187
|
}}
|
|
194
188
|
>
|
|
195
189
|
<div data-slot="select-v2-value">
|
|
196
|
-
<Value<T> data-slot="select-v2-value-text" class={local.valueClass}>
|
|
190
|
+
<Kobalte.Value<T> data-slot="select-v2-value-text" class={local.valueClass}>
|
|
197
191
|
{(st) => {
|
|
198
192
|
const selected = st.selectedOption()
|
|
199
193
|
if (local.label && selected != null) return local.label(selected)
|
|
200
194
|
return selected != null ? (selected as string) : ""
|
|
201
195
|
}}
|
|
202
|
-
</Value>
|
|
196
|
+
</Kobalte.Value>
|
|
203
197
|
</div>
|
|
204
198
|
<span data-slot="select-v2-chevron" aria-hidden="true">
|
|
205
199
|
<ChevronDown />
|
|
206
200
|
</span>
|
|
207
|
-
</Trigger>
|
|
208
|
-
<Portal>
|
|
209
|
-
<Content data-component="menu-v2-content" data-slot="select-v2-content">
|
|
210
|
-
<Listbox data-slot="select-v2-listbox" />
|
|
211
|
-
</Content>
|
|
212
|
-
</Portal>
|
|
213
|
-
</
|
|
201
|
+
</Kobalte.Trigger>
|
|
202
|
+
<Kobalte.Portal>
|
|
203
|
+
<Kobalte.Content data-component="menu-v2-content" data-slot="select-v2-content">
|
|
204
|
+
<Kobalte.Listbox data-slot="select-v2-listbox" />
|
|
205
|
+
</Kobalte.Content>
|
|
206
|
+
</Kobalte.Portal>
|
|
207
|
+
</Kobalte>
|
|
214
208
|
)
|
|
215
209
|
}
|
|
@@ -87,8 +87,13 @@
|
|
|
87
87
|
flex-shrink: 0;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
[data-component="menu-v2-content"].open-in-app-v2-menu [data-
|
|
90
|
+
[data-component="menu-v2-content"].open-in-app-v2-menu [data-component="icon"] {
|
|
91
91
|
width: 16px;
|
|
92
92
|
height: 16px;
|
|
93
93
|
flex-shrink: 0;
|
|
94
94
|
}
|
|
95
|
+
|
|
96
|
+
[data-component="menu-v2-content"].open-in-app-v2-menu [data-component="icon"] [data-slot="icon-svg"] {
|
|
97
|
+
width: 16px;
|
|
98
|
+
height: 16px;
|
|
99
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { splitProps, type ComponentProps, type ParentProps } from "solid-js"
|
|
2
|
-
import "./split-button.css"
|
|
2
|
+
import "./split-button-v2.css"
|
|
3
3
|
|
|
4
|
-
export function
|
|
4
|
+
export function SplitButtonV2(props: ParentProps<ComponentProps<"div">>) {
|
|
5
5
|
const [split, rest] = splitProps(props, ["class", "classList", "children"])
|
|
6
6
|
return (
|
|
7
7
|
<div
|
|
@@ -17,7 +17,7 @@ export function SplitButton(props: ParentProps<ComponentProps<"div">>) {
|
|
|
17
17
|
)
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export function
|
|
20
|
+
export function SplitButtonV2Action(props: ComponentProps<"button">) {
|
|
21
21
|
const [split, rest] = splitProps(props, ["class", "classList"])
|
|
22
22
|
return (
|
|
23
23
|
<button
|
|
@@ -32,7 +32,7 @@ export function SplitButtonAction(props: ComponentProps<"button">) {
|
|
|
32
32
|
)
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
export function
|
|
35
|
+
export function SplitButtonV2MenuTrigger(props: ComponentProps<"button">) {
|
|
36
36
|
const [split, rest] = splitProps(props, ["class", "classList"])
|
|
37
37
|
return (
|
|
38
38
|
<button
|
|
@@ -160,113 +160,3 @@
|
|
|
160
160
|
pointer-events: none;
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
|
|
164
|
-
[data-component="switch"][data-appearance="standard"] {
|
|
165
|
-
[data-slot="switch-control"] {
|
|
166
|
-
padding: 0;
|
|
167
|
-
width: 28px;
|
|
168
|
-
height: 16px;
|
|
169
|
-
border-radius: 3px;
|
|
170
|
-
border: 1px solid var(--border-weak-base);
|
|
171
|
-
background: var(--surface-base);
|
|
172
|
-
box-shadow: none;
|
|
173
|
-
transition:
|
|
174
|
-
background-color 150ms,
|
|
175
|
-
border-color 150ms;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
[data-slot="switch-thumb"] {
|
|
179
|
-
box-sizing: content-box;
|
|
180
|
-
width: 14px;
|
|
181
|
-
height: 14px;
|
|
182
|
-
border-radius: 2px;
|
|
183
|
-
border: 1px solid var(--border-base);
|
|
184
|
-
background: var(--icon-invert-base);
|
|
185
|
-
box-shadow:
|
|
186
|
-
0 1px 2px -1px rgba(19, 16, 16, 0.04),
|
|
187
|
-
0 1px 2px 0 rgba(19, 16, 16, 0.06),
|
|
188
|
-
0 1px 3px 0 rgba(19, 16, 16, 0.08);
|
|
189
|
-
transform: translateX(-1px);
|
|
190
|
-
transition:
|
|
191
|
-
transform 150ms,
|
|
192
|
-
background-color 150ms;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
[data-slot="switch-label"] {
|
|
196
|
-
color: var(--text-base);
|
|
197
|
-
font-family: var(--font-family-sans);
|
|
198
|
-
font-size: var(--font-size-small);
|
|
199
|
-
font-style: normal;
|
|
200
|
-
font-weight: var(--font-weight-regular);
|
|
201
|
-
line-height: var(--line-height-large);
|
|
202
|
-
letter-spacing: var(--letter-spacing-normal);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
[data-slot="switch-description"] {
|
|
206
|
-
color: var(--text-base);
|
|
207
|
-
font-family: var(--font-family-sans);
|
|
208
|
-
font-size: 12px;
|
|
209
|
-
font-weight: var(--font-weight-regular);
|
|
210
|
-
line-height: var(--line-height-normal);
|
|
211
|
-
letter-spacing: var(--letter-spacing-normal);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
[data-slot="switch-error"] {
|
|
215
|
-
color: var(--text-error);
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
&:hover:not([data-disabled], [data-readonly]) [data-slot="switch-control"] {
|
|
219
|
-
border-color: var(--border-hover);
|
|
220
|
-
background: var(--surface-hover);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
&:hover:not([data-disabled], [data-readonly]) [data-slot="switch-thumb"] {
|
|
224
|
-
width: 14px;
|
|
225
|
-
border-radius: 2px;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
&:not([data-readonly]) [data-slot="switch-input"]:focus-visible ~ [data-slot="switch-control"] {
|
|
229
|
-
border-color: var(--border-focus);
|
|
230
|
-
outline: none;
|
|
231
|
-
box-shadow: var(--shadow-xs-border-focus);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
&[data-checked] [data-slot="switch-control"] {
|
|
235
|
-
border-color: var(--icon-strong-base);
|
|
236
|
-
background: var(--icon-strong-base);
|
|
237
|
-
box-shadow: none;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
&[data-checked] [data-slot="switch-thumb"],
|
|
241
|
-
&[data-checked]:hover:not([data-disabled], [data-readonly]) [data-slot="switch-thumb"] {
|
|
242
|
-
width: 14px;
|
|
243
|
-
border: none;
|
|
244
|
-
border-radius: 2px;
|
|
245
|
-
transform: translateX(12px);
|
|
246
|
-
background: var(--icon-invert-base);
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
&:dir(rtl)[data-checked] [data-slot="switch-thumb"],
|
|
250
|
-
&:dir(rtl)[data-checked]:hover:not([data-disabled], [data-readonly]) [data-slot="switch-thumb"] {
|
|
251
|
-
transform: translateX(-12px);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
&[data-checked]:hover:not([data-disabled], [data-readonly]) [data-slot="switch-control"] {
|
|
255
|
-
border-color: var(--border-hover);
|
|
256
|
-
background: var(--surface-hover);
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
&[data-disabled] [data-slot="switch-control"] {
|
|
260
|
-
border-color: var(--border-disabled);
|
|
261
|
-
background: var(--surface-disabled);
|
|
262
|
-
opacity: 1;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
&[data-disabled] [data-slot="switch-thumb"] {
|
|
266
|
-
background: var(--icon-disabled);
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
&[data-invalid] [data-slot="switch-control"] {
|
|
270
|
-
border-color: var(--border-error);
|
|
271
|
-
}
|
|
272
|
-
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Switch as Kobalte } from "@kobalte/core/switch"
|
|
2
|
+
import { Show, splitProps } from "solid-js"
|
|
3
|
+
import type { ComponentProps, ParentProps } from "solid-js"
|
|
4
|
+
import "./switch-v2.css"
|
|
5
|
+
|
|
6
|
+
export interface SwitchProps extends ParentProps<ComponentProps<typeof Kobalte>> {
|
|
7
|
+
hideLabel?: boolean
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function Switch(props: SwitchProps) {
|
|
11
|
+
const [local, others] = splitProps(props, ["children", "class", "hideLabel"])
|
|
12
|
+
return (
|
|
13
|
+
<Kobalte {...others} class={local.class} data-component="switch">
|
|
14
|
+
<Kobalte.Input data-slot="switch-input" />
|
|
15
|
+
<Show when={local.children}>
|
|
16
|
+
{(label) => (
|
|
17
|
+
<Kobalte.Label data-slot="switch-label" classList={{ "sr-only": local.hideLabel }}>
|
|
18
|
+
{label()}
|
|
19
|
+
</Kobalte.Label>
|
|
20
|
+
)}
|
|
21
|
+
</Show>
|
|
22
|
+
<Kobalte.Control data-slot="switch-control">
|
|
23
|
+
<Kobalte.Thumb data-slot="switch-thumb" />
|
|
24
|
+
</Kobalte.Control>
|
|
25
|
+
<Kobalte.ErrorMessage data-slot="switch-error" />
|
|
26
|
+
</Kobalte>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
@@ -68,29 +68,22 @@
|
|
|
68
68
|
box-shadow: none;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
[data-slot="tabs-v2-
|
|
72
|
-
display: flex;
|
|
73
|
-
align-items: center;
|
|
74
|
-
justify-content: center;
|
|
75
|
-
margin-inline-start: -5px;
|
|
76
|
-
flex: none;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
[data-slot="tabs-v2-trigger-close-button"] [data-slot="tabs-close-button"] {
|
|
71
|
+
[data-component="tabs-v2"] [data-slot="tabs-v2-close-button"] {
|
|
80
72
|
width: 20px;
|
|
81
73
|
height: 20px;
|
|
82
|
-
|
|
74
|
+
margin-inline-start: -5px;
|
|
75
|
+
flex: none;
|
|
83
76
|
display: flex;
|
|
84
77
|
align-items: center;
|
|
85
78
|
justify-content: center;
|
|
86
79
|
color: var(--v2-text-text-faint);
|
|
87
80
|
}
|
|
88
81
|
|
|
89
|
-
[data-
|
|
82
|
+
[data-component="tabs-v2"] [data-slot="tabs-v2-close-button"]:hover {
|
|
90
83
|
color: var(--v2-text-text-muted);
|
|
91
84
|
}
|
|
92
85
|
|
|
93
|
-
[data-component="tabs-v2"] [data-component="icon-button
|
|
86
|
+
[data-component="tabs-v2"] [data-component="icon-button"] {
|
|
94
87
|
margin: 0;
|
|
95
88
|
}
|
|
96
89
|
|
|
@@ -182,7 +175,7 @@
|
|
|
182
175
|
border: 0.5px solid var(--v2-border-border-muted);
|
|
183
176
|
}
|
|
184
177
|
|
|
185
|
-
[data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"]
|
|
178
|
+
[data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"] [data-slot="tabs-v2-list"] {
|
|
186
179
|
flex-direction: column;
|
|
187
180
|
width: 240px;
|
|
188
181
|
min-width: 200px;
|
|
@@ -193,9 +186,7 @@
|
|
|
193
186
|
border-inline-end: 1px solid var(--v2-border-border-base);
|
|
194
187
|
}
|
|
195
188
|
|
|
196
|
-
[data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"]
|
|
197
|
-
> [data-slot="tabs-v2-list"]
|
|
198
|
-
[data-slot="tabs-v2-section-title"] {
|
|
189
|
+
[data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"] [data-slot="tabs-v2-section-title"] {
|
|
199
190
|
width: 100%;
|
|
200
191
|
padding-inline-start: 4px;
|
|
201
192
|
color: var(--v2-text-text-muted);
|
|
@@ -204,9 +195,7 @@
|
|
|
204
195
|
user-select: none;
|
|
205
196
|
}
|
|
206
197
|
|
|
207
|
-
[data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"]
|
|
208
|
-
> [data-slot="tabs-v2-list"]
|
|
209
|
-
[data-slot="tabs-v2-trigger-wrapper"] {
|
|
198
|
+
[data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"] [data-slot="tabs-v2-trigger-wrapper"] {
|
|
210
199
|
width: 100%;
|
|
211
200
|
height: 28px;
|
|
212
201
|
border-radius: 4px;
|
|
@@ -214,9 +203,7 @@
|
|
|
214
203
|
color: var(--v2-text-text-muted);
|
|
215
204
|
}
|
|
216
205
|
|
|
217
|
-
[data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"]
|
|
218
|
-
> [data-slot="tabs-v2-list"]
|
|
219
|
-
[data-slot="tabs-v2-trigger"] {
|
|
206
|
+
[data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"] [data-slot="tabs-v2-trigger"] {
|
|
220
207
|
width: 100%;
|
|
221
208
|
height: 100%;
|
|
222
209
|
justify-content: flex-start;
|
|
@@ -225,14 +212,12 @@
|
|
|
225
212
|
}
|
|
226
213
|
|
|
227
214
|
[data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"]
|
|
228
|
-
> [data-slot="tabs-v2-list"]
|
|
229
215
|
[data-slot="tabs-v2-trigger-wrapper"]:hover:not(:disabled):not(:has([data-selected])) {
|
|
230
216
|
background-color: var(--v2-background-bg-layer-03);
|
|
231
217
|
color: var(--v2-text-text-base);
|
|
232
218
|
}
|
|
233
219
|
|
|
234
220
|
[data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"]
|
|
235
|
-
> [data-slot="tabs-v2-list"]
|
|
236
221
|
[data-slot="tabs-v2-trigger-wrapper"]:has([data-selected]) {
|
|
237
222
|
background-color: var(--v2-background-bg-layer-03);
|
|
238
223
|
color: var(--v2-text-text-base);
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { Tabs as Kobalte } from "@kobalte/core/tabs"
|
|
2
|
+
import { Show, splitProps, type JSX } from "solid-js"
|
|
3
|
+
import type { ComponentProps, ParentProps, Component } from "solid-js"
|
|
4
|
+
import { useI18n } from "../../context/i18n"
|
|
5
|
+
import "./tabs-v2.css"
|
|
6
|
+
|
|
7
|
+
export interface TabsV2Props extends ComponentProps<typeof Kobalte> {
|
|
8
|
+
variant?: "normal" | "pill" | "settings"
|
|
9
|
+
orientation?: "horizontal" | "vertical"
|
|
10
|
+
}
|
|
11
|
+
export interface TabsV2ListProps extends ComponentProps<typeof Kobalte.List> {}
|
|
12
|
+
export interface TabsV2TriggerProps extends ComponentProps<typeof Kobalte.Trigger> {
|
|
13
|
+
onMiddleClick?: () => void
|
|
14
|
+
/** Optional subtext shown beside the primary content (muted style) */
|
|
15
|
+
subtext?: JSX.Element | string
|
|
16
|
+
}
|
|
17
|
+
export interface TabsV2CloseButtonProps extends ComponentProps<"div"> {}
|
|
18
|
+
export interface TabsV2ContentProps extends ComponentProps<typeof Kobalte.Content> {}
|
|
19
|
+
|
|
20
|
+
function TabsV2Root(props: TabsV2Props) {
|
|
21
|
+
const [split, rest] = splitProps(props, ["class", "classList", "variant", "orientation"])
|
|
22
|
+
return (
|
|
23
|
+
<Kobalte
|
|
24
|
+
{...rest}
|
|
25
|
+
orientation={split.orientation}
|
|
26
|
+
data-component="tabs-v2"
|
|
27
|
+
data-variant={split.variant || "normal"}
|
|
28
|
+
data-orientation={split.orientation || "horizontal"}
|
|
29
|
+
classList={{
|
|
30
|
+
...split.classList,
|
|
31
|
+
[split.class ?? ""]: !!split.class,
|
|
32
|
+
}}
|
|
33
|
+
/>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function TabsV2List(props: TabsV2ListProps) {
|
|
38
|
+
const [split, rest] = splitProps(props, ["class", "classList"])
|
|
39
|
+
return (
|
|
40
|
+
<Kobalte.List
|
|
41
|
+
{...rest}
|
|
42
|
+
data-slot="tabs-v2-list"
|
|
43
|
+
classList={{
|
|
44
|
+
...split.classList,
|
|
45
|
+
[split.class ?? ""]: !!split.class,
|
|
46
|
+
}}
|
|
47
|
+
/>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function TabsV2Trigger(props: ParentProps<TabsV2TriggerProps>) {
|
|
52
|
+
const [split, rest] = splitProps(props, ["class", "classList", "children", "onMiddleClick", "subtext"])
|
|
53
|
+
return (
|
|
54
|
+
<div
|
|
55
|
+
data-slot="tabs-v2-trigger-wrapper"
|
|
56
|
+
data-value={props.value}
|
|
57
|
+
classList={{
|
|
58
|
+
...split.classList,
|
|
59
|
+
[split.class ?? ""]: !!split.class,
|
|
60
|
+
}}
|
|
61
|
+
onMouseDown={(e) => {
|
|
62
|
+
if (e.button === 1 && split.onMiddleClick) {
|
|
63
|
+
e.preventDefault()
|
|
64
|
+
}
|
|
65
|
+
}}
|
|
66
|
+
onAuxClick={(e) => {
|
|
67
|
+
if (e.button === 1 && split.onMiddleClick) {
|
|
68
|
+
e.preventDefault()
|
|
69
|
+
split.onMiddleClick()
|
|
70
|
+
}
|
|
71
|
+
}}
|
|
72
|
+
>
|
|
73
|
+
<Kobalte.Trigger {...rest} data-slot="tabs-v2-trigger" data-value={props.value}>
|
|
74
|
+
<span class="inline-flex items-center gap-2" data-slot="tabs-v2-trigger-content">
|
|
75
|
+
{split.children}
|
|
76
|
+
<Show when={split.subtext}>
|
|
77
|
+
{(subtext) => (
|
|
78
|
+
<span data-slot="tabs-v2-subtext" class="ms-2 text-xs text-text-weak">
|
|
79
|
+
{subtext()}
|
|
80
|
+
</span>
|
|
81
|
+
)}
|
|
82
|
+
</Show>
|
|
83
|
+
</span>
|
|
84
|
+
</Kobalte.Trigger>
|
|
85
|
+
</div>
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function TabsV2CloseButton(props: TabsV2CloseButtonProps) {
|
|
90
|
+
const i18n = useI18n()
|
|
91
|
+
const [split, rest] = splitProps(props, ["class", "classList", "onClick"])
|
|
92
|
+
return (
|
|
93
|
+
<div
|
|
94
|
+
role="button"
|
|
95
|
+
tabindex={0}
|
|
96
|
+
aria-label={i18n.t("ui.tabs.close")}
|
|
97
|
+
data-slot="tabs-v2-close-button"
|
|
98
|
+
{...rest}
|
|
99
|
+
classList={{
|
|
100
|
+
[split.class ?? ""]: !!split.class,
|
|
101
|
+
...split.classList,
|
|
102
|
+
}}
|
|
103
|
+
onClick={(e) => {
|
|
104
|
+
e.preventDefault()
|
|
105
|
+
e.stopPropagation()
|
|
106
|
+
if (typeof split.onClick === "function") {
|
|
107
|
+
split.onClick(e)
|
|
108
|
+
}
|
|
109
|
+
}}
|
|
110
|
+
onMouseDown={(e) => {
|
|
111
|
+
e.preventDefault()
|
|
112
|
+
e.stopPropagation()
|
|
113
|
+
}}
|
|
114
|
+
>
|
|
115
|
+
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
116
|
+
<path d="M10.8889 3.11108L3.11108 10.8889" stroke="currentColor" stroke-linejoin="round" />
|
|
117
|
+
<path d="M3.11108 3.11108L10.8889 10.8889" stroke="currentColor" stroke-linejoin="round" />
|
|
118
|
+
</svg>
|
|
119
|
+
</div>
|
|
120
|
+
)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function TabsV2Content(props: ParentProps<TabsV2ContentProps>) {
|
|
124
|
+
const [split, rest] = splitProps(props, ["class", "classList", "children"])
|
|
125
|
+
return (
|
|
126
|
+
<Kobalte.Content
|
|
127
|
+
{...rest}
|
|
128
|
+
data-slot="tabs-v2-content"
|
|
129
|
+
classList={{
|
|
130
|
+
...split.classList,
|
|
131
|
+
[split.class ?? ""]: !!split.class,
|
|
132
|
+
}}
|
|
133
|
+
>
|
|
134
|
+
{split.children}
|
|
135
|
+
</Kobalte.Content>
|
|
136
|
+
)
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const TabsV2SectionTitle: Component<ParentProps> = (props) => {
|
|
140
|
+
return <div data-slot="tabs-v2-section-title">{props.children}</div>
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export const TabsV2 = Object.assign(TabsV2Root, {
|
|
144
|
+
List: TabsV2List,
|
|
145
|
+
Trigger: TabsV2Trigger,
|
|
146
|
+
CloseButton: TabsV2CloseButton,
|
|
147
|
+
Content: TabsV2Content,
|
|
148
|
+
SectionTitle: TabsV2SectionTitle,
|
|
149
|
+
})
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type ComponentProps, type JSX, Show, splitProps } from "solid-js"
|
|
2
|
-
import { Icon } from "
|
|
2
|
+
import { Icon } from "./icon"
|
|
3
3
|
import { useI18n } from "../../context/i18n"
|
|
4
|
-
import "./text-input.css"
|
|
4
|
+
import "./text-input-v2.css"
|
|
5
5
|
|
|
6
|
-
export interface
|
|
6
|
+
export interface TextInputV2Props extends Omit<ComponentProps<"input">, "type"> {
|
|
7
7
|
/** Icon or adornment shown before the field value. */
|
|
8
8
|
leadingIcon?: JSX.Element
|
|
9
9
|
/** Show the trailing copy action. */
|
|
@@ -25,7 +25,7 @@ export interface TextInputProps extends Omit<ComponentProps<"input">, "type"> {
|
|
|
25
25
|
type?: ComponentProps<"input">["type"]
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
export function
|
|
28
|
+
export function TextInputV2(props: TextInputV2Props) {
|
|
29
29
|
const i18n = useI18n()
|
|
30
30
|
const [local, inputProps] = splitProps(props, [
|
|
31
31
|
"class",
|