@recursica/mui-adapter 0.31.0 → 0.32.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 +18 -0
- package/dist/index.d.ts +11 -3
- package/dist/mui-adapter.cjs +50 -50
- package/dist/mui-adapter.cjs.map +1 -1
- package/dist/mui-adapter.css +1 -1
- package/dist/mui-adapter.js +3717 -3659
- package/dist/mui-adapter.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Accordion/Accordion.module.css +7 -0
- package/src/components/Autocomplete/Autocomplete.module.css +10 -0
- package/src/components/Button/Button.module.css +10 -0
- package/src/components/Card/Card.stories.tsx +2 -4
- package/src/components/Chip/Chip.module.css +9 -0
- package/src/components/DatePicker/DatePicker.module.css +13 -0
- package/src/components/Dropdown/Dropdown.module.css +10 -0
- package/src/components/FileInput/FILEINPUT_IMPLEMENTATION_NOTES.md +4 -1
- package/src/components/FileInput/FileInput.module.css +17 -0
- package/src/components/FileUpload/FileUpload.module.css +6 -0
- package/src/components/Link/Link.module.css +5 -0
- package/src/components/Menu/Menu.module.css +6 -0
- package/src/components/NumberInput/NumberInput.module.css +8 -0
- package/src/components/Pagination/Pagination.module.css +7 -0
- package/src/components/Slider/IMPLEMENTATION_NOTES.md +18 -2
- package/src/components/Slider/Slider.module.css +20 -3
- package/src/components/Slider/Slider.stories.tsx +65 -0
- package/src/components/Slider/Slider.tsx +130 -40
- package/src/components/Slider/USAGE.md +15 -1
- package/src/components/Switch/Switch.module.css +8 -0
- package/src/components/Tabs/Tabs.module.css +9 -0
- package/src/components/TextArea/TextArea.module.css +8 -0
- package/src/components/TextField/TextField.module.css +8 -0
- package/src/components/TimePicker/TimePicker.module.css +8 -0
- package/src/components/Tree/IMPLEMENTATION_NOTES.md +3 -0
- package/src/components/Tree/Tree.module.css +11 -0
- package/src/components/Tree/Tree.tsx +7 -1
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/* Brand-layer exemptions (recursica-allow-brand) — see recursica-token-analyzer README.md.
|
|
2
|
+
* Outline variant's baseline-patch trick needs an opaque paint (active background is transparent by design); borrows Layer 0's surface as the default ambient layer absent a wrapping <Layer> (see IMPLEMENTATION_NOTES.md 'Outline selected-tab border'). Schema gap: no generic 'current ambient layer' token exists — flagged for the token-schema owner.
|
|
3
|
+
* recursica-allow-brand: --recursica_brand_layer_0_properties_surface
|
|
4
|
+
* Global hover/focus/disabled state tokens (recursica_variables_scoped.css header, 'Hover & Focus states' / 'Disabled state' — implicit rule for every interactive element; components must not define their own per-component treatment).
|
|
5
|
+
* recursica-allow-brand: --recursica_brand_states_disabled
|
|
6
|
+
* recursica-allow-brand: --recursica_brand_states_hover_color
|
|
7
|
+
* recursica-allow-brand: --recursica_brand_states_hover_opacity
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
/*
|
|
2
11
|
Recursica Tabs CSS module natively binding to Figma variables.
|
|
3
12
|
*/
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/* Brand-layer exemptions (recursica-allow-brand) — see recursica-token-analyzer README.md.
|
|
2
|
+
* Global hover/focus/disabled state tokens (recursica_variables_scoped.css header, 'Hover & Focus states' / 'Disabled state' — implicit rule for every interactive element; components must not define their own per-component treatment).
|
|
3
|
+
* recursica-allow-brand: --recursica_brand_states_focus_blur
|
|
4
|
+
* recursica-allow-brand: --recursica_brand_states_focus_border-size
|
|
5
|
+
* recursica-allow-brand: --recursica_brand_states_focus_color
|
|
6
|
+
* recursica-allow-brand: --recursica_brand_states_focus_margin
|
|
7
|
+
*/
|
|
8
|
+
|
|
1
9
|
/* LAYOUT SPACING OVERRIDES:
|
|
2
10
|
- Sets the --form-control-margin-bottom spacing hook to map component-specific layout tokens.
|
|
3
11
|
- Also sets the --textarea-control-{max,min}-width hooks consumed inline in TextArea.tsx, since
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/* Brand-layer exemptions (recursica-allow-brand) — see recursica-token-analyzer README.md.
|
|
2
|
+
* Global hover/focus/disabled state tokens (recursica_variables_scoped.css header, 'Hover & Focus states' / 'Disabled state' — implicit rule for every interactive element; components must not define their own per-component treatment).
|
|
3
|
+
* recursica-allow-brand: --recursica_brand_states_focus_blur
|
|
4
|
+
* recursica-allow-brand: --recursica_brand_states_focus_border-size
|
|
5
|
+
* recursica-allow-brand: --recursica_brand_states_focus_color
|
|
6
|
+
* recursica-allow-brand: --recursica_brand_states_focus_margin
|
|
7
|
+
*/
|
|
8
|
+
|
|
1
9
|
/* LAYOUT SPACING OVERRIDES:
|
|
2
10
|
- Sets the --form-control-margin-bottom spacing hook to map component-specific layout tokens.
|
|
3
11
|
- Also sets the --text-field-control-{max,min}-width hooks consumed inline in TextField.tsx,
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/* Brand-layer exemptions (recursica-allow-brand) — see recursica-token-analyzer README.md.
|
|
2
|
+
* Global hover/focus/disabled state tokens (recursica_variables_scoped.css header, 'Hover & Focus states' / 'Disabled state' — implicit rule for every interactive element; components must not define their own per-component treatment).
|
|
3
|
+
* recursica-allow-brand: --recursica_brand_states_focus_blur
|
|
4
|
+
* recursica-allow-brand: --recursica_brand_states_focus_border-size
|
|
5
|
+
* recursica-allow-brand: --recursica_brand_states_focus_color
|
|
6
|
+
* recursica-allow-brand: --recursica_brand_states_focus_margin
|
|
7
|
+
*/
|
|
8
|
+
|
|
1
9
|
/* LAYOUT SPACING OVERRIDES:
|
|
2
10
|
- Sets the --form-control-margin-bottom spacing hook to map component-specific layout tokens. */
|
|
3
11
|
.layoutOverride {
|
|
@@ -43,6 +43,9 @@
|
|
|
43
43
|
- **MUI-only: a leftover default selected background was still showing through.** `@mui/x-tree-view`'s own `TreeItemContent` ships a built-in selected tint (`rgba(25, 118, 210, 0.08)`, and a separate, higher-specificity `rgba(25, 118, 210, 0.2)` for the `[data-selected][data-focused]` combination specifically) that the earlier `.row:hover, .row[data-focused] { background-color: transparent; }` neutralizer never covered. Added `.row[data-selected]` to that neutralizer — but the `[data-selected][data-focused]` compound needed its _own_ explicit rule too: MUI's equivalent compound selector has higher specificity (two attribute selectors plus its own class) than a single-attribute `.row[data-selected]` rule, so it kept winning regardless of source order until matched with an equally-specific `.row[data-selected][data-focused]` rule on our side.
|
|
44
44
|
|
|
45
45
|
- **Whole-tree `disabled` (Matt Massey, 2026-08-10), added to support a `Disabled` story.** Unlike mantine-adapter (which has zero `disabled` concept anywhere in its `Tree` API — see its own note on this), `@mui/x-tree-view` already had per-item `disabled` plumbing sitting mostly dormant here: `CustomTreeItem` already destructured `disabled` off `UseTreeItemParameters`, and `.row[data-disabled] { opacity: ...; cursor: auto; }` already existed in `Tree.module.css` — just with no way for a caller to actually set it, since `RecursicaTreeNode` has no `disabled` field (and still doesn't; per-node disabling remains unexposed, same reasoning as the existing "Deliberately not implemented" entry above).
|
|
46
|
+
|
|
46
47
|
- **Implementation**: `isItemDisabled={disabled ? () => true : undefined}` passed to `<RichTreeView>` — marking every item disabled at once, reusing the library's own per-item mechanism rather than inventing a parallel one. `interactions.handleExpansion`/`handleSelection` (used by both the icon container's click handling and our own `Enter`-key override) already check `status.disabled` internally and no-op, so nothing in `CustomTreeItem` needed an extra guard.
|
|
47
48
|
- **Visual**: the pre-existing `.row[data-disabled]` rule now actually activates. Verified a pre-selected node's chip stays visible underneath the dimming (`.row[data-selected] .label` and `.row[data-disabled]` are independent, non-conflicting selectors — one styles `.label`, the other dims the whole `.row` via `opacity`), per Matt's ask to check that combination.
|
|
48
49
|
- **Found while verifying**: disabled rows still showed the hover tint (`.label::after` opacity) on mouse-over — MUI's own disabled checks block the actual select/expand _action_ on click, but `:hover` is pure CSS with nothing stopping it. Added `pointer-events: none` to `.row[data-disabled]`, matching mantine-adapter's `.root[data-disabled]` (tree-wide there; per-row here, since MUI's disabled state is inherently per-item even when every item is disabled at once by the same whole-tree prop).
|
|
50
|
+
|
|
51
|
+
- **`ExpandToggleButton` could still steal DOM focus despite `tabIndex={-1}` (Matt Massey, 2026-08-24), caught via a live browser console warning, in both adapters.** `tabIndex={-1}`/`aria-hidden` only removes the embedded chevron `Button` from the sequential tab order; it doesn't stop a native `<button>` from receiving DOM focus on a direct mouse click on the chevron, which browsers still do regardless of `tabIndex`. Since the button also has `aria-hidden="true"`, clicking it left an aria-hidden element holding focus — flagged by Chrome as "Blocked aria-hidden on an element because its descendant retained focus." Fixed with `onMouseDown={(event) => event.preventDefault()}` on the `Button` inside `ExpandToggleButton`: this suppresses the browser's default click-focuses-the-target behavior without affecting expand/collapse (still driven entirely by `TreeItemIconContainer`'s own click handling, untouched by this). Same fix applied to mantine-adapter's embedded chevron `Button`.
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/* Brand-layer exemptions (recursica-allow-brand) — see recursica-token-analyzer README.md.
|
|
2
|
+
* Global hover/focus/disabled state tokens (recursica_variables_scoped.css header, 'Hover & Focus states' / 'Disabled state' — implicit rule for every interactive element; components must not define their own per-component treatment).
|
|
3
|
+
* recursica-allow-brand: --recursica_brand_states_disabled
|
|
4
|
+
* recursica-allow-brand: --recursica_brand_states_focus_blur
|
|
5
|
+
* recursica-allow-brand: --recursica_brand_states_focus_border-size
|
|
6
|
+
* recursica-allow-brand: --recursica_brand_states_focus_color
|
|
7
|
+
* recursica-allow-brand: --recursica_brand_states_focus_margin
|
|
8
|
+
* recursica-allow-brand: --recursica_brand_states_hover_color
|
|
9
|
+
* recursica-allow-brand: --recursica_brand_states_hover_opacity
|
|
10
|
+
*/
|
|
11
|
+
|
|
1
12
|
/* HARDCODED VALUES:
|
|
2
13
|
* - list-style/margin/padding resets on .root/.subtree/.node: layout resets, no corresponding
|
|
3
14
|
* design tokens (structural, not visual design values).
|
|
@@ -71,7 +71,12 @@ function ChevronGlyph({ rotated }: { rotated?: boolean }) {
|
|
|
71
71
|
* not by this Button itself, so the row stays the only focusable element and the button never
|
|
72
72
|
* shows its own focus state. Rendered for every row, including leaf items, so row alignment
|
|
73
73
|
* stays consistent; `hidden` (visibility, not display) is used for leaf rows instead of omitting
|
|
74
|
-
* the button, so the layout space is reserved without duplicating Button's own size tokens.
|
|
74
|
+
* the button, so the layout space is reserved without duplicating Button's own size tokens.
|
|
75
|
+
* `onMouseDown` prevents the browser's default click-focuses-the-button behavior (tabIndex={-1}
|
|
76
|
+
* only removes it from the tab order, it doesn't stop a direct mouse click on the chevron from
|
|
77
|
+
* focusing this button) — without this, clicking the chevron leaves the (aria-hidden) button
|
|
78
|
+
* focused, which browsers now flag as an accessibility violation ("focus must not be hidden from
|
|
79
|
+
* assistive technology"). */
|
|
75
80
|
function ExpandToggleButton({
|
|
76
81
|
rotated,
|
|
77
82
|
hidden,
|
|
@@ -88,6 +93,7 @@ function ExpandToggleButton({
|
|
|
88
93
|
aria-label="Toggle subtree"
|
|
89
94
|
aria-hidden="true"
|
|
90
95
|
tabIndex={-1}
|
|
96
|
+
onMouseDown={(event) => event.preventDefault()}
|
|
91
97
|
className={
|
|
92
98
|
hidden
|
|
93
99
|
? `${styles.expandButton} ${styles.expandButtonHidden}`
|