@classic-homes/theme-react 0.1.57 → 0.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.
- package/dist/index.d.mts +32 -6
- package/dist/index.d.ts +32 -6
- package/dist/index.js +51 -44
- package/dist/index.mjs +55 -44
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -194,22 +194,25 @@ declare const DialogDescription: React$1.ForwardRefExoticComponent<Omit<React$1.
|
|
|
194
194
|
* Supports multiple layout variants and optional action buttons.
|
|
195
195
|
*
|
|
196
196
|
* Features:
|
|
197
|
-
* - Multiple variants: default, hero, centered
|
|
197
|
+
* - Multiple variants: default, hero, centered, form
|
|
198
198
|
* - Optional subtitle with branded styling
|
|
199
199
|
* - Optional actions slot for CTA buttons
|
|
200
|
-
* - Consistent typography using design tokens
|
|
200
|
+
* - Consistent typography using design tokens: `default` and `centered`
|
|
201
|
+
* inherit the theme heading styles for the rendered level (h1 = Spectral
|
|
202
|
+
* 500 italic, h2-h6 = Figtree 600); `hero` and `form` are display styles
|
|
203
|
+
* that opt out of them.
|
|
201
204
|
*/
|
|
202
205
|
declare const pageHeaderContainerVariants: (props?: ({
|
|
203
|
-
variant?: "default" | "hero" | "centered" | null | undefined;
|
|
206
|
+
variant?: "default" | "form" | "hero" | "centered" | null | undefined;
|
|
204
207
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
205
208
|
declare const pageHeaderTitleVariants: (props?: ({
|
|
206
|
-
variant?: "default" | "hero" | "centered" | null | undefined;
|
|
209
|
+
variant?: "default" | "form" | "hero" | "centered" | null | undefined;
|
|
207
210
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
208
211
|
declare const pageHeaderSubtitleVariants: (props?: ({
|
|
209
|
-
variant?: "default" | "hero" | "centered" | null | undefined;
|
|
212
|
+
variant?: "default" | "form" | "hero" | "centered" | null | undefined;
|
|
210
213
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
211
214
|
declare const pageHeaderActionsVariants: (props?: ({
|
|
212
|
-
variant?: "default" | "hero" | "centered" | null | undefined;
|
|
215
|
+
variant?: "default" | "form" | "hero" | "centered" | null | undefined;
|
|
213
216
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
214
217
|
interface PageHeaderProps extends React$1.HTMLAttributes<HTMLElement>, VariantProps<typeof pageHeaderContainerVariants> {
|
|
215
218
|
/** Main title text */
|
|
@@ -261,6 +264,17 @@ interface DataPanelProps {
|
|
|
261
264
|
actions?: DataPanelAction[];
|
|
262
265
|
/** Size constraints */
|
|
263
266
|
constraints?: PanelConstraints;
|
|
267
|
+
/**
|
|
268
|
+
* Length (px) of the collapsed tab along its edge. Fixed rather than
|
|
269
|
+
* content-sized; raise it for longer titles. Defaults to 220.
|
|
270
|
+
*/
|
|
271
|
+
tabWidth?: number;
|
|
272
|
+
/**
|
|
273
|
+
* Distance (px) of the collapsed tab from its pinned edge. Use it to clear
|
|
274
|
+
* fixed app chrome — a sticky header, a toolbar — that would otherwise cover
|
|
275
|
+
* the tab. Defaults to 0.
|
|
276
|
+
*/
|
|
277
|
+
tabInset?: number;
|
|
264
278
|
/** Disable close button */
|
|
265
279
|
disableClose?: boolean;
|
|
266
280
|
/** Disable resize functionality */
|
|
@@ -358,6 +372,18 @@ interface DataPanelTabProps {
|
|
|
358
372
|
offset?: number;
|
|
359
373
|
/** Called with the new offset after the tab is dragged along its edge */
|
|
360
374
|
onOffsetChange?: (offset: number) => void;
|
|
375
|
+
/**
|
|
376
|
+
* Length (px) of the tab along its edge. Fixed rather than content-sized so
|
|
377
|
+
* the tab's geometry is pure pixel math in every browser; raise it for longer
|
|
378
|
+
* labels. Defaults to 220.
|
|
379
|
+
*/
|
|
380
|
+
tabWidth?: number;
|
|
381
|
+
/**
|
|
382
|
+
* Distance (px) from the pinned edge. Use it to clear fixed app chrome — a
|
|
383
|
+
* sticky header, a toolbar — that would otherwise cover the tab. Defaults
|
|
384
|
+
* to 0 (flush with the edge).
|
|
385
|
+
*/
|
|
386
|
+
tabInset?: number;
|
|
361
387
|
className?: string;
|
|
362
388
|
}
|
|
363
389
|
declare const DataPanelTab: React$1.ForwardRefExoticComponent<DataPanelTabProps & React$1.RefAttributes<HTMLDivElement>>;
|
package/dist/index.d.ts
CHANGED
|
@@ -194,22 +194,25 @@ declare const DialogDescription: React$1.ForwardRefExoticComponent<Omit<React$1.
|
|
|
194
194
|
* Supports multiple layout variants and optional action buttons.
|
|
195
195
|
*
|
|
196
196
|
* Features:
|
|
197
|
-
* - Multiple variants: default, hero, centered
|
|
197
|
+
* - Multiple variants: default, hero, centered, form
|
|
198
198
|
* - Optional subtitle with branded styling
|
|
199
199
|
* - Optional actions slot for CTA buttons
|
|
200
|
-
* - Consistent typography using design tokens
|
|
200
|
+
* - Consistent typography using design tokens: `default` and `centered`
|
|
201
|
+
* inherit the theme heading styles for the rendered level (h1 = Spectral
|
|
202
|
+
* 500 italic, h2-h6 = Figtree 600); `hero` and `form` are display styles
|
|
203
|
+
* that opt out of them.
|
|
201
204
|
*/
|
|
202
205
|
declare const pageHeaderContainerVariants: (props?: ({
|
|
203
|
-
variant?: "default" | "hero" | "centered" | null | undefined;
|
|
206
|
+
variant?: "default" | "form" | "hero" | "centered" | null | undefined;
|
|
204
207
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
205
208
|
declare const pageHeaderTitleVariants: (props?: ({
|
|
206
|
-
variant?: "default" | "hero" | "centered" | null | undefined;
|
|
209
|
+
variant?: "default" | "form" | "hero" | "centered" | null | undefined;
|
|
207
210
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
208
211
|
declare const pageHeaderSubtitleVariants: (props?: ({
|
|
209
|
-
variant?: "default" | "hero" | "centered" | null | undefined;
|
|
212
|
+
variant?: "default" | "form" | "hero" | "centered" | null | undefined;
|
|
210
213
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
211
214
|
declare const pageHeaderActionsVariants: (props?: ({
|
|
212
|
-
variant?: "default" | "hero" | "centered" | null | undefined;
|
|
215
|
+
variant?: "default" | "form" | "hero" | "centered" | null | undefined;
|
|
213
216
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
214
217
|
interface PageHeaderProps extends React$1.HTMLAttributes<HTMLElement>, VariantProps<typeof pageHeaderContainerVariants> {
|
|
215
218
|
/** Main title text */
|
|
@@ -261,6 +264,17 @@ interface DataPanelProps {
|
|
|
261
264
|
actions?: DataPanelAction[];
|
|
262
265
|
/** Size constraints */
|
|
263
266
|
constraints?: PanelConstraints;
|
|
267
|
+
/**
|
|
268
|
+
* Length (px) of the collapsed tab along its edge. Fixed rather than
|
|
269
|
+
* content-sized; raise it for longer titles. Defaults to 220.
|
|
270
|
+
*/
|
|
271
|
+
tabWidth?: number;
|
|
272
|
+
/**
|
|
273
|
+
* Distance (px) of the collapsed tab from its pinned edge. Use it to clear
|
|
274
|
+
* fixed app chrome — a sticky header, a toolbar — that would otherwise cover
|
|
275
|
+
* the tab. Defaults to 0.
|
|
276
|
+
*/
|
|
277
|
+
tabInset?: number;
|
|
264
278
|
/** Disable close button */
|
|
265
279
|
disableClose?: boolean;
|
|
266
280
|
/** Disable resize functionality */
|
|
@@ -358,6 +372,18 @@ interface DataPanelTabProps {
|
|
|
358
372
|
offset?: number;
|
|
359
373
|
/** Called with the new offset after the tab is dragged along its edge */
|
|
360
374
|
onOffsetChange?: (offset: number) => void;
|
|
375
|
+
/**
|
|
376
|
+
* Length (px) of the tab along its edge. Fixed rather than content-sized so
|
|
377
|
+
* the tab's geometry is pure pixel math in every browser; raise it for longer
|
|
378
|
+
* labels. Defaults to 220.
|
|
379
|
+
*/
|
|
380
|
+
tabWidth?: number;
|
|
381
|
+
/**
|
|
382
|
+
* Distance (px) from the pinned edge. Use it to clear fixed app chrome — a
|
|
383
|
+
* sticky header, a toolbar — that would otherwise cover the tab. Defaults
|
|
384
|
+
* to 0 (flush with the edge).
|
|
385
|
+
*/
|
|
386
|
+
tabInset?: number;
|
|
361
387
|
className?: string;
|
|
362
388
|
}
|
|
363
389
|
declare const DataPanelTab: React$1.ForwardRefExoticComponent<DataPanelTabProps & React$1.RefAttributes<HTMLDivElement>>;
|
package/dist/index.js
CHANGED
|
@@ -114,9 +114,9 @@ var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
|
114
114
|
variants: {
|
|
115
115
|
variant: {
|
|
116
116
|
default: "bg-primary text-primary-foreground shadow hover:bg-primary-hover",
|
|
117
|
-
secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary-hover",
|
|
117
|
+
secondary: "border-2 border-secondary-border bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary-hover",
|
|
118
118
|
destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive-hover focus-visible:ring-destructive",
|
|
119
|
-
outline: "border-2 border-
|
|
119
|
+
outline: "border-2 border-outline bg-transparent text-foreground hover:border-outline-hover hover:bg-primary hover:text-primary-foreground",
|
|
120
120
|
ghost: "hover:bg-muted-hover hover:text-foreground",
|
|
121
121
|
link: "text-primary underline-offset-4 hover:underline"
|
|
122
122
|
},
|
|
@@ -679,7 +679,8 @@ var pageHeaderContainerVariants = (0, import_class_variance_authority4.cva)("",
|
|
|
679
679
|
variant: {
|
|
680
680
|
default: "",
|
|
681
681
|
hero: "",
|
|
682
|
-
centered: "text-center"
|
|
682
|
+
centered: "text-center",
|
|
683
|
+
form: "text-center mb-8"
|
|
683
684
|
}
|
|
684
685
|
},
|
|
685
686
|
defaultVariants: {
|
|
@@ -689,9 +690,10 @@ var pageHeaderContainerVariants = (0, import_class_variance_authority4.cva)("",
|
|
|
689
690
|
var pageHeaderTitleVariants = (0, import_class_variance_authority4.cva)("text-foreground", {
|
|
690
691
|
variants: {
|
|
691
692
|
variant: {
|
|
692
|
-
default: "
|
|
693
|
-
hero: "text-5xl font-black uppercase tracking-tight mb-2",
|
|
694
|
-
centered: "
|
|
693
|
+
default: "mb-2",
|
|
694
|
+
hero: "font-sans text-5xl font-black not-italic uppercase tracking-tight mb-2",
|
|
695
|
+
centered: "mb-3",
|
|
696
|
+
form: "font-sans text-3xl md:text-4xl font-light not-italic tracking-tight text-brand-core-2"
|
|
695
697
|
}
|
|
696
698
|
},
|
|
697
699
|
defaultVariants: {
|
|
@@ -703,7 +705,8 @@ var pageHeaderSubtitleVariants = (0, import_class_variance_authority4.cva)("text
|
|
|
703
705
|
variant: {
|
|
704
706
|
default: "text-lg",
|
|
705
707
|
hero: "text-lg font-serif italic",
|
|
706
|
-
centered: "text-xl max-w-2xl mx-auto"
|
|
708
|
+
centered: "text-xl max-w-2xl mx-auto",
|
|
709
|
+
form: "mt-3 text-base md:text-lg text-gray-600"
|
|
707
710
|
}
|
|
708
711
|
},
|
|
709
712
|
defaultVariants: {
|
|
@@ -715,7 +718,8 @@ var pageHeaderActionsVariants = (0, import_class_variance_authority4.cva)("flex
|
|
|
715
718
|
variant: {
|
|
716
719
|
default: "mt-4",
|
|
717
720
|
hero: "mt-6",
|
|
718
|
-
centered: "mt-6 justify-center"
|
|
721
|
+
centered: "mt-6 justify-center",
|
|
722
|
+
form: "mt-6 justify-center"
|
|
719
723
|
}
|
|
720
724
|
},
|
|
721
725
|
defaultVariants: {
|
|
@@ -1329,20 +1333,22 @@ var DataPanelTab = React14.forwardRef(
|
|
|
1329
1333
|
disableClose = false,
|
|
1330
1334
|
offset = 0,
|
|
1331
1335
|
onOffsetChange,
|
|
1336
|
+
tabWidth = import_data_panel_core.DEFAULT_TAB_WIDTH,
|
|
1337
|
+
tabInset = 0,
|
|
1332
1338
|
className
|
|
1333
1339
|
}, ref) => {
|
|
1334
1340
|
const isVertical = edge === "left" || edge === "right";
|
|
1335
1341
|
const positionClasses = {
|
|
1336
|
-
//
|
|
1337
|
-
//
|
|
1338
|
-
//
|
|
1339
|
-
//
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
bottom: "bottom-0 left-1/2 rounded-t-lg border-b-0"
|
|
1342
|
+
// Border classes are in the chip's pre-rotation frame: its bottom rotates
|
|
1343
|
+
// to the attached (edge) side and its top corners to the viewport-facing
|
|
1344
|
+
// corners, so both side edges drop the bottom border and round the top.
|
|
1345
|
+
// The anchored axis is set inline (see insetStyle) so tabInset can move it.
|
|
1346
|
+
left: "top-1/2 rounded-t-lg border-b-0",
|
|
1347
|
+
right: "top-1/2 rounded-t-lg border-b-0",
|
|
1348
|
+
top: "left-1/2 rounded-b-lg border-t-0",
|
|
1349
|
+
bottom: "left-1/2 rounded-t-lg border-b-0"
|
|
1345
1350
|
}[edge];
|
|
1351
|
+
const insetStyle = { [edge]: tabInset };
|
|
1346
1352
|
const innerRef = React14.useRef(null);
|
|
1347
1353
|
const dragRef = React14.useRef({
|
|
1348
1354
|
startX: 0,
|
|
@@ -1354,8 +1360,8 @@ var DataPanelTab = React14.forwardRef(
|
|
|
1354
1360
|
const [dragOffset, setDragOffset] = React14.useState(null);
|
|
1355
1361
|
const effectiveOffset = dragOffset ?? offset;
|
|
1356
1362
|
const draggable = !!onOffsetChange;
|
|
1357
|
-
const
|
|
1358
|
-
const
|
|
1363
|
+
const tabTransform = (0, import_data_panel_core.getTabTransform)(edge, tabWidth, effectiveOffset);
|
|
1364
|
+
const tabBounds = (0, import_data_panel_core.getTabBounds)(edge, tabWidth);
|
|
1359
1365
|
const setRefs = (node) => {
|
|
1360
1366
|
innerRef.current = node;
|
|
1361
1367
|
if (typeof ref === "function") ref(node);
|
|
@@ -1380,13 +1386,11 @@ var DataPanelTab = React14.forwardRef(
|
|
|
1380
1386
|
if (d.pointerId !== e.pointerId || !e.currentTarget.hasPointerCapture(e.pointerId)) return;
|
|
1381
1387
|
const delta = isVertical ? e.clientY - d.startY : e.clientX - d.startX;
|
|
1382
1388
|
if (Math.abs(delta) > 3) d.moved = true;
|
|
1383
|
-
const rect = innerRef.current?.getBoundingClientRect();
|
|
1384
|
-
const tabSize = { width: rect?.width ?? 160, height: rect?.height ?? 48 };
|
|
1385
1389
|
setDragOffset(
|
|
1386
1390
|
(0, import_data_panel_core.constrainTabOffset)(
|
|
1387
1391
|
d.startOffset + delta,
|
|
1388
1392
|
edge,
|
|
1389
|
-
|
|
1393
|
+
tabBounds,
|
|
1390
1394
|
window.innerWidth,
|
|
1391
1395
|
window.innerHeight
|
|
1392
1396
|
)
|
|
@@ -1424,42 +1428,41 @@ var DataPanelTab = React14.forwardRef(
|
|
|
1424
1428
|
};
|
|
1425
1429
|
React14.useEffect(() => {
|
|
1426
1430
|
if (!onOffsetChange || dragOffset !== null) return;
|
|
1427
|
-
const
|
|
1428
|
-
|
|
1429
|
-
const clamped = (0, import_data_panel_core.constrainTabOffset)(
|
|
1430
|
-
offset,
|
|
1431
|
-
edge,
|
|
1432
|
-
{ width: rect.width, height: rect.height },
|
|
1433
|
-
window.innerWidth,
|
|
1434
|
-
window.innerHeight
|
|
1435
|
-
);
|
|
1436
|
-
if (clamped !== offset) onOffsetChange(clamped);
|
|
1437
|
-
const onResize = () => {
|
|
1438
|
-
const r = innerRef.current?.getBoundingClientRect();
|
|
1439
|
-
if (!r) return;
|
|
1440
|
-
const c = (0, import_data_panel_core.constrainTabOffset)(
|
|
1431
|
+
const reclamp = () => {
|
|
1432
|
+
const clamped = (0, import_data_panel_core.constrainTabOffset)(
|
|
1441
1433
|
offset,
|
|
1442
1434
|
edge,
|
|
1443
|
-
|
|
1435
|
+
tabBounds,
|
|
1444
1436
|
window.innerWidth,
|
|
1445
1437
|
window.innerHeight
|
|
1446
1438
|
);
|
|
1447
|
-
if (
|
|
1439
|
+
if (clamped !== offset) onOffsetChange(clamped);
|
|
1448
1440
|
};
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1441
|
+
reclamp();
|
|
1442
|
+
window.addEventListener("resize", reclamp);
|
|
1443
|
+
return () => window.removeEventListener("resize", reclamp);
|
|
1444
|
+
}, [edge, tabWidth, offset, onOffsetChange, dragOffset]);
|
|
1452
1445
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1453
1446
|
"div",
|
|
1454
1447
|
{
|
|
1455
1448
|
ref: setRefs,
|
|
1456
1449
|
className: cn(
|
|
1457
|
-
|
|
1450
|
+
// Same layer as the expanded panel: the tab is the only way to bring
|
|
1451
|
+
// the panel back, so it must never sit under chrome the panel covers.
|
|
1452
|
+
"fixed z-50 flex items-center gap-2 border border-border bg-background px-2.5 py-1.5 shadow-md focus-within:ring-2 focus-within:ring-ring",
|
|
1458
1453
|
draggable && "cursor-grab touch-none active:cursor-grabbing",
|
|
1459
1454
|
positionClasses,
|
|
1460
1455
|
className
|
|
1461
1456
|
),
|
|
1462
|
-
style: {
|
|
1457
|
+
style: {
|
|
1458
|
+
...insetStyle,
|
|
1459
|
+
width: tabWidth,
|
|
1460
|
+
// Side tabs rotate, so they need a fixed thickness for a deterministic
|
|
1461
|
+
// edge hug; top/bottom stay content-height.
|
|
1462
|
+
height: isVertical ? import_data_panel_core.TAB_THICKNESS : void 0,
|
|
1463
|
+
transformOrigin: "0 0",
|
|
1464
|
+
transform: tabTransform
|
|
1465
|
+
},
|
|
1463
1466
|
onPointerDown: handlePointerDown,
|
|
1464
1467
|
onPointerMove: draggable ? handlePointerMove : void 0,
|
|
1465
1468
|
onPointerUp: draggable ? handlePointerUp : void 0,
|
|
@@ -1709,6 +1712,8 @@ var DataPanel = React14.forwardRef(
|
|
|
1709
1712
|
children,
|
|
1710
1713
|
actions = [],
|
|
1711
1714
|
constraints = {},
|
|
1715
|
+
tabWidth = import_data_panel_core.DEFAULT_TAB_WIDTH,
|
|
1716
|
+
tabInset = 0,
|
|
1712
1717
|
disableClose = false,
|
|
1713
1718
|
disableResize = false,
|
|
1714
1719
|
disableDrag = false,
|
|
@@ -2517,7 +2522,9 @@ var DataPanel = React14.forwardRef(
|
|
|
2517
2522
|
onClose: () => handleOpenChange(false),
|
|
2518
2523
|
disableClose,
|
|
2519
2524
|
offset: tabOffset,
|
|
2520
|
-
onOffsetChange: setTabOffset
|
|
2525
|
+
onOffsetChange: setTabOffset,
|
|
2526
|
+
tabWidth,
|
|
2527
|
+
tabInset
|
|
2521
2528
|
}
|
|
2522
2529
|
);
|
|
2523
2530
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -19,9 +19,9 @@ var buttonVariants = cva(
|
|
|
19
19
|
variants: {
|
|
20
20
|
variant: {
|
|
21
21
|
default: "bg-primary text-primary-foreground shadow hover:bg-primary-hover",
|
|
22
|
-
secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary-hover",
|
|
22
|
+
secondary: "border-2 border-secondary-border bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary-hover",
|
|
23
23
|
destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive-hover focus-visible:ring-destructive",
|
|
24
|
-
outline: "border-2 border-
|
|
24
|
+
outline: "border-2 border-outline bg-transparent text-foreground hover:border-outline-hover hover:bg-primary hover:text-primary-foreground",
|
|
25
25
|
ghost: "hover:bg-muted-hover hover:text-foreground",
|
|
26
26
|
link: "text-primary underline-offset-4 hover:underline"
|
|
27
27
|
},
|
|
@@ -584,7 +584,8 @@ var pageHeaderContainerVariants = cva4("", {
|
|
|
584
584
|
variant: {
|
|
585
585
|
default: "",
|
|
586
586
|
hero: "",
|
|
587
|
-
centered: "text-center"
|
|
587
|
+
centered: "text-center",
|
|
588
|
+
form: "text-center mb-8"
|
|
588
589
|
}
|
|
589
590
|
},
|
|
590
591
|
defaultVariants: {
|
|
@@ -594,9 +595,10 @@ var pageHeaderContainerVariants = cva4("", {
|
|
|
594
595
|
var pageHeaderTitleVariants = cva4("text-foreground", {
|
|
595
596
|
variants: {
|
|
596
597
|
variant: {
|
|
597
|
-
default: "
|
|
598
|
-
hero: "text-5xl font-black uppercase tracking-tight mb-2",
|
|
599
|
-
centered: "
|
|
598
|
+
default: "mb-2",
|
|
599
|
+
hero: "font-sans text-5xl font-black not-italic uppercase tracking-tight mb-2",
|
|
600
|
+
centered: "mb-3",
|
|
601
|
+
form: "font-sans text-3xl md:text-4xl font-light not-italic tracking-tight text-brand-core-2"
|
|
600
602
|
}
|
|
601
603
|
},
|
|
602
604
|
defaultVariants: {
|
|
@@ -608,7 +610,8 @@ var pageHeaderSubtitleVariants = cva4("text-muted-foreground", {
|
|
|
608
610
|
variant: {
|
|
609
611
|
default: "text-lg",
|
|
610
612
|
hero: "text-lg font-serif italic",
|
|
611
|
-
centered: "text-xl max-w-2xl mx-auto"
|
|
613
|
+
centered: "text-xl max-w-2xl mx-auto",
|
|
614
|
+
form: "mt-3 text-base md:text-lg text-gray-600"
|
|
612
615
|
}
|
|
613
616
|
},
|
|
614
617
|
defaultVariants: {
|
|
@@ -620,7 +623,8 @@ var pageHeaderActionsVariants = cva4("flex gap-4", {
|
|
|
620
623
|
variant: {
|
|
621
624
|
default: "mt-4",
|
|
622
625
|
hero: "mt-6",
|
|
623
|
-
centered: "mt-6 justify-center"
|
|
626
|
+
centered: "mt-6 justify-center",
|
|
627
|
+
form: "mt-6 justify-center"
|
|
624
628
|
}
|
|
625
629
|
},
|
|
626
630
|
defaultVariants: {
|
|
@@ -789,6 +793,10 @@ import {
|
|
|
789
793
|
getInitialDetachedPosition,
|
|
790
794
|
isHorizontalEdge,
|
|
791
795
|
constrainTabOffset,
|
|
796
|
+
getTabTransform,
|
|
797
|
+
getTabBounds,
|
|
798
|
+
TAB_THICKNESS,
|
|
799
|
+
DEFAULT_TAB_WIDTH,
|
|
792
800
|
calculateDetachDistance,
|
|
793
801
|
calculatePullOffset,
|
|
794
802
|
calculateDetachedPositionFromPinned,
|
|
@@ -1263,20 +1271,22 @@ var DataPanelTab = React14.forwardRef(
|
|
|
1263
1271
|
disableClose = false,
|
|
1264
1272
|
offset = 0,
|
|
1265
1273
|
onOffsetChange,
|
|
1274
|
+
tabWidth = DEFAULT_TAB_WIDTH,
|
|
1275
|
+
tabInset = 0,
|
|
1266
1276
|
className
|
|
1267
1277
|
}, ref) => {
|
|
1268
1278
|
const isVertical = edge === "left" || edge === "right";
|
|
1269
1279
|
const positionClasses = {
|
|
1270
|
-
//
|
|
1271
|
-
//
|
|
1272
|
-
//
|
|
1273
|
-
//
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
bottom: "bottom-0 left-1/2 rounded-t-lg border-b-0"
|
|
1280
|
+
// Border classes are in the chip's pre-rotation frame: its bottom rotates
|
|
1281
|
+
// to the attached (edge) side and its top corners to the viewport-facing
|
|
1282
|
+
// corners, so both side edges drop the bottom border and round the top.
|
|
1283
|
+
// The anchored axis is set inline (see insetStyle) so tabInset can move it.
|
|
1284
|
+
left: "top-1/2 rounded-t-lg border-b-0",
|
|
1285
|
+
right: "top-1/2 rounded-t-lg border-b-0",
|
|
1286
|
+
top: "left-1/2 rounded-b-lg border-t-0",
|
|
1287
|
+
bottom: "left-1/2 rounded-t-lg border-b-0"
|
|
1279
1288
|
}[edge];
|
|
1289
|
+
const insetStyle = { [edge]: tabInset };
|
|
1280
1290
|
const innerRef = React14.useRef(null);
|
|
1281
1291
|
const dragRef = React14.useRef({
|
|
1282
1292
|
startX: 0,
|
|
@@ -1288,8 +1298,8 @@ var DataPanelTab = React14.forwardRef(
|
|
|
1288
1298
|
const [dragOffset, setDragOffset] = React14.useState(null);
|
|
1289
1299
|
const effectiveOffset = dragOffset ?? offset;
|
|
1290
1300
|
const draggable = !!onOffsetChange;
|
|
1291
|
-
const
|
|
1292
|
-
const
|
|
1301
|
+
const tabTransform = getTabTransform(edge, tabWidth, effectiveOffset);
|
|
1302
|
+
const tabBounds = getTabBounds(edge, tabWidth);
|
|
1293
1303
|
const setRefs = (node) => {
|
|
1294
1304
|
innerRef.current = node;
|
|
1295
1305
|
if (typeof ref === "function") ref(node);
|
|
@@ -1314,13 +1324,11 @@ var DataPanelTab = React14.forwardRef(
|
|
|
1314
1324
|
if (d.pointerId !== e.pointerId || !e.currentTarget.hasPointerCapture(e.pointerId)) return;
|
|
1315
1325
|
const delta = isVertical ? e.clientY - d.startY : e.clientX - d.startX;
|
|
1316
1326
|
if (Math.abs(delta) > 3) d.moved = true;
|
|
1317
|
-
const rect = innerRef.current?.getBoundingClientRect();
|
|
1318
|
-
const tabSize = { width: rect?.width ?? 160, height: rect?.height ?? 48 };
|
|
1319
1327
|
setDragOffset(
|
|
1320
1328
|
constrainTabOffset(
|
|
1321
1329
|
d.startOffset + delta,
|
|
1322
1330
|
edge,
|
|
1323
|
-
|
|
1331
|
+
tabBounds,
|
|
1324
1332
|
window.innerWidth,
|
|
1325
1333
|
window.innerHeight
|
|
1326
1334
|
)
|
|
@@ -1358,42 +1366,41 @@ var DataPanelTab = React14.forwardRef(
|
|
|
1358
1366
|
};
|
|
1359
1367
|
React14.useEffect(() => {
|
|
1360
1368
|
if (!onOffsetChange || dragOffset !== null) return;
|
|
1361
|
-
const
|
|
1362
|
-
|
|
1363
|
-
const clamped = constrainTabOffset(
|
|
1364
|
-
offset,
|
|
1365
|
-
edge,
|
|
1366
|
-
{ width: rect.width, height: rect.height },
|
|
1367
|
-
window.innerWidth,
|
|
1368
|
-
window.innerHeight
|
|
1369
|
-
);
|
|
1370
|
-
if (clamped !== offset) onOffsetChange(clamped);
|
|
1371
|
-
const onResize = () => {
|
|
1372
|
-
const r = innerRef.current?.getBoundingClientRect();
|
|
1373
|
-
if (!r) return;
|
|
1374
|
-
const c = constrainTabOffset(
|
|
1369
|
+
const reclamp = () => {
|
|
1370
|
+
const clamped = constrainTabOffset(
|
|
1375
1371
|
offset,
|
|
1376
1372
|
edge,
|
|
1377
|
-
|
|
1373
|
+
tabBounds,
|
|
1378
1374
|
window.innerWidth,
|
|
1379
1375
|
window.innerHeight
|
|
1380
1376
|
);
|
|
1381
|
-
if (
|
|
1377
|
+
if (clamped !== offset) onOffsetChange(clamped);
|
|
1382
1378
|
};
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1379
|
+
reclamp();
|
|
1380
|
+
window.addEventListener("resize", reclamp);
|
|
1381
|
+
return () => window.removeEventListener("resize", reclamp);
|
|
1382
|
+
}, [edge, tabWidth, offset, onOffsetChange, dragOffset]);
|
|
1386
1383
|
return /* @__PURE__ */ jsxs5(
|
|
1387
1384
|
"div",
|
|
1388
1385
|
{
|
|
1389
1386
|
ref: setRefs,
|
|
1390
1387
|
className: cn(
|
|
1391
|
-
|
|
1388
|
+
// Same layer as the expanded panel: the tab is the only way to bring
|
|
1389
|
+
// the panel back, so it must never sit under chrome the panel covers.
|
|
1390
|
+
"fixed z-50 flex items-center gap-2 border border-border bg-background px-2.5 py-1.5 shadow-md focus-within:ring-2 focus-within:ring-ring",
|
|
1392
1391
|
draggable && "cursor-grab touch-none active:cursor-grabbing",
|
|
1393
1392
|
positionClasses,
|
|
1394
1393
|
className
|
|
1395
1394
|
),
|
|
1396
|
-
style: {
|
|
1395
|
+
style: {
|
|
1396
|
+
...insetStyle,
|
|
1397
|
+
width: tabWidth,
|
|
1398
|
+
// Side tabs rotate, so they need a fixed thickness for a deterministic
|
|
1399
|
+
// edge hug; top/bottom stay content-height.
|
|
1400
|
+
height: isVertical ? TAB_THICKNESS : void 0,
|
|
1401
|
+
transformOrigin: "0 0",
|
|
1402
|
+
transform: tabTransform
|
|
1403
|
+
},
|
|
1397
1404
|
onPointerDown: handlePointerDown,
|
|
1398
1405
|
onPointerMove: draggable ? handlePointerMove : void 0,
|
|
1399
1406
|
onPointerUp: draggable ? handlePointerUp : void 0,
|
|
@@ -1643,6 +1650,8 @@ var DataPanel = React14.forwardRef(
|
|
|
1643
1650
|
children,
|
|
1644
1651
|
actions = [],
|
|
1645
1652
|
constraints = {},
|
|
1653
|
+
tabWidth = DEFAULT_TAB_WIDTH,
|
|
1654
|
+
tabInset = 0,
|
|
1646
1655
|
disableClose = false,
|
|
1647
1656
|
disableResize = false,
|
|
1648
1657
|
disableDrag = false,
|
|
@@ -2451,7 +2460,9 @@ var DataPanel = React14.forwardRef(
|
|
|
2451
2460
|
onClose: () => handleOpenChange(false),
|
|
2452
2461
|
disableClose,
|
|
2453
2462
|
offset: tabOffset,
|
|
2454
|
-
onOffsetChange: setTabOffset
|
|
2463
|
+
onOffsetChange: setTabOffset,
|
|
2464
|
+
tabWidth,
|
|
2465
|
+
tabInset
|
|
2455
2466
|
}
|
|
2456
2467
|
);
|
|
2457
2468
|
}
|