material-plus-ui 1.0.0 → 1.2.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 (151) hide show
  1. package/dist/components/animate-appear/MPAnimateAppear.d.ts +56 -0
  2. package/dist/components/animate-appear/MPAnimateAppear.js +1 -0
  3. package/dist/components/animate-appear/index.d.ts +2 -0
  4. package/dist/components/animate-appear/index.js +1 -0
  5. package/dist/components/animate-blink/MPAnimateBlink.d.ts +41 -0
  6. package/dist/components/animate-blink/MPAnimateBlink.js +1 -0
  7. package/dist/components/animate-blink/index.d.ts +2 -0
  8. package/dist/components/animate-blink/index.js +1 -0
  9. package/dist/components/animate-fade/MPAnimateFade.d.ts +38 -0
  10. package/dist/components/animate-fade/MPAnimateFade.js +1 -0
  11. package/dist/components/animate-fade/index.d.ts +2 -0
  12. package/dist/components/animate-fade/index.js +1 -0
  13. package/dist/components/animate-grow/MPAnimateGrow.d.ts +52 -0
  14. package/dist/components/animate-grow/MPAnimateGrow.js +1 -0
  15. package/dist/components/animate-grow/index.d.ts +2 -0
  16. package/dist/components/animate-grow/index.js +1 -0
  17. package/dist/components/animate-headline/MPAnimateHeadline.d.ts +63 -0
  18. package/dist/components/animate-headline/MPAnimateHeadline.js +1 -0
  19. package/dist/components/animate-headline/index.d.ts +2 -0
  20. package/dist/components/animate-headline/index.js +1 -0
  21. package/dist/components/animate-lighting/MPAnimateLighting.d.ts +68 -0
  22. package/dist/components/animate-lighting/MPAnimateLighting.js +1 -0
  23. package/dist/components/animate-lighting/index.d.ts +2 -0
  24. package/dist/components/animate-lighting/index.js +1 -0
  25. package/dist/components/animate-marquee/MPAnimateMarquee.d.ts +66 -0
  26. package/dist/components/animate-marquee/MPAnimateMarquee.js +1 -0
  27. package/dist/components/animate-marquee/index.d.ts +2 -0
  28. package/dist/components/animate-marquee/index.js +1 -0
  29. package/dist/components/animate-rotate/MPAnimateRotate.d.ts +56 -0
  30. package/dist/components/animate-rotate/MPAnimateRotate.js +1 -0
  31. package/dist/components/animate-rotate/index.d.ts +2 -0
  32. package/dist/components/animate-rotate/index.js +1 -0
  33. package/dist/components/animate-slide/MPAnimateSlide.d.ts +53 -0
  34. package/dist/components/animate-slide/MPAnimateSlide.js +1 -0
  35. package/dist/components/animate-slide/index.d.ts +2 -0
  36. package/dist/components/animate-slide/index.js +1 -0
  37. package/dist/components/animate-typing/MPAnimateTyping.d.ts +59 -0
  38. package/dist/components/animate-typing/MPAnimateTyping.js +1 -0
  39. package/dist/components/animate-typing/index.d.ts +2 -0
  40. package/dist/components/animate-typing/index.js +1 -0
  41. package/dist/components/animate-zoom/MPAnimateZoom.d.ts +44 -0
  42. package/dist/components/animate-zoom/MPAnimateZoom.js +1 -0
  43. package/dist/components/animate-zoom/index.d.ts +2 -0
  44. package/dist/components/animate-zoom/index.js +1 -0
  45. package/dist/components/avatar/MPAvatar.d.ts +9 -2
  46. package/dist/components/avatar/MPAvatar.js +1 -1
  47. package/dist/components/badge/MPBadge.js +1 -1
  48. package/dist/components/bottom-navigation/MPBottomNavigation.d.ts +144 -0
  49. package/dist/components/bottom-navigation/MPBottomNavigation.js +1 -0
  50. package/dist/components/bottom-navigation/index.d.ts +2 -0
  51. package/dist/components/bottom-navigation/index.js +1 -0
  52. package/dist/components/breadcrumb/MPBreadcrumb.d.ts +22 -0
  53. package/dist/components/breadcrumb/MPBreadcrumb.js +1 -1
  54. package/dist/components/button/MPButton.d.ts +7 -2
  55. package/dist/components/button/MPButton.js +1 -1
  56. package/dist/components/carousel/MPCarousel.js +1 -1
  57. package/dist/components/checkbox/MPCheckbox.d.ts +2 -2
  58. package/dist/components/checkbox/MPCheckbox.js +1 -1
  59. package/dist/components/chip/MPChip.d.ts +13 -3
  60. package/dist/components/chip/MPChip.js +1 -1
  61. package/dist/components/color-picker/MPColorPicker.d.ts +21 -3
  62. package/dist/components/color-picker/MPColorPicker.js +1 -1
  63. package/dist/components/combobox/MPCombobox.d.ts +38 -10
  64. package/dist/components/combobox/MPCombobox.js +1 -1
  65. package/dist/components/container/MPContainer.d.ts +75 -0
  66. package/dist/components/container/MPContainer.js +1 -0
  67. package/dist/components/container/index.d.ts +2 -0
  68. package/dist/components/container/index.js +1 -0
  69. package/dist/components/date-picker/MPDatePicker.d.ts +3 -0
  70. package/dist/components/date-picker/MPDatePicker.js +1 -1
  71. package/dist/components/date-range-picker/MPDateRangePicker.js +1 -1
  72. package/dist/components/date-time-picker/MPDateTimePicker.js +1 -1
  73. package/dist/components/dialog/MPDialog.d.ts +8 -3
  74. package/dist/components/dialog/MPDialog.js +1 -1
  75. package/dist/components/drawer/MPDrawer.d.ts +33 -9
  76. package/dist/components/drawer/MPDrawer.js +1 -1
  77. package/dist/components/empty/MPEmpty.d.ts +12 -2
  78. package/dist/components/empty/MPEmpty.js +1 -1
  79. package/dist/components/file-picker/MPFilePicker.d.ts +11 -1
  80. package/dist/components/file-picker/MPFilePicker.js +1 -1
  81. package/dist/components/floating-action-button/MPFloatingActionButton.d.ts +126 -0
  82. package/dist/components/floating-action-button/MPFloatingActionButton.js +1 -0
  83. package/dist/components/floating-action-button/index.d.ts +2 -0
  84. package/dist/components/floating-action-button/index.js +1 -0
  85. package/dist/components/grid/MPGrid.d.ts +155 -0
  86. package/dist/components/grid/MPGrid.js +1 -0
  87. package/dist/components/grid/index.d.ts +2 -0
  88. package/dist/components/grid/index.js +1 -0
  89. package/dist/components/highlight/MPHighlight.js +1 -1
  90. package/dist/components/list/MPList.js +1 -1
  91. package/dist/components/menu/MPMenu.d.ts +10 -1
  92. package/dist/components/menu/MPMenu.js +1 -1
  93. package/dist/components/number-field/MPNumberField.d.ts +21 -3
  94. package/dist/components/number-field/MPNumberField.js +1 -1
  95. package/dist/components/pagination/MPPagination.d.ts +106 -0
  96. package/dist/components/pagination/MPPagination.js +1 -0
  97. package/dist/components/pagination/index.d.ts +2 -0
  98. package/dist/components/pagination/index.js +1 -0
  99. package/dist/components/panes/MPPanes.js +1 -1
  100. package/dist/components/pill/MPPill.js +1 -1
  101. package/dist/components/popover/MPPopover.d.ts +8 -3
  102. package/dist/components/popover/MPPopover.js +1 -1
  103. package/dist/components/radio-group/MPRadioGroup.js +1 -1
  104. package/dist/components/rating/MPRating.d.ts +135 -0
  105. package/dist/components/rating/MPRating.js +1 -0
  106. package/dist/components/rating/index.d.ts +2 -0
  107. package/dist/components/rating/index.js +1 -0
  108. package/dist/components/segmented-button/MPSegmentedButton.js +1 -1
  109. package/dist/components/select/MPSelect.d.ts +23 -6
  110. package/dist/components/select/MPSelect.js +1 -1
  111. package/dist/components/skeleton/MPSkeleton.js +1 -1
  112. package/dist/components/slider/MPSlider.js +1 -1
  113. package/dist/components/snackbar/MPSnackbar.d.ts +8 -3
  114. package/dist/components/snackbar/MPSnackbar.js +1 -1
  115. package/dist/components/spoiler/MPSpoiler.js +1 -1
  116. package/dist/components/switch/MPSwitch.d.ts +2 -2
  117. package/dist/components/switch/MPSwitch.js +1 -1
  118. package/dist/components/table/MPTable.d.ts +14 -1
  119. package/dist/components/table/MPTable.js +1 -1
  120. package/dist/components/tabs/MPTabs.d.ts +145 -0
  121. package/dist/components/tabs/MPTabs.js +1 -0
  122. package/dist/components/tabs/index.d.ts +2 -0
  123. package/dist/components/tabs/index.js +1 -0
  124. package/dist/components/text-field/MPTextField.d.ts +37 -7
  125. package/dist/components/text-field/MPTextField.js +1 -1
  126. package/dist/components/text-link/MPTextLink.js +1 -1
  127. package/dist/components/time-picker/MPTimePicker.js +1 -1
  128. package/dist/components/timeline/MPTimeline.js +1 -1
  129. package/dist/constants/icons.d.ts +13 -0
  130. package/dist/constants/icons.js +1 -1
  131. package/dist/index.d.ts +18 -0
  132. package/dist/index.js +1 -1
  133. package/dist/internal/Calendar.js +1 -1
  134. package/dist/internal/FieldOutline.d.ts +75 -4
  135. package/dist/internal/FieldOutline.js +1 -1
  136. package/dist/internal/Picker.d.ts +52 -9
  137. package/dist/internal/Picker.js +1 -1
  138. package/dist/internal/animate.d.ts +179 -0
  139. package/dist/internal/animate.js +1 -0
  140. package/dist/internal/date.d.ts +2 -2
  141. package/dist/internal/date.js +1 -1
  142. package/dist/internal/i18n.d.ts +110 -0
  143. package/dist/internal/i18n.js +1 -1
  144. package/dist/internal/inert.d.ts +11 -0
  145. package/dist/internal/inert.js +1 -0
  146. package/dist/internal/surface.d.ts +42 -12
  147. package/dist/internal/surface.js +1 -1
  148. package/dist/styles.css +1 -1
  149. package/dist/tailwind.css +640 -4
  150. package/dist/types.d.ts +155 -0
  151. package/package.json +10 -10
