asma-ui-core 3.114.0 → 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.
@@ -1,10 +1,10 @@
1
- import { cn as i } from "../../helpers/cn.js";
2
- var d = () => ({
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
- }), l = ({ paddingLeft: e = 14, paddingRight: r = 14 } = {}) => ({
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
- }), s = (e) => e ? {
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
- }, b = (e) => ({
25
+ }, x = (e) => ({
26
26
  width: "100%",
27
27
  maxWidth: `var(--field-width-${e})`
28
- }), x = {
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", p = ({ disabled: e } = {}) => i("block pb-1 text-base font-semibold", e ? "text-delta-300" : "text-delta-800"), u = ({ focused: e, error: r, disabled: t, readOnly: o, borderless: a }) => i("pointer-events-none absolute inset-0 rounded border border-solid transition-colors", a && !e ? "border-transparent" : t ? "border-delta-300" : o ? "border-delta-200" : r ? "border-error-500" : 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"), h = ({ focused: e, error: r, disabled: t, readOnly: o, notched: a = !0 }) => i("pointer-events-none absolute z-0 m-0 box-border min-w-0 overflow-hidden rounded border border-solid transition-colors", a ? "inset-x-0 bottom-0 top-[-5px] px-2 py-0" : "inset-0", t ? "border-delta-300" : o ? "border-delta-200" : r ? "border-error-500" : 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"), f = (e) => i("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]"), m = ({ shrink: e, focused: r, error: t, disabled: o, readOnly: a }) => i("pointer-events-none absolute left-[14px] z-10 max-w-[calc(100%-1.75rem)] truncate transition-colors duration-150", o ? "text-delta-300" : a ? "text-delta-800" : t ? "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]");
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
- p as fieldLabelAboveClass,
33
+ h as fieldLabelAboveClass,
34
34
  g as fieldWidthForMaxLength,
35
- b as fieldWidthStyle,
36
- m as floatingLabelClass,
37
- s as floatingLabelLayoutStyle,
38
- x as fullScreenFieldWidthVars,
39
- f as notchedLegendClass,
40
- h as notchedOutlineClass,
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
- l as singleLineInputLayoutStyle,
43
- d as singleLineShellLayoutStyle
42
+ s as singleLineInputLayoutStyle,
43
+ l as singleLineShellLayoutStyle
44
44
  };
@@ -1,11 +1,11 @@
1
- var a = "_textarea_lhzo8_1", e = "_active_lhzo8_1", _ = "_error_lhzo8_41", r = "_label_lhzo8_82", l = "_disabled_lhzo8_90", t = "_description_lhzo8_95", o = {
2
- textarea: a,
3
- active: e,
4
- error: _,
5
- label: r,
6
- disabled: l,
7
- description: t
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
- o as default
10
+ d as default
11
11
  };
