@dgshahr/ui-kit 0.0.10 → 0.0.11
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/Checkbox/index.cjs +1 -1
- package/dist/Form/Checkbox/index.js +2 -2
- package/dist/Form/RadioButton/index.cjs +1 -1
- package/dist/Form/RadioButton/index.js +2 -2
- package/dist/Form/Textarea/index.cjs +1 -1
- package/dist/Form/Textarea/index.js +13 -13
- package/dist/{Slide-Czb0m7Xs.js → Slide-D2Y_3pkg.js} +79 -79
- package/dist/Slide-hhQXJzHv.cjs +1 -0
- package/dist/Slider/index.cjs +1 -1
- package/dist/Slider/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/Slide-Cgy--iTR.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),c=require("../../clsx-C11secjj.cjs"),h=require("../../SelectableInputWrapper-C9x3IShC.cjs"),o=s=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 24 24",...s,children:e.jsx("path",{fill:"currentColor",d:"M9.613 17.57a.75.75 0 0 1-.53-.22l-4.375-4.376a.75.75 0 0 1 1.06-1.06l3.845 3.844 9.1-9.1a.75.75 0 1 1 1.06 1.061l-9.635 9.63a.75.75 0 0 1-.525.22"})}),a=s=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 24 24",...s,children:e.jsx("path",{fill:"currentColor",d:"M6 11a.75.75 0 0 0 0 1.5zm12 1.5a.75.75 0 0 0 0-1.5zm-12 0h12V11H6z"})}),x=s=>{const{className:n,isIndeterminate:r,...t}=s;return e.jsx(h.SelectableInputWrapper,{...t,children:({inputClassName:i,checkedInputClassName:l})=>e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"checkbox",className:c.clsx("dgs-ui-kit-rounded",i,n)
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),c=require("../../clsx-C11secjj.cjs"),h=require("../../SelectableInputWrapper-C9x3IShC.cjs"),o=s=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 24 24",...s,children:e.jsx("path",{fill:"currentColor",d:"M9.613 17.57a.75.75 0 0 1-.53-.22l-4.375-4.376a.75.75 0 0 1 1.06-1.06l3.845 3.844 9.1-9.1a.75.75 0 1 1 1.06 1.061l-9.635 9.63a.75.75 0 0 1-.525.22"})}),a=s=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 24 24",...s,children:e.jsx("path",{fill:"currentColor",d:"M6 11a.75.75 0 0 0 0 1.5zm12 1.5a.75.75 0 0 0 0-1.5zm-12 0h12V11H6z"})}),x=s=>{const{className:n,isIndeterminate:r,...t}=s;return e.jsx(h.SelectableInputWrapper,{...t,children:({inputClassName:i,checkedInputClassName:l})=>e.jsxs(e.Fragment,{children:[e.jsx("input",{...t,type:"checkbox",className:c.clsx("dgs-ui-kit-rounded",i,n)}),e.jsx("div",{className:l,children:r?e.jsx(a,{width:16,height:16}):e.jsx(o,{width:16,height:16})})]})})};module.exports=x;
|
|
@@ -41,9 +41,9 @@ const m = (t) => /* @__PURE__ */ e(
|
|
|
41
41
|
/* @__PURE__ */ e(
|
|
42
42
|
"input",
|
|
43
43
|
{
|
|
44
|
+
...i,
|
|
44
45
|
type: "checkbox",
|
|
45
|
-
className: a("dgs-ui-kit-rounded", n, r)
|
|
46
|
-
...i
|
|
46
|
+
className: a("dgs-ui-kit-rounded", n, r)
|
|
47
47
|
}
|
|
48
48
|
),
|
|
49
49
|
/* @__PURE__ */ e("div", { className: s, children: l ? /* @__PURE__ */ e(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),c=require("../../clsx-C11secjj.cjs"),l=require("../../SelectableInputWrapper-C9x3IShC.cjs"),n=t=>{const{className:i,...s}=t;return e.jsx(l.SelectableInputWrapper,{...s,children:({inputClassName:r,checkedInputClassName:u})=>e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"radio",className:c.clsx("dgs-ui-kit-rounded-full",r,i)
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),c=require("../../clsx-C11secjj.cjs"),l=require("../../SelectableInputWrapper-C9x3IShC.cjs"),n=t=>{const{className:i,...s}=t;return e.jsx(l.SelectableInputWrapper,{...s,children:({inputClassName:r,checkedInputClassName:u})=>e.jsxs(e.Fragment,{children:[e.jsx("input",{...s,type:"radio",className:c.clsx("dgs-ui-kit-rounded-full",r,i)}),e.jsx("div",{className:u,children:e.jsx("div",{className:"dgs-ui-kit-bg-white dgs-ui-kit-rounded-full dgs-ui-kit-w-2 dgs-ui-kit-h-2"})})]})})};module.exports=n;
|
|
@@ -7,9 +7,9 @@ const p = (t) => {
|
|
|
7
7
|
/* @__PURE__ */ s(
|
|
8
8
|
"input",
|
|
9
9
|
{
|
|
10
|
+
...i,
|
|
10
11
|
type: "radio",
|
|
11
|
-
className: o("dgs-ui-kit-rounded-full", r, e)
|
|
12
|
-
...i
|
|
12
|
+
className: o("dgs-ui-kit-rounded-full", r, e)
|
|
13
13
|
}
|
|
14
14
|
),
|
|
15
15
|
/* @__PURE__ */ s("div", { className: a, children: /* @__PURE__ */ s("div", { className: "dgs-ui-kit-bg-white dgs-ui-kit-rounded-full dgs-ui-kit-w-2 dgs-ui-kit-h-2" }) })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const i=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";const i=require("react/jsx-runtime"),n=require("../../clsx-C11secjj.cjs"),d=require("react"),o=require("../../TextFieldWrapper-CLMz60O3.cjs"),c=d.forwardRef(function(e,s){const{dir:t="rtl",placeholderDir:l=t,className:u,...r}=e;return i.jsx(o.TextFieldWrapper,{...e,children:({handleChangeField:a})=>i.jsx("textarea",{...r,ref:s,className:n.clsx("dgs-ui-kit-text-gray-800 dgs-ui-kit-bg-transparent dgs-ui-kit-w-full dgs-ui-kit-h-full focus:dgs-ui-kit-outline-none ss02 dgs-ui-kit-flex-1 dgs-ui-kit-resize-none",t==="rtl"?"dgs-ui-kit-text-right":"!dgs-ui-kit-text-left",l==="rtl"?"placeholder:dgs-ui-kit-text-right":"placeholder:dgs-ui-kit-text-left",u),onChange:a,rows:r.rows??5})})});module.exports=c;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { c as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { T as
|
|
5
|
-
const
|
|
6
|
-
const { dir:
|
|
7
|
-
return /* @__PURE__ */ i(
|
|
2
|
+
import { c as d } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import { forwardRef as u } from "react";
|
|
4
|
+
import { T as g } from "../../TextFieldWrapper-Dm06uTk8.js";
|
|
5
|
+
const m = u(function(t, s) {
|
|
6
|
+
const { dir: e = "rtl", placeholderDir: a = e, className: l, ...r } = t;
|
|
7
|
+
return /* @__PURE__ */ i(g, { ...t, children: ({ handleChangeField: o }) => /* @__PURE__ */ i(
|
|
8
8
|
"textarea",
|
|
9
9
|
{
|
|
10
|
-
...
|
|
10
|
+
...r,
|
|
11
11
|
ref: s,
|
|
12
|
-
className:
|
|
12
|
+
className: d(
|
|
13
13
|
"dgs-ui-kit-text-gray-800 dgs-ui-kit-bg-transparent dgs-ui-kit-w-full dgs-ui-kit-h-full focus:dgs-ui-kit-outline-none ss02 dgs-ui-kit-flex-1 dgs-ui-kit-resize-none",
|
|
14
|
-
|
|
14
|
+
e === "rtl" ? "dgs-ui-kit-text-right" : "!dgs-ui-kit-text-left",
|
|
15
15
|
a === "rtl" ? "placeholder:dgs-ui-kit-text-right" : "placeholder:dgs-ui-kit-text-left",
|
|
16
|
-
|
|
16
|
+
l
|
|
17
17
|
),
|
|
18
|
-
onChange:
|
|
19
|
-
rows:
|
|
18
|
+
onChange: o,
|
|
19
|
+
rows: r.rows ?? 5
|
|
20
20
|
}
|
|
21
21
|
) });
|
|
22
22
|
});
|
|
23
23
|
export {
|
|
24
|
-
|
|
24
|
+
m as default
|
|
25
25
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as a, jsxs as y, Fragment as M } from "react/jsx-runtime";
|
|
3
3
|
import { c } from "./clsx-OuTLNxxd.js";
|
|
4
4
|
import { createContext as B, useContext as R, useState as x, useEffect as S, useRef as j, Children as V } from "react";
|
|
5
5
|
import { A as O } from "./ArrowLeft2-jP2w1vwt.js";
|
|
@@ -27,34 +27,34 @@ function K({
|
|
|
27
27
|
];
|
|
28
28
|
}
|
|
29
29
|
const z = (i) => {
|
|
30
|
-
const { active: e, onClick: s, onNavigateToNext: n } = i, { autoplay: t, navigationVariant:
|
|
30
|
+
const { active: e, onClick: s, onNavigateToNext: n } = i, { autoplay: t, navigationVariant: u = "outside" } = T(), [k, r] = x(0);
|
|
31
31
|
return S(() => {
|
|
32
32
|
if (!e || !t) return;
|
|
33
|
-
const
|
|
34
|
-
let
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
|
|
33
|
+
const o = typeof t == "boolean" ? 7e3 : t?.delay ?? 7e3;
|
|
34
|
+
let l = Date.now();
|
|
35
|
+
const g = setInterval(() => {
|
|
36
|
+
const v = Date.now() - l, m = v / o * 100;
|
|
37
|
+
r(Math.min(m, 100)), v >= o && typeof n == "function" && n();
|
|
38
38
|
}, 100);
|
|
39
39
|
return function() {
|
|
40
|
-
return
|
|
40
|
+
return r(0), l = Date.now(), clearInterval(g);
|
|
41
41
|
};
|
|
42
|
-
}, [e, t, n]), /* @__PURE__ */
|
|
42
|
+
}, [e, t, n]), /* @__PURE__ */ a(
|
|
43
43
|
"button",
|
|
44
44
|
{
|
|
45
45
|
className: c(
|
|
46
46
|
"dgs-ui-kit-rounded-full dgs-ui-kit-overflow-hidden dgs-ui-kit-transition-all dgs-ui-kit-h-[6px]",
|
|
47
|
-
K({ active: e, autoplay: t, variant:
|
|
47
|
+
K({ active: e, autoplay: t, variant: u })
|
|
48
48
|
),
|
|
49
49
|
onClick: s,
|
|
50
|
-
children: e && /* @__PURE__ */
|
|
50
|
+
children: e && /* @__PURE__ */ a(
|
|
51
51
|
"div",
|
|
52
52
|
{
|
|
53
53
|
className: c("dgs-ui-kit-h-full dgs-ui-kit-rounded-full", {
|
|
54
|
-
"dgs-ui-kit-bg-white":
|
|
55
|
-
"dgs-ui-kit-bg-gray-700":
|
|
54
|
+
"dgs-ui-kit-bg-white": u === "inside",
|
|
55
|
+
"dgs-ui-kit-bg-gray-700": u === "outside"
|
|
56
56
|
}),
|
|
57
|
-
style: { width: t ? `${
|
|
57
|
+
style: { width: t ? `${k}%` : "100%" }
|
|
58
58
|
}
|
|
59
59
|
)
|
|
60
60
|
}
|
|
@@ -62,88 +62,88 @@ const z = (i) => {
|
|
|
62
62
|
}, F = (i) => {
|
|
63
63
|
const { onNavigate: e, slideIndex: s, slidesCount: n } = i, {
|
|
64
64
|
navigationButtonsShowType: t = "hide",
|
|
65
|
-
dotsClassName:
|
|
66
|
-
navigationContainerClassName:
|
|
67
|
-
navigationVariant:
|
|
68
|
-
showNavigationDots:
|
|
69
|
-
showPaginationText:
|
|
70
|
-
} = T(),
|
|
65
|
+
dotsClassName: u,
|
|
66
|
+
navigationContainerClassName: k,
|
|
67
|
+
navigationVariant: r = "outside",
|
|
68
|
+
showNavigationDots: o = !0,
|
|
69
|
+
showPaginationText: l
|
|
70
|
+
} = T(), g = /* @__PURE__ */ y(
|
|
71
71
|
"div",
|
|
72
72
|
{
|
|
73
73
|
className: c("dgs-ui-kit-flex dgs-ui-kit-gap-2", {
|
|
74
|
-
"dgs-ui-kit-absolute dgs-ui-kit-bottom-0 dgs-ui-kit-left-[5.5%]":
|
|
75
|
-
"dgs-ui-kit-absolute dgs-ui-kit-justify-between dgs-ui-kit-top-1/2 -dgs-ui-kit-translate-y-1/2 dgs-ui-kit-w-full dgs-ui-kit-px-[5.5%]":
|
|
74
|
+
"dgs-ui-kit-absolute dgs-ui-kit-bottom-0 dgs-ui-kit-left-[5.5%]": r === "inside" && t !== "onSides",
|
|
75
|
+
"dgs-ui-kit-absolute dgs-ui-kit-justify-between dgs-ui-kit-top-1/2 -dgs-ui-kit-translate-y-1/2 dgs-ui-kit-w-full dgs-ui-kit-px-[5.5%]": r === "inside" && t === "onSides",
|
|
76
76
|
"dgs-ui-kit-opacity-0 group-hover:dgs-ui-kit-opacity-100 dgs-ui-kit-transition": t === "hover" || t === "onSides"
|
|
77
77
|
}),
|
|
78
78
|
children: [
|
|
79
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ a(
|
|
80
80
|
P,
|
|
81
81
|
{
|
|
82
82
|
type: "button",
|
|
83
83
|
variant: "secondary",
|
|
84
84
|
onClick: () => e(s - 1),
|
|
85
|
-
rightIcon: /* @__PURE__ */
|
|
85
|
+
rightIcon: /* @__PURE__ */ a(E, {})
|
|
86
86
|
}
|
|
87
87
|
),
|
|
88
|
-
/* @__PURE__ */
|
|
88
|
+
/* @__PURE__ */ a(
|
|
89
89
|
P,
|
|
90
90
|
{
|
|
91
91
|
type: "button",
|
|
92
92
|
variant: "secondary",
|
|
93
93
|
onClick: () => e(s + 1),
|
|
94
|
-
rightIcon: /* @__PURE__ */
|
|
94
|
+
rightIcon: /* @__PURE__ */ a(O, {})
|
|
95
95
|
}
|
|
96
96
|
)
|
|
97
97
|
]
|
|
98
98
|
}
|
|
99
99
|
);
|
|
100
100
|
return /* @__PURE__ */ y(M, { children: [
|
|
101
|
-
t && t !== "hide" && t === "onSides" &&
|
|
101
|
+
t && t !== "hide" && t === "onSides" && g,
|
|
102
102
|
/* @__PURE__ */ y(
|
|
103
103
|
"div",
|
|
104
104
|
{
|
|
105
105
|
className: c(
|
|
106
106
|
"dgs-ui-kit-flex",
|
|
107
107
|
{
|
|
108
|
-
"dgs-ui-kit-items-center dgs-ui-kit-mt-2":
|
|
109
|
-
"dgs-ui-kit-absolute dgs-ui-kit-bottom-4 dgs-ui-kit-w-full dgs-ui-kit-justify-center":
|
|
110
|
-
"dgs-ui-kit-justify-between":
|
|
111
|
-
"dgs-ui-kit-justify-center":
|
|
108
|
+
"dgs-ui-kit-items-center dgs-ui-kit-mt-2": r === "outside",
|
|
109
|
+
"dgs-ui-kit-absolute dgs-ui-kit-bottom-4 dgs-ui-kit-w-full dgs-ui-kit-justify-center": r === "inside",
|
|
110
|
+
"dgs-ui-kit-justify-between": r === "outside" && t !== "hide",
|
|
111
|
+
"dgs-ui-kit-justify-center": r === "outside" && t === "hide"
|
|
112
112
|
},
|
|
113
|
-
|
|
113
|
+
k
|
|
114
114
|
),
|
|
115
115
|
children: [
|
|
116
|
-
t && t !== "hide" && t !== "onSides" &&
|
|
117
|
-
(
|
|
118
|
-
|
|
119
|
-
/* @__PURE__ */
|
|
116
|
+
t && t !== "hide" && t !== "onSides" && g,
|
|
117
|
+
(o || l) && /* @__PURE__ */ y("div", { className: "dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-3", children: [
|
|
118
|
+
l && /* @__PURE__ */ y("div", { className: "dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-1 dgs-ui-kit-font-caption-regular dgs-ui-kit-text-gray-400 ss02", children: [
|
|
119
|
+
/* @__PURE__ */ a(
|
|
120
120
|
"span",
|
|
121
121
|
{
|
|
122
122
|
className: c("dgs-ui-kit-font-bold", {
|
|
123
|
-
"dgs-ui-kit-text-gray-600":
|
|
124
|
-
"dgs-ui-kit-text-white":
|
|
123
|
+
"dgs-ui-kit-text-gray-600": r === "outside",
|
|
124
|
+
"dgs-ui-kit-text-white": r === "inside"
|
|
125
125
|
}),
|
|
126
126
|
children: s + 1
|
|
127
127
|
}
|
|
128
128
|
),
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ a("span", { children: "از" }),
|
|
130
|
+
/* @__PURE__ */ a("span", { children: n })
|
|
131
131
|
] }),
|
|
132
|
-
|
|
132
|
+
o && /* @__PURE__ */ a(
|
|
133
133
|
"div",
|
|
134
134
|
{
|
|
135
135
|
className: c(
|
|
136
136
|
"dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-justify-center dgs-ui-kit-gap-2",
|
|
137
|
-
|
|
137
|
+
u
|
|
138
138
|
),
|
|
139
|
-
children: Array.from(Array(n).keys()).map((
|
|
139
|
+
children: Array.from(Array(n).keys()).map((v, m) => /* @__PURE__ */ a(
|
|
140
140
|
z,
|
|
141
141
|
{
|
|
142
142
|
active: s === m,
|
|
143
143
|
onClick: () => e(m),
|
|
144
144
|
onNavigateToNext: () => e(s + 1)
|
|
145
145
|
},
|
|
146
|
-
|
|
146
|
+
v + n
|
|
147
147
|
))
|
|
148
148
|
}
|
|
149
149
|
)
|
|
@@ -154,33 +154,33 @@ const z = (i) => {
|
|
|
154
154
|
] });
|
|
155
155
|
}, X = (i) => {
|
|
156
156
|
const [e, s] = x(0), [n, t] = x(i), {
|
|
157
|
-
className:
|
|
158
|
-
containerClassName:
|
|
159
|
-
showNavigationDots:
|
|
160
|
-
slidesPerView:
|
|
161
|
-
navigationButtonsShowType:
|
|
162
|
-
spaceBetween:
|
|
163
|
-
showPaginationText:
|
|
157
|
+
className: u = "",
|
|
158
|
+
containerClassName: k = "",
|
|
159
|
+
showNavigationDots: r = !0,
|
|
160
|
+
slidesPerView: o = 1,
|
|
161
|
+
navigationButtonsShowType: l = "hide",
|
|
162
|
+
spaceBetween: g = 0,
|
|
163
|
+
showPaginationText: v
|
|
164
164
|
} = n, m = Object.fromEntries(
|
|
165
|
-
Object.entries(n).filter(([
|
|
166
|
-
), w = j(null), W = V.count(i.children), f = Math.ceil(W / Math.floor(
|
|
167
|
-
function D(
|
|
168
|
-
if (Math.ceil(Math.abs(
|
|
165
|
+
Object.entries(n).filter(([d]) => d !== "children")
|
|
166
|
+
), w = j(null), W = V.count(i.children), f = Math.ceil(W / Math.floor(o)), A = (r || l && l !== "hide" || v) && f > 1;
|
|
167
|
+
function D(d) {
|
|
168
|
+
if (Math.ceil(Math.abs(d.currentTarget.scrollLeft)) + d.currentTarget.clientWidth === d.currentTarget.scrollWidth) {
|
|
169
169
|
s(f - 1);
|
|
170
170
|
return;
|
|
171
171
|
}
|
|
172
|
-
const p =
|
|
172
|
+
const p = d.currentTarget.scrollWidth / f, h = (d.currentTarget.scrollWidth - d.currentTarget.scrollLeft) / p;
|
|
173
173
|
if (h <= f) {
|
|
174
174
|
s(0);
|
|
175
175
|
return;
|
|
176
176
|
}
|
|
177
177
|
s(Math.round(h % f));
|
|
178
178
|
}
|
|
179
|
-
function L(
|
|
179
|
+
function L(d) {
|
|
180
180
|
if (!w.current) return;
|
|
181
|
-
const p =
|
|
182
|
-
let C = -(N *
|
|
183
|
-
|
|
181
|
+
const p = o % 1 !== 0, h = w.current.offsetWidth, N = p ? h / o : h;
|
|
182
|
+
let C = -(N * d);
|
|
183
|
+
d < 0 ? C = -(N * f) : d >= f && (C = 0), w.current.scrollTo({
|
|
184
184
|
left: C,
|
|
185
185
|
behavior: "smooth"
|
|
186
186
|
});
|
|
@@ -196,29 +196,29 @@ const z = (i) => {
|
|
|
196
196
|
return b(), window.addEventListener("resize", b), () => {
|
|
197
197
|
window.removeEventListener("resize", b);
|
|
198
198
|
};
|
|
199
|
-
}, [i.responsive]), /* @__PURE__ */
|
|
199
|
+
}, [i.responsive]), /* @__PURE__ */ a(I.Provider, { value: m, children: /* @__PURE__ */ y(
|
|
200
200
|
"div",
|
|
201
201
|
{
|
|
202
202
|
className: c(
|
|
203
203
|
"dgs-ui-kit-overflow-hidden dgs-ui-kit-relative dgs-ui-kit-group",
|
|
204
|
-
|
|
204
|
+
u
|
|
205
205
|
),
|
|
206
206
|
style: { direction: "rtl" },
|
|
207
207
|
children: [
|
|
208
|
-
/* @__PURE__ */
|
|
208
|
+
/* @__PURE__ */ a(
|
|
209
209
|
"div",
|
|
210
210
|
{
|
|
211
211
|
className: c(
|
|
212
212
|
"dgs-ui-kit-flex dgs-ui-kit-snap-x dgs-ui-kit-snap-mandatory dgs-ui-kit-overflow-x-auto no-scrollbar",
|
|
213
|
-
|
|
213
|
+
k
|
|
214
214
|
),
|
|
215
|
-
style: { marginLeft: -
|
|
215
|
+
style: { marginLeft: -g },
|
|
216
216
|
onScroll: D,
|
|
217
217
|
ref: w,
|
|
218
218
|
children: i.children
|
|
219
219
|
}
|
|
220
220
|
),
|
|
221
|
-
A && /* @__PURE__ */
|
|
221
|
+
A && /* @__PURE__ */ a(
|
|
222
222
|
F,
|
|
223
223
|
{
|
|
224
224
|
onNavigate: L,
|
|
@@ -239,26 +239,26 @@ function $({
|
|
|
239
239
|
return e % Math.floor(i) !== 0 ? "none" : s && i % 1 !== 0 ? e === 0 ? "start" : e === n - 1 ? "none" : "center" : "start";
|
|
240
240
|
}
|
|
241
241
|
const Y = (i) => {
|
|
242
|
-
const { children: e,
|
|
242
|
+
const { children: e, className: s, style: n, ...t } = i, { slidesPerView: u = 1, spaceBetween: k, centerMode: r = !1 } = T(), o = j(null), [l, g] = x(0);
|
|
243
243
|
return S(() => {
|
|
244
|
-
|
|
245
|
-
}, [
|
|
244
|
+
o.current && g(Array.prototype.indexOf.call(o.current.parentNode?.children, o.current));
|
|
245
|
+
}, [o]), /* @__PURE__ */ a(
|
|
246
246
|
"div",
|
|
247
247
|
{
|
|
248
|
-
|
|
249
|
-
|
|
248
|
+
...t,
|
|
249
|
+
ref: o,
|
|
250
|
+
className: c("dgs-ui-kit-shrink-0 dgs-ui-kit-snap-always", s),
|
|
250
251
|
style: {
|
|
251
|
-
width: 100 / (
|
|
252
|
-
paddingLeft:
|
|
252
|
+
width: 100 / (u ?? 1) + "%",
|
|
253
|
+
paddingLeft: k,
|
|
253
254
|
scrollSnapAlign: $({
|
|
254
|
-
slidesPerView:
|
|
255
|
-
childIndex:
|
|
256
|
-
centerMode:
|
|
257
|
-
childsLength:
|
|
255
|
+
slidesPerView: u,
|
|
256
|
+
childIndex: l,
|
|
257
|
+
centerMode: r,
|
|
258
|
+
childsLength: o.current?.parentNode?.children.length || 0
|
|
258
259
|
}),
|
|
259
|
-
...
|
|
260
|
+
...n
|
|
260
261
|
},
|
|
261
|
-
...s,
|
|
262
262
|
children: e
|
|
263
263
|
}
|
|
264
264
|
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";const e=require("react/jsx-runtime"),g=require("./clsx-C11secjj.cjs"),u=require("react"),R=require("./ArrowLeft2-B76dkC-C.cjs"),W=require("./ArrowRight2-CYowPzS8.cjs"),S=require("./Button/index.cjs"),C=u.createContext({slidesPerView:1,spaceBetween:0,navigationVariant:"outside",showNavigationDots:!0,showPaginationText:!1}),b=()=>u.useContext(C);function A({active:i,autoplay:s,variant:n="outside"}){return[{inside:"dgs-ui-kit-bg-gray-500/50 hover:dgs-ui-kit-bg-gray-500/80",outside:"dgs-ui-kit-bg-gray-200 hover:dgs-ui-kit-bg-gray-300"}[n],i?"dgs-ui-kit-w-[22px]":"dgs-ui-kit-w-[6px]",s?"dgs-ui-kit-p-[1px]":""]}const D=i=>{const{active:s,onClick:n,onNavigateToNext:r}=i,{autoplay:t,navigationVariant:l="outside"}=b(),[v,a]=u.useState(0);return u.useEffect(()=>{if(!s||!t)return;const o=typeof t=="boolean"?7e3:t?.delay??7e3;let c=Date.now();const h=setInterval(()=>{const x=Date.now()-c,p=x/o*100;a(Math.min(p,100)),x>=o&&typeof r=="function"&&r()},100);return function(){return a(0),c=Date.now(),clearInterval(h)}},[s,t,r]),e.jsx("button",{className:g.clsx("dgs-ui-kit-rounded-full dgs-ui-kit-overflow-hidden dgs-ui-kit-transition-all dgs-ui-kit-h-[6px]",A({active:s,autoplay:t,variant:l})),onClick:n,children:s&&e.jsx("div",{className:g.clsx("dgs-ui-kit-h-full dgs-ui-kit-rounded-full",{"dgs-ui-kit-bg-white":l==="inside","dgs-ui-kit-bg-gray-700":l==="outside"}),style:{width:t?`${v}%`:"100%"}})})},M=i=>{const{onNavigate:s,slideIndex:n,slidesCount:r}=i,{navigationButtonsShowType:t="hide",dotsClassName:l,navigationContainerClassName:v,navigationVariant:a="outside",showNavigationDots:o=!0,showPaginationText:c}=b(),h=e.jsxs("div",{className:g.clsx("dgs-ui-kit-flex dgs-ui-kit-gap-2",{"dgs-ui-kit-absolute dgs-ui-kit-bottom-0 dgs-ui-kit-left-[5.5%]":a==="inside"&&t!=="onSides","dgs-ui-kit-absolute dgs-ui-kit-justify-between dgs-ui-kit-top-1/2 -dgs-ui-kit-translate-y-1/2 dgs-ui-kit-w-full dgs-ui-kit-px-[5.5%]":a==="inside"&&t==="onSides","dgs-ui-kit-opacity-0 group-hover:dgs-ui-kit-opacity-100 dgs-ui-kit-transition":t==="hover"||t==="onSides"}),children:[e.jsx(S,{type:"button",variant:"secondary",onClick:()=>s(n-1),rightIcon:e.jsx(W.ArrowRight2Icon,{})}),e.jsx(S,{type:"button",variant:"secondary",onClick:()=>s(n+1),rightIcon:e.jsx(R.ArrowLeft2Icon,{})})]});return e.jsxs(e.Fragment,{children:[t&&t!=="hide"&&t==="onSides"&&h,e.jsxs("div",{className:g.clsx("dgs-ui-kit-flex",{"dgs-ui-kit-items-center dgs-ui-kit-mt-2":a==="outside","dgs-ui-kit-absolute dgs-ui-kit-bottom-4 dgs-ui-kit-w-full dgs-ui-kit-justify-center":a==="inside","dgs-ui-kit-justify-between":a==="outside"&&t!=="hide","dgs-ui-kit-justify-center":a==="outside"&&t==="hide"},v),children:[t&&t!=="hide"&&t!=="onSides"&&h,(o||c)&&e.jsxs("div",{className:"dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-3",children:[c&&e.jsxs("div",{className:"dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-1 dgs-ui-kit-font-caption-regular dgs-ui-kit-text-gray-400 ss02",children:[e.jsx("span",{className:g.clsx("dgs-ui-kit-font-bold",{"dgs-ui-kit-text-gray-600":a==="outside","dgs-ui-kit-text-white":a==="inside"}),children:n+1}),e.jsx("span",{children:"از"}),e.jsx("span",{children:r})]}),o&&e.jsx("div",{className:g.clsx("dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-justify-center dgs-ui-kit-gap-2",l),children:Array.from(Array(r).keys()).map((x,p)=>e.jsx(D,{active:n===p,onClick:()=>s(p),onNavigateToNext:()=>s(n+1)},x+r))})]})]})]})},B=i=>{const[s,n]=u.useState(0),[r,t]=u.useState(i),{className:l="",containerClassName:v="",showNavigationDots:a=!0,slidesPerView:o=1,navigationButtonsShowType:c="hide",spaceBetween:h=0,showPaginationText:x}=r,p=Object.fromEntries(Object.entries(r).filter(([d])=>d!=="children")),m=u.useRef(null),T=u.Children.count(i.children),f=Math.ceil(T/Math.floor(o)),P=(a||c&&c!=="hide"||x)&&f>1;function I(d){if(Math.ceil(Math.abs(d.currentTarget.scrollLeft))+d.currentTarget.clientWidth===d.currentTarget.scrollWidth){n(f-1);return}const y=d.currentTarget.scrollWidth/f,k=(d.currentTarget.scrollWidth-d.currentTarget.scrollLeft)/y;if(k<=f){n(0);return}n(Math.round(k%f))}function L(d){if(!m.current)return;const y=o%1!==0,k=m.current.offsetWidth,w=y?k/o:k;let j=-(w*d);d<0?j=-(w*f):d>=f&&(j=0),m.current.scrollTo({left:j,behavior:"smooth"})}function N(){const y=Object.keys(i.responsive).sort().findLast(w=>Number(w)<=window.innerWidth),k=y?i.responsive[Number(y)]:null;t(k?{...r,...k}:i)}return u.useEffect(()=>{if(!(!i.responsive||Object.keys(i.responsive).length<=0))return N(),window.addEventListener("resize",N),()=>{window.removeEventListener("resize",N)}},[i.responsive]),e.jsx(C.Provider,{value:p,children:e.jsxs("div",{className:g.clsx("dgs-ui-kit-overflow-hidden dgs-ui-kit-relative dgs-ui-kit-group",l),style:{direction:"rtl"},children:[e.jsx("div",{className:g.clsx("dgs-ui-kit-flex dgs-ui-kit-snap-x dgs-ui-kit-snap-mandatory dgs-ui-kit-overflow-x-auto no-scrollbar",v),style:{marginLeft:-h},onScroll:I,ref:m,children:i.children}),P&&e.jsx(M,{onNavigate:L,slideIndex:s,slidesCount:f})]})})};function q({slidesPerView:i,childIndex:s,centerMode:n,childsLength:r}){return s%Math.floor(i)!==0?"none":n&&i%1!==0?s===0?"start":s===r-1?"none":"center":"start"}const E=i=>{const{children:s,className:n,style:r,...t}=i,{slidesPerView:l=1,spaceBetween:v,centerMode:a=!1}=b(),o=u.useRef(null),[c,h]=u.useState(0);return u.useEffect(()=>{o.current&&h(Array.prototype.indexOf.call(o.current.parentNode?.children,o.current))},[o]),e.jsx("div",{...t,ref:o,className:g.clsx("dgs-ui-kit-shrink-0 dgs-ui-kit-snap-always",n),style:{width:100/(l??1)+"%",paddingLeft:v,scrollSnapAlign:q({slidesPerView:l,childIndex:c,centerMode:a,childsLength:o.current?.parentNode?.children.length||0}),...r},children:s})};exports.Slide=E;exports.Slider=B;
|
package/dist/Slider/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../assets/styles.css');;/* empty css */const e=require("../Slide-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../assets/styles.css');;/* empty css */const e=require("../Slide-hhQXJzHv.cjs");exports.Slide=e.Slide;exports.Slider=e.Slider;
|
package/dist/Slider/index.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./assets/styles.css');;/* empty css */const r=require("./AccordionItem-AwBSlD0h.cjs"),o=require("./Alert/index.cjs"),t=require("./Badge/index.cjs"),i=require("./Breadcrumb/index.cjs"),n=require("./Button/index.cjs"),c=require("./Divider/index.cjs"),u=require("./Form/Checkbox/index.cjs"),s=require("./Form/Input/index.cjs"),a=require("./Form/RadioButton/index.cjs"),d=require("./Form/Textarea/index.cjs"),q=require("./Pagination/index.cjs"),l=require("./Progress/Bar/index.cjs"),e=require("./Slide-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./assets/styles.css');;/* empty css */const r=require("./AccordionItem-AwBSlD0h.cjs"),o=require("./Alert/index.cjs"),t=require("./Badge/index.cjs"),i=require("./Breadcrumb/index.cjs"),n=require("./Button/index.cjs"),c=require("./Divider/index.cjs"),u=require("./Form/Checkbox/index.cjs"),s=require("./Form/Input/index.cjs"),a=require("./Form/RadioButton/index.cjs"),d=require("./Form/Textarea/index.cjs"),q=require("./Pagination/index.cjs"),l=require("./Progress/Bar/index.cjs"),e=require("./Slide-hhQXJzHv.cjs"),m=require("./Tabs/index.cjs");exports.AccordionGroup=r.AccordionGroup;exports.AccordionItem=r.AccordionItem;exports.Alert=o;exports.Badge=t;exports.Breadcrumb=i;exports.Button=n;exports.Divider=c;exports.Checkbox=u;exports.Input=s;exports.RadioButton=a;exports.Textarea=d;exports.Pagination=q;exports.ProgressBar=l;exports.Slide=e.Slide;exports.Slider=e.Slider;exports.Tabs=m;
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import { default as S } from "./Form/RadioButton/index.js";
|
|
|
11
11
|
import { default as P } from "./Form/Textarea/index.js";
|
|
12
12
|
import { default as h } from "./Pagination/index.js";
|
|
13
13
|
import { default as v } from "./Progress/Bar/index.js";
|
|
14
|
-
import { a as D, S as G } from "./Slide-
|
|
14
|
+
import { a as D, S as G } from "./Slide-D2Y_3pkg.js";
|
|
15
15
|
import { default as j } from "./Tabs/index.js";
|
|
16
16
|
export {
|
|
17
17
|
e as AccordionGroup,
|
package/package.json
CHANGED
package/dist/Slide-Cgy--iTR.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";"use strict";const e=require("react/jsx-runtime"),g=require("./clsx-C11secjj.cjs"),u=require("react"),R=require("./ArrowLeft2-B76dkC-C.cjs"),W=require("./ArrowRight2-CYowPzS8.cjs"),S=require("./Button/index.cjs"),C=u.createContext({slidesPerView:1,spaceBetween:0,navigationVariant:"outside",showNavigationDots:!0,showPaginationText:!1}),b=()=>u.useContext(C);function A({active:i,autoplay:s,variant:n="outside"}){return[{inside:"dgs-ui-kit-bg-gray-500/50 hover:dgs-ui-kit-bg-gray-500/80",outside:"dgs-ui-kit-bg-gray-200 hover:dgs-ui-kit-bg-gray-300"}[n],i?"dgs-ui-kit-w-[22px]":"dgs-ui-kit-w-[6px]",s?"dgs-ui-kit-p-[1px]":""]}const D=i=>{const{active:s,onClick:n,onNavigateToNext:r}=i,{autoplay:t,navigationVariant:c="outside"}=b(),[d,o]=u.useState(0);return u.useEffect(()=>{if(!s||!t)return;const l=typeof t=="boolean"?7e3:t?.delay??7e3;let h=Date.now();const x=setInterval(()=>{const v=Date.now()-h,p=v/l*100;o(Math.min(p,100)),v>=l&&typeof r=="function"&&r()},100);return function(){return o(0),h=Date.now(),clearInterval(x)}},[s,t,r]),e.jsx("button",{className:g.clsx("dgs-ui-kit-rounded-full dgs-ui-kit-overflow-hidden dgs-ui-kit-transition-all dgs-ui-kit-h-[6px]",A({active:s,autoplay:t,variant:c})),onClick:n,children:s&&e.jsx("div",{className:g.clsx("dgs-ui-kit-h-full dgs-ui-kit-rounded-full",{"dgs-ui-kit-bg-white":c==="inside","dgs-ui-kit-bg-gray-700":c==="outside"}),style:{width:t?`${d}%`:"100%"}})})},M=i=>{const{onNavigate:s,slideIndex:n,slidesCount:r}=i,{navigationButtonsShowType:t="hide",dotsClassName:c,navigationContainerClassName:d,navigationVariant:o="outside",showNavigationDots:l=!0,showPaginationText:h}=b(),x=e.jsxs("div",{className:g.clsx("dgs-ui-kit-flex dgs-ui-kit-gap-2",{"dgs-ui-kit-absolute dgs-ui-kit-bottom-0 dgs-ui-kit-left-[5.5%]":o==="inside"&&t!=="onSides","dgs-ui-kit-absolute dgs-ui-kit-justify-between dgs-ui-kit-top-1/2 -dgs-ui-kit-translate-y-1/2 dgs-ui-kit-w-full dgs-ui-kit-px-[5.5%]":o==="inside"&&t==="onSides","dgs-ui-kit-opacity-0 group-hover:dgs-ui-kit-opacity-100 dgs-ui-kit-transition":t==="hover"||t==="onSides"}),children:[e.jsx(S,{type:"button",variant:"secondary",onClick:()=>s(n-1),rightIcon:e.jsx(W.ArrowRight2Icon,{})}),e.jsx(S,{type:"button",variant:"secondary",onClick:()=>s(n+1),rightIcon:e.jsx(R.ArrowLeft2Icon,{})})]});return e.jsxs(e.Fragment,{children:[t&&t!=="hide"&&t==="onSides"&&x,e.jsxs("div",{className:g.clsx("dgs-ui-kit-flex",{"dgs-ui-kit-items-center dgs-ui-kit-mt-2":o==="outside","dgs-ui-kit-absolute dgs-ui-kit-bottom-4 dgs-ui-kit-w-full dgs-ui-kit-justify-center":o==="inside","dgs-ui-kit-justify-between":o==="outside"&&t!=="hide","dgs-ui-kit-justify-center":o==="outside"&&t==="hide"},d),children:[t&&t!=="hide"&&t!=="onSides"&&x,(l||h)&&e.jsxs("div",{className:"dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-3",children:[h&&e.jsxs("div",{className:"dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-1 dgs-ui-kit-font-caption-regular dgs-ui-kit-text-gray-400 ss02",children:[e.jsx("span",{className:g.clsx("dgs-ui-kit-font-bold",{"dgs-ui-kit-text-gray-600":o==="outside","dgs-ui-kit-text-white":o==="inside"}),children:n+1}),e.jsx("span",{children:"از"}),e.jsx("span",{children:r})]}),l&&e.jsx("div",{className:g.clsx("dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-justify-center dgs-ui-kit-gap-2",c),children:Array.from(Array(r).keys()).map((v,p)=>e.jsx(D,{active:n===p,onClick:()=>s(p),onNavigateToNext:()=>s(n+1)},v+r))})]})]})]})},B=i=>{const[s,n]=u.useState(0),[r,t]=u.useState(i),{className:c="",containerClassName:d="",showNavigationDots:o=!0,slidesPerView:l=1,navigationButtonsShowType:h="hide",spaceBetween:x=0,showPaginationText:v}=r,p=Object.fromEntries(Object.entries(r).filter(([a])=>a!=="children")),m=u.useRef(null),T=u.Children.count(i.children),f=Math.ceil(T/Math.floor(l)),P=(o||h&&h!=="hide"||v)&&f>1;function I(a){if(Math.ceil(Math.abs(a.currentTarget.scrollLeft))+a.currentTarget.clientWidth===a.currentTarget.scrollWidth){n(f-1);return}const y=a.currentTarget.scrollWidth/f,k=(a.currentTarget.scrollWidth-a.currentTarget.scrollLeft)/y;if(k<=f){n(0);return}n(Math.round(k%f))}function L(a){if(!m.current)return;const y=l%1!==0,k=m.current.offsetWidth,w=y?k/l:k;let j=-(w*a);a<0?j=-(w*f):a>=f&&(j=0),m.current.scrollTo({left:j,behavior:"smooth"})}function N(){const y=Object.keys(i.responsive).sort().findLast(w=>Number(w)<=window.innerWidth),k=y?i.responsive[Number(y)]:null;t(k?{...r,...k}:i)}return u.useEffect(()=>{if(!(!i.responsive||Object.keys(i.responsive).length<=0))return N(),window.addEventListener("resize",N),()=>{window.removeEventListener("resize",N)}},[i.responsive]),e.jsx(C.Provider,{value:p,children:e.jsxs("div",{className:g.clsx("dgs-ui-kit-overflow-hidden dgs-ui-kit-relative dgs-ui-kit-group",c),style:{direction:"rtl"},children:[e.jsx("div",{className:g.clsx("dgs-ui-kit-flex dgs-ui-kit-snap-x dgs-ui-kit-snap-mandatory dgs-ui-kit-overflow-x-auto no-scrollbar",d),style:{marginLeft:-x},onScroll:I,ref:m,children:i.children}),P&&e.jsx(M,{onNavigate:L,slideIndex:s,slidesCount:f})]})})};function q({slidesPerView:i,childIndex:s,centerMode:n,childsLength:r}){return s%Math.floor(i)!==0?"none":n&&i%1!==0?s===0?"start":s===r-1?"none":"center":"start"}const E=i=>{const{children:s,...n}=i,{slidesPerView:r=1,spaceBetween:t,centerMode:c=!1}=b(),d=u.useRef(null),[o,l]=u.useState(0);return u.useEffect(()=>{d.current&&l(Array.prototype.indexOf.call(d.current.parentNode?.children,d.current))},[d]),e.jsx("div",{ref:d,className:g.clsx("dgs-ui-kit-shrink-0 dgs-ui-kit-snap-always",n.className),style:{width:100/(r??1)+"%",paddingLeft:t,scrollSnapAlign:q({slidesPerView:r,childIndex:o,centerMode:c,childsLength:d.current?.parentNode?.children.length||0}),...n.style},...n,children:s})};exports.Slide=E;exports.Slider=B;
|