@brightlocal/ui-components 1.1.1 → 1.2.0

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.
Files changed (115) hide show
  1. package/AI_USAGE.md +390 -0
  2. package/README.md +45 -10
  3. package/component-meta.json +1488 -0
  4. package/dist/blocks/input-list.cjs +2 -0
  5. package/dist/blocks/input-list.d.ts +93 -0
  6. package/dist/blocks/input-list.d.ts.map +1 -0
  7. package/dist/blocks/input-list.js +215 -0
  8. package/dist/blocks/sidebar.d.ts.map +1 -1
  9. package/dist/breadcrumb.cjs +1 -1
  10. package/dist/breadcrumb.d.ts.map +1 -1
  11. package/dist/breadcrumb.js +17 -14
  12. package/dist/button.cjs +1 -1
  13. package/dist/button.d.ts.map +1 -1
  14. package/dist/button.js +9 -8
  15. package/dist/calendar.cjs +1 -1
  16. package/dist/calendar.js +1 -1
  17. package/dist/checkbox.cjs +1 -1
  18. package/dist/checkbox.d.ts.map +1 -1
  19. package/dist/checkbox.js +8 -10
  20. package/dist/combobox.cjs +1 -1
  21. package/dist/combobox.d.ts +12 -1
  22. package/dist/combobox.d.ts.map +1 -1
  23. package/dist/combobox.js +87 -79
  24. package/dist/command.cjs +1 -1
  25. package/dist/command.d.ts.map +1 -1
  26. package/dist/command.js +60 -50
  27. package/dist/date-picker.cjs +1 -1
  28. package/dist/date-picker.d.ts.map +1 -1
  29. package/dist/date-picker.js +66 -57
  30. package/dist/field.cjs +1 -1
  31. package/dist/field.d.ts.map +1 -1
  32. package/dist/field.js +2 -2
  33. package/dist/header.cjs +1 -1
  34. package/dist/header.d.ts +4 -0
  35. package/dist/header.d.ts.map +1 -1
  36. package/dist/header.js +33 -13
  37. package/dist/index.cjs +1 -1
  38. package/dist/index.d.ts +2 -0
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +281 -268
  41. package/dist/input-chip.cjs +1 -1
  42. package/dist/input-chip.js +2 -2
  43. package/dist/input-group.cjs +1 -1
  44. package/dist/input-group.js +17 -17
  45. package/dist/input-otp.cjs +1 -1
  46. package/dist/input-otp.d.ts.map +1 -1
  47. package/dist/input-otp.js +20 -20
  48. package/dist/input-password.cjs +1 -1
  49. package/dist/input-password.d.ts.map +1 -1
  50. package/dist/input-password.js +33 -25
  51. package/dist/input.cjs +1 -1
  52. package/dist/input.js +15 -15
  53. package/dist/label.d.ts.map +1 -1
  54. package/dist/link.cjs +1 -1
  55. package/dist/link.d.ts.map +1 -1
  56. package/dist/link.js +24 -25
  57. package/dist/list.cjs +1 -0
  58. package/dist/list.d.ts +104 -0
  59. package/dist/list.d.ts.map +1 -0
  60. package/dist/list.js +145 -0
  61. package/dist/navigation-menu.cjs +1 -1
  62. package/dist/navigation-menu.d.ts.map +1 -1
  63. package/dist/navigation-menu.js +6 -5
  64. package/dist/radio-group.cjs +1 -1
  65. package/dist/radio-group.js +20 -20
  66. package/dist/select.cjs +1 -1
  67. package/dist/select.js +1 -1
  68. package/dist/sheet.d.ts.map +1 -1
  69. package/dist/sonner.cjs +1 -1
  70. package/dist/sonner.d.ts +10 -4
  71. package/dist/sonner.d.ts.map +1 -1
  72. package/dist/sonner.js +48 -41
  73. package/dist/split-layout.cjs +1 -1
  74. package/dist/split-layout.d.ts +66 -15
  75. package/dist/split-layout.d.ts.map +1 -1
  76. package/dist/split-layout.js +100 -96
  77. package/dist/switch.cjs +1 -1
  78. package/dist/switch.d.ts.map +1 -1
  79. package/dist/switch.js +2 -2
  80. package/dist/textarea.cjs +1 -1
  81. package/dist/textarea.js +1 -1
  82. package/dist/tooltip.cjs +1 -1
  83. package/dist/tooltip.d.ts.map +1 -1
  84. package/dist/tooltip.js +40 -38
  85. package/package.json +5 -1
  86. package/src/blocks/input-list.tsx +366 -0
  87. package/src/blocks/sidebar.tsx +7 -7
  88. package/src/components/breadcrumb.tsx +4 -1
  89. package/src/components/button.tsx +1 -0
  90. package/src/components/calendar.tsx +1 -1
  91. package/src/components/checkbox.tsx +2 -4
  92. package/src/components/combobox.tsx +21 -2
  93. package/src/components/command.tsx +25 -9
  94. package/src/components/date-picker.tsx +15 -5
  95. package/src/components/dropdown-menu.tsx +3 -3
  96. package/src/components/field.tsx +5 -3
  97. package/src/components/header.tsx +28 -2
  98. package/src/components/input-chip.tsx +2 -2
  99. package/src/components/input-group.tsx +4 -4
  100. package/src/components/input-otp.tsx +7 -3
  101. package/src/components/input-password.tsx +8 -2
  102. package/src/components/input.tsx +1 -1
  103. package/src/components/label.tsx +1 -4
  104. package/src/components/link.tsx +3 -4
  105. package/src/components/list.tsx +290 -0
  106. package/src/components/navigation-menu.tsx +1 -0
  107. package/src/components/radio-group.tsx +2 -2
  108. package/src/components/select.tsx +3 -3
  109. package/src/components/sheet.tsx +2 -2
  110. package/src/components/sonner.tsx +30 -12
  111. package/src/components/split-layout.tsx +200 -79
  112. package/src/components/switch.tsx +6 -4
  113. package/src/components/textarea.tsx +1 -1
  114. package/src/components/tooltip.tsx +4 -2
  115. package/src/index.ts +2 -0
