@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,420 @@
1
+ @layer slotted.components {
2
+ /**
3
+ * ── A date field, a trigger, and a calendar behind them ────────────────
4
+ *
5
+ * ┌─ root ──────────────────────────────────────────────────────────┐
6
+ * │ ┌─ control ─────────────────────────────────────────────────┐ │
7
+ * │ │ date-field ┌ trigger ┐ │ │
8
+ * │ └───────────────────────────────────────────────────────────┘ │
9
+ * └─────────────────────────────────────────────────────────────────┘
10
+ * ┌─ positioner ─ the layer ────────────────────────────────┐
11
+ * │ ┌─ content ─ the surface ──────────────────────────┐ │
12
+ * │ │ presets │ calendar │ │
13
+ * │ │ footer │ │
14
+ * │ └──────────────────────────────────────────────────┘ │
15
+ * └────────────────────────────────────────────────────────┘
16
+ *
17
+ * The two families inside keep their own `data-ui`, so nothing here restyles
18
+ * a segment or a day: this stylesheet owns the frame that holds them, the
19
+ * trigger, and the layer the calendar stands on. A family that reached into
20
+ * another family's parts would be a second place to fix one defect.
21
+ */
22
+ [data-ui='date-picker'][data-part='root'] {
23
+ display: block;
24
+ /* The anchor the positioner measures is the control, and a block root
25
+ lets the frame take the width the form gave it. */
26
+ inline-size: 100%;
27
+ }
28
+
29
+ /**
30
+ * The box the positioner measures, and nothing else.
31
+ *
32
+ * It draws no frame: the `date-field` inside it draws its own, and the
33
+ * trigger is handed to that field's `end` slot by the binding. A second
34
+ * border here would be a second place to fix one defect, and this stylesheet
35
+ * would then have to reach into another family's parts to suppress the first
36
+ * — which is the rule the whole family is built to keep.
37
+ */
38
+ [data-ui='date-picker'] [data-part='control'] {
39
+ --_icon-size: var(--slotted-control-icon-size-md, 16px);
40
+ --_height: var(--slotted-control-height-md, 34px);
41
+
42
+ align-items: center;
43
+ display: flex;
44
+ inline-size: 100%;
45
+ min-inline-size: 0;
46
+ position: relative;
47
+ }
48
+
49
+ [data-ui='date-picker'][data-part='root'][data-size='sm'] [data-part='control'] {
50
+ --_icon-size: var(--slotted-control-icon-size-sm, 14px);
51
+ --_height: var(--slotted-control-height-sm, 30px);
52
+ }
53
+
54
+ [data-ui='date-picker'][data-part='root'][data-size='lg'] [data-part='control'] {
55
+ --_icon-size: var(--slotted-control-icon-size-lg, 18px);
56
+ --_height: var(--slotted-control-height-lg, 38px);
57
+ }
58
+
59
+ /**
60
+ * The button that opens the calendar. It sits inside the field's frame, at
61
+ * the reading end, and takes the same inner-control box every other family
62
+ * puts inside a frame.
63
+ *
64
+ * It is always drawn. Angular Material records why: ChromeOS turns
65
+ * `Alt`+`ArrowDown` into `PageDown` before the browser sees it, so the chord
66
+ * cannot be the only way in.
67
+ */
68
+ [data-ui='date-picker'] [data-part='trigger'] {
69
+ --slotted-icon-size: var(--_icon-size);
70
+
71
+ align-items: center;
72
+ appearance: none;
73
+ background-color: transparent;
74
+ block-size: var(
75
+ --slotted-date-picker-trigger-size,
76
+ min(
77
+ calc(var(--_icon-size) + 2 * var(--slotted-space-2, 0.25rem)),
78
+ calc(
79
+ var(--_height) - var(--slotted-control-border-width, 1px) * 2 -
80
+ var(--slotted-space-2, 0.25rem)
81
+ )
82
+ )
83
+ );
84
+ border: 0;
85
+ border-radius: var(--slotted-date-picker-radius, var(--slotted-control-radius, 4px));
86
+ color: var(--slotted-date-picker-trigger-color, var(--slotted-text-muted, GrayText));
87
+ cursor: pointer;
88
+ display: inline-flex;
89
+ flex: 0 0 auto;
90
+ inline-size: var(
91
+ --slotted-date-picker-trigger-size,
92
+ min(
93
+ calc(var(--_icon-size) + 2 * var(--slotted-space-2, 0.25rem)),
94
+ calc(
95
+ var(--_height) - var(--slotted-control-border-width, 1px) * 2 -
96
+ var(--slotted-space-2, 0.25rem)
97
+ )
98
+ )
99
+ );
100
+ justify-content: center;
101
+ padding: 0;
102
+ position: relative;
103
+ touch-action: manipulation;
104
+ transition:
105
+ background-color var(--slotted-control-transition-duration)
106
+ var(--slotted-control-transition-easing),
107
+ color var(--slotted-control-transition-duration) var(--slotted-control-transition-easing);
108
+ -webkit-tap-highlight-color: transparent;
109
+ }
110
+
111
+ /* The hit area, recovered outside the paint, exactly as every other inner
112
+ control in the library recovers it. */
113
+ [data-ui='date-picker'] [data-part='trigger']::after {
114
+ content: '';
115
+ inset: min(0px, calc((100% - var(--slotted-target-min, 24px)) / 2));
116
+ position: absolute;
117
+ }
118
+
119
+ /* On a finger the target is the comfortable size in both axes and the box
120
+ is the one a mouse sees: the ground and the focus ring stay square, and
121
+ the hit area above grows to 44 pixels around them. Before the field's
122
+ clear it does not reach across it. */
123
+ @media (pointer: coarse) {
124
+ [data-ui='date-picker'] [data-part='trigger']::after {
125
+ inset: min(0px, calc((100% - var(--slotted-target-comfortable, 44px)) / 2));
126
+ }
127
+
128
+ [data-ui='date-picker']
129
+ [data-part='end']:has(+ [data-part='clear']:not([hidden]))
130
+ > [data-part='trigger']::after {
131
+ inset-inline-end: 0;
132
+ }
133
+ }
134
+
135
+ /**
136
+ * The mark is the calendar `Glyph` the binding draws inside an `icon` box, at
137
+ * the field's icon step. It does not turn, and does not become a chevron while the surface is
138
+ * open. A chevron says "a list opens here", which is the promise `select`
139
+ * makes and this control does not keep: what opens is a month. The state is
140
+ * carried by `aria-expanded` and by the surface itself, and the trigger goes
141
+ * on saying what kind of value it holds — which is the one thing about it
142
+ * that never changes.
143
+ */
144
+
145
+ [data-ui='date-picker'] [data-part='trigger']:hover:not(:disabled):not([data-disabled]) {
146
+ background-color: var(
147
+ --slotted-date-picker-trigger-hover-background,
148
+ var(--slotted-tone-secondary-subtle-hover)
149
+ );
150
+ }
151
+
152
+ [data-ui='date-picker'] [data-part='trigger']:active:not(:disabled):not([data-disabled]) {
153
+ background-color: var(
154
+ --slotted-date-picker-trigger-active-background,
155
+ var(--slotted-tone-secondary-subtle-active)
156
+ );
157
+ }
158
+
159
+ /* Its own ring: tabbing from the last segment to the trigger has to move
160
+ something visible, and the frame's ring would sit still. */
161
+ [data-ui='date-picker'] [data-part='trigger']:focus-visible {
162
+ outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
163
+ outline-offset: calc(var(--slotted-focus-ring-offset, 2px) * -1);
164
+ }
165
+
166
+ [data-ui='date-picker'][data-part='root'][data-invalid] {
167
+ --slotted-focus-ring-color: var(
168
+ --slotted-date-picker-invalid-focus-ring-color,
169
+ var(--slotted-focus-ring-color-invalid, Highlight)
170
+ );
171
+ }
172
+
173
+ [data-ui='date-picker'] [data-part='trigger']:disabled {
174
+ color: var(--slotted-disabled-foreground);
175
+ cursor: not-allowed;
176
+ }
177
+
178
+ /* ── The layer ────────────────────────────────────────────────────────
179
+ *
180
+ * What `packages/core/src/positioner` writes `position`, `left` and `top`
181
+ * onto. The painted surface is one element in, as `tooltip`, `popover`,
182
+ * `menu` and `select` are all built.
183
+ */
184
+ [data-ui='date-picker'][data-part='positioner'] {
185
+ /* Only the block inset: the positioner writes `left` and never `right`,
186
+ and `inset-inline-start` would resolve to `right` in a right-to-left
187
+ document and win over the measured value. */
188
+ position: absolute;
189
+ inset-block-start: 0;
190
+
191
+ box-sizing: border-box;
192
+ isolation: isolate;
193
+ /* The layer is only a frame around the surface; the surface takes the
194
+ pointer, and the frame must not swallow a press meant for the page. */
195
+ pointer-events: none;
196
+ z-index: calc(var(--slotted-z-index-popover, 1100) + var(--slotted-layer-depth, 0));
197
+
198
+ /* The layer arrives along the axis it opens on and never along the inline
199
+ one, which is the rule `select` records: a scale from the corner the
200
+ positioner named as origin moved the far edge and read as an entrance
201
+ from the side. */
202
+ --_enter-distance: var(--slotted-space-2, 0.25rem);
203
+ opacity: 0;
204
+ translate: 0 calc(-1 * var(--_enter-distance));
205
+ transition:
206
+ opacity var(--slotted-duration-short) var(--slotted-easing-exit),
207
+ translate var(--slotted-duration-short) var(--slotted-easing-exit);
208
+ }
209
+
210
+ [data-ui='date-picker'][data-part='positioner'][data-side='top'] {
211
+ translate: 0 var(--_enter-distance);
212
+ }
213
+
214
+ /* A lateral side has no block direction to arrive from, so it only fades. */
215
+ [data-ui='date-picker'][data-part='positioner']:is([data-side='left'], [data-side='right']) {
216
+ translate: 0 0;
217
+ }
218
+
219
+ [data-ui='date-picker'][data-part='positioner'][data-open] {
220
+ opacity: 1;
221
+ translate: 0 0;
222
+ transition: none;
223
+ }
224
+
225
+ /**
226
+ * The entrance is a keyframe animation and not a transition, for the reason
227
+ * `select` records: a transition starts from the style the browser computed
228
+ * last, and the positioner writes `data-side` in the same style update as
229
+ * the family opens the layer.
230
+ *
231
+ * Only a layer the positioner placed arrives. A layer written open in static
232
+ * markup — the harness, a docs snippet — is simply there, and is
233
+ * photographed where it stands.
234
+ */
235
+ [data-ui='date-picker'][data-part='positioner'][data-open][data-positioned] {
236
+ animation: slotted-date-picker-enter-down var(--slotted-duration-medium)
237
+ var(--slotted-easing-enter);
238
+ }
239
+
240
+ [data-ui='date-picker'][data-part='positioner'][data-open][data-positioned][data-side='top'] {
241
+ animation-name: slotted-date-picker-enter-up;
242
+ }
243
+
244
+ [data-ui='date-picker'][data-part='positioner'][data-open][data-positioned]:is(
245
+ [data-side='left'],
246
+ [data-side='right']
247
+ ) {
248
+ animation-name: slotted-date-picker-fade;
249
+ }
250
+
251
+ @keyframes slotted-date-picker-enter-down {
252
+ from {
253
+ opacity: 0;
254
+ translate: 0 calc(-1 * var(--_enter-distance));
255
+ }
256
+ }
257
+
258
+ @keyframes slotted-date-picker-enter-up {
259
+ from {
260
+ opacity: 0;
261
+ translate: 0 var(--_enter-distance);
262
+ }
263
+ }
264
+
265
+ @keyframes slotted-date-picker-fade {
266
+ from {
267
+ opacity: 0;
268
+ }
269
+ }
270
+
271
+ /* Stillness keeps the fade and drops the movement. */
272
+ @media (prefers-reduced-motion: reduce) {
273
+ [data-ui='date-picker'][data-part='positioner'],
274
+ [data-ui='date-picker'][data-part='positioner'][data-side='top'],
275
+ [data-ui='date-picker'][data-part='positioner'][data-side='left'],
276
+ [data-ui='date-picker'][data-part='positioner'][data-side='right'] {
277
+ translate: 0 0;
278
+ transition: opacity var(--slotted-duration-short) var(--slotted-easing-exit);
279
+ }
280
+
281
+ [data-ui='date-picker'][data-part='positioner'][data-open][data-positioned],
282
+ [data-ui='date-picker'][data-part='positioner'][data-open][data-positioned][data-side='top'],
283
+ [data-ui='date-picker'][data-part='positioner'][data-open][data-positioned][data-side='left'],
284
+ [data-ui='date-picker'][data-part='positioner'][data-open][data-positioned][data-side='right'] {
285
+ animation-name: slotted-date-picker-fade;
286
+ }
287
+ }
288
+
289
+ /* The anchor scrolled out of its own clipper. The calendar is still open and
290
+ still belongs to a control the reader can no longer see. */
291
+ [data-ui='date-picker'][data-part='positioner'][data-detached] {
292
+ visibility: hidden;
293
+ }
294
+
295
+ /**
296
+ * The surface. It is sized by the calendar inside it rather than by the
297
+ * control it hangs from: a month is seven columns wide and a field is as
298
+ * wide as the form, and forcing one to the other would either crush the grid
299
+ * or stretch it.
300
+ */
301
+ [data-ui='date-picker'] [data-part='content'] {
302
+ background-color: var(--slotted-date-picker-surface, var(--slotted-surface-raised, Canvas));
303
+ border: var(--slotted-border-width-thin, 1px) solid
304
+ var(--slotted-date-picker-content-border-color, var(--slotted-border-subtle, ButtonBorder));
305
+ border-radius: var(--slotted-date-picker-content-radius, var(--slotted-radius-lg, 8px));
306
+ box-shadow: var(--slotted-date-picker-content-shadow, var(--slotted-shadow-md));
307
+ box-sizing: border-box;
308
+ color: var(--slotted-date-picker-content-color, var(--slotted-text, CanvasText));
309
+ /**
310
+ * A grid of `auto` tracks rather than a wrapping flex row.
311
+ *
312
+ * The footer has to run the whole width, and as a flex item that means
313
+ * `flex-basis: 100%` — a percentage against a container whose own width is
314
+ * being shrink-wrapped from its contents. The browser resolves the circle
315
+ * by making the surface wider than anything in it: the first capture of
316
+ * this family showed 195 pixels of empty ground to the right of the grid.
317
+ * `auto` tracks have no such circle, and `grid-area` says which cell each
318
+ * part is in without a second element to carry the row.
319
+ */
320
+ display: grid;
321
+ gap: var(--slotted-space-5, 0.75rem);
322
+ grid-template-areas: 'calendar' 'footer';
323
+ grid-template-columns: auto;
324
+ padding: var(--slotted-date-picker-content-padding, var(--slotted-space-5, 0.75rem));
325
+ /* The layer above gave up the pointer; the surface takes it back. */
326
+ pointer-events: auto;
327
+ }
328
+
329
+ /* The shortcuts take a column of their own only when there are any. */
330
+ [data-ui='date-picker'] [data-part='content']:has([data-part='presets']) {
331
+ grid-template-areas: 'presets calendar' 'footer footer';
332
+ grid-template-columns: auto auto;
333
+ }
334
+
335
+ [data-ui='date-picker'] [data-part='content'] > [data-ui='calendar'] {
336
+ grid-area: calendar;
337
+ }
338
+
339
+ /**
340
+ * The consumer's own shortcuts. This family ships no list of them: "last 7
341
+ * days" is a business calendar and a library that guessed at one would be
342
+ * guessing at a fiscal year. What it ships is the column they stand in.
343
+ */
344
+ [data-ui='date-picker'] [data-part='presets'] {
345
+ /* A list of shortcuts reads from the start edge. Stretched, each button
346
+ centred its own label and the four labels formed a ragged column with
347
+ no left edge to run down. */
348
+ align-items: flex-start;
349
+ border-inline-end: var(--slotted-border-width-thin, 1px) solid
350
+ var(--slotted-date-picker-content-border-color, var(--slotted-border-subtle, ButtonBorder));
351
+ display: flex;
352
+ flex-direction: column;
353
+ gap: var(--slotted-space-2, 0.25rem);
354
+ grid-area: presets;
355
+ padding-inline-end: var(--slotted-space-5, 0.75rem);
356
+ }
357
+
358
+ [data-ui='date-picker'] [data-part='footer'] {
359
+ align-items: center;
360
+ border-block-start: var(--slotted-border-width-thin, 1px) solid
361
+ var(--slotted-date-picker-content-border-color, var(--slotted-border-subtle, ButtonBorder));
362
+ display: flex;
363
+ gap: var(--slotted-space-2, 0.25rem);
364
+ /* The whole width under whatever the surface is holding, so the actions
365
+ sit under the calendar rather than beside it. */
366
+ grid-area: footer;
367
+ justify-content: flex-end;
368
+ padding-block-start: var(--slotted-space-4, 0.5rem);
369
+ }
370
+
371
+ /* ── Narrow, on a finger ──────────────────────────────────────────────
372
+ *
373
+ * §2.7 of `docs/component-features.md` asks for it by name: a popover on the
374
+ * desktop and a sheet in a narrow viewport. The DOM does not change, so the
375
+ * decision is testable without a device — and the query is on the viewport
376
+ * rather than on a container because a layer in a portal has no container to
377
+ * ask, and the question really is how much screen there is.
378
+ */
379
+ @media (max-width: 480px) and (pointer: coarse) {
380
+ [data-ui='date-picker'][data-part='positioner'][data-presentation='sheet'] {
381
+ /* The positioner's own measurement is overridden here on purpose: a
382
+ sheet is not placed against an anchor, it is placed against the
383
+ screen. */
384
+ inset: auto 0 0;
385
+ position: fixed;
386
+ /* Nothing arrives sideways, and the sheet rises from the edge it is
387
+ attached to. */
388
+ translate: 0 var(--slotted-space-9, 2rem);
389
+ }
390
+
391
+ [data-ui='date-picker'][data-part='positioner'][data-presentation='sheet'][data-open] {
392
+ translate: 0 0;
393
+ }
394
+
395
+ [data-ui='date-picker'][data-part='positioner'][data-presentation='sheet']
396
+ [data-part='content'] {
397
+ border-end-end-radius: 0;
398
+ border-end-start-radius: 0;
399
+ border-inline: 0;
400
+ border-block-end: 0;
401
+ inline-size: 100%;
402
+ /* A calendar wider than the screen would scroll sideways; the grid
403
+ inside answers its own width and drops to one month instead. */
404
+ justify-content: center;
405
+ }
406
+
407
+ [data-ui='date-picker'][data-part='positioner'][data-presentation='sheet']
408
+ [data-part='presets'] {
409
+ /* Beside the grid there is no room for a column of shortcuts, so they
410
+ become a row above it and keep their labels. */
411
+ border-inline-end: 0;
412
+ border-block-end: var(--slotted-border-width-thin, 1px) solid
413
+ var(--slotted-date-picker-content-border-color, var(--slotted-border-subtle, ButtonBorder));
414
+ flex-direction: row;
415
+ flex-wrap: wrap;
416
+ padding-block-end: var(--slotted-space-4, 0.5rem);
417
+ padding-inline-end: 0;
418
+ }
419
+ }
420
+ }
@@ -0,0 +1,49 @@
1
+ [
2
+ "--slotted-border-subtle",
3
+ "--slotted-border-width-thin",
4
+ "--slotted-control-border-width",
5
+ "--slotted-control-height-lg",
6
+ "--slotted-control-height-md",
7
+ "--slotted-control-height-sm",
8
+ "--slotted-control-icon-size-lg",
9
+ "--slotted-control-icon-size-md",
10
+ "--slotted-control-icon-size-sm",
11
+ "--slotted-control-radius",
12
+ "--slotted-control-transition-duration",
13
+ "--slotted-control-transition-easing",
14
+ "--slotted-date-picker-content-border-color",
15
+ "--slotted-date-picker-content-color",
16
+ "--slotted-date-picker-content-padding",
17
+ "--slotted-date-picker-content-radius",
18
+ "--slotted-date-picker-content-shadow",
19
+ "--slotted-date-picker-invalid-focus-ring-color",
20
+ "--slotted-date-picker-radius",
21
+ "--slotted-date-picker-surface",
22
+ "--slotted-date-picker-trigger-active-background",
23
+ "--slotted-date-picker-trigger-color",
24
+ "--slotted-date-picker-trigger-hover-background",
25
+ "--slotted-date-picker-trigger-size",
26
+ "--slotted-disabled-foreground",
27
+ "--slotted-duration-medium",
28
+ "--slotted-duration-short",
29
+ "--slotted-easing-enter",
30
+ "--slotted-easing-exit",
31
+ "--slotted-focus-ring-color",
32
+ "--slotted-focus-ring-color-invalid",
33
+ "--slotted-focus-ring-offset",
34
+ "--slotted-focus-ring-width",
35
+ "--slotted-radius-lg",
36
+ "--slotted-shadow-md",
37
+ "--slotted-space-2",
38
+ "--slotted-space-4",
39
+ "--slotted-space-5",
40
+ "--slotted-space-9",
41
+ "--slotted-surface-raised",
42
+ "--slotted-target-comfortable",
43
+ "--slotted-target-min",
44
+ "--slotted-text",
45
+ "--slotted-text-muted",
46
+ "--slotted-tone-secondary-subtle-active",
47
+ "--slotted-tone-secondary-subtle-hover",
48
+ "--slotted-z-index-popover"
49
+ ]