asma-ui-core 3.135.3 → 3.136.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/asma-ui-core.css +1 -1
- package/dist/components/inputs/form-layout/StyledFormColumn.js +4 -4
- package/dist/components/miscellaneous/StyledFormControlLabel.js +18 -17
- package/dist/components/miscellaneous/StyledFormControlLabel.module.js +4 -0
- package/dist/components/utils/accordion/base-ui/StyledAccordionSummary.js +22 -22
- package/dist/src/components/inputs/form-layout/StyledFormColumn.d.ts +5 -3
- package/dist/src/components/miscellaneous/StyledFormControlLabel.d.ts +5 -1
- package/dist/src/components/utils/accordion/base-ui/StyledAccordionSummary.d.ts +7 -1
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
var
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
var a = ({ children: t, className: d, dataTest: m, maxWidth: o }) => /* @__PURE__ */ r("div", {
|
|
3
3
|
"data-testid": m,
|
|
4
4
|
className: d,
|
|
5
5
|
style: {
|
|
6
6
|
width: "100%",
|
|
7
|
-
maxWidth: "var(--form-column-width)"
|
|
7
|
+
maxWidth: o ?? "var(--form-column-width)"
|
|
8
8
|
},
|
|
9
9
|
children: t
|
|
10
10
|
});
|
|
11
11
|
export {
|
|
12
|
-
|
|
12
|
+
a as StyledFormColumn
|
|
13
13
|
};
|
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { resolveSx as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { cn as n } from "../../helpers/cn.js";
|
|
2
|
+
import { resolveSx as C } from "../../helpers/sx.js";
|
|
3
|
+
import L from "./StyledFormControlLabel.module.js";
|
|
4
|
+
import { cloneElement as g, isValidElement as s, useId as S } from "react";
|
|
5
|
+
import { jsx as A, jsxs as E } from "react/jsx-runtime";
|
|
6
|
+
var N = {
|
|
6
7
|
end: "flex-row",
|
|
7
8
|
start: "flex-row-reverse",
|
|
8
9
|
top: "flex-col-reverse",
|
|
9
10
|
bottom: "flex-col"
|
|
10
|
-
},
|
|
11
|
-
const e =
|
|
11
|
+
}, k = ({ control: l, label: a, checked: i, disabled: d, name: m, value: c, labelPlacement: x = "end", className: f, classes: p, sx: b, onChange: u }) => {
|
|
12
|
+
const e = s(l) ? l.props : {}, o = d ?? e.disabled ?? !1, h = !!e.readOnly, t = S(), y = e["aria-label"] != null || e["aria-labelledby"] != null, v = typeof a == "string" ? a.trim().length > 0 : a != null, r = s(l) && v && !y, w = s(l) ? g(l, {
|
|
12
13
|
checked: e.checked ?? i,
|
|
13
|
-
onChange: e.onChange ??
|
|
14
|
-
disabled:
|
|
14
|
+
onChange: e.onChange ?? u,
|
|
15
|
+
disabled: o,
|
|
15
16
|
name: e.name ?? m,
|
|
16
17
|
value: e.value ?? c,
|
|
17
|
-
...
|
|
18
|
+
...r ? { "aria-labelledby": t } : {}
|
|
18
19
|
}) : l;
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
className:
|
|
20
|
+
return /* @__PURE__ */ E("label", {
|
|
21
|
+
className: n("m-0 inline-flex items-center gap-2 align-middle text-delta-800", o || h ? "cursor-default" : "cursor-pointer", N[x], f),
|
|
21
22
|
style: {
|
|
22
23
|
fontFamily: "Roboto, Helvetica, Arial, sans-serif",
|
|
23
|
-
...
|
|
24
|
+
...C(b)
|
|
24
25
|
},
|
|
25
|
-
children: [
|
|
26
|
-
id:
|
|
27
|
-
className:
|
|
26
|
+
children: [w, a != null && /* @__PURE__ */ A("span", {
|
|
27
|
+
id: r ? t : void 0,
|
|
28
|
+
className: n(L.Label, "max-xs:min-w-0 max-xs:hyphens-auto max-xs:![overflow-wrap:anywhere]", o && "text-delta-300", p?.label),
|
|
28
29
|
children: a
|
|
29
30
|
})]
|
|
30
31
|
});
|
|
31
32
|
};
|
|
32
33
|
export {
|
|
33
|
-
|
|
34
|
+
k as StyledFormControlLabel
|
|
34
35
|
};
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { ChevronDownIcon as
|
|
2
|
-
import
|
|
3
|
-
import { useAccordionContext as
|
|
1
|
+
import { ChevronDownIcon as A } from "../../../icons/chevron-down-icon/ChevronDownIcon.js";
|
|
2
|
+
import r from "./StyledAccordion.module.js";
|
|
3
|
+
import { useAccordionContext as N } from "./AccordionContext.js";
|
|
4
4
|
import o from "clsx";
|
|
5
5
|
import "react";
|
|
6
6
|
import { Fragment as c, jsx as t, jsxs as l } from "react/jsx-runtime";
|
|
7
|
-
var
|
|
8
|
-
const { open: n, toggle:
|
|
9
|
-
"--trigger-height":
|
|
10
|
-
"--trigger-padding-x":
|
|
11
|
-
"--trigger-font-size":
|
|
12
|
-
"--chevron-size":
|
|
13
|
-
...
|
|
14
|
-
}, s = /* @__PURE__ */ t(
|
|
15
|
-
className: o(
|
|
7
|
+
var $ = ({ size: d = "large", expandChevronRight: a, chevronAlign: g = "edge", className: m, headerClassName: p, sx: x, children: i, onClick: h, ...u }) => {
|
|
8
|
+
const { open: n, toggle: f, disabled: y, triggerId: I, panelId: b } = N(), e = d === "small", v = {
|
|
9
|
+
"--trigger-height": e ? "48px" : "72px",
|
|
10
|
+
"--trigger-padding-x": e ? "8px" : "16px",
|
|
11
|
+
"--trigger-font-size": e ? "14px" : "18px",
|
|
12
|
+
"--chevron-size": e ? "20px" : "24px",
|
|
13
|
+
...x
|
|
14
|
+
}, s = /* @__PURE__ */ t(A, {
|
|
15
|
+
className: o(r.TriggerIcon, a && g === "edge" && r.TriggerIconRight),
|
|
16
16
|
"data-state-icon": !0
|
|
17
17
|
});
|
|
18
18
|
return /* @__PURE__ */ t("h3", {
|
|
19
|
-
className: o(
|
|
19
|
+
className: o(r.Header, p),
|
|
20
20
|
children: /* @__PURE__ */ t("button", {
|
|
21
|
-
...
|
|
21
|
+
...u,
|
|
22
22
|
type: "button",
|
|
23
|
-
id:
|
|
23
|
+
id: I,
|
|
24
24
|
"aria-expanded": n,
|
|
25
|
-
"aria-controls":
|
|
26
|
-
disabled:
|
|
27
|
-
onClick: (
|
|
28
|
-
|
|
25
|
+
"aria-controls": b,
|
|
26
|
+
disabled: y,
|
|
27
|
+
onClick: (S) => {
|
|
28
|
+
h?.(S), f();
|
|
29
29
|
},
|
|
30
|
-
className: o(
|
|
31
|
-
style:
|
|
30
|
+
className: o(r.Trigger, "asma-pressable", m),
|
|
31
|
+
style: v,
|
|
32
32
|
"data-panel-open": n ? "" : void 0,
|
|
33
33
|
children: a ? /* @__PURE__ */ l(c, { children: [i, s] }) : /* @__PURE__ */ l(c, { children: [s, i] })
|
|
34
34
|
})
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
37
|
export {
|
|
38
|
-
|
|
38
|
+
$ as StyledAccordionSummary
|
|
39
39
|
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
export interface StyledFormColumnProps {
|
|
3
3
|
children?: ReactNode;
|
|
4
4
|
className?: string;
|
|
5
5
|
dataTest?: string;
|
|
6
|
+
maxWidth?: CSSProperties['maxWidth'];
|
|
6
7
|
}
|
|
7
8
|
/**
|
|
8
9
|
* The one form column (field width pattern WID-1): at most 37.5rem (600 px), left-aligned, and as wide
|
|
9
10
|
* as its container when that is narrower. Fields, labels, hints and errors all sit inside it.
|
|
10
|
-
* A full-screen `MinimizableDialog` widens it to the dialog (WID-10).
|
|
11
|
+
* A full-screen `MinimizableDialog` widens it to the dialog (WID-10). Pass `maxWidth` to uncap it
|
|
12
|
+
* without changing the field-width tokens.
|
|
11
13
|
*/
|
|
12
|
-
export declare const StyledFormColumn: ({ children, className, dataTest }: StyledFormColumnProps) => JSX.Element;
|
|
14
|
+
export declare const StyledFormColumn: ({ children, className, dataTest, maxWidth, }: StyledFormColumnProps) => JSX.Element;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { ChangeEvent, ReactElement, ReactNode } from 'react';
|
|
2
2
|
export type LabelPlacement = 'end' | 'start' | 'top' | 'bottom';
|
|
3
|
+
export interface FormControlLabelClasses {
|
|
4
|
+
label?: string;
|
|
5
|
+
}
|
|
3
6
|
export interface FormControlLabelProps {
|
|
4
7
|
/** The control element (a checkbox, radio, or switch). Receives `checked`/`onChange`/`disabled`/`name`/`value` unless already set. */
|
|
5
8
|
control: ReactElement;
|
|
@@ -10,6 +13,7 @@ export interface FormControlLabelProps {
|
|
|
10
13
|
value?: unknown;
|
|
11
14
|
labelPlacement?: LabelPlacement;
|
|
12
15
|
className?: string;
|
|
16
|
+
classes?: FormControlLabelClasses;
|
|
13
17
|
sx?: unknown;
|
|
14
18
|
onChange?: (event: ChangeEvent<HTMLInputElement>, checked: boolean) => void;
|
|
15
19
|
}
|
|
@@ -28,4 +32,4 @@ export interface FormControlLabelProps {
|
|
|
28
32
|
* is unchanged and no markup moves. A control that already sets `aria-label`/`aria-labelledby`
|
|
29
33
|
* keeps its own.
|
|
30
34
|
*/
|
|
31
|
-
export declare const StyledFormControlLabel: ({ control, label, checked, disabled, name, value, labelPlacement, className, sx, onChange, }: FormControlLabelProps) => JSX.Element;
|
|
35
|
+
export declare const StyledFormControlLabel: ({ control, label, checked, disabled, name, value, labelPlacement, className, classes, sx, onChange, }: FormControlLabelProps) => JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export type StyledAccordionSummarySize = 'small' | 'large';
|
|
3
|
+
export type StyledAccordionSummaryChevronAlign = 'edge' | 'title';
|
|
3
4
|
/**
|
|
4
5
|
* @figmaNode wXrXt5uKNNzV2DnQCgyYZH#21228-37809
|
|
5
6
|
* The accordion header. Figma: rounded-8 white container (border/outline delta-300), 16px padding,
|
|
@@ -12,6 +13,11 @@ export interface StyledAccordionSummaryProps extends Omit<React.ButtonHTMLAttrib
|
|
|
12
13
|
size?: StyledAccordionSummarySize;
|
|
13
14
|
/** @figmaProp Chevron placement — Figma default is left; true = right (MUI parity) */
|
|
14
15
|
expandChevronRight?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Where the right-hand chevron sits: `edge` (default) pushes it to the trigger's trailing edge,
|
|
18
|
+
* `title` keeps it immediately after the title text. No effect with the left-hand chevron.
|
|
19
|
+
*/
|
|
20
|
+
chevronAlign?: StyledAccordionSummaryChevronAlign;
|
|
15
21
|
sx?: React.CSSProperties;
|
|
16
22
|
}
|
|
17
23
|
/**
|
|
@@ -19,4 +25,4 @@ export interface StyledAccordionSummaryProps extends Omit<React.ButtonHTMLAttrib
|
|
|
19
25
|
* inside a header, toggling the shared context. `data-panel-open` drives the chevron rotation in
|
|
20
26
|
* SCSS. TASK-201.
|
|
21
27
|
*/
|
|
22
|
-
export declare const StyledAccordionSummary: ({ size, expandChevronRight, className, headerClassName, sx, children, onClick, ...rest }: StyledAccordionSummaryProps) => JSX.Element;
|
|
28
|
+
export declare const StyledAccordionSummary: ({ size, expandChevronRight, chevronAlign, className, headerClassName, sx, children, onClick, ...rest }: StyledAccordionSummaryProps) => JSX.Element;
|