material-plus-ui 0.0.1 → 1.1.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.
- package/README.md +39 -28
- package/dist/components/accordion/MPAccordion.d.ts +115 -0
- package/dist/components/accordion/MPAccordion.js +1 -0
- package/dist/components/accordion/index.d.ts +2 -0
- package/dist/components/accordion/index.js +1 -0
- package/dist/components/alert/MPAlert.d.ts +91 -0
- package/dist/components/alert/MPAlert.js +1 -0
- package/dist/components/alert/index.d.ts +2 -0
- package/dist/components/alert/index.js +1 -0
- package/dist/components/animate-appear/MPAnimateAppear.d.ts +56 -0
- package/dist/components/animate-appear/MPAnimateAppear.js +1 -0
- package/dist/components/animate-appear/index.d.ts +2 -0
- package/dist/components/animate-appear/index.js +1 -0
- package/dist/components/animate-blink/MPAnimateBlink.d.ts +41 -0
- package/dist/components/animate-blink/MPAnimateBlink.js +1 -0
- package/dist/components/animate-blink/index.d.ts +2 -0
- package/dist/components/animate-blink/index.js +1 -0
- package/dist/components/animate-fade/MPAnimateFade.d.ts +38 -0
- package/dist/components/animate-fade/MPAnimateFade.js +1 -0
- package/dist/components/animate-fade/index.d.ts +2 -0
- package/dist/components/animate-fade/index.js +1 -0
- package/dist/components/animate-grow/MPAnimateGrow.d.ts +52 -0
- package/dist/components/animate-grow/MPAnimateGrow.js +1 -0
- package/dist/components/animate-grow/index.d.ts +2 -0
- package/dist/components/animate-grow/index.js +1 -0
- package/dist/components/animate-headline/MPAnimateHeadline.d.ts +63 -0
- package/dist/components/animate-headline/MPAnimateHeadline.js +1 -0
- package/dist/components/animate-headline/index.d.ts +2 -0
- package/dist/components/animate-headline/index.js +1 -0
- package/dist/components/animate-lighting/MPAnimateLighting.d.ts +68 -0
- package/dist/components/animate-lighting/MPAnimateLighting.js +1 -0
- package/dist/components/animate-lighting/index.d.ts +2 -0
- package/dist/components/animate-lighting/index.js +1 -0
- package/dist/components/animate-marquee/MPAnimateMarquee.d.ts +66 -0
- package/dist/components/animate-marquee/MPAnimateMarquee.js +1 -0
- package/dist/components/animate-marquee/index.d.ts +2 -0
- package/dist/components/animate-marquee/index.js +1 -0
- package/dist/components/animate-rotate/MPAnimateRotate.d.ts +56 -0
- package/dist/components/animate-rotate/MPAnimateRotate.js +1 -0
- package/dist/components/animate-rotate/index.d.ts +2 -0
- package/dist/components/animate-rotate/index.js +1 -0
- package/dist/components/animate-slide/MPAnimateSlide.d.ts +53 -0
- package/dist/components/animate-slide/MPAnimateSlide.js +1 -0
- package/dist/components/animate-slide/index.d.ts +2 -0
- package/dist/components/animate-slide/index.js +1 -0
- package/dist/components/animate-typing/MPAnimateTyping.d.ts +59 -0
- package/dist/components/animate-typing/MPAnimateTyping.js +1 -0
- package/dist/components/animate-typing/index.d.ts +2 -0
- package/dist/components/animate-typing/index.js +1 -0
- package/dist/components/animate-zoom/MPAnimateZoom.d.ts +44 -0
- package/dist/components/animate-zoom/MPAnimateZoom.js +1 -0
- package/dist/components/animate-zoom/index.d.ts +2 -0
- package/dist/components/animate-zoom/index.js +1 -0
- package/dist/components/aspect-ratio/MPAspectRatio.d.ts +69 -0
- package/dist/components/aspect-ratio/MPAspectRatio.js +1 -0
- package/dist/components/aspect-ratio/index.d.ts +2 -0
- package/dist/components/aspect-ratio/index.js +1 -0
- package/dist/components/avatar/MPAvatar.d.ts +104 -0
- package/dist/components/avatar/MPAvatar.js +1 -0
- package/dist/components/avatar/index.d.ts +2 -0
- package/dist/components/avatar/index.js +1 -0
- package/dist/components/badge/MPBadge.d.ts +104 -0
- package/dist/components/badge/MPBadge.js +1 -0
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/components/badge/index.js +1 -0
- package/dist/components/blockquote/MPBlockquote.d.ts +73 -0
- package/dist/components/blockquote/MPBlockquote.js +1 -0
- package/dist/components/blockquote/index.d.ts +2 -0
- package/dist/components/blockquote/index.js +1 -0
- package/dist/components/bottom-navigation/MPBottomNavigation.d.ts +144 -0
- package/dist/components/bottom-navigation/MPBottomNavigation.js +1 -0
- package/dist/components/bottom-navigation/index.d.ts +2 -0
- package/dist/components/bottom-navigation/index.js +1 -0
- package/dist/components/box/MPBox.d.ts +78 -0
- package/dist/components/box/MPBox.js +1 -0
- package/dist/components/box/index.d.ts +2 -0
- package/dist/components/box/index.js +1 -0
- package/dist/components/breadcrumb/MPBreadcrumb.d.ts +127 -0
- package/dist/components/breadcrumb/MPBreadcrumb.js +1 -0
- package/dist/components/breadcrumb/index.d.ts +2 -0
- package/dist/components/breadcrumb/index.js +1 -0
- package/dist/components/button/MPButton.d.ts +75 -0
- package/dist/components/button/MPButton.js +1 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/index.js +1 -0
- package/dist/components/button-group/MPButtonGroup.d.ts +31 -0
- package/dist/components/button-group/MPButtonGroup.js +1 -0
- package/dist/components/button-group/index.d.ts +2 -0
- package/dist/components/button-group/index.js +1 -0
- package/dist/components/card/MPCard.d.ts +73 -0
- package/dist/components/card/MPCard.js +1 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/card/index.js +1 -0
- package/dist/components/carousel/MPCarousel.d.ts +116 -0
- package/dist/components/carousel/MPCarousel.js +1 -0
- package/dist/components/carousel/index.d.ts +2 -0
- package/dist/components/carousel/index.js +1 -0
- package/dist/components/chat-bubble/MPChatBubble.d.ts +132 -0
- package/dist/components/chat-bubble/MPChatBubble.js +1 -0
- package/dist/components/chat-bubble/index.d.ts +2 -0
- package/dist/components/chat-bubble/index.js +1 -0
- package/dist/components/checkbox/MPCheckbox.d.ts +76 -0
- package/dist/components/checkbox/MPCheckbox.js +1 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/checkbox/index.js +1 -0
- package/dist/components/chip/MPChip.d.ts +74 -0
- package/dist/components/chip/MPChip.js +1 -0
- package/dist/components/chip/index.d.ts +2 -0
- package/dist/components/chip/index.js +1 -0
- package/dist/components/collapsible/MPCollapsible.d.ts +97 -0
- package/dist/components/collapsible/MPCollapsible.js +1 -0
- package/dist/components/collapsible/index.d.ts +2 -0
- package/dist/components/collapsible/index.js +1 -0
- package/dist/components/color-picker/MPColorPicker.d.ts +131 -0
- package/dist/components/color-picker/MPColorPicker.js +1 -0
- package/dist/components/color-picker/index.d.ts +2 -0
- package/dist/components/color-picker/index.js +1 -0
- package/dist/components/combobox/MPCombobox.d.ts +175 -0
- package/dist/components/combobox/MPCombobox.js +1 -0
- package/dist/components/combobox/index.d.ts +2 -0
- package/dist/components/combobox/index.js +1 -0
- package/dist/components/container/MPContainer.d.ts +75 -0
- package/dist/components/container/MPContainer.js +1 -0
- package/dist/components/container/index.d.ts +2 -0
- package/dist/components/container/index.js +1 -0
- package/dist/components/date-picker/MPDatePicker.d.ts +98 -0
- package/dist/components/date-picker/MPDatePicker.js +1 -0
- package/dist/components/date-picker/index.d.ts +2 -0
- package/dist/components/date-picker/index.js +1 -0
- package/dist/components/date-range-picker/MPDateRangePicker.d.ts +98 -0
- package/dist/components/date-range-picker/MPDateRangePicker.js +1 -0
- package/dist/components/date-range-picker/index.d.ts +2 -0
- package/dist/components/date-range-picker/index.js +1 -0
- package/dist/components/date-time-picker/MPDateTimePicker.d.ts +78 -0
- package/dist/components/date-time-picker/MPDateTimePicker.js +1 -0
- package/dist/components/date-time-picker/index.d.ts +2 -0
- package/dist/components/date-time-picker/index.js +1 -0
- package/dist/components/dialog/MPDialog.d.ts +150 -0
- package/dist/components/dialog/MPDialog.js +1 -0
- package/dist/components/dialog/index.d.ts +2 -0
- package/dist/components/dialog/index.js +1 -0
- package/dist/components/divider/MPDivider.d.ts +80 -0
- package/dist/components/divider/MPDivider.js +1 -0
- package/dist/components/divider/index.d.ts +2 -0
- package/dist/components/divider/index.js +1 -0
- package/dist/components/drawer/MPDrawer.d.ts +168 -0
- package/dist/components/drawer/MPDrawer.js +1 -0
- package/dist/components/drawer/index.d.ts +2 -0
- package/dist/components/drawer/index.js +1 -0
- package/dist/components/empty/MPEmpty.d.ts +74 -0
- package/dist/components/empty/MPEmpty.js +1 -0
- package/dist/components/empty/index.d.ts +2 -0
- package/dist/components/empty/index.js +1 -0
- package/dist/components/file-picker/MPFilePicker.d.ts +113 -0
- package/dist/components/file-picker/MPFilePicker.js +1 -0
- package/dist/components/file-picker/index.d.ts +2 -0
- package/dist/components/file-picker/index.js +1 -0
- package/dist/components/floating-action-button/MPFloatingActionButton.d.ts +126 -0
- package/dist/components/floating-action-button/MPFloatingActionButton.js +1 -0
- package/dist/components/floating-action-button/index.d.ts +2 -0
- package/dist/components/floating-action-button/index.js +1 -0
- package/dist/components/grid/MPGrid.d.ts +155 -0
- package/dist/components/grid/MPGrid.js +1 -0
- package/dist/components/grid/index.d.ts +2 -0
- package/dist/components/grid/index.js +1 -0
- package/dist/components/highlight/MPHighlight.d.ts +95 -0
- package/dist/components/highlight/MPHighlight.js +1 -0
- package/dist/components/highlight/index.d.ts +2 -0
- package/dist/components/highlight/index.js +1 -0
- package/dist/components/icon-button/MPIconButton.d.ts +59 -0
- package/dist/components/icon-button/MPIconButton.js +1 -0
- package/dist/components/icon-button/index.d.ts +2 -0
- package/dist/components/icon-button/index.js +1 -0
- package/dist/components/list/MPList.d.ts +96 -0
- package/dist/components/list/MPList.js +1 -0
- package/dist/components/list/index.d.ts +2 -0
- package/dist/components/list/index.js +1 -0
- package/dist/components/locale/MPLocaleProvider.d.ts +63 -0
- package/dist/components/locale/MPLocaleProvider.js +1 -0
- package/dist/components/locale/index.d.ts +2 -0
- package/dist/components/locale/index.js +1 -0
- package/dist/components/menu/MPMenu.d.ts +232 -0
- package/dist/components/menu/MPMenu.js +1 -0
- package/dist/components/menu/index.d.ts +2 -0
- package/dist/components/menu/index.js +1 -0
- package/dist/components/number-field/MPNumberField.d.ts +117 -0
- package/dist/components/number-field/MPNumberField.js +1 -0
- package/dist/components/number-field/index.d.ts +2 -0
- package/dist/components/number-field/index.js +1 -0
- package/dist/components/otp-field/MPOtpField.d.ts +89 -0
- package/dist/components/otp-field/MPOtpField.js +1 -0
- package/dist/components/otp-field/index.d.ts +2 -0
- package/dist/components/otp-field/index.js +1 -0
- package/dist/components/overlay/MPOverlay.d.ts +96 -0
- package/dist/components/overlay/MPOverlay.js +1 -0
- package/dist/components/overlay/index.d.ts +2 -0
- package/dist/components/overlay/index.js +1 -0
- package/dist/components/pagination/MPPagination.d.ts +106 -0
- package/dist/components/pagination/MPPagination.js +1 -0
- package/dist/components/pagination/index.d.ts +2 -0
- package/dist/components/pagination/index.js +1 -0
- package/dist/components/panes/MPPanes.d.ts +100 -0
- package/dist/components/panes/MPPanes.js +1 -0
- package/dist/components/panes/index.d.ts +2 -0
- package/dist/components/panes/index.js +1 -0
- package/dist/components/pill/MPPill.d.ts +117 -0
- package/dist/components/pill/MPPill.js +1 -0
- package/dist/components/pill/index.d.ts +2 -0
- package/dist/components/pill/index.js +1 -0
- package/dist/components/popover/MPPopover.d.ts +143 -0
- package/dist/components/popover/MPPopover.js +1 -0
- package/dist/components/popover/index.d.ts +2 -0
- package/dist/components/popover/index.js +1 -0
- package/dist/components/progress-box/MPProgressBox.d.ts +40 -0
- package/dist/components/progress-box/MPProgressBox.js +1 -0
- package/dist/components/progress-box/index.d.ts +2 -0
- package/dist/components/progress-box/index.js +1 -0
- package/dist/components/progress-circular/MPProgressCircular.d.ts +32 -0
- package/dist/components/progress-circular/MPProgressCircular.js +1 -0
- package/dist/components/progress-circular/index.d.ts +2 -0
- package/dist/components/progress-circular/index.js +1 -0
- package/dist/components/progress-linear/MPProgressLinear.d.ts +32 -0
- package/dist/components/progress-linear/MPProgressLinear.js +1 -0
- package/dist/components/progress-linear/index.d.ts +2 -0
- package/dist/components/progress-linear/index.js +1 -0
- package/dist/components/radio-group/MPRadioGroup.d.ts +81 -0
- package/dist/components/radio-group/MPRadioGroup.js +1 -0
- package/dist/components/radio-group/index.d.ts +2 -0
- package/dist/components/radio-group/index.js +1 -0
- package/dist/components/rating/MPRating.d.ts +135 -0
- package/dist/components/rating/MPRating.js +1 -0
- package/dist/components/rating/index.d.ts +2 -0
- package/dist/components/rating/index.js +1 -0
- package/dist/components/segmented-button/MPSegmentedButton.d.ts +75 -0
- package/dist/components/segmented-button/MPSegmentedButton.js +1 -0
- package/dist/components/segmented-button/index.d.ts +2 -0
- package/dist/components/segmented-button/index.js +1 -0
- package/dist/components/select/MPSelect.d.ts +103 -0
- package/dist/components/select/MPSelect.js +1 -0
- package/dist/components/select/index.d.ts +2 -0
- package/dist/components/select/index.js +1 -0
- package/dist/components/shortcut/MPShortcut.d.ts +67 -0
- package/dist/components/shortcut/MPShortcut.js +1 -0
- package/dist/components/shortcut/index.d.ts +2 -0
- package/dist/components/shortcut/index.js +1 -0
- package/dist/components/skeleton/MPSkeleton.d.ts +76 -0
- package/dist/components/skeleton/MPSkeleton.js +1 -0
- package/dist/components/skeleton/index.d.ts +2 -0
- package/dist/components/skeleton/index.js +1 -0
- package/dist/components/slider/MPSlider.d.ts +77 -0
- package/dist/components/slider/MPSlider.js +1 -0
- package/dist/components/slider/index.d.ts +2 -0
- package/dist/components/slider/index.js +1 -0
- package/dist/components/snackbar/MPSnackbar.d.ts +175 -0
- package/dist/components/snackbar/MPSnackbar.js +1 -0
- package/dist/components/snackbar/index.d.ts +2 -0
- package/dist/components/snackbar/index.js +1 -0
- package/dist/components/spoiler/MPSpoiler.d.ts +106 -0
- package/dist/components/spoiler/MPSpoiler.js +1 -0
- package/dist/components/spoiler/index.d.ts +2 -0
- package/dist/components/spoiler/index.js +1 -0
- package/dist/components/switch/MPSwitch.d.ts +75 -0
- package/dist/components/switch/MPSwitch.js +1 -0
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/switch/index.js +1 -0
- package/dist/components/table/MPTable.d.ts +120 -0
- package/dist/components/table/MPTable.js +1 -0
- package/dist/components/table/index.d.ts +2 -0
- package/dist/components/table/index.js +1 -0
- package/dist/components/tabs/MPTabs.d.ts +145 -0
- package/dist/components/tabs/MPTabs.js +1 -0
- package/dist/components/tabs/index.d.ts +2 -0
- package/dist/components/tabs/index.js +1 -0
- package/dist/components/text-field/MPTextField.d.ts +51 -22
- package/dist/components/text-field/MPTextField.js +1 -1
- package/dist/components/text-link/MPTextLink.d.ts +88 -0
- package/dist/components/text-link/MPTextLink.js +1 -0
- package/dist/components/text-link/index.d.ts +2 -0
- package/dist/components/text-link/index.js +1 -0
- package/dist/components/time-picker/MPTimePicker.d.ts +108 -0
- package/dist/components/time-picker/MPTimePicker.js +1 -0
- package/dist/components/time-picker/index.d.ts +2 -0
- package/dist/components/time-picker/index.js +1 -0
- package/dist/components/timeline/MPTimeline.d.ts +96 -0
- package/dist/components/timeline/MPTimeline.js +1 -0
- package/dist/components/timeline/index.d.ts +2 -0
- package/dist/components/timeline/index.js +1 -0
- package/dist/components/tooltip/MPTooltip.d.ts +117 -0
- package/dist/components/tooltip/MPTooltip.js +1 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tooltip/index.js +1 -0
- package/dist/components/typography/MPTypography.d.ts +94 -0
- package/dist/components/typography/MPTypography.js +1 -0
- package/dist/components/typography/index.d.ts +2 -0
- package/dist/components/typography/index.js +1 -0
- package/dist/constants/icons.d.ts +49 -0
- package/dist/constants/icons.js +1 -1
- package/dist/index.d.ts +73 -0
- package/dist/index.js +1 -1
- package/dist/internal/Calendar.d.ts +118 -0
- package/dist/internal/Calendar.js +1 -0
- package/dist/internal/FieldOutline.d.ts +109 -0
- package/dist/internal/FieldOutline.js +1 -0
- package/dist/internal/Picker.d.ts +153 -0
- package/dist/internal/Picker.js +1 -0
- package/dist/internal/StateLayer.d.ts +45 -0
- package/dist/internal/StateLayer.js +1 -0
- package/dist/internal/SupportingText.d.ts +23 -0
- package/dist/internal/SupportingText.js +1 -0
- package/dist/internal/WidthSizer.d.ts +31 -0
- package/dist/internal/WidthSizer.js +1 -0
- package/dist/internal/accent.d.ts +39 -0
- package/dist/internal/accent.js +1 -0
- package/dist/internal/animate.d.ts +179 -0
- package/dist/internal/animate.js +1 -0
- package/dist/internal/button-group.d.ts +21 -0
- package/dist/internal/button-group.js +1 -0
- package/dist/internal/color.d.ts +125 -0
- package/dist/internal/color.js +1 -0
- package/dist/internal/date.d.ts +179 -0
- package/dist/internal/date.js +1 -0
- package/dist/internal/i18n.d.ts +241 -0
- package/dist/internal/i18n.js +1 -0
- package/dist/internal/inert.d.ts +11 -0
- package/dist/internal/inert.js +1 -0
- package/dist/internal/locale.d.ts +43 -0
- package/dist/internal/locale.js +1 -0
- package/dist/internal/menu.d.ts +23 -0
- package/dist/internal/menu.js +1 -0
- package/dist/internal/progress.d.ts +126 -0
- package/dist/internal/progress.js +1 -0
- package/dist/internal/scale.d.ts +127 -0
- package/dist/internal/scale.js +1 -0
- package/dist/internal/surface.d.ts +76 -0
- package/dist/internal/surface.js +1 -0
- package/dist/internal/visually-hidden.d.ts +23 -0
- package/dist/internal/visually-hidden.js +1 -0
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1871 -20
- package/dist/types.d.ts +262 -16
- package/package.json +16 -21
package/dist/types.d.ts
CHANGED
|
@@ -1,27 +1,157 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The prop vocabulary shared across Material Plus components.
|
|
3
3
|
*
|
|
4
|
-
* This library
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* second vocabulary would make a consumer translate between two libraries on
|
|
10
|
-
* every line, which is the thing this package exists to avoid.
|
|
4
|
+
* This library implements the Material Design specification rather than wrapping
|
|
5
|
+
* somebody's implementation of it, so the rule is: **where the spec already has a
|
|
6
|
+
* word, use the spec's word.** A colour role is `primary` or `on-surface-variant`
|
|
7
|
+
* because that is what MD3 calls it, a corner is `extra-small`, a type role is
|
|
8
|
+
* `body-large`.
|
|
11
9
|
*
|
|
12
|
-
*
|
|
10
|
+
* In particular they are *not* Material UI's words. MUI's palette is
|
|
11
|
+
* `main`/`light`/`dark`/`contrastText`, which is a different and earlier colour
|
|
12
|
+
* model; borrowing those names would describe a system this library does not
|
|
13
|
+
* implement. See `src/styles.css` for the token side of the same decision.
|
|
14
|
+
*
|
|
15
|
+
* What lives here is only what a component actually needs in its props.
|
|
13
16
|
*/
|
|
14
17
|
import type * as React from 'react';
|
|
15
18
|
/**
|
|
16
|
-
* The size ladder
|
|
19
|
+
* The size ladder every control is drawn at.
|
|
20
|
+
*
|
|
21
|
+
* **This is the one place the library goes beyond the specification, knowingly.**
|
|
22
|
+
* Material defines a single size per component — a text field is 56dp, full
|
|
23
|
+
* stop — because it is describing a design system for whole products, where one
|
|
24
|
+
* height per control is the point. A component library gets used in places a
|
|
25
|
+
* design system does not plan for: a filter bar, a table's inline editor, a
|
|
26
|
+
* dense settings page, a marketing hero. Those need a ladder, and a consumer
|
|
27
|
+
* who cannot get one from the library builds it out of `!important`.
|
|
28
|
+
*
|
|
29
|
+
* So `md` **is** the spec's size, and the other four are ours. That is the whole
|
|
30
|
+
* rule, and it is why the ladder is centred rather than starting at the spec's
|
|
31
|
+
* value: `md` is what you get by saying nothing, and nobody has to know the
|
|
32
|
+
* scale exists to be given the Material size.
|
|
33
|
+
*
|
|
34
|
+
* `xs` and `xl` are deliberately at the edges of usable rather than merely
|
|
35
|
+
* smaller and larger — below `xs` a control stops meeting a 24px touch target,
|
|
36
|
+
* and there is no sixth step because a ladder long enough to need one is a sign
|
|
37
|
+
* the caller wants a custom control instead.
|
|
38
|
+
*/
|
|
39
|
+
export type MPSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
40
|
+
/**
|
|
41
|
+
* An accent colour role.
|
|
42
|
+
*
|
|
43
|
+
* MD3's four, not Material UI's six: there is no `info`, `success` or `warning`
|
|
44
|
+
* in the specification's colour system, and offering them would promise roles the
|
|
45
|
+
* token sheet has no way to derive.
|
|
46
|
+
*/
|
|
47
|
+
export type MPColor = 'primary' | 'secondary' | 'tertiary' | 'error';
|
|
48
|
+
/**
|
|
49
|
+
* How much of a surface a component paints.
|
|
50
|
+
*
|
|
51
|
+
* These are Material's own five button styles, in the order they get louder, and
|
|
52
|
+
* the vocabulary is deliberately shared with the components that are not buttons
|
|
53
|
+
* — a `filled` segmented button and a `filled` button are the same statement
|
|
54
|
+
* about emphasis, made by two different controls.
|
|
55
|
+
*
|
|
56
|
+
* `elevated` is the odd one: it is a *tonal* surface that also casts a shadow,
|
|
57
|
+
* and MD3 keeps it separate from `filled` precisely because a raised surface and
|
|
58
|
+
* a saturated one solve the same problem two different ways. A component that has
|
|
59
|
+
* no meaningful raised state simply does not offer it.
|
|
60
|
+
*/
|
|
61
|
+
export type MPVariant = 'filled' | 'tonal' | 'elevated' | 'outlined' | 'text';
|
|
62
|
+
/** Which way a set of controls runs. */
|
|
63
|
+
export type MPOrientation = 'horizontal' | 'vertical';
|
|
64
|
+
/**
|
|
65
|
+
* Where something sits along an axis.
|
|
66
|
+
*
|
|
67
|
+
* `start` and `end` rather than `left` and `right`, for the same reason the icon
|
|
68
|
+
* slots are `startIcon` and `endIcon`: the two words that name a physical side
|
|
69
|
+
* swap meaning under RTL, and a divider whose label was pinned `left` would move
|
|
70
|
+
* to the other end of the rule in Arabic without anybody asking it to.
|
|
71
|
+
*/
|
|
72
|
+
export type MPAlign = 'start' | 'center' | 'end';
|
|
73
|
+
/**
|
|
74
|
+
* Which side of an anchor something is drawn on.
|
|
75
|
+
*
|
|
76
|
+
* These *are* physical sides, and deliberately so — this is the axis a popup
|
|
77
|
+
* travels along, and Base UI's positioner takes the same four words. A tooltip
|
|
78
|
+
* above its trigger is above it in every writing direction.
|
|
79
|
+
*/
|
|
80
|
+
export type MPSide = 'top' | 'right' | 'bottom' | 'left';
|
|
81
|
+
/**
|
|
82
|
+
* Which corner of a box something is pinned to. Logical again: a badge sits at
|
|
83
|
+
* the reading-end corner, which is the left one under RTL.
|
|
84
|
+
*/
|
|
85
|
+
export type MPCorner = 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';
|
|
86
|
+
/**
|
|
87
|
+
* Which day a week is drawn as starting on. `0` is Sunday, the way `Date`
|
|
88
|
+
* counts.
|
|
89
|
+
*
|
|
90
|
+
* `Date`'s numbering rather than a nicer set of words, and rather than CLDR's —
|
|
91
|
+
* which counts Monday as 1 through Sunday as 7. Every calendar in this library
|
|
92
|
+
* is built out of `getDay()`, so a second numbering would be a conversion at
|
|
93
|
+
* every comparison, and an off-by-one there is a week drawn one column out.
|
|
94
|
+
*
|
|
95
|
+
* Left unset, a picker asks `Intl` what the locale does: Sunday in the US and
|
|
96
|
+
* Korea, Monday across most of Europe, Saturday in much of the Middle East.
|
|
97
|
+
*/
|
|
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.
|
|
17
118
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
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.
|
|
21
127
|
*/
|
|
22
|
-
export type
|
|
23
|
-
/**
|
|
24
|
-
|
|
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>>;
|
|
138
|
+
/**
|
|
139
|
+
* The axes most components share.
|
|
140
|
+
*
|
|
141
|
+
* A component extends this and adds only what is genuinely its own, which is what
|
|
142
|
+
* keeps `size="md"` meaning the same thing on every one of them. The rule for
|
|
143
|
+
* adding to this interface is the same as the rule for adding a token: an axis
|
|
144
|
+
* arrives when a second component needs it, not in anticipation of one.
|
|
145
|
+
*/
|
|
146
|
+
export interface MPStyleProps {
|
|
147
|
+
/**
|
|
148
|
+
* The control's height and type scale.
|
|
149
|
+
* @default 'md'
|
|
150
|
+
*/
|
|
151
|
+
size?: MPSize;
|
|
152
|
+
/** Stretches the control to the width of its container. */
|
|
153
|
+
fullWidth?: boolean;
|
|
154
|
+
}
|
|
25
155
|
/**
|
|
26
156
|
* The props a glyph component is handed when Material Plus renders one.
|
|
27
157
|
*
|
|
@@ -47,7 +177,7 @@ export interface MPIconGlyphProps {
|
|
|
47
177
|
* lets `MPIcon` pass a size and a colour *into* the glyph rather than trying
|
|
48
178
|
* to style an element from the outside.
|
|
49
179
|
* - **An element** — `<MPIcon icon={<svg>…</svg>} />`. A drawing of your own, a
|
|
50
|
-
*
|
|
180
|
+
* glyph another set has already constructed, an `<img>`. It is sized by
|
|
51
181
|
* the box it is laid into.
|
|
52
182
|
*
|
|
53
183
|
* Note that this is *not* `React.ReactNode`. A component and an element are
|
|
@@ -55,3 +185,119 @@ export interface MPIconGlyphProps {
|
|
|
55
185
|
* caller passing `ICONS.close` would be told to pass `<ICONS.close />` instead.
|
|
56
186
|
*/
|
|
57
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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "material-plus-ui",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "A React component library
|
|
3
|
+
"version": "1.1.0",
|
|
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",
|
|
7
7
|
"author": "CDGet <jooy2.contact@gmail.com>",
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
"keywords": [
|
|
64
64
|
"material-plus-ui",
|
|
65
65
|
"material-plus",
|
|
66
|
-
"material-
|
|
67
|
-
"
|
|
68
|
-
"
|
|
66
|
+
"material-design",
|
|
67
|
+
"material-design-3",
|
|
68
|
+
"md3",
|
|
69
69
|
"react",
|
|
70
70
|
"reactjs",
|
|
71
71
|
"react-components",
|
|
@@ -100,48 +100,43 @@
|
|
|
100
100
|
],
|
|
101
101
|
"devDependencies": {
|
|
102
102
|
"@base-ui/react": "^1.7.0",
|
|
103
|
-
"@emotion/react": "^11.14.0",
|
|
104
|
-
"@emotion/styled": "^11.14.1",
|
|
105
103
|
"@eslint/js": "^9.39.1",
|
|
106
|
-
"@mui/material": "^9.3.0",
|
|
107
104
|
"@tailwindcss/postcss": "^4.3.3",
|
|
108
|
-
"@types/node": "^26.
|
|
105
|
+
"@types/node": "^26.2.0",
|
|
109
106
|
"@types/react": "^19.2.18",
|
|
110
107
|
"@types/react-dom": "^19.2.4",
|
|
111
|
-
"@typescript-eslint/parser": "^8.
|
|
108
|
+
"@typescript-eslint/parser": "^8.67.0",
|
|
112
109
|
"@vitejs/plugin-react": "^6.0.5",
|
|
113
110
|
"@vitest/browser": "^4.1.10",
|
|
114
111
|
"@vitest/browser-playwright": "^4.1.10",
|
|
115
112
|
"eslint": "^9.39.1",
|
|
116
113
|
"eslint-config-prettier": "^10.1.8",
|
|
117
|
-
"eslint-plugin-n": "^18.
|
|
118
|
-
"globals": "^17.
|
|
114
|
+
"eslint-plugin-n": "^18.3.0",
|
|
115
|
+
"globals": "^17.10.0",
|
|
119
116
|
"jiti": "^2.7.0",
|
|
120
117
|
"playwright": "^1.62.1",
|
|
121
|
-
"postcss": "^8.5.
|
|
118
|
+
"postcss": "^8.5.26",
|
|
122
119
|
"prettier": "^3.9.6",
|
|
123
120
|
"prettier-plugin-tailwindcss": "^0.8.1",
|
|
124
121
|
"react": "^19.2.8",
|
|
125
122
|
"react-dom": "^19.2.8",
|
|
126
123
|
"tailwindcss": "^4.3.3",
|
|
127
124
|
"terser-glob": "^1.2.1",
|
|
128
|
-
"tsx": "^4.23.
|
|
125
|
+
"tsx": "^4.23.12",
|
|
129
126
|
"typescript": "^6.0.3",
|
|
130
|
-
"typescript-eslint": "^8.
|
|
131
|
-
"vite": "^8.2.
|
|
127
|
+
"typescript-eslint": "^8.67.0",
|
|
128
|
+
"vite": "^8.2.1",
|
|
132
129
|
"vitepress": "^1.6.4",
|
|
133
130
|
"vitepress-i18n": "^1.3.5",
|
|
134
|
-
"vitepress-sidebar": "^1.
|
|
131
|
+
"vitepress-sidebar": "^1.38.0",
|
|
135
132
|
"vitest": "^4.1.10",
|
|
136
133
|
"vitest-browser-react": "^2.2.0"
|
|
137
134
|
},
|
|
138
135
|
"dependencies": {
|
|
139
|
-
"lucide-react": "^1.
|
|
136
|
+
"lucide-react": "^1.31.0"
|
|
140
137
|
},
|
|
141
138
|
"peerDependencies": {
|
|
142
|
-
"@
|
|
143
|
-
"@emotion/styled": "^11.0.0",
|
|
144
|
-
"@mui/material": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0",
|
|
139
|
+
"@base-ui/react": "^1.7.0",
|
|
145
140
|
"@types/react": "^18.0.0 || ^19.0.0",
|
|
146
141
|
"react": "^18.0.0 || ^19.0.0",
|
|
147
142
|
"react-dom": "^18.0.0 || ^19.0.0"
|