@slotted/styles 0.1.0-beta.4 → 0.1.0-beta.40

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 (221) hide show
  1. package/package.json +21 -1
  2. package/src/accordion/accordion.css +31 -13
  3. package/src/accordion/accordion.tokens.json +2 -0
  4. package/src/action-bar/action-bar.css +47 -44
  5. package/src/action-bar/action-bar.tokens.json +1 -0
  6. package/src/action-sheet/action-sheet.css +39 -39
  7. package/src/alert/alert.css +97 -97
  8. package/src/alert/alert.tokens.json +6 -1
  9. package/src/app-shell/app-shell.css +472 -342
  10. package/src/app-shell/app-shell.tokens.json +6 -3
  11. package/src/aspect-ratio/aspect-ratio.css +24 -23
  12. package/src/attachment/attachment.css +118 -114
  13. package/src/avatar/avatar.css +97 -67
  14. package/src/avatar/avatar.tokens.json +8 -0
  15. package/src/avatar-group/avatar-group.css +22 -23
  16. package/src/badge/badge.css +58 -47
  17. package/src/badge/badge.tokens.json +6 -0
  18. package/src/breadcrumb/breadcrumb.css +52 -52
  19. package/src/button/button.css +408 -93
  20. package/src/button/button.tokens.json +13 -0
  21. package/src/button-group/button-group.css +80 -79
  22. package/src/button-group/button-group.tokens.json +1 -0
  23. package/src/calendar/calendar.css +594 -267
  24. package/src/calendar/calendar.tokens.json +35 -3
  25. package/src/card/card.css +133 -70
  26. package/src/card/card.tokens.json +1 -0
  27. package/src/carousel/carousel.css +158 -169
  28. package/src/cascader/cascader.css +174 -159
  29. package/src/cascader/cascader.tokens.json +2 -0
  30. package/src/chart/chart.css +300 -271
  31. package/src/chart/chart.tokens.json +5 -0
  32. package/src/checkbox/checkbox.css +190 -148
  33. package/src/checkbox/checkbox.tokens.json +4 -0
  34. package/src/checkbox-group/checkbox-group.css +7 -7
  35. package/src/clock/clock.css +246 -0
  36. package/src/clock/clock.tokens.json +44 -0
  37. package/src/code-block/code-block.css +85 -89
  38. package/src/collapsible/collapsible.css +273 -85
  39. package/src/collapsible/collapsible.tokens.json +6 -0
  40. package/src/color-picker/color-picker.css +106 -114
  41. package/src/column-manager/column-manager.css +111 -119
  42. package/src/combobox/combobox.css +219 -132
  43. package/src/combobox/combobox.tokens.json +4 -0
  44. package/src/command-palette/command-palette.css +214 -102
  45. package/src/command-palette/command-palette.tokens.json +4 -0
  46. package/src/container/container.css +27 -27
  47. package/src/context-menu/context-menu.css +9 -9
  48. package/src/currency-field/currency-field.css +119 -119
  49. package/src/currency-field/currency-field.tokens.json +1 -0
  50. package/src/dashboard-grid/dashboard-grid.css +231 -115
  51. package/src/dashboard-grid/dashboard-grid.tokens.json +3 -1
  52. package/src/data-grid/data-grid.css +637 -496
  53. package/src/data-grid/data-grid.tokens.json +5 -1
  54. package/src/data-list/data-list.css +93 -76
  55. package/src/data-list/data-list.tokens.json +2 -1
  56. package/src/date-field/date-field.css +62 -57
  57. package/src/date-field/date-field.tokens.json +1 -0
  58. package/src/date-picker/date-picker.css +31 -269
  59. package/src/date-picker/date-picker.tokens.json +1 -21
  60. package/src/date-range-picker/date-range-picker.css +72 -528
  61. package/src/date-range-picker/date-range-picker.tokens.json +1 -37
  62. package/src/datetime-field/datetime-field.css +90 -90
  63. package/src/datetime-field/datetime-field.tokens.json +1 -0
  64. package/src/datetime-picker/datetime-picker.css +49 -711
  65. package/src/datetime-picker/datetime-picker.tokens.json +1 -50
  66. package/src/datetime-range-picker/datetime-range-picker.css +60 -985
  67. package/src/datetime-range-picker/datetime-range-picker.tokens.json +1 -67
  68. package/src/description-list/description-list.css +120 -76
  69. package/src/description-list/description-list.tokens.json +1 -0
  70. package/src/detail-panel/detail-panel.css +86 -71
  71. package/src/detail-panel/detail-panel.tokens.json +2 -0
  72. package/src/dialog/dialog.css +462 -199
  73. package/src/dialog/dialog.tokens.json +10 -0
  74. package/src/divider/divider.css +20 -20
  75. package/src/drawer/drawer.css +736 -237
  76. package/src/drawer/drawer.tokens.json +15 -0
  77. package/src/entity-picker/entity-picker.css +402 -272
  78. package/src/entity-picker/entity-picker.tokens.json +6 -0
  79. package/src/event-calendar/event-calendar.css +357 -399
  80. package/src/field/field.css +106 -93
  81. package/src/field/field.tokens.json +2 -0
  82. package/src/field-group/field-group.css +58 -38
  83. package/src/field-group/field-group.tokens.json +3 -0
  84. package/src/filter-bar/filter-bar.css +224 -216
  85. package/src/floating-panel/floating-panel.css +147 -0
  86. package/src/floating-panel/floating-panel.tokens.json +32 -0
  87. package/src/form/form.css +103 -26
  88. package/src/form/form.tokens.json +6 -1
  89. package/src/fullscreen/fullscreen.css +26 -27
  90. package/src/grid/grid.css +32 -31
  91. package/src/highlight/highlight.css +11 -11
  92. package/src/hover-card/hover-card.css +9 -9
  93. package/src/icon/icon.css +67 -20
  94. package/src/icon/icon.tokens.json +1 -0
  95. package/src/image/image.css +42 -42
  96. package/src/import-export-center/import-export-center.css +147 -168
  97. package/src/import-export-center/import-export-center.tokens.json +1 -0
  98. package/src/inline/inline.css +29 -29
  99. package/src/inline-message/inline-message.css +162 -86
  100. package/src/inline-message/inline-message.tokens.json +5 -0
  101. package/src/kbd/kbd.css +63 -51
  102. package/src/kbd/kbd.tokens.json +4 -0
  103. package/src/link/link.css +54 -33
  104. package/src/link/link.tokens.json +4 -0
  105. package/src/list/list.css +55 -24
  106. package/src/list/list.tokens.json +2 -0
  107. package/src/list-item/list-item.css +195 -80
  108. package/src/list-item/list-item.tokens.json +10 -0
  109. package/src/listbox/listbox.css +121 -72
  110. package/src/listbox/listbox.tokens.json +6 -1
  111. package/src/loading-overlay/loading-overlay.css +86 -103
  112. package/src/markdown/markdown.css +20 -20
  113. package/src/media-viewer/media-viewer.css +790 -0
  114. package/src/media-viewer/media-viewer.tokens.json +53 -0
  115. package/src/menu/menu.css +166 -83
  116. package/src/menu/menu.tokens.json +3 -1
  117. package/src/menubar/menubar.css +16 -16
  118. package/src/message/message.css +1296 -1243
  119. package/src/message/message.tokens.json +14 -0
  120. package/src/message-scroller/message-scroller.css +323 -320
  121. package/src/meter/meter.css +136 -0
  122. package/src/meter/meter.tokens.json +23 -0
  123. package/src/multi-select/multi-select.css +246 -174
  124. package/src/multi-select/multi-select.tokens.json +3 -0
  125. package/src/navigation-menu/navigation-menu.css +170 -191
  126. package/src/navigation-menu/navigation-menu.tokens.json +1 -0
  127. package/src/notification-center/notification-center.css +155 -163
  128. package/src/notification-center/notification-center.tokens.json +4 -0
  129. package/src/number-field/number-field.css +93 -93
  130. package/src/number-field/number-field.tokens.json +1 -0
  131. package/src/otp-input/otp-input.css +74 -64
  132. package/src/otp-input/otp-input.tokens.json +1 -0
  133. package/src/page/page.css +109 -31
  134. package/src/page/page.tokens.json +8 -0
  135. package/src/page-header/page-header.css +342 -287
  136. package/src/page-header/page-header.tokens.json +6 -1
  137. package/src/pagination/pagination.css +75 -79
  138. package/src/picker-panel/picker-panel.css +1074 -0
  139. package/src/picker-panel/picker-panel.tokens.json +77 -0
  140. package/src/popover/popover.css +85 -65
  141. package/src/popover/popover.tokens.json +2 -0
  142. package/src/progress-indicator/progress-indicator.css +194 -137
  143. package/src/progress-indicator/progress-indicator.tokens.json +1 -0
  144. package/src/prompt-composer/prompt-composer.css +274 -116
  145. package/src/prompt-composer/prompt-composer.tokens.json +15 -0
  146. package/src/prose/prose.css +77 -82
  147. package/src/radio-group/radio-group.css +107 -112
  148. package/src/rating/rating.css +147 -143
  149. package/src/rating/rating.tokens.json +2 -0
  150. package/src/result-state/result-state.css +95 -102
  151. package/src/result-state/result-state.tokens.json +1 -0
  152. package/src/runtime-properties.mjs +44 -6
  153. package/src/saved-views/saved-views.css +43 -49
  154. package/src/scroll-area/scroll-area.css +50 -37
  155. package/src/section/section.css +311 -46
  156. package/src/section/section.tokens.json +13 -1
  157. package/src/segmented-control/segmented-control.css +221 -133
  158. package/src/segmented-control/segmented-control.tokens.json +7 -11
  159. package/src/select/select.css +226 -149
  160. package/src/select/select.tokens.json +4 -0
  161. package/src/side-navigation/side-navigation.css +204 -201
  162. package/src/side-navigation/side-navigation.tokens.json +2 -0
  163. package/src/skeleton/skeleton.css +76 -58
  164. package/src/slider/slider.css +108 -104
  165. package/src/slider/slider.tokens.json +1 -0
  166. package/src/sparkline/sparkline.css +75 -53
  167. package/src/sparkline/sparkline.tokens.json +2 -0
  168. package/src/spinner/spinner.css +83 -180
  169. package/src/spinner/spinner.tokens.json +0 -1
  170. package/src/split-button/split-button.css +34 -35
  171. package/src/split-button/split-button.tokens.json +1 -0
  172. package/src/splitter/splitter.css +47 -48
  173. package/src/stack/stack.css +26 -26
  174. package/src/stat-card/stat-card.css +420 -245
  175. package/src/stat-card/stat-card.tokens.json +8 -0
  176. package/src/status-indicator/status-indicator.css +126 -101
  177. package/src/status-indicator/status-indicator.tokens.json +0 -3
  178. package/src/stepper/stepper.css +78 -82
  179. package/src/switch/switch.css +143 -125
  180. package/src/switch/switch.tokens.json +4 -0
  181. package/src/table/table.css +653 -222
  182. package/src/table/table.tokens.json +10 -0
  183. package/src/table-of-contents/table-of-contents.css +60 -59
  184. package/src/table-of-contents/table-of-contents.tokens.json +1 -0
  185. package/src/tabs/tabs.css +327 -294
  186. package/src/tabs/tabs.tokens.json +7 -1
  187. package/src/tag/tag.css +113 -89
  188. package/src/tag/tag.tokens.json +11 -0
  189. package/src/tags-input/tags-input.css +152 -87
  190. package/src/tags-input/tags-input.tokens.json +7 -1
  191. package/src/text-field/text-field.css +146 -148
  192. package/src/text-field/text-field.tokens.json +1 -0
  193. package/src/textarea/textarea.css +38 -33
  194. package/src/textarea/textarea.tokens.json +1 -0
  195. package/src/time-field/time-field.css +82 -77
  196. package/src/time-field/time-field.tokens.json +1 -0
  197. package/src/time-picker/time-picker.css +30 -519
  198. package/src/time-picker/time-picker.tokens.json +1 -38
  199. package/src/time-range-picker/time-range-picker.css +53 -895
  200. package/src/time-range-picker/time-range-picker.tokens.json +1 -66
  201. package/src/timeline/timeline.css +280 -292
  202. package/src/timeline/timeline.tokens.json +5 -0
  203. package/src/toast/toast.css +139 -122
  204. package/src/toast/toast.tokens.json +7 -0
  205. package/src/toggle/toggle.css +34 -38
  206. package/src/toggle-group/toggle-group.css +73 -77
  207. package/src/toolbar/toolbar.css +49 -40
  208. package/src/toolbar/toolbar.tokens.json +2 -1
  209. package/src/tooltip/tooltip.css +95 -39
  210. package/src/tooltip/tooltip.tokens.json +1 -0
  211. package/src/top-navigation/top-navigation.css +253 -269
  212. package/src/top-navigation/top-navigation.tokens.json +1 -0
  213. package/src/tour/tour.css +68 -74
  214. package/src/tour/tour.tokens.json +1 -0
  215. package/src/transfer/transfer.css +164 -168
  216. package/src/tree/tree.css +118 -122
  217. package/src/typography/typography.css +67 -38
  218. package/src/typography/typography.tokens.json +2 -0
  219. package/src/upload/upload.css +256 -257
  220. package/src/visually-hidden/visually-hidden.css +1 -1
  221. package/src/wizard/wizard.css +187 -199