package/dist/sonner.d.ts CHANGED
@@ -36,6 +36,8 @@ export type SonnerColorSchema = "default" | "success";
36
36
  type SonnerCustomOptions = {
37
37
  className?: string;
38
38
  id?: string | number;
39
+ /** Duration in ms before the toast auto-dismisses. Set to `Infinity` to keep the toast visible until the user closes it or you call `sonner.dismiss(id)`. @default 4000 */
40
+ duration?: number;
39
41
  };
40
42
  /**
41
43
  * Input type for creating a toast. The `id` is optional as it will be generated if not provided.
@@ -43,7 +45,12 @@ type SonnerCustomOptions = {
43
45
  type ToastInput = Omit<ToastProps, "id"> & {
44
46
  id?: string | number;
45
47
  };
46
- declare function sonner(toast: ToastInput, options?: SonnerCustomOptions): void;
48
+ interface SonnerFn {
49
+ (toast: ToastInput, options?: SonnerCustomOptions): void;
50
+ /** Dismiss a toast by its `id`. */
51
+ dismiss: (id: string | number) => void;
52
+ }
53
+ declare const sonner: SonnerFn;
47
54
  /**
48
55
  * Sonner toaster component that must be mounted once in your application root.
49
56
  * This component manages the toast container and handles toast display, stacking, and animations.
@@ -130,7 +137,6 @@ declare namespace Sonner {
130
137
  * ```tsx
131
138
  * // 1. Mount the Sonner component in your app root
132
139
  * import { Sonner } from './sonner';
133
- * import { toast } from 'sonner';
134
140
  *
135
141
  * <Sonner />
136
142
  *
@@ -167,14 +173,14 @@ declare namespace Sonner {
167
173
  * // After operation completes, dismiss the loading toast and show success
168
174
  * try {
169
175
  * await uploadFile();
170
- * toast.dismiss(loadingToastId);
176
+ * sonner.dismiss(loadingToastId);
171
177
  * sonner({
172
178
  * title: "Upload complete!",
173
179
  * icon: "success",
174
180
  * colorSchema: "success"
175
181
  * });
176
182
  * } catch (error) {
177
- * toast.dismiss(loadingToastId);
183
+ * sonner.dismiss(loadingToastId);
178
184
  * sonner({
179
185
  * title: "Upload failed",
180
186
  * description: error.message,
@@ -1 +1 @@
1
- {"version":3,"file":"sonner.d.ts","sourceRoot":"","sources":["../../src/components/sonner.tsx"],"names":[],"mappings":"AAeA;;;;GAIG;AACH,KAAK,UAAU,GAAG;IAChB,2CAA2C;IAC3C,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2CAA2C;IAC3C,MAAM,CAAC,EAAE;QACP,wBAAwB;QACxB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,mCAAmC;QACnC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;QACrB,mCAAmC;QACnC,OAAO,CAAC,EACJ,SAAS,GACT,aAAa,GACb,SAAS,GACT,WAAW,GACX,OAAO,GACP,SAAS,CAAC;KACf,CAAC;IACF,gCAAgC;IAChC,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,mCAAmC;IACnC,IAAI,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAA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,MAAM,EAAE,MAAM,EAAE,CAAC"}
package/dist/sonner.js CHANGED
@@ -1,10 +1,10 @@
1
- import { jsx as o, jsxs as d } from "react/jsx-runtime";
2
- import { Loader2 as S, XCircle as p, AlertTriangle as b, CheckCircle2 as g, Info as v } from "@brightlocal/icons";
1
+ import { jsx as o, jsxs as u } from "react/jsx-runtime";
2
+ import { Loader2 as S, XCircle as p, AlertTriangle as g, CheckCircle2 as b, Info as v } from "@brightlocal/icons";
3
3
  import { cva as i } from "class-variance-authority";
4
- import { Toaster as N, toast as f } from "sonner";
5
- import { Button as x } from "@brightlocal/ui-components/button";
4
+ import { Toaster as x, toast as f } from "sonner";
5
+ import { Button as N } from "@brightlocal/ui-components/button";
6
6
  import { cn as a } from "@brightlocal/ui-components/lib/utils";
7
- const I = i(
7
+ const T = 4e3, I = i(
8
8
  [
9
9
  "flex",
10
10
  "items-center",
@@ -30,84 +30,91 @@ const I = i(
30
30
  colorSchema: "default"
31
31
  }
32
32
  }
33
- ), T = i("text-sm leading-normal font-medium", {
33
+ ), k = i("text-sm leading-normal font-medium", {
34
34
  variants: {
35
35
  colorSchema: {
36
36
  default: "text-foreground",
37
- success: "text-green-900"
37
+ success: "text-green-900 dark:text-green-100"
38
38
  }
39
39
  },
40
40
  defaultVariants: {
41
41
  colorSchema: "default"
42
42
  }
43
- }), C = i("text-sm leading-normal", {
43
+ }), A = i("text-sm leading-normal", {
44
44
  variants: {
45
45
  colorSchema: {
46
46
  default: "text-muted-foreground",
47
- success: "text-green-900"
47
+ success: "text-green-900 dark:text-green-100"
48
48
  }
49
49
  },
50
50
  defaultVariants: {
51
51
  colorSchema: "default"
52
52
  }
53
- }), n = i("", {
53
+ }), l = i("", {
54
54
  variants: {
55
55
  colorSchema: {
56
56
  default: "text-foreground",
57
- success: "text-green-900"
57
+ success: "text-green-900 dark:text-green-100"
58
58
  }
59
59
  },
60
60
  defaultVariants: {
61
61
  colorSchema: "default"
62
62
  }
63
63
  });
64
- function A(r, e) {
64
+ function C(r, e) {
65
65
  switch (r) {
66
66
  case "info":
67
- return /* @__PURE__ */ o(v, { className: a(n({ colorSchema: e })) });
67
+ return /* @__PURE__ */ o(v, { className: a(l({ colorSchema: e })) });
68
68
  case "success":
