@classic-homes/theme-react 0.1.55 → 0.1.57
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/README.md +30 -0
- package/dist/index.css +37 -12
- package/dist/index.d.mts +18 -3
- package/dist/index.d.ts +18 -3
- package/dist/index.js +1132 -293
- package/dist/index.mjs +1150 -305
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# @classic-homes/theme-react
|
|
2
|
+
|
|
3
|
+
React components for the Classic theme system (Radix UI + CVA).
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @classic-homes/theme-react
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Styling
|
|
12
|
+
|
|
13
|
+
Most components are styled with Tailwind utilities from
|
|
14
|
+
`@classic-homes/theme-tailwind-preset`. A few components ship additional plain
|
|
15
|
+
CSS (e.g. the `DataPanel` resize handles). Import the package stylesheet **once**
|
|
16
|
+
in your app entry so those styles load:
|
|
17
|
+
|
|
18
|
+
```css
|
|
19
|
+
/* app entry css, before the Tailwind directives */
|
|
20
|
+
@import '@classic-homes/theme-react/styles.css';
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
or in JS/TS:
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import '@classic-homes/theme-react/styles.css';
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Without this import the `DataPanel` resize handles (edges + corners) will not be
|
|
30
|
+
positioned or visible, so detached/pinned resizing won't work.
|
package/dist/index.css
CHANGED
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
.resize-handle--horizontal {
|
|
9
9
|
left: 14px;
|
|
10
10
|
right: 14px;
|
|
11
|
-
height:
|
|
12
|
-
margin-top: -18px;
|
|
11
|
+
height: 8px;
|
|
13
12
|
cursor: ns-resize;
|
|
14
13
|
}
|
|
15
14
|
.resize-handle--horizontal::after {
|
|
@@ -22,22 +21,21 @@
|
|
|
22
21
|
transition: background-color 0.15s ease;
|
|
23
22
|
}
|
|
24
23
|
.resize-handle--top {
|
|
25
|
-
top:
|
|
24
|
+
top: 2px;
|
|
26
25
|
}
|
|
27
26
|
.resize-handle--top::after {
|
|
28
|
-
top:
|
|
27
|
+
top: 0;
|
|
29
28
|
}
|
|
30
29
|
.resize-handle--bottom {
|
|
31
|
-
bottom:
|
|
30
|
+
bottom: 2px;
|
|
32
31
|
}
|
|
33
32
|
.resize-handle--bottom::after {
|
|
34
|
-
bottom:
|
|
33
|
+
bottom: 0;
|
|
35
34
|
}
|
|
36
35
|
.resize-handle--vertical {
|
|
37
36
|
top: 14px;
|
|
38
37
|
bottom: 14px;
|
|
39
|
-
width:
|
|
40
|
-
margin-left: -18px;
|
|
38
|
+
width: 8px;
|
|
41
39
|
cursor: ew-resize;
|
|
42
40
|
}
|
|
43
41
|
.resize-handle--vertical::after {
|
|
@@ -50,21 +48,32 @@
|
|
|
50
48
|
transition: background-color 0.15s ease;
|
|
51
49
|
}
|
|
52
50
|
.resize-handle--left {
|
|
53
|
-
left:
|
|
51
|
+
left: 2px;
|
|
54
52
|
}
|
|
55
53
|
.resize-handle--left::after {
|
|
56
|
-
left:
|
|
54
|
+
left: 0;
|
|
57
55
|
}
|
|
58
56
|
.resize-handle--right {
|
|
59
|
-
right:
|
|
57
|
+
right: 2px;
|
|
60
58
|
}
|
|
61
59
|
.resize-handle--right::after {
|
|
62
|
-
right:
|
|
60
|
+
right: 0;
|
|
63
61
|
}
|
|
64
62
|
.resize-handle--horizontal:hover::after,
|
|
65
63
|
.resize-handle--vertical:hover::after {
|
|
66
64
|
background: hsl(var(--border));
|
|
67
65
|
}
|
|
66
|
+
.resize-handle--horizontal:focus-visible::after,
|
|
67
|
+
.resize-handle--vertical:focus-visible::after {
|
|
68
|
+
background: hsl(var(--ring));
|
|
69
|
+
}
|
|
70
|
+
.resize-handle:focus-visible {
|
|
71
|
+
outline: none;
|
|
72
|
+
}
|
|
73
|
+
.resize-handle--card-edge {
|
|
74
|
+
top: 14px;
|
|
75
|
+
bottom: 2px;
|
|
76
|
+
}
|
|
68
77
|
.resize-handle--corner {
|
|
69
78
|
width: 20px;
|
|
70
79
|
height: 20px;
|
|
@@ -138,6 +147,22 @@
|
|
|
138
147
|
border-bottom-color: hsl(var(--border)) !important;
|
|
139
148
|
border-right-color: hsl(var(--border)) !important;
|
|
140
149
|
}
|
|
150
|
+
.resize-handle--top-left:focus-visible::after {
|
|
151
|
+
border-top-color: hsl(var(--ring)) !important;
|
|
152
|
+
border-left-color: hsl(var(--ring)) !important;
|
|
153
|
+
}
|
|
154
|
+
.resize-handle--top-right:focus-visible::after {
|
|
155
|
+
border-top-color: hsl(var(--ring)) !important;
|
|
156
|
+
border-right-color: hsl(var(--ring)) !important;
|
|
157
|
+
}
|
|
158
|
+
.resize-handle--bottom-left:focus-visible::after {
|
|
159
|
+
border-bottom-color: hsl(var(--ring)) !important;
|
|
160
|
+
border-left-color: hsl(var(--ring)) !important;
|
|
161
|
+
}
|
|
162
|
+
.resize-handle--bottom-right:focus-visible::after {
|
|
163
|
+
border-bottom-color: hsl(var(--ring)) !important;
|
|
164
|
+
border-right-color: hsl(var(--ring)) !important;
|
|
165
|
+
}
|
|
141
166
|
.data-panel--pulling {
|
|
142
167
|
transition: transform 0.05s ease-out, box-shadow 0.15s ease-out;
|
|
143
168
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -5,8 +5,8 @@ import * as LabelPrimitive from '@radix-ui/react-label';
|
|
|
5
5
|
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
6
6
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
7
7
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
8
|
-
import { PanelMode, PanelEdge, DataPanelAction, PanelConstraints, Position, Size } from '@classic-homes/data-panel-core';
|
|
9
|
-
export { DataPanelAction, DataPanelState, PanelConstraints, PanelEdge, PanelMode, Position, Size } from '@classic-homes/data-panel-core';
|
|
8
|
+
import { PanelMode, PanelVariant, CardConfig, PanelEdge, DataPanelAction, PanelConstraints, Position, Size } from '@classic-homes/data-panel-core';
|
|
9
|
+
export { CardConfig, DataPanelAction, DataPanelState, PanelConstraints, PanelEdge, PanelMode, PanelVariant, Position, Size } from '@classic-homes/data-panel-core';
|
|
10
10
|
import { ClassValue } from 'clsx';
|
|
11
11
|
|
|
12
12
|
declare const buttonVariants: (props?: ({
|
|
@@ -237,6 +237,12 @@ interface DataPanelProps {
|
|
|
237
237
|
mode?: PanelMode;
|
|
238
238
|
/** Callback when mode changes */
|
|
239
239
|
onModeChange?: (mode: PanelMode) => void;
|
|
240
|
+
/** Panel variant - 'full' for traditional sidebar, 'card' for mobile bottom sheet */
|
|
241
|
+
variant?: PanelVariant;
|
|
242
|
+
/** Callback when variant changes */
|
|
243
|
+
onVariantChange?: (variant: PanelVariant) => void;
|
|
244
|
+
/** Card mode configuration */
|
|
245
|
+
cardConfig?: CardConfig;
|
|
240
246
|
/** Edge to pin panel to (when mode is 'pinned') */
|
|
241
247
|
edge?: PanelEdge;
|
|
242
248
|
/** Callback when edge changes */
|
|
@@ -341,11 +347,20 @@ interface DataPanelFooterProps {
|
|
|
341
347
|
declare const DataPanelFooter: React$1.ForwardRefExoticComponent<DataPanelFooterProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
342
348
|
interface DataPanelTabProps {
|
|
343
349
|
title?: string;
|
|
350
|
+
subtitle?: string;
|
|
344
351
|
edge: PanelEdge;
|
|
352
|
+
/** Expand the panel (tap/click/keyboard on the chip body) */
|
|
345
353
|
onClick?: () => void;
|
|
354
|
+
/** Close the panel (chip close button) */
|
|
355
|
+
onClose?: () => void;
|
|
356
|
+
disableClose?: boolean;
|
|
357
|
+
/** Offset (px) of the tab along its edge from the centered position */
|
|
358
|
+
offset?: number;
|
|
359
|
+
/** Called with the new offset after the tab is dragged along its edge */
|
|
360
|
+
onOffsetChange?: (offset: number) => void;
|
|
346
361
|
className?: string;
|
|
347
362
|
}
|
|
348
|
-
declare const DataPanelTab: React$1.ForwardRefExoticComponent<DataPanelTabProps & React$1.RefAttributes<
|
|
363
|
+
declare const DataPanelTab: React$1.ForwardRefExoticComponent<DataPanelTabProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
349
364
|
declare const DataPanel: React$1.ForwardRefExoticComponent<DataPanelProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
350
365
|
|
|
351
366
|
declare const skeletonVariants: (props?: ({
|
package/dist/index.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ import * as LabelPrimitive from '@radix-ui/react-label';
|
|
|
5
5
|
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
6
6
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
7
7
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
8
|
-
import { PanelMode, PanelEdge, DataPanelAction, PanelConstraints, Position, Size } from '@classic-homes/data-panel-core';
|
|
9
|
-
export { DataPanelAction, DataPanelState, PanelConstraints, PanelEdge, PanelMode, Position, Size } from '@classic-homes/data-panel-core';
|
|
8
|
+
import { PanelMode, PanelVariant, CardConfig, PanelEdge, DataPanelAction, PanelConstraints, Position, Size } from '@classic-homes/data-panel-core';
|
|
9
|
+
export { CardConfig, DataPanelAction, DataPanelState, PanelConstraints, PanelEdge, PanelMode, PanelVariant, Position, Size } from '@classic-homes/data-panel-core';
|
|
10
10
|
import { ClassValue } from 'clsx';
|
|
11
11
|
|
|
12
12
|
declare const buttonVariants: (props?: ({
|
|
@@ -237,6 +237,12 @@ interface DataPanelProps {
|
|
|
237
237
|
mode?: PanelMode;
|
|
238
238
|
/** Callback when mode changes */
|
|
239
239
|
onModeChange?: (mode: PanelMode) => void;
|
|
240
|
+
/** Panel variant - 'full' for traditional sidebar, 'card' for mobile bottom sheet */
|
|
241
|
+
variant?: PanelVariant;
|
|
242
|
+
/** Callback when variant changes */
|
|
243
|
+
onVariantChange?: (variant: PanelVariant) => void;
|
|
244
|
+
/** Card mode configuration */
|
|
245
|
+
cardConfig?: CardConfig;
|
|
240
246
|
/** Edge to pin panel to (when mode is 'pinned') */
|
|
241
247
|
edge?: PanelEdge;
|
|
242
248
|
/** Callback when edge changes */
|
|
@@ -341,11 +347,20 @@ interface DataPanelFooterProps {
|
|
|
341
347
|
declare const DataPanelFooter: React$1.ForwardRefExoticComponent<DataPanelFooterProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
342
348
|
interface DataPanelTabProps {
|
|
343
349
|
title?: string;
|
|
350
|
+
subtitle?: string;
|
|
344
351
|
edge: PanelEdge;
|
|
352
|
+
/** Expand the panel (tap/click/keyboard on the chip body) */
|
|
345
353
|
onClick?: () => void;
|
|
354
|
+
/** Close the panel (chip close button) */
|
|
355
|
+
onClose?: () => void;
|
|
356
|
+
disableClose?: boolean;
|
|
357
|
+
/** Offset (px) of the tab along its edge from the centered position */
|
|
358
|
+
offset?: number;
|
|
359
|
+
/** Called with the new offset after the tab is dragged along its edge */
|
|
360
|
+
onOffsetChange?: (offset: number) => void;
|
|
346
361
|
className?: string;
|
|
347
362
|
}
|
|
348
|
-
declare const DataPanelTab: React$1.ForwardRefExoticComponent<DataPanelTabProps & React$1.RefAttributes<
|
|
363
|
+
declare const DataPanelTab: React$1.ForwardRefExoticComponent<DataPanelTabProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
349
364
|
declare const DataPanel: React$1.ForwardRefExoticComponent<DataPanelProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
350
365
|
|
|
351
366
|
declare const skeletonVariants: (props?: ({
|