@slotted/styles 0.0.0-stage → 0.1.0-beta.0

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 (254) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +10 -2
  3. package/package.json +276 -3
  4. package/src/accordion/accordion.css +96 -0
  5. package/src/accordion/accordion.tokens.json +14 -0
  6. package/src/action-bar/action-bar.css +455 -0
  7. package/src/action-bar/action-bar.tokens.json +50 -0
  8. package/src/action-sheet/action-sheet.css +462 -0
  9. package/src/action-sheet/action-sheet.tokens.json +59 -0
  10. package/src/alert/alert.css +764 -0
  11. package/src/alert/alert.tokens.json +77 -0
  12. package/src/app-shell/app-shell.css +1899 -0
  13. package/src/app-shell/app-shell.tokens.json +88 -0
  14. package/src/aspect-ratio/aspect-ratio.css +131 -0
  15. package/src/aspect-ratio/aspect-ratio.tokens.json +1 -0
  16. package/src/attachment/attachment.css +906 -0
  17. package/src/attachment/attachment.tokens.json +85 -0
  18. package/src/avatar/avatar.css +598 -0
  19. package/src/avatar/avatar.tokens.json +64 -0
  20. package/src/avatar-group/avatar-group.css +268 -0
  21. package/src/avatar-group/avatar-group.tokens.json +16 -0
  22. package/src/badge/badge.css +462 -0
  23. package/src/badge/badge.tokens.json +58 -0
  24. package/src/breadcrumb/breadcrumb.css +441 -0
  25. package/src/breadcrumb/breadcrumb.tokens.json +50 -0
  26. package/src/button/button.css +754 -0
  27. package/src/button/button.tokens.json +72 -0
  28. package/src/button-group/button-group.css +455 -0
  29. package/src/button-group/button-group.tokens.json +11 -0
  30. package/src/calendar/calendar.css +846 -0
  31. package/src/calendar/calendar.tokens.json +67 -0
  32. package/src/card/card.css +602 -0
  33. package/src/card/card.tokens.json +68 -0
  34. package/src/carousel/carousel.css +860 -0
  35. package/src/carousel/carousel.tokens.json +62 -0
  36. package/src/cascader/cascader.css +1320 -0
  37. package/src/cascader/cascader.tokens.json +103 -0
  38. package/src/chart/chart.css +1473 -0
  39. package/src/chart/chart.tokens.json +107 -0
  40. package/src/checkbox/checkbox.css +1011 -0
  41. package/src/checkbox/checkbox.tokens.json +102 -0
  42. package/src/checkbox-group/checkbox-group.css +70 -0
  43. package/src/checkbox-group/checkbox-group.tokens.json +6 -0
  44. package/src/code-block/code-block.css +555 -0
  45. package/src/code-block/code-block.tokens.json +69 -0
  46. package/src/collapsible/collapsible.css +546 -0
  47. package/src/collapsible/collapsible.tokens.json +55 -0
  48. package/src/color-picker/color-picker.css +607 -0
  49. package/src/color-picker/color-picker.tokens.json +58 -0
  50. package/src/column-manager/column-manager.css +452 -0
  51. package/src/column-manager/column-manager.tokens.json +43 -0
  52. package/src/combobox/combobox.css +1048 -0
  53. package/src/combobox/combobox.tokens.json +112 -0
  54. package/src/command-palette/command-palette.css +1000 -0
  55. package/src/command-palette/command-palette.tokens.json +75 -0
  56. package/src/container/container.css +198 -0
  57. package/src/container/container.tokens.json +18 -0
  58. package/src/context-menu/context-menu.css +104 -0
  59. package/src/context-menu/context-menu.tokens.json +11 -0
  60. package/src/currency-field/currency-field.css +787 -0
  61. package/src/currency-field/currency-field.tokens.json +80 -0
  62. package/src/dashboard-grid/dashboard-grid.css +748 -0
  63. package/src/dashboard-grid/dashboard-grid.tokens.json +67 -0
  64. package/src/data-grid/data-grid.css +2484 -0
  65. package/src/data-grid/data-grid.tokens.json +100 -0
  66. package/src/data-list/data-list.css +455 -0
  67. package/src/data-list/data-list.tokens.json +35 -0
  68. package/src/date-field/date-field.css +560 -0
  69. package/src/date-field/date-field.tokens.json +80 -0
  70. package/src/date-picker/date-picker.css +420 -0
  71. package/src/date-picker/date-picker.tokens.json +49 -0
  72. package/src/date-range-picker/date-range-picker.css +983 -0
  73. package/src/date-range-picker/date-range-picker.tokens.json +109 -0
  74. package/src/datetime-field/datetime-field.css +850 -0
  75. package/src/datetime-field/datetime-field.tokens.json +91 -0
  76. package/src/datetime-picker/datetime-picker.css +843 -0
  77. package/src/datetime-picker/datetime-picker.tokens.json +78 -0
  78. package/src/datetime-range-picker/datetime-range-picker.css +1375 -0
  79. package/src/datetime-range-picker/datetime-range-picker.tokens.json +135 -0
  80. package/src/description-list/description-list.css +675 -0
  81. package/src/description-list/description-list.tokens.json +66 -0
  82. package/src/detail-panel/detail-panel.css +329 -0
  83. package/src/detail-panel/detail-panel.tokens.json +33 -0
  84. package/src/dialog/dialog.css +968 -0
  85. package/src/dialog/dialog.tokens.json +66 -0
  86. package/src/divider/divider.css +131 -0
  87. package/src/divider/divider.tokens.json +18 -0
  88. package/src/drawer/drawer.css +1303 -0
  89. package/src/drawer/drawer.tokens.json +75 -0
  90. package/src/entity-picker/entity-picker.css +1367 -0
  91. package/src/entity-picker/entity-picker.tokens.json +118 -0
  92. package/src/event-calendar/event-calendar.css +2148 -0
  93. package/src/event-calendar/event-calendar.tokens.json +87 -0
  94. package/src/field/field.css +707 -0
  95. package/src/field/field.tokens.json +58 -0
  96. package/src/field-group/field-group.css +226 -0
  97. package/src/field-group/field-group.tokens.json +33 -0
  98. package/src/filter-bar/filter-bar.css +1306 -0
  99. package/src/filter-bar/filter-bar.tokens.json +78 -0
  100. package/src/form/form.css +218 -0
  101. package/src/form/form.tokens.json +32 -0
  102. package/src/fullscreen/fullscreen.css +376 -0
  103. package/src/fullscreen/fullscreen.tokens.json +50 -0
  104. package/src/grid/grid.css +173 -0
  105. package/src/grid/grid.tokens.json +20 -0
  106. package/src/highlight/highlight.css +135 -0
  107. package/src/highlight/highlight.tokens.json +16 -0
  108. package/src/hover-card/hover-card.css +93 -0
  109. package/src/hover-card/hover-card.tokens.json +17 -0
  110. package/src/icon/icon.css +136 -0
  111. package/src/icon/icon.tokens.json +14 -0
  112. package/src/image/image.css +449 -0
  113. package/src/image/image.tokens.json +27 -0
  114. package/src/import-export-center/import-export-center.css +1175 -0
  115. package/src/import-export-center/import-export-center.tokens.json +84 -0
  116. package/src/inline/inline.css +149 -0
  117. package/src/inline/inline.tokens.json +14 -0
  118. package/src/inline-message/inline-message.css +396 -0
  119. package/src/inline-message/inline-message.tokens.json +19 -0
  120. package/src/kbd/kbd.css +490 -0
  121. package/src/kbd/kbd.tokens.json +40 -0
  122. package/src/link/link.css +237 -0
  123. package/src/link/link.tokens.json +25 -0
  124. package/src/list/list.css +240 -0
  125. package/src/list/list.tokens.json +42 -0
  126. package/src/list-item/list-item.css +937 -0
  127. package/src/list-item/list-item.tokens.json +114 -0
  128. package/src/listbox/listbox.css +674 -0
  129. package/src/listbox/listbox.tokens.json +72 -0
  130. package/src/loading-overlay/loading-overlay.css +730 -0
  131. package/src/loading-overlay/loading-overlay.tokens.json +48 -0
  132. package/src/markdown/markdown.css +168 -0
  133. package/src/markdown/markdown.tokens.json +18 -0
  134. package/src/menu/menu.css +817 -0
  135. package/src/menu/menu.tokens.json +78 -0
  136. package/src/menubar/menubar.css +170 -0
  137. package/src/menubar/menubar.tokens.json +32 -0
  138. package/src/message/message.css +1453 -0
  139. package/src/message/message.tokens.json +85 -0
  140. package/src/message-scroller/message-scroller.css +371 -0
  141. package/src/message-scroller/message-scroller.tokens.json +47 -0
  142. package/src/multi-select/multi-select.css +1427 -0
  143. package/src/multi-select/multi-select.tokens.json +114 -0
  144. package/src/navigation-menu/navigation-menu.css +1029 -0
  145. package/src/navigation-menu/navigation-menu.tokens.json +70 -0
  146. package/src/notification-center/notification-center.css +856 -0
  147. package/src/notification-center/notification-center.tokens.json +84 -0
  148. package/src/number-field/number-field.css +794 -0
  149. package/src/number-field/number-field.tokens.json +80 -0
  150. package/src/otp-input/otp-input.css +525 -0
  151. package/src/otp-input/otp-input.tokens.json +69 -0
  152. package/src/page/page.css +179 -0
  153. package/src/page/page.tokens.json +20 -0
  154. package/src/page-header/page-header.css +1181 -0
  155. package/src/page-header/page-header.tokens.json +71 -0
  156. package/src/pagination/pagination.css +500 -0
  157. package/src/pagination/pagination.tokens.json +56 -0
  158. package/src/popover/popover.css +526 -0
  159. package/src/popover/popover.tokens.json +60 -0
  160. package/src/progress-indicator/progress-indicator.css +1584 -0
  161. package/src/progress-indicator/progress-indicator.tokens.json +50 -0
  162. package/src/prompt-composer/prompt-composer.css +680 -0
  163. package/src/prompt-composer/prompt-composer.tokens.json +99 -0
  164. package/src/prose/prose.css +733 -0
  165. package/src/prose/prose.tokens.json +79 -0
  166. package/src/radio-group/radio-group.css +778 -0
  167. package/src/radio-group/radio-group.tokens.json +103 -0
  168. package/src/rating/rating.css +1071 -0
  169. package/src/rating/rating.tokens.json +88 -0
  170. package/src/result-state/result-state.css +980 -0
  171. package/src/result-state/result-state.tokens.json +63 -0
  172. package/src/runtime-properties.mjs +321 -0
  173. package/src/saved-views/saved-views.css +394 -0
  174. package/src/saved-views/saved-views.tokens.json +41 -0
  175. package/src/scroll-area/scroll-area.css +481 -0
  176. package/src/scroll-area/scroll-area.tokens.json +15 -0
  177. package/src/section/section.css +177 -0
  178. package/src/section/section.tokens.json +39 -0
  179. package/src/segmented-control/segmented-control.css +564 -0
  180. package/src/segmented-control/segmented-control.tokens.json +67 -0
  181. package/src/select/select.css +1593 -0
  182. package/src/select/select.tokens.json +110 -0
  183. package/src/side-navigation/side-navigation.css +1096 -0
  184. package/src/side-navigation/side-navigation.tokens.json +87 -0
  185. package/src/skeleton/skeleton.css +431 -0
  186. package/src/skeleton/skeleton.tokens.json +29 -0
  187. package/src/slider/slider.css +792 -0
  188. package/src/slider/slider.tokens.json +75 -0
  189. package/src/sparkline/sparkline.css +282 -0
  190. package/src/sparkline/sparkline.tokens.json +45 -0
  191. package/src/spinner/spinner.css +224 -0
  192. package/src/spinner/spinner.tokens.json +8 -0
  193. package/src/split-button/split-button.css +253 -0
  194. package/src/split-button/split-button.tokens.json +12 -0
  195. package/src/splitter/splitter.css +336 -0
  196. package/src/splitter/splitter.tokens.json +24 -0
  197. package/src/stack/stack.css +128 -0
  198. package/src/stack/stack.tokens.json +14 -0
  199. package/src/stat-card/stat-card.css +641 -0
  200. package/src/stat-card/stat-card.tokens.json +95 -0
  201. package/src/status-indicator/status-indicator.css +481 -0
  202. package/src/status-indicator/status-indicator.tokens.json +38 -0
  203. package/src/stepper/stepper.css +629 -0
  204. package/src/stepper/stepper.tokens.json +72 -0
  205. package/src/switch/switch.css +703 -0
  206. package/src/switch/switch.tokens.json +75 -0
  207. package/src/table/table.css +1482 -0
  208. package/src/table/table.tokens.json +69 -0
  209. package/src/table-of-contents/table-of-contents.css +533 -0
  210. package/src/table-of-contents/table-of-contents.tokens.json +53 -0
  211. package/src/tabs/tabs.css +998 -0
  212. package/src/tabs/tabs.tokens.json +82 -0
  213. package/src/tag/tag.css +768 -0
  214. package/src/tag/tag.tokens.json +85 -0
  215. package/src/tags-input/tags-input.css +757 -0
  216. package/src/tags-input/tags-input.tokens.json +84 -0
  217. package/src/text-field/text-field.css +900 -0
  218. package/src/text-field/text-field.tokens.json +87 -0
  219. package/src/textarea/textarea.css +365 -0
  220. package/src/textarea/textarea.tokens.json +59 -0
  221. package/src/time-field/time-field.css +719 -0
  222. package/src/time-field/time-field.tokens.json +86 -0
  223. package/src/time-picker/time-picker.css +665 -0
  224. package/src/time-picker/time-picker.tokens.json +66 -0
  225. package/src/time-range-picker/time-range-picker.css +1287 -0
  226. package/src/time-range-picker/time-range-picker.tokens.json +134 -0
  227. package/src/timeline/timeline.css +1596 -0
  228. package/src/timeline/timeline.tokens.json +96 -0
  229. package/src/toast/toast.css +943 -0
  230. package/src/toast/toast.tokens.json +90 -0
  231. package/src/toggle/toggle.css +290 -0
  232. package/src/toggle/toggle.tokens.json +54 -0
  233. package/src/toggle-group/toggle-group.css +463 -0
  234. package/src/toggle-group/toggle-group.tokens.json +54 -0
  235. package/src/toolbar/toolbar.css +434 -0
  236. package/src/toolbar/toolbar.tokens.json +49 -0
  237. package/src/tooltip/tooltip.css +368 -0
  238. package/src/tooltip/tooltip.tokens.json +39 -0
  239. package/src/top-navigation/top-navigation.css +1287 -0
  240. package/src/top-navigation/top-navigation.tokens.json +91 -0
  241. package/src/tour/tour.css +680 -0
  242. package/src/tour/tour.tokens.json +67 -0
  243. package/src/transfer/transfer.css +571 -0
  244. package/src/transfer/transfer.tokens.json +49 -0
  245. package/src/tree/tree.css +1000 -0
  246. package/src/tree/tree.tokens.json +80 -0
  247. package/src/typography/typography.css +211 -0
  248. package/src/typography/typography.tokens.json +31 -0
  249. package/src/upload/upload.css +1706 -0
  250. package/src/upload/upload.tokens.json +123 -0
  251. package/src/visually-hidden/visually-hidden.css +52 -0
  252. package/src/visually-hidden/visually-hidden.tokens.json +1 -0
  253. package/src/wizard/wizard.css +740 -0
  254. package/src/wizard/wizard.tokens.json +63 -0
