@opencode-ai/ui 0.0.0-dev-19010 → 0.0.0-dev-202609031506
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 -238
- 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 -32
- 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 -19
- 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 -54
- 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 +19 -48
- package/src/theme/v2/default-primitives.ts +8 -8
- package/src/theme/v2/foreground.ts +0 -1
- package/src/theme/v2/mapping.ts +1 -5
- 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.css → v2/components/button-v2.css} +0 -29
- 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 +12 -67
- 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 -40
- 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} +3 -3
- 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} +2 -2
- package/src/{styles/tokens → v2/styles}/colors.css +8 -8
- package/src/{styles/tokens → v2/styles}/theme.css +16 -20
- 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/{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/index.css → v2/styles/tailwind.css} +0 -0
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import { type ComponentProps, splitProps } from "solid-js"
|
|
2
|
-
import "./badge.css"
|
|
2
|
+
import "./badge-v2.css"
|
|
3
3
|
|
|
4
|
-
export interface
|
|
5
|
-
appearance?: "standard" | "compact"
|
|
4
|
+
export interface TagProps extends ComponentProps<"span"> {
|
|
6
5
|
variant?: "neutral" | "accent"
|
|
7
6
|
}
|
|
8
7
|
|
|
9
|
-
export function
|
|
10
|
-
const [split, rest] = splitProps(props, ["class", "classList", "children", "
|
|
8
|
+
export function Tag(props: TagProps) {
|
|
9
|
+
const [split, rest] = splitProps(props, ["class", "classList", "children", "variant"])
|
|
11
10
|
return (
|
|
12
11
|
<span
|
|
13
12
|
{...rest}
|
|
14
13
|
data-component="tag"
|
|
15
|
-
data-appearance={split.appearance ?? "compact"}
|
|
16
14
|
data-variant={split.variant ?? "neutral"}
|
|
17
15
|
classList={{
|
|
18
16
|
...split.classList,
|
|
@@ -260,32 +260,3 @@
|
|
|
260
260
|
opacity: 0.5;
|
|
261
261
|
cursor: not-allowed;
|
|
262
262
|
}
|
|
263
|
-
|
|
264
|
-
/* Ghost faint */
|
|
265
|
-
[data-component="button-v2"][data-variant="ghost-faint"] {
|
|
266
|
-
background-color: transparent;
|
|
267
|
-
color: var(--v2-text-text-faint);
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
[data-component="button-v2"][data-variant="ghost-faint"] [data-slot="icon-svg"] {
|
|
271
|
-
color: var(--v2-icon-icon-faint);
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
[data-component="button-v2"][data-variant="ghost-faint"]:is(:hover, [data-state="hover"]):not(:disabled):not(
|
|
275
|
-
[data-expanded]
|
|
276
|
-
) {
|
|
277
|
-
background-color: var(--v2-overlay-simple-overlay-hover);
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
[data-component="button-v2"][data-variant="ghost-faint"]:is(:active, [data-state="pressed"]):not(:disabled) {
|
|
281
|
-
background-color: var(--v2-overlay-simple-overlay-pressed);
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
[data-component="button-v2"][data-variant="ghost-faint"]:where([data-expanded]):not(:disabled) {
|
|
285
|
-
background-color: var(--v2-overlay-simple-overlay-pressed);
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
[data-component="button-v2"][data-variant="ghost-faint"]:is(:disabled, [data-state="disabled"]) {
|
|
289
|
-
opacity: 0.5;
|
|
290
|
-
cursor: not-allowed;
|
|
291
|
-
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Button as Kobalte } from "@kobalte/core/button"
|
|
2
|
+
import { type ComponentProps, Show, createMemo, splitProps } from "solid-js"
|
|
3
|
+
import { Icon, type IconProps } from "./icon"
|
|
4
|
+
import "./button-v2.css"
|
|
5
|
+
|
|
6
|
+
export interface ButtonV2Props
|
|
7
|
+
extends ComponentProps<typeof Kobalte>,
|
|
8
|
+
Pick<ComponentProps<"button">, "class" | "classList" | "children"> {
|
|
9
|
+
size?: "small" | "normal" | "large"
|
|
10
|
+
variant?: "neutral" | "danger" | "warning" | "outline" | "contrast" | "ghost" | "ghost-muted" | "loading"
|
|
11
|
+
icon?: IconProps["name"]
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function ButtonV2(props: ButtonV2Props) {
|
|
15
|
+
const [split, rest] = splitProps(props, ["variant", "size", "icon", "class", "classList"])
|
|
16
|
+
const resolvedIcon = createMemo(() => split.icon)
|
|
17
|
+
return (
|
|
18
|
+
<Kobalte
|
|
19
|
+
{...rest}
|
|
20
|
+
data-component="button-v2"
|
|
21
|
+
data-size={split.size || "normal"}
|
|
22
|
+
data-variant={split.variant || "neutral"}
|
|
23
|
+
data-icon={resolvedIcon()}
|
|
24
|
+
classList={{
|
|
25
|
+
...split.classList,
|
|
26
|
+
[split.class ?? ""]: !!split.class,
|
|
27
|
+
}}
|
|
28
|
+
>
|
|
29
|
+
<Show when={resolvedIcon()}>
|
|
30
|
+
<Icon name={resolvedIcon()!} />
|
|
31
|
+
</Show>
|
|
32
|
+
{props.children}
|
|
33
|
+
</Kobalte>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
[data-slot="checkbox-v2"] {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 6px;
|
|
5
|
+
cursor: default;
|
|
6
|
+
|
|
7
|
+
&:where([data-disabled]) {
|
|
8
|
+
cursor: not-allowed;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
[data-slot="checkbox-v2-error"] {
|
|
12
|
+
color: var(--v2-state-fg-danger);
|
|
13
|
+
font-size: 12px;
|
|
14
|
+
font-weight: var(--font-weight-regular);
|
|
15
|
+
line-height: var(--line-height-normal);
|
|
16
|
+
letter-spacing: var(--letter-spacing-normal);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
[data-slot="checkbox-v2-error"]:empty {
|
|
20
|
+
display: none;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
[data-slot="checkbox-v2-row"] {
|
|
25
|
+
position: relative;
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: row;
|
|
28
|
+
align-items: flex-start;
|
|
29
|
+
padding: 0px;
|
|
30
|
+
gap: 8px;
|
|
31
|
+
|
|
32
|
+
[data-slot="checkbox-v2-input"] {
|
|
33
|
+
position: absolute;
|
|
34
|
+
width: 1px;
|
|
35
|
+
height: 1px;
|
|
36
|
+
padding: 0;
|
|
37
|
+
margin: -1px;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
clip: rect(0, 0, 0, 0);
|
|
40
|
+
white-space: nowrap;
|
|
41
|
+
border-width: 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
[data-slot="checkbox-v2-control-stack"] {
|
|
45
|
+
position: relative;
|
|
46
|
+
width: 16px;
|
|
47
|
+
height: 20px;
|
|
48
|
+
flex: none;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
[data-slot="checkbox-v2-control"] {
|
|
52
|
+
box-sizing: border-box;
|
|
53
|
+
position: absolute;
|
|
54
|
+
width: 16px;
|
|
55
|
+
height: 16px;
|
|
56
|
+
flex: none;
|
|
57
|
+
flex-shrink: 0;
|
|
58
|
+
left: 0;
|
|
59
|
+
top: calc(50% - 16px / 2);
|
|
60
|
+
border-radius: 4px;
|
|
61
|
+
border: none;
|
|
62
|
+
box-shadow: inset 0 0 0 0.5px var(--v2-border-border-strong);
|
|
63
|
+
|
|
64
|
+
background:
|
|
65
|
+
linear-gradient(180deg, var(--v2-alpha-light-6) 0%, var(--v2-alpha-light-0) 100%), var(--v2-background-bg-base);
|
|
66
|
+
transition:
|
|
67
|
+
background 170ms ease-out,
|
|
68
|
+
opacity 170ms ease-out,
|
|
69
|
+
outline-color 170ms ease-out;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
[data-slot="checkbox-v2-indicator"] {
|
|
73
|
+
position: absolute;
|
|
74
|
+
inset: 0;
|
|
75
|
+
width: 16px;
|
|
76
|
+
height: 16px;
|
|
77
|
+
pointer-events: none;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
[data-slot="checkbox-v2-text"] {
|
|
81
|
+
display: flex;
|
|
82
|
+
flex-direction: column;
|
|
83
|
+
justify-content: center;
|
|
84
|
+
align-items: flex-start;
|
|
85
|
+
padding: 0px;
|
|
86
|
+
gap: 6px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
[data-slot="checkbox-v2-label"] {
|
|
90
|
+
display: inline-flex;
|
|
91
|
+
user-select: none;
|
|
92
|
+
color: inherit;
|
|
93
|
+
font-style: normal;
|
|
94
|
+
font-weight: 440;
|
|
95
|
+
font-variant-numeric: tabular-nums;
|
|
96
|
+
font-variation-settings: "slnt" 0;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
[data-slot="checkbox-v2-label-text"] {
|
|
100
|
+
display: inline-flex;
|
|
101
|
+
align-items: center;
|
|
102
|
+
user-select: none;
|
|
103
|
+
color: var(--v2-text-text-base);
|
|
104
|
+
font-size: 13px;
|
|
105
|
+
line-height: 20px;
|
|
106
|
+
letter-spacing: -0.04px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
[data-slot="checkbox-v2-description"] {
|
|
110
|
+
color: var(--v2-text-text-muted);
|
|
111
|
+
font-size: 11px;
|
|
112
|
+
font-weight: 440;
|
|
113
|
+
line-height: 1;
|
|
114
|
+
letter-spacing: 0.05px;
|
|
115
|
+
font-variant-numeric: tabular-nums;
|
|
116
|
+
user-select: none;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
[data-slot="checkbox-v2"]:where(:not([data-readonly]))
|
|
121
|
+
[data-slot="checkbox-v2-input"]:focus-visible
|
|
122
|
+
~ [data-slot="checkbox-v2-control-stack"]
|
|
123
|
+
[data-slot="checkbox-v2-control"] {
|
|
124
|
+
outline: 2px solid var(--v2-border-border-focus);
|
|
125
|
+
outline-offset: 1px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
[data-slot="checkbox-v2"]:where(:hover):where(:not([data-disabled], [data-readonly], [data-invalid])):where(
|
|
129
|
+
:not([data-checked], [data-indeterminate])
|
|
130
|
+
)
|
|
131
|
+
[data-slot="checkbox-v2-control"] {
|
|
132
|
+
background:
|
|
133
|
+
linear-gradient(0deg, var(--v2-overlay-simple-overlay-hover), var(--v2-overlay-simple-overlay-hover)),
|
|
134
|
+
linear-gradient(180deg, var(--v2-alpha-light-6) 0%, var(--v2-alpha-light-0) 100%), var(--v2-background-bg-base);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
[data-slot="checkbox-v2"]:where([data-disabled]) [data-slot="checkbox-v2-control"] {
|
|
138
|
+
opacity: 0.5;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
[data-slot="checkbox-v2"]:where([data-checked], [data-indeterminate]) [data-slot="checkbox-v2-control"] {
|
|
142
|
+
background:
|
|
143
|
+
linear-gradient(180deg, var(--v2-alpha-light-20) 0%, var(--v2-alpha-light-0) 100%), var(--v2-background-bg-accent);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
[data-slot="checkbox-v2"]:where([data-checked], [data-indeterminate]):where(:hover):where(
|
|
147
|
+
:not([data-disabled], [data-readonly])
|
|
148
|
+
)
|
|
149
|
+
[data-slot="checkbox-v2-control"] {
|
|
150
|
+
background:
|
|
151
|
+
linear-gradient(
|
|
152
|
+
0deg,
|
|
153
|
+
var(--v2-overlay-simple-overlay-contrast-hover),
|
|
154
|
+
var(--v2-overlay-simple-overlay-contrast-hover)
|
|
155
|
+
),
|
|
156
|
+
linear-gradient(180deg, var(--v2-alpha-light-20) 0%, var(--v2-alpha-light-0) 100%), var(--v2-background-bg-accent);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
[data-slot="checkbox-v2"]:where([data-invalid]):where(:not([data-checked], [data-indeterminate]))
|
|
160
|
+
[data-slot="checkbox-v2-control"] {
|
|
161
|
+
background: var(--v2-state-bg-danger);
|
|
162
|
+
box-shadow: inset 0 0 0 0.5px var(--v2-state-border-danger);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
[data-slot="checkbox-v2"] .checkbox-v2-icon {
|
|
166
|
+
position: absolute;
|
|
167
|
+
left: 50%;
|
|
168
|
+
top: 50%;
|
|
169
|
+
transform: translate(-50%, -50%);
|
|
170
|
+
display: none;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
[data-slot="checkbox-v2"]:where([data-checked]):where(:not([data-indeterminate])) .checkbox-v2-icon--check {
|
|
174
|
+
display: block;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
[data-slot="checkbox-v2"]:where([data-indeterminate]) .checkbox-v2-icon--minus {
|
|
178
|
+
display: block;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
[data-slot="checkbox-v2"]:where([data-disabled]) [data-slot="checkbox-v2-label"],
|
|
182
|
+
[data-slot="checkbox-v2"]:where([data-disabled]) [data-slot="checkbox-v2-description"] {
|
|
183
|
+
opacity: 0.5;
|
|
184
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Checkbox as Kobalte } from "@kobalte/core/checkbox"
|
|
2
|
+
import { Show, splitProps, type JSX } from "solid-js"
|
|
3
|
+
import type { ComponentProps } from "solid-js"
|
|
4
|
+
import "./checkbox-v2.css"
|
|
5
|
+
|
|
6
|
+
export interface CheckboxV2Props extends ComponentProps<typeof Kobalte> {
|
|
7
|
+
label: JSX.Element
|
|
8
|
+
description?: JSX.Element
|
|
9
|
+
hideLabel?: boolean
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function CheckboxV2(props: CheckboxV2Props) {
|
|
13
|
+
const [local, others] = splitProps(props, ["class", "classList", "label", "description", "hideLabel"])
|
|
14
|
+
return (
|
|
15
|
+
<Kobalte
|
|
16
|
+
{...others}
|
|
17
|
+
data-slot="checkbox-v2"
|
|
18
|
+
classList={{
|
|
19
|
+
...local.classList,
|
|
20
|
+
[local.class ?? ""]: !!local.class,
|
|
21
|
+
}}
|
|
22
|
+
>
|
|
23
|
+
<div data-slot="checkbox-v2-row">
|
|
24
|
+
<Kobalte.Input data-slot="checkbox-v2-input" />
|
|
25
|
+
<div data-slot="checkbox-v2-control-stack">
|
|
26
|
+
<Kobalte.Control data-slot="checkbox-v2-control">
|
|
27
|
+
<Kobalte.Indicator data-slot="checkbox-v2-indicator">
|
|
28
|
+
<svg
|
|
29
|
+
class="checkbox-v2-icon checkbox-v2-icon--check"
|
|
30
|
+
width="16"
|
|
31
|
+
height="16"
|
|
32
|
+
viewBox="0 0 16 16"
|
|
33
|
+
fill="none"
|
|
34
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
35
|
+
aria-hidden="true"
|
|
36
|
+
>
|
|
37
|
+
<path d="M3.53564 8.17857L6.39279 11.75L12.4642 4.25" stroke="#FAFAFA" stroke-width="1" />
|
|
38
|
+
</svg>
|
|
39
|
+
<svg
|
|
40
|
+
class="checkbox-v2-icon checkbox-v2-icon--minus"
|
|
41
|
+
width="16"
|
|
42
|
+
height="16"
|
|
43
|
+
viewBox="0 0 16 16"
|
|
44
|
+
fill="none"
|
|
45
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
46
|
+
aria-hidden="true"
|
|
47
|
+
>
|
|
48
|
+
<path d="M12.75 8H3.25" stroke="#FAFAFA" stroke-linejoin="round" stroke-width="1" />
|
|
49
|
+
</svg>
|
|
50
|
+
</Kobalte.Indicator>
|
|
51
|
+
</Kobalte.Control>
|
|
52
|
+
</div>
|
|
53
|
+
<Kobalte.Label data-slot="checkbox-v2-label" classList={{ "sr-only": local.hideLabel }}>
|
|
54
|
+
<div data-slot="checkbox-v2-text">
|
|
55
|
+
<span data-slot="checkbox-v2-label-text">{local.label}</span>
|
|
56
|
+
<Show when={local.description}>
|
|
57
|
+
{(description) => <span data-slot="checkbox-v2-description">{description()}</span>}
|
|
58
|
+
</Show>
|
|
59
|
+
</div>
|
|
60
|
+
</Kobalte.Label>
|
|
61
|
+
</div>
|
|
62
|
+
<Kobalte.ErrorMessage data-slot="checkbox-v2-error" />
|
|
63
|
+
</Kobalte>
|
|
64
|
+
)
|
|
65
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Dialog as Kobalte } from "@kobalte/core/dialog"
|
|
2
2
|
import { type ComponentProps, type JSXElement, type ParentProps, Show, children, splitProps } from "solid-js"
|
|
3
3
|
import { useI18n } from "../../context/i18n"
|
|
4
|
-
import "./dialog.css"
|
|
4
|
+
import "./dialog-v2.css"
|
|
5
5
|
|
|
6
6
|
export interface DialogProps extends ParentProps {
|
|
7
7
|
size?: "normal" | "large" | "x-large"
|
|
@@ -36,7 +36,7 @@ export function DialogBody(props: ParentProps & { class?: ComponentProps<"div">[
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
export function DialogTitle(props: ParentProps) {
|
|
39
|
-
return <Title data-slot="dialog-header-title">{props.children}</Title>
|
|
39
|
+
return <Kobalte.Title data-slot="dialog-header-title">{props.children}</Kobalte.Title>
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
export function DialogTitleGroup(props: DialogTitleGroupProps) {
|
|
@@ -45,8 +45,8 @@ export function DialogTitleGroup(props: DialogTitleGroupProps) {
|
|
|
45
45
|
|
|
46
46
|
return (
|
|
47
47
|
<div data-slot="dialog-title-group">
|
|
48
|
-
<Show when={title()}>{(t) => <Title data-slot="dialog-title">{t()}</Title>}</Show>
|
|
49
|
-
<Description data-slot="dialog-description">{description()}</Description>
|
|
48
|
+
<Show when={title()}>{(t) => <Kobalte.Title data-slot="dialog-title">{t()}</Kobalte.Title>}</Show>
|
|
49
|
+
<Kobalte.Description data-slot="dialog-description">{description()}</Kobalte.Description>
|
|
50
50
|
</div>
|
|
51
51
|
)
|
|
52
52
|
}
|
|
@@ -59,8 +59,8 @@ export function DialogHeader(props: DialogHeaderProps) {
|
|
|
59
59
|
return (
|
|
60
60
|
<div data-slot="dialog-header" data-hide-close={hideClose() ? "" : undefined}>
|
|
61
61
|
{local.children}
|
|
62
|
-
|
|
63
|
-
<CloseButton data-slot="dialog-close-button" aria-label={local.closeLabel ?? i18n.t("ui.common.close")}>
|
|
62
|
+
{!hideClose() && (
|
|
63
|
+
<Kobalte.CloseButton data-slot="dialog-close-button" aria-label={local.closeLabel ?? i18n.t("ui.common.close")}>
|
|
64
64
|
<svg
|
|
65
65
|
width="16"
|
|
66
66
|
height="16"
|
|
@@ -75,8 +75,8 @@ export function DialogHeader(props: DialogHeaderProps) {
|
|
|
75
75
|
stroke-linejoin="round"
|
|
76
76
|
/>
|
|
77
77
|
</svg>
|
|
78
|
-
</CloseButton>
|
|
79
|
-
|
|
78
|
+
</Kobalte.CloseButton>
|
|
79
|
+
)}
|
|
80
80
|
</div>
|
|
81
81
|
)
|
|
82
82
|
}
|
|
@@ -92,7 +92,7 @@ export function Dialog(props: DialogProps) {
|
|
|
92
92
|
data-size={local.size || "normal"}
|
|
93
93
|
>
|
|
94
94
|
<div data-slot="dialog-container" class={local.containerClass}>
|
|
95
|
-
<Content
|
|
95
|
+
<Kobalte.Content
|
|
96
96
|
data-slot="dialog-content"
|
|
97
97
|
classList={{
|
|
98
98
|
...local.classList,
|
|
@@ -108,8 +108,10 @@ export function Dialog(props: DialogProps) {
|
|
|
108
108
|
}}
|
|
109
109
|
>
|
|
110
110
|
{local.children}
|
|
111
|
-
</Content>
|
|
111
|
+
</Kobalte.Content>
|
|
112
112
|
</div>
|
|
113
113
|
</div>
|
|
114
114
|
)
|
|
115
115
|
}
|
|
116
|
+
|
|
117
|
+
export const DialogV2 = Dialog
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
[data-component="diff-changes"] {
|
|
2
|
+
display: flex;
|
|
3
|
+
direction: ltr;
|
|
4
|
+
unicode-bidi: isolate;
|
|
5
|
+
gap: 8px;
|
|
6
|
+
justify-content: flex-end;
|
|
7
|
+
align-items: center;
|
|
8
|
+
|
|
9
|
+
[data-slot="diff-changes-additions"],
|
|
10
|
+
[data-slot="diff-changes-deletions"] {
|
|
11
|
+
font-size: 11px;
|
|
12
|
+
font-style: normal;
|
|
13
|
+
font-weight: 440;
|
|
14
|
+
line-height: 1;
|
|
15
|
+
letter-spacing: 0.05px;
|
|
16
|
+
text-align: right;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
[data-slot="diff-changes-additions"] {
|
|
20
|
+
color: var(--v2-state-fg-success);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
[data-slot="diff-changes-deletions"] {
|
|
24
|
+
color: var(--v2-state-fg-danger);
|
|
25
|
+
}
|
|
26
|
+
}
|
package/src/{data-display/diff-changes/diff-changes.tsx → v2/components/diff-changes-v2.tsx}
RENAMED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { createMemo, Show } from "solid-js"
|
|
2
|
-
import "./diff-changes.css"
|
|
2
|
+
import "./diff-changes-v2.css"
|
|
3
3
|
|
|
4
4
|
export function DiffChanges(props: {
|
|
5
5
|
class?: string
|
|
6
|
-
appearance?: "standard" | "compact"
|
|
7
6
|
changes: { additions: number; deletions: number } | { additions: number; deletions: number }[]
|
|
8
7
|
}) {
|
|
9
8
|
const additions = createMemo(() =>
|
|
@@ -20,11 +19,7 @@ export function DiffChanges(props: {
|
|
|
20
19
|
|
|
21
20
|
return (
|
|
22
21
|
<Show when={total() > 0}>
|
|
23
|
-
<div
|
|
24
|
-
data-component="diff-changes"
|
|
25
|
-
data-appearance={props.appearance ?? "compact"}
|
|
26
|
-
classList={{ [props.class ?? ""]: true }}
|
|
27
|
-
>
|
|
22
|
+
<div data-component="diff-changes" classList={{ [props.class ?? ""]: true }}>
|
|
28
23
|
<span data-slot="diff-changes-additions">{`+${additions()}`}</span>
|
|
29
24
|
<span data-slot="diff-changes-deletions">{`-${deletions()}`}</span>
|
|
30
25
|
</div>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type ComponentProps, splitProps } from "solid-js"
|
|
2
|
-
import "./divider.css"
|
|
2
|
+
import "./divider-v2.css"
|
|
3
3
|
|
|
4
|
-
export interface
|
|
4
|
+
export interface DividerV2Props extends ComponentProps<"div"> {}
|
|
5
5
|
|
|
6
|
-
export function
|
|
6
|
+
export function DividerV2(props: DividerV2Props) {
|
|
7
7
|
const [local, rest] = splitProps(props, ["class", "classList"])
|
|
8
8
|
return (
|
|
9
9
|
<div
|
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
type ComponentProps,
|
|
12
12
|
type ParentProps,
|
|
13
13
|
} from "solid-js"
|
|
14
|
-
import {
|
|
15
|
-
import "./field.css"
|
|
14
|
+
import { TooltipV2 } from "./tooltip-v2"
|
|
15
|
+
import "./field-v2.css"
|
|
16
16
|
|
|
17
17
|
type FieldContextValue = {
|
|
18
18
|
controlId: string
|
|
@@ -40,14 +40,14 @@ function useField() {
|
|
|
40
40
|
const CONTROL_SELECTOR = [
|
|
41
41
|
"[data-slot='text-input-v2-input']",
|
|
42
42
|
"[data-slot='textarea-v2-textarea']",
|
|
43
|
-
"[data-
|
|
43
|
+
"[data-slot='inline-input-v2-input']",
|
|
44
44
|
].join(", ")
|
|
45
45
|
|
|
46
|
-
export interface
|
|
46
|
+
export interface FieldV2Props extends ComponentProps<"div"> {
|
|
47
47
|
invalid?: boolean
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
function
|
|
50
|
+
function FieldV2Root(props: ParentProps<FieldV2Props>) {
|
|
51
51
|
const [local, rest] = splitProps(props, ["invalid", "class", "classList", "children"])
|
|
52
52
|
|
|
53
53
|
const controlId = `field-control-${createUniqueId()}`
|
|
@@ -86,7 +86,7 @@ function FieldRoot(props: ParentProps<FieldProps>) {
|
|
|
86
86
|
if (!control) return
|
|
87
87
|
|
|
88
88
|
const shell = control.closest(
|
|
89
|
-
"[data-component='text-input-v2'], [data-component='textarea-v2'], [data-component='inline-input']",
|
|
89
|
+
"[data-component='text-input-v2'], [data-component='textarea-v2'], [data-component='inline-input-v2']",
|
|
90
90
|
) as HTMLElement | null
|
|
91
91
|
|
|
92
92
|
control.id = controlId
|
|
@@ -173,7 +173,7 @@ function FieldLabel(props: ParentProps<FieldLabelProps>) {
|
|
|
173
173
|
<span data-slot="field-v2-label-text">{local.children}</span>
|
|
174
174
|
<Show when={local.tooltip}>
|
|
175
175
|
{(tooltip) => (
|
|
176
|
-
<
|
|
176
|
+
<TooltipV2 value={tooltip()}>
|
|
177
177
|
<button
|
|
178
178
|
type="button"
|
|
179
179
|
data-slot="field-v2-label-info"
|
|
@@ -182,7 +182,7 @@ function FieldLabel(props: ParentProps<FieldLabelProps>) {
|
|
|
182
182
|
>
|
|
183
183
|
<FieldLabelInfoIcon />
|
|
184
184
|
</button>
|
|
185
|
-
</
|
|
185
|
+
</TooltipV2>
|
|
186
186
|
)}
|
|
187
187
|
</Show>
|
|
188
188
|
</label>
|
|
@@ -255,9 +255,11 @@ function FieldControl(props: ParentProps<ComponentProps<"div">>) {
|
|
|
255
255
|
)
|
|
256
256
|
}
|
|
257
257
|
|
|
258
|
-
export const
|
|
258
|
+
export const FieldV2 = Object.assign(FieldV2Root, {
|
|
259
259
|
Label: FieldLabel,
|
|
260
260
|
Prefix: FieldPrefix,
|
|
261
261
|
Suffix: FieldSuffix,
|
|
262
262
|
Control: FieldControl,
|
|
263
263
|
})
|
|
264
|
+
|
|
265
|
+
export const Field = FieldV2
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Button as Kobalte } from "@kobalte/core/button"
|
|
2
|
+
import { type ComponentProps, splitProps } from "solid-js"
|
|
3
|
+
import { JSX } from "solid-js"
|
|
4
|
+
import "./icon-button-v2.css"
|
|
5
|
+
|
|
6
|
+
export interface IconButtonV2Props
|
|
7
|
+
extends ComponentProps<typeof Kobalte>,
|
|
8
|
+
Pick<ComponentProps<"button">, "class" | "classList"> {
|
|
9
|
+
// temporary
|
|
10
|
+
icon?: JSX.Element
|
|
11
|
+
// icon: IconProps["name"]
|
|
12
|
+
size?: "small" | "normal" | "large"
|
|
13
|
+
// iconSize?: IconProps["size"]
|
|
14
|
+
variant?: "neutral" | "contrast" | "ghost" | "ghost-muted"
|
|
15
|
+
state?: "rest" | "hover" | "pressed"
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function IconButtonV2(props: ComponentProps<"button"> & IconButtonV2Props) {
|
|
19
|
+
const [split, rest] = splitProps(props, ["variant", "size", "iconSize", "class", "classList", "state"])
|
|
20
|
+
return (
|
|
21
|
+
<Kobalte
|
|
22
|
+
{...rest}
|
|
23
|
+
data-component="icon-button-v2"
|
|
24
|
+
// data-icon={props.icon}
|
|
25
|
+
data-size={split.size || "normal"}
|
|
26
|
+
data-variant={split.variant || "neutral"}
|
|
27
|
+
data-state={split.state}
|
|
28
|
+
classList={{
|
|
29
|
+
...split.classList,
|
|
30
|
+
[split.class ?? ""]: !!split.class,
|
|
31
|
+
}}
|
|
32
|
+
>
|
|
33
|
+
{props.icon}
|
|
34
|
+
{/*<Icon name={props.icon} size={split.iconSize ?? (split.size === "large" ? "normal" : "small")} />*/}
|
|
35
|
+
</Kobalte>
|
|
36
|
+
)
|
|
37
|
+
}
|