@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.
@@ -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
- side = "bottom",
45
- label = "more information",
17
+ title,
18
+ side = "top",
19
+ size = "sm",
20
+ tone = "default",
21
+ label = "what is this?",
46
22
  className
47
23
  }) {
48
- return /* @__PURE__ */ jsxs(Popover, { children: [
24
+ const iconSize = size === "xs" ? 12 : 14;
25
+ return /* @__PURE__ */ jsxs(Popover.Root, { children: [
49
26
  /* @__PURE__ */ jsx(
50
- PopoverTrigger,
27
+ Popover.Trigger,
51
28
  {
52
29
  "aria-label": label,
30
+ onClick: (e) => e.stopPropagation(),
53
31
  className: cn(
54
- "text-muted-foreground/60 hover:text-foreground inline-flex size-3.5 items-center justify-center align-middle transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring",
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, { className: "size-3.5", "aria-hidden": true })
36
+ children: /* @__PURE__ */ jsx(HelpCircle, { size: iconSize, "aria-hidden": true })
58
37
  }
59
38
  ),
60
- /* @__PURE__ */ jsxs(PopoverContent, { side, className: "w-72 space-y-1.5", children: [
61
- title && /* @__PURE__ */ jsx("p", { className: "label-mono text-foreground text-[10px]", children: title }),
62
- /* @__PURE__ */ jsx("div", { className: "text-muted-foreground text-xs leading-relaxed", children })
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 = {