@orangecheck/design 0.7.4 → 0.7.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.
- package/dist/components.js +31 -39
- package/dist/components.js.map +1 -1
- package/dist/components.mjs +30 -38
- package/dist/components.mjs.map +1 -1
- package/dist/composites.d.mts +5 -3
- package/dist/composites.d.ts +5 -3
- package/dist/composites.js +31 -39
- package/dist/composites.js.map +1 -1
- package/dist/composites.mjs +30 -38
- package/dist/composites.mjs.map +1 -1
- package/dist/format.d.mts +12 -1
- package/dist/format.d.ts +12 -1
- package/dist/format.js +48 -0
- package/dist/format.js.map +1 -1
- package/dist/format.mjs +47 -1
- package/dist/format.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +73 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +72 -12
- package/dist/index.mjs.map +1 -1
- package/dist/primitives.js.map +1 -1
- package/dist/primitives.mjs.map +1 -1
- package/package.json +2 -2
package/dist/components.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import * as Popover from '@radix-ui/react-popover';
|
|
1
2
|
import { HelpCircle, Boxes, ChevronDown, Check, CornerDownLeft, Plus, Loader2, Copy } from 'lucide-react';
|
|
2
|
-
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
3
3
|
import { clsx } from 'clsx';
|
|
4
4
|
import { twMerge } from 'tailwind-merge';
|
|
5
5
|
import { jsxs, jsx, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
@@ -12,55 +12,47 @@ import { useOcSession, fetchOcLinkedIdentities } from '@orangecheck/auth-client'
|
|
|
12
12
|
function cn(...inputs) {
|
|
13
13
|
return twMerge(clsx(inputs));
|
|
14
14
|
}
|
|
15
|
-
function Popover({ ...props }) {
|
|
16
|
-
return /* @__PURE__ */ jsx(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
|
|
17
|
-
}
|
|
18
|
-
function PopoverTrigger({ ...props }) {
|
|
19
|
-
return /* @__PURE__ */ jsx(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
20
|
-
}
|
|
21
|
-
function PopoverContent({
|
|
22
|
-
className,
|
|
23
|
-
align = "center",
|
|
24
|
-
sideOffset = 4,
|
|
25
|
-
...props
|
|
26
|
-
}) {
|
|
27
|
-
return /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
28
|
-
PopoverPrimitive.Content,
|
|
29
|
-
{
|
|
30
|
-
"data-slot": "popover-content",
|
|
31
|
-
align,
|
|
32
|
-
sideOffset,
|
|
33
|
-
className: cn(
|
|
34
|
-
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
|
|
35
|
-
className
|
|
36
|
-
),
|
|
37
|
-
...props
|
|
38
|
-
}
|
|
39
|
-
) });
|
|
40
|
-
}
|
|
41
15
|
function HelpHint({
|
|
42
|
-
title,
|
|
43
16
|
children,
|
|
44
|
-
|
|
45
|
-
|
|
17
|
+
title,
|
|
18
|
+
side = "top",
|
|
19
|
+
size = "sm",
|
|
20
|
+
tone = "default",
|
|
21
|
+
label = "what is this?",
|
|
46
22
|
className
|
|
47
23
|
}) {
|
|
48
|
-
|
|
24
|
+
const iconSize = size === "xs" ? 12 : 14;
|
|
25
|
+
return /* @__PURE__ */ jsxs(Popover.Root, { children: [
|
|
49
26
|
/* @__PURE__ */ jsx(
|
|
50
|
-
|
|
27
|
+
Popover.Trigger,
|
|
51
28
|
{
|
|
52
29
|
"aria-label": label,
|
|
30
|
+
onClick: (e) => e.stopPropagation(),
|
|
53
31
|
className: cn(
|
|
54
|
-
"
|
|
32
|
+
"focus-visible:ring-primary/60 inline-flex shrink-0 items-center justify-center rounded-full transition-colors outline-none focus-visible:ring-2",
|
|
33
|
+
tone === "subtle" ? "text-muted-foreground/60 hover:text-foreground/80" : "text-primary/70 hover:text-primary",
|
|
55
34
|
className
|
|
56
35
|
),
|
|
57
|
-
children: /* @__PURE__ */ jsx(HelpCircle, {
|
|
36
|
+
children: /* @__PURE__ */ jsx(HelpCircle, { size: iconSize, "aria-hidden": true })
|
|
58
37
|
}
|
|
59
38
|
),
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
39
|
+
/* @__PURE__ */ jsx(Popover.Portal, { children: /* @__PURE__ */ jsxs(
|
|
40
|
+
Popover.Content,
|
|
41
|
+
{
|
|
42
|
+
side,
|
|
43
|
+
sideOffset: 6,
|
|
44
|
+
collisionPadding: 12,
|
|
45
|
+
className: "border-border bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 z-50 max-w-xs rounded-md border p-3 text-xs leading-relaxed shadow-md outline-none",
|
|
46
|
+
children: [
|
|
47
|
+
title && /* @__PURE__ */ jsxs("div", { className: "label-mono text-primary mb-1.5", children: [
|
|
48
|
+
"\xA7 ",
|
|
49
|
+
title
|
|
50
|
+
] }),
|
|
51
|
+
/* @__PURE__ */ jsx("div", { className: "text-foreground/90", children }),
|
|
52
|
+
/* @__PURE__ */ jsx(Popover.Arrow, { className: "fill-popover" })
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
) })
|
|
64
56
|
] });
|
|
65
57
|
}
|
|
66
58
|
var TONE_CLASS = {
|