@matekit/react 0.0.0-stage → 0.1.1

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 (268) hide show
  1. package/CHANGELOG.md +102 -0
  2. package/LICENSE +202 -0
  3. package/NOTICE +56 -0
  4. package/README.md +115 -2
  5. package/dist/atoms/Divider/Divider.d.ts +49 -0
  6. package/dist/atoms/Divider/Divider.js +29 -0
  7. package/dist/atoms/FocusRing/FocusRing.d.ts +16 -0
  8. package/dist/atoms/FocusRing/FocusRing.js +16 -0
  9. package/dist/atoms/Group/Group.d.ts +38 -0
  10. package/dist/atoms/Group/Group.js +34 -0
  11. package/dist/atoms/Icon/Icon.d.ts +23 -0
  12. package/dist/atoms/Icon/Icon.js +19 -0
  13. package/dist/atoms/Interactive/Interactive.d.ts +98 -0
  14. package/dist/atoms/Interactive/Interactive.js +87 -0
  15. package/dist/atoms/Ripple/Ripple.d.ts +14 -0
  16. package/dist/atoms/Ripple/Ripple.js +63 -0
  17. package/dist/atoms/Shape/Shape.d.ts +24 -0
  18. package/dist/atoms/Shape/Shape.js +19 -0
  19. package/dist/atoms/Shape/shapes.d.ts +8 -0
  20. package/dist/atoms/Shape/shapes.js +40 -0
  21. package/dist/atoms/Stack/Stack.d.ts +58 -0
  22. package/dist/atoms/Stack/Stack.js +33 -0
  23. package/dist/atoms/StateLayer/StateLayer.d.ts +17 -0
  24. package/dist/atoms/StateLayer/StateLayer.js +17 -0
  25. package/dist/atoms/index.d.ts +10 -0
  26. package/dist/atoms/index.js +10 -0
  27. package/dist/fonts/roboto-flex/OFL.txt +93 -0
  28. package/dist/fonts/roboto-flex/roboto-flex-cyrillic-ext.woff2 +0 -0
  29. package/dist/fonts/roboto-flex/roboto-flex-cyrillic.woff2 +0 -0
  30. package/dist/fonts/roboto-flex/roboto-flex-greek.woff2 +0 -0
  31. package/dist/fonts/roboto-flex/roboto-flex-latin-ext.woff2 +0 -0
  32. package/dist/fonts/roboto-flex/roboto-flex-latin.woff2 +0 -0
  33. package/dist/fonts/roboto-flex/roboto-flex-vietnamese.woff2 +0 -0
  34. package/dist/icons/icons.d.ts +89 -0
  35. package/dist/icons/icons.js +186 -0
  36. package/dist/icons/index.d.ts +1 -0
  37. package/dist/icons/index.js +3 -0
  38. package/dist/index.d.ts +8 -0
  39. package/dist/index.js +12 -0
  40. package/dist/internal/accessible-name.d.ts +17 -0
  41. package/dist/internal/accessible-name.js +33 -0
  42. package/dist/internal/anchor-position.d.ts +99 -0
  43. package/dist/internal/anchor-position.js +159 -0
  44. package/dist/internal/anchored-drag.d.ts +25 -0
  45. package/dist/internal/anchored-drag.js +106 -0
  46. package/dist/internal/dev.d.ts +2 -0
  47. package/dist/internal/dev.js +18 -0
  48. package/dist/internal/diagnostics.d.ts +46 -0
  49. package/dist/internal/diagnostics.js +125 -0
  50. package/dist/internal/group-label.d.ts +22 -0
  51. package/dist/internal/group-label.js +50 -0
  52. package/dist/internal/interactive.d.ts +28 -0
  53. package/dist/internal/interactive.js +18 -0
  54. package/dist/internal/layout-element.d.ts +21 -0
  55. package/dist/internal/layout-element.js +33 -0
  56. package/dist/internal/merge-refs.d.ts +13 -0
  57. package/dist/internal/merge-refs.js +35 -0
  58. package/dist/internal/modal-dialog.d.ts +63 -0
  59. package/dist/internal/modal-dialog.js +267 -0
  60. package/dist/internal/navigation-count.d.ts +38 -0
  61. package/dist/internal/navigation-count.js +60 -0
  62. package/dist/internal/navigation-item.d.ts +14 -0
  63. package/dist/internal/navigation-item.js +17 -0
  64. package/dist/internal/nearest-scroller.d.ts +4 -0
  65. package/dist/internal/nearest-scroller.js +17 -0
  66. package/dist/internal/open-state.d.ts +15 -0
  67. package/dist/internal/open-state.js +42 -0
  68. package/dist/internal/roving-focus.d.ts +41 -0
  69. package/dist/internal/roving-focus.js +126 -0
  70. package/dist/internal/settle-animations.d.ts +33 -0
  71. package/dist/internal/settle-animations.js +48 -0
  72. package/dist/internal/time-period.d.ts +10 -0
  73. package/dist/internal/time-period.js +26 -0
  74. package/dist/internal/time.d.ts +23 -0
  75. package/dist/internal/time.js +69 -0
  76. package/dist/internal/typeahead.d.ts +17 -0
  77. package/dist/internal/typeahead.js +35 -0
  78. package/dist/molecules/Badge/Badge.d.ts +25 -0
  79. package/dist/molecules/Badge/Badge.js +16 -0
  80. package/dist/molecules/Button/Button.d.ts +48 -0
  81. package/dist/molecules/Button/Button.js +34 -0
  82. package/dist/molecules/Card/Card.d.ts +159 -0
  83. package/dist/molecules/Card/Card.js +119 -0
  84. package/dist/molecules/Checkbox/Checkbox.d.ts +26 -0
  85. package/dist/molecules/Checkbox/Checkbox.js +40 -0
  86. package/dist/molecules/Chip/AssistChip.d.ts +23 -0
  87. package/dist/molecules/Chip/AssistChip.js +22 -0
  88. package/dist/molecules/Chip/ChipGroup.d.ts +85 -0
  89. package/dist/molecules/Chip/ChipGroup.js +92 -0
  90. package/dist/molecules/Chip/FilterChip.d.ts +33 -0
  91. package/dist/molecules/Chip/FilterChip.js +30 -0
  92. package/dist/molecules/Chip/InputChip.d.ts +60 -0
  93. package/dist/molecules/Chip/InputChip.js +107 -0
  94. package/dist/molecules/Chip/SuggestionChip.d.ts +24 -0
  95. package/dist/molecules/Chip/SuggestionChip.js +17 -0
  96. package/dist/molecules/Chip/chip-content.d.ts +39 -0
  97. package/dist/molecules/Chip/chip-content.js +95 -0
  98. package/dist/molecules/Chip/chip-element.d.ts +14 -0
  99. package/dist/molecules/Chip/chip-element.js +14 -0
  100. package/dist/molecules/Chip/strings.d.ts +8 -0
  101. package/dist/molecules/Chip/strings.js +5 -0
  102. package/dist/molecules/Fab/Fab.d.ts +78 -0
  103. package/dist/molecules/Fab/Fab.js +52 -0
  104. package/dist/molecules/IconButton/IconButton.d.ts +59 -0
  105. package/dist/molecules/IconButton/IconButton.js +36 -0
  106. package/dist/molecules/LoadingIndicator/LoadingIndicator.d.ts +38 -0
  107. package/dist/molecules/LoadingIndicator/LoadingIndicator.js +25 -0
  108. package/dist/molecules/LoadingIndicator/determinate.d.ts +3 -0
  109. package/dist/molecules/LoadingIndicator/determinate.js +47 -0
  110. package/dist/molecules/LoadingIndicator/loading-indicator-data.d.ts +21 -0
  111. package/dist/molecules/LoadingIndicator/loading-indicator-data.js +72 -0
  112. package/dist/molecules/ProgressIndicator/CircularProgressIndicator.d.ts +35 -0
  113. package/dist/molecules/ProgressIndicator/CircularProgressIndicator.js +30 -0
  114. package/dist/molecules/ProgressIndicator/LinearProgressIndicator.d.ts +43 -0
  115. package/dist/molecules/ProgressIndicator/LinearProgressIndicator.js +28 -0
  116. package/dist/molecules/ProgressIndicator/circular-wavy-data.d.ts +5 -0
  117. package/dist/molecules/ProgressIndicator/circular-wavy-data.js +19 -0
  118. package/dist/molecules/ProgressIndicator/progress.d.ts +24 -0
  119. package/dist/molecules/ProgressIndicator/progress.js +60 -0
  120. package/dist/molecules/RadioButton/RadioButton.d.ts +27 -0
  121. package/dist/molecules/RadioButton/RadioButton.js +70 -0
  122. package/dist/molecules/RadioButton/RadioGroup.d.ts +73 -0
  123. package/dist/molecules/RadioButton/RadioGroup.js +82 -0
  124. package/dist/molecules/ScrollField/ScrollField.d.ts +61 -0
  125. package/dist/molecules/ScrollField/ScrollField.js +352 -0
  126. package/dist/molecules/Slider/RangeSlider.d.ts +60 -0
  127. package/dist/molecules/Slider/RangeSlider.js +169 -0
  128. package/dist/molecules/Slider/Slider.d.ts +54 -0
  129. package/dist/molecules/Slider/Slider.js +71 -0
  130. package/dist/molecules/Slider/slider-shared.d.ts +26 -0
  131. package/dist/molecules/Slider/slider-shared.js +98 -0
  132. package/dist/molecules/Switch/Switch.d.ts +22 -0
  133. package/dist/molecules/Switch/Switch.js +20 -0
  134. package/dist/molecules/TextField/TextField.d.ts +83 -0
  135. package/dist/molecules/TextField/TextField.js +146 -0
  136. package/dist/molecules/TextField/TextFieldSlots.d.ts +22 -0
  137. package/dist/molecules/TextField/TextFieldSlots.js +24 -0
  138. package/dist/molecules/TimeInput/TimeInput.d.ts +108 -0
  139. package/dist/molecules/TimeInput/TimeInput.js +347 -0
  140. package/dist/molecules/TimeInput/strings.d.ts +13 -0
  141. package/dist/molecules/TimeInput/strings.js +10 -0
  142. package/dist/molecules/TimeScroll/TimeScroll.d.ts +106 -0
  143. package/dist/molecules/TimeScroll/TimeScroll.js +213 -0
  144. package/dist/molecules/TimeScroll/strings.d.ts +13 -0
  145. package/dist/molecules/TimeScroll/strings.js +12 -0
  146. package/dist/molecules/index.d.ts +27 -0
  147. package/dist/molecules/index.js +25 -0
  148. package/dist/organisms/BottomSheet/BottomSheet.d.ts +128 -0
  149. package/dist/organisms/BottomSheet/BottomSheet.js +432 -0
  150. package/dist/organisms/BottomSheet/BottomSheetSlots.d.ts +17 -0
  151. package/dist/organisms/BottomSheet/BottomSheetSlots.js +16 -0
  152. package/dist/organisms/BottomSheet/StandardBottomSheet.d.ts +37 -0
  153. package/dist/organisms/BottomSheet/StandardBottomSheet.js +206 -0
  154. package/dist/organisms/BottomSheet/bottom-sheet-context.d.ts +31 -0
  155. package/dist/organisms/BottomSheet/bottom-sheet-context.js +12 -0
  156. package/dist/organisms/BottomSheet/sheet-drag.d.ts +1 -0
  157. package/dist/organisms/BottomSheet/sheet-drag.js +4 -0
  158. package/dist/organisms/BottomSheet/strings.d.ts +9 -0
  159. package/dist/organisms/BottomSheet/strings.js +8 -0
  160. package/dist/organisms/ButtonGroup/ButtonGroup.d.ts +97 -0
  161. package/dist/organisms/ButtonGroup/ButtonGroup.js +242 -0
  162. package/dist/organisms/ButtonGroup/ButtonGroupItem.d.ts +36 -0
  163. package/dist/organisms/ButtonGroup/ButtonGroupItem.js +47 -0
  164. package/dist/organisms/Dialog/Dialog.d.ts +186 -0
  165. package/dist/organisms/Dialog/Dialog.js +193 -0
  166. package/dist/organisms/Dialog/DialogSlots.d.ts +60 -0
  167. package/dist/organisms/Dialog/DialogSlots.js +54 -0
  168. package/dist/organisms/Dialog/strings.d.ts +5 -0
  169. package/dist/organisms/Dialog/strings.js +5 -0
  170. package/dist/organisms/FabMenu/FabMenu.d.ts +104 -0
  171. package/dist/organisms/FabMenu/FabMenu.js +142 -0
  172. package/dist/organisms/FabMenu/strings.d.ts +9 -0
  173. package/dist/organisms/FabMenu/strings.js +5 -0
  174. package/dist/organisms/List/List.d.ts +190 -0
  175. package/dist/organisms/List/List.js +148 -0
  176. package/dist/organisms/Menu/Menu.d.ts +313 -0
  177. package/dist/organisms/Menu/Menu.js +865 -0
  178. package/dist/organisms/Menu/MenuSlots.d.ts +35 -0
  179. package/dist/organisms/Menu/MenuSlots.js +36 -0
  180. package/dist/organisms/NavigationBar/NavigationBar.d.ts +96 -0
  181. package/dist/organisms/NavigationBar/NavigationBar.js +77 -0
  182. package/dist/organisms/NavigationRail/ModalNavigationRail.d.ts +105 -0
  183. package/dist/organisms/NavigationRail/ModalNavigationRail.js +272 -0
  184. package/dist/organisms/NavigationRail/NavigationRail.d.ts +148 -0
  185. package/dist/organisms/NavigationRail/NavigationRail.js +114 -0
  186. package/dist/organisms/NavigationRail/NavigationRailSection.d.ts +54 -0
  187. package/dist/organisms/NavigationRail/NavigationRailSection.js +96 -0
  188. package/dist/organisms/NavigationRail/strings.d.ts +7 -0
  189. package/dist/organisms/NavigationRail/strings.js +7 -0
  190. package/dist/organisms/NavigationSuite/NavigationSuite.d.ts +109 -0
  191. package/dist/organisms/NavigationSuite/NavigationSuite.js +86 -0
  192. package/dist/organisms/PaneScaffold/PaneScaffold.d.ts +118 -0
  193. package/dist/organisms/PaneScaffold/PaneScaffold.js +132 -0
  194. package/dist/organisms/Search/Search.d.ts +213 -0
  195. package/dist/organisms/Search/Search.js +783 -0
  196. package/dist/organisms/Search/SearchSlots.d.ts +18 -0
  197. package/dist/organisms/Search/SearchSlots.js +19 -0
  198. package/dist/organisms/Search/strings.d.ts +21 -0
  199. package/dist/organisms/Search/strings.js +12 -0
  200. package/dist/organisms/Select/Select.d.ts +186 -0
  201. package/dist/organisms/Select/Select.js +597 -0
  202. package/dist/organisms/Select/SelectSlots.d.ts +12 -0
  203. package/dist/organisms/Select/SelectSlots.js +12 -0
  204. package/dist/organisms/SideSheet/SideSheet.d.ts +88 -0
  205. package/dist/organisms/SideSheet/SideSheet.js +109 -0
  206. package/dist/organisms/SideSheet/SideSheetSlots.d.ts +35 -0
  207. package/dist/organisms/SideSheet/SideSheetSlots.js +37 -0
  208. package/dist/organisms/SideSheet/strings.d.ts +7 -0
  209. package/dist/organisms/SideSheet/strings.js +6 -0
  210. package/dist/organisms/Snackbar/Snackbar.d.ts +46 -0
  211. package/dist/organisms/Snackbar/Snackbar.js +36 -0
  212. package/dist/organisms/Snackbar/SnackbarHost.d.ts +57 -0
  213. package/dist/organisms/Snackbar/SnackbarHost.js +221 -0
  214. package/dist/organisms/Snackbar/snackbar-queue.d.ts +81 -0
  215. package/dist/organisms/Snackbar/snackbar-queue.js +114 -0
  216. package/dist/organisms/Snackbar/strings.d.ts +8 -0
  217. package/dist/organisms/Snackbar/strings.js +5 -0
  218. package/dist/organisms/SplitButton/SplitButton.d.ts +73 -0
  219. package/dist/organisms/SplitButton/SplitButton.js +77 -0
  220. package/dist/organisms/SplitButton/strings.d.ts +9 -0
  221. package/dist/organisms/SplitButton/strings.js +5 -0
  222. package/dist/organisms/Tabs/TabLink.d.ts +27 -0
  223. package/dist/organisms/Tabs/TabLink.js +25 -0
  224. package/dist/organisms/Tabs/TabNav.d.ts +19 -0
  225. package/dist/organisms/Tabs/TabNav.js +55 -0
  226. package/dist/organisms/Tabs/Tabs.d.ts +147 -0
  227. package/dist/organisms/Tabs/Tabs.js +223 -0
  228. package/dist/organisms/Tabs/tab-content.d.ts +23 -0
  229. package/dist/organisms/Tabs/tab-content.js +105 -0
  230. package/dist/organisms/Tabs/tab-fit.d.ts +4 -0
  231. package/dist/organisms/Tabs/tab-fit.js +65 -0
  232. package/dist/organisms/Tabs/tab-motion.d.ts +2 -0
  233. package/dist/organisms/Tabs/tab-motion.js +68 -0
  234. package/dist/organisms/TimePickerDialog/TimePickerDialog.d.ts +26 -0
  235. package/dist/organisms/TimePickerDialog/TimePickerDialog.js +34 -0
  236. package/dist/organisms/Toolbar/Toolbar.d.ts +75 -0
  237. package/dist/organisms/Toolbar/Toolbar.js +84 -0
  238. package/dist/organisms/Toolbar/ToolbarLayout.d.ts +44 -0
  239. package/dist/organisms/Toolbar/ToolbarLayout.js +90 -0
  240. package/dist/organisms/Toolbar/ToolbarScroll.d.ts +8 -0
  241. package/dist/organisms/Toolbar/ToolbarScroll.js +222 -0
  242. package/dist/organisms/Tooltip/RichTooltip.d.ts +73 -0
  243. package/dist/organisms/Tooltip/RichTooltip.js +250 -0
  244. package/dist/organisms/Tooltip/Tooltip.d.ts +52 -0
  245. package/dist/organisms/Tooltip/Tooltip.js +99 -0
  246. package/dist/organisms/Tooltip/tooltip-behavior.d.ts +43 -0
  247. package/dist/organisms/Tooltip/tooltip-behavior.js +307 -0
  248. package/dist/organisms/TopAppBar/TopAppBar.d.ts +107 -0
  249. package/dist/organisms/TopAppBar/TopAppBar.js +78 -0
  250. package/dist/organisms/TopAppBar/TopAppBarScroll.d.ts +7 -0
  251. package/dist/organisms/TopAppBar/TopAppBarScroll.js +155 -0
  252. package/dist/organisms/index.d.ts +36 -0
  253. package/dist/organisms/index.js +36 -0
  254. package/dist/palettes/blue.css +275 -0
  255. package/dist/palettes/green.css +275 -0
  256. package/dist/palettes/index.css +823 -0
  257. package/dist/palettes/orange.css +275 -0
  258. package/dist/shapes.css +115 -0
  259. package/dist/strings/index.d.ts +35 -0
  260. package/dist/strings/index.js +39 -0
  261. package/dist/styles-no-fonts.css +12025 -0
  262. package/dist/styles.css +12123 -0
  263. package/dist/stylesheet.d.ts +2 -0
  264. package/dist/tokens/breakpoints.d.ts +33 -0
  265. package/dist/tokens/breakpoints.js +31 -0
  266. package/dist/tokens/space.d.ts +26 -0
  267. package/dist/tokens/space.js +26 -0
  268. package/package.json +110 -3