package/dist/types.d.ts CHANGED
@@ -96,6 +96,45 @@ export type MPCorner = 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';
96
96
  * Korea, Monday across most of Europe, Saturday in much of the Middle East.
97
97
  */
98
98
  export type MPWeekday = 0 | 1 | 2 | 3 | 4 | 5 | 6;
99
+ /**
100
+ * How something sits in the page's scroll.
101
+ *
102
+ * CSS's own four values, because this is CSS's own question and a second
103
+ * spelling for `fixed` would be a word a caller has to translate. `sticky` and
104
+ * `fixed` are what a bar pinned to an edge of the window wants; `absolute` pins
105
+ * a thing to a *region* instead — a button in a card, in a map, in a preview —
106
+ * and is the one that makes a floating control usable anywhere but the window.
107
+ */
108
+ export type MPPosition = 'static' | 'absolute' | 'sticky' | 'fixed';
109
+ /**
110
+ * How wide the window is, in Material's own words.
111
+ *
112
+ * MD3 does not describe a layout in pixels, it describes it in **window size
113
+ * classes**: `compact` below 600dp, `medium` from 600, `expanded` from 840,
114
+ * `large` from 1200, `extra-large` from 1600. They are the axis the
115
+ * specification's layout grid changes along — four columns in a compact window,
116
+ * twelve from medium up — and so they are the axis this library's grid changes
117
+ * along too.
118
+ *
119
+ * **They are deliberately not Tailwind's breakpoints.** Tailwind changes at
120
+ * 640/768/1024/1280, which are different numbers describing the same idea, and a
121
+ * `<MPGrid>` that reflowed at one set while the `md:` utility beside it reflowed
122
+ * at another would be a layout that is subtly wrong at exactly one width and
123
+ * impossible to reason about at every other. Given two ladders, the library
124
+ * takes the one the specification defines — see
125
+ * `docs/{locale}/components/layout/grid.md` for how to line the other one up
126
+ * with it.
127
+ */
128
+ export type MPWindowClass = 'compact' | 'medium' | 'expanded' | 'large' | 'extra-large';
129
+ /**
130
+ * A value, or the same value said differently at each window size class.
131
+ *
132
+ * `span={6}` is six columns at every width; `span={{ compact: 12, medium: 6 }}`
133
+ * is the whole row on a phone and half of it from 600dp up. Each entry applies
134
+ * from its own class **upward**, so a layout is usually two entries rather than
135
+ * five — anything not named keeps whatever the class below it said.
136
+ */
137
+ export type MPResponsive<T> = T | Partial<Record<MPWindowClass, T>>;
99
138
  /**
100
139
  * The axes most components share.
101
140
  *
@@ -146,3 +185,119 @@ export interface MPIconGlyphProps {
146
185
  * caller passing `ICONS.close` would be told to pass `<ICONS.close />` instead.
147
186
  */
