@aglyn/plugins-mui 1.0.0-beta.256 → 1.0.0-beta.258
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/package.json +9 -7
- package/src/lib/components/form-controls.d.ts +33 -0
- package/src/lib/components/form-controls.js +16 -12
- package/src/lib/components/form-controls.js.map +1 -1
- package/src/lib/components/form-pickers.d.ts +69 -0
- package/src/lib/components/form-pickers.js +455 -0
- package/src/lib/components/form-pickers.js.map +1 -0
- package/src/lib/element-tier.d.ts +1 -0
- package/src/lib/element-tier.js +17 -1
- package/src/lib/element-tier.js.map +1 -1
- package/src/lib/plugin.js +13 -0
- package/src/lib/plugin.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aglyn/plugins-mui",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.258",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"homepage": "https://aglyn.com",
|
|
6
6
|
"repository": {
|
|
@@ -25,19 +25,21 @@
|
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aglyn/aglyn": "1.0.0-beta.
|
|
29
|
-
"@aglyn/shared-data-enums": "1.0.0-beta.
|
|
30
|
-
"@aglyn/shared-data-mdi": "1.0.0-beta.
|
|
31
|
-
"@aglyn/shared-ui-jsx": "1.0.0-beta.
|
|
32
|
-
"@aglyn/shared-ui-theme": "1.0.0-beta.
|
|
33
|
-
"@aglyn/shared-util-vendor": "1.0.0-beta.
|
|
28
|
+
"@aglyn/aglyn": "1.0.0-beta.258",
|
|
29
|
+
"@aglyn/shared-data-enums": "1.0.0-beta.258",
|
|
30
|
+
"@aglyn/shared-data-mdi": "1.0.0-beta.258",
|
|
31
|
+
"@aglyn/shared-ui-jsx": "1.0.0-beta.258",
|
|
32
|
+
"@aglyn/shared-ui-theme": "1.0.0-beta.258",
|
|
33
|
+
"@aglyn/shared-util-vendor": "1.0.0-beta.258",
|
|
34
34
|
"@swc/helpers": "0.5.23",
|
|
35
|
+
"dayjs": "^1.11.23",
|
|
35
36
|
"mobx": "^7.0.5",
|
|
36
37
|
"mobx-react-lite": "^5.1.0"
|
|
37
38
|
},
|
|
38
39
|
"peerDependencies": {
|
|
39
40
|
"@mui/material": "^9.3.1",
|
|
40
41
|
"@mui/utils": "^9.2.0",
|
|
42
|
+
"@mui/x-date-pickers": "^9.15.0",
|
|
41
43
|
"react": "^19.2.8"
|
|
42
44
|
},
|
|
43
45
|
"sideEffects": false,
|
|
@@ -22,6 +22,7 @@ import { type FormLabelProps } from '@mui/material/FormLabel';
|
|
|
22
22
|
import { type RadioProps } from '@mui/material/Radio';
|
|
23
23
|
import { type RadioGroupProps } from '@mui/material/RadioGroup';
|
|
24
24
|
import { type RatingProps } from '@mui/material/Rating';
|
|
25
|
+
import { type SxProps, type Theme } from '@mui/material/styles';
|
|
25
26
|
import { type ReactNode } from 'react';
|
|
26
27
|
export declare const FORM_CONTROL_ID: Aglyn.ComponentId;
|
|
27
28
|
export declare const FORM_LABEL_ID: Aglyn.ComponentId;
|
|
@@ -34,6 +35,16 @@ export declare const RADIO_GROUP_ID: Aglyn.ComponentId;
|
|
|
34
35
|
export declare const RADIO_ID: Aglyn.ComponentId;
|
|
35
36
|
export declare const CHOICE_LABEL_ID: Aglyn.ComponentId;
|
|
36
37
|
export declare const RATING_ID: Aglyn.ComponentId;
|
|
38
|
+
/**
|
|
39
|
+
* The Date and Time Pickers' module (AGL-3825), loaded from here so its chunk
|
|
40
|
+
* is a child of this one: see `formPickers` in element-tier.ts.
|
|
41
|
+
*/
|
|
42
|
+
export declare const loadFormPickers: () => Promise<typeof import("./form-pickers")>;
|
|
43
|
+
/**
|
|
44
|
+
* The id a Form Control gives the input inside it, so the Form Label beside
|
|
45
|
+
* that input names it (`for=`) without the author wiring anything.
|
|
46
|
+
*/
|
|
47
|
+
export declare const FieldIdContext: import("react").Context<string>;
|
|
37
48
|
export interface AglynFormControlProps extends FormControlProps {
|
|
38
49
|
children?: ReactNode;
|
|
39
50
|
}
|
|
@@ -59,6 +70,13 @@ export interface AglynInputProps {
|
|
|
59
70
|
fullWidth?: boolean;
|
|
60
71
|
[key: string]: any;
|
|
61
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Whether the site theme draws inputs filled: the Input style its Style
|
|
75
|
+
* components card sets, which is MUI's own text field default.
|
|
76
|
+
*/
|
|
77
|
+
export declare const useFilledInputs: () => boolean;
|
|
78
|
+
/** A node's `sx`, as a list the outline can go in front of. */
|
|
79
|
+
export declare const nodeSxList: (sx: unknown) => SxProps<Theme>[];
|
|
62
80
|
/** The box a visitor types in. */
|
|
63
81
|
export declare const AglynInput: import("react").ForwardRefExoticComponent<Omit<AglynInputProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
64
82
|
/** One line of help or guidance under a field. */
|
|
@@ -104,6 +122,19 @@ export interface AglynChoiceLabelProps {
|
|
|
104
122
|
export declare const AglynChoiceLabel: import("react").ForwardRefExoticComponent<Omit<AglynChoiceLabelProps, "ref"> & import("react").RefAttributes<HTMLLabelElement>>;
|
|
105
123
|
/** Stars a visitor picks; sends the number chosen. */
|
|
106
124
|
export declare const AglynRating: import("react").ForwardRefExoticComponent<Omit<RatingProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
125
|
+
export declare const FIELD_NAME: Aglyn.AglynAttributeSchema;
|
|
126
|
+
/**
|
|
127
|
+
* Which field of the form's dataset this answer is stored under — the same
|
|
128
|
+
* picker the all-in-one Form Field had, listing the fields of the dataset
|
|
129
|
+
* chosen on the Form around it. Stored by id, so renaming the dataset field
|
|
130
|
+
* never breaks the mapping; left empty, the answer matches by name.
|
|
131
|
+
*/
|
|
132
|
+
export declare const FIELD_DATASET_FIELD: Aglyn.AglynAttributeSchema;
|
|
133
|
+
export declare const FIELD_INPUT_SIZE: Aglyn.AglynAttributeSchema;
|
|
134
|
+
export declare const FIELD_REQUIRED: Aglyn.AglynAttributeSchema;
|
|
135
|
+
export declare const FIELD_ARIA_LABEL: Aglyn.AglynAttributeSchema;
|
|
136
|
+
export declare const FIELD_FULL_WIDTH: Aglyn.AglynAttributeSchema;
|
|
137
|
+
export declare const category = Aglyn.ComponentCategory.FORMS;
|
|
107
138
|
export declare const formControlSchema: Aglyn.ComponentSchema<AglynFormControlProps>;
|
|
108
139
|
export declare const formLabelSchema: Aglyn.ComponentSchema<FormLabelProps>;
|
|
109
140
|
export declare const inputSchema: Aglyn.ComponentSchema<AglynInputProps>;
|
|
@@ -115,6 +146,8 @@ export declare const radioGroupSchema: Aglyn.ComponentSchema<RadioGroupProps>;
|
|
|
115
146
|
export declare const radioSchema: Aglyn.ComponentSchema<RadioProps>;
|
|
116
147
|
export declare const choiceLabelSchema: Aglyn.ComponentSchema<AglynChoiceLabelProps>;
|
|
117
148
|
export declare const ratingSchema: Aglyn.ComponentSchema<RatingProps>;
|
|
149
|
+
export declare const node: (componentId: Aglyn.ComponentId, props?: Record<string, unknown>, nodes?: Aglyn.NodePresetData[], sx?: Record<string, unknown>) => Aglyn.NodePresetData;
|
|
118
150
|
/** A labelled text field: Form Control › Form Label + Input. */
|
|
119
151
|
export declare const textFieldPreset: (label: string, input: Record<string, unknown>) => Aglyn.NodePresetData;
|
|
152
|
+
export declare const preset: ($id: string, displayName: string, description: string, icon: string, data: Aglyn.NodePresetData) => Aglyn.PresetSchema;
|
|
120
153
|
export declare const formControlPresets: Aglyn.PresetSchema[];
|
|
@@ -58,10 +58,14 @@ export const RADIO_GROUP_ID = 'muiRadioGroup';
|
|
|
58
58
|
export const RADIO_ID = 'muiRadio';
|
|
59
59
|
export const CHOICE_LABEL_ID = 'muiFormControlLabel';
|
|
60
60
|
export const RATING_ID = 'muiRating';
|
|
61
|
+
/**
|
|
62
|
+
* The Date and Time Pickers' module (AGL-3825), loaded from here so its chunk
|
|
63
|
+
* is a child of this one: see `formPickers` in element-tier.ts.
|
|
64
|
+
*/ export const loadFormPickers = ()=>import("./form-pickers.js");
|
|
61
65
|
/**
|
|
62
66
|
* The id a Form Control gives the input inside it, so the Form Label beside
|
|
63
67
|
* that input names it (`for=`) without the author wiring anything.
|
|
64
|
-
*/ const FieldIdContext = /*#__PURE__*/ createContext(undefined);
|
|
68
|
+
*/ export const FieldIdContext = /*#__PURE__*/ createContext(undefined);
|
|
65
69
|
/** A field's frame: label, input and help text together. */ export const AglynFormControl = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
66
70
|
const id = `field-${useId().replace(/:/g, '')}`;
|
|
67
71
|
return /*#__PURE__*/ _jsx(FieldIdContext.Provider, {
|
|
@@ -121,11 +125,11 @@ AglynFormLabel.displayName = 'AglynFormLabel';
|
|
|
121
125
|
/**
|
|
122
126
|
* Whether the site theme draws inputs filled: the Input style its Style
|
|
123
127
|
* components card sets, which is MUI's own text field default.
|
|
124
|
-
*/ const useFilledInputs = ()=>{
|
|
128
|
+
*/ export const useFilledInputs = ()=>{
|
|
125
129
|
var _useTheme_components_MuiTextField_defaultProps, _useTheme_components_MuiTextField, _useTheme_components;
|
|
126
130
|
return ((_useTheme_components = useTheme().components) == null ? void 0 : (_useTheme_components_MuiTextField = _useTheme_components.MuiTextField) == null ? void 0 : (_useTheme_components_MuiTextField_defaultProps = _useTheme_components_MuiTextField.defaultProps) == null ? void 0 : _useTheme_components_MuiTextField_defaultProps.variant) === 'filled';
|
|
127
131
|
};
|
|
128
|
-
/** A node's `sx`, as a list the outline can go in front of. */ const nodeSxList = (sx)=>sx === undefined || sx === null ? [] : Array.isArray(sx) ? sx : [
|
|
132
|
+
/** A node's `sx`, as a list the outline can go in front of. */ export const nodeSxList = (sx)=>sx === undefined || sx === null ? [] : Array.isArray(sx) ? sx : [
|
|
129
133
|
sx
|
|
130
134
|
];
|
|
131
135
|
/** The box a visitor types in. */ export const AglynInput = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
@@ -291,7 +295,7 @@ AglynChoiceLabel.displayName = 'AglynChoiceLabel';
|
|
|
291
295
|
}, withoutMapping(props))));
|
|
292
296
|
AglynRating.displayName = 'AglynRating';
|
|
293
297
|
// ── Attributes ──────────────────────────────────────────────────────────────
|
|
294
|
-
const FIELD_NAME = {
|
|
298
|
+
export const FIELD_NAME = {
|
|
295
299
|
name: 'name',
|
|
296
300
|
label: 'Field name',
|
|
297
301
|
description: 'What the answer is sent as — the key it is stored under in submissions. ' + 'Two inputs in one form need two names (radios share their group’s).',
|
|
@@ -302,13 +306,13 @@ const FIELD_NAME = {
|
|
|
302
306
|
* picker the all-in-one Form Field had, listing the fields of the dataset
|
|
303
307
|
* chosen on the Form around it. Stored by id, so renaming the dataset field
|
|
304
308
|
* never breaks the mapping; left empty, the answer matches by name.
|
|
305
|
-
*/ const FIELD_DATASET_FIELD = {
|
|
309
|
+
*/ export const FIELD_DATASET_FIELD = {
|
|
306
310
|
name: 'datasetFieldId',
|
|
307
311
|
label: 'Maps to schema field',
|
|
308
312
|
description: 'The field of the form’s dataset this answer is stored under. Left ' + 'empty, it matches a dataset field by its Field name.',
|
|
309
313
|
component: Aglyn.FieldComponentType.DATASET_FIELD_SELECT
|
|
310
314
|
};
|
|
311
|
-
const FIELD_INPUT_SIZE = {
|
|
315
|
+
export const FIELD_INPUT_SIZE = {
|
|
312
316
|
name: 'size',
|
|
313
317
|
label: 'Size',
|
|
314
318
|
description: 'Normal is 56px tall; Small is 40px, to sit beside a button.',
|
|
@@ -324,19 +328,19 @@ const FIELD_INPUT_SIZE = {
|
|
|
324
328
|
}
|
|
325
329
|
]
|
|
326
330
|
};
|
|
327
|
-
const FIELD_REQUIRED = {
|
|
331
|
+
export const FIELD_REQUIRED = {
|
|
328
332
|
name: 'required',
|
|
329
333
|
label: 'Required?',
|
|
330
334
|
description: 'The form will not send until this is answered.',
|
|
331
335
|
component: Aglyn.FieldComponentType.SWITCH
|
|
332
336
|
};
|
|
333
|
-
const FIELD_ARIA_LABEL = {
|
|
337
|
+
export const FIELD_ARIA_LABEL = {
|
|
334
338
|
name: 'ariaLabel',
|
|
335
339
|
label: 'Accessible label',
|
|
336
340
|
description: 'Names the input for screen readers when there is no Form Label beside ' + 'it. Not shown on the page.',
|
|
337
341
|
component: Aglyn.FieldComponentType.TEXT_FIELD
|
|
338
342
|
};
|
|
339
|
-
const FIELD_FULL_WIDTH = {
|
|
343
|
+
export const FIELD_FULL_WIDTH = {
|
|
340
344
|
name: 'fullWidth',
|
|
341
345
|
label: 'Full width?',
|
|
342
346
|
description: 'Fills the width of whatever holds it.',
|
|
@@ -354,7 +358,7 @@ const FIELD_CHOICE_VALUE = {
|
|
|
354
358
|
description: 'What is sent when this is chosen.',
|
|
355
359
|
component: Aglyn.FieldComponentType.TEXT_FIELD
|
|
356
360
|
};
|
|
357
|
-
const category = Aglyn.ComponentCategory.FORMS;
|
|
361
|
+
export const category = Aglyn.ComponentCategory.FORMS;
|
|
358
362
|
export const formControlSchema = {
|
|
359
363
|
$id: FORM_CONTROL_ID,
|
|
360
364
|
pluginId: BUNDLE_ID,
|
|
@@ -651,7 +655,7 @@ export const ratingSchema = {
|
|
|
651
655
|
]
|
|
652
656
|
};
|
|
653
657
|
// ── Presets: ready-made arrangements of the pieces above ────────────────────
|
|
654
|
-
const node = (componentId, props, nodes, sx)=>_extends({
|
|
658
|
+
export const node = (componentId, props, nodes, sx)=>_extends({
|
|
655
659
|
$id: null,
|
|
656
660
|
componentId,
|
|
657
661
|
pluginId: BUNDLE_ID
|
|
@@ -672,7 +676,7 @@ const node = (componentId, props, nodes, sx)=>_extends({
|
|
|
672
676
|
fullWidth: true
|
|
673
677
|
}, input))
|
|
674
678
|
]);
|
|
675
|
-
const preset = ($id, displayName, description, icon, data)=>({
|
|
679
|
+
export const preset = ($id, displayName, description, icon, data)=>({
|
|
676
680
|
$id,
|
|
677
681
|
type: Aglyn.NodeType.PRESET,
|
|
678
682
|
displayName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/plugins/mui/src/lib/components/form-controls.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as Aglyn from '@aglyn/aglyn'\nimport {\n mdiCheckboxMarkedOutline,\n mdiFormDropdown,\n mdiFormTextbox,\n mdiFormatText,\n mdiRadioboxMarked,\n mdiStarOutline,\n mdiTextShort,\n mdiTagOutline,\n mdiFormSelect,\n} from '@aglyn/shared-data-mdi'\nimport Checkbox, { type CheckboxProps } from '@mui/material/Checkbox'\nimport FormControl, { type FormControlProps } from '@mui/material/FormControl'\nimport FormControlLabel from '@mui/material/FormControlLabel'\nimport FormHelperText, {\n type FormHelperTextProps,\n} from '@mui/material/FormHelperText'\nimport FilledInput from '@mui/material/FilledInput'\nimport FormLabel, { type FormLabelProps } from '@mui/material/FormLabel'\nimport NativeSelect from '@mui/material/NativeSelect'\nimport OutlinedInput from '@mui/material/OutlinedInput'\nimport Radio, { type RadioProps } from '@mui/material/Radio'\nimport RadioGroup, { type RadioGroupProps } from '@mui/material/RadioGroup'\nimport Rating, { type RatingProps } from '@mui/material/Rating'\nimport {\n alpha,\n type SxProps,\n type Theme,\n useTheme,\n} from '@mui/material/styles'\nimport {\n createContext,\n forwardRef,\n type ReactNode,\n useContext,\n useId,\n} from 'react'\nimport { BUNDLE_ID } from '../constants/bundle-common'\nimport { FIELD_TEXT_CONTENT } from '../constants/field-presets'\nimport { dropClearedProps } from '../utils/drop-cleared-props'\nimport { generatePresetId } from '../utils/generate-preset-id'\n\n/*\n * MUI's FORM ELEMENTS, ONE BESIGNER ELEMENT EACH.\n *\n * A field is not one element: it is a Form Control holding a label, an input\n * and a line of help text, exactly as MUI builds it. Each piece is placed,\n * selected and styled on its own — a label's color, an input's fill and\n * corners, the help text's size — with the ordinary Styles panel, and the\n * presets at the bottom of this file are just ready-made arrangements of\n * them. Nothing here knows about forms submitting: an input carries a NAME,\n * and whatever form it sits in sends what the browser sends.\n *\n * Component ids are persisted in documents; never rename them.\n */\nexport const FORM_CONTROL_ID: Aglyn.ComponentId = 'muiFormControl'\nexport const FORM_LABEL_ID: Aglyn.ComponentId = 'muiFormLabel'\nexport const INPUT_ID: Aglyn.ComponentId = 'muiInput'\nexport const FORM_HELPER_TEXT_ID: Aglyn.ComponentId = 'muiFormHelperText'\nexport const SELECT_ID: Aglyn.ComponentId = 'muiSelect'\nexport const SELECT_OPTION_ID: Aglyn.ComponentId = 'muiSelectOption'\nexport const CHECKBOX_ID: Aglyn.ComponentId = 'muiCheckbox'\nexport const RADIO_GROUP_ID: Aglyn.ComponentId = 'muiRadioGroup'\nexport const RADIO_ID: Aglyn.ComponentId = 'muiRadio'\nexport const CHOICE_LABEL_ID: Aglyn.ComponentId = 'muiFormControlLabel'\nexport const RATING_ID: Aglyn.ComponentId = 'muiRating'\n\n/**\n * The id a Form Control gives the input inside it, so the Form Label beside\n * that input names it (`for=`) without the author wiring anything.\n */\nconst FieldIdContext = createContext<string | undefined>(undefined)\n\nexport interface AglynFormControlProps extends FormControlProps {\n children?: ReactNode\n}\n\n/** A field's frame: label, input and help text together. */\nexport const AglynFormControl = forwardRef<HTMLDivElement, AglynFormControlProps>(\n (props, ref) => {\n const id = `field-${useId().replace(/:/g, '')}`\n return (\n <FieldIdContext.Provider value={id}>\n <FormControl ref={ref} {...dropClearedProps(props)} />\n </FieldIdContext.Provider>\n )\n },\n)\nAglynFormControl.displayName = 'AglynFormControl'\n\n/** The label above an input, linked to it by the Form Control. */\nexport const AglynFormLabel = forwardRef<HTMLLabelElement, FormLabelProps>(\n (props, ref) => {\n const id = useContext(FieldIdContext)\n return (\n <FormLabel\n ref={ref as never}\n component=\"label\"\n {...(id ? { htmlFor: id } : {})}\n {...dropClearedProps(props)}\n />\n )\n },\n)\nAglynFormLabel.displayName = 'AglynFormLabel'\n\nexport interface AglynInputProps {\n /** What the answer is sent as. */\n name?: string\n type?: 'text' | 'email' | 'tel' | 'url' | 'number'\n /** Several lines (a message box) instead of one. */\n multiline?: boolean\n /** Lines a multi-line input starts at. */\n minRows?: number\n placeholder?: string\n required?: boolean\n /**\n * A name for assistive technology when no Form Label sits beside the\n * input — a sign-up row with only a placeholder, for one.\n */\n ariaLabel?: string\n fullWidth?: boolean\n [key: string]: any\n}\n\n/**\n * The outline an Input or Select draws, ON ITS OWN BOX.\n *\n * MUI paints an outlined input's border with an inner `<fieldset>`, so the\n * Styles panel's Border Color, Border and Corner Radius — which reach the\n * element's own box — would change nothing a visitor can see. Hiding that\n * fieldset and drawing the same outline (MUI's resting, hover, focus and\n * error colors) on the box itself puts every border and corner field on the\n * outline you actually see. The node's own styles come after, so whatever an\n * author sets wins; focus and error still show through their own rules.\n *\n * The resting outline sits under `:where()`, which weighs nothing, so the\n * site theme's input border color (the Style components card) outranks it,\n * as MUI's own corner radius and the theme's corners already do.\n */\nconst outlinedBoxSx = (theme: Theme) => ({\n '*:where(&)': {\n border: '1px solid',\n borderColor: alpha(theme.palette.text.primary, 0.23),\n },\n '& .MuiOutlinedInput-notchedOutline': { display: 'none' },\n '&:hover': { borderColor: 'text.primary' },\n '&.Mui-focused': {\n borderColor: 'primary.main',\n boxShadow: `0 0 0 1px ${theme.palette.primary.main}`,\n },\n '&.Mui-error': { borderColor: 'error.main' },\n '&.Mui-disabled': { borderColor: 'action.disabled' },\n})\n\n/**\n * Whether the site theme draws inputs filled: the Input style its Style\n * components card sets, which is MUI's own text field default.\n */\nconst useFilledInputs = () =>\n useTheme().components?.MuiTextField?.defaultProps?.variant === 'filled'\n\n/** A node's `sx`, as a list the outline can go in front of. */\nconst nodeSxList = (sx: unknown): SxProps<Theme>[] =>\n sx === undefined || sx === null\n ? []\n : ((Array.isArray(sx) ? sx : [sx]) as SxProps<Theme>[])\n\n/** The box a visitor types in. */\nexport const AglynInput = forwardRef<HTMLDivElement, AglynInputProps>(\n (props, ref) => {\n const {\n name,\n type,\n multiline,\n minRows,\n placeholder,\n required,\n ariaLabel,\n datasetFieldId: _datasetFieldId,\n ...rest\n } = dropClearedProps(props)\n const id = useContext(FieldIdContext)\n const filled = useFilledInputs()\n const inputProps = {\n ...(id ? { id } : {}),\n name: name || undefined,\n type: multiline ? undefined : type || 'text',\n multiline: Boolean(multiline),\n ...(multiline ? { minRows: minRows || 3 } : {}),\n placeholder: placeholder || undefined,\n required: Boolean(required),\n inputProps: ariaLabel ? { 'aria-label': ariaLabel } : undefined,\n }\n if (filled) return <FilledInput ref={ref} {...inputProps} {...rest} />\n return (\n <OutlinedInput\n ref={ref}\n // The label is its own element above the box, so the outline never\n // carries a notch for a floating one.\n notched={false}\n {...inputProps}\n {...rest}\n sx={[outlinedBoxSx, ...nodeSxList(rest['sx'])] as SxProps<Theme>}\n />\n )\n },\n)\nAglynInput.displayName = 'AglynInput'\n\n/** One line of help or guidance under a field. */\nexport const AglynFormHelperText = forwardRef<\n HTMLParagraphElement,\n FormHelperTextProps\n>((props, ref) => <FormHelperText ref={ref} {...dropClearedProps(props)} />)\nAglynFormHelperText.displayName = 'AglynFormHelperText'\n\nexport interface AglynSelectProps {\n name?: string\n required?: boolean\n /** Shown until a choice is made; never sent as an answer. */\n placeholder?: string\n ariaLabel?: string\n fullWidth?: boolean\n size?: 'small' | 'medium'\n children?: ReactNode\n [key: string]: any\n}\n\n/**\n * A dropdown. Its choices are Select Option elements inside it — the\n * browser's own list, so every choice is a real element a page can edit.\n */\nexport const AglynSelect = forwardRef<HTMLDivElement, AglynSelectProps>(\n (props, ref) => {\n const {\n name,\n required,\n placeholder,\n ariaLabel,\n children,\n size,\n datasetFieldId: _datasetFieldId,\n ...rest\n } = dropClearedProps(props)\n const id = useContext(FieldIdContext)\n const filled = useFilledInputs()\n return (\n <NativeSelect\n ref={ref}\n input={\n filled ? (\n <FilledInput size={size} sx={rest['sx']} />\n ) : (\n <OutlinedInput\n notched={false}\n size={size}\n sx={[outlinedBoxSx, ...nodeSxList(rest['sx'])] as SxProps<Theme>}\n />\n )\n }\n defaultValue=\"\"\n inputProps={{\n ...(id ? { id } : {}),\n name: name || undefined,\n required: Boolean(required),\n ...(ariaLabel ? { 'aria-label': ariaLabel } : {}),\n }}\n {...rest}\n // The node's styles ride the outlined box above, where they reach\n // what a visitor sees.\n sx={undefined}\n >\n <option value=\"\" disabled={Boolean(required)}>\n {placeholder || ''}\n </option>\n {children}\n </NativeSelect>\n )\n },\n)\nAglynSelect.displayName = 'AglynSelect'\n\nexport interface AglynSelectOptionProps {\n value?: string\n children?: ReactNode\n}\n\n/** One choice in a Select. */\nexport const AglynSelectOption = forwardRef<\n HTMLOptionElement,\n AglynSelectOptionProps\n>((props, ref) => {\n const { value, children, ...rest } = dropClearedProps(props)\n const text = typeof children === 'string' ? children : ''\n return (\n <option ref={ref} value={value ?? text} {...(rest as object)}>\n {children}\n </option>\n )\n})\nAglynSelectOption.displayName = 'AglynSelectOption'\n\n/**\n * The props an answer element hands MUI: cleared values dropped, and the\n * dataset mapping — authoring data read off the node, never a DOM attribute —\n * taken out.\n */\nfunction withoutMapping<T extends object>(props: T): T {\n const { datasetFieldId: _datasetFieldId, ...rest } = dropClearedProps(\n props as T & { datasetFieldId?: unknown },\n )\n return rest as T\n}\n\n/** A tick box. Put it in a Choice Label to give it words. */\nexport const AglynCheckbox = forwardRef<HTMLButtonElement, CheckboxProps>(\n (props, ref) => <Checkbox ref={ref} {...withoutMapping(props)} />,\n)\nAglynCheckbox.displayName = 'AglynCheckbox'\n\n/** A set of Radio choices sharing one name; one may be picked. */\nexport const AglynRadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(\n (props, ref) => <RadioGroup ref={ref} {...withoutMapping(props)} />,\n)\nAglynRadioGroup.displayName = 'AglynRadioGroup'\n\n/** One choice in a Radio Group. Put it in a Choice Label to give it words. */\nexport const AglynRadio = forwardRef<HTMLButtonElement, RadioProps>(\n (props, ref) => <Radio ref={ref} {...dropClearedProps(props)} />,\n)\nAglynRadio.displayName = 'AglynRadio'\n\nexport interface AglynChoiceLabelProps {\n /** The words beside the tick box or radio. */\n label?: string\n children?: ReactNode\n [key: string]: any\n}\n\n/**\n * The words beside a Checkbox or Radio, clickable as one with it — MUI's\n * FormControlLabel, holding the control as its child element.\n */\nexport const AglynChoiceLabel = forwardRef<HTMLLabelElement, AglynChoiceLabelProps>(\n (props, ref) => {\n const { label, children, ...rest } = dropClearedProps(props)\n return (\n <FormControlLabel\n ref={ref}\n label={label ?? ''}\n // The control is whatever element the author placed inside; a\n // `display: contents` holder keeps it the label's direct box.\n control={<span style={{ display: 'contents' }}>{children}</span>}\n {...rest}\n />\n )\n },\n)\nAglynChoiceLabel.displayName = 'AglynChoiceLabel'\n\n/** Stars a visitor picks; sends the number chosen. */\nexport const AglynRating = forwardRef<HTMLSpanElement, RatingProps>(\n (props, ref) => <Rating ref={ref} {...withoutMapping(props)} />,\n)\nAglynRating.displayName = 'AglynRating'\n\n// ── Attributes ──────────────────────────────────────────────────────────────\n\nconst FIELD_NAME: Aglyn.AglynAttributeSchema = {\n name: 'name',\n label: 'Field name',\n description:\n 'What the answer is sent as — the key it is stored under in submissions. ' +\n 'Two inputs in one form need two names (radios share their group’s).',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n}\n/**\n * Which field of the form's dataset this answer is stored under — the same\n * picker the all-in-one Form Field had, listing the fields of the dataset\n * chosen on the Form around it. Stored by id, so renaming the dataset field\n * never breaks the mapping; left empty, the answer matches by name.\n */\nconst FIELD_DATASET_FIELD: Aglyn.AglynAttributeSchema = {\n name: 'datasetFieldId',\n label: 'Maps to schema field',\n description:\n 'The field of the form’s dataset this answer is stored under. Left ' +\n 'empty, it matches a dataset field by its Field name.',\n component: Aglyn.FieldComponentType.DATASET_FIELD_SELECT,\n}\nconst FIELD_INPUT_SIZE: Aglyn.AglynAttributeSchema = {\n name: 'size',\n label: 'Size',\n description: 'Normal is 56px tall; Small is 40px, to sit beside a button.',\n component: Aglyn.FieldComponentType.SELECT,\n options: [\n { value: 'medium', label: 'Normal' },\n { value: 'small', label: 'Small' },\n ],\n}\nconst FIELD_REQUIRED: Aglyn.AglynAttributeSchema = {\n name: 'required',\n label: 'Required?',\n description: 'The form will not send until this is answered.',\n component: Aglyn.FieldComponentType.SWITCH,\n}\nconst FIELD_ARIA_LABEL: Aglyn.AglynAttributeSchema = {\n name: 'ariaLabel',\n label: 'Accessible label',\n description:\n 'Names the input for screen readers when there is no Form Label beside ' +\n 'it. Not shown on the page.',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n}\nconst FIELD_FULL_WIDTH: Aglyn.AglynAttributeSchema = {\n name: 'fullWidth',\n label: 'Full width?',\n description: 'Fills the width of whatever holds it.',\n component: Aglyn.FieldComponentType.SWITCH,\n}\nconst FIELD_PLACEHOLDER: Aglyn.AglynAttributeSchema = {\n name: 'placeholder',\n label: 'Placeholder',\n description:\n 'A gray hint inside the empty input, such as you@company.com. It is ' +\n 'not a label: it disappears as soon as someone types.',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n}\nconst FIELD_CHOICE_VALUE: Aglyn.AglynAttributeSchema = {\n name: 'value',\n label: 'Value',\n description: 'What is sent when this is chosen.',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n}\n\nconst category = Aglyn.ComponentCategory.FORMS\n\nexport const formControlSchema: Aglyn.ComponentSchema<AglynFormControlProps> = {\n $id: FORM_CONTROL_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Form Control',\n description:\n 'One field’s frame: holds a Form Label, an input and Helper Text, and ' +\n 'links the label to the input.',\n category,\n icon: { path: mdiFormTextbox.path, sx: { color: 'info.main' } },\n attributes: [\n FIELD_FULL_WIDTH,\n {\n ...FIELD_REQUIRED,\n description: 'Marks the label with an asterisk. Set Required? on the input too.',\n },\n ],\n}\n\nexport const formLabelSchema: Aglyn.ComponentSchema<FormLabelProps> = {\n $id: FORM_LABEL_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Form Label',\n description: 'The words that name a field, above its input.',\n category,\n icon: { path: mdiTagOutline.path, sx: { color: 'info.main' } },\n flags: { textEditable: Aglyn.FEATURE_FLAG.ENABLED },\n attributes: [FIELD_TEXT_CONTENT],\n}\n\nexport const inputSchema: Aglyn.ComponentSchema<AglynInputProps> = {\n $id: INPUT_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Input',\n description: 'A box a visitor types in: text, email, phone, link or number.',\n category,\n icon: { path: mdiTextShort.path, sx: { color: 'info.main' } },\n flags: { selfClosing: Aglyn.FEATURE_FLAG.ENABLED },\n attributes: [\n FIELD_NAME,\n FIELD_DATASET_FIELD,\n {\n name: 'type',\n label: 'Type',\n description: 'What goes in it. Email, phone and link bring the right phone keyboard.',\n component: Aglyn.FieldComponentType.SELECT,\n options: [\n { value: 'text', label: 'Text' },\n { value: 'email', label: 'Email' },\n { value: 'tel', label: 'Phone' },\n { value: 'url', label: 'Link' },\n { value: 'number', label: 'Number' },\n ],\n },\n FIELD_PLACEHOLDER,\n FIELD_REQUIRED,\n {\n name: 'multiline',\n label: 'Several lines?',\n description: 'A message box instead of a single line.',\n component: Aglyn.FieldComponentType.SWITCH,\n },\n FIELD_INPUT_SIZE,\n FIELD_FULL_WIDTH,\n FIELD_ARIA_LABEL,\n ],\n}\n\nexport const formHelperTextSchema: Aglyn.ComponentSchema<FormHelperTextProps> = {\n $id: FORM_HELPER_TEXT_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Helper Text',\n description: 'A line of guidance under a field.',\n category,\n icon: { path: mdiFormatText.path, sx: { color: 'info.main' } },\n flags: { textEditable: Aglyn.FEATURE_FLAG.ENABLED },\n attributes: [FIELD_TEXT_CONTENT],\n}\n\nexport const selectSchema: Aglyn.ComponentSchema<AglynSelectProps> = {\n $id: SELECT_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Select',\n description: 'A dropdown of Select Options; one may be picked.',\n category,\n icon: { path: mdiFormDropdown.path, sx: { color: 'info.main' } },\n restrictChildren: [\n Aglyn.LinealDirectiveFlag.LIMIT_TO,\n { components: [SELECT_OPTION_ID] },\n ],\n attributes: [\n FIELD_NAME,\n FIELD_DATASET_FIELD,\n { ...FIELD_PLACEHOLDER, description: 'Shown until a choice is made; never sent.' },\n FIELD_REQUIRED,\n FIELD_INPUT_SIZE,\n FIELD_FULL_WIDTH,\n FIELD_ARIA_LABEL,\n ],\n}\n\nexport const selectOptionSchema: Aglyn.ComponentSchema<AglynSelectOptionProps> = {\n $id: SELECT_OPTION_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Select Option',\n description: 'One choice in a Select.',\n category,\n icon: { path: mdiFormSelect.path, sx: { color: 'info.main' } },\n flags: {\n selfClosing: Aglyn.FEATURE_FLAG.ENABLED,\n textEditable: Aglyn.FEATURE_FLAG.ENABLED,\n },\n attributes: [\n FIELD_TEXT_CONTENT,\n { ...FIELD_CHOICE_VALUE, description: 'What is sent. Leave empty to send the text.' },\n ],\n}\n\nexport const checkboxSchema: Aglyn.ComponentSchema<CheckboxProps> = {\n $id: CHECKBOX_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Checkbox',\n description: 'A tick box. Put it in a Choice Label to give it words.',\n category,\n icon: { path: mdiCheckboxMarkedOutline.path, sx: { color: 'info.main' } },\n flags: { selfClosing: Aglyn.FEATURE_FLAG.ENABLED },\n attributes: [\n FIELD_NAME,\n FIELD_DATASET_FIELD,\n { ...FIELD_CHOICE_VALUE, description: 'What is sent when ticked, such as Yes.' },\n FIELD_REQUIRED,\n ],\n}\n\nexport const radioGroupSchema: Aglyn.ComponentSchema<RadioGroupProps> = {\n $id: RADIO_GROUP_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Radio Group',\n description: 'A set of Radio choices; one may be picked.',\n category,\n icon: { path: mdiRadioboxMarked.path, sx: { color: 'info.main' } },\n attributes: [\n FIELD_NAME,\n FIELD_DATASET_FIELD,\n {\n name: 'row',\n label: 'In a row?',\n description: 'Side by side instead of one under another.',\n component: Aglyn.FieldComponentType.SWITCH,\n },\n ],\n}\n\nexport const radioSchema: Aglyn.ComponentSchema<RadioProps> = {\n $id: RADIO_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Radio',\n description: 'One choice in a Radio Group. Put it in a Choice Label to give it words.',\n category,\n icon: { path: mdiRadioboxMarked.path, sx: { color: 'info.main' } },\n flags: { selfClosing: Aglyn.FEATURE_FLAG.ENABLED },\n attributes: [FIELD_CHOICE_VALUE, FIELD_REQUIRED],\n}\n\nexport const choiceLabelSchema: Aglyn.ComponentSchema<AglynChoiceLabelProps> = {\n $id: CHOICE_LABEL_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Choice Label',\n description: 'The words beside a Checkbox or Radio placed inside it; clicking them ticks it.',\n category,\n icon: { path: mdiTagOutline.path, sx: { color: 'info.main' } },\n restrictChildren: [\n Aglyn.LinealDirectiveFlag.LIMIT_TO,\n { components: [CHECKBOX_ID, RADIO_ID] },\n ],\n attributes: [\n {\n name: 'label',\n label: 'Text',\n description: 'The words beside the box.',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n },\n ],\n}\n\nexport const ratingSchema: Aglyn.ComponentSchema<RatingProps> = {\n $id: RATING_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Rating',\n description: 'Stars a visitor picks; sends the number chosen.',\n category,\n icon: { path: mdiStarOutline.path, sx: { color: 'info.main' } },\n flags: { selfClosing: Aglyn.FEATURE_FLAG.ENABLED },\n attributes: [\n FIELD_NAME,\n FIELD_DATASET_FIELD,\n {\n name: 'max',\n label: 'Stars',\n description: 'How many stars to show.',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n type: 'number',\n },\n ],\n}\n\n// ── Presets: ready-made arrangements of the pieces above ────────────────────\n\nconst node = (\n componentId: Aglyn.ComponentId,\n props?: Record<string, unknown>,\n nodes?: Aglyn.NodePresetData[],\n sx?: Record<string, unknown>,\n): Aglyn.NodePresetData =>\n ({\n $id: null,\n componentId,\n pluginId: BUNDLE_ID,\n ...(props ? { props } : {}),\n ...(nodes ? { nodes } : {}),\n ...(sx ? { sx } : {}),\n }) as Aglyn.NodePresetData\n\n/** A labelled text field: Form Control › Form Label + Input. */\nexport const textFieldPreset = (\n label: string,\n input: Record<string, unknown>,\n): Aglyn.NodePresetData =>\n node(FORM_CONTROL_ID, { fullWidth: true }, [\n node(FORM_LABEL_ID, { children: label }),\n node(INPUT_ID, { fullWidth: true, ...input }),\n ])\n\nconst preset = (\n $id: string,\n displayName: string,\n description: string,\n icon: string,\n data: Aglyn.NodePresetData,\n): Aglyn.PresetSchema => ({\n $id,\n type: Aglyn.NodeType.PRESET,\n displayName,\n description,\n pluginId: BUNDLE_ID,\n category,\n icon: { path: icon, sx: { color: 'info.main' } },\n data,\n})\n\n/**\n * Each element on its own, so any piece can be inserted by itself — a bare\n * Input beside a Button in a sign-up row, a Form Label above a field the\n * author is assembling, one more Radio in a group. The field presets below\n * are ready-made arrangements of the same pieces.\n */\nconst singleElementPresets: Aglyn.PresetSchema[] = [\n preset(\n generatePresetId(FORM_CONTROL_ID),\n 'Form Control',\n 'An empty field frame: put a Form Label, an input and Helper Text in it.',\n mdiFormTextbox.path,\n node(FORM_CONTROL_ID, { fullWidth: true }),\n ),\n preset(\n generatePresetId(FORM_LABEL_ID),\n 'Form Label',\n 'The words that name a field, above its input.',\n mdiTagOutline.path,\n node(FORM_LABEL_ID, { children: 'Label' }),\n ),\n preset(\n generatePresetId(INPUT_ID),\n 'Input',\n 'A box a visitor types in, on its own.',\n mdiTextShort.path,\n node(INPUT_ID, { name: 'field', placeholder: 'Type here' }),\n ),\n preset(\n generatePresetId(SELECT_ID),\n 'Select',\n 'A dropdown with two options.',\n mdiFormDropdown.path,\n node(SELECT_ID, { name: 'choice', placeholder: 'Choose…' }, [\n node(SELECT_OPTION_ID, { children: 'Option one' }),\n node(SELECT_OPTION_ID, { children: 'Option two' }),\n ]),\n ),\n preset(\n generatePresetId(SELECT_OPTION_ID),\n 'Select Option',\n 'One more choice for a Select.',\n mdiFormSelect.path,\n node(SELECT_OPTION_ID, { children: 'Option' }),\n ),\n preset(\n generatePresetId(RADIO_GROUP_ID),\n 'Radio Group',\n 'A set of Radio choices sharing one Field name.',\n mdiRadioboxMarked.path,\n node(RADIO_GROUP_ID, { name: 'pick' }, [\n node(CHOICE_LABEL_ID, { label: 'First' }, [node(RADIO_ID, { value: 'First' })]),\n node(CHOICE_LABEL_ID, { label: 'Second' }, [node(RADIO_ID, { value: 'Second' })]),\n ]),\n ),\n preset(\n generatePresetId(RADIO_ID),\n 'Radio',\n 'One more choice for a Radio Group, with its words.',\n mdiRadioboxMarked.path,\n node(CHOICE_LABEL_ID, { label: 'Another choice' }, [\n node(RADIO_ID, { value: 'Another choice' }),\n ]),\n ),\n preset(\n generatePresetId(CHOICE_LABEL_ID),\n 'Choice Label',\n 'Words beside a tick box; holds a Checkbox.',\n mdiTagOutline.path,\n node(CHOICE_LABEL_ID, { label: 'Yes, please' }, [\n node(CHECKBOX_ID, { name: 'agree', value: 'Yes' }),\n ]),\n ),\n preset(\n generatePresetId(RATING_ID),\n 'Rating',\n 'Five stars, on their own.',\n mdiStarOutline.path,\n node(RATING_ID, { name: 'rating' }),\n ),\n]\n\nexport const formControlPresets: Aglyn.PresetSchema[] = [\n ...singleElementPresets,\n preset(\n generatePresetId(FORM_CONTROL_ID, 'text'),\n 'Text field',\n 'A label and a one-line input.',\n mdiFormTextbox.path,\n textFieldPreset('Name', { name: 'name' }),\n ),\n preset(\n generatePresetId(FORM_CONTROL_ID, 'email'),\n 'Email field',\n 'A label and an email input.',\n mdiFormTextbox.path,\n textFieldPreset('Email', { name: 'email', type: 'email', required: true }),\n ),\n preset(\n generatePresetId(FORM_CONTROL_ID, 'message'),\n 'Message field',\n 'A label and a several-line input.',\n mdiFormTextbox.path,\n textFieldPreset('Message', { name: 'message', multiline: true, minRows: 4 }),\n ),\n preset(\n generatePresetId(FORM_CONTROL_ID, 'select'),\n 'Dropdown field',\n 'A label and a Select with three options.',\n mdiFormDropdown.path,\n node(FORM_CONTROL_ID, { fullWidth: true }, [\n node(FORM_LABEL_ID, { children: 'Choose one' }),\n node(SELECT_ID, { name: 'choice', fullWidth: true, placeholder: 'Choose…' }, [\n node(SELECT_OPTION_ID, { children: 'Option one' }),\n node(SELECT_OPTION_ID, { children: 'Option two' }),\n node(SELECT_OPTION_ID, { children: 'Option three' }),\n ]),\n ]),\n ),\n preset(\n generatePresetId(FORM_CONTROL_ID, 'radio'),\n 'Radio choice field',\n 'A label and a Radio Group with three choices.',\n mdiRadioboxMarked.path,\n node(FORM_CONTROL_ID, {}, [\n node(FORM_LABEL_ID, { children: 'Pick one' }),\n node(RADIO_GROUP_ID, { name: 'pick' }, [\n node(CHOICE_LABEL_ID, { label: 'First' }, [node(RADIO_ID, { value: 'First' })]),\n node(CHOICE_LABEL_ID, { label: 'Second' }, [node(RADIO_ID, { value: 'Second' })]),\n node(CHOICE_LABEL_ID, { label: 'Third' }, [node(RADIO_ID, { value: 'Third' })]),\n ]),\n ]),\n ),\n preset(\n generatePresetId(FORM_CONTROL_ID, 'checkbox'),\n 'Checkbox',\n 'A tick box with words beside it.',\n mdiCheckboxMarkedOutline.path,\n node(CHOICE_LABEL_ID, { label: 'Yes, please' }, [\n node(CHECKBOX_ID, { name: 'agree', value: 'Yes' }),\n ]),\n ),\n preset(\n generatePresetId(FORM_HELPER_TEXT_ID),\n 'Helper Text',\n 'A line of guidance under a field.',\n mdiFormatText.path,\n node(FORM_HELPER_TEXT_ID, { children: 'We never share your address.' }),\n ),\n preset(\n generatePresetId(FORM_CONTROL_ID, 'rating'),\n 'Rating field',\n 'A label and five stars.',\n mdiStarOutline.path,\n node(FORM_CONTROL_ID, {}, [\n node(FORM_LABEL_ID, { children: 'How did we do?' }),\n node(RATING_ID, { name: 'rating' }),\n ]),\n ),\n]\n"],"names":["Aglyn","mdiCheckboxMarkedOutline","mdiFormDropdown","mdiFormTextbox","mdiFormatText","mdiRadioboxMarked","mdiStarOutline","mdiTextShort","mdiTagOutline","mdiFormSelect","Checkbox","FormControl","FormControlLabel","FormHelperText","FilledInput","FormLabel","NativeSelect","OutlinedInput","Radio","RadioGroup","Rating","alpha","useTheme","createContext","forwardRef","useContext","useId","BUNDLE_ID","FIELD_TEXT_CONTENT","dropClearedProps","generatePresetId","FORM_CONTROL_ID","FORM_LABEL_ID","INPUT_ID","FORM_HELPER_TEXT_ID","SELECT_ID","SELECT_OPTION_ID","CHECKBOX_ID","RADIO_GROUP_ID","RADIO_ID","CHOICE_LABEL_ID","RATING_ID","FieldIdContext","undefined","AglynFormControl","props","ref","id","replace","Provider","value","displayName","AglynFormLabel","component","htmlFor","outlinedBoxSx","theme","border","borderColor","palette","text","primary","display","boxShadow","main","useFilledInputs","components","MuiTextField","defaultProps","variant","nodeSxList","sx","Array","isArray","AglynInput","name","type","multiline","minRows","placeholder","required","ariaLabel","datasetFieldId","_datasetFieldId","rest","filled","inputProps","Boolean","notched","AglynFormHelperText","AglynSelect","children","size","input","defaultValue","option","disabled","AglynSelectOption","withoutMapping","AglynCheckbox","AglynRadioGroup","AglynRadio","AglynChoiceLabel","label","control","span","style","AglynRating","FIELD_NAME","description","FieldComponentType","TEXT_FIELD","FIELD_DATASET_FIELD","DATASET_FIELD_SELECT","FIELD_INPUT_SIZE","SELECT","options","FIELD_REQUIRED","SWITCH","FIELD_ARIA_LABEL","FIELD_FULL_WIDTH","FIELD_PLACEHOLDER","FIELD_CHOICE_VALUE","category","ComponentCategory","FORMS","formControlSchema","$id","pluginId","icon","path","color","attributes","formLabelSchema","flags","textEditable","FEATURE_FLAG","ENABLED","inputSchema","selfClosing","formHelperTextSchema","selectSchema","restrictChildren","LinealDirectiveFlag","LIMIT_TO","selectOptionSchema","checkboxSchema","radioGroupSchema","radioSchema","choiceLabelSchema","ratingSchema","node","componentId","nodes","textFieldPreset","fullWidth","preset","data","NodeType","PRESET","singleElementPresets","formControlPresets"],"mappings":";;;AAAA;;;;;;;;;;;;;;;CAeC,GAED,YAAYA,WAAW,eAAc;AACrC,SACEC,wBAAwB,EACxBC,eAAe,EACfC,cAAc,EACdC,aAAa,EACbC,iBAAiB,EACjBC,cAAc,EACdC,YAAY,EACZC,aAAa,EACbC,aAAa,QACR,yBAAwB;AAC/B,OAAOC,cAAsC,yBAAwB;AACrE,OAAOC,iBAA4C,4BAA2B;AAC9E,OAAOC,sBAAsB,iCAAgC;AAC7D,OAAOC,oBAEA,+BAA8B;AACrC,OAAOC,iBAAiB,4BAA2B;AACnD,OAAOC,eAAwC,0BAAyB;AACxE,OAAOC,kBAAkB,6BAA4B;AACrD,OAAOC,mBAAmB,8BAA6B;AACvD,OAAOC,WAAgC,sBAAqB;AAC5D,OAAOC,gBAA0C,2BAA0B;AAC3E,OAAOC,YAAkC,uBAAsB;AAC/D,SACEC,KAAK,EAGLC,QAAQ,QACH,uBAAsB;AAC7B,SACEC,aAAa,EACbC,UAAU,EAEVC,UAAU,EACVC,KAAK,QACA,QAAO;AACd,SAASC,SAAS,QAAQ,gCAA4B;AACtD,SAASC,kBAAkB,QAAQ,gCAA4B;AAC/D,SAASC,gBAAgB,QAAQ,iCAA6B;AAC9D,SAASC,gBAAgB,QAAQ,iCAA6B;AAE9D;;;;;;;;;;;;CAYC,GACD,OAAO,MAAMC,kBAAqC,iBAAgB;AAClE,OAAO,MAAMC,gBAAmC,eAAc;AAC9D,OAAO,MAAMC,WAA8B,WAAU;AACrD,OAAO,MAAMC,sBAAyC,oBAAmB;AACzE,OAAO,MAAMC,YAA+B,YAAW;AACvD,OAAO,MAAMC,mBAAsC,kBAAiB;AACpE,OAAO,MAAMC,cAAiC,cAAa;AAC3D,OAAO,MAAMC,iBAAoC,gBAAe;AAChE,OAAO,MAAMC,WAA8B,WAAU;AACrD,OAAO,MAAMC,kBAAqC,sBAAqB;AACvE,OAAO,MAAMC,Y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yD,UAAU;IAA+B;IAEvEiE,OACE9H,iBAAiBC,iBAAiB,WAClC,gBACA,2BACAzB,eAAe4H,IAAI,EACnBqB,KAAKxH,iBAAiB,CAAC,GAAG;QACxBwH,KAAKvH,eAAe;YAAE2D,UAAU;QAAiB;QACjD4D,KAAK9G,WAAW;YAAEkC,MAAM;QAAS;KAClC;CAEJ,CAAA"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/mui/src/lib/components/form-controls.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as Aglyn from '@aglyn/aglyn'\nimport {\n mdiCheckboxMarkedOutline,\n mdiFormDropdown,\n mdiFormTextbox,\n mdiFormatText,\n mdiRadioboxMarked,\n mdiStarOutline,\n mdiTextShort,\n mdiTagOutline,\n mdiFormSelect,\n} from '@aglyn/shared-data-mdi'\nimport Checkbox, { type CheckboxProps } from '@mui/material/Checkbox'\nimport FormControl, { type FormControlProps } from '@mui/material/FormControl'\nimport FormControlLabel from '@mui/material/FormControlLabel'\nimport FormHelperText, {\n type FormHelperTextProps,\n} from '@mui/material/FormHelperText'\nimport FilledInput from '@mui/material/FilledInput'\nimport FormLabel, { type FormLabelProps } from '@mui/material/FormLabel'\nimport NativeSelect from '@mui/material/NativeSelect'\nimport OutlinedInput from '@mui/material/OutlinedInput'\nimport Radio, { type RadioProps } from '@mui/material/Radio'\nimport RadioGroup, { type RadioGroupProps } from '@mui/material/RadioGroup'\nimport Rating, { type RatingProps } from '@mui/material/Rating'\nimport {\n alpha,\n type SxProps,\n type Theme,\n useTheme,\n} from '@mui/material/styles'\nimport {\n createContext,\n forwardRef,\n type ReactNode,\n useContext,\n useId,\n} from 'react'\nimport { BUNDLE_ID } from '../constants/bundle-common'\nimport { FIELD_TEXT_CONTENT } from '../constants/field-presets'\nimport { dropClearedProps } from '../utils/drop-cleared-props'\nimport { generatePresetId } from '../utils/generate-preset-id'\n\n/*\n * MUI's FORM ELEMENTS, ONE BESIGNER ELEMENT EACH.\n *\n * A field is not one element: it is a Form Control holding a label, an input\n * and a line of help text, exactly as MUI builds it. Each piece is placed,\n * selected and styled on its own — a label's color, an input's fill and\n * corners, the help text's size — with the ordinary Styles panel, and the\n * presets at the bottom of this file are just ready-made arrangements of\n * them. Nothing here knows about forms submitting: an input carries a NAME,\n * and whatever form it sits in sends what the browser sends.\n *\n * Component ids are persisted in documents; never rename them.\n */\nexport const FORM_CONTROL_ID: Aglyn.ComponentId = 'muiFormControl'\nexport const FORM_LABEL_ID: Aglyn.ComponentId = 'muiFormLabel'\nexport const INPUT_ID: Aglyn.ComponentId = 'muiInput'\nexport const FORM_HELPER_TEXT_ID: Aglyn.ComponentId = 'muiFormHelperText'\nexport const SELECT_ID: Aglyn.ComponentId = 'muiSelect'\nexport const SELECT_OPTION_ID: Aglyn.ComponentId = 'muiSelectOption'\nexport const CHECKBOX_ID: Aglyn.ComponentId = 'muiCheckbox'\nexport const RADIO_GROUP_ID: Aglyn.ComponentId = 'muiRadioGroup'\nexport const RADIO_ID: Aglyn.ComponentId = 'muiRadio'\nexport const CHOICE_LABEL_ID: Aglyn.ComponentId = 'muiFormControlLabel'\nexport const RATING_ID: Aglyn.ComponentId = 'muiRating'\n\n/**\n * The Date and Time Pickers' module (AGL-3825), loaded from here so its chunk\n * is a child of this one: see `formPickers` in element-tier.ts.\n */\nexport const loadFormPickers = () => import('./form-pickers')\n\n/**\n * The id a Form Control gives the input inside it, so the Form Label beside\n * that input names it (`for=`) without the author wiring anything.\n */\nexport const FieldIdContext = createContext<string | undefined>(undefined)\n\nexport interface AglynFormControlProps extends FormControlProps {\n children?: ReactNode\n}\n\n/** A field's frame: label, input and help text together. */\nexport const AglynFormControl = forwardRef<HTMLDivElement, AglynFormControlProps>(\n (props, ref) => {\n const id = `field-${useId().replace(/:/g, '')}`\n return (\n <FieldIdContext.Provider value={id}>\n <FormControl ref={ref} {...dropClearedProps(props)} />\n </FieldIdContext.Provider>\n )\n },\n)\nAglynFormControl.displayName = 'AglynFormControl'\n\n/** The label above an input, linked to it by the Form Control. */\nexport const AglynFormLabel = forwardRef<HTMLLabelElement, FormLabelProps>(\n (props, ref) => {\n const id = useContext(FieldIdContext)\n return (\n <FormLabel\n ref={ref as never}\n component=\"label\"\n {...(id ? { htmlFor: id } : {})}\n {...dropClearedProps(props)}\n />\n )\n },\n)\nAglynFormLabel.displayName = 'AglynFormLabel'\n\nexport interface AglynInputProps {\n /** What the answer is sent as. */\n name?: string\n type?: 'text' | 'email' | 'tel' | 'url' | 'number'\n /** Several lines (a message box) instead of one. */\n multiline?: boolean\n /** Lines a multi-line input starts at. */\n minRows?: number\n placeholder?: string\n required?: boolean\n /**\n * A name for assistive technology when no Form Label sits beside the\n * input — a sign-up row with only a placeholder, for one.\n */\n ariaLabel?: string\n fullWidth?: boolean\n [key: string]: any\n}\n\n/**\n * The outline an Input or Select draws, ON ITS OWN BOX.\n *\n * MUI paints an outlined input's border with an inner `<fieldset>`, so the\n * Styles panel's Border Color, Border and Corner Radius — which reach the\n * element's own box — would change nothing a visitor can see. Hiding that\n * fieldset and drawing the same outline (MUI's resting, hover, focus and\n * error colors) on the box itself puts every border and corner field on the\n * outline you actually see. The node's own styles come after, so whatever an\n * author sets wins; focus and error still show through their own rules.\n *\n * The resting outline sits under `:where()`, which weighs nothing, so the\n * site theme's input border color (the Style components card) outranks it,\n * as MUI's own corner radius and the theme's corners already do.\n */\nconst outlinedBoxSx = (theme: Theme) => ({\n '*:where(&)': {\n border: '1px solid',\n borderColor: alpha(theme.palette.text.primary, 0.23),\n },\n '& .MuiOutlinedInput-notchedOutline': { display: 'none' },\n '&:hover': { borderColor: 'text.primary' },\n '&.Mui-focused': {\n borderColor: 'primary.main',\n boxShadow: `0 0 0 1px ${theme.palette.primary.main}`,\n },\n '&.Mui-error': { borderColor: 'error.main' },\n '&.Mui-disabled': { borderColor: 'action.disabled' },\n})\n\n/**\n * Whether the site theme draws inputs filled: the Input style its Style\n * components card sets, which is MUI's own text field default.\n */\nexport const useFilledInputs = () =>\n useTheme().components?.MuiTextField?.defaultProps?.variant === 'filled'\n\n/** A node's `sx`, as a list the outline can go in front of. */\nexport const nodeSxList = (sx: unknown): SxProps<Theme>[] =>\n sx === undefined || sx === null\n ? []\n : ((Array.isArray(sx) ? sx : [sx]) as SxProps<Theme>[])\n\n/** The box a visitor types in. */\nexport const AglynInput = forwardRef<HTMLDivElement, AglynInputProps>(\n (props, ref) => {\n const {\n name,\n type,\n multiline,\n minRows,\n placeholder,\n required,\n ariaLabel,\n datasetFieldId: _datasetFieldId,\n ...rest\n } = dropClearedProps(props)\n const id = useContext(FieldIdContext)\n const filled = useFilledInputs()\n const inputProps = {\n ...(id ? { id } : {}),\n name: name || undefined,\n type: multiline ? undefined : type || 'text',\n multiline: Boolean(multiline),\n ...(multiline ? { minRows: minRows || 3 } : {}),\n placeholder: placeholder || undefined,\n required: Boolean(required),\n inputProps: ariaLabel ? { 'aria-label': ariaLabel } : undefined,\n }\n if (filled) return <FilledInput ref={ref} {...inputProps} {...rest} />\n return (\n <OutlinedInput\n ref={ref}\n // The label is its own element above the box, so the outline never\n // carries a notch for a floating one.\n notched={false}\n {...inputProps}\n {...rest}\n sx={[outlinedBoxSx, ...nodeSxList(rest['sx'])] as SxProps<Theme>}\n />\n )\n },\n)\nAglynInput.displayName = 'AglynInput'\n\n/** One line of help or guidance under a field. */\nexport const AglynFormHelperText = forwardRef<\n HTMLParagraphElement,\n FormHelperTextProps\n>((props, ref) => <FormHelperText ref={ref} {...dropClearedProps(props)} />)\nAglynFormHelperText.displayName = 'AglynFormHelperText'\n\nexport interface AglynSelectProps {\n name?: string\n required?: boolean\n /** Shown until a choice is made; never sent as an answer. */\n placeholder?: string\n ariaLabel?: string\n fullWidth?: boolean\n size?: 'small' | 'medium'\n children?: ReactNode\n [key: string]: any\n}\n\n/**\n * A dropdown. Its choices are Select Option elements inside it — the\n * browser's own list, so every choice is a real element a page can edit.\n */\nexport const AglynSelect = forwardRef<HTMLDivElement, AglynSelectProps>(\n (props, ref) => {\n const {\n name,\n required,\n placeholder,\n ariaLabel,\n children,\n size,\n datasetFieldId: _datasetFieldId,\n ...rest\n } = dropClearedProps(props)\n const id = useContext(FieldIdContext)\n const filled = useFilledInputs()\n return (\n <NativeSelect\n ref={ref}\n input={\n filled ? (\n <FilledInput size={size} sx={rest['sx']} />\n ) : (\n <OutlinedInput\n notched={false}\n size={size}\n sx={[outlinedBoxSx, ...nodeSxList(rest['sx'])] as SxProps<Theme>}\n />\n )\n }\n defaultValue=\"\"\n inputProps={{\n ...(id ? { id } : {}),\n name: name || undefined,\n required: Boolean(required),\n ...(ariaLabel ? { 'aria-label': ariaLabel } : {}),\n }}\n {...rest}\n // The node's styles ride the outlined box above, where they reach\n // what a visitor sees.\n sx={undefined}\n >\n <option value=\"\" disabled={Boolean(required)}>\n {placeholder || ''}\n </option>\n {children}\n </NativeSelect>\n )\n },\n)\nAglynSelect.displayName = 'AglynSelect'\n\nexport interface AglynSelectOptionProps {\n value?: string\n children?: ReactNode\n}\n\n/** One choice in a Select. */\nexport const AglynSelectOption = forwardRef<\n HTMLOptionElement,\n AglynSelectOptionProps\n>((props, ref) => {\n const { value, children, ...rest } = dropClearedProps(props)\n const text = typeof children === 'string' ? children : ''\n return (\n <option ref={ref} value={value ?? text} {...(rest as object)}>\n {children}\n </option>\n )\n})\nAglynSelectOption.displayName = 'AglynSelectOption'\n\n/**\n * The props an answer element hands MUI: cleared values dropped, and the\n * dataset mapping — authoring data read off the node, never a DOM attribute —\n * taken out.\n */\nfunction withoutMapping<T extends object>(props: T): T {\n const { datasetFieldId: _datasetFieldId, ...rest } = dropClearedProps(\n props as T & { datasetFieldId?: unknown },\n )\n return rest as T\n}\n\n/** A tick box. Put it in a Choice Label to give it words. */\nexport const AglynCheckbox = forwardRef<HTMLButtonElement, CheckboxProps>(\n (props, ref) => <Checkbox ref={ref} {...withoutMapping(props)} />,\n)\nAglynCheckbox.displayName = 'AglynCheckbox'\n\n/** A set of Radio choices sharing one name; one may be picked. */\nexport const AglynRadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(\n (props, ref) => <RadioGroup ref={ref} {...withoutMapping(props)} />,\n)\nAglynRadioGroup.displayName = 'AglynRadioGroup'\n\n/** One choice in a Radio Group. Put it in a Choice Label to give it words. */\nexport const AglynRadio = forwardRef<HTMLButtonElement, RadioProps>(\n (props, ref) => <Radio ref={ref} {...dropClearedProps(props)} />,\n)\nAglynRadio.displayName = 'AglynRadio'\n\nexport interface AglynChoiceLabelProps {\n /** The words beside the tick box or radio. */\n label?: string\n children?: ReactNode\n [key: string]: any\n}\n\n/**\n * The words beside a Checkbox or Radio, clickable as one with it — MUI's\n * FormControlLabel, holding the control as its child element.\n */\nexport const AglynChoiceLabel = forwardRef<HTMLLabelElement, AglynChoiceLabelProps>(\n (props, ref) => {\n const { label, children, ...rest } = dropClearedProps(props)\n return (\n <FormControlLabel\n ref={ref}\n label={label ?? ''}\n // The control is whatever element the author placed inside; a\n // `display: contents` holder keeps it the label's direct box.\n control={<span style={{ display: 'contents' }}>{children}</span>}\n {...rest}\n />\n )\n },\n)\nAglynChoiceLabel.displayName = 'AglynChoiceLabel'\n\n/** Stars a visitor picks; sends the number chosen. */\nexport const AglynRating = forwardRef<HTMLSpanElement, RatingProps>(\n (props, ref) => <Rating ref={ref} {...withoutMapping(props)} />,\n)\nAglynRating.displayName = 'AglynRating'\n\n// ── Attributes ──────────────────────────────────────────────────────────────\n\nexport const FIELD_NAME: Aglyn.AglynAttributeSchema = {\n name: 'name',\n label: 'Field name',\n description:\n 'What the answer is sent as — the key it is stored under in submissions. ' +\n 'Two inputs in one form need two names (radios share their group’s).',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n}\n/**\n * Which field of the form's dataset this answer is stored under — the same\n * picker the all-in-one Form Field had, listing the fields of the dataset\n * chosen on the Form around it. Stored by id, so renaming the dataset field\n * never breaks the mapping; left empty, the answer matches by name.\n */\nexport const FIELD_DATASET_FIELD: Aglyn.AglynAttributeSchema = {\n name: 'datasetFieldId',\n label: 'Maps to schema field',\n description:\n 'The field of the form’s dataset this answer is stored under. Left ' +\n 'empty, it matches a dataset field by its Field name.',\n component: Aglyn.FieldComponentType.DATASET_FIELD_SELECT,\n}\nexport const FIELD_INPUT_SIZE: Aglyn.AglynAttributeSchema = {\n name: 'size',\n label: 'Size',\n description: 'Normal is 56px tall; Small is 40px, to sit beside a button.',\n component: Aglyn.FieldComponentType.SELECT,\n options: [\n { value: 'medium', label: 'Normal' },\n { value: 'small', label: 'Small' },\n ],\n}\nexport const FIELD_REQUIRED: Aglyn.AglynAttributeSchema = {\n name: 'required',\n label: 'Required?',\n description: 'The form will not send until this is answered.',\n component: Aglyn.FieldComponentType.SWITCH,\n}\nexport const FIELD_ARIA_LABEL: Aglyn.AglynAttributeSchema = {\n name: 'ariaLabel',\n label: 'Accessible label',\n description:\n 'Names the input for screen readers when there is no Form Label beside ' +\n 'it. Not shown on the page.',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n}\nexport const FIELD_FULL_WIDTH: Aglyn.AglynAttributeSchema = {\n name: 'fullWidth',\n label: 'Full width?',\n description: 'Fills the width of whatever holds it.',\n component: Aglyn.FieldComponentType.SWITCH,\n}\nconst FIELD_PLACEHOLDER: Aglyn.AglynAttributeSchema = {\n name: 'placeholder',\n label: 'Placeholder',\n description:\n 'A gray hint inside the empty input, such as you@company.com. It is ' +\n 'not a label: it disappears as soon as someone types.',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n}\nconst FIELD_CHOICE_VALUE: Aglyn.AglynAttributeSchema = {\n name: 'value',\n label: 'Value',\n description: 'What is sent when this is chosen.',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n}\n\nexport const category = Aglyn.ComponentCategory.FORMS\n\nexport const formControlSchema: Aglyn.ComponentSchema<AglynFormControlProps> = {\n $id: FORM_CONTROL_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Form Control',\n description:\n 'One field’s frame: holds a Form Label, an input and Helper Text, and ' +\n 'links the label to the input.',\n category,\n icon: { path: mdiFormTextbox.path, sx: { color: 'info.main' } },\n attributes: [\n FIELD_FULL_WIDTH,\n {\n ...FIELD_REQUIRED,\n description: 'Marks the label with an asterisk. Set Required? on the input too.',\n },\n ],\n}\n\nexport const formLabelSchema: Aglyn.ComponentSchema<FormLabelProps> = {\n $id: FORM_LABEL_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Form Label',\n description: 'The words that name a field, above its input.',\n category,\n icon: { path: mdiTagOutline.path, sx: { color: 'info.main' } },\n flags: { textEditable: Aglyn.FEATURE_FLAG.ENABLED },\n attributes: [FIELD_TEXT_CONTENT],\n}\n\nexport const inputSchema: Aglyn.ComponentSchema<AglynInputProps> = {\n $id: INPUT_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Input',\n description: 'A box a visitor types in: text, email, phone, link or number.',\n category,\n icon: { path: mdiTextShort.path, sx: { color: 'info.main' } },\n flags: { selfClosing: Aglyn.FEATURE_FLAG.ENABLED },\n attributes: [\n FIELD_NAME,\n FIELD_DATASET_FIELD,\n {\n name: 'type',\n label: 'Type',\n description: 'What goes in it. Email, phone and link bring the right phone keyboard.',\n component: Aglyn.FieldComponentType.SELECT,\n options: [\n { value: 'text', label: 'Text' },\n { value: 'email', label: 'Email' },\n { value: 'tel', label: 'Phone' },\n { value: 'url', label: 'Link' },\n { value: 'number', label: 'Number' },\n ],\n },\n FIELD_PLACEHOLDER,\n FIELD_REQUIRED,\n {\n name: 'multiline',\n label: 'Several lines?',\n description: 'A message box instead of a single line.',\n component: Aglyn.FieldComponentType.SWITCH,\n },\n FIELD_INPUT_SIZE,\n FIELD_FULL_WIDTH,\n FIELD_ARIA_LABEL,\n ],\n}\n\nexport const formHelperTextSchema: Aglyn.ComponentSchema<FormHelperTextProps> = {\n $id: FORM_HELPER_TEXT_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Helper Text',\n description: 'A line of guidance under a field.',\n category,\n icon: { path: mdiFormatText.path, sx: { color: 'info.main' } },\n flags: { textEditable: Aglyn.FEATURE_FLAG.ENABLED },\n attributes: [FIELD_TEXT_CONTENT],\n}\n\nexport const selectSchema: Aglyn.ComponentSchema<AglynSelectProps> = {\n $id: SELECT_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Select',\n description: 'A dropdown of Select Options; one may be picked.',\n category,\n icon: { path: mdiFormDropdown.path, sx: { color: 'info.main' } },\n restrictChildren: [\n Aglyn.LinealDirectiveFlag.LIMIT_TO,\n { components: [SELECT_OPTION_ID] },\n ],\n attributes: [\n FIELD_NAME,\n FIELD_DATASET_FIELD,\n { ...FIELD_PLACEHOLDER, description: 'Shown until a choice is made; never sent.' },\n FIELD_REQUIRED,\n FIELD_INPUT_SIZE,\n FIELD_FULL_WIDTH,\n FIELD_ARIA_LABEL,\n ],\n}\n\nexport const selectOptionSchema: Aglyn.ComponentSchema<AglynSelectOptionProps> = {\n $id: SELECT_OPTION_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Select Option',\n description: 'One choice in a Select.',\n category,\n icon: { path: mdiFormSelect.path, sx: { color: 'info.main' } },\n flags: {\n selfClosing: Aglyn.FEATURE_FLAG.ENABLED,\n textEditable: Aglyn.FEATURE_FLAG.ENABLED,\n },\n attributes: [\n FIELD_TEXT_CONTENT,\n { ...FIELD_CHOICE_VALUE, description: 'What is sent. Leave empty to send the text.' },\n ],\n}\n\nexport const checkboxSchema: Aglyn.ComponentSchema<CheckboxProps> = {\n $id: CHECKBOX_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Checkbox',\n description: 'A tick box. Put it in a Choice Label to give it words.',\n category,\n icon: { path: mdiCheckboxMarkedOutline.path, sx: { color: 'info.main' } },\n flags: { selfClosing: Aglyn.FEATURE_FLAG.ENABLED },\n attributes: [\n FIELD_NAME,\n FIELD_DATASET_FIELD,\n { ...FIELD_CHOICE_VALUE, description: 'What is sent when ticked, such as Yes.' },\n FIELD_REQUIRED,\n ],\n}\n\nexport const radioGroupSchema: Aglyn.ComponentSchema<RadioGroupProps> = {\n $id: RADIO_GROUP_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Radio Group',\n description: 'A set of Radio choices; one may be picked.',\n category,\n icon: { path: mdiRadioboxMarked.path, sx: { color: 'info.main' } },\n attributes: [\n FIELD_NAME,\n FIELD_DATASET_FIELD,\n {\n name: 'row',\n label: 'In a row?',\n description: 'Side by side instead of one under another.',\n component: Aglyn.FieldComponentType.SWITCH,\n },\n ],\n}\n\nexport const radioSchema: Aglyn.ComponentSchema<RadioProps> = {\n $id: RADIO_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Radio',\n description: 'One choice in a Radio Group. Put it in a Choice Label to give it words.',\n category,\n icon: { path: mdiRadioboxMarked.path, sx: { color: 'info.main' } },\n flags: { selfClosing: Aglyn.FEATURE_FLAG.ENABLED },\n attributes: [FIELD_CHOICE_VALUE, FIELD_REQUIRED],\n}\n\nexport const choiceLabelSchema: Aglyn.ComponentSchema<AglynChoiceLabelProps> = {\n $id: CHOICE_LABEL_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Choice Label',\n description: 'The words beside a Checkbox or Radio placed inside it; clicking them ticks it.',\n category,\n icon: { path: mdiTagOutline.path, sx: { color: 'info.main' } },\n restrictChildren: [\n Aglyn.LinealDirectiveFlag.LIMIT_TO,\n { components: [CHECKBOX_ID, RADIO_ID] },\n ],\n attributes: [\n {\n name: 'label',\n label: 'Text',\n description: 'The words beside the box.',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n },\n ],\n}\n\nexport const ratingSchema: Aglyn.ComponentSchema<RatingProps> = {\n $id: RATING_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Rating',\n description: 'Stars a visitor picks; sends the number chosen.',\n category,\n icon: { path: mdiStarOutline.path, sx: { color: 'info.main' } },\n flags: { selfClosing: Aglyn.FEATURE_FLAG.ENABLED },\n attributes: [\n FIELD_NAME,\n FIELD_DATASET_FIELD,\n {\n name: 'max',\n label: 'Stars',\n description: 'How many stars to show.',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n type: 'number',\n },\n ],\n}\n\n// ── Presets: ready-made arrangements of the pieces above ────────────────────\n\nexport const node = (\n componentId: Aglyn.ComponentId,\n props?: Record<string, unknown>,\n nodes?: Aglyn.NodePresetData[],\n sx?: Record<string, unknown>,\n): Aglyn.NodePresetData =>\n ({\n $id: null,\n componentId,\n pluginId: BUNDLE_ID,\n ...(props ? { props } : {}),\n ...(nodes ? { nodes } : {}),\n ...(sx ? { sx } : {}),\n }) as Aglyn.NodePresetData\n\n/** A labelled text field: Form Control › Form Label + Input. */\nexport const textFieldPreset = (\n label: string,\n input: Record<string, unknown>,\n): Aglyn.NodePresetData =>\n node(FORM_CONTROL_ID, { fullWidth: true }, [\n node(FORM_LABEL_ID, { children: label }),\n node(INPUT_ID, { fullWidth: true, ...input }),\n ])\n\nexport const preset = (\n $id: string,\n displayName: string,\n description: string,\n icon: string,\n data: Aglyn.NodePresetData,\n): Aglyn.PresetSchema => ({\n $id,\n type: Aglyn.NodeType.PRESET,\n displayName,\n description,\n pluginId: BUNDLE_ID,\n category,\n icon: { path: icon, sx: { color: 'info.main' } },\n data,\n})\n\n/**\n * Each element on its own, so any piece can be inserted by itself — a bare\n * Input beside a Button in a sign-up row, a Form Label above a field the\n * author is assembling, one more Radio in a group. The field presets below\n * are ready-made arrangements of the same pieces.\n */\nconst singleElementPresets: Aglyn.PresetSchema[] = [\n preset(\n generatePresetId(FORM_CONTROL_ID),\n 'Form Control',\n 'An empty field frame: put a Form Label, an input and Helper Text in it.',\n mdiFormTextbox.path,\n node(FORM_CONTROL_ID, { fullWidth: true }),\n ),\n preset(\n generatePresetId(FORM_LABEL_ID),\n 'Form Label',\n 'The words that name a field, above its input.',\n mdiTagOutline.path,\n node(FORM_LABEL_ID, { children: 'Label' }),\n ),\n preset(\n generatePresetId(INPUT_ID),\n 'Input',\n 'A box a visitor types in, on its own.',\n mdiTextShort.path,\n node(INPUT_ID, { name: 'field', placeholder: 'Type here' }),\n ),\n preset(\n generatePresetId(SELECT_ID),\n 'Select',\n 'A dropdown with two options.',\n mdiFormDropdown.path,\n node(SELECT_ID, { name: 'choice', placeholder: 'Choose…' }, [\n node(SELECT_OPTION_ID, { children: 'Option one' }),\n node(SELECT_OPTION_ID, { children: 'Option two' }),\n ]),\n ),\n preset(\n generatePresetId(SELECT_OPTION_ID),\n 'Select Option',\n 'One more choice for a Select.',\n mdiFormSelect.path,\n node(SELECT_OPTION_ID, { children: 'Option' }),\n ),\n preset(\n generatePresetId(RADIO_GROUP_ID),\n 'Radio Group',\n 'A set of Radio choices sharing one Field name.',\n mdiRadioboxMarked.path,\n node(RADIO_GROUP_ID, { name: 'pick' }, [\n node(CHOICE_LABEL_ID, { label: 'First' }, [node(RADIO_ID, { value: 'First' })]),\n node(CHOICE_LABEL_ID, { label: 'Second' }, [node(RADIO_ID, { value: 'Second' })]),\n ]),\n ),\n preset(\n generatePresetId(RADIO_ID),\n 'Radio',\n 'One more choice for a Radio Group, with its words.',\n mdiRadioboxMarked.path,\n node(CHOICE_LABEL_ID, { label: 'Another choice' }, [\n node(RADIO_ID, { value: 'Another choice' }),\n ]),\n ),\n preset(\n generatePresetId(CHOICE_LABEL_ID),\n 'Choice Label',\n 'Words beside a tick box; holds a Checkbox.',\n mdiTagOutline.path,\n node(CHOICE_LABEL_ID, { label: 'Yes, please' }, [\n node(CHECKBOX_ID, { name: 'agree', value: 'Yes' }),\n ]),\n ),\n preset(\n generatePresetId(RATING_ID),\n 'Rating',\n 'Five stars, on their own.',\n mdiStarOutline.path,\n node(RATING_ID, { name: 'rating' }),\n ),\n]\n\nexport const formControlPresets: Aglyn.PresetSchema[] = [\n ...singleElementPresets,\n preset(\n generatePresetId(FORM_CONTROL_ID, 'text'),\n 'Text field',\n 'A label and a one-line input.',\n mdiFormTextbox.path,\n textFieldPreset('Name', { name: 'name' }),\n ),\n preset(\n generatePresetId(FORM_CONTROL_ID, 'email'),\n 'Email field',\n 'A label and an email input.',\n mdiFormTextbox.path,\n textFieldPreset('Email', { name: 'email', type: 'email', required: true }),\n ),\n preset(\n generatePresetId(FORM_CONTROL_ID, 'message'),\n 'Message field',\n 'A label and a several-line input.',\n mdiFormTextbox.path,\n textFieldPreset('Message', { name: 'message', multiline: true, minRows: 4 }),\n ),\n preset(\n generatePresetId(FORM_CONTROL_ID, 'select'),\n 'Dropdown field',\n 'A label and a Select with three options.',\n mdiFormDropdown.path,\n node(FORM_CONTROL_ID, { fullWidth: true }, [\n node(FORM_LABEL_ID, { children: 'Choose one' }),\n node(SELECT_ID, { name: 'choice', fullWidth: true, placeholder: 'Choose…' }, [\n node(SELECT_OPTION_ID, { children: 'Option one' }),\n node(SELECT_OPTION_ID, { children: 'Option two' }),\n node(SELECT_OPTION_ID, { children: 'Option three' }),\n ]),\n ]),\n ),\n preset(\n generatePresetId(FORM_CONTROL_ID, 'radio'),\n 'Radio choice field',\n 'A label and a Radio Group with three choices.',\n mdiRadioboxMarked.path,\n node(FORM_CONTROL_ID, {}, [\n node(FORM_LABEL_ID, { children: 'Pick one' }),\n node(RADIO_GROUP_ID, { name: 'pick' }, [\n node(CHOICE_LABEL_ID, { label: 'First' }, [node(RADIO_ID, { value: 'First' })]),\n node(CHOICE_LABEL_ID, { label: 'Second' }, [node(RADIO_ID, { value: 'Second' })]),\n node(CHOICE_LABEL_ID, { label: 'Third' }, [node(RADIO_ID, { value: 'Third' })]),\n ]),\n ]),\n ),\n preset(\n generatePresetId(FORM_CONTROL_ID, 'checkbox'),\n 'Checkbox',\n 'A tick box with words beside it.',\n mdiCheckboxMarkedOutline.path,\n node(CHOICE_LABEL_ID, { label: 'Yes, please' }, [\n node(CHECKBOX_ID, { name: 'agree', value: 'Yes' }),\n ]),\n ),\n preset(\n generatePresetId(FORM_HELPER_TEXT_ID),\n 'Helper Text',\n 'A line of guidance under a field.',\n mdiFormatText.path,\n node(FORM_HELPER_TEXT_ID, { children: 'We never share your address.' }),\n ),\n preset(\n generatePresetId(FORM_CONTROL_ID, 'rating'),\n 'Rating field',\n 'A label and five stars.',\n mdiStarOutline.path,\n node(FORM_CONTROL_ID, {}, [\n node(FORM_LABEL_ID, { children: 'How did we do?' }),\n node(RATING_ID, { name: 'rating' }),\n ]),\n ),\n]\n"],"names":["Aglyn","mdiCheckboxMarkedOutline","mdiFormDropdown","mdiFormTextbox","mdiFormatText","mdiRadioboxMarked","mdiStarOutline","mdiTextShort","mdiTagOutline","mdiFormSelect","Checkbox","FormControl","FormControlLabel","FormHelperText","FilledInput","FormLabel","NativeSelect","OutlinedInput","Radio","RadioGroup","Rating","alpha","useTheme","createContext","forwardRef","useContext","useId","BUNDLE_ID","FIELD_TEXT_CONTENT","dropClearedProps","generatePresetId","FORM_CONTROL_ID","FORM_LABEL_ID","INPUT_ID","FORM_HELPER_TEXT_ID","SELECT_ID","SELECT_OPTION_ID","CHECKBOX_ID","RADIO_GROUP_ID","RADIO_ID","CHOICE_LABEL_ID","RATING_ID","loadFormPickers","FieldIdContext","undefined","AglynFormControl","props","ref","id","replace","Provider","value","displayName","AglynFormLabel","component","htmlFor","outlinedBoxSx","theme","border","borderColor","palette","text","primary","display","boxShadow","main","useFilledInputs","components","MuiTextField","defaultProps","variant","nodeSxList","sx","Array","isArray","AglynInput","name","type","multiline","minRows","placeholder","required","ariaLabel","datasetFieldId","_datasetFieldId","rest","filled","inputProps","Boolean","notched","AglynFormHelperText","AglynSelect","children","size","input","defaultValue","option","disabled","AglynSelectOption","withoutMapping","AglynCheckbox","AglynRadioGroup","AglynRadio","AglynChoiceLabel","label","control","span","style","AglynRating","FIELD_NAME","description","FieldComponentType","TEXT_FIELD","FIELD_DATASET_FIELD","DATASET_FIELD_SELECT","FIELD_INPUT_SIZE","SELECT","options","FIELD_REQUIRED","SWITCH","FIELD_ARIA_LABEL","FIELD_FULL_WIDTH","FIELD_PLACEHOLDER","FIELD_CHOICE_VALUE","category","ComponentCategory","FORMS","formControlSchema","$id","pluginId","icon","path","color","attributes","formLabelSchema","flags","textEditable","FEATURE_FLAG","ENABLED","inputSchema","selfClosing","formHelperTextSchema","selectSchema","restrictChildren","LinealDirectiveFlag","LIMIT_TO","selectOptionSchema","checkboxSchema","radioGroupSchema","radioSchema","choiceLabelSchema","ratingSchema","node","componentId","nodes","textFieldPreset","fullWidth","preset","data","NodeType","PRESET","singleElementPresets","formControlPresets"],"mappings":";;;AAAA;;;;;;;;;;;;;;;CAeC,GAED,YAAYA,WAAW,eAAc;AACrC,SACEC,wBAAwB,EACxBC,eAAe,EACfC,cAAc,EACdC,aAAa,EACbC,iBAAiB,EACjBC,cAAc,EACdC,YAAY,EACZC,aAAa,EACbC,aAAa,QACR,yBAAwB;AAC/B,OAAOC,cAAsC,yBAAwB;AACrE,OAAOC,iBAA4C,4BAA2B;AAC9E,OAAOC,sBAAsB,iCAAgC;AAC7D,OAAOC,oBAEA,+BAA8B;AACrC,OAAOC,iBAAiB,4BAA2B;AACnD,OAAOC,eAAwC,0BAAyB;AACxE,OAAOC,kBAAkB,6BAA4B;AACrD,OAAOC,mBAAmB,8BAA6B;AACvD,OAAOC,WAAgC,sBAAqB;AAC5D,OAAOC,gBAA0C,2BAA0B;AAC3E,OAAOC,YAAkC,uBAAsB;AAC/D,SACEC,KAAK,EAGLC,QAAQ,QACH,uBAAsB;AAC7B,SACEC,aAAa,EACbC,UAAU,EAEVC,UAAU,EACVC,KAAK,QACA,QAAO;AACd,SAASC,SAAS,QAAQ,gCAA4B;AACtD,SAASC,kBAAkB,QAAQ,gCAA4B;AAC/D,SAASC,gBAAgB,QAAQ,iCAA6B;AAC9D,SAASC,gBAAgB,QAAQ,iCAA6B;AA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C4E,KAAKhH,iBAAiB;gBAAEgE,OAAO;YAAQ,GAAG;gBAACgD,KAAKjH,UAAU;oBAAEY,OAAO;gBAAQ;aAAG;YAC9EqG,KAAKhH,iBAAiB;gBAAEgE,OAAO;YAAS,GAAG;gBAACgD,KAAKjH,UAAU;oBAAEY,OAAO;gBAAS;aAAG;YAChFqG,KAAKhH,iBAAiB;gBAAEgE,OAAO;YAAQ,GAAG;gBAACgD,KAAKjH,UAAU;oBAAEY,OAAO;gBAAQ;aAAG;SAC/E;KACF;IAEH0G,OACE/H,iBAAiBC,iBAAiB,aAClC,YACA,oCACA9B,yBAAyBkI,IAAI,EAC7BqB,KAAKhH,iBAAiB;QAAEgE,OAAO;IAAc,GAAG;QAC9CgD,KAAKnH,aAAa;YAAEuC,MAAM;YAASzB,OAAO;QAAM;KACjD;IAEH0G,OACE/H,iBAAiBI,sBACjB,eACA,qCACA9B,cAAc+H,IAAI,EAClBqB,KAAKtH,qBAAqB;QAAE0D,UAAU;IAA+B;IAEvEiE,OACE/H,iBAAiBC,iBAAiB,WAClC,gBACA,2BACAzB,eAAe6H,IAAI,EACnBqB,KAAKzH,iBAAiB,CAAC,GAAG;QACxByH,KAAKxH,eAAe;YAAE4D,UAAU;QAAiB;QACjD4D,KAAK/G,WAAW;YAAEmC,MAAM;QAAS;KAClC;CAEJ,CAAA"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import * as Aglyn from '@aglyn/aglyn';
|
|
18
|
+
import { type Dayjs } from 'dayjs';
|
|
19
|
+
export declare const DATE_PICKER_ID: Aglyn.ComponentId;
|
|
20
|
+
export declare const TIME_PICKER_ID: Aglyn.ComponentId;
|
|
21
|
+
/** `2026-10-15` as a picker value, or `null` for anything that is not a day. */
|
|
22
|
+
export declare function parsePickerDay(value: unknown): Dayjs | null;
|
|
23
|
+
/** `14:30` as a picker value (today at that time), or `null`. */
|
|
24
|
+
export declare function parsePickerTime(value: unknown): Dayjs | null;
|
|
25
|
+
/** What a picked value posts as: the ISO day or the 24-hour time, or nothing. */
|
|
26
|
+
export declare function pickerAnswer(value: Dayjs | null, kind: 'date' | 'time'): string;
|
|
27
|
+
interface PickerFieldProps {
|
|
28
|
+
/** What the answer is sent as. */
|
|
29
|
+
name?: string;
|
|
30
|
+
required?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* A name for assistive technology when no Form Label sits beside the
|
|
33
|
+
* picker.
|
|
34
|
+
*/
|
|
35
|
+
ariaLabel?: string;
|
|
36
|
+
fullWidth?: boolean;
|
|
37
|
+
size?: 'small' | 'medium';
|
|
38
|
+
[key: string]: any;
|
|
39
|
+
}
|
|
40
|
+
export interface AglynDatePickerProps extends PickerFieldProps {
|
|
41
|
+
/** Days before today cannot be picked. */
|
|
42
|
+
disablePast?: boolean;
|
|
43
|
+
/** Days after today cannot be picked. */
|
|
44
|
+
disableFuture?: boolean;
|
|
45
|
+
/** The first day that can be picked, as `YYYY-MM-DD`. */
|
|
46
|
+
minDate?: string;
|
|
47
|
+
/** The last day that can be picked, as `YYYY-MM-DD`. */
|
|
48
|
+
maxDate?: string;
|
|
49
|
+
/** Starts filled in with today. */
|
|
50
|
+
defaultToday?: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface AglynTimePickerProps extends PickerFieldProps {
|
|
53
|
+
/** The minutes the clock steps by. */
|
|
54
|
+
minutesStep?: number | string;
|
|
55
|
+
/** The earliest time that can be picked, as `HH:mm`. */
|
|
56
|
+
minTime?: string;
|
|
57
|
+
/** The latest time that can be picked, as `HH:mm`. */
|
|
58
|
+
maxTime?: string;
|
|
59
|
+
/** `12` or `24`; anything else follows the visitor's language. */
|
|
60
|
+
clock?: string;
|
|
61
|
+
}
|
|
62
|
+
/** A day a visitor picks from a calendar; sends it as `2026-10-15`. */
|
|
63
|
+
export declare const AglynDatePicker: import("react").ForwardRefExoticComponent<Omit<AglynDatePickerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
64
|
+
/** A time a visitor picks from a clock; sends it as `14:30`. */
|
|
65
|
+
export declare const AglynTimePicker: import("react").ForwardRefExoticComponent<Omit<AglynTimePickerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
66
|
+
export declare const datePickerSchema: Aglyn.ComponentSchema<AglynDatePickerProps>;
|
|
67
|
+
export declare const timePickerSchema: Aglyn.ComponentSchema<AglynTimePickerProps>;
|
|
68
|
+
export declare const formPickerPresets: Aglyn.PresetSchema[];
|
|
69
|
+
export {};
|