enefit-design-system 0.9.2-ds.3 → 0.9.2-ds.4

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,89 +1,90 @@
1
1
  "use client";
2
- import { jsxs as n, jsx as s, Fragment as F } from "react/jsx-runtime";
3
- import { forwardRef as T, useRef as $, useEffect as q } from "react";
4
- import { DsIcon as w } from "../DsIcon/DsIcon.js";
5
- import { cn as v } from "../utils/dsClass.js";
2
+ import { jsxs as n, jsx as t, Fragment as D } from "react/jsx-runtime";
3
+ import { forwardRef as F, useRef as T, useEffect as $ } from "react";
4
+ import q from "../output/icons/IconCheckXs.js";
5
+ import C from "../output/icons/IconCheckSm.js";
6
+ import { cn as b } from "../utils/dsClass.js";
6
7
  /* empty css */
7
- function z(r, t) {
8
- return r < t ? "completed" : r === t ? "active" : "upcoming";
8
+ function E(r, s) {
9
+ return r < s ? "completed" : r === s ? "active" : "upcoming";
9
10
  }
10
- function E(r, t, i) {
11
- return t ? !!(r === "completed" && i) : !1;
11
+ function H(r, s, i) {
12
+ return s ? !!(r === "completed" && i) : !1;
12
13
  }
13
- const K = T(
14
+ const K = F(
14
15
  function({
15
- items: t,
16
+ items: s,
16
17
  value: i,
17
18
  onChange: p,
18
- allowPrevStepSelect: h = !1,
19
+ allowPrevStepSelect: v = !1,
19
20
  focusOnActiveChange: d = !1,
20
21
  size: u = "default",
21
- ariaLabels: f,
22
+ ariaLabels: m,
22
23
  className: N,
23
- ...x
24
- }, k) {
25
- const I = f?.nav ?? "Steps", S = f?.completed ?? "completed", o = Math.max(0, t.findIndex((e) => e.value === i)), y = u === "small" ? "small" : "default", m = $(null);
26
- q(() => {
24
+ ...k
25
+ }, x) {
26
+ const I = m?.nav ?? "Steps", S = m?.completed ?? "completed", o = Math.max(0, s.findIndex((e) => e.value === i)), g = u === "small" ? "small" : "default", f = T(null);
27
+ $(() => {
27
28
  if (!d) return;
28
- const e = m.current;
29
+ const e = f.current;
29
30
  if (!e) return;
30
31
  (e.querySelector(
31
32
  "button, [tabindex]"
32
33
  ) ?? e).focus();
33
34
  }, [o, d]);
34
- const l = t[o];
35
+ const l = s[o];
35
36
  return /* @__PURE__ */ n(
36
37
  "nav",
37
38
  {
38
- ref: k,
39
+ ref: x,
39
40
  "aria-label": I,
40
- className: v(
41
+ className: b(
41
42
  "ds-stepper",
42
43
  u === "small" && "ds-stepper--small",
43
44
  N
44
45
  ),
45
- ...x,
46
+ ...k,
46
47
  children: [
47
- /* @__PURE__ */ s("ol", { className: "ds-stepper__list", children: t.map((e, c) => {
48
- const a = z(c, o), D = e.disabled ?? !1, L = t.slice(c + 1).every((j) => j.disabled), _ = E(
48
+ /* @__PURE__ */ t("ol", { className: "ds-stepper__list", children: s.map((e, c) => {
49
+ const a = E(c, o), w = e.disabled ?? !1, y = s.slice(c + 1).every((j) => j.disabled), h = H(
49
50
  a,
50
51
  p,
51
- h
52
- ), R = a === "completed" ? /* @__PURE__ */ s(w, { icon: "check", size: y, "aria-hidden": "true" }) : c + 1, b = /* @__PURE__ */ n(F, { children: [
53
- /* @__PURE__ */ s(
52
+ v
53
+ ), L = a === "completed" ? g === "small" ? /* @__PURE__ */ t(q, { "aria-hidden": !0, width: 16, height: 16 }) : /* @__PURE__ */ t(C, { "aria-hidden": !0, width: 24, height: 24 }) : c + 1, _ = /* @__PURE__ */ n(D, { children: [
54
+ /* @__PURE__ */ t(
54
55
  "span",
55
56
  {
56
57
  className: "ds-stepper__indicator",
57
58
  "aria-hidden": "true",
58
- children: R
59
+ children: L
59
60
  }
60
61
  ),
61
- /* @__PURE__ */ s("span", { className: "ds-stepper__title", children: e.label }),
62
- e.description != null && e.description !== "" ? /* @__PURE__ */ s("span", { className: "ds-stepper__description", children: e.description }) : null
63
- ] }), g = a === "completed" ? `${e.label}, ${S}` : e.label;
62
+ /* @__PURE__ */ t("span", { className: "ds-stepper__title", children: e.label }),
63
+ e.description != null && e.description !== "" ? /* @__PURE__ */ t("span", { className: "ds-stepper__description", children: e.description }) : null
64
+ ] }), R = a === "completed" ? `${e.label}, ${S}` : e.label;
64
65
  return /* @__PURE__ */ n(
65
66
  "li",
66
67
  {
67
- ref: a === "active" ? m : void 0,
68
- className: v(
68
+ ref: a === "active" ? f : void 0,
69
+ className: b(
69
70
  "ds-stepper__item",
70
- D && "ds-stepper__item--hidden"
71
+ w && "ds-stepper__item--hidden"
71
72
  ),
72
73
  "data-state": a,
73
74
  "aria-current": a === "active" ? "step" : void 0,
74
- "aria-label": g,
75
- tabIndex: a === "active" && d && !_ ? -1 : void 0,
75
+ "aria-label": R,
76
+ tabIndex: a === "active" && d && !h ? -1 : void 0,
76
77
  children: [
77
- _ ? /* @__PURE__ */ s(
78
+ h ? /* @__PURE__ */ t(
78
79
  "button",
79
80
  {
80
81
  type: "button",
81
82
  className: "ds-stepper__button",
82
83
  onClick: () => p?.(e.value),
83
- children: b
84
+ children: _
84
85
  }
85
- ) : b,
86
- L ? null : /* @__PURE__ */ s(
86
+ ) : _,
87
+ y ? null : /* @__PURE__ */ t(
87
88
  "span",
88
89
  {
89
90
  className: "ds-stepper__separator",
@@ -97,8 +98,8 @@ const K = T(
97
98
  );
98
99
  }) }),
99
100
  l ? /* @__PURE__ */ n("div", { className: "ds-stepper__active-step", "aria-hidden": "true", children: [
100
- /* @__PURE__ */ s("p", { className: "ds-stepper__active-title", children: l.label }),
101
- l.description != null && l.description !== "" ? /* @__PURE__ */ s("p", { className: "ds-stepper__active-description", children: l.description }) : null
101
+ /* @__PURE__ */ t("p", { className: "ds-stepper__active-title", children: l.label }),
102
+ l.description != null && l.description !== "" ? /* @__PURE__ */ t("p", { className: "ds-stepper__active-description", children: l.description }) : null
102
103
  ] }) : null
103
104
  ]
104
105
  }
@@ -1,7 +1,5 @@
1
- import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
- import { __require as o } from "../external/prop-types/index.js";
3
- var p = /* @__PURE__ */ o();
4
- const s = /* @__PURE__ */ r(p);
1
+ import { __require as r } from "../external/use-sync-external-store/shim/index.js";
2
+ var i = r();
5
3
  export {
6
- s as default
4
+ i as s
7
5
  };
@@ -1,5 +1,7 @@
1
- import { __require as r } from "../external/use-sync-external-store/shim/index.js";
2
- var i = r();
1
+ import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
+ import { __require as o } from "../external/prop-types/index.js";
3
+ var p = /* @__PURE__ */ o();
4
+ const s = /* @__PURE__ */ r(p);
3
5
  export {
4
- i as s
6
+ s as default
5
7
  };
@@ -1,4 +1,4 @@
1
- var p = { exports: {} };
1
+ var e = { exports: {} };
2
2
  export {
3
- p as __module
3
+ e as __module
4
4
  };
@@ -1,4 +1,4 @@
1
- var e = { exports: {} };
1
+ var p = { exports: {} };
2
2
  export {
3
- e as __module
3
+ p as __module
4
4
  };
@@ -1,6 +1,6 @@
1
1
  import { useState as b, useCallback as h, useEffect as g } from "react";
2
2
  import { useLayoutEffect as L } from "../../utils/dist/useLayoutEffect.js";
3
- import { s as p } from "../../../../_virtual/index6.js";
3
+ import { s as p } from "../../../../_virtual/index5.js";
4
4
  const v = 1, c = /* @__PURE__ */ Symbol.for("react-aria-landmark-manager");
5
5
  function E(l) {
6
6
  return document.addEventListener("react-aria-landmark-manager-change", l), () => document.removeEventListener("react-aria-landmark-manager-change", l);
@@ -1,5 +1,5 @@
1
1
  import { useMemo as o, useCallback as l } from "react";
2
- import { s as u } from "../../../../_virtual/index6.js";
2
+ import { s as u } from "../../../../_virtual/index5.js";
3
3
  function d(e = {}) {
4
4
  let { maxVisibleToasts: s = 1, wrapUpdate: t } = e, i = o(() => new c({
5
5
  maxVisibleToasts: s,
@@ -1,4 +1,4 @@
1
- import { __module as r } from "../../_virtual/index7.js";
1
+ import { __module as r } from "../../_virtual/index8.js";
2
2
  import { __require as s } from "./external/react-is/index.js";
3
3
  import { __require as t } from "./factoryWithTypeCheckers.js";
4
4
  import { __require as p } from "./factoryWithThrowingShims.js";
@@ -1,7 +1,7 @@
1
1
  import C from "../../@babel/runtime/helpers/esm/extends.js";
2
2
  import x from "../../@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js";
3
3
  import N from "../../@babel/runtime/helpers/esm/inheritsLoose.js";
4
- import v from "../../../_virtual/index5.js";
4
+ import v from "../../../_virtual/index6.js";
5
5
  import A from "../../dom-helpers/esm/addClass.js";
6
6
  import _ from "../../dom-helpers/esm/removeClass.js";
7
7
  import c from "react";
@@ -1,6 +1,6 @@
1
1
  import C from "../../@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js";
2
2
  import D from "../../@babel/runtime/helpers/esm/inheritsLoose.js";
3
- import o from "../../../_virtual/index5.js";
3
+ import o from "../../../_virtual/index6.js";
4
4
  import v from "react";
5
5
  import b from "react-dom";
6
6
  import T from "./config.js";
@@ -1,4 +1,4 @@
1
- import e from "../../../../_virtual/index5.js";
1
+ import e from "../../../../_virtual/index6.js";
2
2
  var n = process.env.NODE_ENV !== "production" ? e.oneOfType([e.number, e.shape({
3
3
  enter: e.number,
4
4
  exit: e.number,
@@ -1,4 +1,4 @@
1
- import { __module as r } from "../../../_virtual/index8.js";
1
+ import { __module as r } from "../../../_virtual/index7.js";
2
2
  import { __require as o } from "../cjs/use-sync-external-store-shim.production.js";
3
3
  import { __require as i } from "../cjs/use-sync-external-store-shim.development.js";
4
4
  var e;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "enefit-design-system",
3
- "version": "0.9.2-ds.3",
3
+ "version": "0.9.2-ds.4",
4
4
  "description": "Enefit design system",
5
5
  "type": "module",
6
6
  "types": "dist/index.d.ts",