@texaryn/react-mui 0.1.4 → 0.3.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/CHANGELOG.md CHANGED
@@ -1,5 +1,60 @@
1
1
  # @texaryn/react-mui
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 04270e8: Give every array action control an accessible name that says which row it acts on.
8
+
9
+ Five buttons all announced as "Remove" leave a screen reader user guessing. Each now carries the current 1-based position and whatever schema titles exist, so "Remove Contact 2 from Contacts", degrading to "Remove item 2" when nothing is titled. Reorder controls read "Move up Contact 2 in Contacts", and the per-array control reads "Add item to Contacts". The visible words stay "Remove", "Up" and "Add", with the longer string in `aria-label`, which contains the visible text so speech input still works.
10
+
11
+ The row's own value is deliberately not used: it is mutable, often blank, frequently duplicated, and sometimes sensitive. The position is recomputed on every render rather than captured when a row is created, because a row survives a move while its position does not.
12
+
13
+ The add control is named from the item template rather than from the first row, so an empty array still says "Add Tag" where naming it matters most. That needed the template's annotations, which the projection did not carry: `NodeProjection.itemAnnotations` is new and optional, so an adapter that cannot supply it stays valid, and `ArrayMeta.itemTitle` carries the result to renderers.
14
+
15
+ React exposes the decision as `useArrayActions` so its three widget sets cannot drift, and the name builders are exported for custom widgets. Reorder-control parity is unchanged: the three React sets still expose no reorder button.
16
+ - c9b930f: Show a required field's requirement to a sighted user, without announcing it twice.
17
+
18
+ Required was conveyed only through `aria-required`, so a sighted user had nothing to tell a required field from an optional one. Every required label now carries a visible `(required)`.
19
+
20
+ Three channels carry that one fact and are deliberately kept separate. The visible label reads "Full Name (required)". The accessible name stays exactly "Full Name", because the indicator is `aria-hidden` and `aria-required` already reports the state; putting it in the name as well makes some screen readers say it twice. WCAG's Label in Name allows exactly this omission when the state is surfaced programmatically.
21
+
22
+ The indicator is the word rather than an asterisk, so nothing has to be explained elsewhere on the form. `field.label` and `fieldLabel()` still return the raw schema title: the decoration lives in the label rendering, so a visual convention does not become the canonical field title a custom widget sees. React exposes `FieldLabelContent` so its three widget sets cannot drift, and each binding exports `REQUIRED_INDICATOR` so a custom widget can match the wording.
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies [04270e8]
27
+ - Updated dependencies [c9b930f]
28
+ - @texaryn/core@0.7.0
29
+ - @texaryn/react@0.4.0
30
+
31
+ ## 0.2.0
32
+
33
+ ### Minor Changes
34
+
35
+ - 3545378: Expose a titled nested object as a named group in React and Vue, closing the last gap the DOM accessibility contract declared.
36
+
37
+ A nested object rendered as a plain `div` gives no indication where one group of fields ends and the next begins. It is now a `fieldset` named by its `legend`, matching what `@texaryn/web-components` already did. The element is chosen once at mount and only the grouping semantics are re-derived, because a conditional subschema can add or drop a title on any recompile and swapping `div` for `fieldset` at that moment would remount the subtree and take the caret with it. An untitled nested object stays a `fieldset` but carries `role="none"`, since an unnamed group is noise in the accessibility tree.
38
+
39
+ The decision is shared through a new `useObjectGroup` hook, so the three React widget sets cannot drift apart on it. The root object is still a plain container: it is the form itself, not a group inside one.
40
+ - 3e53ca9: Keep each field's error container mounted as a live region instead of inserting it with the message already inside.
41
+
42
+ A region that appears together with its content is not reliably announced, which is what every binding did: React and Vue rendered nothing until an error existed, and Web Components kept the node but hid it, which takes it out of the accessibility tree just the same. The container now exists from mount, stays empty while the field is valid, and only its contents change.
43
+
44
+ It is `aria-live="polite" aria-atomic="true"` rather than `role="alert"`. This is a public semantic change: `ErrorProps` promised `role: 'alert'` and now carries the live-region attributes instead. Alert is assertive, and validation runs on change, blur and submit, so keeping it would have interrupted typing and spoken once per failing field on submit. `aria-describedby` stays conditional, pointing at the region only while it has something to say. `ErrorSummary` loses its `role="alert"` and keeps rendering conditionally, because the fields now announce their own errors and an aggregate region would repeat the same validation event.
45
+ - e7c00ce: Render a schema's `readOnly` as read-only rather than disabled, and enforce it in the runtime.
46
+
47
+ A disabled control is not focusable and is announced differently; a read-only one stays focusable and selectable, which is what `readOnly` means. Compiled nodes now carry a resolved `readOnly` that a read-only object or array passes to everything beneath it, because editing a descendant changes the ancestor's value. The runtime refuses `SetValue`, `InsertItem`, `RemoveItem` and `MoveItem` on a read-only node, so a custom widget set cannot write past the restriction; `Reset` stays allowed as the owning authority replacing state. Renderers use the native `readonly` attribute where HTML has one and `aria-readonly` plus refusing the change where it does not, which is select and checkbox. `disabled` remains part of the node API, but the compiler no longer derives it from `readOnly`, so compiled nodes currently resolve it to false.
48
+
49
+ ### Patch Changes
50
+
51
+ - Updated dependencies [3545378]
52
+ - Updated dependencies [3e53ca9]
53
+ - Updated dependencies [4a161b2]
54
+ - Updated dependencies [e7c00ce]
55
+ - @texaryn/react@0.3.0
56
+ - @texaryn/core@0.6.0
57
+
3
58
  ## 0.1.4
