@janbox/storefront-ui 6.0.5 → 6.0.6

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 (44) hide show
  1. package/dist/assets/svg/arrow-down.svg.js +3 -2
  2. package/dist/assets/svg/arrow-down2.svg.js +4 -0
  3. package/dist/assets/svg/arrow-left2.svg.js +5 -0
  4. package/dist/assets/svg/arrow-right2.svg.js +5 -0
  5. package/dist/assets/svg/done-check.svg.js +3 -2
  6. package/dist/assets/svg/loading-waiting2.svg.js +5 -0
  7. package/dist/assets/svg/minus.svg.js +3 -2
  8. package/dist/assets/svg/minus2.svg.js +4 -0
  9. package/dist/components/index.d.ts +0 -1
  10. package/dist/components/index.js +0 -2
  11. package/dist/components/scroll-view/scroll-view.js +1 -1
  12. package/dist/lib/accordion/accordion-content/accordion-content.js +1 -1
  13. package/dist/lib/cascader/cascader-floating-content.d.ts +1 -1
  14. package/dist/lib/cascader/cascader-floating-content.js +4 -5
  15. package/dist/lib/cascader/cascader.d.ts +1 -2
  16. package/dist/lib/cascader/cascader.js +4 -6
  17. package/dist/lib/checkbox/README.md +0 -1
  18. package/dist/lib/checkbox/checkbox.js +4 -5
  19. package/dist/lib/count-up/count-up.js +1 -1
  20. package/dist/lib/drawer/drawer/drawer.js +1 -1
  21. package/dist/lib/filter-panel/filter-panel.js +1 -1
  22. package/dist/lib/floating/floating-content/floating-content.js +1 -1
  23. package/dist/lib/icon/README.md +1 -5
  24. package/dist/lib/input-number/input-number.js +1 -1
  25. package/dist/lib/lightbox/lightbox.js +1 -1
  26. package/dist/lib/loading/README.md +0 -1
  27. package/dist/lib/loading/image-skeleton/image-skeleton.js +1 -1
  28. package/dist/lib/loading/loading-overlay/loading-overlay.d.ts +1 -1
  29. package/dist/lib/loading/loading-overlay/loading-overlay.js +3 -4
  30. package/dist/lib/multiple-select/multiple-select.d.ts +1 -2
  31. package/dist/lib/multiple-select/multiple-select.js +4 -6
  32. package/dist/lib/notifications/notifications.js +1 -1
  33. package/dist/lib/select/select.js +5 -7
  34. package/dist/lib/star-rating/star-rating.js +1 -1
  35. package/dist/lib/swiper/swiper-dots-paging/swiper-dots-paging.js +1 -1
  36. package/dist/lib/swiper/swiper-side-arrows-paging/swiper-side-arrows-paging.js +2 -3
  37. package/dist/lib/tabs/tab-indicator/tab-indicator.js +1 -1
  38. package/dist/utils/common.d.ts +0 -2
  39. package/dist/utils/common.js +1 -51
  40. package/dist/utils/index.js +1 -2
  41. package/dist/utils/stylesheet.js +1 -2
  42. package/package.json +2 -3
  43. package/dist/components/svg-loader.d.ts +0 -6
  44. package/dist/components/svg-loader.js +0 -19
@@ -1,4 +1,5 @@
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';
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
- ArrowDownIcon as default
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
- const CheckIcon = '<svg fill="currentColor" width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\n <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"></path>\n</svg>';
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
- CheckIcon as default
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
+ };
@@ -1,4 +1,5 @@
1
- const MinusIcon = '<svg fill="currentColor" width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M19,13H5a1,1,0,0,1,0-2H19a1,1,0,0,1,0,2Z"></path></svg>';
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" }));
2
3
  export {
3
- MinusIcon as default
4
+ SvgMinus as default
4
5
  };
@@ -0,0 +1,4 @@
1
+ const MinusIcon = '<svg fill="currentColor" width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M19,13H5a1,1,0,0,1,0-2H19a1,1,0,0,1,0,2Z"></path></svg>';
2
+ export {
3
+ MinusIcon as default
4
+ };
@@ -1,3 +1,2 @@
1
- export * from './svg-loader';
2
1
  export * from './scroll-view';
3
2
  export * from './virtualized-list';
@@ -1,8 +1,6 @@
1
- import { SvgLoader } from "./svg-loader.js";
2
1
  import { VirtualizedList } from "./virtualized-list.js";
3
2
  import { ScrollView } from "./scroll-view/scroll-view.js";
4
3
  export {
5
4
  ScrollView,
6
- SvgLoader,
7
5
  VirtualizedList
8
6
  };
