@liner-fe/prism 1.12.26 → 1.12.28

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/lib/index.mjs CHANGED
@@ -6814,9 +6814,9 @@ var DefaultButton = forwardRef(
6814
6814
  ref
6815
6815
  },
6816
6816
  /* @__PURE__ */ jsxs99("span", { className: clsx2(defaultButtonChildrenVariants({ size })), children: [
6817
- !!leftIcon && /* @__PURE__ */ jsx138(Icon, { name: leftIcon.name, size: buttonIconSizeMap[size], thick: buttonSizeIconThickMap[size] }),
6817
+ !!leftIcon && /* @__PURE__ */ jsx138(Icon, { ...leftIcon, size: buttonIconSizeMap[size], thick: buttonSizeIconThickMap[size] }),
6818
6818
  /* @__PURE__ */ jsx138("p", { className: style_module_default.content, children: newChildren }),
6819
- !!rightIcon && /* @__PURE__ */ jsx138(Icon, { name: rightIcon.name, size: buttonIconSizeMap[size], thick: buttonSizeIconThickMap[size] })
6819
+ !!rightIcon && /* @__PURE__ */ jsx138(Icon, { ...rightIcon, size: buttonIconSizeMap[size], thick: buttonSizeIconThickMap[size] })
6820
6820
  ] })
6821
6821
  );
6822
6822
  return ParentClone;
@@ -6828,25 +6828,9 @@ var DefaultButton = forwardRef(
6828
6828
  className: clsx2(defaultButtonVariants({ level, fill, align, size, width }), className),
6829
6829
  ref,
6830
6830
  children: /* @__PURE__ */ jsxs99("span", { className: clsx2(defaultButtonChildrenVariants({ size })), children: [
6831
- !!leftIcon && /* @__PURE__ */ jsx138(
6832
- Icon,
6833
- {
6834
- name: leftIcon.name,
6835
- size: buttonIconSizeMap[size],
6836
- thick: buttonSizeIconThickMap[size],
6837
- fill: leftIcon.fill
6838
- }
6839
- ),
6831
+ !!leftIcon && /* @__PURE__ */ jsx138(Icon, { ...leftIcon, size: buttonIconSizeMap[size], thick: buttonSizeIconThickMap[size] }),
6840
6832
  /* @__PURE__ */ jsx138("p", { className: style_module_default.content, children }),
6841
- !!rightIcon && /* @__PURE__ */ jsx138(
6842
- Icon,
6843
- {
6844
- name: rightIcon.name,
6845
- size: buttonIconSizeMap[size],
6846
- thick: buttonSizeIconThickMap[size],
6847
- fill: rightIcon.fill
6848
- }
6849
- )
6833
+ !!rightIcon && /* @__PURE__ */ jsx138(Icon, { ...rightIcon, size: buttonIconSizeMap[size], thick: buttonSizeIconThickMap[size] })
6850
6834
  ] })
6851
6835
  }
6852
6836
  );
@@ -7764,49 +7748,64 @@ import * as ScrollArea from "@radix-ui/react-scroll-area";
7764
7748
 
7765
7749
  // src/components/Select/style.module.scss
