@cratis/components.mui 0.0.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CONFORMANCE.md ADDED
@@ -0,0 +1,32 @@
1
+ <!-- Copyright (c) Cratis. All rights reserved. -->
2
+ <!-- Licensed under the MIT license. See LICENSE file in the project root for full license information. -->
3
+
4
+ # MUI adapter conformance
5
+
6
+ The adapter declares `stable-presentation/v1` at renderer ABI major 1. Repository evidence runs
7
+ `@cratis/components.conformance` against all nine declared slots and requires every applicable check
8
+ to pass with zero failures and zero skips. The generated report is the authoritative check inventory.
9
+
10
+ The bounded checks cover:
11
+
12
+ - schema-valid package metadata and exact static/runtime consistency;
13
+ - every stable part, canonical state, and typed `pt` destination;
14
+ - exact native elements and native refs;
15
+ - native names, values, submit/reset, disabled/read-only, validation, and autofill-shaped props;
16
+ - one value-first `ChangeHandler` callback with `source: 'user'` and the originating native `Event`;
17
+ - current and deprecated Button appearance mapping and canonical data attributes;
18
+ - real MUI DOM identities for all nine slots;
19
+ - deterministic SSR and mismatch-free hydration; and
20
+ - package peers, archive boundaries, runtime loading, declaration hygiene, and strict Bundler and
21
+ NodeNext consumers with `skipLibCheck: false`.
22
+
23
+ The generic overlay absent/present check has no applicable slot in this nine-slot profile; it is
24
+ reported as a bounded pass but supplies no MUI overlay evidence. Portable part names and typed `pt`
25
+ destinations are preserved, while MUI may add wrappers or nest parts differently from the built-in
26
+ renderer; undocumented descendant order and sibling selectors are not portable contracts.
27
+
28
+ This is automated jsdom/axe and package evidence, not universal browser, visual, RTL, forced-colors,
29
+ reduced-motion, or assistive-technology certification. MUI RTL requires host theme direction and an
30
+ RTL-configured Emotion cache, which this adapter's provider ABI cannot create per request. MUI's
31
+ CSS-in-JS output likewise requires host-specific, request-local Emotion cache and style extraction
32
+ during SSR. No MUI X package is included or exercised.
package/LICENSE ADDED
@@ -0,0 +1,30 @@
1
+ MIT License
2
+
3
+ Copyright (c) Cratis
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ Third-party MIT notices
24
+ -----------------------
25
+ MUI Core (@mui/material and Core support packages): Copyright (c) 2014
26
+ Call-Em-All and Copyright (c) 2016-2026 MUI. Licensed under the MIT License
27
+ above. MUI X is not included.
28
+
29
+ Emotion (@emotion/react and @emotion/styled): Copyright (c) Emotion team and
30
+ other contributors. Licensed under the MIT License above.
package/README.md CHANGED
@@ -1,3 +1,78 @@
1
- # @cratis/components.mui
1
+ <!-- Copyright (c) Cratis. All rights reserved. -->
2
+ <!-- Licensed under the MIT license. See LICENSE file in the project root for full license information. -->
2
3
 
