@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.
- package/CHANGELOG.md +102 -0
- package/LICENSE +202 -0
- package/NOTICE +56 -0
- package/README.md +115 -2
- package/dist/atoms/Divider/Divider.d.ts +49 -0
- package/dist/atoms/Divider/Divider.js +29 -0
- package/dist/atoms/FocusRing/FocusRing.d.ts +16 -0
- package/dist/atoms/FocusRing/FocusRing.js +16 -0
- package/dist/atoms/Group/Group.d.ts +38 -0
- package/dist/atoms/Group/Group.js +34 -0
- package/dist/atoms/Icon/Icon.d.ts +23 -0
- package/dist/atoms/Icon/Icon.js +19 -0
- package/dist/atoms/Interactive/Interactive.d.ts +98 -0
- package/dist/atoms/Interactive/Interactive.js +87 -0
- package/dist/atoms/Ripple/Ripple.d.ts +14 -0
- package/dist/atoms/Ripple/Ripple.js +63 -0
- package/dist/atoms/Shape/Shape.d.ts +24 -0
- package/dist/atoms/Shape/Shape.js +19 -0
- package/dist/atoms/Shape/shapes.d.ts +8 -0
- package/dist/atoms/Shape/shapes.js +40 -0
- package/dist/atoms/Stack/Stack.d.ts +58 -0
- package/dist/atoms/Stack/Stack.js +33 -0
- package/dist/atoms/StateLayer/StateLayer.d.ts +17 -0
- package/dist/atoms/StateLayer/StateLayer.js +17 -0
- package/dist/atoms/index.d.ts +10 -0
- package/dist/atoms/index.js +10 -0
- package/dist/fonts/roboto-flex/OFL.txt +93 -0
- package/dist/fonts/roboto-flex/roboto-flex-cyrillic-ext.woff2 +0 -0
- package/dist/fonts/roboto-flex/roboto-flex-cyrillic.woff2 +0 -0
- package/dist/fonts/roboto-flex/roboto-flex-greek.woff2 +0 -0
- package/dist/fonts/roboto-flex/roboto-flex-latin-ext.woff2 +0 -0
- package/dist/fonts/roboto-flex/roboto-flex-latin.woff2 +0 -0
- package/dist/fonts/roboto-flex/roboto-flex-vietnamese.woff2 +0 -0
- package/dist/icons/icons.d.ts +89 -0
- package/dist/icons/icons.js +186 -0
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +3 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +12 -0
- package/dist/internal/accessible-name.d.ts +17 -0
- package/dist/internal/accessible-name.js +33 -0
- package/dist/internal/anchor-position.d.ts +99 -0
- package/dist/internal/anchor-position.js +159 -0
- package/dist/internal/anchored-drag.d.ts +25 -0
- package/dist/internal/anchored-drag.js +106 -0
- package/dist/internal/dev.d.ts +2 -0
- package/dist/internal/dev.js +18 -0
- package/dist/internal/diagnostics.d.ts +46 -0
- package/dist/internal/diagnostics.js +125 -0
- package/dist/internal/group-label.d.ts +22 -0
- package/dist/internal/group-label.js +50 -0
- package/dist/internal/interactive.d.ts +28 -0
- package/dist/internal/interactive.js +18 -0
- package/dist/internal/layout-element.d.ts +21 -0
- package/dist/internal/layout-element.js +33 -0
- package/dist/internal/merge-refs.d.ts +13 -0
- package/dist/internal/merge-refs.js +35 -0
- package/dist/internal/modal-dialog.d.ts +63 -0
- package/dist/internal/modal-dialog.js +267 -0
- package/dist/internal/navigation-count.d.ts +38 -0
- package/dist/internal/navigation-count.js +60 -0
- package/dist/internal/navigation-item.d.ts +14 -0
- package/dist/internal/navigation-item.js +17 -0
- package/dist/internal/nearest-scroller.d.ts +4 -0
- package/dist/internal/nearest-scroller.js +17 -0
- package/dist/internal/open-state.d.ts +15 -0
- package/dist/internal/open-state.js +42 -0
- package/dist/internal/roving-focus.d.ts +41 -0
- package/dist/internal/roving-focus.js +126 -0
- package/dist/internal/settle-animations.d.ts +33 -0
- package/dist/internal/settle-animations.js +48 -0
- package/dist/internal/time-period.d.ts +10 -0
- package/dist/internal/time-period.js +26 -0
- package/dist/internal/time.d.ts +23 -0
- package/dist/internal/time.js +69 -0
- package/dist/internal/typeahead.d.ts +17 -0
- package/dist/internal/typeahead.js +35 -0
- package/dist/molecules/Badge/Badge.d.ts +25 -0
- package/dist/molecules/Badge/Badge.js +16 -0
- package/dist/molecules/Button/Button.d.ts +48 -0
- package/dist/molecules/Button/Button.js +34 -0
- package/dist/molecules/Card/Card.d.ts +159 -0
- package/dist/molecules/Card/Card.js +119 -0
- package/dist/molecules/Checkbox/Checkbox.d.ts +26 -0
- package/dist/molecules/Checkbox/Checkbox.js +40 -0
- package/dist/molecules/Chip/AssistChip.d.ts +23 -0
- package/dist/molecules/Chip/AssistChip.js +22 -0
- package/dist/molecules/Chip/ChipGroup.d.ts +85 -0
- package/dist/molecules/Chip/ChipGroup.js +92 -0
- package/dist/molecules/Chip/FilterChip.d.ts +33 -0
- package/dist/molecules/Chip/FilterChip.js +30 -0
- package/dist/molecules/Chip/InputChip.d.ts +60 -0
- package/dist/molecules/Chip/InputChip.js +107 -0
- package/dist/molecules/Chip/SuggestionChip.d.ts +24 -0
- package/dist/molecules/Chip/SuggestionChip.js +17 -0
- package/dist/molecules/Chip/chip-content.d.ts +39 -0
- package/dist/molecules/Chip/chip-content.js +95 -0
- package/dist/molecules/Chip/chip-element.d.ts +14 -0
- package/dist/molecules/Chip/chip-element.js +14 -0
- package/dist/molecules/Chip/strings.d.ts +8 -0
- package/dist/molecules/Chip/strings.js +5 -0
- package/dist/molecules/Fab/Fab.d.ts +78 -0
- package/dist/molecules/Fab/Fab.js +52 -0
- package/dist/molecules/IconButton/IconButton.d.ts +59 -0
- package/dist/molecules/IconButton/IconButton.js +36 -0
- package/dist/molecules/LoadingIndicator/LoadingIndicator.d.ts +38 -0
- package/dist/molecules/LoadingIndicator/LoadingIndicator.js +25 -0
- package/dist/molecules/LoadingIndicator/determinate.d.ts +3 -0
- package/dist/molecules/LoadingIndicator/determinate.js +47 -0
- package/dist/molecules/LoadingIndicator/loading-indicator-data.d.ts +21 -0
- package/dist/molecules/LoadingIndicator/loading-indicator-data.js +72 -0
- package/dist/molecules/ProgressIndicator/CircularProgressIndicator.d.ts +35 -0
- package/dist/molecules/ProgressIndicator/CircularProgressIndicator.js +30 -0
- package/dist/molecules/ProgressIndicator/LinearProgressIndicator.d.ts +43 -0
- package/dist/molecules/ProgressIndicator/LinearProgressIndicator.js +28 -0
- package/dist/molecules/ProgressIndicator/circular-wavy-data.d.ts +5 -0
- package/dist/molecules/ProgressIndicator/circular-wavy-data.js +19 -0
- package/dist/molecules/ProgressIndicator/progress.d.ts +24 -0
- package/dist/molecules/ProgressIndicator/progress.js +60 -0
- package/dist/molecules/RadioButton/RadioButton.d.ts +27 -0
- package/dist/molecules/RadioButton/RadioButton.js +70 -0
- package/dist/molecules/RadioButton/RadioGroup.d.ts +73 -0
- package/dist/molecules/RadioButton/RadioGroup.js +82 -0
- package/dist/molecules/ScrollField/ScrollField.d.ts +61 -0
- package/dist/molecules/ScrollField/ScrollField.js +352 -0
- package/dist/molecules/Slider/RangeSlider.d.ts +60 -0
- package/dist/molecules/Slider/RangeSlider.js +169 -0
- package/dist/molecules/Slider/Slider.d.ts +54 -0
- package/dist/molecules/Slider/Slider.js +71 -0
- package/dist/molecules/Slider/slider-shared.d.ts +26 -0
- package/dist/molecules/Slider/slider-shared.js +98 -0
- package/dist/molecules/Switch/Switch.d.ts +22 -0
- package/dist/molecules/Switch/Switch.js +20 -0
- package/dist/molecules/TextField/TextField.d.ts +83 -0
- package/dist/molecules/TextField/TextField.js +146 -0
- package/dist/molecules/TextField/TextFieldSlots.d.ts +22 -0
- package/dist/molecules/TextField/TextFieldSlots.js +24 -0
- package/dist/molecules/TimeInput/TimeInput.d.ts +108 -0
- package/dist/molecules/TimeInput/TimeInput.js +347 -0
- package/dist/molecules/TimeInput/strings.d.ts +13 -0
- package/dist/molecules/TimeInput/strings.js +10 -0
- package/dist/molecules/TimeScroll/TimeScroll.d.ts +106 -0
- package/dist/molecules/TimeScroll/TimeScroll.js +213 -0
- package/dist/molecules/TimeScroll/strings.d.ts +13 -0
- package/dist/molecules/TimeScroll/strings.js +12 -0
- package/dist/molecules/index.d.ts +27 -0
- package/dist/molecules/index.js +25 -0
- package/dist/organisms/BottomSheet/BottomSheet.d.ts +128 -0
- package/dist/organisms/BottomSheet/BottomSheet.js +432 -0
- package/dist/organisms/BottomSheet/BottomSheetSlots.d.ts +17 -0
- package/dist/organisms/BottomSheet/BottomSheetSlots.js +16 -0
- package/dist/organisms/BottomSheet/StandardBottomSheet.d.ts +37 -0
- package/dist/organisms/BottomSheet/StandardBottomSheet.js +206 -0
- package/dist/organisms/BottomSheet/bottom-sheet-context.d.ts +31 -0
- package/dist/organisms/BottomSheet/bottom-sheet-context.js +12 -0
- package/dist/organisms/BottomSheet/sheet-drag.d.ts +1 -0
- package/dist/organisms/BottomSheet/sheet-drag.js +4 -0
- package/dist/organisms/BottomSheet/strings.d.ts +9 -0
- package/dist/organisms/BottomSheet/strings.js +8 -0
- package/dist/organisms/ButtonGroup/ButtonGroup.d.ts +97 -0
- package/dist/organisms/ButtonGroup/ButtonGroup.js +242 -0
- package/dist/organisms/ButtonGroup/ButtonGroupItem.d.ts +36 -0
- package/dist/organisms/ButtonGroup/ButtonGroupItem.js +47 -0
- package/dist/organisms/Dialog/Dialog.d.ts +186 -0
- package/dist/organisms/Dialog/Dialog.js +193 -0
- package/dist/organisms/Dialog/DialogSlots.d.ts +60 -0
- package/dist/organisms/Dialog/DialogSlots.js +54 -0
- package/dist/organisms/Dialog/strings.d.ts +5 -0
- package/dist/organisms/Dialog/strings.js +5 -0
- package/dist/organisms/FabMenu/FabMenu.d.ts +104 -0
- package/dist/organisms/FabMenu/FabMenu.js +142 -0
- package/dist/organisms/FabMenu/strings.d.ts +9 -0
- package/dist/organisms/FabMenu/strings.js +5 -0
- package/dist/organisms/List/List.d.ts +190 -0
- package/dist/organisms/List/List.js +148 -0
- package/dist/organisms/Menu/Menu.d.ts +313 -0
- package/dist/organisms/Menu/Menu.js +865 -0
- package/dist/organisms/Menu/MenuSlots.d.ts +35 -0
- package/dist/organisms/Menu/MenuSlots.js +36 -0
- package/dist/organisms/NavigationBar/NavigationBar.d.ts +96 -0
- package/dist/organisms/NavigationBar/NavigationBar.js +77 -0
- package/dist/organisms/NavigationRail/ModalNavigationRail.d.ts +105 -0
- package/dist/organisms/NavigationRail/ModalNavigationRail.js +272 -0
- package/dist/organisms/NavigationRail/NavigationRail.d.ts +148 -0
- package/dist/organisms/NavigationRail/NavigationRail.js +114 -0
- package/dist/organisms/NavigationRail/NavigationRailSection.d.ts +54 -0
- package/dist/organisms/NavigationRail/NavigationRailSection.js +96 -0
- package/dist/organisms/NavigationRail/strings.d.ts +7 -0
- package/dist/organisms/NavigationRail/strings.js +7 -0
- package/dist/organisms/NavigationSuite/NavigationSuite.d.ts +109 -0
- package/dist/organisms/NavigationSuite/NavigationSuite.js +86 -0
- package/dist/organisms/PaneScaffold/PaneScaffold.d.ts +118 -0
- package/dist/organisms/PaneScaffold/PaneScaffold.js +132 -0
- package/dist/organisms/Search/Search.d.ts +213 -0
- package/dist/organisms/Search/Search.js +783 -0
- package/dist/organisms/Search/SearchSlots.d.ts +18 -0
- package/dist/organisms/Search/SearchSlots.js +19 -0
- package/dist/organisms/Search/strings.d.ts +21 -0
- package/dist/organisms/Search/strings.js +12 -0
- package/dist/organisms/Select/Select.d.ts +186 -0
- package/dist/organisms/Select/Select.js +597 -0
- package/dist/organisms/Select/SelectSlots.d.ts +12 -0
- package/dist/organisms/Select/SelectSlots.js +12 -0
- package/dist/organisms/SideSheet/SideSheet.d.ts +88 -0
- package/dist/organisms/SideSheet/SideSheet.js +109 -0
- package/dist/organisms/SideSheet/SideSheetSlots.d.ts +35 -0
- package/dist/organisms/SideSheet/SideSheetSlots.js +37 -0
- package/dist/organisms/SideSheet/strings.d.ts +7 -0
- package/dist/organisms/SideSheet/strings.js +6 -0
- package/dist/organisms/Snackbar/Snackbar.d.ts +46 -0
- package/dist/organisms/Snackbar/Snackbar.js +36 -0
- package/dist/organisms/Snackbar/SnackbarHost.d.ts +57 -0
- package/dist/organisms/Snackbar/SnackbarHost.js +221 -0
- package/dist/organisms/Snackbar/snackbar-queue.d.ts +81 -0
- package/dist/organisms/Snackbar/snackbar-queue.js +114 -0
- package/dist/organisms/Snackbar/strings.d.ts +8 -0
- package/dist/organisms/Snackbar/strings.js +5 -0
- package/dist/organisms/SplitButton/SplitButton.d.ts +73 -0
- package/dist/organisms/SplitButton/SplitButton.js +77 -0
- package/dist/organisms/SplitButton/strings.d.ts +9 -0
- package/dist/organisms/SplitButton/strings.js +5 -0
- package/dist/organisms/Tabs/TabLink.d.ts +27 -0
- package/dist/organisms/Tabs/TabLink.js +25 -0
- package/dist/organisms/Tabs/TabNav.d.ts +19 -0
- package/dist/organisms/Tabs/TabNav.js +55 -0
- package/dist/organisms/Tabs/Tabs.d.ts +147 -0
- package/dist/organisms/Tabs/Tabs.js +223 -0
- package/dist/organisms/Tabs/tab-content.d.ts +23 -0
- package/dist/organisms/Tabs/tab-content.js +105 -0
- package/dist/organisms/Tabs/tab-fit.d.ts +4 -0
- package/dist/organisms/Tabs/tab-fit.js +65 -0
- package/dist/organisms/Tabs/tab-motion.d.ts +2 -0
- package/dist/organisms/Tabs/tab-motion.js +68 -0
- package/dist/organisms/TimePickerDialog/TimePickerDialog.d.ts +26 -0
- package/dist/organisms/TimePickerDialog/TimePickerDialog.js +34 -0
- package/dist/organisms/Toolbar/Toolbar.d.ts +75 -0
- package/dist/organisms/Toolbar/Toolbar.js +84 -0
- package/dist/organisms/Toolbar/ToolbarLayout.d.ts +44 -0
- package/dist/organisms/Toolbar/ToolbarLayout.js +90 -0
- package/dist/organisms/Toolbar/ToolbarScroll.d.ts +8 -0
- package/dist/organisms/Toolbar/ToolbarScroll.js +222 -0
- package/dist/organisms/Tooltip/RichTooltip.d.ts +73 -0
- package/dist/organisms/Tooltip/RichTooltip.js +250 -0
- package/dist/organisms/Tooltip/Tooltip.d.ts +52 -0
- package/dist/organisms/Tooltip/Tooltip.js +99 -0
- package/dist/organisms/Tooltip/tooltip-behavior.d.ts +43 -0
- package/dist/organisms/Tooltip/tooltip-behavior.js +307 -0
- package/dist/organisms/TopAppBar/TopAppBar.d.ts +107 -0
- package/dist/organisms/TopAppBar/TopAppBar.js +78 -0
- package/dist/organisms/TopAppBar/TopAppBarScroll.d.ts +7 -0
- package/dist/organisms/TopAppBar/TopAppBarScroll.js +155 -0
- package/dist/organisms/index.d.ts +36 -0
- package/dist/organisms/index.js +36 -0
- package/dist/palettes/blue.css +275 -0
- package/dist/palettes/green.css +275 -0
- package/dist/palettes/index.css +823 -0
- package/dist/palettes/orange.css +275 -0
- package/dist/shapes.css +115 -0
- package/dist/strings/index.d.ts +35 -0
- package/dist/strings/index.js +39 -0
- package/dist/styles-no-fonts.css +12025 -0
- package/dist/styles.css +12123 -0
- package/dist/stylesheet.d.ts +2 -0
- package/dist/tokens/breakpoints.d.ts +33 -0
- package/dist/tokens/breakpoints.js +31 -0
- package/dist/tokens/space.d.ts +26 -0
- package/dist/tokens/space.js +26 -0
- package/package.json +110 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@matekit/react` are documented in this file. The format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses
|
|
5
|
+
[Semantic Versioning](https://semver.org/) (while in 0.x, a minor version may contain breaking
|
|
6
|
+
changes, always listed here).
|
|
7
|
+
|
|
8
|
+
## [0.1.1] - Unreleased
|
|
9
|
+
|
|
10
|
+
Fixes for four problems found by building an app with 0.1.0 and testing it on a phone. No API changes.
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **`Search`: focus order.** `SearchBar` now renders its parts in the order they are seen: start
|
|
15
|
+
(`SearchBarLeading`), the input, the clear button, end (`SearchBarTrailing`). Before, both parts came
|
|
16
|
+
before the `<input>` in the DOM, so Tab and screen readers reached a button in `SearchBarTrailing`
|
|
17
|
+
(an account avatar, a voice button) before the field (WCAG 2.4.3). The order no longer depends on how
|
|
18
|
+
you write the parts, also in server-rendered HTML. Parts must be direct children of `SearchBar` (or
|
|
19
|
+
inside a fragment); a part wrapped in a component of your own keeps the 0.1.0 order.
|
|
20
|
+
- **`PaneScaffold`: no empty column with a single pane.** From 840 px wide, a `variant="supporting"`
|
|
21
|
+
scaffold with only `<Pane name="main">`, or a `list-detail` scaffold with only one pane, reserved the
|
|
22
|
+
missing pane's column (360 px, or 412 px from 1200 px) and left it empty. Only the panes that exist take
|
|
23
|
+
room now: a single pane fills the width, and the detail (or main) pane with the extra one and no list
|
|
24
|
+
(or supporting) pane shows those two. If you overrode the scaffold's private grid variable to work
|
|
25
|
+
around this, remove that override.
|
|
26
|
+
- **`PaneScaffold`: a visible `main` landmark on phones.** The documented recipe (`render={<main />}` on
|
|
27
|
+
the detail pane) left a phone showing the list with no visible `main` landmark, because the hidden
|
|
28
|
+
detail is out of the accessibility tree. The recipe is now: make each pane a named `<section>` with
|
|
29
|
+
`render`, and set `role="main"` on the pane that is the scaffold's `pane`
|
|
30
|
+
(`role={pane === 'list' ? 'main' : undefined}`). There is always exactly one visible `main`, and the
|
|
31
|
+
`NavigationSuite` stays outside it. Change the `role`, not the `render` element, so the pane keeps its
|
|
32
|
+
state and scroll position. Updated in the `PaneScaffold` and `Pane` JSDoc and the documentation site.
|
|
33
|
+
- **`Search`: full screen on a phone in landscape.** `view="auto"` chose only by the window width, so a
|
|
34
|
+
phone in landscape (about 844 × 390) got the docked list, and with the on-screen keyboard open it was
|
|
35
|
+
left a thin strip. It now goes full screen in a short window too (under 480 px tall), the same rule as
|
|
36
|
+
`Dialog view="auto"` and `NavigationSuite`.
|
|
37
|
+
|
|
38
|
+
## [0.1.0] - 2026-11-30
|
|
39
|
+
|
|
40
|
+
First public release: React 19 components for Material 3 Expressive, as an ESM package with
|
|
41
|
+
TypeScript declarations, plain CSS and a self-hosted font.
|
|
42
|
+
|
|
43
|
+
### Foundations
|
|
44
|
+
|
|
45
|
+
- Design tokens as CSS custom properties: color (light and dark with `light-dark()`), typography,
|
|
46
|
+
shape, elevation, state layers, spring motion and spacing (`--md-sys-*`), inside `@layer matekit.*`.
|
|
47
|
+
- Optional palettes (green, blue, orange) and three contrast levels (standard, medium, high), selected
|
|
48
|
+
with `data-palette`, `data-contrast` and `data-theme` on any element.
|
|
49
|
+
- Roboto Flex hosted in the package (six variable subsets) with a metric-adjusted fallback;
|
|
50
|
+
`styles-no-fonts.css` for apps that use another typeface.
|
|
51
|
+
- Layout primitives: `Stack` and `Group` (connected blocks with per-position corners), `Divider`.
|
|
52
|
+
- `Interactive`, the public link/button/`render` primitive, and the `StateLayer`, `FocusRing` and
|
|
53
|
+
`Ripple` atoms for building your own controls.
|
|
54
|
+
- `Icon` and 36 Material Symbols icon components, with automatic grade -25 in dark theme.
|
|
55
|
+
- `Shape` with the 35 Expressive decorative shapes (optional `shapes.css`).
|
|
56
|
+
- `SPACE`, `WINDOW_WIDTH` and `WINDOW_HEIGHT` constants.
|
|
57
|
+
|
|
58
|
+
### Actions
|
|
59
|
+
|
|
60
|
+
- `Button` (five variants, sizes XS–XL, toggle, shape morphing), `IconButton`, `Fab` and `ExtendedFab`.
|
|
61
|
+
- `ButtonGroup` (standard and connected), `SplitButton` and `FabMenu`.
|
|
62
|
+
- `Menu` with groups, section labels, supporting text and submenus; `Toolbar` (docked and floating)
|
|
63
|
+
and `ToolbarLayout`.
|
|
64
|
+
|
|
65
|
+
### Inputs
|
|
66
|
+
|
|
67
|
+
- `TextField` (filled and outlined, multiline), `Select`, `Checkbox`, `RadioGroup` and
|
|
68
|
+
`RadioButton`, `Switch`, `Slider` and `RangeSlider`.
|
|
69
|
+
- Chips: `AssistChip`, `FilterChip`, `InputChip`, `SuggestionChip` and `ChipGroup`.
|
|
70
|
+
- Time pickers: `TimeInput` (keyboard entry), `TimeScroll` (wheel, on the generic `ScrollField`) and
|
|
71
|
+
`TimePickerDialog`.
|
|
72
|
+
|
|
73
|
+
### Navigation
|
|
74
|
+
|
|
75
|
+
- `NavigationBar`, `NavigationRail` (collapsed, expanded, sections), `ModalNavigationRail` and
|
|
76
|
+
`NavigationSuite`, which switches between bar and rail by window size.
|
|
77
|
+
- `Tabs` (primary and secondary, fixed and scrollable) and `TabNav`/`TabLink` for page navigation.
|
|
78
|
+
- `TopAppBar` (small, medium and large flexible, scroll-driven color and collapse) and `Search`
|
|
79
|
+
(search bar and docked or full-screen search view).
|
|
80
|
+
|
|
81
|
+
### Containment
|
|
82
|
+
|
|
83
|
+
- `Card`, `List` (content, actions, selection and accordion), `Dialog` (basic and full-screen),
|
|
84
|
+
`BottomSheet` (modal and standard), `SideSheet` and `PaneScaffold` (list-detail and supporting
|
|
85
|
+
pane layouts).
|
|
86
|
+
|
|
87
|
+
### Feedback
|
|
88
|
+
|
|
89
|
+
- `Snackbar` with `createSnackbarQueue` and `SnackbarHost`, `Tooltip` and `RichTooltip`, `Badge`,
|
|
90
|
+
`LoadingIndicator`, `LinearProgressIndicator` and `CircularProgressIndicator` (flat and wavy).
|
|
91
|
+
|
|
92
|
+
### Platform
|
|
93
|
+
|
|
94
|
+
- Universal components (no `'use client'`) render in React Server Components; interactive ones are
|
|
95
|
+
marked `'use client'` per module.
|
|
96
|
+
- Every built-in text has a prop to change it; `defaultStrings` and `MatekitStrings` to translate them
|
|
97
|
+
all.
|
|
98
|
+
- Diagnostics with stable codes: `MatekitError` and the `MatekitErrorCode`/`MatekitWarningCode` types;
|
|
99
|
+
development warnings are removed in production builds.
|
|
100
|
+
|
|
101
|
+
[0.1.1]: https://github.com/jrodrigopuca/matekit/compare/v0.1.0...v0.1.1
|
|
102
|
+
[0.1.0]: https://github.com/jrodrigopuca/matekit/releases/tag/v0.1.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
matekit (@matekit/react)
|
|
2
|
+
Copyright 2026 The matekit Authors
|
|
3
|
+
|
|
4
|
+
This product is licensed under the Apache License, Version 2.0 (see LICENSE).
|
|
5
|
+
|
|
6
|
+
This product includes third-party content, listed below with its license.
|
|
7
|
+
|
|
8
|
+
--------------------------------------------------------------------------------
|
|
9
|
+
Roboto Flex (font)
|
|
10
|
+
--------------------------------------------------------------------------------
|
|
11
|
+
Files: dist/fonts/roboto-flex/*.woff2
|
|
12
|
+
Copyright 2017 The Roboto Flex Project Authors (https://github.com/TypeNetwork/Roboto-Flex)
|
|
13
|
+
Licensed under the SIL Open Font License, Version 1.1; the full license is
|
|
14
|
+
shipped next to the fonts in dist/fonts/roboto-flex/OFL.txt.
|
|
15
|
+
Version 3.200, as served by Google Fonts (v31): six variable subsets (latin,
|
|
16
|
+
latin-ext, cyrillic, cyrillic-ext, greek, vietnamese) with the opsz, wght and
|
|
17
|
+
GRAD axes, unmodified.
|
|
18
|
+
|
|
19
|
+
--------------------------------------------------------------------------------
|
|
20
|
+
Material Symbols (icon outlines)
|
|
21
|
+
--------------------------------------------------------------------------------
|
|
22
|
+
Files: the SVG path data of the icon components (dist/icons/icons.js)
|
|
23
|
+
Copyright Google LLC
|
|
24
|
+
Licensed under the Apache License, Version 2.0.
|
|
25
|
+
Source: https://github.com/google/material-design-icons, commit 10ecc1479061,
|
|
26
|
+
symbols/web/*/materialsymbolsoutlined (Outlined style, weight 400, optical
|
|
27
|
+
size 24, grades 0 and -25, unfilled and filled).
|
|
28
|
+
|
|
29
|
+
--------------------------------------------------------------------------------
|
|
30
|
+
Android Open Source Project: Jetpack Compose and androidx.graphics.shapes
|
|
31
|
+
--------------------------------------------------------------------------------
|
|
32
|
+
Copyright The Android Open Source Project
|
|
33
|
+
Licensed under the Apache License, Version 2.0.
|
|
34
|
+
Source: https://github.com/androidx/androidx
|
|
35
|
+
|
|
36
|
+
Portions of this product are derived from AndroidX source code, ported to
|
|
37
|
+
TypeScript or generated with such ports:
|
|
38
|
+
|
|
39
|
+
- The outlines of the 35 Material 3 Expressive decorative shapes
|
|
40
|
+
(dist/atoms/Shape/shapes.js and dist/shapes.css), the LoadingIndicator
|
|
41
|
+
animation frames (dist/molecules/LoadingIndicator/loading-indicator-data.js)
|
|
42
|
+
and the wavy circular progress outlines
|
|
43
|
+
(dist/molecules/ProgressIndicator/circular-wavy-data.js), generated from
|
|
44
|
+
ports of androidx.graphics.shapes (RoundedPolygon, Morph), MaterialShapes.kt,
|
|
45
|
+
LoadingIndicator.kt and CircularWavyProgressModifiers.kt
|
|
46
|
+
(compose/material3, graphics/graphics-shapes).
|
|
47
|
+
- The release decision of anchored drags (dist/internal/anchored-drag.js),
|
|
48
|
+
ported from AnchoredDraggable.kt, SheetDefaults.kt and VelocityTracker.kt.
|
|
49
|
+
- Measurement and motion logic adapted from Compose Material 3: the
|
|
50
|
+
ButtonGroup pressed-width policy (ButtonGroup.kt), the FAB menu stagger
|
|
51
|
+
(FloatingActionButtonMenu.kt) and the progress indicator geometry and timing
|
|
52
|
+
(WavyProgressIndicator.kt, ProgressIndicator.kt and their tokens).
|
|
53
|
+
|
|
54
|
+
Design token values (color, typography, shape, elevation, motion, spacing)
|
|
55
|
+
follow the Material 3 specification, Material 3 Design Kit and the Compose
|
|
56
|
+
Material 3 token files (androidx/androidx, compose/material3).
|
package/README.md
CHANGED
|
@@ -1,3 +1,116 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @matekit/react
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
React components for **Material 3 Expressive**, the current version of Google's design system:
|
|
4
|
+
accessible, themeable with plain CSS, and ready for React Server Components.
|
|
5
|
+
|
|
6
|
+
- **Faithful to the spec.** Measurements, colors and motion come from the official Material 3 Design
|
|
7
|
+
Kit and Jetpack Compose, including Expressive shapes, sizes and spring motion.
|
|
8
|
+
- **Native elements first.** `<button>`, `<input>`, `<dialog>` and the Popover API, with WAI-ARIA APG
|
|
9
|
+
keyboard behavior. Tested with axe and custom contrast checks in Chrome, Firefox and Safari (WebKit).
|
|
10
|
+
- **Server Components ready.** Components without state or events are universal and render on the
|
|
11
|
+
server with no JavaScript; interactive ones are marked `'use client'`.
|
|
12
|
+
- **Themes in CSS.** Light and dark, optional palettes and three contrast levels, all as CSS custom
|
|
13
|
+
properties inside `@layer`, so your own styles always win.
|
|
14
|
+
- **No runtime dependencies.** Only React 19 as a peer.
|
|
15
|
+
|
|
16
|
+
Documentation, live examples and the full API: **https://jrodrigopuca.github.io/matekit/**
|
|
17
|
+
|
|
18
|
+
> **Status:** 0.x. The API can still change between minor versions; see [CHANGELOG.md](CHANGELOG.md).
|
|
19
|
+
|
|
20
|
+
## Install
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
pnpm add @matekit/react
|
|
24
|
+
# or: npm install @matekit/react
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Requires `react` and `react-dom` 19.
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
Import the stylesheet once, at the root of your app:
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
import '@matekit/react/styles.css'
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Then use the components:
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
import { Button, AddIcon, TextField, TextFieldLabel, TextFieldInput } from '@matekit/react'
|
|
41
|
+
|
|
42
|
+
export function CreateForm() {
|
|
43
|
+
return (
|
|
44
|
+
<form>
|
|
45
|
+
<TextField>
|
|
46
|
+
<TextFieldLabel>Name</TextFieldLabel>
|
|
47
|
+
<TextFieldInput name="name" />
|
|
48
|
+
</TextField>
|
|
49
|
+
<Button type="submit">
|
|
50
|
+
<AddIcon />
|
|
51
|
+
Create
|
|
52
|
+
</Button>
|
|
53
|
+
</form>
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Components with several pieces are composed from flat-named parts (`DialogHeadline`,
|
|
59
|
+
`TextFieldLabel`) instead of content props.
|
|
60
|
+
|
|
61
|
+
### Stylesheets
|
|
62
|
+
|
|
63
|
+
| Import | What it contains |
|
|
64
|
+
|---|---|
|
|
65
|
+
| `@matekit/react/styles.css` | Tokens, every component and the Roboto Flex font (required, or the next one) |
|
|
66
|
+
| `@matekit/react/styles-no-fonts.css` | The same without the font, for apps that set another typeface |
|
|
67
|
+
| `@matekit/react/palettes/<name>.css` | Optional palette: `green`, `blue`, `orange`, or `index` for all of them |
|
|
68
|
+
| `@matekit/react/shapes.css` | Optional: the 35 Expressive shapes used by the `Shape` component |
|
|
69
|
+
|
|
70
|
+
The stylesheets are plain CSS. Any bundler that handles CSS imports works (Vite, webpack, Next.js,
|
|
71
|
+
Parcel…); without a bundler, link `node_modules/@matekit/react/dist/styles.css` and keep the
|
|
72
|
+
`dist/fonts/` folder next to it. The font is hosted in the package: no requests to third parties.
|
|
73
|
+
|
|
74
|
+
### Theme, palette and contrast
|
|
75
|
+
|
|
76
|
+
Set attributes on `<html>` or on any element; everything inside follows:
|
|
77
|
+
|
|
78
|
+
```html
|
|
79
|
+
<html data-theme="dark" data-palette="green" data-contrast="medium">
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
- `data-theme="light" | "dark"`: without it, the system preference applies.
|
|
83
|
+
- `data-palette`: needs the matching palette stylesheet.
|
|
84
|
+
- `data-contrast="standard" | "medium" | "high"`: without it, `prefers-contrast: more` selects high.
|
|
85
|
+
|
|
86
|
+
To use another font, set `--md-ref-typeface-brand` and `--md-ref-typeface-plain` and import
|
|
87
|
+
`styles-no-fonts.css` instead of `styles.css`.
|
|
88
|
+
|
|
89
|
+
## Server Components and SSR
|
|
90
|
+
|
|
91
|
+
The package is ESM, compiled file by file, so each module keeps its own directive:
|
|
92
|
+
|
|
93
|
+
- **Universal** components (Button, Card, List, NavigationBar, TopAppBar, the icons…) have no
|
|
94
|
+
`'use client'`. Imported from a Server Component they render on the server and ship no JavaScript.
|
|
95
|
+
- **Client** components (Dialog, Menu, TextField, Tabs, Select…) start with `'use client'`, so a
|
|
96
|
+
Server Component can still render them and pass them props and children.
|
|
97
|
+
|
|
98
|
+
Each component page in the documentation says which one it is.
|
|
99
|
+
|
|
100
|
+
Development warnings read `process.env.NODE_ENV`, which your bundler replaces as it does for React;
|
|
101
|
+
in a production build they are removed.
|
|
102
|
+
|
|
103
|
+
## Browser support
|
|
104
|
+
|
|
105
|
+
matekit relies on modern platform features (`light-dark()`, the Popover API, `<dialog>`, CSS anchor
|
|
106
|
+
positioning with a JavaScript fallback, `@starting-style`). It targets current versions of Chrome,
|
|
107
|
+
Edge, Firefox and Safari, and its tests run on the three engines.
|
|
108
|
+
|
|
109
|
+
## License
|
|
110
|
+
|
|
111
|
+
[Apache-2.0](LICENSE). The package includes third-party content: the Roboto Flex font (SIL Open Font
|
|
112
|
+
License 1.1, shipped in `dist/fonts/roboto-flex/OFL.txt`), Material Symbols icon outlines
|
|
113
|
+
(Apache-2.0) and code ported from AndroidX (Apache-2.0). See [NOTICE](NOTICE).
|
|
114
|
+
|
|
115
|
+
matekit is an independent project, not affiliated with or endorsed by Google. Material Design is a
|
|
116
|
+
design system by Google.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { HTMLAttributes, Ref } from 'react';
|
|
2
|
+
export type DividerOrientation = 'horizontal' | 'vertical';
|
|
3
|
+
/** `start`: inset at the start (the kit's Inset). `both`: on both sides (Middle-inset). */
|
|
4
|
+
export type DividerInset = 'start' | 'both';
|
|
5
|
+
export interface DividerProps extends HTMLAttributes<HTMLHRElement> {
|
|
6
|
+
ref?: Ref<HTMLHRElement> | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Horizontal, or vertical (stretches to the height of a flex or grid container). Defaults to
|
|
9
|
+
* `horizontal`.
|
|
10
|
+
*/
|
|
11
|
+
orientation?: DividerOrientation | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* 16 px inset (`--mk-divider-inset`): at the start of the line (left, or right in RTL; top in
|
|
14
|
+
* the vertical one) or on both sides. When undefined, it spans the full length.
|
|
15
|
+
*/
|
|
16
|
+
inset?: DividerInset | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Hides the divider from screen readers. Use it when the line only accompanies a separation
|
|
19
|
+
* that is already clear in another way (a section heading, a card's edge); without it, it is
|
|
20
|
+
* announced as a separator (`<hr>`, `role="separator"`).
|
|
21
|
+
*/
|
|
22
|
+
decorative?: boolean | undefined;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Divider: a 1 px line in `outline-variant` on an `<hr>` (role `separator`).
|
|
26
|
+
*
|
|
27
|
+
* ```tsx
|
|
28
|
+
* <Divider />
|
|
29
|
+
* <Divider inset="start" />
|
|
30
|
+
* <div style={{ display: 'flex' }}>…<Divider orientation="vertical" />…</div>
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function Divider({ orientation, inset, decorative, className, ...props }: DividerProps): import("react").JSX.Element;
|
|
34
|
+
export interface DividerSubheadProps extends HTMLAttributes<HTMLDivElement> {
|
|
35
|
+
ref?: Ref<HTMLDivElement> | undefined;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Divider with subhead (the kit's "Divider with subhead"): the line and, below it, the heading
|
|
39
|
+
* of the section that starts, in Title Small and `on-surface-variant`, with 16 px on both sides.
|
|
40
|
+
*
|
|
41
|
+
* The heading is the child, and you choose its element (`<h2>`…`<h6>` by its level on the page)
|
|
42
|
+
* so the section shows up in heading navigation. The line is decorative: the heading already
|
|
43
|
+
* marks where the section starts, and announcing a separator too would repeat it.
|
|
44
|
+
*
|
|
45
|
+
* ```tsx
|
|
46
|
+
* <DividerSubhead><h3>Recent</h3></DividerSubhead>
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare function DividerSubhead({ className, children, ...props }: DividerSubheadProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
const cx = (base, extra) => (extra ? `${base} ${extra}` : base);
|
|
3
|
+
/**
|
|
4
|
+
* Divider: a 1 px line in `outline-variant` on an `<hr>` (role `separator`).
|
|
5
|
+
*
|
|
6
|
+
* ```tsx
|
|
7
|
+
* <Divider />
|
|
8
|
+
* <Divider inset="start" />
|
|
9
|
+
* <div style={{ display: 'flex' }}>…<Divider orientation="vertical" />…</div>
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
export function Divider({ orientation = 'horizontal', inset, decorative, className, ...props }) {
|
|
13
|
+
return (_jsx("hr", { ...(orientation === 'vertical' ? { 'aria-orientation': 'vertical' } : {}), ...(decorative ? { 'aria-hidden': true } : {}), ...(inset ? { 'data-inset': inset } : {}), ...props, className: cx('mk-divider', className) }));
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Divider with subhead (the kit's "Divider with subhead"): the line and, below it, the heading
|
|
17
|
+
* of the section that starts, in Title Small and `on-surface-variant`, with 16 px on both sides.
|
|
18
|
+
*
|
|
19
|
+
* The heading is the child, and you choose its element (`<h2>`…`<h6>` by its level on the page)
|
|
20
|
+
* so the section shows up in heading navigation. The line is decorative: the heading already
|
|
21
|
+
* marks where the section starts, and announcing a separator too would repeat it.
|
|
22
|
+
*
|
|
23
|
+
* ```tsx
|
|
24
|
+
* <DividerSubhead><h3>Recent</h3></DividerSubhead>
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export function DividerSubhead({ className, children, ...props }) {
|
|
28
|
+
return (_jsxs("div", { ...props, className: cx('mk-divider-subhead', className), children: [_jsx(Divider, { decorative: true }), children] }));
|
|
29
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
export interface FocusRingProps extends HTMLAttributes<HTMLSpanElement> {
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Material 3 focus ring: a 3 px outline in `secondary`, 2 px away from the element, shown only
|
|
6
|
+
* on keyboard focus (`:focus-visible`), not on click.
|
|
7
|
+
*
|
|
8
|
+
* Place it as a direct child of the element that receives focus; it inherits its border radius.
|
|
9
|
+
*
|
|
10
|
+
* Customization with CSS variables:
|
|
11
|
+
* - `--mk-focus-ring-color`: color. Defaults to `--md-sys-color-secondary`.
|
|
12
|
+
* - `--mk-focus-ring-offset`: offset. Defaults to 2 px; negative to draw it inwards.
|
|
13
|
+
* - `--mk-focus-ring-visible`: 1 to show it when focus is on another element, for example a
|
|
14
|
+
* hidden `<input>` that is a sibling of the ring.
|
|
15
|
+
*/
|
|
16
|
+
export declare function FocusRing({ className, ...props }: FocusRingProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Material 3 focus ring: a 3 px outline in `secondary`, 2 px away from the element, shown only
|
|
4
|
+
* on keyboard focus (`:focus-visible`), not on click.
|
|
5
|
+
*
|
|
6
|
+
* Place it as a direct child of the element that receives focus; it inherits its border radius.
|
|
7
|
+
*
|
|
8
|
+
* Customization with CSS variables:
|
|
9
|
+
* - `--mk-focus-ring-color`: color. Defaults to `--md-sys-color-secondary`.
|
|
10
|
+
* - `--mk-focus-ring-offset`: offset. Defaults to 2 px; negative to draw it inwards.
|
|
11
|
+
* - `--mk-focus-ring-visible`: 1 to show it when focus is on another element, for example a
|
|
12
|
+
* hidden `<input>` that is a sibling of the ring.
|
|
13
|
+
*/
|
|
14
|
+
export function FocusRing({ className, ...props }) {
|
|
15
|
+
return (_jsx("span", { "aria-hidden": "true", ...props, className: className ? `mk-focus-ring ${className}` : 'mk-focus-ring' }));
|
|
16
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type LayoutElementProps } from '../../internal/layout-element.tsx';
|
|
2
|
+
export type GroupOrientation = 'horizontal' | 'vertical';
|
|
3
|
+
export interface GroupProps extends LayoutElementProps {
|
|
4
|
+
/**
|
|
5
|
+
* Blocks in a row or in a column. Decides which corners are outer: in a row, the first one's
|
|
6
|
+
* start corners and the last one's end corners (in RTL, reversed on screen); in a column, the
|
|
7
|
+
* first one's top corners and the last one's bottom corners. Defaults to `horizontal`.
|
|
8
|
+
*/
|
|
9
|
+
orientation?: GroupOrientation | undefined;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Group of connected blocks: a minimal gap between children and a shape by position, with large
|
|
13
|
+
* outer corners and small inner ones (Material 3 Expressive's segmented List and connected Button
|
|
14
|
+
* groups). CSS resolves it by position (`:first-child`, `:last-child`), so it works with any number
|
|
15
|
+
* of children and on the server.
|
|
16
|
+
*
|
|
17
|
+
* Each use sets three variables (on the group or on a child, also per state):
|
|
18
|
+
* - `--mk-group-gap`: gap. Defaults to `--md-sys-space-25` (2 px).
|
|
19
|
+
* - `--mk-group-outer-radius`: radius of the outer corners. Defaults to 16 (`corner-large`).
|
|
20
|
+
* - `--mk-group-inner-radius`: radius of the inner ones. Defaults to 4 (`corner-extra-small`).
|
|
21
|
+
*
|
|
22
|
+
* The group sets each corner's radius on every direct child (`--mk-group-corner-start-start`,
|
|
23
|
+
* `-start-end`, `-end-start` and `-end-end`, not inherited by grandchildren). A child without a
|
|
24
|
+
* radius of its own (a `<div>`, an `<li>`) gets it automatically; a component with its own radius
|
|
25
|
+
* takes part if it reads those variables (ADR-0017). The variables are computed on each child, so a
|
|
26
|
+
* child can change its inner radius when pressed by redefining `--mk-group-inner-radius` in its
|
|
27
|
+
* `:active`, and the radius animates if the child has a `border-radius` transition.
|
|
28
|
+
*
|
|
29
|
+
* It adds no roles: the blocks can be a list (`render={<ul />}`), buttons (a button group takes
|
|
30
|
+
* `role="group"` and a name, passed as props) or cards.
|
|
31
|
+
*
|
|
32
|
+
* ```tsx
|
|
33
|
+
* <Group orientation="vertical" render={<ul />}>
|
|
34
|
+
* <li>…</li><li>…</li><li>…</li>
|
|
35
|
+
* </Group>
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare function Group({ orientation, className, style, children, ...props }: GroupProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|