4
59
 
5
60
  ### Patch Changes
package/README.md CHANGED
@@ -66,14 +66,14 @@ function App() {
66
66
  | `MuiTextarea` | field with the `textarea` widget hint | `TextField` with `multiline` |
67
67
  | `MuiSelect` | field with enum values | `TextField` with `select`, `MenuItem` per option |
68
68
  | `MuiCheckbox` | boolean field | `FormControl`, `FormControlLabel`, `Checkbox`, `FormHelperText` |
69
- | `MuiObjectLayout` | object container | `Stack` around the children |
69
+ | `MuiObjectLayout` | object container | `Stack`; a nested object is a `fieldset` named by its `legend` |
70
70
  | `MuiArrayControl` | array container | `Stack`, `Box` per item, `Button` to add or remove |
71
71
 
72
72
  Enum outranks the primitive type, so a string field with an `enum` renders as a select, and the `textarea` hint outranks both.
73
73
 
74
74
  ### Error display: replace, not both
75
75
 
76
- Where `@texaryn/react-bootstrap` and the default registry show the description and every visible error together, this package shows one line of helper text at a time: the description while the field is valid, and the first visible error in its place once the field is invalid. That is `TextField`'s own `helperText` model, one slot, so the widgets pass it `field.error ?? field.description` rather than rendering both. The error line carries `role="alert"` through `slotProps.formHelperText`.
76
+ Where `@texaryn/react-bootstrap` and the default registry show the description and every visible error together, this package shows one line of helper text at a time: the description while the field is valid, and the first visible error in its place once the field is invalid. That is `TextField`'s own `helperText` model, one slot, so the widgets fill it with the error or the description rather than both. MUI renders no helper line at all for empty `helperText`, so the live region that announces the error is a stable `aria-live="polite"` span inside that line rather than the line itself: a region inserted with its content already in place is not reliably announced.
77
77
 
78
78
  ### `aria-required`, not `required`
79
79
 
@@ -1 +1 @@
1
- {"version":3,"file":"MuiArrayControl.d.ts","sourceRoot":"","sources":["../../src/widgets/MuiArrayControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAiB,MAAM,EAAE,MAAM,eAAe,CAAA;AAG1D,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;CACb;AAED,iBAAS,mBAAmB,CAAC,EAAE,IAAI,EAAE,EAAE,WAAW,qBAoCjD;AAED,eAAO,MAAM,eAAe,uDAAiF,CAAA"}
1
+ {"version":3,"file":"MuiArrayControl.d.ts","sourceRoot":"","sources":["../../src/widgets/MuiArrayControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAiB,MAAM,EAAE,MAAM,eAAe,CAAA;AAG1D,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;CACb;AAED,iBAAS,mBAAmB,CAAC,EAAE,IAAI,EAAE,EAAE,WAAW,qBAsCjD;AAED,eAAO,MAAM,eAAe,uDAAiF,CAAA"}
@@ -3,15 +3,16 @@ import React from 'react';
3
3
  import Stack from '@mui/material/Stack';
4
4
  import Button from '@mui/material/Button';
5
5
  import Box from '@mui/material/Box';
6
- import { NodeRenderer, useFieldArray, useRendererContext } from '@texaryn/react';
6
+ import { NodeRenderer, useArrayActions, useFieldArray, useRendererContext } from '@texaryn/react';
7
7
  function MuiArrayControlImpl({ node }) {
8
8
  const containerNode = node;
9
9
  const fieldArray = useFieldArray(containerNode.id);
10
10
  const { document, registry } = useRendererContext();
11
+ const actions = useArrayActions(node);
11
12
  return (_jsxs(Stack, { spacing: 2, children: [fieldArray.items.map((item, index) => {
12
13
  const childNode = item.nodeId ? document.nodes[item.nodeId] : undefined;
13
- return (_jsxs(Box, { children: [childNode ? (_jsx(NodeRenderer, { node: childNode, document: document, registry: registry })) : null, fieldArray.canRemove ? (_jsx(Button, { variant: "outlined", color: "error", size: "small", onClick: () => fieldArray.remove(index), children: "Remove" })) : null] }, item.id));
14
- }), fieldArray.canAdd ? (_jsx(Box, { children: _jsx(Button, { variant: "contained", onClick: () => fieldArray.add(), children: "Add" }) })) : null] }));
14
+ return (_jsxs(Box, { children: [childNode ? (_jsx(NodeRenderer, { node: childNode, document: document, registry: registry })) : null, fieldArray.canRemove ? (_jsx(Button, { variant: "outlined", color: "error", size: "small", "aria-label": actions.removeName(index + 1, childNode), onClick: () => fieldArray.remove(index), children: "Remove" })) : null] }, item.id));
15
+ }), fieldArray.canAdd ? (_jsx(Box, { children: _jsx(Button, { variant: "contained", "aria-label": actions.addName, onClick: () => fieldArray.add(), children: "Add" }) })) : null] }));
15
16
  }