3
- Reserved for the Cratis Components release workflow.
4
+ # `@cratis/components.mui`
5
+
6
+ Material UI adapter for the nine stable presentation slots in the Cratis Components renderer ABI v1.
7
+ The package shares the Components repository release version while the renderer ABI remains
8
+ versioned separately. It exports one stable `CratisPresentationUiLibrary` manifest, `muiUiLibrary`. This certifies nine-slot primitive
9
+ adaptation, never full-catalog replacement.
10
+
11
+ > **Publication status:** The install example targets the owner-authorized 4.0.0 npm release. When
12
+ > reading this README from repository source before that release, verify availability with
13
+ > `npm view @cratis/components.mui@4.0.0 version`; source contributors use the workspace in this
14
+ > checkout.
15
+
16
+ ## Install
17
+
18
+ ```sh
19
+ npm install @cratis/components.mui@^4 @cratis/components@^4 \
20
+ @mui/material@^9 @emotion/react@^11 @emotion/styled@^11 react@^19 react-dom@^19
21
+ ```
22
+
23
+ Node-based build, test, and server-rendering environments require Node.js 23 or newer.
24
+
25
+ Select the adapter on the application Components provider:
26
+
27
+ ```tsx
28
+ import { CratisComponentsProvider } from '@cratis/components';
29
+ import { muiUiLibrary } from '@cratis/components.mui';
30
+
31
+ export const Application = () => (
32
+ <CratisComponentsProvider value={{ locale: 'en-US' }} library={muiUiLibrary}>
33
+ <main>Application content</main>
34
+ </CratisComponentsProvider>
35
+ );
36
+ ```
37
+
38
+ The adapter covers Button, IconButton, TextInput, TextArea, Checkbox, Radio, Switch,
39
+ ProgressBar, and Surface. It deliberately excludes MUI X and does not implement the five atomic
40
+ interaction slots.
41
+
42
+ ## Theme integration
43
+
44
+ The manifest provider mounts the MUI `ThemeProvider`. An outer CSS-variable MUI theme is reused.
45
+ An outer non-variable theme is converted to an equivalent CSS-variable theme so its palette and
46
+ other values remain in force. Without an outer provider, MUI's default theme becomes a sane
47
+ CSS-variable-enabled theme. The conversion is memoized and deterministic during server rendering.
48
+
49
+ Put application customization outside `CratisComponentsProvider`:
50
+
51
+ ```tsx
52
+ <ThemeProvider theme={applicationTheme}>
53
+ <CratisComponentsProvider value={{ locale: 'en-US' }} library={muiUiLibrary}>
54
+ <Application />
55
+ </CratisComponentsProvider>
56
+ </ThemeProvider>
57
+ ```
58
+
59
+ The renderer provider ABI receives only `children` and non-secret boolean setup attestations; it
60
+ cannot receive an Emotion cache. SSR hosts
61
+ must create an Emotion cache per request, mount Emotion's `CacheProvider` outside the Components
62
+ provider, and extract critical styles from that same request-local cache. Sharing a cache between
63
+ requests can leak styles and ordering. RTL additionally requires the host MUI theme direction and
64
+ an Emotion cache configured with the RTL Stylis plugin. These are application/host integration
65
+ concerns and do not justify a Core ABI change.
66
+
67
+ ## Peer policy
68
+
69
+ MUI Core is bounded to `>=9 <10`, `@emotion/react` to `>=11.5 <12`,
70
+ `@emotion/styled` to `>=11.11 <12`, and React/ReactDOM to React 19. Vendor packages are peers.
71
+ The repository's packed-consumer matrix proves both these effective lower boundaries and the
72
+ current-highest compatible boundary; exact current versions remain dev dependencies only.
73
+
74
+ The adapter requires `@cratis/components >=4 <5`. This range is intentionally bounded to the
75
+ Components major whose renderer ABI and stable presentation profile it implements.
76
+
77
+ See [CONFORMANCE.md](./CONFORMANCE.md) for the bounded evidence and
78
+ [THIRD_PARTY_NOTICES.md](./THIRD_PARTY_NOTICES.md) for upstream licenses.
@@ -0,0 +1,35 @@
1
+ <!-- Copyright (c) Cratis. All rights reserved. -->
2
+ <!-- Licensed under the MIT license. See LICENSE file in the project root for full license information. -->
3
+
4
+ # Third-party notices
5
+
6
+ This adapter interoperates with peer-installed software. It does not bundle the following packages.
7
+
8
+ ## MUI Core
9
+
10
+ MUI Core (`@mui/material` and its Core support packages) is Copyright (c) 2014 Call-Em-All and
11
+ Copyright (c) 2016-2026 MUI and licensed under the MIT License.
12
+
13
+ MUI X is explicitly excluded from this adapter.
14
+
15
+ ## Emotion
16
+
17
+ Emotion (`@emotion/react` and `@emotion/styled`) is Copyright (c) Emotion team and other
18
+ contributors and licensed under the MIT License.
19
+
20
+ ## MIT License text
21
+
22
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
23
+ associated documentation files (the "Software"), to deal in the Software without restriction,
24
+ including without limitation the rights to use, copy, modify, merge, publish, distribute,
25
+ sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
26
+ furnished to do so, subject to the following conditions:
27
+
28
+ The above copyright notice and this permission notice shall be included in all copies or substantial
29
+ portions of the Software.
30
+
31
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
32
+ NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
33
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
34
+ OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
35
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,4 @@
1
+ import { type CratisPresentationUiLibrary } from '@cratis/components/renderer';
2
+ /** Material UI implementation of the stable Cratis presentation profile. */
3
+ export declare const muiUiLibrary: CratisPresentationUiLibrary;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AA2CA,OAAO,EAQH,KAAK,2BAA2B,EACnC,MAAM,6BAA6B,CAAC;AA+6BrC,4EAA4E;AAC5E,eAAO,MAAM,YAAY,EAAE,2BAUzB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,411 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ // Copyright (c) Cratis. All rights reserved.
3
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
4
+ import { forwardRef, useCallback, useEffect, useMemo, useRef, useState, } from 'react';
5
+ import MuiButton from '@mui/material/Button';
6
+ import MuiCheckbox from '@mui/material/Checkbox';
7
+ import MuiIconButton from '@mui/material/IconButton';
8
+ import MuiInputBase from '@mui/material/InputBase';
9
+ import MuiLinearProgress from '@mui/material/LinearProgress';
10
+ import MuiPaper from '@mui/material/Paper';
11
+ import MuiRadio from '@mui/material/Radio';
12
+ import MuiSwitch from '@mui/material/Switch';
13
+ import MuiTooltip from '@mui/material/Tooltip';
14
+ import { ThemeProvider, createTheme, useTheme } from '@mui/material/styles';
15
+ import { CRATIS_PRESENTATION_ABI_VERSION, CRATIS_PRESENTATION_PROFILE, cratisPresentationSlotIds, definePresentationUiLibrary, } from '@cratis/components/renderer';
16
+ const capabilities = Object.freeze([
17
+ 'slot.render',
18
+ 'parts.passthrough',
19
+ 'ssr.staticRender',
20
+ ]);
21
+ const MuiAdapterProvider = ({ children }) => {
22
+ const outerTheme = useTheme();
23
+ const theme = useMemo(() => outerTheme.vars
24
+ ? outerTheme
25
+ : createTheme({ ...outerTheme, cssVariables: true }), [outerTheme]);
26
+ return _jsx(ThemeProvider, { theme: theme, children: children });
27
+ };
28
+ const classNames = (...values) => values.filter(Boolean).join(' ');
29
+ const toneForSeverity = {
30
+ secondary: 'neutral',
31
+ info: 'accent',
32
+ help: 'accent',
33
+ success: 'positive',
34
+ warn: 'caution',
35
+ danger: 'critical',
36
+ contrast: 'neutral',
37
+ };
38
+ const severityForTone = {
39
+ neutral: 'secondary',
40
+ accent: 'info',
41
+ positive: 'success',
42
+ caution: 'warn',
43
+ critical: 'danger',
44
+ };
45
+ const muiColorForTone = (tone) => {
46
+ switch (tone) {
47
+ case 'neutral':
48
+ return 'secondary';
49
+ case 'positive':
50
+ return 'success';
51
+ case 'caution':
52
+ return 'warning';
53
+ case 'critical':
54
+ return 'error';
55
+ case 'accent':
56
+ default:
57
+ return 'primary';
58
+ }
59
+ };
60
+ const muiVariant = (variant) => {
61
+ switch (variant) {
62
+ case 'solid':
63
+ return 'contained';
64
+ case 'outline':
65
+ return 'outlined';
66
+ case 'ghost':
67
+ case 'link':
68
+ return 'text';
69
+ default:
70
+ throw new Error(`Unsupported Button variant '${String(variant)}'.`);
71
+ }
72
+ };
73
+ const muiSize = (size) => size === 'normal' ? 'medium' : size;
74
+ const renderIcon = (icon) => typeof icon === 'string' ? _jsx("i", { className: icon, "aria-hidden": 'true' }) : icon;
75
+ const warnedDeprecatedProps = new Set();
76
+ const warnForDeprecatedProp = (prop) => {
77
+ const environment = globalThis.process?.env?.NODE_ENV;
78
+ if (environment === 'production' || warnedDeprecatedProps.has(prop))
79
+ return;
80
+ warnedDeprecatedProps.add(prop);
81
+ console.warn(`Button prop "${prop}" is deprecated and will be removed in 5.0. Use variant, tone, or shape instead.`);
82
+ };
83
+ const resolveButtonVariant = ({ variant, link, text, outlined, }) => {
84
+ if (variant)
85
+ return variant;
86
+ if (link)
87
+ return 'link';
88
+ if (text)
89
+ return 'ghost';
90
+ if (outlined)
91
+ return 'outline';
92
+ return 'solid';
93
+ };
94
+ const resolveButtonAppearance = (options) => {
95
+ const { tone, shape, text, link, outlined, rounded, severity } = options;
96
+ if (text !== undefined)
97
+ warnForDeprecatedProp('text');
98
+ if (link !== undefined)
99
+ warnForDeprecatedProp('link');
100
+ if (outlined !== undefined)
101
+ warnForDeprecatedProp('outlined');
102
+ if (rounded !== undefined)
103
+ warnForDeprecatedProp('rounded');
104
+ if (severity !== undefined)
105
+ warnForDeprecatedProp('severity');
106
+ return {
107
+ variant: resolveButtonVariant(options),
108
+ tone: tone ?? (severity ? toneForSeverity[severity] : undefined),
109
+ shape: shape ?? (rounded ? 'pill' : 'default'),
110
+ severity: tone ? severityForTone[tone] : severity,
111
+ };
112
+ };
113
+ const MuiButtonContent = ({ icon, label, children, pt }) => (_jsxs(_Fragment, { children: [icon ? (_jsx("span", { ...pt?.icon, className: classNames('cratis-mui-button__icon', pt?.icon?.className), "data-cratis-part": 'icon', "aria-hidden": pt?.icon?.['aria-hidden'] ?? true, children: renderIcon(icon) })) : null, label !== undefined || children !== undefined ? (_jsxs("span", { ...pt?.label, className: classNames('cratis-mui-button__label', pt?.label?.className), "data-cratis-part": 'label', children: [label, children] })) : null] }));
114
+ const muiButtonStyles = (appearance) => ({
115
+ borderRadius: appearance.shape === 'pill' ? 9999 : undefined,
116
+ textTransform: appearance.variant === 'link' ? 'none' : undefined,
117
+ padding: appearance.variant === 'link' ? 0 : undefined,
118
+ minWidth: appearance.variant === 'link' ? 0 : undefined,
119
+ });
120
+ const muiLoadingIndicator = (pt) => (_jsx("span", { ...pt?.spinner, className: classNames('cratis-mui-button__spinner', pt?.spinner?.className), "data-cratis-part": 'spinner', "aria-hidden": 'true' }));
121
+ const withMuiTooltip = (element, tooltip, options) => {
122
+ if (!tooltip)
123
+ return element;
124
+ return (_jsx(MuiTooltip, { title: tooltip, placement: options?.position, classes: { tooltip: options?.className ?? '' }, children: element }));
125
+ };
126
+ const MuiButtonSlot = forwardRef(function MuiButtonSlot({ label, icon, loading = false, tooltip, tooltipOptions, pt, variant, tone, shape, text, link, outlined, rounded, severity, size = 'normal', disabled, type = 'button', title, autoFocus, onClick, className, style, children, ...nativeProps }, ref) {
127
+ const appearance = resolveButtonAppearance({
128
+ variant,
129
+ tone,
130
+ shape,
131
+ text,
132
+ link,
133
+ outlined,
134
+ rounded,
135
+ severity,
136
+ });
137
+ const effectiveDisabled = Boolean(disabled || loading);
138
+ const iconOnly = Boolean(icon) && label === undefined && !children;
139
+ const button = (_jsx(MuiButton, { ...pt?.root, ...nativeProps, ref: ref, type: type, title: title, autoFocus: autoFocus, disabled: effectiveDisabled, onClick: onClick, className: classNames('cratis-mui-button', pt?.root?.className, className), style: { ...pt?.root?.style, ...style }, variant: muiVariant(appearance.variant), color: muiColorForTone(appearance.tone), size: muiSize(size), loading: loading, loadingIndicator: muiLoadingIndicator(pt), sx: muiButtonStyles(appearance), "aria-busy": loading || undefined, "data-cratis-part": 'root', "data-variant": appearance.variant, "data-tone": appearance.tone, "data-severity": appearance.severity, "data-shape": appearance.shape, "data-size": size, "data-disabled": effectiveDisabled || undefined, "data-loading": loading || undefined, "data-icon-only": iconOnly || undefined, children: _jsx(MuiButtonContent, { icon: loading ? undefined : icon, label: label, pt: pt, children: children }) }));
140
+ return withMuiTooltip(button, tooltip, tooltipOptions);
141
+ });
142
+ const MuiIconButtonSlot = forwardRef(function MuiIconButtonSlot({ icon, loading = false, tooltip, tooltipOptions, pt, variant, tone, shape = 'pill', text, link, outlined, rounded, severity, size = 'normal', disabled, type = 'button', title, autoFocus, onClick, className, style, 'aria-label': ariaLabel, ...nativeProps }, ref) {
143
+ const appearance = resolveButtonAppearance({
144
+ variant,
145
+ tone,
146
+ shape,
147
+ text,
148
+ link,
149
+ outlined,
150
+ rounded,
151
+ severity,
152
+ });
153
+ const effectiveDisabled = Boolean(disabled || loading);
154
+ const button = (_jsx(MuiIconButton, { ...pt?.root, ...nativeProps, ref: ref, type: type, title: title, autoFocus: autoFocus, disabled: effectiveDisabled, onClick: onClick, className: classNames('cratis-mui-icon-button', pt?.root?.className, className), style: { ...pt?.root?.style, ...style }, color: muiColorForTone(appearance.tone), size: muiSize(size), loading: loading, loadingIndicator: muiLoadingIndicator(pt), sx: { borderRadius: appearance.shape === 'pill' ? '50%' : 1 }, "aria-label": ariaLabel, "aria-busy": loading || undefined, "data-cratis-part": 'root', "data-variant": appearance.variant, "data-tone": appearance.tone, "data-severity": appearance.severity, "data-shape": appearance.shape, "data-size": size, "data-disabled": effectiveDisabled || undefined, "data-loading": loading || undefined, "data-icon-only": 'true', children: !loading && (_jsx("span", { ...pt?.icon, className: classNames('cratis-mui-button__icon', pt?.icon?.className), "data-cratis-part": 'icon', "aria-hidden": pt?.icon?.['aria-hidden'] ?? true, children: renderIcon(icon) })) }));
155
+ return withMuiTooltip(button, tooltip, tooltipOptions);
156
+ });
157
+ const MuiTextInputSlot = forwardRef(function MuiTextInputSlot({ type = 'text', invalid = false, onChange, pt, className, style, disabled, readOnly, 'aria-invalid': ariaInvalid, ...nativeProps }, ref) {
158
+ const effectiveDisabled = disabled ?? pt?.root?.disabled;
159
+ const effectiveReadOnly = readOnly ?? pt?.root?.readOnly;
160
+ const effectiveAriaInvalid = ariaInvalid ?? pt?.root?.['aria-invalid'] ?? (invalid || undefined);
161
+ const effectiveInvalid = invalid || effectiveAriaInvalid === true || effectiveAriaInvalid === 'true';
162
+ const inputProps = {
163
+ ...pt?.root,
164
+ ...nativeProps,
165
+ type,
166
+ disabled: effectiveDisabled,
167
+ readOnly: effectiveReadOnly,
168
+ 'aria-invalid': effectiveAriaInvalid,
169
+ onChange: (event) => {
170
+ pt?.root?.onChange?.(event);
171
+ onChange?.(event.currentTarget.value, {
172
+ source: 'user',
173
+ nativeEvent: event.nativeEvent,
174
+ });
175
+ },
176
+ className: classNames('cratis-mui-text-input', pt?.root?.className, className),
177
+ style: { ...pt?.root?.style, ...style },
178
+ 'data-cratis-part': 'root',
179
+ 'data-disabled': effectiveDisabled || undefined,
180
+ 'data-invalid': effectiveInvalid || undefined,
181
+ 'data-readonly': effectiveReadOnly || undefined,
182
+ };
183
+ return (_jsx(MuiInputBase, { inputRef: ref, type: type, disabled: effectiveDisabled, readOnly: effectiveReadOnly, error: effectiveInvalid, inputProps: inputProps }));
184
+ });
185
+ const MuiTextAreaSlot = forwardRef(function MuiTextAreaSlot({ invalid = false, onChange, pt, className, style, disabled, readOnly, 'aria-invalid': ariaInvalid, ...nativeProps }, ref) {
186
+ const effectiveDisabled = disabled ?? pt?.root?.disabled;
187
+ const effectiveReadOnly = readOnly ?? pt?.root?.readOnly;
188
+ const effectiveAriaInvalid = ariaInvalid ?? pt?.root?.['aria-invalid'] ?? (invalid || undefined);
189
+ const effectiveInvalid = invalid || effectiveAriaInvalid === true || effectiveAriaInvalid === 'true';
190
+ const inputProps = {
191
+ ...pt?.root,
192
+ ...nativeProps,
193
+ disabled: effectiveDisabled,
194
+ readOnly: effectiveReadOnly,
195
+ 'aria-invalid': effectiveAriaInvalid,
196
+ onChange: (event) => {
197
+ pt?.root?.onChange?.(event);
198
+ onChange?.(event.currentTarget.value, {
199
+ source: 'user',
200
+ nativeEvent: event.nativeEvent,
201
+ });
202
+ },
203
+ className: classNames('cratis-mui-text-area', pt?.root?.className, className),
204
+ style: { ...pt?.root?.style, ...style },
205
+ 'data-cratis-part': 'root',
206
+ 'data-disabled': effectiveDisabled || undefined,
207
+ 'data-invalid': effectiveInvalid || undefined,
208
+ 'data-readonly': effectiveReadOnly || undefined,
209
+ };
210
+ return (_jsx(MuiInputBase, { inputRef: ref, multiline: true, inputComponent: 'textarea', disabled: effectiveDisabled, readOnly: effectiveReadOnly, error: effectiveInvalid, inputProps: inputProps }));
211
+ });
212
+ const assignRef = (ref, value) => {
213
+ if (typeof ref === 'function')
214
+ ref(value);
215
+ else if (ref)
216
+ ref.current = value;
217
+ };
218
+ const useNativeCheckedState = (checked, defaultChecked, forwardedRef, options = {}) => {
219
+ const observeRadioGroup = options.observeRadioGroup ?? false;
220
+ const inputRef = useRef(null);
221
+ const [uncontrolledChecked, setUncontrolledChecked] = useState(Boolean(defaultChecked));
222
+ const controlled = checked !== undefined;
223
+ const ref = useCallback((input) => {
224
+ inputRef.current = input;
225
+ assignRef(forwardedRef, input);
226
+ }, [forwardedRef]);
227
+ useEffect(() => {
228
+ const input = inputRef.current;
229
+ if (!input || controlled)
230
+ return;
231
+ const synchronize = () => queueMicrotask(() => setUncontrolledChecked(input.checked));
232
+ const form = input.form;
233
+ form?.addEventListener('reset', synchronize);
234
+ if (observeRadioGroup)
235
+ input.ownerDocument.addEventListener('change', synchronize);
236
+ return () => {
237
+ form?.removeEventListener('reset', synchronize);
238
+ if (observeRadioGroup)
239
+ input.ownerDocument.removeEventListener('change', synchronize);
240
+ };
241
+ }, [controlled, observeRadioGroup]);
242
+ return {
243
+ ref,
244
+ selected: checked ?? uncontrolledChecked,
245
+ synchronize: (nextChecked) => {
246
+ if (!controlled)
247
+ setUncontrolledChecked(nextChecked);
248
+ },
249
+ };
250
+ };
251
+ const stateAttributes = (disabled, invalid, readOnly, selected) => ({
252
+ 'data-disabled': disabled || undefined,
253
+ 'data-invalid': invalid || undefined,
254
+ 'data-readonly': readOnly || undefined,
255
+ 'data-selected': selected || undefined,
256
+ });
257
+ const useResolvedMuiChoice = (kind, props, forwardedRef) => {
258
+ const parts = props.pt;
259
+ const inputPart = parts?.input;
260
+ const checked = props.checked ?? inputPart?.checked;
261
+ const defaultChecked = props.defaultChecked ?? inputPart?.defaultChecked;
262
+ const disabled = props.disabled ?? inputPart?.disabled;
263
+ const readOnly = props.readOnly ?? inputPart?.readOnly;
264
+ const ariaInvalid = props['aria-invalid'] ??
265
+ inputPart?.['aria-invalid'] ??
266
+ (props.invalid || undefined);
267
+ const invalid = Boolean(props.invalid) || ariaInvalid === true || ariaInvalid === 'true';
268
+ const state = useNativeCheckedState(checked, defaultChecked, forwardedRef, {
269
+ observeRadioGroup: kind === 'radio',
270
+ });
271
+ return {
272
+ parts,
273
+ inputPart,
274
+ checked,
275
+ defaultChecked,
276
+ disabled,
277
+ readOnly,
278
+ ariaInvalid,
279
+ state,
280
+ attributes: stateAttributes(disabled, invalid, readOnly, state.selected),
281
+ };
282
+ };
283
+ const choiceIndicator = (kind, parts, attributes, selected) => (_jsx("span", { ...parts?.indicator, className: classNames(`cratis-mui-${kind}__indicator`, parts?.indicator?.className), "data-cratis-part": 'indicator', "aria-hidden": 'true', ...attributes, children: kind === 'checkbox' && selected ? '✓' : undefined }));
284
+ const MuiChoiceControl = ({ kind, checked, defaultChecked, disabled, onChange, input, parts, attributes, }) => {
285
+ const uncontrolledDefault = checked === undefined ? defaultChecked : undefined;
286
+ switch (kind) {
287
+ case 'switch': {
288
+ const switchParts = parts;
289
+ const root = {
290
+ ...switchParts?.control,
291
+ className: classNames('cratis-mui-switch__control', switchParts?.control?.className),
292
+ 'data-cratis-part': 'control',
293
+ ...attributes,
294
+ };
295
+ const thumb = {
296
+ ...switchParts?.handle,
297
+ className: classNames('cratis-mui-switch__handle', switchParts?.handle?.className),
298
+ 'data-cratis-part': 'handle',
299
+ ...attributes,
300
+ };
301
+ return (_jsx(MuiSwitch, { checked: checked, defaultChecked: uncontrolledDefault, disabled: disabled, onChange: onChange, slotProps: { root, input, thumb } }));
302
+ }
303
+ case 'radio': {
304
+ const radioParts = parts;
305
+ const root = {
306
+ ...radioParts?.box,
307
+ className: classNames('cratis-mui-radio__box', radioParts?.box?.className),
308
+ 'data-cratis-part': 'box',
309
+ ...attributes,
310
+ };
311
+ return (_jsx(MuiRadio, { checked: checked, defaultChecked: uncontrolledDefault, disabled: disabled, onChange: onChange, icon: choiceIndicator('radio', radioParts, attributes, false), checkedIcon: choiceIndicator('radio', radioParts, attributes, true), slotProps: { root, input } }));
312
+ }
313
+ case 'checkbox': {
314
+ const checkboxParts = parts;
315
+ const root = {
316
+ ...checkboxParts?.box,
317
+ className: classNames('cratis-mui-checkbox__box', checkboxParts?.box?.className),
318
+ 'data-cratis-part': 'box',
319
+ ...attributes,
320
+ };
321
+ return (_jsx(MuiCheckbox, { checked: checked, defaultChecked: uncontrolledDefault, disabled: disabled, onChange: onChange, icon: choiceIndicator('checkbox', checkboxParts, attributes, false), checkedIcon: choiceIndicator('checkbox', checkboxParts, attributes, true), slotProps: { root, input } }));
322
+ }
323
+ default:
324
+ throw new Error(`Unsupported choice kind '${String(kind)}'.`);
325
+ }
326
+ };
327
+ const MuiChoice = ({ kind, props, forwardedRef }) => {
328
+ const { parts, inputPart, checked, defaultChecked, disabled, readOnly, ariaInvalid, state, attributes, } = useResolvedMuiChoice(kind, props, forwardedRef);
329
+ const { label, readOnly: _readOnly, invalid: _invalid, onChange, className, style, pt: _parts, checked: _checked, defaultChecked: _defaultChecked, disabled: _disabled, onClick, 'aria-invalid': _ariaInvalid, ...nativeProps } = props;
330
+ const { onClick: partOnClick, onChange: partOnChange, className: inputClassName, style: inputStyle, readOnly: _partReadOnly, checked: _partChecked, defaultChecked: _partDefaultChecked, disabled: _partDisabled, ...inputPartRest } = inputPart ?? {};
331
+ const radioProps = props;
332
+ const input = {
333
+ ...inputPartRest,
334
+ ...nativeProps,
335
+ ref: state.ref,
336
+ name: kind === 'radio' ? radioProps.name : nativeProps.name,
337
+ value: kind === 'radio' ? radioProps.value : nativeProps.value,
338
+ 'aria-invalid': ariaInvalid,
339
+ 'aria-readonly': kind === 'radio' ? undefined : readOnly || undefined,
340
+ role: kind === 'switch' ? 'switch' : nativeProps.role,
341
+ className: classNames('cratis-mui-choice__input', inputClassName),
342
+ style: inputStyle,
343
+ 'data-cratis-part': 'input',
344
+ ...attributes,
345
+ onClick: (event) => {
346
+ partOnClick?.(event);
347
+ onClick?.(event);
348
+ if (readOnly)
349
+ event.preventDefault();
350
+ },
351
+ };
352
+ const handleChange = (event) => {
353
+ partOnChange?.(event);
354
+ if (readOnly || (kind === 'radio' && !event.currentTarget.checked))
355
+ return;
356
+ state.synchronize(event.currentTarget.checked);
357
+ onChange?.(event.currentTarget.checked, {
358
+ source: 'user',
359
+ nativeEvent: event.nativeEvent,
360
+ });
361
+ };
362
+ const labelPart = parts?.label;
363
+ return (_jsxs("label", { ...parts?.root, className: classNames('cratis-mui-choice', parts?.root?.className, className), style: { ...parts?.root?.style, ...style }, "data-cratis-part": 'root', ...attributes, children: [_jsx(MuiChoiceControl, { kind: kind, checked: checked, defaultChecked: defaultChecked, disabled: disabled, onChange: handleChange, input: input, parts: parts, attributes: attributes }), label !== undefined && (_jsx("span", { ...labelPart, className: classNames('cratis-mui-choice__label', labelPart?.className), "data-cratis-part": 'label', ...attributes, children: label }))] }));
364
+ };
365
+ const MuiCheckboxSlot = forwardRef(function MuiCheckboxSlot(props, ref) {
366
+ return _jsx(MuiChoice, { kind: 'checkbox', props: props, forwardedRef: ref });
367
+ });
368
+ const MuiRadioSlot = forwardRef(function MuiRadioSlot(props, ref) {
369
+ return _jsx(MuiChoice, { kind: 'radio', props: props, forwardedRef: ref });
370
+ });
371
+ const MuiSwitchSlot = forwardRef(function MuiSwitchSlot(props, ref) {
372
+ return _jsx(MuiChoice, { kind: 'switch', props: props, forwardedRef: ref });
373
+ });
374
+ const MuiProgressSlot = ({ value = 0, mode = 'determinate', showValue = true, 'aria-label': ariaLabel = 'Progress', 'aria-labelledby': ariaLabelledBy, className, }) => {
375
+ const boundedValue = Math.min(100, Math.max(0, value));
376
+ const determinate = mode === 'determinate';
377
+ const busy = !determinate || boundedValue < 100;
378
+ return (_jsxs("div", { role: 'progressbar', "aria-label": ariaLabelledBy ? undefined : ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-valuemin": determinate ? 0 : undefined, "aria-valuemax": determinate ? 100 : undefined, "aria-valuenow": determinate ? boundedValue : undefined, className: classNames('cratis-mui-progress', className), "data-cratis-part": 'root', "data-mode": mode, "data-busy": busy || undefined, "data-loading": !determinate || undefined, children: [_jsx(MuiLinearProgress, { variant: determinate ? 'determinate' : 'indeterminate', value: determinate ? boundedValue : undefined, role: 'presentation', "aria-hidden": 'true', "data-cratis-part": 'indicator' }), determinate && showValue && (_jsxs("span", { "data-cratis-part": 'label', children: [boundedValue, "%"] }))] }));
379
+ };
380
+ const MuiSurfaceSlot = forwardRef(function MuiSurfaceSlot({ as: Element = 'div', pt, className, style, ...nativeProps }, ref) {
381
+ return (_jsx(MuiPaper, { ...pt?.root, ...nativeProps, component: Element, ref: ref, className: classNames('cratis-mui-surface', pt?.root?.className, className), style: { ...pt?.root?.style, ...style }, "data-cratis-part": 'root' }));
382
+ });
383
+ const declaration = (render) => Object.freeze({
384
+ mode: 'presentation',
385
+ fidelity: 'native',
386
+ render,
387
+ });
388
+ const slots = Object.freeze({
389
+ 'common.button': declaration(MuiButtonSlot),
390
+ 'common.iconButton': declaration(MuiIconButtonSlot),
391
+ 'common.textInput': declaration(MuiTextInputSlot),
392
+ 'common.textArea': declaration(MuiTextAreaSlot),
393
+ 'common.checkbox': declaration(MuiCheckboxSlot),
394
+ 'common.radio': declaration(MuiRadioSlot),
395
+ 'common.switch': declaration(MuiSwitchSlot),
396
+ 'common.progress': declaration(MuiProgressSlot),
397
+ 'common.surface': declaration(MuiSurfaceSlot),
398
+ });
399
+ /** Material UI implementation of the stable Cratis presentation profile. */
400
+ export const muiUiLibrary = definePresentationUiLibrary({
401
+ id: 'cratis-mui',
402
+ displayName: 'Cratis Material UI renderer',
403
+ abi: CRATIS_PRESENTATION_ABI_VERSION,
404
+ level: 'primitive',
405
+ profile: CRATIS_PRESENTATION_PROFILE,
406
+ profileSlots: cratisPresentationSlotIds,
407
+ capabilities,
408
+ slots,
409
+ Provider: MuiAdapterProvider,
410
+ });
411
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EACH,UAAU,EACV,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,GAOX,MAAM,OAAO,CAAC;AACf,OAAO,SAAS,MAAM,sBAAsB,CAAC;AAC7C,OAAO,WAAW,MAAM,wBAAwB,CAAC;AACjD,OAAO,aAAa,MAAM,0BAA0B,CAAC;AACrD,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,iBAAiB,MAAM,8BAA8B,CAAC;AAC7D,OAAO,QAAQ,MAAM,qBAAqB,CAAC;AAC3C,OAAO,QAAQ,MAAM,qBAAqB,CAAC;AAC3C,OAAO,SAAS,MAAM,sBAAsB,CAAC;AAC7C,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAiB5E,OAAO,EACH,+BAA+B,EAC/B,2BAA2B,EAC3B,yBAAyB,EACzB,2BAA2B,GAK9B,MAAM,6BAA6B,CAAC;AAErC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC;IAC/B,aAAa;IACb,mBAAmB;IACnB,kBAAkB;CACoB,CAAC,CAAC;AAE5C,MAAM,kBAAkB,GAAG,CAAC,EAAE,QAAQ,EAAoC,EAAE,EAAE;IAC1E,MAAM,UAAU,GAAG,QAAQ,EAAE,CAAC;IAC9B,MAAM,KAAK,GAAG,OAAO,CACjB,GAAG,EAAE,CACD,UAAU,CAAC,IAAI;QACX,CAAC,CAAC,UAAU;QACZ,CAAC,CAAC,WAAW,CAAC,EAAE,GAAG,UAAU,EAAE,YAAY,EAAE,IAAI,EAAE,C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A2B,CAAC;IACjF,EAAE,EAAE,YAAY;IAChB,WAAW,EAAE,6BAA6B;IAC1C,GAAG,EAAE,+BAA+B;IACpC,KAAK,EAAE,WAAW;IAClB,OAAO,EAAE,2BAA2B;IACpC,YAAY,EAAE,yBAAyB;IACvC,YAAY;IACZ,KAAK;IACL,QAAQ,EAAE,kBAAkB;CAC/B,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,13 +1,123 @@
1
1
  {
2
2
  "name": "@cratis/components.mui",
3
- "version": "0.0.0",
4
- "description": "Reserved package record for the Cratis Components release workflow.",
3
+ "version": "4.1.0",
4
+ "description": "Material UI presentation adapter for Cratis Components renderer ABI v1.",
5
+ "author": "Cratis",
5
6
  "license": "MIT",
6
7
  "type": "module",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/Cratis/Components"
11
+ },
7
12
  "publishConfig": {
8
13
  "access": "public"
9
14
  },
15
+ "engines": {
16
+ "node": ">=23.0.0"
17
+ },
10
18
  "files": [
11
- "README.md"
12
- ]
19
+ "dist",
20
+ "README.md",
21
+ "CONFORMANCE.md",
22
+ "THIRD_PARTY_NOTICES.md",
23
+ "LICENSE"
24
+ ],
25
+ "main": "./dist/index.js",
26
+ "module": "./dist/index.js",
27
+ "types": "./dist/index.d.ts",
28
+ "exports": {
29
+ "./package.json": "./package.json",
30
+ ".": {
31
+ "types": "./dist/index.d.ts",
32
+ "import": "./dist/index.js"
33
+ }
34
+ },
35
+ "sideEffects": false,
36
+ "cratisUiAbi": 1,
37
+ "cratis": {
38
+ "kind": "ui-adapter",
39
+ "id": "cratis-mui",
40
+ "displayName": "Cratis Material UI renderer",
41
+ "abi": "^1",
42
+ "level": "primitive",
43
+ "profile": "stable-presentation/v1",
44
+ "category": "material-ui",
45
+ "entry": "./dist/index.js",
46
+ "export": "muiUiLibrary",
47
+ "slots": [
48
+ "common.button",
49
+ "common.iconButton",
50
+ "common.textInput",
51
+ "common.textArea",
52
+ "common.checkbox",
53
+ "common.radio",
54
+ "common.switch",
55
+ "common.progress",
56
+ "common.surface"
57
+ ],
58
+ "modes": {
59
+ "common.button": "presentation",
60
+ "common.iconButton": "presentation",
61
+ "common.textInput": "presentation",
62
+ "common.textArea": "presentation",
63
+ "common.checkbox": "presentation",
64
+ "common.radio": "presentation",
65
+ "common.switch": "presentation",
66
+ "common.progress": "presentation",
67
+ "common.surface": "presentation"
68
+ },
69
+ "capabilities": [
70
+ "slot.render",
71
+ "parts.passthrough",
72
+ "ssr.staticRender"
73
+ ],
74
+ "ssr": "safe",
75
+ "a11y": {
76
+ "axeProfile": "wcag22aa",
77
+ "evidence": "./CONFORMANCE.md"
78
+ },
79
+ "license": {
80
+ "spdx": "MIT",
81
+ "requiresKey": false
82
+ },
83
+ "upstream": {
84
+ "@mui/material": ">=9 <10",
85
+ "@emotion/react": ">=11.5 <12",
86
+ "@emotion/styled": ">=11.11 <12",
87
+ "react": "^19.0.0",
88
+ "react-dom": "^19.0.0"
89
+ }
90
+ },
91
+ "scripts": {
92
+ "clean": "rm -rf dist",
93
+ "build": "node ../../node_modules/typescript/bin/tsc -p tsconfig.build.json",
94
+ "typecheck-specs": "yarn workspace @cratis/components prepare && yarn workspace @cratis/components.conformance build && node ../../node_modules/typescript/bin/tsc -p tsconfig.json",
95
+ "lint": "node ../../node_modules/eslint/bin/eslint.js . --quiet",
96
+ "test": "node ../../node_modules/vitest/vitest.mjs run --config vitest.config.ts",
97
+ "verify-package": "node ./scripts/verify-packed-package.mjs",
98
+ "ci": "yarn clean && yarn lint && yarn build && yarn typecheck-specs && yarn test && yarn verify-package"
99
+ },
100
+ "peerDependencies": {
101
+ "@cratis/components": "4.1.0",
102
+ "@emotion/react": ">=11.5 <12",
103
+ "@emotion/styled": ">=11.11 <12",
104
+ "@mui/material": ">=9 <10",
105
+ "react": "^19.0.0",
106
+ "react-dom": "^19.0.0"
107
+ },
108
+ "devDependencies": {
109
+ "@cratis/arc": "22.6.2",
110
+ "@cratis/arc.react": "22.6.2",
111
+ "@cratis/components": "4.1.0",
112
+ "@cratis/components.conformance": "4.1.0",
113
+ "@cratis/fundamentals": "^7.10.3",
114
+ "@emotion/react": "11.14.0",
115
+ "@emotion/styled": "11.14.1",
116
+ "@mui/material": "9.4.0",
117
+ "@types/react": "^19.2.18",
118
+ "react": "^19.0.0",
119
+ "react-dom": "^19.0.0",
120
+ "reflect-metadata": "0.2.2",
121
+ "tsyringe": "4.10.0"
122
+ }
13
123
  }