@janbox/storefront-ui 1.0.16 → 1.0.17

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.
@@ -1,4 +1,5 @@
1
1
  import { JSX } from 'react';
2
- export type BlockSkeletonProps = JSX.IntrinsicElements['div'];
2
+ import { PrimitiveProps } from '../../primitive';
3
+ export type BlockSkeletonProps = PrimitiveProps<JSX.IntrinsicElements['div'], HTMLDivElement>;
3
4
  export declare const BlockSkeleton: (props: BlockSkeletonProps) => import("@emotion/react/jsx-runtime").JSX.Element;
4
5
  //# sourceMappingURL=block-skeleton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"block-skeleton.d.ts","sourceRoot":"","sources":["../../../../src/lib/loading/block-skeleton/block-skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAK5B,MAAM,MAAM,kBAAkB,GAAG,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;AAE9D,eAAO,MAAM,aAAa,UAAW,kBAAkB,qDAEtD,CAAC"}
1
+ {"version":3,"file":"block-skeleton.d.ts","sourceRoot":"","sources":["../../../../src/lib/loading/block-skeleton/block-skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAI5B,OAAO,EAAa,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE5D,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC,CAAC;AAE9F,eAAO,MAAM,aAAa,UAAW,kBAAkB,qDAItD,CAAC"}
@@ -2,8 +2,9 @@ import { jsx } from "@emotion/react/jsx-runtime";
2
2
  import { animatePulseStyle } from "../../../constants/emotion.js";
3
3
  import "lodash-es";
4
4
  import { getColorVar } from "../../../theme/palette.js";
5
+ import { Primitive } from "../../primitive/primitive.js";
5
6
  const BlockSkeleton = (props) => {
6
- return /* @__PURE__ */ jsx("div", { css: [animatePulseStyle, { borderRadius: 4, backgroundColor: getColorVar("neutral.200") }], ...props });
7
+ return /* @__PURE__ */ jsx(Primitive, { css: [animatePulseStyle, { borderRadius: 4, backgroundColor: getColorVar("neutral.200") }], ...props });
7
8
  };
8
9
  export {
9
10
  BlockSkeleton
@@ -1 +1 @@
1
- {"version":3,"file":"image-skeleton.d.ts","sourceRoot":"","sources":["../../../../src/lib/loading/image-skeleton/image-skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAK7C,eAAO,MAAM,aAAa,UAAW,kBAAkB,qDA4BtD,CAAC"}
1
+ {"version":3,"file":"image-skeleton.d.ts","sourceRoot":"","sources":["../../../../src/lib/loading/image-skeleton/image-skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAM7C,eAAO,MAAM,aAAa,UAAW,kBAAkB,qDA4BtD,CAAC"}
@@ -2,9 +2,10 @@ import { jsx } from "@emotion/react/jsx-runtime";
2
2
  import { animatePulseStyle } from "../../../constants/emotion.js";
3
3
  import "lodash-es";
4
4
  import { getColorVar } from "../../../theme/palette.js";
5
+ import { Primitive } from "../../primitive/primitive.js";
5
6
  const ImageSkeleton = (props) => {
6
7
  return /* @__PURE__ */ jsx(
7
- "div",
8
+ Primitive,
8
9
  {
9
10
  css: [
10
11
  animatePulseStyle,
@@ -1,3 +1,4 @@
1
+ import { PrimitiveProps } from '../../primitive';
1
2
  import { JSX } from 'react';
2
- export type ImageSkeletonProps = JSX.IntrinsicElements['div'];
3
+ export type ImageSkeletonProps = PrimitiveProps<JSX.IntrinsicElements['div'], HTMLDivElement>;
3
4
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/loading/image-skeleton/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,MAAM,MAAM,kBAAkB,GAAG,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/loading/image-skeleton/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC,CAAC"}
@@ -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;AAO9C,eAAO,MAAM,cAAc,qEAQxB,mBAAmB,qDAkCrB,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,qDAkCrB,CAAC"}
@@ -3,6 +3,7 @@ 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 { Primitive } from "../../primitive/primitive.js";
6
7
  const LoadingOverlay = ({
7
8
  isLoading = false,
8
9
  iconProps,
@@ -14,7 +15,7 @@ const LoadingOverlay = ({
14
15
  }) => {
15
16
  const { main } = getColorShadesByVariant(color);
16
17
  return /* @__PURE__ */ jsxs(
17
- "div",
18
+ Primitive,
18
19
  {
19
20
  style: {
20
21
  minWidth: size,
@@ -1,6 +1,7 @@
1
1
  import { JSX } from 'react';
2
2
  import { ColorVariant, ShallowMerge } from '../../../types';
3
- export type LoadingOverlayProps = ShallowMerge<JSX.IntrinsicElements['div'], {
3
+ import { PrimitiveProps } from '../../primitive';
4
+ export type LoadingOverlayProps = ShallowMerge<PrimitiveProps<JSX.IntrinsicElements['div'], HTMLDivElement>, {
4
5
  isLoading?: boolean;
5
6
  size?: number;
6
7
  color?: ColorVariant;
@@ -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,EAAC,YAAY,EAAE,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAE1D,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAC5C,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAC5B;IACE,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,CACF,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,YAAY,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAC5C,cAAc,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC,EAC5D;IACE,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,CACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"text-skeleton.d.ts","sourceRoot":"","sources":["../../../../src/lib/loading/text-skeleton/text-skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAK5C,eAAO,MAAM,YAAY,UAAW,iBAAiB,qDAcpD,CAAC"}
1
+ {"version":3,"file":"text-skeleton.d.ts","sourceRoot":"","sources":["../../../../src/lib/loading/text-skeleton/text-skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAM5C,eAAO,MAAM,YAAY,UAAW,iBAAiB,qDAkBpD,CAAC"}
@@ -2,20 +2,29 @@ import { jsxs, jsx } from "@emotion/react/jsx-runtime";
2
2
  import { animatePulseStyle } from "../../../constants/emotion.js";
3
3
  import "lodash-es";
4
4
  import { getColorVar } from "../../../theme/palette.js";
5
+ import { Primitive } from "../../primitive/primitive.js";
5
6
  const TextSkeleton = (props) => {
6
- return /* @__PURE__ */ jsxs("span", { css: { width: "100%", overflow: "hidden", display: "inline-flex", alignItems: "center" }, ...props, children: [
7
- /* @__PURE__ */ jsx(
8
- "span",
9
- {
10
- css: [
11
- animatePulseStyle,
12
- { flex: "1 1 0%", borderRadius: "0.125rem", lineHeight: 1, backgroundColor: getColorVar("neutral.200") }
13
- ],
14
- children: " "
15
- }
16
- ),
17
- " "
18
- ] });
7
+ return /* @__PURE__ */ jsxs(
8
+ Primitive,
9
+ {
10
+ as: "span",
11
+ css: { width: "100%", overflow: "hidden", display: "inline-flex", alignItems: "center" },
12
+ ...props,
13
+ children: [
14
+ /* @__PURE__ */ jsx(
15
+ "span",
16
+ {
17
+ css: [
18
+ animatePulseStyle,
19
+ { flex: "1 1 0%", borderRadius: "0.125rem", lineHeight: 1, backgroundColor: getColorVar("neutral.200") }
20
+ ],
21
+ children: " "
22
+ }
23
+ ),
24
+ " "
25
+ ]
26
+ }
27
+ );
19
28
  };
20
29
  export {
21
30
  TextSkeleton
@@ -1,3 +1,4 @@
1
+ import { PrimitiveProps } from '../../primitive';
1
2
  import { JSX } from 'react';
2
- export type TextSkeletonProps = JSX.IntrinsicElements['p'];
3
+ export type TextSkeletonProps = PrimitiveProps<JSX.IntrinsicElements['span'], HTMLSpanElement>;
3
4
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/loading/text-skeleton/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,MAAM,MAAM,iBAAiB,GAAG,GAAG,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/loading/text-skeleton/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,GAAG,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC,CAAC"}
@@ -1,3 +1,3 @@
1
1
  import { PhoneInputProps } from './types';
2
- export declare const PhoneInput: import('react').ForwardRefExoticComponent<Omit<PhoneInputProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
2
+ export declare const PhoneInput: ({ error, defaultValue, value, onChange, containerProps, helperText, disabled, ref, ...props }: PhoneInputProps) => import("@emotion/react/jsx-runtime").JSX.Element;
3
3
  //# sourceMappingURL=phone-input.d.ts.map
@@ -1 +1 @@
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;AAsD3D,eAAO,MAAM,UAAU,yHAqJtB,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;AAsD3D,eAAO,MAAM,UAAU,kGAUpB,eAAe,qDAwJjB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from "@emotion/react/jsx-runtime";
2
- import { forwardRef, useState, useRef, useEffect } from "react";
2
+ import { useState, useRef, useEffect } from "react";
3
3
  import { useMergeRefs } from "@floating-ui/react";
4
4
  import { isNil } from "lodash-es";
5
5
  import { phone } from "phone";
@@ -46,157 +46,170 @@ const parsePhoneInputValue = (value) => {
46
46
  countryCode: countryIso2 ?? ((_b = countries.find((country) => country.dial_code === value.dialCode)) == null ? void 0 : _b.code)
47
47
  };
48
48
  };
49
- const PhoneInput = forwardRef(
50
- ({ error, defaultValue, value, onChange, containerProps, helperText, disabled, ...props }, ref) => {
51
- var _a;
52
- const [selectOpen, setSelectOpen] = useState(false);
53
- const [inputFocused, setInputFocused] = useState(false);
54
- const inputRef = useRef(null);
55
- const wrapperRef = useRef(null);
56
- const mergedRefs = useMergeRefs([ref, wrapperRef]);
57
- const [wrapperWidth, setWrapperWidth] = useState(0);
58
- useEffect(() => {
59
- const resizeObserver = new ResizeObserver((entries) => {
60
- var _a2;
61
- const domRect = (_a2 = entries.at(0)) == null ? void 0 : _a2.target.getBoundingClientRect();
62
- if (domRect) {
63
- setWrapperWidth(domRect.width);
64
- }
65
- });
66
- if (wrapperRef.current) {
67
- resizeObserver.observe(wrapperRef.current);
49
+ const PhoneInput = ({
50
+ error,
51
+ defaultValue,
52
+ value,
53
+ onChange,
54
+ containerProps,
55
+ helperText,
56
+ disabled,
57
+ ref,
58
+ ...props
59
+ }) => {
60
+ var _a;
61
+ const [selectOpen, setSelectOpen] = useState(false);
62
+ const [inputFocused, setInputFocused] = useState(false);
63
+ const inputRef = useRef(null);
64
+ const wrapperRef = useRef(null);
65
+ const mergedRefs = useMergeRefs([ref, wrapperRef]);
66
+ const [wrapperWidth, setWrapperWidth] = useState(0);
67
+ useEffect(() => {
68
+ const resizeObserver = new ResizeObserver((entries) => {
69
+ var _a2;
70
+ const domRect = (_a2 = entries.at(0)) == null ? void 0 : _a2.target.getBoundingClientRect();
71
+ if (domRect) {
72
+ setWrapperWidth(domRect.width);
68
73
  }
69
- return () => resizeObserver.disconnect();
70
- }, []);
71
- const [internalValue, setInternalValue] = useControllableState({
72
- defaultValue: parsePhoneInputValue(defaultValue) ?? {
73
- countryCode: (_a = countries.at(0)) == null ? void 0 : _a.code
74
- },
75
- value: parsePhoneInputValue(value)
76
74
  });
77
- const triggerChange = (next) => {
78
- setInternalValue(next);
79
- onChange == null ? void 0 : onChange(next);
80
- };
81
- const onDialCodeChange = (_, option) => {
82
- var _a2;
83
- triggerChange({
84
- ...internalValue,
85
- dialCode: option.dial_code,
86
- countryCode: option.code
87
- });
88
- (_a2 = inputRef.current) == null ? void 0 : _a2.select();
89
- };
90
- const onNationalNumberChange = (e) => {
91
- e.target.value = e.target.value.replace(/[^0-9]/g, "");
92
- triggerChange({
93
- ...internalValue,
94
- nationalNumber: e.target.value
95
- });
96
- };
97
- const inputDisplayValue = (() => {
98
- const originalValue = internalValue.nationalNumber ?? "";
99
- return inputFocused ? originalValue : originalValue.replace(/^(\d{1,3})(\d{0,3})?(\d*)$/, "$1 $2 $3");
100
- })();
101
- return /* @__PURE__ */ jsxs("div", { ...containerProps, css: [{ display: "flex", flexDirection: "column", width: "100%" }, containerProps == null ? void 0 : containerProps.css], children: [
102
- /* @__PURE__ */ jsx(
103
- ForwardRefInputMask,
104
- {
105
- ...props,
106
- css: [
107
- error && !selectOpen && {
108
- "&::after": { borderColor: getColorVar("red.600") }
109
- },
110
- inputFocused && {
111
- "&::after": { borderColor: getColorVar("primary.600") },
112
- boxShadow: `0 0 0 3px ${getColorVar("primary.300")}`
113
- },
114
- disabled && {
115
- backgroundColor: getColorShadesByVariant("neutral").disabledSurface,
116
- pointerEvents: "none"
117
- },
118
- props.css
119
- ],
120
- ref: mergedRefs,
121
- children: /* @__PURE__ */ jsxs("div", { css: { position: "absolute", inset: 0, display: "flex", alignItems: "center" }, children: [
122
- /* @__PURE__ */ jsx(
123
- Select,
124
- {
125
- containerProps: {
126
- css: { width: "fit-content", minWidth: 80 }
127
- },
128
- css: {
129
- paddingRight: 0
130
- },
75
+ if (wrapperRef.current) {
76
+ resizeObserver.observe(wrapperRef.current);
77
+ }
78
+ return () => resizeObserver.disconnect();
79
+ }, []);
80
+ const [internalValue, setInternalValue] = useControllableState({
81
+ defaultValue: parsePhoneInputValue(defaultValue) ?? {
82
+ countryCode: (_a = countries.at(0)) == null ? void 0 : _a.code
83
+ },
84
+ value: parsePhoneInputValue(value)
85
+ });
86
+ const triggerChange = (next) => {
87
+ setInternalValue(next);
88
+ onChange == null ? void 0 : onChange(next);
89
+ };
90
+ const onDialCodeChange = (_, option) => {
91
+ var _a2;
92
+ triggerChange({
93
+ ...internalValue,
94
+ dialCode: option.dial_code,
95
+ countryCode: option.code
96
+ });
97
+ (_a2 = inputRef.current) == null ? void 0 : _a2.select();
98
+ };
99
+ const onNationalNumberChange = (e) => {
100
+ e.target.value = e.target.value.replace(/[^0-9]/g, "");
101
+ triggerChange({
102
+ ...internalValue,
103
+ nationalNumber: e.target.value
104
+ });
105
+ };
106
+ const inputDisplayValue = (() => {
107
+ const originalValue = internalValue.nationalNumber ?? "";
108
+ return inputFocused ? originalValue : originalValue.replace(/^(\d{1,3})(\d{0,3})?(\d*)$/, "$1 $2 $3");
109
+ })();
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: {
131
135
  xs: {
132
- outline: {
133
- top: 0,
134
- right: 0,
135
- bottom: 0,
136
- left: 0
137
- }
138
- },
139
- listProps: {
140
- style: {
141
- width: wrapperWidth
136
+ css: {
137
+ width: "fit-content",
138
+ minWidth: 80
142
139
  }
143
- },
144
- value: internalValue.countryCode ?? null,
145
- onChange: onDialCodeChange,
146
- options: countries,
147
- disabled,
148
- selectedRenderer: SelectedRenderer,
149
- optionLabel: CountryRowLabel,
150
- optionValue: "code",
151
- optionSearchLabel: ["name", "dial_code", "code"],
152
- open: selectOpen,
153
- onOpenChange: setSelectOpen
140
+ }
141
+ },
142
+ css: {
143
+ paddingRight: 0
144
+ },
145
+ xs: {
146
+ outline: {
147
+ top: 0,
148
+ right: 0,
149
+ bottom: 0,
150
+ left: 0
151
+ }
152
+ },
153
+ listProps: {
154
+ style: {
155
+ width: wrapperWidth
156
+ }
157
+ },
158
+ value: internalValue.countryCode ?? null,
159
+ onChange: onDialCodeChange,
160
+ options: countries,
161
+ disabled,
162
+ selectedRenderer: SelectedRenderer,
163
+ optionLabel: CountryRowLabel,
164
+ optionValue: "code",
165
+ optionSearchLabel: ["name", "dial_code", "code"],
166
+ open: selectOpen,
167
+ onOpenChange: setSelectOpen
168
+ }
169
+ ),
170
+ /* @__PURE__ */ jsx(
171
+ "div",
172
+ {
173
+ css: {
174
+ borderRight: "1px solid",
175
+ borderColor: getColorVar("border.default"),
176
+ height: "66.666667%",
177
+ marginLeft: 8,
178
+ marginRight: 8
154
179
  }
155
- ),
156
- /* @__PURE__ */ jsx(
157
- "div",
158
- {
180
+ }
181
+ ),
182
+ /* @__PURE__ */ jsx(
183
+ Input,
184
+ {
185
+ value: inputDisplayValue,
186
+ disabled,
187
+ containerProps: {
188
+ css: { flex: 1 }
189
+ },
190
+ mainProps: {
191
+ style: {
192
+ paddingLeft: 0,
193
+ boxShadow: "none"
194
+ }
195
+ },
196
+ onChange: onNationalNumberChange,
197
+ xs: {
159
198
  css: {
160
- borderRight: "1px solid",
161
- borderColor: getColorVar("border.default"),
162
- height: "66.666667%",
163
- marginLeft: 8,
164
- marginRight: 8
199
+ borderWidth: 0
165
200
  }
166
- }
167
- ),
168
- /* @__PURE__ */ jsx(
169
- Input,
170
- {
171
- value: inputDisplayValue,
172
- disabled,
173
- containerProps: {
174
- css: { flex: 1 }
175
- },
176
- mainProps: {
177
- style: {
178
- paddingLeft: 0,
179
- boxShadow: "none"
180
- }
181
- },
182
- onChange: onNationalNumberChange,
183
- xs: {
184
- css: {
185
- borderWidth: 0
186
- }
187
- },
188
- onFocus: () => setInputFocused(true),
189
- onBlur: () => setInputFocused(false),
190
- ref: inputRef
191
- }
192
- )
193
- ] })
194
- }
195
- ),
196
- /* @__PURE__ */ jsx(FormHelperText, { error, children: helperText })
197
- ] });
198
- }
199
- );
201
+ },
202
+ onFocus: () => setInputFocused(true),
203
+ onBlur: () => setInputFocused(false),
204
+ ref: inputRef
205
+ }
206
+ )
207
+ ] })
208
+ }
209
+ ),
210
+ /* @__PURE__ */ jsx(FormHelperText, { error, children: helperText })
211
+ ] });
212
+ };
200
213
  export {
201
214
  PhoneInput
202
215
  };
@@ -1 +1 @@
1
- {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/lib/select/select.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAkBzD,eAAO,MAAM,MAAM,GAAI,CAAC,SAAS,iBAAiB,sBAAsB,CAAC,SAAS,MAAM,8BAGrF,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,qDAwUnB,CAAC"}
1
+ {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/lib/select/select.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAkBzD,eAAO,MAAM,MAAM,GAAI,CAAC,SAAS,iBAAiB,sBAAsB,CAAC,SAAS,MAAM,8BAGrF,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,qDAyUnB,CAAC"}
@@ -17,6 +17,7 @@ import { FloatingTrigger } from "../floating/floating-trigger/floating-trigger.j
17
17
  import { InputMask as ForwardRefInputMask } from "../input-mask/input-mask.js";
18
18
  import { FloatingContent } from "../floating/floating-content/floating-content.js";
19
19
  import { Input } from "../input/input.js";
20
+ import { Primitive } from "../primitive/primitive.js";
20
21
  import { FormHelperText } from "../form-helper-text/form-helper-text.js";
21
22
  const DEFAULT_DISPLAY_ROW_COUNT = 5;
22
23
  const Select = ({
@@ -201,15 +202,16 @@ const Select = ({
201
202
  return () => clearTimeout(timer);
202
203
  }, [isOpen, setInputValue]);
203
204
  return /* @__PURE__ */ jsxs(
204
- "div",
205
+ Primitive,
205
206
  {
206
207
  ...containerProps,
207
- css: {
208
- display: "flex",
209
- flexDirection: "column",
210
- ...fullWidth ? { width: "100%" } : {},
211
- ...containerProps == null ? void 0 : containerProps.css
212
- },
208
+ css: [
209
+ {
210
+ display: "flex",
211
+ flexDirection: "column"
212
+ },
213
+ fullWidth && { width: "100%" }
214
+ ],
213
215
  children: [
214
216
  /* @__PURE__ */ jsxs(
215
217
  Floating,
@@ -4,6 +4,7 @@ import { Placement, UseFloatingOptions } from '@floating-ui/react';
4
4
  import { InputProps } from '../input';
5
5
  import { InputMaskProps, InputMaskResponsiveProps } from '../input-mask/types';
6
6
  import { ResponsiveDesign, ShallowMerge } from '../../types';
7
+ import { PrimitiveProps } from '../primitive';
7
8
  export type SelectResponsiveProps = InputMaskResponsiveProps;
8
9
  export type SelectOptionValue = string | number | boolean;
9
10
  interface SelectExtendedProps<V extends SelectOptionValue, O extends object> extends ResponsiveDesign<SelectResponsiveProps> {
@@ -24,9 +25,7 @@ interface SelectExtendedProps<V extends SelectOptionValue, O extends object> ext
24
25
  selectedRenderer?: (option: O) => React.ReactNode;
25
26
  error?: boolean;
26
27
  helperText?: string;
27
- containerProps?: JSX.IntrinsicElements['div'] & {
28
- css?: Interpolation;
29
- };
28
+ containerProps?: PrimitiveProps<JSX.IntrinsicElements['div'], HTMLDivElement>;
30
29
  inputProps?: InputProps;
31
30
  fullWidth?: boolean;
32
31
  lazy?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/select/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,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,gBAAgB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEzD,MAAM,MAAM,qBAAqB,GAAG,wBAAwB,CAAC;AAE7D,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE1D,UAAU,mBAAmB,CAC3B,CAAC,SAAS,iBAAiB,EAC3B,CAAC,SAAS,MAAM,CAChB,SAAQ,gBAAgB,CAAC,qBAAqB,CAAC;IAC/C,GAAG,CAAC,EAAE,aAAa,CAAC;IAE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"1.0.16",
3
+ "version": "1.0.17",
4
4
  "description": "Storefront UI component library for Janbox",
5
5
  "author": "Janbox",
6
6
  "keywords": [