@12-apps/ui 6.16.0 → 6.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_internal/components/data-display/DataViews/DataViewsGrid.js +7 -7
- package/dist/_internal/components/data-display/DataViews/DataViewsTableBase.js +8 -8
- package/dist/_internal/components/data-display/DataViews/data-views-category-pill.js +3 -3
- package/dist/_internal/components/data-display/DataViews/data-views-filter-panel.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-grid-parts.js +6 -6
- package/dist/_internal/components/data-display/DataViews/data-views-inline-bar.js +4 -4
- package/dist/_internal/components/form/CategorySelect/CategorySelect.js +2 -2
- package/dist/_internal/components/form/CepField/CepField.js +2 -2
- package/dist/_internal/components/form/CreatableSelect/CreatableSelect.js +2 -2
- package/dist/_internal/components/form/Form/Form.js +1 -1
- package/dist/_internal/components/form/index.js +2 -2
- package/dist/_internal/components/form/total-form/Fields/CategoryField.js +3 -3
- package/dist/_internal/components/form/total-form/Fields/CepField.js +3 -3
- package/dist/_internal/components/form/total-form/Fields/SelectField.js +2 -2
- package/dist/_internal/components/form/total-form/Fields/TextField.js +2 -2
- package/dist/_internal/components/form/total-form/Fields/ToggleField.js +2 -2
- package/dist/_internal/components/form/total-form/Fields/index.js +9 -9
- package/dist/_internal/components/form/total-form/FormContainer.js +2 -2
- package/dist/_internal/components/index.js +3 -3
- package/dist/_internal/components/layout/Separator/Separator.js +1 -1
- package/dist/_internal/components/layout/index.js +1 -1
- package/dist/_internal/social-login-button/social-login-button.js +2 -2
- package/dist/{chunk-3ORFVLI3.js → chunk-37YPZHAG.js} +2 -2
- package/dist/{chunk-DGMR3IMM.js → chunk-CBPQJAHX.js} +2 -2
- package/dist/{chunk-ENK4XGKF.js → chunk-CLNTJM3F.js} +2 -2
- package/dist/{chunk-OK5BHFZE.js → chunk-E6OILRUU.js} +2 -2
- package/dist/{chunk-P2U7C2S7.js → chunk-EB4BTKKY.js} +2 -2
- package/dist/{chunk-O3OU2PPT.js → chunk-ES2RN7YV.js} +2 -2
- package/dist/{chunk-RX6DWIIW.js → chunk-FWCUELBU.js} +2 -2
- package/dist/{chunk-QETBO7EC.js → chunk-GCJLMX63.js} +2 -2
- package/dist/{chunk-VZO7VREP.js → chunk-IPPTOL53.js} +2 -2
- package/dist/chunk-IPPTOL53.js.map +1 -0
- package/dist/{chunk-LIQHOLDQ.js → chunk-LYMAMKJT.js} +2 -2
- package/dist/{chunk-6I75JTFO.js → chunk-MCZ7536N.js} +3 -6
- package/dist/chunk-MCZ7536N.js.map +1 -0
- package/dist/{chunk-TPUIIZN2.js → chunk-MD6T7MDT.js} +3 -3
- package/dist/{chunk-LUWATXU4.js → chunk-OAXAF4VY.js} +2 -2
- package/dist/{chunk-45N6LXUU.js → chunk-OI3HOI74.js} +2 -2
- package/dist/{chunk-TUAIPMU7.js → chunk-SRMWCN5D.js} +2 -2
- package/dist/{chunk-WFX5GASM.js → chunk-VOOPGAQO.js} +2 -2
- package/dist/{chunk-PLK7UGO6.js → chunk-WME2F2YY.js} +2 -2
- package/dist/{chunk-EE2LBAJH.js → chunk-WPR2HS5B.js} +6 -6
- package/dist/{chunk-KNNBIXWJ.js → chunk-ZBOFBRZC.js} +2 -2
- package/dist/data-display/DataViews.js +8 -8
- package/dist/form/CategorySelect.js +2 -2
- package/dist/form/CepField.js +2 -2
- package/dist/form/CreatableSelect.js +2 -2
- package/dist/form/Form.js +1 -1
- package/dist/form/total-form.js +10 -10
- package/dist/layout/Separator.js +1 -1
- package/dist/social-login-button.js +2 -2
- package/dist/types/components/form/Form/Form.d.ts.map +1 -1
- package/dist/types/components/layout/Separator/Separator.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/form/Form/Form.md +46 -1
- package/src/components/form/Form/Form.tsx +40 -1
- package/src/components/layout/Separator/Separator.tsx +12 -5
- package/dist/chunk-6I75JTFO.js.map +0 -1
- package/dist/chunk-VZO7VREP.js.map +0 -1
- /package/dist/{chunk-3ORFVLI3.js.map → chunk-37YPZHAG.js.map} +0 -0
- /package/dist/{chunk-DGMR3IMM.js.map → chunk-CBPQJAHX.js.map} +0 -0
- /package/dist/{chunk-ENK4XGKF.js.map → chunk-CLNTJM3F.js.map} +0 -0
- /package/dist/{chunk-OK5BHFZE.js.map → chunk-E6OILRUU.js.map} +0 -0
- /package/dist/{chunk-P2U7C2S7.js.map → chunk-EB4BTKKY.js.map} +0 -0
- /package/dist/{chunk-O3OU2PPT.js.map → chunk-ES2RN7YV.js.map} +0 -0
- /package/dist/{chunk-RX6DWIIW.js.map → chunk-FWCUELBU.js.map} +0 -0
- /package/dist/{chunk-QETBO7EC.js.map → chunk-GCJLMX63.js.map} +0 -0
- /package/dist/{chunk-LIQHOLDQ.js.map → chunk-LYMAMKJT.js.map} +0 -0
- /package/dist/{chunk-TPUIIZN2.js.map → chunk-MD6T7MDT.js.map} +0 -0
- /package/dist/{chunk-LUWATXU4.js.map → chunk-OAXAF4VY.js.map} +0 -0
- /package/dist/{chunk-45N6LXUU.js.map → chunk-OI3HOI74.js.map} +0 -0
- /package/dist/{chunk-TUAIPMU7.js.map → chunk-SRMWCN5D.js.map} +0 -0
- /package/dist/{chunk-WFX5GASM.js.map → chunk-VOOPGAQO.js.map} +0 -0
- /package/dist/{chunk-PLK7UGO6.js.map → chunk-WME2F2YY.js.map} +0 -0
- /package/dist/{chunk-EE2LBAJH.js.map → chunk-WPR2HS5B.js.map} +0 -0
- /package/dist/{chunk-KNNBIXWJ.js.map → chunk-ZBOFBRZC.js.map} +0 -0
|
@@ -39,7 +39,7 @@ var StyledFormField = styled(Box, {
|
|
|
39
39
|
display: variant === "horizontal" ? "grid" : "flex",
|
|
40
40
|
flexDirection: variant === "horizontal" ? void 0 : "column",
|
|
41
41
|
gridTemplateColumns: variant === "horizontal" ? "200px 1fr" : void 0,
|
|
42
|
-
|
|
42
|
+
columnGap: variant === "horizontal" ? theme.spacing(1) : void 0,
|
|
43
43
|
alignItems: variant === "horizontal" ? "center" : void 0
|
|
44
44
|
})
|
|
45
45
|
);
|
|
@@ -109,4 +109,4 @@ export {
|
|
|
109
109
|
FormControl,
|
|
110
110
|
FormMessage
|
|
111
111
|
};
|
|
112
|
-
//# sourceMappingURL=chunk-
|
|
112
|
+
//# sourceMappingURL=chunk-IPPTOL53.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/form/Form/Form.tsx"],"sourcesContent":["import Box from '@mui/material/Box/index.js';\nimport Stack from '@mui/material/Stack/index.js';\nimport { styled } from '@mui/material/styles/index.js';\nimport React from 'react';\n\nimport type {\n FormControlProps,\n FormFieldProps,\n FormLabelProps,\n FormMessageProps,\n FormProps,\n} from './Form.types';\n\nconst StyledForm = styled('form', {\n shouldForwardProp: (prop) => prop !== 'variant',\n})<{ variant?: FormProps['variant'] }>(({ theme, variant }) => ({\n width: '100%',\n ...(variant === 'inline' && {\n display: 'flex',\n gap: theme.spacing(2),\n alignItems: 'flex-start',\n }),\n}));\n\nconst spacingMap = {\n xs: 1,\n sm: 2,\n md: 3,\n lg: 4,\n xl: 5,\n};\n\nconst maxWidthMap = {\n sm: '600px',\n md: '900px',\n lg: '1200px',\n xl: '1536px',\n full: '100%',\n};\n\nexport const Form = React.forwardRef<HTMLFormElement, FormProps>(\n ({ variant = 'vertical', maxWidth = 'full', spacing = 'md', children, dataTestId, ...props }, ref) => (\n <StyledForm ref={ref} variant={variant} role=\"form\" data-testid={dataTestId} {...props}>\n <Box sx={{ maxWidth: maxWidthMap[maxWidth], width: '100%' }}>\n {variant === 'inline' ? (\n children\n ) : (\n <Stack spacing={spacingMap[spacing]}>{children}</Stack>\n )}\n </Box>\n </StyledForm>\n ),\n);\n\nForm.displayName = 'Form';\n\n/**\n * NO ROW GAP HERE, and that is the fix rather than an omission.\n *\n * `FormLabel` already carries `marginBottom: theme.spacing(0.5)` — 4px — and it\n * carries it because it has to: every OTHER user of it (`CepField`,\n * `CategorySelect`, `CreatableSelect`, the three `total-form` fields, five of\n * `@12-apps/discounts`' builders and the host's own `currency-field`) puts a\n * bare `FormLabel` straight inside a `FormControl`, which is a plain block box\n * with no gap of its own. There, the label's own margin is the ONLY thing\n * between the label and the control.\n *\n * A `gap: theme.spacing(1)` here was a second mechanism for that one job, and in\n * a column the two ADD: 8px + 4px put `FormField` at 12px where every one of\n * those siblings sits at 4px. Measured in Chromium at 320x568 on a consuming\n * app's six-field delivery address form, the 8px a row it added pushed the\n * submit button from 561px to 609px — 41px below the fold of the smallest\n * supported phone, i.e. a checkout whose primary action is off-screen.\n *\n * That claim is about `FormLabel`'s own callers, not about the whole package:\n * `Textarea` labels its control through MUI's `InputLabel` at\n * `theme.spacing(1)` and still draws 8px. It composes nothing out of\n * `FormLabel`, so it is a separate inconsistency rather than a reason to keep\n * a second spacing here.\n *\n * ## The `columnGap` is scaffolding, and currently unreachable\n *\n * `FormFieldProps` has no `variant` and `FormField` passes none, so `variant`\n * is ALWAYS undefined and every branch below resolves to the vertical shape.\n * `Form` accepts `variant=\"horizontal\"` and `Form.md` documents it as \"labels\n * beside inputs\", but nothing carries that variant down to the field — so a\n * horizontal form draws vertical rows today. That gap is older than this\n * change and fixing it is a feature, not a spacing fix.\n *\n * The branch is kept, scoped to the COLUMN axis, so that whoever does wire it\n * up inherits the right answer: with the label beside the control, a horizontal\n * gap and a vertical margin are orthogonal and nothing double-counts. A `gap`\n * shorthand there would put the 8px back on the row axis the moment a field\n * wrapped.\n */\nconst StyledFormField = styled(Box, {\n shouldForwardProp: (prop) => prop !== 'variant',\n})<{ variant?: 'vertical' | 'horizontal' }>(\n ({ theme, variant }) => ({\n display: variant === 'horizontal' ? 'grid' : 'flex',\n flexDirection: variant === 'horizontal' ? undefined : 'column',\n gridTemplateColumns: variant === 'horizontal' ? '200px 1fr' : undefined,\n columnGap: variant === 'horizontal' ? theme.spacing(1) : undefined,\n alignItems: variant === 'horizontal' ? 'center' : undefined,\n }),\n);\n\nexport const FormField: React.FC<FormFieldProps> = ({\n name,\n label,\n required,\n error,\n helperText,\n children,\n dataTestId,\n}) => (\n <StyledFormField data-testid={dataTestId}>\n {label && (\n <FormLabel required={required} error={!!error} htmlFor={name} dataTestId={dataTestId ? `${dataTestId}-label` : undefined}>\n {label}\n </FormLabel>\n )}\n <FormControl fullWidth dataTestId={dataTestId ? `${dataTestId}-control` : undefined}>\n {children}\n {(error || helperText) && <FormMessage error={!!error} dataTestId={dataTestId ? `${dataTestId}-message` : undefined}>{error || helperText}</FormMessage>}\n </FormControl>\n </StyledFormField>\n );\n\nconst StyledFormLabel = styled('label', {\n shouldForwardProp: (prop) => prop !== 'error',\n})<{ error?: boolean }>(({ theme, error }) => ({\n fontSize: '0.875rem',\n fontWeight: 500,\n color: error ? theme.palette.error.main : theme.palette.text.primary,\n marginBottom: theme.spacing(0.5),\n display: 'block',\n '&::after': {\n content: '\" *\"',\n color: theme.palette.error.main,\n display: 'var(--required-display, none)',\n },\n}));\n\nexport const FormLabel: React.FC<FormLabelProps> = ({ required, error, children, htmlFor, dataTestId }) => (\n <StyledFormLabel\n error={error}\n htmlFor={htmlFor}\n data-testid={dataTestId}\n style={{ '--required-display': required ? 'inline' : 'none' } as React.CSSProperties}\n >\n {children}\n </StyledFormLabel>\n );\n\nconst StyledFormControl = styled(Box, {\n shouldForwardProp: (prop) => prop !== 'fullWidth',\n})<{ fullWidth?: boolean }>(({ fullWidth }) => ({\n width: fullWidth ? '100%' : 'auto',\n position: 'relative',\n}));\n\nexport const FormControl: React.FC<FormControlProps> = ({ fullWidth = true, children, dataTestId }) =>\n // Don't pass error prop to the DOM element\n <StyledFormControl fullWidth={fullWidth} data-testid={dataTestId}>{children}</StyledFormControl>\n;\n\nconst StyledFormMessage = styled('span', {\n shouldForwardProp: (prop) => prop !== 'error',\n})<{ error?: boolean }>(({ theme, error }) => ({\n fontSize: '0.75rem',\n marginTop: theme.spacing(0.5),\n color: error ? theme.palette.error.main : theme.palette.text.secondary,\n display: 'block',\n}));\n\nexport const FormMessage: React.FC<FormMessageProps> = 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C,mBAAmB,CAAC,SAAS,SAAS;AACxC,CAAC,EAA2B,CAAC,EAAE,UAAU,OAAO;AAAA,EAC9C,OAAO,YAAY,SAAS;AAAA,EAC5B,UAAU;AACZ,EAAE;AAEK,IAAM,cAA0C,CAAC,EAAE,YAAY,MAAM,UAAU,WAAW;AAAA;AAAA,EAE9F,oBAAC,qBAAkB,WAAsB,eAAa,YAAa,UAAS;AAAA;AAG/E,IAAM,oBAAoB,OAAO,QAAQ;AAAA,EACvC,mBAAmB,CAAC,SAAS,SAAS;AACxC,CAAC,EAAuB,CAAC,EAAE,OAAO,MAAM,OAAO;AAAA,EAC7C,UAAU;AAAA,EACV,WAAW,MAAM,QAAQ,GAAG;AAAA,EAC5B,OAAO,QAAQ,MAAM,QAAQ,MAAM,OAAO,MAAM,QAAQ,KAAK;AAAA,EAC7D,SAAS;AACX,EAAE;AAEK,IAAM,cAA0C,CAAC,EAAE,OAAO,UAAU,WAAW,MAAM,oBAAC,qBAAkB,OAAc,eAAa,YAAa,UAAS;","names":[]}
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
FormControl,
|
|
9
9
|
FormLabel,
|
|
10
10
|
FormMessage
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-IPPTOL53.js";
|
|
12
12
|
|
|
13
13
|
// src/components/form/total-form/Fields/ToggleField.tsx
|
|
14
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -39,4 +39,4 @@ function ToggleField({ name, options, label }) {
|
|
|
39
39
|
export {
|
|
40
40
|
ToggleField
|
|
41
41
|
};
|
|
42
|
-
//# sourceMappingURL=chunk-
|
|
42
|
+
//# sourceMappingURL=chunk-LYMAMKJT.js.map
|
|
@@ -27,6 +27,7 @@ var Separator = ({
|
|
|
27
27
|
Box,
|
|
28
28
|
{
|
|
29
29
|
className,
|
|
30
|
+
"data-testid": dataTestId,
|
|
30
31
|
sx: {
|
|
31
32
|
display: "flex",
|
|
32
33
|
alignItems: "center",
|
|
@@ -41,11 +42,7 @@ var Separator = ({
|
|
|
41
42
|
{
|
|
42
43
|
variant: "body2",
|
|
43
44
|
color: "text.secondary",
|
|
44
|
-
sx: {
|
|
45
|
-
flexShrink: 0,
|
|
46
|
-
padding: theme.spacing(0, 1),
|
|
47
|
-
backgroundColor: theme.palette.background.default
|
|
48
|
-
},
|
|
45
|
+
sx: { flexShrink: 0, padding: theme.spacing(0, 1) },
|
|
49
46
|
children
|
|
50
47
|
}
|
|
51
48
|
),
|
|
@@ -69,4 +66,4 @@ var Separator = ({
|
|
|
69
66
|
export {
|
|
70
67
|
Separator
|
|
71
68
|
};
|
|
72
|
-
//# sourceMappingURL=chunk-
|
|
69
|
+
//# sourceMappingURL=chunk-MCZ7536N.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/layout/Separator/Separator.tsx"],"sourcesContent":["import Box from '@mui/material/Box/index.js';\nimport Typography from '@mui/material/Typography/index.js';\nimport { useTheme } from '@mui/material/styles/index.js';\nimport React from 'react';\n\nimport { separatorMargin, separatorStyles } from './Separator.styles';\nimport type { SeparatorProps } from './Separator.types';\n\nexport const Separator: React.FC<SeparatorProps> = ({\n variant = 'solid',\n orientation = 'horizontal',\n size = 'md',\n color,\n margin,\n length,\n children,\n className,\n 'data-testid': dataTestId,\n}) => {\n const theme = useTheme();\n const styles = separatorStyles(theme, { variant, orientation, size, color, margin, length });\n\n if (children) {\n const isHorizontal = orientation === 'horizontal';\n\n return (\n <Box\n className={className}\n // The plain branch below has always carried the caller's hook; this one\n // silently dropped it, so a LABELLED separator was the one variant no\n // test could address except through its own words.\n data-testid={dataTestId}\n sx={{\n display: 'flex',\n alignItems: 'center',\n margin: separatorMargin(size, margin),\n flexDirection: isHorizontal ? 'row' : 'column',\n gap: theme.spacing(2),\n }}\n >\n <Box sx={styles} />\n {/*\n No background behind the label. The two rules and the words are a FLEX\n ROW — the rules stop where the label starts — so there is nothing for a\n background to mask, and painting one made the label a coloured pill on\n every surface that is not `background.default`. On a white card it read\n as a highlight nobody had asked for.\n */}\n <Typography\n variant=\"body2\"\n color=\"text.secondary\"\n sx={{ flexShrink: 0, padding: theme.spacing(0, 1) }}\n >\n {children}\n </Typography>\n <Box sx={styles} />\n </Box>\n );\n }\n\n return (\n <Box\n className={className}\n sx={styles}\n role=\"separator\"\n aria-orientation={orientation}\n data-testid={dataTestId}\n />\n );\n};\n"],"mappings":";;;;;;AAAA,OAAO,SAAS;AAChB,OAAO,gBAAgB;AACvB,SAAS,gBAAgB;AAwBnB,SAcE,KAdF;AAlBC,IAAM,YAAsC,CAAC;AAAA,EAClD,UAAU;AAAA,EACV,cAAc;AAAA,EACd,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AACjB,MAAM;AACJ,QAAM,QAAQ,SAAS;AACvB,QAAM,SAAS,gBAAgB,OAAO,EAAE,SAAS,aAAa,MAAM,OAAO,QAAQ,OAAO,CAAC;AAE3F,MAAI,UAAU;AACZ,UAAM,eAAe,gBAAgB;AAErC,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QAIA,eAAa;AAAA,QACb,IAAI;AAAA,UACF,SAAS;AAAA,UACT,YAAY;AAAA,UACZ,QAAQ,gBAAgB,MAAM,MAAM;AAAA,UACpC,eAAe,eAAe,QAAQ;AAAA,UACtC,KAAK,MAAM,QAAQ,CAAC;AAAA,QACtB;AAAA,QAEA;AAAA,8BAAC,OAAI,IAAI,QAAQ;AAAA,UAQjB;AAAA,YAAC;AAAA;AAAA,cACC,SAAQ;AAAA,cACR,OAAM;AAAA,cACN,IAAI,EAAE,YAAY,GAAG,SAAS,MAAM,QAAQ,GAAG,CAAC,EAAE;AAAA,cAEjD;AAAA;AAAA,UACH;AAAA,UACA,oBAAC,OAAI,IAAI,QAAQ;AAAA;AAAA;AAAA,IACnB;AAAA,EAEJ;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,IAAI;AAAA,MACJ,MAAK;AAAA,MACL,oBAAkB;AAAA,MAClB,eAAa;AAAA;AAAA,EACf;AAEJ;","names":[]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FilterDialog,
|
|
3
3
|
GridFilterPanel
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CLNTJM3F.js";
|
|
5
5
|
import {
|
|
6
6
|
DataViewsEmpty
|
|
7
7
|
} from "./chunk-4Y65Q3CR.js";
|
|
8
8
|
import {
|
|
9
9
|
InlineFilterControls
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-CBPQJAHX.js";
|
|
11
11
|
import {
|
|
12
12
|
GridHeaderRow
|
|
13
13
|
} from "./chunk-A4YWFX5C.js";
|
|
@@ -237,4 +237,4 @@ function GridShell(props) {
|
|
|
237
237
|
export {
|
|
238
238
|
GridShell
|
|
239
239
|
};
|
|
240
|
-
//# sourceMappingURL=chunk-
|
|
240
|
+
//# sourceMappingURL=chunk-MD6T7MDT.js.map
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
FormControl,
|
|
27
27
|
FormLabel,
|
|
28
28
|
FormMessage
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-IPPTOL53.js";
|
|
30
30
|
|
|
31
31
|
// src/components/form/CategorySelect/CategorySelect.tsx
|
|
32
32
|
import { useEffect, useMemo, useRef } from "react";
|
|
@@ -158,4 +158,4 @@ function CategorySelect(props) {
|
|
|
158
158
|
export {
|
|
159
159
|
CategorySelect
|
|
160
160
|
};
|
|
161
|
-
//# sourceMappingURL=chunk-
|
|
161
|
+
//# sourceMappingURL=chunk-OAXAF4VY.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
FormControl,
|
|
3
3
|
FormLabel,
|
|
4
4
|
FormMessage
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-IPPTOL53.js";
|
|
6
6
|
import {
|
|
7
7
|
fieldEdge
|
|
8
8
|
} from "./chunk-MLOWPVVW.js";
|
|
@@ -158,4 +158,4 @@ function CreatableSelect({
|
|
|
158
158
|
export {
|
|
159
159
|
CreatableSelect
|
|
160
160
|
};
|
|
161
|
-
//# sourceMappingURL=chunk-
|
|
161
|
+
//# sourceMappingURL=chunk-OI3HOI74.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DataViewsGrid
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WME2F2YY.js";
|
|
4
4
|
import {
|
|
5
5
|
DeleteViewDialog
|
|
6
6
|
} from "./chunk-HEDOL2RV.js";
|
|
@@ -178,4 +178,4 @@ function renderViewDialogs(ctl, fields, columns, views, testIdPrefix, onSaved) {
|
|
|
178
178
|
export {
|
|
179
179
|
DataViewsTableBase
|
|
180
180
|
};
|
|
181
|
-
//# sourceMappingURL=chunk-
|
|
181
|
+
//# sourceMappingURL=chunk-SRMWCN5D.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-4XK6JQ4D.js";
|
|
4
4
|
import {
|
|
5
5
|
CepField
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FWCUELBU.js";
|
|
7
7
|
|
|
8
8
|
// src/components/form/total-form/Fields/CepField.tsx
|
|
9
9
|
import { useCallback, useMemo, useRef } from "react";
|
|
@@ -80,4 +80,4 @@ function CepField2({
|
|
|
80
80
|
export {
|
|
81
81
|
CepField2 as CepField
|
|
82
82
|
};
|
|
83
|
-
//# sourceMappingURL=chunk-
|
|
83
|
+
//# sourceMappingURL=chunk-VOOPGAQO.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GridShell
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MD6T7MDT.js";
|
|
4
4
|
import {
|
|
5
5
|
useDataViewsState
|
|
6
6
|
} from "./chunk-5VVM2PPV.js";
|
|
@@ -27,4 +27,4 @@ function DataViewsGrid(props) {
|
|
|
27
27
|
export {
|
|
28
28
|
DataViewsGrid
|
|
29
29
|
};
|
|
30
|
-
//# sourceMappingURL=chunk-
|
|
30
|
+
//# sourceMappingURL=chunk-WME2F2YY.js.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CepField
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VOOPGAQO.js";
|
|
4
4
|
import {
|
|
5
5
|
CategoryField
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GCJLMX63.js";
|
|
7
7
|
import {
|
|
8
8
|
ToggleField
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-LYMAMKJT.js";
|
|
10
10
|
import {
|
|
11
11
|
TextField
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ZBOFBRZC.js";
|
|
13
13
|
import {
|
|
14
14
|
SelectField
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-37YPZHAG.js";
|
|
16
16
|
import {
|
|
17
17
|
__export
|
|
18
18
|
} from "./chunk-PZ5AY32C.js";
|
|
@@ -30,4 +30,4 @@ __export(Fields_exports, {
|
|
|
30
30
|
export {
|
|
31
31
|
Fields_exports
|
|
32
32
|
};
|
|
33
|
-
//# sourceMappingURL=chunk-
|
|
33
|
+
//# sourceMappingURL=chunk-WPR2HS5B.js.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
FormControl,
|
|
9
9
|
FormLabel,
|
|
10
10
|
FormMessage
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-IPPTOL53.js";
|
|
12
12
|
|
|
13
13
|
// src/components/form/total-form/Fields/TextField.tsx
|
|
14
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -38,4 +38,4 @@ function TextField({ name, label, type = "text", placeholder }) {
|
|
|
38
38
|
export {
|
|
39
39
|
TextField
|
|
40
40
|
};
|
|
41
|
-
//# sourceMappingURL=chunk-
|
|
41
|
+
//# sourceMappingURL=chunk-ZBOFBRZC.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DataViewsTableBase
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-SRMWCN5D.js";
|
|
4
4
|
import {
|
|
5
5
|
DataViewsGrid
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-WME2F2YY.js";
|
|
7
7
|
import {
|
|
8
8
|
BaseCard
|
|
9
9
|
} from "../chunk-6U7NA74A.js";
|
|
@@ -22,12 +22,12 @@ import {
|
|
|
22
22
|
useDragItem
|
|
23
23
|
} from "../chunk-JCJGJX7V.js";
|
|
24
24
|
import "../chunk-ZOLAYP2D.js";
|
|
25
|
-
import "../chunk-
|
|
26
|
-
import "../chunk-
|
|
25
|
+
import "../chunk-MD6T7MDT.js";
|
|
26
|
+
import "../chunk-CLNTJM3F.js";
|
|
27
27
|
import "../chunk-4Y65Q3CR.js";
|
|
28
|
-
import "../chunk-
|
|
28
|
+
import "../chunk-CBPQJAHX.js";
|
|
29
29
|
import "../chunk-5WNQJ5KS.js";
|
|
30
|
-
import "../chunk-
|
|
30
|
+
import "../chunk-ES2RN7YV.js";
|
|
31
31
|
import "../chunk-A4YWFX5C.js";
|
|
32
32
|
import "../chunk-ELYLG4F7.js";
|
|
33
33
|
import {
|
|
@@ -127,7 +127,7 @@ import "../chunk-XJKMH3RX.js";
|
|
|
127
127
|
import "../chunk-D2HKCPEH.js";
|
|
128
128
|
import "../chunk-UCU5FCYE.js";
|
|
129
129
|
import "../chunk-N5ZWC6CB.js";
|
|
130
|
-
import "../chunk-
|
|
130
|
+
import "../chunk-OAXAF4VY.js";
|
|
131
131
|
import "../chunk-MHFJBNDP.js";
|
|
132
132
|
import "../chunk-PU3AAKRR.js";
|
|
133
133
|
import "../chunk-ZUIJ3N7N.js";
|
|
@@ -151,7 +151,7 @@ import "../chunk-SJRTT3PA.js";
|
|
|
151
151
|
import "../chunk-BJ3J6FTN.js";
|
|
152
152
|
import "../chunk-JD364H3Y.js";
|
|
153
153
|
import "../chunk-C3UKR3NT.js";
|
|
154
|
-
import "../chunk-
|
|
154
|
+
import "../chunk-IPPTOL53.js";
|
|
155
155
|
import "../chunk-KFJKOVDD.js";
|
|
156
156
|
import "../chunk-S5LE2ARG.js";
|
|
157
157
|
import "../chunk-6PRA45LC.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../chunk-N5ZWC6CB.js";
|
|
2
2
|
import {
|
|
3
3
|
CategorySelect
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-OAXAF4VY.js";
|
|
5
5
|
import "../chunk-MHFJBNDP.js";
|
|
6
6
|
import "../chunk-PU3AAKRR.js";
|
|
7
7
|
import "../chunk-ZUIJ3N7N.js";
|
|
@@ -26,7 +26,7 @@ import "../chunk-ZBNTFWTG.js";
|
|
|
26
26
|
import "../chunk-DMNZD3Q7.js";
|
|
27
27
|
import "../chunk-FCOEJCUP.js";
|
|
28
28
|
import "../chunk-C3UKR3NT.js";
|
|
29
|
-
import "../chunk-
|
|
29
|
+
import "../chunk-IPPTOL53.js";
|
|
30
30
|
import "../chunk-MLOWPVVW.js";
|
|
31
31
|
import "../chunk-MFU4Y25U.js";
|
|
32
32
|
import "../chunk-PZ5AY32C.js";
|
package/dist/form/CepField.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import "../chunk-6XLMTOJ3.js";
|
|
2
2
|
import {
|
|
3
3
|
CepField
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-FWCUELBU.js";
|
|
5
5
|
import "../chunk-QYKDY4EI.js";
|
|
6
6
|
import "../chunk-M3RIC6JI.js";
|
|
7
7
|
import "../chunk-RMSH2I3O.js";
|
|
8
8
|
import "../chunk-SL6454K7.js";
|
|
9
9
|
import "../chunk-C3UKR3NT.js";
|
|
10
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-IPPTOL53.js";
|
|
11
11
|
import "../chunk-MLOWPVVW.js";
|
|
12
12
|
import "../chunk-HPK33ACY.js";
|
|
13
13
|
import "../chunk-PZ5AY32C.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CreatableSelect
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-OI3HOI74.js";
|
|
4
4
|
import "../chunk-C3UKR3NT.js";
|
|
5
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-IPPTOL53.js";
|
|
6
6
|
import "../chunk-MLOWPVVW.js";
|
|
7
7
|
import "../chunk-MFU4Y25U.js";
|
|
8
8
|
import "../chunk-PZ5AY32C.js";
|
package/dist/form/Form.js
CHANGED
package/dist/form/total-form.js
CHANGED
|
@@ -6,21 +6,21 @@ import {
|
|
|
6
6
|
} from "../chunk-XJUEHG72.js";
|
|
7
7
|
import {
|
|
8
8
|
FormContainer
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-E6OILRUU.js";
|
|
10
10
|
import {
|
|
11
11
|
Fields_exports
|
|
12
|
-
} from "../chunk-
|
|
13
|
-
import "../chunk-
|
|
12
|
+
} from "../chunk-WPR2HS5B.js";
|
|
13
|
+
import "../chunk-VOOPGAQO.js";
|
|
14
14
|
import {
|
|
15
15
|
CategoryField
|
|
16
|
-
} from "../chunk-
|
|
17
|
-
import "../chunk-
|
|
16
|
+
} from "../chunk-GCJLMX63.js";
|
|
17
|
+
import "../chunk-LYMAMKJT.js";
|
|
18
18
|
import {
|
|
19
19
|
TextField
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-ZBOFBRZC.js";
|
|
21
21
|
import {
|
|
22
22
|
SelectField
|
|
23
|
-
} from "../chunk-
|
|
23
|
+
} from "../chunk-37YPZHAG.js";
|
|
24
24
|
import {
|
|
25
25
|
FormContext,
|
|
26
26
|
useFormContext
|
|
@@ -30,11 +30,11 @@ import "../chunk-A7LG3AXV.js";
|
|
|
30
30
|
import "../chunk-II3YNC5S.js";
|
|
31
31
|
import "../chunk-VSLUFBMT.js";
|
|
32
32
|
import "../chunk-6XLMTOJ3.js";
|
|
33
|
-
import "../chunk-
|
|
33
|
+
import "../chunk-FWCUELBU.js";
|
|
34
34
|
import "../chunk-JD5BVIM7.js";
|
|
35
35
|
import "../chunk-JXUWWPZR.js";
|
|
36
36
|
import "../chunk-N5ZWC6CB.js";
|
|
37
|
-
import "../chunk-
|
|
37
|
+
import "../chunk-OAXAF4VY.js";
|
|
38
38
|
import "../chunk-MHFJBNDP.js";
|
|
39
39
|
import "../chunk-PU3AAKRR.js";
|
|
40
40
|
import "../chunk-ZUIJ3N7N.js";
|
|
@@ -55,7 +55,7 @@ import "../chunk-M3RIC6JI.js";
|
|
|
55
55
|
import "../chunk-RMSH2I3O.js";
|
|
56
56
|
import "../chunk-SL6454K7.js";
|
|
57
57
|
import "../chunk-C3UKR3NT.js";
|
|
58
|
-
import "../chunk-
|
|
58
|
+
import "../chunk-IPPTOL53.js";
|
|
59
59
|
import "../chunk-MLOWPVVW.js";
|
|
60
60
|
import "../chunk-BA4RHQ3B.js";
|
|
61
61
|
import "../chunk-IAQFQNBL.js";
|
package/dist/layout/Separator.js
CHANGED
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
GoogleIcon,
|
|
5
5
|
SocialLoginButton,
|
|
6
6
|
SocialLoginContainer
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-EB4BTKKY.js";
|
|
8
8
|
import "./chunk-INGPH3YQ.js";
|
|
9
9
|
import "./chunk-6GP2DOOO.js";
|
|
10
10
|
import "./chunk-HQJ75HHI.js";
|
|
11
11
|
import "./chunk-QCIWROKG.js";
|
|
12
12
|
import "./chunk-CMMPGAMJ.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-MCZ7536N.js";
|
|
14
14
|
import "./chunk-IFPTVHYR.js";
|
|
15
15
|
import "./chunk-VUHLNYAE.js";
|
|
16
16
|
import "./chunk-2GSIEDGN.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Form/Form.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,SAAS,EACV,MAAM,cAAc,CAAC;AA6BtB,eAAO,MAAM,IAAI,mFAYhB,CAAC;
|
|
1
|
+
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Form/Form.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,SAAS,EACV,MAAM,cAAc,CAAC;AA6BtB,eAAO,MAAM,IAAI,mFAYhB,CAAC;AAuDF,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAoB5C,CAAC;AAiBJ,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAS5C,CAAC;AASJ,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAEgD,CAClG;AAWD,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAAiI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Separator.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/Separator/Separator.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,
|
|
1
|
+
{"version":3,"file":"Separator.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/Separator/Separator.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA6D9C,CAAC"}
|
package/package.json
CHANGED
|
@@ -85,7 +85,7 @@ Default layout with fields stacked vertically:
|
|
|
85
85
|
```
|
|
86
86
|
|
|
87
87
|
### Horizontal Layout
|
|
88
|
-
|
|
88
|
+
Intended to put labels beside their inputs:
|
|
89
89
|
```tsx
|
|
90
90
|
<Form variant="horizontal">
|
|
91
91
|
<FormField name="field1" label="Field 1">
|
|
@@ -94,6 +94,13 @@ Labels positioned horizontally beside inputs:
|
|
|
94
94
|
</Form>
|
|
95
95
|
```
|
|
96
96
|
|
|
97
|
+
> **Not wired up yet.** `Form` accepts the variant, but nothing carries it down
|
|
98
|
+
> to `FormField` — `FormFieldProps` has no `variant` — so a horizontal form
|
|
99
|
+
> currently draws ordinary vertical rows. The field's styled wrapper still
|
|
100
|
+
> keeps the horizontal branch, scoped to the column axis (see
|
|
101
|
+
> [Row spacing](#row-spacing)), so wiring it up later is a wiring job rather
|
|
102
|
+
> than a re-derivation of the spacing.
|
|
103
|
+
|
|
97
104
|
### Inline Layout
|
|
98
105
|
All elements in a single row:
|
|
99
106
|
```tsx
|
|
@@ -103,6 +110,44 @@ All elements in a single row:
|
|
|
103
110
|
</Form>
|
|
104
111
|
```
|
|
105
112
|
|
|
113
|
+
## Row spacing
|
|
114
|
+
|
|
115
|
+
A label sits **4px** above its control, and exactly one thing puts it there:
|
|
116
|
+
`FormLabel`'s own `marginBottom` (`theme.spacing(0.5)`). `FormMessage` mirrors it
|
|
117
|
+
with the same 4px `marginTop` below the control, so a row reads 4 / control / 4.
|
|
118
|
+
|
|
119
|
+
`FormField` deliberately adds **nothing** to that. It used to: the wrapper was a
|
|
120
|
+
flex column with `gap: theme.spacing(1)`, and in a column a gap and a margin add
|
|
121
|
+
up — 8 + 4 = 12px, three times what every other user of `FormLabel` draws.
|
|
122
|
+
`CepField`, `CategorySelect`, `CreatableSelect`, the `total-form` fields and
|
|
123
|
+
`@12-apps/discounts`' builders all put a bare `FormLabel` straight inside a
|
|
124
|
+
`FormControl`, which has no gap of its own, so the label's margin is the whole
|
|
125
|
+
of their spacing at 4px. `FormField` was the only one of them that disagreed.
|
|
126
|
+
|
|
127
|
+
That is a claim about `FormLabel`'s callers, not about every labelled control in
|
|
128
|
+
the package: `Textarea` labels itself through MUI's `InputLabel` at
|
|
129
|
+
`theme.spacing(1)` and draws 8px. It shares no code with `FormLabel`, so it is a
|
|
130
|
+
separate inconsistency — worth settling one day, and no argument for keeping a
|
|
131
|
+
second spacing mechanism here.
|
|
132
|
+
|
|
133
|
+
Eight pixels a row is invisible on one field and decisive on six. Measured in
|
|
134
|
+
Chromium at 320x568 — the smallest supported viewport — a six-field address form
|
|
135
|
+
put its submit button 41px below the fold.
|
|
136
|
+
|
|
137
|
+
**There is no `spacing` prop, and that is the answer rather than an omission.**
|
|
138
|
+
A knob here would be a second place to state a decision that already has one, and
|
|
139
|
+
its default would have to be the 4px every other `FormLabel` row draws — so the
|
|
140
|
+
only thing it would buy is the ability to disagree with them. A row that
|
|
141
|
+
genuinely needs more air gets it from the container: `Form`'s own `spacing` sets
|
|
142
|
+
the distance *between* fields, and a caller composing `FormControl` +
|
|
143
|
+
`FormLabel` by hand can space them however it likes.
|
|
144
|
+
|
|
145
|
+
`variant="horizontal"` keeps a `columnGap` rather than a `gap`. That branch is
|
|
146
|
+
unreachable today (see [Horizontal Layout](#horizontal-layout)), and the axis is
|
|
147
|
+
the reason it is kept rather than deleted: with the label beside the control a
|
|
148
|
+
horizontal gap and a vertical margin are orthogonal, where a `gap` shorthand
|
|
149
|
+
would put the 8px straight back on the row axis as soon as a field wrapped.
|
|
150
|
+
|
|
106
151
|
## Validation
|
|
107
152
|
|
|
108
153
|
Display validation errors and helper text:
|
|
@@ -54,6 +54,45 @@ export const Form = React.forwardRef<HTMLFormElement, FormProps>(
|
|
|
54
54
|
|
|
55
55
|
Form.displayName = 'Form';
|
|
56
56
|
|
|
57
|
+
/**
|
|
58
|
+
* NO ROW GAP HERE, and that is the fix rather than an omission.
|
|
59
|
+
*
|
|
60
|
+
* `FormLabel` already carries `marginBottom: theme.spacing(0.5)` — 4px — and it
|
|
61
|
+
* carries it because it has to: every OTHER user of it (`CepField`,
|
|
62
|
+
* `CategorySelect`, `CreatableSelect`, the three `total-form` fields, five of
|
|
63
|
+
* `@12-apps/discounts`' builders and the host's own `currency-field`) puts a
|
|
64
|
+
* bare `FormLabel` straight inside a `FormControl`, which is a plain block box
|
|
65
|
+
* with no gap of its own. There, the label's own margin is the ONLY thing
|
|
66
|
+
* between the label and the control.
|
|
67
|
+
*
|
|
68
|
+
* A `gap: theme.spacing(1)` here was a second mechanism for that one job, and in
|
|
69
|
+
* a column the two ADD: 8px + 4px put `FormField` at 12px where every one of
|
|
70
|
+
* those siblings sits at 4px. Measured in Chromium at 320x568 on a consuming
|
|
71
|
+
* app's six-field delivery address form, the 8px a row it added pushed the
|
|
72
|
+
* submit button from 561px to 609px — 41px below the fold of the smallest
|
|
73
|
+
* supported phone, i.e. a checkout whose primary action is off-screen.
|
|
74
|
+
*
|
|
75
|
+
* That claim is about `FormLabel`'s own callers, not about the whole package:
|
|
76
|
+
* `Textarea` labels its control through MUI's `InputLabel` at
|
|
77
|
+
* `theme.spacing(1)` and still draws 8px. It composes nothing out of
|
|
78
|
+
* `FormLabel`, so it is a separate inconsistency rather than a reason to keep
|
|
79
|
+
* a second spacing here.
|
|
80
|
+
*
|
|
81
|
+
* ## The `columnGap` is scaffolding, and currently unreachable
|
|
82
|
+
*
|
|
83
|
+
* `FormFieldProps` has no `variant` and `FormField` passes none, so `variant`
|
|
84
|
+
* is ALWAYS undefined and every branch below resolves to the vertical shape.
|
|
85
|
+
* `Form` accepts `variant="horizontal"` and `Form.md` documents it as "labels
|
|
86
|
+
* beside inputs", but nothing carries that variant down to the field — so a
|
|
87
|
+
* horizontal form draws vertical rows today. That gap is older than this
|
|
88
|
+
* change and fixing it is a feature, not a spacing fix.
|
|
89
|
+
*
|
|
90
|
+
* The branch is kept, scoped to the COLUMN axis, so that whoever does wire it
|
|
91
|
+
* up inherits the right answer: with the label beside the control, a horizontal
|
|
92
|
+
* gap and a vertical margin are orthogonal and nothing double-counts. A `gap`
|
|
93
|
+
* shorthand there would put the 8px back on the row axis the moment a field
|
|
94
|
+
* wrapped.
|
|
95
|
+
*/
|
|
57
96
|
const StyledFormField = styled(Box, {
|
|
58
97
|
shouldForwardProp: (prop) => prop !== 'variant',
|
|
59
98
|
})<{ variant?: 'vertical' | 'horizontal' }>(
|
|
@@ -61,7 +100,7 @@ const StyledFormField = styled(Box, {
|
|
|
61
100
|
display: variant === 'horizontal' ? 'grid' : 'flex',
|
|
62
101
|
flexDirection: variant === 'horizontal' ? undefined : 'column',
|
|
63
102
|
gridTemplateColumns: variant === 'horizontal' ? '200px 1fr' : undefined,
|
|
64
|
-
|
|
103
|
+
columnGap: variant === 'horizontal' ? theme.spacing(1) : undefined,
|
|
65
104
|
alignItems: variant === 'horizontal' ? 'center' : undefined,
|
|
66
105
|
}),
|
|
67
106
|
);
|
|
@@ -26,6 +26,10 @@ export const Separator: React.FC<SeparatorProps> = ({
|
|
|
26
26
|
return (
|
|
27
27
|
<Box
|
|
28
28
|
className={className}
|
|
29
|
+
// The plain branch below has always carried the caller's hook; this one
|
|
30
|
+
// silently dropped it, so a LABELLED separator was the one variant no
|
|
31
|
+
// test could address except through its own words.
|
|
32
|
+
data-testid={dataTestId}
|
|
29
33
|
sx={{
|
|
30
34
|
display: 'flex',
|
|
31
35
|
alignItems: 'center',
|
|
@@ -35,14 +39,17 @@ export const Separator: React.FC<SeparatorProps> = ({
|
|
|
35
39
|
}}
|
|
36
40
|
>
|
|
37
41
|
<Box sx={styles} />
|
|
42
|
+
{/*
|
|
43
|
+
No background behind the label. The two rules and the words are a FLEX
|
|
44
|
+
ROW — the rules stop where the label starts — so there is nothing for a
|
|
45
|
+
background to mask, and painting one made the label a coloured pill on
|
|
46
|
+
every surface that is not `background.default`. On a white card it read
|
|
47
|
+
as a highlight nobody had asked for.
|
|
48
|
+
*/}
|
|
38
49
|
<Typography
|
|
39
50
|
variant="body2"
|
|
40
51
|
color="text.secondary"
|
|
41
|
-
sx={{
|
|
42
|
-
flexShrink: 0,
|
|
43
|
-
padding: theme.spacing(0, 1),
|
|
44
|
-
backgroundColor: theme.palette.background.default,
|
|
45
|
-
}}
|
|
52
|
+
sx={{ flexShrink: 0, padding: theme.spacing(0, 1) }}
|
|
46
53
|
>
|
|
47
54
|
{children}
|
|
48
55
|
</Typography>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/layout/Separator/Separator.tsx"],"sourcesContent":["import Box from '@mui/material/Box/index.js';\nimport Typography from '@mui/material/Typography/index.js';\nimport { useTheme } from '@mui/material/styles/index.js';\nimport React from 'react';\n\nimport { separatorMargin, separatorStyles } from './Separator.styles';\nimport type { SeparatorProps } from './Separator.types';\n\nexport const Separator: React.FC<SeparatorProps> = ({\n variant = 'solid',\n orientation = 'horizontal',\n size = 'md',\n color,\n margin,\n length,\n children,\n className,\n 'data-testid': dataTestId,\n}) => {\n const theme = useTheme();\n const styles = separatorStyles(theme, { variant, orientation, size, color, margin, length });\n\n if (children) {\n const isHorizontal = orientation === 'horizontal';\n\n return (\n <Box\n className={className}\n sx={{\n display: 'flex',\n alignItems: 'center',\n margin: separatorMargin(size, margin),\n flexDirection: isHorizontal ? 'row' : 'column',\n gap: theme.spacing(2),\n }}\n >\n <Box sx={styles} />\n <Typography\n variant=\"body2\"\n color=\"text.secondary\"\n sx={{\n flexShrink: 0,\n padding: theme.spacing(0, 1),\n backgroundColor: theme.palette.background.default,\n }}\n >\n {children}\n </Typography>\n <Box sx={styles} />\n </Box>\n );\n }\n\n return (\n <Box\n className={className}\n sx={styles}\n role=\"separator\"\n aria-orientation={orientation}\n data-testid={dataTestId}\n />\n );\n};\n"],"mappings":";;;;;;AAAA,OAAO,SAAS;AAChB,OAAO,gBAAgB;AACvB,SAAS,gBAAgB;AAwBnB,SAUE,KAVF;AAlBC,IAAM,YAAsC,CAAC;AAAA,EAClD,UAAU;AAAA,EACV,cAAc;AAAA,EACd,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AACjB,MAAM;AACJ,QAAM,QAAQ,SAAS;AACvB,QAAM,SAAS,gBAAgB,OAAO,EAAE,SAAS,aAAa,MAAM,OAAO,QAAQ,OAAO,CAAC;AAE3F,MAAI,UAAU;AACZ,UAAM,eAAe,gBAAgB;AAErC,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,IAAI;AAAA,UACF,SAAS;AAAA,UACT,YAAY;AAAA,UACZ,QAAQ,gBAAgB,MAAM,MAAM;AAAA,UACpC,eAAe,eAAe,QAAQ;AAAA,UACtC,KAAK,MAAM,QAAQ,CAAC;AAAA,QACtB;AAAA,QAEA;AAAA,8BAAC,OAAI,IAAI,QAAQ;AAAA,UACjB;AAAA,YAAC;AAAA;AAAA,cACC,SAAQ;AAAA,cACR,OAAM;AAAA,cACN,IAAI;AAAA,gBACF,YAAY;AAAA,gBACZ,SAAS,MAAM,QAAQ,GAAG,CAAC;AAAA,gBAC3B,iBAAiB,MAAM,QAAQ,WAAW;AAAA,cAC5C;AAAA,cAEC;AAAA;AAAA,UACH;AAAA,UACA,oBAAC,OAAI,IAAI,QAAQ;AAAA;AAAA;AAAA,IACnB;AAAA,EAEJ;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,IAAI;AAAA,MACJ,MAAK;AAAA,MACL,oBAAkB;AAAA,MAClB,eAAa;AAAA;AAAA,EACf;AAEJ;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/form/Form/Form.tsx"],"sourcesContent":["import Box from '@mui/material/Box/index.js';\nimport Stack from '@mui/material/Stack/index.js';\nimport { styled } from '@mui/material/styles/index.js';\nimport React from 'react';\n\nimport type {\n FormControlProps,\n FormFieldProps,\n FormLabelProps,\n FormMessageProps,\n FormProps,\n} from './Form.types';\n\nconst StyledForm = styled('form', {\n shouldForwardProp: (prop) => prop !== 'variant',\n})<{ variant?: FormProps['variant'] }>(({ theme, variant }) => ({\n width: '100%',\n ...(variant === 'inline' && {\n display: 'flex',\n gap: theme.spacing(2),\n alignItems: 'flex-start',\n }),\n}));\n\nconst spacingMap = {\n xs: 1,\n sm: 2,\n md: 3,\n lg: 4,\n xl: 5,\n};\n\nconst maxWidthMap = {\n sm: '600px',\n md: '900px',\n lg: '1200px',\n xl: '1536px',\n full: '100%',\n};\n\nexport const Form = React.forwardRef<HTMLFormElement, FormProps>(\n ({ variant = 'vertical', maxWidth = 'full', spacing = 'md', children, dataTestId, ...props }, ref) => (\n <StyledForm ref={ref} variant={variant} role=\"form\" data-testid={dataTestId} {...props}>\n <Box sx={{ maxWidth: maxWidthMap[maxWidth], width: '100%' }}>\n {variant === 'inline' ? (\n children\n ) : (\n <Stack spacing={spacingMap[spacing]}>{children}</Stack>\n )}\n </Box>\n </StyledForm>\n ),\n);\n\nForm.displayName = 'Form';\n\nconst StyledFormField = styled(Box, {\n shouldForwardProp: (prop) => prop !== 'variant',\n})<{ variant?: 'vertical' | 'horizontal' }>(\n ({ theme, variant }) => ({\n display: variant === 'horizontal' ? 'grid' : 'flex',\n flexDirection: variant === 'horizontal' ? undefined : 'column',\n gridTemplateColumns: variant === 'horizontal' ? '200px 1fr' : undefined,\n gap: theme.spacing(1),\n alignItems: variant === 'horizontal' ? 'center' : undefined,\n }),\n);\n\nexport const FormField: React.FC<FormFieldProps> = ({\n name,\n label,\n required,\n error,\n helperText,\n children,\n dataTestId,\n}) => (\n <StyledFormField data-testid={dataTestId}>\n {label && (\n <FormLabel required={required} error={!!error} htmlFor={name} dataTestId={dataTestId ? `${dataTestId}-label` : undefined}>\n {label}\n </FormLabel>\n )}\n <FormControl fullWidth dataTestId={dataTestId ? `${dataTestId}-control` : undefined}>\n {children}\n {(error || helperText) && <FormMessage error={!!error} dataTestId={dataTestId ? `${dataTestId}-message` : undefined}>{error || helperText}</FormMessage>}\n </FormControl>\n </StyledFormField>\n );\n\nconst StyledFormLabel = styled('label', {\n shouldForwardProp: (prop) => prop !== 'error',\n})<{ error?: boolean }>(({ theme, error }) => ({\n fontSize: '0.875rem',\n fontWeight: 500,\n color: error ? theme.palette.error.main : theme.palette.text.primary,\n marginBottom: theme.spacing(0.5),\n display: 'block',\n '&::after': {\n content: '\" *\"',\n color: theme.palette.error.main,\n display: 'var(--required-display, none)',\n },\n}));\n\nexport const FormLabel: React.FC<FormLabelProps> = ({ required, error, children, htmlFor, dataTestId }) => (\n <StyledFormLabel\n error={error}\n htmlFor={htmlFor}\n data-testid={dataTestId}\n style={{ '--required-display': required ? 'inline' : 'none' } as React.CSSProperties}\n >\n {children}\n </StyledFormLabel>\n );\n\nconst StyledFormControl = styled(Box, {\n shouldForwardProp: (prop) => prop !== 'fullWidth',\n})<{ fullWidth?: boolean }>(({ fullWidth }) => ({\n width: fullWidth ? '100%' : 'auto',\n position: 'relative',\n}));\n\nexport const FormControl: React.FC<FormControlProps> = ({ fullWidth = true, children, dataTestId }) =>\n // Don't pass error prop to the DOM element\n <StyledFormControl fullWidth={fullWidth} data-testid={dataTestId}>{children}</StyledFormControl>\n;\n\nconst StyledFormMessage = styled('span', {\n shouldForwardProp: (prop) => prop !== 'error',\n})<{ error?: boolean }>(({ theme, error }) => ({\n fontSize: '0.75rem',\n marginTop: theme.spacing(0.5),\n color: error ? theme.palette.error.main : theme.palette.text.secondary,\n display: 'block',\n}));\n\nexport const FormMessage: React.FC<FormMessageProps> = ({ error, children, dataTestId }) => <StyledFormMessage error={error} data-testid={dataTestId}>{children}</StyledFormMessage>;\n"],"mappings":";AAAA,OAAO,SAAS;AAChB,OAAO,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