7766
7750
  var style_module_default13 = {
7767
- "select-label": "_select-label_1dsk6_101",
7768
- "trigger": "_trigger_1dsk6_105",
7769
- "placeholder": "_placeholder_1dsk6_145",
7770
- "openIcon": "_openIcon_1dsk6_149",
7771
- "desktop-content": "_desktop-content_1dsk6_165",
7772
- "slide-up": "_slide-up_1dsk6_226",
7773
- "header": "_header_1dsk6_185",
7774
- "mobile-overlay": "_mobile-overlay_1dsk6_193",
7775
- "mobile-content": "_mobile-content_1dsk6_209",
7776
- "slide-down": "_slide-down_1dsk6_230",
7777
- "slide-in-right": "_slide-in-right_1dsk6_234",
7778
- "slide-out-right": "_slide-out-right_1dsk6_238",
7779
- "mobile-viewport": "_mobile-viewport_1dsk6_243",
7780
- "scrollAreaRoot": "_scrollAreaRoot_1dsk6_247",
7781
- "scrollAreaViewport": "_scrollAreaViewport_1dsk6_252",
7782
- "scrollAreaScrollbar": "_scrollAreaScrollbar_1dsk6_259",
7783
- "scrollAreaThumb": "_scrollAreaThumb_1dsk6_264",
7784
- "desktop-label": "_desktop-label_1dsk6_269",
7785
- "mobile-label": "_mobile-label_1dsk6_274",
7786
- "item": "_item_1dsk6_282",
7787
- "icon": "_icon_1dsk6_310",
7788
- "itemIndicator": "_itemIndicator_1dsk6_316"
7751
+ "select-label": "_select-label_x2vxw_101",
7752
+ "trigger": "_trigger_x2vxw_105",
7753
+ "placeholder": "_placeholder_x2vxw_145",
7754
+ "openIcon": "_openIcon_x2vxw_149",
7755
+ "desktop-content": "_desktop-content_x2vxw_165",
7756
+ "slide-up": "_slide-up_x2vxw_1",
7757
+ "responsive": "_responsive_x2vxw_180",
7758
+ "header": "_header_x2vxw_185",
7759
+ "scrollAreaRoot": "_scrollAreaRoot_x2vxw_193",
7760
+ "scrollAreaViewport": "_scrollAreaViewport_x2vxw_198",
7761
+ "scrollAreaScrollbar": "_scrollAreaScrollbar_x2vxw_205",
7762
+ "scrollAreaThumb": "_scrollAreaThumb_x2vxw_210",
7763
+ "desktop-label": "_desktop-label_x2vxw_215",
7764
+ "item": "_item_x2vxw_220",
7765
+ "icon": "_icon_x2vxw_248",
7766
+ "itemIndicator": "_itemIndicator_x2vxw_254",
7767
+ "slide-down": "_slide-down_x2vxw_1",
7768
+ "slide-in-right": "_slide-in-right_x2vxw_1",
7769
+ "slide-out-right": "_slide-out-right_x2vxw_1"
7789
7770
  };
7790
7771
 
7791
7772
  // src/components/Select/index.tsx
7792
- import { forwardRef as forwardRef10, useEffect as useEffect3, useState as useState5 } from "react";
7773
+ import { forwardRef as forwardRef10, useEffect as useEffect2, useState as useState4 } from "react";
7793
7774
  import clsx15 from "clsx";
7794
-
7795
- // src/hooks/media.ts
7796
- import { useEffect as useEffect2, useState as useState4 } from "react";
7797
- var useMediaQuery = /* @__PURE__ */ __name((query) => {
7798
- const [matches, setMatches] = useState4();
7799
- useEffect2(() => {
7800
- const mediaQuery = window.matchMedia(query);
7801
- const handleChange = /* @__PURE__ */ __name(() => setMatches(mediaQuery.matches), "handleChange");
7802
- mediaQuery.addEventListener("change", handleChange);
7803
- return () => mediaQuery.removeEventListener("change", handleChange);
7804
- }, [query]);
7805
- return matches;
7806
- }, "useMediaQuery");
7807
-
7808
- // src/components/Select/index.tsx
7809
7775
  import { Fragment as Fragment7, jsx as jsx153, jsxs as jsxs107 } from "react/jsx-runtime";
