@dgshahr/ui-kit 0.0.77 → 0.0.78
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.
- package/dist/Form/Select/types.d.ts +0 -1
- package/dist/Form/Select/types.d.ts.map +1 -1
- package/dist/Step-CZp-RQhJ.js +129 -0
- package/dist/Step-CtqJxQMY.cjs +1 -0
- package/dist/Stepper/Horizontal/Step.d.ts +1 -0
- package/dist/Stepper/Horizontal/Step.d.ts.map +1 -1
- package/dist/Stepper/Horizontal/StepIcon.d.ts +1 -0
- package/dist/Stepper/Horizontal/StepIcon.d.ts.map +1 -1
- package/dist/Stepper/Horizontal/index.cjs +1 -1
- package/dist/Stepper/Horizontal/index.js +1 -1
- package/dist/Stepper/Horizontal/type.d.ts +1 -1
- package/dist/Stepper/Horizontal/type.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/Step-DHyr4R82.js +0 -124
- package/dist/Step-OS-cER74.cjs +0 -1
|
@@ -8,7 +8,6 @@ export type Option<T> = {
|
|
|
8
8
|
};
|
|
9
9
|
type SelectPropsBase<T> = {
|
|
10
10
|
options: Option<T>[];
|
|
11
|
-
optionsContainer?: 'drawer' | 'popover';
|
|
12
11
|
searchable?: boolean | Omit<InputProps, 'onChange'>;
|
|
13
12
|
optionCell?: (option: Option<T>, isActive: boolean) => ReactNode;
|
|
14
13
|
optionCellClassName?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Form/Select/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI;IACtB,KAAK,EAAE,CAAC,CAAC;IACT,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AACF,KAAK,eAAe,CAAC,CAAC,IAAI;IACxB,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IACrB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Form/Select/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI;IACtB,KAAK,EAAE,CAAC,CAAC;IACT,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AACF,KAAK,eAAe,CAAC,CAAC,IAAI;IACxB,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACpD,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,KAAK,SAAS,CAAC;IACjE,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI;IACpC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,uBAAuB,CAAC,EAAE,KAAK,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,sBAAsB,CAAC,CAAC,IAAI;IACtC,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,eAAe,CAAC,CAAC,CAAC,GAC7C,kBAAkB,GAClB,CAAC,oBAAoB,CAAC,CAAC,CAAC,GAAG,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as i, jsxs as p, Fragment as S } from "react/jsx-runtime";
|
|
3
|
+
import m, { createContext as v, useContext as b, useRef as w, useEffect as C } from "react";
|
|
4
|
+
import { c as d } from "./clsx-OuTLNxxd.js";
|
|
5
|
+
const f = v({
|
|
6
|
+
activeStep: 1,
|
|
7
|
+
stepOrientation: "horizontal",
|
|
8
|
+
size: "medium"
|
|
9
|
+
}), k = () => {
|
|
10
|
+
const t = b(f);
|
|
11
|
+
if (!t) throw new Error("useStepperContext must be used within a StepperProvider");
|
|
12
|
+
return t;
|
|
13
|
+
}, F = (t) => {
|
|
14
|
+
const { stepOrientation: e = "horizontal", size: s = "medium", activeStep: n = 0, children: c } = t, u = m.Children.toArray(c).filter(
|
|
15
|
+
m.isValidElement
|
|
16
|
+
), a = n ?? 0, o = u.map((r, l) => m.cloneElement(r, {
|
|
17
|
+
index: l,
|
|
18
|
+
...r.props
|
|
19
|
+
}));
|
|
20
|
+
return /* @__PURE__ */ i(f.Provider, { value: { activeStep: a, stepOrientation: e, size: s }, children: /* @__PURE__ */ i("div", { className: "dgs-ui-kit-flex dgs-ui-kit-justify-center dgs-ui-kit-flex-row dgs-ui-kit-gap-5 no-scrollbar dgs-ui-kit-overflow-x-auto", children: o }) });
|
|
21
|
+
}, z = (t) => typeof t > "u" || t === null, h = (t, e) => t === e ? "current" : t > e ? "complete" : "incomplete", N = {
|
|
22
|
+
complete: "dgs-ui-kit-bg-teal-500 dgs-ui-kit-opacity-100",
|
|
23
|
+
current: "dgs-ui-kit-bg-gray-300 dgs-ui-kit-opacity-75",
|
|
24
|
+
incomplete: "dgs-ui-kit-bg-gray-200 dgs-ui-kit-opacity-50"
|
|
25
|
+
}, I = ({ index: t }) => {
|
|
26
|
+
const { activeStep: e, stepOrientation: s } = k(), n = h(e, t - 1);
|
|
27
|
+
return /* @__PURE__ */ i(
|
|
28
|
+
"div",
|
|
29
|
+
{
|
|
30
|
+
className: d(
|
|
31
|
+
"dgs-ui-kit-flex dgs-ui-kit-min-w-5 dgs-ui-kit-items-center dgs-ui-kit-w-full",
|
|
32
|
+
s === "vertical" ? "dgs-ui-kit-h-10" : "dgs-ui-kit-h-15"
|
|
33
|
+
),
|
|
34
|
+
children: /* @__PURE__ */ i(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
className: d(
|
|
38
|
+
"dgs-ui-kit-h-0.5 dgs-ui-kit-w-full dgs-ui-kit-rounded-md",
|
|
39
|
+
N[n]
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}, M = {
|
|
46
|
+
complete: "dgs-ui-kit-text-secondary-400 dgs-ui-kit-rounded-lg",
|
|
47
|
+
current: "dgs-ui-kit-bg-primary-50 dgs-ui-kit-text-primary-400 dgs-ui-kit-rounded-lg",
|
|
48
|
+
incomplete: "dgs-ui-kit-bg-gray-50 dgs-ui-kit-text-gray-400 dgs-ui-kit-rounded-lg"
|
|
49
|
+
}, E = {
|
|
50
|
+
medium: "dgs-ui-kit-w-10 dgs-ui-kit-h-10 dgs-ui-kit-text-xl",
|
|
51
|
+
small: "dgs-ui-kit-w-10 dgs-ui-kit-h-10 dgs-ui-kit-text-lg"
|
|
52
|
+
}, O = (t) => {
|
|
53
|
+
const { status: e, icon: s, activeIcon: n, completeIcon: c } = t, { size: u } = k(), o = {
|
|
54
|
+
incomplete: s,
|
|
55
|
+
current: n,
|
|
56
|
+
complete: c
|
|
57
|
+
}[e] ?? s, r = d(
|
|
58
|
+
M[e],
|
|
59
|
+
E[u],
|
|
60
|
+
"dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-justify-center dgs-ui-kit-min-w-10"
|
|
61
|
+
);
|
|
62
|
+
return /* @__PURE__ */ i("div", { className: r, children: o });
|
|
63
|
+
}, j = {
|
|
64
|
+
complete: "dgs-ui-kit-text-secondary-500",
|
|
65
|
+
current: "dgs-ui-kit-text-primary-500 dgs-ui-kit-font-medium dgs-ui-kit-font-semibold",
|
|
66
|
+
incomplete: "dgs-ui-kit-text-gray-400"
|
|
67
|
+
}, H = {
|
|
68
|
+
small: "dgs-ui-kit-text-sm",
|
|
69
|
+
medium: "dgs-ui-kit-text-base"
|
|
70
|
+
}, A = {
|
|
71
|
+
horizontal: "dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-2",
|
|
72
|
+
vertical: "dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-2 dgs-ui-kit-flex-col"
|
|
73
|
+
}, T = (t) => {
|
|
74
|
+
const { index: e, title: s, subTitle: n, icon: c, activeIcon: u, completeIcon: a } = t, o = w(null), { size: r, activeStep: l, stepOrientation: x } = k();
|
|
75
|
+
if (z(e))
|
|
76
|
+
throw new Error(
|
|
77
|
+
`expected index to be a number but instead got: ${e}, you are probably rendering <Step /> component outside of <Stepper />`
|
|
78
|
+
);
|
|
79
|
+
const g = h(l, e), y = d(
|
|
80
|
+
"dgs-ui-kit-flex dgs-ui-kit-flex-grow dgs-ui-kit-min-w-max",
|
|
81
|
+
j[g],
|
|
82
|
+
H[r],
|
|
83
|
+
A[x]
|
|
84
|
+
);
|
|
85
|
+
return C(() => {
|
|
86
|
+
g === "current" && o.current?.scrollIntoView({
|
|
87
|
+
behavior: "smooth",
|
|
88
|
+
block: "center",
|
|
89
|
+
inline: "center"
|
|
90
|
+
});
|
|
91
|
+
}, [g]), /* @__PURE__ */ p(S, { children: [
|
|
92
|
+
e !== 0 && /* @__PURE__ */ i(I, { index: e }),
|
|
93
|
+
/* @__PURE__ */ p(
|
|
94
|
+
"div",
|
|
95
|
+
{
|
|
96
|
+
className: y,
|
|
97
|
+
ref: o,
|
|
98
|
+
children: [
|
|
99
|
+
/* @__PURE__ */ i(
|
|
100
|
+
O,
|
|
101
|
+
{
|
|
102
|
+
status: g,
|
|
103
|
+
icon: c,
|
|
104
|
+
activeIcon: u,
|
|
105
|
+
completeIcon: a
|
|
106
|
+
}
|
|
107
|
+
),
|
|
108
|
+
/* @__PURE__ */ p(
|
|
109
|
+
"div",
|
|
110
|
+
{
|
|
111
|
+
className: d(
|
|
112
|
+
"dgs-ui-kit-flex dgs-ui-kit-flex-col dgs-ui-kit-gap-1 dgs-ui-kit-mt-0",
|
|
113
|
+
x === "vertical" && "dgs-ui-kit-items-center"
|
|
114
|
+
),
|
|
115
|
+
children: [
|
|
116
|
+
e === l && /* @__PURE__ */ i("p", { className: "dgs-ui-kit-font-normal dgs-ui-kit-text-gray-400", children: n }),
|
|
117
|
+
/* @__PURE__ */ i("p", { className: "dgs-ui-kit-text-center", children: s })
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
)
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
] });
|
|
125
|
+
};
|
|
126
|
+
export {
|
|
127
|
+
F as H,
|
|
128
|
+
T as a
|
|
129
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";const i=require("react/jsx-runtime"),o=require("react"),a=require("./clsx-C11secjj.cjs"),x=o.createContext({activeStep:1,stepOrientation:"horizontal",size:"medium"}),m=()=>{const t=o.useContext(x);if(!t)throw new Error("useStepperContext must be used within a StepperProvider");return t},S=t=>{const{stepOrientation:e="horizontal",size:s="medium",activeStep:n=0,children:u}=t,d=o.Children.toArray(u).filter(o.isValidElement),l=n??0,r=d.map((c,g)=>o.cloneElement(c,{index:g,...c.props}));return i.jsx(x.Provider,{value:{activeStep:l,stepOrientation:e,size:s},children:i.jsx("div",{className:"dgs-ui-kit-flex dgs-ui-kit-justify-center dgs-ui-kit-flex-row dgs-ui-kit-gap-5 no-scrollbar dgs-ui-kit-overflow-x-auto",children:r})})},y=t=>typeof t>"u"||t===null,f=(t,e)=>t===e?"current":t>e?"complete":"incomplete",v={complete:"dgs-ui-kit-bg-teal-500 dgs-ui-kit-opacity-100",current:"dgs-ui-kit-bg-gray-300 dgs-ui-kit-opacity-75",incomplete:"dgs-ui-kit-bg-gray-200 dgs-ui-kit-opacity-50"},b=({index:t})=>{const{activeStep:e,stepOrientation:s}=m(),n=f(e,t-1);return i.jsx("div",{className:a.clsx("dgs-ui-kit-flex dgs-ui-kit-min-w-5 dgs-ui-kit-items-center dgs-ui-kit-w-full",s==="vertical"?"dgs-ui-kit-h-10":"dgs-ui-kit-h-15"),children:i.jsx("div",{className:a.clsx("dgs-ui-kit-h-0.5 dgs-ui-kit-w-full dgs-ui-kit-rounded-md",v[n])})})},w={complete:"dgs-ui-kit-text-secondary-400 dgs-ui-kit-rounded-lg",current:"dgs-ui-kit-bg-primary-50 dgs-ui-kit-text-primary-400 dgs-ui-kit-rounded-lg",incomplete:"dgs-ui-kit-bg-gray-50 dgs-ui-kit-text-gray-400 dgs-ui-kit-rounded-lg"},C={medium:"dgs-ui-kit-w-10 dgs-ui-kit-h-10 dgs-ui-kit-text-xl",small:"dgs-ui-kit-w-10 dgs-ui-kit-h-10 dgs-ui-kit-text-lg"},j=t=>{const{status:e,icon:s,activeIcon:n,completeIcon:u}=t,{size:d}=m(),r={incomplete:s,current:n,complete:u}[e]??s,c=a.clsx(w[e],C[d],"dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-justify-center dgs-ui-kit-min-w-10");return i.jsx("div",{className:c,children:r})},z={complete:"dgs-ui-kit-text-secondary-500",current:"dgs-ui-kit-text-primary-500 dgs-ui-kit-font-medium dgs-ui-kit-font-semibold",incomplete:"dgs-ui-kit-text-gray-400"},N={small:"dgs-ui-kit-text-sm",medium:"dgs-ui-kit-text-base"},I={horizontal:"dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-2",vertical:"dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-2 dgs-ui-kit-flex-col"},M=t=>{const{index:e,title:s,subTitle:n,icon:u,activeIcon:d,completeIcon:l}=t,r=o.useRef(null),{size:c,activeStep:g,stepOrientation:k}=m();if(y(e))throw new Error(`expected index to be a number but instead got: ${e}, you are probably rendering <Step /> component outside of <Stepper />`);const p=f(g,e),h=a.clsx("dgs-ui-kit-flex dgs-ui-kit-flex-grow dgs-ui-kit-min-w-max",z[p],N[c],I[k]);return o.useEffect(()=>{p==="current"&&r.current?.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},[p]),i.jsxs(i.Fragment,{children:[e!==0&&i.jsx(b,{index:e}),i.jsxs("div",{className:h,ref:r,children:[i.jsx(j,{status:p,icon:u,activeIcon:d,completeIcon:l}),i.jsxs("div",{className:a.clsx("dgs-ui-kit-flex dgs-ui-kit-flex-col dgs-ui-kit-gap-1 dgs-ui-kit-mt-0",k==="vertical"&&"dgs-ui-kit-items-center"),children:[e===g&&i.jsx("p",{className:"dgs-ui-kit-font-normal dgs-ui-kit-text-gray-400",children:n}),i.jsx("p",{className:"dgs-ui-kit-text-center",children:s})]})]})]})};exports.HorizontalStep=M;exports.HorizontalStepper=S;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Step.d.ts","sourceRoot":"","sources":["../../../src/components/Stepper/Horizontal/Step.tsx"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAYnE,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAkBD,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"Step.d.ts","sourceRoot":"","sources":["../../../src/components/Stepper/Horizontal/Step.tsx"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAYnE,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,SAAS,CAAC;IAChB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAkBD,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CA2D3C,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepIcon.d.ts","sourceRoot":"","sources":["../../../src/components/Stepper/Horizontal/StepIcon.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,KAAK,EAAE,2BAA2B,EAAyB,MAAM,QAAQ,CAAC;AAEjF,UAAU,aAAa;IACrB,MAAM,EAAE,2BAA2B,CAAC;IACpC,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,CAAC,EAAE,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"StepIcon.d.ts","sourceRoot":"","sources":["../../../src/components/Stepper/Horizontal/StepIcon.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,KAAK,EAAE,2BAA2B,EAAyB,MAAM,QAAQ,CAAC;AAEjF,UAAU,aAAa;IACrB,MAAM,EAAE,2BAA2B,CAAC;IACpC,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,YAAY,CAAC,EAAE,SAAS,CAAC;CAC1B;AAaD,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAoB/B,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/styles.css');;/* empty css */const e=require("../../Step-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/styles.css');;/* empty css */const e=require("../../Step-CtqJxQMY.cjs");exports.HorizontalStep=e.HorizontalStep;exports.HorizontalStepper=e.HorizontalStepper;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export type HorizontalStepperSize = 'small' | 'medium';
|
|
2
2
|
export type HorizontalStepperStepOrientation = 'vertical' | 'horizontal';
|
|
3
|
-
export type HorizontalStepperStepStatus = '
|
|
3
|
+
export type HorizontalStepperStepStatus = 'complete' | 'incomplete' | 'current';
|
|
4
4
|
//# sourceMappingURL=type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../src/components/Stepper/Horizontal/type.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,QAAQ,CAAC;AACvD,MAAM,MAAM,gCAAgC,GAAG,UAAU,GAAG,YAAY,CAAC;AACzE,MAAM,MAAM,2BAA2B,GAAG,
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../src/components/Stepper/Horizontal/type.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,QAAQ,CAAC;AACvD,MAAM,MAAM,gCAAgC,GAAG,UAAU,GAAG,YAAY,CAAC;AACzE,MAAM,MAAM,2BAA2B,GAAG,UAAU,GAAG,YAAY,GAAG,SAAS,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./assets/styles.css');;/* empty css */const e=require("./AccordionItem-U3jVG5e6.cjs"),t=require("./Alert/index.cjs"),i=require("./Badge/index.cjs"),n=require("./Breadcrumb/index.cjs"),c=require("./Button/index.cjs"),u=require("./Chip/index.cjs"),s=require("./Divider/index.cjs"),a=require("./Drawer/index.cjs"),p=require("./Form/Checkbox/index.cjs"),q=require("./Form/Datepicker/index.cjs"),d=require("./Form/Input/index.cjs"),l=require("./Form/OtpInput/index.cjs"),S=require("./Form/RadioButton/index.cjs"),m=require("./Form/Select/index.cjs"),B=require("./Form/Textarea/index.cjs"),b=require("./Pagination/index.cjs"),g=require("./Progress/Bar/index.cjs"),r=require("./Slide-aMCvZQnM.cjs"),o=require("./Step-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./assets/styles.css');;/* empty css */const e=require("./AccordionItem-U3jVG5e6.cjs"),t=require("./Alert/index.cjs"),i=require("./Badge/index.cjs"),n=require("./Breadcrumb/index.cjs"),c=require("./Button/index.cjs"),u=require("./Chip/index.cjs"),s=require("./Divider/index.cjs"),a=require("./Drawer/index.cjs"),p=require("./Form/Checkbox/index.cjs"),q=require("./Form/Datepicker/index.cjs"),d=require("./Form/Input/index.cjs"),l=require("./Form/OtpInput/index.cjs"),S=require("./Form/RadioButton/index.cjs"),m=require("./Form/Select/index.cjs"),B=require("./Form/Textarea/index.cjs"),b=require("./Pagination/index.cjs"),g=require("./Progress/Bar/index.cjs"),r=require("./Slide-aMCvZQnM.cjs"),o=require("./Step-CtqJxQMY.cjs"),_=require("./Tabs/index.cjs"),A=require("./Tooltip/index.cjs");exports.AccordionGroup=e.AccordionGroup;exports.AccordionItem=e.AccordionItem;exports.Alert=t;exports.Badge=i;exports.Breadcrumb=n;exports.Button=c;exports.Chip=u;exports.Divider=s;exports.Drawer=a;exports.Checkbox=p;exports.Datepicker=q;exports.Input=d;exports.OtpInput=l;exports.RadioButton=S;exports.Select=m;exports.Textarea=B;exports.Pagination=b;exports.ProgressBar=g;exports.Slide=r.Slide;exports.Slider=r.Slider;exports.HorizontalStep=o.HorizontalStep;exports.HorizontalStepper=o.HorizontalStepper;exports.Tabs=_;exports.Tooltip=A;
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import { default as G } from "./Form/Textarea/index.js";
|
|
|
17
17
|
import { default as R } from "./Pagination/index.js";
|
|
18
18
|
import { default as q } from "./Progress/Bar/index.js";
|
|
19
19
|
import { a as E, S as F } from "./Slide-DsdG_6vc.js";
|
|
20
|
-
import { a as K, H as L } from "./Step-
|
|
20
|
+
import { a as K, H as L } from "./Step-CZp-RQhJ.js";
|
|
21
21
|
import { default as N } from "./Tabs/index.js";
|
|
22
22
|
import { default as U } from "./Tooltip/index.js";
|
|
23
23
|
export {
|
package/package.json
CHANGED
package/dist/Step-DHyr4R82.js
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as e, jsxs as k, Fragment as h } from "react/jsx-runtime";
|
|
3
|
-
import m, { createContext as y, useContext as S, useRef as b, useEffect as w } from "react";
|
|
4
|
-
import { c as a } from "./clsx-OuTLNxxd.js";
|
|
5
|
-
const x = y({
|
|
6
|
-
activeStep: 1,
|
|
7
|
-
stepOrientation: "horizontal",
|
|
8
|
-
size: "medium"
|
|
9
|
-
}), p = () => {
|
|
10
|
-
const t = S(x);
|
|
11
|
-
if (!t) throw new Error("useStepperContext must be used within a StepperProvider");
|
|
12
|
-
return t;
|
|
13
|
-
}, V = (t) => {
|
|
14
|
-
const { stepOrientation: i = "horizontal", size: s = "medium", activeStep: n = 0, children: c } = t, d = m.Children.toArray(c).filter(
|
|
15
|
-
m.isValidElement
|
|
16
|
-
), r = n ?? 0, o = d.map((u, l) => m.cloneElement(u, {
|
|
17
|
-
index: l,
|
|
18
|
-
...u.props
|
|
19
|
-
}));
|
|
20
|
-
return /* @__PURE__ */ e(x.Provider, { value: { activeStep: r, stepOrientation: i, size: s }, children: /* @__PURE__ */ e("div", { className: "dgs-ui-kit-flex dgs-ui-kit-justify-center dgs-ui-kit-flex-row dgs-ui-kit-gap-5 no-scrollbar dgs-ui-kit-overflow-x-auto", children: o }) });
|
|
21
|
-
}, C = (t) => typeof t > "u" || t === null, f = (t, i) => t === i ? "current" : t > i ? "active" : "inactive", z = {
|
|
22
|
-
active: "dgs-ui-kit-bg-teal-500 dgs-ui-kit-opacity-100",
|
|
23
|
-
current: "dgs-ui-kit-bg-gray-300 dgs-ui-kit-opacity-75",
|
|
24
|
-
inactive: "dgs-ui-kit-bg-gray-200 dgs-ui-kit-opacity-50"
|
|
25
|
-
}, N = ({ index: t }) => {
|
|
26
|
-
const { activeStep: i, stepOrientation: s } = p(), n = f(i, t - 1);
|
|
27
|
-
return /* @__PURE__ */ e(
|
|
28
|
-
"div",
|
|
29
|
-
{
|
|
30
|
-
className: a(
|
|
31
|
-
"dgs-ui-kit-flex dgs-ui-kit-min-w-5 dgs-ui-kit-items-center dgs-ui-kit-w-full",
|
|
32
|
-
s === "vertical" ? "dgs-ui-kit-h-10" : "dgs-ui-kit-h-15"
|
|
33
|
-
),
|
|
34
|
-
children: /* @__PURE__ */ e(
|
|
35
|
-
"div",
|
|
36
|
-
{
|
|
37
|
-
className: a(
|
|
38
|
-
"dgs-ui-kit-h-0.5 dgs-ui-kit-w-full dgs-ui-kit-rounded-md",
|
|
39
|
-
z[n]
|
|
40
|
-
)
|
|
41
|
-
}
|
|
42
|
-
)
|
|
43
|
-
}
|
|
44
|
-
);
|
|
45
|
-
}, I = {
|
|
46
|
-
active: "dgs-ui-kit-text-secondary-400 dgs-ui-kit-rounded-lg",
|
|
47
|
-
current: "dgs-ui-kit-bg-primary-50 dgs-ui-kit-text-primary-400 dgs-ui-kit-rounded-lg",
|
|
48
|
-
inactive: "dgs-ui-kit-bg-gray-50 dgs-ui-kit-text-gray-400 dgs-ui-kit-rounded-lg"
|
|
49
|
-
}, M = {
|
|
50
|
-
medium: "dgs-ui-kit-w-10 dgs-ui-kit-h-10 dgs-ui-kit-text-xl",
|
|
51
|
-
small: "dgs-ui-kit-w-10 dgs-ui-kit-h-10 dgs-ui-kit-text-lg"
|
|
52
|
-
}, E = (t) => {
|
|
53
|
-
const { status: i, icon: s, activeIcon: n } = t, { size: c } = p(), r = i === "current" ? n ?? s : s, o = a(
|
|
54
|
-
I[i],
|
|
55
|
-
M[c],
|
|
56
|
-
"dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-justify-center dgs-ui-kit-min-w-10"
|
|
57
|
-
);
|
|
58
|
-
return /* @__PURE__ */ e("div", { className: o, children: r });
|
|
59
|
-
}, O = {
|
|
60
|
-
active: "dgs-ui-kit-text-secondary-500",
|
|
61
|
-
current: "dgs-ui-kit-text-primary-500 dgs-ui-kit-font-medium dgs-ui-kit-font-semibold",
|
|
62
|
-
inactive: "dgs-ui-kit-text-gray-400"
|
|
63
|
-
}, j = {
|
|
64
|
-
small: "dgs-ui-kit-text-sm",
|
|
65
|
-
medium: "dgs-ui-kit-text-base"
|
|
66
|
-
}, A = {
|
|
67
|
-
horizontal: "dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-2",
|
|
68
|
-
vertical: "dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-2 dgs-ui-kit-flex-col"
|
|
69
|
-
}, F = (t) => {
|
|
70
|
-
const { index: i, title: s, subTitle: n, icon: c, activeIcon: d } = t, r = b(null), { size: o, activeStep: u, stepOrientation: l } = p();
|
|
71
|
-
if (C(i))
|
|
72
|
-
throw new Error(
|
|
73
|
-
`expected index to be a number but instead got: ${i}, you are probably rendering <Step /> component outside of <Stepper />`
|
|
74
|
-
);
|
|
75
|
-
const g = f(u, i), v = a(
|
|
76
|
-
"dgs-ui-kit-flex dgs-ui-kit-flex-grow dgs-ui-kit-min-w-max",
|
|
77
|
-
O[g],
|
|
78
|
-
j[o],
|
|
79
|
-
A[l]
|
|
80
|
-
);
|
|
81
|
-
return w(() => {
|
|
82
|
-
g === "current" && r.current?.scrollIntoView({
|
|
83
|
-
behavior: "smooth",
|
|
84
|
-
block: "center",
|
|
85
|
-
inline: "center"
|
|
86
|
-
});
|
|
87
|
-
}, [g]), /* @__PURE__ */ k(h, { children: [
|
|
88
|
-
i !== 0 && /* @__PURE__ */ e(N, { index: i }),
|
|
89
|
-
/* @__PURE__ */ k(
|
|
90
|
-
"div",
|
|
91
|
-
{
|
|
92
|
-
className: v,
|
|
93
|
-
ref: r,
|
|
94
|
-
children: [
|
|
95
|
-
/* @__PURE__ */ e(
|
|
96
|
-
E,
|
|
97
|
-
{
|
|
98
|
-
status: g,
|
|
99
|
-
icon: c,
|
|
100
|
-
activeIcon: d
|
|
101
|
-
}
|
|
102
|
-
),
|
|
103
|
-
/* @__PURE__ */ k(
|
|
104
|
-
"div",
|
|
105
|
-
{
|
|
106
|
-
className: a(
|
|
107
|
-
"dgs-ui-kit-flex dgs-ui-kit-flex-col dgs-ui-kit-gap-1 dgs-ui-kit-mt-0",
|
|
108
|
-
l === "vertical" && "dgs-ui-kit-items-center"
|
|
109
|
-
),
|
|
110
|
-
children: [
|
|
111
|
-
i === u && /* @__PURE__ */ e("p", { className: "dgs-ui-kit-font-normal dgs-ui-kit-text-gray-400", children: n }),
|
|
112
|
-
/* @__PURE__ */ e("p", { className: "dgs-ui-kit-text-center", children: s })
|
|
113
|
-
]
|
|
114
|
-
}
|
|
115
|
-
)
|
|
116
|
-
]
|
|
117
|
-
}
|
|
118
|
-
)
|
|
119
|
-
] });
|
|
120
|
-
};
|
|
121
|
-
export {
|
|
122
|
-
V as H,
|
|
123
|
-
F as a
|
|
124
|
-
};
|
package/dist/Step-OS-cER74.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";"use strict";const e=require("react/jsx-runtime"),r=require("react"),d=require("./clsx-C11secjj.cjs"),m=r.createContext({activeStep:1,stepOrientation:"horizontal",size:"medium"}),p=()=>{const t=r.useContext(m);if(!t)throw new Error("useStepperContext must be used within a StepperProvider");return t},v=t=>{const{stepOrientation:i="horizontal",size:s="medium",activeStep:n=0,children:u}=t,l=r.Children.toArray(u).filter(r.isValidElement),c=n??0,o=l.map((a,g)=>r.cloneElement(a,{index:g,...a.props}));return e.jsx(m.Provider,{value:{activeStep:c,stepOrientation:i,size:s},children:e.jsx("div",{className:"dgs-ui-kit-flex dgs-ui-kit-justify-center dgs-ui-kit-flex-row dgs-ui-kit-gap-5 no-scrollbar dgs-ui-kit-overflow-x-auto",children:o})})},h=t=>typeof t>"u"||t===null,x=(t,i)=>t===i?"current":t>i?"active":"inactive",S={active:"dgs-ui-kit-bg-teal-500 dgs-ui-kit-opacity-100",current:"dgs-ui-kit-bg-gray-300 dgs-ui-kit-opacity-75",inactive:"dgs-ui-kit-bg-gray-200 dgs-ui-kit-opacity-50"},y=({index:t})=>{const{activeStep:i,stepOrientation:s}=p(),n=x(i,t-1);return e.jsx("div",{className:d.clsx("dgs-ui-kit-flex dgs-ui-kit-min-w-5 dgs-ui-kit-items-center dgs-ui-kit-w-full",s==="vertical"?"dgs-ui-kit-h-10":"dgs-ui-kit-h-15"),children:e.jsx("div",{className:d.clsx("dgs-ui-kit-h-0.5 dgs-ui-kit-w-full dgs-ui-kit-rounded-md",S[n])})})},b={active:"dgs-ui-kit-text-secondary-400 dgs-ui-kit-rounded-lg",current:"dgs-ui-kit-bg-primary-50 dgs-ui-kit-text-primary-400 dgs-ui-kit-rounded-lg",inactive:"dgs-ui-kit-bg-gray-50 dgs-ui-kit-text-gray-400 dgs-ui-kit-rounded-lg"},w={medium:"dgs-ui-kit-w-10 dgs-ui-kit-h-10 dgs-ui-kit-text-xl",small:"dgs-ui-kit-w-10 dgs-ui-kit-h-10 dgs-ui-kit-text-lg"},j=t=>{const{status:i,icon:s,activeIcon:n}=t,{size:u}=p(),c=i==="current"?n??s:s,o=d.clsx(b[i],w[u],"dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-justify-center dgs-ui-kit-min-w-10");return e.jsx("div",{className:o,children:c})},C={active:"dgs-ui-kit-text-secondary-500",current:"dgs-ui-kit-text-primary-500 dgs-ui-kit-font-medium dgs-ui-kit-font-semibold",inactive:"dgs-ui-kit-text-gray-400"},z={small:"dgs-ui-kit-text-sm",medium:"dgs-ui-kit-text-base"},N={horizontal:"dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-2",vertical:"dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-2 dgs-ui-kit-flex-col"},I=t=>{const{index:i,title:s,subTitle:n,icon:u,activeIcon:l}=t,c=r.useRef(null),{size:o,activeStep:a,stepOrientation:g}=p();if(h(i))throw new Error(`expected index to be a number but instead got: ${i}, you are probably rendering <Step /> component outside of <Stepper />`);const k=x(a,i),f=d.clsx("dgs-ui-kit-flex dgs-ui-kit-flex-grow dgs-ui-kit-min-w-max",C[k],z[o],N[g]);return r.useEffect(()=>{k==="current"&&c.current?.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},[k]),e.jsxs(e.Fragment,{children:[i!==0&&e.jsx(y,{index:i}),e.jsxs("div",{className:f,ref:c,children:[e.jsx(j,{status:k,icon:u,activeIcon:l}),e.jsxs("div",{className:d.clsx("dgs-ui-kit-flex dgs-ui-kit-flex-col dgs-ui-kit-gap-1 dgs-ui-kit-mt-0",g==="vertical"&&"dgs-ui-kit-items-center"),children:[i===a&&e.jsx("p",{className:"dgs-ui-kit-font-normal dgs-ui-kit-text-gray-400",children:n}),e.jsx("p",{className:"dgs-ui-kit-text-center",children:s})]})]})]})};exports.HorizontalStep=I;exports.HorizontalStepper=v;
|