asma-ui-core 3.135.0 → 3.135.2

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,49 +1,48 @@
1
- import { cn as s } from "../../../../helpers/cn.js";
1
+ import { cn as o } from "../../../../helpers/cn.js";
2
2
  import { StyledButton as N } from "../../../inputs/button/StyledButton.js";
3
3
  import b from "../icons/ChevronDownIcon.js";
4
- import { StyledEmptyPage as C } from "../../../feedback/empty-page/StyledEmptyPage.js";
5
- import { StyledLoading as I } from "../../../feedback/loading/StyledLoading.js";
6
- import { StyledLink as v } from "../../../navigation/link/StyledLink.js";
4
+ import { StyledEmptyPage as v } from "../../../feedback/empty-page/StyledEmptyPage.js";
5
+ import { StyledLoading as C } from "../../../feedback/loading/StyledLoading.js";
6
+ import { StyledLink as I } from "../../../navigation/link/StyledLink.js";
7
7
  import { StyledWidgetTitle as T } from "../widget-title/StyledWidgetTitle.js";
8
8
  import a from "./StyledWidget.module.js";
9
9
  import k from "../icons/ChevronUpIcon.js";
10
10
  import { useState as L } from "react";
11
- import { Fragment as R, jsx as e, jsxs as i } from "react/jsx-runtime";
12
- var V = ({ children: m, title: c, titleNode: h, icon: n, link: l, viewMore: t, persistKey: o, isLoading: g, isEmpty: r, emptyText: f, headerRight: x, headerRightClassName: p }) => {
13
- const [d, w] = L(() => o ? localStorage.getItem(o) === "true" : !1), u = !!l && !l.hide, S = !!t && !t.hide, y = !!t?.disabled && !d && t?.disabledReason != null;
14
- return /* @__PURE__ */ i("div", {
11
+ import { Fragment as R, jsx as e, jsxs as l } from "react/jsx-runtime";
12
+ var V = ({ children: m, title: c, titleNode: h, icon: s, link: i, viewMore: t, persistKey: n, isLoading: g, isEmpty: r, emptyText: f, headerRight: p, headerRightClassName: x }) => {
13
+ const [d, w] = L(() => n ? localStorage.getItem(n) === "true" : !1), u = !!i && !i.hide, S = !!t && !t.hide, y = !!t?.disabled && !d && t?.disabledReason != null;
14
+ return /* @__PURE__ */ l("div", {
15
15
  className: `${a["asma-ui-core-styled-widget"]} ${r ? a["empty-state"] : ""}`,
16
16
  children: [
17
- /* @__PURE__ */ i("div", {
18
- className: s(a["widget-header-left"], "max-xs:flex-wrap max-xs:gap-y-2"),
19
- children: [
20
- n && /* @__PURE__ */ e("span", {
17
+ /* @__PURE__ */ l("div", {
18
+ className: o(a["widget-header-left"], "flex-wrap gap-y-2"),
19
+ children: [/* @__PURE__ */ l("div", {
20
+ className: "flex min-w-0 items-center gap-2.5 max-xs:contents",
21
+ children: [s && /* @__PURE__ */ e("span", {
21
22
  className: "flex shrink-0",
22
- children: n
23
- }),
24
- h ?? /* @__PURE__ */ e(T, {
23
+ children: s
24
+ }), h ?? /* @__PURE__ */ e(T, {
25
25
  className: "min-w-min",
26
26
  children: c
27
- }),
28
- /* @__PURE__ */ e("div", {
29
- className: s(a["widget-header-right"], "max-xs:flex-wrap max-xs:gap-y-2", p),
30
- children: x
31
- })
32
- ]
27
+ })]
28
+ }), /* @__PURE__ */ e("div", {
29
+ className: o(a["widget-header-right"], "empty:hidden max-xs:flex-wrap max-xs:gap-y-2", x),
30
+ children: p
31
+ })]
33
32
  }),
34
33
  /* @__PURE__ */ e("div", {
35
34
  className: a["widget-content"],
36
- children: /* @__PURE__ */ i(R, { children: [
35
+ children: /* @__PURE__ */ l(R, { children: [
37
36
  m,
38
- /* @__PURE__ */ e(I, { isLoading: g }),
39
- /* @__PURE__ */ e(C, {
37
+ /* @__PURE__ */ e(C, { isLoading: g }),
38
+ /* @__PURE__ */ e(v, {
40
39
  isEmpty: r,
41
40
  emptyText: f
42
41
  })
43
42
  ] })
44
43
  }),
45
- S && /* @__PURE__ */ i("div", {
46
- className: s(a["widget-footer"], "max-xs:flex-wrap max-xs:gap-y-2"),
44
+ S && /* @__PURE__ */ l("div", {
45
+ className: o(a["widget-footer"], "max-xs:flex-wrap max-xs:gap-y-2"),
47
46
  children: [y ? /* @__PURE__ */ e("p", {
48
47
  className: a["widget-all-shown"],
49
48
  "data-testid": "all-items-shown",
@@ -61,16 +60,16 @@ var V = ({ children: m, title: c, titleNode: h, icon: n, link: l, viewMore: t, p
61
60
  height: 20
62
61
  }),
63
62
  onClick: () => {
64
- w(!d), o && localStorage.setItem(o, String(!d)), t.onClick?.();
63
+ w(!d), n && localStorage.setItem(n, String(!d)), t.onClick?.();
65
64
  },
66
65
  children: d ? t.viewLessText : t.viewMoreText
67
- }), u ? /* @__PURE__ */ e(v, {
66
+ }), u ? /* @__PURE__ */ e(I, {
68
67
  dataTest: "go-to-button",
69
68
  className: a["widget-link"],
70
69
  size: "large",
71
- href: l.href,
72
- onClick: l.onClick,
73
- content: l.content
70
+ href: i.href,
71
+ onClick: i.onClick,
72
+ content: i.content
74
73
  }) : /* @__PURE__ */ e("div", {})]
75
74
  })
76
75
  ]
@@ -4,13 +4,13 @@ import { clampToMinTime as j, isHourDisabled as x, isMinuteDisabled as D } from
4
4
  import { isHourRejected as N, isMinuteRejected as C } from "../helpers/disabledTime.js";
5
5
  import P from "clsx";
6
6
  import { jsx as n } from "react/jsx-runtime";
7
- import { getHours as w, getMinutes as R, set as T } from "date-fns";
7
+ import { getHours as k, getMinutes as R, set as T } from "date-fns";
8
8
  var G = ({ type: M, value: o, onSelect: h, minTime: c, isTimeDisabled: l, disabledTimeReason: d }) => {
9
- const r = /* @__PURE__ */ new Date(), t = M === "hours", m = w(o ?? r), u = o ?? r, b = t ? 24 : 12, g = t ? r.getHours() : r.getMinutes();
9
+ const r = /* @__PURE__ */ new Date(), t = M === "hours", m = k(o ?? r), u = o ?? r, b = t ? 24 : 12, g = t ? r.getHours() : r.getMinutes();
10
10
  return /* @__PURE__ */ n("div", {
11
11
  className: s["styled-time-picker-root_column"],
12
12
  children: new Array(b).fill(null).map((z, p) => {
13
- const e = t ? p : p * 5, a = o && e === (t ? w(o) : R(o)), f = g == e, H = t ? x(e, c) : D(m, e, c), _ = t ? N(e, u, l) : C(m, e, u, l), i = _ && !!d, y = /* @__PURE__ */ n("button", {
13
+ const e = t ? p : p * 5, a = o && e === (t ? k(o) : R(o)), f = g == e, H = t ? x(e, c) : D(m, e, c), _ = t ? N(e, u, l) : C(m, e, u, l), i = _ && !!d, w = /* @__PURE__ */ n("button", {
14
14
  type: "button",
15
15
  disabled: H || _ && !i,
16
16
  "aria-disabled": i || void 0,
@@ -18,15 +18,17 @@ var G = ({ type: M, value: o, onSelect: h, minTime: c, isTimeDisabled: l, disabl
18
18
  className: P("border-0", s["styled-time-picker-root_cell"], f && s["styled-time-picker-root_cell__cell-now"], a && s["styled-time-picker-root_cell__cell-selected"]),
19
19
  onClick: () => {
20
20
  if (i) return;
21
- const k = T(o ?? /* @__PURE__ */ new Date(), t ? { hours: e } : { minutes: e });
22
- h(t ? j(k, c) : k);
21
+ const y = T(o ?? /* @__PURE__ */ new Date(), t ? { hours: e } : { minutes: e });
22
+ h(t ? j(y, c) : y);
23
23
  },
24
24
  children: e.toString().padStart(2, "0")
25
25
  }, e);
26
26
  return i ? /* @__PURE__ */ n(S, {
27
27
  title: d,
28
- children: y
29
- }, e) : y;
28
+ persistentDescription: !0,
29
+ arrow: !0,
30
+ children: w
31
+ }, e) : w;
30
32
  })
31
33
  });
32
34
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.135.0",
6
+ "version": "3.135.2",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",