@j3m-quantum/ui 0.7.11 → 0.7.13

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/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var React8 = require('react');
3
+ var React7 = require('react');
4
4
  var reactSlot = require('@radix-ui/react-slot');
5
5
  var classVarianceAuthority = require('class-variance-authority');
6
6
  var clsx = require('clsx');
@@ -15,7 +15,6 @@ var SliderPrimitive = require('@radix-ui/react-slider');
15
15
  var SelectPrimitive = require('@radix-ui/react-select');
16
16
  var TogglePrimitive = require('@radix-ui/react-toggle');
17
17
  var ToggleGroupPrimitive = require('@radix-ui/react-toggle-group');
18
- var inputOtp = require('input-otp');
19
18
  var reactHookForm = require('react-hook-form');
20
19
  var LabelPrimitive = require('@radix-ui/react-label');
21
20
  var AvatarPrimitive = require('@radix-ui/react-avatar');
@@ -62,7 +61,7 @@ function _interopNamespace(e) {
62
61
  return Object.freeze(n);
63
62
  }
64
63
 
65
- var React8__namespace = /*#__PURE__*/_interopNamespace(React8);
64
+ var React7__namespace = /*#__PURE__*/_interopNamespace(React7);
66
65
  var SeparatorPrimitive__namespace = /*#__PURE__*/_interopNamespace(SeparatorPrimitive);
67
66
  var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
68
67
  var RadioGroupPrimitive__namespace = /*#__PURE__*/_interopNamespace(RadioGroupPrimitive);
