@konstructio/ui 0.1.2-alpha.54 → 0.1.2-alpha.55

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.
Files changed (97) hide show
  1. package/dist/components/Button/Button.variants.js +7 -1
  2. package/dist/components/ButtonGroup/ButtonGroup.d.ts +34 -0
  3. package/dist/components/ButtonGroup/ButtonGroup.js +118 -0
  4. package/dist/components/ButtonGroup/ButtonGroup.types.d.ts +92 -0
  5. package/dist/components/ButtonGroup/ButtonGroup.variants.d.ts +13 -0
  6. package/dist/components/ButtonGroup/ButtonGroup.variants.js +31 -0
  7. package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.d.ts +3 -0
  8. package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.js +263 -0
  9. package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.types.d.ts +21 -0
  10. package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.variants.d.ts +26 -0
  11. package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.variants.js +89 -0
  12. package/dist/components/ButtonGroup/components/ButtonGroupItem/index.d.ts +2 -0
  13. package/dist/components/ButtonGroup/components/ButtonGroupItem/index.js +4 -0
  14. package/dist/components/ButtonGroup/components/ButtonGroupLabel/ButtonGroupLabel.d.ts +3 -0
  15. package/dist/components/ButtonGroup/components/ButtonGroupLabel/ButtonGroupLabel.js +45 -0
  16. package/dist/components/ButtonGroup/components/ButtonGroupLabel/ButtonGroupLabel.types.d.ts +8 -0
  17. package/dist/components/ButtonGroup/components/ButtonGroupLabel/index.d.ts +2 -0
  18. package/dist/components/ButtonGroup/components/ButtonGroupLabel/index.js +4 -0
  19. package/dist/components/ButtonGroup/components/ButtonGroupMessage/ButtonGroupMessage.d.ts +3 -0
  20. package/dist/components/ButtonGroup/components/ButtonGroupMessage/ButtonGroupMessage.js +37 -0
  21. package/dist/components/ButtonGroup/components/ButtonGroupMessage/ButtonGroupMessage.types.d.ts +6 -0
  22. package/dist/components/ButtonGroup/components/ButtonGroupMessage/index.d.ts +2 -0
  23. package/dist/components/ButtonGroup/components/ButtonGroupMessage/index.js +4 -0
  24. package/dist/components/ButtonGroup/components/index.d.ts +3 -0
  25. package/dist/components/ButtonGroup/components/index.js +8 -0
  26. package/dist/components/ButtonGroup/hooks/index.d.ts +2 -0
  27. package/dist/components/ButtonGroup/hooks/index.js +4 -0
  28. package/dist/components/ButtonGroup/hooks/useButtonGroup.d.ts +3 -0
  29. package/dist/components/ButtonGroup/hooks/useButtonGroup.js +67 -0
  30. package/dist/components/ButtonGroup/hooks/useButtonGroup.types.d.ts +18 -0
  31. package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +1 -1
  32. package/dist/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.js +1 -1
  33. package/dist/components/DateRangePicker/components/PresetPanel/PresetPanel.js +11 -11
  34. package/dist/components/Drawer/Drawer.d.ts +36 -0
  35. package/dist/components/Drawer/Drawer.js +134 -0
  36. package/dist/components/Drawer/Drawer.types.d.ts +65 -0
  37. package/dist/components/Drawer/Drawer.variants.d.ts +8 -0
  38. package/dist/components/Drawer/Drawer.variants.js +92 -0
  39. package/dist/components/Drawer/components/Body/Body.d.ts +3 -0
  40. package/dist/components/Drawer/components/Body/Body.js +24 -0
  41. package/dist/components/Drawer/components/Body/Body.types.d.ts +7 -0
  42. package/dist/components/Drawer/components/Body/index.d.ts +2 -0
  43. package/dist/components/Drawer/components/Body/index.js +4 -0
  44. package/dist/components/Drawer/components/Footer/Footer.d.ts +3 -0
  45. package/dist/components/Drawer/components/Footer/Footer.js +26 -0
  46. package/dist/components/Drawer/components/Footer/Footer.types.d.ts +7 -0
  47. package/dist/components/Drawer/components/Footer/index.d.ts +2 -0
  48. package/dist/components/Drawer/components/Footer/index.js +4 -0
  49. package/dist/components/Drawer/components/Header/Header.d.ts +3 -0
  50. package/dist/components/Drawer/components/Header/Header.js +27 -0
  51. package/dist/components/Drawer/components/Header/Header.types.d.ts +9 -0
  52. package/dist/components/Drawer/components/Header/index.d.ts +2 -0
  53. package/dist/components/Drawer/components/Header/index.js +4 -0
  54. package/dist/components/Drawer/components/index.d.ts +3 -0
  55. package/dist/components/Drawer/components/index.js +8 -0
  56. package/dist/components/Drawer/constants/index.d.ts +6 -0
  57. package/dist/components/Drawer/constants/index.js +9 -0
  58. package/dist/components/Drawer/contexts/Drawer.context.d.ts +7 -0
  59. package/dist/components/Drawer/contexts/Drawer.context.js +6 -0
  60. package/dist/components/Drawer/contexts/index.d.ts +2 -0
  61. package/dist/components/Drawer/contexts/index.js +5 -0
  62. package/dist/components/Drawer/hooks/index.d.ts +2 -0
  63. package/dist/components/Drawer/hooks/index.js +4 -0
  64. package/dist/components/Drawer/hooks/useDrawer.d.ts +2 -0
  65. package/dist/components/Drawer/hooks/useDrawer.js +66 -0
  66. package/dist/components/Drawer/hooks/useDrawer.types.d.ts +30 -0
  67. package/dist/components/PhoneNumberInput/components/Wrapper.js +116 -116
  68. package/dist/components/RadioGroup/RadioGroup.js +34 -33
  69. package/dist/components/RadioGroup/RadioGroup.types.d.ts +3 -1
  70. package/dist/components/Stepper/Stepper.js +29 -25
  71. package/dist/components/Stepper/components/HorizontalStepItem/HorizontalStepItem.d.ts +1 -2
  72. package/dist/components/Stepper/components/HorizontalStepItem/HorizontalStepItem.js +96 -91
  73. package/dist/components/Stepper/components/StepConnector/StepConnector.d.ts +1 -2
  74. package/dist/components/Stepper/components/StepConnector/StepConnector.js +10 -9
  75. package/dist/components/Stepper/components/StepIndicatorContent/StepIndicatorContent.d.ts +1 -2
  76. package/dist/components/Stepper/components/StepIndicatorContent/StepIndicatorContent.js +13 -19
  77. package/dist/components/Stepper/components/StepItem/StepItem.d.ts +1 -2
  78. package/dist/components/Stepper/components/StepItem/StepItem.js +6 -5
  79. package/dist/components/Stepper/components/VerticalStepItem/VerticalStepItem.d.ts +1 -2
  80. package/dist/components/Stepper/components/VerticalStepItem/VerticalStepItem.js +65 -60
  81. package/dist/components/Stepper/constants/index.d.ts +3 -0
  82. package/dist/components/Stepper/constants/index.js +13 -0
  83. package/dist/components/Stepper/hooks/index.d.ts +1 -0
  84. package/dist/components/Stepper/hooks/index.js +4 -0
  85. package/dist/components/Stepper/hooks/useStepItemLogic.d.ts +2 -0
  86. package/dist/components/Stepper/hooks/useStepItemLogic.js +27 -0
  87. package/dist/components/Stepper/hooks/useStepItemLogic.types.d.ts +16 -0
  88. package/dist/components/Stepper/utils/index.d.ts +3 -0
  89. package/dist/components/Stepper/utils/index.js +13 -0
  90. package/dist/components/Tooltip/Tooltip.variants.d.ts +2 -2
  91. package/dist/components/index.d.ts +2 -0
  92. package/dist/components/index.js +113 -109
  93. package/dist/index.js +115 -111
  94. package/dist/package.json +18 -17
  95. package/dist/{proxy-Drz23HDt.js → proxy-i19-YB39.js} +1044 -1035
  96. package/dist/styles.css +1 -1
  97. package/package.json +15 -16