148
187
  export type MPIconGlyph = React.ComponentType<MPIconGlyphProps> | React.ReactElement;
188
+ /**
189
+ * A Material easing curve, by the specification's own name.
190
+ *
191
+ * These are MD3's motion easing set and nothing else — no arbitrary
192
+ * `cubic-bezier()`, for the same reason `color` takes a family rather than a
193
+ * colour: to change what `emphasized` *is*, set
194
+ * `--mp-sys-motion-easing-emphasized` and every animation in the page moves
195
+ * together. A curve written into one component's props is a curve the theme
196
+ * cannot reach.
197
+ *
198
+ * The pairs are how Material describes a transition rather than four
199
+ * interchangeable options. Something **arriving** decelerates into place;
200
+ * something **leaving** accelerates away; `standard` is for a change that is
201
+ * neither, and `linear` for a loop that has no beginning to arrive at.
202
+ *
203
+ * A note on `emphasized`: the specification's own emphasized curve is two
204
+ * curves joined in the middle, which CSS has no single value for. MD3's web
205
+ * implementation publishes a one-curve stand-in, and that is what the token
206
+ * carries here. Where the halves matter — a line arriving as another leaves —
207
+ * the two `emphasized-*` names are the halves, and they are what the components
208
+ * reach for.
209
+ */
210
+ export type MPEasing = 'linear' | 'standard' | 'standard-decelerate' | 'standard-accelerate' | 'emphasized' | 'emphasized-decelerate' | 'emphasized-accelerate';
211
+ /**
212
+ * The six effects the `MPAnimate*` components are built out of.
213
+ *
214
+ * Named after what a reader sees rather than after the CSS property underneath:
215
+ * `zoom` and `grow` are both a change of scale, and they are two words because
216
+ * they are two *gestures* — one arrives from the middle of where it will end
217
+ * up, the other unfolds from an edge of it.
218
+ *
219
+ * Everything past these six is a component rather than a value. A marquee that
220
+ * duplicates its children, a headline that swaps between them, a typewriter
221
+ * that counts characters — none of those can be a class name and a few numbers.
222
+ */
223
+ export type MPAnimation = 'fade' | 'grow' | 'slide' | 'zoom' | 'rotate' | 'blink';
224
+ /**
225
+ * What makes an animation run.
226
+ *
227
+ * - `mount` — as soon as it is on the page. The default, and the only one that
228
+ * needs nothing from the caller.
229
+ * - `visible` — when it is scrolled into view. Once, unless `once` is off.
230
+ * - `hover` — while the pointer is on it, starting again on each entry.
231
+ * Keyboard focus counts, or the effect would be unreachable without a mouse.
232
+ * - `manual` — never on its own. `play` is what runs it.
233
+ */
234
+ export type MPAnimateTrigger = 'mount' | 'visible' | 'hover' | 'manual';
235
+ /**
236
+ * Whether an effect brings its content in or takes it away.
237
+ *
238
+ * The two are not the same length in Material: an entrance is given room to be
239
+ * read as an arrival, an exit gets out of the way. That asymmetry is what the
240
+ * default durations carry, so `mode="out"` is quicker than `mode="in"` without
241
+ * anybody having to know the numbers.
242
+ */
243
+ export type MPAnimateMode = 'in' | 'out';
244
+ /**
245
+ * How many times an animation runs. `'infinite'` rather than `Infinity`,
246
+ * because it is written into CSS as that word and a caller who typed the number
247
+ * would be surprised by which one worked.
248
+ */
249
+ export type MPAnimateRepeat = number | 'infinite';
250
+ /**
251
+ * The settings every `MPAnimate*` component takes, and the reason they are one
252
+ * interface: a `delay` of 200 has to mean the same thing on a fade and on a
253
+ * marquee, exactly as `size="md"` means one height everywhere.
254
+ *
255
+ * Durations and delays are milliseconds — numbers, not CSS strings. A prop
256
+ * typed `string` invites `'0.4s'`, and then two components on one screen are
257
+ * written in two units.
258
+ */
259
+ export interface MPAnimateProps {
260
+ /**
261
+ * How long one run takes, in milliseconds. Left unset, the effect takes its
262
+ * own Material duration token — which is what a theme changes.
263
+ */
264
+ duration?: number;
265
+ /**
266
+ * How long before it starts, in milliseconds.
267
+ * @default 0
268
+ */
269
+ delay?: number;
270
+ /** Which Material easing curve it runs on. */
271
+ easing?: MPEasing;
272
+ /**
273
+ * How many times it runs.
274
+ * @default 1
275
+ */
276
+ repeat?: MPAnimateRepeat;
277
+ /** Runs every other pass backwards, so a repeat returns instead of jumping. */
278
+ alternate?: boolean;
279
+ /**
280
+ * Holds the animation where it is.
281
+ * @default false
282
+ */
283
+ paused?: boolean;
284
+ /**
285
+ * What starts it.
286
+ * @default 'mount'
287
+ */
288
+ trigger?: MPAnimateTrigger;
289
+ /** Runs it, when `trigger` is `manual`. Each `false` → `true` starts it over. */
290
+ play?: boolean;
291
+ /**
292
+ * With `trigger="visible"`, whether it runs only the first time. Off, it runs
293
+ * again every time the element comes back into view.
294
+ * @default true
295
+ */
296
+ once?: boolean;
297
+ /**
298
+ * With `trigger="visible"`, how much of the element has to be on screen
299
+ * before it counts as visible, from `0` to `1`.
300
+ * @default 0.2
301
+ */
302
+ threshold?: number;
303
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "material-plus-ui",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "description": "A React component library implementing Material Design 3 — the components other Material libraries do not ship, and wider versions of the ones they do. Built on Base UI and Tailwind CSS v4, themed with CSS custom properties so it can coexist with an existing Material setup. ESM only, types included.",
5
5
  "type": "module",
6
6
  "types": "dist/index.d.ts",
@@ -31,7 +31,7 @@
31
31
  "typecheck": "tsc --project tsconfig.prod.json --noEmit && tsc --project test/tsconfig.json && tsc --project docs/tsconfig.json"
32
32
  },