@@ -0,0 +1,790 @@
1
+ @layer slotted.components {
2
+ /**
3
+ * The viewer stands inside `dialog`'s content, which `fullScreen="always"`
4
+ * and `surface="plain"` make the whole viewport with no panel of its own.
5
+ * Like `upload`'s viewer, the family's identifier is on a box inside the
6
+ * content rather than around the dialog: the dialog portals its content to
7
+ * the end of the document, so a rule written under an outer root would match
8
+ * nothing.
9
+ *
10
+ * One grid, four rows: the bar, the stage, the caption and the thumbnails.
11
+ * The previous and next buttons and the zoom pill stand in the stage's row
12
+ * over the stage, placed by the grid rather than by a positioned wrapper,
13
+ * so the stage keeps the whole row as its scrollport.
14
+ */
15
+ [data-ui-media-viewer] {
16
+ --_ground: var(
17
+ --slotted-media-viewer-ground,
18
+ color-mix(in oklab, var(--slotted-surface) 35%, black)
19
+ );
20
+ --_ink: var(--slotted-text, CanvasText);
21
+ --_ink-muted: var(--slotted-text-muted, GrayText);
22
+ --_gap: var(--slotted-space-4, 0.5rem);
23
+ --_bar-padding-block: var(--slotted-space-3, 0.375rem);
24
+ --_bar-padding-inline: var(--slotted-space-4, 0.5rem);
25
+ --_control-size: var(--slotted-control-height-md, 2.25rem);
26
+ --_control-glyph: var(--slotted-control-icon-size-lg, 18px);
27
+ --_step-size: var(--slotted-control-height-lg, 2.75rem);
28
+ --_hover: var(--slotted-tone-secondary-subtle-hover);
29
+ --_press: var(--slotted-tone-secondary-subtle-active);
30
+ --_radius: var(--slotted-media-viewer-control-radius, var(--slotted-control-radius, 4px));
31
+ --_transition:
32
+ background-color var(--slotted-control-transition-duration)
33
+ var(--slotted-control-transition-easing),
34
+ color var(--slotted-control-transition-duration) var(--slotted-control-transition-easing),
35
+ scale var(--slotted-control-transition-duration) var(--slotted-control-transition-easing);
36
+
37
+ background-color: var(--_ground);
38
+ block-size: 100%;
39
+ color: var(--_ink);
40
+ container-name: media-viewer;
41
+ container-type: inline-size;
42
+ display: grid;
43
+ /* The dialog's content is a three-row grid; the viewer takes all three, as upload's does. */
44
+ grid-row: 1 / -1;
45
+ grid-template-columns: minmax(0, 1fr);
46
+ grid-template-rows: auto minmax(0, 1fr) auto auto;
47
+ inline-size: 100%;
48
+ isolation: isolate;
49
+ overflow: hidden;
50
+ }
51
+
52
+ /*
53
+ * In the high-contrast scheme the reader asked for the page's own black on
54
+ * white, and the viewer keeps it: the ground is the surface, not a dark mix
55
+ * of it. The binding writes `data-slotted-scheme="dark"` in every other
56
+ * scheme, so the bar's tokens read on the dark ground.
57
+ */
58
+ [data-ui-media-viewer][data-slotted-scheme='high-contrast'] {
59
+ --_ground: var(--slotted-media-viewer-ground, var(--slotted-surface, Canvas));
60
+ }
61
+
62
+ /* ── The bar ──────────────────────────────────────────────────────────── */
63
+
64
+ /*
65
+ * The name at the start, the actions and then close at the end: where every
66
+ * surveyed viewer and this library's own dialog put the way out. The start
67
+ * gets the stage's own inset, so the name lines up with what sits under it;
68
+ * the end gets the controls' smaller one, so close keeps its corner.
69
+ */
70
+ [data-ui-media-viewer] > [data-part-bar] {
71
+ align-items: center;
72
+ column-gap: var(--_gap);
73
+ display: grid;
74
+ grid-row: 1;
75
+ grid-template-columns: minmax(0, 1fr) auto auto;
76
+ min-block-size: calc(var(--_control-size) + 2 * var(--_bar-padding-block));
77
+ padding-block: var(--_bar-padding-block);
78
+ padding-inline: var(--slotted-space-6, 1rem) var(--_bar-padding-inline);
79
+ }
80
+
81
+ [data-ui-media-viewer] [data-part-heading] {
82
+ display: grid;
83
+ min-inline-size: 0;
84
+ }
85
+
86
+ /*
87
+ * The name is cut in the middle: the stem shrinks to an ellipsis and the
88
+ * extension stays, as `attachment` cuts it, because the extension is what
89
+ * says what the file is. The binding splits the name into two spans; the
90
+ * whole name stays in the document and in `title`. `dir="auto"` orders the
91
+ * run in its own direction, and the box stands at the start of the bar's
92
+ * direction, where the position under it stands.
93
+ */
94
+ [data-ui-media-viewer] [data-part-title] {
95
+ display: flex;
96
+ /* The box is the name's width and stands at the bar's start: inside it the
97
+ flex follows the name's own direction, which is not the bar's. */
98
+ justify-self: start;
99
+ max-inline-size: 100%;
100
+ font-size: var(--slotted-font-size-md, 0.875rem);
101
+ font-weight: var(--slotted-font-weight-semibold, 600);
102
+ line-height: var(--slotted-line-height-sm, 1.25);
103
+ margin: 0;
104
+ min-inline-size: 0;
105
+ unicode-bidi: isolate;
106
+ white-space: nowrap;
107
+ }
108
+
109
+ [data-ui-media-viewer] [data-part-title] > span:first-child {
110
+ min-inline-size: 0;
111
+ overflow: hidden;
112
+ text-overflow: ellipsis;
113
+ }
114
+
115
+ [data-ui-media-viewer] [data-part-title] > span:last-child:not(:first-child) {
116
+ flex: none;
117
+ }
118
+
119
+ [data-ui-media-viewer] [data-part-position] {
120
+ color: var(--_ink-muted);
121
+ font-size: var(--slotted-font-size-xs, 0.75rem);
122
+ font-variant-numeric: tabular-nums;
123
+ line-height: var(--slotted-line-height-sm, 1.25);
124
+ justify-self: start;
125
+ margin: 0;
126
+ }
127
+
128
+ [data-ui-media-viewer] [data-part-actions] {
129
+ align-items: center;
130
+ display: inline-flex;
131
+ gap: var(--slotted-space-1, 0.125rem);
132
+ }
133
+
134
+ /*
135
+ * The bar's controls are inner controls (R2): a glyph and a ground that
136
+ * appears on hover, square, at the control height of the bar. `download`
137
+ * is an `a download`, so its underline and visited color are reset.
138
+ */
139
+ [data-ui-media-viewer] :is([data-part-close], [data-part-download]),
140
+ [data-ui-media-viewer] [data-part-zoom] > button {
141
+ align-items: center;
142
+ appearance: none;
143
+ background-color: transparent;
144
+ block-size: var(--_control-size);
145
+ border: 0;
146
+ border-radius: var(--_radius);
147
+ box-sizing: border-box;
148
+ color: inherit;
149
+ cursor: pointer;
150
+ display: inline-flex;
151
+ flex: none;
152
+ font: inherit;
153
+ inline-size: var(--_control-size);
154
+ justify-content: center;
155
+ padding: 0;
156
+ text-decoration: none;
157
+ transition: var(--_transition);
158
+ }
159
+
160
+ [data-ui-media-viewer] :is([data-part-close], [data-part-download]) > [data-ui-icon],
161
+ [data-ui-media-viewer] [data-part-zoom] > button > [data-ui-icon] {
162
+ --slotted-icon-size: var(--_control-glyph);
163
+ }
164
+
165
+ /* ── The stage ────────────────────────────────────────────────────────── */
166
+
167
+ /**
168
+ * The stage is the scrollport of a zoomed picture. It is a flex container
169
+ * and the frame inside it has `margin: auto`: the frame is centerd while it
170
+ * fits, and once it is larger every edge stays reachable. `place-items:
171
+ * center` would center the overflow too and cut the frame's start, which no
172
+ * scroll reaches.
173
+ *
174
+ * `touch-action: none` hands every finger to the binding: one finger pans a
175
+ * zoomed picture or swipes a fitted one, two fingers pinch. The browser's
176
+ * own pinch would zoom the page under the layer.
177
+ */
178
+ [data-ui-media-viewer] > [data-part-stage] {
179
+ display: flex;
180
+ grid-column: 1;
181
+ grid-row: 2;
182
+ min-block-size: 0;
183
+ outline: none;
184
+ overflow: auto;
185
+ overscroll-behavior: contain;
186
+ position: relative;
187
+ /* No scrollbar: one that appeared as the picture outgrew the stage narrowed the stage
188
+ mid-gesture and moved the point under the pointer. The picture pans by a drag, a
189
+ finger and the arrows. */
190
+ scrollbar-width: none;
191
+ touch-action: none;
192
+ }
193
+
194
+ [data-ui-media-viewer] > [data-part-stage][data-zoomed] {
195
+ cursor: grab;
196
+ }
197
+
198
+ [data-ui-media-viewer] > [data-part-stage][data-panning] {
199
+ cursor: grabbing;
200
+ }
201
+
202
+ /*
203
+ * The ring of a focused stage is drawn inside it, because the stage reaches
204
+ * the bar above and the edge of the viewport on every other side.
205
+ */
206
+ [data-ui-media-viewer] > [data-part-stage]:focus-visible {
207
+ outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
208
+ outline-offset: calc(var(--slotted-focus-ring-width, 2px) * -1);
209
+ }
210
+
211
+ /**
212
+ * At the fit the stylesheet sizes the picture alone: its own size, capped at
213
+ * the stage on both axes and centerd by `margin: auto`, which is `contain`
214
+ * that never enlarges. Nothing is measured before the first paint, and a
215
+ * server render is already right. The frame steps out of the layout there.
216
+ *
217
+ * Zoomed or turned, the binding writes the frame's size,
218
+ * `--slotted-media-viewer-frame-inline-size` and `-block-size`, with the two
219
+ * axes swapped at a quarter turn so the stage's scroll extent is the turned
220
+ * picture's, and the picture's own size inside it; `data-sized` says so.
221
+ *
222
+ * A change of level snaps. It is driven by a wheel, a pinch or a repeated
223
+ * key, and the point under the pointer stays still only if the size and the
224
+ * scroll change in the same frame; a size that eased would drag the point
225
+ * away and back.
226
+ */
227
+ [data-ui-media-viewer] [data-part-frame]:not([data-sized]) {
228
+ display: contents;
229
+ }
230
+
231
+ [data-ui-media-viewer] [data-part-frame]:not([data-sized]) > img[data-part-media] {
232
+ margin: auto;
233
+ max-block-size: 100%;
234
+ max-inline-size: 100%;
235
+ }
236
+
237
+ /*
238
+ * The picture is taken out of the frame's flow and centerd on it, so the
239
+ * frame's size is the turned picture's alone: in the flow, an unturned
240
+ * portrait three hundred pixels tall stretched a frame two hundred tall and
241
+ * the turned picture sat a hundred pixels low.
242
+ */
243
+ [data-ui-media-viewer] [data-part-frame][data-sized] {
244
+ block-size: var(--slotted-media-viewer-frame-block-size);
245
+ flex: none;
246
+ inline-size: var(--slotted-media-viewer-frame-inline-size);
247
+ margin: auto;
248
+ position: relative;
249
+ }
250
+
251
+ [data-ui-media-viewer] [data-part-frame][data-sized] > img[data-part-media] {
252
+ block-size: var(--slotted-media-viewer-media-block-size);
253
+ inline-size: var(--slotted-media-viewer-media-inline-size);
254
+ inset-block-start: 50%;
255
+ inset-inline-start: 50%;
256
+ max-inline-size: none;
257
+ position: absolute;
258
+ rotate: var(--slotted-media-viewer-rotation, 0deg);
259
+ translate: -50% -50%;
260
+ }
261
+
262
+ [data-ui-media-viewer] img[data-part-media] {
263
+ display: block;
264
+ flex: none;
265
+ min-block-size: 0;
266
+ min-inline-size: 0;
267
+ -webkit-user-drag: none;
268
+ user-select: none;
269
+ }
270
+
271
+ /*
272
+ * Each new item fades in from the ground; the old one is gone at once,
273
+ * because the step is the reader's own press and the next picture is what
274
+ * they asked to see.
275
+ */
276
+ @starting-style {
277
+ [data-ui-media-viewer] [data-part-media] {
278
+ opacity: 0;
279
+ }
280
+ }
281
+
282
+ [data-ui-media-viewer] [data-part-media] {
283
+ transition: opacity var(--slotted-duration-short) var(--slotted-easing-enter);
284
+ }
285
+
286
+ /*
287
+ * While the picture loads it is its own skeleton: an item that states its
288
+ * size gives the `img` that size before a byte arrives (`width` and
289
+ * `height`), and the box is painted on a raised ground until it loads. An
290
+ * item that states no size draws nothing, and the status alone says it is
291
+ * loading.
292
+ */
293
+ [data-ui-media-viewer] [data-part-frame][data-loading] > img[data-part-media] {
294
+ aspect-ratio: auto;
295
+ background-color: color-mix(in oklab, var(--_ink) 8%, transparent);
296
+ border-radius: var(--slotted-radius-sm, 2px);
297
+ color: transparent;
298
+ }
299
+
300
+ /*
301
+ * A frame for a PDF or a text file takes the whole stage, and the browser's
302
+ * reader inside it scrolls and zooms. The text frame is painted on the
303
+ * surface because a plain text file has no ground of its own.
304
+ */
305
+ [data-ui-media-viewer] > [data-part-stage] > iframe[data-part-media] {
306
+ align-self: stretch;
307
+ background-color: var(--slotted-surface, Canvas);
308
+ border: 0;
309
+ flex: 1 1 auto;
310
+ min-inline-size: 0;
311
+ }
312
+
313
+ [data-ui-media-viewer] > [data-part-stage] > :is(video, audio)[data-part-media] {
314
+ margin: auto;
315
+ max-block-size: 100%;
316
+ max-inline-size: 100%;
317
+ }
318
+
319
+ /* ── Text ────────────────────────────────────────────────────────────── */
320
+
321
+ /**
322
+ * A text file is a page of the surface on the dark ground: the monospace
323
+ * face, the lines wrapped at the page's measure, and the stage scrolling it
324
+ * as a reader scrolls a document. The finger scrolls it too, which a
325
+ * picture's stage hands to the binding instead.
326
+ */
327
+ [data-ui-media-viewer] > [data-part-stage][data-kind='text'] {
328
+ touch-action: auto;
329
+ }
330
+
331
+ [data-ui-media-viewer] [data-part-text] {
332
+ align-self: flex-start;
333
+ display: grid;
334
+ gap: var(--slotted-space-4, 0.5rem);
335
+ inline-size: min(
336
+ 100% - 2 * var(--slotted-space-6, 1rem),
337
+ var(--slotted-media-viewer-text-measure, 56rem)
338
+ );
339
+ margin-block: var(--slotted-space-6, 1rem);
340
+ margin-inline: auto;
341
+ }
342
+
343
+ [data-ui-media-viewer] [data-part-text] > pre {
344
+ background-color: var(--slotted-media-viewer-text-surface, var(--slotted-surface, Canvas));
345
+ border: var(--slotted-border-width-thin, 1px) solid var(--slotted-border-subtle);
346
+ border-radius: var(--slotted-radius-md, 6px);
347
+ color: var(--slotted-text, CanvasText);
348
+ font-family: var(--slotted-font-family-mono, ui-monospace, monospace);
349
+ font-size: var(--slotted-font-size-sm, 0.8125rem);
350
+ line-height: var(--slotted-line-height-md, 1.5);
351
+ margin: 0;
352
+ min-inline-size: 0;
353
+ overflow-wrap: anywhere;
354
+ padding-block: var(--slotted-space-6, 1rem);
355
+ padding-inline: var(--slotted-space-7, 1.25rem);
356
+ tab-size: 2;
357
+ white-space: pre-wrap;
358
+ }
359
+
360
+ [data-ui-media-viewer] [data-part-text] > p {
361
+ color: var(--_ink-muted);
362
+ font-size: var(--slotted-font-size-xs, 0.75rem);
363
+ margin: 0;
364
+ text-align: center;
365
+ }
366
+
367
+ /* ── A file the viewer cannot draw, and one that did not load ────────── */
368
+
369
+ /**
370
+ * Both answers share one anatomy, centerd on the ground: the file's tile
371
+ * with its extension, a heading that says what happened, one sentence that
372
+ * says what to do, and the actions that do it. The download is the solid
373
+ * one, because it is the way to the file in both cases; trying again is
374
+ * the outlined one beside it.
375
+ */
376
+ [data-ui-media-viewer] :is([data-part-unsupported], [data-part-status][data-error]) {
377
+ display: grid;
378
+ justify-items: center;
379
+ margin: auto;
380
+ max-inline-size: min(26rem, 100% - 2 * var(--slotted-space-6, 1rem));
381
+ padding: var(--slotted-space-7, 1.25rem);
382
+ text-align: center;
383
+ }
384
+
385
+ /* The tile is a sheet of paper, taller than wide, with the extension as a label across its foot. */
386
+ [data-ui-media-viewer] [data-part-tile] {
387
+ --slotted-icon-size: var(--slotted-media-viewer-tile-glyph-size, 2rem);
388
+
389
+ background-color: color-mix(in oklab, var(--_ink) 6%, transparent);
390
+ block-size: var(--slotted-media-viewer-tile-size, 5rem);
391
+ border: var(--slotted-border-width-thin, 1px) solid
392
+ color-mix(in oklab, var(--_ink) 14%, transparent);
393
+ border-radius: var(--slotted-radius-lg, 8px);
394
+ color: var(--_ink-muted);
395
+ display: grid;
396
+ inline-size: calc(var(--slotted-media-viewer-tile-size, 5rem) * 0.8);
397
+ margin-block-end: var(--slotted-space-7, 1.25rem);
398
+ place-items: center;
399
+ position: relative;
400
+ }
401
+
402
+ [data-ui-media-viewer] [data-part-tile] > span:not([data-ui-icon]) {
403
+ background-color: var(--_ink);
404
+ border-radius: var(--slotted-radius-sm, 2px);
405
+ color: var(--_ground);
406
+ font-size: var(--slotted-font-size-xs, 0.75rem);
407
+ font-weight: var(--slotted-font-weight-semibold, 600);
408
+ inset-block-end: calc(-1 * var(--slotted-space-3, 0.375rem));
409
+ letter-spacing: 0.04em;
410
+ line-height: var(--slotted-line-height-sm, 1.25);
411
+ max-inline-size: calc(100% + 2 * var(--slotted-space-4, 0.5rem));
412
+ overflow: hidden;
413
+ padding-block: var(--slotted-space-1, 0.125rem);
414
+ padding-inline: var(--slotted-space-3, 0.375rem);
415
+ position: absolute;
416
+ text-overflow: ellipsis;
417
+ white-space: nowrap;
418
+ }
419
+
420
+ [data-ui-media-viewer] :is([data-part-unsupported], [data-part-status]) > h3 {
421
+ color: var(--_ink);
422
+ font-size: var(--slotted-font-size-md, 0.875rem);
423
+ font-weight: var(--slotted-font-weight-semibold, 600);
424
+ line-height: var(--slotted-line-height-sm, 1.25);
425
+ margin: 0;
426
+ }
427
+
428
+ [data-ui-media-viewer] :is([data-part-unsupported], [data-part-status]) > p {
429
+ color: var(--_ink-muted);
430
+ font-size: var(--slotted-font-size-sm, 0.8125rem);
431
+ line-height: var(--slotted-line-height-md, 1.5);
432
+ margin-block: var(--slotted-space-2, 0.25rem) 0;
433
+ max-inline-size: 34ch;
434
+ text-wrap: balance;
435
+ }
436
+
437
+ [data-ui-media-viewer] :is([data-part-unsupported], [data-part-status]) > div {
438
+ display: flex;
439
+ flex-wrap: wrap;
440
+ gap: var(--slotted-space-3, 0.375rem);
441
+ justify-content: center;
442
+ margin-block-start: var(--slotted-space-7, 1.25rem);
443
+ }
444
+
445
+ [data-ui-media-viewer]
446
+ :is([data-part-unsupported], [data-part-status])
447
+ > div
448
+ > :is([data-part-download], [data-part-retry]) {
449
+ align-items: center;
450
+ appearance: none;
451
+ block-size: var(--_control-size);
452
+ border: var(--slotted-border-width-thin, 1px) solid transparent;
453
+ border-radius: var(--slotted-radius-full, 9999px);
454
+ /*
455
+ * One box model for both: an `a` is content-box and a `button` border-box
456
+ * with a pixel of padding from the user agent, and the download stood two
457
+ * pixels taller than the retry beside it.
458
+ */
459
+ box-sizing: border-box;
460
+ cursor: pointer;
461
+ display: inline-flex;
462
+ font: inherit;
463
+ font-size: var(--slotted-font-size-sm, 0.8125rem);
464
+ font-weight: var(--slotted-font-weight-medium, 500);
465
+ gap: var(--slotted-space-3, 0.375rem);
466
+ inline-size: auto;
467
+ padding-block: 0;
468
+ padding-inline: var(--slotted-space-5, 0.75rem) var(--slotted-space-6, 1rem);
469
+ text-decoration: none;
470
+ transition: var(--_transition);
471
+ }
472
+
473
+ [data-ui-media-viewer]
474
+ :is([data-part-unsupported], [data-part-status])
475
+ > div
476
+ > :is([data-part-download], [data-part-retry])
477
+ > [data-ui-icon] {
478
+ --slotted-icon-size: var(--slotted-control-icon-size-md, 16px);
479
+ }
480
+
481
+ [data-ui-media-viewer]
482
+ :is([data-part-unsupported], [data-part-status])
483
+ > div
484
+ > [data-part-download] {
485
+ background-color: var(--_ink);
486
+ color: var(--_ground);
487
+ }
488
+
489
+ [data-ui-media-viewer]
490
+ :is([data-part-unsupported], [data-part-status])
491
+ > div
492
+ > [data-part-download]:not(:disabled, [aria-disabled='true']):hover {
493
+ background-color: color-mix(in oklab, var(--_ink) 88%, var(--_ground));
494
+ }
495
+
496
+ [data-ui-media-viewer]
497
+ :is([data-part-unsupported], [data-part-status])
498
+ > div
499
+ > [data-part-download]:not(:disabled, [aria-disabled='true']):active {
500
+ background-color: color-mix(in oklab, var(--_ink) 78%, var(--_ground));
501
+ }
502
+
503
+ [data-ui-media-viewer]
504
+ :is([data-part-unsupported], [data-part-status])
505
+ > div
506
+ > [data-part-retry] {
507
+ background-color: transparent;
508
+ border-color: color-mix(in oklab, var(--_ink) 24%, transparent);
509
+ color: var(--_ink);
510
+ }
511
+
512
+ [data-ui-media-viewer]
513
+ :is([data-part-unsupported], [data-part-status])
514
+ > div
515
+ > [data-part-retry]:not(:disabled):hover {
516
+ background-color: var(--_hover);
517
+ }
518
+
519
+ [data-ui-media-viewer]
520
+ :is([data-part-unsupported], [data-part-status])
521
+ > div
522
+ > [data-part-retry]:not(:disabled):active {
523
+ background-color: var(--_press);
524
+ }
525
+
526
+ [data-ui-media-viewer] [data-part-retry]:focus-visible,
527
+ [data-ui-media-viewer]
528
+ :is([data-part-unsupported], [data-part-status])
529
+ [data-part-download]:focus-visible {
530
+ outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
531
+ outline-offset: var(--slotted-focus-ring-offset, 2px);
532
+ }
533
+
534
+ /* While loading, the status is only announced; the frame is what is seen. */
535
+ [data-ui-media-viewer] [data-part-status]:not([data-error]) {
536
+ block-size: 1px;
537
+ clip-path: inset(50%);
538
+ inline-size: 1px;
539
+ overflow: hidden;
540
+ position: absolute;
541
+ white-space: nowrap;
542
+ }
543
+
544
+ /* ── Previous and next ───────────────────────────────────────────────── */
545
+
546
+ /**
547
+ * Two circles over the stage's sides, on a raised ground so they read on a
548
+ * white photograph as well as on the dark ground. They stand in the stage's
549
+ * grid row and the stage stays under them as the scrollport.
550
+ */
551
+ [data-ui-media-viewer] > :is([data-part-previous], [data-part-next]) {
552
+ align-items: center;
553
+ align-self: center;
554
+ appearance: none;
555
+ background-color: var(--slotted-media-viewer-step-surface, var(--slotted-surface-raised));
556
+ block-size: var(--_step-size);
557
+ border: var(--slotted-border-width-thin, 1px) solid var(--slotted-border-subtle);
558
+ border-radius: var(--slotted-radius-full, 9999px);
559
+ box-shadow: var(--slotted-shadow-md);
560
+ color: var(--_ink);
561
+ cursor: pointer;
562
+ display: inline-flex;
563
+ grid-column: 1;
564
+ grid-row: 2;
565
+ inline-size: var(--_step-size);
566
+ justify-content: center;
567
+ margin-inline: var(--slotted-space-6, 1rem);
568
+ padding: 0;
569
+ transition: var(--_transition);
570
+ z-index: 1;
571
+ }
572
+
573
+ [data-ui-media-viewer] > [data-part-previous] {
574
+ justify-self: start;
575
+ }
576
+
577
+ [data-ui-media-viewer] > [data-part-next] {
578
+ justify-self: end;
579
+ }
580
+
581
+ [data-ui-media-viewer] > :is([data-part-previous], [data-part-next]) > [data-ui-icon] {
582
+ --slotted-icon-size: var(--slotted-control-icon-size-lg, 18px);
583
+ }
584
+
585
+ /*
586
+ * At an end without `loop` the button stays where it was, flat and muted:
587
+ * it says the set ends here rather than vanishing under the pointer that
588
+ * was about to press it.
589
+ */
590
+ [data-ui-media-viewer] > :is([data-part-previous], [data-part-next]):disabled {
591
+ background-color: color-mix(in oklab, var(--slotted-surface-raised) 60%, transparent);
592
+ box-shadow: none;
593
+ color: var(--_ink-muted);
594
+ cursor: default;
595
+ }
596
+
597
+ /*
598
+ * A phone steps with the swipe, and two circles over a picture three
599
+ * hundred pixels wide cover a third of it. Hidden, not removed: the keys and
600
+ * a screen reader still reach them.
601
+ */
602
+ @container media-viewer (width < 600px) {
603
+ [data-ui-media-viewer] > :is([data-part-previous], [data-part-next]) {
604
+ block-size: 1px;
605
+ clip-path: inset(50%);
606
+ inline-size: 1px;
607
+ margin: 0;
608
+ overflow: hidden;
609
+ position: absolute;
610
+ }
611
+ }
612
+
613
+ /* ── The zoom pill ───────────────────────────────────────────────────── */
614
+
615
+ [data-ui-media-viewer] > [data-part-zoom] {
616
+ align-items: center;
617
+ align-self: end;
618
+ background-color: var(--slotted-media-viewer-zoom-surface, var(--slotted-surface-raised));
619
+ border: var(--slotted-border-width-thin, 1px) solid var(--slotted-border-subtle);
620
+ border-radius: var(--slotted-radius-full, 9999px);
621
+ box-shadow: var(--slotted-shadow-lg);
622
+ display: inline-flex;
623
+ gap: var(--slotted-space-1, 0.125rem);
624
+ grid-column: 1;
625
+ grid-row: 2;
626
+ justify-self: center;
627
+ margin-block-end: var(--slotted-space-6, 1rem);
628
+ padding: var(--slotted-space-1, 0.125rem);
629
+ z-index: 1;
630
+ }
631
+
632
+ [data-ui-media-viewer] [data-part-zoom] > button {
633
+ --_radius: var(--slotted-radius-full, 9999px);
634
+ }
635
+
636
+ [data-ui-media-viewer] [data-part-zoom-level] {
637
+ font-size: var(--slotted-font-size-sm, 0.8125rem);
638
+ font-variant-numeric: tabular-nums;
639
+ font-weight: var(--slotted-font-weight-medium, 500);
640
+ /* Four characters, "400%", hold one width as the level moves. */
641
+ min-inline-size: 4.5ch;
642
+ text-align: center;
643
+ }
644
+
645
+ /* A rule between the level and the two whole-picture actions, fit and rotate. */
646
+ [data-ui-media-viewer] [data-part-zoom] > [data-part-fit] {
647
+ margin-inline-start: var(--slotted-space-2, 0.25rem);
648
+ position: relative;
649
+ }
650
+
651
+ [data-ui-media-viewer] [data-part-zoom] > [data-part-fit]::before {
652
+ background-color: var(--slotted-border-subtle);
653
+ block-size: 50%;
654
+ content: '';
655
+ inline-size: var(--slotted-border-width-thin, 1px);
656
+ inset-block-start: 25%;
657
+ inset-inline-start: calc(-1 * var(--slotted-space-2, 0.25rem) / 2 - 1px);
658
+ position: absolute;
659
+ }
660
+
661
+ /* ── States of every control ─────────────────────────────────────────── */
662
+
663
+ [data-ui-media-viewer]
664
+ :is([data-part-close], [data-part-download]):not(:disabled, [aria-disabled='true']):hover,
665
+ [data-ui-media-viewer] [data-part-zoom] > button:enabled:hover,
666
+ [data-ui-media-viewer] > :is([data-part-previous], [data-part-next]):enabled:hover {
667
+ background-color: var(--_hover);
668
+ }
669
+
670
+ [data-ui-media-viewer] > :is([data-part-previous], [data-part-next]):enabled:hover {
671
+ background-color: color-mix(in oklab, var(--_hover), var(--slotted-surface-raised) 40%);
672
+ }
673
+
674
+ [data-ui-media-viewer]
675
+ :is([data-part-close], [data-part-download]):not(:disabled, [aria-disabled='true']):active,
676
+ [data-ui-media-viewer] [data-part-zoom] > button:enabled:active {
677
+ background-color: var(--_press);
678
+ }
679
+
680
+ /* The circles answer a press by settling, as a button does (Emil: scale below 1). */
681
+ [data-ui-media-viewer] > :is([data-part-previous], [data-part-next]):enabled:active {
682
+ background-color: var(--_press);
683
+ scale: 0.96;
684
+ }
685
+
686
+ [data-ui-media-viewer] [data-part-zoom] > button:disabled {
687
+ color: var(--_ink-muted);
688
+ cursor: default;
689
+ }
690
+
691
+ [data-ui-media-viewer] :is([data-part-close], [data-part-download]):focus-visible,
692
+ [data-ui-media-viewer] [data-part-zoom] > button:focus-visible,
693
+ [data-ui-media-viewer] > :is([data-part-previous], [data-part-next]):focus-visible,
694
+ [data-ui-media-viewer] [data-part-thumbnail]:focus-visible {
695
+ outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
696
+ outline-offset: var(--slotted-focus-ring-offset, 2px);
697
+ }
698
+
699
+ /* ── Caption and thumbnails ─────────────────────────────────────────── */
700
+
701
+ [data-ui-media-viewer] > [data-part-caption] {
702
+ color: var(--_ink);
703
+ font-size: var(--slotted-font-size-sm, 0.8125rem);
704
+ grid-row: 3;
705
+ justify-self: center;
706
+ line-height: var(--slotted-line-height-md, 1.5);
707
+ margin: 0;
708
+ max-inline-size: min(48rem, 100%);
709
+ overflow-wrap: anywhere;
710
+ padding-block: var(--slotted-space-4, 0.5rem);
711
+ padding-inline: var(--slotted-space-6, 1rem);
712
+ text-align: center;
713
+ }
714
+
715
+ [data-ui-media-viewer] > [data-part-thumbnails] {
716
+ display: flex;
717
+ gap: var(--slotted-space-2, 0.25rem);
718
+ grid-row: 4;
719
+ justify-content: safe center;
720
+ overflow-x: auto;
721
+ padding-block: var(--slotted-space-4, 0.5rem);
722
+ padding-inline: var(--slotted-space-6, 1rem);
723
+ scrollbar-width: none;
724
+ }
725
+
726
+ /*
727
+ * A thumbnail is a pressable picture: the current one is framed, the others
728
+ * are dimmed until the pointer reaches them, and a press brings one to full
729
+ * strength. The frame is a border, transparent on the others, so marking the
730
+ * current one moves nothing; the outline stays the focus ring's alone (R3).
731
+ */
732
+ [data-ui-media-viewer] [data-part-thumbnail] {
733
+ appearance: none;
734
+ background-color: color-mix(in oklab, var(--_ink) 8%, transparent);
735
+ block-size: var(--slotted-media-viewer-thumbnail-size, 3.5rem);
736
+ border: var(--slotted-border-width-thick, 2px) solid transparent;
737
+ border-radius: var(--slotted-radius-sm, 2px);
738
+ cursor: pointer;
739
+ flex: none;
740
+ inline-size: var(--slotted-media-viewer-thumbnail-size, 3.5rem);
741
+ opacity: 0.6;
742
+ overflow: hidden;
743
+ padding: 0;
744
+ transition:
745
+ opacity var(--slotted-control-transition-duration) var(--slotted-control-transition-easing),
746
+ border-color var(--slotted-control-transition-duration)
747
+ var(--slotted-control-transition-easing);
748
+ }
749
+
750
+ [data-ui-media-viewer] [data-part-thumbnail] > img {
751
+ block-size: 100%;
752
+ display: block;
753
+ inline-size: 100%;
754
+ object-fit: cover;
755
+ }
756
+
757
+ [data-ui-media-viewer] [data-part-thumbnail]:not(:disabled):hover {
758
+ opacity: 0.85;
759
+ }
760
+
761
+ [data-ui-media-viewer] [data-part-thumbnail]:not(:disabled):active,
762
+ [data-ui-media-viewer] [data-part-thumbnail][data-current] {
763
+ opacity: 1;
764
+ }
765
+
766
+ [data-ui-media-viewer] [data-part-thumbnail][data-current] {
767
+ border-color: var(--_ink);
768
+ }
769
+
770
+ /* ── Forced colors ──────────────────────────────────────────────────── */
771
+
772
+ /*
773
+ * The theme maps every token; what it cannot reach is a ground said by a
774
+ * mix, which forced colors flatten to `Canvas`. The pointer's answer on the
775
+ * controls comes back as the system pair, as in `upload`.
776
+ */
777
+ @media (forced-colors: active) {
778
+ [data-ui-media-viewer]
779
+ :is([data-part-close], [data-part-download]):not(:disabled, [aria-disabled='true']):hover,
780
+ [data-ui-media-viewer] [data-part-zoom] > button:enabled:hover,
781
+ [data-ui-media-viewer] > :is([data-part-previous], [data-part-next]):enabled:hover {
782
+ background-color: Highlight;
783
+ color: HighlightText;
784
+ }
785
+
786
+ [data-ui-media-viewer] [data-part-thumbnail][data-current] {
787
+ border-color: Highlight;
788
+ }
789
+ }
790
+ }