@opencode-ai/ui 0.0.0-dev-17746 → 0.0.0-dev-202608201751
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{data-display/accordion → components}/accordion.d.ts +6 -6
- package/dist/components/avatar.d.ts +9 -0
- package/dist/components/button.d.ts +9 -0
- package/dist/components/card.d.ts +1 -1
- package/dist/{forms/checkbox → components}/checkbox.d.ts +2 -2
- package/dist/components/dialog.d.ts +12 -0
- package/dist/{data-display/diff-changes → components}/diff-changes.d.ts +1 -2
- package/dist/components/dropdown-menu.d.ts +80 -0
- package/dist/components/icon-button.d.ts +10 -0
- package/dist/{icons/icon/additional-icons.d.ts → components/icon.d.ts} +8 -8
- package/dist/components/keybind.d.ts +6 -0
- package/dist/components/list.d.ts +1 -1
- package/dist/{feedback/progress-circle → components}/progress-circle.d.ts +0 -2
- package/dist/components/radio-group.d.ts +16 -0
- package/dist/components/scroll-view.d.ts +3 -3
- package/dist/components/select.d.ts +21 -0
- package/dist/{forms/switch → components}/switch.d.ts +2 -4
- package/dist/{navigation/tabs → components}/tabs.d.ts +8 -15
- package/dist/components/tag.d.ts +5 -0
- package/dist/{typography/text-shimmer → components}/text-shimmer.d.ts +0 -1
- package/dist/components/toast.d.ts +56 -0
- package/dist/components/tooltip.d.ts +17 -0
- package/dist/context/i18n.d.ts +7 -10
- package/dist/i18n/ar.d.ts +2 -0
- package/dist/i18n/bg.d.ts +2 -0
- package/dist/i18n/br.d.ts +2 -0
- package/dist/i18n/bs.d.ts +2 -0
- package/dist/i18n/da.d.ts +2 -0
- package/dist/i18n/de.d.ts +2 -0
- package/dist/i18n/en.d.ts +1 -209
- package/dist/i18n/es.d.ts +2 -0
- package/dist/i18n/fr.d.ts +2 -0
- package/dist/i18n/ja.d.ts +2 -0
- package/dist/i18n/km.d.ts +2 -0
- package/dist/i18n/ko.d.ts +2 -0
- package/dist/i18n/lo.d.ts +2 -0
- package/dist/i18n/mk.d.ts +2 -0
- package/dist/i18n/mn.d.ts +2 -0
- package/dist/i18n/my.d.ts +2 -0
- package/dist/i18n/pl.d.ts +2 -0
- package/dist/i18n/ru.d.ts +2 -0
- package/dist/i18n/sr.d.ts +2 -0
- package/dist/i18n/tg.d.ts +2 -0
- package/dist/i18n/th.d.ts +2 -0
- package/dist/i18n/tr.d.ts +2 -0
- package/dist/i18n/zh.d.ts +2 -0
- package/dist/i18n/zht.d.ts +2 -0
- package/dist/v2/components/accordion-v2.d.ts +26 -0
- package/dist/{data-display/avatar/avatar.d.ts → v2/components/avatar-v2.d.ts} +1 -1
- package/dist/v2/components/badge-v2.d.ts +6 -0
- package/dist/v2/components/button-v2.d.ts +10 -0
- package/dist/v2/components/checkbox-v2.d.ts +10 -0
- package/dist/{overlays/dialog/dialog.d.ts → v2/components/dialog-v2.d.ts} +2 -1
- package/dist/v2/components/diff-changes-v2.d.ts +11 -0
- package/dist/v2/components/divider-v2.d.ts +5 -0
- package/dist/{forms/field/field.d.ts → v2/components/field-v2.d.ts} +10 -4
- package/dist/v2/components/icon-button-v2.d.ts +11 -0
- package/dist/{icons/icon → v2/components}/icon.d.ts +1 -16
- package/dist/v2/components/inline-input-v2.d.ts +21 -0
- package/dist/v2/components/keybind-v2.d.ts +7 -0
- package/dist/{data-display/line-comment/line-comment.d.ts → v2/components/line-comment-v2.d.ts} +9 -9
- package/dist/v2/components/loader-v2.d.ts +3 -0
- package/dist/v2/components/menu-v2.d.ts +52 -0
- package/dist/v2/components/progress-circle-v2.d.ts +8 -0
- package/dist/{data-display/project-avatar/project-avatar.d.ts → v2/components/project-avatar-v2.d.ts} +1 -1
- package/dist/v2/components/radio-v2.d.ts +16 -0
- package/dist/{navigation/segmented-control/segmented-control.d.ts → v2/components/segmented-control-v2.d.ts} +5 -5
- package/dist/{forms/select/select.d.ts → v2/components/select-v2.d.ts} +6 -4
- package/dist/v2/components/split-button-v2.d.ts +5 -0
- package/dist/v2/components/switch-v2.d.ts +7 -0
- package/dist/v2/components/tabs-v2.d.ts +34 -0
- package/dist/{forms/text-input/text-input.d.ts → v2/components/text-input-v2.d.ts} +3 -3
- package/dist/v2/components/text-shimmer-v2.d.ts +9 -0
- package/dist/v2/components/textarea-v2.d.ts +7 -0
- package/dist/v2/components/toast-v2.d.ts +57 -0
- package/dist/v2/components/tooltip-v2.d.ts +13 -0
- package/dist/v2/components/wordmark-v2.d.ts +2 -0
- package/package.json +13 -131
- package/src/{data-display/accordion → components}/accordion.css +26 -1
- package/src/{data-display/accordion → components}/accordion.tsx +14 -14
- package/src/components/animated-number.css +11 -29
- package/src/components/animated-number.tsx +2 -2
- package/src/components/avatar.css +49 -0
- package/src/components/avatar.tsx +55 -0
- package/src/components/button.css +194 -0
- package/src/components/button.tsx +33 -0
- package/src/components/card.css +23 -2
- package/src/components/card.tsx +4 -4
- package/src/{forms/checkbox → components}/checkbox.css +7 -1
- package/src/{forms/checkbox → components}/checkbox.tsx +13 -13
- package/src/components/collapsible.tsx +1 -1
- package/src/components/dialog.css +181 -0
- package/src/components/dialog.tsx +72 -0
- package/src/{data-display/diff-changes → components}/diff-changes.css +19 -22
- package/src/components/diff-changes.tsx +115 -0
- package/src/components/dropdown-menu.css +135 -0
- package/src/components/dropdown-menu.tsx +308 -0
- package/src/components/icon-button.css +181 -0
- package/src/components/icon-button.tsx +29 -0
- package/src/components/icon.css +39 -0
- package/src/{icons/icon/additional-icons.ts → components/icon.tsx} +74 -8
- package/src/components/image-preview.tsx +2 -3
- package/src/components/keybind.css +18 -0
- package/src/components/keybind.tsx +20 -0
- package/src/components/list.css +5 -5
- package/src/components/list.tsx +5 -7
- package/src/components/popover.tsx +2 -3
- package/src/components/progress-circle.css +16 -0
- package/src/components/progress-circle.tsx +64 -0
- package/src/components/provider-icon.tsx +1 -1
- package/src/components/radio-group.css +187 -0
- package/src/components/radio-group.tsx +83 -0
- package/src/components/scroll-view.tsx +20 -5
- package/src/components/select.css +201 -0
- package/src/components/select.tsx +174 -0
- package/src/components/sticky-accordion-header.tsx +1 -1
- package/src/components/switch.css +136 -0
- package/src/components/switch.tsx +29 -0
- package/src/{navigation/tabs → components}/tabs.css +229 -39
- package/src/components/tabs.tsx +126 -0
- package/src/components/tag.css +37 -0
- package/src/components/tag.tsx +22 -0
- package/src/components/text-field.tsx +4 -12
- package/src/{typography/text-shimmer → components}/text-shimmer.css +1 -2
- package/src/{typography/text-shimmer → components}/text-shimmer.tsx +0 -1
- package/src/components/toast.css +236 -0
- package/src/components/toast.tsx +185 -0
- package/src/components/tooltip.css +74 -0
- package/src/components/tooltip.tsx +163 -0
- package/src/context/i18n.tsx +14 -17
- package/src/hooks/create-auto-scroll.tsx +0 -20
- package/src/i18n/am.ts +2 -0
- package/src/i18n/ar.ts +2 -0
- package/src/i18n/az.ts +2 -0
- package/src/i18n/bg.ts +2 -0
- package/src/i18n/bn.ts +2 -0
- package/src/i18n/br.ts +2 -0
- package/src/i18n/bs.ts +2 -0
- package/src/i18n/ca.ts +2 -0
- package/src/i18n/cs.ts +2 -0
- package/src/i18n/da.ts +2 -0
- package/src/i18n/de.ts +2 -0
- package/src/i18n/dv.ts +2 -0
- package/src/i18n/dz.ts +2 -0
- package/src/i18n/el.ts +2 -0
- package/src/i18n/en.ts +4 -18
- package/src/i18n/es.ts +2 -0
- package/src/i18n/et.ts +2 -0
- package/src/i18n/fa.ts +2 -0
- package/src/i18n/fi.ts +2 -0
- package/src/i18n/fo.ts +2 -0
- package/src/i18n/fr.ts +2 -0
- package/src/i18n/hi.ts +2 -0
- package/src/i18n/hr.ts +2 -0
- package/src/i18n/hu.ts +2 -0
- package/src/i18n/hy.ts +2 -0
- package/src/i18n/id.ts +2 -0
- package/src/i18n/is.ts +2 -0
- package/src/i18n/it.ts +2 -0
- package/src/i18n/ja.ts +2 -0
- package/src/i18n/ka.ts +2 -0
- package/src/i18n/km.ts +2 -0
- package/src/i18n/ko.ts +2 -0
- package/src/i18n/lo.ts +2 -0
- package/src/i18n/lt.ts +2 -0
- package/src/i18n/lv.ts +2 -0
- package/src/i18n/mk.ts +2 -0
- package/src/i18n/mn.ts +2 -0
- package/src/i18n/ms.ts +2 -0
- package/src/i18n/my.ts +2 -0
- package/src/i18n/ne.ts +2 -0
- package/src/i18n/nl.ts +2 -0
- package/src/i18n/no.ts +2 -0
- package/src/i18n/pa.ts +2 -0
- package/src/i18n/pl.ts +2 -0
- package/src/i18n/ro.ts +2 -0
- package/src/i18n/ru.ts +2 -0
- package/src/i18n/si.ts +2 -0
- package/src/i18n/sk.ts +2 -0
- package/src/i18n/sl.ts +2 -0
- package/src/i18n/sq.ts +2 -0
- package/src/i18n/sr.ts +2 -0
- package/src/i18n/sv.ts +2 -0
- package/src/i18n/tg.ts +2 -0
- package/src/i18n/th.ts +2 -0
- package/src/i18n/tk.ts +2 -0
- package/src/i18n/tr.ts +2 -0
- package/src/i18n/uk.ts +2 -0
- package/src/i18n/ur.ts +2 -0
- package/src/i18n/uz.ts +2 -0
- package/src/i18n/vi.ts +2 -0
- package/src/i18n/zh.ts +2 -0
- package/src/i18n/zht.ts +2 -0
- package/src/styles/index.css +20 -4
- package/src/styles/tailwind/index.css +1 -15
- package/src/theme/context.tsx +11 -19
- package/src/theme/themes/oc-2.json +1 -1
- package/src/v2/components/accordion-v2.css +139 -0
- package/src/v2/components/accordion-v2.tsx +86 -0
- package/src/{data-display/avatar/avatar.tsx → v2/components/avatar-v2.tsx} +1 -1
- package/src/{data-display/badge/badge.css → v2/components/badge-v2.css} +0 -19
- package/src/{data-display/badge/badge.tsx → v2/components/badge-v2.tsx} +4 -6
- package/src/{actions/button/button.tsx → v2/components/button-v2.tsx} +8 -8
- package/src/v2/components/checkbox-v2.css +184 -0
- package/src/v2/components/checkbox-v2.tsx +65 -0
- package/src/{overlays/dialog/dialog.css → v2/components/dialog-v2.css} +0 -3
- package/src/{overlays/dialog/dialog.tsx → v2/components/dialog-v2.tsx} +13 -11
- package/src/v2/components/diff-changes-v2.css +26 -0
- package/src/{data-display/diff-changes/diff-changes.tsx → v2/components/diff-changes-v2.tsx} +2 -7
- package/src/{layout/divider/divider.tsx → v2/components/divider-v2.tsx} +3 -3
- package/src/{forms/field/field.tsx → v2/components/field-v2.tsx} +11 -9
- package/src/v2/components/icon-button-v2.tsx +37 -0
- package/src/{icons/icon → v2/components}/icon.tsx +9 -42
- package/src/v2/components/inline-input-v2.css +225 -0
- package/src/v2/components/inline-input-v2.tsx +107 -0
- package/src/{data-display/keybind/keybind.css → v2/components/keybind-v2.css} +1 -1
- package/src/{data-display/keybind/keybind.tsx → v2/components/keybind-v2.tsx} +3 -3
- package/src/{data-display/line-comment/line-comment.tsx → v2/components/line-comment-v2.tsx} +15 -17
- package/src/{feedback/loader/loader.tsx → v2/components/loader-v2.tsx} +2 -2
- package/src/{navigation/menu/menu.css → v2/components/menu-v2.css} +0 -121
- package/src/{navigation/menu/menu.tsx → v2/components/menu-v2.tsx} +32 -96
- package/src/v2/components/progress-circle-v2.css +13 -0
- package/src/v2/components/progress-circle-v2.tsx +52 -0
- package/src/{data-display/project-avatar/project-avatar.tsx → v2/components/project-avatar-v2.tsx} +1 -1
- package/src/{forms/radio/radio.tsx → v2/components/radio-v2.tsx} +20 -30
- package/src/{navigation/segmented-control/segmented-control.tsx → v2/components/segmented-control-v2.tsx} +8 -9
- package/src/{forms/select/select.css → v2/components/select-v2.css} +8 -2
- package/src/{forms/select/select.tsx → v2/components/select-v2.tsx} +32 -38
- package/src/{actions/split-button/split-button.css → v2/components/split-button-v2.css} +6 -1
- package/src/{actions/split-button/split-button.tsx → v2/components/split-button-v2.tsx} +4 -4
- package/src/{forms/switch/switch.css → v2/components/switch-v2.css} +0 -110
- package/src/v2/components/switch-v2.tsx +28 -0
- package/src/{navigation/tabs/tabs-current.css → v2/components/tabs-v2.css} +9 -24
- package/src/v2/components/tabs-v2.tsx +149 -0
- package/src/{forms/text-input/text-input.tsx → v2/components/text-input-v2.tsx} +4 -4
- package/src/v2/components/text-shimmer-v2.css +125 -0
- package/src/v2/components/text-shimmer-v2.tsx +63 -0
- package/src/{forms/textarea/textarea.tsx → v2/components/textarea-v2.tsx} +3 -3
- package/src/{feedback/toast/toast.tsx → v2/components/toast-v2.tsx} +58 -60
- package/src/{overlays/tooltip/tooltip.css → v2/components/tooltip-v2.css} +0 -26
- package/src/{overlays/tooltip/tooltip.tsx → v2/components/tooltip-v2.tsx} +14 -18
- package/src/{typography/wordmark/wordmark.tsx → v2/components/wordmark-v2.tsx} +1 -1
- package/src/{styles/tokens → v2/styles}/theme.css +12 -0
- package/dist/actions/button/button.d.ts +0 -10
- package/dist/actions/icon-button/icon-button.d.ts +0 -11
- package/dist/actions/split-button/split-button.d.ts +0 -5
- package/dist/data-display/badge/badge.d.ts +0 -7
- package/dist/data-display/keybind/keybind.d.ts +0 -7
- package/dist/feedback/loader/loader.d.ts +0 -3
- package/dist/feedback/toast/toast.d.ts +0 -57
- package/dist/forms/radio/radio.d.ts +0 -16
- package/dist/forms/textarea/textarea.d.ts +0 -7
- package/dist/i18n/he.d.ts +0 -197
- package/dist/layout/divider/divider.d.ts +0 -5
- package/dist/navigation/menu/menu.d.ts +0 -59
- package/dist/overlays/tooltip/tooltip.d.ts +0 -14
- package/dist/typography/wordmark/wordmark.d.ts +0 -2
- package/src/actions/icon-button/icon-button.tsx +0 -32
- package/src/feedback/progress-circle/progress-circle.css +0 -28
- package/src/feedback/progress-circle/progress-circle.tsx +0 -64
- package/src/forms/switch/switch.tsx +0 -34
- package/src/i18n/he.ts +0 -199
- package/src/icons/icon/icon.css +0 -3
- package/src/navigation/tabs/tabs.tsx +0 -194
- /package/dist/{forms/inline-input → components}/inline-input.d.ts +0 -0
- /package/dist/{navigation → v2/components}/tab-state-indicator.d.ts +0 -0
- /package/src/{forms/inline-input → components}/inline-input.css +0 -0
- /package/src/{forms/inline-input → components}/inline-input.tsx +0 -0
- /package/src/{data-display/avatar/avatar.css → v2/components/avatar-v2.css} +0 -0
- /package/src/{actions/button/button.css → v2/components/button-v2.css} +0 -0
- /package/src/{layout/divider/divider.css → v2/components/divider-v2.css} +0 -0
- /package/src/{forms/field/field.css → v2/components/field-v2.css} +0 -0
- /package/src/{styles/file-tree.css → v2/components/file-tree-v2.css} +0 -0
- /package/src/{actions/icon-button/icon-button.css → v2/components/icon-button-v2.css} +0 -0
- /package/src/{data-display/line-comment/line-comment.css → v2/components/line-comment-v2.css} +0 -0
- /package/src/{feedback/loader/loader.css → v2/components/loader-v2.css} +0 -0
- /package/src/{data-display/project-avatar/project-avatar.css → v2/components/project-avatar-v2.css} +0 -0
- /package/src/{forms/radio/radio.css → v2/components/radio-v2.css} +0 -0
- /package/src/{navigation/segmented-control/segmented-control.css → v2/components/segmented-control-v2.css} +0 -0
- /package/src/{navigation → v2/components}/tab-state-indicator.tsx +0 -0
- /package/src/{forms/text-input/text-input.css → v2/components/text-input-v2.css} +0 -0
- /package/src/{forms/textarea/textarea.css → v2/components/textarea-v2.css} +0 -0
- /package/src/{feedback/toast/toast.css → v2/components/toast-v2.css} +0 -0
- /package/src/{styles/tokens → v2/styles}/colors.css +0 -0
- /package/src/{styles/tokens/index.css → v2/styles/tailwind.css} +0 -0
package/src/i18n/th.ts
CHANGED
|
@@ -151,6 +151,8 @@ export const dict = {
|
|
|
151
151
|
"ui.tool.websearch.provider": "{{provider}} ค้นหาเว็บ",
|
|
152
152
|
"ui.tool.shell": "เชลล์",
|
|
153
153
|
"ui.tool.patch": "แพตช์",
|
|
154
|
+
"ui.tool.todos": "รายการงาน",
|
|
155
|
+
"ui.tool.todos.read": "อ่านรายการงาน",
|
|
154
156
|
"ui.tool.questions": "คำถาม",
|
|
155
157
|
"ui.tool.questions.numbered": "คำถาม {{number}}",
|
|
156
158
|
"ui.tool.agent": "เอเจนต์ {{type}}",
|
package/src/i18n/tk.ts
CHANGED
|
@@ -143,6 +143,8 @@ export const dict: Record<string, string> = {
|
|
|
143
143
|
"ui.tool.websearch.provider": "{{provider}} Web gözlegi",
|
|
144
144
|
"ui.tool.shell": "Shell",
|
|
145
145
|
"ui.tool.patch": "Patch",
|
|
146
|
+
"ui.tool.todos": "Edilmeli işler",
|
|
147
|
+
"ui.tool.todos.read": "Edilmeli zatlary okaň",
|
|
146
148
|
"ui.tool.questions": "Soraglar",
|
|
147
149
|
"ui.tool.questions.numbered": "Soraglar {{number}}",
|
|
148
150
|
"ui.tool.agent": "{{type}} Agenti",
|
package/src/i18n/tr.ts
CHANGED
|
@@ -157,6 +157,8 @@ export const dict = {
|
|
|
157
157
|
"ui.tool.websearch.provider": "{{provider}} Web araması",
|
|
158
158
|
"ui.tool.shell": "Kabuk",
|
|
159
159
|
"ui.tool.patch": "Yama",
|
|
160
|
+
"ui.tool.todos": "Görevler",
|
|
161
|
+
"ui.tool.todos.read": "Görevleri oku",
|
|
160
162
|
"ui.tool.questions": "Sorular",
|
|
161
163
|
"ui.tool.questions.numbered": "Sorular {{number}}",
|
|
162
164
|
"ui.tool.agent": "{{type}} ajanı",
|
package/src/i18n/uk.ts
CHANGED
|
@@ -167,6 +167,8 @@ export const dict: Record<string, string> = {
|
|
|
167
167
|
"ui.tool.websearch.provider": "{{provider}} Веб-пошук",
|
|
168
168
|
"ui.tool.shell": "Оболонка",
|
|
169
169
|
"ui.tool.patch": "Патч",
|
|
170
|
+
"ui.tool.todos": "Завдання",
|
|
171
|
+
"ui.tool.todos.read": "Читати завдання",
|
|
170
172
|
"ui.tool.questions": "Запитання",
|
|
171
173
|
"ui.tool.questions.numbered": "Запитання {{number}}",
|
|
172
174
|
"ui.tool.agent": "Агент {{type}}",
|
package/src/i18n/ur.ts
CHANGED
|
@@ -144,6 +144,8 @@ export const dict: Record<string, string> = {
|
|
|
144
144
|
"ui.tool.websearch.provider": "{{provider}} ویب تلاش",
|
|
145
145
|
"ui.tool.shell": "شیل",
|
|
146
146
|
"ui.tool.patch": "پیچ",
|
|
147
|
+
"ui.tool.todos": "زیر التوا کام",
|
|
148
|
+
"ui.tool.todos.read": "زیر التوا کام پڑھیں",
|
|
147
149
|
"ui.tool.questions": "سوالات",
|
|
148
150
|
"ui.tool.questions.numbered": "سوالات {{number}}",
|
|
149
151
|
"ui.tool.agent": "{{type}} ایجنٹ",
|
package/src/i18n/uz.ts
CHANGED
|
@@ -146,6 +146,8 @@ export const dict: Record<string, string> = {
|
|
|
146
146
|
"ui.tool.websearch.provider": "{{provider}} veb-qidiruv",
|
|
147
147
|
"ui.tool.shell": "Shell",
|
|
148
148
|
"ui.tool.patch": "Yamoq",
|
|
149
|
+
"ui.tool.todos": "Vazifalar",
|
|
150
|
+
"ui.tool.todos.read": "Vazifalarni o'qing",
|
|
149
151
|
"ui.tool.questions": "Savollar",
|
|
150
152
|
"ui.tool.questions.numbered": "Savollar {{number}}",
|
|
151
153
|
"ui.tool.agent": "{{type}} agenti",
|
package/src/i18n/vi.ts
CHANGED
|
@@ -143,6 +143,8 @@ export const dict: Record<string, string> = {
|
|
|
143
143
|
"ui.tool.websearch.provider": "{{provider}} Tìm kiếm trên web",
|
|
144
144
|
"ui.tool.shell": "Shell",
|
|
145
145
|
"ui.tool.patch": "Bản vá",
|
|
146
|
+
"ui.tool.todos": "Việc cần làm",
|
|
147
|
+
"ui.tool.todos.read": "Đọc việc cần làm",
|
|
146
148
|
"ui.tool.questions": "Câu hỏi",
|
|
147
149
|
"ui.tool.questions.numbered": "Câu hỏi {{number}}",
|
|
148
150
|
"ui.tool.agent": "Tác nhân {{type}}",
|
package/src/i18n/zh.ts
CHANGED
|
@@ -153,6 +153,8 @@ export const dict = {
|
|
|
153
153
|
"ui.tool.websearch.provider": "{{provider}} 网页搜索",
|
|
154
154
|
"ui.tool.shell": "Shell",
|
|
155
155
|
"ui.tool.patch": "补丁",
|
|
156
|
+
"ui.tool.todos": "待办",
|
|
157
|
+
"ui.tool.todos.read": "读取待办",
|
|
156
158
|
"ui.tool.questions": "问题",
|
|
157
159
|
"ui.tool.questions.numbered": "问题 {{number}}",
|
|
158
160
|
"ui.tool.agent": "{{type}} 智能体",
|
package/src/i18n/zht.ts
CHANGED
|
@@ -153,6 +153,8 @@ export const dict = {
|
|
|
153
153
|
"ui.tool.websearch.provider": "{{provider}} 網頁搜尋",
|
|
154
154
|
"ui.tool.shell": "Shell",
|
|
155
155
|
"ui.tool.patch": "修補",
|
|
156
|
+
"ui.tool.todos": "待辦",
|
|
157
|
+
"ui.tool.todos.read": "讀取待辦",
|
|
156
158
|
"ui.tool.questions": "問題",
|
|
157
159
|
"ui.tool.questions.numbered": "問題 {{number}}",
|
|
158
160
|
"ui.tool.agent": "{{type}} 代理程式",
|
package/src/styles/index.css
CHANGED
|
@@ -6,31 +6,47 @@
|
|
|
6
6
|
@import "./base.css" layer(base);
|
|
7
7
|
@import "katex/dist/katex.min.css" layer(base);
|
|
8
8
|
|
|
9
|
-
@import "../
|
|
9
|
+
@import "../components/accordion.css" layer(components);
|
|
10
10
|
@import "../components/animated-number.css" layer(components);
|
|
11
11
|
@import "../components/app-icon.css" layer(components);
|
|
12
|
+
@import "../components/avatar.css" layer(components);
|
|
13
|
+
@import "../components/button.css" layer(components);
|
|
12
14
|
@import "../components/card.css" layer(components);
|
|
13
|
-
@import "../
|
|
15
|
+
@import "../components/checkbox.css" layer(components);
|
|
14
16
|
@import "../components/collapsible.css" layer(components);
|
|
17
|
+
@import "../components/diff-changes.css" layer(components);
|
|
15
18
|
@import "../components/context-menu.css" layer(components);
|
|
19
|
+
@import "../components/dropdown-menu.css" layer(components);
|
|
20
|
+
@import "../components/dialog.css" layer(components);
|
|
16
21
|
@import "../components/file-icon.css" layer(components);
|
|
17
22
|
@import "../components/hover-card.css" layer(components);
|
|
18
23
|
@import "../components/provider-icon.css" layer(components);
|
|
19
24
|
@import "../components/dock-surface.css" layer(components);
|
|
25
|
+
@import "../components/icon.css" layer(components);
|
|
26
|
+
@import "../components/icon-button.css" layer(components);
|
|
20
27
|
@import "../components/image-preview.css" layer(components);
|
|
21
|
-
@import "../
|
|
28
|
+
@import "../components/keybind.css" layer(components);
|
|
22
29
|
@import "../components/text-field.css" layer(components);
|
|
30
|
+
@import "../components/inline-input.css" layer(components);
|
|
23
31
|
@import "../components/list.css" layer(components);
|
|
24
32
|
@import "../components/logo.css" layer(components);
|
|
25
33
|
@import "../components/popover.css" layer(components);
|
|
26
34
|
@import "../components/progress.css" layer(components);
|
|
35
|
+
@import "../components/progress-circle.css" layer(components);
|
|
36
|
+
@import "../components/radio-group.css" layer(components);
|
|
27
37
|
@import "../components/resize-handle.css" layer(components);
|
|
38
|
+
@import "../components/select.css" layer(components);
|
|
28
39
|
@import "../components/spinner.css" layer(components);
|
|
40
|
+
@import "../components/switch.css" layer(components);
|
|
29
41
|
@import "../components/scroll-view.css" layer(components);
|
|
30
42
|
@import "../components/sticky-accordion-header.css" layer(components);
|
|
31
|
-
@import "../
|
|
43
|
+
@import "../components/tabs.css" layer(components);
|
|
44
|
+
@import "../components/tag.css" layer(components);
|
|
32
45
|
@import "../components/text-reveal.css" layer(components);
|
|
33
46
|
@import "../components/text-strikethrough.css" layer(components);
|
|
47
|
+
@import "../components/text-shimmer.css" layer(components);
|
|
48
|
+
@import "../components/toast.css" layer(components);
|
|
49
|
+
@import "../components/tooltip.css" layer(components);
|
|
34
50
|
@import "../components/typewriter.css" layer(components);
|
|
35
51
|
|
|
36
52
|
@import "./utilities.css" layer(utilities);
|
|
@@ -1,21 +1,7 @@
|
|
|
1
1
|
@layer theme, base, components, utilities;
|
|
2
2
|
|
|
3
3
|
@import "tailwindcss/theme.css" layer(theme);
|
|
4
|
-
@import "tailwindcss/utilities.css" layer(utilities) source(
|
|
5
|
-
@source "../../../../app/src";
|
|
6
|
-
@source "../../../../app/index.html";
|
|
7
|
-
@source not "../../../../app/src/i18n";
|
|
8
|
-
@source not "../../../../app/src/**/*.test.{ts,tsx}";
|
|
9
|
-
@source "../../../../desktop/src/renderer";
|
|
10
|
-
@source not "../../../../desktop/src/renderer/**/*.test.{ts,tsx}";
|
|
11
|
-
@source "../../../../enterprise/src";
|
|
12
|
-
@source "../../../../session-ui/src";
|
|
13
|
-
@source not "../../../../session-ui/src/**/*.test.{ts,tsx}";
|
|
14
|
-
@source "../../../../storybook";
|
|
15
|
-
@source "../../../src";
|
|
16
|
-
@source not "../../../src/assets";
|
|
17
|
-
@source not "../../../src/i18n";
|
|
18
|
-
@source not "../../../src/**/*.test.{ts,tsx}";
|
|
4
|
+
@import "tailwindcss/utilities.css" layer(utilities) source("../../../../");
|
|
19
5
|
@import "./utilities.css";
|
|
20
6
|
|
|
21
7
|
@import "../index.css";
|
package/src/theme/context.tsx
CHANGED
|
@@ -84,9 +84,8 @@ const names: Record<string, string> = {
|
|
|
84
84
|
}
|
|
85
85
|
const oc2Theme = oc2ThemeJson as DesktopTheme
|
|
86
86
|
|
|
87
|
-
function
|
|
88
|
-
|
|
89
|
-
return "oc-2"
|
|
87
|
+
function normalize(id: string | null | undefined) {
|
|
88
|
+
return id === "oc-1" ? "oc-2" : id
|
|
90
89
|
}
|
|
91
90
|
|
|
92
91
|
function read(key: string) {
|
|
@@ -178,12 +177,7 @@ export const { use: useTheme, provider: ThemeProvider } = createSimpleContext({
|
|
|
178
177
|
defaultTheme?: string
|
|
179
178
|
onThemeApplied?: (theme: DesktopTheme, mode: "light" | "dark", scheme: ColorScheme) => void
|
|
180
179
|
}) => {
|
|
181
|
-
const
|
|
182
|
-
const themeId = resolveStoredTheme(rawTheme)
|
|
183
|
-
if (rawTheme && rawTheme !== themeId) {
|
|
184
|
-
write(STORAGE_KEYS.THEME_ID, themeId)
|
|
185
|
-
clear()
|
|
186
|
-
}
|
|
180
|
+
const themeId = normalize(read(STORAGE_KEYS.THEME_ID) ?? props.defaultTheme) ?? "oc-2"
|
|
187
181
|
const colorScheme = (read(STORAGE_KEYS.COLOR_SCHEME) as ColorScheme | null) ?? "system"
|
|
188
182
|
const mode = colorScheme === "system" ? getSystemMode() : colorScheme
|
|
189
183
|
const [store, setStore] = createStore({
|
|
@@ -200,7 +194,7 @@ export const { use: useTheme, provider: ThemeProvider } = createSimpleContext({
|
|
|
200
194
|
const loads = new Map<string, Promise<DesktopTheme | undefined>>()
|
|
201
195
|
|
|
202
196
|
const load = (id: string) => {
|
|
203
|
-
const next = id
|
|
197
|
+
const next = normalize(id)
|
|
204
198
|
if (!next) return Promise.resolve(undefined)
|
|
205
199
|
const hit = store.themes[next]
|
|
206
200
|
if (hit) return Promise.resolve(hit)
|
|
@@ -239,11 +233,9 @@ export const { use: useTheme, provider: ThemeProvider } = createSimpleContext({
|
|
|
239
233
|
|
|
240
234
|
const onStorage = (e: StorageEvent) => {
|
|
241
235
|
if (e.key === STORAGE_KEYS.THEME_ID && e.newValue) {
|
|
242
|
-
const next =
|
|
243
|
-
if (next
|
|
244
|
-
|
|
245
|
-
clear()
|
|
246
|
-
}
|
|
236
|
+
const next = normalize(e.newValue)
|
|
237
|
+
if (!next) return
|
|
238
|
+
if (next !== "oc-2" && !knownThemes().has(next) && !store.themes[next]) return
|
|
247
239
|
setStore("themeId", next)
|
|
248
240
|
if (next === "oc-2") {
|
|
249
241
|
clear()
|
|
@@ -270,8 +262,8 @@ export const { use: useTheme, provider: ThemeProvider } = createSimpleContext({
|
|
|
270
262
|
}
|
|
271
263
|
makeEventListener(mediaQuery, "change", onMedia)
|
|
272
264
|
|
|
273
|
-
const rawTheme = read(STORAGE_KEYS.THEME_ID)
|
|
274
|
-
const savedTheme =
|
|
265
|
+
const rawTheme = read(STORAGE_KEYS.THEME_ID)
|
|
266
|
+
const savedTheme = normalize(rawTheme ?? props.defaultTheme) ?? "oc-2"
|
|
275
267
|
const savedScheme = (read(STORAGE_KEYS.COLOR_SCHEME) as ColorScheme | null) ?? "system"
|
|
276
268
|
if (rawTheme && rawTheme !== savedTheme) {
|
|
277
269
|
write(STORAGE_KEYS.THEME_ID, savedTheme)
|
|
@@ -293,7 +285,7 @@ export const { use: useTheme, provider: ThemeProvider } = createSimpleContext({
|
|
|
293
285
|
})
|
|
294
286
|
|
|
295
287
|
const setTheme = (id: string) => {
|
|
296
|
-
const next = id
|
|
288
|
+
const next = normalize(id)
|
|
297
289
|
if (!next) {
|
|
298
290
|
console.warn(`Theme "${id}" not found`)
|
|
299
291
|
return
|
|
@@ -333,7 +325,7 @@ export const { use: useTheme, provider: ThemeProvider } = createSimpleContext({
|
|
|
333
325
|
setColorScheme,
|
|
334
326
|
registerTheme: (theme: DesktopTheme) => setStore("themes", theme.id, theme),
|
|
335
327
|
previewTheme: (id: string) => {
|
|
336
|
-
const next = id
|
|
328
|
+
const next = normalize(id)
|
|
337
329
|
if (!next) return
|
|
338
330
|
if (next !== "oc-2" && !knownThemes().has(next) && !store.themes[next]) return
|
|
339
331
|
setStore("previewThemeId", next)
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"border-weak-base": "#DBDBDB",
|
|
26
26
|
"border-weaker-base": "#E8E8E8",
|
|
27
27
|
"icon-base": "#8F8F8F",
|
|
28
|
-
"icon-weak-base": "C7C7C7",
|
|
28
|
+
"icon-weak-base": "#C7C7C7",
|
|
29
29
|
"surface-raised-base": "#F3F3F3",
|
|
30
30
|
"surface-raised-base-hover": "#EDEDED",
|
|
31
31
|
"surface-base": "#F8F8F8",
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
[data-component="accordion-v2"] {
|
|
2
|
+
--accordion-v2-fg: var(--v2-text-text-base);
|
|
3
|
+
--accordion-v2-icon: var(--v2-icon-icon-base);
|
|
4
|
+
--accordion-v2-border: var(--v2-border-border-strong);
|
|
5
|
+
--accordion-v2-bg: var(--v2-background-bg-base);
|
|
6
|
+
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
align-items: stretch;
|
|
11
|
+
|
|
12
|
+
width: 100%;
|
|
13
|
+
background: var(--accordion-v2-bg);
|
|
14
|
+
border-radius: 6px;
|
|
15
|
+
box-shadow: 0 0 0 0.5px var(--accordion-v2-border);
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
|
|
18
|
+
color: var(--accordion-v2-fg);
|
|
19
|
+
|
|
20
|
+
-webkit-font-smoothing: antialiased;
|
|
21
|
+
-moz-osx-font-smoothing: grayscale;
|
|
22
|
+
text-rendering: geometricPrecision;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
[data-component="accordion-v2-item"] {
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
align-items: stretch;
|
|
30
|
+
width: 100%;
|
|
31
|
+
background: var(--accordion-v2-bg);
|
|
32
|
+
box-shadow: inset 0 -0.5px 0 var(--accordion-v2-border);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
[data-component="accordion-v2-item"]:last-child {
|
|
36
|
+
box-shadow: none;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
[data-slot="accordion-v2-header"] {
|
|
40
|
+
display: flex;
|
|
41
|
+
margin: 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
[data-component="accordion-v2-trigger"] {
|
|
45
|
+
box-sizing: border-box;
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: row;
|
|
48
|
+
align-items: center;
|
|
49
|
+
gap: 4px;
|
|
50
|
+
|
|
51
|
+
width: 100%;
|
|
52
|
+
min-height: 30px;
|
|
53
|
+
padding: 0 12px;
|
|
54
|
+
|
|
55
|
+
background: transparent;
|
|
56
|
+
border: 0;
|
|
57
|
+
outline: none;
|
|
58
|
+
cursor: default;
|
|
59
|
+
user-select: none;
|
|
60
|
+
|
|
61
|
+
font-size: 13px;
|
|
62
|
+
font-weight: 440;
|
|
63
|
+
line-height: 100%;
|
|
64
|
+
letter-spacing: -0.04px;
|
|
65
|
+
color: var(--accordion-v2-fg);
|
|
66
|
+
text-align: left;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
[data-component="accordion-v2-trigger"] [data-slot="accordion-v2-trigger-content"] {
|
|
70
|
+
display: flex;
|
|
71
|
+
flex: 1 1 auto;
|
|
72
|
+
flex-direction: row;
|
|
73
|
+
align-items: center;
|
|
74
|
+
gap: 8px;
|
|
75
|
+
min-width: 0;
|
|
76
|
+
height: 30px;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
[data-component="accordion-v2-trigger"] [data-slot="accordion-v2-chevron"] {
|
|
80
|
+
flex: none;
|
|
81
|
+
width: 14px;
|
|
82
|
+
height: 14px;
|
|
83
|
+
color: var(--accordion-v2-icon);
|
|
84
|
+
transition: transform 150ms ease;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
[data-component="accordion-v2-trigger"][data-expanded] [data-slot="accordion-v2-chevron"] {
|
|
88
|
+
transform: rotate(180deg);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
[data-component="accordion-v2-item"][data-expanded] [data-component="accordion-v2-trigger"] {
|
|
92
|
+
box-shadow: inset 0 -0.5px 0 var(--accordion-v2-border);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
[data-component="accordion-v2-trigger"][data-disabled] {
|
|
96
|
+
pointer-events: none;
|
|
97
|
+
opacity: 0.5;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
[data-component="accordion-v2-content"] {
|
|
101
|
+
overflow: hidden;
|
|
102
|
+
font-size: 13px;
|
|
103
|
+
line-height: 140%;
|
|
104
|
+
color: var(--accordion-v2-fg);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
[data-component="accordion-v2-content"][data-expanded] {
|
|
108
|
+
animation: accordion-v2-down 180ms ease-out;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
[data-component="accordion-v2-content"][data-closed] {
|
|
112
|
+
animation: accordion-v2-up 180ms ease-out;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
[data-component="accordion-v2-content"] [data-slot="accordion-v2-content-inner"] {
|
|
116
|
+
display: flex;
|
|
117
|
+
flex-direction: row;
|
|
118
|
+
align-items: flex-start;
|
|
119
|
+
width: 100%;
|
|
120
|
+
padding: 12px;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@keyframes accordion-v2-down {
|
|
124
|
+
from {
|
|
125
|
+
height: 0;
|
|
126
|
+
}
|
|
127
|
+
to {
|
|
128
|
+
height: var(--kb-collapsible-content-height);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
@keyframes accordion-v2-up {
|
|
133
|
+
from {
|
|
134
|
+
height: var(--kb-collapsible-content-height);
|
|
135
|
+
}
|
|
136
|
+
to {
|
|
137
|
+
height: 0;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Accordion as Kobalte } from "@kobalte/core/accordion"
|
|
2
|
+
import { Show, splitProps, type Component, type ComponentProps, type ParentProps } from "solid-js"
|
|
3
|
+
import "./accordion-v2.css"
|
|
4
|
+
|
|
5
|
+
const ChevronDown: Component = () => (
|
|
6
|
+
<svg
|
|
7
|
+
data-slot="accordion-v2-chevron"
|
|
8
|
+
width="14"
|
|
9
|
+
height="14"
|
|
10
|
+
viewBox="0 0 14 14"
|
|
11
|
+
fill="none"
|
|
12
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
13
|
+
aria-hidden="true"
|
|
14
|
+
>
|
|
15
|
+
<path d="M4 5.5L7 8.5L10 5.5" stroke="currentColor" />
|
|
16
|
+
</svg>
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
export interface AccordionV2Props extends ComponentProps<typeof Kobalte> {}
|
|
20
|
+
export interface AccordionV2ItemProps extends ComponentProps<typeof Kobalte.Item> {}
|
|
21
|
+
export interface AccordionV2HeaderProps extends ComponentProps<typeof Kobalte.Header> {}
|
|
22
|
+
export interface AccordionV2TriggerProps extends ComponentProps<typeof Kobalte.Trigger> {
|
|
23
|
+
hideChevron?: boolean
|
|
24
|
+
}
|
|
25
|
+
export interface AccordionV2ContentProps extends ComponentProps<typeof Kobalte.Content> {}
|
|
26
|
+
|
|
27
|
+
function AccordionV2Root(props: ParentProps<AccordionV2Props>) {
|
|
28
|
+
const [s, r] = splitProps(props, ["class", "classList"])
|
|
29
|
+
return <Kobalte {...r} data-component="accordion-v2" classList={{ ...s.classList, [s.class ?? ""]: !!s.class }} />
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function AccordionV2Item(props: ParentProps<AccordionV2ItemProps>) {
|
|
33
|
+
const [s, r] = splitProps(props, ["class", "classList"])
|
|
34
|
+
return (
|
|
35
|
+
<Kobalte.Item
|
|
36
|
+
{...r}
|
|
37
|
+
data-component="accordion-v2-item"
|
|
38
|
+
classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}
|
|
39
|
+
/>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function AccordionV2Header(props: ParentProps<AccordionV2HeaderProps>) {
|
|
44
|
+
const [s, r] = splitProps(props, ["class", "classList", "children"])
|
|
45
|
+
return (
|
|
46
|
+
<Kobalte.Header {...r} data-slot="accordion-v2-header" classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}>
|
|
47
|
+
{s.children}
|
|
48
|
+
</Kobalte.Header>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function AccordionV2Trigger(props: ParentProps<AccordionV2TriggerProps>) {
|
|
53
|
+
const [s, r] = splitProps(props, ["class", "classList", "children", "hideChevron"])
|
|
54
|
+
return (
|
|
55
|
+
<Kobalte.Trigger
|
|
56
|
+
{...r}
|
|
57
|
+
data-component="accordion-v2-trigger"
|
|
58
|
+
classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}
|
|
59
|
+
>
|
|
60
|
+
<span data-slot="accordion-v2-trigger-content">{s.children}</span>
|
|
61
|
+
<Show when={!s.hideChevron}>
|
|
62
|
+
<ChevronDown />
|
|
63
|
+
</Show>
|
|
64
|
+
</Kobalte.Trigger>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function AccordionV2Content(props: ParentProps<AccordionV2ContentProps>) {
|
|
69
|
+
const [s, r] = splitProps(props, ["class", "classList", "children"])
|
|
70
|
+
return (
|
|
71
|
+
<Kobalte.Content
|
|
72
|
+
{...r}
|
|
73
|
+
data-component="accordion-v2-content"
|
|
74
|
+
classList={{ ...s.classList, [s.class ?? ""]: !!s.class }}
|
|
75
|
+
>
|
|
76
|
+
<div data-slot="accordion-v2-content-inner">{s.children}</div>
|
|
77
|
+
</Kobalte.Content>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export const AccordionV2 = Object.assign(AccordionV2Root, {
|
|
82
|
+
Item: AccordionV2Item,
|
|
83
|
+
Header: AccordionV2Header,
|
|
84
|
+
Trigger: AccordionV2Trigger,
|
|
85
|
+
Content: AccordionV2Content,
|
|
86
|
+
})
|
|
@@ -31,22 +31,3 @@
|
|
|
31
31
|
background: var(--v2-background-bg-accent);
|
|
32
32
|
color: var(--v2-text-text-contrast);
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
[data-component="tag"][data-appearance="standard"] {
|
|
36
|
-
height: 18px;
|
|
37
|
-
padding: 0 6px;
|
|
38
|
-
border-radius: var(--radius-xs);
|
|
39
|
-
font-family: var(--font-family-sans);
|
|
40
|
-
font-size: var(--font-size-small);
|
|
41
|
-
font-style: normal;
|
|
42
|
-
font-weight: var(--font-weight-medium);
|
|
43
|
-
line-height: var(--line-height-large);
|
|
44
|
-
letter-spacing: var(--letter-spacing-normal);
|
|
45
|
-
font-variant-numeric: normal;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
[data-component="tag"][data-appearance="standard"][data-variant="neutral"] {
|
|
49
|
-
border: 0.5px solid var(--border-weak-base);
|
|
50
|
-
background: var(--surface-raised-base);
|
|
51
|
-
color: var(--text-base);
|
|
52
|
-
}
|
|
@@ -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,
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Button as Kobalte } from "@kobalte/core/button"
|
|
2
2
|
import { type ComponentProps, Show, createMemo, splitProps } from "solid-js"
|
|
3
|
-
import { Icon, type IconProps } from "
|
|
4
|
-
import "./button.css"
|
|
3
|
+
import { Icon, type IconProps } from "./icon"
|
|
4
|
+
import "./button-v2.css"
|
|
5
5
|
|
|
6
|
-
export interface
|
|
7
|
-
extends ComponentProps<typeof
|
|
6
|
+
export interface ButtonV2Props
|
|
7
|
+
extends ComponentProps<typeof Kobalte>,
|
|
8
8
|
Pick<ComponentProps<"button">, "class" | "classList" | "children"> {
|
|
9
9
|
size?: "small" | "normal" | "large"
|
|
10
10
|
variant?: "neutral" | "danger" | "warning" | "outline" | "contrast" | "ghost" | "ghost-muted" | "loading"
|
|
11
11
|
icon?: IconProps["name"]
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export function
|
|
14
|
+
export function ButtonV2(props: ButtonV2Props) {
|
|
15
15
|
const [split, rest] = splitProps(props, ["variant", "size", "icon", "class", "classList"])
|
|
16
16
|
const resolvedIcon = createMemo(() => split.icon)
|
|
17
17
|
return (
|
|
18
|
-
<
|
|
18
|
+
<Kobalte
|
|
19
19
|
{...rest}
|
|
20
20
|
data-component="button-v2"
|
|
21
21
|
data-size={split.size || "normal"}
|
|
@@ -30,6 +30,6 @@ export function Button(props: ButtonProps) {
|
|
|
30
30
|
<Icon name={resolvedIcon()!} />
|
|
31
31
|
</Show>
|
|
32
32
|
{props.children}
|
|
33
|
-
</
|
|
33
|
+
</Kobalte>
|
|
34
34
|
)
|
|
35
35
|
}
|