33
33
  "engines": {
34
- "node": ">=18.0.0"
34
+ "node": ">=22.0.0"
35
35
  },
36
36
  "main": "dist/index.js",
37
37
  "exports": {
@@ -106,13 +106,13 @@
106
106
  "@types/react": "^19.2.18",
107
107
  "@types/react-dom": "^19.2.4",
108
108
  "@typescript-eslint/parser": "^8.67.0",
109
- "@vitejs/plugin-react": "^6.0.5",
110
- "@vitest/browser": "^4.1.10",
111
- "@vitest/browser-playwright": "^4.1.10",
109
+ "@vitejs/plugin-react": "^6.1.0",
110
+ "@vitest/browser": "^4.1.11",
111
+ "@vitest/browser-playwright": "^4.1.11",
112
112
  "eslint": "^9.39.1",
113
113
  "eslint-config-prettier": "^10.1.8",
114
114
  "eslint-plugin-n": "^18.3.0",
115
- "globals": "^17.10.0",
115
+ "globals": "^17.11.0",
116
116
  "jiti": "^2.7.0",
117
117
  "playwright": "^1.62.1",
118
118
  "postcss": "^8.5.26",
@@ -125,15 +125,15 @@
125
125
  "tsx": "^4.23.12",
126
126
  "typescript": "^6.0.3",
127
127
  "typescript-eslint": "^8.67.0",
128
- "vite": "^8.2.1",
128
+ "vite": "^8.2.2",
129
129
  "vitepress": "^1.6.4",
130
130
  "vitepress-i18n": "^1.3.5",
131
- "vitepress-sidebar": "^1.38.0",
132
- "vitest": "^4.1.10",
131
+ "vitepress-sidebar": "^1.39.0",
132
+ "vitest": "^4.1.11",
133
133
  "vitest-browser-react": "^2.2.0"
134
134
  },
135
135
  "dependencies": {
136
- "lucide-react": "^1.31.0"
136
+ "lucide-react": "^1.33.0"
137
137
  },
138
138
  "peerDependencies": {
139
139
  "@base-ui/react": "^1.7.0",