@janbox/storefront-ui 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/floating/floating/floating.js +1 -1
- package/dist/utils/common.d.ts +0 -1
- package/dist/utils/common.d.ts.map +1 -1
- package/dist/utils/common.js +1 -8
- package/dist/utils/index.js +1 -2
- package/package.json +3 -10
- package/dist/HOCs/index.d.ts +0 -2
- package/dist/HOCs/index.d.ts.map +0 -1
- package/dist/HOCs/index.js +0 -4
- package/dist/HOCs/with-query-fallback.d.ts +0 -7
- package/dist/HOCs/with-query-fallback.d.ts.map +0 -1
- package/dist/HOCs/with-query-fallback.js +0 -16
|
@@ -42,7 +42,7 @@ const FloatingCore = forwardRef(
|
|
|
42
42
|
styles.height = `${availableHeight}px`;
|
|
43
43
|
}
|
|
44
44
|
if (rects.floating.width > availableWidth) {
|
|
45
|
-
const maxWidth = Math.min(
|
|
45
|
+
const maxWidth = Math.min(rects.floating.width, window.innerWidth);
|
|
46
46
|
styles.maxWidth = `${maxWidth}px`;
|
|
47
47
|
const verticalPlacements = [
|
|
48
48
|
"top",
|
package/dist/utils/common.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ export declare const normalizeSearchText: (str?: string, options?: {
|
|
|
7
7
|
trim?: boolean;
|
|
8
8
|
}) => string;
|
|
9
9
|
export declare const matchSearch: (text: string | string[], searchText: string, options?: Parameters<typeof normalizeSearchText>[1]) => boolean;
|
|
10
|
-
export declare const createSlug: (text: string) => string;
|
|
11
10
|
export type FormatNumberOptions = Intl.NumberFormatOptions & {
|
|
12
11
|
lng: string;
|
|
13
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/utils/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,YAAY,EAAO,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/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GED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { isValidElement } from "react";
|
|
2
2
|
import parse from "html-react-parser";
|
|
3
|
-
import {
|
|
4
|
-
import slugify from "slugify";
|
|
3
|
+
import { isNil, isBoolean, omitBy, isArray, isString, parseInt } from "lodash-es";
|
|
5
4
|
import { Booleanish } from "../constants/index.js";
|
|
6
5
|
const ensureArray = (val) => {
|
|
7
6
|
if (isNil(val)) {
|
|
@@ -38,11 +37,6 @@ const matchSearch = (text, searchText, options) => {
|
|
|
38
37
|
return normalizeSearchText(entry, options).includes(normalizedSearchText);
|
|
39
38
|
});
|
|
40
39
|
};
|
|
41
|
-
const createSlug = (text) => {
|
|
42
|
-
return slugify(kebabCase(text.toLowerCase()), {
|
|
43
|
-
lower: true
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
40
|
const formatNumber = (value, { lng, ...options }) => {
|
|
47
41
|
try {
|
|
48
42
|
return new Intl.NumberFormat(lng, {
|
|
@@ -125,7 +119,6 @@ function parseSvgString(source, uniqueId) {
|
|
|
125
119
|
return isValidElement(parsed) && parsed.type === validType ? parsed : null;
|
|
126
120
|
}
|
|
127
121
|
export {
|
|
128
|
-
createSlug,
|
|
129
122
|
ensureArray,
|
|
130
123
|
ensureBoolean,
|
|
131
124
|
formatNumber,
|
package/dist/utils/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Children, isValidElement, Fragment } from "react";
|
|
|
2
2
|
import { clsx } from "clsx";
|
|
3
3
|
import { isUndefined, kebabCase, mergeWith, omit, get } from "lodash-es";
|
|
4
4
|
import { PREFIX } from "../theme/index.js";
|
|
5
|
-
import {
|
|
5
|
+
import { ensureArray, ensureBoolean, formatNumber, getDecimalDigits, getEnumValues, matchSearch, normalizeSearchText, omitEmpty, parseNumber, parseSvgString } from "./common.js";
|
|
6
6
|
import { cn } from "./stylesheet.js";
|
|
7
7
|
import { ArrayParamParser, BooleanParamParser, DateParamParser, EnumParamParser, NumberParamParser, StringParamParser, simplifyQueryParams } from "./query-params.js";
|
|
8
8
|
import { animatePulse, animateSpin, containerStyle, cursorPointer, overflowAuto, overflowHidden, pbBlock, pointerEventsNone, ptBlock, pyBlock, scrollbarNone, textHeading1, textHeading2, textHeading3, textHeading4, textHeading5, textHeading6, truncate } from "./emotion-helpers.js";
|
|
@@ -195,7 +195,6 @@ export {
|
|
|
195
195
|
animateSpin,
|
|
196
196
|
cn,
|
|
197
197
|
containerStyle,
|
|
198
|
-
createSlug,
|
|
199
198
|
cursorPointer,
|
|
200
199
|
ensureArray,
|
|
201
200
|
ensureBoolean,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@janbox/storefront-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "Storefront UI component library for Janbox",
|
|
5
5
|
"author": "Janbox",
|
|
6
6
|
"keywords": [
|
|
@@ -47,10 +47,6 @@
|
|
|
47
47
|
"types": "./dist/components/index.d.ts",
|
|
48
48
|
"default": "./dist/components/index.js"
|
|
49
49
|
},
|
|
50
|
-
"./HOCs": {
|
|
51
|
-
"types": "./dist/HOCs/index.d.ts",
|
|
52
|
-
"default": "./dist/HOCs/index.js"
|
|
53
|
-
},
|
|
54
50
|
"./locales/*": "./dist/locales/*",
|
|
55
51
|
"./style.css": "./dist/style.css"
|
|
56
52
|
},
|
|
@@ -84,16 +80,12 @@
|
|
|
84
80
|
"motion": "^11.15.0",
|
|
85
81
|
"overlayscrollbars-react": "^0.5.6",
|
|
86
82
|
"phone": "^3.1.62",
|
|
87
|
-
"react-colorful": "^5.6.1",
|
|
88
83
|
"react-date-range": "^2.0.1",
|
|
89
|
-
"react-error-boundary": "^5.0.0",
|
|
90
84
|
"react-hook-form": "^7.52.2",
|
|
91
85
|
"react-i18next": "^14.0.0",
|
|
92
86
|
"react-player": "^3.3.3",
|
|
93
87
|
"react-router": "^7.9.6",
|
|
94
88
|
"react-zoom-pan-pinch": "^3.7.0",
|
|
95
|
-
"slugify": "^1.6.6",
|
|
96
|
-
"type-fest": "^5.2.0",
|
|
97
89
|
"usehooks-ts": "^3.1.1",
|
|
98
90
|
"uuid": "^10.0.0"
|
|
99
91
|
},
|
|
@@ -118,7 +110,8 @@
|
|
|
118
110
|
"typescript": "5.5.4",
|
|
119
111
|
"vite": "^5.3.3",
|
|
120
112
|
"vite-plugin-dts": "^4.5.4",
|
|
121
|
-
"vite-tsconfig-paths": "^6.1.1"
|
|
113
|
+
"vite-tsconfig-paths": "^6.1.1",
|
|
114
|
+
"type-fest": "^5.2.0"
|
|
122
115
|
},
|
|
123
116
|
"scripts": {
|
|
124
117
|
"build": "vite build",
|
package/dist/HOCs/index.d.ts
DELETED
package/dist/HOCs/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/HOCs/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
|
package/dist/HOCs/index.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
export type QueryFallbackOptions<T> = Partial<{
|
|
3
|
-
Loading: React.FunctionComponent<T>;
|
|
4
|
-
Error: React.ComponentType<T>;
|
|
5
|
-
}>;
|
|
6
|
-
export declare const withQueryFallback: <T, P extends object, C = React.FunctionComponent<P> | React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<T>>>(Component: C, options?: QueryFallbackOptions<P>) => typeof Component;
|
|
7
|
-
//# sourceMappingURL=with-query-fallback.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"with-query-fallback.d.ts","sourceRoot":"","sources":["../../src/HOCs/with-query-fallback.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAIf,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,OAAO,CAAC;IAC5C,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;IACpC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;CAC/B,CAAC,CAAC;AAEH,eAAO,MAAM,iBAAiB,GAC5B,CAAC,EACD,CAAC,SAAS,MAAM,EAChB,CAAC,+HAEU,CAAC,YACH,oBAAoB,CAAC,CAAC,CAAC,KAkBA,OAAO,SACxC,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsx, Fragment } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { forwardRef, Suspense, createElement } from "react";
|
|
3
|
-
import { ErrorBoundary } from "react-error-boundary";
|
|
4
|
-
const withQueryFallback = (Component, options = {}) => {
|
|
5
|
-
const { Loading, Error } = options;
|
|
6
|
-
const ComponentWithFallback = forwardRef((props, ref) => {
|
|
7
|
-
const fallbackRender = (_fallbackProps) => {
|
|
8
|
-
return Error ? createElement(Error, props) : /* @__PURE__ */ jsx(Fragment, {});
|
|
9
|
-
};
|
|
10
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: Loading ? createElement(Loading, props) : null, children: /* @__PURE__ */ jsx(ErrorBoundary, { fallbackRender, children: createElement(Component, { ...props, ref }) }) });
|
|
11
|
-
});
|
|
12
|
-
return ComponentWithFallback;
|
|
13
|
-
};
|
|
14
|
-
export {
|
|
15
|
-
withQueryFallback
|
|
16
|
-
};
|