@@ -0,0 +1,1375 @@
1
+ @layer slotted.components {
2
+ /**
3
+ * ── A one-line frame, and behind it one end at a time: the range calendar and its list ──
4
+ *
5
+ * ┌─ root ──────────────────────────────────────────────────────────────┐
6
+ * │ ┌─ control ── the frame ─────────────────────────────────────────┐ │
7
+ * │ │ ┌ trigger ──────────────────────────────────────────────────┐ │ │
8
+ * │ │ │ summary: 12 set, 14:00 – 16 set, 11:00 ┌ clear ┐ cal. │ │ │
9
+ * │ │ └───────────────────────────────────────────┴───────┴───────┘ │ │
10
+ * │ └────────────────────────────────────────────────────────────────┘ │
11
+ * └─────────────────────────────────────────────────────────────────────┘
12
+ * ┌─ positioner ─ the layer ───────────────────────────────────┐
13
+ * │ ┌─ content ─ the surface ─────────────────────────────┐ │
14
+ * │ │ head: tabs [ PICKUP · 12 Sep, 14:00 ] [ RETURN · — ] │ │
15
+ * │ │ field [datetime-field] now │ │
16
+ * │ │ hint Choose the return day length · limit │ │
17
+ * │ │ presets: chip chip chip │ │
18
+ * │ │ panel (the current end): date-panel │ list │ │
19
+ * │ │ footer done │ │
20
+ * │ └─────────────────────────────────────────────────────┘ │
21
+ * └───────────────────────────────────────────────────────────┘
22
+ *
23
+ * The field and the calendar inside keep their own `data-ui`. Nothing here
24
+ * selects a segment or a day: this stylesheet owns the frame, the layer,
25
+ * the band the field stands in, and the list beside the calendar.
26
+ *
27
+ * **The frame is one line at any width.** Two segmented fields stood in it
28
+ * first — the shape `date-range-picker` has — and were withdrawn at the
29
+ * visual gate: a segment cannot shrink, and two fields broke the frame into
30
+ * two lines in any form column narrower than they are, against the height
31
+ * every control shares. The frame keeps the value in words.
32
+ *
33
+ * **The band speaks to the field through its tokens and never through its
34
+ * parts** — the rule `date-range-picker` records.
35
+ *
36
+ * **One end at a time.** Two lists side by side, under two fields, were
37
+ * refused at the release gate as too much interface at once for a lay
38
+ * reader and for a phone. The tab says which end, the panel shows only
39
+ * that end, and choosing one end moves to the other — the end list
40
+ * appears already striking what the chosen start refuses.
41
+ */
42
+ [data-ui='datetime-range-picker'][data-part='root'] {
43
+ display: block;
44
+ /* The anchor the positioner measures is the control, and a block root
45
+ lets the frame take the width the form gave it. */
46
+ inline-size: 100%;
47
+ }
48
+
49
+ /* ── The frame ────────────────────────────────────────────────────────
50
+ *
51
+ * One line, at the height the scale gives every control. The frame
52
+ * `select` draws: the value in words, cut with an ellipsis where it does
53
+ * not fit, and the trigger filling the box. Two segmented fields stood here
54
+ * first and were withdrawn at the visual gate — a segment cannot shrink,
55
+ * and two of them broke the frame into two lines in any form column
56
+ * narrower than they are, against the height every control shares.
57
+ */
58
+ [data-ui='datetime-range-picker'] [data-part='control'] {
59
+ --_font-size: var(--slotted-control-font-size-md, 13px);
60
+ --_height: var(--slotted-control-height-md, 34px);
61
+ --_padding-inline: var(--slotted-control-padding-inline-md, 13px);
62
+ --_gap: var(--slotted-control-gap-md, 8px);
63
+ --_icon-size: var(--slotted-control-icon-size-md, 16px);
64
+ --_border-width: var(--slotted-control-border-width, 1px);
65
+
66
+ /* The same inner-control box every family in the library draws: the glyph,
67
+ and one step of air on each side, bounded by the frame's own height. */
68
+ --_action-size: var(
69
+ --slotted-datetime-range-picker-action-size,
70
+ min(
71
+ calc(var(--_icon-size) + 2 * var(--slotted-space-2, 0.25rem)),
72
+ calc(var(--_height) - var(--_border-width) * 2 - var(--slotted-space-2, 0.25rem))
73
+ )
74
+ );
75
+ --_action-inset: max(
76
+ 0px,
77
+ calc(var(--_padding-inline) - (var(--_action-size) - var(--_icon-size)) / 2)
78
+ );
79
+
80
+ background-color: var(
81
+ --slotted-datetime-range-picker-background,
82
+ var(--slotted-control-surface, Field)
83
+ );
84
+ block-size: var(--_height);
85
+ border: var(--_border-width) solid
86
+ var(
87
+ --slotted-datetime-range-picker-border-color,
88
+ var(--slotted-control-border-color, ButtonBorder)
89
+ );
90
+ border-radius: var(--slotted-datetime-range-picker-radius, var(--slotted-control-radius, 4px));
91
+ box-shadow: var(--slotted-datetime-range-picker-shadow, var(--slotted-control-shadow, none));
92
+ box-sizing: border-box;
93
+ color: var(--slotted-datetime-range-picker-color, var(--slotted-text, CanvasText));
94
+ display: flex;
95
+ font-family: var(--slotted-control-font-family, system-ui, sans-serif);
96
+ font-size: var(--_font-size);
97
+ inline-size: 100%;
98
+ min-inline-size: 0;
99
+ position: relative;
100
+ transition:
101
+ background-color var(--slotted-control-transition-duration)
102
+ var(--slotted-control-transition-easing),
103
+ border-color var(--slotted-control-transition-duration)
104
+ var(--slotted-control-transition-easing),
105
+ box-shadow var(--slotted-control-transition-duration) var(--slotted-control-transition-easing);
106
+ }
107
+
108
+ [data-ui='datetime-range-picker'][data-part='root'][data-size='sm'] [data-part='control'] {
109
+ --_font-size: var(--slotted-control-font-size-sm, 12px);
110
+ --_height: var(--slotted-control-height-sm, 30px);
111
+ --_padding-inline: var(--slotted-control-padding-inline-sm, 11px);
112
+ --_gap: var(--slotted-control-gap-sm, 6px);
113
+ --_icon-size: var(--slotted-control-icon-size-sm, 14px);
114
+ }
115
+
116
+ [data-ui='datetime-range-picker'][data-part='root'][data-size='lg'] [data-part='control'] {
117
+ --_font-size: var(--slotted-control-font-size-lg, 14px);
118
+ --_height: var(--slotted-control-height-lg, 38px);
119
+ --_padding-inline: var(--slotted-control-padding-inline-lg, 15px);
120
+ --_gap: var(--slotted-control-gap-lg, 10px);
121
+ --_icon-size: var(--slotted-control-icon-size-lg, 18px);
122
+ }
123
+
124
+ /* ── Variant ──────────────────────────────────────────────────────────
125
+ *
126
+ * The three steps `text-field` set, through the field's own variant tokens.
127
+ */
128
+ [data-ui='datetime-range-picker'][data-part='root'][data-variant='subtle'] [data-part='control'] {
129
+ background-color: var(
130
+ --slotted-datetime-range-picker-subtle-background,
131
+ var(--slotted-surface-sunken, Canvas)
132
+ );
133
+ border-color: var(
134
+ --slotted-datetime-range-picker-subtle-border-color,
135
+ var(--slotted-border-subtle, ButtonBorder)
136
+ );
137
+ }
138
+
139
+ [data-ui='datetime-range-picker'][data-part='root'][data-variant='plain'] [data-part='control'] {
140
+ background-color: transparent;
141
+ border-color: transparent;
142
+ border-radius: var(--slotted-radius-none, 0px);
143
+ box-shadow: none;
144
+ }
145
+
146
+ /* ── The trigger ──────────────────────────────────────────────────────
147
+ *
148
+ * A transparent button filling the frame, with the value as its content and
149
+ * the glyph at its reading end: the whole box opens the panel, which is the
150
+ * shape `select` has. It is always drawn — ChromeOS turns `Alt`+`ArrowDown`
151
+ * into `PageDown` before the browser sees it, so a chord cannot be the only
152
+ * way in.
153
+ */
154
+ [data-ui='datetime-range-picker'] [data-part='trigger'] {
155
+ align-items: center;
156
+ appearance: none;
157
+ background-color: transparent;
158
+ border: 0;
159
+ border-radius: inherit;
160
+ color: inherit;
161
+ cursor: pointer;
162
+ display: flex;
163
+ flex: 1 1 auto;
164
+ font: inherit;
165
+ gap: var(--_gap);
166
+ min-inline-size: 0;
167
+ padding-block: 0;
168
+ padding-inline-start: var(--_padding-inline);
169
+ /* Room for the glyph, and for the clear beside it when there is one. */
170
+ padding-inline-end: calc(
171
+ var(--_action-inset) + var(--_action-size) * var(--_actions, 1) +
172
+ var(--slotted-space-1, 0.125rem) * (var(--_actions, 1) - 1) +
173
+ var(--slotted-space-2, 0.25rem)
174
+ );
175
+ text-align: start;
176
+ touch-action: manipulation;
177
+ -webkit-tap-highlight-color: transparent;
178
+ }
179
+
180
+ [data-ui='datetime-range-picker'] [data-part='control']:has(> [data-part='clear']) {
181
+ --_actions: 2;
182
+ }
183
+
184
+ /* The value in words, one line, cut where it does not fit: the trigger's
185
+ name carries it whole, so the ellipsis removes nothing a reader cannot
186
+ hear. Tabular figures, so two ranges in a form line up. */
187
+ [data-ui='datetime-range-picker'] [data-part='summary'] {
188
+ flex: 1 1 auto;
189
+ font-variant-numeric: tabular-nums;
190
+ min-inline-size: 0;
191
+ overflow: hidden;
192
+ text-overflow: ellipsis;
193
+ unicode-bidi: plaintext;
194
+ white-space: nowrap;
195
+ }
196
+
197
+ [data-ui='datetime-range-picker'] [data-part='summary'][data-placeholder] {
198
+ color: var(
199
+ --slotted-datetime-range-picker-placeholder-color,
200
+ var(--slotted-text-muted, GrayText)
201
+ );
202
+ }
203
+
204
+ /* The calendar `datetime-picker` puts on its trigger — the mark
205
+ `input[type=datetime-local]` draws for the same control, a `Glyph` the
206
+ binding draws after the summary; it does not turn while the surface is
207
+ open. */
208
+ /* The frame draws the ring for the trigger; the browser's own ring on the
209
+ trigger would be a second one, inside the frame and over its edge. */
210
+ [data-ui='datetime-range-picker'] [data-part='trigger']:focus-visible {
211
+ outline: none;
212
+ }
213
+
214
+ [data-ui='datetime-range-picker'] [data-part='trigger'] > [data-ui='icon'] {
215
+ --slotted-icon-size: var(--_icon-size);
216
+
217
+ /* No system-colour fallback on a decoration: unthemed, it takes the
218
+ trigger's ink rather than shouts. */
219
+ color: var(--slotted-datetime-range-picker-action-color, var(--slotted-text-muted));
220
+ inset-block-start: 50%;
221
+ inset-inline-end: calc(var(--_action-inset) + (var(--_action-size) - var(--_icon-size)) / 2);
222
+ position: absolute;
223
+ translate: 0 -50%;
224
+ }
225
+
226
+ [data-ui='datetime-range-picker'] [data-part='trigger']:disabled {
227
+ cursor: not-allowed;
228
+ }
229
+
230
+ /* ── The clear ────────────────────────────────────────────────────────
231
+ *
232
+ * The inner-control box, before the glyph, as every clear in the library
233
+ * stands. Its own ring: tabbing from the trigger to it has to move
234
+ * something visible, and the frame's ring would sit still.
235
+ */
236
+ [data-ui='datetime-range-picker'] [data-part='clear'] {
237
+ --slotted-icon-size: var(--_icon-size);
238
+
239
+ align-items: center;
240
+ appearance: none;
241
+ background-color: transparent;
242
+ block-size: var(--_action-size);
243
+ border: 0;
244
+ border-radius: var(--slotted-datetime-range-picker-radius, var(--slotted-control-radius, 4px));
245
+ color: var(--slotted-datetime-range-picker-action-color, var(--slotted-text-muted, GrayText));
246
+ cursor: pointer;
247
+ display: inline-flex;
248
+ flex: 0 0 auto;
249
+ inline-size: var(--_action-size);
250
+ inset-block-start: calc((var(--_height) - var(--_border-width) * 2 - var(--_action-size)) / 2);
251
+ inset-inline-end: calc(
252
+ var(--_action-inset) + var(--_action-size) + var(--slotted-space-1, 0.125rem)
253
+ );
254
+ justify-content: center;
255
+ padding: 0;
256
+ position: absolute;
257
+ touch-action: manipulation;
258
+ transition:
259
+ background-color var(--slotted-control-transition-duration)
260
+ var(--slotted-control-transition-easing),
261
+ color var(--slotted-control-transition-duration) var(--slotted-control-transition-easing);
262
+ -webkit-tap-highlight-color: transparent;
263
+ }
264
+
265
+ /* The hit area, recovered outside the paint, as every inner control does. */
266
+ [data-ui='datetime-range-picker'] [data-part='clear']::after {
267
+ content: '';
268
+ inset: min(0px, calc((100% - var(--slotted-target-min, 24px)) / 2));
269
+ position: absolute;
270
+ }
271
+
272
+ /* On a finger the target is the comfortable size in both axes and the box
273
+ is the one a mouse sees: the ground and the focus ring stay square, and
274
+ the hit area above grows to 44 pixels around them. It does not reach into
275
+ the calendar's lane after it, which is the trigger's to answer. */
276
+ @media (pointer: coarse) {
277
+ [data-ui='datetime-range-picker'] [data-part='clear']::after {
278
+ inset: min(0px, calc((100% - var(--slotted-target-comfortable, 44px)) / 2));
279
+ inset-inline-end: 0;
280
+ }
281
+ }
282
+
283
+ [data-ui='datetime-range-picker'] [data-part='clear']:hover:not(:disabled):not([data-disabled]) {
284
+ background-color: var(
285
+ --slotted-datetime-range-picker-action-hover-background,
286
+ var(--slotted-tone-secondary-subtle-hover)
287
+ );
288
+ }
289
+
290
+ [data-ui='datetime-range-picker'] [data-part='clear']:active:not(:disabled):not([data-disabled]) {
291
+ background-color: var(
292
+ --slotted-datetime-range-picker-action-active-background,
293
+ var(--slotted-tone-secondary-subtle-active)
294
+ );
295
+ }
296
+
297
+ [data-ui='datetime-range-picker'] [data-part='clear']:focus-visible {
298
+ outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
299
+ outline-offset: calc(var(--slotted-focus-ring-offset, 2px) * -1);
300
+ }
301
+
302
+ [data-ui='datetime-range-picker'] [data-part='clear']:disabled {
303
+ color: var(--slotted-disabled-foreground);
304
+ cursor: not-allowed;
305
+ }
306
+
307
+ /* ── States on the frame ──────────────────────────────────────────────
308
+ *
309
+ * Written strongest last, and each weaker one guarded against every stronger
310
+ * one it can meet, which is the order `STATE_PRECEDENCE` sets.
311
+ */
312
+
313
+ [data-ui='datetime-range-picker'][data-part='root']:not([data-disabled]):not([data-readonly]):not(
314
+ [data-invalid]
315
+ )
316
+ [data-part='control']:hover {
317
+ border-color: var(
318
+ --slotted-datetime-range-picker-hover-border-color,
319
+ var(--slotted-tone-accent-border)
320
+ );
321
+ }
322
+
323
+ [data-ui='datetime-range-picker'][data-part='root'][data-variant='subtle']:not(
324
+ [data-disabled]
325
+ ):not([data-readonly]):not([data-invalid])
326
+ [data-part='control']:hover {
327
+ background-color: var(
328
+ --slotted-datetime-range-picker-subtle-hover-background,
329
+ var(--slotted-tone-secondary-subtle-hover)
330
+ );
331
+ }
332
+
333
+ [data-ui='datetime-range-picker'][data-part='root'][data-variant='plain']:not(
334
+ [data-disabled]
335
+ ):not([data-readonly]):not([data-invalid])
336
+ [data-part='control']:hover {
337
+ background-color: var(
338
+ --slotted-datetime-range-picker-plain-hover-background,
339
+ var(--slotted-tone-secondary-subtle-hover)
340
+ );
341
+ border-color: transparent;
342
+ }
343
+
344
+ /* The trigger is the only thing in the frame that takes focus, apart from
345
+ the clear, which draws its own ring; the frame's ring is drawn for it. */
346
+ [data-ui='datetime-range-picker']
347
+ [data-part='control']:has(> [data-part='trigger']:focus-visible) {
348
+ box-shadow: var(--slotted-control-shadow-focus-geometry, 0 1px 4px -1px)
349
+ var(--slotted-focus-ring-color, Highlight);
350
+ outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
351
+ outline-offset: var(--slotted-focus-ring-offset, 2px);
352
+ }
353
+
354
+ /* The ring of a control whose box is not its own is drawn inside that box,
355
+ and there is no lift — the `plain` rule of `plain-variant.test.mjs`. */
356
+ [data-ui='datetime-range-picker'][data-part='root'][data-variant='plain']
357
+ [data-part='control']:has(> [data-part='trigger']:focus-visible) {
358
+ box-shadow: none;
359
+ outline-offset: calc(var(--slotted-focus-ring-offset, 2px) * -1);
360
+ }
361
+
362
+ /* Invalid outranks hover and is written after it. The ring is retargeted
363
+ rather than repainted, so every ring in the frame moves at once. */
364
+ [data-ui='datetime-range-picker'][data-part='root'][data-invalid] [data-part='control'] {
365
+ --slotted-focus-ring-color: var(
366
+ --slotted-datetime-range-picker-invalid-focus-ring-color,
367
+ var(--slotted-focus-ring-color-invalid, Highlight)
368
+ );
369
+ --_invalid-edge-width: var(
370
+ --slotted-datetime-range-picker-invalid-edge-width,
371
+ var(--slotted-control-invalid-edge-width, 1px)
372
+ );
373
+ --_invalid-edge-color: var(
374
+ --slotted-datetime-range-picker-invalid-border-color,
375
+ var(--slotted-tone-danger-border)
376
+ );
377
+ --_invalid-edge: inset 0 0 0 var(--_invalid-edge-width) var(--_invalid-edge-color);
378
+
379
+ border-color: var(
380
+ --slotted-datetime-range-picker-invalid-border-color,
381
+ var(--slotted-tone-danger-border)
382
+ );
383
+ /*
384
+ * Width as well as colour (WCAG 1.4.1), the edge `text-field` draws: in
385
+ * `high-contrast` the danger border is the resting edge's black. The line
386
+ * is a shadow inside the border, so neither box nor text moves, and it
387
+ * takes the resting lift's place.
388
+ */
389
+ box-shadow: var(--_invalid-edge);
390
+ }
391
+
392
+ [data-ui='datetime-range-picker'][data-invalid]
393
+ [data-part='control']:has(> [data-part='trigger']:focus-visible) {
394
+ box-shadow:
395
+ var(--_invalid-edge),
396
+ var(--slotted-control-shadow-focus-geometry, 0 1px 4px -1px)
397
+ var(--slotted-focus-ring-color, Highlight);
398
+ }
399
+
400
+ [data-ui='datetime-range-picker'][data-part='root'][data-variant='plain'][data-invalid]
401
+ [data-part='control']:has(> [data-part='trigger']:focus-visible) {
402
+ /* The ring lies inside the box here, over the border and an edge as wide as
403
+ it; the edge reaches past the ring. */
404
+ box-shadow: inset 0 0 0
405
+ calc(
406
+ var(--slotted-focus-ring-offset, 2px) - var(--_border-width) + var(--_invalid-edge-width)
407
+ )
408
+ var(--_invalid-edge-color);
409
+ }
410
+
411
+ /*
412
+ * Forced colours remove every box shadow, and the edge with them. The
413
+ * width comes back as an outline inside the border, and a focused invalid
414
+ * control draws its ring double, which a valid ring is not.
415
+ */
416
+ @media (forced-colors: active) {
417
+ [data-ui='datetime-range-picker'][data-part='root'][data-invalid] [data-part='control'] {
418
+ outline: var(--_invalid-edge-width) solid CanvasText;
419
+ outline-offset: calc(-1 * (var(--_border-width) + var(--_invalid-edge-width)));
420
+ }
421
+
422
+ [data-ui='datetime-range-picker'][data-invalid]
423
+ [data-part='control']:has(> [data-part='trigger']:focus-visible) {
424
+ outline: calc(var(--slotted-focus-ring-width, 2px) + var(--_invalid-edge-width)) double
425
+ var(--slotted-focus-ring-color, Highlight);
426
+ outline-offset: var(--slotted-focus-ring-offset, 2px);
427
+ }
428
+
429
+ [data-ui='datetime-range-picker'][data-part='root'][data-variant='plain'][data-invalid]
430
+ [data-part='control']:has(> [data-part='trigger']:focus-visible) {
431
+ outline: calc(var(--slotted-focus-ring-width, 2px) + var(--_invalid-edge-width)) double
432
+ var(--slotted-focus-ring-color, Highlight);
433
+ outline-offset: calc(
434
+ -1 * (var(--slotted-focus-ring-width, 2px) + var(--_invalid-edge-width))
435
+ );
436
+ }
437
+ }
438
+
439
+ /* Read-only stays focusable, readable and copyable, and must not be
440
+ mistakable for disabled: the ground says "not yours to change". */
441
+ [data-ui='datetime-range-picker'][data-part='root'][data-readonly] [data-part='control'] {
442
+ background-color: var(
443
+ --slotted-datetime-range-picker-readonly-background,
444
+ var(--slotted-tone-secondary-subtle-hover)
445
+ );
446
+ cursor: default;
447
+ }
448
+
449
+ /* Muted to the colour the theme measures rather than faded by opacity. */
450
+ [data-ui='datetime-range-picker'][data-part='root'][data-disabled] [data-part='control'] {
451
+ background-color: var(
452
+ --slotted-datetime-range-picker-disabled-background,
453
+ var(--slotted-disabled-background)
454
+ );
455
+ border-color: var(
456
+ --slotted-datetime-range-picker-disabled-border-color,
457
+ var(--slotted-disabled-border)
458
+ );
459
+ box-shadow: none;
460
+ color: var(--slotted-datetime-range-picker-disabled-color, var(--slotted-disabled-foreground));
461
+ cursor: not-allowed;
462
+ }
463
+
464
+ [data-ui='datetime-range-picker'][data-part='root'][data-disabled]
465
+ [data-part='trigger']
466
+ > [data-ui='icon'] {
467
+ color: var(--slotted-disabled-foreground);
468
+ }
469
+
470
+ /* ── The layer ────────────────────────────────────────────────────────
471
+ *
472
+ * What `packages/core/src/positioner` writes `position`, `left` and `top`
473
+ * onto. The painted surface is one element in, as every overlay is built.
474
+ */
475
+ [data-ui='datetime-range-picker'][data-part='positioner'] {
476
+ /* Only the block inset: the positioner writes `left` and never `right`,
477
+ and `inset-inline-start` would resolve to `right` in a right-to-left
478
+ document and win over the measured value. */
479
+ position: absolute;
480
+ inset-block-start: 0;
481
+
482
+ box-sizing: border-box;
483
+ isolation: isolate;
484
+ pointer-events: none;
485
+ z-index: calc(var(--slotted-z-index-popover, 1100) + var(--slotted-layer-depth, 0));
486
+
487
+ /* The layer arrives along the axis it opens on and never along the inline
488
+ one, which is the rule `select` records. */
489
+ --_enter-distance: var(--slotted-space-2, 0.25rem);
490
+ opacity: 0;
491
+ translate: 0 calc(-1 * var(--_enter-distance));
492
+ transition:
493
+ opacity var(--slotted-duration-short) var(--slotted-easing-exit),
494
+ translate var(--slotted-duration-short) var(--slotted-easing-exit);
495
+ }
496
+
497
+ [data-ui='datetime-range-picker'][data-part='positioner'][data-side='top'] {
498
+ translate: 0 var(--_enter-distance);
499
+ }
500
+
501
+ [data-ui='datetime-range-picker'][data-part='positioner']:is(
502
+ [data-side='left'],
503
+ [data-side='right']
504
+ ) {
505
+ translate: 0 0;
506
+ }
507
+
508
+ [data-ui='datetime-range-picker'][data-part='positioner'][data-open] {
509
+ opacity: 1;
510
+ translate: 0 0;
511
+ transition: none;
512
+ }
513
+
514
+ /* The entrance is a keyframe animation and not a transition, for the reason
515
+ `select` records: only a layer the positioner placed arrives. */
516
+ [data-ui='datetime-range-picker'][data-part='positioner'][data-open][data-positioned] {
517
+ animation: slotted-datetime-range-picker-enter-down var(--slotted-duration-medium)
518
+ var(--slotted-easing-enter);
519
+ }
520
+
521
+ [data-ui='datetime-range-picker'][data-part='positioner'][data-open][data-positioned][data-side='top'] {
522
+ animation-name: slotted-datetime-range-picker-enter-up;
523
+ }
524
+
525
+ [data-ui='datetime-range-picker'][data-part='positioner'][data-open][data-positioned]:is(
526
+ [data-side='left'],
527
+ [data-side='right']
528
+ ) {
529
+ animation-name: slotted-datetime-range-picker-fade;
530
+ }
531
+
532
+ @keyframes slotted-datetime-range-picker-enter-down {
533
+ from {
534
+ opacity: 0;
535
+ translate: 0 calc(-1 * var(--_enter-distance));
536
+ }
537
+ }
538
+
539
+ @keyframes slotted-datetime-range-picker-enter-up {
540
+ from {
541
+ opacity: 0;
542
+ translate: 0 var(--_enter-distance);
543
+ }
544
+ }
545
+
546
+ @keyframes slotted-datetime-range-picker-fade {
547
+ from {
548
+ opacity: 0;
549
+ }
550
+ }
551
+
552
+ /* Stillness keeps the fade and drops the movement. */
553
+ @media (prefers-reduced-motion: reduce) {
554
+ [data-ui='datetime-range-picker'][data-part='positioner'],
555
+ [data-ui='datetime-range-picker'][data-part='positioner'][data-side='top'],
556
+ [data-ui='datetime-range-picker'][data-part='positioner'][data-side='left'],
557
+ [data-ui='datetime-range-picker'][data-part='positioner'][data-side='right'] {
558
+ translate: 0 0;
559
+ transition: opacity var(--slotted-duration-short) var(--slotted-easing-exit);
560
+ }
561
+
562
+ [data-ui='datetime-range-picker'][data-part='positioner'][data-open][data-positioned],
563
+ [data-ui='datetime-range-picker'][data-part='positioner'][data-open][data-positioned][data-side='top'],
564
+ [data-ui='datetime-range-picker'][data-part='positioner'][data-open][data-positioned][data-side='left'],
565
+ [data-ui='datetime-range-picker'][data-part='positioner'][data-open][data-positioned][data-side='right'] {
566
+ animation-name: slotted-datetime-range-picker-fade;
567
+ }
568
+ }
569
+
570
+ /* The anchor scrolled out of its own clipper. */
571
+ [data-ui='datetime-range-picker'][data-part='positioner'][data-detached] {
572
+ visibility: hidden;
573
+ }
574
+
575
+ /**
576
+ * The surface. It is sized by the calendar and the list inside it rather
577
+ * than by the control it hangs from, and it is a grid of one
578
+ * `minmax(0, 1fr)` track for the reason `date-range-picker` records: an
579
+ * `auto` track takes the calendar's own width as its floor, and the cap
580
+ * below would then cap a box the track had already overflowed.
581
+ */
582
+ [data-ui='datetime-range-picker'] [data-part='content'] {
583
+ background-color: var(
584
+ --slotted-datetime-range-picker-surface,
585
+ var(--slotted-surface-raised, Canvas)
586
+ );
587
+ border: var(--slotted-border-width-thin, 1px) solid
588
+ var(
589
+ --slotted-datetime-range-picker-content-border-color,
590
+ var(--slotted-border-subtle, ButtonBorder)
591
+ );
592
+ border-radius: var(
593
+ --slotted-datetime-range-picker-content-radius,
594
+ var(--slotted-radius-lg, 8px)
595
+ );
596
+ box-shadow: var(--slotted-datetime-range-picker-content-shadow, var(--slotted-shadow-md));
597
+ box-sizing: border-box;
598
+ color: var(--slotted-datetime-range-picker-content-color, var(--slotted-text, CanvasText));
599
+ /* The type of the surface follows density with the control scale, as the
600
+ calendar's does: a list at the page's size beside a grid at the
601
+ control's read as two sizes in dense. */
602
+ font-family: var(--slotted-control-font-family, system-ui, sans-serif);
603
+ font-size: var(--slotted-control-font-size-md, 13px);
604
+ /**
605
+ * One row's height, stated once, because the list's cap is counted in
606
+ * rows — eight and a half of them at every density, the arithmetic
607
+ * `time-picker` records. The pitch is the row plus the air under it.
608
+ */
609
+ --_row: max(var(--slotted-target-min, 24px), var(--slotted-control-height-sm, 30px));
610
+ --_row-pitch: calc(var(--_row) + var(--slotted-space-1, 0.125rem));
611
+
612
+ display: grid;
613
+ /* The bands breathe by the step the dialogs of the date chain use: a
614
+ surface holding a field and a list is a dialog, not a menu. */
615
+ gap: var(--slotted-space-5, 0.75rem);
616
+ grid-template-areas: 'head' 'presets' 'panel' 'footer';
617
+ grid-template-columns: minmax(0, 1fr);
618
+ /* Capped by the room the positioner measured, so the list drops under a
619
+ calendar it does not fit beside instead of running past the edge of
620
+ the screen; and by thirty rems before that, because a surface that
621
+ shrink-wraps a list takes its widest row, and a column of times reads
622
+ at half of that. */
623
+ max-inline-size: min(
624
+ var(--slotted-positioner-available-width, 100vw),
625
+ var(--slotted-datetime-range-picker-content-max-inline-size, 30rem)
626
+ );
627
+ padding: var(--slotted-datetime-range-picker-content-padding, var(--slotted-space-5, 0.75rem));
628
+ /* The layer above gave up the pointer; the surface takes it back. */
629
+ pointer-events: auto;
630
+ }
631
+
632
+ /* ── The band ─────────────────────────────────────────────────────────
633
+ *
634
+ * Three rows: which end is being chosen, where the reader types it, and
635
+ * what to do next. It renders at the panel's width and contributes nothing
636
+ * to it, by the pair `datetime-picker` records.
637
+ */
638
+ [data-ui='datetime-range-picker'] [data-part='head'] {
639
+ box-sizing: border-box;
640
+ inline-size: 0;
641
+ min-inline-size: 100%;
642
+
643
+ /* A grid, so the field and now, and the hint and the length, share a
644
+ row without a wrapper the anatomy would have to name. */
645
+ column-gap: var(--slotted-space-2, 0.25rem);
646
+ display: grid;
647
+ grid-area: head;
648
+ grid-template-areas: 'tabs tabs' 'field now' 'hint length' 'limit limit';
649
+ grid-template-columns: minmax(0, 1fr) auto;
650
+ row-gap: var(--slotted-space-2, 0.25rem);
651
+ }
652
+
653
+ [data-ui='datetime-range-picker'] [data-part='tabs'] {
654
+ grid-area: tabs;
655
+ }
656
+
657
+ [data-ui='datetime-range-picker'] [data-part='field'] {
658
+ grid-area: field;
659
+ }
660
+
661
+ [data-ui='datetime-range-picker'] [data-part='head'] > [data-part='now'] {
662
+ align-self: center;
663
+ grid-area: now;
664
+ }
665
+
666
+ [data-ui='datetime-range-picker'] [data-part='hint'] {
667
+ align-self: center;
668
+ grid-area: hint;
669
+ }
670
+
671
+ [data-ui='datetime-range-picker'] [data-part='length'] {
672
+ align-self: center;
673
+ grid-area: length;
674
+ }
675
+
676
+ [data-ui='datetime-range-picker'] [data-part='limit'] {
677
+ grid-area: limit;
678
+ }
679
+
680
+ /* ── The two ends, as tabs ────────────────────────────────────────────
681
+ *
682
+ * One end at a time. Two equal halves, the label over the value; the
683
+ * current one carries the underline `date-range-picker` draws under its
684
+ * current field, in the accent, and the other reads as the step to come.
685
+ * The row is the whole width so the two are the same size whatever their
686
+ * values, and a thumb finds them without aiming.
687
+ */
688
+ [data-ui='datetime-range-picker'] [data-part='tabs'] {
689
+ border-block-end: var(--slotted-border-width-thin, 1px) solid
690
+ var(
691
+ --slotted-datetime-range-picker-content-border-color,
692
+ var(--slotted-border-subtle, ButtonBorder)
693
+ );
694
+ display: grid;
695
+ gap: var(--slotted-space-2, 0.25rem);
696
+ grid-template-columns: repeat(2, minmax(0, 1fr));
697
+ }
698
+
699
+ [data-ui='datetime-range-picker'] [data-part='tab'] {
700
+ appearance: none;
701
+ background-color: transparent;
702
+ border: 0;
703
+ border-start-end-radius: var(
704
+ --slotted-datetime-range-picker-option-radius,
705
+ var(--slotted-radius-sm, 4px)
706
+ );
707
+ border-start-start-radius: var(
708
+ --slotted-datetime-range-picker-option-radius,
709
+ var(--slotted-radius-sm, 4px)
710
+ );
711
+ color: var(--slotted-datetime-range-picker-content-color, var(--slotted-text, CanvasText));
712
+ cursor: pointer;
713
+ display: flex;
714
+ flex-direction: column;
715
+ font: inherit;
716
+ gap: var(--slotted-space-1, 0.125rem);
717
+ min-block-size: var(--slotted-datetime-range-picker-tab-block-size, calc(var(--_row) * 1.5));
718
+ min-inline-size: 0;
719
+ padding-block: var(--slotted-space-2, 0.25rem) var(--slotted-space-3, 0.375rem);
720
+ padding-inline: var(--slotted-space-3, 0.375rem);
721
+ position: relative;
722
+ text-align: start;
723
+ touch-action: manipulation;
724
+ transition: background-color var(--slotted-control-transition-duration)
725
+ var(--slotted-control-transition-easing);
726
+ -webkit-tap-highlight-color: transparent;
727
+ }
728
+
729
+ [data-ui='datetime-range-picker'] [data-part='tab']::after {
730
+ background-color: var(
731
+ --slotted-datetime-range-picker-current-color,
732
+ var(--slotted-tone-accent-solid)
733
+ );
734
+ block-size: var(--slotted-datetime-range-picker-current-size, 2px);
735
+ border-start-end-radius: var(--slotted-radius-xs, 2px);
736
+ border-start-start-radius: var(--slotted-radius-xs, 2px);
737
+ content: '';
738
+ /* Over the row's own hairline, so the current tab's mark and the rule
739
+ are one line. */
740
+ inset-block-end: calc(-1 * var(--slotted-border-width-thin, 1px));
741
+ inset-inline: 0;
742
+ opacity: 0;
743
+ position: absolute;
744
+ transition: opacity var(--slotted-control-transition-duration)
745
+ var(--slotted-control-transition-easing);
746
+ }
747
+
748
+ [data-ui='datetime-range-picker'] [data-part='tab'][data-current]::after {
749
+ opacity: 1;
750
+ }
751
+
752
+ [data-ui='datetime-range-picker'] [data-part='tab']:hover:not(:disabled):not([data-current]) {
753
+ background-color: var(
754
+ --slotted-datetime-range-picker-option-hover-background,
755
+ var(--slotted-tone-secondary-subtle-hover)
756
+ );
757
+ }
758
+
759
+ [data-ui='datetime-range-picker'] [data-part='tab']:focus-visible {
760
+ outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
761
+ outline-offset: calc(var(--slotted-focus-ring-offset, 2px) * -1);
762
+ }
763
+
764
+ [data-ui='datetime-range-picker'] [data-part='tab']:disabled {
765
+ color: var(--slotted-disabled-foreground);
766
+ cursor: not-allowed;
767
+ }
768
+
769
+ /* The label, in the muted ink for both ends alike: which end is current
770
+ is said once, by the underline. */
771
+ [data-ui='datetime-range-picker'] [data-part='tab-label'] {
772
+ color: var(--slotted-datetime-range-picker-label-color, var(--slotted-text-muted, GrayText));
773
+ font-size: var(--slotted-font-size-xs, 11px);
774
+ font-weight: var(--slotted-font-weight-medium, 500);
775
+ letter-spacing: var(--slotted-letter-spacing-wide, 0.02em);
776
+ text-transform: uppercase;
777
+ white-space: nowrap;
778
+ }
779
+
780
+ [data-ui='datetime-range-picker'] [data-part='tab-value'] {
781
+ font-size: var(--slotted-font-size-sm, 13px);
782
+ font-variant-numeric: tabular-nums;
783
+ font-weight: var(--slotted-font-weight-medium, 500);
784
+ overflow: hidden;
785
+ text-overflow: ellipsis;
786
+ unicode-bidi: plaintext;
787
+ white-space: nowrap;
788
+ }
789
+
790
+ [data-ui='datetime-range-picker'] [data-part='tab'][data-placeholder] [data-part='tab-value'] {
791
+ color: var(--slotted-datetime-range-picker-label-color, var(--slotted-text-muted, GrayText));
792
+ font-weight: var(--slotted-font-weight-regular, 400);
793
+ }
794
+
795
+ /* ── The field row ────────────────────────────────────────────────────
796
+ *
797
+ * The current end's field in `plain`, spoken to in the only language this
798
+ * stylesheet is allowed: the tokens the field reads. Its border, inline
799
+ * padding, hover wash, invalid edge and lift are zeroed; its own focus ring
800
+ * stays, because in the band the field is the control the reader is in.
801
+ * `now` sits at the reading end of the same row. On a coarse pointer the
802
+ * row is `now` alone: a segment is a spinbutton and raises no keyboard.
803
+ */
804
+ [data-ui='datetime-range-picker'] [data-part='field'] {
805
+ --slotted-control-border-width: 0px;
806
+ --slotted-control-padding-inline-sm: var(--slotted-space-2, 0.25rem);
807
+ --slotted-control-padding-inline-md: var(--slotted-space-2, 0.25rem);
808
+ --slotted-control-padding-inline-lg: var(--slotted-space-2, 0.25rem);
809
+ --slotted-datetime-field-plain-hover-background: transparent;
810
+ --slotted-datetime-field-invalid-border-color: transparent;
811
+ --slotted-datetime-field-shadow: none;
812
+ --slotted-control-shadow-focus-geometry: 0 0 0 0;
813
+
814
+ display: flex;
815
+ flex: 0 1 auto;
816
+ min-inline-size: 0;
817
+ }
818
+
819
+ /* ── What to do next ──────────────────────────────────────────────────
820
+ *
821
+ * The hint at the start, the duration at the reading end; the limit on a
822
+ * line of its own under them. The hint is the difference between a panel
823
+ * that refuses and a panel that explains.
824
+ */
825
+ [data-ui='datetime-range-picker'] [data-part='hint'] {
826
+ color: var(--slotted-datetime-range-picker-hint-color, var(--slotted-text-muted, GrayText));
827
+ font-size: var(--slotted-font-size-sm, 13px);
828
+ min-inline-size: 0;
829
+ padding-inline-start: var(--slotted-space-2, 0.25rem);
830
+ text-wrap: balance;
831
+ unicode-bidi: plaintext;
832
+ }
833
+
834
+ [data-ui='datetime-range-picker'] [data-part='hint'][data-invalid] {
835
+ color: var(--slotted-datetime-range-picker-invalid-color, var(--slotted-tone-danger-text));
836
+ }
837
+
838
+ /* The duration, at the reading end, in the accent's text tone: it is the
839
+ number the band exists to say. Pending, it drops a step of weight. */
840
+ [data-ui='datetime-range-picker'] [data-part='length'] {
841
+ color: var(--slotted-datetime-range-picker-length-color, var(--slotted-tone-accent-text));
842
+ font-size: var(--slotted-font-size-sm, 13px);
843
+ font-variant-numeric: tabular-nums;
844
+ font-weight: var(--slotted-font-weight-semibold, 600);
845
+ padding-inline: var(--slotted-space-4, 0.5rem) var(--slotted-space-2, 0.25rem);
846
+ unicode-bidi: plaintext;
847
+ white-space: nowrap;
848
+ }
849
+
850
+ [data-ui='datetime-range-picker'] [data-part='length'][data-pending] {
851
+ font-weight: var(--slotted-font-weight-medium, 500);
852
+ }
853
+
854
+ /* An empty length still holds its line, so the band does not grow a row
855
+ when the first end is chosen. */
856
+ [data-ui='datetime-range-picker'] [data-part='length']:empty::before {
857
+ content: '\200B';
858
+ }
859
+
860
+ [data-ui='datetime-range-picker'] [data-part='limit'] {
861
+ color: var(--slotted-datetime-range-picker-limit-color, var(--slotted-text-muted, GrayText));
862
+ font-size: var(--slotted-font-size-xs, 11px);
863
+ padding-inline-start: var(--slotted-space-2, 0.25rem);
864
+ unicode-bidi: plaintext;
865
+ }
866
+
867
+ /* ── The panel ────────────────────────────────────────────────────────
868
+ *
869
+ * The current end, one at a time: the calendar in range mode with both
870
+ * dates drawn, and the list of that end beside it, running on its day.
871
+ * `data-position` says which. Two items in a wrapping row: the list drops
872
+ * under the grid when the row cannot hold the grid and a list of nine rems
873
+ * — with one list there is nothing to keep together, so the row wraps by
874
+ * itself and no break in rems is needed; a break in rems broke the row in
875
+ * dense, where the grid is narrower and both fit. Half a step on every
876
+ * item and the same half taken back on the row, in place of `gap`, the
877
+ * habit of the date chain.
878
+ */
879
+ [data-ui='datetime-range-picker'] [data-part='panel'] {
880
+ --_panel-gap: calc(var(--slotted-space-4, 0.5rem) / 2);
881
+
882
+ align-items: stretch;
883
+ display: flex;
884
+ flex-wrap: wrap;
885
+ grid-area: panel;
886
+ margin: calc(-1 * var(--_panel-gap));
887
+ min-inline-size: 0;
888
+ }
889
+
890
+ [data-ui='datetime-range-picker'] [data-part='panel'] > * {
891
+ margin: var(--_panel-gap);
892
+ }
893
+
894
+ /* The calendar keeps its own width and wraps its second month under the
895
+ first when the surface is narrow, which is its own container rule. */
896
+ [data-ui='datetime-range-picker'] [data-part='date-panel'] {
897
+ flex: 0 1 auto;
898
+ min-inline-size: 0;
899
+ }
900
+
901
+ [data-ui='datetime-range-picker'] [data-part='panel'] > [data-part='list'],
902
+ [data-ui='datetime-range-picker'] [data-part='panel'] > [data-part='empty'] {
903
+ flex: 1 1 var(--slotted-datetime-range-picker-list-min-inline-size, 9rem);
904
+ min-inline-size: var(--slotted-datetime-range-picker-list-min-inline-size, 9rem);
905
+ }
906
+
907
+ /* A hairline between the grid and the list while they share a row. */
908
+ [data-ui='datetime-range-picker'] [data-part='date-panel'] + [data-part='list'],
909
+ [data-ui='datetime-range-picker'] [data-part='date-panel'] + [data-part='empty'] {
910
+ border-inline-start: var(--slotted-border-width-thin, 1px) solid
911
+ var(
912
+ --slotted-datetime-range-picker-content-border-color,
913
+ var(--slotted-border-subtle, ButtonBorder)
914
+ );
915
+ padding-inline-start: var(--slotted-space-4, 0.5rem);
916
+ }
917
+
918
+ [data-ui='datetime-range-picker'] [data-part='now'] {
919
+ appearance: none;
920
+ background-color: transparent;
921
+ border: 0;
922
+ border-radius: var(
923
+ --slotted-datetime-range-picker-option-radius,
924
+ var(--slotted-radius-sm, 4px)
925
+ );
926
+ color: var(--slotted-datetime-range-picker-now-color, var(--slotted-tone-accent-text));
927
+ cursor: pointer;
928
+ flex: 0 0 auto;
929
+ font: inherit;
930
+ font-size: var(--slotted-font-size-sm, 13px);
931
+ min-block-size: var(--_row);
932
+ padding-block: var(--slotted-space-1, 0.125rem);
933
+ padding-inline: var(--slotted-space-3, 0.375rem);
934
+ touch-action: manipulation;
935
+ transition: background-color var(--slotted-control-transition-duration)
936
+ var(--slotted-control-transition-easing);
937
+ }
938
+
939
+ [data-ui='datetime-range-picker'] [data-part='now']:hover:not(:disabled):not([data-disabled]) {
940
+ background-color: var(
941
+ --slotted-datetime-range-picker-option-hover-background,
942
+ var(--slotted-tone-secondary-subtle-hover)
943
+ );
944
+ }
945
+
946
+ [data-ui='datetime-range-picker'] [data-part='now']:focus-visible {
947
+ outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
948
+ outline-offset: calc(var(--slotted-focus-ring-offset, 2px) * -1);
949
+ }
950
+
951
+ [data-ui='datetime-range-picker'] [data-part='now']:disabled {
952
+ color: var(--slotted-disabled-foreground);
953
+ cursor: not-allowed;
954
+ }
955
+
956
+ /* ── The shortcuts ────────────────────────────────────────────────────
957
+ *
958
+ * This family ships no list of them: "the morning shift" is a business
959
+ * clock. It ships the row they stand in and the chip each one is, between
960
+ * the band and the panel, wrapping when they do not fit.
961
+ */
962
+ [data-ui='datetime-range-picker'] [data-part='presets'] {
963
+ display: flex;
964
+ flex-wrap: wrap;
965
+ gap: var(--slotted-space-2, 0.25rem);
966
+ grid-area: presets;
967
+ min-inline-size: 0;
968
+ }
969
+
970
+ [data-ui='datetime-range-picker'] [data-part='preset'] {
971
+ appearance: none;
972
+ background-color: var(
973
+ --slotted-datetime-range-picker-preset-background,
974
+ var(--slotted-tone-secondary-subtle)
975
+ );
976
+ border: 0;
977
+ border-radius: var(
978
+ --slotted-datetime-range-picker-preset-radius,
979
+ var(--slotted-radius-pill, 999px)
980
+ );
981
+ color: var(--slotted-datetime-range-picker-content-color, var(--slotted-text, CanvasText));
982
+ cursor: pointer;
983
+ font-family: var(--slotted-control-font-family, system-ui, sans-serif);
984
+ font-size: var(--slotted-font-size-sm, 13px);
985
+ line-height: var(--slotted-line-height-sm, 1.4);
986
+ min-block-size: var(--_row);
987
+ padding-block: var(--slotted-space-1, 0.125rem);
988
+ padding-inline: var(--slotted-space-4, 0.5rem);
989
+ text-align: start;
990
+ touch-action: manipulation;
991
+ transition:
992
+ background-color var(--slotted-control-transition-duration)
993
+ var(--slotted-control-transition-easing),
994
+ color var(--slotted-control-transition-duration) var(--slotted-control-transition-easing);
995
+ white-space: nowrap;
996
+ -webkit-tap-highlight-color: transparent;
997
+ }
998
+
999
+ [data-ui='datetime-range-picker'] [data-part='preset']:hover:not(:disabled):not([data-selected]) {
1000
+ background-color: var(
1001
+ --slotted-datetime-range-picker-preset-hover-background,
1002
+ var(--slotted-tone-secondary-subtle-hover)
1003
+ );
1004
+ }
1005
+
1006
+ [data-ui='datetime-range-picker']
1007
+ [data-part='preset']:active:not(:disabled):not([data-selected]) {
1008
+ background-color: var(
1009
+ --slotted-datetime-range-picker-preset-active-background,
1010
+ var(--slotted-tone-secondary-subtle-active)
1011
+ );
1012
+ }
1013
+
1014
+ [data-ui='datetime-range-picker'] [data-part='preset'][data-selected] {
1015
+ background-color: var(
1016
+ --slotted-datetime-range-picker-preset-selected-background,
1017
+ var(--slotted-tone-accent-subtle-hover)
1018
+ );
1019
+ color: var(
1020
+ --slotted-datetime-range-picker-preset-selected-color,
1021
+ var(--slotted-tone-accent-text)
1022
+ );
1023
+ font-weight: var(--slotted-font-weight-medium, 500);
1024
+ }
1025
+
1026
+ [data-ui='datetime-range-picker'] [data-part='preset']:focus-visible {
1027
+ outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
1028
+ outline-offset: var(--slotted-focus-ring-offset, 2px);
1029
+ }
1030
+
1031
+ [data-ui='datetime-range-picker'] [data-part='preset']:disabled {
1032
+ color: var(--slotted-disabled-foreground);
1033
+ cursor: not-allowed;
1034
+ }
1035
+
1036
+ /* ── The list ─────────────────────────────────────────────────────────
1037
+ *
1038
+ * One column of times, the current end's, capped in control heights so the
1039
+ * cap holds at every density, and scrolled rather than truncated —
1040
+ * `time-picker`'s list.
1041
+ */
1042
+ [data-ui='datetime-range-picker'] [data-part='list'] {
1043
+ display: flex;
1044
+ flex-direction: column;
1045
+ /* One step of air between rows, so the chosen row's painted ground and
1046
+ the focused row's inset ring never share an edge. */
1047
+ gap: var(--slotted-space-1, 0.125rem);
1048
+ /* Eight rows and half of the ninth: a list cut on a row boundary looks
1049
+ like the whole list. */
1050
+ max-block-size: var(
1051
+ --slotted-datetime-range-picker-list-block-size,
1052
+ calc(var(--_row-pitch) * 8.5)
1053
+ );
1054
+ min-inline-size: 0;
1055
+ overflow-y: auto;
1056
+ /* A highlight moved by a key lands whole rather than half under the edge. */
1057
+ scroll-padding-block: var(--slotted-space-2, 0.25rem);
1058
+ }
1059
+
1060
+ [data-ui='datetime-range-picker'] [data-part='option'] {
1061
+ /* The time and its duration share a baseline, and the line box is the
1062
+ row: baseline alignment alone would seat both at the top of a row
1063
+ taller than one line, and a length line-height centres them in it. */
1064
+ align-items: baseline;
1065
+ background-color: transparent;
1066
+ border-radius: var(
1067
+ --slotted-datetime-range-picker-option-radius,
1068
+ var(--slotted-radius-sm, 4px)
1069
+ );
1070
+ color: inherit;
1071
+ cursor: pointer;
1072
+ display: flex;
1073
+ flex: 0 0 auto;
1074
+ font-variant-numeric: tabular-nums;
1075
+ gap: var(--slotted-space-3, 0.375rem);
1076
+ justify-content: space-between;
1077
+ line-height: var(--_row);
1078
+ /* The row *is* `--_row`: no block padding on top of it, so eight rows are
1079
+ eight rows and the cap that counts them is arithmetic. */
1080
+ min-block-size: var(--_row);
1081
+ padding-inline: var(--slotted-space-3, 0.375rem);
1082
+ transition:
1083
+ background-color var(--slotted-control-transition-duration)
1084
+ var(--slotted-control-transition-easing),
1085
+ color var(--slotted-control-transition-duration) var(--slotted-control-transition-easing);
1086
+ user-select: none;
1087
+ -webkit-tap-highlight-color: transparent;
1088
+ }
1089
+
1090
+ /**
1091
+ * The duration this option would make, beside it: "15:00 · 1 hr", the way
1092
+ * a calendar application lists the end times of an event. It is the answer
1093
+ * to the question the reader is actually asking while choosing an end, read
1094
+ * row by row rather than one option at a time from the band. In the list of
1095
+ * the other end it is the duration to the end already chosen. Muted, so the
1096
+ * time stays what the row is; on the chosen row it takes the row's own ink.
1097
+ */
1098
+ [data-ui='datetime-range-picker'] [data-part='option-duration'] {
1099
+ color: var(--slotted-datetime-range-picker-label-color, var(--slotted-text-muted, GrayText));
1100
+ flex: 0 1 auto;
1101
+ font-size: var(--slotted-font-size-xs, 11px);
1102
+ min-inline-size: 0;
1103
+ overflow: hidden;
1104
+ text-overflow: ellipsis;
1105
+ unicode-bidi: plaintext;
1106
+ white-space: nowrap;
1107
+ }
1108
+
1109
+ [data-ui='datetime-range-picker']
1110
+ [data-part='option'][data-selected]
1111
+ [data-part='option-duration'],
1112
+ [data-ui='datetime-range-picker']
1113
+ [data-part='option'][data-disabled]
1114
+ [data-part='option-duration'] {
1115
+ color: inherit;
1116
+ }
1117
+
1118
+ /* ── Option states ────────────────────────────────────────────────────
1119
+ *
1120
+ * Written strongest last, and each weaker one guarded against every stronger
1121
+ * one it can meet: the chosen time outranks the highlight, and the highlight
1122
+ * outranks the pointer. Specificity is what makes this a rule rather than an
1123
+ * ordering — the defect `time-picker` records from its visual gate.
1124
+ */
1125
+ [data-ui='datetime-range-picker']
1126
+ [data-part='option']:hover:not([data-disabled]):not([data-selected]):not([data-current]) {
1127
+ background-color: var(
1128
+ --slotted-datetime-range-picker-option-hover-background,
1129
+ var(--slotted-tone-secondary-subtle-hover)
1130
+ );
1131
+ }
1132
+
1133
+ [data-ui='datetime-range-picker'] [data-part='option'][data-current]:not([data-selected]) {
1134
+ background-color: var(
1135
+ --slotted-datetime-range-picker-option-current-background,
1136
+ var(--slotted-tone-secondary-subtle-active)
1137
+ );
1138
+ }
1139
+
1140
+ [data-ui='datetime-range-picker'] [data-part='option']:focus-visible {
1141
+ outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
1142
+ outline-offset: calc(var(--slotted-focus-ring-offset, 2px) * -1);
1143
+ }
1144
+
1145
+ [data-ui='datetime-range-picker'] [data-part='option'][data-selected] {
1146
+ background-color: var(
1147
+ --slotted-datetime-range-picker-option-selected-background,
1148
+ var(--slotted-tone-accent-solid)
1149
+ );
1150
+ color: var(
1151
+ --slotted-datetime-range-picker-option-selected-color,
1152
+ var(--slotted-tone-accent-on-solid)
1153
+ );
1154
+ }
1155
+
1156
+ /* The chosen row still answers the pointer, one step along its own tone. */
1157
+ [data-ui='datetime-range-picker'] [data-part='option'][data-selected]:hover:not([data-disabled]) {
1158
+ background-color: var(
1159
+ --slotted-datetime-range-picker-option-selected-hover-background,
1160
+ var(--slotted-tone-accent-solid-hover)
1161
+ );
1162
+ }
1163
+
1164
+ /**
1165
+ * A time a bound, the predicate or the other end refuses. It stays in the
1166
+ * list by default, because a list that silently drops rows is a list whose
1167
+ * step the reader cannot infer — and it is muted to the colour the theme
1168
+ * measures rather than faded by opacity, so it stays readable.
1169
+ */
1170
+ [data-ui='datetime-range-picker'] [data-part='option'][data-disabled] {
1171
+ background-color: transparent;
1172
+ color: var(--slotted-disabled-foreground);
1173
+ cursor: not-allowed;
1174
+ }
1175
+
1176
+ /* Nothing available for this end at all. A sentence rather than an empty
1177
+ box, the reason `time-picker` records. */
1178
+ [data-ui='datetime-range-picker'] [data-part='empty'] {
1179
+ align-items: center;
1180
+ color: var(--slotted-datetime-range-picker-label-color, var(--slotted-text-muted, GrayText));
1181
+ display: flex;
1182
+ font-size: var(--slotted-font-size-sm, 13px);
1183
+ justify-content: center;
1184
+ min-block-size: calc(var(--_row) * 2);
1185
+ padding: var(--slotted-space-4, 0.5rem);
1186
+ text-align: center;
1187
+ text-wrap: balance;
1188
+ /* A sentence laid out by its own first strong character, so a full stop
1189
+ does not lead it in a right-to-left document. */
1190
+ unicode-bidi: plaintext;
1191
+ }
1192
+
1193
+ /* The consumer's own actions and, at the reading end, `done`: the way out
1194
+ of a sheet that fills the screen and of an edit left half way. */
1195
+ [data-ui='datetime-range-picker'] [data-part='footer'] {
1196
+ box-sizing: border-box;
1197
+ inline-size: 0;
1198
+ min-inline-size: 100%;
1199
+
1200
+ align-items: center;
1201
+ border-block-start: var(--slotted-border-width-thin, 1px) solid
1202
+ var(
1203
+ --slotted-datetime-range-picker-content-border-color,
1204
+ var(--slotted-border-subtle, ButtonBorder)
1205
+ );
1206
+ display: flex;
1207
+ gap: var(--slotted-space-2, 0.25rem);
1208
+ grid-area: footer;
1209
+ justify-content: flex-end;
1210
+ padding-block-start: var(--slotted-space-3, 0.375rem);
1211
+ }
1212
+
1213
+ [data-ui='datetime-range-picker'] [data-part='done'] {
1214
+ appearance: none;
1215
+ background-color: var(
1216
+ --slotted-datetime-range-picker-done-background,
1217
+ var(--slotted-tone-accent-solid)
1218
+ );
1219
+ border: 0;
1220
+ border-radius: var(--slotted-datetime-range-picker-radius, var(--slotted-control-radius, 4px));
1221
+ color: var(
1222
+ --slotted-datetime-range-picker-done-color,
1223
+ var(--slotted-tone-accent-on-solid, Canvas)
1224
+ );
1225
+ cursor: pointer;
1226
+ font-family: var(--slotted-control-font-family, system-ui, sans-serif);
1227
+ font-size: var(--slotted-font-size-sm, 13px);
1228
+ font-weight: var(--slotted-font-weight-medium, 500);
1229
+ line-height: var(--slotted-line-height-sm, 1.4);
1230
+ margin-inline-start: auto;
1231
+ min-block-size: var(--_row);
1232
+ padding-block: var(--slotted-space-1, 0.125rem);
1233
+ padding-inline: var(--slotted-space-5, 0.75rem);
1234
+ touch-action: manipulation;
1235
+ transition: background-color var(--slotted-control-transition-duration)
1236
+ var(--slotted-control-transition-easing);
1237
+ -webkit-tap-highlight-color: transparent;
1238
+ }
1239
+
1240
+ [data-ui='datetime-range-picker'] [data-part='done']:hover:not(:disabled) {
1241
+ background-color: var(
1242
+ --slotted-datetime-range-picker-done-hover-background,
1243
+ var(--slotted-tone-accent-solid-hover)
1244
+ );
1245
+ }
1246
+
1247
+ [data-ui='datetime-range-picker'] [data-part='done']:active:not(:disabled) {
1248
+ background-color: var(
1249
+ --slotted-datetime-range-picker-done-active-background,
1250
+ var(--slotted-tone-accent-solid-active)
1251
+ );
1252
+ }
1253
+
1254
+ [data-ui='datetime-range-picker'] [data-part='done']:focus-visible {
1255
+ outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
1256
+ outline-offset: var(--slotted-focus-ring-offset, 2px);
1257
+ }
1258
+
1259
+ /* ── On a finger ──────────────────────────────────────────────────────
1260
+ *
1261
+ * The row is the touch target: the theme raises the control heights to
1262
+ * `--slotted-target-comfortable` under a coarse pointer, and the row is
1263
+ * counted in them. The field is not drawn — a segment is a spinbutton and
1264
+ * raises no keyboard — and the list is the way to a time.
1265
+ */
1266
+ @media (pointer: coarse) {
1267
+ [data-ui='datetime-range-picker'] [data-part='field'] {
1268
+ display: none;
1269
+ }
1270
+ }
1271
+
1272
+ /* ── Narrow, on a finger ──────────────────────────────────────────────
1273
+ *
1274
+ * §2.7 of `docs/component-features.md` asks for it by name: a popover on the
1275
+ * desktop and a sheet in a narrow viewport. The DOM does not change.
1276
+ */
1277
+ @media (max-width: 480px) and (pointer: coarse) {
1278
+ [data-ui='datetime-range-picker'][data-part='positioner'][data-presentation='sheet'] {
1279
+ inset: auto 0 0;
1280
+ position: fixed;
1281
+ translate: 0 var(--slotted-space-9, 2rem);
1282
+ }
1283
+
1284
+ [data-ui='datetime-range-picker'][data-part='positioner'][data-presentation='sheet'][data-open] {
1285
+ translate: 0 0;
1286
+ }
1287
+
1288
+ [data-ui='datetime-range-picker'][data-part='positioner'][data-presentation='sheet']
1289
+ [data-part='content'] {
1290
+ border-end-end-radius: 0;
1291
+ border-end-start-radius: 0;
1292
+ border-inline: 0;
1293
+ border-block-end: 0;
1294
+ inline-size: var(--slotted-datetime-range-picker-sheet-inline-size, 100%);
1295
+ max-inline-size: none;
1296
+ /* A month wider than the screen would scroll sideways; the grid inside
1297
+ answers its own width instead. */
1298
+ justify-content: center;
1299
+ /* A sheet taller than the screen — a grid and a list on a short phone,
1300
+ a list on a phone held sideways — scrolls as one, so the tabs stay
1301
+ reachable rather than above the top edge. `dvh` follows the
1302
+ browser's own bars; `vh` is the fallback. */
1303
+ max-block-size: 100vh;
1304
+ max-block-size: 100dvh;
1305
+ overflow-y: auto;
1306
+ overscroll-behavior: contain;
1307
+ padding-block-end: max(
1308
+ var(--slotted-datetime-range-picker-content-padding, var(--slotted-space-5, 0.75rem)),
1309
+ env(safe-area-inset-bottom, 0px)
1310
+ );
1311
+ }
1312
+
1313
+ /* Four rows and a half under the grid on a phone, at the touch height:
1314
+ the grid, the list and done fit a short screen together. */
1315
+ [data-ui='datetime-range-picker'][data-part='positioner'][data-presentation='sheet']
1316
+ [data-part='list'] {
1317
+ max-block-size: calc(var(--_row-pitch) * 4.5);
1318
+ }
1319
+
1320
+ /* The list under the grid on a phone, whatever the row's width: a grid
1321
+ and a column side by side leave neither room enough. */
1322
+ [data-ui='datetime-range-picker'][data-part='positioner'][data-presentation='sheet']
1323
+ [data-part='panel']
1324
+ > [data-part='list'],
1325
+ [data-ui='datetime-range-picker'][data-part='positioner'][data-presentation='sheet']
1326
+ [data-part='panel']
1327
+ > [data-part='empty'] {
1328
+ flex-basis: 100%;
1329
+ }
1330
+
1331
+ [data-ui='datetime-range-picker'][data-part='positioner'][data-presentation='sheet']
1332
+ [data-part='date-panel']
1333
+ + [data-part='list'] {
1334
+ border-inline-start: 0;
1335
+ padding-inline-start: 0;
1336
+ }
1337
+
1338
+ [data-ui='datetime-range-picker'][data-part='positioner'][data-presentation='sheet']
1339
+ [data-part='tab'] {
1340
+ min-block-size: var(
1341
+ --slotted-datetime-range-picker-tab-block-size,
1342
+ var(--slotted-target-comfortable, 44px)
1343
+ );
1344
+ }
1345
+ }
1346
+
1347
+ @media (forced-colors: active) {
1348
+ [data-ui='datetime-range-picker'][data-part='root'][data-variant='plain']
1349
+ [data-part='control'] {
1350
+ border-color: ButtonBorder;
1351
+ }
1352
+
1353
+ /* The tab's underline is painted with a background, and forced colours
1354
+ replace a background that is not one of the system's own. */
1355
+ [data-ui='datetime-range-picker'] [data-part='tab']::after {
1356
+ forced-color-adjust: none;
1357
+ }
1358
+
1359
+ [data-ui='datetime-range-picker'] [data-part='tab']::after {
1360
+ background-color: currentcolor;
1361
+ }
1362
+
1363
+ [data-ui='datetime-range-picker'] [data-part='preset'][data-selected],
1364
+ [data-ui='datetime-range-picker'] [data-part='option'][data-selected] {
1365
+ background-color: Highlight;
1366
+ color: HighlightText;
1367
+ forced-color-adjust: none;
1368
+ }
1369
+
1370
+ [data-ui='datetime-range-picker'] [data-part='option'][data-current]:not([data-selected]) {
1371
+ outline: var(--slotted-focus-ring-width, 2px) solid Highlight;
1372
+ outline-offset: calc(var(--slotted-focus-ring-offset, 2px) * -1);
1373
+ }
1374
+ }
1375
+ }