69
- return /* @__PURE__ */ o(g, { className: a(n({ colorSchema: e })) });
69
+ return /* @__PURE__ */ o(b, { className: a(l({ colorSchema: e })) });
70
70
  case "warning":
71
- return /* @__PURE__ */ o(b, { className: a(n({ colorSchema: e })) });
71
+ return /* @__PURE__ */ o(g, { className: a(l({ colorSchema: e })) });
72
72
  case "error":
73
- return /* @__PURE__ */ o(p, { className: a(n({ colorSchema: e })) });
73
+ return /* @__PURE__ */ o(p, { className: a(l({ colorSchema: e })) });
74
74
  case "loading":
75
75
  return /* @__PURE__ */ o(
76
76
  S,
77
77
  {
78
- className: a(n({ colorSchema: e }), "animate-spin")
78
+ className: a(l({ colorSchema: e }), "animate-spin")
79
79
  }
80
80
  );
81
81
  default:
82
82
  return null;
83
83
  }
84
84
  }
85
- function E(r, e) {
86
- const { id: c, ...t } = r, m = c != null ? { ...e, id: e?.id ?? c } : e;
87
- f.custom((l) => {
88
- const u = t.button && t.button.label ? {
85
+ const w = function(e, n) {
86
+ const { id: c, ...t } = e, d = {
87
+ ...n,
88
+ duration: n?.duration ?? T,
89
+ ...c != null && { id: n?.id ?? c }
90
+ };
91
+ f.custom((m) => {
92
+ const s = t.button && t.button.label ? {
89
93
  label: t.button.label,
90
94
  variant: t.button.variant,
91
95
  onClick: () => {
92
- t.button?.onClick && t.button.onClick(), f.dismiss(l);
96
+ t.button?.onClick && t.button.onClick(), f.dismiss(m);
93
97
  }
94
98
  } : void 0;
95
99
  return /* @__PURE__ */ o(
96
- k,
100
+ V,
97
101
  {
98
- button: u,
102
+ button: s,
99
103
  colorSchema: t.colorSchema,
100
104
  description: t.description,
101
105
  icon: t.icon ?? void 0,
102
- id: l,
106
+ id: m,
103
107
  title: t.title
104
108
  }
105
109
  );
106
- }, m);
107
- }
108
- function k(r) {
109
- const { button: e, description: c, icon: t, title: m, colorSchema: l } = r, s = ((h) => h === "success" ? "success" : "default")(l);
110
- return /* @__PURE__ */ d(
110
+ }, d);
111
+ };
112
+ w.dismiss = (r) => {
113
+ f.dismiss(r);
114
+ };
115
+ function V(r) {
116
+ const { button: e, description: n, icon: c, title: t, colorSchema: d } = r, s = ((h) => h === "success" ? "success" : "default")(d);
117
+ return /* @__PURE__ */ u(
111
118
  "div",
112
119
  {
113
120
  "aria-atomic": "true",
@@ -115,15 +122,15 @@ function k(r) {
115
122
  className: a(I({ colorSchema: s })),
116
123
  role: "status",
117
124
  children: [
118
- /* @__PURE__ */ d("div", { className: "flex flex-1 items-start gap-2", children: [
119
- t != null && A(t, s),
120
- /* @__PURE__ */ d("div", { className: "w-full", children: [
121
- /* @__PURE__ */ o("p", { className: a(T({ colorSchema: s })), children: m }),
122
- c && /* @__PURE__ */ o("p", { className: a(C({ colorSchema: s })), children: c })
125
+ /* @__PURE__ */ u("div", { className: "flex flex-1 items-start gap-2", children: [
126
+ c != null && C(c, s),
127
+ /* @__PURE__ */ u("div", { className: "w-full", children: [
128
+ /* @__PURE__ */ o("p", { className: a(k({ colorSchema: s })), children: t }),
129
+ n && /* @__PURE__ */ o("p", { className: a(A({ colorSchema: s })), children: n })
123
130
  ] })
124
131
  ] }),
125
132
  e?.label && /* @__PURE__ */ o(
126
- x,
133
+ N,
127
134
  {
128
135
  "aria-label": e.label,
129
136
  className: "min-h-6 px-2 py-0 text-xs leading-normal font-medium",
@@ -138,11 +145,11 @@ function k(r) {
138
145
  }
139
146
  );
140
147
  }
141
- function w() {
142
- return /* @__PURE__ */ o(N, { position: "top-right" });
148
+ function R() {
149
+ return /* @__PURE__ */ o(x, { position: "top-right" });
143
150
  }
144
- w.displayName = "Sonner";
151
+ R.displayName = "Sonner";
145
152
  export {
146
- w as Sonner,
147
- E as sonner
153
+ R as Sonner,
154
+ w as sonner
148
155
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),g=require("react"),x=require("class-variance-authority"),n=require("@brightlocal/ui-components/lib/utils");function j(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const l=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(e,a,l.get?l:{enumerable:!0,get:()=>t[a]})}}return e.default=t,Object.freeze(e)}const c=j(g),m=["flex","w-full","min-h-screen","flex-col","lg:flex-row"],r=x.cva(["flex","flex-1","items-center","overflow-auto","p-6"],{variants:{side:{left:["bg-background","justify-center","lg:justify-end","lg:pr-[46px]","xl:pr-[110px]"],right:["bg-card","hidden","lg:flex","justify-center","lg:justify-start","lg:pl-[46px]","xl:pl-[110px]"]}},defaultVariants:{side:"left"}}),u=c.forwardRef(({className:t,dataHook:e,trackingEl:a,trackingLabel:l,left:i,right:o,children:f,...p},y)=>s.jsxs("div",{ref:y,className:n.cn(m,t),"data-hook":e,"data-slot":"split-layout","data-tracking-el":a||"split-layout","data-tracking-label":l,...p,children:[i&&s.jsx("div",{className:r({side:"left"}),"data-slot":"split-layout-left",children:i}),o&&s.jsx("div",{className:r({side:"right"}),"data-slot":"split-layout-right",children:o}),f]}));u.displayName="SplitLayout";const d=c.forwardRef(({className:t,side:e="left",children:a,...l},i)=>s.jsx("div",{ref:i,className:n.cn(r({side:e}),t),"data-slot":`split-layout-${e}`,...l,children:a}));d.displayName="SplitLayoutSection";exports.SplitLayout=u;exports.SplitLayoutSection=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),N=require("react"),c=require("@brightlocal/ui-components/lib/utils");function R(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const l=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(a,e,l.get?l:{enumerable:!0,get:()=>t[e]})}}return a.default=t,Object.freeze(a)}const n=R(N),m=n.createContext(!1),j=n.forwardRef(({className:t,dataHook:a,trackingEl:e,trackingLabel:l,left:r,right:u,children:L,...C},S)=>{const d=[],f=[],p=[],g=o=>{if(n.isValidElement(o)){if(o.type===n.Fragment){n.Children.forEach(o.props.children,g);return}o.type===y?d.push(o):o.type===i?p.push(o):f.push(o)}};n.Children.forEach(L,g);const b=r!=null||u!=null,v=f.length>0||p.length>0,x=b&&!v,w=d.length>0;return s.jsxs("div",{ref:S,className:c.cn("flex min-h-screen w-full flex-col lg:flex-row",t),"data-hook":a,"data-slot":"split-layout","data-tracking-el":e||"split-layout","data-tracking-label":l,...C,children:[s.jsx("div",{className:"bg-background flex flex-1 flex-col","data-slot":"split-layout-body",children:s.jsxs(m.Provider,{value:w,children:[d,x?r&&s.jsx(h,{children:r}):f]})}),x?u&&s.jsx(i,{children:u}):p]})});j.displayName="SplitLayout";const y=n.forwardRef(({className:t,children:a,...e},l)=>s.jsx("div",{ref:l,className:c.cn("px-section pt-section flex w-full items-center justify-center lg:justify-start",t),"data-slot":"split-layout-header",...e,children:a}));y.displayName="SplitLayoutHeader";const h=n.forwardRef(({className:t,children:a,...e},l)=>{const r=n.useContext(m);return s.jsx("div",{ref:l,className:c.cn("p-section flex flex-1 items-center justify-center overflow-auto",r&&"pt-2",t),"data-slot":"split-layout-left",...e,children:a})});h.displayName="SplitLayoutContentLeft";const i=n.forwardRef(({className:t,children:a,...e},l)=>s.jsx("div",{ref:l,className:c.cn("bg-card p-section hidden flex-1 items-center justify-center overflow-auto lg:flex",t),"data-slot":"split-layout-right",...e,children:a}));i.displayName="SplitLayoutContentRight";exports.SplitLayout=j;exports.SplitLayoutContentLeft=h;exports.SplitLayoutContentRight=i;exports.SplitLayoutHeader=y;
@@ -6,40 +6,91 @@ interface SplitLayoutProps extends React.ComponentProps<"div"> {
6
6
  trackingEl?: string;
7
7
  /** Tracking label for analytics context */
8
8
  trackingLabel?: string;
9
- /** Content for the left/first section */
9
+ /**
10
+ * Content for the left/primary section.
11
+ * @deprecated Use `<SplitLayoutContentLeft>` composition instead.
12
+ */
10
13
  left?: React.ReactNode;
11
- /** Content for the right/second section */
14
+ /**
15
+ * Content for the right/secondary section.
16
+ * @deprecated Use `<SplitLayoutContentRight>` composition instead.
17
+ */
12
18
  right?: React.ReactNode;
13
19
  }
14
20
  /**
15
- * SplitLayout component for creating responsive two-column layouts
21
+ * SplitLayout component for creating responsive two-column layouts.
16
22
  *
17
23
  * Displays content in two sections side-by-side on large screens (≥1024px),
18
24
  * and shows only the left section on smaller screens (hiding the right/marketing section).
19
25
  * This pattern is commonly used for authentication pages where the form is prioritized on mobile.
20
26
  *
27
+ * Uses a composition pattern with SplitLayoutHeader, SplitLayoutContentLeft,
28
+ * and SplitLayoutContentRight sub-components.
29
+ *
30
+ * @example
31
+ * // Basic usage
32
+ * <SplitLayout dataHook="login-layout">
33
+ * <SplitLayoutContentLeft>
34
+ * <LoginForm />
35
+ * </SplitLayoutContentLeft>
36
+ * <SplitLayoutContentRight>
37
+ * <MarketingContent />
38
+ * </SplitLayoutContentRight>
39
+ * </SplitLayout>
40
+ *
41
+ * @example
42
+ * // With Header
43
+ * <SplitLayout dataHook="login-layout">
44
+ * <SplitLayoutHeader>
45
+ * <Header dataHook="my-header"><Logo dataHook="my-logo" /></Header>
46
+ * </SplitLayoutHeader>
47
+ * <SplitLayoutContentLeft>
48
+ * <LoginForm />
49
+ * </SplitLayoutContentLeft>
50
+ * <SplitLayoutContentRight>
51
+ * <MarketingContent />
52
+ * </SplitLayoutContentRight>
53
+ * </SplitLayout>
54
+ *
21
55
  * Layout specifications:
22
56
  * - Mobile/Tablet: Stacked layout, only left section visible, content centered
23
- * - LG (≥1024px): Side-by-side with 46px spacing on each side (92px total gap)
24
- * - XL (≥1280px) and bigger: Side-by-side with 110px spacing on each side (220px total gap max)
25
- * - Left section: Content aligned to right edge with responsive padding
26
- * - Right section: Content aligned to left edge with responsive padding
57
+ * - Desktop (≥1024px): Side-by-side, content centered within each section
58
+ * - Section padding uses responsive section tokens (16px mobile, 24px desktop)
27
59
  * - Background colors extend full-width of viewport
28
60
  * - Content within each section can be independently sized (e.g., using Card components)
29
61
  */
30
62
  declare const SplitLayout: React.ForwardRefExoticComponent<Omit<SplitLayoutProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
31
- interface SplitLayoutSectionProps extends React.ComponentProps<"div"> {
63
+ interface SplitLayoutHeaderProps extends React.ComponentProps<"div"> {
32
64
  /**
33
- * Which side this section appears on: "left" | "right"
34
- * @default "left"
65
+ * Header content (e.g., Header component with Logo)
35
66
  */
36
- side?: "left" | "right";
67
+ children: React.ReactNode;
68
+ }
69
+ /**
70
+ * SplitLayoutHeader component for rendering header content at the top of SplitLayout.
71
+ * Content is centered on mobile/tablet, left-aligned from lg breakpoint onwards.
72
+ * Uses section padding tokens for responsive horizontal and vertical padding (16px mobile, 24px desktop).
73
+ */
74
+ declare const SplitLayoutHeader: React.ForwardRefExoticComponent<Omit<SplitLayoutHeaderProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
75
+ interface SplitLayoutContentLeftProps extends React.ComponentProps<"div"> {
76
+ children: React.ReactNode;
77
+ }
78
+ /**
79
+ * SplitLayoutContentLeft - Left/primary section within a SplitLayout.
80
+ *
81
+ * Always visible. When a SplitLayoutHeader is present, top padding is
82
+ * automatically reduced to avoid excessive spacing below the header.
83
+ */
84
+ declare const SplitLayoutContentLeft: React.ForwardRefExoticComponent<Omit<SplitLayoutContentLeftProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
85
+ interface SplitLayoutContentRightProps extends React.ComponentProps<"div"> {
86
+ children: React.ReactNode;
37
87
  }
38
88
  /**
39
- * SplitLayoutSection - Individual section within a SplitLayout
89
+ * SplitLayoutContentRight - Right/secondary section within a SplitLayout.
40
90
  *
41
- * Use this for more granular control over layout sections
91
+ * Hidden on mobile/tablet (<1024px), visible on desktop (≥1024px).
92
+ * Uses bg-card background color.
42
93
  */
43
- declare const SplitLayoutSection: React.ForwardRefExoticComponent<Omit<SplitLayoutSectionProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
44
- export { SplitLayout, SplitLayoutSection, type SplitLayoutProps, type SplitLayoutSectionProps, };
94
+ declare const SplitLayoutContentRight: React.ForwardRefExoticComponent<Omit<SplitLayoutContentRightProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
95
+ export { SplitLayout, SplitLayoutHeader, SplitLayoutContentLeft, SplitLayoutContentRight, type SplitLayoutProps, type SplitLayoutHeaderProps, type SplitLayoutContentLeftProps, type SplitLayoutContentRightProps, };
45
96
  //# sourceMappingURL=split-layout.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"split-layout.d.ts","sourceRoot":"","sources":["../../src/components/split-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA4C/B,UAAU,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IAC5D,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yCAAyC;IACzC,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACzB;AAED;;;;;;;;;;;;;;;GAeG;AACH,QAAA,MAAM,WAAW,sGA4ChB,CAAC;AAIF,UAAU,uBAAwB,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IACnE;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACzB;AAED;;;;GAIG;AACH,QAAA,MAAM,kBAAkB,6GActB,CAAC;AAIH,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,GAC7B,CAAC"}
1
+ {"version":3,"file":"split-layout.d.ts","sourceRoot":"","sources":["../../src/components/split-layout.ts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jsx-runtime";
2
- import * as d from "react";
3
- import { cva as y } from "class-variance-authority";
4
- import { cn as n } from "@brightlocal/ui-components/lib/utils";
5
- const m = [
6
- "flex",
7
- "w-full",
8
- "min-h-screen",
9
- // Responsive behavior: stack on small screens, side-by-side on large
10
- "flex-col",
11
- "lg:flex-row"
12
- ], o = y(
13
- ["flex", "flex-1", "items-center", "overflow-auto", "p-6"],
14
- {
15
- variants: {
16
- side: {
17
- left: [
18
- "bg-background",
19
- // base/background token
20
- "justify-center",
21
- // Center on mobile
22
- "lg:justify-end",
23
- // Align to right on large screens
24
- "lg:pr-[46px]",
25
- // 46px spacing from right edge on LG
26
- "xl:pr-[110px]"
27
- // 110px spacing from right edge on XL and bigger
28
- ],
29
- right: [
30
- "bg-card",
31
- // base/card token (handles both light and dark modes)
32
- "hidden",
33
- // Hidden on mobile (MD and SM breakpoints)
34
- "lg:flex",
35
- // Visible on large screens (LG and XL breakpoints)
36
- "justify-center",
37
- // Center on mobile
38
- "lg:justify-start",
39
- // Align to left on large screens
40
- "lg:pl-[46px]",
41
- // 46px spacing from left edge on LG
42
- "xl:pl-[110px]"
43
- // 110px spacing from left edge on XL and bigger
1
+ import { jsxs as m, jsx as n } from "react/jsx-runtime";
2
+ import * as t from "react";
3
+ import { cn as i } from "@brightlocal/ui-components/lib/utils";
4
+ const x = t.createContext(!1), j = t.forwardRef(
5
+ ({
6
+ className: a,
7
+ dataHook: l,
8
+ trackingEl: o,
9
+ trackingLabel: s,
10
+ left: r,
11
+ right: c,
12
+ children: L,
13
+ ...v
14
+ }, w) => {
15
+ const d = [], f = [], p = [], y = (e) => {
16
+ if (t.isValidElement(e)) {
17
+ if (e.type === t.Fragment) {
18
+ t.Children.forEach(
19
+ e.props.children,
20
+ y
21
+ );
22
+ return;
23
+ }
24
+ e.type === g ? d.push(e) : e.type === u ? p.push(e) : f.push(e);
25
+ }
26
+ };
27
+ t.Children.forEach(L, y);
28
+ const N = r != null || c != null, S = f.length > 0 || p.length > 0, h = N && !S, R = d.length > 0;
29
+ return /* @__PURE__ */ m(
30
+ "div",
31
+ {
32
+ ref: w,
33
+ className: i(
34
+ "flex min-h-screen w-full flex-col lg:flex-row",
35
+ a
36
+ ),
37
+ "data-hook": l,
38
+ "data-slot": "split-layout",
39
+ "data-tracking-el": o || "split-layout",
40
+ "data-tracking-label": s,
41
+ ...v,
42
+ children: [
43
+ /* @__PURE__ */ n(
44
+ "div",
45
+ {
46
+ className: "bg-background flex flex-1 flex-col",
47
+ "data-slot": "split-layout-body",
48
+ children: /* @__PURE__ */ m(x.Provider, { value: R, children: [
49
+ d,
50
+ h ? r && /* @__PURE__ */ n(C, { children: r }) : f
51
+ ] })
52
+ }
53
+ ),
54
+ h ? c && /* @__PURE__ */ n(u, { children: c }) : p
44
55
  ]
45
56
  }
46
- },
47
- defaultVariants: {
48
- side: "left"
49
- }
57
+ );
50
58
  }
51
- ), x = d.forwardRef(
52
- ({
53
- className: l,
54
- dataHook: t,
55
- trackingEl: e,
56
- trackingLabel: i,
57
- left: a,
58
- right: r,
59
- children: p,
60
- ...c
61
- }, f) => /* @__PURE__ */ u(
59
+ );
60
+ j.displayName = "SplitLayout";
61
+ const g = t.forwardRef(({ className: a, children: l, ...o }, s) => /* @__PURE__ */ n(
62
+ "div",
63
+ {
64
+ ref: s,
65
+ className: i(
66
+ "px-section pt-section flex w-full items-center justify-center lg:justify-start",
67
+ a
68
+ ),
69
+ "data-slot": "split-layout-header",
70
+ ...o,
71
+ children: l
72
+ }
73
+ ));
74
+ g.displayName = "SplitLayoutHeader";
75
+ const C = t.forwardRef(({ className: a, children: l, ...o }, s) => {
76
+ const r = t.useContext(x);
77
+ return /* @__PURE__ */ n(
62
78
  "div",
63
79
  {
64
- ref: f,
65
- className: n(m, l),
66
- "data-hook": t,
67
- "data-slot": "split-layout",
68
- "data-tracking-el": e || "split-layout",
69
- "data-tracking-label": i,
70
- ...c,
71
- children: [
72
- a && /* @__PURE__ */ s(
73
- "div",
74
- {
75
- className: o({ side: "left" }),
76
- "data-slot": "split-layout-left",
77
- children: a
78
- }
79
- ),
80
- r && /* @__PURE__ */ s(
81
- "div",
82
- {
83
- className: o({ side: "right" }),
84
- "data-slot": "split-layout-right",
85
- children: r
86
- }
87
- ),
88
- p
89
- ]
80
+ ref: s,
81
+ className: i(
82
+ "p-section flex flex-1 items-center justify-center overflow-auto",
83
+ r && "pt-2",
84
+ a
85
+ ),
86
+ "data-slot": "split-layout-left",
87
+ ...o,
88
+ children: l
90
89
  }
91
- )
92
- );
93
- x.displayName = "SplitLayout";
94
- const g = d.forwardRef(({ className: l, side: t = "left", children: e, ...i }, a) => /* @__PURE__ */ s(
90
+ );
91
+ });
92
+ C.displayName = "SplitLayoutContentLeft";
93
+ const u = t.forwardRef(({ className: a, children: l, ...o }, s) => /* @__PURE__ */ n(
95
94
  "div",
96
95
  {
97
- ref: a,
98
- className: n(o({ side: t }), l),
99
- "data-slot": `split-layout-${t}`,
100
- ...i,
101
- children: e
96
+ ref: s,
97
+ className: i(
98
+ "bg-card p-section hidden flex-1 items-center justify-center overflow-auto lg:flex",
99
+ a
100
+ ),
101
+ "data-slot": "split-layout-right",
102
+ ...o,
103
+ children: l
102
104
  }
103
105
  ));
104
- g.displayName = "SplitLayoutSection";
106
+ u.displayName = "SplitLayoutContentRight";
105
107
  export {
106
- x as SplitLayout,
107
- g as SplitLayoutSection
108
+ j as SplitLayout,
109
+ C as SplitLayoutContentLeft,
110
+ u as SplitLayoutContentRight,
111
+ g as SplitLayoutHeader
108
112
  };
package/dist/switch.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),u=require("react"),b=require("@radix-ui/react-switch"),o=require("@brightlocal/ui-components/lib/utils");function i(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const h=i(u),c=i(b),s=h.forwardRef(({className:e,dataHook:a,trackingEl:t,trackingLabel:r,...d},l)=>n.jsx(c.Root,{ref:l,className:o.cn("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring dark:focus-visible:border-neutral-500 dark:data-[state=unchecked]:bg-input/80","inline-flex h-5 w-9 shrink-0 items-center rounded-full border-1 border-transparent shadow-xs transition-[background-color,border-color,box-shadow] outline-none focus-visible:shadow-default","disabled:cursor-not-allowed disabled:opacity-50","pl-[1px]",e),"data-hook":a,"data-slot":"switch","data-tracking-el":t||"switch","data-tracking-label":r,...d,children:n.jsx(c.Thumb,{className:o.cn("bg-background","pointer-events-none block size-4 rounded-full ring-0 transition-transform","data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"),"data-slot":"switch-thumb"})}));s.displayName="Switch";exports.Switch=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),u=require("react"),b=require("@radix-ui/react-switch"),o=require("@brightlocal/ui-components/lib/utils");function i(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const h=i(u),c=i(b),s=h.forwardRef(({className:e,dataHook:a,trackingEl:t,trackingLabel:r,...d},l)=>n.jsx(c.Root,{ref:l,className:o.cn("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring dark:data-[state=unchecked]:bg-input/80 dark:focus-visible:border-neutral-500","focus-visible:shadow-default inline-flex h-5 w-9 shrink-0 items-center rounded-full border-1 border-transparent shadow-xs transition-[background-color,border-color,box-shadow] outline-none","disabled:cursor-not-allowed disabled:opacity-50","pl-[1px]",e),"data-hook":a,"data-slot":"switch","data-tracking-el":t||"switch","data-tracking-label":r,...d,children:n.jsx(c.Thumb,{className:o.cn("bg-background","pointer-events-none block size-4 rounded-full ring-0 transition-transform","data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"),"data-slot":"switch-thumb"})}));s.displayName="Switch";exports.Switch=s;
@@ -1 +1 @@
1
- {"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../src/components/switch.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAI1D,UAAU,WACR,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAC1E,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,QAAA,MAAM,MAAM,oGA8BV,CAAC;AAIH,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../src/components/switch.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAI1D,UAAU,WAAY,SAAQ,IAAI,CAChC,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,EACjD,SAAS,CACV;IACC,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,QAAA,MAAM,MAAM,oGA8BV,CAAC;AAIH,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,CAAC"}
package/dist/switch.js CHANGED
@@ -7,8 +7,8 @@ const l = c.forwardRef(({ className: r, dataHook: o, trackingEl: i, trackingLabe
7
7
  {
8
8
  ref: n,
9
9
  className: e(
10
- "peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring dark:focus-visible:border-neutral-500 dark:data-[state=unchecked]:bg-input/80",
11
- "inline-flex h-5 w-9 shrink-0 items-center rounded-full border-1 border-transparent shadow-xs transition-[background-color,border-color,box-shadow] outline-none focus-visible:shadow-default",
10
+ "peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring dark:data-[state=unchecked]:bg-input/80 dark:focus-visible:border-neutral-500",
11
+ "focus-visible:shadow-default inline-flex h-5 w-9 shrink-0 items-center rounded-full border-1 border-transparent shadow-xs transition-[background-color,border-color,box-shadow] outline-none",
12
12
  "disabled:cursor-not-allowed disabled:opacity-50",
13
13
  "pl-[1px]",
14
14
  r
package/dist/textarea.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),u=require("react"),l=require("class-variance-authority"),b=require("@brightlocal/ui-components/lib/utils");function f(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const g=f(u),v=l.cva(["flex w-full","border border-input bg-background rounded-md","outline-none transition-[border-color,background-color,box-shadow]","text-sm leading-normal font-sans","text-foreground","px-3 py-2","focus-visible:outline-none focus-visible:border-ring focus-visible:bg-background","focus-visible:shadow-default","disabled:cursor-not-allowed disabled:opacity-50","placeholder:text-muted-foreground"]),n=g.forwardRef(({className:e,dataHook:r,error:t,trackingEl:a,trackingLabel:s,...o},c)=>{const i=t||o["aria-invalid"]===!0||o["aria-invalid"]==="true";return d.jsx("textarea",{ref:c,"aria-invalid":i?"true":void 0,className:b.cn(v(),i&&"border-destructive dark:border-destructive focus-visible:border-destructive focus-visible:shadow-destructive",e),"data-hook":r,"data-slot":"textarea","data-tracking-el":a,"data-tracking-label":s,...o})});n.displayName="Textarea";exports.Textarea=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),u=require("react"),l=require("class-variance-authority"),b=require("@brightlocal/ui-components/lib/utils");function f(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const g=f(u),v=l.cva(["flex w-full","border border-input bg-background rounded-md","outline-none transition-[border-color,background-color,box-shadow]","text-sm leading-normal font-sans","text-foreground","px-3 py-2","focus-visible:outline-none focus-visible:border-ring focus-visible:bg-background","focus-visible:shadow-default","disabled:cursor-not-allowed disabled:opacity-50","placeholder:text-muted-foreground"]),n=g.forwardRef(({className:e,dataHook:r,error:t,trackingEl:a,trackingLabel:s,...o},c)=>{const i=t||o["aria-invalid"]===!0||o["aria-invalid"]==="true";return d.jsx("textarea",{ref:c,"aria-invalid":i?"true":void 0,className:b.cn(v(),i&&"border-destructive-40 focus-visible:border-destructive-40 focus-visible:shadow-destructive",e),"data-hook":r,"data-slot":"textarea","data-tracking-el":a,"data-tracking-label":s,...o})});n.displayName="Textarea";exports.Textarea=n;
package/dist/textarea.js CHANGED
@@ -30,7 +30,7 @@ const b = c([
30
30
  "aria-invalid": e ? "true" : void 0,
31
31
  className: u(
32
32
  b(),
33
- e && "border-destructive dark:border-destructive focus-visible:border-destructive focus-visible:shadow-destructive",
33
+ e && "border-destructive-40 focus-visible:border-destructive-40 focus-visible:shadow-destructive",
34
34
  a
35
35
  ),
36
36
  "data-hook": o,
package/dist/tooltip.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),T=require("react"),m=require("@radix-ui/react-tooltip"),j=require("@brightlocal/ui-components/lib/utils");function a(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(e,o,n.get?n:{enumerable:!0,get:()=>t[o]})}}return e.default=t,Object.freeze(e)}const l=a(T),i=a(m);function x({delayDuration:t=0,skipDelayDuration:e=0,...o}){return r.jsx(i.Provider,{"data-slot":"tooltip-provider",delayDuration:t,skipDelayDuration:e,...o})}function y({...t}){return r.jsx(i.Root,{"data-slot":"tooltip",...t})}const s=l.forwardRef(({...t},e)=>r.jsx(i.Trigger,{ref:e,"data-slot":"tooltip-trigger",...t}));s.displayName="TooltipTrigger";const c=l.forwardRef(({className:t,sideOffset:e=0,dataHook:o,trackingEl:n,trackingLabel:d,hideArrow:p=!1,children:u,...g},f)=>r.jsx(i.Portal,{children:r.jsxs(i.Content,{ref:f,className:j.cn("bg-secondary text-secondary-foreground z-50 rounded-md px-3 py-1.5 text-xs leading-4 font-normal",t),"data-hook":o,"data-slot":"tooltip-content","data-tracking-el":n,"data-tracking-label":d,sideOffset:e,...g,children:[u,!p&&r.jsx(i.Arrow,{className:"fill-secondary",height:5.5,width:10})]})}));c.displayName="TooltipContent";exports.Tooltip=y;exports.TooltipContent=c;exports.TooltipProvider=x;exports.TooltipTrigger=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),T=require("react"),x=require("@radix-ui/react-tooltip"),m=require("@brightlocal/ui-components/lib/utils");function l(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(o,e,i.get?i:{enumerable:!0,get:()=>t[e]})}}return o.default=t,Object.freeze(o)}const n=l(T),a=l(x);function y({delayDuration:t=0,skipDelayDuration:o=0,...e}){return r.jsx(a.Provider,{"data-slot":"tooltip-provider",delayDuration:t,skipDelayDuration:o,...e})}function j({...t}){return r.jsx(a.Root,{"data-slot":"tooltip",...t})}const s=n.forwardRef(({...t},o)=>r.jsx(a.Trigger,{ref:o,"data-slot":"tooltip-trigger",...t}));s.displayName="TooltipTrigger";const d=n.forwardRef(({className:t,sideOffset:o=0,dataHook:e,trackingEl:i,trackingLabel:p,hideArrow:c=!1,children:u,...g},f)=>r.jsx(a.Portal,{children:r.jsxs(a.Content,{ref:f,className:m.cn("bg-secondary text-secondary-foreground z-50 rounded-md px-3 py-1.5 text-xs leading-4 font-normal","data-[side=bottom]:[&_[data-slot=tooltip-arrow]]:translate-y-px data-[side=left]:[&_[data-slot=tooltip-arrow]]:-translate-x-px data-[side=right]:[&_[data-slot=tooltip-arrow]]:translate-x-px data-[side=top]:[&_[data-slot=tooltip-arrow]]:-translate-y-px",t),"data-hook":e,"data-slot":"tooltip-content","data-tracking-el":i,"data-tracking-label":p,sideOffset:o,...g,children:[u,!c&&r.jsx(a.Arrow,{className:"fill-secondary","data-slot":"tooltip-arrow",height:7,width:14})]})}));d.displayName="TooltipContent";exports.Tooltip=j;exports.TooltipContent=d;exports.TooltipProvider=y;exports.TooltipTrigger=s;