@dgshahr/ui-kit 0.0.4 → 0.0.6
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/AccordionItem.d.ts.map +1 -1
- package/dist/Accordion/index.cjs +1 -1
- package/dist/Accordion/index.js +1 -1
- package/dist/{AccordionItem-DN7bi5kw.js → AccordionItem-BFDuboYi.js} +11 -11
- package/dist/{AccordionItem-lq6ehxKe.cjs → AccordionItem-C3MiOBH7.cjs} +11 -11
- package/dist/Alert/index.cjs +69 -57
- package/dist/Alert/index.d.ts.map +1 -1
- package/dist/Alert/index.js +69 -57
- package/dist/Badge/index.cjs +22 -22
- package/dist/Badge/index.d.ts.map +1 -1
- package/dist/Badge/index.js +22 -22
- package/dist/Breadcrumb/index.cjs +31 -22
- package/dist/Breadcrumb/index.d.ts.map +1 -1
- package/dist/Breadcrumb/index.js +31 -22
- package/dist/Button/index.cjs +34 -34
- package/dist/Button/index.d.ts.map +1 -1
- package/dist/Button/index.js +34 -34
- package/dist/Button/variants.d.ts.map +1 -1
- package/dist/Divider/index.cjs +6 -6
- package/dist/Divider/index.js +6 -6
- package/dist/Form/Checkbox/index.cjs +2 -2
- package/dist/Form/Checkbox/index.js +2 -2
- package/dist/Form/Input/index.cjs +10 -10
- package/dist/Form/Input/index.d.ts.map +1 -1
- package/dist/Form/Input/index.js +10 -10
- package/dist/Form/RadioButton/index.cjs +3 -3
- package/dist/Form/RadioButton/index.js +3 -3
- package/dist/Form/Textarea/index.cjs +4 -4
- package/dist/Form/Textarea/index.d.ts.map +1 -1
- package/dist/Form/Textarea/index.js +4 -4
- package/dist/Form/Wrappers/SelectableInputWrapper/SelectableInputWrapper.d.ts.map +1 -1
- package/dist/Pagination/index.cjs +51 -42
- package/dist/Pagination/index.d.ts.map +1 -1
- package/dist/Pagination/index.js +51 -42
- package/dist/SelectableInputWrapper-BIBVazbq.js +77 -0
- package/dist/SelectableInputWrapper-g7YtIiBW.cjs +79 -0
- package/dist/Slide-BhWFQV8r.js +234 -0
- package/dist/Slide-BzXDEkqH.cjs +237 -0
- package/dist/Slider/NavigationDot.d.ts.map +1 -1
- package/dist/Slider/Slide.d.ts.map +1 -1
- package/dist/Slider/Slider.d.ts +2 -1
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/index.cjs +1 -1
- package/dist/Slider/index.js +1 -1
- package/dist/{TextFieldWrapper--hxpmYuz.js → TextFieldWrapper-BkoKcbvs.js} +16 -16
- package/dist/{TextFieldWrapper-DaoZxs1E.cjs → TextFieldWrapper-D-DH5_DG.cjs} +16 -16
- package/dist/assets/Button.css +355 -317
- package/dist/assets/styles.css +343 -305
- package/dist/index.cjs +2 -2
- package/dist/index.js +2 -2
- package/package.json +5 -4
- package/dist/SelectableInputWrapper-D2aYQb9J.cjs +0 -71
- package/dist/SelectableInputWrapper-DAj8v1nv.js +0 -69
- package/dist/Slide-B4sbGo5D.js +0 -198
- package/dist/Slide-JxJDSGwS.cjs +0 -201
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { c as clsx } from './clsx-ChV9xqsO.js';
|
|
3
|
+
import { createContext, useContext, useState, useEffect, useRef, Children } from 'react';
|
|
4
|
+
import { A as ArrowLeft2Icon } from './ArrowLeft2-BURhvXT2.js';
|
|
5
|
+
import { A as ArrowRight2Icon } from './ArrowRight2-DCxJPvNC.js';
|
|
6
|
+
import Button from './Button/index.js';
|
|
7
|
+
|
|
8
|
+
const sliderContext = createContext({
|
|
9
|
+
slidesPerView: 1,
|
|
10
|
+
spaceBetween: 0
|
|
11
|
+
});
|
|
12
|
+
const useSliderContext = () => useContext(sliderContext);
|
|
13
|
+
|
|
14
|
+
function styleNavigationDot({ active, autoplay, variant }) {
|
|
15
|
+
const variantClassName = {
|
|
16
|
+
inside: "dgs-ui-kit-bg-gray-500/50 hover:dgs-ui-kit-bg-gray-500/80",
|
|
17
|
+
outside: "dgs-ui-kit-bg-gray-200 hover:dgs-ui-kit-bg-gray-300"
|
|
18
|
+
};
|
|
19
|
+
return [
|
|
20
|
+
variantClassName[variant],
|
|
21
|
+
active ? "dgs-ui-kit-w-[22px]" : "dgs-ui-kit-w-[6px]",
|
|
22
|
+
autoplay ? "dgs-ui-kit-p-[1px]" : ""
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
const NavigationDot = (props) => {
|
|
26
|
+
const { active, autoplay, variant, onClick, onNavigateToNext } = props;
|
|
27
|
+
const [fillPercentage, setFillPercentage] = useState(0);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (!active || !autoplay) return;
|
|
30
|
+
const autoplayTime = typeof autoplay === "boolean" ? 7e3 : autoplay?.delay ?? 7e3;
|
|
31
|
+
let startTime = Date.now();
|
|
32
|
+
const autoplayInterval = setInterval(() => {
|
|
33
|
+
const elapsed = Date.now() - startTime;
|
|
34
|
+
const percentage = elapsed / autoplayTime * 100;
|
|
35
|
+
setFillPercentage(Math.min(percentage, 100));
|
|
36
|
+
if (elapsed >= autoplayTime && typeof onNavigateToNext === "function") {
|
|
37
|
+
onNavigateToNext();
|
|
38
|
+
}
|
|
39
|
+
}, 100);
|
|
40
|
+
return function cleanup() {
|
|
41
|
+
setFillPercentage(0);
|
|
42
|
+
startTime = Date.now();
|
|
43
|
+
return clearInterval(autoplayInterval);
|
|
44
|
+
};
|
|
45
|
+
}, [active, autoplay, onNavigateToNext]);
|
|
46
|
+
return /* @__PURE__ */ jsx(
|
|
47
|
+
"button",
|
|
48
|
+
{
|
|
49
|
+
className: clsx(
|
|
50
|
+
"dgs-ui-kit-rounded-full dgs-ui-kit-overflow-hidden dgs-ui-kit-transition-all dgs-ui-kit-h-[6px]",
|
|
51
|
+
styleNavigationDot({ active, autoplay, variant })
|
|
52
|
+
),
|
|
53
|
+
onClick,
|
|
54
|
+
children: active && /* @__PURE__ */ jsx(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
className: clsx("dgs-ui-kit-h-full dgs-ui-kit-rounded-full", {
|
|
58
|
+
"dgs-ui-kit-bg-white": variant === "inside",
|
|
59
|
+
"dgs-ui-kit-bg-gray-700": variant === "outside"
|
|
60
|
+
}),
|
|
61
|
+
style: { width: autoplay ? `${fillPercentage}%` : "100%" }
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const Slider = (props) => {
|
|
69
|
+
const {
|
|
70
|
+
className = "",
|
|
71
|
+
containerClassName = "",
|
|
72
|
+
showNavigationDots = true,
|
|
73
|
+
dotsClassName = "",
|
|
74
|
+
slidesPerView = 1,
|
|
75
|
+
autoplay,
|
|
76
|
+
navigationButtonsShowType = "hide",
|
|
77
|
+
spaceBetween = 0,
|
|
78
|
+
navigationVariant = "outside",
|
|
79
|
+
showPaginationText = false,
|
|
80
|
+
navigationContainerClassName = ""
|
|
81
|
+
} = props;
|
|
82
|
+
const [slideIndex, setSlideIndex] = useState(0);
|
|
83
|
+
const containerRef = useRef(null);
|
|
84
|
+
const childsCount = Children.count(props.children);
|
|
85
|
+
const slidesCount = Math.ceil(childsCount / slidesPerView);
|
|
86
|
+
const haveNavigation = (showNavigationDots || navigationButtonsShowType && navigationButtonsShowType !== "hide" || showPaginationText) && slidesCount > 1;
|
|
87
|
+
function detectCarouselPosition(e) {
|
|
88
|
+
const itemsWidth = e.currentTarget.scrollWidth / slidesCount;
|
|
89
|
+
const position = (e.currentTarget.scrollWidth - e.currentTarget.scrollLeft) / itemsWidth;
|
|
90
|
+
setSlideIndex(Math.round(position % slidesCount));
|
|
91
|
+
}
|
|
92
|
+
function navigate(target) {
|
|
93
|
+
if (!containerRef.current) return;
|
|
94
|
+
const slideWidth = containerRef.current.offsetWidth;
|
|
95
|
+
let nextSlideScroll = -(slideWidth * target);
|
|
96
|
+
if (target < 0) nextSlideScroll = -(slideWidth * slidesCount);
|
|
97
|
+
else if (target >= slidesCount) nextSlideScroll = 0;
|
|
98
|
+
containerRef.current.scrollTo({
|
|
99
|
+
left: nextSlideScroll,
|
|
100
|
+
behavior: "smooth"
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
return /* @__PURE__ */ jsxs(
|
|
104
|
+
"div",
|
|
105
|
+
{
|
|
106
|
+
className: clsx("dgs-ui-kit-overflow-hidden dgs-ui-kit-relative dgs-ui-kit-group", className),
|
|
107
|
+
style: { direction: "rtl" },
|
|
108
|
+
children: [
|
|
109
|
+
/* @__PURE__ */ jsx(
|
|
110
|
+
"div",
|
|
111
|
+
{
|
|
112
|
+
className: clsx(
|
|
113
|
+
"dgs-ui-kit-flex dgs-ui-kit-snap-x dgs-ui-kit-snap-mandatory dgs-ui-kit-overflow-x-auto no-scrollbar",
|
|
114
|
+
containerClassName
|
|
115
|
+
),
|
|
116
|
+
style: { marginLeft: -spaceBetween },
|
|
117
|
+
onScroll: detectCarouselPosition,
|
|
118
|
+
ref: containerRef,
|
|
119
|
+
children: /* @__PURE__ */ jsx(sliderContext.Provider, { value: { slidesPerView, spaceBetween }, children: props.children })
|
|
120
|
+
}
|
|
121
|
+
),
|
|
122
|
+
haveNavigation && /* @__PURE__ */ jsxs(
|
|
123
|
+
"div",
|
|
124
|
+
{
|
|
125
|
+
className: clsx(
|
|
126
|
+
"dgs-ui-kit-flex",
|
|
127
|
+
{
|
|
128
|
+
"dgs-ui-kit-items-center dgs-ui-kit-mt-2": navigationVariant === "outside",
|
|
129
|
+
"dgs-ui-kit-absolute dgs-ui-kit-bottom-4 dgs-ui-kit-w-full dgs-ui-kit-justify-center": navigationVariant === "inside",
|
|
130
|
+
"dgs-ui-kit-justify-between": navigationVariant === "outside" && navigationButtonsShowType !== "hide",
|
|
131
|
+
"dgs-ui-kit-justify-center": navigationVariant === "outside" && navigationButtonsShowType === "hide"
|
|
132
|
+
},
|
|
133
|
+
navigationContainerClassName
|
|
134
|
+
),
|
|
135
|
+
children: [
|
|
136
|
+
navigationButtonsShowType && navigationButtonsShowType !== "hide" && /* @__PURE__ */ jsxs(
|
|
137
|
+
"div",
|
|
138
|
+
{
|
|
139
|
+
className: clsx("dgs-ui-kit-flex dgs-ui-kit-gap-2", {
|
|
140
|
+
"dgs-ui-kit-absolute dgs-ui-kit-bottom-0 dgs-ui-kit-left-[5.5%]": navigationVariant === "inside" && navigationButtonsShowType !== "onSides",
|
|
141
|
+
"dgs-ui-kit-opacity-0 group-hover:dgs-ui-kit-opacity-100 dgs-ui-kit-transition": navigationButtonsShowType === "hover" || navigationButtonsShowType === "onSides",
|
|
142
|
+
"dgs-ui-kit-fixed 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%]": navigationVariant === "inside" && navigationButtonsShowType === "onSides"
|
|
143
|
+
}),
|
|
144
|
+
children: [
|
|
145
|
+
/* @__PURE__ */ jsx(
|
|
146
|
+
Button,
|
|
147
|
+
{
|
|
148
|
+
type: "button",
|
|
149
|
+
variant: "secondary",
|
|
150
|
+
onClick: () => navigate(slideIndex - 1),
|
|
151
|
+
rightIcon: /* @__PURE__ */ jsx(ArrowRight2Icon, {})
|
|
152
|
+
}
|
|
153
|
+
),
|
|
154
|
+
/* @__PURE__ */ jsx(
|
|
155
|
+
Button,
|
|
156
|
+
{
|
|
157
|
+
type: "button",
|
|
158
|
+
variant: "secondary",
|
|
159
|
+
onClick: () => navigate(slideIndex + 1),
|
|
160
|
+
rightIcon: /* @__PURE__ */ jsx(ArrowLeft2Icon, {})
|
|
161
|
+
}
|
|
162
|
+
)
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
),
|
|
166
|
+
(showNavigationDots || showPaginationText) && /* @__PURE__ */ jsxs("div", { className: "dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-3", children: [
|
|
167
|
+
showPaginationText && /* @__PURE__ */ 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: [
|
|
168
|
+
/* @__PURE__ */ jsx(
|
|
169
|
+
"span",
|
|
170
|
+
{
|
|
171
|
+
className: clsx("dgs-ui-kit-font-bold", {
|
|
172
|
+
"dgs-ui-kit-text-gray-600": navigationVariant === "outside",
|
|
173
|
+
"dgs-ui-kit-text-white": navigationVariant === "inside"
|
|
174
|
+
}),
|
|
175
|
+
children: slideIndex + 1
|
|
176
|
+
}
|
|
177
|
+
),
|
|
178
|
+
/* @__PURE__ */ jsx("span", { children: "از" }),
|
|
179
|
+
/* @__PURE__ */ jsx("span", { children: slidesCount })
|
|
180
|
+
] }),
|
|
181
|
+
showNavigationDots && /* @__PURE__ */ jsx(
|
|
182
|
+
"div",
|
|
183
|
+
{
|
|
184
|
+
className: clsx(
|
|
185
|
+
"dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-justify-center dgs-ui-kit-gap-2",
|
|
186
|
+
dotsClassName
|
|
187
|
+
),
|
|
188
|
+
children: Array.from(Array(slidesCount).keys()).map((item, index) => /* @__PURE__ */ jsx(
|
|
189
|
+
NavigationDot,
|
|
190
|
+
{
|
|
191
|
+
active: slideIndex === index,
|
|
192
|
+
autoplay: autoplay ?? false,
|
|
193
|
+
variant: navigationVariant,
|
|
194
|
+
onClick: () => navigate(index),
|
|
195
|
+
onNavigateToNext: () => navigate(slideIndex + 1)
|
|
196
|
+
},
|
|
197
|
+
item + slidesCount
|
|
198
|
+
))
|
|
199
|
+
}
|
|
200
|
+
)
|
|
201
|
+
] })
|
|
202
|
+
]
|
|
203
|
+
}
|
|
204
|
+
)
|
|
205
|
+
]
|
|
206
|
+
}
|
|
207
|
+
);
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
const Slide = (props) => {
|
|
211
|
+
const { children, className } = props;
|
|
212
|
+
const { slidesPerView, spaceBetween } = useSliderContext();
|
|
213
|
+
const ref = useRef(null);
|
|
214
|
+
const [childIndex, setChildIndex] = useState(0);
|
|
215
|
+
useEffect(() => {
|
|
216
|
+
if (!ref.current) return;
|
|
217
|
+
setChildIndex(Array.prototype.indexOf.call(ref.current.parentNode?.children, ref.current));
|
|
218
|
+
}, [ref]);
|
|
219
|
+
return /* @__PURE__ */ jsx(
|
|
220
|
+
"div",
|
|
221
|
+
{
|
|
222
|
+
ref,
|
|
223
|
+
className: clsx("dgs-ui-kit-shrink-0 dgs-ui-kit-snap-always", className),
|
|
224
|
+
style: {
|
|
225
|
+
width: 100 / (slidesPerView ?? 1) + "%",
|
|
226
|
+
paddingLeft: spaceBetween,
|
|
227
|
+
scrollSnapAlign: childIndex % slidesPerView === 0 ? "start" : "none"
|
|
228
|
+
},
|
|
229
|
+
children
|
|
230
|
+
}
|
|
231
|
+
);
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
export { Slider as S, Slide as a };
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
const clsx = require('./clsx-BtxeOLZW.cjs');
|
|
5
|
+
const react = require('react');
|
|
6
|
+
const ArrowLeft2 = require('./ArrowLeft2-iZ0Au6Fn.cjs');
|
|
7
|
+
const ArrowRight2 = require('./ArrowRight2-DTuru_sP.cjs');
|
|
8
|
+
const Button = require('./Button/index.cjs');
|
|
9
|
+
|
|
10
|
+
const sliderContext = react.createContext({
|
|
11
|
+
slidesPerView: 1,
|
|
12
|
+
spaceBetween: 0
|
|
13
|
+
});
|
|
14
|
+
const useSliderContext = () => react.useContext(sliderContext);
|
|
15
|
+
|
|
16
|
+
function styleNavigationDot({ active, autoplay, variant }) {
|
|
17
|
+
const variantClassName = {
|
|
18
|
+
inside: "dgs-ui-kit-bg-gray-500/50 hover:dgs-ui-kit-bg-gray-500/80",
|
|
19
|
+
outside: "dgs-ui-kit-bg-gray-200 hover:dgs-ui-kit-bg-gray-300"
|
|
20
|
+
};
|
|
21
|
+
return [
|
|
22
|
+
variantClassName[variant],
|
|
23
|
+
active ? "dgs-ui-kit-w-[22px]" : "dgs-ui-kit-w-[6px]",
|
|
24
|
+
autoplay ? "dgs-ui-kit-p-[1px]" : ""
|
|
25
|
+
];
|
|
26
|
+
}
|
|
27
|
+
const NavigationDot = (props) => {
|
|
28
|
+
const { active, autoplay, variant, onClick, onNavigateToNext } = props;
|
|
29
|
+
const [fillPercentage, setFillPercentage] = react.useState(0);
|
|
30
|
+
react.useEffect(() => {
|
|
31
|
+
if (!active || !autoplay) return;
|
|
32
|
+
const autoplayTime = typeof autoplay === "boolean" ? 7e3 : autoplay?.delay ?? 7e3;
|
|
33
|
+
let startTime = Date.now();
|
|
34
|
+
const autoplayInterval = setInterval(() => {
|
|
35
|
+
const elapsed = Date.now() - startTime;
|
|
36
|
+
const percentage = elapsed / autoplayTime * 100;
|
|
37
|
+
setFillPercentage(Math.min(percentage, 100));
|
|
38
|
+
if (elapsed >= autoplayTime && typeof onNavigateToNext === "function") {
|
|
39
|
+
onNavigateToNext();
|
|
40
|
+
}
|
|
41
|
+
}, 100);
|
|
42
|
+
return function cleanup() {
|
|
43
|
+
setFillPercentage(0);
|
|
44
|
+
startTime = Date.now();
|
|
45
|
+
return clearInterval(autoplayInterval);
|
|
46
|
+
};
|
|
47
|
+
}, [active, autoplay, onNavigateToNext]);
|
|
48
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
49
|
+
"button",
|
|
50
|
+
{
|
|
51
|
+
className: clsx.clsx(
|
|
52
|
+
"dgs-ui-kit-rounded-full dgs-ui-kit-overflow-hidden dgs-ui-kit-transition-all dgs-ui-kit-h-[6px]",
|
|
53
|
+
styleNavigationDot({ active, autoplay, variant })
|
|
54
|
+
),
|
|
55
|
+
onClick,
|
|
56
|
+
children: active && /* @__PURE__ */ jsxRuntime.jsx(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
className: clsx.clsx("dgs-ui-kit-h-full dgs-ui-kit-rounded-full", {
|
|
60
|
+
"dgs-ui-kit-bg-white": variant === "inside",
|
|
61
|
+
"dgs-ui-kit-bg-gray-700": variant === "outside"
|
|
62
|
+
}),
|
|
63
|
+
style: { width: autoplay ? `${fillPercentage}%` : "100%" }
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const Slider = (props) => {
|
|
71
|
+
const {
|
|
72
|
+
className = "",
|
|
73
|
+
containerClassName = "",
|
|
74
|
+
showNavigationDots = true,
|
|
75
|
+
dotsClassName = "",
|
|
76
|
+
slidesPerView = 1,
|
|
77
|
+
autoplay,
|
|
78
|
+
navigationButtonsShowType = "hide",
|
|
79
|
+
spaceBetween = 0,
|
|
80
|
+
navigationVariant = "outside",
|
|
81
|
+
showPaginationText = false,
|
|
82
|
+
navigationContainerClassName = ""
|
|
83
|
+
} = props;
|
|
84
|
+
const [slideIndex, setSlideIndex] = react.useState(0);
|
|
85
|
+
const containerRef = react.useRef(null);
|
|
86
|
+
const childsCount = react.Children.count(props.children);
|
|
87
|
+
const slidesCount = Math.ceil(childsCount / slidesPerView);
|
|
88
|
+
const haveNavigation = (showNavigationDots || navigationButtonsShowType && navigationButtonsShowType !== "hide" || showPaginationText) && slidesCount > 1;
|
|
89
|
+
function detectCarouselPosition(e) {
|
|
90
|
+
const itemsWidth = e.currentTarget.scrollWidth / slidesCount;
|
|
91
|
+
const position = (e.currentTarget.scrollWidth - e.currentTarget.scrollLeft) / itemsWidth;
|
|
92
|
+
setSlideIndex(Math.round(position % slidesCount));
|
|
93
|
+
}
|
|
94
|
+
function navigate(target) {
|
|
95
|
+
if (!containerRef.current) return;
|
|
96
|
+
const slideWidth = containerRef.current.offsetWidth;
|
|
97
|
+
let nextSlideScroll = -(slideWidth * target);
|
|
98
|
+
if (target < 0) nextSlideScroll = -(slideWidth * slidesCount);
|
|
99
|
+
else if (target >= slidesCount) nextSlideScroll = 0;
|
|
100
|
+
containerRef.current.scrollTo({
|
|
101
|
+
left: nextSlideScroll,
|
|
102
|
+
behavior: "smooth"
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
106
|
+
"div",
|
|
107
|
+
{
|
|
108
|
+
className: clsx.clsx("dgs-ui-kit-overflow-hidden dgs-ui-kit-relative dgs-ui-kit-group", className),
|
|
109
|
+
style: { direction: "rtl" },
|
|
110
|
+
children: [
|
|
111
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
112
|
+
"div",
|
|
113
|
+
{
|
|
114
|
+
className: clsx.clsx(
|
|
115
|
+
"dgs-ui-kit-flex dgs-ui-kit-snap-x dgs-ui-kit-snap-mandatory dgs-ui-kit-overflow-x-auto no-scrollbar",
|
|
116
|
+
containerClassName
|
|
117
|
+
),
|
|
118
|
+
style: { marginLeft: -spaceBetween },
|
|
119
|
+
onScroll: detectCarouselPosition,
|
|
120
|
+
ref: containerRef,
|
|
121
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(sliderContext.Provider, { value: { slidesPerView, spaceBetween }, children: props.children })
|
|
122
|
+
}
|
|
123
|
+
),
|
|
124
|
+
haveNavigation && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
125
|
+
"div",
|
|
126
|
+
{
|
|
127
|
+
className: clsx.clsx(
|
|
128
|
+
"dgs-ui-kit-flex",
|
|
129
|
+
{
|
|
130
|
+
"dgs-ui-kit-items-center dgs-ui-kit-mt-2": navigationVariant === "outside",
|
|
131
|
+
"dgs-ui-kit-absolute dgs-ui-kit-bottom-4 dgs-ui-kit-w-full dgs-ui-kit-justify-center": navigationVariant === "inside",
|
|
132
|
+
"dgs-ui-kit-justify-between": navigationVariant === "outside" && navigationButtonsShowType !== "hide",
|
|
133
|
+
"dgs-ui-kit-justify-center": navigationVariant === "outside" && navigationButtonsShowType === "hide"
|
|
134
|
+
},
|
|
135
|
+
navigationContainerClassName
|
|
136
|
+
),
|
|
137
|
+
children: [
|
|
138
|
+
navigationButtonsShowType && navigationButtonsShowType !== "hide" && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
139
|
+
"div",
|
|
140
|
+
{
|
|
141
|
+
className: clsx.clsx("dgs-ui-kit-flex dgs-ui-kit-gap-2", {
|
|
142
|
+
"dgs-ui-kit-absolute dgs-ui-kit-bottom-0 dgs-ui-kit-left-[5.5%]": navigationVariant === "inside" && navigationButtonsShowType !== "onSides",
|
|
143
|
+
"dgs-ui-kit-opacity-0 group-hover:dgs-ui-kit-opacity-100 dgs-ui-kit-transition": navigationButtonsShowType === "hover" || navigationButtonsShowType === "onSides",
|
|
144
|
+
"dgs-ui-kit-fixed 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%]": navigationVariant === "inside" && navigationButtonsShowType === "onSides"
|
|
145
|
+
}),
|
|
146
|
+
children: [
|
|
147
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
148
|
+
Button,
|
|
149
|
+
{
|
|
150
|
+
type: "button",
|
|
151
|
+
variant: "secondary",
|
|
152
|
+
onClick: () => navigate(slideIndex - 1),
|
|
153
|
+
rightIcon: /* @__PURE__ */ jsxRuntime.jsx(ArrowRight2.ArrowRight2Icon, {})
|
|
154
|
+
}
|
|
155
|
+
),
|
|
156
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
157
|
+
Button,
|
|
158
|
+
{
|
|
159
|
+
type: "button",
|
|
160
|
+
variant: "secondary",
|
|
161
|
+
onClick: () => navigate(slideIndex + 1),
|
|
162
|
+
rightIcon: /* @__PURE__ */ jsxRuntime.jsx(ArrowLeft2.ArrowLeft2Icon, {})
|
|
163
|
+
}
|
|
164
|
+
)
|
|
165
|
+
]
|
|
166
|
+
}
|
|
167
|
+
),
|
|
168
|
+
(showNavigationDots || showPaginationText) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-3", children: [
|
|
169
|
+
showPaginationText && /* @__PURE__ */ jsxRuntime.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: [
|
|
170
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
171
|
+
"span",
|
|
172
|
+
{
|
|
173
|
+
className: clsx.clsx("dgs-ui-kit-font-bold", {
|
|
174
|
+
"dgs-ui-kit-text-gray-600": navigationVariant === "outside",
|
|
175
|
+
"dgs-ui-kit-text-white": navigationVariant === "inside"
|
|
176
|
+
}),
|
|
177
|
+
children: slideIndex + 1
|
|
178
|
+
}
|
|
179
|
+
),
|
|
180
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "از" }),
|
|
181
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: slidesCount })
|
|
182
|
+
] }),
|
|
183
|
+
showNavigationDots && /* @__PURE__ */ jsxRuntime.jsx(
|
|
184
|
+
"div",
|
|
185
|
+
{
|
|
186
|
+
className: clsx.clsx(
|
|
187
|
+
"dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-justify-center dgs-ui-kit-gap-2",
|
|
188
|
+
dotsClassName
|
|
189
|
+
),
|
|
190
|
+
children: Array.from(Array(slidesCount).keys()).map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
191
|
+
NavigationDot,
|
|
192
|
+
{
|
|
193
|
+
active: slideIndex === index,
|
|
194
|
+
autoplay: autoplay ?? false,
|
|
195
|
+
variant: navigationVariant,
|
|
196
|
+
onClick: () => navigate(index),
|
|
197
|
+
onNavigateToNext: () => navigate(slideIndex + 1)
|
|
198
|
+
},
|
|
199
|
+
item + slidesCount
|
|
200
|
+
))
|
|
201
|
+
}
|
|
202
|
+
)
|
|
203
|
+
] })
|
|
204
|
+
]
|
|
205
|
+
}
|
|
206
|
+
)
|
|
207
|
+
]
|
|
208
|
+
}
|
|
209
|
+
);
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
const Slide = (props) => {
|
|
213
|
+
const { children, className } = props;
|
|
214
|
+
const { slidesPerView, spaceBetween } = useSliderContext();
|
|
215
|
+
const ref = react.useRef(null);
|
|
216
|
+
const [childIndex, setChildIndex] = react.useState(0);
|
|
217
|
+
react.useEffect(() => {
|
|
218
|
+
if (!ref.current) return;
|
|
219
|
+
setChildIndex(Array.prototype.indexOf.call(ref.current.parentNode?.children, ref.current));
|
|
220
|
+
}, [ref]);
|
|
221
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
222
|
+
"div",
|
|
223
|
+
{
|
|
224
|
+
ref,
|
|
225
|
+
className: clsx.clsx("dgs-ui-kit-shrink-0 dgs-ui-kit-snap-always", className),
|
|
226
|
+
style: {
|
|
227
|
+
width: 100 / (slidesPerView ?? 1) + "%",
|
|
228
|
+
paddingLeft: spaceBetween,
|
|
229
|
+
scrollSnapAlign: childIndex % slidesPerView === 0 ? "start" : "none"
|
|
230
|
+
},
|
|
231
|
+
children
|
|
232
|
+
}
|
|
233
|
+
);
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
exports.Slide = Slide;
|
|
237
|
+
exports.Slider = Slider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationDot.d.ts","sourceRoot":"","sources":["../../src/components/Slider/NavigationDot.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,UAAU,kBAAkB;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC,UAAU,CAAC,CAAC;IAC5C,OAAO,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B;
|
|
1
|
+
{"version":3,"file":"NavigationDot.d.ts","sourceRoot":"","sources":["../../src/components/Slider/NavigationDot.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,UAAU,kBAAkB;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC,UAAU,CAAC,CAAC;IAC5C,OAAO,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B;AAeD,QAAA,MAAM,aAAa,UAAW,kBAAkB,4CA6C/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slide.d.ts","sourceRoot":"","sources":["../../src/components/Slider/Slide.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"Slide.d.ts","sourceRoot":"","sources":["../../src/components/Slider/Slide.tsx"],"names":[],"mappings":"AACA,OAAO,EAA+B,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAGrF,UAAU,UAAU;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AACD,QAAA,MAAM,KAAK,EAAE,EAAE,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAwB5C,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
package/dist/Slider/Slider.d.ts
CHANGED
|
@@ -10,10 +10,11 @@ interface SliderPropsBase {
|
|
|
10
10
|
};
|
|
11
11
|
spaceBetween?: number;
|
|
12
12
|
showPaginationText?: boolean;
|
|
13
|
+
navigationContainerClassName?: string;
|
|
13
14
|
}
|
|
14
15
|
interface InsideNavigationSliderProps extends SliderPropsBase {
|
|
15
16
|
navigationVariant?: 'inside';
|
|
16
|
-
navigationButtonsShowType?: 'hide' | 'hover' | 'permanent';
|
|
17
|
+
navigationButtonsShowType?: 'hide' | 'hover' | 'permanent' | 'onSides';
|
|
17
18
|
}
|
|
18
19
|
interface OutsideNavigationSliderProps extends SliderPropsBase {
|
|
19
20
|
navigationVariant?: 'outside';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../../src/components/Slider/Slider.tsx"],"names":[],"mappings":"AACA,OAAO,EAA8B,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAgB,MAAM,OAAO,CAAC;AAOlG,UAAU,eAAe;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EACL,OAAO,GACP;QACE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KACvB,CAAC;IACN,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../../src/components/Slider/Slider.tsx"],"names":[],"mappings":"AACA,OAAO,EAA8B,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAgB,MAAM,OAAO,CAAC;AAOlG,UAAU,eAAe;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EACL,OAAO,GACP;QACE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KACvB,CAAC;IACN,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,4BAA4B,CAAC,EAAE,MAAM,CAAC;CACvC;AAED,UAAU,2BAA4B,SAAQ,eAAe;IAC3D,iBAAiB,CAAC,EAAE,QAAQ,CAAC;IAC7B,yBAAyB,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,WAAW,GAAG,SAAS,CAAC;CACxE;AACD,UAAU,4BAA6B,SAAQ,eAAe;IAC5D,iBAAiB,CAAC,EAAE,SAAS,CAAC;IAC9B,yBAAyB,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;CAClD;AAED,MAAM,MAAM,WAAW,GAAG,2BAA2B,GAAG,4BAA4B,CAAC;AAErF,QAAA,MAAM,MAAM,EAAE,EAAE,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAiJ9C,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/dist/Slider/index.cjs
CHANGED
package/dist/Slider/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '../assets/styles.css';/* empty css */
|
|
2
|
-
export { a as Slide, S as Slider } from '../Slide-
|
|
2
|
+
export { a as Slide, S as Slider } from '../Slide-BhWFQV8r.js';
|
|
@@ -43,16 +43,16 @@ const FieldBottomInfo = (props) => {
|
|
|
43
43
|
"div",
|
|
44
44
|
{
|
|
45
45
|
className: clsx(
|
|
46
|
-
"flex font-p3-regular",
|
|
46
|
+
"dgs-ui-kit-flex dgs-ui-kit-font-p3-regular",
|
|
47
47
|
{
|
|
48
|
-
"justify-between": (errorMessage || hintMessage) && maxLength,
|
|
49
|
-
"justify-start": (errorMessage || hintMessage) && !maxLength,
|
|
50
|
-
"justify-end": !(errorMessage || hintMessage) && maxLength
|
|
48
|
+
"dgs-ui-kit-justify-between": (errorMessage || hintMessage) && maxLength,
|
|
49
|
+
"dgs-ui-kit-justify-start": (errorMessage || hintMessage) && !maxLength,
|
|
50
|
+
"dgs-ui-kit-justify-end": !(errorMessage || hintMessage) && maxLength
|
|
51
51
|
},
|
|
52
|
-
errorMessage ? "text-error-500" : "text-gray-500"
|
|
52
|
+
errorMessage ? "dgs-ui-kit-text-error-500" : "dgs-ui-kit-text-gray-500"
|
|
53
53
|
),
|
|
54
54
|
children: [
|
|
55
|
-
(errorMessage || hintMessage) && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
55
|
+
(errorMessage || hintMessage) && /* @__PURE__ */ jsxs("div", { className: "dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-2", children: [
|
|
56
56
|
/* @__PURE__ */ jsx(
|
|
57
57
|
InfoCircleOutlineIcon,
|
|
58
58
|
{
|
|
@@ -80,21 +80,21 @@ const FieldLabel = (props) => {
|
|
|
80
80
|
return /* @__PURE__ */ jsxs(
|
|
81
81
|
"div",
|
|
82
82
|
{
|
|
83
|
-
className: clsx("flex mb-2", {
|
|
84
|
-
"justify-between": labelContent && link?.href,
|
|
85
|
-
"justify-start": labelContent && !link?.href,
|
|
86
|
-
"justify-end": !labelContent && link?.href
|
|
83
|
+
className: clsx("dgs-ui-kit-flex dgs-ui-kit-mb-2", {
|
|
84
|
+
"dgs-ui-kit-justify-between": labelContent && link?.href,
|
|
85
|
+
"dgs-ui-kit-justify-start": labelContent && !link?.href,
|
|
86
|
+
"dgs-ui-kit-justify-end": !labelContent && link?.href
|
|
87
87
|
}),
|
|
88
88
|
children: [
|
|
89
|
-
labelContent && /* @__PURE__ */ jsxs("label", { className: "px-0 text-sm font-bold text-right md:mx-0", children: [
|
|
89
|
+
labelContent && /* @__PURE__ */ jsxs("label", { className: "dgs-ui-kit-px-0 dgs-ui-kit-text-sm dgs-ui-kit-font-bold dgs-ui-kit-text-right md:dgs-ui-kit-mx-0", children: [
|
|
90
90
|
labelContent,
|
|
91
|
-
required && /* @__PURE__ */ jsx("span", { className: "ms-2 text-error-500", children: "*" })
|
|
91
|
+
required && /* @__PURE__ */ jsx("span", { className: "dgs-ui-kit-ms-2 dgs-ui-kit-text-error-500", children: "*" })
|
|
92
92
|
] }),
|
|
93
93
|
link?.href && /* @__PURE__ */ jsx(
|
|
94
94
|
"a",
|
|
95
95
|
{
|
|
96
96
|
href: link.href,
|
|
97
|
-
className: "font-button-small text-primary-400",
|
|
97
|
+
className: "dgs-ui-kit-font-button-small dgs-ui-kit-text-primary-400",
|
|
98
98
|
children: link.cnotent
|
|
99
99
|
}
|
|
100
100
|
)
|
|
@@ -142,12 +142,12 @@ const TextFieldWrapper = (props) => {
|
|
|
142
142
|
"div",
|
|
143
143
|
{
|
|
144
144
|
className: clsx(
|
|
145
|
-
"relative cursor-text border border-solid rounded-lg ring-4 flex justify-between gap-x-3 p-3 bg-gray-100 transition-all ring-transparent hover:ring-gray-50 has-[:focus]:bg-white",
|
|
146
|
-
isError || errorMessage ? "border-error-500 has-[:focus]:ring-error-50" : "border-transparent hover:border-gray-300 has-[:focus]:border-primary-500 has-[:focus]:ring-primary-50",
|
|
145
|
+
"dgs-ui-kit-relative dgs-ui-kit-cursor-text dgs-ui-kit-border dgs-ui-kit-border-solid dgs-ui-kit-rounded-lg dgs-ui-kit-ring-4 dgs-ui-kit-flex dgs-ui-kit-justify-between dgs-ui-kit-gap-x-3 dgs-ui-kit-p-3 dgs-ui-kit-bg-gray-100 dgs-ui-kit-transition-all dgs-ui-kit-ring-transparent hover:dgs-ui-kit-ring-gray-50 has-[:focus]:dgs-ui-kit-bg-white",
|
|
146
|
+
isError || errorMessage ? "dgs-ui-kit-border-error-500 has-[:focus]:dgs-ui-kit-ring-error-50" : "dgs-ui-kit-border-transparent hover:dgs-ui-kit-border-gray-300 has-[:focus]:dgs-ui-kit-border-primary-500 has-[:focus]:dgs-ui-kit-ring-primary-50",
|
|
147
147
|
containerClassName
|
|
148
148
|
),
|
|
149
149
|
children: [
|
|
150
|
-
rightIcon && /* @__PURE__ */ jsx("div", { className: "text-gray-600", children: rightIcon }),
|
|
150
|
+
rightIcon && /* @__PURE__ */ jsx("div", { className: "dgs-ui-kit-text-gray-600", children: rightIcon }),
|
|
151
151
|
children({ handleChangeField, setValue, value })
|
|
152
152
|
]
|
|
153
153
|
}
|
|
@@ -45,16 +45,16 @@ const FieldBottomInfo = (props) => {
|
|
|
45
45
|
"div",
|
|
46
46
|
{
|
|
47
47
|
className: clsx.clsx(
|
|
48
|
-
"flex font-p3-regular",
|
|
48
|
+
"dgs-ui-kit-flex dgs-ui-kit-font-p3-regular",
|
|
49
49
|
{
|
|
50
|
-
"justify-between": (errorMessage || hintMessage) && maxLength,
|
|
51
|
-
"justify-start": (errorMessage || hintMessage) && !maxLength,
|
|
52
|
-
"justify-end": !(errorMessage || hintMessage) && maxLength
|
|
50
|
+
"dgs-ui-kit-justify-between": (errorMessage || hintMessage) && maxLength,
|
|
51
|
+
"dgs-ui-kit-justify-start": (errorMessage || hintMessage) && !maxLength,
|
|
52
|
+
"dgs-ui-kit-justify-end": !(errorMessage || hintMessage) && maxLength
|
|
53
53
|
},
|
|
54
|
-
errorMessage ? "text-error-500" : "text-gray-500"
|
|
54
|
+
errorMessage ? "dgs-ui-kit-text-error-500" : "dgs-ui-kit-text-gray-500"
|
|
55
55
|
),
|
|
56
56
|
children: [
|
|
57
|
-
(errorMessage || hintMessage) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
57
|
+
(errorMessage || hintMessage) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-gap-2", children: [
|
|
58
58
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
59
59
|
InfoCircleOutlineIcon,
|
|
60
60
|
{
|
|
@@ -82,21 +82,21 @@ const FieldLabel = (props) => {
|
|
|
82
82
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
83
83
|
"div",
|
|
84
84
|
{
|
|
85
|
-
className: clsx.clsx("flex mb-2", {
|
|
86
|
-
"justify-between": labelContent && link?.href,
|
|
87
|
-
"justify-start": labelContent && !link?.href,
|
|
88
|
-
"justify-end": !labelContent && link?.href
|
|
85
|
+
className: clsx.clsx("dgs-ui-kit-flex dgs-ui-kit-mb-2", {
|
|
86
|
+
"dgs-ui-kit-justify-between": labelContent && link?.href,
|
|
87
|
+
"dgs-ui-kit-justify-start": labelContent && !link?.href,
|
|
88
|
+
"dgs-ui-kit-justify-end": !labelContent && link?.href
|
|
89
89
|
}),
|
|
90
90
|
children: [
|
|
91
|
-
labelContent && /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "px-0 text-sm font-bold text-right md:mx-0", children: [
|
|
91
|
+
labelContent && /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "dgs-ui-kit-px-0 dgs-ui-kit-text-sm dgs-ui-kit-font-bold dgs-ui-kit-text-right md:dgs-ui-kit-mx-0", children: [
|
|
92
92
|
labelContent,
|
|
93
|
-
required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ms-2 text-error-500", children: "*" })
|
|
93
|
+
required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "dgs-ui-kit-ms-2 dgs-ui-kit-text-error-500", children: "*" })
|
|
94
94
|
] }),
|
|
95
95
|
link?.href && /* @__PURE__ */ jsxRuntime.jsx(
|
|
96
96
|
"a",
|
|
97
97
|
{
|
|
98
98
|
href: link.href,
|
|
99
|
-
className: "font-button-small text-primary-400",
|
|
99
|
+
className: "dgs-ui-kit-font-button-small dgs-ui-kit-text-primary-400",
|
|
100
100
|
children: link.cnotent
|
|
101
101
|
}
|
|
102
102
|
)
|
|
@@ -144,12 +144,12 @@ const TextFieldWrapper = (props) => {
|
|
|
144
144
|
"div",
|
|
145
145
|
{
|
|
146
146
|
className: clsx.clsx(
|
|
147
|
-
"relative cursor-text border border-solid rounded-lg ring-4 flex justify-between gap-x-3 p-3 bg-gray-100 transition-all ring-transparent hover:ring-gray-50 has-[:focus]:bg-white",
|
|
148
|
-
isError || errorMessage ? "border-error-500 has-[:focus]:ring-error-50" : "border-transparent hover:border-gray-300 has-[:focus]:border-primary-500 has-[:focus]:ring-primary-50",
|
|
147
|
+
"dgs-ui-kit-relative dgs-ui-kit-cursor-text dgs-ui-kit-border dgs-ui-kit-border-solid dgs-ui-kit-rounded-lg dgs-ui-kit-ring-4 dgs-ui-kit-flex dgs-ui-kit-justify-between dgs-ui-kit-gap-x-3 dgs-ui-kit-p-3 dgs-ui-kit-bg-gray-100 dgs-ui-kit-transition-all dgs-ui-kit-ring-transparent hover:dgs-ui-kit-ring-gray-50 has-[:focus]:dgs-ui-kit-bg-white",
|
|
148
|
+
isError || errorMessage ? "dgs-ui-kit-border-error-500 has-[:focus]:dgs-ui-kit-ring-error-50" : "dgs-ui-kit-border-transparent hover:dgs-ui-kit-border-gray-300 has-[:focus]:dgs-ui-kit-border-primary-500 has-[:focus]:dgs-ui-kit-ring-primary-50",
|
|
149
149
|
containerClassName
|
|
150
150
|
),
|
|
151
151
|
children: [
|
|
152
|
-
rightIcon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-600", children: rightIcon }),
|
|
152
|
+
rightIcon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "dgs-ui-kit-text-gray-600", children: rightIcon }),
|
|
153
153
|
children({ handleChangeField, setValue, value })
|
|
154
154
|
]
|
|
155
155
|
}
|