@opencode-ai/ui 0.0.0-next-17078 → 0.0.0-next-17079

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.
Files changed (166) hide show
  1. package/dist/context/i18n.d.ts +10 -1
  2. package/dist/context/marked-parser.d.ts +2 -0
  3. package/dist/context/marked-theme-register.d.ts +1 -0
  4. package/dist/context/marked-theme.d.ts +2 -0
  5. package/dist/context/marked.d.ts +2 -9
  6. package/dist/i18n/am.d.ts +1 -0
  7. package/dist/i18n/ar.d.ts +38 -0
  8. package/dist/i18n/az.d.ts +1 -0
  9. package/dist/i18n/bg.d.ts +193 -0
  10. package/dist/i18n/bn.d.ts +1 -0
  11. package/dist/i18n/br.d.ts +26 -0
  12. package/dist/i18n/bs.d.ts +26 -0
  13. package/dist/i18n/ca.d.ts +1 -0
  14. package/dist/i18n/cs.d.ts +1 -0
  15. package/dist/i18n/da.d.ts +22 -0
  16. package/dist/i18n/de.d.ts +22 -0
  17. package/dist/i18n/dv.d.ts +1 -0
  18. package/dist/i18n/dz.d.ts +1 -0
  19. package/dist/i18n/el.d.ts +1 -0
  20. package/dist/i18n/es.d.ts +26 -0
  21. package/dist/i18n/et.d.ts +1 -0
  22. package/dist/i18n/fa.d.ts +1 -0
  23. package/dist/i18n/fi.d.ts +1 -0
  24. package/dist/i18n/fo.d.ts +1 -0
  25. package/dist/i18n/fr.d.ts +26 -0
  26. package/dist/i18n/hi.d.ts +1 -0
  27. package/dist/i18n/hr.d.ts +1 -0
  28. package/dist/i18n/hu.d.ts +1 -0
  29. package/dist/i18n/hy.d.ts +1 -0
  30. package/dist/i18n/id.d.ts +1 -0
  31. package/dist/i18n/is.d.ts +1 -0
  32. package/dist/i18n/it.d.ts +1 -0
  33. package/dist/i18n/ja.d.ts +22 -0
  34. package/dist/i18n/ka.d.ts +1 -0
  35. package/dist/i18n/km.d.ts +193 -0
  36. package/dist/i18n/ko.d.ts +22 -0
  37. package/dist/i18n/lo.d.ts +193 -0
  38. package/dist/i18n/lt.d.ts +1 -0
  39. package/dist/i18n/lv.d.ts +1 -0
  40. package/dist/i18n/mk.d.ts +193 -0
  41. package/dist/i18n/mn.d.ts +193 -0
  42. package/dist/i18n/ms.d.ts +1 -0
  43. package/dist/i18n/my.d.ts +193 -0
  44. package/dist/i18n/ne.d.ts +1 -0
  45. package/dist/i18n/nl.d.ts +1 -0
  46. package/dist/i18n/pa.d.ts +1 -0
  47. package/dist/i18n/pl.d.ts +30 -0
  48. package/dist/i18n/ro.d.ts +1 -0
  49. package/dist/i18n/ru.d.ts +30 -0
  50. package/dist/i18n/si.d.ts +1 -0
  51. package/dist/i18n/sk.d.ts +1 -0
  52. package/dist/i18n/sl.d.ts +1 -0
  53. package/dist/i18n/sq.d.ts +1 -0
  54. package/dist/i18n/sr.d.ts +197 -0
  55. package/dist/i18n/sv.d.ts +1 -0
  56. package/dist/i18n/tg.d.ts +193 -0
  57. package/dist/i18n/th.d.ts +22 -0
  58. package/dist/i18n/tk.d.ts +1 -0
  59. package/dist/i18n/tr.d.ts +22 -0
  60. package/dist/i18n/ur.d.ts +1 -0
  61. package/dist/i18n/uz.d.ts +1 -0
  62. package/dist/i18n/vi.d.ts +1 -0
  63. package/dist/i18n/zh.d.ts +22 -0
  64. package/dist/i18n/zht.d.ts +22 -0
  65. package/dist/v2/components/toast-v2.d.ts +19 -10
  66. package/package.json +3 -3
  67. package/src/components/diff-changes.css +2 -0
  68. package/src/components/dropdown-menu.css +2 -2
  69. package/src/components/icon.css +5 -0
  70. package/src/components/icon.tsx +12 -1
  71. package/src/components/provider-icons/sprite.svg +2 -27
  72. package/src/components/resize-handle.css +14 -2
  73. package/src/components/resize-handle.tsx +5 -1
  74. package/src/components/scroll-view.css +1 -1
  75. package/src/components/select.css +5 -3
  76. package/src/components/switch.css +4 -0
  77. package/src/components/tabs.css +54 -26
  78. package/src/components/tabs.tsx +1 -0
  79. package/src/components/text-field.css +2 -2
  80. package/src/components/toast.css +1 -1
  81. package/src/context/i18n.tsx +38 -2
  82. package/src/context/marked-parser.tsx +68 -0
  83. package/src/context/marked-theme-register.tsx +10 -0
  84. package/src/context/marked-theme.tsx +372 -0
  85. package/src/context/marked.tsx +20 -562
  86. package/src/i18n/am.ts +194 -0
  87. package/src/i18n/ar.ts +62 -22
  88. package/src/i18n/az.ts +195 -0
  89. package/src/i18n/bg.ts +195 -0
  90. package/src/i18n/bn.ts +197 -0
  91. package/src/i18n/br.ts +34 -6
  92. package/src/i18n/bs.ts +51 -23
  93. package/src/i18n/ca.ts +199 -0
  94. package/src/i18n/cs.ts +203 -0
  95. package/src/i18n/da.ts +36 -12
  96. package/src/i18n/de.ts +58 -36
  97. package/src/i18n/dv.ts +196 -0
  98. package/src/i18n/dz.ts +197 -0
  99. package/src/i18n/el.ts +195 -0
  100. package/src/i18n/en.ts +24 -0
  101. package/src/i18n/es.ts +45 -17
  102. package/src/i18n/et.ts +195 -0
  103. package/src/i18n/fa.ts +195 -0
  104. package/src/i18n/fi.ts +195 -0
  105. package/src/i18n/fo.ts +195 -0
  106. package/src/i18n/fr.ts +51 -21
  107. package/src/i18n/hi.ts +197 -0
  108. package/src/i18n/hr.ts +200 -0
  109. package/src/i18n/hu.ts +197 -0
  110. package/src/i18n/hy.ts +195 -0
  111. package/src/i18n/id.ts +217 -0
  112. package/src/i18n/is.ts +195 -0
  113. package/src/i18n/it.ts +200 -0
  114. package/src/i18n/ja.ts +29 -5
  115. package/src/i18n/ka.ts +195 -0
  116. package/src/i18n/km.ts +196 -0
  117. package/src/i18n/ko.ts +36 -12
  118. package/src/i18n/lo.ts +195 -0
  119. package/src/i18n/lt.ts +203 -0
  120. package/src/i18n/lv.ts +199 -0
  121. package/src/i18n/mk.ts +195 -0
  122. package/src/i18n/mn.ts +195 -0
  123. package/src/i18n/ms.ts +195 -0
  124. package/src/i18n/my.ts +196 -0
  125. package/src/i18n/ne.ts +197 -0
  126. package/src/i18n/nl.ts +195 -0
  127. package/src/i18n/no.ts +47 -23
  128. package/src/i18n/pa.ts +196 -0
  129. package/src/i18n/pl.ts +57 -24
  130. package/src/i18n/ro.ts +199 -0
  131. package/src/i18n/ru.ts +55 -23
  132. package/src/i18n/si.ts +195 -0
  133. package/src/i18n/sk.ts +203 -0
  134. package/src/i18n/sl.ts +204 -0
  135. package/src/i18n/sq.ts +195 -0
  136. package/src/i18n/sr.ts +200 -0
  137. package/src/i18n/sv.ts +195 -0
  138. package/src/i18n/tg.ts +195 -0
  139. package/src/i18n/th.ts +44 -21
  140. package/src/i18n/tk.ts +195 -0
  141. package/src/i18n/tr.ts +49 -25
  142. package/src/i18n/uk.ts +47 -15
  143. package/src/i18n/ur.ts +196 -0
  144. package/src/i18n/uz.ts +198 -0
  145. package/src/i18n/vi.ts +195 -0
  146. package/src/i18n/zh.ts +52 -29
  147. package/src/i18n/zht.ts +45 -22
  148. package/src/theme/themes/oc-2.json +4 -2
  149. package/src/v2/components/button-v2.css +2 -2
  150. package/src/v2/components/dialog-v2.css +2 -2
  151. package/src/v2/components/dialog-v2.tsx +3 -1
  152. package/src/v2/components/diff-changes-v2.css +2 -0
  153. package/src/v2/components/file-tree-v2.css +6 -2
  154. package/src/v2/components/inline-input-v2.tsx +3 -1
  155. package/src/v2/components/line-comment-v2.css +1 -1
  156. package/src/v2/components/line-comment-v2.tsx +6 -4
  157. package/src/v2/components/select-v2.css +16 -5
  158. package/src/v2/components/switch-v2.css +8 -0
  159. package/src/v2/components/tabs-v2.css +4 -6
  160. package/src/v2/components/tabs-v2.tsx +4 -2
  161. package/src/v2/components/text-input-v2.css +7 -5
  162. package/src/v2/components/text-input-v2.tsx +7 -1
  163. package/src/v2/components/toast-v2.css +132 -122
  164. package/src/v2/components/toast-v2.tsx +208 -73
  165. package/dist/context/marked-code-span.d.ts +0 -10
  166. package/src/context/marked-code-span.ts +0 -17