@@ -1,92 +1,97 @@
1
- import { jsxs as c, jsx as n } from "react/jsx-runtime";
2
- import { S as w } from "../../../../index-BvoZGpli.js";
3
- import { cn as t } from "../../../../utils/index.js";
4
- import { stepIndicatorVariants as C, stepLabelVariants as g, stepDescriptionVariants as y, stepContentVariants as $, stepVariants as S } from "../../Stepper.variants.js";
5
- import { StepConnector as K } from "../StepConnector/StepConnector.js";
6
- import { StepIndicatorContent as x } from "../StepIndicatorContent/StepIndicatorContent.js";
7
- const L = ({
8
- classNames: o,
1
+ import { jsxs as d, jsx as n } from "react/jsx-runtime";
2
+ import { memo as H } from "react";
3
+ import { cn as o } from "../../../../utils/index.js";
4
+ import { stepIndicatorVariants as v, stepLabelVariants as C, stepDescriptionVariants as k, stepContentVariants as g, stepVariants as I } from "../../Stepper.variants.js";
5
+ import { getStepAriaLabel as x } from "../../utils/index.js";
6
+ import { StepConnector as w } from "../StepConnector/StepConnector.js";
7
+ import { StepIndicatorContent as S } from "../StepIndicatorContent/StepIndicatorContent.js";
8
+ import { useStepItemLogic as y } from "../../hooks/useStepItemLogic.js";
9
+ const K = ({
10
+ classNames: r,
9
11
  clickable: D,
10
- icons: h,
11
- index: d,
12
- isLast: f,
13
- showConnector: u,
12
+ icons: m,
13
+ index: c,
14
+ isLast: p,
15
+ showConnector: b,
14
16
  size: a,
15
- step: r,
16
- variant: i,
17
- onClick: b
17
+ step: i,
18
+ variant: t,
19
+ onClick: V
18
20
  }) => {
19
- const e = r.status ?? "pending", I = i === "horizontal", p = r.disabled || e === "active", V = !!(r.onClick || b), l = D && !p && V, v = typeof r.label == "string" ? "span" : w, m = () => {
20
- l && (r.onClick ? r.onClick() : b && b());
21
- }, k = (s) => {
22
- l && (s.key === "Enter" || s.key === " ") && (s.preventDefault(), m());
23
- };
24
- return I ? /* @__PURE__ */ c("div", { className: "flex items-center", children: [
25
- /* @__PURE__ */ c(
21
+ const {
22
+ isClickable: l,
23
+ isDisabled: h,
24
+ LabelComponent: s,
25
+ status: e,
26
+ handleClick: u,
27
+ handleKeyDown: f
28
+ } = y({ clickable: D, step: i, onClick: V });
29
+ return t === "horizontal" ? /* @__PURE__ */ d("div", { className: "flex items-center", children: [
30
+ /* @__PURE__ */ d(
26
31
  "div",
27
32
  {
28
- className: t(
29
- S({
33
+ className: o(
34
+ I({
30
35
  orientation: "horizontal",
31
- variant: i,
36
+ variant: t,
32
37
  clickable: l
33
38
  }),
34
- o?.stepWrapper
39
+ r?.stepWrapper
35
40
  ),
36
41
  role: l ? "button" : void 0,
37
42
  tabIndex: l ? 0 : void 0,
38
- onClick: m,
39
- onKeyDown: k,
43
+ onClick: u,
44
+ onKeyDown: f,
40
45
  "aria-current": e === "active" ? "step" : void 0,
41
- "aria-disabled": p || void 0,
42
- "aria-label": `Step ${d + 1}${typeof r.label == "string" ? `: ${r.label}` : ""}${e === "completed" ? ", completed" : e === "active" ? ", current" : e === "error" ? ", error" : ""}`,
46
+ ...h && { "aria-disabled": !0 },
47
+ "aria-label": x(c, i.label, e),
43
48
  children: [
44
49
  /* @__PURE__ */ n(
45
50
  "div",
46
51
  {
47
- className: t(
48
- C({ status: e, size: a }),
49
- o?.indicator
52
+ className: o(
53
+ v({ status: e, size: a }),
54
+ r?.indicator
50
55
  ),
51
56
  "aria-hidden": "true",
52
57
  children: /* @__PURE__ */ n(
53
- x,
58
+ S,
54
59
  {
55
60
  status: e,
56
- index: d,
61
+ index: c,
57
62
  size: a,
58
- icons: h,
59
- className: o?.indicatorContent
63
+ icons: m,
64
+ className: r?.indicatorContent
60
65
  }
61
66
  )
62
67
  }
63
68
  ),
64
- /* @__PURE__ */ c(
69
+ /* @__PURE__ */ d(
65
70
  "div",
66
71
  {
67
- className: t(
68
- $({ variant: i }),
69
- o?.content
72
+ className: o(
73
+ g({ variant: t }),
74
+ r?.content
70
75
  ),
71
76
  children: [
72
- r.label && /* @__PURE__ */ n(
73
- v,
77
+ i.label && /* @__PURE__ */ n(
78
+ s,
74
79
  {
75
- className: t(
76
- g({ status: e, size: a, variant: i }),
77
- o?.label
80
+ className: o(
81
+ C({ status: e, size: a, variant: t }),
82
+ r?.label
78
83
  ),
79
- children: r.label
84
+ children: i.label
80
85
  }
81
86
  ),
82
- r.description && /* @__PURE__ */ n(
87
+ i.description && /* @__PURE__ */ n(
83
88
  "span",
84
89
  {
85
- className: t(
86
- y({ status: e, size: a, variant: i }),
87
- o?.description
90
+ className: o(
91
+ k({ status: e, size: a, variant: t }),
92
+ r?.description
88
93
  ),
89
- children: r.description
94
+ children: i.description
90
95
  }
91
96
  )
92
97
  ]
@@ -95,81 +100,81 @@ const L = ({
95
100
  ]
96
101
  }
97
102
  ),
98
- !f && u && /* @__PURE__ */ n(
103
+ !p && b && /* @__PURE__ */ n(
99
104
  "div",
100
105
  {
101
- className: t(
106
+ className: o(
102
107
  "h-0.5 w-7.5 mx-2 transition-colors duration-200",
103
108
  e === "completed" || e === "active" ? "bg-aurora-500" : e === "error" ? "bg-red-700 dark:bg-red-600" : "bg-slate-300 dark:bg-metal-400",
104
- o?.connector
109
+ r?.connector
105
110
  ),
106
111
  role: "presentation",
107
112
  "aria-hidden": "true"
108
113
  }
109
114
  )
110
- ] }) : /* @__PURE__ */ c("div", { className: "flex flex-1 items-start", children: [
111
- /* @__PURE__ */ c(
115
+ ] }) : /* @__PURE__ */ d("div", { className: "flex flex-1 items-start", children: [
116
+ /* @__PURE__ */ d(
112
117
  "div",
113
118
  {
114
- className: t(
115
- S({
119
+ className: o(
120
+ I({
116
121
  orientation: "horizontal",
117
- variant: i,
122
+ variant: t,
118
123
  clickable: l
119
124
  }),
120
- o?.stepWrapper
125
+ r?.stepWrapper
121
126
  ),
122
127
  role: l ? "button" : void 0,
123
128
  tabIndex: l ? 0 : void 0,
124
- onClick: m,
125
- onKeyDown: k,
129
+ onClick: u,
130
+ onKeyDown: f,
126
131
  "aria-current": e === "active" ? "step" : void 0,
127
- "aria-disabled": p || void 0,
128
- "aria-label": `Step ${d + 1}${typeof r.label == "string" ? `: ${r.label}` : ""}${e === "completed" ? ", completed" : e === "active" ? ", current" : e === "error" ? ", error" : ""}`,
132
+ ...h && { "aria-disabled": !0 },
133
+ "aria-label": x(c, i.label, e),
129
134
  children: [
130
135
  /* @__PURE__ */ n(
131
136
  "div",
132
137
  {
133
- className: t(
134
- C({ status: e, size: a }),
135
- o?.indicator
138
+ className: o(
139
+ v({ status: e, size: a }),
140
+ r?.indicator
136
141
  ),
137
142
  "aria-hidden": "true",
138
143
  children: /* @__PURE__ */ n(
139
- x,
144
+ S,
140
145
  {
141
146
  status: e,
142
- index: d,
147
+ index: c,
143
148
  size: a,
144
- icons: h,
145
- className: o?.indicatorContent
149
+ icons: m,
150
+ className: r?.indicatorContent
146
151
  }
147
152
  )
148
153
  }
149
154
  ),
150
- /* @__PURE__ */ c(
155
+ /* @__PURE__ */ d(
151
156
  "div",
152
157
  {
153
- className: t($({ variant: i }), o?.content),
158
+ className: o(g({ variant: t }), r?.content),
154
159
  children: [
155
- r.label && /* @__PURE__ */ n(
156
- v,
160
+ i.label && /* @__PURE__ */ n(
161
+ s,
157
162
  {
158
- className: t(
159
- g({ status: e, size: a, variant: i }),
160
- o?.label
163
+ className: o(
164
+ C({ status: e, size: a, variant: t }),
165
+ r?.label
161
166
  ),
162
- children: r.label
167
+ children: i.label
163
168
  }
164
169
  ),
165
- r.description && /* @__PURE__ */ n(
170
+ i.description && /* @__PURE__ */ n(
166
171
  "span",
167
172
  {
168
- className: t(
169
- y({ status: e, size: a, variant: i }),
170
- o?.description
173
+ className: o(
174
+ k({ status: e, size: a, variant: t }),
175
+ r?.description
171
176
  ),
172
- children: r.description
177
+ children: i.description
173
178
  }
174
179
  )
175
180
  ]
@@ -178,18 +183,18 @@ const L = ({
178
183
  ]
179
184
  }
180
185
  ),
181
- !f && u && /* @__PURE__ */ n(
182
- K,
186
+ !p && b && /* @__PURE__ */ n(
187
+ w,
183
188
  {
184
189
  orientation: "horizontal",
185
190
  status: e,
186
191
  size: a,
187
- variant: i,
188
- className: t("mt-6.5", o?.connector)
192
+ variant: t,
193
+ className: o("mt-6.5", r?.connector)
189
194
  }
190
195
  )
191
196
  ] });
192
- };
197
+ }, F = H(K);
193
198
  export {
194
- L as HorizontalStepItem
199
+ F as HorizontalStepItem
195
200
  };
@@ -1,3 +1,2 @@
1
- import { FC } from 'react';
2
1
  import { Props } from './StepConnector.types';
3
- export declare const StepConnector: FC<Props>;
2
+ export declare const StepConnector: import('react').NamedExoticComponent<Props>;
@@ -1,17 +1,18 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { cn as a } from "../../../../utils/index.js";
3
- import { stepConnectorVariants as m } from "../../Stepper.variants.js";
4
- const d = ({
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { memo as i } from "react";
3
+ import { cn as p } from "../../../../utils/index.js";
4
+ import { stepConnectorVariants as s } from "../../Stepper.variants.js";
5
+ const a = ({
5
6
  className: o,
6
7
  orientation: r,
7
8
  size: t,
8
9
  status: e,
9
10
  variant: n
10
- }) => /* @__PURE__ */ i(
11
+ }) => /* @__PURE__ */ m(
11
12
  "div",
12
13
  {
13
- className: a(
14
- m({
14
+ className: p(
15
+ s({
15
16
  orientation: r,
16
17
  size: t,
17
18
  status: e,
@@ -22,7 +23,7 @@ const d = ({
22
23
  role: "presentation",
23
24
  "aria-hidden": "true"
24
25
  }
25
- );
26
+ ), l = i(a);
26
27
  export {
27
- d as StepConnector
28
+ l as StepConnector
28
29
  };
@@ -1,3 +1,2 @@
1
- import { FC } from 'react';
2
1
  import { Props } from './StepIndicatorContent.types';
3
- export declare const StepIndicatorContent: FC<Props>;
2
+ export declare const StepIndicatorContent: import('react').NamedExoticComponent<Props>;
@@ -1,29 +1,23 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
+ import { memo as c } from "react";
2
3
  import { cn as d } from "../../../../utils/index.js";
3
- import { c as p } from "../../../../createLucideIcon-CP-mMPfa.js";
4
- import { ExclamationIcon as m } from "../../../../assets/icons/components/Exclamation.js";
5
- const h = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], a = p("check", h), M = ({
4
+ import { CHECK_ICON_SIZE_MAP as m, ICON_SIZE_MAP as p } from "../../constants/index.js";
5
+ import { c as f } from "../../../../createLucideIcon-CP-mMPfa.js";
6
+ import { ExclamationIcon as h } from "../../../../assets/icons/components/Exclamation.js";
7
+ const a = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], I = f("check", a), u = ({
6
8
  className: r,
7
- icons: o,
8
- index: c,
9
- size: t,
9
+ icons: t,
10
+ index: i,
11
+ size: o,
10
12
  status: n
11
- }) => n === "completed" ? o?.completed ? /* @__PURE__ */ e("span", { className: r, children: o.completed }) : /* @__PURE__ */ e(
12
- a,
13
+ }) => n === "completed" ? t?.completed ? /* @__PURE__ */ e("span", { className: r, children: t.completed }) : /* @__PURE__ */ e(
14
+ I,
13
15
  {
14
- className: d({
15
- sm: "h-3 w-3",
16
- md: "h-4 w-4",
17
- lg: "h-6 w-6"
18
- }[t], r),
16
+ className: d(m[o], r),
19
17
  strokeWidth: 2.5,
20
18
  "aria-hidden": "true"
21
19
  }
22
- ) : n === "error" ? o?.error ? /* @__PURE__ */ e("span", { className: r, children: o.error }) : /* @__PURE__ */ e(m, { size: {
23
- sm: "sm",
24
- md: "md",
25
- lg: "lg"
26
- }[t], className: r }) : /* @__PURE__ */ e("span", { className: r, "aria-hidden": "true", children: c + 1 });
20
+ ) : n === "error" ? t?.error ? /* @__PURE__ */ e("span", { className: r, children: t.error }) : /* @__PURE__ */ e(h, { size: p[o], className: r }) : /* @__PURE__ */ e("span", { className: r, "aria-hidden": "true", children: i + 1 }), x = c(u);
27
21
  export {
28
- M as StepIndicatorContent
22
+ x as StepIndicatorContent
29
23
  };
@@ -1,3 +1,2 @@
1
- import { FC } from 'react';
2
1
  import { Props } from './StepItem.types';
3
- export declare const StepItem: FC<Props>;
2
+ export declare const StepItem: import('react').NamedExoticComponent<Props>;
@@ -1,7 +1,8 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { HorizontalStepItem as o } from "../HorizontalStepItem/HorizontalStepItem.js";
3
- import { VerticalStepItem as e } from "../VerticalStepItem/VerticalStepItem.js";
4
- const a = (t) => t.orientation === "horizontal" || t.variant === "horizontal" ? /* @__PURE__ */ r(o, { ...t }) : /* @__PURE__ */ r(e, { ...t });
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { memo as r } from "react";
3
+ import { HorizontalStepItem as e } from "../HorizontalStepItem/HorizontalStepItem.js";
4
+ import { VerticalStepItem as m } from "../VerticalStepItem/VerticalStepItem.js";
5
+ const i = (t) => t.orientation === "horizontal" || t.variant === "horizontal" ? /* @__PURE__ */ o(e, { ...t }) : /* @__PURE__ */ o(m, { ...t }), I = r(i);
5
6
  export {
6
- a as StepItem
7
+ I as StepItem
7
8
  };
@@ -1,3 +1,2 @@
1
- import { FC } from 'react';
2
1
  import { Props } from './VerticalStepItem.types';
3
- export declare const VerticalStepItem: FC<Props>;
2
+ export declare const VerticalStepItem: import('react').NamedExoticComponent<Props>;
@@ -1,89 +1,94 @@
1
- import { jsxs as s, jsx as a } from "react/jsx-runtime";
2
- import { S as y } from "../../../../index-BvoZGpli.js";
3
- import { cn as l } from "../../../../utils/index.js";
4
- import { stepIndicatorVariants as S, stepLabelVariants as V, stepDescriptionVariants as D, stepContentVariants as w, stepVariants as I } from "../../Stepper.variants.js";
5
- import { StepConnector as $ } from "../StepConnector/StepConnector.js";
1
+ import { jsxs as c, jsx as n } from "react/jsx-runtime";
2
+ import { memo as V } from "react";
3
+ import { cn as a } from "../../../../utils/index.js";
4
+ import { stepIndicatorVariants as I, stepLabelVariants as S, stepDescriptionVariants as k, stepContentVariants as v, stepVariants as w } from "../../Stepper.variants.js";
5
+ import { getStepAriaLabel as D } from "../../utils/index.js";
6
+ import { StepConnector as L } from "../StepConnector/StepConnector.js";
6
7
  import { StepIndicatorContent as g } from "../StepIndicatorContent/StepIndicatorContent.js";
7
- const q = ({
8
- classNames: r,
9
- clickable: b,
10
- icons: C,
8
+ import { useStepItemLogic as j } from "../../hooks/useStepItemLogic.js";
9
+ const y = ({
10
+ classNames: e,
11
+ clickable: d,
12
+ icons: s,
11
13
  index: p,
12
- isLast: h,
13
- showConnector: u,
14
- size: o,
15
- step: e,
16
- variant: n,
17
- onClick: c
14
+ isLast: m,
15
+ showConnector: b,
16
+ size: i,
17
+ step: r,
18
+ variant: o,
19
+ onClick: f
18
20
  }) => {
19
- const t = e.status ?? "pending", m = e.disabled || t === "active", k = !!(e.onClick || c), i = b && !m && k, v = typeof e.label == "string" ? "span" : y, f = () => {
20
- i && (e.onClick ? e.onClick() : c && c());
21
- }, x = (d) => {
22
- i && (d.key === "Enter" || d.key === " ") && (d.preventDefault(), f());
23
- };
24
- return /* @__PURE__ */ s("div", { className: n === "stacked" ? "flex flex-col items-center" : "flex flex-col", children: [
25
- /* @__PURE__ */ s(
21
+ const {
22
+ isClickable: l,
23
+ isDisabled: C,
24
+ LabelComponent: h,
25
+ status: t,
26
+ handleClick: u,
27
+ handleKeyDown: x
28
+ } = j({ clickable: d, step: r, onClick: f });
29
+ return /* @__PURE__ */ c("div", { className: o === "stacked" ? "flex flex-col items-center" : "flex flex-col", children: [
30
+ /* @__PURE__ */ c(
26
31
  "div",
27
32
  {
28
- className: l(
29
- I({
33
+ className: a(
34
+ w({
30
35
  orientation: "vertical",
31
- variant: n,
32
- clickable: i
36
+ variant: o,
37
+ clickable: l
33
38
  }),
34
- r?.stepWrapper
39
+ e?.stepWrapper
35
40
  ),
36
- role: i ? "button" : void 0,
37
- tabIndex: i ? 0 : void 0,
38
- onClick: f,
41
+ role: l ? "button" : void 0,
42
+ tabIndex: l ? 0 : void 0,
43
+ onClick: u,
39
44
  onKeyDown: x,
40
45
  "aria-current": t === "active" ? "step" : void 0,
41
- "aria-disabled": m || void 0,
42
- "aria-label": `Step ${p + 1}${typeof e.label == "string" ? `: ${e.label}` : ""}${t === "completed" ? ", completed" : t === "active" ? ", current" : t === "error" ? ", error" : ""}`,
46
+ ...C && { "aria-disabled": !0 },
47
+ "aria-label": D(p, r.label, t),
43
48
  children: [
44
- /* @__PURE__ */ a(
49
+ /* @__PURE__ */ n(
45
50
  "div",
46
51
  {
47
- className: l(
48
- S({ status: t, size: o }),
49
- r?.indicator
52
+ className: a(
53
+ I({ status: t, size: i }),
54
+ e?.indicator
50
55
  ),
51
56
  "aria-hidden": "true",
52
- children: /* @__PURE__ */ a(
57
+ children: /* @__PURE__ */ n(
53
58
  g,
54
59
  {
55
60
  status: t,
56
61
  index: p,
57
- size: o,
58
- icons: C,
59
- className: r?.indicatorContent
62
+ size: i,
63
+ icons: s,
64
+ className: e?.indicatorContent
60
65
  }
61
66
  )
62
67
  }
63
68
  ),
64
- /* @__PURE__ */ s(
69
+ /* @__PURE__ */ c(
65
70
  "div",
66
71
  {
67
- className: l(w({ variant: n }), r?.content),
72
+ className: a(v({ variant: o }), e?.content),
68
73
  children: [
69
- e.label && /* @__PURE__ */ a(
70
- v,
74
+ r.label && /* @__PURE__ */ n(
75
+ h,
71
76
  {
72
- className: l(
73
- V({ status: t, size: o, variant: n }),
74
- r?.label
77
+ className: a(
78
+ S({ status: t, size: i, variant: o }),
79
+ e?.label
75
80
  ),
76
- children: e.label
81
+ children: r.label
77
82
  }
78
83
  ),
79
- e.description && /* @__PURE__ */ a(
84
+ r.description && /* @__PURE__ */ n(
80
85
  "span",
81
86
  {
82
- className: l(
83
- D({ status: t, size: o, variant: n }),
84
- r?.description
87
+ className: a(
88
+ k({ status: t, size: i, variant: o }),
89
+ e?.description
85
90
  ),
86
- children: e.description
91
+ children: r.description
87
92
  }
88
93
  )
89
94
  ]
@@ -92,18 +97,18 @@ const q = ({
92
97
  ]
93
98
  }
94
99
  ),
95
- !h && u && /* @__PURE__ */ a(
96
- $,
100
+ !m && b && /* @__PURE__ */ n(
101
+ L,
97
102
  {
98
103
  orientation: "vertical",
99
104
  status: t,
100
- size: o,
101
- variant: n,
102
- className: r?.connector
105
+ size: i,
106
+ variant: o,
107
+ className: e?.connector
103
108
  }
104
109
  )
105
110
  ] });
106
- };
111
+ }, H = V(y);
107
112
  export {
108
- q as VerticalStepItem
113
+ H as VerticalStepItem
109
114
  };
@@ -0,0 +1,3 @@
1
+ import { StepSize } from '../Stepper.types';
2
+ export declare const ICON_SIZE_MAP: Record<StepSize, number>;
3
+ export declare const CHECK_ICON_SIZE_MAP: Record<StepSize, string>;
@@ -0,0 +1,13 @@
1
+ const _ = {
2
+ sm: 12,
3
+ md: 16,
4
+ lg: 24
5
+ }, m = {
6
+ sm: "h-3 w-3",
7
+ md: "h-4 w-4",
8
+ lg: "h-6 w-6"
9
+ };
10
+ export {
11
+ m as CHECK_ICON_SIZE_MAP,
12
+ _ as ICON_SIZE_MAP
13
+ };
@@ -0,0 +1 @@
1
+ export { useStepItemLogic } from './useStepItemLogic';
@@ -0,0 +1,4 @@
1
+ import { useStepItemLogic as t } from "./useStepItemLogic.js";
2
+ export {
3
+ t as useStepItemLogic
4
+ };
@@ -0,0 +1,2 @@
1
+ import { UseStepItemLogicProps, UseStepItemLogicReturn } from './useStepItemLogic.types';
2
+ export declare function useStepItemLogic({ clickable, onClick, step, }: UseStepItemLogicProps): UseStepItemLogicReturn;
@@ -0,0 +1,27 @@
1
+ import { S as b } from "../../../index-BvoZGpli.js";
2
+ import { useCallback as s } from "react";
3
+ function m({
4
+ clickable: c,
5
+ onClick: t,
6
+ step: n
7
+ }) {
8
+ const i = n.status ?? "pending", l = n.disabled || i === "active", r = !!(n.onClick || t), o = c && !l && r, f = typeof n.label == "string" ? "span" : b, e = s(() => {
9
+ o && (n.onClick ? n.onClick() : t && t());
10
+ }, [o, n.onClick, t]), u = s(
11
+ (a) => {
12
+ o && (a.key === "Enter" || a.key === " ") && (a.preventDefault(), e());
13
+ },
14
+ [o, e]
15
+ );
16
+ return {
17
+ isClickable: o,
18
+ isDisabled: l,
19
+ LabelComponent: f,
20
+ status: i,
21
+ handleClick: e,
22
+ handleKeyDown: u
23
+ };
24
+ }
25
+ export {
26
+ m as useStepItemLogic
27
+ };