16
17
  export const MuiArrayControl = React.memo(MuiArrayControlImpl, (prev, next) => prev.node.id === next.node.id);
17
18
  //# sourceMappingURL=MuiArrayControl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MuiArrayControl.js","sourceRoot":"","sources":["../../src/widgets/MuiArrayControl.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,MAAM,qBAAqB,CAAA;AACvC,OAAO,MAAM,MAAM,sBAAsB,CAAA;AACzC,OAAO,GAAG,MAAM,mBAAmB,CAAA;AAEnC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAMhF,SAAS,mBAAmB,CAAC,EAAE,IAAI,EAAe;IAChD,MAAM,aAAa,GAAG,IAAqB,CAAA;IAC3C,MAAM,UAAU,GAAG,aAAa,CAAC,aAAa,CAAC,EAAE,CAAC,CAAA;IAClD,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,k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,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,uBAGhC,CACV,CAAC,CAAC,CAAC,IAAI,KAdA,IAAI,CAAC,EAAE,CAeX,CACP,CAAA;YACH,CAAC,CAAC,EACD,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CACnB,KAAC,GAAG,cACF,KAAC,MAAM,IAAC,OAAO,EAAC,WAAW,gBAAa,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,oBAE/E,GACL,CACP,CAAC,CAAC,CAAC,IAAI,IACF,CACT,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"MuiCheckbox.d.ts","sourceRoot":"","sources":["../../src/widgets/MuiCheckbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,KAAK,EAAa,MAAM,EAAE,MAAM,eAAe,CAAA;AAGtD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;CACb;AAED,iBAAS,eAAe,CAAC,EAAE,IAAI,EAAE,EAAE,WAAW,qBAiC7C;AAED,eAAO,MAAM,WAAW,mDAA6E,CAAA"}
