@xsolla/xui-slider 0.89.0 → 0.91.0

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/web/index.mjs CHANGED
@@ -202,257 +202,10 @@ var Text = ({
202
202
  );
203
203
  };
204
204
 
205
- // ../primitives-web/src/Spinner.tsx
206
- import styled3, { keyframes } from "styled-components";
207
- import { jsx as jsx3 } from "react/jsx-runtime";
208
- var rotate = keyframes`
209
- from {
210
- transform: rotate(0deg);
211
- }
212
- to {
213
- transform: rotate(360deg);
214
- }
215
- `;
216
- var StyledSpinner = styled3.div`
217
- width: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
218
- height: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
219
- border: ${(props) => props.strokeWidth || 2}px solid
220
- ${(props) => props.color || "currentColor"};
221
- border-bottom-color: transparent;
222
- border-radius: 50%;
223
- display: inline-block;
224
- box-sizing: border-box;
225
- animation: ${rotate} 1s linear infinite;
226
- `;
227
- var Spinner = ({
228
- role = "status",
229
- "aria-label": ariaLabel,
230
- "aria-live": ariaLive = "polite",
231
- "aria-describedby": ariaDescribedBy,
232
- testID,
233
- ...props
234
- }) => {
235
- return /* @__PURE__ */ jsx3(
236
- StyledSpinner,
237
- {
238
- role,
239
- "aria-label": ariaLabel,
240
- "aria-live": ariaLive,
241
- "aria-describedby": ariaDescribedBy,
242
- "data-testid": testID,
243
- ...props
244
- }
245
- );
246
- };
247
- Spinner.displayName = "Spinner";
248
-
249
- // ../primitives-web/src/Icon.tsx
250
- import styled4 from "styled-components";
251
- import { jsx as jsx4 } from "react/jsx-runtime";
252
- var StyledIcon = styled4.div`
253
- display: flex;
254
- align-items: center;
255
- justify-content: center;
256
- width: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
257
- height: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
258
- color: ${(props) => props.color || "currentColor"};
259
-
260
- svg {
261
- width: 100%;
262
- height: 100%;
263
- fill: none;
264
- stroke: currentColor;
265
- }
266
- `;
267
-
268
- // ../primitives-web/src/Divider.tsx
269
- import styled5 from "styled-components";
270
- import { jsx as jsx5 } from "react/jsx-runtime";
271
- var StyledDivider = styled5.div`
272
- background-color: ${(props) => props.dashStroke ? "transparent" : props.color || "rgba(255, 255, 255, 0.15)"};
273
- width: ${(props) => props.vertical ? typeof props.width === "number" ? `${props.width}px` : props.width || "1px" : "100%"};
274
- height: ${(props) => props.vertical ? "100%" : typeof props.height === "number" ? `${props.height}px` : props.height || "1px"};
275
-
276
- ${(props) => props.dashStroke && `
277
- border-style: dashed;
278
- border-color: ${props.color || "rgba(255, 255, 255, 0.15)"};
279
- border-width: 0;
280
- ${props.vertical ? `
281
- border-left-width: ${typeof props.width === "number" ? `${props.width}px` : props.width || "1px"};
282
- height: 100%;
283
- ` : `
284
- border-top-width: ${typeof props.height === "number" ? `${props.height}px` : props.height || "1px"};
285
- width: 100%;
286
- `}
287
- `}
288
- `;
289
-
290
- // ../primitives-web/src/Input.tsx
291
- import { forwardRef } from "react";
292
- import styled6 from "styled-components";
293
- import { jsx as jsx6 } from "react/jsx-runtime";
294
- var StyledInput = styled6.input`
295
- background: transparent;
296
- border: none;
297
- outline: none;
298
- width: 100%;
299
- height: 100%;
300
- padding: 0;
301
- margin: 0;
302
- color: ${(props) => props.color || "inherit"};
303
- font-size: ${(props) => typeof props.fontSize === "number" ? `${props.fontSize}px` : props.fontSize || "inherit"};
304
- font-family: inherit;
305
- text-align: inherit;
306
-
307
- &::placeholder {
308
- color: ${(props) => props.placeholderTextColor || "rgba(255, 255, 255, 0.5)"};
309
- }
310
-
311
- &:disabled {
312
- cursor: not-allowed;
313
- }
314
- `;
315
- var InputPrimitive = forwardRef(
316
- ({
317
- value,
318
- placeholder,
319
- onChange,
320
- onChangeText,
321
- onFocus,
322
- onBlur,
323
- onKeyDown,
324
- disabled,
325
- secureTextEntry,
326
- style,
327
- color,
328
- fontSize,
329
- placeholderTextColor,
330
- maxLength,
331
- name,
332
- type,
333
- inputMode,
334
- autoComplete,
335
- id,
336
- "aria-invalid": ariaInvalid,
337
- "aria-describedby": ariaDescribedBy,
338
- "aria-labelledby": ariaLabelledBy,
339
- "aria-label": ariaLabel,
340
- "aria-disabled": ariaDisabled,
341
- "data-testid": dataTestId,
342
- ...rest
343
- }, ref) => {
344
- const handleChange = (e) => {
345
- if (onChange) {
346
- onChange(e);
347
- }
348
- if (onChangeText) {
349
- onChangeText(e.target.value);
350
- }
351
- };
352
- const inputValue = value !== void 0 ? value : "";
353
- return /* @__PURE__ */ jsx6(
354
- StyledInput,
355
- {
356
- ref,
357
- id,
358
- value: inputValue,
359
- name,
360
- placeholder,
361
- onChange: handleChange,
362
- onFocus,
363
- onBlur,
364
- onKeyDown,
365
- disabled,
366
- type: secureTextEntry ? "password" : type || "text",
367
- inputMode,
368
- autoComplete,
369
- style,
370
- color,
371
- fontSize,
372
- placeholderTextColor,
373
- maxLength,
374
- "aria-invalid": ariaInvalid,
375
- "aria-describedby": ariaDescribedBy,
376
- "aria-labelledby": ariaLabelledBy,
377
- "aria-label": ariaLabel,
378
- "aria-disabled": ariaDisabled,
379
- "data-testid": dataTestId,
380
- ...rest
381
- }
382
- );
383
- }
384
- );
385
- InputPrimitive.displayName = "InputPrimitive";
386
-
387
- // ../primitives-web/src/TextArea.tsx
388
- import { forwardRef as forwardRef2 } from "react";
389
- import styled7 from "styled-components";
390
- import { jsx as jsx7 } from "react/jsx-runtime";
391
- var StyledTextArea = styled7.textarea`
392
- background: transparent;
393
- border: none;
394
- outline: none;
395
- width: 100%;
396
- height: 100%;
397
- padding: 0;
398
- margin: 0;
399
- color: ${(props) => props.color || "inherit"};
400
- font-size: ${(props) => typeof props.fontSize === "number" ? `${props.fontSize}px` : props.fontSize || "inherit"};
401
- font-family: inherit;
402
- text-align: inherit;
403
- resize: none;
404
-
405
- &::placeholder {
406
- color: ${(props) => props.placeholderTextColor || "rgba(255, 255, 255, 0.5)"};
407
- }
408
-
409
- &:disabled {
410
- cursor: not-allowed;
411
- }
412
- `;
413
- var TextAreaPrimitive = forwardRef2(
414
- ({
415
- value,
416
- placeholder,
417
- onChangeText,
418
- onFocus,
419
- onBlur,
420
- onKeyDown,
421
- disabled,
422
- style,
423
- color,
424
- fontSize,
425
- placeholderTextColor,
426
- maxLength,
427
- rows
428
- }, ref) => {
429
- return /* @__PURE__ */ jsx7(
430
- StyledTextArea,
431
- {
432
- ref,
433
- value,
434
- placeholder,
435
- onChange: (e) => onChangeText?.(e.target.value),
436
- onFocus,
437
- onBlur,
438
- onKeyDown,
439
- disabled,
440
- style,
441
- color,
442
- fontSize,
443
- placeholderTextColor,
444
- maxLength,
445
- rows
446
- }
447
- );
448
- }
449
- );
450
- TextAreaPrimitive.displayName = "TextAreaPrimitive";
451
-
452
205
  // src/Slider.tsx
