@janbox/storefront-ui 2.0.1 → 2.0.2

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.
Files changed (41) hide show
  1. package/dist/lib/floating/floating-content/floating-content.d.ts.map +1 -1
  2. package/dist/lib/floating/floating-content/floating-content.js +3 -1
  3. package/dist/lib/floating/floating-content/types.d.ts +2 -2
  4. package/dist/lib/floating/floating-content/types.d.ts.map +1 -1
  5. package/dist/lib/form-helper-text/form-helper-text.d.ts.map +1 -1
  6. package/dist/lib/form-helper-text/form-helper-text.js +7 -4
  7. package/dist/lib/form-helper-text/types.d.ts +2 -1
  8. package/dist/lib/form-helper-text/types.d.ts.map +1 -1
  9. package/dist/lib/input/input.d.ts.map +1 -1
  10. package/dist/lib/input/input.js +119 -122
  11. package/dist/lib/input/types.d.ts +3 -2
  12. package/dist/lib/input/types.d.ts.map +1 -1
  13. package/dist/lib/loading/loading-overlay/loading-overlay.d.ts +1 -1
  14. package/dist/lib/loading/loading-overlay/loading-overlay.d.ts.map +1 -1
  15. package/dist/lib/loading/loading-overlay/loading-overlay.js +10 -10
  16. package/dist/lib/loading/loading-overlay/types.d.ts +3 -2
  17. package/dist/lib/loading/loading-overlay/types.d.ts.map +1 -1
  18. package/dist/lib/menu/menu-list/menu-list.d.ts.map +1 -1
  19. package/dist/lib/menu/menu-list/menu-list.js +4 -3
  20. package/dist/lib/multiple-select/multiple-select.d.ts.map +1 -1
  21. package/dist/lib/multiple-select/multiple-select.js +8 -2
  22. package/dist/lib/multiple-select/types.d.ts +2 -4
  23. package/dist/lib/multiple-select/types.d.ts.map +1 -1
  24. package/dist/lib/phone-input/phone-input.d.ts.map +1 -1
  25. package/dist/lib/phone-input/phone-input.js +105 -92
  26. package/dist/lib/phone-input/types.d.ts +2 -3
  27. package/dist/lib/phone-input/types.d.ts.map +1 -1
  28. package/dist/lib/radio-button/radio-button.d.ts.map +1 -1
  29. package/dist/lib/radio-button/radio-button.js +7 -7
  30. package/dist/lib/radio-button/types.d.ts +2 -4
  31. package/dist/lib/radio-button/types.d.ts.map +1 -1
  32. package/dist/lib/textarea/textarea.d.ts.map +1 -1
  33. package/dist/lib/textarea/textarea.js +48 -44
  34. package/dist/lib/textarea/types.d.ts +3 -2
  35. package/dist/lib/textarea/types.d.ts.map +1 -1
  36. package/dist/lib/video/types.d.ts +2 -8
  37. package/dist/lib/video/types.d.ts.map +1 -1
  38. package/dist/lib/video/video.d.ts +1 -1
  39. package/dist/lib/video/video.d.ts.map +1 -1
  40. package/dist/lib/video/video.js +2 -4
  41. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"floating-content.d.ts","sourceRoot":"","sources":["../../../../src/lib/floating/floating-content/floating-content.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAO/C,eAAO,MAAM,eAAe,8HAuC3B,CAAC"}