@@ -95,8 +94,8 @@ var ResizablePrimitive__namespace = /*#__PURE__*/_interopNamespace(ResizablePrim
95
94
  // src/hooks/use-mobile.ts
96
95
  var MOBILE_BREAKPOINT = 768;
97
96
  function useIsMobile() {
98
- const [isMobile, setIsMobile] = React8__namespace.useState(void 0);
99
- React8__namespace.useEffect(() => {
97
+ const [isMobile, setIsMobile] = React7__namespace.useState(void 0);
98
+ React7__namespace.useEffect(() => {
100
99
  const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
101
100
  const onChange = () => {
102
101
  setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
@@ -137,7 +136,7 @@ var buttonVariants = classVarianceAuthority.cva(
137
136
  }
138
137
  }
139
138
  );
140
- var Button = React8__namespace.forwardRef(
139
+ var Button = React7__namespace.forwardRef(
141
140
  ({ className, variant, size, asChild = false, ...props }, ref) => {
142
141
  const Comp = asChild ? reactSlot.Slot : "button";
143
142
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -501,7 +500,7 @@ function Slider({
501
500
  max = 100,
502
501
  ...props
503
502
  }) {
504
- const _values = React8__namespace.useMemo(
503
+ const _values = React7__namespace.useMemo(
505
504
  () => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
506
505
  [value, defaultValue, min, max]
507
506
  );
@@ -716,7 +715,7 @@ function NativeSelect({ className, ...props }) {
716
715
  {
717
716
  "data-slot": "native-select",
718
717
  className: cn(
719
- "border-input placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground bg-background dark:bg-input/30 dark:hover:bg-input/50 h-9 w-full min-w-0 appearance-none rounded-full border px-4 py-2 pr-10 text-sm shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed",
718
+ "border-input placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground bg-background dark:bg-input/30 dark:hover:bg-input/50 h-9 w-full min-w-0 appearance-none rounded-full border pl-4 py-2 pr-8 text-sm shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed",
720
719
  "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
721
720
  "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
722
721
  className
@@ -727,7 +726,7 @@ function NativeSelect({ className, ...props }) {
727
726
  /* @__PURE__ */ jsxRuntime.jsx(
728
727
  lucideReact.ChevronDownIcon,
729
728
  {
730
- className: "text-muted-foreground pointer-events-none absolute top-1/2 right-4 size-4 -translate-y-1/2 opacity-50 select-none",
729
+ className: "text-muted-foreground pointer-events-none absolute top-1/2 right-2.5 size-4 -translate-y-1/2 opacity-50 select-none",
731
730
  "aria-hidden": "true",
732
731
  "data-slot": "native-select-icon"
733
732
  }
@@ -787,7 +786,7 @@ function Toggle({
787
786
  }
788
787
  );
789
788
  }
790
- var ToggleGroupContext = React8__namespace.createContext({
789
+ var ToggleGroupContext = React7__namespace.createContext({
791
790
  size: "default",
792
791
  variant: "default",
793
792
  spacing: 0
@@ -824,7 +823,7 @@ function ToggleGroupItem({
824
823
  size,
825
824
  ...props
826
825
  }) {
827
- const context = React8__namespace.useContext(ToggleGroupContext);
826
+ const context = React7__namespace.useContext(ToggleGroupContext);
828
827
  return /* @__PURE__ */ jsxRuntime.jsx(
829
828
  ToggleGroupPrimitive__namespace.Item,
830
829
  {
@@ -846,61 +845,6 @@ function ToggleGroupItem({
846
845
  }
847
846
  );
848
847
  }
849
- function InputOTP({
850
- className,
851
- containerClassName,
852
- ...props
853
- }) {
854
- return /* @__PURE__ */ jsxRuntime.jsx(
855
- inputOtp.OTPInput,
856
- {
857
- "data-slot": "input-otp",
858
- containerClassName: cn(
859
- "flex items-center gap-2 has-disabled:opacity-50",
860
- containerClassName
861
- ),
862
- className: cn("disabled:cursor-not-allowed", className),
863
- ...props
864
- }
865
- );
866
- }
867
- function InputOTPGroup({ className, ...props }) {
868
- return /* @__PURE__ */ jsxRuntime.jsx(
869
- "div",
870
- {
871
- "data-slot": "input-otp-group",
872
- className: cn("flex items-center", className),
873
- ...props
874
- }
875
- );
876
- }
877
- function InputOTPSlot({
878
- index,
879
- className,
880
- ...props
881
- }) {
882
- const inputOTPContext = React8__namespace.useContext(inputOtp.OTPInputContext);
883
- const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
884
- return /* @__PURE__ */ jsxRuntime.jsxs(
885
- "div",
886
- {
887
- "data-slot": "input-otp-slot",
888
- "data-active": isActive,
889
- className: cn(
890
- "data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive bg-background border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-full first:border-l last:rounded-r-full data-[active=true]:z-10 data-[active=true]:ring-[3px]",
891
- className
892
- ),
893
- ...props,
894
- children: [
895
- char,
896
- hasFakeCaret && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "animate-caret-blink bg-foreground h-4 w-px duration-1000" }) })
897
- ]
898
- }
899
- );
900
- }
901
- function InputOTPSeparator({ ...props }) {
902
- return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "input-otp-separator", role: "separator", ...props, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MinusIcon, {}) });
903
- }
904
848
  function Label2({
905
849
  className,
906
850
  ...props
@@ -918,7 +862,7 @@ function Label2({
918
862
  );
919
863
  }
920
864
  var Form = reactHookForm.FormProvider;
921
- var FormFieldContext = React8__namespace.createContext(
865
+ var FormFieldContext = React7__namespace.createContext(
922
866
  {}
923
867
  );
924
868
  var FormField = ({
@@ -927,8 +871,8 @@ var FormField = ({
927
871
  return /* @__PURE__ */ jsxRuntime.jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsxRuntime.jsx(reactHookForm.Controller, { ...props }) });
928
872
  };
929
873
  var useFormField = () => {
930
- const fieldContext = React8__namespace.useContext(FormFieldContext);
931
- const itemContext = React8__namespace.useContext(FormItemContext);
874
+ const fieldContext = React7__namespace.useContext(FormFieldContext);
875
+ const itemContext = React7__namespace.useContext(FormItemContext);
932
876
  const { getFieldState } = reactHookForm.useFormContext();
933
877
  const formState = reactHookForm.useFormState({ name: fieldContext.name });
934
878
  const fieldState = getFieldState(fieldContext.name, formState);
@@ -945,11 +889,11 @@ var useFormField = () => {
945
889
  ...fieldState
946
890
  };
947
891
  };
948
- var FormItemContext = React8__namespace.createContext(
892
+ var FormItemContext = React7__namespace.createContext(
949
893
  {}
950
894
  );
951
895
  function FormItem({ className, ...props }) {
952
- const id = React8__namespace.useId();
896
+ const id = React7__namespace.useId();
953
897
  return /* @__PURE__ */ jsxRuntime.jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsxRuntime.jsx(
954
898
  "div",
955
899
  {
@@ -1197,7 +1141,7 @@ function FieldError({
1197
1141
  errors,
1198
1142
  ...props
1199
1143
  }) {
1200
- const content = React8.useMemo(() => {
1144
+ const content = React7.useMemo(() => {
1201
1145
  if (children) {
1202
1146
  return children;
1203
1147
  }
@@ -1759,8 +1703,8 @@ function CalendarDayButton({
1759
1703
  modifiers,
1760
1704
  ...props
1761
1705
  }) {
1762
- const ref = React8__namespace.useRef(null);
1763
- React8__namespace.useEffect(() => {
1706
+ const ref = React7__namespace.useRef(null);
1707
+ React7__namespace.useEffect(() => {
1764
1708
  if (modifiers.focused) ref.current?.focus();
1765
1709
  }, [modifiers.focused]);
1766
1710
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -1781,9 +1725,9 @@ function CalendarDayButton({
1781
1725
  }
1782
1726
  );
1783
1727
  }
1784
- var CarouselContext = React8__namespace.createContext(null);
1728
+ var CarouselContext = React7__namespace.createContext(null);
1785
1729
  function useCarousel() {
1786
- const context = React8__namespace.useContext(CarouselContext);
1730
+ const context = React7__namespace.useContext(CarouselContext);
1787
1731
  if (!context) {
1788
1732
  throw new Error("useCarousel must be used within a <Carousel />");
1789
1733
  }
@@ -1805,20 +1749,20 @@ function Carousel({
1805
1749
  },
1806
1750
  plugins
1807
1751
  );
1808
- const [canScrollPrev, setCanScrollPrev] = React8__namespace.useState(false);
1809
- const [canScrollNext, setCanScrollNext] = React8__namespace.useState(false);
1810
- const onSelect = React8__namespace.useCallback((api2) => {
1752
+ const [canScrollPrev, setCanScrollPrev] = React7__namespace.useState(false);
1753
+ const [canScrollNext, setCanScrollNext] = React7__namespace.useState(false);
1754
+ const onSelect = React7__namespace.useCallback((api2) => {
1811
1755
  if (!api2) return;
1812
1756
  setCanScrollPrev(api2.canScrollPrev());
1813
1757
  setCanScrollNext(api2.canScrollNext());
1814
1758
  }, []);
1815
- const scrollPrev = React8__namespace.useCallback(() => {
1759
+ const scrollPrev = React7__namespace.useCallback(() => {
1816
1760
  api?.scrollPrev();
1817
1761
  }, [api]);
1818
- const scrollNext = React8__namespace.useCallback(() => {
1762
+ const scrollNext = React7__namespace.useCallback(() => {
1819
1763
  api?.scrollNext();
1820
1764
  }, [api]);
1821
- const handleKeyDown = React8__namespace.useCallback(
1765
+ const handleKeyDown = React7__namespace.useCallback(
1822
1766
  (event) => {
1823
1767
  if (event.key === "ArrowLeft") {
1824
1768
  event.preventDefault();
@@ -1830,11 +1774,11 @@ function Carousel({
1830
1774
  },
1831
1775
  [scrollPrev, scrollNext]
1832
1776
  );
1833
- React8__namespace.useEffect(() => {
1777
+ React7__namespace.useEffect(() => {
1834
1778
  if (!api || !setApi) return;
1835
1779
  setApi(api);
1836
1780
  }, [api, setApi]);
1837
- React8__namespace.useEffect(() => {
1781
+ React7__namespace.useEffect(() => {
1838
1782
  if (!api) return;
1839
1783
  onSelect(api);
1840
1784
  api.on("reInit", onSelect);
@@ -1967,9 +1911,9 @@ function CarouselNext({
1967
1911
  );
1968
1912
  }
1969
1913
  var THEMES = { light: "", dark: ".dark" };
1970
- var ChartContext = React8__namespace.createContext(null);
1914
+ var ChartContext = React7__namespace.createContext(null);
1971
1915
  function useChart() {
1972
- const context = React8__namespace.useContext(ChartContext);
1916
+ const context = React7__namespace.useContext(ChartContext);
1973
1917
  if (!context) {
1974
1918
  throw new Error("useChart must be used within a <ChartContainer />");
1975
1919
  }
@@ -1982,7 +1926,7 @@ function ChartContainer({
1982
1926
  config,
1983
1927
  ...props
1984
1928
  }) {
1985
- const uniqueId = React8__namespace.useId();
1929
+ const uniqueId = React7__namespace.useId();
1986
1930
  const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
1987
1931
  return /* @__PURE__ */ jsxRuntime.jsx(ChartContext.Provider, { value: { config }, children: /* @__PURE__ */ jsxRuntime.jsxs(
1988
1932
  "div",
@@ -2043,7 +1987,7 @@ function ChartTooltipContent({
2043
1987
  labelKey
2044
1988
  }) {
2045
1989
  const { config } = useChart();
2046
- const tooltipLabel = React8__namespace.useMemo(() => {
1990
+ const tooltipLabel = React7__namespace.useMemo(() => {
2047
1991
  if (hideLabel || !payload?.length) {
2048
1992
  return null;
2049
1993
  }
@@ -2766,16 +2710,16 @@ var M = (e, i, s, u, m, a, l, h) => {
2766
2710
  } catch (n) {
2767
2711
  }
2768
2712
  };
2769
- var x = React8__namespace.createContext(void 0);
2713
+ var x = React7__namespace.createContext(void 0);
2770
2714
  var U = { setTheme: (e) => {
2771
2715
  }, themes: [] };
2772
2716
  var z = () => {
2773
2717
  var e;
2774
- return (e = React8__namespace.useContext(x)) != null ? e : U;
2718
+ return (e = React7__namespace.useContext(x)) != null ? e : U;
2775
2719
  };
2776
- React8__namespace.memo(({ forcedTheme: e, storageKey: i, attribute: s, enableSystem: u, enableColorScheme: m, defaultTheme: a, value: l, themes: h, nonce: d, scriptProps: w }) => {
2720
+ React7__namespace.memo(({ forcedTheme: e, storageKey: i, attribute: s, enableSystem: u, enableColorScheme: m, defaultTheme: a, value: l, themes: h, nonce: d, scriptProps: w }) => {
2777
2721
  let p = JSON.stringify([s, i, a, e, h, l, u, m]).slice(1, -1);
2778
- return React8__namespace.createElement("script", { ...w, suppressHydrationWarning: true, nonce: typeof window == "undefined" ? d : "", dangerouslySetInnerHTML: { __html: `(${M.toString()})(${p})` } });
2722
+ return React7__namespace.createElement("script", { ...w, suppressHydrationWarning: true, nonce: typeof window == "undefined" ? d : "", dangerouslySetInnerHTML: { __html: `(${M.toString()})(${p})` } });
2779
2723
  });
2780
2724
  var Toaster = ({ ...props }) => {
2781
2725
  const { theme = "system" } = z();
@@ -4508,9 +4452,9 @@ var SIDEBAR_WIDTH = "16rem";
4508
4452
  var SIDEBAR_WIDTH_MOBILE = "18rem";
4509
4453
  var SIDEBAR_WIDTH_ICON = "3rem";
4510
4454
  var SIDEBAR_KEYBOARD_SHORTCUT = "b";
4511
- var SidebarContext = React8__namespace.createContext(null);
4455
+ var SidebarContext = React7__namespace.createContext(null);
4512
4456
  function useSidebar() {
4513
- const context = React8__namespace.useContext(SidebarContext);
4457
+ const context = React7__namespace.useContext(SidebarContext);
4514
4458
  if (!context) {
4515
4459
  throw new Error("useSidebar must be used within a SidebarProvider.");
4516
4460
  }
@@ -4526,10 +4470,10 @@ function SidebarProvider({
4526
4470
  ...props
4527
4471
  }) {
4528
4472
  const isMobile = useIsMobile();
4529
- const [openMobile, setOpenMobile] = React8__namespace.useState(false);
4530
- const [_open, _setOpen] = React8__namespace.useState(defaultOpen);
4473
+ const [openMobile, setOpenMobile] = React7__namespace.useState(false);
4474
+ const [_open, _setOpen] = React7__namespace.useState(defaultOpen);
4531
4475
  const open = openProp ?? _open;
4532
- const setOpen = React8__namespace.useCallback(
4476
+ const setOpen = React7__namespace.useCallback(
4533
4477
  (value) => {
4534
4478
  const openState = typeof value === "function" ? value(open) : value;
4535
4479
  if (setOpenProp) {
@@ -4541,10 +4485,10 @@ function SidebarProvider({
4541
4485
  },
4542
4486
  [setOpenProp, open]
4543
4487
  );
4544
- const toggleSidebar = React8__namespace.useCallback(() => {
4488
+ const toggleSidebar = React7__namespace.useCallback(() => {
4545
4489
  return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
4546
4490
  }, [isMobile, setOpen, setOpenMobile]);
4547
- React8__namespace.useEffect(() => {
4491
+ React7__namespace.useEffect(() => {
4548
4492
  const handleKeyDown = (event) => {
4549
4493
  if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
4550
4494
  event.preventDefault();
@@ -4555,7 +4499,7 @@ function SidebarProvider({
4555
4499
  return () => window.removeEventListener("keydown", handleKeyDown);
4556
4500
  }, [toggleSidebar]);
4557
4501
  const state = open ? "expanded" : "collapsed";
4558
- const contextValue = React8__namespace.useMemo(
4502
+ const contextValue = React7__namespace.useMemo(
4559
4503
  () => ({
4560
4504
  state,
4561
4505
  open,
@@ -5013,7 +4957,7 @@ function SidebarMenuSkeleton({
5013
4957
  showIcon = false,
5014
4958
  ...props
5015
4959
  }) {
5016
- const width = React8__namespace.useMemo(() => {
4960
+ const width = React7__namespace.useMemo(() => {
5017
4961
  return `${Math.floor(Math.random() * 40) + 50}%`;
5018
4962
  }, []);
5019
4963
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -5157,7 +5101,7 @@ var sectionVariants = classVarianceAuthority.cva(
5157
5101
  }
5158
5102
  );
5159
5103
  var isGlassVariant = (variant) => variant?.startsWith("glass-") ?? false;
5160
- var Section = React8__namespace.forwardRef(
5104
+ var Section = React7__namespace.forwardRef(
5161
5105
  ({ className, variant, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
5162
5106
  "section",
5163
5107
  {
@@ -5169,7 +5113,7 @@ var Section = React8__namespace.forwardRef(
5169
5113
  )
5170
5114
  );
5171
5115
  Section.displayName = "Section";
5172
- var SectionHeader = React8__namespace.forwardRef(
5116
+ var SectionHeader = React7__namespace.forwardRef(
5173
5117
  ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
5174
5118
  "div",
5175
5119
  {
@@ -5184,7 +5128,7 @@ var SectionHeader = React8__namespace.forwardRef(
5184
5128
  )
5185
5129
  );
5186
5130
  SectionHeader.displayName = "SectionHeader";
5187
- var SectionTitle = React8__namespace.forwardRef(
5131
+ var SectionTitle = React7__namespace.forwardRef(
5188
5132
  ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
5189
5133
  "h2",
5190
5134
  {
@@ -5198,7 +5142,7 @@ var SectionTitle = React8__namespace.forwardRef(
5198
5142
  )
5199
5143
  );
5200
5144
  SectionTitle.displayName = "SectionTitle";
5201
- var SectionDescription = React8__namespace.forwardRef(
5145
+ var SectionDescription = React7__namespace.forwardRef(
5202
5146
  ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
5203
5147
  "p",
5204
5148
  {
@@ -5212,7 +5156,7 @@ var SectionDescription = React8__namespace.forwardRef(
5212
5156
  )
5213
5157
  );
5214
5158
  SectionDescription.displayName = "SectionDescription";
5215
- var SectionContent = React8__namespace.forwardRef(
5159
+ var SectionContent = React7__namespace.forwardRef(
5216
5160
  ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
5217
5161
  "div",
5218
5162
  {
@@ -5226,7 +5170,7 @@ var SectionContent = React8__namespace.forwardRef(
5226
5170
  )
5227
5171
  );
5228
5172
  SectionContent.displayName = "SectionContent";
5229
- var SectionFooter = React8__namespace.forwardRef(
5173
+ var SectionFooter = React7__namespace.forwardRef(
5230
5174
  ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
5231
5175
  "div",
5232
5176
  {
@@ -5392,10 +5336,6 @@ exports.InputGroupButton = InputGroupButton;
5392
5336
  exports.InputGroupInput = InputGroupInput;
5393
5337
  exports.InputGroupText = InputGroupText;
5394
5338
  exports.InputGroupTextarea = InputGroupTextarea;
5395
- exports.InputOTP = InputOTP;
5396
- exports.InputOTPGroup = InputOTPGroup;
5397
- exports.InputOTPSeparator = InputOTPSeparator;
5398
- exports.InputOTPSlot = InputOTPSlot;
5399
5339
  exports.Item = Item5;
5400
5340
  exports.ItemActions = ItemActions;
5401
5341
  exports.ItemContent = ItemContent;