@@ -1,5 +1,6 @@
1
1
  import { type ComponentProps, type JSX, Show, splitProps } from "solid-js"
2
2
  import { Icon } from "./icon"
3
+ import { useI18n } from "../../context/i18n"
3
4
  import "./inline-input-v2.css"
4
5
 
5
6
  export interface InlineInputV2Props extends Omit<ComponentProps<"input">, "type" | "prefix"> {
@@ -22,6 +23,7 @@ export interface InlineInputV2Props extends Omit<ComponentProps<"input">, "type"
22
23
  }
23
24
 
24
25
  export function InlineInputV2(props: InlineInputV2Props) {
26
+ const i18n = useI18n()
25
27
  const [local, inputProps] = splitProps(props, [
26
28
  "class",
27
29
  "classList",
@@ -92,7 +94,7 @@ export function InlineInputV2(props: InlineInputV2Props) {
92
94
  <button
93
95
  type="button"
94
96
  data-slot="inline-input-v2-icon-button"
95
- aria-label={local.copyLabel ?? "Copy"}
97
+ aria-label={local.copyLabel ?? i18n.t("ui.message.copy")}
96
98
  disabled={local.disabled}
97
99
  onClick={local.onCopyClick}
98
100
  >
@@ -228,7 +228,7 @@
228
228
  border-radius: 4px;
229
229
  background: transparent;
230
230
  color: var(--v2-text-text-base);
231
- text-align: left;
231
+ text-align: start;
232
232
  cursor: pointer;
233
233
  }
234
234
 
@@ -1,5 +1,6 @@
1
1
  import { For, Show, createSignal, onMount, splitProps, type ComponentProps, type JSX } from "solid-js"
2
2
  import { FileIcon } from "../../components/file-icon"
3
+ import { useI18n } from "../../context/i18n"
3
4
  import { useFilteredList } from "../../hooks"
4
5
  import { ButtonV2 } from "./button-v2"
5
6
  import "./line-comment-v2.css"
@@ -86,6 +87,7 @@ function pathDirectory(path: string) {
86
87
  }
87
88
 
88
89
  export function LineCommentEditorV2(props: LineCommentEditorV2Props) {
90
+ const i18n = useI18n()
89
91
  let textareaRef: HTMLTextAreaElement | undefined
90
92
  const [mentionOpen, setMentionOpen] = createSignal(false)
91
93
 
@@ -106,7 +108,7 @@ export function LineCommentEditorV2(props: LineCommentEditorV2Props) {
106
108
  "classList",
107
109
  ])
108
110
 
109
- const heading = () => local.heading ?? "Comment"
111
+ const heading = () => local.heading ?? i18n.t("ui.lineComment.submit")
110
112
  const canSubmit = () => local.value.trim().length > 0
111
113
 
112
114
  const closeMention = () => {
@@ -211,7 +213,7 @@ export function LineCommentEditorV2(props: LineCommentEditorV2Props) {
211
213
  }}
212
214
  data-slot="line-comment-v2-textarea"
213
215
  rows={local.rows ?? 3}
214
- placeholder={local.placeholder ?? "Add context for this change"}
216
+ placeholder={local.placeholder ?? i18n.t("ui.lineComment.contextPlaceholder")}
215
217
  value={local.value}
216
218
  onInput={(e) => {
217
219
  local.onInput(e.currentTarget.value)
@@ -291,10 +293,10 @@ export function LineCommentEditorV2(props: LineCommentEditorV2Props) {
291
293
  <div data-slot="line-comment-v2-footer-meta">{local.selection}</div>
292
294
  <div data-slot="line-comment-v2-footer-actions">
293
295
  <ButtonV2 type="button" size="normal" variant="neutral" onClick={() => local.onCancel()}>
294
- {local.cancelLabel ?? "Cancel"}
296
+ {local.cancelLabel ?? i18n.t("ui.lineComment.cancel")}
295
297
  </ButtonV2>
296
298
  <ButtonV2 type="button" size="normal" variant="contrast" disabled={!canSubmit()} onClick={submit}>
297
- {local.submitLabel ?? "Comment"}
299
+ {local.submitLabel ?? i18n.t("ui.lineComment.submit")}
298
300
  </ButtonV2>
299
301
  </div>
300
302
  </div>
@@ -52,7 +52,8 @@
52
52
  display: flex;
53
53
  flex-direction: row;
54
54
  align-items: stretch;
55
- padding: 0 6px 0 0;
55
+ padding-block: 0;
56
+ padding-inline: 0 6px;
56
57
  gap: 8px;
57
58
  width: 280px;
58
59
  height: 28px;
@@ -74,7 +75,8 @@
74
75
 
75
76
  [data-component="select-v2"][data-appearance="large"] {
76
77
  height: 32px;
77
- padding: 0 8px 0 0;
78
+ padding-block: 0;
79
+ padding-inline: 0 8px;
78
80
  }
79
81
 
80
82
  [data-component="select-v2"]:where(:hover):not([data-disabled], [data-invalid]):not(:focus-within):not(
@@ -126,12 +128,13 @@
126
128
  overflow: hidden;
127
129
  text-overflow: ellipsis;
128
130
  white-space: nowrap;
129
- padding: 0 0 0 8px;
131
+ padding-block: 0;
132
+ padding-inline: 8px 0;
130
133
  margin: 0;
131
134
  border: 0;
132
135
  background: transparent;
133
136
  outline: none;
134
- text-align: left;
137
+ text-align: start;
135
138
  font-style: normal;
136
139
  font-weight: 440;
137
140
  font-size: 13px;
@@ -188,7 +191,8 @@
188
191
  width: fit-content;
189
192
  max-width: 100%;
190
193
  height: 24px;
191
- padding: 4px 4px 4px 8px;
194
+ padding-block: 4px;
195
+ padding-inline: 8px 4px;
192
196
  gap: 4px;
193
197
  border-radius: 4px;
194
198
  background: transparent;
@@ -278,6 +282,13 @@
278
282
  color: var(--menu-v2-accent);
279
283
  }
280
284
 
285
+ [data-slot="select-v2-listbox"]
286
+ [data-component="menu-v2-item"][data-selected]
287
+ [data-slot="menu-v2-item-indicator"]
288
+ svg {
289
+ visibility: visible;
290
+ }
291
+
281
292
  [data-slot="select-v2-listbox"]
282
293
  [data-component="menu-v2-item"]:not([data-selected])
283
294
  [data-slot="menu-v2-item-indicator"]
@@ -121,6 +121,10 @@
121
121
  var(--v2-grey-300);
122
122
  }
123
123
 
124
+ &:dir(rtl)[data-checked] [data-slot="switch-thumb"] {
125
+ transform: translateX(-8px);
126
+ }
127
+
124
128
  &[data-checked]:hover:not([data-disabled], [data-readonly]) [data-slot="switch-control"] {
125
129
  background:
126
130
  linear-gradient(
@@ -135,6 +139,10 @@
135
139
  transform: translateX(7px);
136
140
  }
137
141
 
142
+ &:dir(rtl)[data-checked]:hover:not([data-disabled], [data-readonly]) [data-slot="switch-thumb"] {
143
+ transform: translateX(-7px);
144
+ }
145
+
138
146
  &[data-disabled] {
139
147
  cursor: not-allowed;
140
148
  }
@@ -71,7 +71,7 @@
71
71
  [data-component="tabs-v2"] [data-slot="tabs-v2-close-button"] {
72
72
  width: 20px;
73
73
  height: 20px;
74
- margin-left: -5px;
74
+ margin-inline-start: -5px;
75
75
  flex: none;
76
76
  display: flex;
77
77
  align-items: center;
@@ -109,7 +109,7 @@
109
109
  background-color: var(--v2-border-border-base);
110
110
  position: absolute;
111
111
  bottom: 0px;
112
- left: -8px;
112
+ inset-inline-start: -8px;
113
113
  }
114
114
 
115
115
  [data-component="tabs-v2"][data-variant="pill"][data-orientation="horizontal"] [data-slot="tabs-v2-list"] {
@@ -183,12 +183,12 @@
183
183
  padding: 12px;
184
184
  gap: 4px;
185
185
  overflow-y: auto;
186
- border-right: 1px solid var(--v2-border-border-base);
186
+ border-inline-end: 1px solid var(--v2-border-border-base);
187
187
  }
188
188
 
189
189
  [data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"] [data-slot="tabs-v2-section-title"] {
190
190
  width: 100%;
191
- padding-left: 4px;
191
+ padding-inline-start: 4px;
192
192
  color: var(--v2-text-text-muted);
193
193
  font-size: 12px;
194
194
  font-weight: 500;
@@ -199,7 +199,6 @@
199
199
  width: 100%;
200
200
  height: 28px;
201
201
  border-radius: 4px;
202
- border: 0.5px solid transparent;
203
202
  box-sizing: border-box;
204
203
  color: var(--v2-text-text-muted);
205
204
  }
@@ -222,5 +221,4 @@
222
221
  [data-slot="tabs-v2-trigger-wrapper"]:has([data-selected]) {
223
222
  background-color: var(--v2-background-bg-layer-03);
224
223
  color: var(--v2-text-text-base);
225
- border: 0.5px solid var(--v2-border-border-muted);
226
224
  }
@@ -1,6 +1,7 @@
1
1
  import { Tabs as Kobalte } from "@kobalte/core/tabs"
2
2
  import { Show, splitProps, type JSX } from "solid-js"
3
3
  import type { ComponentProps, ParentProps, Component } from "solid-js"
4
+ import { useI18n } from "../../context/i18n"
4
5
  import "./tabs-v2.css"
5
6
 
6
7
  export interface TabsV2Props extends ComponentProps<typeof Kobalte> {
@@ -74,7 +75,7 @@ function TabsV2Trigger(props: ParentProps<TabsV2TriggerProps>) {
74
75
  {split.children}
75
76
  <Show when={split.subtext}>
76
77
  {(subtext) => (
77
- <span data-slot="tabs-v2-subtext" class="ml-2 text-xs text-text-weak">
78
+ <span data-slot="tabs-v2-subtext" class="ms-2 text-xs text-text-weak">
78
79
  {subtext()}
79
80
  </span>
80
81
  )}
@@ -86,12 +87,13 @@ function TabsV2Trigger(props: ParentProps<TabsV2TriggerProps>) {
86
87
  }
87
88
 
88
89
  function TabsV2CloseButton(props: TabsV2CloseButtonProps) {
90
+ const i18n = useI18n()
89
91
  const [split, rest] = splitProps(props, ["class", "classList", "onClick"])
90
92
  return (
91
93
  <div
92
94
  role="button"
93
95
  tabindex={0}
94
- aria-label="Close tab"
96
+ aria-label={i18n.t("ui.tabs.close")}
95
97
  data-slot="tabs-v2-close-button"
96
98
  {...rest}
97
99
  classList={{
@@ -3,7 +3,8 @@
3
3
  display: flex;
4
4
  flex-direction: row;
5
5
  align-items: stretch;
6
- padding: 0 8px 0 0;
6
+ padding-block: 0;
7
+ padding-inline: 0 8px;
7
8
  gap: 8px;
8
9
  width: 280px;
9
10
  height: 28px;
@@ -64,7 +65,7 @@
64
65
  flex: none;
65
66
  align-items: center;
66
67
  justify-content: center;
67
- padding-left: 8px;
68
+ padding-inline-start: 8px;
68
69
  color: var(--v2-icon-icon-muted);
69
70
  }
70
71
 
@@ -74,7 +75,7 @@
74
75
  }
75
76
 
76
77
  [data-component="text-input-v2"][data-leading-icon] [data-slot="text-input-v2-input"] {
77
- padding-left: 0;
78
+ padding-inline-start: 0;
78
79
  }
79
80
 
80
81
  [data-component="text-input-v2"] [data-slot="text-input-v2-input"] {
@@ -82,7 +83,8 @@
82
83
  width: 100%;
83
84
  min-width: 0;
84
85
  height: 100%;
85
- padding: 0 0 0 8px;
86
+ padding-block: 0;
87
+ padding-inline: 8px 0;
86
88
  margin: 0;
87
89
  border: 0;
88
90
  background: transparent;
@@ -165,7 +167,7 @@
165
167
  height: 28px;
166
168
  padding: 0;
167
169
  border-radius: 6px;
168
- margin-right: -8px;
170
+ margin-inline-end: -8px;
169
171
  }
170
172
 
171
173
  [data-component="text-input-v2"][data-invalid]:not([data-disabled]) [data-slot="text-input-v2-input"] {
@@ -1,5 +1,6 @@
1
1
  import { type ComponentProps, type JSX, Show, splitProps } from "solid-js"
2
2
  import { Icon } from "./icon"
3
+ import { useI18n } from "../../context/i18n"
3
4
  import "./text-input-v2.css"
4
5
 
5
6
  export interface TextInputV2Props extends Omit<ComponentProps<"input">, "type"> {
@@ -25,6 +26,7 @@ export interface TextInputV2Props extends Omit<ComponentProps<"input">, "type">
25
26
  }
26
27
 
27
28
  export function TextInputV2(props: TextInputV2Props) {
29
+ const i18n = useI18n()
28
30
  const [local, inputProps] = splitProps(props, [
29
31
  "class",
30
32
  "classList",
@@ -71,7 +73,11 @@ export function TextInputV2(props: TextInputV2Props) {
71
73
  type="button"
72
74
  data-slot="text-input-v2-icon-button"
73
75
  data-variant={local.showClearButton ? "clear" : "copy"}
74
- aria-label={local.showClearButton ? (local.clearLabel ?? "Clear") : (local.copyLabel ?? "Copy")}
76
+ aria-label={
77
+ local.showClearButton
78
+ ? (local.clearLabel ?? i18n.t("ui.common.clear"))
79
+ : (local.copyLabel ?? i18n.t("ui.message.copy"))
80
+ }
75
81
  disabled={local.disabled}
76
82
  onMouseDown={(event) => {
77
83
  if (!local.showClearButton) return
@@ -1,114 +1,133 @@
1
- [data-component="toast-v2-region"] {
2
- position: fixed;
3
- bottom: 48px;
4
- right: 32px;
1
+ .toast-v2-region {
5
2
  z-index: 1000;
6
- display: flex;
7
- flex-direction: column;
8
- gap: 12px;
9
3
  max-width: min(320px, calc(100vw - 64px));
10
- max-height: none;
11
- width: 100%;
12
- overflow: visible;
13
4
  pointer-events: none;
14
-
15
- [data-slot="toast-v2-list"] {
16
- display: flex;
17
- flex-direction: column;
18
- gap: 12px;
19
- list-style: none;
20
- margin: 0;
21
- padding: 0;
22
- max-height: none;
23
- overflow-y: visible;
24
- overflow-x: visible;
25
- scrollbar-width: none;
26
-
27
- &::-webkit-scrollbar {
28
- display: none;
29
- }
30
- }
5
+ user-select: none;
6
+ -webkit-user-select: none;
31
7
  }
32
8
 
33
- [data-component="toast-v2"] {
34
- position: relative;
35
- display: flex;
36
- flex-direction: column;
37
- gap: 12px;
9
+ .toast-v2 {
10
+ display: grid;
11
+ grid-template-columns: minmax(0, 1fr) 20px;
12
+ column-gap: 12px;
13
+ row-gap: 12px;
38
14
  width: 320px;
15
+ max-width: 100%;
39
16
  padding: 12px;
40
17
  max-height: min(420px, calc(100dvh - 96px));
41
18
  overflow: hidden;
42
19
  pointer-events: auto;
43
- transition: transform 140ms ease-out;
44
-
20
+ box-sizing: border-box;
21
+ outline: none;
22
+ user-select: none;
23
+ -webkit-user-select: none;
45
24
  border-radius: 8px;
46
25
  color: var(--v2-text-text-base);
47
26
  background: var(--v2-background-bg-layer-01);
48
27
  box-shadow: var(--v2-elevation-floating);
28
+ transition:
29
+ transform 280ms cubic-bezier(0.2, 0, 0, 1),
30
+ opacity 160ms ease-out,
31
+ height 280ms cubic-bezier(0.2, 0, 0, 1),
32
+ box-shadow 160ms ease-out;
33
+
34
+ &:has(> [data-icon]) {
35
+ grid-template-columns: 16px minmax(0, 1fr) 20px;
36
+ }
49
37
 
50
- &[data-opened] {
51
- animation: toastV2PopIn 140ms ease-out;
38
+ &:focus-visible {
39
+ box-shadow:
40
+ var(--v2-elevation-floating),
41
+ 0 0 0 2px var(--v2-border-border-focus);
52
42
  }
53
43
 
54
- &[data-closed] {
55
- animation: toastV2PopOut 100ms ease-in forwards;
44
+ &[data-expanded="true"] {
45
+ overflow: visible;
56
46
  }
57
47
 
58
- [data-slot="toast-v2-header"] {
59
- display: flex;
60
- align-items: flex-start;
61
- gap: 12px;
62
- width: 100%;
48
+ &[data-expanded="false"][data-front="false"] > * {
49
+ opacity: 0;
63
50
  }
64
51
 
65
- [data-slot="toast-v2-icon"] {
66
- flex-shrink: 0;
52
+ &[data-expanded="false"][data-front="false"] {
53
+ --y: translateY(calc(-1 * var(--toasts-before) * 9.5px)) scale(calc(1 - var(--toasts-before) * 0.05));
54
+ }
55
+
56
+ > [data-icon] {
57
+ grid-column: 1;
58
+ grid-row: 1;
59
+ align-self: start;
67
60
  display: flex;
68
61
  align-items: center;
69
62
  justify-content: center;
70
63
  width: 16px;
71
64
  height: 20px;
72
- min-width: 16px;
73
- min-height: 20px;
74
65
  color: var(--v2-icon-icon-base);
75
-
76
- [data-component="icon"] {
77
- color: var(--v2-icon-icon-base);
78
- width: 16px;
79
- height: 16px;
80
- display: inline-flex;
81
- align-items: center;
82
- justify-content: center;
83
- }
84
-
85
- > * {
86
- width: 16px;
87
- height: 16px;
88
- display: inline-flex;
89
- align-items: center;
90
- justify-content: center;
91
- flex-shrink: 0;
92
- }
93
-
94
- svg {
95
- width: 16px;
96
- height: 16px;
97
- display: block;
98
- flex-shrink: 0;
99
- }
100
66
  }
101
67
 
102
- [data-slot="toast-v2-content"] {
103
- flex: 1;
68
+ > [data-content] {
69
+ grid-column: 1;
70
+ grid-row: 1;
104
71
  display: flex;
105
72
  flex-direction: column;
106
73
  gap: 4px;
107
- min-height: 0;
108
74
  min-width: 0;
109
75
  overflow: hidden;
110
76
  }
111
77
 
78
+ &:has(> [data-icon]) > [data-content] {
79
+ grid-column: 2;
80
+ }
81
+
82
+ > [data-close-button] {
83
+ grid-column: 2;
84
+ grid-row: 1;
85
+ position: static;
86
+ align-self: start;
87
+ width: 20px;
88
+ height: 20px;
89
+ min-width: 20px;
90
+ min-height: 20px;
91
+ padding: 0;
92
+ border: 0;
93
+ border-radius: 4px;
94
+ transform: none;
95
+ background: transparent;
96
+ color: var(--v2-icon-icon-muted);
97
+ cursor: pointer;
98
+ display: inline-flex;
99
+ align-items: center;
100
+ justify-content: center;
101
+ }
102
+
103
+ &:has(> [data-icon]) > [data-close-button] {
104
+ grid-column: 3;
105
+ }
106
+
107
+ > [data-close-button]:hover {
108
+ background: var(--v2-overlay-simple-overlay-hover);
109
+ color: var(--v2-icon-icon-base);
110
+ }
111
+
112
+ > [data-close-button]:active {
113
+ background: var(--v2-overlay-simple-overlay-pressed);
114
+ }
115
+
116
+ > [data-close-button]:focus-visible {
117
+ outline: 2px solid var(--v2-border-border-focus);
118
+ outline-offset: 2px;
119
+ }
120
+
121
+ > [data-icon] > *,
122
+ > [data-icon] svg,
123
+ > [data-close-button] svg {
124
+ width: 16px;
125
+ height: 16px;
126
+ display: block;
127
+ flex-shrink: 0;
128
+ }
129
+
130
+ [data-title],
112
131
  [data-slot="toast-v2-title"] {
113
132
  color: var(--v2-text-text-base);
114
133
  overflow: hidden;
@@ -123,6 +142,7 @@
123
142
  margin: 0;
124
143
  }
125
144
 
145
+ [data-description],
126
146
  [data-slot="toast-v2-description"] {
127
147
  color: var(--v2-text-text-muted);
128
148
  text-wrap-style: pretty;
@@ -138,10 +158,15 @@
138
158
  }
139
159
 
140
160
  [data-slot="toast-v2-actions"] {
161
+ grid-column: 1;
162
+ grid-row: 2;
141
163
  display: flex;
142
164
  flex-wrap: wrap;
143
165
  gap: 8px;
144
- padding-left: 28px;
166
+ }
167
+
168
+ &:has(> [data-icon]) [data-slot="toast-v2-actions"] {
169
+ grid-column: 2;
145
170
  }
146
171
 
147
172
  [data-slot="toast-v2-actions"] [data-component="button-v2"] {
@@ -154,62 +179,47 @@
154
179
  font-synthesis: none;
155
180
  }
156
181
 
157
- [data-slot="toast-v2-close-button"] {
182
+ [data-slot="toast-v2-header"] {
183
+ display: flex;
184
+ align-items: flex-start;
185
+ gap: 12px;
186
+ width: 100%;
187
+ }
188
+
189
+ [data-slot="toast-v2-icon"] {
158
190
  flex-shrink: 0;
159
- width: 20px;
160
- height: 20px;
161
- min-width: 20px;
162
- min-height: 20px;
163
- padding: 0;
164
- border: 0;
165
- border-radius: 4px;
166
- background: transparent;
167
- color: var(--v2-icon-icon-muted);
168
- cursor: pointer;
169
- display: inline-flex;
191
+ display: flex;
170
192
  align-items: center;
171
193
  justify-content: center;
194
+ width: 16px;
195
+ height: 20px;
196
+ color: var(--v2-icon-icon-base);
197
+ }
172
198
 
173
- &:hover {
174
- background: var(--v2-overlay-simple-overlay-hover);
175
- color: var(--v2-icon-icon-base);
176
- }
177
-
178
- &:active {
179
- background: var(--v2-overlay-simple-overlay-pressed);
180
- }
181
-
182
- &:focus-visible {
183
- outline: 2px solid var(--v2-border-border-focus);
184
- outline-offset: 2px;
185
- }
186
-
187
- svg {
188
- width: 16px;
189
- height: 16px;
190
- display: block;
191
- }
199
+ [data-slot="toast-v2-content"] {
200
+ flex: 1;
201
+ display: flex;
202
+ flex-direction: column;
203
+ gap: 4px;
204
+ min-width: 0;
205
+ overflow: hidden;
192
206
  }
193
207
  }
194
208
 
195
- @keyframes toastV2PopIn {
196
- from {
197
- opacity: 0.8;
198
- transform: translateY(6px);
199
- }
200
- to {
201
- transform: translateY(0);
202
- opacity: 1;
209
+ @media (prefers-reduced-motion: reduce) {
210
+ .toast-v2,
211
+ .toast-v2 > * {
212
+ animation: none !important;
213
+ transition: none !important;
203
214
  }
204
215
  }
205
216
 
206
- @keyframes toastV2PopOut {
207
- from {
208
- transform: translateY(0);
209
- opacity: 1;
217
+ @media (max-width: 600px) {
218
+ .toast-v2-region {
219
+ max-width: calc(100vw - 32px);
210
220
  }
211
- to {
212
- transform: translateY(6px);
213
- opacity: 0.8;
221
+
222
+ .toast-v2 {
223
+ width: 100%;
214
224
  }
215
225
  }