@janbox/storefront-ui 2.0.1 → 2.0.3

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 (47) 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/tabs/tab-indicator/tab-indicator.d.ts.map +1 -1
  33. package/dist/lib/tabs/tab-indicator/tab-indicator.js +11 -2
  34. package/dist/lib/tabs/tabs/helpers.d.ts.map +1 -1
  35. package/dist/lib/tabs/tabs/helpers.js +2 -4
  36. package/dist/lib/textarea/textarea.d.ts.map +1 -1
  37. package/dist/lib/textarea/textarea.js +48 -44
  38. package/dist/lib/textarea/types.d.ts +3 -2
  39. package/dist/lib/textarea/types.d.ts.map +1 -1
  40. package/dist/lib/unordered-list/unordered-list/helpers.d.ts.map +1 -1
  41. package/dist/lib/unordered-list/unordered-list/helpers.js +1 -3
  42. package/dist/lib/video/types.d.ts +2 -8
  43. package/dist/lib/video/types.d.ts.map +1 -1
  44. package/dist/lib/video/video.d.ts +1 -1
  45. package/dist/lib/video/video.d.ts.map +1 -1
  46. package/dist/lib/video/video.js +2 -4
  47. package/package.json +1 -1
@@ -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,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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,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,YAAY,CACxC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAC5B;IACE,GAAG,CAAC,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":"tab-indicator.d.ts","sourceRoot":"","sources":["../../../../src/lib/tabs/tab-indicator/tab-indicator.tsx"],"names":[],"mappings":"AAaA,eAAO,MAAM,YAAY,wDAqFxB,CAAC"}
1
+ {"version":3,"file":"tab-indicator.d.ts","sourceRoot":"","sources":["../../../../src/lib/tabs/tab-indicator/tab-indicator.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,YAAY,wDA8FxB,CAAC"}
@@ -53,7 +53,7 @@ const TabIndicator = () => {
53
53
  resizeObserver.disconnect();
54
54
  };
55
55
  }, [activeTabElement]);
56
- const css = [
56
+ [
57
57
  {
58
58
  position: "absolute",
59
59
  bottom: 0,
@@ -75,7 +75,16 @@ const TabIndicator = () => {
75
75
  transform: `translateX(${indicatorRect.left}px)`
76
76
  },
77
77
  ref: indicatorEl,
78
- css
78
+ css: [
79
+ {
80
+ position: "absolute",
81
+ bottom: 0,
82
+ left: 0,
83
+ backgroundColor: "currentcolor",
84
+ borderRadius: 8
85
+ },
86
+ createSxInterpolation(tabIndicatorProps == null ? void 0 : tabIndicatorProps.sx)
87
+ ]
79
88
  }
80
89
  );
81
90
  };
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/lib/tabs/tabs/helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AA0BpC,eAAO,MAAM,YAAY,aAAc,SAAS,cAE/C,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IACjC,iBAAiB,CAAC,EAAE,SAAS,CAAC,mBAAmB,CAAC,CAAC;IACnD,aAAa,CAAC,EAAE,SAAS,CAAC,eAAe,CAAC,CAAC;IAC3C,sBAAsB,EAAE,SAAS,CAAC,wBAAwB,CAAC,CAAC;CAC7D,CAAC;AAEF,eAAO,MAAM,WAAW,2CAAwC,CAAC;AAEjE,eAAO,MAAM,cAAc,wBAE1B,CAAC"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/lib/tabs/tabs/helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAwBpC,eAAO,MAAM,YAAY,aAAc,SAAS,cAE/C,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IACjC,iBAAiB,CAAC,EAAE,SAAS,CAAC,mBAAmB,CAAC,CAAC;IACnD,aAAa,CAAC,EAAE,SAAS,CAAC,eAAe,CAAC,CAAC;IAC3C,sBAAsB,EAAE,SAAS,CAAC,wBAAwB,CAAC,CAAC;CAC7D,CAAC;AAEF,eAAO,MAAM,WAAW,2CAAwC,CAAC;AAEjE,eAAO,MAAM,cAAc,wBAE1B,CAAC"}
@@ -15,10 +15,8 @@ const defaultProps = {
15
15
  },
16
16
  tabIndicatorProps: {
17
17
  sx: {
18
- xs: {
19
- height: 2,
20
- backgroundColor: getColorVar("primary.600")
21
- }
18
+ height: 2,
19
+ backgroundColor: getColorVar("primary.600")
22
20
  }
23
21
  }
24
22
  };
@@ -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,K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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 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/lib/unordered-list/unordered-list/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAY7C,eAAO,MAAM,qBAAqB,aAAc,kBAAkB,uBAEjE,CAAC"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/lib/unordered-list/unordered-list/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAU7C,eAAO,MAAM,qBAAqB,aAAc,kBAAkB,uBAEjE,CAAC"}
@@ -1,9 +1,7 @@
1
1
  import { mergeComponentProps } from "../../../utils/index.js";
2
2
  const defaultProps = {
3
3
  sx: {
4
- xs: {
5
- alignItems: "flex-start"
6
- }
4
+ alignItems: "flex-start"
7
5
  }
8
6
  };
9
7
  const getUnorderedListProps = (extended) => {
@@ -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.3",
4
4
  "description": "Storefront UI component library for Janbox",
5
5
  "author": "Janbox",
6
6
  "keywords": [