@@ -1,119 +1,120 @@
1
- import { cn as g } from "../../../helpers/cn.js";
2
- import { isOverlayBackEnabled as M, useBackCloses as A } from "../../../hooks/useBackCloses.hook.js";
3
- import { useIsMobileView as q } from "../../hooks/useWindowWidthSize.hook.js";
4
- import { StyledDrawer as F } from "../../../components/navigation/drawer/StyledDrawer.js";
5
- import { useBackNavigationClose as K } from "../../hooks/useBackNavigationClose.hook.js";
6
- import { usePopupState as W } from "../../../hooks/usePopupState.js";
7
- import { ClickAwayListener as z } from "../../../components/mui-compat/ClickAwayListener.js";
8
- import { isBeforeMinTime as w } from "./helpers/minTime.js";
9
- import { TimePickerPanel as G } from "./components/TimePickerPanel.js";
10
- import { TimePickerPopper as J } from "./TimePickerPopper.js";
11
- import { getTimeFromValue as B } from "./helpers/getTimeFromValue.js";
12
- import { timePickerWidthProps as O } from "./helpers/timePickerWidth.js";
13
- import { TimePickerInput as Q } from "./TimePickerInput.js";
14
- import { useEffect as R, useState as E } from "react";
15
- import { jsx as r, jsxs as D } from "react/jsx-runtime";
16
- import { format as V, isBefore as U, isValid as X } from "date-fns";
17
- var fe = (o) => {
18
- const { value: l, onSelect: n, notBeforeTime: d, minTime: c } = o, t = W({
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 = q();
22
- A({
21
+ }), m = K();
22
+ F({
23
23
  active: t.isOpen,
24
24
  requestClose: t.close
25
- }), K({
26
- open: m && t.isOpen && !M(),
25
+ }), z({
26
+ open: m && t.isOpen && !q(),
27
27
  onClose: t.close
28
28
  });
29
- const { isOpen: P, anchorEl: x, close: h } = t;
30
- R(() => {
31
- if (!P || m) return;
32
- const e = (i) => {
33
- x?.contains(document.activeElement) && (i.key === "Escape" ? (i.preventDefault(), i.stopPropagation(), h()) : i.key === "Tab" && h());
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
- P,
38
- x,
39
- h,
37
+ b,
38
+ S,
39
+ w,
40
40
  m
41
41
  ]);
42
- const C = l ? V(l, "HH:mm") : "", [H, u] = E(C), [b, a] = E(!1), [L, s] = E(!0), v = b ? H : C, k = (e) => !e || !d || !X(d) || !U(e, d), f = v.length === 5 ? B(v, l) : null, N = f ? k(f) : !0, I = (e) => {
43
- const i = e.target.value;
44
- if (a(!0), u(i), i.length !== 5) {
45
- s(!1);
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
- const p = B(i, l);
49
- if (!p) {
50
- n(void 0), s(!1);
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
- s(!0), !w(p, c) && (k(p) ? (n(p), a(!1), t.close()) : n(void 0));
54
- }, T = (e) => {
55
- if (!(e && w(e, c))) {
56
- if (s(!0), k(e)) {
57
- n(e), u(e ? V(e, "HH:mm") : ""), a(!1);
58
- return;
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: v,
70
- isValidTime: L,
71
- isValidEndTime: N,
72
- handleChange: I,
73
- handleBlur: j
70
+ localValue: p,
71
+ isValidTime: j,
72
+ isValidEndTime: I,
73
+ handleChange: M,
74
+ handleBlur: A
74
75
  });
75
- return o.disabled || o.readOnly ? y : m ? /* @__PURE__ */ D("div", {
76
- className: g("relative h-auto", typeof o.width == "number" && "w-auto"),
77
- ...O(o.width),
78
- children: [/* @__PURE__ */ r("div", {
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__ */ r(F, {
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__ */ r("div", {
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__ */ r(G, {
90
- dataTest: o.dataTest,
91
- value: l,
90
+ children: /* @__PURE__ */ i(Q, {
91
+ dataTest: r.dataTest,
92
+ value: a,
92
93
  minTime: c,
93
- onSelect: T,
94
- handleClear: S,
94
+ onSelect: O,
95
+ handleClear: N,
95
96
  onConfirm: t.close
96
97
  })
97
98
  })
98
99
  })]
99
- }) : /* @__PURE__ */ r(z, {
100
+ }) : /* @__PURE__ */ i(J, {
100
101
  mouseEvent: "onMouseDown",
101
102
  onClickAway: t.close,
102
- children: /* @__PURE__ */ D("div", {
103
- className: g("relative h-auto", typeof o.width == "number" && "w-auto"),
104
- ...O(o.width),
105
- children: [/* @__PURE__ */ r("div", {
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__ */ r(J, {
109
- ...o,
109
+ }), t.isOpen && /* @__PURE__ */ i(R, {
110
+ ...r,
110
111
  popupState: t,
111
- handleClear: S,
112
- onSelect: T
112
+ handleClear: N,
113
+ onSelect: O
113
114
  })]
114
115
  })
115
116
  });
116
117
  };
117
118
  export {
118
- fe as StyledTimePicker
119
+ de as StyledTimePicker
119
120
  };
@@ -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
- /** The border overlay (an absolutely-positioned sibling so width changes never reflow the input). */
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 gama-400 `#1ca1a1`, error error-500),
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 gama-400 #1ca1a1 (3px)**, **error error-500 #e10700**, **disabled delta-300**.
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 gama-400 / error error-500) with
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
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.114.0",
6
+ "version": "3.115.0",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",
@@ -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
- --input-error-active-outline-width: 1px;
67
- --input-error-focus-outline-width: 1px;
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);