@graphty/compact-mantine 0.0.1 → 0.3.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/README.md +0 -44
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +930 -0
- package/dist/index.js +1749 -0
- package/package.json +87 -7
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,930 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
|
+
import { JSX } from 'react';
|
|
3
|
+
import { MantineColorShade } from '@mantine/core';
|
|
4
|
+
import { MantineColorsTuple } from '@mantine/core';
|
|
5
|
+
import { MantineRadius } from '@mantine/core';
|
|
6
|
+
import { ReactNode } from 'react';
|
|
7
|
+
import { ReactPortal } from 'react';
|
|
8
|
+
import { RefObject } from 'react';
|
|
9
|
+
import { VariantColorsResolver } from '@mantine/core';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Gradient color stop.
|
|
13
|
+
*/
|
|
14
|
+
export declare interface ColorStop {
|
|
15
|
+
/** Unique identifier for stable React keys */
|
|
16
|
+
id: string;
|
|
17
|
+
/** Stop position (0-1) */
|
|
18
|
+
offset: number;
|
|
19
|
+
/** Stop color in hex format */
|
|
20
|
+
color: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Compact color input with optional opacity support.
|
|
25
|
+
* Supports both controlled and uncontrolled modes.
|
|
26
|
+
* Shows muted styling when using default values, with reset button when explicit.
|
|
27
|
+
* Figma-style layout: [color swatch] [hex input] | [opacity%] [reset]
|
|
28
|
+
* @param root0 - Component props
|
|
29
|
+
* @param root0.color - Hex color value - undefined means using defaultColor
|
|
30
|
+
* @param root0.defaultColor - Default color shown when color is undefined
|
|
31
|
+
* @param root0.opacity - Opacity value 0-100 - undefined means using defaultOpacity
|
|
32
|
+
* @param root0.defaultOpacity - Default opacity shown when opacity is undefined
|
|
33
|
+
* @param root0.onColorChange - Called when color changes (optional for uncontrolled mode)
|
|
34
|
+
* @param root0.onOpacityChange - Called when opacity changes (optional for uncontrolled mode)
|
|
35
|
+
* @param root0.label - Optional label displayed above the input
|
|
36
|
+
* @param root0.showOpacity - Control visibility of opacity input
|
|
37
|
+
* @returns The compact color input component
|
|
38
|
+
*/
|
|
39
|
+
export declare function CompactColorInput({ color, defaultColor, opacity, defaultOpacity, onColorChange, onOpacityChange, label, showOpacity, }: CompactColorInputProps): default_2.JSX.Element;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Props for compact color input with optional opacity support.
|
|
43
|
+
* Supports both controlled and uncontrolled modes via useUncontrolled pattern.
|
|
44
|
+
* When color/opacity is undefined, shows the default value with muted styling and a reset button.
|
|
45
|
+
*/
|
|
46
|
+
export declare interface CompactColorInputProps {
|
|
47
|
+
/** Hex color value - undefined means using defaultColor (controlled mode) */
|
|
48
|
+
color?: string | undefined;
|
|
49
|
+
/** Default color shown when color is undefined */
|
|
50
|
+
defaultColor: string;
|
|
51
|
+
/** Opacity value 0-100 - undefined means using defaultOpacity (controlled mode) */
|
|
52
|
+
opacity?: number | undefined;
|
|
53
|
+
/** Default opacity shown when opacity is undefined */
|
|
54
|
+
defaultOpacity?: number;
|
|
55
|
+
/** Called when color changes - receives undefined when reset (optional for uncontrolled mode) */
|
|
56
|
+
onColorChange?: (color: string | undefined) => void;
|
|
57
|
+
/** Called when opacity changes - receives undefined when reset (optional for uncontrolled mode) */
|
|
58
|
+
onOpacityChange?: (opacity: number | undefined) => void;
|
|
59
|
+
/** Optional label displayed above the input */
|
|
60
|
+
label?: string;
|
|
61
|
+
/** Control visibility of opacity input (defaults to true) */
|
|
62
|
+
showOpacity?: boolean;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Color configuration for the compact theme.
|
|
67
|
+
*/
|
|
68
|
+
export declare const compactColors: {
|
|
69
|
+
dark: MantineColorsTuple;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Custom dark color palette optimized for dense UIs.
|
|
74
|
+
*
|
|
75
|
+
* Usage:
|
|
76
|
+
* - 0-2: Light tones (text, borders in light mode)
|
|
77
|
+
* - 3-5: Mid tones (secondary elements)
|
|
78
|
+
* - 6-7: Dark tones (input backgrounds in dark mode)
|
|
79
|
+
* - 8-9: Darkest tones (main backgrounds in dark mode)
|
|
80
|
+
*/
|
|
81
|
+
export declare const compactDarkColors: MantineColorsTuple;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Mantine theme with "compact" size support for dense UIs.
|
|
85
|
+
*
|
|
86
|
+
* Compact size specifications:
|
|
87
|
+
* - Input height: 24px
|
|
88
|
+
* - Font size: 11px
|
|
89
|
+
* - No borders
|
|
90
|
+
* - Semantic color backgrounds
|
|
91
|
+
* @example
|
|
92
|
+
* ```tsx
|
|
93
|
+
* import { MantineProvider, TextInput } from '@mantine/core';
|
|
94
|
+
* import { compactTheme } from '@graphty/compact-mantine';
|
|
95
|
+
*
|
|
96
|
+
* function App() {
|
|
97
|
+
* return (
|
|
98
|
+
* <MantineProvider theme={compactTheme}>
|
|
99
|
+
* <TextInput size="compact" label="Name" />
|
|
100
|
+
* </MantineProvider>
|
|
101
|
+
* );
|
|
102
|
+
* }
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
export declare const compactTheme: {
|
|
106
|
+
focusRing?: "auto" | "always" | "never" | undefined;
|
|
107
|
+
scale?: number | undefined;
|
|
108
|
+
fontSmoothing?: boolean | undefined;
|
|
109
|
+
white?: string | undefined;
|
|
110
|
+
black?: string | undefined;
|
|
111
|
+
colors?: {
|
|
112
|
+
[x: string & {}]: MantineColorsTuple | undefined;
|
|
113
|
+
blue?: MantineColorsTuple | undefined;
|
|
114
|
+
cyan?: MantineColorsTuple | undefined;
|
|
115
|
+
gray?: MantineColorsTuple | undefined;
|
|
116
|
+
green?: MantineColorsTuple | undefined;
|
|
117
|
+
indigo?: MantineColorsTuple | undefined;
|
|
118
|
+
lime?: MantineColorsTuple | undefined;
|
|
119
|
+
orange?: MantineColorsTuple | undefined;
|
|
120
|
+
pink?: MantineColorsTuple | undefined;
|
|
121
|
+
red?: MantineColorsTuple | undefined;
|
|
122
|
+
teal?: MantineColorsTuple | undefined;
|
|
123
|
+
violet?: MantineColorsTuple | undefined;
|
|
124
|
+
yellow?: MantineColorsTuple | undefined;
|
|
125
|
+
dark?: MantineColorsTuple | undefined;
|
|
126
|
+
grape?: MantineColorsTuple | undefined;
|
|
127
|
+
} | undefined;
|
|
128
|
+
primaryShade?: MantineColorShade | {
|
|
129
|
+
light?: MantineColorShade | undefined;
|
|
130
|
+
dark?: MantineColorShade | undefined;
|
|
131
|
+
} | undefined;
|
|
132
|
+
primaryColor?: string | undefined;
|
|
133
|
+
variantColorResolver?: VariantColorsResolver | undefined;
|
|
134
|
+
autoContrast?: boolean | undefined;
|
|
135
|
+
luminanceThreshold?: number | undefined;
|
|
136
|
+
fontFamily?: string | undefined;
|
|
137
|
+
fontFamilyMonospace?: string | undefined;
|
|
138
|
+
headings?: {
|
|
139
|
+
fontFamily?: string | undefined;
|
|
140
|
+
fontWeight?: string | undefined;
|
|
141
|
+
textWrap?: "wrap" | "nowrap" | "balance" | "pretty" | "stable" | undefined;
|
|
142
|
+
sizes?: {
|
|
143
|
+
h1?: {
|
|
144
|
+
fontSize?: string | undefined;
|
|
145
|
+
fontWeight?: string | undefined;
|
|
146
|
+
lineHeight?: string | undefined;
|
|
147
|
+
} | undefined;
|
|
148
|
+
h2?: {
|
|
149
|
+
fontSize?: string | undefined;
|
|
150
|
+
fontWeight?: string | undefined;
|
|
151
|
+
lineHeight?: string | undefined;
|
|
152
|
+
} | undefined;
|
|
153
|
+
h3?: {
|
|
154
|
+
fontSize?: string | undefined;
|
|
155
|
+
fontWeight?: string | undefined;
|
|
156
|
+
lineHeight?: string | undefined;
|
|
157
|
+
} | undefined;
|
|
158
|
+
h4?: {
|
|
159
|
+
fontSize?: string | undefined;
|
|
160
|
+
fontWeight?: string | undefined;
|
|
161
|
+
lineHeight?: string | undefined;
|
|
162
|
+
} | undefined;
|
|
163
|
+
h5?: {
|
|
164
|
+
fontSize?: string | undefined;
|
|
165
|
+
fontWeight?: string | undefined;
|
|
166
|
+
lineHeight?: string | undefined;
|
|
167
|
+
} | undefined;
|
|
168
|
+
h6?: {
|
|
169
|
+
fontSize?: string | undefined;
|
|
170
|
+
fontWeight?: string | undefined;
|
|
171
|
+
lineHeight?: string | undefined;
|
|
172
|
+
} | undefined;
|
|
173
|
+
} | undefined;
|
|
174
|
+
} | undefined;
|
|
175
|
+
radius?: {
|
|
176
|
+
[x: string & {}]: string | undefined;
|
|
177
|
+
xs?: string | undefined;
|
|
178
|
+
sm?: string | undefined;
|
|
179
|
+
md?: string | undefined;
|
|
180
|
+
lg?: string | undefined;
|
|
181
|
+
xl?: string | undefined;
|
|
182
|
+
} | undefined;
|
|
183
|
+
defaultRadius?: MantineRadius | undefined;
|
|
184
|
+
spacing?: {
|
|
185
|
+
[x: number]: string | undefined;
|
|
186
|
+
[x: string & {}]: string | undefined;
|
|
187
|
+
xs?: string | undefined;
|
|
188
|
+
sm?: string | undefined;
|
|
189
|
+
md?: string | undefined;
|
|
190
|
+
lg?: string | undefined;
|
|
191
|
+
xl?: string | undefined;
|
|
192
|
+
} | undefined;
|
|
193
|
+
fontSizes?: {
|
|
194
|
+
[x: string & {}]: string | undefined;
|
|
195
|
+
xs?: string | undefined;
|
|
196
|
+
sm?: string | undefined;
|
|
197
|
+
md?: string | undefined;
|
|
198
|
+
lg?: string | undefined;
|
|
199
|
+
xl?: string | undefined;
|
|
200
|
+
} | undefined;
|
|
201
|
+
lineHeights?: {
|
|
202
|
+
[x: string & {}]: string | undefined;
|
|
203
|
+
xs?: string | undefined;
|
|
204
|
+
sm?: string | undefined;
|
|
205
|
+
md?: string | undefined;
|
|
206
|
+
lg?: string | undefined;
|
|
207
|
+
xl?: string | undefined;
|
|
208
|
+
} | undefined;
|
|
209
|
+
breakpoints?: {
|
|
210
|
+
[x: string & {}]: string | undefined;
|
|
211
|
+
xs?: string | undefined;
|
|
212
|
+
sm?: string | undefined;
|
|
213
|
+
md?: string | undefined;
|
|
214
|
+
lg?: string | undefined;
|
|
215
|
+
xl?: string | undefined;
|
|
216
|
+
} | undefined;
|
|
217
|
+
shadows?: {
|
|
218
|
+
[x: string & {}]: string | undefined;
|
|
219
|
+
xs?: string | undefined;
|
|
220
|
+
sm?: string | undefined;
|
|
221
|
+
md?: string | undefined;
|
|
222
|
+
lg?: string | undefined;
|
|
223
|
+
xl?: string | undefined;
|
|
224
|
+
} | undefined;
|
|
225
|
+
respectReducedMotion?: boolean | undefined;
|
|
226
|
+
cursorType?: "default" | "pointer" | undefined;
|
|
227
|
+
defaultGradient?: {
|
|
228
|
+
from?: string | undefined;
|
|
229
|
+
to?: string | undefined;
|
|
230
|
+
deg?: number | undefined;
|
|
231
|
+
} | undefined;
|
|
232
|
+
activeClassName?: string | undefined;
|
|
233
|
+
focusClassName?: string | undefined;
|
|
234
|
+
components?: {
|
|
235
|
+
[x: string]: {
|
|
236
|
+
classNames?: any;
|
|
237
|
+
styles?: any;
|
|
238
|
+
vars?: any;
|
|
239
|
+
defaultProps?: any;
|
|
240
|
+
} | undefined;
|
|
241
|
+
} | undefined;
|
|
242
|
+
other?: {
|
|
243
|
+
[x: string]: any;
|
|
244
|
+
} | undefined;
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* A section header with label for grouping related controls.
|
|
249
|
+
* Provides consistent Figma-style styling with separator lines.
|
|
250
|
+
* @param root0 - Component props
|
|
251
|
+
* @param root0.label - The label text for the group header
|
|
252
|
+
* @param root0.actions - Optional action buttons to display in the header
|
|
253
|
+
* @param root0.children - Child controls to render in the group
|
|
254
|
+
* @returns The control group component
|
|
255
|
+
*/
|
|
256
|
+
export declare function ControlGroup({ label, actions, children }: ControlGroupProps): default_2.JSX.Element;
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Props for the ControlGroup component.
|
|
260
|
+
*/
|
|
261
|
+
export declare interface ControlGroupProps {
|
|
262
|
+
/** Group label */
|
|
263
|
+
label: string;
|
|
264
|
+
/** Optional action buttons to display in the header */
|
|
265
|
+
actions?: ReactNode;
|
|
266
|
+
/** Group content */
|
|
267
|
+
children: ReactNode;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* A collapsible section for grouping related controls.
|
|
272
|
+
* Provides consistent Figma-style styling with toggle functionality.
|
|
273
|
+
*
|
|
274
|
+
* When hasConfiguredValues is true, shows a small indicator dot
|
|
275
|
+
* to visually highlight that the section contains explicitly set values.
|
|
276
|
+
* @param root0 - Component props
|
|
277
|
+
* @param root0.label - The label text for the section header
|
|
278
|
+
* @param root0.defaultOpen - Whether the section is open by default
|
|
279
|
+
* @param root0.children - Child controls to render in the section
|
|
280
|
+
* @param root0.hasConfiguredValues - Whether this section has configured values
|
|
281
|
+
* @returns The control section component
|
|
282
|
+
*/
|
|
283
|
+
export declare function ControlSection({ label, defaultOpen, children, hasConfiguredValues, }: ControlSectionProps): default_2.JSX.Element;
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Props for the ControlSection component.
|
|
287
|
+
*/
|
|
288
|
+
export declare interface ControlSectionProps {
|
|
289
|
+
/** Section label displayed in header */
|
|
290
|
+
label: string;
|
|
291
|
+
/** Whether section is expanded by default */
|
|
292
|
+
defaultOpen?: boolean;
|
|
293
|
+
/** Visual indicator that child values differ from defaults */
|
|
294
|
+
hasConfiguredValues?: boolean;
|
|
295
|
+
/** Section content */
|
|
296
|
+
children: ReactNode;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* A collapsible sub-section for grouping related advanced controls.
|
|
301
|
+
* Used for nested options like text effects, animation settings, etc.
|
|
302
|
+
* Provides a lighter visual weight than ControlSection.
|
|
303
|
+
* @param root0 - Component props
|
|
304
|
+
* @param root0.label - The label text for the sub-group header
|
|
305
|
+
* @param root0.defaultOpen - Whether the sub-group is open by default
|
|
306
|
+
* @param root0.children - Child controls to render in the sub-group
|
|
307
|
+
* @returns The control sub-group component
|
|
308
|
+
*/
|
|
309
|
+
export declare function ControlSubGroup({ label, defaultOpen, children }: ControlSubGroupProps): default_2.JSX.Element;
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Props for the ControlSubGroup component.
|
|
313
|
+
*/
|
|
314
|
+
export declare interface ControlSubGroupProps {
|
|
315
|
+
/** Group label */
|
|
316
|
+
label: string;
|
|
317
|
+
/** Whether group is expanded by default */
|
|
318
|
+
defaultOpen?: boolean;
|
|
319
|
+
/** Group content */
|
|
320
|
+
children: ReactNode;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Creates a new ColorStop with a unique ID.
|
|
325
|
+
* @param offset - The position of the stop (0-1)
|
|
326
|
+
* @param color - The color value in hex format
|
|
327
|
+
* @returns A new ColorStop with a unique ID
|
|
328
|
+
* @example
|
|
329
|
+
* const stop = createColorStop(0.5, '#ff0000');
|
|
330
|
+
* // { id: 'abc12345', offset: 0.5, color: '#ff0000' }
|
|
331
|
+
*/
|
|
332
|
+
export declare function createColorStop(offset: number, color: string): ColorStop;
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Creates default gradient stops for a new gradient configuration.
|
|
336
|
+
* @returns An array of two ColorStops (start and end)
|
|
337
|
+
*/
|
|
338
|
+
export declare function createDefaultGradientStops(): ColorStop[];
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Default color for new gradient stops.
|
|
342
|
+
*/
|
|
343
|
+
export declare const DEFAULT_GRADIENT_STOP_COLOR = "#888888";
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* A checkbox toggle that shows/hides child controls.
|
|
347
|
+
* Supports both controlled and uncontrolled modes.
|
|
348
|
+
* Used for enabling/disabling effects like glow and outline.
|
|
349
|
+
* Provides clean visual indent for child content.
|
|
350
|
+
* @param root0 - Component props
|
|
351
|
+
* @param root0.label - The label for the toggle checkbox
|
|
352
|
+
* @param root0.checked - Whether the toggle is checked (controlled mode)
|
|
353
|
+
* @param root0.defaultChecked - Default checked state for uncontrolled mode
|
|
354
|
+
* @param root0.onChange - Called when the toggle state changes (optional for uncontrolled mode)
|
|
355
|
+
* @param root0.children - Child controls to show when checked
|
|
356
|
+
* @returns The effect toggle component
|
|
357
|
+
*/
|
|
358
|
+
export declare function EffectToggle({ label, checked, defaultChecked, onChange, children, }: EffectToggleProps): default_2.JSX.Element;
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Props for EffectToggle component.
|
|
362
|
+
* Supports both controlled and uncontrolled modes via useUncontrolled pattern.
|
|
363
|
+
*/
|
|
364
|
+
export declare interface EffectToggleProps {
|
|
365
|
+
/** Checkbox label */
|
|
366
|
+
label: string;
|
|
367
|
+
/** Whether effect is enabled (controlled mode) */
|
|
368
|
+
checked?: boolean;
|
|
369
|
+
/** Default checked state for uncontrolled mode */
|
|
370
|
+
defaultChecked?: boolean;
|
|
371
|
+
/** Called when checked state changes (optional for uncontrolled mode) */
|
|
372
|
+
onChange?: (checked: boolean) => void;
|
|
373
|
+
/** Content shown when checked */
|
|
374
|
+
children: ReactNode;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Editor for gradient color stops with optional direction control.
|
|
379
|
+
* Supports both controlled and uncontrolled modes.
|
|
380
|
+
* Allows adding/removing color stops and adjusting their positions.
|
|
381
|
+
* @param root0 - Component props
|
|
382
|
+
* @param root0.stops - Array of color stops (controlled mode)
|
|
383
|
+
* @param root0.defaultStops - Default stops for uncontrolled mode
|
|
384
|
+
* @param root0.direction - Gradient direction in degrees (controlled mode)
|
|
385
|
+
* @param root0.defaultDirection - Default direction for uncontrolled mode
|
|
386
|
+
* @param root0.showDirection - Whether to show direction control
|
|
387
|
+
* @param root0.onChange - Called when stops or direction change (optional for uncontrolled mode)
|
|
388
|
+
* @returns The gradient editor component
|
|
389
|
+
*/
|
|
390
|
+
export declare function GradientEditor({ stops, defaultStops, direction, defaultDirection, showDirection, onChange, }: GradientEditorProps): default_2.JSX.Element;
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* Props for GradientEditor component.
|
|
394
|
+
* Supports both controlled and uncontrolled modes via useUncontrolled pattern.
|
|
395
|
+
*/
|
|
396
|
+
export declare interface GradientEditorProps {
|
|
397
|
+
/** Gradient color stops (controlled mode) */
|
|
398
|
+
stops?: ColorStop[];
|
|
399
|
+
/** Default stops for uncontrolled mode */
|
|
400
|
+
defaultStops?: ColorStop[];
|
|
401
|
+
/** Gradient direction in degrees (controlled mode) */
|
|
402
|
+
direction?: number;
|
|
403
|
+
/** Default direction for uncontrolled mode */
|
|
404
|
+
defaultDirection?: number;
|
|
405
|
+
/** Whether to show direction control */
|
|
406
|
+
showDirection?: boolean;
|
|
407
|
+
/** Called when stops or direction change (optional for uncontrolled mode) */
|
|
408
|
+
onChange?: (stops: ColorStop[], direction?: number) => void;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Check if a color string is valid hex format.
|
|
413
|
+
* @param color - Color string to validate
|
|
414
|
+
* @returns true if valid hex format (3, 4, 6, or 8 characters with optional #)
|
|
415
|
+
*/
|
|
416
|
+
export declare function isValidHex(color: string): boolean;
|
|
417
|
+
|
|
418
|
+
/**
|
|
419
|
+
* Mantine spacing values for consistent component spacing.
|
|
420
|
+
*/
|
|
421
|
+
export declare const MANTINE_SPACING: {
|
|
422
|
+
xs: string;
|
|
423
|
+
sm: string;
|
|
424
|
+
md: string;
|
|
425
|
+
lg: string;
|
|
426
|
+
xl: string;
|
|
427
|
+
};
|
|
428
|
+
|
|
429
|
+
/** Maximum value for hex alpha channel (0xFF = 255) */
|
|
430
|
+
export declare const MAX_ALPHA_HEX = 255;
|
|
431
|
+
|
|
432
|
+
/** Maximum opacity percentage value */
|
|
433
|
+
export declare const MAX_OPACITY_PERCENT = 100;
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* Converts an opacity percentage (0-100) to a hex alpha string (00-ff).
|
|
437
|
+
* @param opacity - Opacity as a percentage from 0 to 100
|
|
438
|
+
* @returns Two-character lowercase hex string representing alpha
|
|
439
|
+
* @example
|
|
440
|
+
* opacityToAlphaHex(100) // returns "ff"
|
|
441
|
+
* opacityToAlphaHex(50) // returns "80"
|
|
442
|
+
* opacityToAlphaHex(0) // returns "00"
|
|
443
|
+
*/
|
|
444
|
+
export declare function opacityToAlphaHex(opacity: number): string;
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* Converts a hex alpha string (00-FF) to an opacity percentage (0-100).
|
|
448
|
+
* @param alphaHex - Two-character hex string representing alpha (00-FF)
|
|
449
|
+
* @returns Opacity as a percentage from 0 to 100
|
|
450
|
+
* @example
|
|
451
|
+
* parseAlphaFromHexa("FF") // returns 100
|
|
452
|
+
* parseAlphaFromHexa("80") // returns ~50
|
|
453
|
+
* parseAlphaFromHexa("00") // returns 0
|
|
454
|
+
*/
|
|
455
|
+
export declare function parseAlphaFromHexa(alphaHex: string): number;
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* Parse HEXA color string (#RRGGBBAA) and extract RGB and opacity.
|
|
459
|
+
* @param hexa - Color string in hex or hexa format
|
|
460
|
+
* @returns Object with hex color and opacity percentage
|
|
461
|
+
*/
|
|
462
|
+
export declare function parseHexaColor(hexa: string): {
|
|
463
|
+
hex: string;
|
|
464
|
+
opacity: number;
|
|
465
|
+
};
|
|
466
|
+
|
|
467
|
+
export declare const Popout: typeof PopoutRoot & {
|
|
468
|
+
Trigger: typeof PopoutTrigger;
|
|
469
|
+
Panel: typeof PopoutPanel;
|
|
470
|
+
Content: typeof PopoutContent;
|
|
471
|
+
};
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* Gap in pixels between trigger and panel for root-level popouts.
|
|
475
|
+
*/
|
|
476
|
+
export declare const POPOUT_GAP = 8;
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* Gap in pixels between parent and child panels for nested popouts.
|
|
480
|
+
* Used in Phase 6 for nested popout hierarchies.
|
|
481
|
+
*/
|
|
482
|
+
export declare const POPOUT_NESTED_GAP = 4;
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Z-index base value for popout panels.
|
|
486
|
+
* Ensures popouts appear above other UI elements.
|
|
487
|
+
*/
|
|
488
|
+
export declare const POPOUT_Z_INDEX_BASE = 1000;
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* Alignment of the popout panel along the placement axis.
|
|
492
|
+
* - "start": Align to the start (top for left/right, left for top/bottom)
|
|
493
|
+
* - "center": Center along the axis
|
|
494
|
+
* - "end": Align to the end (bottom for left/right, right for top/bottom)
|
|
495
|
+
*/
|
|
496
|
+
declare type PopoutAlignment = "start" | "center" | "end";
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* Container for popout panel content.
|
|
500
|
+
* Provides consistent padding and styling for panel content.
|
|
501
|
+
* @param props - Component props
|
|
502
|
+
* @param props.children - Content to display in the panel
|
|
503
|
+
* @returns The PopoutContent component
|
|
504
|
+
*/
|
|
505
|
+
declare function PopoutContent({ children }: PopoutContentProps): JSX.Element;
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* Props for the PopoutContent component.
|
|
509
|
+
*/
|
|
510
|
+
export declare interface PopoutContentProps {
|
|
511
|
+
/** Content to display in the panel */
|
|
512
|
+
children: ReactNode;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* Context value for a single Popout instance.
|
|
517
|
+
*/
|
|
518
|
+
export declare interface PopoutContextValue {
|
|
519
|
+
/** Unique identifier for this popout */
|
|
520
|
+
id: string;
|
|
521
|
+
/** Whether the panel is currently open */
|
|
522
|
+
isOpen: boolean;
|
|
523
|
+
/** Opens the panel */
|
|
524
|
+
open: () => void;
|
|
525
|
+
/** Closes the panel */
|
|
526
|
+
close: () => void;
|
|
527
|
+
/** Toggles the panel open/closed */
|
|
528
|
+
toggle: () => void;
|
|
529
|
+
/** Reference to the trigger element for positioning */
|
|
530
|
+
triggerRef: React.RefObject<HTMLElement | null>;
|
|
531
|
+
/** ID of the parent popout (if nested inside another popout) */
|
|
532
|
+
parentId: string | null;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* Action button configuration for header actions.
|
|
537
|
+
*/
|
|
538
|
+
declare interface PopoutHeaderAction {
|
|
539
|
+
/** Unique identifier for the action */
|
|
540
|
+
id: string;
|
|
541
|
+
/** Icon element to display */
|
|
542
|
+
icon: ReactNode;
|
|
543
|
+
/** Accessible label for the action button */
|
|
544
|
+
label: string;
|
|
545
|
+
/** Callback when the action is clicked */
|
|
546
|
+
onClick: () => void;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* Header configuration for Popout panel.
|
|
551
|
+
* Supports "title" variant (simple text header) and "tabs" variant (tabbed interface).
|
|
552
|
+
*/
|
|
553
|
+
export declare type PopoutHeaderConfig = PopoutTitleHeaderConfig | PopoutTabbedHeaderConfig;
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* Props for the PopoutHeader component.
|
|
557
|
+
*/
|
|
558
|
+
export declare interface PopoutHeaderProps {
|
|
559
|
+
/** Header configuration */
|
|
560
|
+
config: PopoutHeaderConfig;
|
|
561
|
+
/** Called when close button is clicked */
|
|
562
|
+
onClose: () => void;
|
|
563
|
+
/** Props to apply to the drag handle area (Phase 2) */
|
|
564
|
+
dragTriggerProps?: Record<string, unknown>;
|
|
565
|
+
/** Action buttons to display in the header */
|
|
566
|
+
actions?: PopoutHeaderAction[];
|
|
567
|
+
/** Currently active tab ID (controlled by PopoutPanel for tabs variant) */
|
|
568
|
+
activeTab?: string;
|
|
569
|
+
/** Callback when active tab changes (controlled by PopoutPanel for tabs variant) */
|
|
570
|
+
onTabChange?: (tabId: string) => void;
|
|
571
|
+
/** ID for the title element (used for aria-labelledby) */
|
|
572
|
+
titleId?: string;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* Manages coordination between multiple Popout instances.
|
|
577
|
+
* Provides context for z-index management, click-outside handling,
|
|
578
|
+
* Escape key behavior, and hierarchy tracking (Phase 6).
|
|
579
|
+
* @param props - Component props
|
|
580
|
+
* @param props.children - Child components that may contain Popout instances
|
|
581
|
+
* @returns The PopoutManager component
|
|
582
|
+
*/
|
|
583
|
+
export declare function PopoutManager({ children }: PopoutManagerProps): JSX.Element;
|
|
584
|
+
|
|
585
|
+
/**
|
|
586
|
+
* Context value for the PopoutManager.
|
|
587
|
+
*/
|
|
588
|
+
export declare interface PopoutManagerContextValue {
|
|
589
|
+
/** Register a popout with the manager, providing a close callback and optional parent ID */
|
|
590
|
+
register: (id: string, closeCallback: () => void, parentId?: string | null) => void;
|
|
591
|
+
/** Unregister a popout from the manager */
|
|
592
|
+
unregister: (id: string) => void;
|
|
593
|
+
/** Get the current z-index for a popout */
|
|
594
|
+
getZIndex: (id: string) => number;
|
|
595
|
+
/** Bring a popout to the front (highest z-index) */
|
|
596
|
+
bringToFront: (id: string) => void;
|
|
597
|
+
/** Container element for portals - avoids assuming document.body */
|
|
598
|
+
portalContainer: HTMLElement | null;
|
|
599
|
+
/** Version counter that changes when z-index stack changes, for triggering re-renders */
|
|
600
|
+
zIndexVersion: number;
|
|
601
|
+
/** Close the focused (topmost) popout */
|
|
602
|
+
closeFocused: () => void;
|
|
603
|
+
/** Close all open popouts */
|
|
604
|
+
closeAll: () => void;
|
|
605
|
+
/** Check if there are any open popouts */
|
|
606
|
+
hasOpenPopouts: () => boolean;
|
|
607
|
+
/** Close a specific popout and all its descendants */
|
|
608
|
+
closeWithDescendants: (id: string) => void;
|
|
609
|
+
/** Close only descendants of a popout (not the popout itself) */
|
|
610
|
+
closeDescendants: (id: string) => void;
|
|
611
|
+
/** Close all siblings of a popout (same parent or both root-level). Also closes their descendants. */
|
|
612
|
+
closeSiblings: (id: string, parentId: string | null) => void;
|
|
613
|
+
/** Get the parent ID of a popout (null if root-level) */
|
|
614
|
+
getParentId: (id: string) => string | null;
|
|
615
|
+
/** Check if a popout is an ancestor of another popout */
|
|
616
|
+
isAncestor: (ancestorId: string, descendantId: string) => boolean;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* Props for PopoutManager.
|
|
621
|
+
*/
|
|
622
|
+
declare interface PopoutManagerProps {
|
|
623
|
+
/** Child components that may contain Popout instances */
|
|
624
|
+
children: ReactNode;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
/**
|
|
628
|
+
* The floating panel component that appears when the trigger is clicked.
|
|
629
|
+
* Renders in a portal to avoid z-index and overflow issues.
|
|
630
|
+
* Supports dragging via the header area.
|
|
631
|
+
* @param props - Component props
|
|
632
|
+
* @param props.width - The width of the panel in pixels
|
|
633
|
+
* @param props.height - Optional height of the panel in pixels (for alignment calculations)
|
|
634
|
+
* @param props.header - Header configuration for the panel
|
|
635
|
+
* @param props.children - Content to display in the panel
|
|
636
|
+
* @param props.anchorRef - Optional ref to anchor element for positioning (defaults to trigger)
|
|
637
|
+
* @param props.placement - Placement relative to anchor: left, right, top, bottom (default: left)
|
|
638
|
+
* @param props.alignment - Alignment along placement axis: start, center, end (default: start)
|
|
639
|
+
* @param props.gap - Gap between panel and anchor in pixels (default: 0 for pixel-perfect alignment)
|
|
640
|
+
* @param props.actions - Action buttons to display in the header
|
|
641
|
+
* @returns The PopoutPanel component or null when closed
|
|
642
|
+
*/
|
|
643
|
+
declare function PopoutPanel({ width, height, header, children, anchorRef, placement, alignment, gap, actions, }: PopoutPanelProps): ReactPortal | null;
|
|
644
|
+
|
|
645
|
+
/**
|
|
646
|
+
* Props for the PopoutPanel component.
|
|
647
|
+
*/
|
|
648
|
+
export declare interface PopoutPanelProps {
|
|
649
|
+
/** Width of the panel in pixels */
|
|
650
|
+
width: number;
|
|
651
|
+
/** Height of the panel in pixels (optional, for top/bottom placement alignment) */
|
|
652
|
+
height?: number;
|
|
653
|
+
/** Header configuration */
|
|
654
|
+
header: PopoutHeaderConfig;
|
|
655
|
+
/** Panel content */
|
|
656
|
+
children?: ReactNode;
|
|
657
|
+
/**
|
|
658
|
+
* Optional ref to an anchor element for positioning.
|
|
659
|
+
* If not provided, the panel positions relative to the trigger.
|
|
660
|
+
*/
|
|
661
|
+
anchorRef?: RefObject<HTMLElement | null>;
|
|
662
|
+
/**
|
|
663
|
+
* Placement of the panel relative to the anchor.
|
|
664
|
+
* @default "left"
|
|
665
|
+
*/
|
|
666
|
+
placement?: PopoutPlacement;
|
|
667
|
+
/**
|
|
668
|
+
* Alignment along the placement axis.
|
|
669
|
+
* @default "start"
|
|
670
|
+
*/
|
|
671
|
+
alignment?: PopoutAlignment;
|
|
672
|
+
/**
|
|
673
|
+
* Gap between the panel and anchor element in pixels.
|
|
674
|
+
* Set to 0 for pixel-perfect edge alignment.
|
|
675
|
+
* @default 0
|
|
676
|
+
*/
|
|
677
|
+
gap?: number;
|
|
678
|
+
/**
|
|
679
|
+
* Action buttons to display in the header.
|
|
680
|
+
*/
|
|
681
|
+
actions?: PopoutHeaderAction[];
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
/**
|
|
685
|
+
* Placement of the popout panel relative to the anchor element.
|
|
686
|
+
*/
|
|
687
|
+
declare type PopoutPlacement = "left" | "right" | "top" | "bottom";
|
|
688
|
+
|
|
689
|
+
/**
|
|
690
|
+
* Position for a popout panel relative to its trigger.
|
|
691
|
+
*/
|
|
692
|
+
export declare interface PopoutPosition {
|
|
693
|
+
/** Left position in pixels */
|
|
694
|
+
left: number;
|
|
695
|
+
/** Top position in pixels */
|
|
696
|
+
top: number;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
/**
|
|
700
|
+
* Props for the Popout compound component.
|
|
701
|
+
*/
|
|
702
|
+
declare interface PopoutProps {
|
|
703
|
+
/** Child components (Popout.Trigger, Popout.Panel) */
|
|
704
|
+
children: ReactNode;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
/**
|
|
708
|
+
* Compound component for creating floating pop-out panels.
|
|
709
|
+
* Follows the Figma-style floating panel pattern.
|
|
710
|
+
* Automatically detects when nested inside another Popout for hierarchy tracking.
|
|
711
|
+
*
|
|
712
|
+
* Usage:
|
|
713
|
+
* ```tsx
|
|
714
|
+
* <PopoutManager>
|
|
715
|
+
* <Popout>
|
|
716
|
+
* <Popout.Trigger>
|
|
717
|
+
* <Button>Open</Button>
|
|
718
|
+
* </Popout.Trigger>
|
|
719
|
+
* <Popout.Panel width={280} header={{ variant: "title", title: "Settings" }}>
|
|
720
|
+
* <Popout.Content>
|
|
721
|
+
* Panel content here
|
|
722
|
+
* </Popout.Content>
|
|
723
|
+
* </Popout.Panel>
|
|
724
|
+
* </Popout>
|
|
725
|
+
* </PopoutManager>
|
|
726
|
+
* ```
|
|
727
|
+
* @param props - Component props
|
|
728
|
+
* @param props.children - Child components (Popout.Trigger, Popout.Panel)
|
|
729
|
+
* @returns The Popout compound component
|
|
730
|
+
*/
|
|
731
|
+
declare function PopoutRoot({ children }: PopoutProps): JSX.Element;
|
|
732
|
+
|
|
733
|
+
/**
|
|
734
|
+
* Individual tab configuration for tabbed header variant.
|
|
735
|
+
*/
|
|
736
|
+
declare interface PopoutTab {
|
|
737
|
+
/** Unique identifier for the tab */
|
|
738
|
+
id: string;
|
|
739
|
+
/** Label displayed on the tab button */
|
|
740
|
+
label: string;
|
|
741
|
+
/** Content to display when this tab is active */
|
|
742
|
+
content: ReactNode;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
/**
|
|
746
|
+
* Tabbed header configuration.
|
|
747
|
+
*/
|
|
748
|
+
declare interface PopoutTabbedHeaderConfig {
|
|
749
|
+
/** Header variant - tabs shows a tabbed interface */
|
|
750
|
+
variant: "tabs";
|
|
751
|
+
/** Array of tab configurations */
|
|
752
|
+
tabs: PopoutTab[];
|
|
753
|
+
/** ID of the default active tab (defaults to first tab) */
|
|
754
|
+
defaultTab?: string;
|
|
755
|
+
/** Callback when tab changes */
|
|
756
|
+
onTabChange?: (tabId: string) => void;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
/**
|
|
760
|
+
* Title header configuration.
|
|
761
|
+
*/
|
|
762
|
+
declare interface PopoutTitleHeaderConfig {
|
|
763
|
+
/** Header variant - title shows a simple text header */
|
|
764
|
+
variant: "title";
|
|
765
|
+
/** Title text displayed in the header */
|
|
766
|
+
title: string;
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
/**
|
|
770
|
+
* Wrapper component for the popout trigger element.
|
|
771
|
+
* Attaches click handler, ref, and ARIA attributes to the child element.
|
|
772
|
+
* @param props - Component props
|
|
773
|
+
* @param props.children - The trigger element (typically a button or icon)
|
|
774
|
+
* @returns The PopoutTrigger component
|
|
775
|
+
*/
|
|
776
|
+
declare function PopoutTrigger({ children }: PopoutTriggerProps): JSX.Element;
|
|
777
|
+
|
|
778
|
+
/**
|
|
779
|
+
* Props for the PopoutTrigger component.
|
|
780
|
+
*/
|
|
781
|
+
export declare interface PopoutTriggerProps {
|
|
782
|
+
/** Trigger element (typically a button or icon) */
|
|
783
|
+
children: ReactNode;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
/**
|
|
787
|
+
* A label-value pair component for displaying statistics.
|
|
788
|
+
* Shows the label on the left and value on the right with appropriate styling.
|
|
789
|
+
* @param root0 - Component props
|
|
790
|
+
* @param root0.label - Label for the statistic
|
|
791
|
+
* @param root0.value - Value to display (can be string or number)
|
|
792
|
+
* @returns The stat row component
|
|
793
|
+
*/
|
|
794
|
+
export declare function StatRow({ label, value }: StatRowProps): default_2.JSX.Element;
|
|
795
|
+
|
|
796
|
+
/**
|
|
797
|
+
* Props for StatRow component.
|
|
798
|
+
*/
|
|
799
|
+
export declare interface StatRowProps {
|
|
800
|
+
/** Label text */
|
|
801
|
+
label: string;
|
|
802
|
+
/** Value to display */
|
|
803
|
+
value: string | number;
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
/**
|
|
807
|
+
* A number input that distinguishes between default and explicit values.
|
|
808
|
+
* Supports both controlled and uncontrolled modes.
|
|
809
|
+
*
|
|
810
|
+
* Features:
|
|
811
|
+
* - Shows muted/italic styling when using default value (value is undefined)
|
|
812
|
+
* - Shows normal styling when an explicit value is set
|
|
813
|
+
* - Shows a reset button (x) only when an explicit value is set
|
|
814
|
+
* - Clicking reset calls onChange(undefined) to revert to default
|
|
815
|
+
* @param root0 - Component props
|
|
816
|
+
* @param root0.label - Label for the input
|
|
817
|
+
* @param root0.value - Current value - undefined means using default (controlled mode)
|
|
818
|
+
* @param root0.defaultValue - Default value to show when value is undefined
|
|
819
|
+
* @param root0.onChange - Called when value changes (optional for uncontrolled mode)
|
|
820
|
+
* @param root0.min - Minimum allowed value
|
|
821
|
+
* @param root0.max - Maximum allowed value
|
|
822
|
+
* @param root0.step - Step increment
|
|
823
|
+
* @param root0.decimalScale - Number of decimal places
|
|
824
|
+
* @param root0.suffix - Suffix to display
|
|
825
|
+
* @param root0.hideControls - Whether to hide the spinner controls
|
|
826
|
+
* @returns The style number input component
|
|
827
|
+
*/
|
|
828
|
+
export declare function StyleNumberInput({ label, value, defaultValue, onChange, min, max, step, decimalScale, suffix, hideControls, }: StyleNumberInputProps): default_2.JSX.Element;
|
|
829
|
+
|
|
830
|
+
/**
|
|
831
|
+
* Props for StyleNumberInput component.
|
|
832
|
+
* Supports both controlled and uncontrolled modes via useUncontrolled pattern.
|
|
833
|
+
*/
|
|
834
|
+
export declare interface StyleNumberInputProps {
|
|
835
|
+
/** Label for the input (also used for aria-label) */
|
|
836
|
+
label: string;
|
|
837
|
+
/** Current value - undefined means using default (controlled mode) */
|
|
838
|
+
value?: number | undefined;
|
|
839
|
+
/** Default value to show when value is undefined */
|
|
840
|
+
defaultValue: number;
|
|
841
|
+
/** Called when value changes (optional for uncontrolled mode) */
|
|
842
|
+
onChange?: (value: number | undefined) => void;
|
|
843
|
+
/** Minimum allowed value */
|
|
844
|
+
min?: number;
|
|
845
|
+
/** Maximum allowed value */
|
|
846
|
+
max?: number;
|
|
847
|
+
/** Step increment */
|
|
848
|
+
step?: number;
|
|
849
|
+
/** Number of decimal places */
|
|
850
|
+
decimalScale?: number;
|
|
851
|
+
/** Suffix to display (e.g., "%") */
|
|
852
|
+
suffix?: string;
|
|
853
|
+
/** Whether to hide the spinner controls */
|
|
854
|
+
hideControls?: boolean;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
/**
|
|
858
|
+
* A select input that distinguishes between default and explicit values.
|
|
859
|
+
* Supports both controlled and uncontrolled modes.
|
|
860
|
+
*
|
|
861
|
+
* Features:
|
|
862
|
+
* - Shows muted styling when using default value (value is undefined)
|
|
863
|
+
* - Shows normal styling when an explicit value is set
|
|
864
|
+
* - Shows a reset button (x) only when an explicit value is set
|
|
865
|
+
* - Clicking reset calls onChange(undefined) to revert to default
|
|
866
|
+
* @param root0 - Component props
|
|
867
|
+
* @param root0.label - Label for the select
|
|
868
|
+
* @param root0.value - Current value - undefined means using default (controlled mode)
|
|
869
|
+
* @param root0.defaultValue - Default value to show when value is undefined
|
|
870
|
+
* @param root0.options - Available options
|
|
871
|
+
* @param root0.onChange - Called when value changes (optional for uncontrolled mode)
|
|
872
|
+
* @returns The style select component
|
|
873
|
+
*/
|
|
874
|
+
export declare function StyleSelect({ label, value, defaultValue, options, onChange }: StyleSelectProps): default_2.JSX.Element;
|
|
875
|
+
|
|
876
|
+
/**
|
|
877
|
+
* Option type for StyleSelect component.
|
|
878
|
+
*/
|
|
879
|
+
export declare interface StyleSelectOption {
|
|
880
|
+
value: string;
|
|
881
|
+
label: string;
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
/**
|
|
885
|
+
* Props for StyleSelect component.
|
|
886
|
+
* Supports both controlled and uncontrolled modes via useUncontrolled pattern.
|
|
887
|
+
*/
|
|
888
|
+
export declare interface StyleSelectProps {
|
|
889
|
+
/** Label for the select (also used for aria-label) */
|
|
890
|
+
label: string;
|
|
891
|
+
/** Current value - undefined means using default (controlled mode) */
|
|
892
|
+
value?: string | undefined;
|
|
893
|
+
/** Default value to show when value is undefined */
|
|
894
|
+
defaultValue: string;
|
|
895
|
+
/** Available options */
|
|
896
|
+
options: StyleSelectOption[];
|
|
897
|
+
/** Called when value changes (optional for uncontrolled mode) */
|
|
898
|
+
onChange?: (value: string | undefined) => void;
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
/**
|
|
902
|
+
* Standard color swatches for color pickers throughout the application.
|
|
903
|
+
* Used by CompactColorInput and GradientEditor.
|
|
904
|
+
*/
|
|
905
|
+
export declare const SWATCH_COLORS: readonly ["#5B8FF9", "#FF6B6B", "#61D095", "#F7B731", "#9B59B6"];
|
|
906
|
+
|
|
907
|
+
/**
|
|
908
|
+
* Swatches with alpha channel for HEXA color pickers.
|
|
909
|
+
* Includes both fully opaque (FF) and semi-transparent (80) variants.
|
|
910
|
+
*/
|
|
911
|
+
export declare const SWATCH_COLORS_HEXA: readonly ["#5B8FF9FF", "#FF6B6BFF", "#61D095FF", "#F7B731FF", "#9B59B6FF", "#5B8FF980", "#FF6B6B80", "#61D09580", "#F7B73180", "#9B59B680"];
|
|
912
|
+
|
|
913
|
+
/**
|
|
914
|
+
* Convert RGB hex and opacity to HEXA format.
|
|
915
|
+
* @param hex - Color in hex format (#RRGGBB)
|
|
916
|
+
* @param opacity - Opacity percentage (0-100)
|
|
917
|
+
* @returns Color in HEXA format (#RRGGBBAA)
|
|
918
|
+
*/
|
|
919
|
+
export declare function toHexaColor(hex: string, opacity: number): string;
|
|
920
|
+
|
|
921
|
+
/**
|
|
922
|
+
* Hook to get the actual resolved color scheme.
|
|
923
|
+
* Resolves "auto" to the actual light/dark value based on system preference.
|
|
924
|
+
* @returns "light" | "dark"
|
|
925
|
+
*/
|
|
926
|
+
export declare function useActualColorScheme(): "light" | "dark";
|
|
927
|
+
|
|
928
|
+
export declare const VERSION = "0.1.0";
|
|
929
|
+
|
|
930
|
+
export { }
|