1
+ {"version":3,"file":"MuiCheckbox.d.ts","sourceRoot":"","sources":["../../src/widgets/MuiCheckbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,KAAK,EAAa,MAAM,EAAE,MAAM,eAAe,CAAA;AAItD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;CACb;AAED,iBAAS,eAAe,CAAC,EAAE,IAAI,EAAE,EAAE,WAAW,qBA6B7C;AAED,eAAO,MAAM,WAAW,mDAA6E,CAAA"}
@@ -4,20 +4,21 @@ import FormControl from '@mui/material/FormControl';
4
4
  import FormControlLabel from '@mui/material/FormControlLabel';
5
5
  import Checkbox from '@mui/material/Checkbox';
6
6
  import FormHelperText from '@mui/material/FormHelperText';
7
- import { useFieldBinding } from '@texaryn/react';
7
+ import { FieldLabelContent, useFieldBinding } from '@texaryn/react';
8
+ import { helperContent } from './helper-text.js';
8
9
  function MuiCheckboxImpl({ node }) {
9
10
  const field = useFieldBinding(node);
10
- const feedback = field.error ?? field.description;
11
11
  const helperId = `${field.domCheckboxProps.id}-helper`;
12
- return (_jsxs(FormControl, { error: field.invalid, disabled: field.disabled, children: [_jsx(FormControlLabel, { label: field.label, control: _jsx(Checkbox, { checked: field.domCheckboxProps.checked, onChange: field.domCheckboxProps.onChange, onBlur: field.domCheckboxProps.onBlur, slotProps: {
12
+ return (_jsxs(FormControl, { error: field.invalid, disabled: field.disabled, children: [_jsx(FormControlLabel, { label: _jsx(FieldLabelContent, { label: field.label, required: field.required }), control: _jsx(Checkbox, { checked: field.domCheckboxProps.checked, onChange: field.domCheckboxProps.onChange, onBlur: field.domCheckboxProps.onBlur, slotProps: {
13
13
  input: {
14
14
  id: field.domCheckboxProps.id,
15
15
  name: field.domCheckboxProps.name,
16
16
  'aria-required': field.required || undefined,
17
+ 'aria-readonly': field.readOnly || undefined,
17
18
  'aria-invalid': field.invalid || undefined,
18
- 'aria-describedby': feedback ? helperId : undefined,
19
+ 'aria-describedby': helperId,
19
20
  },
20
- } }) }), feedback ? (_jsx(FormHelperText, { id: helperId, role: field.invalid ? 'alert' : undefined, children: feedback })) : null] }));
21
+ } }) }), _jsx(FormHelperText, { id: helperId, children: helperContent(field) })] }));
21
22
  }
22
23
  export const MuiCheckbox = React.memo(MuiCheckboxImpl, (prev, next) => prev.node.id === next.node.id);
23
24
  //# sourceMappingURL=MuiCheckbox.js.map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c,sDAAgF,CAAA"}
1
+ {"version":3,"file":"MuiNumberInput.d.ts","sourceRoot":"","sources":["../../src/widgets/MuiNumberInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAa,MAAM,EAAE,MAAM,eAAe,CAAA;AAItD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;CACb;AAED,iBAAS,kBAAkB,CAAC,EAAE,IAAI,EAAE,EAAE,WAAW,qBA0BhD;AAED,eAAO,MAAM,cAAc,sDAAgF,CAAA"}
@@ -1,17 +1,16 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import React from 'react';
3
3
  import TextField from '@mui/material/TextField';
4
- import { useFieldBinding } from '@texaryn/react';
4
+ import { FieldLabelContent, useFieldBinding } from '@texaryn/react';
5
+ import { helperContent } from './helper-text.js';
5
6
  function MuiNumberInputImpl({ node }) {
6
7
  const field = useFieldBinding(node);
7
- return (_jsx(TextField, { type: "number", id: field.domInputProps.id, name: field.domInputProps.name, value: field.domInputProps.value, onChange: field.domInputProps.onChange, onBlur: field.domInputProps.onBlur, disabled: field.disabled, placeholder: field.placeholder, label: field.label, error: field.invalid, helperText: field.error ?? field.description, fullWidth: true, slotProps: {
8
+ return (_jsx(TextField, { type: "number", id: field.domInputProps.id, name: field.domInputProps.name, value: field.domInputProps.value, onChange: field.domInputProps.onChange, onBlur: field.domInputProps.onBlur, disabled: field.disabled, placeholder: field.placeholder, label: _jsx(FieldLabelContent, { label: field.label, required: field.required }), error: field.invalid, helperText: helperContent(field), fullWidth: true, slotProps: {
8
9
  htmlInput: {
10
+ readOnly: field.readOnly,
9
11
  'aria-required': field.required || undefined,
10
12
  'aria-invalid': field.invalid || undefined,
11
13
  },
12
- formHelperText: {
13
- role: field.invalid ? 'alert' : undefined,
14
- },
15
14
  } }));
16
15
  }
17
16
  export const MuiNumberInput = React.memo(MuiNumberInputImpl, (prev, next) => prev.node.id === next.node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C;SACF,GACD,CACH,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"MuiObjectLayout.d.ts","sourceRoot":"","sources":["../../src/widgets/MuiObjectLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAiB,MAAM,EAAE,MAAM,eAAe,CAAA;AAG1D,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;CACb;AAED,iBAAS,mBAAmB,CAAC,EAAE,IAAI,EAAE,EAAE,WAAW,qBAejD;AAED,eAAO,MAAM,eAAe,uDAAiF,CAAA"}
1
+ {"version":3,"file":"MuiObjectLayout.d.ts","sourceRoot":"","sources":["../../src/widgets/MuiObjectLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAG3C,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;CACb;AAED,iBAAS,mBAAmB,CAAC,EAAE,IAAI,EAAE,EAAE,WAAW,qBA8BjD;AAED,eAAO,MAAM,eAAe,uDAG3B,CAAA"}
@@ -1,17 +1,19 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from 'react';
3
3
  import Stack from '@mui/material/Stack';
4
- import { NodeRenderer, useRendererContext } from '@texaryn/react';
4
+ import Typography from '@mui/material/Typography';
5
+ import { NodeRenderer, useObjectGroup, useRendererContext } from '@texaryn/react';
5
6
  function MuiObjectLayoutImpl({ node }) {
6
- const containerNode = node;
7
7
  const { document, registry } = useRendererContext();
8
- return (_jsx(Stack, { spacing: 2, children: containerNode.children.map((childId) => {
9
- const child = document.nodes[childId];
10
- if (!child) {
11
- return null;
12
- }
13
- return _jsx(NodeRenderer, { node: child, document: document, registry: registry }, childId);
14
- }) }));
8
+ const { nested, title, children } = useObjectGroup(node);
9
+ const rendered = children.map((child) => (_jsx(NodeRenderer, { node: child, document: document, registry: registry }, child.id)));
10
+ if (!nested) {
11
+ return _jsx(Stack, { spacing: 2, children: rendered });
12
+ }
13
+ // A plain fieldset rather than one of MUI's own containers: this package is
14
+ // theme-neutral and the grouping has to be a real fieldset with a legend for
15
+ // the group to be named. Typography styles the legend without replacing it.
16
+ return (_jsxs(Stack, { component: "fieldset", spacing: 2, role: title === undefined ? 'none' : undefined, sx: { border: 0, m: 0, p: 0 }, children: [title === undefined ? null : (_jsx(Typography, { component: "legend", variant: "subtitle2", children: title })), _jsx(Stack, { spacing: 2, children: rendered })] }));
15
17
  }
16
18
  export const MuiObjectLayout = React.memo(MuiObjectLayoutImpl, (prev, next) => prev.node.id === next.node.id);
17
19
  //# sourceMappingURL=MuiObjectLayout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MuiObjectLayout.js","sourceRoot":"","sources":["../../src/widgets/MuiObjectLayout.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,MAAM,qBAAqB,CAAA;AAEvC,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAMjE,SAAS,mBAAmB,CAAC,EAAE,IAAI,EAAe;IAChD,MAAM,aAAa,GAAG,IAAqB,CAAA;IAC3C,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,kBAAkB,EAAE,CAAA;IAEnD,OAAO,CACL,KAAC,KAAK,IAAC,OAAO,EAAE,CAAC,YACd,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE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MuiSelect.d.ts","sourceRoot":"","sources":["../../src/widgets/MuiSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAa,MAAM,EAAE,MAAM,eAAe,CAAA;AAItD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;CACb;AAED,iBAAS,aAAa,CAAC,EAAE,IAAI,EAAE,EAAE,WAAW,qBAyC3C;AAED,eAAO,MAAM,SAAS,iDAA2E,CAAA"}
@@ -2,11 +2,12 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import React from 'react';
3
3
  import TextField from '@mui/material/TextField';
4
4
  import MenuItem from '@mui/material/MenuItem';
5
- import { useFieldBinding } from '@texaryn/react';
5
+ import { FieldLabelContent, useFieldBinding } from '@texaryn/react';
6
+ import { helperContent } from './helper-text.js';
6
7
  function MuiSelectImpl({ node }) {
7
8
  const field = useFieldBinding(node);
8
9
  const enumValues = node.enumValues ?? [];
9
- return (_jsx(TextField, { select: true, id: field.domInputProps.id, name: field.domInputProps.name, value: field.domInputProps.value, onChange: field.domInputProps.onChange, onBlur: field.domInputProps.onBlur, disabled: field.disabled, label: field.label, error: field.invalid, helperText: field.error ?? field.description, fullWidth: true, slotProps: {
10
+ return (_jsx(TextField, { select: true, id: field.domInputProps.id, name: field.domInputProps.name, value: field.domInputProps.value, onChange: field.domInputProps.onChange, onBlur: field.domInputProps.onBlur, disabled: field.disabled, label: _jsx(FieldLabelContent, { label: field.label, required: field.required }), error: field.invalid, helperText: helperContent(field), fullWidth: true, slotProps: {
10
11
  // Screen readers see the combobox div, not MUI's aria-hidden native
11
12
  // input, so the required state goes on the display element.
12
13
  //
@@ -18,11 +19,9 @@ function MuiSelectImpl({ node }) {
18
19
  select: {
19
20
  SelectDisplayProps: {
20
21
  'aria-required': field.required || undefined,
22
+ 'aria-readonly': field.readOnly || undefined,
21
23
  },
22
24
  },
23
- formHelperText: {
24
- role: field.invalid ? 'alert' : undefined,
25
- },
26
25
  }, children: enumValues.map((option) => (_jsx(MenuItem, { value: String(option.value), children: option.title ?? String(option.value) }, String(option.value)))) }));
27
26
  }
28
27
  export const MuiSelect = React.memo(MuiSelectImpl, (prev, next) => prev.node.id === next.node.id);
@@ -1 +1 @@
1
- {"version":3,"file":"MuiSelect.js","sourceRoot":"","sources":["../../src/widgets/MuiSelect.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,SAAS,MAAM,yBAAyB,CAAA;AAC/C,OAAO,QAAQ,MAAM,wBAAwB,CAAA;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAMhD,SAAS,aAAa,CAAC,EAAE,IAAI,EAAe;IAC1C,MAAM,KAAK,GAAG,eAAe,CAAC,IAAiB,CAAC,CAAA;IAChD,MAAM,UAAU,GAAI,IAAkB,CAAC,UAAU,IAAI,EAAE,CAAA;IAEvD,OAAO,CACL,KAAC,SAAS,IACR,MAAM,QACN,EAAE,EAAE,KAAK,CAAC,aAAa,CAAC,EAAE,EAC1B,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,IAAI,EAC9B,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,EAChC,QAAQ,EAAE,KAAK,CAAC,aAAa,CAAC,QAAQ,EACtC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,MAAM,EAClC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,KAAK,EAAE,KAAK,CAAC,OAAO,EACpB,UAAU,EAAE,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,WAAW,EAC5C,SAAS,QACT,SAAS,EAAE;YACT,oEAAoE;YACpE,4DAA4D;YAC5D,EAAE;YACF,qEAAqE;YACrE,kEAAkE;YAClE,oEAAoE;YACpE,kEAAkE;YAClE,qBAAqB;YACrB,MAAM,EAAE;gBACN,kBAAkB,EAAE;oBAClB,eAAe,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.ts","sourceRoot":"","sources":["../../src/widgets/MuiTextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAa,MAAM,EAAE,MAAM,eAAe,CAAA;AAGtD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;CACb;AAED,iBAAS,gBAAgB,CAAC,EAAE,IAAI,EAAE,EAAE,WAAW,qBA2B9C;AAED,eAAO,MAAM,YAAY,oDAA8E,CAAA"}
1
+ {"version":3,"file":"MuiTextInput.d.ts","sourceRoot":"","sources":["../../src/widgets/MuiTextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAa,MAAM,EAAE,MAAM,eAAe,CAAA;AAItD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;CACb;AAED,iBAAS,gBAAgB,CAAC,EAAE,IAAI,EAAE,EAAE,WAAW,qBAyB9C;AAED,eAAO,MAAM,YAAY,oDAA8E,CAAA"}
@@ -1,17 +1,16 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import React from 'react';
3
3
  import TextField from '@mui/material/TextField';
4
- import { useFieldBinding } from '@texaryn/react';
4
+ import { FieldLabelContent, useFieldBinding } from '@texaryn/react';
5
+ import { helperContent } from './helper-text.js';
5
6
  function MuiTextInputImpl({ node }) {
6
7
  const field = useFieldBinding(node);
7
- return (_jsx(TextField, { id: field.domInputProps.id, name: field.domInputProps.name, value: field.domInputProps.value, onChange: field.domInputProps.onChange, onBlur: field.domInputProps.onBlur, disabled: field.disabled, placeholder: field.placeholder, label: field.label, error: field.invalid, helperText: field.error ?? field.description, fullWidth: true, slotProps: {
8
+ return (_jsx(TextField, { id: field.domInputProps.id, name: field.domInputProps.name, value: field.domInputProps.value, onChange: field.domInputProps.onChange, onBlur: field.domInputProps.onBlur, disabled: field.disabled, placeholder: field.placeholder, label: _jsx(FieldLabelContent, { label: field.label, required: field.required }), error: field.invalid, helperText: helperContent(field), fullWidth: true, slotProps: {
8
9
  htmlInput: {
10
+ readOnly: field.readOnly,
9
11
  'aria-required': field.required || undefined,
10
12
  'aria-invalid': field.invalid || undefined,
11
13
  },
12
- formHelperText: {
13
- role: field.invalid ? 'alert' : undefined,
14
- },
15
14
  } }));
16
15
  }
17
16
  export const MuiTextInput = React.memo(MuiTextInputImpl, (prev, next) => prev.node.id === next.node.id);
@@ -1 +1 @@
1
- {"version":3,"file":"MuiTextInput.js","sourceRoot":"","sources":["../../src/widgets/MuiTextInput.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,SAAS,MAAM,yBAAyB,CAAA;AAE/C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAMhD,SAAS,gBAAgB,CAAC,EAAE,IAAI,EAAe;IAC7C,MAAM,KAAK,GAAG,eAAe,CAAC,IAAiB,CAAC,CAAA;IAEhD,OAAO,CACL,KAAC,SAAS,IACR,EAAE,EAAE,KAAK,CAAC,aAAa,CAAC,EAAE,EAC1B,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,IAAI,EAC9B,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,EAChC,QAAQ,EAAE,KAAK,CAAC,aAAa,CAAC,QAAQ,EACtC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,MAAM,EAClC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,KAAK,EAAE,KAAK,CAAC,OAAO,EACpB,UAAU,EAAE,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,WAAW,EAC5C,SAAS,QACT,SAAS,EAAE;YACT,SAAS,EAAE;gBACT,eAAe,EAAE,KAAK,CAAC,QAAQ,IAAI,SAAS;gBAC5C,cAAc,EAAE,KAAK,CAAC,OAAO,IAAI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,UAAU,EAAE,aAAa,CAAC,KAAK,CAAC,EAChC,SAAS,QACT,SAAS,EAAE;YACT,SAAS,EAAE;gBACT,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,eAAe,EAAE,KAAK,CAAC,QAAQ,IAAI,SAAS;gBAC5C,cAAc,EAAE,KAAK,CAAC,OAAO,IAAI,SAAS;aAC3C;SACF,GACD,CACH,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"MuiTextarea.d.ts","sourceRoot":"","sources":["../../src/widgets/MuiTextarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAa,MAAM,EAAE,MAAM,eAAe,CAAA;AAGtD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;CACb;AAED,iBAAS,eAAe,CAAC,EAAE,IAAI,EAAE,EAAE,WAAW,qBA6B7C;AAED,eAAO,MAAM,WAAW,mDAA6E,CAAA"}
1
+ {"version":3,"file":"MuiTextarea.d.ts","sourceRoot":"","sources":["../../src/widgets/MuiTextarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAa,MAAM,EAAE,MAAM,eAAe,CAAA;AAItD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;CACb;AAED,iBAAS,eAAe,CAAC,EAAE,IAAI,EAAE,EAAE,WAAW,qBA2B7C;AAED,eAAO,MAAM,WAAW,mDAA6E,CAAA"}
@@ -1,17 +1,16 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import React from 'react';
3
3
  import TextField from '@mui/material/TextField';
4
- import { useFieldBinding } from '@texaryn/react';
4
+ import { FieldLabelContent, useFieldBinding } from '@texaryn/react';
5
+ import { helperContent } from './helper-text.js';
5
6
  function MuiTextareaImpl({ node }) {
6
7
  const field = useFieldBinding(node);
7
- return (_jsx(TextField, { multiline: true, minRows: 3, id: field.domInputProps.id, name: field.domInputProps.name, value: field.domInputProps.value, onChange: field.domInputProps.onChange, onBlur: field.domInputProps.onBlur, disabled: field.disabled, placeholder: field.placeholder, label: field.label, error: field.invalid, helperText: field.error ?? field.description, fullWidth: true, slotProps: {
8
+ return (_jsx(TextField, { multiline: true, minRows: 3, id: field.domInputProps.id, name: field.domInputProps.name, value: field.domInputProps.value, onChange: field.domInputProps.onChange, onBlur: field.domInputProps.onBlur, disabled: field.disabled, placeholder: field.placeholder, label: _jsx(FieldLabelContent, { label: field.label, required: field.required }), error: field.invalid, helperText: helperContent(field), fullWidth: true, slotProps: {
8
9
  htmlInput: {
10
+ readOnly: field.readOnly,
9
11
  'aria-required': field.required || undefined,
10
12
  'aria-invalid': field.invalid || undefined,
11
13
  },
12
- formHelperText: {
13
- role: field.invalid ? 'alert' : undefined,
14
- },
15
14
  } }));
16
15
  }
17
16
  export const MuiTextarea = React.memo(MuiTextareaImpl, (prev, next) => prev.node.id === next.node.id);
@@ -1 +1 @@
1
- {"version":3,"file":"MuiTextarea.js","sourceRoot":"","sources":["../../src/widgets/MuiTextarea.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,SAAS,MAAM,yBAAyB,CAAA;AAE/C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAMhD,SAAS,eAAe,CAAC,EAAE,IAAI,EAAe;IAC5C,MAAM,KAAK,GAAG,eAAe,CAAC,IAAiB,CAAC,CAAA;IAEhD,OAAO,CACL,KAAC,SAAS,IACR,SAAS,QACT,OAAO,EAAE,CAAC,EACV,EAAE,EAAE,KAAK,CAAC,aAAa,C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M,KAAK,GAAG,eAAe,CAAC,IAAiB,CAAC,CAAA;IAEhD,OAAO,CACL,KAAC,SAAS,IACR,SAAS,QACT,OAAO,EAAE,CAAC,EACV,EAAE,EAAE,KAAK,CAAC,aAAa,CAAC,EAAE,EAC1B,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,IAAI,EAC9B,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,EAChC,QAAQ,EAAE,KAAK,CAAC,aAAa,CAAC,QAAQ,EACtC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,MAAM,EAClC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,KAAK,EAAE,KAAC,iBAAiB,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,GAAI,EAC1E,KAAK,EAAE,KAAK,CAAC,OAAO,EACpB,UAAU,EAAE,aAAa,CAAC,KAAK,CAAC,EAChC,SAAS,QACT,SAAS,EAAE;YACT,SAAS,EAAE;gBACT,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,eAAe,EAAE,KAAK,CAAC,QAAQ,IAAI,SAAS;gBAC5C,cAAc,EAAE,KAAK,CAAC,OAAO,IAAI,SAAS;aAC3C;SACF,GACD,CACH,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA"}
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import type { FieldBinding } from '@texaryn/react';
3
+ /**
4
+ * MUI's helper line doubles as description and error, and it renders nothing
5
+ * when helperText is empty, so the live region has to be a stable child of it
6
+ * rather than the line itself. Only the error goes inside the region: the
7
+ * description is not news and should not be re-announced.
8
+ *
9
+ * Always returning an element keeps the line mounted without reserving it with
10
+ * a blank string, which would change layout to prime the announcement.
11
+ */
12
+ export declare function helperContent(field: FieldBinding): React.ReactNode;
13
+ //# sourceMappingURL=helper-text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helper-text.d.ts","sourceRoot":"","sources":["../../src/widgets/helper-text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAElD;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,GAAG,KAAK,CAAC,SAAS,CASlE"}
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ /**
4
+ * MUI's helper line doubles as description and error, and it renders nothing
5
+ * when helperText is empty, so the live region has to be a stable child of it
6
+ * rather than the line itself. Only the error goes inside the region: the
7
+ * description is not news and should not be re-announced.
8
+ *
9
+ * Always returning an element keeps the line mounted without reserving it with
10
+ * a blank string, which would change layout to prime the announcement.
11
+ */
12
+ export function helperContent(field) {
13
+ return (_jsxs(_Fragment, { children: [_jsx("span", { "aria-live": "polite", "aria-atomic": "true", children: field.error ?? '' }), field.invalid ? null : field.description] }));
14
+ }
15
+ //# sourceMappingURL=helper-text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helper-text.js","sourceRoot":"","sources":["../../src/widgets/helper-text.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAAC,KAAmB;IAC/C,OAAO,CACL,8BACE,4BAAgB,QAAQ,iBAAa,MAAM,YACxC,KAAK,CAAC,KAAK,IAAI,EAAE,GACb,EACN,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,IACxC,CACJ,CAAA;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@texaryn/react-mui",
3
- "version": "0.1.4",
3
+ "version": "0.3.0",
4
4
  "description": "Material UI v9 widgets for Texaryn: MUI components on top of @texaryn/react",
5
5
  "keywords": [
6
6
  "react",
@@ -41,12 +41,12 @@
41
41
  "CHANGELOG.md"
42
42
  ],
43
43
  "dependencies": {
44
- "@texaryn/core": "^0.5.0"
44
+ "@texaryn/core": "^0.7.0"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@mui/material": "^9.0.0",
48
48
  "react": ">=18.0.0",
49
- "@texaryn/react": "^0.2.4"
49
+ "@texaryn/react": "^0.4.0"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@emotion/react": "^11.14.0",
@@ -57,8 +57,8 @@
57
57
  "jsdom": "^25.0.0",
58
58
  "react": "^19.0.0",
59
59
  "react-dom": "^19.0.0",
60
- "@texaryn/schema-json": "0.2.4",
61
- "@texaryn/react": "0.2.4"
60
+ "@texaryn/react": "0.4.0",
61
+ "@texaryn/schema-json": "0.3.0"
62
62
  },
63
63
  "scripts": {
64
64
  "build": "tsc --build"