@brightlocal/ui-components 2.6.1 → 2.8.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.
@@ -158,6 +158,13 @@ SplitLayoutHeader.displayName = "SplitLayoutHeader";
158
158
 
159
159
  interface SplitLayoutContentLeftProps extends React.ComponentProps<"div"> {
160
160
  children: React.ReactNode;
161
+ /**
162
+ * Pins the column to the viewport on desktop (≥lg) so it stays visible
163
+ * while the sibling column grows beyond one screen.
164
+ * Applies `sticky top-0 h-screen self-start`.
165
+ * @default false
166
+ */
167
+ sticky?: boolean;
161
168
  }
162
169
 
163
170
  /**
@@ -170,13 +177,14 @@ interface SplitLayoutContentLeftProps extends React.ComponentProps<"div"> {
170
177
  const SplitLayoutContentLeft = React.forwardRef<
171
178
  HTMLDivElement,
172
179
  SplitLayoutContentLeftProps
173
- >(({ className, children, ...props }, ref) => {
180
+ >(({ className, sticky = false, children, ...props }, ref) => {
174
181
  return (
175
182
  <div
176
183
  ref={ref}
177
184
  className={cn(
178
185
  "p-section-sm col-start-1 row-start-2 flex min-h-0 items-center justify-center overflow-auto",
179
186
  "group-has-[[data-slot=split-layout-header]]/split-layout:pt-2",
187
+ sticky && "lg:sticky lg:top-0 lg:h-screen lg:self-start",
180
188
  className
181
189
  )}
182
190
  data-slot="split-layout-left"
@@ -201,6 +209,14 @@ interface SplitLayoutContentRightProps extends React.ComponentProps<"div"> {
201
209
  * @default false
202
210
  */
203
211
  flush?: boolean;
212
+ /**
213
+ * Pins the column to the viewport on desktop (≥lg) so it stays visible
214
+ * while the sibling column grows beyond one screen.
215
+ * Applies `sticky top-0 h-screen self-start`.
216
+ * Can be combined with `flush` for a sticky full-bleed panel.
217
+ * @default false
218
+ */
219
+ sticky?: boolean;
204
220
  }
205
221
 
206
222
  /**
@@ -215,7 +231,7 @@ interface SplitLayoutContentRightProps extends React.ComponentProps<"div"> {
215
231
  const SplitLayoutContentRight = React.forwardRef<
216
232
  HTMLDivElement,
217
233
  SplitLayoutContentRightProps
218
- >(({ className, flush = false, children, ...props }, ref) => {
234
+ >(({ className, flush = false, sticky = false, children, ...props }, ref) => {
219
235
  return (
220
236
  <div
221
237
  ref={ref}
@@ -224,6 +240,7 @@ const SplitLayoutContentRight = React.forwardRef<
224
240
  flush
225
241
  ? "relative overflow-hidden lg:block"
226
242
  : "p-section-sm min-h-0 items-center justify-center overflow-auto lg:flex",
243
+ sticky && "lg:sticky lg:top-0 lg:h-screen lg:self-start",
227
244
  className
228
245
  )}
229
246
  data-slot="split-layout-right"
@@ -294,7 +294,7 @@ const TableCaption = React.forwardRef<
294
294
  >(({ className, dataHook, ...props }, ref) => (
295
295
  <caption
296
296
  ref={ref}
297
- className={cn("text-muted-foreground mt-4 text-center text-sm", className)}
297
+ className={cn("caption-bottom py-4", className)}
298
298
  data-hook={dataHook}
299
299
  data-slot="table-caption"
300
300
  {...props}