@janbox/storefront-ui 6.0.5 → 6.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/assets/svg/arrow-down.svg.js +3 -2
- package/dist/assets/svg/arrow-down2.svg.js +4 -0
- package/dist/assets/svg/arrow-left2.svg.js +5 -0
- package/dist/assets/svg/arrow-right2.svg.js +5 -0
- package/dist/assets/svg/done-check.svg.js +3 -2
- package/dist/assets/svg/loading-waiting2.svg.js +5 -0
- package/dist/assets/svg/minus2.svg.js +5 -0
- package/dist/components/index.d.ts +0 -1
- package/dist/components/index.js +0 -2
- package/dist/components/scroll-view/scroll-view.js +1 -1
- package/dist/lib/accordion/accordion-content/accordion-content.js +1 -1
- package/dist/lib/cascader/cascader-floating-content.d.ts +1 -1
- package/dist/lib/cascader/cascader-floating-content.js +4 -5
- package/dist/lib/cascader/cascader.d.ts +1 -2
- package/dist/lib/cascader/cascader.js +4 -6
- package/dist/lib/checkbox/README.md +0 -1
- package/dist/lib/checkbox/checkbox.js +4 -5
- package/dist/lib/collapse/README.md +1 -1
- package/dist/lib/count-up/count-up.js +1 -1
- package/dist/lib/drawer/drawer/drawer.js +1 -1
- package/dist/lib/filter-panel/filter-panel.js +1 -1
- package/dist/lib/floating/floating-content/floating-content.js +1 -1
- package/dist/lib/icon/README.md +1 -5
- package/dist/lib/lightbox/lightbox.js +1 -1
- package/dist/lib/loading/README.md +0 -1
- package/dist/lib/loading/image-skeleton/image-skeleton.js +1 -1
- package/dist/lib/loading/loading-overlay/loading-overlay.d.ts +1 -1
- package/dist/lib/loading/loading-overlay/loading-overlay.js +3 -4
- package/dist/lib/multiple-select/multiple-select.d.ts +1 -2
- package/dist/lib/multiple-select/multiple-select.js +4 -6
- package/dist/lib/notifications/notifications.js +1 -1
- package/dist/lib/select/select.js +5 -7
- package/dist/lib/star-rating/star-rating.js +1 -1
- package/dist/lib/swiper/swiper-dots-paging/swiper-dots-paging.js +1 -1
- package/dist/lib/swiper/swiper-side-arrows-paging/swiper-side-arrows-paging.js +2 -3
- package/dist/lib/tabs/tab-indicator/tab-indicator.js +1 -1
- package/dist/utils/common.d.ts +0 -2
- package/dist/utils/common.js +1 -51
- package/dist/utils/index.js +1 -2
- package/dist/utils/stylesheet.js +1 -2
- package/package.json +3 -4
- package/dist/components/svg-loader.d.ts +0 -6
- package/dist/components/svg-loader.js +0 -19
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgArrowDown = (props) => /* @__PURE__ */ React.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React.createElement("path", { d: "M6 9L12 15L18 9", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }));
|
|
2
3
|
export {
|
|
3
|
-
|
|
4
|
+
SvgArrowDown as default
|
|
4
5
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const ArrowDownIcon = '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M6 9L12 15L18 9" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n';
|
|
2
|
+
export {
|
|
3
|
+
ArrowDownIcon as default
|
|
4
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgArrowLeft = (props) => /* @__PURE__ */ React.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React.createElement("path", { d: "M15 6L9 12L15 18", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }));
|
|
3
|
+
export {
|
|
4
|
+
SvgArrowLeft as default
|
|
5
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgArrowRight = (props) => /* @__PURE__ */ React.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React.createElement("path", { d: "M9 18L15 12L9 6", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }));
|
|
3
|
+
export {
|
|
4
|
+
SvgArrowRight as default
|
|
5
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgDoneCheck = (props) => /* @__PURE__ */ React.createElement("svg", { fill: "currentColor", width: 24, height: 24, viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React.createElement("path", { d: "M10,18a1,1,0,0,1-.71-.29l-5-5a1,1,0,0,1,1.42-1.42L10,15.59l8.29-8.3a1,1,0,1,1,1.42,1.42l-9,9A1,1,0,0,1,10,18Z" }));
|
|
2
3
|
export {
|
|
3
|
-
|
|
4
|
+
SvgDoneCheck as default
|
|
4
5
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgLoadingWaiting = (props) => /* @__PURE__ */ React.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React.createElement("path", { d: "M12 17.6201V21.0001", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React.createElement("path", { d: "M8.02001 15.9805L5.64001 18.3605", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React.createElement("path", { d: "M6.38 12H3", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React.createElement("path", { d: "M5.64001 5.63965L8.02001 8.01965", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React.createElement("path", { d: "M12 6V3", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React.createElement("path", { d: "M16.77 7.22965L18.36 5.63965", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React.createElement("path", { d: "M21 12H19.5", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React.createElement("path", { d: "M18.36 18.3597L17.83 17.8297", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }));
|
|
3
|
+
export {
|
|
4
|
+
SvgLoadingWaiting as default
|
|
5
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgMinus = (props) => /* @__PURE__ */ React.createElement("svg", { fill: "currentColor", width: 24, height: 24, viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React.createElement("path", { d: "M19,13H5a1,1,0,0,1,0-2H19a1,1,0,0,1,0,2Z" }));
|
|
3
|
+
export {
|
|
4
|
+
SvgMinus as default
|
|
5
|
+
};
|
package/dist/components/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import { Stylesheet } from "../../lib/stylesheet/stylesheet.js";
|
|
4
3
|
import { OverlayScrollbarsComponent } from "overlayscrollbars-react";
|
|
4
|
+
import { Stylesheet } from "../../lib/stylesheet/stylesheet.js";
|
|
5
5
|
const ScrollView = ({ children, options, sx, ...props }) => {
|
|
6
6
|
return /* @__PURE__ */ jsx(Stylesheet, { children: ({ cx, css }) => /* @__PURE__ */ jsx(
|
|
7
7
|
OverlayScrollbarsComponent,
|
|
@@ -3,8 +3,8 @@ import { useRef } from "react";
|
|
|
3
3
|
import { motion } from "motion/react";
|
|
4
4
|
import { getAccordionContentProps } from "./helpers.js";
|
|
5
5
|
import { useAccordionContext } from "../accordion/helpers.js";
|
|
6
|
-
import { Stylesheet } from "../../stylesheet/stylesheet.js";
|
|
7
6
|
import { useAccordionGroupContext } from "../accordion-group/helpers.js";
|
|
7
|
+
import { Stylesheet } from "../../stylesheet/stylesheet.js";
|
|
8
8
|
import { Primitive } from "../../primitive/primitive.js";
|
|
9
9
|
const AccordionContent = ({ children, ref, ..._props }) => {
|
|
10
10
|
const { accordionContentProps: accordionContentPropsByGroup = {} } = useAccordionGroupContext();
|
|
@@ -15,5 +15,5 @@ type CascaderFloatingContentProps = {
|
|
|
15
15
|
} & ToResponsiveProps<{
|
|
16
16
|
size?: SizeVariant;
|
|
17
17
|
}>;
|
|
18
|
-
export declare const CascaderFloatingContent: ({ searchable, selectedPath, options, loadOptions, onChange, inputProps, listProps, separator, lazy, size, sm, md, lg, }: CascaderFloatingContentProps) => import("react").JSX.Element;
|
|
18
|
+
export declare const CascaderFloatingContent: ({ searchable, selectedPath, options, loadOptions, onChange, inputProps, listProps, separator, lazy, size, sm, md, lg, }: CascaderFloatingContentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
19
19
|
export {};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
1
|
+
import { jsxs, jsx, Fragment } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { useRef, useId, useState, useEffect, useMemo, useCallback } from "react";
|
|
3
3
|
import { isString, isNil, trimStart } from "lodash-es";
|
|
4
4
|
import { findOptionPath, isExpandable, hasChildren } from "./helpers.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { SvgLoader } from "../../components/svg-loader.js";
|
|
5
|
+
import SvgArrowRight from "../../assets/svg/arrow-right2.svg.js";
|
|
6
|
+
import SvgDoneCheck from "../../assets/svg/done-check.svg.js";
|
|
8
7
|
import { VirtualizedList } from "../../components/virtualized-list.js";
|
|
9
8
|
import { truncateStyle } from "../../constants/emotion.js";
|
|
10
9
|
import { getResponsiveProp, getSizeVariantState } from "../../utils/index.js";
|
|
@@ -309,7 +308,7 @@ const CascaderFloatingContent = ({
|
|
|
309
308
|
},
|
|
310
309
|
children: isLoading ? /* @__PURE__ */ jsx(TextSkeleton, {}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
311
310
|
/* @__PURE__ */ jsx(Primitive, { sx: { flex: 1, ...truncateStyle }, children: rowData.label }),
|
|
312
|
-
isExpandable(rowData) ? /* @__PURE__ */ jsx(
|
|
311
|
+
isExpandable(rowData) ? /* @__PURE__ */ jsx(SvgArrowRight, { width: 20, height: 20, css: { color: getColorVar("neutral.400") } }) : isSelected && /* @__PURE__ */ jsx(SvgDoneCheck, { width: 20, height: 20, css: { color: getColorVar("primary.600") } })
|
|
313
312
|
] })
|
|
314
313
|
},
|
|
315
314
|
`${uniqueId}-option-${rowData.value}`
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { JSX } from 'react';
|
|
2
1
|
import { CascaderProps } from './types';
|
|
3
|
-
export declare const Cascader: ({ ref, ..._props }: CascaderProps) => JSX.Element;
|
|
2
|
+
export declare const Cascader: ({ ref, ..._props }: CascaderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsxs, jsx } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { useRef } from "react";
|
|
3
3
|
import { isNil } from "lodash-es";
|
|
4
4
|
import { CascaderFloatingContent } from "./cascader-floating-content.js";
|
|
5
5
|
import { getCascaderProps } from "./helpers.js";
|
|
6
|
-
import
|
|
6
|
+
import SvgArrowDown from "../../assets/svg/arrow-down.svg.js";
|
|
7
7
|
import { getColorVar } from "../../theme/palette.js";
|
|
8
8
|
import { getTypographyVar } from "../../theme/typography.js";
|
|
9
9
|
import { truncateStyle } from "../../constants/emotion.js";
|
|
10
10
|
import { getSizeVariantState } from "../../utils/index.js";
|
|
11
11
|
import { useControllableState } from "../../hooks/use-controllable-state.js";
|
|
12
|
-
import { SvgLoader } from "../../components/svg-loader.js";
|
|
13
12
|
import { Primitive } from "../primitive/primitive.js";
|
|
14
13
|
import { InputMask as ForwardRefInputMask } from "../input-mask/input-mask.js";
|
|
15
14
|
import { FormHelperText } from "../form-helper-text/form-helper-text.js";
|
|
@@ -106,12 +105,11 @@ const Cascader = ({ ref, ..._props }) => {
|
|
|
106
105
|
error: isOpen ? false : error,
|
|
107
106
|
as: "button",
|
|
108
107
|
suffix: /* @__PURE__ */ jsx(
|
|
109
|
-
|
|
108
|
+
SvgArrowDown,
|
|
110
109
|
{
|
|
111
|
-
source: ArrowDownIcon,
|
|
112
110
|
width: 20,
|
|
113
111
|
height: 20,
|
|
114
|
-
|
|
112
|
+
css: {
|
|
115
113
|
transition: "transform 150ms",
|
|
116
114
|
...isOpen ? { transform: "rotate(-180deg)" } : {}
|
|
117
115
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useRef, useEffect } from "react";
|
|
3
3
|
import { useMergeRefs } from "@floating-ui/react";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import MinusIcon from "../../assets/svg/minus.svg.js";
|
|
4
|
+
import SvgDoneCheck from "../../assets/svg/done-check.svg.js";
|
|
5
|
+
import SvgMinus from "../../assets/svg/minus2.svg.js";
|
|
7
6
|
import { getColorShadesByVariant } from "../../utils/index.js";
|
|
8
7
|
import "lodash-es";
|
|
9
8
|
import { getColorVar } from "../../theme/palette.js";
|
|
@@ -132,8 +131,8 @@ const Checkbox = ({
|
|
|
132
131
|
}
|
|
133
132
|
},
|
|
134
133
|
children: [
|
|
135
|
-
/* @__PURE__ */ jsx(
|
|
136
|
-
/* @__PURE__ */ jsx(
|
|
134
|
+
/* @__PURE__ */ jsx(SvgDoneCheck, { "data-checkbox-icon": "checked", width: 18, height: 18 }),
|
|
135
|
+
/* @__PURE__ */ jsx(SvgMinus, { "data-checkbox-icon": "indeterminate", width: 18, height: 18 })
|
|
137
136
|
]
|
|
138
137
|
}
|
|
139
138
|
)
|
|
@@ -15,7 +15,7 @@ import { Collapse } from '@janbox/storefront-ui';
|
|
|
15
15
|
| `open` | `boolean` | true | Controls whether the content is expanded (true) or collapsed (false). |
|
|
16
16
|
| `collapsedSize` | `number` | 0 | The size in pixels to collapse to when closed. Defaults to 0 (fully hidden). Use a non-zero value to show a partial peek of the content. |
|
|
17
17
|
| `orientation` | `'horizontal' \| 'vertical'` | 'vertical' | The axis along which the collapse animation occurs. 'vertical' animates height; 'horizontal' animates width. |
|
|
18
|
-
| `transition` | `
|
|
18
|
+
| `transition` | `HTMLMotionProps<'div'>['transition']` | - | Motion transition config passed to the underlying motion.div. Merged with the default duration of 0.15s. |
|
|
19
19
|
| `children` | `React.ReactNode` | - | Content to show or hide. |
|
|
20
20
|
|
|
21
21
|
## Examples
|
|
@@ -7,9 +7,9 @@ import { useTranslation } from "../../i18n/index.js";
|
|
|
7
7
|
import "lodash-es";
|
|
8
8
|
import "../../theme/palette.js";
|
|
9
9
|
import { getTypographyVar } from "../../theme/typography.js";
|
|
10
|
-
import { Stylesheet } from "../stylesheet/stylesheet.js";
|
|
11
10
|
import { getCountUpProps } from "./helpers.js";
|
|
12
11
|
import { getDecimalDigits } from "../../utils/common.js";
|
|
12
|
+
import { Stylesheet } from "../stylesheet/stylesheet.js";
|
|
13
13
|
const CountUp = ({ ref, ..._props }) => {
|
|
14
14
|
const {
|
|
15
15
|
from = 0,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
3
|
import { motion } from "motion/react";
|
|
4
|
-
import { Stylesheet } from "../../stylesheet/stylesheet.js";
|
|
5
4
|
import { Primitive } from "../../primitive/primitive.js";
|
|
5
|
+
import { Stylesheet } from "../../stylesheet/stylesheet.js";
|
|
6
6
|
import { Floating } from "../../floating/floating/floating.js";
|
|
7
7
|
import { FloatingContent } from "../../floating/floating-content/floating-content.js";
|
|
8
8
|
const Drawer = ({ children, placement = "left", ...props }) => {
|
|
@@ -5,7 +5,7 @@ import { CheckboxFilterPanel } from "./checkbox-filter-panel.js";
|
|
|
5
5
|
import { PriceRangeFilterPanel } from "./price-range-filter-panel.js";
|
|
6
6
|
import { InputTextFilterPanel } from "./input-text-filter-panel.js";
|
|
7
7
|
import { RadioFilterPanel } from "./radio-filter-panel.js";
|
|
8
|
-
import ArrowDownIcon from "../../assets/svg/arrow-
|
|
8
|
+
import ArrowDownIcon from "../../assets/svg/arrow-down2.svg.js";
|
|
9
9
|
import { Primitive } from "../primitive/primitive.js";
|
|
10
10
|
import { Icon } from "../icon/icon.js";
|
|
11
11
|
import { Collapse } from "../collapse/collapse.js";
|
|
@@ -4,8 +4,8 @@ import { motion, AnimatePresence } from "motion/react";
|
|
|
4
4
|
import { useFloatingContext } from "../floating/helpers.js";
|
|
5
5
|
import { FLOATING_Z_INDEX } from "../../../theme/index.js";
|
|
6
6
|
import { useIsHydrated } from "../../../hooks/use-is-hydrated/index.js";
|
|
7
|
-
import { Stylesheet } from "../../stylesheet/stylesheet.js";
|
|
8
7
|
import { usePortalContainer } from "../../../theme/provider.js";
|
|
8
|
+
import { Stylesheet } from "../../stylesheet/stylesheet.js";
|
|
9
9
|
const FloatingContent = ({ preserveTabOrder, focus, overlay, sx, ref, ...props }) => {
|
|
10
10
|
const { getFloatingProps, context } = useFloatingContext();
|
|
11
11
|
const mergedRefs = useMergeRefs([context.refs.setFloating, ref]);
|
package/dist/lib/icon/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Icon
|
|
2
2
|
|
|
3
|
-
A responsive SVG icon component that renders raw SVG strings
|
|
3
|
+
A responsive SVG icon component that renders raw SVG strings. Supports numeric size control with responsive breakpoint overrides (sm/md/lg) and the sx prop for custom styling.
|
|
4
4
|
|
|
5
5
|
## Import
|
|
6
6
|
|
|
@@ -54,10 +54,6 @@ import SearchIcon from '@/assets/svg/search.svg?raw';
|
|
|
54
54
|
/>
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
## Related Components
|
|
58
|
-
|
|
59
|
-
- [SvgLoader](../svgloader/README.md)
|
|
60
|
-
|
|
61
57
|
## Dependencies
|
|
62
58
|
|
|
63
59
|
- @emotion/react
|
|
@@ -10,10 +10,10 @@ import ZoomPlusIcon from "../../assets/svg/search-add-plus-middle.svg.js";
|
|
|
10
10
|
import ZoomMinusIcon from "../../assets/svg/search-minus.svg.js";
|
|
11
11
|
import CloseIcon from "../../assets/svg/times-close-delete.svg.js";
|
|
12
12
|
import { FLOATING_Z_INDEX } from "../../theme/index.js";
|
|
13
|
-
import { Stylesheet } from "../stylesheet/stylesheet.js";
|
|
14
13
|
import { Primitive } from "../primitive/primitive.js";
|
|
15
14
|
import { Swiper } from "../swiper/swiper/swiper.js";
|
|
16
15
|
import { SwiperSlide } from "../swiper/swiper-slide/swiper-slide.js";
|
|
16
|
+
import { Stylesheet } from "../stylesheet/stylesheet.js";
|
|
17
17
|
import { Image } from "../image/image.js";
|
|
18
18
|
import { IconButton } from "../icon-button/icon-button.js";
|
|
19
19
|
import { Floating } from "../floating/floating/floating.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { animatePulseStyle } from "../../../constants/emotion.js";
|
|
3
|
-
import { Stylesheet } from "../../stylesheet/stylesheet.js";
|
|
4
3
|
import "lodash-es";
|
|
5
4
|
import { getColorVar } from "../../../theme/palette.js";
|
|
6
5
|
import { Primitive } from "../../primitive/primitive.js";
|
|
6
|
+
import { Stylesheet } from "../../stylesheet/stylesheet.js";
|
|
7
7
|
const ImageSkeleton = (props) => {
|
|
8
8
|
return /* @__PURE__ */ jsx(
|
|
9
9
|
Primitive,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { LoadingOverlayProps } from './types';
|
|
2
|
-
export declare const LoadingOverlay: ({ isLoading, iconProps, color, style, size, children, ...props }: LoadingOverlayProps) => import("react").JSX.Element;
|
|
2
|
+
export declare const LoadingOverlay: ({ isLoading, iconProps, color, style, size, children, ...props }: LoadingOverlayProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { SvgLoader } from "../../../components/svg-loader.js";
|
|
1
|
+
import { jsxs, jsx } from "@emotion/react/jsx-runtime";
|
|
3
2
|
import { animateSpinStyle } from "../../../constants/emotion.js";
|
|
4
|
-
import
|
|
3
|
+
import SvgLoadingWaiting from "../../../assets/svg/loading-waiting2.svg.js";
|
|
5
4
|
import { getColorShadesByVariant } from "../../../utils/index.js";
|
|
6
5
|
import { Primitive } from "../../primitive/primitive.js";
|
|
7
6
|
const LoadingOverlay = ({
|
|
@@ -45,7 +44,7 @@ const LoadingOverlay = ({
|
|
|
45
44
|
cursor: "progress",
|
|
46
45
|
...iconProps == null ? void 0 : iconProps.sx
|
|
47
46
|
},
|
|
48
|
-
children: /* @__PURE__ */ jsx(
|
|
47
|
+
children: /* @__PURE__ */ jsx(SvgLoadingWaiting, { width: size, height: size, css: animateSpinStyle, style: { color: main } })
|
|
49
48
|
}
|
|
50
49
|
)
|
|
51
50
|
]
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { JSX } from 'react';
|
|
2
1
|
import { MultipleSelectProps } from './types';
|
|
3
|
-
export declare const MultipleSelect: <O extends object = object>({ ref, ...props }: MultipleSelectProps<O>) => JSX.Element;
|
|
2
|
+
export declare const MultipleSelect: <O extends object = object>({ ref, ...props }: MultipleSelectProps<O>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsxs, jsx } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { useRef, useId, useCallback, useMemo, useEffect } from "react";
|
|
3
3
|
import { get, isNil, isElement, trimStart } from "lodash-es";
|
|
4
4
|
import { getMultipleSelectProps } from "./helpers.js";
|
|
5
|
-
import { SvgLoader } from "../../components/svg-loader.js";
|
|
6
5
|
import { VirtualizedList } from "../../components/virtualized-list.js";
|
|
7
6
|
import { useWindowScreen } from "../../hooks/use-window-screen/index.js";
|
|
8
7
|
import { useControllableState } from "../../hooks/use-controllable-state.js";
|
|
9
8
|
import { getResponsiveProp, getSizeVariantState } from "../../utils/index.js";
|
|
10
|
-
import
|
|
9
|
+
import SvgArrowDown from "../../assets/svg/arrow-down.svg.js";
|
|
11
10
|
import { getColorVar } from "../../theme/palette.js";
|
|
12
11
|
import { getTypographyVar } from "../../theme/typography.js";
|
|
13
12
|
import { ensureArray, matchSearch } from "../../utils/common.js";
|
|
@@ -240,12 +239,11 @@ const MultipleSelect = ({ ref, ...props }) => {
|
|
|
240
239
|
error: isOpen ? false : error,
|
|
241
240
|
as: "button",
|
|
242
241
|
suffix: /* @__PURE__ */ jsx(
|
|
243
|
-
|
|
242
|
+
SvgArrowDown,
|
|
244
243
|
{
|
|
245
|
-
source: ArrowDownIcon,
|
|
246
244
|
width: 20,
|
|
247
245
|
height: 20,
|
|
248
|
-
|
|
246
|
+
css: {
|
|
249
247
|
transition: "transform 150ms",
|
|
250
248
|
...isOpen ? { transform: "rotate(-180deg)" } : {}
|
|
251
249
|
}
|
|
@@ -7,9 +7,9 @@ import { notificationStore } from "./helpers.js";
|
|
|
7
7
|
import { getColorShadesByVariant } from "../../utils/index.js";
|
|
8
8
|
import { FLOATING_Z_INDEX } from "../../theme/index.js";
|
|
9
9
|
import CloseIcon from "../../assets/svg/times-close-delete.svg.js";
|
|
10
|
-
import { Stylesheet } from "../stylesheet/stylesheet.js";
|
|
11
10
|
import { usePortalContainer } from "../../theme/provider.js";
|
|
12
11
|
import { Primitive } from "../primitive/primitive.js";
|
|
12
|
+
import { Stylesheet } from "../stylesheet/stylesheet.js";
|
|
13
13
|
import { getTypographyVar } from "../../theme/typography.js";
|
|
14
14
|
import { IconButton } from "../icon-button/icon-button.js";
|
|
15
15
|
const Notifications = () => {
|
|
@@ -2,13 +2,12 @@ import { jsxs, jsx, Fragment } from "@emotion/react/jsx-runtime";
|
|
|
2
2
|
import { useRef, useId, useCallback, useMemo, useEffect } from "react";
|
|
3
3
|
import { get, isNil, trimStart } from "lodash-es";
|
|
4
4
|
import { getSelectProps } from "./helpers.js";
|
|
5
|
-
import { SvgLoader } from "../../components/svg-loader.js";
|
|
6
5
|
import { VirtualizedList } from "../../components/virtualized-list.js";
|
|
7
6
|
import { useWindowScreen } from "../../hooks/use-window-screen/index.js";
|
|
8
7
|
import { useControllableState } from "../../hooks/use-controllable-state.js";
|
|
9
8
|
import { getResponsiveProp, getSizeVariantState } from "../../utils/index.js";
|
|
10
|
-
import
|
|
11
|
-
import
|
|
9
|
+
import SvgArrowDown from "../../assets/svg/arrow-down.svg.js";
|
|
10
|
+
import SvgDoneCheck from "../../assets/svg/done-check.svg.js";
|
|
12
11
|
import { getColorVar } from "../../theme/palette.js";
|
|
13
12
|
import { getTypographyVar } from "../../theme/typography.js";
|
|
14
13
|
import { ensureArray, matchSearch } from "../../utils/common.js";
|
|
@@ -163,7 +162,7 @@ const Select = ({
|
|
|
163
162
|
},
|
|
164
163
|
children: [
|
|
165
164
|
/* @__PURE__ */ jsx(Primitive, { sx: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: getOptionLabel(rowData) }),
|
|
166
|
-
isSelected && /* @__PURE__ */ jsx(
|
|
165
|
+
isSelected && /* @__PURE__ */ jsx(SvgDoneCheck, { width: 24, height: 24, css: { color: getColorVar("primary.600") } })
|
|
167
166
|
]
|
|
168
167
|
}
|
|
169
168
|
);
|
|
@@ -245,12 +244,11 @@ const Select = ({
|
|
|
245
244
|
error: isOpen ? false : error,
|
|
246
245
|
as: "button",
|
|
247
246
|
suffix: /* @__PURE__ */ jsx(
|
|
248
|
-
|
|
247
|
+
SvgArrowDown,
|
|
249
248
|
{
|
|
250
|
-
source: ArrowDownIcon,
|
|
251
249
|
width: 20,
|
|
252
250
|
height: 20,
|
|
253
|
-
|
|
251
|
+
css: {
|
|
254
252
|
transition: "transform 150ms",
|
|
255
253
|
...isOpen ? { transform: "rotate(-180deg)" } : {}
|
|
256
254
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useId } from "react";
|
|
3
|
-
import { Stylesheet } from "../stylesheet/stylesheet.js";
|
|
4
3
|
import { getStarRatingProps } from "./helpers.js";
|
|
4
|
+
import { Stylesheet } from "../stylesheet/stylesheet.js";
|
|
5
5
|
const StarRating = (_props) => {
|
|
6
6
|
const { rating, maxRating, size, sm, md, lg, ref, color, sx } = getStarRatingProps(_props);
|
|
7
7
|
const id = useId();
|
|
@@ -6,8 +6,8 @@ import { motion } from "motion/react";
|
|
|
6
6
|
import { getColorVar } from "../../../theme/palette.js";
|
|
7
7
|
import { usePortalContainer } from "../../../theme/provider.js";
|
|
8
8
|
import { useIsHydrated } from "../../../hooks/use-is-hydrated/index.js";
|
|
9
|
-
import { Stylesheet } from "../../stylesheet/stylesheet.js";
|
|
10
9
|
import { Primitive } from "../../primitive/primitive.js";
|
|
10
|
+
import { Stylesheet } from "../../stylesheet/stylesheet.js";
|
|
11
11
|
const SWIPER_DOTS_SIZE_VAR = "--swiper-dots-size";
|
|
12
12
|
const SWIPER_DOTS_OFFSET_VAR = "--swiper-dots-offset";
|
|
13
13
|
const SWIPER_DOTS_SPACING_VAR = "--swiper-dots-spacing";
|
|
@@ -4,8 +4,7 @@ import { useFloating, autoUpdate, offset, size, FloatingPortal } from "@floating
|
|
|
4
4
|
import { isEmpty, isNumber, isNil } from "lodash-es";
|
|
5
5
|
import { getColorVar } from "../../../theme/palette.js";
|
|
6
6
|
import { usePortalContainer } from "../../../theme/provider.js";
|
|
7
|
-
import
|
|
8
|
-
import { SvgLoader } from "../../../components/svg-loader.js";
|
|
7
|
+
import SvgArrowLeft from "../../../assets/svg/arrow-left2.svg.js";
|
|
9
8
|
import { Primitive } from "../../primitive/primitive.js";
|
|
10
9
|
const SWIPER_SIDE_ARROWS_OVERFLOW_VAR = "--swiper-side-arrows-overflow";
|
|
11
10
|
const SwiperSideArrowsPaging = ({
|
|
@@ -251,7 +250,7 @@ const ArrowButton = ({
|
|
|
251
250
|
md: createArrowIconStyle(md),
|
|
252
251
|
lg: createArrowIconStyle(lg)
|
|
253
252
|
},
|
|
254
|
-
children: /* @__PURE__ */ jsx(
|
|
253
|
+
children: /* @__PURE__ */ jsx(SvgArrowLeft, { width: void 0, height: void 0 })
|
|
255
254
|
}
|
|
256
255
|
)
|
|
257
256
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useRef, useState, useEffect, useCallback } from "react";
|
|
3
3
|
import { motion } from "motion/react";
|
|
4
|
-
import { Stylesheet } from "../../stylesheet/stylesheet.js";
|
|
5
4
|
import "lodash-es";
|
|
6
5
|
import "../../../theme/palette.js";
|
|
7
6
|
import { isNumber } from "../../../utils/common.js";
|
|
8
7
|
import { useTabsContext } from "../tabs/helpers.js";
|
|
8
|
+
import { Stylesheet } from "../../stylesheet/stylesheet.js";
|
|
9
9
|
const INDICATOR_SIZE_VAR_NAME = "--indicator-size";
|
|
10
10
|
const TabIndicator = ({ size, sm, md, lg, ...props }) => {
|
|
11
11
|
const { activeIndex } = useTabsContext();
|
package/dist/utils/common.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
1
|
import { Dict } from '../types';
|
|
3
2
|
export declare const ensureArray: <T>(val: T | T[]) => T[];
|
|
4
3
|
export declare const ensureBoolean: <T extends boolean | string | undefined | null>(val: T) => boolean;
|
|
@@ -15,5 +14,4 @@ export declare const getDecimalDigits: (value: number) => number;
|
|
|
15
14
|
export declare const parseNumber: (text?: string | number, type?: "int" | "float", separator?: string) => number | undefined;
|
|
16
15
|
export declare function omitEmpty<T extends object>(obj?: T): T;
|
|
17
16
|
export declare const getEnumValues: <T extends Dict<string | number>>(enumObject: T) => Array<T[keyof T]>;
|
|
18
|
-
export declare function parseSvgString(source: string, uniqueId?: string): ReactElement<import('react').SVGProps<SVGSVGElement>, "svg"> | null;
|
|
19
17
|
export declare const isNumber: (value: any) => value is number;
|
package/dist/utils/common.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { isValidElement } from "react";
|
|
2
|
-
import { parseDocument } from "htmlparser2";
|
|
3
|
-
import { domToReact } from "html-react-parser";
|
|
4
1
|
import { isNil, isBoolean, omitBy, isArray, isString, parseInt } from "lodash-es";
|
|
5
2
|
import { Booleanish } from "../constants/index.js";
|
|
6
3
|
const ensureArray = (val) => {
|
|
@@ -62,52 +59,6 @@ function omitEmpty(obj) {
|
|
|
62
59
|
const getEnumValues = (enumObject) => {
|
|
63
60
|
return Object.keys(enumObject).filter((key) => isNaN(Number(key))).map((key) => enumObject[key]);
|
|
64
61
|
};
|
|
65
|
-
function parseSvgString(source, uniqueId) {
|
|
66
|
-
const createUniqueId = (originalId) => {
|
|
67
|
-
return [originalId, uniqueId].filter(Boolean).join("-");
|
|
68
|
-
};
|
|
69
|
-
const parsed = domToReact(parseDocument(source).children, {
|
|
70
|
-
replace(domNode) {
|
|
71
|
-
if (domNode.type === "tag" && "attribs" in domNode && domNode.attribs) {
|
|
72
|
-
const el = domNode;
|
|
73
|
-
if (el.attribs.id) {
|
|
74
|
-
el.attribs.id = createUniqueId(el.attribs.id);
|
|
75
|
-
}
|
|
76
|
-
const urlRefAttrs = [
|
|
77
|
-
"fill",
|
|
78
|
-
"stroke",
|
|
79
|
-
"filter",
|
|
80
|
-
"clip-path",
|
|
81
|
-
"mask",
|
|
82
|
-
"marker-start",
|
|
83
|
-
"marker-mid",
|
|
84
|
-
"marker-end",
|
|
85
|
-
"style"
|
|
86
|
-
];
|
|
87
|
-
for (const attr of urlRefAttrs) {
|
|
88
|
-
const value = el.attribs[attr];
|
|
89
|
-
if (!value) continue;
|
|
90
|
-
if (attr === "style") {
|
|
91
|
-
const match = value == null ? void 0 : value.match(/url\(#(.+?)\)/);
|
|
92
|
-
if (match) {
|
|
93
|
-
el.attribs[attr] = value.replace(match[1], createUniqueId(match[1]));
|
|
94
|
-
}
|
|
95
|
-
} else {
|
|
96
|
-
const match = value == null ? void 0 : value.match(/^url\(#(.+?)\)$/);
|
|
97
|
-
if (match) {
|
|
98
|
-
el.attribs[attr] = `url(#${createUniqueId(match[1])})`;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
return el;
|
|
103
|
-
}
|
|
104
|
-
return void 0;
|
|
105
|
-
},
|
|
106
|
-
trim: true
|
|
107
|
-
});
|
|
108
|
-
const validType = "svg";
|
|
109
|
-
return isValidElement(parsed) && parsed.type === validType ? parsed : null;
|
|
110
|
-
}
|
|
111
62
|
const isNumber = (value) => typeof value === "number";
|
|
112
63
|
export {
|
|
113
64
|
ensureArray,
|
|
@@ -118,6 +69,5 @@ export {
|
|
|
118
69
|
matchSearch,
|
|
119
70
|
normalizeSearchText,
|
|
120
71
|
omitEmpty,
|
|
121
|
-
parseNumber
|
|
122
|
-
parseSvgString
|
|
72
|
+
parseNumber
|
|
123
73
|
};
|
package/dist/utils/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Children, isValidElement, Fragment } from "react";
|
|
|
2
2
|
import { isString, isNumber, isUndefined, mergeWith, get } from "lodash-es";
|
|
3
3
|
import { getSmallerScreens } from "../theme/screens.js";
|
|
4
4
|
import { getColorVar } from "../theme/palette.js";
|
|
5
|
-
import { ensureArray, ensureBoolean, getDecimalDigits, getEnumValues, isNumber as isNumber2, matchSearch, normalizeSearchText, omitEmpty, parseNumber
|
|
5
|
+
import { ensureArray, ensureBoolean, getDecimalDigits, getEnumValues, isNumber as isNumber2, matchSearch, normalizeSearchText, omitEmpty, parseNumber } from "./common.js";
|
|
6
6
|
import { ArrayParamParser, BooleanParamParser, DateParamParser, EnumParamParser, NumberParamParser, StringParamParser, simplifyQueryParams } from "./query-params.js";
|
|
7
7
|
import { createUnderlineEffect } from "./stylesheet.js";
|
|
8
8
|
const getColorShadesByVariant = (variant) => {
|
|
@@ -259,6 +259,5 @@ export {
|
|
|
259
259
|
normalizeSearchText,
|
|
260
260
|
omitEmpty,
|
|
261
261
|
parseNumber,
|
|
262
|
-
parseSvgString,
|
|
263
262
|
simplifyQueryParams
|
|
264
263
|
};
|
package/dist/utils/stylesheet.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { isNumber } from "lodash-es";
|
|
2
1
|
import { mediaQuery } from "../theme/screens.js";
|
|
3
2
|
import "../theme/palette.js";
|
|
4
3
|
const createSxStyle = (sx = {}) => {
|
|
@@ -26,7 +25,7 @@ const createUnderlineEffect = (options = {}) => {
|
|
|
26
25
|
transitionProperty: "transform",
|
|
27
26
|
transitionTimingFunction: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
28
27
|
backgroundColor: color,
|
|
29
|
-
height:
|
|
28
|
+
height: typeof height === "number" ? `${height}px` : height,
|
|
30
29
|
transitionDuration: `${duration}ms`
|
|
31
30
|
},
|
|
32
31
|
"&:hover::after": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@janbox/storefront-ui",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.7",
|
|
4
4
|
"description": "Storefront UI component library for Janbox",
|
|
5
5
|
"author": "Janbox",
|
|
6
6
|
"keywords": [
|
|
@@ -71,10 +71,8 @@
|
|
|
71
71
|
"embla-carousel-wheel-gestures": "^8.0.2",
|
|
72
72
|
"flat": "^6.0.1",
|
|
73
73
|
"highlight-words-core": "^1.2.3",
|
|
74
|
-
"html-react-parser": "^5.2.2",
|
|
75
|
-
"htmlparser2": "^12.0.0",
|
|
76
74
|
"lodash-es": "^4.17.21",
|
|
77
|
-
"motion": "^
|
|
75
|
+
"motion": "^12.43.0",
|
|
78
76
|
"overlayscrollbars": "^2.16.0",
|
|
79
77
|
"overlayscrollbars-react": "^0.5.6",
|
|
80
78
|
"phone": "^3.1.62",
|
|
@@ -112,6 +110,7 @@
|
|
|
112
110
|
"vite-plugin-checker": "^0.12.0",
|
|
113
111
|
"vite-plugin-dts": "^4.5.4",
|
|
114
112
|
"vite-plugin-static-copy": "^3.1.6",
|
|
113
|
+
"vite-plugin-svgr": "^5.2.0",
|
|
115
114
|
"vite-tsconfig-paths": "^6.1.1"
|
|
116
115
|
},
|
|
117
116
|
"scripts": {
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useId, useMemo, cloneElement } from "react";
|
|
3
|
-
import { parseSvgString } from "../utils/common.js";
|
|
4
|
-
import { Stylesheet } from "../lib/stylesheet/stylesheet.js";
|
|
5
|
-
const SvgLoader = ({ sx, source, ref, ...props }) => {
|
|
6
|
-
const uniqueId = useId();
|
|
7
|
-
const jsxSvg = useMemo(() => parseSvgString(source, uniqueId), [source, uniqueId]);
|
|
8
|
-
return /* @__PURE__ */ jsx(Stylesheet, { children: ({ cx, css }) => {
|
|
9
|
-
if (!jsxSvg) return /* @__PURE__ */ jsx(Fragment, {});
|
|
10
|
-
return cloneElement(jsxSvg, {
|
|
11
|
-
...props,
|
|
12
|
-
className: cx(css(sx), props.className),
|
|
13
|
-
ref
|
|
14
|
-
});
|
|
15
|
-
} });
|
|
16
|
-
};
|
|
17
|
-
export {
|
|
18
|
-
SvgLoader
|
|
19
|
-
};
|