7776
+ var SelectContent = forwardRef10((props, ref) => {
7777
+ const { isResponsive, popSide, sideOffset, listLabel, children } = props;
7778
+ return /* @__PURE__ */ jsx153(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsx153(
7779
+ SelectPrimitive.Content,
7780
+ {
7781
+ ref: (instance) => {
7782
+ if (typeof ref === "function") {
7783
+ ref(instance);
7784
+ } else if (ref) {
7785
+ ref.current = instance;
7786
+ }
7787
+ if (!instance) return;
7788
+ instance.ontouchstart = (e) => {
7789
+ e.stopPropagation();
7790
+ };
7791
+ },
7792
+ className: clsx15(style_module_default13["desktop-content"], {
7793
+ [style_module_default13["responsive"]]: isResponsive
7794
+ }),
7795
+ position: "popper",
7796
+ side: popSide,
7797
+ sideOffset,
7798
+ avoidCollisions: false,
7799
+ children: /* @__PURE__ */ jsxs107(ScrollArea.Root, { className: style_module_default13.scrollAreaRoot, type: "scroll", children: [
7800
+ /* @__PURE__ */ jsx153(SelectPrimitive.Viewport, { asChild: true, children: /* @__PURE__ */ jsx153(ScrollArea.Viewport, { className: style_module_default13.scrollAreaViewport, style: { overflowY: void 0 }, children: /* @__PURE__ */ jsxs107(SelectPrimitive.Group, { children: [
7801
+ /* @__PURE__ */ jsx153(SelectPrimitive.Label, { asChild: true, children: /* @__PURE__ */ jsx153(Label, { className: style_module_default13["desktop-label"], level: "secondary", size: "m", offset: "low", children: listLabel }) }),
7802
+ children
7803
+ ] }) }) }),
7804
+ /* @__PURE__ */ jsx153(ScrollArea.Scrollbar, { className: style_module_default13.scrollAreaScrollbar, orientation: "vertical", children: /* @__PURE__ */ jsx153(ScrollArea.Thumb, { className: style_module_default13.scrollAreaThumb }) })
7805
+ ] })
7806
+ }
7807
+ ) });
7808
+ });
7810
7809
  var SelectRoot = forwardRef10((props, ref) => {
7811
7810
  const {
7812
7811
  id,
@@ -7819,15 +7818,13 @@ var SelectRoot = forwardRef10((props, ref) => {
7819
7818
  children,
7820
7819
  open = false,
7821
7820
  onOpenChange,
7822
- isOverlay = false,
7821
+ isResponsive = false,
7823
7822
  openDirection = "slide-right",
7824
7823
  ...rest
7825
7824
  } = props;
7826
- const [isOpen, setIsOpen] = useState5(true);
7827
- const [isClosing, setIsClosing] = useState5(false);
7828
- const [isBack, setIsBack] = useState5(false);
7829
- const isMobile = useMediaQuery("(max-width: 600px)");
7830
- useEffect3(() => {
7825
+ const contentProps = { isResponsive, popSide, sideOffset, listLabel, children };
7826
+ const [isOpen, setIsOpen] = useState4(true);
7827
+ useEffect2(() => {
7831
7828
  setIsOpen(open);
7832
7829
  }, [open]);
7833
7830
  return /* @__PURE__ */ jsxs107(Fragment7, { children: [
@@ -7846,74 +7843,7 @@ var SelectRoot = forwardRef10((props, ref) => {
7846
7843
  /* @__PURE__ */ jsx153(SelectPrimitive.Value, { className: style_module_default13.placeholder, placeholder }),
7847
7844
  /* @__PURE__ */ jsx153(SelectPrimitive.Icon, { className: style_module_default13.openIcon, children: /* @__PURE__ */ jsx153(Icon, { name: "arrow-drop-down", fill: true, thick: true, size: "xs" }) })
7848
7845
  ] }),
7849
- /* @__PURE__ */ jsx153(SelectPrimitive.Portal, { children: isMobile ? /* @__PURE__ */ jsxs107(Fragment7, { children: [
7850
- /* @__PURE__ */ jsx153(
7851
- SelectPrimitive.Content,
7852
- {
7853
- className: clsx15(style_module_default13["mobile-content"], {
7854
- [style_module_default13["slide-in-right"]]: openDirection === "slide-right",
7855
- [style_module_default13["slide-up"]]: openDirection === "slide-up",
7856
- [style_module_default13["slide-out-right"]]: isBack,
7857
- [style_module_default13["slide-down"]]: isClosing
7858
- }),
7859
- avoidCollisions: false,
7860
- children: /* @__PURE__ */ jsxs107(ScrollArea.Root, { className: style_module_default13.scrollAreaRoot, type: "scroll", children: [
7861
- /* @__PURE__ */ jsx153(SelectPrimitive.Viewport, { asChild: true, children: /* @__PURE__ */ jsxs107(SelectPrimitive.Group, { children: [
7862
- /* @__PURE__ */ jsxs107("div", { className: style_module_default13.header, children: [
7863
- /* @__PURE__ */ jsx153(
7864
- IconButton,
7865
- {
7866
- name: "arrow-back",
7867
- level: "tertiary",
7868
- onClick: () => {
7869
- setIsBack(true);
7870
- setTimeout(() => {
7871
- setIsOpen(false);
7872
- setIsBack(false);
7873
- }, 250);
7874
- }
7875
- }
7876
- ),
7877
- /* @__PURE__ */ jsx153(SelectPrimitive.Label, { asChild: true, children: /* @__PURE__ */ jsx153(Label, { className: style_module_default13["mobile-label"], level: "primary", size: "m", offset: "low", children: listLabel }) }),
7878
- /* @__PURE__ */ jsx153(
7879
- IconButton,
7880
- {
7881
- name: "close",
7882
- level: "tertiary",
7883
- onClick: () => {
7884
- setIsClosing(true);
7885
- setTimeout(() => {
7886
- setIsOpen(false);
7887
- setIsClosing(false);
7888
- }, 250);
7889
- }
7890
- }
7891
- )
7892
- ] }),
7893
- /* @__PURE__ */ jsx153(ScrollArea.Viewport, { className: style_module_default13["mobile-viewport"], style: { overflowY: void 0 }, children })
7894
- ] }) }),
7895
- /* @__PURE__ */ jsx153(ScrollArea.Scrollbar, { className: style_module_default13.scrollAreaScrollbar, orientation: "vertical", children: /* @__PURE__ */ jsx153(ScrollArea.Thumb, { className: style_module_default13.scrollAreaThumb }) })
7896
- ] })
7897
- }
7898
- ),
7899
- isOverlay && /* @__PURE__ */ jsx153("div", { className: style_module_default13["mobile-overlay"] })
7900
- ] }) : /* @__PURE__ */ jsx153(
7901
- SelectPrimitive.Content,
7902
- {
7903
- className: style_module_default13["desktop-content"],
7904
- position: "popper",
7905
- side: popSide,
7906
- sideOffset,
7907
- avoidCollisions: false,
7908
- children: /* @__PURE__ */ jsxs107(ScrollArea.Root, { className: style_module_default13.scrollAreaRoot, type: "scroll", children: [
7909
- /* @__PURE__ */ jsx153(SelectPrimitive.Viewport, { asChild: true, children: /* @__PURE__ */ jsx153(ScrollArea.Viewport, { className: style_module_default13.scrollAreaViewport, style: { overflowY: void 0 }, children: /* @__PURE__ */ jsxs107(SelectPrimitive.Group, { children: [
7910
- /* @__PURE__ */ jsx153(SelectPrimitive.Label, { asChild: true, children: /* @__PURE__ */ jsx153(Label, { className: style_module_default13["desktop-label"], level: "secondary", size: "m", offset: "low", children: listLabel }) }),
7911
- children
7912
- ] }) }) }),
7913
- /* @__PURE__ */ jsx153(ScrollArea.Scrollbar, { className: style_module_default13.scrollAreaScrollbar, orientation: "vertical", children: /* @__PURE__ */ jsx153(ScrollArea.Thumb, { className: style_module_default13.scrollAreaThumb }) })
7914
- ] })
7915
- }
7916
- ) })
7846
+ /* @__PURE__ */ jsx153(SelectContent, { ...contentProps })
7917
7847
  ]
7918
7848
  }
7919
7849
  )