@dgshahr/ui-kit 0.0.79 → 0.0.81
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/Accordion/index.cjs +1 -1
- package/dist/Accordion/index.js +1 -1
- package/dist/AccordionItem-BYDG8XVW.cjs +1 -0
- package/dist/{AccordionItem-BBAVaF6W.js → AccordionItem-DhYhZ3vW.js} +1 -1
- package/dist/Alert/index.cjs +1 -1
- package/dist/Alert/index.js +1 -1
- package/dist/Breadcrumb/index.cjs +1 -1
- package/dist/Breadcrumb/index.d.ts.map +1 -1
- package/dist/Breadcrumb/index.js +1 -1
- package/dist/Drawer/index.cjs +1 -1
- package/dist/Drawer/index.js +1 -1
- package/dist/Form/Common/FieldBottomInfo/FieldBottomInfo.d.ts +11 -0
- package/dist/Form/Common/FieldBottomInfo/FieldBottomInfo.d.ts.map +1 -0
- package/dist/Form/Common/FieldLabel/FieldLabel.d.ts +14 -0
- package/dist/Form/Common/FieldLabel/FieldLabel.d.ts.map +1 -0
- package/dist/Form/Datepicker/Days.d.ts.map +1 -1
- package/dist/Form/Datepicker/Header.d.ts.map +1 -1
- package/dist/Form/Datepicker/Months.d.ts.map +1 -1
- package/dist/Form/Datepicker/Years.d.ts.map +1 -1
- package/dist/Form/Datepicker/index.cjs +1 -1
- package/dist/Form/Datepicker/index.js +41 -37
- package/dist/Form/FileUploader/FileUploader.d.ts +5 -0
- package/dist/Form/FileUploader/FileUploader.d.ts.map +1 -0
- package/dist/Form/FileUploader/Input/FileInput.d.ts +8 -0
- package/dist/Form/FileUploader/Input/FileInput.d.ts.map +1 -0
- package/dist/Form/FileUploader/Input/FileInputIcon.d.ts +4 -0
- package/dist/Form/FileUploader/Input/FileInputIcon.d.ts.map +1 -0
- package/dist/Form/FileUploader/Preview/FilePreview.d.ts +10 -0
- package/dist/Form/FileUploader/Preview/FilePreview.d.ts.map +1 -0
- package/dist/Form/FileUploader/Preview/MultipleMode/Grid/GridTypePreview.d.ts +6 -0
- package/dist/Form/FileUploader/Preview/MultipleMode/Grid/GridTypePreview.d.ts.map +1 -0
- package/dist/Form/FileUploader/Preview/MultipleMode/List/ListTypePreview.d.ts +6 -0
- package/dist/Form/FileUploader/Preview/MultipleMode/List/ListTypePreview.d.ts.map +1 -0
- package/dist/Form/FileUploader/Preview/MultipleMode/MultipleModePreveiw.d.ts +6 -0
- package/dist/Form/FileUploader/Preview/MultipleMode/MultipleModePreveiw.d.ts.map +1 -0
- package/dist/Form/FileUploader/Preview/SingleMode/SingleModePreview.d.ts +7 -0
- package/dist/Form/FileUploader/Preview/SingleMode/SingleModePreview.d.ts.map +1 -0
- package/dist/Form/FileUploader/Preview/types.d.ts +5 -0
- package/dist/Form/FileUploader/Preview/types.d.ts.map +1 -0
- package/dist/Form/FileUploader/Preview/utils.d.ts +7 -0
- package/dist/Form/FileUploader/Preview/utils.d.ts.map +1 -0
- package/dist/Form/FileUploader/constants.d.ts +10 -0
- package/dist/Form/FileUploader/constants.d.ts.map +1 -0
- package/dist/Form/FileUploader/index.d.ts +4 -0
- package/dist/Form/FileUploader/index.d.ts.map +1 -0
- package/dist/Form/FileUploader/types.d.ts +51 -0
- package/dist/Form/FileUploader/types.d.ts.map +1 -0
- package/dist/Form/Input/index.cjs +1 -1
- package/dist/Form/Input/index.d.ts.map +1 -1
- package/dist/Form/Input/index.js +7 -190
- package/dist/Form/OtpInput/index.cjs +1 -1
- package/dist/Form/OtpInput/index.d.ts.map +1 -1
- package/dist/Form/OtpInput/index.js +20 -20
- package/dist/Form/Select/OptionItem.d.ts.map +1 -1
- package/dist/Form/Select/Options.d.ts.map +1 -1
- package/dist/Form/Select/index.cjs +1 -1
- package/dist/Form/Select/index.js +4 -2
- package/dist/Form/Switch/index.cjs +1 -0
- package/dist/Form/Switch/index.d.ts +15 -0
- package/dist/Form/Switch/index.d.ts.map +1 -0
- package/dist/Form/Switch/index.js +84 -0
- package/dist/Form/Textarea/index.cjs +1 -1
- package/dist/Form/Textarea/index.js +1 -1
- package/dist/Form/Wrappers/PickerWrapper/PickerWrapper.d.ts.map +1 -1
- package/dist/Form/Wrappers/TextFieldWrapper/TextFieldWrapper.d.ts +4 -13
- package/dist/Form/Wrappers/TextFieldWrapper/TextFieldWrapper.d.ts.map +1 -1
- package/dist/{ArrowDown2-CMeKw_vj.js → IconArrowDown2-7ddwV5IE.js} +1 -1
- package/dist/{ArrowDown2-O11Hxz6e.cjs → IconArrowDown2-C1dLVveG.cjs} +1 -1
- package/dist/{ArrowLeft2-B76dkC-C.cjs → IconArrowLeft2-CNA3H0xY.cjs} +1 -1
- package/dist/{ArrowLeft2-jP2w1vwt.js → IconArrowLeft2-cxcPyDqS.js} +1 -1
- package/dist/{ArrowRight2-CcHdxGRE.js → IconArrowRight2-BoXg0Gkw.js} +1 -1
- package/dist/{ArrowRight2-CYowPzS8.cjs → IconArrowRight2-CF_bdH81.cjs} +1 -1
- package/dist/{CloseRemove-BzqPxkjk.js → IconCloseRemove-BPEWBqGA.js} +1 -1
- package/dist/{CloseRemove-BUG0Hjfl.cjs → IconCloseRemove-DwCc4o3b.cjs} +1 -1
- package/dist/Pagination/index.cjs +1 -1
- package/dist/Pagination/index.js +8 -8
- package/dist/PickerWrapper-CWSAzbwY.cjs +1 -0
- package/dist/{PickerWrapper-EWtj7K7M.js → PickerWrapper-ChkVx96j.js} +25 -24
- package/dist/Progress/Doughnut/index.cjs +1 -0
- package/dist/Progress/Doughnut/index.d.ts +5 -0
- package/dist/Progress/Doughnut/index.d.ts.map +1 -0
- package/dist/Progress/Doughnut/index.js +85 -0
- package/dist/Progress/Doughnut/types.d.ts +21 -0
- package/dist/Progress/Doughnut/types.d.ts.map +1 -0
- package/dist/Slide-BhtrgZAI.cjs +1 -0
- package/dist/{Slide-DsdG_6vc.js → Slide-CFSk8Dlg.js} +13 -13
- package/dist/Slider/index.cjs +1 -1
- package/dist/Slider/index.js +1 -1
- package/dist/Step-CcJeR_kj.cjs +1 -0
- package/dist/Step-pWxkk9vq.js +159 -0
- package/dist/Stepper/Horizontal/Step.d.ts +3 -0
- package/dist/Stepper/Horizontal/Step.d.ts.map +1 -1
- package/dist/Stepper/Horizontal/Stepper.d.ts +1 -0
- package/dist/Stepper/Horizontal/Stepper.d.ts.map +1 -1
- package/dist/Stepper/Horizontal/index.cjs +1 -1
- package/dist/Stepper/Horizontal/index.js +1 -1
- package/dist/{TextFieldWrapper-Crap8mNo.js → TextFieldWrapper-BJEouM80.js} +53 -53
- package/dist/TextFieldWrapper-BrWmggFz.cjs +1 -0
- package/dist/assets/styles.css +1 -1
- package/dist/index-BctRb68z.cjs +1 -0
- package/dist/index-CXKbrGQV.js +194 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +650 -45
- package/package.json +31 -1
- package/dist/AccordionItem-CpjwOEDp.cjs +0 -1
- package/dist/Form/Wrappers/TextFieldWrapper/FieldBottomInfo.d.ts +0 -9
- package/dist/Form/Wrappers/TextFieldWrapper/FieldBottomInfo.d.ts.map +0 -1
- package/dist/Form/Wrappers/TextFieldWrapper/FieldLabel.d.ts +0 -9
- package/dist/Form/Wrappers/TextFieldWrapper/FieldLabel.d.ts.map +0 -1
- package/dist/PickerWrapper-CY7PJM50.cjs +0 -1
- package/dist/Slide-aMCvZQnM.cjs +0 -1
- package/dist/Step-CZp-RQhJ.js +0 -129
- package/dist/Step-CtqJxQMY.cjs +0 -1
- package/dist/TextFieldWrapper-CmSiS8zD.cjs +0 -1
package/dist/Form/Input/index.js
CHANGED
|
@@ -1,192 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
"svg",
|
|
8
|
-
{
|
|
9
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
10
|
-
width: "1em",
|
|
11
|
-
height: "1em",
|
|
12
|
-
fill: "none",
|
|
13
|
-
viewBox: "0 0 24 24",
|
|
14
|
-
...e,
|
|
15
|
-
children: [
|
|
16
|
-
/* @__PURE__ */ t(
|
|
17
|
-
"path",
|
|
18
|
-
{
|
|
19
|
-
fill: "currentColor",
|
|
20
|
-
fillRule: "evenodd",
|
|
21
|
-
d: "m15.456 9.595-5.852 5.852-1.061-1.06 5.853-5.853z",
|
|
22
|
-
clipRule: "evenodd"
|
|
23
|
-
}
|
|
24
|
-
),
|
|
25
|
-
/* @__PURE__ */ t(
|
|
26
|
-
"path",
|
|
27
|
-
{
|
|
28
|
-
fill: "currentColor",
|
|
29
|
-
fillRule: "evenodd",
|
|
30
|
-
d: "m9.6 8.532 5.856 5.858-1.06 1.06-5.857-5.857z",
|
|
31
|
-
clipRule: "evenodd"
|
|
32
|
-
}
|
|
33
|
-
),
|
|
34
|
-
/* @__PURE__ */ t(
|
|
35
|
-
"path",
|
|
36
|
-
{
|
|
37
|
-
fill: "currentColor",
|
|
38
|
-
fillRule: "evenodd",
|
|
39
|
-
d: "M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12m10-8.5a8.5 8.5 0 1 0 0 17 8.5 8.5 0 0 0 0-17",
|
|
40
|
-
clipRule: "evenodd"
|
|
41
|
-
}
|
|
42
|
-
)
|
|
43
|
-
]
|
|
44
|
-
}
|
|
45
|
-
), R = (e) => /* @__PURE__ */ d(
|
|
46
|
-
"svg",
|
|
47
|
-
{
|
|
48
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
49
|
-
width: "1em",
|
|
50
|
-
height: "1em",
|
|
51
|
-
fill: "none",
|
|
52
|
-
viewBox: "0 0 24 24",
|
|
53
|
-
...e,
|
|
54
|
-
children: [
|
|
55
|
-
/* @__PURE__ */ t(
|
|
56
|
-
"path",
|
|
57
|
-
{
|
|
58
|
-
fill: "currentColor",
|
|
59
|
-
d: "M12.247 20.812c-4.033 0-7.654-2.828-9.686-7.558a.75.75 0 0 1 0-.592c2.034-4.732 5.655-7.557 9.687-7.557s7.657 2.825 9.69 7.557a.75.75 0 0 1 0 .592c-2.032 4.73-5.653 7.554-9.685 7.557zm-8.182-7.853c1.806 3.983 4.846 6.352 8.18 6.352 3.334.002 6.373-2.369 8.18-6.352-1.808-3.986-4.848-6.354-8.182-6.354s-6.37 2.368-8.176 6.354z"
|
|
60
|
-
}
|
|
61
|
-
),
|
|
62
|
-
/* @__PURE__ */ t(
|
|
63
|
-
"path",
|
|
64
|
-
{
|
|
65
|
-
fill: "currentColor",
|
|
66
|
-
d: "M12.247 16.789a3.825 3.825 0 1 1 0-7.651 3.825 3.825 0 0 1 0 7.65m0-6.152a2.326 2.326 0 1 0 0 4.651 2.326 2.326 0 0 0 0-4.651"
|
|
67
|
-
}
|
|
68
|
-
)
|
|
69
|
-
]
|
|
70
|
-
}
|
|
71
|
-
), b = (e) => /* @__PURE__ */ t(
|
|
72
|
-
"svg",
|
|
73
|
-
{
|
|
74
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
75
|
-
width: "1em",
|
|
76
|
-
height: "1em",
|
|
77
|
-
fill: "none",
|
|
78
|
-
viewBox: "0 0 24 24",
|
|
79
|
-
...e,
|
|
80
|
-
children: /* @__PURE__ */ t(
|
|
81
|
-
"path",
|
|
82
|
-
{
|
|
83
|
-
fill: "currentColor",
|
|
84
|
-
fillRule: "evenodd",
|
|
85
|
-
d: "M20.417 3.22a.75.75 0 0 1 0 1.06L4.643 20.055a.744.744 0 0 1-1.06 0 .75.75 0 0 1 0-1.06l1.972-1.971c-1.413-1.293-2.613-3.036-3.493-5.089a.75.75 0 0 1 0-.593C3.082 8.977 4.52 7.02 6.22 5.683c3.292-2.606 7.621-2.744 11.048-.375l2.088-2.088a.75.75 0 0 1 1.06 0m-.37 4.82c.724.962 1.36 2.073 1.891 3.299a.74.74 0 0 1 0 .595C19.842 16.79 16.128 19.69 12 19.69a8.8 8.8 0 0 1-2.769-.451.75.75 0 0 1 .474-1.424A7.3 7.3 0 0 0 12 18.19c3.428 0 6.561-2.442 8.43-6.553a14.5 14.5 0 0 0-1.58-2.694.75.75 0 0 1 1.197-.902M7.15 6.862c-1.437 1.13-2.67 2.776-3.58 4.778.794 1.752 1.836 3.23 3.047 4.322l2.138-2.138a3.87 3.87 0 0 1-.67-2.184A3.92 3.92 0 0 1 12 7.722a3.9 3.9 0 0 1 2.187.669l2.001-2.002c-2.853-1.844-6.325-1.676-9.038.472m8.088 4.6a.75.75 0 0 1 .606.872 3.92 3.92 0 0 1-3.141 3.147.75.75 0 0 1-.268-1.476 2.41 2.41 0 0 0 1.932-1.937.754.754 0 0 1 .87-.606M12 9.221a2.418 2.418 0 0 0-2.152 3.509l3.245-3.246A2.4 2.4 0 0 0 12 9.222",
|
|
86
|
-
clipRule: "evenodd"
|
|
87
|
-
}
|
|
88
|
-
)
|
|
89
|
-
}
|
|
90
|
-
), j = C(function(a, m) {
|
|
91
|
-
const {
|
|
92
|
-
dir: l = "rtl",
|
|
93
|
-
placeholderDir: x = l,
|
|
94
|
-
containerClassName: w,
|
|
95
|
-
leftIcon: u,
|
|
96
|
-
prefix: p,
|
|
97
|
-
postfix: g,
|
|
98
|
-
onClear: r,
|
|
99
|
-
value: o,
|
|
100
|
-
...i
|
|
101
|
-
} = a, v = I(i, [
|
|
102
|
-
"labelAddon",
|
|
103
|
-
"labelContent",
|
|
104
|
-
"link",
|
|
105
|
-
"rightIcon",
|
|
106
|
-
"isError",
|
|
107
|
-
"errorMessage",
|
|
108
|
-
"hintMessage",
|
|
109
|
-
"wrapperClassName",
|
|
110
|
-
"showMaxLength"
|
|
111
|
-
]), [c, k] = y(i.type);
|
|
112
|
-
function h() {
|
|
113
|
-
return /* @__PURE__ */ t(
|
|
114
|
-
"button",
|
|
115
|
-
{
|
|
116
|
-
onClick: () => {
|
|
117
|
-
typeof r == "function" && r();
|
|
118
|
-
},
|
|
119
|
-
children: /* @__PURE__ */ t(
|
|
120
|
-
M,
|
|
121
|
-
{
|
|
122
|
-
className: "dgs-ui-kit-text-gray-600",
|
|
123
|
-
width: 20,
|
|
124
|
-
height: 20
|
|
125
|
-
}
|
|
126
|
-
)
|
|
127
|
-
}
|
|
128
|
-
);
|
|
129
|
-
}
|
|
130
|
-
return /* @__PURE__ */ d(
|
|
131
|
-
N,
|
|
132
|
-
{
|
|
133
|
-
...a,
|
|
134
|
-
containerClassName: f("dgs-ui-kit-items-center", w),
|
|
135
|
-
value: o,
|
|
136
|
-
children: [
|
|
137
|
-
p && /* @__PURE__ */ t("span", { className: "dgs-ui-kit-font-p1-regular dgs-ui-kit-text-gray-500", children: p }),
|
|
138
|
-
typeof r == "function" && o && l === "ltr" && h(),
|
|
139
|
-
/* @__PURE__ */ t(
|
|
140
|
-
"input",
|
|
141
|
-
{
|
|
142
|
-
...v,
|
|
143
|
-
ref: m,
|
|
144
|
-
className: f(
|
|
145
|
-
"dgs-ui-kit-bg-transparent focus:dgs-ui-kit-outline-none dgs-ui-kit-flex-1",
|
|
146
|
-
l === "rtl" ? "dgs-ui-kit-text-right" : "!dgs-ui-kit-text-left",
|
|
147
|
-
x === "rtl" ? "placeholder:dgs-ui-kit-text-right" : "placeholder:dgs-ui-kit-text-left",
|
|
148
|
-
{
|
|
149
|
-
ss02: i.type != "password"
|
|
150
|
-
},
|
|
151
|
-
a.className
|
|
152
|
-
),
|
|
153
|
-
...l === "ltr" ? { style: { direction: "ltr" } } : {},
|
|
154
|
-
value: o,
|
|
155
|
-
type: c,
|
|
156
|
-
onInput: (s) => {
|
|
157
|
-
if (typeof i.onInput == "function" && i.onInput(s) || c !== "number") return;
|
|
158
|
-
const n = s.currentTarget;
|
|
159
|
-
n.value.length > n.maxLength && (n.value = n.value.slice(0, n.maxLength));
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
),
|
|
163
|
-
typeof r == "function" && o && l === "rtl" && h(),
|
|
164
|
-
g && /* @__PURE__ */ t("span", { className: "dgs-ui-kit-font-p1-regular dgs-ui-kit-text-gray-500", children: g }),
|
|
165
|
-
u && /* @__PURE__ */ t("div", { className: "dgs-ui-kit-text-gray-600", children: u }),
|
|
166
|
-
i.type === "password" && /* @__PURE__ */ t(
|
|
167
|
-
"button",
|
|
168
|
-
{
|
|
169
|
-
onClick: () => k((s) => s === "text" ? "password" : "text"),
|
|
170
|
-
className: "dgs-ui-kit-text-gray-600",
|
|
171
|
-
children: c === "password" ? /* @__PURE__ */ t(
|
|
172
|
-
R,
|
|
173
|
-
{
|
|
174
|
-
width: 20,
|
|
175
|
-
height: 20
|
|
176
|
-
}
|
|
177
|
-
) : /* @__PURE__ */ t(
|
|
178
|
-
b,
|
|
179
|
-
{
|
|
180
|
-
width: 20,
|
|
181
|
-
height: 20
|
|
182
|
-
}
|
|
183
|
-
)
|
|
184
|
-
}
|
|
185
|
-
)
|
|
186
|
-
]
|
|
187
|
-
}
|
|
188
|
-
);
|
|
189
|
-
});
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { I as e } from "../../index-CXKbrGQV.js";
|
|
5
|
+
import "../../omitObjects-CxFrrlkX.js";
|
|
6
|
+
import "../../TextFieldWrapper-BJEouM80.js";
|
|
190
7
|
export {
|
|
191
|
-
|
|
8
|
+
e as default
|
|
192
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";require('../../assets/styles.css');const u=require("react/jsx-runtime"),m=require("../../clsx-C11secjj.cjs"),k=require("react"),
|
|
1
|
+
"use client";"use strict";require('../../assets/styles.css');const u=require("react/jsx-runtime"),m=require("../../clsx-C11secjj.cjs"),k=require("react"),y=require("../../TextFieldWrapper-BrWmggFz.cjs"),w=require("../../index-BctRb68z.cjs");;/* empty css */const T=a=>a.replace(/[۰-۹]/g,r=>String("۰۱۲۳۴۵۶۷۸۹".indexOf(r))),b=a=>{const{inputsNumber:r=4,onChange:o,onEnd:f,className:N,inputsContainerClassName:j,labelContent:g,hintMessage:d,errorMessage:c,isError:x,value:i,...C}=a,p=k.useRef(!1);function l(n){document.getElementById(`dgs-ui-kit-otp-input-${n}`)?.focus()}function E(n,t){const e=[n.code,n.key];if(e.includes("Backspace")||e.includes("Delete")){const s=i.split("");s[t]="",t!==0&&l(t-1),o(s.join(""))}else e.includes("ArrowLeft")?l(t-1):e.includes("ArrowRight")&&l(t+1)}function I(n,t){const e=T(n.currentTarget.value),s=i.split("");e.length>1?e.split("").forEach((v,h)=>{h<r&&(s[h]=v)}):s[t]=e,o(s.join("")),t+1!==r&&e&&l(t+1)}return k.useEffect(()=>{i.length===r&&p.current?(p.current=!1,typeof f=="function"&&f(i)):i.length<r&&(p.current=!0)},[i]),u.jsxs("div",{className:m.clsx("dgs-ui-kit-space-y-2",N),children:[g?u.jsx(y.FieldLabel,{labelContent:g}):null,u.jsx("div",{className:m.clsx("dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-2 [direction:ltr]",j),children:Array.from(Array(r).keys()).map((n,t)=>u.jsx(w.Input,{containerClassName:"dgs-ui-kit-w-12 dgs-ui-kit-h-12 dgs-ui-kit-p-0",className:"dgs-ui-kit-w-full dgs-ui-kit-h-full !dgs-ui-kit-text-center placeholder:!dgs-ui-kit-text-center",placeholder:"-",autoFocus:t===0,onChange:e=>I(e,t),onKeyUp:e=>E(e,t),onFocus:e=>e.currentTarget.select(),id:`dgs-ui-kit-otp-input-${t}`,value:i[t]||"",showMaxLength:!1,isError:!!c||x,autoComplete:"off",maxLength:1,onPaste:e=>{const s=e.clipboardData.getData("text");Number(s)&&o(s)},onInput:e=>{const s=e.currentTarget;return!!(Number(s.value)&&s.value.length>1)},...C},n))}),c||d?u.jsx(y.FieldBottomInfo,{errorMessage:c,hintMessage:d}):null]})};module.exports=b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Form/OtpInput/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAuC,KAAK,EAAE,EAAsB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Form/OtpInput/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAuC,KAAK,EAAE,EAAsB,MAAM,OAAO,CAAC;AAIzF,OAAc,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,kBAAkB,CAAC;AAE1B,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,UAAU,CAAC;IAC3E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAoH/B,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as w, jsx as o } from "react/jsx-runtime";
|
|
3
3
|
import { c as h } from "../../clsx-OuTLNxxd.js";
|
|
4
4
|
import { useRef as b, useEffect as T } from "react";
|
|
5
|
-
import F from "
|
|
6
|
-
import {
|
|
5
|
+
import { F, a as j } from "../../TextFieldWrapper-BJEouM80.js";
|
|
6
|
+
import { I as A } from "../../index-CXKbrGQV.js";
|
|
7
7
|
import '../../assets/styles.css';/* empty css */
|
|
8
|
-
const B = (
|
|
8
|
+
const B = (u) => u.replace(/[۰-۹]/g, (i) => String("۰۱۲۳۴۵۶۷۸۹".indexOf(i))), R = (u) => {
|
|
9
9
|
const {
|
|
10
10
|
inputsNumber: i = 4,
|
|
11
11
|
onChange: l,
|
|
@@ -18,42 +18,42 @@ const B = (a) => a.replace(/[۰-۹]/g, (i) => String("۰۱۲۳۴۵۶۷۸۹".inde
|
|
|
18
18
|
isError: N,
|
|
19
19
|
value: r,
|
|
20
20
|
...C
|
|
21
|
-
} =
|
|
22
|
-
function
|
|
21
|
+
} = u, f = b(!1);
|
|
22
|
+
function a(n) {
|
|
23
23
|
document.getElementById(`dgs-ui-kit-otp-input-${n}`)?.focus();
|
|
24
24
|
}
|
|
25
25
|
function E(n, t) {
|
|
26
26
|
const e = [n.code, n.key];
|
|
27
27
|
if (e.includes("Backspace") || e.includes("Delete")) {
|
|
28
28
|
const s = r.split("");
|
|
29
|
-
s[t] = "", t !== 0 &&
|
|
30
|
-
} else e.includes("ArrowLeft") ?
|
|
29
|
+
s[t] = "", t !== 0 && a(t - 1), l(s.join(""));
|
|
30
|
+
} else e.includes("ArrowLeft") ? a(t - 1) : e.includes("ArrowRight") && a(t + 1);
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function I(n, t) {
|
|
33
33
|
const e = B(n.currentTarget.value), s = r.split("");
|
|
34
|
-
e.length > 1 ? e.split("").forEach((
|
|
35
|
-
d < i && (s[d] =
|
|
36
|
-
}) : s[t] = e, l(s.join("")), t + 1 !== i && e &&
|
|
34
|
+
e.length > 1 ? e.split("").forEach((v, d) => {
|
|
35
|
+
d < i && (s[d] = v);
|
|
36
|
+
}) : s[t] = e, l(s.join("")), t + 1 !== i && e && a(t + 1);
|
|
37
37
|
}
|
|
38
38
|
return T(() => {
|
|
39
39
|
r.length === i && f.current ? (f.current = !1, typeof p == "function" && p(r)) : r.length < i && (f.current = !0);
|
|
40
|
-
}, [r]), /* @__PURE__ */
|
|
41
|
-
g ? /* @__PURE__ */
|
|
42
|
-
/* @__PURE__ */
|
|
40
|
+
}, [r]), /* @__PURE__ */ w("div", { className: h("dgs-ui-kit-space-y-2", k), children: [
|
|
41
|
+
g ? /* @__PURE__ */ o(F, { labelContent: g }) : null,
|
|
42
|
+
/* @__PURE__ */ o(
|
|
43
43
|
"div",
|
|
44
44
|
{
|
|
45
45
|
className: h(
|
|
46
46
|
"dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-2 [direction:ltr]",
|
|
47
47
|
y
|
|
48
48
|
),
|
|
49
|
-
children: Array.from(Array(i).keys()).map((n, t) => /* @__PURE__ */
|
|
50
|
-
|
|
49
|
+
children: Array.from(Array(i).keys()).map((n, t) => /* @__PURE__ */ o(
|
|
50
|
+
A,
|
|
51
51
|
{
|
|
52
52
|
containerClassName: "dgs-ui-kit-w-12 dgs-ui-kit-h-12 dgs-ui-kit-p-0",
|
|
53
53
|
className: "dgs-ui-kit-w-full dgs-ui-kit-h-full !dgs-ui-kit-text-center placeholder:!dgs-ui-kit-text-center",
|
|
54
54
|
placeholder: "-",
|
|
55
55
|
autoFocus: t === 0,
|
|
56
|
-
onChange: (e) =>
|
|
56
|
+
onChange: (e) => I(e, t),
|
|
57
57
|
onKeyUp: (e) => E(e, t),
|
|
58
58
|
onFocus: (e) => e.currentTarget.select(),
|
|
59
59
|
id: `dgs-ui-kit-otp-input-${t}`,
|
|
@@ -76,8 +76,8 @@ const B = (a) => a.replace(/[۰-۹]/g, (i) => String("۰۱۲۳۴۵۶۷۸۹".inde
|
|
|
76
76
|
))
|
|
77
77
|
}
|
|
78
78
|
),
|
|
79
|
-
c || m ? /* @__PURE__ */
|
|
80
|
-
|
|
79
|
+
c || m ? /* @__PURE__ */ o(
|
|
80
|
+
j,
|
|
81
81
|
{
|
|
82
82
|
errorMessage: c,
|
|
83
83
|
hintMessage: m
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OptionItem.d.ts","sourceRoot":"","sources":["../../../src/components/Form/Select/OptionItem.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGnD,KAAK,eAAe,CAAC,CAAC,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG;IAClD,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;CACnB,CAAC;AAyBF,QAAA,MAAM,UAAU,GAAI,CAAC,SAAU,eAAe,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"OptionItem.d.ts","sourceRoot":"","sources":["../../../src/components/Form/Select/OptionItem.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGnD,KAAK,eAAe,CAAC,CAAC,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG;IAClD,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;CACnB,CAAC;AAyBF,QAAA,MAAM,UAAU,GAAI,CAAC,SAAU,eAAe,CAAC,CAAC,CAAC,4CA+BhD,CAAC;wBAEiC,OAAO,UAAU;AAApD,wBAAqD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Options.d.ts","sourceRoot":"","sources":["../../../src/components/Form/Select/Options.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAgD,MAAM,SAAS,CAAC;AAOzF,QAAA,MAAM,OAAO,GAAI,CAAC,SAAU,WAAW,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"Options.d.ts","sourceRoot":"","sources":["../../../src/components/Form/Select/Options.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAgD,MAAM,SAAS,CAAC;AAOzF,QAAA,MAAM,OAAO,GAAI,CAAC,SAAU,WAAW,CAAC,CAAC,CAAC,4CAwLzC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require('../../assets/styles.css');const s=require("react/jsx-runtime"),d=require("../../clsx-C11secjj.cjs"),o=require("react"),F=require("../Checkbox/index.cjs"),W=require("../../Button/index.cjs"),R=require("
|
|
1
|
+
"use strict";require('../../assets/styles.css');const s=require("react/jsx-runtime"),d=require("../../clsx-C11secjj.cjs"),o=require("react"),F=require("../Checkbox/index.cjs"),W=require("../../Button/index.cjs"),R=require("../../index-BctRb68z.cjs"),M=require("../../PickerWrapper-CWSAzbwY.cjs");;/* empty css */const _=i=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 24 24",...i,children:s.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M11.767 20.755a8.989 8.989 0 1 0 0-17.977 8.989 8.989 0 0 0 0 17.977M18.018 18.485 21.542 22"})});function H(i,r=100){if(!i)return;const t=document.createElement("input");t.style.position="absolute",t.style.top=`${i.offsetTop+7}px`,t.style.left=`${i.offsetLeft}px`,t.style.height="0px",t.style.opacity="0px",document.body.appendChild(t),t.focus(),setTimeout(()=>{i.focus(),i.click(),document.body.removeChild(t)},r)}function z({label:i,isMultiple:r,isActive:t,disabled:u}){return r?s.jsx(F,{checked:t,label:i,readOnly:!0,disabled:u}):i}const D=i=>{const{option:r,onClick:t,value:u,mode:n,optionCellClassName:g,optionCell:a}=i;function c(){return Array.isArray(u)?u.includes(r.value):r.value===u}return s.jsx("button",{type:"button",onClick:t,className:d.clsx("dgs-ui-kit-w-full dgs-ui-kit-text-start dgs-ui-kit-px-3 disabled:dgs-ui-kit-cursor-not-allowed dgs-ui-kit-py-3 dgs-ui-kit-font-p1-regular disabled:dgs-ui-kit-bg-gray-50 dgs-ui-kit-transition",c()?"dgs-ui-kit-bg-primary-50 dgs-ui-kit-text-primary-500":"dgs-ui-kit-text-gray-700 disabled:dgs-ui-kit-text-gray-400",g),disabled:r.disabled,children:a?a(r,c()):z({label:r.label,isMultiple:n==="multiple",isActive:c(),disabled:r.disabled??!1})})},T=o.memo(D),K=20,U=i=>{const{options:r,mode:t="single",afterOptions:u,beforOptions:n,onChange:g,searchable:a=!0,separateSelectedOptions:c=!0,optionsTitle:w="عنوانها",value:p,optionCellClassName:P,emptyContent:q="نتیجهای یافت نشد !",showClearButtonOnEmpty:A=!0}=i,[f,N]=o.useState(""),[k,L]=o.useState(0),m=o.useRef(null),{toggleWrapperVisibility:$}=M.usePickerWrapperContext(),O=d.clsx("dgs-ui-kit-border-t dgs-ui-kit-border-solid dgs-ui-kit-border-gray-100",(!a&&!n||t==="multiple"&&c)&&"first-of-type:dgs-ui-kit-border-t-0",!!u&&"last-of-type:dgs-ui-kit-border-b");let h;const b=a;typeof a=="boolean"?h=a:h=Object.keys(a).length>0;const y=o.useMemo(()=>f?r?.filter(e=>e.label.includes(f)):r,[f,r]),v=o.useMemo(()=>t==="multiple"&&c?r?.filter(e=>p.includes(e.value))??[]:[],[r,p]),I=o.useMemo(()=>{let e=y;t==="multiple"&&c&&(e=e?.filter(j=>!p.includes(j.value)));const l=Math.min(k+K,e?.length??0);return e?.slice(k,l)},[y,k,p]),x=m?.current?.children[0]?.clientHeight??50,B=(y?.length??0)*x,C=o.useCallback(()=>{const e=m?.current?.parentElement;if(!e)return;const l=e.scrollTop,j=m.current.offsetTop,S=Math.floor((l-j)/x);L(S>=0?S:0)},[x]);o.useEffect(()=>{const e=m.current?.parentElement;if(e)return e.addEventListener("scroll",C),()=>e.removeEventListener("scroll",C)},[C]),o.useEffect(()=>{h&&H(document.getElementById("search-input"),400)},[]);const E=o.useCallback(e=>{if(typeof g=="function")if(t==="multiple"){const l=[...p??[]];l.includes(e)?l.splice(l.indexOf(e),1):l.push(e),g(l)}else g(e),$()},[p]);return s.jsxs(s.Fragment,{children:[h&&s.jsx(R.Input,{id:"search-input",wrapperClassName:d.clsx("dgs-ui-kit-sticky dgs-ui-kit-top-0 dgs-ui-kit-pt-3 dgs-ui-kit-right-0 dgs-ui-kit-bg-white dgs-ui-kit-z-10 dgs-ui-kit-px-3",n?"dgs-ui-kit-pb-2":"dgs-ui-kit-pb-3",b?.wrapperClassName),placeholder:b?.placeholder??"جستجوی عنوان",value:f,onChange:e=>N(e.currentTarget.value),rightIcon:b?.rightIcon??s.jsx(_,{width:20,height:20}),...typeof a=="object"?a:{}}),n,t==="multiple"&&c&&v.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"dgs-ui-kit-font-p2-regular dgs-ui-kit-text-gray-400 dgs-ui-kit-px-3 dgs-ui-kit-py-2",children:`${w}ی انتخاب شده`}),v.map(e=>s.jsx(T,{onClick:()=>E(e.value),option:e,optionCellClassName:d.clsx(O,P),...i},e.value))]}),s.jsxs(s.Fragment,{children:[t==="multiple"&&c&&s.jsx("p",{className:"dgs-ui-kit-font-p2-regular dgs-ui-kit-text-gray-400 dgs-ui-kit-px-3 dgs-ui-kit-py-2",children:w}),s.jsx("div",{ref:m,className:"dgs-ui-kit-relative",style:{height:B},children:I?.map((e,l)=>s.jsx("div",{className:d.clsx("dgs-ui-kit-absolute dgs-ui-kit-w-full",O),style:{top:`${(k+l)*x}px`},children:s.jsx(T,{onClick:()=>E(e.value),option:e,...i})},e.value))}),!I?.length&&!v.length&&s.jsxs("div",{className:"dgs-ui-kit-text-center dgs-ui-kit-flex dgs-ui-kit-flex-col dgs-ui-kit-items-center dgs-ui-kit-mt-2",children:[s.jsx("p",{className:"dgs-ui-kit-text-gray-500 dgs-ui-kit-font-p3-medium",children:q}),A&&s.jsx(W,{type:"button",className:"dgs-ui-kit-mt-1",variant:"text",size:"small",onClick:()=>N(""),children:"پاک کردن"})]})]}),u]})};function V(i,r){return Array.isArray(i)?r.filter(t=>i.includes(t.value)).map(t=>t.label).join(", "):r.find(t=>t.value===i)?.label??""}const G=i=>{const{searchable:r=!0,value:t,options:u}=i,n={...i};return n.dropdownType==="popover"&&!r&&(n.popoverClassName=d.clsx("dgs-ui-kit-pt-3",n.popoverClassName)),n.dropdownType==="drawer"&&(n.drawerProps={...n.drawerProps,containerClassName:d.clsx(r?"!dgs-ui-kit-pt-0":"!dgs-ui-kit-pt-3",n.drawerProps?.containerClassName)}),n.customInput||(n.inputProps={...n.inputProps,value:V(t,u)}),s.jsx(M.PickerWrapper,{...n,children:s.jsx(U,{...i})})};module.exports=G;
|
|
@@ -3,8 +3,8 @@ import { c as d } from "../../clsx-OuTLNxxd.js";
|
|
|
3
3
|
import { memo as D, useState as L, useRef as F, useMemo as O, useCallback as M, useEffect as $ } from "react";
|
|
4
4
|
import K from "../Checkbox/index.js";
|
|
5
5
|
import U from "../../Button/index.js";
|
|
6
|
-
import V from "
|
|
7
|
-
import { u as q, P as G } from "../../PickerWrapper-
|
|
6
|
+
import { I as V } from "../../index-CXKbrGQV.js";
|
|
7
|
+
import { u as q, P as G } from "../../PickerWrapper-ChkVx96j.js";
|
|
8
8
|
import '../../assets/styles.css';/* empty css */
|
|
9
9
|
const J = (i) => /* @__PURE__ */ n(
|
|
10
10
|
"svg",
|
|
@@ -58,6 +58,7 @@ const Y = (i) => {
|
|
|
58
58
|
return /* @__PURE__ */ n(
|
|
59
59
|
"button",
|
|
60
60
|
{
|
|
61
|
+
type: "button",
|
|
61
62
|
onClick: t,
|
|
62
63
|
className: d(
|
|
63
64
|
"dgs-ui-kit-w-full dgs-ui-kit-text-start dgs-ui-kit-px-3 disabled:dgs-ui-kit-cursor-not-allowed dgs-ui-kit-py-3 dgs-ui-kit-font-p1-regular disabled:dgs-ui-kit-bg-gray-50 dgs-ui-kit-transition",
|
|
@@ -192,6 +193,7 @@ const Y = (i) => {
|
|
|
192
193
|
H && /* @__PURE__ */ n(
|
|
193
194
|
U,
|
|
194
195
|
{
|
|
196
|
+
type: "button",
|
|
195
197
|
className: "dgs-ui-kit-mt-1",
|
|
196
198
|
variant: "text",
|
|
197
199
|
size: "small",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";require('../../assets/styles.css');const i=require("react/jsx-runtime"),t=require("../../clsx-C11secjj.cjs");;/* empty css */const u={large:{switch:"dgs-ui-kit-w-11 dgs-ui-kit-h-6",label:"dgs-ui-kit-font-p1-medium",toggler:"dgs-ui-kit-size-5"},small:{switch:"dgs-ui-kit-w-9 dgs-ui-kit-h-5",label:"dgs-ui-kit-font-p2-medium",toggler:"dgs-ui-kit-size-4"}},n=d=>{const{checked:s,onChange:r,isIntermediate:e,label:l,description:a,disabled:k,size:g="large",className:o,containerClassName:c}=d;return i.jsxs("button",{type:"button",className:t.clsx("dgs-ui-kit-flex dgs-ui-kit-gap-x-2 dgs-ui-kit-group",k&&"dgs-ui-kit-opacity-50",c),onClick:()=>r(!s),children:[i.jsx("div",{className:t.clsx("dgs-ui-kit-relative dgs-ui-kit-rounded-xl dgs-ui-kit-transition","group-hover:dgs-ui-kit-ring-4 group-hover:dgs-ui-kit-ring-gray-100","group-focus:dgs-ui-kit-ring-offset-1 group-focus:dgs-ui-kit-ring-offset-white group-focus:dgs-ui-kit-ring-4 group-focus:dgs-ui-kit-ring-primary-300",s?"dgs-ui-kit-bg-primary-500":"dgs-ui-kit-bg-gray-300",u[g].switch,o),children:i.jsx("div",{className:t.clsx("dgs-ui-kit-bg-white dgs-ui-kit-rounded-full dgs-ui-kit-transition-all dgs-ui-kit-absolute dgs-ui-kit-top-1/2 -dgs-ui-kit-translate-y-1/2 dgs-ui-kit-right-0.5 dgs-ui-kit-left-0.5",{"dgs-ui-kit-left-[calc(100%-2px)]":!s,"!dgs-ui-kit-w-3 !dgs-ui-kit-h-0.5 dgs-ui-kit-left-1/2 dgs-ui-kit-right-1/2 dgs-ui-kit-translate-x-1/2":s&&e,"dgs-ui-kit-right-[calc(100%-2px)] dgs-ui-kit-translate-x-full":s&&!e},u[g].toggler)})}),i.jsxs("div",{className:"dgs-ui-kit-space-y-1 -dgs-ui-kit-mt-1",children:[i.jsx("div",{className:t.clsx(u[g].label,"dgs-ui-kit-text-gray-700 group-hover:dgs-ui-kit-text-primary-500 dgs-ui-kit-transition-colors"),children:l}),i.jsx("div",{className:"dgs-ui-kit-font-p3-regular dgs-ui-kit-text-gray-500",children:a})]})]})};module.exports=n;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export interface SwitchProps {
|
|
3
|
+
checked: boolean;
|
|
4
|
+
onChange: (checked: SwitchProps['checked']) => void;
|
|
5
|
+
isIntermediate?: boolean;
|
|
6
|
+
label?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
size?: 'large' | 'small';
|
|
10
|
+
containerClassName?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
declare const Switch: FC<SwitchProps>;
|
|
14
|
+
export default Switch;
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Form/Switch/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,kBAAkB,CAAC;AAE1B,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;IACpD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAkBD,QAAA,MAAM,MAAM,EAAE,EAAE,CAAC,WAAW,CA4D3B,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { jsxs as e, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { c as s } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import '../../assets/styles.css';/* empty css */
|
|
4
|
+
const u = {
|
|
5
|
+
large: {
|
|
6
|
+
switch: "dgs-ui-kit-w-11 dgs-ui-kit-h-6",
|
|
7
|
+
label: "dgs-ui-kit-font-p1-medium",
|
|
8
|
+
toggler: "dgs-ui-kit-size-5"
|
|
9
|
+
},
|
|
10
|
+
small: {
|
|
11
|
+
switch: "dgs-ui-kit-w-9 dgs-ui-kit-h-5",
|
|
12
|
+
label: "dgs-ui-kit-font-p2-medium",
|
|
13
|
+
toggler: "dgs-ui-kit-size-4"
|
|
14
|
+
}
|
|
15
|
+
}, f = (r) => {
|
|
16
|
+
const {
|
|
17
|
+
checked: i,
|
|
18
|
+
onChange: a,
|
|
19
|
+
isIntermediate: d,
|
|
20
|
+
label: l,
|
|
21
|
+
description: k,
|
|
22
|
+
disabled: o,
|
|
23
|
+
size: g = "large",
|
|
24
|
+
className: n,
|
|
25
|
+
containerClassName: c
|
|
26
|
+
} = r;
|
|
27
|
+
return /* @__PURE__ */ e(
|
|
28
|
+
"button",
|
|
29
|
+
{
|
|
30
|
+
type: "button",
|
|
31
|
+
className: s(
|
|
32
|
+
"dgs-ui-kit-flex dgs-ui-kit-gap-x-2 dgs-ui-kit-group",
|
|
33
|
+
o && "dgs-ui-kit-opacity-50",
|
|
34
|
+
c
|
|
35
|
+
),
|
|
36
|
+
onClick: () => a(!i),
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ t(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
className: s(
|
|
42
|
+
"dgs-ui-kit-relative dgs-ui-kit-rounded-xl dgs-ui-kit-transition",
|
|
43
|
+
"group-hover:dgs-ui-kit-ring-4 group-hover:dgs-ui-kit-ring-gray-100",
|
|
44
|
+
"group-focus:dgs-ui-kit-ring-offset-1 group-focus:dgs-ui-kit-ring-offset-white group-focus:dgs-ui-kit-ring-4 group-focus:dgs-ui-kit-ring-primary-300",
|
|
45
|
+
i ? "dgs-ui-kit-bg-primary-500" : "dgs-ui-kit-bg-gray-300",
|
|
46
|
+
u[g].switch,
|
|
47
|
+
n
|
|
48
|
+
),
|
|
49
|
+
children: /* @__PURE__ */ t(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
className: s(
|
|
53
|
+
"dgs-ui-kit-bg-white dgs-ui-kit-rounded-full dgs-ui-kit-transition-all dgs-ui-kit-absolute dgs-ui-kit-top-1/2 -dgs-ui-kit-translate-y-1/2 dgs-ui-kit-right-0.5 dgs-ui-kit-left-0.5",
|
|
54
|
+
{
|
|
55
|
+
"dgs-ui-kit-left-[calc(100%-2px)]": !i,
|
|
56
|
+
"!dgs-ui-kit-w-3 !dgs-ui-kit-h-0.5 dgs-ui-kit-left-1/2 dgs-ui-kit-right-1/2 dgs-ui-kit-translate-x-1/2": i && d,
|
|
57
|
+
"dgs-ui-kit-right-[calc(100%-2px)] dgs-ui-kit-translate-x-full": i && !d
|
|
58
|
+
},
|
|
59
|
+
u[g].toggler
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ e("div", { className: "dgs-ui-kit-space-y-1 -dgs-ui-kit-mt-1", children: [
|
|
66
|
+
/* @__PURE__ */ t(
|
|
67
|
+
"div",
|
|
68
|
+
{
|
|
69
|
+
className: s(
|
|
70
|
+
u[g].label,
|
|
71
|
+
"dgs-ui-kit-text-gray-700 group-hover:dgs-ui-kit-text-primary-500 dgs-ui-kit-transition-colors"
|
|
72
|
+
),
|
|
73
|
+
children: l
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
/* @__PURE__ */ t("div", { className: "dgs-ui-kit-font-p3-regular dgs-ui-kit-text-gray-500", children: k })
|
|
77
|
+
] })
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
};
|
|
82
|
+
export {
|
|
83
|
+
f as default
|
|
84
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const s=require("react/jsx-runtime"),o=require("../../clsx-C11secjj.cjs"),u=require("react"),c=require("../../omitObjects-CtiYo0hv.cjs"),d=require("../../TextFieldWrapper-
|
|
1
|
+
"use strict";const s=require("react/jsx-runtime"),o=require("../../clsx-C11secjj.cjs"),u=require("react"),c=require("../../omitObjects-CtiYo0hv.cjs"),d=require("../../TextFieldWrapper-BrWmggFz.cjs"),g=u.forwardRef(function(e,i){const{dir:t="rtl",placeholderDir:l=t,className:a,...r}=e,n=c.omitObject(r,["labelAddon","labelContent","link","rightIcon","isError","errorMessage","hintMessage","wrapperClassName","showMaxLength","containerClassName"]);return s.jsx(d.TextFieldWrapper,{...e,children:s.jsx("textarea",{...n,ref:i,className:o.clsx("dgs-ui-kit-bg-transparent dgs-ui-kit-leading-normal 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",a),rows:r.rows??5})})});module.exports=g;
|
|
@@ -2,7 +2,7 @@ import { jsx as i } from "react/jsx-runtime";
|
|
|
2
2
|
import { c as n } from "../../clsx-OuTLNxxd.js";
|
|
3
3
|
import { forwardRef as d } from "react";
|
|
4
4
|
import { o as g } from "../../omitObjects-CxFrrlkX.js";
|
|
5
|
-
import { T as u } from "../../TextFieldWrapper-
|
|
5
|
+
import { T as u } from "../../TextFieldWrapper-BJEouM80.js";
|
|
6
6
|
const h = d(function(t, s) {
|
|
7
7
|
const { dir: e = "rtl", placeholderDir: o = e, className: a, ...r } = t, l = g(r, [
|
|
8
8
|
"labelAddon",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PickerWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/Wrappers/PickerWrapper/PickerWrapper.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAY,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAKlE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAGjD,OAAO,kBAAkB,CAAC;AAM1B,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,
|
|
1
|
+
{"version":3,"file":"PickerWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/Wrappers/PickerWrapper/PickerWrapper.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAY,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAKlE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAGjD,OAAO,kBAAkB,CAAC;AAM1B,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CA6H5D,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,26 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
link?: {
|
|
6
|
-
cnotent: string;
|
|
7
|
-
href: string;
|
|
8
|
-
};
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { FieldBottomInfoProps } from '../../Common/FieldBottomInfo/FieldBottomInfo';
|
|
3
|
+
import { FieldLabelProps } from '../../Common/FieldLabel/FieldLabel';
|
|
4
|
+
export interface TextFieldBaseProps extends FieldLabelProps, Omit<FieldBottomInfoProps, 'extraHelper'> {
|
|
9
5
|
containerClassName?: string;
|
|
10
6
|
rightIcon?: JSX.Element;
|
|
11
7
|
dir?: 'rtl' | 'ltr';
|
|
12
8
|
placeholderDir?: 'rtl' | 'ltr';
|
|
13
9
|
isError?: boolean;
|
|
14
|
-
errorMessage?: string;
|
|
15
|
-
hintMessage?: string;
|
|
16
10
|
wrapperClassName?: string;
|
|
17
11
|
showMaxLength?: boolean;
|
|
18
12
|
}
|
|
19
13
|
interface TextFieldWrapperProps extends TextFieldBaseProps {
|
|
20
|
-
required?: boolean;
|
|
21
|
-
disabled?: boolean;
|
|
22
14
|
maxLength?: number;
|
|
23
|
-
labelAddon?: React.ReactNode;
|
|
24
15
|
value?: string | number | readonly string[];
|
|
25
16
|
children: ReactNode;
|
|
26
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextFieldWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/Wrappers/TextFieldWrapper/TextFieldWrapper.tsx"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"TextFieldWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/Wrappers/TextFieldWrapper/TextFieldWrapper.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvD,OAAwB,EACtB,KAAK,oBAAoB,EAC1B,MAAM,8CAA8C,CAAC;AACtD,OAAmB,EAAE,KAAK,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAEtF,OAAO,kBAAkB,CAAC;AAE1B,MAAM,WAAW,kBACf,SAAQ,eAAe,EACrB,IAAI,CAAC,oBAAoB,EAAE,aAAa,CAAC;IAC3C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACxB,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IACpB,cAAc,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,UAAU,qBAAsB,SAAQ,kBAAkB;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;IAC5C,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,QAAA,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CA2E/C,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const o=require("react/jsx-runtime"),n=l=>o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 24 24",...l,children:o.jsx("path",{fill:"currentColor",d:"M4.47 7.97a.75.75 0 0 1 .976-.073l.084.073L12 14.439l6.47-6.47a.75.75 0 0 1 .976-.072l.084.073a.75.75 0 0 1 .073.976l-.073.084-7 7a.75.75 0 0 1-.976.073l-.084-.073-7-7a.75.75 0 0 1 0-1.06"})});exports.
|
|
1
|
+
"use strict";const o=require("react/jsx-runtime"),n=l=>o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 24 24",...l,children:o.jsx("path",{fill:"currentColor",d:"M4.47 7.97a.75.75 0 0 1 .976-.073l.084.073L12 14.439l6.47-6.47a.75.75 0 0 1 .976-.072l.084.073a.75.75 0 0 1 .073.976l-.073.084-7 7a.75.75 0 0 1-.976.073l-.084-.073-7-7a.75.75 0 0 1 0-1.06"})});exports.IconArrowDown2=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),l=t=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 24 24",...t,children:e.jsx("path",{fill:"currentColor",d:"M16.28 4.47a.75.75 0 0 1 .073.976l-.073.084L9.811 12l6.47 6.47a.75.75 0 0 1 .072.976l-.073.084a.75.75 0 0 1-.976.073l-.084-.073-7-7a.75.75 0 0 1-.073-.976l.073-.084 7-7a.75.75 0 0 1 1.06 0"})});exports.
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),l=t=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 24 24",...t,children:e.jsx("path",{fill:"currentColor",d:"M16.28 4.47a.75.75 0 0 1 .073.976l-.073.084L9.811 12l6.47 6.47a.75.75 0 0 1 .072.976l-.073.084a.75.75 0 0 1-.976.073l-.084-.073-7-7a.75.75 0 0 1-.073-.976l.073-.084 7-7a.75.75 0 0 1 1.06 0"})});exports.IconArrowLeft2=l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const o=require("react/jsx-runtime"),t=r=>o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 24 24",...r,children:o.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m8.5 5 7 7-7 7"})});exports.
|
|
1
|
+
"use strict";const o=require("react/jsx-runtime"),t=r=>o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 24 24",...r,children:o.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m8.5 5 7 7-7 7"})});exports.IconArrowRight2=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),o=l=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 24 24",...l,children:e.jsx("path",{fill:"currentColor",d:"M6.28 5.22a.75.75 0 0 0-1.06 1.06l5.47 5.47-5.47 5.47a.75.75 0 1 0 1.06 1.06l5.47-5.47 5.47 5.47a.75.75 0 1 0 1.06-1.06l-5.47-5.47 5.47-5.47a.75.75 0 0 0-1.06-1.06l-5.47 5.47z"})});exports.
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),o=l=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 24 24",...l,children:e.jsx("path",{fill:"currentColor",d:"M6.28 5.22a.75.75 0 0 0-1.06 1.06l5.47 5.47-5.47 5.47a.75.75 0 1 0 1.06 1.06l5.47-5.47 5.47 5.47a.75.75 0 1 0 1.06-1.06l-5.47-5.47 5.47-5.47a.75.75 0 0 0-1.06-1.06l-5.47 5.47z"})});exports.IconCloseRemove=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";require('../assets/styles.css');const o=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";require('../assets/styles.css');const o=require("react/jsx-runtime"),I=require("../clsx-C11secjj.cjs"),w=require("react"),y=require("../IconArrowLeft2-CNA3H0xY.cjs"),R=require("../IconArrowRight2-CF_bdH81.cjs"),P=require("../Button/index.cjs");;/* empty css */const h="...";function k(d,g){const n=g-d+1;return Array.from({length:n},(u,t)=>t+d)}function v({totalCount:d,pageSize:g,siblingCount:n,currentPage:u}){const t=Math.ceil(d/g);if(n+5>=t)return k(1,t);const e=Math.max(u-n,1),c=Math.min(u+n,t),l=e>2,s=c<t-1,f=1,a=t;if(!l&&s){let r=2+n;return e>1&&(r+=1),[...k(1,r),h,t]}if(l&&!s){let r=2+n;c<t&&(r+=1);const i=k(t-r+1,t);return[f,h,...i]}const x=k(e,c);return[f,h,...x,h,a]}const C=d=>{const{totalCount:g,pageSize:n,onPageChange:u,siblingCount:t=1,defaultCurrent:m=1,navigationButtonsWithText:e=!0,hideOnSinglePage:c,className:l}=d,[s,f]=w.useState(m),a=v({totalCount:g,pageSize:n,siblingCount:t,currentPage:s}),x=a[a.length-1];if(c&&a.length<2)return null;function r(i){typeof u=="function"&&u(i),f(i)}return o.jsxs("div",{className:I.clsx("dgs-ui-kit-flex dgs-ui-kit-justify-between dgs-ui-kit-w-full dgs-ui-kit-px-4 dgs-ui-kit-text-gray-600",l),children:[o.jsx(P,{disabled:s===1,onClick:()=>r(s-1),rightIcon:o.jsx(R.IconArrowRight2,{}),variant:e?"text":"secondary",size:e?"medium":"small",children:e&&"صفحه قبل"}),o.jsx("div",{className:"dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-x-1 md:dgs-ui-kit-gap-x-4",children:a.map((i,j)=>typeof i=="string"?o.jsx("div",{children:h},`${i}-${j}`):o.jsx("button",{className:I.clsx("ss02 dgs-ui-kit-w-9 dgs-ui-kit-h-9 md:dgs-ui-kit-w-11 md:dgs-ui-kit-h-11 dgs-ui-kit-flex dgs-ui-kit-justify-center dgs-ui-kit-items-center dgs-ui-kit-font-h6-bold md:dgs-ui-kit-font-h5-bold dgs-ui-kit-transition dgs-ui-kit-border dgs-ui-kit-border-solid dgs-ui-kit-border-transparent dgs-ui-kit-rounded-lg",i===s?"dgs-ui-kit-bg-primary-500 dgs-ui-kit-text-white":"hover:dgs-ui-kit-text-primary-500 hover:dgs-ui-kit-border-primary-200",l),onClick:()=>r(i),children:i},i))}),o.jsx(P,{disabled:s===x,onClick:()=>r(s+1),leftIcon:o.jsx(y.IconArrowLeft2,{}),variant:e?"text":"secondary",size:e?"medium":"small",children:e&&"صفحه بعد"})]})};module.exports=C;
|