1
+ {"version":3,"file":"floating-content.d.ts","sourceRoot":"","sources":["../../../../src/lib/floating/floating-content/floating-content.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAQ/C,eAAO,MAAM,eAAe,8HAwC3B,CAAC"}
@@ -5,8 +5,9 @@ import { AnimatePresence, motion } from "motion/react";
5
5
  import { useFloatingContext } from "../floating/helpers.js";
6
6
  import { FLOATING_Z_INDEX } from "../../../theme/index.js";
7
7
  import { useIsHydrated } from "../../../hooks/use-is-hydrated/index.js";
8
+ import { createSxInterpolation } from "../../../utils/stylesheet.js";
8
9
  const FloatingContent = forwardRef(
9
- ({ style, floatingPortalProps, floatingFocusManagerProps, floatingOverlayProps, ...props }, ref) => {
10
+ ({ style, floatingPortalProps, floatingFocusManagerProps, floatingOverlayProps, sx, ...props }, ref) => {
10
11
  const { getFloatingProps, context } = useFloatingContext();
11
12
  const mergedRefs = useMergeRefs([context.refs.setFloating, ref]);
12
13
  const isHydrated = useIsHydrated();
@@ -29,6 +30,7 @@ const FloatingContent = forwardRef(
29
30
  ...style,
30
31
  zIndex: FLOATING_Z_INDEX
31
32
  },
33
+ css: createSxInterpolation(sx),
32
34
  ...getFloatingProps(props),
33
35
  ref: mergedRefs,
34
36
  children: props.children
@@ -1,8 +1,8 @@
1
1
  import { ComponentProps, HTMLProps } from 'react';
2
2
  import { Interpolation } from '@emotion/react';
3
3
  import { FloatingFocusManager, FloatingOverlay, FloatingPortal } from '@floating-ui/react';
4
- import { ShallowMerge } from '../../../types';
5
- export type FloatingContentProps = ShallowMerge<HTMLProps<HTMLDivElement>, {
4
+ import { PropsWithSx, ShallowMerge } from '../../../types';
5
+ export type FloatingContentProps = PropsWithSx<HTMLProps<HTMLDivElement> & {
6
6
  floatingPortalProps?: Partial<ComponentProps<typeof FloatingPortal>>;
7
7
  floatingOverlayProps?: Partial<ShallowMerge<ComponentProps<typeof FloatingOverlay>, {
8
8
  disabled: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/floating/floating-content/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEhG,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,MAAM,oBAAoB,GAAG,YAAY,CAC7C,SAAS,CAAC,cAAc,CAAC,EACzB;IACE,mBAAmB,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC;IACrE,oBAAoB,CAAC,EAAE,OAAO,CAC5B,YAAY,CACV,cAAc,CAAC,OAAO,eAAe,CAAC,EACtC;QACE,QAAQ,EAAE,OAAO,CAAC;QAClB,GAAG,CAAC,EAAE,aAAa,CAAC;KACrB,CACF,CACF,CAAC;IACF,yBAAyB,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC;CAClF,CACF,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/floating/floating-content/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEhG,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEpD,MAAM,MAAM,oBAAoB,GAAG,WAAW,CAC5C,SAAS,CAAC,cAAc,CAAC,GAAG;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC;IACrE,oBAAoB,CAAC,EAAE,OAAO,CAC5B,YAAY,CACV,cAAc,CAAC,OAAO,eAAe,CAAC,EACtC;QACE,QAAQ,EAAE,OAAO,CAAC;QAClB,GAAG,CAAC,EAAE,aAAa,CAAC;KACrB,CACF,CACF,CAAC;IACF,yBAAyB,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC;CAClF,CACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"form-helper-text.d.ts","sourceRoot":"","sources":["../../../src/lib/form-helper-text/form-helper-text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAG9C,eAAO,MAAM,cAAc,kCAAmC,mBAAmB,qDAiBhF,CAAC"}
1
+ {"version":3,"file":"form-helper-text.d.ts","sourceRoot":"","sources":["../../../src/lib/form-helper-text/form-helper-text.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAG9C,eAAO,MAAM,cAAc,kCAAmC,mBAAmB,qDAmBhF,CAAC"}
@@ -2,20 +2,23 @@ import { jsx } from "@emotion/react/jsx-runtime";
2
2
  import "lodash-es";
3
3
  import { getColorVar } from "../../theme/palette.js";
4
4
  import { getTypographyVar } from "../../theme/typography.js";
5
+ import { Primitive } from "../primitive/primitive.js";
5
6
  const FormHelperText = ({ error, children, ...props }) => {
6
7
  return /* @__PURE__ */ jsx(
7
- "p",
8
+ Primitive,
8
9
  {
9
- css: {
10
+ as: "p",
11
+ ...props,
12
+ sx: {
10
13
  paddingLeft: 16,
11
14
  paddingRight: 16,
12
15
  paddingTop: 4,
13
16
  fontSize: getTypographyVar("xs").fontSize,
14
17
  lineHeight: getTypographyVar("xs").lineHeight,
15
18
  "&:empty": { display: "none" },
16
- ...error && { color: getColorVar("red.600") }
19
+ ...error && { color: getColorVar("red.600") },
20
+ ...props.sx
17
21
  },
18
- ...props,
19
22
  children
20
23
  }
21
24
  );
@@ -1,6 +1,7 @@
1
1
  import { JSX } from 'react';
2
2
  import { ShallowMerge } from '../../types';
3
- export type FormHelperTextProps = ShallowMerge<JSX.IntrinsicElements['p'], {
3
+ import { PrimitiveProps } from '../primitive';
4
+ export type FormHelperTextProps = ShallowMerge<PrimitiveProps<JSX.IntrinsicElements['p']>, {
4
5
  error?: boolean;
5
6
  }>;
6
7
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/form-helper-text/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAC5C,GAAG,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAC1B;IACE,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CACF,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/form-helper-text/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAC5C,cAAc,CAAC,GAAG,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,EAC1C;IACE,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/lib/input/input.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAwB,MAAM,SAAS,CAAC;AAa3D,eAAO,MAAM,KAAK,sHA4LhB,CAAC"}
1
+ {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/lib/input/input.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAwB,MAAM,SAAS,CAAC;AAa3D,eAAO,MAAM,KAAK,sHA8LhB,CAAC"}
@@ -4,16 +4,17 @@ import { useMergeRefs } from "@floating-ui/react";
4
4
  import { isString } from "lodash-es";
5
5
  import { getInputProps } from "./helpers.js";
6
6
  import classes from "./input.module.scss.js";
7
- import { cn, createSxInterpolation } from "../../utils/stylesheet.js";
7
+ import { cn } from "../../utils/stylesheet.js";
8
8
  import EyeHidden from "../../assets/svg/eye-hidden.svg.js";
9
9
  import EyeVisible from "../../assets/svg/eye-show-visible.svg.js";
10
10
  import { getSizeVariantState } from "../../utils/index.js";
11
- import { mediaQuery } from "../../theme/screens.js";
12
11
  import "../../theme/palette.js";
13
12
  import { getTypographyVar } from "../../theme/typography.js";
14
13
  import { FormHelperText } from "../form-helper-text/form-helper-text.js";
14
+ import { Primitive } from "../primitive/primitive.js";
15
15
  import { Icon } from "../icon/icon.js";
16
16
  const Input = forwardRef((_props, ref) => {
17
+ var _a, _b, _c;
17
18
  const {
18
19
  type,
19
20
  size,
@@ -22,7 +23,6 @@ const Input = forwardRef((_props, ref) => {
22
23
  lg,
23
24
  prefix,
24
25
  suffix,
25
- sx,
26
26
  containerProps,
27
27
  mainProps,
28
28
  className,
@@ -71,146 +71,143 @@ const Input = forwardRef((_props, ref) => {
71
71
  onChangeProp == null ? void 0 : onChangeProp(e);
72
72
  };
73
73
  const onFocus = (e) => {
74
- var _a;
74
+ var _a2;
75
75
  beforeChangeValue.current = e.target.value;
76
- (_a = rest.onFocus) == null ? void 0 : _a.call(rest, e);
76
+ (_a2 = rest.onFocus) == null ? void 0 : _a2.call(rest, e);
77
77
  };
78
78
  const onBlur = (e) => {
79
- var _a;
79
+ var _a2;
80
80
  if (beforeChangeValue.current !== e.target.value) {
81
81
  if (mode === "onBlur" || debounce > 0) {
82
82
  onChange(e, true);
83
83
  }
84
84
  }
85
- (_a = rest.onBlur) == null ? void 0 : _a.call(rest, e);
85
+ (_a2 = rest.onBlur) == null ? void 0 : _a2.call(rest, e);
86
86
  setTimeout(() => {
87
87
  setTypingValue(void 0);
88
88
  }, debounce);
89
89
  };
90
- const { sx: containerSx, ...restContainerProps } = containerProps ?? {};
91
90
  const toggleShowPassword = (e) => {
92
91
  e.stopPropagation();
93
92
  setShowPassword((prev) => !prev);
94
93
  };
95
- return /* @__PURE__ */ jsxs(
96
- "div",
97
- {
98
- ...restContainerProps,
99
- css: createSxInterpolation(containerSx),
100
- className: cn(classes.input__container, restContainerProps.className),
101
- children: [
102
- /* @__PURE__ */ jsxs(
103
- "div",
94
+ return /* @__PURE__ */ jsxs(Primitive, { className: cn(classes.input__container, containerProps == null ? void 0 : containerProps.className), children: [
95
+ /* @__PURE__ */ jsxs(
96
+ Primitive,
97
+ {
98
+ ...mainProps,
99
+ className: cn(
100
+ classes.input__main,
104
101
  {
105
- css: createSxInterpolation(sx),
106
- ...mainProps,
107
- className: cn(
108
- classes.input__main,
109
- {
110
- [classes.input__main_error]: error
111
- },
112
- mainProps == null ? void 0 : mainProps.className
113
- ),
114
- children: [
115
- prefix,
116
- !!startIcon && /* @__PURE__ */ jsx(
117
- Icon,
118
- {
119
- size: getSizeVariantState(size).iconSize,
120
- ...startIcon,
121
- sm: {
122
- size: getSizeVariantState(sm == null ? void 0 : sm.size).iconSize,
123
- ...startIcon.sm
124
- },
125
- md: {
126
- size: getSizeVariantState(md == null ? void 0 : md.size).iconSize,
127
- ...startIcon.md
128
- },
129
- lg: {
130
- size: getSizeVariantState(lg == null ? void 0 : lg.size).iconSize,
131
- ...startIcon.lg
132
- }
133
- }
134
- ),
135
- /* @__PURE__ */ jsx(
136
- "input",
137
- {
138
- "data-error": error,
139
- type: type === "password" && showPassword ? "text" : type,
140
- className: cn(classes.input__control, className),
141
- ...rest,
142
- value: typingValue ?? value,
143
- ref: mergedRefs,
144
- onChange,
145
- css: [
146
- createStyle({ size }),
147
- {
148
- [mediaQuery("sm")]: createStyle(sm),
149
- [mediaQuery("md")]: createStyle(md),
150
- [mediaQuery("lg")]: createStyle(lg)
151
- }
152
- ],
153
- onBlur,
154
- onFocus
155
- }
156
- ),
157
- !!endIcon && /* @__PURE__ */ jsx(
158
- Icon,
159
- {
160
- size: getSizeVariantState(size).iconSize,
161
- ...endIcon,
162
- sm: {
163
- size: getSizeVariantState(sm == null ? void 0 : sm.size).iconSize,
164
- ...endIcon.sm
165
- },
166
- md: {
167
- size: getSizeVariantState(md == null ? void 0 : md.size).iconSize,
168
- ...endIcon.md
169
- },
170
- lg: {
171
- size: getSizeVariantState(lg == null ? void 0 : lg.size).iconSize,
172
- ...endIcon.lg
173
- }
174
- }
175
- ),
176
- suffix,
177
- type === "password" && /* @__PURE__ */ jsx(
178
- Icon,
179
- {
180
- onClick: toggleShowPassword,
181
- sx: { cursor: "pointer" },
182
- size: getSizeVariantState(size).iconSize,
183
- sm: {
184
- size: getSizeVariantState(sm == null ? void 0 : sm.size).iconSize
185
- },
186
- md: {
187
- size: getSizeVariantState(md == null ? void 0 : md.size).iconSize
188
- },
189
- lg: {
190
- size: getSizeVariantState(lg == null ? void 0 : lg.size).iconSize
191
- },
192
- source: showPassword ? EyeVisible : EyeHidden
193
- }
194
- )
195
- ]
196
- }
102
+ [classes.input__main_error]: error
103
+ },
104
+ mainProps == null ? void 0 : mainProps.className
197
105
  ),
198
- /* @__PURE__ */ jsx(FormHelperText, { error, children: helperText })
199
- ]
200
- }
201
- );
106
+ sx: {
107
+ ...createStyle({ size }),
108
+ ...mainProps == null ? void 0 : mainProps.sx,
109
+ sm: {
110
+ ...createStyle(sm),
111
+ ...(_a = mainProps == null ? void 0 : mainProps.sx) == null ? void 0 : _a.sm
112
+ },
113
+ md: {
114
+ ...createStyle(md),
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
132
+ },
133
+ md: {
134
+ size: getSizeVariantState(md == null ? void 0 : md.size).iconSize,
135
+ ...startIcon.md
136
+ },
137
+ lg: {
138
+ size: getSizeVariantState(lg == null ? void 0 : lg.size).iconSize,
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: cn(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
166
+ },
167
+ md: {
168
+ size: getSizeVariantState(md == null ? void 0 : md.size).iconSize,
169
+ ...endIcon.md
170
+ },
171
+ lg: {
172
+ size: getSizeVariantState(lg == null ? void 0 : lg.size).iconSize,
173
+ ...endIcon.lg
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,
184
+ sm: {
185
+ size: getSizeVariantState(sm == null ? void 0 : sm.size).iconSize
186
+ },
187
+ md: {
188
+ size: getSizeVariantState(md == null ? void 0 : md.size).iconSize
189
+ },
190
+ lg: {
191
+ size: getSizeVariantState(lg == null ? void 0 : lg.size).iconSize
192
+ },
193
+ source: showPassword ? EyeVisible : EyeHidden
194
+ }
195
+ )
196
+ ]
197
+ }
198
+ ),
199
+ /* @__PURE__ */ jsx(FormHelperText, { error, children: helperText })
200
+ ] });
202
201
  });
203
202
  const createStyle = ({ size } = {}) => {
204
203
  const { inputPaddingX, inputSize, textVariant } = getSizeVariantState(size);
205
- return [
206
- {
207
- paddingLeft: inputPaddingX,
208
- paddingRight: inputPaddingX,
209
- height: inputSize,
210
- fontSize: textVariant ? getTypographyVar(textVariant).fontSize : void 0,
211
- lineHeight: textVariant ? getTypographyVar(textVariant).lineHeight : void 0
212
- }
213
- ];
204
+ return {
205
+ paddingLeft: inputPaddingX,
206
+ paddingRight: inputPaddingX,
207
+ height: inputSize,
208
+ fontSize: textVariant ? getTypographyVar(textVariant).fontSize : void 0,
209
+ lineHeight: textVariant ? getTypographyVar(textVariant).lineHeight : void 0
210
+ };
214
211
  };
215
212
  export {
216
213
  Input
@@ -1,6 +1,7 @@
1
1
  import { HTMLAttributes, JSX } from 'react';
2
2
  import { IconProps } from '../icon';
3
3
  import { PropsWithSx, SizeVariant, ShallowMerge, ToResponsiveProps } from '../../types';
4
+ import { PrimitiveProps } from '../primitive';
4
5
  export interface InputResponsiveProps {
5
6
  size?: SizeVariant;
6
7
  }
@@ -8,8 +9,8 @@ export type InputWrapperProps = HTMLAttributes<HTMLDivElement>;
8
9
  interface InputExtendedProps extends PropsWithSx<ToResponsiveProps<InputResponsiveProps>> {
9
10
  prefix?: React.ReactNode;
10
11
  suffix?: React.ReactNode;
11
- containerProps?: PropsWithSx<JSX.IntrinsicElements['div']>;
12
- mainProps?: JSX.IntrinsicElements['div'];
12
+ containerProps?: PrimitiveProps<JSX.IntrinsicElements['div']>;
13
+ mainProps?: PrimitiveProps<JSX.IntrinsicElements['div']>;
13
14
  helperText?: string;
14
15
  error?: boolean;
15
16
  value?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/input/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEpF,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AAED,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAE/D,UAAU,kBAAmB,SAAQ,WAAW,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IACvF,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,cAAc,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3D,SAAS,CAAC,EAAE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CAAC;IAC9D,SAAS,CAAC,EAAE,cAAc,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;IACzD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACtC,IAAI,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,UAAU,GAAG,YAAY,CAAC,GAAG,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAC,CAAC"}
@@ -1,3 +1,3 @@
1
1
  import { LoadingOverlayProps } from './types';
2
- export declare const LoadingOverlay: ({ isLoading, iconProps, color, sx, style, size, children, ...props }: LoadingOverlayProps) => import("@emotion/react/jsx-runtime").JSX.Element;
2
+ export declare const LoadingOverlay: ({ isLoading, iconProps, color, style, size, children, ...props }: LoadingOverlayProps) => import("@emotion/react/jsx-runtime").JSX.Element;
3
3
  //# sourceMappingURL=loading-overlay.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"loading-overlay.d.ts","sourceRoot":"","sources":["../../../../src/lib/loading/loading-overlay/loading-overlay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAQ9C,eAAO,MAAM,cAAc,yEASxB,mBAAmB,qDAqCrB,CAAC"}
1
+ {"version":3,"file":"loading-overlay.d.ts","sourceRoot":"","sources":["../../../../src/lib/loading/loading-overlay/loading-overlay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAQ9C,eAAO,MAAM,cAAc,qEAQxB,mBAAmB,qDAsCrB,CAAC"}
@@ -3,12 +3,11 @@ import { SvgLoader } from "../../../components/svg-loader.js";
3
3
  import { animateSpinStyle } from "../../../constants/emotion.js";
4
4
  import LoadingIcon from "../../../assets/svg/loading-waiting.svg.js";
5
5
  import { getColorShadesByVariant } from "../../../utils/index.js";
6
- import { createSxInterpolation } from "../../../utils/stylesheet.js";
6
+ import { Primitive } from "../../primitive/primitive.js";
7
7
  const LoadingOverlay = ({
8
8
  isLoading = false,
9
9
  iconProps,
10
10
  color = "primary",
11
- sx,
12
11
  style,
13
12
  size = 32,
14
13
  children,
@@ -16,7 +15,7 @@ const LoadingOverlay = ({
16
15
  }) => {
17
16
  const { main } = getColorShadesByVariant(color);
18
17
  return /* @__PURE__ */ jsxs(
19
- "div",
18
+ Primitive,
20
19
  {
21
20
  style: {
22
21
  minWidth: size,
@@ -24,17 +23,17 @@ const LoadingOverlay = ({
24
23
  ...style
25
24
  },
26
25
  ...props,
27
- css: [
28
- { position: "relative" },
29
- createSxInterpolation(sx)
30
- ],
26
+ sx: {
27
+ position: "relative",
28
+ ...props.sx
29
+ },
31
30
  children: [
32
31
  children,
33
32
  isLoading && /* @__PURE__ */ jsx(
34
- "div",
33
+ Primitive,
35
34
  {
36
35
  ...iconProps,
37
- css: {
36
+ sx: {
38
37
  position: "absolute",
39
38
  top: 0,
40
39
  right: 0,
@@ -43,7 +42,8 @@ const LoadingOverlay = ({
43
42
  zIndex: 10,
44
43
  display: "grid",
45
44
  placeItems: "center",
46
- cursor: "progress"
45
+ cursor: "progress",
46
+ ...iconProps == null ? void 0 : iconProps.sx
47
47
  },
48
48
  children: /* @__PURE__ */ jsx(SvgLoader, { source: LoadingIcon, width: size, height: size, css: animateSpinStyle, style: { color: main } })
49
49
  }
@@ -1,9 +1,10 @@
1
1
  import { JSX } from 'react';
2
2
  import { ColorVariant, PropsWithSx, ShallowMerge } from '../../../types';
3
- export type LoadingOverlayProps = ShallowMerge<JSX.IntrinsicElements['div'], PropsWithSx<{
3
+ import { PrimitiveProps } from '../../primitive';
4
+ export type LoadingOverlayProps = ShallowMerge<PrimitiveProps<JSX.IntrinsicElements['div']>, PropsWithSx<{
4
5
  isLoading?: boolean;
5
6
  size?: number;
6
7
  color?: ColorVariant;
7
- iconProps?: JSX.IntrinsicElements['div'];
8
+ iconProps?: PrimitiveProps<JSX.IntrinsicElements['div']>;
8
9
  }>>;
9
10
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/loading/loading-overlay/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAElE,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAC5C,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAC5B,WAAW,CAAC;IACV,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,SAAS,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;CAC1C,CAAC,CACH,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/loading/loading-overlay/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAC5C,cAAc,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,EAC5C,WAAW,CAAC;IACV,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,SAAS,CAAC,EAAE,cAAc,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;CAC1D,CAAC,CACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"menu-list.d.ts","sourceRoot":"","sources":["../../../../src/lib/menu/menu-list/menu-list.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAMxC,eAAO,MAAM,QAAQ,2BAA4B,aAAa,qDAoB7D,CAAC"}
1
+ {"version":3,"file":"menu-list.d.ts","sourceRoot":"","sources":["../../../../src/lib/menu/menu-list/menu-list.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAMxC,eAAO,MAAM,QAAQ,2BAA4B,aAAa,qDAqB7D,CAAC"}
@@ -7,7 +7,8 @@ const MenuList = ({ children, ...props }) => {
7
7
  return /* @__PURE__ */ jsx(
8
8
  FloatingContent,
9
9
  {
10
- css: {
10
+ ...props,
11
+ sx: {
11
12
  backgroundColor: getColorVar("surface.default"),
12
13
  padding: "0.25rem",
13
14
  borderRadius: "0.75rem",
@@ -16,9 +17,9 @@ const MenuList = ({ children, ...props }) => {
16
17
  borderColor: getColorVar("neutral.100"),
17
18
  boxShadow: "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)",
18
19
  display: "flex",
19
- flexDirection: "column"
20
+ flexDirection: "column",
21
+ ...props.sx
20
22
  },
21
- ...props,
22
23
  ...{ [HTMLDatasetAttributes.DATA_MENU_LIST]: true },
23
24
  children
24
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"multiple-select.d.ts","sourceRoot":"","sources":["../../../src/lib/multiple-select/multiple-select.tsx"],"names":[],"mappings":"AAQA,OAAO,EAA6B,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAiBzE,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,MAAM,8BAA8B,mBAAmB,CAAC,CAAC,CAAC,qDAkYlG,CAAC"}
1
+ {"version":3,"file":"multiple-select.d.ts","sourceRoot":"","sources":["../../../src/lib/multiple-select/multiple-select.tsx"],"names":[],"mappings":"AAQA,OAAO,EAA6B,mBAAmB,EAAE,MAAM,SAAS,CAAC;AA0BzE,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,MAAM,8BAA8B,mBAAmB,CAAC,CAAC,CAAC,qDAuYlG,CAAC"}
@@ -13,6 +13,7 @@ import { getTypographyVar } from "../../theme/typography.js";
13
13
  import { Checkbox } from "../checkbox/checkbox.js";
14
14
  import { TextSkeleton } from "../loading/text-skeleton/text-skeleton.js";
15
15
  import { ensureArray, matchSearch } from "../../utils/common.js";
16
+ import { Primitive } from "../primitive/primitive.js";
16
17
  import { Floating } from "../floating/floating/floating.js";
17
18
  import { FloatingTrigger } from "../floating/floating-trigger/floating-trigger.js";
18
19
  import { InputMask as ForwardRefInputMask } from "../input-mask/input-mask.js";
@@ -207,10 +208,15 @@ const MultipleSelect = ({ ref, ...props }) => {
207
208
  return () => clearTimeout(timer);
208
209
  }, [isOpen, setInputValue]);
209
210
  return /* @__PURE__ */ jsxs(
210
- "div",
211
+ Primitive,
211
212
  {
212
213
  ...containerProps,
213
- css: { display: "flex", flexDirection: "column", width: "100%", ...containerProps == null ? void 0 : containerProps.css },
214
+ sx: {
215
+ display: "flex",
216
+ flexDirection: "column",
217
+ width: "100%",
218
+ ...containerProps == null ? void 0 : containerProps.sx
219
+ },
214
220
  children: [
215
221
  /* @__PURE__ */ jsxs(
216
222
  Floating,
@@ -1,9 +1,9 @@
1
1
  import { HTMLProps, JSX, PropsWithoutRef } from 'react';
2
- import { Interpolation } from '@emotion/react';
3
2
  import { Placement, UseFloatingOptions } from '@floating-ui/react';
4
3
  import { InputProps } from '../input';
5
4
  import { InputMaskProps, InputMaskResponsiveProps } from '../input-mask/types';
6
5
  import { ShallowMerge, ToResponsiveProps } from '../../types';
6
+ import { PrimitiveProps } from '../primitive';
7
7
  export type MultipleSelectResponsiveProps = InputMaskResponsiveProps;
8
8
  export type MultipleSelectOptionValue = string | number;
9
9
  interface MultipleSelectExtendedProps<O extends object> extends ToResponsiveProps<MultipleSelectResponsiveProps> {
@@ -24,9 +24,7 @@ interface MultipleSelectExtendedProps<O extends object> extends ToResponsiveProp
24
24
  selectedRenderer?: (options: O[]) => React.ReactNode;
25
25
  error?: boolean;
26
26
  helperText?: string;
27
- containerProps?: JSX.IntrinsicElements['div'] & {
28
- css?: Interpolation;
29
- };
27
+ containerProps?: PrimitiveProps<JSX.IntrinsicElements['div']>;
30
28
  inputProps?: InputProps;
31
29
  displayCount?: number;
32
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/multiple-select/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAExD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAEnE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAE/E,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE1D,MAAM,MAAM,6BAA6B,GAAG,wBAAwB,CAAC;AAErE,MAAM,MAAM,yBAAyB,GAAG,MAAM,GAAG,MAAM,CAAC;AAExD,UAAU,2BAA2B,CAAC,CAAC,SAAS,MAAM,CAAE,SAAQ,iBAAiB,CAAC,6BAA6B,CAAC;IAE9G,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,YAAY,CAAC,EAAE,kBAAkB,CAAC,cAAc,CAAC,CA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"","sources":["../../../src/lib/phone-input/phone-input.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAmB,MAAM,SAAS,CAAC;AAsD3D,eAAO,MAAM,UAAU,kGAUpB,eAAe,qDAoJjB,CAAC"}
1
+ {"version":3,"file":"phone-input.d.ts","sourceRoot":"","sources":["../../../src/lib/phone-input/phone-input.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAmB,MAAM,SAAS,CAAC;AAuD3D,eAAO,MAAM,UAAU,kGAUpB,eAAe,qDA4JjB,CAAC"}
@@ -9,6 +9,7 @@ import { getColorShadesByVariant } from "../../utils/index.js";
9
9
  import { getColorVar } from "../../theme/palette.js";
10
10
  import { Select } from "../select/select.js";
11
11
  import { Flag } from "../flag/flag.js";
12
+ import { Primitive } from "../primitive/primitive.js";
12
13
  import { InputMask as ForwardRefInputMask } from "../input-mask/input-mask.js";
13
14
  import { Input } from "../input/input.js";
14
15
  import { FormHelperText } from "../form-helper-text/form-helper-text.js";
@@ -107,104 +108,116 @@ const PhoneInput = ({
107
108
  const originalValue = internalValue.nationalNumber ?? "";
108
109
  return inputFocused ? originalValue : originalValue.replace(/^(\d{1,3})(\d{0,3})?(\d*)$/, "$1 $2 $3");
109
110
  })();
110
- return /* @__PURE__ */ jsxs("div", { ...containerProps, css: [{ display: "flex", flexDirection: "column", width: "100%" }, containerProps == null ? void 0 : containerProps.css], children: [
111
- /* @__PURE__ */ jsx(
112
- ForwardRefInputMask,
113
- {
114
- ...props,
115
- css: [
116
- error && !selectOpen && {
117
- "&::after": { borderColor: getColorVar("red.600") }
118
- },
119
- inputFocused && {
120
- "&::after": { borderColor: getColorVar("primary.600") },
121
- boxShadow: `0 0 0 3px ${getColorVar("primary.300")}`
122
- },
123
- disabled && {
124
- backgroundColor: getColorShadesByVariant("neutral").disabledSurface,
125
- pointerEvents: "none"
126
- },
127
- props.css
128
- ],
129
- ref: mergedRefs,
130
- children: /* @__PURE__ */ jsxs("div", { css: { position: "absolute", inset: 0, display: "flex", alignItems: "center" }, children: [
131
- /* @__PURE__ */ jsx(
132
- Select,
133
- {
134
- containerProps: {
135
- sx: {
136
- width: "fit-content",
137
- minWidth: 80
138
- }
111
+ return /* @__PURE__ */ jsxs(
112
+ Primitive,
113
+ {
114
+ ...containerProps,
115
+ sx: {
116
+ display: "flex",
117
+ flexDirection: "column",
118
+ width: "100%",
119
+ ...containerProps == null ? void 0 : containerProps.sx
120
+ },
121
+ children: [
122
+ /* @__PURE__ */ jsx(
123
+ ForwardRefInputMask,
124
+ {
125
+ ...props,
126
+ css: [
127
+ error && !selectOpen && {
128
+ "&::after": { borderColor: getColorVar("red.600") }
139
129
  },
140
- css: {
141
- paddingRight: 0
130
+ inputFocused && {
131
+ "&::after": { borderColor: getColorVar("primary.600") },
132
+ boxShadow: `0 0 0 3px ${getColorVar("primary.300")}`
142
133
  },
143
- outline: {
144
- top: 0,
145
- right: 0,
146
- bottom: 0,
147
- left: 0
134
+ disabled && {
135
+ backgroundColor: getColorShadesByVariant("neutral").disabledSurface,
136
+ pointerEvents: "none"
148
137
  },
149
- listProps: {
150
- style: {
151
- width: wrapperWidth
138
+ props.css
139
+ ],
140
+ ref: mergedRefs,
141
+ children: /* @__PURE__ */ jsxs("div", { css: { position: "absolute", inset: 0, display: "flex", alignItems: "center" }, children: [
142
+ /* @__PURE__ */ jsx(
143
+ Select,
144
+ {
145
+ containerProps: {
146
+ sx: {
147
+ width: "fit-content",
148
+ minWidth: 80
149
+ }
150
+ },
151
+ css: {
152
+ paddingRight: 0
153
+ },
154
+ outline: {
155
+ top: 0,
156
+ right: 0,
157
+ bottom: 0,
158
+ left: 0
159
+ },
160
+ listProps: {
161
+ style: {
162
+ width: wrapperWidth
163
+ }
164
+ },
165
+ value: internalValue.countryCode ?? null,
166
+ onChange: onDialCodeChange,
167
+ options: countries,
168
+ disabled,
169
+ selectedRenderer: SelectedRenderer,
170
+ optionLabel: CountryRowLabel,
171
+ optionValue: "code",
172
+ optionSearchLabel: ["name", "dial_code", "code"],
173
+ open: selectOpen,
174
+ onOpenChange: setSelectOpen
152
175
  }
153
- },
154
- value: internalValue.countryCode ?? null,
155
- onChange: onDialCodeChange,
156
- options: countries,
157
- disabled,
158
- selectedRenderer: SelectedRenderer,
159
- optionLabel: CountryRowLabel,
160
- optionValue: "code",
161
- optionSearchLabel: ["name", "dial_code", "code"],
162
- open: selectOpen,
163
- onOpenChange: setSelectOpen
164
- }
165
- ),
166
- /* @__PURE__ */ jsx(
167
- "div",
168
- {
169
- css: {
170
- borderRight: "1px solid",
171
- borderColor: getColorVar("border.default"),
172
- height: "66.666667%",
173
- marginLeft: 8,
174
- marginRight: 8
175
- }
176
- }
177
- ),
178
- /* @__PURE__ */ jsx(
179
- Input,
180
- {
181
- value: inputDisplayValue,
182
- disabled,
183
- containerProps: {
184
- sx: {
185
- flex: 1
176
+ ),
177
+ /* @__PURE__ */ jsx(
178
+ "div",
179
+ {
180
+ css: {
181
+ borderRight: "1px solid",
182
+ borderColor: getColorVar("border.default"),
183
+ height: "66.666667%",
184
+ marginLeft: 8,
185
+ marginRight: 8
186
+ }
186
187
  }
187
- },
188
- mainProps: {
189
- style: {
190
- paddingLeft: 0,
191
- boxShadow: "none"
188
+ ),
189
+ /* @__PURE__ */ jsx(
190
+ Input,
191
+ {
192
+ value: inputDisplayValue,
193
+ disabled,
194
+ containerProps: {
195
+ sx: {
196
+ flex: 1
197
+ }
198
+ },
199
+ mainProps: {
200
+ style: {
201
+ paddingLeft: 0,
202
+ boxShadow: "none"
203
+ }
204
+ },
205
+ onChange: onNationalNumberChange,
206
+ sx: {
207
+ borderWidth: 0
208
+ },
209
+ onFocus: () => setInputFocused(true),
210
+ onBlur: () => setInputFocused(false),
211
+ ref: inputRef
192
212
  }
193
- },
194
- onChange: onNationalNumberChange,
195
- sx: {
196
- borderWidth: 0
197
- },
198
- onFocus: () => setInputFocused(true),
199
- onBlur: () => setInputFocused(false),
200
- ref: inputRef
201
- }
202
- )
203
- ] })
204
- }
205
- ),
206
- /* @__PURE__ */ jsx(FormHelperText, { error, children: helperText })
207
- ] });
213
+ )
214
+ ] })
215
+ }
216
+ ),
217
+ /* @__PURE__ */ jsx(FormHelperText, { error, children: helperText })
218
+ ]
219
+ }
220
+ );
208
221
  };
209
222
  export {
210
223
  PhoneInput
@@ -1,6 +1,7 @@
1
1
  import { JSX } from 'react';
2
2
  import { Interpolation } from '@emotion/react';
3
3
  import { SizeVariant, ShallowMerge, ToResponsiveProps } from '../../types';
4
+ import { PrimitiveProps } from '../primitive';
4
5
  export type PhoneInputResponsiveProps = {
5
6
  size?: Exclude<SizeVariant, 'xs'>;
6
7
  };
@@ -16,9 +17,7 @@ export type PhoneInputProps = ShallowMerge<JSX.IntrinsicElements['div'], {
16
17
  onChange?: (value: PhoneInputValue) => void;
17
18
  error?: boolean;
18
19
  helperText?: string;
19
- containerProps?: JSX.IntrinsicElements['div'] & {
20
- css?: Interpolation;
21
- };
20
+ containerProps?: PrimitiveProps<JSX.IntrinsicElements['div']>;
22
21
  disabled?: boolean;
23
22
  } & ToResponsiveProps<PhoneInputResponsiveProps>>;
24
23
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/phone-input/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEvE,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,CAAC,EAAE,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,C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,EAAE,aAAa,CAAC;IACpB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAC5C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,cAAc,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,iBAAiB,CAAC,yBAAyB,CAAC,CACjD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"radio-button.d.ts","sourceRoot":"","sources":["../../../src/lib/radio-button/radio-button.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAK3C,eAAO,MAAM,WAAW,4HAuBtB,CAAC"}
1
+ {"version":3,"file":"radio-button.d.ts","sourceRoot":"","sources":["../../../src/lib/radio-button/radio-button.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAM3C,eAAO,MAAM,WAAW,4HAsBtB,CAAC"}
@@ -4,20 +4,20 @@ import { getRadioButtonProps } from "./helpers.js";
4
4
  import classes from "./radio-button.module.scss.js";
5
5
  import { cn } from "../../utils/stylesheet.js";
6
6
  import { getColorShadesByVariant } from "../../utils/index.js";
7
+ import { Primitive } from "../primitive/primitive.js";
7
8
  const RadioButton = forwardRef((_props, ref) => {
8
9
  const { children, color = "primary", className, containerProps, ...props } = getRadioButtonProps(_props);
9
10
  const { main } = getColorShadesByVariant(color);
10
11
  return /* @__PURE__ */ jsxs(
11
- "label",
12
+ Primitive,
12
13
  {
13
14
  ...containerProps,
14
- css: [
15
- {
16
- "--radio-button-color": main
17
- },
18
- containerProps == null ? void 0 : containerProps.css
19
- ],
20
15
  className: cn(classes.radio_button__container, containerProps == null ? void 0 : containerProps.className),
16
+ sx: {
17
+ "--radio-button-color": main,
18
+ ...containerProps == null ? void 0 : containerProps.sx
19
+ },
20
+ as: "label",
21
21
  children: [
22
22
  /* @__PURE__ */ jsxs("span", { className: classes.radio_button__main, children: [
23
23
  /* @__PURE__ */ jsx("input", { ...props, className: cn(classes.radio_button__input, className), type: "radio", ref }),
@@ -1,11 +1,9 @@
1
1
  import { JSX } from 'react';
2
- import { Interpolation } from '@emotion/react';
3
2
  import { ColorVariant, ShallowMerge } from '../../types';
3
+ import { PrimitiveProps } from '../primitive';
4
4
  interface RadioButtonExtendedProps {
5
5
  color?: ColorVariant;
6
- containerProps?: JSX.IntrinsicElements['label'] & {
7
- css?: Interpolation;
8
- };
6
+ containerProps?: PrimitiveProps<JSX.IntrinsicElements['label']>;
9
7
  }
10
8
  export type RadioButtonProps = ShallowMerge<JSX.IntrinsicElements['input'], RadioButtonExtendedProps>;
11
9
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/radio-button/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAErD,UAAU,wBAAwB;IAChC,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,cAAc,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,OAAO,CAAC,GAAG;QAChD,GAAG,CAAC,EAAE,aAAa,CAAC;KACrB,CAAC;CACH;AAED,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,GAAG,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,wBAAwB,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/radio-button/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,UAAU,wBAAwB;IAChC,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,cAAc,CAAC,EAAE,cAAc,CAAC,GAAG,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;CACjE;AAED,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,GAAG,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,wBAAwB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../src/lib/textarea/textarea.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAA2B,MAAM,SAAS,CAAC;AAQjE,eAAO,MAAM,QAAQ,uBAAwB,aAAa,qDAkHzD,CAAC"}
1
+ {"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../src/lib/textarea/textarea.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAA2B,MAAM,SAAS,CAAC;AAUjE,eAAO,MAAM,QAAQ,uBAAwB,aAAa,qDAuHzD,CAAC"}
@@ -5,18 +5,20 @@ import { isString } from "lodash-es";
5
5
  import { getTextareaProps } from "./helpers.js";
6
6
  import classes from "./textarea.module.scss.js";
7
7
  import { getSizeVariantState } from "../../utils/index.js";
8
- import { createSxInterpolation, cn } from "../../utils/stylesheet.js";
9
- import { mediaQuery } from "../../theme/screens.js";
8
+ import { cn } from "../../utils/stylesheet.js";
10
9
  import "../../theme/palette.js";
11
10
  import { getTypographyVar } from "../../theme/typography.js";
11
+ import { Primitive } from "../primitive/primitive.js";
12
12
  import { FormHelperText } from "../form-helper-text/form-helper-text.js";
13
13
  const Textarea = ({ ref, ..._props }) => {
14
+ var _a, _b, _c;
14
15
  const {
15
16
  size,
16
17
  sm,
17
18
  md,
18
19
  lg,
19
20
  containerProps,
21
+ mainProps,
20
22
  className,
21
23
  helperText,
22
24
  error,
@@ -24,7 +26,6 @@ const Textarea = ({ ref, ..._props }) => {
24
26
  debounce = 0,
25
27
  mode = "onChange",
26
28
  value,
27
- sx,
28
29
  ...rest
29
30
  } = getTextareaProps(_props);
30
31
  const textareaRef = useRef(null);
@@ -58,45 +59,49 @@ const Textarea = ({ ref, ..._props }) => {
58
59
  onChangeProp == null ? void 0 : onChangeProp(e);
59
60
  };
60
61
  const onFocus = (e) => {
61
- var _a;
62
+ var _a2;
62
63
  beforeChangeValue.current = e.target.value;
63
- (_a = rest.onFocus) == null ? void 0 : _a.call(rest, e);
64
+ (_a2 = rest.onFocus) == null ? void 0 : _a2.call(rest, e);
64
65
  };
65
66
  const onBlur = (e) => {
66
- var _a;
67
+ var _a2;
67
68
  if (beforeChangeValue.current !== e.target.value) {
68
69
  if (mode === "onBlur" || debounce > 0) {
69
70
  onChange(e, true);
70
71
  }
71
72
  }
72
- (_a = rest.onBlur) == null ? void 0 : _a.call(rest, e);
73
+ (_a2 = rest.onBlur) == null ? void 0 : _a2.call(rest, e);
73
74
  setTimeout(() => {
74
75
  setTypingValue(void 0);
75
76
  }, debounce);
76
77
  };
77
- const css = [
78
- {
79
- paddingTop: 8,
80
- paddingBottom: 8
81
- },
82
- createStyle({ size }),
83
- {
84
- [mediaQuery("sm")]: createStyle(sm),
85
- [mediaQuery("md")]: createStyle(md),
86
- [mediaQuery("lg")]: createStyle(lg)
87
- },
88
- createSxInterpolation(sx)
89
- ];
90
- const { sx: containerSx, ...restContainerProps } = containerProps ?? {};
91
- return /* @__PURE__ */ jsxs(
92
- "div",
93
- {
94
- ...restContainerProps,
95
- css: createSxInterpolation(containerSx),
96
- className: cn(classes.textarea__container, restContainerProps.className),
97
- children: [
98
- /* @__PURE__ */ jsx("div", { css, className: classes.textarea__main, children: /* @__PURE__ */ jsx(
99
- "textarea",
78
+ return /* @__PURE__ */ jsxs(Primitive, { ...containerProps, className: cn(classes.textarea__container, containerProps == null ? void 0 : containerProps.className), children: [
79
+ /* @__PURE__ */ jsx(
80
+ Primitive,
81
+ {
82
+ ...mainProps,
83
+ sx: {
84
+ display: "flex",
85
+ paddingTop: 4,
86
+ paddingBottom: 4,
87
+ ...createStyle({ size }),
88
+ ...mainProps == null ? void 0 : mainProps.sx,
89
+ sm: {
90
+ ...createStyle(sm),
91
+ ...(_a = mainProps == null ? void 0 : mainProps.sx) == null ? void 0 : _a.sm
92
+ },
93
+ md: {
94
+ ...createStyle(md),
95
+ ...(_b = mainProps == null ? void 0 : mainProps.sx) == null ? void 0 : _b.md
96
+ },
97
+ lg: {
98
+ ...createStyle(lg),
99
+ ...(_c = mainProps == null ? void 0 : mainProps.sx) == null ? void 0 : _c.lg
100
+ }
101
+ },
102
+ className: cn(classes.textarea__main, mainProps == null ? void 0 : mainProps.className),
103
+ children: /* @__PURE__ */ jsx(
104
+ Primitive,
100
105
  {
101
106
  "aria-invalid": error,
102
107
  className: cn(
@@ -108,24 +113,23 @@ const Textarea = ({ ref, ..._props }) => {
108
113
  ref: mergedRefs,
109
114
  onChange,
110
115
  onBlur,
111
- onFocus
116
+ onFocus,
117
+ as: "textarea"
112
118
  }
113
- ) }),
114
- /* @__PURE__ */ jsx(FormHelperText, { error, children: helperText })
115
- ]
116
- }
117
- );
119
+ )
120
+ }
121
+ ),
122
+ /* @__PURE__ */ jsx(FormHelperText, { error, children: helperText })
123
+ ] });
118
124
  };
119
125
  const createStyle = ({ size } = {}) => {
120
126
  const { inputPaddingX, textVariant } = getSizeVariantState(size);
121
- return [
122
- {
123
- paddingLeft: inputPaddingX,
124
- paddingRight: inputPaddingX,
125
- fontSize: textVariant ? getTypographyVar(textVariant).fontSize : void 0,
126
- lineHeight: textVariant ? getTypographyVar(textVariant).lineHeight : void 0
127
- }
128
- ];
127
+ return {
128
+ paddingLeft: inputPaddingX,
129
+ paddingRight: inputPaddingX,
130
+ fontSize: textVariant ? getTypographyVar(textVariant).fontSize : void 0,
131
+ lineHeight: textVariant ? getTypographyVar(textVariant).lineHeight : void 0
132
+ };
129
133
  };
130
134
  export {
131
135
  Textarea
@@ -1,11 +1,12 @@
1
1
  import { JSX } from 'react';
2
2
  import { SizeVariant, ShallowMerge, PropsWithSx, ToResponsiveProps } from '../../types';
3
+ import { PrimitiveProps } from '../primitive';
3
4
  export interface TextareaResponsiveProps {
4
5
  size?: SizeVariant;
5
6
  }
6
7
  type TextareaExtendedProps = PropsWithSx<ToResponsiveProps<TextareaResponsiveProps> & {
7
8
  containerProps?: PropsWithSx<JSX.IntrinsicElements['div']>;
8
- mainProps?: JSX.IntrinsicElements['div'];
9
+ mainProps?: PrimitiveProps<JSX.IntrinsicElements['div']>;
9
10
  helperText?: string;
10
11
  error?: boolean;
11
12
  value?: string;
@@ -13,6 +14,6 @@ type TextareaExtendedProps = PropsWithSx<ToResponsiveProps<TextareaResponsivePro
13
14
  mode?: 'onChange' | 'onBlur';
14
15
  debounce?: number;
15
16
  }>;
16
- export type TextareaProps = ShallowMerge<JSX.IntrinsicElements['textarea'], TextareaExtendedProps>;
17
+ export type TextareaProps = ShallowMerge<PrimitiveProps<JSX.IntrinsicElements['textarea']>, TextareaExtendedProps>;
17
18
  export {};
18
19
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/textarea/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEpF,MAAM,WAAW,uBAAuB;IACtC,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AAED,KAAK,qBAAqB,GAAG,WAAW,CACtC,iBAAiB,CAAC,uBAAuB,CAAC,GAAG;IAC3C,cAAc,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,iBAAiB,CAAC,KA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,CAAC,EAAE,MAAM,CAAC;CACnB,CACF,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC,cAAc,CAAC,GAAG,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC,EAAE,qBAAqB,CAAC,CAAC"}
@@ -1,10 +1,4 @@
1
- import { ComponentType, JSX } from 'react';
1
+ import { PropsWithSx } from '../../types';
2
2
  import { ReactPlayerProps } from 'react-player/types';
3
- import { PropsWithSx, ShallowMerge } from '../../types';
4
- type VideoExtendedProps = PropsWithSx<{
5
- containerProps?: JSX.IntrinsicElements['div'];
6
- PlayerComponent?: ComponentType<ReactPlayerProps>;
7
- }>;
8
- export type VideoProps = ShallowMerge<ReactPlayerProps, VideoExtendedProps>;
9
- export {};
3
+ export type VideoProps = PropsWithSx<ReactPlayerProps>;
10
4
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/video/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEpD,KAAK,kBAAkB,GAAG,WAAW,CAAC;IAEpC,cAAc,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC9C,eAAe,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;CACnD,CAAC,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,YAAY,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/video/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC,gBAAgB,CAAC,CAAC"}
@@ -1,3 +1,3 @@
1
1
  import { VideoProps } from './types';
2
- export declare const Video: ({ ref, containerProps, PlayerComponent, ..._props }: VideoProps) => import("@emotion/react/jsx-runtime").JSX.Element;
2
+ export declare const Video: ({ ref, ..._props }: VideoProps) => import("@emotion/react/jsx-runtime").JSX.Element;
3
3
  //# sourceMappingURL=video.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../../../src/lib/video/video.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAIrC,eAAO,MAAM,KAAK,wDAAyD,UAAU,qDAUpF,CAAC"}
1
+ {"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../../../src/lib/video/video.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAIrC,eAAO,MAAM,KAAK,uBAAwB,UAAU,qDAInD,CAAC"}
@@ -1,12 +1,10 @@
1
1
  import { jsx } from "@emotion/react/jsx-runtime";
2
- import { createElement } from "react";
3
2
  import ReactPlayer from "react-player";
4
3
  import { getVideoProps } from "./helpers.js";
5
4
  import { createSxInterpolation } from "../../utils/stylesheet.js";
6
- const Video = ({ ref, containerProps, PlayerComponent, ..._props }) => {
5
+ const Video = ({ ref, ..._props }) => {
7
6
  const { sx, ...rest } = getVideoProps(_props);
8
- const css = [createSxInterpolation(sx)];
9
- return /* @__PURE__ */ jsx("div", { css, ...containerProps, children: PlayerComponent ? createElement(PlayerComponent, rest) : /* @__PURE__ */ jsx(ReactPlayer, { width: "", height: "", ref, ...rest }) });
7
+ return /* @__PURE__ */ jsx(ReactPlayer, { css: createSxInterpolation(sx), width: "", height: "", ref, ...rest });
10
8
  };
11
9
  export {
12
10
  Video
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@janbox/storefront-ui",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Storefront UI component library for Janbox",
5
5
  "author": "Janbox",
6
6
  "keywords": [