@oneplatformdev/ui 0.1.10-1 → 0.1.10-11

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/Switch/Switch.js CHANGED
@@ -1,27 +1,31 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import * as a from "react";
3
- import * as e from "@radix-ui/react-switch";
4
- import { cn as t } from "@oneplatformdev/utils";
5
- const n = a.forwardRef(({ className: i, ...o }, s) => /* @__PURE__ */ r(
6
- e.Root,
7
- {
8
- className: t(
9
- "peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-xs transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
10
- i
11
- ),
12
- ...o,
13
- ref: s,
14
- children: /* @__PURE__ */ r(
15
- e.Thumb,
16
- {
17
- className: t(
18
- "pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
19
- )
20
- }
21
- )
22
- }
23
- ));
24
- n.displayName = e.Root.displayName;
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import * as t from "@radix-ui/react-switch";
3
+ import { cn as a } from "@oneplatformdev/utils";
4
+ function s({
5
+ className: r,
6
+ ...n
7
+ }) {
8
+ return /* @__PURE__ */ e(
9
+ t.Root,
10
+ {
11
+ "data-slot": "switch",
12
+ className: a(
13
+ "peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
14
+ r
15
+ ),
16
+ ...n,
17
+ children: /* @__PURE__ */ e(
18
+ t.Thumb,
19
+ {
20
+ "data-slot": "switch-thumb",
21
+ className: a(
22
+ "bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0"
23
+ )
24
+ }
25
+ )
26
+ }
27
+ );
28
+ }
25
29
  export {
26
- n as Switch
30
+ s as Switch
27
31
  };
@@ -1,3 +1,3 @@
1
- import { IUseAutosizeTextAreaProps } from '..';
1
+ import { IUseAutosizeTextAreaProps } from '@oneplatformdev/ui';
2
2
  export declare const useAutosizeTextArea: ({ textAreaRef, triggerAutoSize, maxHeight, minHeight, }: IUseAutosizeTextAreaProps) => void;
3
3
  //# sourceMappingURL=useAutosizeTextArea.d.ts.map
@@ -1,8 +1,8 @@
1
1
  import * as React from "react";
2
2
  import * as TooltipPrimitive from "@radix-ui/react-tooltip";
3
- declare const TooltipProvider: React.FC<TooltipPrimitive.TooltipProviderProps>;
4
- declare const TooltipRoot: React.FC<TooltipPrimitive.TooltipProps>;
5
- declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
6
- declare const TooltipContent: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
3
+ declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>): import("react/jsx-runtime").JSX.Element;
4
+ declare function TooltipRoot({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
5
+ declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
6
+ declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
7
7
  export { TooltipRoot, TooltipTrigger, TooltipContent, TooltipProvider };
8
8
  //# sourceMappingURL=TooltipRoot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TooltipRoot.d.ts","sourceRoot":"","sources":["../../src/Tooltip/TooltipRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAA;AAI3D,QAAA,MAAM,eAAe,iDAA4B,CAAA;AAEjD,QAAA,MAAM,WAAW,yCAAwB,CAAA;AAEzC,QAAA,MAAM,cAAc,gHAA2B,CAAA;AAE/C,QAAA,MAAM,cAAc,gKAelB,CAAA;AAGF,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,CAAA"}
1
+ {"version":3,"file":"TooltipRoot.d.ts","sourceRoot":"","sources":["../../src/Tooltip/TooltipRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAA;AAI3D,iBAAS,eAAe,CAAC,EACE,aAAiB,EACjB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,QAAQ,CAAC,2CAQjF;AAED,iBAAS,WAAW,CAAC,EACF,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,2CAMrE;AAED,iBAAS,cAAc,CAAC,EACE,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,2CAE/E;AAED,iBAAS,cAAc,CAAC,EACE,SAAS,EACT,UAAc,EACd,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,2CAiB/E;AAED,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,CAAA"}
@@ -1,23 +1,55 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import * as d from "react";
1
+ import { jsx as i, jsxs as n } from "react/jsx-runtime";
3
2
  import * as o from "@radix-ui/react-tooltip";
4
- import { cn as s } from "@oneplatformdev/utils";
5
- const p = o.Provider, f = o.Root, c = o.Trigger, m = d.forwardRef(({ className: e, sideOffset: i = 4, ...a }, r) => /* @__PURE__ */ t(o.Portal, { children: /* @__PURE__ */ t(
6
- o.Content,
7
- {
8
- ref: r,
9
- sideOffset: i,
10
- className: s(
11
- "z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
12
- e
13
- ),
14
- ...a
15
- }
16
- ) }));
17
- m.displayName = o.Content.displayName;
3
+ import { cn as d } from "@oneplatformdev/utils";
4
+ function l({
5
+ delayDuration: t = 0,
6
+ ...r
7
+ }) {
8
+ return /* @__PURE__ */ i(
9
+ o.Provider,
10
+ {
11
+ "data-slot": "tooltip-provider",
12
+ delayDuration: t,
13
+ ...r
14
+ }
15
+ );
16
+ }
17
+ function p({
18
+ ...t
19
+ }) {
20
+ return /* @__PURE__ */ i(l, { children: /* @__PURE__ */ i(o.Root, { "data-slot": "tooltip", ...t }) });
21
+ }
22
+ function f({
23
+ ...t
24
+ }) {
25
+ return /* @__PURE__ */ i(o.Trigger, { "data-slot": "tooltip-trigger", ...t });
26
+ }
27
+ function c({
28
+ className: t,
29
+ sideOffset: r = 0,
30
+ children: e,
31
+ ...a
32
+ }) {
33
+ return /* @__PURE__ */ i(o.Portal, { children: /* @__PURE__ */ n(
34
+ o.Content,
35
+ {
36
+ "data-slot": "tooltip-content",
37
+ sideOffset: r,
38
+ className: d(
39
+ "bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
40
+ t
41
+ ),
42
+ ...a,
43
+ children: [
44
+ e,
45
+ /* @__PURE__ */ i(o.Arrow, { className: "bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })
46
+ ]
47
+ }
48
+ ) });
49
+ }
18
50
  export {
19
- m as TooltipContent,
20
- p as TooltipProvider,
21
- f as TooltipRoot,
22
- c as TooltipTrigger
51
+ c as TooltipContent,
52
+ l as TooltipProvider,
53
+ p as TooltipRoot,
54
+ f as TooltipTrigger
23
55
  };
@@ -1,15 +1,15 @@
1
1
  import * as o from "react";
2
- const a = 768;
3
- function c(s = {}) {
2
+ const s = 768;
3
+ function c(r = {}) {
4
4
  const {
5
- mobileBreakpoint: e = a
6
- } = s, [r, n] = o.useState(void 0);
5
+ mobileBreakpoint: e = s
6
+ } = r, [a, n] = o.useState(void 0);
7
7
  return o.useEffect(() => {
8
8
  const t = window.matchMedia(`(max-width: ${e - 1}px)`), i = () => {
9
9
  n(window.innerWidth < e);
10
10
  };
11
11
  return t.addEventListener("change", i), n(window.innerWidth < e), () => t.removeEventListener("change", i);
12
- }, [e]), !!r;
12
+ }, [e]), !!a;
13
13
  }
14
14
  export {
15
15
  c as useIsMobile
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAA;AAErB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,e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