@janbox/storefront-ui 2.0.27 → 2.0.29
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/hooks/index.d.ts +0 -1
- package/dist/hooks/index.js +0 -2
- package/dist/index.js +2 -0
- package/dist/lib/box/box.js +5 -21
- package/dist/lib/button/button.js +69 -80
- package/dist/lib/flexbox/flexbox/flexbox.d.ts +1 -1
- package/dist/lib/flexbox/flexbox/flexbox.js +16 -20
- package/dist/lib/grid/grid/grid.d.ts +1 -1
- package/dist/lib/grid/grid/grid.js +20 -25
- package/dist/lib/icon-button/icon-button.js +5 -9
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/input/input.js +155 -101
- package/dist/lib/input-range/input-range.d.ts +1 -1
- package/dist/lib/input-range/input-range.js +119 -95
- package/dist/lib/input-range/types.d.ts +3 -2
- package/dist/lib/ripple-effect/index.d.ts +2 -0
- package/dist/lib/ripple-effect/ripple-effect.d.ts +3 -0
- package/dist/lib/ripple-effect/ripple-effect.js +75 -0
- package/dist/{hooks/use-ripple-effect/index.d.ts → lib/ripple-effect/types.d.ts} +1 -6
- package/dist/lib/table/table-row/table-row.d.ts +1 -1
- package/dist/lib/table/table-row/table-row.js +4 -4
- package/dist/lib/table/table-row/types.d.ts +2 -2
- package/dist/lib/unordered-list/list-item/list-item.d.ts +1 -1
- package/dist/lib/unordered-list/list-item/list-item.js +8 -10
- package/dist/lib/unordered-list/list-item/types.d.ts +2 -2
- package/dist/style.css +1 -96
- package/package.json +1 -1
- package/dist/hooks/use-ripple-effect/index.js +0 -69
- package/dist/hooks/use-ripple-effect/use-ripple-effect.module.scss.js +0 -11
- package/dist/lib/input/input.module.scss.js +0 -17
- package/dist/lib/input-range/input-range.module.scss.js +0 -8
package/dist/lib/input/input.js
CHANGED
|
@@ -3,13 +3,11 @@ import { useRef, useState } from "react";
|
|
|
3
3
|
import { useMergeRefs } from "@floating-ui/react";
|
|
4
4
|
import { isString } from "lodash-es";
|
|
5
5
|
import { getInputProps } from "./helpers.js";
|
|
6
|
-
import classes from "./input.module.scss.js";
|
|
7
6
|
import EyeHidden from "../../assets/svg/eye-hidden.svg.js";
|
|
8
7
|
import EyeVisible from "../../assets/svg/eye-show-visible.svg.js";
|
|
9
8
|
import { getSizeVariantState } from "../../utils/index.js";
|
|
10
|
-
import "../../theme/palette.js";
|
|
9
|
+
import { getColorVar } from "../../theme/palette.js";
|
|
11
10
|
import { getTypographyVar } from "../../theme/typography.js";
|
|
12
|
-
import { clsx } from "clsx";
|
|
13
11
|
import { FormHelperText } from "../form-helper-text/form-helper-text.js";
|
|
14
12
|
import { Primitive } from "../primitive/primitive.js";
|
|
15
13
|
import { Icon } from "../icon/icon.js";
|
|
@@ -25,7 +23,6 @@ const Input = ({ ref, ..._props }) => {
|
|
|
25
23
|
suffix,
|
|
26
24
|
containerProps,
|
|
27
25
|
mainProps,
|
|
28
|
-
className,
|
|
29
26
|
helperText,
|
|
30
27
|
error,
|
|
31
28
|
startIcon,
|
|
@@ -91,113 +88,170 @@ const Input = ({ ref, ..._props }) => {
|
|
|
91
88
|
e.stopPropagation();
|
|
92
89
|
setShowPassword((prev) => !prev);
|
|
93
90
|
};
|
|
94
|
-
return /* @__PURE__ */ jsxs(
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
91
|
+
return /* @__PURE__ */ jsxs(
|
|
92
|
+
Primitive,
|
|
93
|
+
{
|
|
94
|
+
...containerProps,
|
|
95
|
+
sx: {
|
|
96
|
+
position: "relative",
|
|
97
|
+
display: "flex",
|
|
98
|
+
flexDirection: "column",
|
|
99
|
+
width: "100%",
|
|
100
|
+
...containerProps == null ? void 0 : containerProps.sx
|
|
101
|
+
},
|
|
102
|
+
children: [
|
|
103
|
+
/* @__PURE__ */ jsxs(
|
|
104
|
+
Primitive,
|
|
101
105
|
{
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
...(_b = mainProps == null ? void 0 : mainProps.sx) == null ? void 0 : _b.md
|
|
116
|
-
},
|
|
117
|
-
lg: {
|
|
118
|
-
...createStyle(lg),
|
|
119
|
-
...(_c = mainProps == null ? void 0 : mainProps.sx) == null ? void 0 : _c.lg
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
children: [
|
|
123
|
-
prefix,
|
|
124
|
-
!!startIcon && /* @__PURE__ */ jsx(
|
|
125
|
-
Icon,
|
|
126
|
-
{
|
|
127
|
-
size: getSizeVariantState(size).iconSize,
|
|
128
|
-
...startIcon,
|
|
129
|
-
sm: {
|
|
130
|
-
size: getSizeVariantState(sm == null ? void 0 : sm.size).iconSize,
|
|
131
|
-
...startIcon.sm
|
|
106
|
+
...mainProps,
|
|
107
|
+
sx: {
|
|
108
|
+
width: "100%",
|
|
109
|
+
display: "flex",
|
|
110
|
+
overflow: "hidden",
|
|
111
|
+
alignItems: "center",
|
|
112
|
+
gap: 8,
|
|
113
|
+
borderRadius: 8,
|
|
114
|
+
borderWidth: 1,
|
|
115
|
+
borderStyle: "solid",
|
|
116
|
+
backgroundColor: getColorVar("surface.default"),
|
|
117
|
+
"&:hover": {
|
|
118
|
+
borderColor: getColorVar("primary.300")
|
|
132
119
|
},
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
120
|
+
"&:has(input:focus:not(:read-only))": {
|
|
121
|
+
borderColor: getColorVar("primary.600"),
|
|
122
|
+
boxShadow: `0 1px 3px 0 ${getColorVar("primary.300")}, 0 1px 2px -1px ${getColorVar("primary.300")}`
|
|
136
123
|
},
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
...startIcon.lg
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
),
|
|
143
|
-
/* @__PURE__ */ jsx(
|
|
144
|
-
Primitive,
|
|
145
|
-
{
|
|
146
|
-
"data-error": error,
|
|
147
|
-
type: type === "password" && showPassword ? "text" : type,
|
|
148
|
-
className: clsx(classes.input__control, className),
|
|
149
|
-
...rest,
|
|
150
|
-
value: typingValue ?? value,
|
|
151
|
-
ref: mergedRefs,
|
|
152
|
-
onChange,
|
|
153
|
-
onBlur,
|
|
154
|
-
onFocus,
|
|
155
|
-
as: "input"
|
|
156
|
-
}
|
|
157
|
-
),
|
|
158
|
-
!!endIcon && /* @__PURE__ */ jsx(
|
|
159
|
-
Icon,
|
|
160
|
-
{
|
|
161
|
-
size: getSizeVariantState(size).iconSize,
|
|
162
|
-
...endIcon,
|
|
163
|
-
sm: {
|
|
164
|
-
size: getSizeVariantState(sm == null ? void 0 : sm.size).iconSize,
|
|
165
|
-
...endIcon.sm
|
|
124
|
+
"&:has(input:read-only)": {
|
|
125
|
+
pointerEvents: "none"
|
|
166
126
|
},
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
127
|
+
"&:has(input:disabled)": {
|
|
128
|
+
backgroundColor: getColorVar("neutral.300"),
|
|
129
|
+
color: getColorVar("neutral.500"),
|
|
130
|
+
borderColor: getColorVar("neutral.300"),
|
|
131
|
+
pointerEvents: "none"
|
|
170
132
|
},
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
),
|
|
177
|
-
suffix,
|
|
178
|
-
type === "password" && /* @__PURE__ */ jsx(
|
|
179
|
-
Icon,
|
|
180
|
-
{
|
|
181
|
-
onClick: toggleShowPassword,
|
|
182
|
-
sx: { cursor: "pointer" },
|
|
183
|
-
size: getSizeVariantState(size).iconSize,
|
|
133
|
+
...error && { borderColor: getColorVar("red.600") },
|
|
134
|
+
...createStyle({ size }),
|
|
135
|
+
...mainProps == null ? void 0 : mainProps.sx,
|
|
184
136
|
sm: {
|
|
185
|
-
|
|
137
|
+
...createStyle(sm),
|
|
138
|
+
...(_a = mainProps == null ? void 0 : mainProps.sx) == null ? void 0 : _a.sm
|
|
186
139
|
},
|
|
187
140
|
md: {
|
|
188
|
-
|
|
141
|
+
...createStyle(md),
|
|
142
|
+
...(_b = mainProps == null ? void 0 : mainProps.sx) == null ? void 0 : _b.md
|
|
189
143
|
},
|
|
190
144
|
lg: {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
145
|
+
...createStyle(lg),
|
|
146
|
+
...(_c = mainProps == null ? void 0 : mainProps.sx) == null ? void 0 : _c.lg
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
children: [
|
|
150
|
+
prefix,
|
|
151
|
+
!!startIcon && /* @__PURE__ */ jsx(
|
|
152
|
+
Icon,
|
|
153
|
+
{
|
|
154
|
+
size: getSizeVariantState(size).iconSize,
|
|
155
|
+
...startIcon,
|
|
156
|
+
sm: {
|
|
157
|
+
size: getSizeVariantState(sm == null ? void 0 : sm.size).iconSize,
|
|
158
|
+
...startIcon.sm
|
|
159
|
+
},
|
|
160
|
+
md: {
|
|
161
|
+
size: getSizeVariantState(md == null ? void 0 : md.size).iconSize,
|
|
162
|
+
...startIcon.md
|
|
163
|
+
},
|
|
164
|
+
lg: {
|
|
165
|
+
size: getSizeVariantState(lg == null ? void 0 : lg.size).iconSize,
|
|
166
|
+
...startIcon.lg
|
|
167
|
+
},
|
|
168
|
+
sx: {
|
|
169
|
+
flexShrink: 0,
|
|
170
|
+
...startIcon == null ? void 0 : startIcon.sx
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
),
|
|
174
|
+
/* @__PURE__ */ jsx(
|
|
175
|
+
Primitive,
|
|
176
|
+
{
|
|
177
|
+
"data-error": error,
|
|
178
|
+
type: type === "password" && showPassword ? "text" : type,
|
|
179
|
+
...rest,
|
|
180
|
+
value: typingValue ?? value,
|
|
181
|
+
ref: mergedRefs,
|
|
182
|
+
onChange,
|
|
183
|
+
onBlur,
|
|
184
|
+
onFocus,
|
|
185
|
+
as: "input",
|
|
186
|
+
sx: {
|
|
187
|
+
flex: "1 1 0%",
|
|
188
|
+
width: "100%",
|
|
189
|
+
height: "100%",
|
|
190
|
+
overflow: "hidden",
|
|
191
|
+
textOverflow: "ellipsis",
|
|
192
|
+
whiteSpace: "nowrap",
|
|
193
|
+
backgroundColor: "transparent",
|
|
194
|
+
":focus": {
|
|
195
|
+
outline: "none"
|
|
196
|
+
},
|
|
197
|
+
"::placeholder": {
|
|
198
|
+
color: getColorVar("neutral.400")
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
),
|
|
203
|
+
!!endIcon && /* @__PURE__ */ jsx(
|
|
204
|
+
Icon,
|
|
205
|
+
{
|
|
206
|
+
size: getSizeVariantState(size).iconSize,
|
|
207
|
+
...endIcon,
|
|
208
|
+
sm: {
|
|
209
|
+
size: getSizeVariantState(sm == null ? void 0 : sm.size).iconSize,
|
|
210
|
+
...endIcon.sm
|
|
211
|
+
},
|
|
212
|
+
md: {
|
|
213
|
+
size: getSizeVariantState(md == null ? void 0 : md.size).iconSize,
|
|
214
|
+
...endIcon.md
|
|
215
|
+
},
|
|
216
|
+
lg: {
|
|
217
|
+
size: getSizeVariantState(lg == null ? void 0 : lg.size).iconSize,
|
|
218
|
+
...endIcon.lg
|
|
219
|
+
},
|
|
220
|
+
sx: {
|
|
221
|
+
flexShrink: 0,
|
|
222
|
+
...endIcon == null ? void 0 : endIcon.sx
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
),
|
|
226
|
+
suffix,
|
|
227
|
+
type === "password" && /* @__PURE__ */ jsx(
|
|
228
|
+
Icon,
|
|
229
|
+
{
|
|
230
|
+
onClick: toggleShowPassword,
|
|
231
|
+
size: getSizeVariantState(size).iconSize,
|
|
232
|
+
sm: {
|
|
233
|
+
size: getSizeVariantState(sm == null ? void 0 : sm.size).iconSize
|
|
234
|
+
},
|
|
235
|
+
md: {
|
|
236
|
+
size: getSizeVariantState(md == null ? void 0 : md.size).iconSize
|
|
237
|
+
},
|
|
238
|
+
lg: {
|
|
239
|
+
size: getSizeVariantState(lg == null ? void 0 : lg.size).iconSize
|
|
240
|
+
},
|
|
241
|
+
source: showPassword ? EyeVisible : EyeHidden,
|
|
242
|
+
sx: {
|
|
243
|
+
cursor: "pointer",
|
|
244
|
+
flexShrink: 0
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
)
|
|
248
|
+
]
|
|
249
|
+
}
|
|
250
|
+
),
|
|
251
|
+
/* @__PURE__ */ jsx(FormHelperText, { error, children: helperText })
|
|
252
|
+
]
|
|
253
|
+
}
|
|
254
|
+
);
|
|
201
255
|
};
|
|
202
256
|
const createStyle = ({ size } = {}) => {
|
|
203
257
|
const { inputPaddingX, inputSize, textVariant } = getSizeVariantState(size);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { InputRangeProps } from './types';
|
|
2
|
-
export declare const InputRange: (_props: InputRangeProps) => import("
|
|
2
|
+
export declare const InputRange: ({ ref: _ref, ..._props }: InputRangeProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { jsxs, jsx } from "
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useRef, Fragment } from "react";
|
|
3
3
|
import { getInputRangeProps } from "./helpers.js";
|
|
4
|
-
import classes from "./input-range.module.scss.js";
|
|
5
4
|
import { getSizeVariantState } from "../../utils/index.js";
|
|
6
5
|
import LongArrowRightIcon from "../../assets/svg/long-arrow-right.svg.js";
|
|
7
|
-
import
|
|
8
|
-
import "../../theme/palette.js";
|
|
9
|
-
import { clsx } from "clsx";
|
|
6
|
+
import "lodash-es";
|
|
7
|
+
import { getColorVar } from "../../theme/palette.js";
|
|
10
8
|
import { InputNumber } from "../input-number/input-number.js";
|
|
9
|
+
import { Primitive } from "../primitive/primitive.js";
|
|
11
10
|
import { Icon } from "../icon/icon.js";
|
|
12
11
|
import { FormHelperText } from "../form-helper-text/form-helper-text.js";
|
|
13
|
-
const InputRange = (_props) => {
|
|
12
|
+
const InputRange = ({ ref: _ref, ..._props }) => {
|
|
14
13
|
const {
|
|
15
14
|
error,
|
|
16
15
|
helperText,
|
|
@@ -52,114 +51,139 @@ const InputRange = (_props) => {
|
|
|
52
51
|
onChange == null ? void 0 : onChange(e, edge);
|
|
53
52
|
(_b = (_a = inputs == null ? void 0 : inputs.at(Number(e.currentTarget.dataset.index))) == null ? void 0 : _a.onChange) == null ? void 0 : _b.call(_a, e);
|
|
54
53
|
};
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
54
|
+
return /* @__PURE__ */ jsxs(Primitive, { ...props, sx: { width: "100%", ...props.sx }, children: [
|
|
55
|
+
/* @__PURE__ */ jsxs(
|
|
56
|
+
Primitive,
|
|
57
|
+
{
|
|
58
|
+
ref: containerRef,
|
|
59
|
+
className,
|
|
60
|
+
sx: {
|
|
61
|
+
display: "flex",
|
|
62
|
+
alignItems: "center",
|
|
63
|
+
borderWidth: 1,
|
|
64
|
+
borderStyle: "solid",
|
|
65
|
+
borderRadius: "0.5rem",
|
|
66
|
+
gap: "0.5rem",
|
|
67
|
+
paddingLeft: getSizeVariantState(size).inputPaddingX,
|
|
68
|
+
paddingRight: getSizeVariantState(size).inputPaddingX,
|
|
69
|
+
"&:has(input:focus)": {
|
|
70
|
+
borderColor: getColorVar("primary.600"),
|
|
71
|
+
boxShadow: `0 1px 3px 0 ${getColorVar("primary.300")}, 0 1px 2px -1px ${getColorVar("primary.300")}`
|
|
72
|
+
},
|
|
73
|
+
":hover": {
|
|
74
|
+
borderColor: getColorVar("primary.300")
|
|
75
|
+
},
|
|
72
76
|
sm: {
|
|
73
|
-
|
|
74
|
-
|
|
77
|
+
paddingLeft: getSizeVariantState(sm == null ? void 0 : sm.size).inputPaddingX,
|
|
78
|
+
paddingRight: getSizeVariantState(sm == null ? void 0 : sm.size).inputPaddingX
|
|
75
79
|
},
|
|
76
80
|
md: {
|
|
77
|
-
|
|
78
|
-
|
|
81
|
+
paddingLeft: getSizeVariantState(md == null ? void 0 : md.size).inputPaddingX,
|
|
82
|
+
paddingRight: getSizeVariantState(md == null ? void 0 : md.size).inputPaddingX
|
|
79
83
|
},
|
|
80
84
|
lg: {
|
|
81
|
-
|
|
82
|
-
|
|
85
|
+
paddingLeft: getSizeVariantState(lg == null ? void 0 : lg.size).inputPaddingX,
|
|
86
|
+
paddingRight: getSizeVariantState(lg == null ? void 0 : lg.size).inputPaddingX
|
|
83
87
|
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
/* @__PURE__ */ jsx(
|
|
90
|
-
InputNumber,
|
|
88
|
+
},
|
|
89
|
+
children: [
|
|
90
|
+
prefix,
|
|
91
|
+
!!startIcon && /* @__PURE__ */ jsx(
|
|
92
|
+
Icon,
|
|
91
93
|
{
|
|
92
|
-
|
|
93
|
-
|
|
94
|
+
size: getSizeVariantState(size).iconSize,
|
|
95
|
+
...startIcon,
|
|
96
|
+
sm: {
|
|
97
|
+
size: getSizeVariantState(sm == null ? void 0 : sm.size).iconSize,
|
|
98
|
+
...startIcon.sm
|
|
99
|
+
},
|
|
100
|
+
md: {
|
|
101
|
+
size: getSizeVariantState(md == null ? void 0 : md.size).iconSize,
|
|
102
|
+
...startIcon.md
|
|
94
103
|
},
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
mainProps: {
|
|
99
|
-
style: {
|
|
100
|
-
borderWidth: 0,
|
|
101
|
-
boxShadow: "none",
|
|
102
|
-
paddingLeft: 0,
|
|
103
|
-
paddingRight: 0
|
|
104
|
-
}
|
|
104
|
+
lg: {
|
|
105
|
+
size: getSizeVariantState(lg == null ? void 0 : lg.size).iconSize,
|
|
106
|
+
...startIcon.lg
|
|
105
107
|
},
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
108
|
+
sx: {
|
|
109
|
+
flexShrink: 0,
|
|
110
|
+
...startIcon.sx
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
),
|
|
114
|
+
["from", "to"].map((edge, index, array) => {
|
|
115
|
+
const inputProps = (inputs == null ? void 0 : inputs.at(index)) ?? {};
|
|
116
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
117
|
+
/* @__PURE__ */ jsx(
|
|
118
|
+
InputNumber,
|
|
119
|
+
{
|
|
120
|
+
ref: (el) => {
|
|
121
|
+
inputRefs.current[index] = el;
|
|
122
|
+
},
|
|
123
|
+
"data-edge": edge,
|
|
124
|
+
"data-index": index,
|
|
125
|
+
mainProps: {
|
|
126
|
+
style: {
|
|
127
|
+
borderWidth: 0,
|
|
128
|
+
boxShadow: "none",
|
|
129
|
+
paddingLeft: 0,
|
|
130
|
+
paddingRight: 0
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
mode: "onBlur",
|
|
134
|
+
...inputProps,
|
|
135
|
+
onChange: onInputChange,
|
|
136
|
+
onFocus: onInputFocus,
|
|
137
|
+
size,
|
|
138
|
+
sm: {
|
|
139
|
+
size: sm == null ? void 0 : sm.size,
|
|
140
|
+
...inputProps.sm
|
|
141
|
+
},
|
|
142
|
+
md: {
|
|
143
|
+
size: md == null ? void 0 : md.size,
|
|
144
|
+
...inputProps.md
|
|
145
|
+
},
|
|
146
|
+
lg: {
|
|
147
|
+
size: lg == null ? void 0 : lg.size,
|
|
148
|
+
...inputProps.lg
|
|
149
|
+
},
|
|
150
|
+
sx: { textAlign: "center", ...inputProps.sx }
|
|
151
|
+
},
|
|
152
|
+
index
|
|
153
|
+
),
|
|
154
|
+
index < array.length - 1 && /* @__PURE__ */ jsx(Icon, { ...iconProps, sx: { flexShrink: 0 }, source: LongArrowRightIcon })
|
|
155
|
+
] }, index);
|
|
156
|
+
}),
|
|
157
|
+
!!endIcon && /* @__PURE__ */ jsx(
|
|
158
|
+
Icon,
|
|
159
|
+
{
|
|
160
|
+
size: getSizeVariantState(size).iconSize,
|
|
161
|
+
...endIcon,
|
|
111
162
|
sm: {
|
|
112
|
-
size: sm == null ? void 0 : sm.size,
|
|
113
|
-
...
|
|
163
|
+
size: getSizeVariantState(sm == null ? void 0 : sm.size).iconSize,
|
|
164
|
+
...endIcon.sm
|
|
114
165
|
},
|
|
115
166
|
md: {
|
|
116
|
-
size: md == null ? void 0 : md.size,
|
|
117
|
-
...
|
|
167
|
+
size: getSizeVariantState(md == null ? void 0 : md.size).iconSize,
|
|
168
|
+
...endIcon.md
|
|
118
169
|
},
|
|
119
170
|
lg: {
|
|
120
|
-
size: lg == null ? void 0 : lg.size,
|
|
121
|
-
...
|
|
171
|
+
size: getSizeVariantState(lg == null ? void 0 : lg.size).iconSize,
|
|
172
|
+
...endIcon.lg
|
|
173
|
+
},
|
|
174
|
+
sx: {
|
|
175
|
+
flexShrink: 0,
|
|
176
|
+
...endIcon.sx
|
|
122
177
|
}
|
|
123
|
-
}
|
|
124
|
-
index
|
|
178
|
+
}
|
|
125
179
|
),
|
|
126
|
-
|
|
127
|
-
]
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
Icon,
|
|
131
|
-
{
|
|
132
|
-
size: getSizeVariantState(size).iconSize,
|
|
133
|
-
...endIcon,
|
|
134
|
-
css: { flexShrink: 0 },
|
|
135
|
-
sm: {
|
|
136
|
-
size: getSizeVariantState(sm == null ? void 0 : sm.size).iconSize,
|
|
137
|
-
...endIcon.sm
|
|
138
|
-
},
|
|
139
|
-
md: {
|
|
140
|
-
size: getSizeVariantState(md == null ? void 0 : md.size).iconSize,
|
|
141
|
-
...endIcon.md
|
|
142
|
-
},
|
|
143
|
-
lg: {
|
|
144
|
-
size: getSizeVariantState(lg == null ? void 0 : lg.size).iconSize,
|
|
145
|
-
...endIcon.lg
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
),
|
|
149
|
-
suffix
|
|
150
|
-
] }),
|
|
180
|
+
suffix
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
),
|
|
151
184
|
/* @__PURE__ */ jsx(FormHelperText, { error, children: helperText })
|
|
152
185
|
] });
|
|
153
186
|
};
|
|
154
|
-
const createStyle = ({ size } = {}) => {
|
|
155
|
-
const { inputPaddingX } = getSizeVariantState(size);
|
|
156
|
-
return [
|
|
157
|
-
{
|
|
158
|
-
paddingLeft: inputPaddingX,
|
|
159
|
-
paddingRight: inputPaddingX
|
|
160
|
-
}
|
|
161
|
-
];
|
|
162
|
-
};
|
|
163
187
|
export {
|
|
164
188
|
InputRange
|
|
165
189
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
2
|
import { IconProps } from '../icon';
|
|
3
3
|
import { InputNumberProps } from '../input-number/types';
|
|
4
|
-
import {
|
|
4
|
+
import { PrimitiveProps } from '../primitive';
|
|
5
|
+
import { ShallowMerge, SizeVariant, ToResponsiveProps } from '../../types';
|
|
5
6
|
export interface InputRangeResponsiveProps {
|
|
6
7
|
size?: SizeVariant;
|
|
7
8
|
}
|
|
@@ -16,5 +17,5 @@ interface InputRangeExtendedProps extends ToResponsiveProps<InputRangeResponsive
|
|
|
16
17
|
startIcon?: IconProps;
|
|
17
18
|
endIcon?: IconProps;
|
|
18
19
|
}
|
|
19
|
-
export type InputRangeProps = ShallowMerge<JSX.IntrinsicElements['div'], InputRangeExtendedProps
|
|
20
|
+
export type InputRangeProps = PrimitiveProps<ShallowMerge<JSX.IntrinsicElements['div'], InputRangeExtendedProps>>;
|
|
20
21
|
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useEffect } from "react";
|
|
3
|
+
import { Primitive } from "../primitive/primitive.js";
|
|
4
|
+
const RippleEffect = ({
|
|
5
|
+
enabled = true,
|
|
6
|
+
color = "currentColor",
|
|
7
|
+
duration = 400,
|
|
8
|
+
opacity = 0.2,
|
|
9
|
+
sizeMultiplier = 1
|
|
10
|
+
}) => {
|
|
11
|
+
const containerRef = useRef(null);
|
|
12
|
+
const activeRipplesRef = useRef(/* @__PURE__ */ new Set());
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (!enabled) return;
|
|
15
|
+
const container = containerRef.current;
|
|
16
|
+
const parent = container == null ? void 0 : container.parentElement;
|
|
17
|
+
if (!container || !parent) return;
|
|
18
|
+
const activeRipples = activeRipplesRef.current;
|
|
19
|
+
const handlePointerDown = (e) => {
|
|
20
|
+
if (e.pointerType === "mouse" && e.button !== 0) return;
|
|
21
|
+
const { clientX, clientY } = e;
|
|
22
|
+
const { clientHeight, clientWidth } = parent;
|
|
23
|
+
const { left: offsetLeft, top: offsetTop } = parent.getBoundingClientRect();
|
|
24
|
+
const circleLeft = clientX - offsetLeft;
|
|
25
|
+
const circleTop = clientY - offsetTop;
|
|
26
|
+
const circleRight = offsetLeft + clientWidth - clientX;
|
|
27
|
+
const circleBottom = offsetTop + clientHeight - clientY;
|
|
28
|
+
const radius = Math.max(circleLeft, circleTop, circleRight, circleBottom) * sizeMultiplier;
|
|
29
|
+
const circle = document.createElement("div");
|
|
30
|
+
circle.style.position = "absolute";
|
|
31
|
+
circle.style.borderRadius = "9999px";
|
|
32
|
+
circle.style.backgroundColor = color;
|
|
33
|
+
circle.style.width = circle.style.height = `${radius * 2}px`;
|
|
34
|
+
circle.style.left = `${circleLeft - radius}px`;
|
|
35
|
+
circle.style.top = `${circleTop - radius}px`;
|
|
36
|
+
const animation = circle.animate(
|
|
37
|
+
[
|
|
38
|
+
{ transform: "scale(0)", opacity },
|
|
39
|
+
{ transform: "scale(1)", opacity: 0 }
|
|
40
|
+
],
|
|
41
|
+
{ duration, easing: "ease-in-out" }
|
|
42
|
+
);
|
|
43
|
+
animation.onfinish = () => {
|
|
44
|
+
circle.remove();
|
|
45
|
+
activeRipples.delete(circle);
|
|
46
|
+
};
|
|
47
|
+
activeRipples.add(circle);
|
|
48
|
+
container.appendChild(circle);
|
|
49
|
+
};
|
|
50
|
+
parent.addEventListener("pointerdown", handlePointerDown);
|
|
51
|
+
return () => {
|
|
52
|
+
parent.removeEventListener("pointerdown", handlePointerDown);
|
|
53
|
+
activeRipples.forEach((circle) => circle.remove());
|
|
54
|
+
activeRipples.clear();
|
|
55
|
+
};
|
|
56
|
+
}, [enabled, color, duration, opacity, sizeMultiplier]);
|
|
57
|
+
if (!enabled) return null;
|
|
58
|
+
return /* @__PURE__ */ jsx(
|
|
59
|
+
Primitive,
|
|
60
|
+
{
|
|
61
|
+
as: "span",
|
|
62
|
+
ref: containerRef,
|
|
63
|
+
sx: {
|
|
64
|
+
position: "absolute",
|
|
65
|
+
inset: 0,
|
|
66
|
+
pointerEvents: "none",
|
|
67
|
+
borderRadius: "inherit",
|
|
68
|
+
overflow: "hidden"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
};
|
|
73
|
+
export {
|
|
74
|
+
RippleEffect
|
|
75
|
+
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
type UseRippleEffectOptions = {
|
|
1
|
+
export type RippleEffectProps = {
|
|
3
2
|
/**
|
|
4
3
|
* Whether to enable the ripple effect
|
|
5
4
|
* @default true
|
|
@@ -26,7 +25,3 @@ type UseRippleEffectOptions = {
|
|
|
26
25
|
*/
|
|
27
26
|
sizeMultiplier?: number;
|
|
28
27
|
};
|
|
29
|
-
export declare const useRippleEffect: (ref: RefObject<HTMLElement | null>, { enabled, color, duration, opacity, sizeMultiplier, }?: UseRippleEffectOptions) => {
|
|
30
|
-
className: string;
|
|
31
|
-
};
|
|
32
|
-
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { TableRowProps } from './types';
|
|
2
|
-
export declare const TableRow: (
|
|
2
|
+
export declare const TableRow: (props: TableRowProps) => import("react/jsx-runtime").JSX.Element;
|