@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,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Accordion as Kobalte } from "@kobalte/core/accordion"
|
|
2
2
|
import { splitProps } from "solid-js"
|
|
3
3
|
import type { ComponentProps, ParentProps } from "solid-js"
|
|
4
4
|
|
|
5
|
-
export interface AccordionProps extends ComponentProps<typeof
|
|
6
|
-
export interface AccordionItemProps extends ComponentProps<typeof Item> {}
|
|
7
|
-
export interface AccordionHeaderProps extends ComponentProps<typeof Header> {}
|
|
8
|
-
export interface AccordionTriggerProps extends ComponentProps<typeof Trigger> {}
|
|
9
|
-
export interface AccordionContentProps extends ComponentProps<typeof Content> {}
|
|
5
|
+
export interface AccordionProps extends ComponentProps<typeof Kobalte> {}
|
|
6
|
+
export interface AccordionItemProps extends ComponentProps<typeof Kobalte.Item> {}
|
|
7
|
+
export interface AccordionHeaderProps extends ComponentProps<typeof Kobalte.Header> {}
|
|
8
|
+
export interface AccordionTriggerProps extends ComponentProps<typeof Kobalte.Trigger> {}
|
|
9
|
+
export interface AccordionContentProps extends ComponentProps<typeof Kobalte.Content> {}
|
|
10
10
|
|
|
11
11
|
function AccordionRoot(props: AccordionProps) {
|
|
12
12
|
const [split, rest] = splitProps(props, ["class", "classList"])
|
|
13
13
|
return (
|
|
14
|
-
<
|
|
14
|
+
<Kobalte
|
|
15
15
|
{...rest}
|
|
16
16
|
data-component="accordion"
|
|
17
17
|
classList={{
|
|
@@ -25,7 +25,7 @@ function AccordionRoot(props: AccordionProps) {
|
|
|
25
25
|
function AccordionItem(props: AccordionItemProps) {
|
|
26
26
|
const [split, rest] = splitProps(props, ["class", "classList"])
|
|
27
27
|
return (
|
|
28
|
-
<Item
|
|
28
|
+
<Kobalte.Item
|
|
29
29
|
{...rest}
|
|
30
30
|
data-slot="accordion-item"
|
|
31
31
|
classList={{
|
|
@@ -39,7 +39,7 @@ function AccordionItem(props: AccordionItemProps) {
|
|
|
39
39
|
function AccordionHeader(props: ParentProps<AccordionHeaderProps>) {
|
|
40
40
|
const [split, rest] = splitProps(props, ["class", "classList", "children"])
|
|
41
41
|
return (
|
|
42
|
-
<Header
|
|
42
|
+
<Kobalte.Header
|
|
43
43
|
{...rest}
|
|
44
44
|
data-slot="accordion-header"
|
|
45
45
|
classList={{
|
|
@@ -48,14 +48,14 @@ function AccordionHeader(props: ParentProps<AccordionHeaderProps>) {
|
|
|
48
48
|
}}
|
|
49
49
|
>
|
|
50
50
|
{split.children}
|
|
51
|
-
</Header>
|
|
51
|
+
</Kobalte.Header>
|
|
52
52
|
)
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
function AccordionTrigger(props: ParentProps<AccordionTriggerProps>) {
|
|
56
56
|
const [split, rest] = splitProps(props, ["class", "classList", "children"])
|
|
57
57
|
return (
|
|
58
|
-
<Trigger
|
|
58
|
+
<Kobalte.Trigger
|
|
59
59
|
{...rest}
|
|
60
60
|
data-slot="accordion-trigger"
|
|
61
61
|
classList={{
|
|
@@ -64,14 +64,14 @@ function AccordionTrigger(props: ParentProps<AccordionTriggerProps>) {
|
|
|
64
64
|
}}
|
|
65
65
|
>
|
|
66
66
|
{split.children}
|
|
67
|
-
</Trigger>
|
|
67
|
+
</Kobalte.Trigger>
|
|
68
68
|
)
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
function AccordionContent(props: ParentProps<AccordionContentProps>) {
|
|
72
72
|
const [split, rest] = splitProps(props, ["class", "classList", "children"])
|
|
73
73
|
return (
|
|
74
|
-
<Content
|
|
74
|
+
<Kobalte.Content
|
|
75
75
|
{...rest}
|
|
76
76
|
data-slot="accordion-content"
|
|
77
77
|
classList={{
|
|
@@ -80,7 +80,7 @@ function AccordionContent(props: ParentProps<AccordionContentProps>) {
|
|
|
80
80
|
}}
|
|
81
81
|
>
|
|
82
82
|
{split.children}
|
|
83
|
-
</Content>
|
|
83
|
+
</Kobalte.Content>
|
|
84
84
|
)
|
|
85
85
|
}
|
|
86
86
|
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
[data-slot="animated-number-digit"] {
|
|
20
|
-
display: inline-
|
|
20
|
+
display: inline-block;
|
|
21
21
|
width: 1ch;
|
|
22
22
|
height: 1em;
|
|
23
23
|
line-height: 1em;
|
|
@@ -41,12 +41,19 @@
|
|
|
41
41
|
mask-repeat: no-repeat;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
[data-slot="animated-number-static"],
|
|
45
44
|
[data-slot="animated-number-strip"] {
|
|
46
|
-
|
|
45
|
+
display: inline-flex;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
transform: translateY(calc(var(--animated-number-offset, 10) * -1em));
|
|
48
|
+
transition-property: transform;
|
|
49
|
+
transition-duration: var(--animated-number-duration, 560ms);
|
|
50
|
+
transition-timing-function: var(--tool-motion-ease, cubic-bezier(0.22, 1, 0.36, 1));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
[data-slot="animated-number-strip"][data-animating="false"] {
|
|
54
|
+
transition-duration: 0ms;
|
|
47
55
|
}
|
|
48
56
|
|
|
49
|
-
[data-slot="animated-number-static"],
|
|
50
57
|
[data-slot="animated-number-cell"] {
|
|
51
58
|
display: inline-flex;
|
|
52
59
|
align-items: center;
|
|
@@ -55,24 +62,6 @@
|
|
|
55
62
|
height: 1em;
|
|
56
63
|
line-height: 1em;
|
|
57
64
|
}
|
|
58
|
-
|
|
59
|
-
[data-slot="animated-number-digit"][data-animating="true"] [data-slot="animated-number-static"] {
|
|
60
|
-
visibility: hidden;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
[data-slot="animated-number-strip"] {
|
|
64
|
-
display: inline-flex;
|
|
65
|
-
flex-direction: column;
|
|
66
|
-
margin-top: calc(var(--animated-number-offset, 10) * -1em);
|
|
67
|
-
transition-property: margin-top;
|
|
68
|
-
transition-duration: var(--animated-number-duration, 560ms);
|
|
69
|
-
transition-timing-function: var(--tool-motion-ease, cubic-bezier(0.22, 1, 0.36, 1));
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
[data-slot="animated-number-digit"][data-animating="false"] [data-slot="animated-number-strip"] {
|
|
73
|
-
transition-duration: 0ms;
|
|
74
|
-
visibility: hidden;
|
|
75
|
-
}
|
|
76
65
|
}
|
|
77
66
|
|
|
78
67
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -82,12 +71,5 @@
|
|
|
82
71
|
|
|
83
72
|
[data-component="animated-number"] [data-slot="animated-number-strip"] {
|
|
84
73
|
transition-duration: 0ms;
|
|
85
|
-
visibility: hidden;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
[data-component="animated-number"]
|
|
89
|
-
[data-slot="animated-number-digit"][data-animating]
|
|
90
|
-
[data-slot="animated-number-static"] {
|
|
91
|
-
visibility: visible;
|
|
92
74
|
}
|
|
93
75
|
}
|
|
@@ -43,10 +43,10 @@ function Digit(props: { value: number; direction: 1 | -1 }) {
|
|
|
43
43
|
)
|
|
44
44
|
|
|
45
45
|
return (
|
|
46
|
-
<span data-slot="animated-number-digit"
|
|
47
|
-
<span data-slot="animated-number-static">{props.value}</span>
|
|
46
|
+
<span data-slot="animated-number-digit">
|
|
48
47
|
<span
|
|
49
48
|
data-slot="animated-number-strip"
|
|
49
|
+
data-animating={animating() ? "true" : "false"}
|
|
50
50
|
onTransitionEnd={() => {
|
|
51
51
|
setState("animating", false)
|
|
52
52
|
setState("step", (value) => normalize(value) + 10)
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
[data-component="avatar"] {
|
|
2
|
+
--avatar-bg: var(--color-surface-info-base);
|
|
3
|
+
--avatar-fg: var(--color-text-base);
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
flex-shrink: 0;
|
|
8
|
+
border-radius: var(--radius-sm);
|
|
9
|
+
border: 1px solid var(--color-border-weak-base);
|
|
10
|
+
font-family: var(--font-mono);
|
|
11
|
+
font-weight: 500;
|
|
12
|
+
text-transform: uppercase;
|
|
13
|
+
background-color: var(--avatar-bg);
|
|
14
|
+
color: var(--avatar-fg);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
[data-component="avatar"][data-has-image] {
|
|
18
|
+
background-color: transparent;
|
|
19
|
+
border: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
[data-component="avatar"][data-size="small"] {
|
|
23
|
+
width: 1.25rem;
|
|
24
|
+
height: 1.25rem;
|
|
25
|
+
font-size: 0.75rem;
|
|
26
|
+
line-height: 1;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
[data-component="avatar"][data-size="normal"] {
|
|
30
|
+
width: 1.5rem;
|
|
31
|
+
height: 1.5rem;
|
|
32
|
+
font-size: 1.125rem;
|
|
33
|
+
line-height: 1.5rem;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
[data-component="avatar"][data-size="large"] {
|
|
37
|
+
width: 2rem;
|
|
38
|
+
height: 2rem;
|
|
39
|
+
font-size: 1.25rem;
|
|
40
|
+
line-height: 2rem;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
[data-component="avatar"] [data-slot="avatar-image"] {
|
|
44
|
+
width: 100%;
|
|
45
|
+
height: 100%;
|
|
46
|
+
display: block;
|
|
47
|
+
object-fit: cover;
|
|
48
|
+
border-radius: inherit;
|
|
49
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type ComponentProps, splitProps, Show } from "solid-js"
|
|
2
|
+
|
|
3
|
+
const segmenter =
|
|
4
|
+
typeof Intl !== "undefined" && "Segmenter" in Intl
|
|
5
|
+
? new Intl.Segmenter(undefined, { granularity: "grapheme" })
|
|
6
|
+
: undefined
|
|
7
|
+
|
|
8
|
+
function first(value: string) {
|
|
9
|
+
if (!value) return ""
|
|
10
|
+
if (!segmenter) return Array.from(value)[0] ?? ""
|
|
11
|
+
return segmenter.segment(value)[Symbol.iterator]().next().value?.segment ?? Array.from(value)[0] ?? ""
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface AvatarProps extends ComponentProps<"div"> {
|
|
15
|
+
fallback: string
|
|
16
|
+
src?: string
|
|
17
|
+
background?: string
|
|
18
|
+
foreground?: string
|
|
19
|
+
size?: "small" | "normal" | "large"
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function Avatar(props: AvatarProps) {
|
|
23
|
+
const [split, rest] = splitProps(props, [
|
|
24
|
+
"fallback",
|
|
25
|
+
"src",
|
|
26
|
+
"background",
|
|
27
|
+
"foreground",
|
|
28
|
+
"size",
|
|
29
|
+
"class",
|
|
30
|
+
"classList",
|
|
31
|
+
"style",
|
|
32
|
+
])
|
|
33
|
+
const src = split.src // did this so i can zero it out to test fallback
|
|
34
|
+
return (
|
|
35
|
+
<div
|
|
36
|
+
{...rest}
|
|
37
|
+
data-component="avatar"
|
|
38
|
+
data-size={split.size || "normal"}
|
|
39
|
+
data-has-image={src ? "" : undefined}
|
|
40
|
+
classList={{
|
|
41
|
+
...split.classList,
|
|
42
|
+
[split.class ?? ""]: !!split.class,
|
|
43
|
+
}}
|
|
44
|
+
style={{
|
|
45
|
+
...(typeof split.style === "object" ? split.style : {}),
|
|
46
|
+
...(!src && split.background ? { "--avatar-bg": split.background } : {}),
|
|
47
|
+
...(!src && split.foreground ? { "--avatar-fg": split.foreground } : {}),
|
|
48
|
+
}}
|
|
49
|
+
>
|
|
50
|
+
<Show when={src} fallback={first(split.fallback)}>
|
|
51
|
+
{(src) => <img src={src()} draggable={false} data-slot="avatar-image" />}
|
|
52
|
+
</Show>
|
|
53
|
+
</div>
|
|
54
|
+
)
|
|
55
|
+
}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
[data-component="button"] {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
border-style: solid;
|
|
6
|
+
border-width: 1px;
|
|
7
|
+
border-radius: var(--radius-md);
|
|
8
|
+
text-decoration: none;
|
|
9
|
+
user-select: none;
|
|
10
|
+
cursor: default;
|
|
11
|
+
outline: none;
|
|
12
|
+
white-space: nowrap;
|
|
13
|
+
|
|
14
|
+
&[data-variant="primary"] {
|
|
15
|
+
background-color: var(--button-primary-base);
|
|
16
|
+
border-color: var(--border-weak-base);
|
|
17
|
+
color: var(--icon-invert-base);
|
|
18
|
+
|
|
19
|
+
[data-slot="icon-svg"] {
|
|
20
|
+
color: var(--icon-invert-base);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&:hover:not(:disabled) {
|
|
24
|
+
background-color: var(--icon-strong-hover);
|
|
25
|
+
}
|
|
26
|
+
&:focus:not(:disabled) {
|
|
27
|
+
background-color: var(--icon-strong-focus);
|
|
28
|
+
}
|
|
29
|
+
&:active:not(:disabled) {
|
|
30
|
+
background-color: var(--icon-strong-active);
|
|
31
|
+
}
|
|
32
|
+
&:disabled {
|
|
33
|
+
background-color: var(--icon-strong-disabled);
|
|
34
|
+
|
|
35
|
+
[data-slot="icon-svg"] {
|
|
36
|
+
color: var(--icon-invert-base);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&[data-variant="ghost"] {
|
|
42
|
+
border-color: transparent;
|
|
43
|
+
background-color: transparent;
|
|
44
|
+
color: var(--text-strong);
|
|
45
|
+
|
|
46
|
+
[data-slot="icon-svg"] {
|
|
47
|
+
color: var(--icon-base);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&:hover:not(:disabled) {
|
|
51
|
+
background-color: var(--surface-base-hover);
|
|
52
|
+
}
|
|
53
|
+
&:focus-visible:not(:disabled) {
|
|
54
|
+
background-color: var(--surface-base-hover);
|
|
55
|
+
}
|
|
56
|
+
&:active:not(:disabled) {
|
|
57
|
+
background-color: var(--surface-base-active);
|
|
58
|
+
}
|
|
59
|
+
&:disabled {
|
|
60
|
+
color: var(--text-weak);
|
|
61
|
+
cursor: not-allowed;
|
|
62
|
+
|
|
63
|
+
[data-slot="icon-svg"] {
|
|
64
|
+
color: var(--icon-disabled);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
&[data-selected="true"]:not(:disabled) {
|
|
68
|
+
background-color: var(--surface-base-hover);
|
|
69
|
+
}
|
|
70
|
+
&[data-active="true"] {
|
|
71
|
+
background-color: var(--surface-base-active);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&[data-variant="secondary"] {
|
|
76
|
+
border: transparent;
|
|
77
|
+
background-color: var(--button-secondary-base);
|
|
78
|
+
color: var(--text-strong);
|
|
79
|
+
box-shadow: var(--shadow-xs-border-base);
|
|
80
|
+
|
|
81
|
+
&:hover:not(:disabled) {
|
|
82
|
+
background-color: var(--button-secondary-hover);
|
|
83
|
+
}
|
|
84
|
+
&:focus:not(:disabled) {
|
|
85
|
+
background-color: var(--button-secondary-base);
|
|
86
|
+
}
|
|
87
|
+
&:focus-visible:not(:active) {
|
|
88
|
+
background-color: var(--button-secondary-base);
|
|
89
|
+
box-shadow: var(--shadow-xs-border-focus);
|
|
90
|
+
}
|
|
91
|
+
&:focus-visible:active {
|
|
92
|
+
box-shadow: none;
|
|
93
|
+
}
|
|
94
|
+
&:active:not(:disabled) {
|
|
95
|
+
background-color: var(--button-secondary-base);
|
|
96
|
+
}
|
|
97
|
+
&:disabled {
|
|
98
|
+
border-color: var(--border-disabled);
|
|
99
|
+
background-color: var(--surface-disabled);
|
|
100
|
+
color: var(--text-weak);
|
|
101
|
+
cursor: not-allowed;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
[data-slot="icon-svg"] {
|
|
105
|
+
color: var(--icon-base);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&[data-size="small"] {
|
|
110
|
+
height: 24px;
|
|
111
|
+
padding: 0 8px;
|
|
112
|
+
&[data-icon] {
|
|
113
|
+
padding: 0 12px 0 4px;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
font-size: var(--font-size-small);
|
|
117
|
+
line-height: var(--line-height-large);
|
|
118
|
+
gap: 8px;
|
|
119
|
+
|
|
120
|
+
/* text-12-medium */
|
|
121
|
+
font-family: var(--font-family-sans);
|
|
122
|
+
font-size: var(--font-size-small);
|
|
123
|
+
font-style: normal;
|
|
124
|
+
font-weight: var(--font-weight-medium);
|
|
125
|
+
line-height: var(--line-height-large); /* 166.667% */
|
|
126
|
+
letter-spacing: var(--letter-spacing-normal);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
&[data-size="normal"] {
|
|
130
|
+
height: 28px;
|
|
131
|
+
line-height: 28px;
|
|
132
|
+
padding: 0 6px;
|
|
133
|
+
&[data-icon] {
|
|
134
|
+
padding: 0 12px 0 4px;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
font-size: var(--font-size-small);
|
|
138
|
+
gap: 8px;
|
|
139
|
+
|
|
140
|
+
/* text-12-medium */
|
|
141
|
+
font-family: var(--font-family-sans);
|
|
142
|
+
font-size: var(--font-size-small);
|
|
143
|
+
font-style: normal;
|
|
144
|
+
font-weight: var(--font-weight-medium);
|
|
145
|
+
letter-spacing: var(--letter-spacing-normal);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&[data-size="large"] {
|
|
149
|
+
height: 32px;
|
|
150
|
+
padding: 6px 12px;
|
|
151
|
+
|
|
152
|
+
&[data-icon] {
|
|
153
|
+
padding: 0 12px 0 8px;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
gap: 8px;
|
|
157
|
+
|
|
158
|
+
/* text-14-medium */
|
|
159
|
+
font-family: var(--font-family-sans);
|
|
160
|
+
font-size: 14px;
|
|
161
|
+
font-style: normal;
|
|
162
|
+
font-weight: var(--font-weight-medium);
|
|
163
|
+
line-height: var(--line-height-large); /* 142.857% */
|
|
164
|
+
letter-spacing: var(--letter-spacing-normal);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
&:focus {
|
|
168
|
+
outline: none;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
[data-component="button"].titlebar-icon[data-variant="ghost"][aria-expanded="true"] {
|
|
173
|
+
background-color: var(--surface-base-active);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
[data-component="button"].titlebar-icon[data-variant="ghost"][aria-expanded="true"] [data-slot="icon-svg"] {
|
|
177
|
+
color: var(--icon-strong-base);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
[data-component="button"].titlebar-icon[data-variant="ghost"][aria-expanded="true"]:hover:not(:disabled) {
|
|
181
|
+
background-color: var(--surface-base-active);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
[data-component="button"].titlebar-icon[data-variant="ghost"][aria-current="page"] {
|
|
185
|
+
background-color: var(--surface-base-active);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
[data-component="button"].titlebar-icon[data-variant="ghost"][aria-current="page"] [data-slot="icon-svg"] {
|
|
189
|
+
color: var(--icon-strong-base);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
[data-component="button"].titlebar-icon[data-variant="ghost"][aria-current="page"]:hover:not(:disabled) {
|
|
193
|
+
background-color: var(--surface-base-active);
|
|
194
|
+
}
|
|
@@ -1,41 +1,33 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Button as Kobalte } from "@kobalte/core/button"
|
|
2
2
|
import { type ComponentProps, Show, splitProps } from "solid-js"
|
|
3
|
-
import { Icon,
|
|
4
|
-
import "./button.css"
|
|
3
|
+
import { Icon, IconProps } from "./icon"
|
|
5
4
|
|
|
6
5
|
export interface ButtonProps
|
|
7
|
-
extends ComponentProps<typeof
|
|
6
|
+
extends ComponentProps<typeof Kobalte>,
|
|
8
7
|
Pick<ComponentProps<"button">, "class" | "classList" | "children"> {
|
|
9
8
|
size?: "small" | "normal" | "large"
|
|
10
|
-
variant?:
|
|
11
|
-
| "neutral"
|
|
12
|
-
| "danger"
|
|
13
|
-
| "warning"
|
|
14
|
-
| "outline"
|
|
15
|
-
| "contrast"
|
|
16
|
-
| "ghost"
|
|
17
|
-
| "ghost-muted"
|
|
18
|
-
| "ghost-faint"
|
|
19
|
-
| "loading"
|
|
9
|
+
variant?: "primary" | "secondary" | "ghost"
|
|
20
10
|
icon?: IconProps["name"]
|
|
21
11
|
}
|
|
22
12
|
|
|
23
13
|
export function Button(props: ButtonProps) {
|
|
24
14
|
const [split, rest] = splitProps(props, ["variant", "size", "icon", "class", "classList"])
|
|
25
15
|
return (
|
|
26
|
-
<
|
|
16
|
+
<Kobalte
|
|
27
17
|
{...rest}
|
|
28
|
-
data-component="button
|
|
18
|
+
data-component="button"
|
|
29
19
|
data-size={split.size || "normal"}
|
|
30
|
-
data-variant={split.variant || "
|
|
20
|
+
data-variant={split.variant || "secondary"}
|
|
31
21
|
data-icon={split.icon}
|
|
32
22
|
classList={{
|
|
33
23
|
...split.classList,
|
|
34
24
|
[split.class ?? ""]: !!split.class,
|
|
35
25
|
}}
|
|
36
26
|
>
|
|
37
|
-
<Show when={split.icon}>
|
|
27
|
+
<Show when={split.icon}>
|
|
28
|
+
<Icon name={split.icon!} size="small" />
|
|
29
|
+
</Show>
|
|
38
30
|
{props.children}
|
|
39
|
-
</
|
|
31
|
+
</Kobalte>
|
|
40
32
|
)
|
|
41
33
|
}
|
package/src/components/card.css
CHANGED
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
gap: var(--card-gap);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
:where([data-slot="card-title"]) [data-
|
|
61
|
+
:where([data-slot="card-title"]) [data-component="icon"] {
|
|
62
62
|
color: var(--card-accent);
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
flex: 0 0 auto;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
:where([data-slot="card-title-icon"][data-placeholder]) [data-
|
|
74
|
+
:where([data-slot="card-title-icon"][data-placeholder]) [data-component="icon"] {
|
|
75
75
|
color: var(--v2-text-text-faint);
|
|
76
76
|
}
|
|
77
77
|
|
|
@@ -92,3 +92,24 @@
|
|
|
92
92
|
padding-left: var(--card-indent);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
+
|
|
96
|
+
body:not([data-new-layout]) [data-component="card"] {
|
|
97
|
+
color: var(--text-strong);
|
|
98
|
+
--card-accent: var(--icon-active);
|
|
99
|
+
|
|
100
|
+
:where([data-card="title"], [data-slot="card-title"]) {
|
|
101
|
+
color: var(--text-strong);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
:where([data-slot="card-title-icon"][data-placeholder]) [data-component="icon"] {
|
|
105
|
+
color: var(--text-weak);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
:where([data-card="description"], [data-slot="card-description"]) {
|
|
109
|
+
color: var(--text-base);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&[data-variant="error"] {
|
|
113
|
+
--card-accent: var(--icon-critical-base) !important;
|
|
114
|
+
}
|
|
115
|
+
}
|
package/src/components/card.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type ComponentProps,
|
|
2
|
-
import { Icon, type IconProps } from "
|
|
1
|
+
import { type ComponentProps, splitProps } from "solid-js"
|
|
2
|
+
import { Icon, type IconProps } from "./icon"
|
|
3
3
|
|
|
4
4
|
type Variant = "normal" | "error" | "warning" | "success" | "info"
|
|
5
5
|
|
|
@@ -80,11 +80,11 @@ export function CardTitle(props: CardTitleProps) {
|
|
|
80
80
|
[split.class ?? ""]: !!split.class,
|
|
81
81
|
}}
|
|
82
82
|
>
|
|
83
|
-
|
|
83
|
+
{show() ? (
|
|
84
84
|
<span data-slot="card-title-icon" data-placeholder={placeholder() || undefined}>
|
|
85
85
|
<Icon name={name() ?? "dash"} size="small" />
|
|
86
86
|
</span>
|
|
87
|
-
|
|
87
|
+
) : null}
|
|
88
88
|
{split.children}
|
|
89
89
|
</div>
|
|
90
90
|
)
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
border-color 220ms var(--tool-motion-ease, cubic-bezier(0.22, 1, 0.36, 1)),
|
|
33
33
|
background-color 220ms var(--tool-motion-ease, cubic-bezier(0.22, 1, 0.36, 1)),
|
|
34
34
|
box-shadow 220ms var(--tool-motion-ease, cubic-bezier(0.22, 1, 0.36, 1));
|
|
35
|
+
/* background-color: var(--surface-weak); */
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
[data-slot="checkbox-checkbox-indicator"] {
|
|
@@ -48,14 +49,19 @@
|
|
|
48
49
|
transform 220ms var(--tool-motion-ease, cubic-bezier(0.22, 1, 0.36, 1));
|
|
49
50
|
}
|
|
50
51
|
|
|
52
|
+
/* [data-slot="checkbox-checkbox-content"] { */
|
|
53
|
+
/* } */
|
|
54
|
+
|
|
51
55
|
[data-slot="checkbox-checkbox-label"] {
|
|
52
56
|
user-select: none;
|
|
53
57
|
color: var(--text-base);
|
|
58
|
+
|
|
59
|
+
/* text-12-regular */
|
|
54
60
|
font-family: var(--font-family-sans);
|
|
55
61
|
font-size: var(--font-size-small);
|
|
56
62
|
font-style: normal;
|
|
57
63
|
font-weight: var(--font-weight-regular);
|
|
58
|
-
line-height: var(--line-height-large);
|
|
64
|
+
line-height: var(--line-height-large); /* 166.667% */
|
|
59
65
|
letter-spacing: var(--letter-spacing-normal);
|
|
60
66
|
}
|
|
61
67
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Checkbox as Kobalte } from "@kobalte/core/checkbox"
|
|
2
2
|
import { Show, splitProps } from "solid-js"
|
|
3
3
|
import type { ComponentProps, JSX, ParentProps } from "solid-js"
|
|
4
4
|
|
|
5
|
-
export interface CheckboxProps extends ParentProps<ComponentProps<typeof
|
|
5
|
+
export interface CheckboxProps extends ParentProps<ComponentProps<typeof Kobalte>> {
|
|
6
6
|
hideLabel?: boolean
|
|
7
7
|
description?: string
|
|
8
8
|
icon?: JSX.Element
|
|
@@ -11,10 +11,10 @@ export interface CheckboxProps extends ParentProps<ComponentProps<typeof Root>>
|
|
|
11
11
|
export function Checkbox(props: CheckboxProps) {
|
|
12
12
|
const [local, others] = splitProps(props, ["children", "class", "label", "hideLabel", "description", "icon"])
|
|
13
13
|
return (
|
|
14
|
-
<
|
|
15
|
-
<Input data-slot="checkbox-checkbox-input" />
|
|
16
|
-
<Control data-slot="checkbox-checkbox-control">
|
|
17
|
-
<Indicator data-slot="checkbox-checkbox-indicator">
|
|
14
|
+
<Kobalte {...others} data-component="checkbox">
|
|
15
|
+
<Kobalte.Input data-slot="checkbox-checkbox-input" />
|
|
16
|
+
<Kobalte.Control data-slot="checkbox-checkbox-control">
|
|
17
|
+
<Kobalte.Indicator data-slot="checkbox-checkbox-indicator">
|
|
18
18
|
{local.icon || (
|
|
19
19
|
<svg viewBox="0 0 12 12" fill="none" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
20
20
|
<path
|
|
@@ -25,19 +25,19 @@ export function Checkbox(props: CheckboxProps) {
|
|
|
25
25
|
/>
|
|
26
26
|
</svg>
|
|
27
27
|
)}
|
|
28
|
-
</Indicator>
|
|
29
|
-
</Control>
|
|
28
|
+
</Kobalte.Indicator>
|
|
29
|
+
</Kobalte.Control>
|
|
30
30
|
<div data-slot="checkbox-checkbox-content">
|
|
31
31
|
<Show when={props.children}>
|
|
32
|
-
<Label data-slot="checkbox-checkbox-label" classList={{ "sr-only": local.hideLabel }}>
|
|
32
|
+
<Kobalte.Label data-slot="checkbox-checkbox-label" classList={{ "sr-only": local.hideLabel }}>
|
|
33
33
|
{props.children}
|
|
34
|
-
</Label>
|
|
34
|
+
</Kobalte.Label>
|
|
35
35
|
</Show>
|
|
36
36
|
<Show when={local.description}>
|
|
37
|
-
<Description data-slot="checkbox-checkbox-description">{local.description}</Description>
|
|
37
|
+
<Kobalte.Description data-slot="checkbox-checkbox-description">{local.description}</Kobalte.Description>
|
|
38
38
|
</Show>
|
|
39
|
-
<ErrorMessage data-slot="checkbox-checkbox-error" />
|
|
39
|
+
<Kobalte.ErrorMessage data-slot="checkbox-checkbox-error" />
|
|
40
40
|
</div>
|
|
41
|
-
</
|
|
41
|
+
</Kobalte>
|
|
42
42
|
)
|
|
43
43
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Collapsible as Kobalte, CollapsibleRootProps } from "@kobalte/core/collapsible"
|
|
2
2
|
import { ComponentProps, ParentProps, splitProps } from "solid-js"
|
|
3
|
-
import { Icon } from "
|
|
3
|
+
import { Icon } from "./icon"
|
|
4
4
|
|
|
5
5
|
export interface CollapsibleProps extends ParentProps<CollapsibleRootProps> {
|
|
6
6
|
class?: string
|
|
@@ -35,7 +35,7 @@ function CollapsibleArrow(props?: ComponentProps<"div">) {
|
|
|
35
35
|
return (
|
|
36
36
|
<div data-slot="collapsible-arrow" {...(props || {})}>
|
|
37
37
|
<span data-slot="collapsible-arrow-icon">
|
|
38
|
-
<Icon name="
|
|
38
|
+
<Icon name="chevron-down" size="small" />
|
|
39
39
|
</span>
|
|
40
40
|
</div>
|
|
41
41
|
)
|