@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
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/* [data-component="dialog-trigger"] { } */
|
|
2
|
+
|
|
3
|
+
[data-component="dialog-overlay"] {
|
|
4
|
+
position: fixed;
|
|
5
|
+
inset: 0;
|
|
6
|
+
z-index: 50;
|
|
7
|
+
background-color: hsl(from var(--background-base) h s l / 0.2);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
[data-component="dialog"] {
|
|
11
|
+
position: fixed;
|
|
12
|
+
inset: 0;
|
|
13
|
+
z-index: 50;
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
pointer-events: none;
|
|
18
|
+
|
|
19
|
+
[data-slot="dialog-container"] {
|
|
20
|
+
position: relative;
|
|
21
|
+
z-index: 50;
|
|
22
|
+
width: min(calc(100vw - 16px), 640px);
|
|
23
|
+
height: min(calc(100vh - 16px), 512px);
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-items: start;
|
|
28
|
+
overflow: visible;
|
|
29
|
+
|
|
30
|
+
[data-slot="dialog-content"] {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
align-items: flex-start;
|
|
34
|
+
align-self: stretch;
|
|
35
|
+
width: 100%;
|
|
36
|
+
max-height: 100%;
|
|
37
|
+
min-height: 280px;
|
|
38
|
+
overflow: auto;
|
|
39
|
+
pointer-events: auto;
|
|
40
|
+
|
|
41
|
+
/* Hide scrollbar */
|
|
42
|
+
scrollbar-width: none;
|
|
43
|
+
-ms-overflow-style: none;
|
|
44
|
+
&::-webkit-scrollbar {
|
|
45
|
+
display: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* padding: 8px; */
|
|
49
|
+
/* padding: 8px 8px 0 8px; */
|
|
50
|
+
border-radius: var(--radius-xl);
|
|
51
|
+
background: var(--surface-raised-stronger-non-alpha);
|
|
52
|
+
background-clip: padding-box;
|
|
53
|
+
box-shadow: var(--shadow-lg-border-base);
|
|
54
|
+
|
|
55
|
+
[data-slot="dialog-header"] {
|
|
56
|
+
display: flex;
|
|
57
|
+
padding: 16px 20px;
|
|
58
|
+
justify-content: space-between;
|
|
59
|
+
align-items: center;
|
|
60
|
+
flex-shrink: 0;
|
|
61
|
+
align-self: stretch;
|
|
62
|
+
|
|
63
|
+
[data-slot="dialog-title"] {
|
|
64
|
+
color: var(--text-strong);
|
|
65
|
+
|
|
66
|
+
/* text-16-medium */
|
|
67
|
+
font-family: var(--font-family-sans);
|
|
68
|
+
font-size: var(--font-size-large);
|
|
69
|
+
font-style: normal;
|
|
70
|
+
font-weight: var(--font-weight-medium);
|
|
71
|
+
line-height: var(--line-height-x-large); /* 150% */
|
|
72
|
+
letter-spacing: var(--letter-spacing-tight);
|
|
73
|
+
}
|
|
74
|
+
/* [data-slot="dialog-close-button"] {} */
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
[data-slot="dialog-description"] {
|
|
78
|
+
display: flex;
|
|
79
|
+
padding: 16px;
|
|
80
|
+
padding-left: 24px;
|
|
81
|
+
padding-top: 0;
|
|
82
|
+
margin-top: -8px;
|
|
83
|
+
justify-content: space-between;
|
|
84
|
+
align-items: center;
|
|
85
|
+
flex-shrink: 0;
|
|
86
|
+
align-self: stretch;
|
|
87
|
+
|
|
88
|
+
color: var(--text-base);
|
|
89
|
+
|
|
90
|
+
/* text-14-regular */
|
|
91
|
+
font-family: var(--font-family-sans);
|
|
92
|
+
font-size: 14px;
|
|
93
|
+
font-style: normal;
|
|
94
|
+
font-weight: var(--font-weight-regular);
|
|
95
|
+
line-height: var(--line-height-large); /* 142.857% */
|
|
96
|
+
letter-spacing: var(--letter-spacing-normal);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
[data-slot="dialog-body"] {
|
|
100
|
+
width: 100%;
|
|
101
|
+
position: relative;
|
|
102
|
+
display: flex;
|
|
103
|
+
flex-direction: column;
|
|
104
|
+
flex: 1;
|
|
105
|
+
overflow: hidden;
|
|
106
|
+
|
|
107
|
+
&:focus-visible {
|
|
108
|
+
outline: none;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
&:focus-visible {
|
|
112
|
+
outline: none;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&[data-fit] {
|
|
118
|
+
[data-slot="dialog-container"] {
|
|
119
|
+
height: auto;
|
|
120
|
+
|
|
121
|
+
[data-slot="dialog-content"] {
|
|
122
|
+
min-height: 0;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&[data-size="large"] [data-slot="dialog-container"] {
|
|
128
|
+
width: min(calc(100vw - 32px), 800px);
|
|
129
|
+
height: min(calc(100vh - 32px), 600px);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&[data-size="x-large"] [data-slot="dialog-container"] {
|
|
133
|
+
width: min(calc(100vw - 32px), 980px);
|
|
134
|
+
height: min(calc(100vh - 92px), 600px);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
[data-component="dialog"][data-transition] [data-slot="dialog-content"] {
|
|
139
|
+
animation: contentHide 100ms ease-in forwards;
|
|
140
|
+
|
|
141
|
+
&[data-expanded] {
|
|
142
|
+
animation: contentShow 150ms ease-out;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@keyframes overlayShow {
|
|
147
|
+
from {
|
|
148
|
+
opacity: 0;
|
|
149
|
+
}
|
|
150
|
+
to {
|
|
151
|
+
opacity: 1;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
@keyframes overlayHide {
|
|
155
|
+
from {
|
|
156
|
+
opacity: 1;
|
|
157
|
+
}
|
|
158
|
+
to {
|
|
159
|
+
opacity: 0;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
@keyframes contentShow {
|
|
163
|
+
from {
|
|
164
|
+
opacity: 0;
|
|
165
|
+
transform: scale(0.98);
|
|
166
|
+
}
|
|
167
|
+
to {
|
|
168
|
+
opacity: 1;
|
|
169
|
+
transform: scale(1);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
@keyframes contentHide {
|
|
173
|
+
from {
|
|
174
|
+
opacity: 1;
|
|
175
|
+
transform: scale(1);
|
|
176
|
+
}
|
|
177
|
+
to {
|
|
178
|
+
opacity: 0;
|
|
179
|
+
transform: scale(0.98);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Dialog as Kobalte } from "@kobalte/core/dialog"
|
|
2
|
+
import { ComponentProps, JSXElement, Match, ParentProps, Show, Switch } from "solid-js"
|
|
3
|
+
import { useI18n } from "../context/i18n"
|
|
4
|
+
import { IconButton } from "./icon-button"
|
|
5
|
+
|
|
6
|
+
export interface DialogProps extends ParentProps {
|
|
7
|
+
title?: JSXElement
|
|
8
|
+
description?: JSXElement
|
|
9
|
+
action?: JSXElement
|
|
10
|
+
size?: "normal" | "large" | "x-large"
|
|
11
|
+
class?: ComponentProps<"div">["class"]
|
|
12
|
+
classList?: ComponentProps<"div">["classList"]
|
|
13
|
+
fit?: boolean
|
|
14
|
+
transition?: boolean
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function Dialog(props: DialogProps) {
|
|
18
|
+
const i18n = useI18n()
|
|
19
|
+
return (
|
|
20
|
+
<div
|
|
21
|
+
data-component="dialog"
|
|
22
|
+
data-fit={props.fit ? true : undefined}
|
|
23
|
+
data-size={props.size || "normal"}
|
|
24
|
+
data-transition={props.transition ? true : undefined}
|
|
25
|
+
>
|
|
26
|
+
<div data-slot="dialog-container">
|
|
27
|
+
<Kobalte.Content
|
|
28
|
+
data-slot="dialog-content"
|
|
29
|
+
data-no-header={!props.title && !props.action ? "" : undefined}
|
|
30
|
+
classList={{
|
|
31
|
+
...props.classList,
|
|
32
|
+
[props.class ?? ""]: !!props.class,
|
|
33
|
+
}}
|
|
34
|
+
onOpenAutoFocus={(e) => {
|
|
35
|
+
const target = e.currentTarget as HTMLElement | null
|
|
36
|
+
const autofocusEl = target?.querySelector("[autofocus]") as HTMLElement | null
|
|
37
|
+
if (autofocusEl) {
|
|
38
|
+
e.preventDefault()
|
|
39
|
+
autofocusEl.focus()
|
|
40
|
+
}
|
|
41
|
+
}}
|
|
42
|
+
>
|
|
43
|
+
<Show when={props.title || props.action}>
|
|
44
|
+
<div data-slot="dialog-header">
|
|
45
|
+
<Show when={props.title}>
|
|
46
|
+
<Kobalte.Title data-slot="dialog-title">{props.title}</Kobalte.Title>
|
|
47
|
+
</Show>
|
|
48
|
+
<Switch>
|
|
49
|
+
<Match when={props.action}>{props.action}</Match>
|
|
50
|
+
<Match when={true}>
|
|
51
|
+
<Kobalte.CloseButton
|
|
52
|
+
data-slot="dialog-close-button"
|
|
53
|
+
as={IconButton}
|
|
54
|
+
icon="close"
|
|
55
|
+
variant="ghost"
|
|
56
|
+
aria-label={i18n.t("ui.common.close")}
|
|
57
|
+
/>
|
|
58
|
+
</Match>
|
|
59
|
+
</Switch>
|
|
60
|
+
</div>
|
|
61
|
+
</Show>
|
|
62
|
+
<Show when={props.description}>
|
|
63
|
+
<Kobalte.Description data-slot="dialog-description" style={{ "margin-left": "-4px" }}>
|
|
64
|
+
{props.description}
|
|
65
|
+
</Kobalte.Description>
|
|
66
|
+
</Show>
|
|
67
|
+
<div data-slot="dialog-body">{props.children}</div>
|
|
68
|
+
</Kobalte.Content>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
@@ -6,27 +6,18 @@
|
|
|
6
6
|
justify-content: flex-end;
|
|
7
7
|
align-items: center;
|
|
8
8
|
|
|
9
|
-
[data-slot="diff-changes-additions"]
|
|
10
|
-
|
|
11
|
-
font-
|
|
9
|
+
[data-slot="diff-changes-additions"] {
|
|
10
|
+
font-family: var(--font-family-mono);
|
|
11
|
+
font-feature-settings: var(--font-family-mono--font-feature-settings);
|
|
12
|
+
font-size: 14px;
|
|
12
13
|
font-style: normal;
|
|
13
|
-
font-weight:
|
|
14
|
-
line-height:
|
|
15
|
-
letter-spacing:
|
|
14
|
+
font-weight: var(--font-weight-regular);
|
|
15
|
+
line-height: var(--line-height-large);
|
|
16
|
+
letter-spacing: var(--letter-spacing-normal);
|
|
16
17
|
text-align: right;
|
|
18
|
+
color: var(--text-diff-add-base);
|
|
17
19
|
}
|
|
18
20
|
|
|
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
|
-
}
|
|
27
|
-
|
|
28
|
-
[data-component="diff-changes"][data-appearance="standard"] {
|
|
29
|
-
[data-slot="diff-changes-additions"],
|
|
30
21
|
[data-slot="diff-changes-deletions"] {
|
|
31
22
|
font-family: var(--font-family-mono);
|
|
32
23
|
font-feature-settings: var(--font-family-mono--font-feature-settings);
|
|
@@ -35,13 +26,19 @@
|
|
|
35
26
|
font-weight: var(--font-weight-regular);
|
|
36
27
|
line-height: var(--line-height-large);
|
|
37
28
|
letter-spacing: var(--letter-spacing-normal);
|
|
29
|
+
text-align: right;
|
|
30
|
+
color: var(--text-diff-delete-base);
|
|
38
31
|
}
|
|
32
|
+
}
|
|
39
33
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
[data-component="diff-changes"][data-variant="bars"] {
|
|
35
|
+
width: 18px;
|
|
36
|
+
height: 14px;
|
|
37
|
+
flex-shrink: 0;
|
|
43
38
|
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
svg {
|
|
40
|
+
display: block;
|
|
41
|
+
width: 100%;
|
|
42
|
+
height: 100%;
|
|
46
43
|
}
|
|
47
44
|
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { createMemo, For, Match, Show, Switch } from "solid-js"
|
|
2
|
+
|
|
3
|
+
export function DiffChanges(props: {
|
|
4
|
+
class?: string
|
|
5
|
+
changes: { additions: number; deletions: number } | { additions: number; deletions: number }[]
|
|
6
|
+
variant?: "default" | "bars"
|
|
7
|
+
}) {
|
|
8
|
+
const variant = () => props.variant ?? "default"
|
|
9
|
+
|
|
10
|
+
const additions = createMemo(() =>
|
|
11
|
+
Array.isArray(props.changes)
|
|
12
|
+
? props.changes.reduce((acc, diff) => acc + (diff.additions ?? 0), 0)
|
|
13
|
+
: props.changes.additions,
|
|
14
|
+
)
|
|
15
|
+
const deletions = createMemo(() =>
|
|
16
|
+
Array.isArray(props.changes)
|
|
17
|
+
? props.changes.reduce((acc, diff) => acc + (diff.deletions ?? 0), 0)
|
|
18
|
+
: props.changes.deletions,
|
|
19
|
+
)
|
|
20
|
+
const total = createMemo(() => (additions() ?? 0) + (deletions() ?? 0))
|
|
21
|
+
|
|
22
|
+
const blockCounts = createMemo(() => {
|
|
23
|
+
const TOTAL_BLOCKS = 5
|
|
24
|
+
|
|
25
|
+
const adds = additions() ?? 0
|
|
26
|
+
const dels = deletions() ?? 0
|
|
27
|
+
|
|
28
|
+
if (adds === 0 && dels === 0) {
|
|
29
|
+
return { added: 0, deleted: 0, neutral: TOTAL_BLOCKS }
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const total = adds + dels
|
|
33
|
+
|
|
34
|
+
if (total < 5) {
|
|
35
|
+
const added = adds > 0 ? 1 : 0
|
|
36
|
+
const deleted = dels > 0 ? 1 : 0
|
|
37
|
+
const neutral = TOTAL_BLOCKS - added - deleted
|
|
38
|
+
return { added, deleted, neutral }
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const ratio = adds > dels ? adds / dels : dels / adds
|
|
42
|
+
let BLOCKS_FOR_COLORS = TOTAL_BLOCKS
|
|
43
|
+
|
|
44
|
+
if (total < 20) {
|
|
45
|
+
BLOCKS_FOR_COLORS = TOTAL_BLOCKS - 1
|
|
46
|
+
} else if (ratio < 4) {
|
|
47
|
+
BLOCKS_FOR_COLORS = TOTAL_BLOCKS - 1
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const percentAdded = adds / total
|
|
51
|
+
const percentDeleted = dels / total
|
|
52
|
+
|
|
53
|
+
const added_raw = percentAdded * BLOCKS_FOR_COLORS
|
|
54
|
+
const deleted_raw = percentDeleted * BLOCKS_FOR_COLORS
|
|
55
|
+
|
|
56
|
+
let added = adds > 0 ? Math.max(1, Math.round(added_raw)) : 0
|
|
57
|
+
let deleted = dels > 0 ? Math.max(1, Math.round(deleted_raw)) : 0
|
|
58
|
+
|
|
59
|
+
// Cap bars based on actual change magnitude
|
|
60
|
+
if (adds > 0 && adds <= 5) added = Math.min(added, 1)
|
|
61
|
+
if (adds > 5 && adds <= 10) added = Math.min(added, 2)
|
|
62
|
+
if (dels > 0 && dels <= 5) deleted = Math.min(deleted, 1)
|
|
63
|
+
if (dels > 5 && dels <= 10) deleted = Math.min(deleted, 2)
|
|
64
|
+
|
|
65
|
+
let total_allocated = added + deleted
|
|
66
|
+
if (total_allocated > BLOCKS_FOR_COLORS) {
|
|
67
|
+
if (added_raw > deleted_raw) {
|
|
68
|
+
added = BLOCKS_FOR_COLORS - deleted
|
|
69
|
+
} else {
|
|
70
|
+
deleted = BLOCKS_FOR_COLORS - added
|
|
71
|
+
}
|
|
72
|
+
total_allocated = added + deleted
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const neutral = Math.max(0, TOTAL_BLOCKS - total_allocated)
|
|
76
|
+
|
|
77
|
+
return { added, deleted, neutral }
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
const ADD_COLOR = "var(--icon-diff-add-base)"
|
|
81
|
+
const DELETE_COLOR = "var(--icon-diff-delete-base)"
|
|
82
|
+
const NEUTRAL_COLOR = "var(--icon-weak-base)"
|
|
83
|
+
|
|
84
|
+
const visibleBlocks = createMemo(() => {
|
|
85
|
+
const counts = blockCounts()
|
|
86
|
+
const blocks = [
|
|
87
|
+
...Array(counts.added).fill(ADD_COLOR),
|
|
88
|
+
...Array(counts.deleted).fill(DELETE_COLOR),
|
|
89
|
+
...Array(counts.neutral).fill(NEUTRAL_COLOR),
|
|
90
|
+
]
|
|
91
|
+
return blocks.slice(0, 5)
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
return (
|
|
95
|
+
<Show when={variant() === "default" ? total() > 0 : true}>
|
|
96
|
+
<div data-component="diff-changes" data-variant={variant()} classList={{ [props.class ?? ""]: true }}>
|
|
97
|
+
<Switch>
|
|
98
|
+
<Match when={variant() === "bars"}>
|
|
99
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 14" fill="none">
|
|
100
|
+
<g>
|
|
101
|
+
<For each={visibleBlocks()}>
|
|
102
|
+
{(color, i) => <rect x={i() * 4} width="2" height="14" rx="1" fill={color} />}
|
|
103
|
+
</For>
|
|
104
|
+
</g>
|
|
105
|
+
</svg>
|
|
106
|
+
</Match>
|
|
107
|
+
<Match when={variant() === "default"}>
|
|
108
|
+
<span data-slot="diff-changes-additions">{`+${additions()}`}</span>
|
|
109
|
+
<span data-slot="diff-changes-deletions">{`-${deletions()}`}</span>
|
|
110
|
+
</Match>
|
|
111
|
+
</Switch>
|
|
112
|
+
</div>
|
|
113
|
+
</Show>
|
|
114
|
+
)
|
|
115
|
+
}
|
|
@@ -10,8 +10,15 @@
|
|
|
10
10
|
[data-dock-border-underlay] {
|
|
11
11
|
/* Later shadows paint underneath, so this solid ring masks overlapping surfaces without changing border geometry. */
|
|
12
12
|
box-shadow:
|
|
13
|
-
var(--
|
|
14
|
-
0 0 0
|
|
13
|
+
var(--dock-shell-visual-shadow, var(--shadow-xs-border)),
|
|
14
|
+
0 0 0 var(--dock-shell-border-underlay-width, 1px)
|
|
15
|
+
var(--dock-shell-border-underlay-background, var(--surface-raised-stronger-non-alpha));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
[data-dock-border-underlay="v2"] {
|
|
19
|
+
--dock-shell-visual-shadow: var(--v2-elevation-raised);
|
|
20
|
+
--dock-shell-border-underlay-width: 0.5px;
|
|
21
|
+
--dock-shell-border-underlay-background: var(--v2-background-bg-base);
|
|
15
22
|
}
|
|
16
23
|
|
|
17
24
|
[data-dock-surface="tray"] {
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
[data-component="dropdown-menu-content"],
|
|
2
|
+
[data-component="dropdown-menu-sub-content"] {
|
|
3
|
+
min-width: 8rem;
|
|
4
|
+
overflow: hidden;
|
|
5
|
+
border-radius: var(--radius-md);
|
|
6
|
+
border: 1px solid color-mix(in oklch, var(--border-base) 50%, transparent);
|
|
7
|
+
background-clip: padding-box;
|
|
8
|
+
background-color: var(--surface-raised-stronger-non-alpha);
|
|
9
|
+
padding: 4px;
|
|
10
|
+
box-shadow: var(--shadow-md);
|
|
11
|
+
z-index: 50;
|
|
12
|
+
transform-origin: var(--kb-menu-content-transform-origin);
|
|
13
|
+
|
|
14
|
+
&:focus,
|
|
15
|
+
&:focus-visible {
|
|
16
|
+
outline: none;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&[data-closed] {
|
|
20
|
+
animation: dropdown-menu-close 0.15s ease-out;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&[data-expanded] {
|
|
24
|
+
animation: dropdown-menu-open 0.15s ease-out;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
[data-component="dropdown-menu-content"],
|
|
29
|
+
[data-component="dropdown-menu-sub-content"] {
|
|
30
|
+
[data-slot="dropdown-menu-item"],
|
|
31
|
+
[data-slot="dropdown-menu-checkbox-item"],
|
|
32
|
+
[data-slot="dropdown-menu-radio-item"],
|
|
33
|
+
[data-slot="dropdown-menu-sub-trigger"] {
|
|
34
|
+
position: relative;
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
gap: 8px;
|
|
38
|
+
padding: 4px 8px;
|
|
39
|
+
border-radius: var(--radius-sm);
|
|
40
|
+
cursor: default;
|
|
41
|
+
user-select: none;
|
|
42
|
+
outline: none;
|
|
43
|
+
|
|
44
|
+
font-family: var(--font-family-sans);
|
|
45
|
+
font-size: var(--font-size-small);
|
|
46
|
+
font-weight: var(--font-weight-medium);
|
|
47
|
+
line-height: var(--line-height-large);
|
|
48
|
+
letter-spacing: var(--letter-spacing-normal);
|
|
49
|
+
color: var(--text-strong);
|
|
50
|
+
|
|
51
|
+
&[data-highlighted] {
|
|
52
|
+
background: var(--surface-raised-base-hover);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&[data-disabled] {
|
|
56
|
+
color: var(--text-weak);
|
|
57
|
+
pointer-events: none;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
[data-slot="dropdown-menu-checkbox-item"],
|
|
62
|
+
[data-slot="dropdown-menu-radio-item"] {
|
|
63
|
+
padding-inline-end: 28px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
[data-slot="dropdown-menu-sub-trigger"] {
|
|
67
|
+
&[data-expanded] {
|
|
68
|
+
background: var(--surface-raised-base-hover);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
[data-slot="dropdown-menu-item-indicator"] {
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: center;
|
|
76
|
+
width: 16px;
|
|
77
|
+
height: 16px;
|
|
78
|
+
position: absolute;
|
|
79
|
+
inset-inline-end: 8px;
|
|
80
|
+
top: 50%;
|
|
81
|
+
transform: translateY(-50%);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
[data-slot="dropdown-menu-item-label"] {
|
|
85
|
+
flex: 1;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
[data-slot="dropdown-menu-item-description"] {
|
|
89
|
+
font-size: var(--font-size-x-small);
|
|
90
|
+
color: var(--text-weak);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
[data-slot="dropdown-menu-separator"] {
|
|
94
|
+
height: 1px;
|
|
95
|
+
margin: 4px -4px;
|
|
96
|
+
border-top-color: var(--border-weak-base);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
[data-slot="dropdown-menu-group-label"] {
|
|
100
|
+
display: block;
|
|
101
|
+
padding: 4px 8px;
|
|
102
|
+
font-family: var(--font-family-sans);
|
|
103
|
+
font-size: var(--font-size-x-small);
|
|
104
|
+
font-weight: var(--font-weight-medium);
|
|
105
|
+
line-height: var(--line-height-large);
|
|
106
|
+
letter-spacing: var(--letter-spacing-normal);
|
|
107
|
+
color: var(--text-weak);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
[data-slot="dropdown-menu-arrow"] {
|
|
111
|
+
fill: var(--surface-raised-stronger-non-alpha);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@keyframes dropdown-menu-open {
|
|
116
|
+
from {
|
|
117
|
+
opacity: 0;
|
|
118
|
+
transform: scale(0.96);
|
|
119
|
+
}
|
|
120
|
+
to {
|
|
121
|
+
opacity: 1;
|
|
122
|
+
transform: scale(1);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
@keyframes dropdown-menu-close {
|
|
127
|
+
from {
|
|
128
|
+
opacity: 1;
|
|
129
|
+
transform: scale(1);
|
|
130
|
+
}
|
|
131
|
+
to {
|
|
132
|
+
opacity: 0;
|
|
133
|
+
transform: scale(0.96);
|
|
134
|
+
}
|
|
135
|
+
}
|