@@ -0,0 +1,13 @@
1
+ export interface TimeInputStrings {
2
+ /** `TimeInput` `hourLabel`: the label below the hour field, which names it. */
3
+ hourLabel: string;
4
+ /** `TimeInput` `minuteLabel`: the label below the minute field, which names it. */
5
+ minuteLabel: string;
6
+ /** `TimeInput` `periodLabel`: the name of the AM/PM selector (12-hour clock). */
7
+ periodLabel: string;
8
+ /** `TimeInput` `amLabel`: the morning option, when the locale gives no name of its own. */
9
+ amLabel: string;
10
+ /** `TimeInput` `pmLabel`: the afternoon option, when the locale gives no name of its own. */
11
+ pmLabel: string;
12
+ }
13
+ export declare const timeInputStrings: TimeInputStrings;
@@ -0,0 +1,10 @@
1
+ // Textos por defecto de TimeInput (en inglés: son salida para quien usa la librería). El índice
2
+ // src/strings/index.ts los reúne con los demás. Los de Compose: m3c_time_picker_hour, _minute, _am,
3
+ // _pm y _period_toggle_description (material3/src/androidMain/res/values/strings.xml).
4
+ export const timeInputStrings = {
5
+ hourLabel: 'Hour',
6
+ minuteLabel: 'Minute',
7
+ periodLabel: 'AM or PM',
8
+ amLabel: 'AM',
9
+ pmLabel: 'PM',
10
+ };
@@ -0,0 +1,106 @@
1
+ import { type FormEvent, type HTMLAttributes, type KeyboardEvent, type MouseEvent, type ReactNode, type Ref } from 'react';
2
+ import { type TimeHourCycle } from '../../internal/time.ts';
3
+ import { type ScrollFieldChangeEvent } from '../ScrollField/ScrollField.tsx';
4
+ /** The event that changed the value: the end of a scroll, a key or a click on a wheel, or a key or click on the period. */
5
+ export type TimeScrollChangeEvent = ScrollFieldChangeEvent | KeyboardEvent<HTMLElement> | MouseEvent<HTMLElement>;
6
+ export interface TimeScrollProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color' | 'defaultValue' | 'onChange' | 'onInvalid' | 'role'> {
7
+ /**
8
+ * The time, controlled: `"HH:mm"` on the 24-hour clock (`"07:05"`, `"19:30"`), the same text as the
9
+ * value of `<input type="time">`, or `''` for no time (the wheels rest on their first number, not
10
+ * highlighted). Any other text counts as `''` and warns in development (`MK_TIME_VALUE_INVALID`).
11
+ */
12
+ value?: string | undefined;
13
+ /** The initial time when uncontrolled, and the one `form.reset()` restores. Defaults to `''`. */
14
+ defaultValue?: string | undefined;
15
+ /**
16
+ * The time changed: the new value (`"HH:mm"`) and the event (`TimeScrollChangeEvent`). Called when a
17
+ * wheel stops on a new number (not while it moves), on a key or a click; not called by
18
+ * `form.reset()`. Without a time, moving either wheel gives a full time with what the other shows.
19
+ */
20
+ onValueChange?: ((value: string, event: TimeScrollChangeEvent) => void) | undefined;
21
+ /**
22
+ * The clock: `12` (hours 1–12 and an AM/PM selector) or `24` (hours 0–23). Without it, the clock of
23
+ * `locale`, or of the browser's language once the page has hydrated (server HTML uses `24`): pass it
24
+ * on server-rendered pages so the first paint already has the right clock.
25
+ */
26
+ hourCycle?: TimeHourCycle | undefined;
27
+ /**
28
+ * BCP 47 language tag (`"en-US"`, `"es-AR"`) for the default clock and the AM/PM names (`Intl`).
29
+ * Without it, the browser's language once the page has hydrated. Digits are always `0`–`9`.
30
+ */
31
+ locale?: string | undefined;
32
+ /** Error state: error colors and `aria-invalid` on both wheels. Put the message in `TimeScrollSupporting`. */
33
+ error?: boolean | undefined;
34
+ /** Disabled: the wheels do not scroll or take focus; not submitted and not validated. */
35
+ disabled?: boolean | undefined;
36
+ /** A time is required to submit the form (native validation, `aria-required` on both wheels). */
37
+ required?: boolean | undefined;
38
+ /** The name the value (`"HH:mm"`) is submitted under. */
39
+ name?: string | undefined;
40
+ /** The `id` of the `<form>` the value belongs to, when the time scroll is outside it. */
41
+ form?: string | undefined;
42
+ /** The hidden native `<input>` failed validation (the form was submitted without a time). */
43
+ onInvalid?: ((event: FormEvent<HTMLInputElement>) => void) | undefined;
44
+ /**
45
+ * Ref to the hidden native `<input>` that takes part in the form (its value is the `"HH:mm"` text), for its validity API
46
+ * (`setCustomValidity`, `validity`, `reportValidity`).
47
+ */
48
+ inputRef?: Ref<HTMLInputElement> | undefined;
49
+ /** Ref to the hour wheel (the first `role="spinbutton"`), for example to focus it. */
50
+ hourRef?: Ref<HTMLDivElement> | undefined;
51
+ /** Accessible name of the hour wheel. Defaults to `"Hour"`. */
52
+ hourLabel?: string | undefined;
53
+ /** Accessible name of the minute wheel. Defaults to `"Minute"`. */
54
+ minuteLabel?: string | undefined;
55
+ /** Name of the AM/PM selector. Defaults to `"AM or PM"`. */
56
+ periodLabel?: string | undefined;
57
+ /** The morning option. Defaults to the locale's name (`Intl`), or `"AM"` until the locale is known. */
58
+ amLabel?: string | undefined;
59
+ /** The afternoon option. Defaults to the locale's name (`Intl`), or `"PM"` until the locale is known. */
60
+ pmLabel?: string | undefined;
61
+ /** Ref to the container (`role="group"`). */
62
+ ref?: Ref<HTMLDivElement> | undefined;
63
+ /** The optional parts: `TimeScrollLabel` and `TimeScrollSupporting`. */
64
+ children?: ReactNode;
65
+ }
66
+ /**
67
+ * Material 3 Expressive time scroll: the time picker's wheel mode (Compose `TimeScroll`), with an hour
68
+ * wheel and a minute wheel (`ScrollField`) and, on the 12-hour clock, an AM/PM selector. It takes the
69
+ * same value and props as `TimeInput`, so an app can offer both modes with one state, inline or inside a
70
+ * `TimePickerDialog`. It submits with `name` in a `<form>` as `"HH:mm"`, like `<input type="time">`.
71
+ *
72
+ * ```tsx
73
+ * const [time, setTime] = useState('07:30')
74
+ *
75
+ * <TimeScroll value={time} onValueChange={setTime} hourCycle={12} name="alarm" required>
76
+ * <TimeScrollLabel>Alarm</TimeScrollLabel>
77
+ * </TimeScroll>
78
+ * ```
79
+ *
80
+ * - **Pointer:** scroll a wheel (finger, mouse wheel, trackpad) and the number that stops in the middle
81
+ * is chosen; clicking a number scrolls to it.
82
+ * - **Keyboard:** each wheel is a spin button. Arrow Up and Arrow Down add or take 1 (wrapping), Page Up
83
+ * and Page Down 2 hours or 15 minutes, Home and End go to the first or last value, and digits pick a
84
+ * number. On the 12-hour clock, typing the first letter of AM or PM chooses it; the selector itself is
85
+ * a radio group (arrows switch).
86
+ * - The clock and the AM/PM names follow `hourCycle` and `locale` (see each prop). Digits always read
87
+ * left to right, also in right-to-left pages.
88
+ * - Native props, `className`, `style` and `ref` go to the container (`role="group"`, named by
89
+ * `TimeScrollLabel` or `aria-label`).
90
+ */
91
+ export declare function TimeScroll({ value: controlledValue, defaultValue, onValueChange, hourCycle, locale, error, disabled, required, name, form, onInvalid, inputRef, hourRef, hourLabel, minuteLabel, periodLabel, amLabel, pmLabel, className, children, ref, ...props }: TimeScrollProps): import("react").JSX.Element;
92
+ export interface TimeScrollLabelProps extends HTMLAttributes<HTMLSpanElement> {
93
+ }
94
+ /**
95
+ * Title above the wheels (Label Medium, `on-surface-variant`), like `TimeInputLabel`. It names the group
96
+ * (`aria-labelledby`). Inside a `TimePickerDialog`, the `DialogHeadline` plays this role instead.
97
+ */
98
+ export declare function TimeScrollLabel({ id, className, ...props }: TimeScrollLabelProps): import("react").JSX.Element;
99
+ export interface TimeScrollSupportingProps extends HTMLAttributes<HTMLDivElement> {
100
+ }
101
+ /**
102
+ * Supporting text below the wheels (Body Small). It becomes the description of both wheels
103
+ * (`aria-describedby`). In error it takes the error color: to show the error message, change its
104
+ * content.
105
+ */
106
+ export declare function TimeScrollSupporting({ id, className, ...props }: TimeScrollSupportingProps): import("react").JSX.Element;
@@ -0,0 +1,213 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ // Molécula interactiva (ADR-0003, ADR-0043): la rueda del time picker de Material 3 Expressive
4
+ // (`TimeScroll` de Compose), con una ScrollField para la hora y otra para el minuto y, en 12 horas, el
5
+ // selector de AM/PM de TimeInput. Necesita estado (el valor sin controlar, el período sin hora),
6
+ // efectos (reinicio del formulario, avisos) y contexto (los ids de la etiqueta y la ayuda).
7
+ //
8
+ // - Mismo modelo que TimeInput (ADR-0042, src/internal/time.ts): valor "HH:mm" en 24 horas o '',
9
+ // `hourCycle` y `locale` resueltos después de hidratar, nombres de AM/PM de Intl, el mismo `<input>`
10
+ // de texto oculto para el formulario y las mismas props: una app cambia de modo con el mismo estado,
11
+ // como el TimePickerState compartido de Compose.
12
+ // - Sin hora (''), las ruedas descansan en su primer número sin resaltarlo; mover cualquiera de las dos
13
+ // da una hora completa con lo que muestra la otra (en 12 horas, "01" AM y el minuto "00").
14
+ // - Las flechas dan la vuelta (de 59 a 00, de 12 a 1) como los campos de TimeInput; la rueda no gira
15
+ // infinita (salta). Re Pág y Av Pág, 2 horas o 15 minutos (los de TimeInput, de React Aria).
16
+ // - Los dígitos van siempre de izquierda a derecha (`dir="ltr"` en la fila de la hora), como Compose; el
17
+ // período sigue la dirección del documento.
18
+ import { Children, createContext, isValidElement, use, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore, } from 'react';
19
+ import { isDevelopment } from '../../internal/dev.js';
20
+ import { mkWarn, partOutsideParent } from '../../internal/diagnostics.js';
21
+ import { mergeRefs } from '../../internal/merge-refs.js';
22
+ import { TimePeriod } from '../../internal/time-period.js';
23
+ import { clientLocale, displayHour, formatTime, hourRange, localeHourCycle, localePeriodLabels, parseTime, serverLocale, subscribeToLocale, toHours24, } from '../../internal/time.js';
24
+ import { ScrollField } from '../ScrollField/ScrollField.js';
25
+ import { timeScrollStrings } from './strings.js';
26
+ const TimeScrollContext = createContext(null);
27
+ function useTimeScroll(part) {
28
+ const ctx = use(TimeScrollContext);
29
+ if (!ctx)
30
+ throw partOutsideParent(part, 'TimeScroll');
31
+ return ctx;
32
+ }
33
+ const cx = (base, extra) => (extra ? `${base} ${extra}` : base);
34
+ // Saltos de Re Pág y Av Pág, los de TimeInput (PAGE_STEP de React Aria).
35
+ const HOUR_PAGE = 2;
36
+ const MINUTE_PAGE = 15;
37
+ // Como en TimeInput: las partes directas (o en fragmentos) se encuentran sin renderizar, así el grupo y
38
+ // las ruedas salen nombrados y descritos en el HTML del servidor.
39
+ function scanParts(children, ids, found) {
40
+ Children.forEach(children, (child) => {
41
+ if (!isValidElement(child))
42
+ return;
43
+ if (child.type === TimeScrollLabel)
44
+ found.label = child.props.id ?? ids.label;
45
+ else if (child.type === TimeScrollSupporting)
46
+ found.supporting = child.props.id ?? ids.supporting;
47
+ else if (typeof child.type === 'symbol')
48
+ scanParts(child.props.children, ids, found);
49
+ });
50
+ }
51
+ /**
52
+ * Material 3 Expressive time scroll: the time picker's wheel mode (Compose `TimeScroll`), with an hour
53
+ * wheel and a minute wheel (`ScrollField`) and, on the 12-hour clock, an AM/PM selector. It takes the
54
+ * same value and props as `TimeInput`, so an app can offer both modes with one state, inline or inside a
55
+ * `TimePickerDialog`. It submits with `name` in a `<form>` as `"HH:mm"`, like `<input type="time">`.
56
+ *
57
+ * ```tsx
58
+ * const [time, setTime] = useState('07:30')
59
+ *
60
+ * <TimeScroll value={time} onValueChange={setTime} hourCycle={12} name="alarm" required>
61
+ * <TimeScrollLabel>Alarm</TimeScrollLabel>
62
+ * </TimeScroll>
63
+ * ```
64
+ *
65
+ * - **Pointer:** scroll a wheel (finger, mouse wheel, trackpad) and the number that stops in the middle
66
+ * is chosen; clicking a number scrolls to it.
67
+ * - **Keyboard:** each wheel is a spin button. Arrow Up and Arrow Down add or take 1 (wrapping), Page Up
68
+ * and Page Down 2 hours or 15 minutes, Home and End go to the first or last value, and digits pick a
69
+ * number. On the 12-hour clock, typing the first letter of AM or PM chooses it; the selector itself is
70
+ * a radio group (arrows switch).
71
+ * - The clock and the AM/PM names follow `hourCycle` and `locale` (see each prop). Digits always read
72
+ * left to right, also in right-to-left pages.
73
+ * - Native props, `className`, `style` and `ref` go to the container (`role="group"`, named by
74
+ * `TimeScrollLabel` or `aria-label`).
75
+ */
76
+ export function TimeScroll({ value: controlledValue, defaultValue = '', onValueChange, hourCycle, locale, error = false, disabled = false, required = false, name, form, onInvalid, inputRef, hourRef, hourLabel = timeScrollStrings.hourLabel, minuteLabel = timeScrollStrings.minuteLabel, periodLabel = timeScrollStrings.periodLabel, amLabel, pmLabel, className, children, ref, ...props }) {
77
+ const id = useId();
78
+ const defaultLabelId = `${id}label`;
79
+ const defaultSupportingId = `${id}supporting`;
80
+ // Idioma y ciclo, como TimeInput: en el servidor y al hidratar, sin idioma del usuario.
81
+ const browserLocale = useSyncExternalStore(subscribeToLocale, clientLocale, serverLocale);
82
+ const resolvedLocale = locale ?? browserLocale;
83
+ const cycle = hourCycle ?? (resolvedLocale ? localeHourCycle(resolvedLocale) : 24);
84
+ const periods = resolvedLocale ? localePeriodLabels(resolvedLocale) : null;
85
+ const am = amLabel ?? periods?.am ?? timeScrollStrings.amLabel;
86
+ const pm = pmLabel ?? periods?.pm ?? timeScrollStrings.pmLabel;
87
+ const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);
88
+ const controlled = controlledValue !== undefined;
89
+ const value = controlled ? controlledValue : uncontrolledValue;
90
+ const parts = parseTime(value);
91
+ const formValue = parts ? value : '';
92
+ // El período sin hora (AM, como TimeInput): con hora, el de la hora.
93
+ const [emptyPm, setEmptyPm] = useState(false);
94
+ const isPm = parts ? parts.hours >= 12 : emptyPm;
95
+ const range = hourRange(cycle);
96
+ const hourValue = parts ? displayHour(parts.hours, cycle) : null;
97
+ const minuteValue = parts ? parts.minutes : null;
98
+ const [registeredLabelId, setLabelId] = useState(null);
99
+ const [registeredSupportingId, setSupportingId] = useState(null);
100
+ const found = { label: null, supporting: null };
101
+ scanParts(children, { label: defaultLabelId, supporting: defaultSupportingId }, found);
102
+ const labelId = registeredLabelId ?? found.label;
103
+ const supportingId = registeredSupportingId ?? found.supporting;
104
+ const hourWheel = useRef(null);
105
+ const nativeRef = useRef(null);
106
+ const setHourRef = useMemo(() => mergeRefs(hourWheel, hourRef), [hourRef]);
107
+ const setNativeRef = useMemo(() => mergeRefs(nativeRef, inputRef), [inputRef]);
108
+ const emit = (hours, minutes, event) => {
109
+ const next = formatTime({ hours, minutes });
110
+ if (next === formValue)
111
+ return;
112
+ if (!controlled)
113
+ setUncontrolledValue(next);
114
+ onValueChange?.(next, event);
115
+ };
116
+ // Sin hora, la otra rueda aporta lo que muestra: su primer número.
117
+ const handleHour = (shown, event) => emit(toHours24(shown, cycle, isPm), minuteValue ?? 0, event);
118
+ const handleMinute = (minutes, event) => emit(parts ? parts.hours : toHours24(range.min, cycle, isPm), minutes, event);
119
+ const setPeriod = (nextPm, event) => {
120
+ if (nextPm === isPm)
121
+ return;
122
+ if (!parts) {
123
+ setEmptyPm(nextPm);
124
+ return;
125
+ }
126
+ emit((parts.hours % 12) + (nextPm ? 12 : 0), parts.minutes, event);
127
+ };
128
+ // La inicial de AM o PM elige el período desde las ruedas (12 horas), como en los campos de TimeInput.
129
+ const handleWheelKeyDown = (e) => {
130
+ if (cycle !== 12 || disabled || e.altKey || e.ctrlKey || e.metaKey || e.key.length !== 1 || /\d/.test(e.key))
131
+ return;
132
+ const key = e.key.toLocaleLowerCase();
133
+ const amKey = am.charAt(0).toLocaleLowerCase();
134
+ const pmKey = pm.charAt(0).toLocaleLowerCase();
135
+ if (amKey === pmKey || (key !== amKey && key !== pmKey))
136
+ return;
137
+ e.preventDefault();
138
+ setPeriod(key === pmKey, e);
139
+ };
140
+ // form.reset(): como TimeInput, se espera a que el navegador termine.
141
+ const latest = useRef({ controlled, defaultValue, formValue });
142
+ latest.current = { controlled, defaultValue, formValue };
143
+ useEffect(() => {
144
+ const owner = nativeRef.current?.form;
145
+ if (!owner)
146
+ return;
147
+ const onReset = () => {
148
+ setTimeout(() => {
149
+ const { controlled: isControlled, defaultValue: initial, formValue: current } = latest.current;
150
+ if (!isControlled)
151
+ setUncontrolledValue(initial);
152
+ const native = nativeRef.current;
153
+ if (native)
154
+ native.value = isControlled ? current : parseTime(initial) ? initial : '';
155
+ });
156
+ };
157
+ owner.addEventListener('reset', onReset);
158
+ return () => owner.removeEventListener('reset', onReset);
159
+ }, [form]);
160
+ const warned = useRef({});
161
+ useEffect(() => {
162
+ if (!isDevelopment() || value === '' || parts)
163
+ return;
164
+ mkWarn('MK_TIME_VALUE_INVALID', {
165
+ component: 'TimeScroll',
166
+ problem: 'the value is not a time on the 24-hour clock in "HH:mm" format, so the wheels show no time',
167
+ fix: 'pass the time with two-digit hours and minutes (value="07:05", value="19:30"), or "" for no time',
168
+ }, { value }, { once: warned.current });
169
+ }, [value, parts]);
170
+ const ctx = useMemo(() => ({ labelId: defaultLabelId, supportingId: defaultSupportingId, setLabelId, setSupportingId }), [defaultLabelId, defaultSupportingId]);
171
+ const ariaLabel = props['aria-label'];
172
+ const labelledBy = props['aria-labelledby'] ?? (labelId && !ariaLabel ? labelId : undefined);
173
+ const wheelProps = {
174
+ disabled,
175
+ wrap: true,
176
+ 'aria-required': required || undefined,
177
+ 'aria-invalid': error || undefined,
178
+ 'aria-describedby': supportingId ?? undefined,
179
+ onKeyDown: handleWheelKeyDown,
180
+ };
181
+ return (_jsx(TimeScrollContext, { value: ctx, children: _jsxs("div", { ...props, ref: ref, role: "group", className: cx('mk-time-scroll', className), "data-hour-cycle": cycle, "data-error": error || undefined, "data-disabled": disabled || undefined, "aria-labelledby": labelledBy, children: [_jsxs("div", { className: "mk-time-scroll-row", children: [_jsxs("div", { className: "mk-time-scroll-clock", dir: "ltr", children: [_jsx(ScrollField, { ...wheelProps, ref: setHourRef, className: "mk-time-scroll-wheel", label: hourLabel, min: range.min, max: range.max, value: hourValue, pageStep: HOUR_PAGE,
182
+ // En 12 h, la hora sola es ambigua: el lector dice también el período ("7 PM"), como TimeInput.
183
+ formatValueText: cycle === 12 ? (n) => `${n} ${isPm ? pm : am}` : undefined, onValueChange: handleHour }), _jsx("span", { className: "mk-time-scroll-separator", "aria-hidden": "true", children: ":" }), _jsx(ScrollField, { ...wheelProps, className: "mk-time-scroll-wheel", label: minuteLabel, min: 0, max: 59, value: minuteValue, pageStep: MINUTE_PAGE, onValueChange: handleMinute })] }), cycle === 12 && _jsx(TimePeriod, { pm: isPm, amLabel: am, pmLabel: pm, label: periodLabel, disabled: disabled, onChange: setPeriod })] }), _jsx("input", { ref: setNativeRef, type: "text", className: "mk-time-scroll-native", "aria-hidden": "true", tabIndex: -1, name: name, form: form, required: required, disabled: disabled, value: formValue, onChange: () => { }, onInvalid: onInvalid,
184
+ // El navegador enfoca el control inválido al enviar: el foco pasa a la rueda de la hora.
185
+ onFocus: () => hourWheel.current?.focus() }), children] }) }));
186
+ }
187
+ function useRegisteredId(id, register) {
188
+ useLayoutEffect(() => {
189
+ register(id);
190
+ return () => register(null);
191
+ }, [id, register]);
192
+ }
193
+ /**
194
+ * Title above the wheels (Label Medium, `on-surface-variant`), like `TimeInputLabel`. It names the group
195
+ * (`aria-labelledby`). Inside a `TimePickerDialog`, the `DialogHeadline` plays this role instead.
196
+ */
197
+ export function TimeScrollLabel({ id, className, ...props }) {
198
+ const ctx = useTimeScroll('TimeScrollLabel');
199
+ const ownId = id ?? ctx.labelId;
200
+ useRegisteredId(ownId, ctx.setLabelId);
201
+ return _jsx("span", { ...props, id: ownId, className: cx('mk-time-scroll-label', className) });
202
+ }
203
+ /**
204
+ * Supporting text below the wheels (Body Small). It becomes the description of both wheels
205
+ * (`aria-describedby`). In error it takes the error color: to show the error message, change its
206
+ * content.
207
+ */
208
+ export function TimeScrollSupporting({ id, className, ...props }) {
209
+ const ctx = useTimeScroll('TimeScrollSupporting');
210
+ const ownId = id ?? ctx.supportingId;
211
+ useRegisteredId(ownId, ctx.setSupportingId);
212
+ return _jsx("div", { ...props, id: ownId, className: cx('mk-time-scroll-supporting', className) });
213
+ }
@@ -0,0 +1,13 @@
1
+ export interface TimeScrollStrings {
2
+ /** `TimeScroll` `hourLabel`: the accessible name of the hour wheel. */
3
+ hourLabel: string;
4
+ /** `TimeScroll` `minuteLabel`: the accessible name of the minute wheel. */
5
+ minuteLabel: string;
6
+ /** `TimeScroll` `periodLabel`: the name of the AM/PM selector (12-hour clock). */
7
+ periodLabel: string;
8
+ /** `TimeScroll` `amLabel`: the morning option, when the locale gives no name of its own. */
9
+ amLabel: string;
10
+ /** `TimeScroll` `pmLabel`: the afternoon option, when the locale gives no name of its own. */
11
+ pmLabel: string;
12
+ }
13
+ export declare const timeScrollStrings: TimeScrollStrings;
@@ -0,0 +1,12 @@
1
+ // Textos por defecto de TimeScroll (en inglés: son salida para quien usa la librería). Las mismas claves
2
+ // que TimeInput (las props se llaman igual, así una app cambia de modo sin cambiar los textos). El índice
3
+ // src/strings/index.ts los reúne con los demás. Compose nombra las ruedas "Select hour" y "Select
4
+ // minutes" (m3c_time_picker_hour_selection, _minute_selection); acá se usan los nombres de los campos de
5
+ // TimeInput ("Hour", "Minute"), que el lector dice junto al rol ("Hour, spin button").
6
+ export const timeScrollStrings = {
7
+ hourLabel: 'Hour',
8
+ minuteLabel: 'Minute',
9
+ periodLabel: 'AM or PM',
10
+ amLabel: 'AM',
11
+ pmLabel: 'PM',
12
+ };
@@ -0,0 +1,27 @@
1
+ export { Button, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, } from './Button/Button.tsx';
2
+ export { ExtendedFab, Fab, type ExtendedFabProps, type FabProps, type FabSize, type FabColor, } from './Fab/Fab.tsx';
3
+ export { Checkbox, type CheckboxProps } from './Checkbox/Checkbox.tsx';
4
+ export { IconButton, type IconButtonProps, type IconButtonShape, type IconButtonSize, type IconButtonVariant, type IconButtonWidth, } from './IconButton/IconButton.tsx';
5
+ export { RadioButton, type RadioButtonProps } from './RadioButton/RadioButton.tsx';
6
+ export { RadioGroup, RadioGroupLabel, useRadioGroup, type RadioGroupLabelProps, type RadioGroupOrientation, type RadioGroupProps, type RadioGroupState, } from './RadioButton/RadioGroup.tsx';
7
+ export { Switch, type SwitchProps } from './Switch/Switch.tsx';
8
+ export { TextField, TextFieldInput, TextFieldLabel, TextFieldSupporting, TextFieldTextarea, type TextFieldInputProps, type TextFieldLabelProps, type TextFieldProps, type TextFieldSupportingProps, type TextFieldTextareaProps, type TextFieldVariant, } from './TextField/TextField.tsx';
9
+ export { TextFieldLeading, TextFieldTrailing, type TextFieldSlotProps } from './TextField/TextFieldSlots.tsx';
10
+ export { TimeInput, TimeInputLabel, TimeInputSupporting, type TimeHourCycle, type TimeInputChangeEvent, type TimeInputLabelProps, type TimeInputProps, type TimeInputSupportingProps, } from './TimeInput/TimeInput.tsx';
11
+ export { ScrollField, type ScrollFieldChangeEvent, type ScrollFieldProps } from './ScrollField/ScrollField.tsx';
12
+ export { TimeScroll, TimeScrollLabel, TimeScrollSupporting, type TimeScrollChangeEvent, type TimeScrollLabelProps, type TimeScrollProps, type TimeScrollSupportingProps, } from './TimeScroll/TimeScroll.tsx';
13
+ export { Badge, type BadgeProps } from './Badge/Badge.tsx';
14
+ export { LoadingIndicator, type LoadingIndicatorProps } from './LoadingIndicator/LoadingIndicator.tsx';
15
+ export { LinearProgressIndicator, type LinearProgressIndicatorProps, } from './ProgressIndicator/LinearProgressIndicator.tsx';
16
+ export { CircularProgressIndicator, type CircularProgressIndicatorProps, } from './ProgressIndicator/CircularProgressIndicator.tsx';
17
+ export type { ProgressIndicatorThickness } from './ProgressIndicator/progress.ts';
18
+ export { Slider, type SliderOwnProps, type SliderProps, } from './Slider/Slider.tsx';
19
+ export { RangeSlider, RangeSliderEnd, RangeSliderStart, type RangeSliderProps, type RangeSliderThumbProps, type RangeSliderValue, } from './Slider/RangeSlider.tsx';
20
+ export type { SliderFormat, SliderOrientation, SliderSize } from './Slider/slider-shared.tsx';
21
+ export { Card, CardActions, CardContent, CardHeader, CardHeadline, CardMedia, CardPrimaryAction, CardSubhead, type CardActionsProps, type CardContentProps, type CardHeaderProps, type CardHeadlineProps, type CardMediaProps, type CardOrientation, type CardPrimaryActionProps, type CardProps, type CardSubheadProps, type CardVariant, } from './Card/Card.tsx';
22
+ export { AssistChip, type AssistChipProps } from './Chip/AssistChip.tsx';
23
+ export { SuggestionChip, type SuggestionChipProps } from './Chip/SuggestionChip.tsx';
24
+ export { FilterChip, type FilterChipProps } from './Chip/FilterChip.tsx';
25
+ export { InputChip, type InputChipProps, type InputChipRemoveEvent } from './Chip/InputChip.tsx';
26
+ export { ChipAvatar, ChipLabel, type ChipAvatarProps, type ChipLabelProps, type ChipVariant, } from './Chip/chip-content.tsx';
27
+ export { ChipGroup, useChipGroup, type ChipGroupLayout, type ChipGroupProps, type ChipGroupSelectionMode, type ChipGroupState, } from './Chip/ChipGroup.tsx';
@@ -0,0 +1,25 @@
1
+ export { Button, } from './Button/Button.js';
2
+ export { ExtendedFab, Fab, } from './Fab/Fab.js';
3
+ export { Checkbox } from './Checkbox/Checkbox.js';
4
+ export { IconButton, } from './IconButton/IconButton.js';
5
+ export { RadioButton } from './RadioButton/RadioButton.js';
6
+ export { RadioGroup, RadioGroupLabel, useRadioGroup, } from './RadioButton/RadioGroup.js';
7
+ export { Switch } from './Switch/Switch.js';
8
+ export { TextField, TextFieldInput, TextFieldLabel, TextFieldSupporting, TextFieldTextarea, } from './TextField/TextField.js';
9
+ export { TextFieldLeading, TextFieldTrailing } from './TextField/TextFieldSlots.js';
10
+ export { TimeInput, TimeInputLabel, TimeInputSupporting, } from './TimeInput/TimeInput.js';
11
+ export { ScrollField } from './ScrollField/ScrollField.js';
12
+ export { TimeScroll, TimeScrollLabel, TimeScrollSupporting, } from './TimeScroll/TimeScroll.js';
13
+ export { Badge } from './Badge/Badge.js';
14
+ export { LoadingIndicator } from './LoadingIndicator/LoadingIndicator.js';
15
+ export { LinearProgressIndicator, } from './ProgressIndicator/LinearProgressIndicator.js';
16
+ export { CircularProgressIndicator, } from './ProgressIndicator/CircularProgressIndicator.js';
17
+ export { Slider, } from './Slider/Slider.js';
18
+ export { RangeSlider, RangeSliderEnd, RangeSliderStart, } from './Slider/RangeSlider.js';
19
+ export { Card, CardActions, CardContent, CardHeader, CardHeadline, CardMedia, CardPrimaryAction, CardSubhead, } from './Card/Card.js';
20
+ export { AssistChip } from './Chip/AssistChip.js';
21
+ export { SuggestionChip } from './Chip/SuggestionChip.js';
22
+ export { FilterChip } from './Chip/FilterChip.js';
23
+ export { InputChip } from './Chip/InputChip.js';
24
+ export { ChipAvatar, ChipLabel, } from './Chip/chip-content.js';
25
+ export { ChipGroup, useChipGroup, } from './Chip/ChipGroup.js';
@@ -0,0 +1,128 @@
1
+ import { type ButtonHTMLAttributes, type DialogHTMLAttributes, type HTMLAttributes, type Ref } from 'react';
2
+ import { type BottomSheetCloseReason, type BottomSheetState, type BottomSheetStateChangeReason } from './bottom-sheet-context.ts';
3
+ import { type BottomSheetStandardProps } from './StandardBottomSheet.tsx';
4
+ export type { BottomSheetCloseReason, BottomSheetState, BottomSheetStateChangeReason } from './bottom-sheet-context.ts';
5
+ export type { BottomSheetStandardProps } from './StandardBottomSheet.tsx';
6
+ export interface BottomSheetModalProps extends Omit<DialogHTMLAttributes<HTMLDialogElement>, 'open' | 'onClose'> {
7
+ /** Modal (the default): a `<dialog>` over the content, with a scrim and trapped focus. */
8
+ modal?: true | undefined;
9
+ /**
10
+ * Open (modal) or closed. Controlled: the app opens the sheet (it has no trigger of its own) and
11
+ * the sheet only changes when `open` changes.
12
+ */
13
+ open?: boolean | undefined;
14
+ /**
15
+ * A **close request**, with the reason (`BottomSheetCloseReason`): Escape, the scrim, a drag (or
16
+ * fling) down from the lowest state, the handle without a partial state, or a native close. The
17
+ * sheet does not close by itself: the app decides by passing `open={false}`, or refuses by keeping
18
+ * `open` (the sheet goes back to its state and stays modal), for example to confirm before
19
+ * discarding a form only when the reason is `'scrim'`.
20
+ */
21
+ onClose?: ((reason: BottomSheetCloseReason) => void) | undefined;
22
+ /** Whether a click on the scrim asks to close. Defaults to `true`, as in Compose. */
23
+ closeOnScrimClick?: boolean | undefined;
24
+ /**
25
+ * No partial state: opens expanded and closes when dragged down (Compose's
26
+ * `skipPartiallyExpanded`). Defaults to `false`: if the sheet is taller than half the window, it
27
+ * opens partially expanded (half the window) and expands with the handle or by dragging up.
28
+ */
29
+ skipPartiallyExpanded?: boolean | undefined;
30
+ /**
31
+ * Controlled state (`partial` or `expanded`). Without `state`, the sheet manages its own. With
32
+ * `state`, the parent is in charge: dragging, the handle and focus only request the change with
33
+ * `onStateChange`, and if the parent does not update `state`, the sheet goes back to the previous
34
+ * one (a veto, like Compose's `confirmValueChange`). `partial` with no partial state available (a
35
+ * sheet no taller than half the window, or `skipPartiallyExpanded`) is shown expanded and reported
36
+ * with `onStateChange('expanded', 'resize')`; if the partial state becomes available again and
37
+ * `state` is still `partial`, it goes back to partial and reports `('partial', 'resize')`.
38
+ */
39
+ state?: BottomSheetState | undefined;
40
+ /**
41
+ * The state it opens in, uncontrolled. Defaults to partial if available, otherwise expanded.
42
+ * Applied every time it opens.
43
+ */
44
+ defaultState?: BottomSheetState | undefined;
45
+ /**
46
+ * The state settled on another value (or, when controlled, was requested): one call per change,
47
+ * when a drag is released with its target decided or when the handle is used, not on every frame.
48
+ * Changes the parent makes through `state` are not reported. The drag progress is in the CSS
49
+ * variable `--mk-bottom-sheet-progress`.
50
+ */
51
+ onStateChange?: ((state: BottomSheetState, reason: BottomSheetStateChangeReason) => void) | undefined;
52
+ /** Ref to the native `<dialog>`. */
53
+ ref?: Ref<HTMLDialogElement> | undefined;
54
+ }
55
+ /**
56
+ * Material 3 bottom sheet. **Modal** (the default): on the native `<dialog>` opened with `showModal()`,
57
+ * like `Dialog` (trapped focus, inert page, scrim, Escape, animated exit, focus returned on close).
58
+ *
59
+ * ```tsx
60
+ * <BottomSheet open={open} onClose={() => setOpen(false)}>
61
+ * <BottomSheetHandle />
62
+ * <BottomSheetTitle>Share</BottomSheetTitle>
63
+ * <BottomSheetContent>…</BottomSheetContent>
64
+ * </BottomSheet>
65
+ * ```
66
+ *
67
+ * - **States:** partially expanded and expanded, like Compose's `SheetState`. It opens partially
68
+ * expanded if the sheet is taller than half the window (and there is no `skipPartiallyExpanded`);
69
+ * otherwise, expanded. The current state is in `data-state` (`partial` or `expanded`). When focus
70
+ * lands on something the partial state leaves outside the window, it expands. Controlled with
71
+ * `state` and `onStateChange`, or with `defaultState` (like `RadioGroup`'s `value`/`defaultValue`):
72
+ *
73
+ * ```tsx
74
+ * const [state, setState] = useState<BottomSheetState>('partial')
75
+ * <BottomSheet open={open} onClose={close} state={state} onStateChange={(next) => setState(next)}>
76
+ * ```
77
+ * - **Progress:** `--mk-bottom-sheet-progress` on the `<dialog>`, the visible part of its height
78
+ * (0 closed, 1 expanded; partial, half the window over the sheet's height), while dragging and
79
+ * during animations, without re-rendering with React. The content and the `::backdrop` inherit
80
+ * it (in all three engines): use it to dim the scrim or reveal something on expand.
81
+ * - **Drag:** with mouse, touch or pen from anywhere on the sheet (with a mouse, not from the
82
+ * content or from fields: there it selects text), following the pointer. On release it decides
83
+ * by velocity (125 px/s) and distance (56 px), like Compose: next state, back, or close. In
84
+ * scrollable content, swiping down while scrolled to the top moves the sheet.
85
+ * - **Name:** from `BottomSheetTitle` (`aria-labelledby`); without a title, pass `aria-label` or
86
+ * `aria-labelledby`. A modal sheet with none of them warns in development (`MK_SURFACE_UNNAMED`)
87
+ * once it opens. There is no description by default: point `aria-describedby` at a paragraph of
88
+ * your own if the sheet needs one.
89
+ * - Maximum width 640 px, centered (`BottomSheetDefaults.SheetMaxWidth`). While it is open, the
90
+ * page does not scroll.
91
+ *
92
+ * **Standard** (`modal={false}`, ADR-0030): the one in Compose's `BottomSheetScaffold`, an `<aside>`
93
+ * without a scrim that lives alongside the content, peeking (the handle and the first line of the
94
+ * title, or 56 px without a title; `--mk-bottom-sheet-peek-height`) or expanded; it goes as a child
95
+ * of a `PaneScaffold`, which pads the bottom of the panes. Same parts, same drag and
96
+ * `state`/`defaultState`/`onStateChange`; `open` (defaults to `true`) and, with `onClose`, it can be
97
+ * hidden by dragging (`onClose('drag')`). See `BottomSheetStandardProps`.
98
+ *
99
+ * Native props and `ref` reach the `<dialog>` (or the `<aside>`); so do `className` and `style`.
100
+ */
101
+ export declare function BottomSheet(props: BottomSheetProps): import("react").JSX.Element;
102
+ /** Modal or standard (`modal={false}`, ADR-0030). */
103
+ export type BottomSheetProps = BottomSheetModalProps | BottomSheetStandardProps;
104
+ export interface BottomSheetHandleProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'aria-label'> {
105
+ /** The handle's name when it expands the partial sheet. Defaults to "Expand". */
106
+ expandLabel?: string | undefined;
107
+ /** The handle's name when it takes the expanded sheet to partial. Defaults to "Collapse". */
108
+ collapseLabel?: string | undefined;
109
+ /** The handle's name when it closes the sheet (no partial state). Defaults to "Close". */
110
+ closeLabel?: string | undefined;
111
+ 'aria-label'?: never;
112
+ ref?: Ref<HTMLButtonElement> | undefined;
113
+ }
114
+ /**
115
+ * Drag handle: the 32 × 4 bar at the top of the sheet, which is also a button for keyboard and
116
+ * screen reader users. Like Compose's handle (which does the same when tapped): with the sheet
117
+ * partially expanded it expands it ("Expand"), expanded it takes it to partial ("Collapse") and,
118
+ * without a partial state, it closes it ("Close"). The name changes with the action.
119
+ *
120
+ * Goes as the first child of `BottomSheet`: it receives focus on open.
121
+ */
122
+ export declare function BottomSheetHandle({ expandLabel, collapseLabel, closeLabel, className, onClick, ...props }: BottomSheetHandleProps): import("react").JSX.Element;
123
+ export interface BottomSheetTitleProps extends HTMLAttributes<HTMLHeadingElement> {
124
+ /** Ref to the `<h2>`. */
125
+ ref?: Ref<HTMLHeadingElement> | undefined;
126
+ }
127
+ /** The sheet's title (Title Large, `on-surface`), in an `<h2>`. It is the sheet's accessible name. */
128
+ export declare function BottomSheetTitle({ id, className, ...props }: BottomSheetTitleProps): import("react").JSX.Element;