@@ -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 ArrowRightIcon from "../../assets/svg/arrow-right.svg.js";
6
- import CheckIcon from "../../assets/svg/done-check.svg.js";
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(SvgLoader, { source: ArrowRightIcon, width: 20, height: 20, sx: { color: getColorVar("neutral.400") } }) : isSelected && /* @__PURE__ */ jsx(SvgLoader, { source: CheckIcon, width: 20, height: 20, sx: { color: getColorVar("primary.600") } })
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 ArrowDownIcon from "../../assets/svg/arrow-down.svg.js";
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
- SvgLoader,
108
+ SvgArrowDown,
110
109
  {
111
- source: ArrowDownIcon,
112
110
  width: 20,
113
111
  height: 20,
114
- sx: {
112
+ css: {
115
113
  transition: "transform 150ms",
116
114
  ...isOpen ? { transform: "rotate(-180deg)" } : {}
117
115
  }
@@ -60,7 +60,6 @@ const someChecked = selected.length > 0 && !allChecked;
60
60
 
61
61
  ## Related Components
62
62
 
63
- - [SvgLoader](../svgloader/README.md)
64
63
  - [Primitive](../primitive/README.md)
65
64
 
66
65
  ## Dependencies
@@ -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 { SvgLoader } from "../../components/svg-loader.js";
5
- import CheckIcon from "../../assets/svg/done-check.svg.js";
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/minus.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(SvgLoader, { "data-checkbox-icon": "checked", width: 18, height: 18, source: CheckIcon }),
136
- /* @__PURE__ */ jsx(SvgLoader, { "data-checkbox-icon": "indeterminate", width: 18, height: 18, source: MinusIcon })
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
  )
@@ -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-down.svg.js";
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]);
@@ -1,6 +1,6 @@
1
1
  # Icon
2
2
 
3
- A responsive SVG icon component that renders raw SVG strings via the SvgLoader component. Supports numeric size control with responsive breakpoint overrides (sm/md/lg) and the sx prop for custom styling.
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
@@ -4,7 +4,7 @@ import { useMergeRefs } from "@floating-ui/react";
4
4
  import { isNil } from "lodash-es";
5
5
  import { Input } from "../input/input.js";
6
6
  import { useControllableState } from "../../hooks/use-controllable-state.js";
7
- import MinusIcon from "../../assets/svg/minus.svg.js";
7
+ import MinusIcon from "../../assets/svg/minus2.svg.js";
8
8
  import PlusIcon from "../../assets/svg/plus.svg.js";
9
9
  import { IconButton } from "../icon-button/icon-button.js";
10
10
  const MAX_FRACTION_DIGITS = 10;
@@ -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";
@@ -50,7 +50,6 @@ import { LoadingOverlay } from '@janbox/storefront-ui';
50
50
  ## Related Components
51
51
 
52
52
  - [Primitive](../primitive/README.md)
53
- - [SvgLoader](../svgloader/README.md)
54
53
 
55
54
  ## Dependencies
56
55
 
@@ -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 LoadingIcon from "../../../assets/svg/loading-waiting.svg.js";
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(SvgLoader, { source: LoadingIcon, width: size, height: size, sx: animateSpinStyle, style: { color: main } })
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 ArrowDownIcon from "../../assets/svg/arrow-down.svg.js";
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
- SvgLoader,
242
+ SvgArrowDown,
244
243
  {
245
- source: ArrowDownIcon,
246
244
  width: 20,
247
245
  height: 20,
248
- sx: {
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 ArrowDownIcon from "../../assets/svg/arrow-down.svg.js";
11
- import CheckIcon from "../../assets/svg/done-check.svg.js";
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(SvgLoader, { source: CheckIcon, width: 24, height: 24, sx: { color: getColorVar("primary.600") } })
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
- SvgLoader,
247
+ SvgArrowDown,
249
248
  {
250
- source: ArrowDownIcon,
251
249
  width: 20,
252
250
  height: 20,
253
- sx: {
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 ArrowLeftIcon from "../../../assets/svg/arrow-left.svg.js";
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(SvgLoader, { width: void 0, height: void 0, source: ArrowLeftIcon })
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();
@@ -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;
@@ -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
  };
@@ -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, parseSvgString } from "./common.js";
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
  };
@@ -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: isNumber(height) ? `${height}px` : 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.5",
3
+ "version": "6.0.6",
4
4
  "description": "Storefront UI component library for Janbox",
5
5
  "author": "Janbox",
6
6
  "keywords": [
@@ -71,8 +71,6 @@
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
75
  "motion": "^11.15.0",
78
76
  "overlayscrollbars": "^2.16.0",
@@ -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,6 +0,0 @@
1
- import { JSX } from 'react';
2
- import { PropsWithSx } from '../types';
3
- export type SvgLoaderProps = PropsWithSx<JSX.IntrinsicElements['svg'] & {
4
- source: string;
5
- }>;
6
- export declare const SvgLoader: ({ sx, source, ref, ...props }: SvgLoaderProps) => JSX.Element;
@@ -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
- };