@orangecheck/design 0.7.4 → 0.7.5

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,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ var Popover = require('@radix-ui/react-popover');
3
4
  var lucideReact = require('lucide-react');
4
- var PopoverPrimitive = require('@radix-ui/react-popover');
5
5
  var clsx = require('clsx');
6
6
  var tailwindMerge = require('tailwind-merge');
7
7
  var jsxRuntime = require('react/jsx-runtime');
@@ -30,62 +30,54 @@ function _interopNamespace(e) {
30
30
  return Object.freeze(n);
31
31
  }
32
32
 
33
- var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitive);
33
+ var Popover__namespace = /*#__PURE__*/_interopNamespace(Popover);
34
34
  var Link6__default = /*#__PURE__*/_interopDefault(Link6);
35
35
 
36
36
  // src/composites/help-hint.tsx
37
37
  function cn(...inputs) {
38
38
  return tailwindMerge.twMerge(clsx.clsx(inputs));
39
39
  }
40
- function Popover({ ...props }) {
41
- return /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Root, { "data-slot": "popover", ...props });
42
- }
43
- function PopoverTrigger({ ...props }) {
44
- return /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Trigger, { "data-slot": "popover-trigger", ...props });
45
- }
46
- function PopoverContent({
47
- className,
48
- align = "center",
49
- sideOffset = 4,
50
- ...props
51
- }) {
52
- return /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
53
- PopoverPrimitive__namespace.Content,
54
- {
55
- "data-slot": "popover-content",
56
- align,
57
- sideOffset,
58
- className: cn(
59
- "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",
60
- className
61
- ),
62
- ...props
63
- }
64
- ) });
65
- }
66
40
  function HelpHint({
67
- title,
68
41
  children,
69
- side = "bottom",
70
- label = "more information",
42
+ title,
43
+ side = "top",
44
+ size = "sm",
45
+ tone = "default",
46
+ label = "what is this?",
71
47
  className
72
48
  }) {
73
- return /* @__PURE__ */ jsxRuntime.jsxs(Popover, { children: [
49
+ const iconSize = size === "xs" ? 12 : 14;
50
+ return /* @__PURE__ */ jsxRuntime.jsxs(Popover__namespace.Root, { children: [
74
51
  /* @__PURE__ */ jsxRuntime.jsx(
75
- PopoverTrigger,
52
+ Popover__namespace.Trigger,
76
53
  {
77
54
  "aria-label": label,
55
+ onClick: (e) => e.stopPropagation(),
78
56
  className: cn(
79
- "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",
57
+ "focus-visible:ring-primary/60 inline-flex shrink-0 items-center justify-center rounded-full transition-colors outline-none focus-visible:ring-2",
58
+ tone === "subtle" ? "text-muted-foreground/60 hover:text-foreground/80" : "text-primary/70 hover:text-primary",
80
59
  className
81
60
  ),
82
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.HelpCircle, { className: "size-3.5", "aria-hidden": true })
61
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.HelpCircle, { size: iconSize, "aria-hidden": true })
83
62
  }
84
63
  ),
85
- /* @__PURE__ */ jsxRuntime.jsxs(PopoverContent, { side, className: "w-72 space-y-1.5", children: [
86
- title && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "label-mono text-foreground text-[10px]", children: title }),
87
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-muted-foreground text-xs leading-relaxed", children })
88
- ] })
64
+ /* @__PURE__ */ jsxRuntime.jsx(Popover__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
65
+ Popover__namespace.Content,
66
+ {
67
+ side,
68
+ sideOffset: 6,
69
+ collisionPadding: 12,
70
+ 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",
71
+ children: [
72
+ title && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "label-mono text-primary mb-1.5", children: [
73
+ "\xA7 ",
74
+ title
75
+ ] }),
76
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-foreground/90", children }),
77
+ /* @__PURE__ */ jsxRuntime.jsx(Popover__namespace.Arrow, { className: "fill-popover" })
78
+ ]
79
+ }
80
+ ) })
89
81
  ] });
90
82
  }
91
83
  var TONE_CLASS = {