asma-ui-core 3.113.2 → 3.115.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/dynamic-select/components/DynamicInteractiveChipGroup.js +56 -59
- package/dist/components/inputs/field-styles.js +16 -16
- package/dist/components/inputs/textarea/StyledTextarea.module.js +8 -8
- package/dist/datetime/components/time-picker/StyledTimePicker.js +79 -78
- package/dist/src/components/inputs/dynamic-select/types.d.ts +8 -1
- package/dist/src/components/inputs/field-styles.d.ts +5 -2
- package/dist/src/components/inputs/field-styles.test.d.ts +1 -0
- package/dist/src/components/inputs/select-autocomplete/StyledSelectAutocomplete.d.ts +2 -1
- package/dist/src/components/inputs/textarea/StyledTextarea.d.ts +2 -1
- package/dist/src/datetime/components/time-picker/StyledTimePicker.d.ts +2 -1
- package/package.json +1 -1
- package/src/styles/components-colors/inputVariables.css +3 -2
|
@@ -1,110 +1,107 @@
|
|
|
1
1
|
import { cn as v } from "../../../../helpers/cn.js";
|
|
2
|
-
import { StyledTooltip as
|
|
2
|
+
import { StyledTooltip as X } from "../../../data-display/tooltip/StyledTooltip.js";
|
|
3
3
|
import { CloseIcon as j } from "../../../icons/close-icon/CloseIcon.js";
|
|
4
|
-
import { ErrorOutlineIcon as
|
|
5
|
-
import { StyledChip as
|
|
4
|
+
import { ErrorOutlineIcon as Y } from "../../../icons/error-outline-icon/ErrorOutlineIcon.js";
|
|
5
|
+
import { StyledChip as Z } from "../../../data-display/chip/StyledChip.js";
|
|
6
6
|
import { StyledInteractiveChip as O } from "../../../data-display/interactive-chip/StyledInteractiveChip.js";
|
|
7
|
-
import { StyledButton as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { DynamicSelectTitle as le } from "./DynamicSelectTitle.js";
|
|
7
|
+
import { StyledButton as _ } from "../../button/StyledButton.js";
|
|
8
|
+
import { useHelperSlot as ee } from "../../../../helpers/useHelperSlot.js";
|
|
9
|
+
import { fieldWidthStyle as te } from "../../field-styles.js";
|
|
10
|
+
import { useWrap as le } from "../helpers/useWrap.js";
|
|
11
|
+
import { DynamicSelectTitle as re } from "./DynamicSelectTitle.js";
|
|
13
12
|
import { Skeleton as N } from "../../../mui-compat/Skeleton.js";
|
|
14
|
-
import { forwardRef as
|
|
13
|
+
import { forwardRef as ae, useEffect as ie, useId as ne } from "react";
|
|
15
14
|
import { jsx as t, jsxs as S } from "react/jsx-runtime";
|
|
16
|
-
var ve =
|
|
17
|
-
const { options: d, dataTest:
|
|
18
|
-
_("DynamicInteractiveChipGroup", f, C);
|
|
19
|
-
const M = Z(f), { containerRef: m, wrapDisabled: w } = te({ dependencyList: [d, d.length] });
|
|
15
|
+
var ve = ae((V, D) => {
|
|
16
|
+
const { options: d, dataTest: z, value: r, readOnly: i, multiple: n, title: A, titleSize: L, width: T = "full", disabled: x, onChange: p, required: R, error: b, helperText: C, disableHelperText: $, valueKey: B = "value", labelKey: E = "label", renderLabel: o, getOptionTooltip: I, loading: H, size: w, locale: q = "en", clearSelectionLabel: G } = V, K = ne(), { show: W, role: F } = ee("DynamicInteractiveChipGroup", b, C, !$), { containerRef: f, wrapDisabled: y } = le({ dependencyList: [d, d.length] });
|
|
20
17
|
ie(() => {
|
|
21
|
-
|
|
22
|
-
}, [
|
|
23
|
-
const
|
|
18
|
+
f.current && (f.current.inert = !0);
|
|
19
|
+
}, [f]);
|
|
20
|
+
const m = (e) => typeof e == "object" ? e?.[E]?.toString() ?? "" : e?.toString() ?? "", g = (e) => typeof e == "object" ? e?.[B] : e, c = (e) => {
|
|
24
21
|
const l = g(e);
|
|
25
|
-
return l == null ? "" : typeof l == "string" || typeof l == "number" || typeof l == "boolean" ? String(l) : e == null ? "" :
|
|
26
|
-
}, s = (e, l) => g(e) === g(l),
|
|
22
|
+
return l == null ? "" : typeof l == "string" || typeof l == "number" || typeof l == "boolean" ? String(l) : e == null ? "" : m(e);
|
|
23
|
+
}, s = (e, l) => g(e) === g(l), J = n ? Array.isArray(r) && r.length > 0 : r != null, M = (e) => {
|
|
27
24
|
if (!n) {
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
p(
|
|
25
|
+
const a = s(e, r) ? null : e;
|
|
26
|
+
if (a === null) return;
|
|
27
|
+
p(a);
|
|
31
28
|
return;
|
|
32
29
|
}
|
|
33
30
|
const l = r ?? [];
|
|
34
|
-
p(l.find((
|
|
35
|
-
},
|
|
31
|
+
p(l.find((a) => s(a, e)) ? l.filter((a) => !s(a, e)) : [...l, e]);
|
|
32
|
+
}, u = i ? d.filter((e) => !!(n ? r?.find((l) => s(l, e)) : s(r, e))) : d, P = u.findIndex((e) => !(typeof e == "object" && e?.disabled) && !i);
|
|
36
33
|
return /* @__PURE__ */ S("div", {
|
|
37
|
-
"data-testid": `${
|
|
34
|
+
"data-testid": `${z}-dynamic-radio-group`,
|
|
38
35
|
className: "relative flex flex-col gap-y-1",
|
|
39
36
|
"data-field-width": T,
|
|
40
|
-
style:
|
|
37
|
+
style: te(T),
|
|
41
38
|
children: [
|
|
42
|
-
/* @__PURE__ */ t(
|
|
43
|
-
title:
|
|
44
|
-
titleSize:
|
|
39
|
+
/* @__PURE__ */ t(re, {
|
|
40
|
+
title: A,
|
|
41
|
+
titleSize: L
|
|
45
42
|
}),
|
|
46
43
|
/* @__PURE__ */ t("div", {
|
|
47
44
|
"aria-hidden": !0,
|
|
48
|
-
ref:
|
|
45
|
+
ref: f,
|
|
49
46
|
className: "pointer-events-none absolute left-0 top-0 flex flex-wrap gap-2 opacity-0",
|
|
50
47
|
style: { width: "100%" },
|
|
51
|
-
children:
|
|
48
|
+
children: u.map((e) => /* @__PURE__ */ t(O, {
|
|
52
49
|
className: "w-fit",
|
|
53
|
-
readOnly:
|
|
50
|
+
readOnly: i,
|
|
54
51
|
type: n ? "checkbox" : "radio",
|
|
55
52
|
dataTest: `ic-${c(e)}-hidden`,
|
|
56
|
-
label: o ? o(e) :
|
|
53
|
+
label: o ? o(e) : m(e)
|
|
57
54
|
}, c(e)))
|
|
58
55
|
}),
|
|
59
56
|
/* @__PURE__ */ t("div", {
|
|
60
|
-
className: v("flex flex-wrap gap-2",
|
|
61
|
-
children:
|
|
57
|
+
className: v("flex flex-wrap gap-2", y && "flex-col gap-1"),
|
|
58
|
+
children: H ? /* @__PURE__ */ S("div", {
|
|
62
59
|
className: "flex flex-wrap gap-2",
|
|
63
60
|
children: [
|
|
64
61
|
/* @__PURE__ */ t(N, { className: "h-[32px] w-[60px]" }),
|
|
65
62
|
/* @__PURE__ */ t(N, { className: "h-[32px] w-[60px]" }),
|
|
66
63
|
/* @__PURE__ */ t(N, { className: "h-[32px] w-[60px]" })
|
|
67
64
|
]
|
|
68
|
-
}) :
|
|
69
|
-
const
|
|
70
|
-
if (
|
|
71
|
-
const
|
|
72
|
-
return /* @__PURE__ */ t(
|
|
73
|
-
title:
|
|
65
|
+
}) : u?.length ? u.map((e, l) => {
|
|
66
|
+
const a = !!(n ? r?.find((U) => s(U, e)) : s(r, e)), Q = I ? I(e) : null;
|
|
67
|
+
if (i && !a) return null;
|
|
68
|
+
const h = typeof e == "object" ? !!e?.disabled : !1, k = !h && !i && l === P ? D : void 0;
|
|
69
|
+
return /* @__PURE__ */ t(X, {
|
|
70
|
+
title: Q,
|
|
74
71
|
arrow: !0,
|
|
75
72
|
children: /* @__PURE__ */ t("span", {
|
|
76
|
-
className: v(
|
|
77
|
-
children:
|
|
73
|
+
className: v(h && "cursor-not-allowed"),
|
|
74
|
+
children: i && !y ? /* @__PURE__ */ t(Z, {
|
|
78
75
|
ref: k,
|
|
79
|
-
disabled: !!
|
|
76
|
+
disabled: !!x || h,
|
|
80
77
|
classes: { root: "min-h-[32px] h-full" },
|
|
81
78
|
className: "w-fit",
|
|
82
79
|
dataTest: `ic-${c(e)}`,
|
|
83
|
-
label: o ? o(e) :
|
|
80
|
+
label: o ? o(e) : m(e)
|
|
84
81
|
}) : /* @__PURE__ */ t(O, {
|
|
85
82
|
ref: k,
|
|
86
|
-
disabled: !!
|
|
87
|
-
classes:
|
|
83
|
+
disabled: !!x || h,
|
|
84
|
+
classes: y ? {
|
|
88
85
|
root: "border-none outline-none bg-transparent w-full flex justify-start h-full min-h-[40px] shadow-none",
|
|
89
86
|
label: "block whitespace-normal break-words overflow-visible"
|
|
90
87
|
} : { root: "min-h-[32px] h-full" },
|
|
91
88
|
className: "w-fit",
|
|
92
|
-
readOnly:
|
|
89
|
+
readOnly: i,
|
|
93
90
|
type: n ? "checkbox" : "radio",
|
|
94
91
|
dataTest: `ic-${c(e)}`,
|
|
95
|
-
checked:
|
|
96
|
-
size:
|
|
97
|
-
onClick: () =>
|
|
98
|
-
label: o ? o(e) :
|
|
92
|
+
checked: a,
|
|
93
|
+
size: w,
|
|
94
|
+
onClick: () => M(e),
|
|
95
|
+
label: o ? o(e) : m(e)
|
|
99
96
|
})
|
|
100
97
|
})
|
|
101
98
|
}, c(e));
|
|
102
99
|
}) : /* @__PURE__ */ t("span", { children: "-" })
|
|
103
100
|
}),
|
|
104
|
-
!
|
|
101
|
+
!R && J && !i && !x && /* @__PURE__ */ t(_, {
|
|
105
102
|
dataTest: "clear-selection-btn",
|
|
106
103
|
variant: "text",
|
|
107
|
-
startIcon:
|
|
104
|
+
startIcon: w === "medium" ? /* @__PURE__ */ t(j, {
|
|
108
105
|
height: 24,
|
|
109
106
|
width: 24,
|
|
110
107
|
className: "size-6"
|
|
@@ -114,15 +111,15 @@ var ve = re((V, A) => {
|
|
|
114
111
|
className: "size-5"
|
|
115
112
|
}),
|
|
116
113
|
className: "w-fit",
|
|
117
|
-
size:
|
|
114
|
+
size: w,
|
|
118
115
|
onClick: () => p(n ? [] : null),
|
|
119
116
|
children: G ?? (q === "en" ? "Clear selection" : "Fjern valget")
|
|
120
117
|
}),
|
|
121
|
-
/* @__PURE__ */ S("div", {
|
|
118
|
+
W && /* @__PURE__ */ S("div", {
|
|
122
119
|
id: K,
|
|
123
|
-
role:
|
|
124
|
-
className: v("flex min-h-[24px] items-center gap-1 pt-1 text-sm/5 text-delta-600",
|
|
125
|
-
children: [
|
|
120
|
+
role: F,
|
|
121
|
+
className: v("flex min-h-[24px] items-center gap-1 pt-1 text-sm/5 text-delta-600", b && "text-error-500"),
|
|
122
|
+
children: [b && /* @__PURE__ */ t(Y, {
|
|
126
123
|
width: 20,
|
|
127
124
|
height: 20,
|
|
128
125
|
className: "min-w-5"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
var
|
|
1
|
+
import { cn as t } from "../../helpers/cn.js";
|
|
2
|
+
var l = () => ({
|
|
3
3
|
boxSizing: "border-box",
|
|
4
4
|
height: 40,
|
|
5
5
|
minHeight: 40,
|
|
6
6
|
maxHeight: 40
|
|
7
|
-
}),
|
|
7
|
+
}), s = ({ paddingLeft: e = 14, paddingRight: r = 14 } = {}) => ({
|
|
8
8
|
boxSizing: "border-box",
|
|
9
9
|
margin: 0,
|
|
10
10
|
paddingTop: 0,
|
|
@@ -16,29 +16,29 @@ var d = () => ({
|
|
|
16
16
|
maxHeight: 40,
|
|
17
17
|
lineHeight: "24px",
|
|
18
18
|
fontSize: 16
|
|
19
|
-
}),
|
|
19
|
+
}), b = (e) => e ? {
|
|
20
20
|
top: 0,
|
|
21
21
|
transform: "translateY(-50%)"
|
|
22
22
|
} : {
|
|
23
23
|
top: "50%",
|
|
24
24
|
transform: "translateY(-50%)"
|
|
25
|
-
},
|
|
25
|
+
}, x = (e) => ({
|
|
26
26
|
width: "100%",
|
|
27
27
|
maxWidth: `var(--field-width-${e})`
|
|
28
|
-
}),
|
|
28
|
+
}), p = {
|
|
29
29
|
"--field-width-full": "100%",
|
|
30
30
|
"--form-column-width": "100%"
|
|
31
|
-
}, g = (e) => e <= 9 ? "xs" : e <= 15 ? "s" : e <= 27 ? "m" : "full",
|
|
31
|
+
}, g = (e) => e <= 9 ? "xs" : e <= 15 ? "s" : e <= 27 ? "m" : "full", h = ({ disabled: e } = {}) => t("block pb-1 text-base font-semibold", e ? "text-delta-300" : "text-delta-800"), n = "shadow-[inset_0_0_0_2px_var(--colors-error-500)]", u = ({ focused: e, error: r, disabled: o, readOnly: a, borderless: i }) => t("pointer-events-none absolute inset-0 rounded border border-solid transition-colors", i && !e ? "border-transparent" : o ? "border-delta-300" : a ? "border-delta-200" : r ? t("border-error-500", e && n) : e ? "border-focus-ring shadow-[inset_0_0_0_2px_var(--colors-focus-ring)]" : "border-delta-500 group-hover:border-2 group-hover:border-gama-300"), v = ({ focused: e, error: r, disabled: o, readOnly: a, notched: i = !0 }) => t("pointer-events-none absolute z-0 m-0 box-border min-w-0 overflow-hidden rounded border border-solid transition-colors", i ? "inset-x-0 bottom-0 top-[-5px] px-2 py-0" : "inset-0", o ? "border-delta-300" : a ? "border-delta-200" : r ? t("border-error-500", e && n) : e ? "border-focus-ring shadow-[inset_0_0_0_2px_var(--colors-focus-ring)]" : "border-delta-500 group-hover:border-2 group-hover:border-gama-300"), m = (e) => t("block h-[11px] overflow-hidden bg-white p-0 text-xs leading-[23px] text-transparent transition-[max-width] duration-150", e ? "max-w-full" : "max-w-[0.01px]"), f = ({ shrink: e, focused: r, error: o, disabled: a, readOnly: i }) => t("pointer-events-none absolute left-[14px] z-10 max-w-[calc(100%-1.75rem)] truncate transition-colors duration-150", a ? "text-delta-300" : i ? "text-delta-800" : o ? "text-error-500" : r ? "text-gama-500" : e ? "text-delta-800" : "text-delta-500", e ? "bg-white px-1 text-xs leading-[16px] tracking-[0.24px]" : "text-base leading-[23px] tracking-[0.00938em]");
|
|
32
32
|
export {
|
|
33
|
-
|
|
33
|
+
h as fieldLabelAboveClass,
|
|
34
34
|
g as fieldWidthForMaxLength,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
x as fieldWidthStyle,
|
|
36
|
+
f as floatingLabelClass,
|
|
37
|
+
b as floatingLabelLayoutStyle,
|
|
38
|
+
p as fullScreenFieldWidthVars,
|
|
39
|
+
m as notchedLegendClass,
|
|
40
|
+
v as notchedOutlineClass,
|
|
41
41
|
u as outlineClass,
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
s as singleLineInputLayoutStyle,
|
|
43
|
+
l as singleLineShellLayoutStyle
|
|
44
44
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
textarea:
|
|
3
|
-
active:
|
|
4
|
-
error:
|
|
5
|
-
label:
|
|
6
|
-
disabled:
|
|
7
|
-
description:
|
|
1
|
+
var e = "_textarea_1sre0_1", r = "_active_1sre0_1", a = "_error_1sre0_43", _ = "_label_1sre0_86", t = "_disabled_1sre0_94", s = "_description_1sre0_99", d = {
|
|
2
|
+
textarea: e,
|
|
3
|
+
active: r,
|
|
4
|
+
error: a,
|
|
5
|
+
label: _,
|
|
6
|
+
disabled: t,
|
|
7
|
+
description: s
|
|
8
8
|
};
|
|
9
9
|
export {
|
|
10
|
-
|
|
10
|
+
d as default
|
|
11
11
|
};
|
|
@@ -1,119 +1,120 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { isOverlayBackEnabled as
|
|
3
|
-
import { useIsMobileView as
|
|
4
|
-
import { StyledDrawer as
|
|
5
|
-
import { useBackNavigationClose as
|
|
6
|
-
import { usePopupState as
|
|
7
|
-
import { ClickAwayListener as
|
|
8
|
-
import { isBeforeMinTime as
|
|
9
|
-
import { TimePickerPanel as
|
|
10
|
-
import { TimePickerPopper as
|
|
11
|
-
import { getTimeFromValue as
|
|
12
|
-
import { timePickerWidthProps as
|
|
13
|
-
import { TimePickerInput as
|
|
14
|
-
import { useEffect as
|
|
15
|
-
import { jsx as
|
|
16
|
-
import { format as V, isBefore as
|
|
17
|
-
var
|
|
18
|
-
const { value:
|
|
1
|
+
import { cn as D } from "../../../helpers/cn.js";
|
|
2
|
+
import { isOverlayBackEnabled as q, useBackCloses as F } from "../../../hooks/useBackCloses.hook.js";
|
|
3
|
+
import { useIsMobileView as K } from "../../hooks/useWindowWidthSize.hook.js";
|
|
4
|
+
import { StyledDrawer as W } from "../../../components/navigation/drawer/StyledDrawer.js";
|
|
5
|
+
import { useBackNavigationClose as z } from "../../hooks/useBackNavigationClose.hook.js";
|
|
6
|
+
import { usePopupState as G } from "../../../hooks/usePopupState.js";
|
|
7
|
+
import { ClickAwayListener as J } from "../../../components/mui-compat/ClickAwayListener.js";
|
|
8
|
+
import { isBeforeMinTime as E } from "./helpers/minTime.js";
|
|
9
|
+
import { TimePickerPanel as Q } from "./components/TimePickerPanel.js";
|
|
10
|
+
import { TimePickerPopper as R } from "./TimePickerPopper.js";
|
|
11
|
+
import { getTimeFromValue as C } from "./helpers/getTimeFromValue.js";
|
|
12
|
+
import { timePickerWidthProps as H } from "./helpers/timePickerWidth.js";
|
|
13
|
+
import { TimePickerInput as U } from "./TimePickerInput.js";
|
|
14
|
+
import { useEffect as X, useState as P } from "react";
|
|
15
|
+
import { jsx as i, jsxs as L } from "react/jsx-runtime";
|
|
16
|
+
import { format as V, isBefore as Y, isValid as Z } from "date-fns";
|
|
17
|
+
var de = (r) => {
|
|
18
|
+
const { value: a, onSelect: n, notBeforeTime: v, minTime: c } = r, t = G({
|
|
19
19
|
variant: "popper",
|
|
20
20
|
popupId: "time-picker-popper"
|
|
21
|
-
}), m =
|
|
22
|
-
|
|
21
|
+
}), m = K();
|
|
22
|
+
F({
|
|
23
23
|
active: t.isOpen,
|
|
24
24
|
requestClose: t.close
|
|
25
|
-
}),
|
|
26
|
-
open: m && t.isOpen && !
|
|
25
|
+
}), z({
|
|
26
|
+
open: m && t.isOpen && !q(),
|
|
27
27
|
onClose: t.close
|
|
28
28
|
});
|
|
29
|
-
const { isOpen:
|
|
30
|
-
|
|
31
|
-
if (!
|
|
32
|
-
const e = (
|
|
33
|
-
|
|
29
|
+
const { isOpen: b, anchorEl: S, close: w } = t;
|
|
30
|
+
X(() => {
|
|
31
|
+
if (!b || m) return;
|
|
32
|
+
const e = (o) => {
|
|
33
|
+
S?.contains(document.activeElement) && (o.key === "Escape" ? (o.preventDefault(), o.stopPropagation(), w()) : o.key === "Tab" && w());
|
|
34
34
|
};
|
|
35
35
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
36
36
|
}, [
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
b,
|
|
38
|
+
S,
|
|
39
|
+
w,
|
|
40
40
|
m
|
|
41
41
|
]);
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
const T = a ? V(a, "HH:mm") : "", [k, u] = P(T), [x, s] = P(!1), [B, f] = P(!1), p = x ? k : T, d = (e) => !e || !v || !Z(v) || !Y(e, v), l = p.length === 5 ? C(p, a) : null, j = !B || p === "" || l !== null, I = !B || !l || d(l), g = (e) => {
|
|
43
|
+
if (e === "") return !0;
|
|
44
|
+
const o = C(e, a);
|
|
45
|
+
return o !== null && d(o);
|
|
46
|
+
}, M = (e) => {
|
|
47
|
+
const o = e.target.value;
|
|
48
|
+
if (s(!0), u(o), g(o) && f(!1), o.length !== 5) return;
|
|
49
|
+
const h = C(o, a);
|
|
50
|
+
if (!h) {
|
|
51
|
+
n(void 0);
|
|
46
52
|
return;
|
|
47
53
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
54
|
+
E(h, c) || (d(h) ? (n(h), s(!1), t.close()) : n(void 0));
|
|
55
|
+
}, O = (e) => {
|
|
56
|
+
if (e && E(e, c)) return;
|
|
57
|
+
const o = d(e);
|
|
58
|
+
if (f(!o), o) {
|
|
59
|
+
n(e), u(e ? V(e, "HH:mm") : ""), s(!1);
|
|
51
60
|
return;
|
|
52
61
|
}
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
n(void 0), u(e ? V(e, "HH:mm") : ""), a(!0);
|
|
61
|
-
}
|
|
62
|
-
}, j = () => {
|
|
63
|
-
b && f && w(f, c) && a(!1);
|
|
64
|
-
}, S = () => {
|
|
65
|
-
n(void 0), u(""), a(!1), s(!0);
|
|
66
|
-
}, y = /* @__PURE__ */ r(Q, {
|
|
67
|
-
...o,
|
|
62
|
+
n(void 0), u(e ? V(e, "HH:mm") : ""), s(!0);
|
|
63
|
+
}, A = () => {
|
|
64
|
+
x && (l && E(l, c) ? s(!1) : k === "" ? n(void 0) : g(k) || f(!0));
|
|
65
|
+
}, N = () => {
|
|
66
|
+
n(void 0), u(""), s(!1), f(!1);
|
|
67
|
+
}, y = /* @__PURE__ */ i(U, {
|
|
68
|
+
...r,
|
|
68
69
|
popupState: t,
|
|
69
|
-
localValue:
|
|
70
|
-
isValidTime:
|
|
71
|
-
isValidEndTime:
|
|
72
|
-
handleChange:
|
|
73
|
-
handleBlur:
|
|
70
|
+
localValue: p,
|
|
71
|
+
isValidTime: j,
|
|
72
|
+
isValidEndTime: I,
|
|
73
|
+
handleChange: M,
|
|
74
|
+
handleBlur: A
|
|
74
75
|
});
|
|
75
|
-
return
|
|
76
|
-
className:
|
|
77
|
-
...
|
|
78
|
-
children: [/* @__PURE__ */
|
|
76
|
+
return r.disabled || r.readOnly ? y : m ? /* @__PURE__ */ L("div", {
|
|
77
|
+
className: D("relative h-auto", typeof r.width == "number" && "w-auto"),
|
|
78
|
+
...H(r.width),
|
|
79
|
+
children: [/* @__PURE__ */ i("div", {
|
|
79
80
|
className: "m-0 flex h-fit items-center justify-center p-0",
|
|
80
81
|
children: y
|
|
81
|
-
}), /* @__PURE__ */
|
|
82
|
+
}), /* @__PURE__ */ i(W, {
|
|
82
83
|
anchor: "bottom",
|
|
83
84
|
open: t.isOpen,
|
|
84
85
|
onClose: t.close,
|
|
85
86
|
anchorEl: t.anchorEl,
|
|
86
87
|
registerBackClose: !1,
|
|
87
|
-
children: /* @__PURE__ */
|
|
88
|
+
children: /* @__PURE__ */ i("div", {
|
|
88
89
|
className: "mx-auto w-full max-w-[360px] px-4 pb-[max(1rem,env(safe-area-inset-bottom))] pt-2",
|
|
89
|
-
children: /* @__PURE__ */
|
|
90
|
-
dataTest:
|
|
91
|
-
value:
|
|
90
|
+
children: /* @__PURE__ */ i(Q, {
|
|
91
|
+
dataTest: r.dataTest,
|
|
92
|
+
value: a,
|
|
92
93
|
minTime: c,
|
|
93
|
-
onSelect:
|
|
94
|
-
handleClear:
|
|
94
|
+
onSelect: O,
|
|
95
|
+
handleClear: N,
|
|
95
96
|
onConfirm: t.close
|
|
96
97
|
})
|
|
97
98
|
})
|
|
98
99
|
})]
|
|
99
|
-
}) : /* @__PURE__ */
|
|
100
|
+
}) : /* @__PURE__ */ i(J, {
|
|
100
101
|
mouseEvent: "onMouseDown",
|
|
101
102
|
onClickAway: t.close,
|
|
102
|
-
children: /* @__PURE__ */
|
|
103
|
-
className:
|
|
104
|
-
...
|
|
105
|
-
children: [/* @__PURE__ */
|
|
103
|
+
children: /* @__PURE__ */ L("div", {
|
|
104
|
+
className: D("relative h-auto", typeof r.width == "number" && "w-auto"),
|
|
105
|
+
...H(r.width),
|
|
106
|
+
children: [/* @__PURE__ */ i("div", {
|
|
106
107
|
className: "m-0 flex h-fit items-center justify-center p-0",
|
|
107
108
|
children: y
|
|
108
|
-
}), t.isOpen && /* @__PURE__ */
|
|
109
|
-
...
|
|
109
|
+
}), t.isOpen && /* @__PURE__ */ i(R, {
|
|
110
|
+
...r,
|
|
110
111
|
popupState: t,
|
|
111
|
-
handleClear:
|
|
112
|
-
onSelect:
|
|
112
|
+
handleClear: N,
|
|
113
|
+
onSelect: O
|
|
113
114
|
})]
|
|
114
115
|
})
|
|
115
116
|
});
|
|
116
117
|
};
|
|
117
118
|
export {
|
|
118
|
-
|
|
119
|
+
de as StyledTimePicker
|
|
119
120
|
};
|
|
@@ -67,7 +67,14 @@ interface DynamicSelectCommonProps<TOption extends DynamicSelectOption> {
|
|
|
67
67
|
*/
|
|
68
68
|
required?: boolean;
|
|
69
69
|
helperText?: React.ReactNode;
|
|
70
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* Stops the helper row being *reserved* below the control. A real `helperText` or an `error` still
|
|
72
|
+
* renders it, growing the layout at that moment — so nothing is silently swallowed.
|
|
73
|
+
*
|
|
74
|
+
* On the autocomplete variant it removes the block outright, which is what it has always done
|
|
75
|
+
* there. On the chip-group variant (1–5 options) it opts out of a 28px row that would otherwise
|
|
76
|
+
* sit empty under the chips.
|
|
77
|
+
*/
|
|
71
78
|
disableHelperText?: boolean;
|
|
72
79
|
/**
|
|
73
80
|
* Key of `TOption` used as the option's identity for comparison and as the chip/tag key.
|
|
@@ -46,9 +46,12 @@ interface FieldState {
|
|
|
46
46
|
/** `variant="standard"`: same geometry as the outlined field, but the border is painted on focus only. */
|
|
47
47
|
borderless?: boolean;
|
|
48
48
|
}
|
|
49
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* The border overlay (an absolutely-positioned sibling so width changes never reflow the input).
|
|
51
|
+
* States: resting 1px delta-500 · focused 3px focus-ring · error 1px error-500 · error + focused 3px error-500.
|
|
52
|
+
*/
|
|
50
53
|
export declare const outlineClass: ({ focused, error, disabled, readOnly, borderless }: FieldState) => string;
|
|
51
|
-
/** MUI-compatible fieldset outline used by text fields with floating labels. */
|
|
54
|
+
/** MUI-compatible fieldset outline used by text fields with floating labels. Same states as `outlineClass`. */
|
|
52
55
|
export declare const notchedOutlineClass: ({ focused, error, disabled, readOnly, notched, }: FieldState & {
|
|
53
56
|
notched?: boolean;
|
|
54
57
|
}) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -43,7 +43,8 @@ type AutocompleteValue<T, Multiple, DisableClearable, FreeSolo> = Multiple exten
|
|
|
43
43
|
/**
|
|
44
44
|
* @figmaNode wXrXt5uKNNzV2DnQCgyYZH#20474-29075
|
|
45
45
|
* Figma "Autocomplete". The trigger is the outlined **Input field** (shared `field-styles`: 40px,
|
|
46
|
-
* border enabled delta-500/`#7a899e`, hover gama-300, focus
|
|
46
|
+
* border enabled delta-500/`#7a899e`, hover gama-300, focus 3px `color.focus.ring`, error error-500,
|
|
47
|
+
* error + focus 3px error-500),
|
|
47
48
|
* so the field **State** (Enabled/Hovered/Focused/Error/Read-only) ← focus/open + `error`/`readOnly`/
|
|
48
49
|
* `disabled`. **Filled** ← selected value(s): single fills the input text, multiple renders **Tag
|
|
49
50
|
* chips** (`StyledChip`: h32, radius25, label 16/delta-700 — node 20475-29954). The dropdown is the
|
|
@@ -57,7 +57,8 @@ type StyledTextAreaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement> & T
|
|
|
57
57
|
* Figma has no standalone "Text area" component — a multiline text control inherits the **Input
|
|
58
58
|
* field** outlined styling (shared with `StyledInputField`/`field-styles`): radius 4, field text
|
|
59
59
|
* **Body Base 16/lh24 delta-800**; border **enabled delta-500 #7a899e**, **hover gama-300 #60bdbd
|
|
60
|
-
* (2px)**, **focus
|
|
60
|
+
* (2px)**, **focus 3px `color.focus.ring`**, **error error-500 #e10700**, **error + focus 3px
|
|
61
|
+
* error-500**, **disabled delta-300**.
|
|
61
62
|
* Title = **Body Base SemiBold 16 delta-800**; description/helper = **Helper 14/lh20 delta-600**.
|
|
62
63
|
* State (Enabled/Hover/Focus/Error/Disabled) ← native + `error`/`disabled`; the `not_editable`/
|
|
63
64
|
* `view_only` variants are the read-only presentations. Colours live in the textarea-only
|
|
@@ -2,7 +2,8 @@ import { StyledTimePickerProps } from './types';
|
|
|
2
2
|
/**
|
|
3
3
|
* @figmaNode wXrXt5uKNNzV2DnQCgyYZH#15561-37391
|
|
4
4
|
* Figma has no distinct time-picker-popover component — the trigger is the outlined **Input field**
|
|
5
|
-
* (`field-styles`: 40px, border delta-500 / hover gama-300 / focus
|
|
5
|
+
* (`field-styles`: 40px, border delta-500 / hover gama-300 / focus 3px `color.focus.ring` / error
|
|
6
|
+
* error-500 / error + focus 3px error-500) with
|
|
6
7
|
* a trailing **clock icon** (delta-700 like the select/search field icons; delta-300 when disabled).
|
|
7
8
|
* The dropdown follows the **Menus** surface (delta-300 border + Menus shadow `0 2 4 rgba(34,33,51,
|
|
8
9
|
* .15)`): scrollable hour/minute columns of 36px cells — hover delta-50, "now" gama-50 (like the
|
package/package.json
CHANGED
|
@@ -63,8 +63,9 @@
|
|
|
63
63
|
--input-error-disabled-cursor: default;
|
|
64
64
|
--input-error-outline-width: 1px;
|
|
65
65
|
--input-error-hover-outline-width: 1px;
|
|
66
|
-
|
|
67
|
-
--input-error-
|
|
66
|
+
/* Error like the input field (ASMA-8561): 1px at rest and on hover, 3px on press and focus. */
|
|
67
|
+
--input-error-active-outline-width: 3px;
|
|
68
|
+
--input-error-focus-outline-width: 3px;
|
|
68
69
|
--input-error-disabled-outline-width: 1px;
|
|
69
70
|
/* input notEditable */
|
|
70
71
|
--colors-input-notEditable-placeholder-color: var(--colors-delta-800);
|