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

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,90 +1,89 @@
1
1
  "use client";
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";
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";
7
6
  /* empty css */
8
- function E(r, s) {
9
- return r < s ? "completed" : r === s ? "active" : "upcoming";
7
+ function z(r, t) {
8
+ return r < t ? "completed" : r === t ? "active" : "upcoming";
10
9
  }
11
- function H(r, s, i) {
12
- return s ? !!(r === "completed" && i) : !1;
10
+ function E(r, t, i) {
11
+ return t ? !!(r === "completed" && i) : !1;
13
12
  }
14
- const K = F(
13
+ const K = T(
15
14
  function({
16
- items: s,
15
+ items: t,
17
16
  value: i,
18
17
  onChange: p,
19
- allowPrevStepSelect: v = !1,
18
+ allowPrevStepSelect: h = !1,
20
19
  focusOnActiveChange: d = !1,
21
20
  size: u = "default",
22
- ariaLabels: m,
21
+ ariaLabels: f,
23
22
  className: N,
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
- $(() => {
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(() => {
28
27
  if (!d) return;
29
- const e = f.current;
28
+ const e = m.current;
30
29
  if (!e) return;
31
30
  (e.querySelector(
32
31
  "button, [tabindex]"
33
32
  ) ?? e).focus();
34
33
  }, [o, d]);
35
- const l = s[o];
34
+ const l = t[o];
36
35
  return /* @__PURE__ */ n(
37
36
  "nav",
38
37
  {
39
- ref: x,
38
+ ref: k,
40
39
  "aria-label": I,
41
- className: b(
40
+ className: v(
42
41
  "ds-stepper",
43
42
  u === "small" && "ds-stepper--small",
44
43
  N
45
44
  ),
46
- ...k,
45
+ ...x,
47
46
  children: [
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(
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(
50
49
  a,
51
50
  p,
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(
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(
55
54
  "span",
56
55
  {
57
56
  className: "ds-stepper__indicator",
58
57
  "aria-hidden": "true",
59
- children: L
58
+ children: R
60
59
  }
61
60
  ),
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;
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;
65
64
  return /* @__PURE__ */ n(
66
65
  "li",
67
66
  {
68
- ref: a === "active" ? f : void 0,
69
- className: b(
67
+ ref: a === "active" ? m : void 0,
68
+ className: v(
70
69
  "ds-stepper__item",
71
- w && "ds-stepper__item--hidden"
70
+ D && "ds-stepper__item--hidden"
72
71
  ),
73
72
  "data-state": a,
74
73
  "aria-current": a === "active" ? "step" : void 0,
75
- "aria-label": R,
76
- tabIndex: a === "active" && d && !h ? -1 : void 0,
74
+ "aria-label": g,
75
+ tabIndex: a === "active" && d && !_ ? -1 : void 0,
77
76
  children: [
78
- h ? /* @__PURE__ */ t(
77
+ _ ? /* @__PURE__ */ s(
79
78
  "button",
80
79
  {
81
80
  type: "button",
82
81
  className: "ds-stepper__button",
83
82
  onClick: () => p?.(e.value),
84
- children: _
83
+ children: b
85
84
  }
86
- ) : _,
87
- y ? null : /* @__PURE__ */ t(
85
+ ) : b,
86
+ L ? null : /* @__PURE__ */ s(
88
87
  "span",
89
88
  {
90
89
  className: "ds-stepper__separator",
@@ -98,8 +97,8 @@ const K = F(
98
97
  );
99
98
  }) }),
100
99
  l ? /* @__PURE__ */ n("div", { className: "ds-stepper__active-step", "aria-hidden": "true", children: [
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
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
103
102
  ] }) : null
104
103
  ]
105
104
  }
@@ -1,2 +1,7 @@
1
- import { __require as e } from "../external/lodash.debounce/index.js";
2
- e();
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);
5
+ export {
6
+ s as default
7
+ };
@@ -1,5 +1,2 @@
1
- import { __require as r } from "../external/use-sync-external-store/shim/index.js";
2
- var i = r();
3
- export {
4
- i as s
5
- };
1
+ import { __require as e } from "../external/lodash.debounce/index.js";
2
+ e();
@@ -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,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,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,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/index5.js";
3
+ import { s as p } from "../../../../_virtual/index6.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/index5.js";
2
+ import { s as u } from "../../../../_virtual/index6.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 e } from "../../../../_virtual/index9.js";
1
+ import { __module as e } from "../../../../_virtual/index8.js";
2
2
  import { __require as o } from "./cjs/react-is.production.min.js";
3
3
  import { __require as t } from "./cjs/react-is.development.js";
4
4
  var r;
@@ -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 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/index6.js";
4
+ import v from "../../../_virtual/index3.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/index6.js";
3
+ import o from "../../../_virtual/index3.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/index6.js";
1
+ import e from "../../../../_virtual/index3.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/index7.js";
1
+ import { __module as r } from "../../../_virtual/index9.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;
@@ -1,5 +1,5 @@
1
1
  import { useState as h, useRef as I, useEffect as R } from "react";
2
- import "../../../_virtual/index3.js";
2
+ import "../../../_virtual/index5.js";
3
3
  function _({
4
4
  threshold: f = 0,
5
5
  root: a = null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "enefit-design-system",
3
- "version": "0.9.2-ds.4",
3
+ "version": "0.9.2-ds.5",
4
4
  "description": "Enefit design system",
5
5
  "type": "module",
6
6
  "types": "dist/index.d.ts",