453
206
  import { useDesignSystem, useId } from "@xsolla/xui-core";
454
207
  import { Input } from "@xsolla/xui-input";
455
- import { Fragment, jsx as jsx8, jsxs } from "react/jsx-runtime";
208
+ import { Fragment, jsx as jsx3, jsxs } from "react/jsx-runtime";
456
209
  var sizeConfig = {
457
210
  xl: {
458
211
  height: 56,
@@ -892,7 +645,7 @@ var Slider = ({
892
645
  const inputIconLeft = iconInside && effectiveIconPosition === "left" ? iconInside : void 0;
893
646
  const inputIconRight = iconInside && effectiveIconPosition === "right" ? iconInside : void 0;
894
647
  const inputWidth = iconInside ? sizing.inputWidth + sizing.inputIconSize + sizing.inputIconGap : sizing.inputWidth;
895
- return /* @__PURE__ */ jsx8(Box, { width: inputWidth, flexShrink: 0, children: /* @__PURE__ */ jsx8(
648
+ return /* @__PURE__ */ jsx3(Box, { width: inputWidth, flexShrink: 0, children: /* @__PURE__ */ jsx3(
896
649
  Input,
897
650
  {
898
651
  value: String(inputValue),
@@ -918,7 +671,7 @@ var Slider = ({
918
671
  const thumbAriaLabel = range ? thumbType === "min" ? minThumbAriaLabel : maxThumbAriaLabel : ariaLabel || label || "Slider value";
919
672
  const currentThumbBg = thumbHovered && !disabled ? thumbBgHoverColor : thumbBgColor;
920
673
  const thumbBaseBg = disabled ? theme.colors.background.primary : currentThumbBg;
921
- return /* @__PURE__ */ jsx8(
674
+ return /* @__PURE__ */ jsx3(
922
675
  Box,
923
676
  {
924
677
  role: "slider",
@@ -960,7 +713,7 @@ var Slider = ({
960
713
  "aria-valuemin": range && thumbType === "max" ? rangeMin + step : min,
961
714
  "aria-valuemax": range && thumbType === "min" ? rangeMax - step : max,
962
715
  "aria-orientation": "horizontal",
963
- children: disabled && /* @__PURE__ */ jsx8(
716
+ children: disabled && /* @__PURE__ */ jsx3(
964
717
  Box,
965
718
  {
966
719
  position: "absolute",
@@ -987,7 +740,7 @@ var Slider = ({
987
740
  onMouseEnter: () => setIsHovered(true),
988
741
  onMouseLeave: () => setIsHovered(false),
989
742
  children: [
990
- label && /* @__PURE__ */ jsx8(
743
+ label && /* @__PURE__ */ jsx3(
991
744
  Text,
992
745
  {
993
746
  id: labelId,
@@ -1005,7 +758,7 @@ var Slider = ({
1005
758
  height: sizing.height,
1006
759
  children: [
1007
760
  (inputPosition === "left" || inputPosition === "both") && (range ? renderInput(rangeMin, "min", "left") : renderInput(value, "single", "left")),
1008
- iconLeft && /* @__PURE__ */ jsx8(
761
+ iconLeft && /* @__PURE__ */ jsx3(
1009
762
  Box,
1010
763
  {
1011
764
  flexShrink: 0,
@@ -1017,7 +770,7 @@ var Slider = ({
1017
770
  children: iconLeft
1018
771
  }
1019
772
  ),
1020
- showLabels && /* @__PURE__ */ jsx8(
773
+ showLabels && /* @__PURE__ */ jsx3(
1021
774
  Text,
1022
775
  {
1023
776
  color: disabled ? inputColors.textDisable : inputColors.text,
@@ -1026,7 +779,7 @@ var Slider = ({
1026
779
  children: min
1027
780
  }
1028
781
  ),
1029
- /* @__PURE__ */ jsx8(
782
+ /* @__PURE__ */ jsx3(
1030
783
  Box,
1031
784
  {
1032
785
  flex: 1,
@@ -1034,7 +787,7 @@ var Slider = ({
1034
787
  height: sizing.height,
1035
788
  alignItems: "center",
1036
789
  justifyContent: "center",
1037
- children: /* @__PURE__ */ jsx8(
790
+ children: /* @__PURE__ */ jsx3(
1038
791
  Box,
1039
792
  {
1040
793
  ref: trackRef,
@@ -1053,7 +806,7 @@ var Slider = ({
1053
806
  onResponderRelease: handleResponderRelease,
1054
807
  onResponderTerminate: handleResponderRelease,
1055
808
  children: range ? /* @__PURE__ */ jsxs(Fragment, { children: [
1056
- /* @__PURE__ */ jsx8(
809
+ /* @__PURE__ */ jsx3(
1057
810
  Box,
1058
811
  {
1059
812
  position: "absolute",
@@ -1068,7 +821,7 @@ var Slider = ({
1068
821
  renderThumb(rangeMinPercentage, "min"),
1069
822
  renderThumb(rangeMaxPercentage, "max")
1070
823
  ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
1071
- /* @__PURE__ */ jsx8(
824
+ /* @__PURE__ */ jsx3(
1072
825
  Box,
1073
826
  {
1074
827
  position: "absolute",
@@ -1086,7 +839,7 @@ var Slider = ({
1086
839
  )
1087
840
  }
1088
841
  ),
1089
- showLabels && /* @__PURE__ */ jsx8(
842
+ showLabels && /* @__PURE__ */ jsx3(
1090
843
  Text,
1091
844
  {
1092
845
  color: disabled ? inputColors.textDisable : inputColors.text,
@@ -1095,7 +848,7 @@ var Slider = ({
1095
848
  children: max
1096
849
  }
1097
850
  ),
1098
- iconRight && /* @__PURE__ */ jsx8(
851
+ iconRight && /* @__PURE__ */ jsx3(
1099
852
  Box,
1100
853
  {
1101
854
  flexShrink: 0,