@kushagradhawan/kookie-ui 0.1.69 → 0.1.71
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/cjs/components/_internal/shell-bottom.d.ts +2 -21
- package/dist/cjs/components/_internal/shell-bottom.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-bottom.js +1 -1
- package/dist/cjs/components/_internal/shell-bottom.js.map +3 -3
- package/dist/cjs/components/_internal/shell-inspector.d.ts +10 -21
- package/dist/cjs/components/_internal/shell-inspector.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-inspector.js +1 -1
- package/dist/cjs/components/_internal/shell-inspector.js.map +3 -3
- package/dist/cjs/components/_internal/shell-prop-helpers.d.ts +7 -0
- package/dist/cjs/components/_internal/shell-prop-helpers.d.ts.map +1 -0
- package/dist/cjs/components/_internal/shell-prop-helpers.js +2 -0
- package/dist/cjs/components/_internal/shell-prop-helpers.js.map +7 -0
- package/dist/cjs/components/_internal/shell-sidebar.d.ts +4 -21
- package/dist/cjs/components/_internal/shell-sidebar.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-sidebar.js +1 -1
- package/dist/cjs/components/_internal/shell-sidebar.js.map +3 -3
- package/dist/cjs/components/chatbar.d.ts +12 -3
- package/dist/cjs/components/chatbar.d.ts.map +1 -1
- package/dist/cjs/components/chatbar.js +1 -1
- package/dist/cjs/components/chatbar.js.map +3 -3
- package/dist/cjs/components/schemas/shell.schema.d.ts +70 -70
- package/dist/cjs/components/shell.context.d.ts +1 -0
- package/dist/cjs/components/shell.context.d.ts.map +1 -1
- package/dist/cjs/components/shell.context.js.map +2 -2
- package/dist/cjs/components/shell.d.ts +6 -26
- package/dist/cjs/components/shell.d.ts.map +1 -1
- package/dist/cjs/components/shell.hooks.d.ts +19 -2
- package/dist/cjs/components/shell.hooks.d.ts.map +1 -1
- package/dist/cjs/components/shell.hooks.js +1 -1
- package/dist/cjs/components/shell.hooks.js.map +3 -3
- package/dist/cjs/components/shell.js +1 -1
- package/dist/cjs/components/shell.js.map +3 -3
- package/dist/cjs/components/shell.types.d.ts +21 -0
- package/dist/cjs/components/shell.types.d.ts.map +1 -1
- package/dist/cjs/components/shell.types.js +1 -1
- package/dist/cjs/components/shell.types.js.map +2 -2
- package/dist/esm/components/_internal/shell-bottom.d.ts +2 -21
- package/dist/esm/components/_internal/shell-bottom.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-bottom.js +1 -1
- package/dist/esm/components/_internal/shell-bottom.js.map +3 -3
- package/dist/esm/components/_internal/shell-inspector.d.ts +10 -21
- package/dist/esm/components/_internal/shell-inspector.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-inspector.js +1 -1
- package/dist/esm/components/_internal/shell-inspector.js.map +3 -3
- package/dist/esm/components/_internal/shell-prop-helpers.d.ts +7 -0
- package/dist/esm/components/_internal/shell-prop-helpers.d.ts.map +1 -0
- package/dist/esm/components/_internal/shell-prop-helpers.js +2 -0
- package/dist/esm/components/_internal/shell-prop-helpers.js.map +7 -0
- package/dist/esm/components/_internal/shell-sidebar.d.ts +4 -21
- package/dist/esm/components/_internal/shell-sidebar.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-sidebar.js +1 -1
- package/dist/esm/components/_internal/shell-sidebar.js.map +3 -3
- package/dist/esm/components/chatbar.d.ts +12 -3
- package/dist/esm/components/chatbar.d.ts.map +1 -1
- package/dist/esm/components/chatbar.js +1 -1
- package/dist/esm/components/chatbar.js.map +3 -3
- package/dist/esm/components/schemas/shell.schema.d.ts +70 -70
- package/dist/esm/components/shell.context.d.ts +1 -0
- package/dist/esm/components/shell.context.d.ts.map +1 -1
- package/dist/esm/components/shell.context.js.map +2 -2
- package/dist/esm/components/shell.d.ts +6 -26
- package/dist/esm/components/shell.d.ts.map +1 -1
- package/dist/esm/components/shell.hooks.d.ts +19 -2
- package/dist/esm/components/shell.hooks.d.ts.map +1 -1
- package/dist/esm/components/shell.hooks.js +1 -1
- package/dist/esm/components/shell.hooks.js.map +3 -3
- package/dist/esm/components/shell.js +1 -1
- package/dist/esm/components/shell.js.map +3 -3
- package/dist/esm/components/shell.types.d.ts +21 -0
- package/dist/esm/components/shell.types.d.ts.map +1 -1
- package/dist/esm/components/shell.types.js.map +2 -2
- package/package.json +1 -1
- package/schemas/base-button.json +1 -1
- package/schemas/button.json +1 -1
- package/schemas/icon-button.json +1 -1
- package/schemas/index.json +6 -6
- package/schemas/toggle-button.json +1 -1
- package/schemas/toggle-icon-button.json +1 -1
- package/src/components/_internal/shell-bottom.tsx +305 -321
- package/src/components/_internal/shell-inspector.tsx +310 -320
- package/src/components/_internal/shell-prop-helpers.ts +53 -0
- package/src/components/_internal/shell-sidebar.tsx +370 -384
- package/src/components/chatbar.tsx +22 -6
- package/src/components/shell.context.tsx +1 -0
- package/src/components/shell.hooks.ts +67 -2
- package/src/components/shell.tsx +186 -200
- package/src/components/shell.types.ts +23 -0
|
@@ -210,6 +210,8 @@ export declare const ShellRailSchema: z.ZodObject<{
|
|
|
210
210
|
} | undefined;
|
|
211
211
|
collapsible?: boolean | undefined;
|
|
212
212
|
mode?: "expanded" | "collapsed" | undefined;
|
|
213
|
+
onExpand?: ((...args: unknown[]) => void) | undefined;
|
|
214
|
+
onCollapse?: ((...args: unknown[]) => void) | undefined;
|
|
213
215
|
defaultMode?: "expanded" | "collapsed" | {
|
|
214
216
|
initial?: "expanded" | "collapsed" | undefined;
|
|
215
217
|
xs?: "expanded" | "collapsed" | undefined;
|
|
@@ -219,8 +221,6 @@ export declare const ShellRailSchema: z.ZodObject<{
|
|
|
219
221
|
xl?: "expanded" | "collapsed" | undefined;
|
|
220
222
|
} | undefined;
|
|
221
223
|
onModeChange?: ((args_0: "expanded" | "collapsed", ...args: unknown[]) => void) | undefined;
|
|
222
|
-
onExpand?: ((...args: unknown[]) => void) | undefined;
|
|
223
|
-
onCollapse?: ((...args: unknown[]) => void) | undefined;
|
|
224
224
|
}, {
|
|
225
225
|
className?: string | undefined;
|
|
226
226
|
style?: Record<string, string | number> | undefined;
|
|
@@ -235,6 +235,9 @@ export declare const ShellRailSchema: z.ZodObject<{
|
|
|
235
235
|
} | undefined;
|
|
236
236
|
collapsible?: boolean | undefined;
|
|
237
237
|
mode?: "expanded" | "collapsed" | undefined;
|
|
238
|
+
expandedSize?: number | undefined;
|
|
239
|
+
onExpand?: ((...args: unknown[]) => void) | undefined;
|
|
240
|
+
onCollapse?: ((...args: unknown[]) => void) | undefined;
|
|
238
241
|
defaultMode?: "expanded" | "collapsed" | {
|
|
239
242
|
initial?: "expanded" | "collapsed" | undefined;
|
|
240
243
|
xs?: "expanded" | "collapsed" | undefined;
|
|
@@ -244,9 +247,6 @@ export declare const ShellRailSchema: z.ZodObject<{
|
|
|
244
247
|
xl?: "expanded" | "collapsed" | undefined;
|
|
245
248
|
} | undefined;
|
|
246
249
|
onModeChange?: ((args_0: "expanded" | "collapsed", ...args: unknown[]) => void) | undefined;
|
|
247
|
-
expandedSize?: number | undefined;
|
|
248
|
-
onExpand?: ((...args: unknown[]) => void) | undefined;
|
|
249
|
-
onCollapse?: ((...args: unknown[]) => void) | undefined;
|
|
250
250
|
}>;
|
|
251
251
|
/**
|
|
252
252
|
* Shell.Panel component schema
|
|
@@ -329,9 +329,9 @@ export declare const ShellPanelSchema: z.ZodObject<{
|
|
|
329
329
|
collapsible: z.ZodDefault<z.ZodBoolean>;
|
|
330
330
|
}, "strict", z.ZodTypeAny, {
|
|
331
331
|
collapsible: boolean;
|
|
332
|
+
expandedSize: number;
|
|
332
333
|
minSize: number;
|
|
333
334
|
maxSize: number;
|
|
334
|
-
expandedSize: number;
|
|
335
335
|
resizable: boolean;
|
|
336
336
|
className?: string | undefined;
|
|
337
337
|
style?: Record<string, string | number> | undefined;
|
|
@@ -347,11 +347,18 @@ export declare const ShellPanelSchema: z.ZodObject<{
|
|
|
347
347
|
} | undefined;
|
|
348
348
|
mode?: "expanded" | "collapsed" | undefined;
|
|
349
349
|
onResize?: ((args_0: number, ...args: unknown[]) => void) | undefined;
|
|
350
|
+
onExpand?: ((...args: unknown[]) => void) | undefined;
|
|
351
|
+
onCollapse?: ((...args: unknown[]) => void) | undefined;
|
|
350
352
|
onResizeStart?: ((args_0: number, ...args: unknown[]) => void) | undefined;
|
|
351
353
|
onResizeEnd?: ((args_0: number, ...args: unknown[]) => void) | undefined;
|
|
352
354
|
snapPoints?: number[] | undefined;
|
|
353
355
|
snapTolerance?: number | undefined;
|
|
354
356
|
collapseThreshold?: number | undefined;
|
|
357
|
+
paneId?: string | undefined;
|
|
358
|
+
persistence?: {
|
|
359
|
+
load?: ((...args: unknown[]) => number | Promise<number> | undefined) | undefined;
|
|
360
|
+
save?: ((args_0: number, ...args: unknown[]) => void | Promise<void>) | undefined;
|
|
361
|
+
} | undefined;
|
|
355
362
|
defaultMode?: "expanded" | "collapsed" | {
|
|
356
363
|
initial?: "expanded" | "collapsed" | undefined;
|
|
357
364
|
xs?: "expanded" | "collapsed" | undefined;
|
|
@@ -361,13 +368,6 @@ export declare const ShellPanelSchema: z.ZodObject<{
|
|
|
361
368
|
xl?: "expanded" | "collapsed" | undefined;
|
|
362
369
|
} | undefined;
|
|
363
370
|
onModeChange?: ((args_0: "expanded" | "collapsed", ...args: unknown[]) => void) | undefined;
|
|
364
|
-
onExpand?: ((...args: unknown[]) => void) | undefined;
|
|
365
|
-
onCollapse?: ((...args: unknown[]) => void) | undefined;
|
|
366
|
-
paneId?: string | undefined;
|
|
367
|
-
persistence?: {
|
|
368
|
-
load?: ((...args: unknown[]) => number | Promise<number> | undefined) | undefined;
|
|
369
|
-
save?: ((args_0: number, ...args: unknown[]) => void | Promise<void>) | undefined;
|
|
370
|
-
} | undefined;
|
|
371
371
|
}, {
|
|
372
372
|
className?: string | undefined;
|
|
373
373
|
style?: Record<string, string | number> | undefined;
|
|
@@ -384,13 +384,22 @@ export declare const ShellPanelSchema: z.ZodObject<{
|
|
|
384
384
|
collapsible?: boolean | undefined;
|
|
385
385
|
mode?: "expanded" | "collapsed" | undefined;
|
|
386
386
|
onResize?: ((args_0: number, ...args: unknown[]) => void) | undefined;
|
|
387
|
+
expandedSize?: number | undefined;
|
|
387
388
|
minSize?: number | undefined;
|
|
388
389
|
maxSize?: number | undefined;
|
|
390
|
+
resizable?: boolean | undefined;
|
|
391
|
+
onExpand?: ((...args: unknown[]) => void) | undefined;
|
|
392
|
+
onCollapse?: ((...args: unknown[]) => void) | undefined;
|
|
389
393
|
onResizeStart?: ((args_0: number, ...args: unknown[]) => void) | undefined;
|
|
390
394
|
onResizeEnd?: ((args_0: number, ...args: unknown[]) => void) | undefined;
|
|
391
395
|
snapPoints?: number[] | undefined;
|
|
392
396
|
snapTolerance?: number | undefined;
|
|
393
397
|
collapseThreshold?: number | undefined;
|
|
398
|
+
paneId?: string | undefined;
|
|
399
|
+
persistence?: {
|
|
400
|
+
load?: ((...args: unknown[]) => number | Promise<number> | undefined) | undefined;
|
|
401
|
+
save?: ((args_0: number, ...args: unknown[]) => void | Promise<void>) | undefined;
|
|
402
|
+
} | undefined;
|
|
394
403
|
defaultMode?: "expanded" | "collapsed" | {
|
|
395
404
|
initial?: "expanded" | "collapsed" | undefined;
|
|
396
405
|
xs?: "expanded" | "collapsed" | undefined;
|
|
@@ -400,15 +409,6 @@ export declare const ShellPanelSchema: z.ZodObject<{
|
|
|
400
409
|
xl?: "expanded" | "collapsed" | undefined;
|
|
401
410
|
} | undefined;
|
|
402
411
|
onModeChange?: ((args_0: "expanded" | "collapsed", ...args: unknown[]) => void) | undefined;
|
|
403
|
-
expandedSize?: number | undefined;
|
|
404
|
-
resizable?: boolean | undefined;
|
|
405
|
-
onExpand?: ((...args: unknown[]) => void) | undefined;
|
|
406
|
-
onCollapse?: ((...args: unknown[]) => void) | undefined;
|
|
407
|
-
paneId?: string | undefined;
|
|
408
|
-
persistence?: {
|
|
409
|
-
load?: ((...args: unknown[]) => number | Promise<number> | undefined) | undefined;
|
|
410
|
-
save?: ((args_0: number, ...args: unknown[]) => void | Promise<void>) | undefined;
|
|
411
|
-
} | undefined;
|
|
412
412
|
}>;
|
|
413
413
|
/**
|
|
414
414
|
* Shell.Sidebar component schema
|
|
@@ -493,8 +493,10 @@ export declare const ShellSidebarSchema: z.ZodObject<{
|
|
|
493
493
|
collapsible: z.ZodDefault<z.ZodBoolean>;
|
|
494
494
|
}, "strict", z.ZodTypeAny, {
|
|
495
495
|
collapsible: boolean;
|
|
496
|
+
expandedSize: number;
|
|
496
497
|
minSize: number;
|
|
497
498
|
maxSize: number;
|
|
499
|
+
resizable: boolean;
|
|
498
500
|
defaultMode: "thin" | "expanded" | "collapsed" | {
|
|
499
501
|
initial?: "thin" | "expanded" | "collapsed" | undefined;
|
|
500
502
|
xs?: "thin" | "expanded" | "collapsed" | undefined;
|
|
@@ -503,8 +505,6 @@ export declare const ShellSidebarSchema: z.ZodObject<{
|
|
|
503
505
|
lg?: "thin" | "expanded" | "collapsed" | undefined;
|
|
504
506
|
xl?: "thin" | "expanded" | "collapsed" | undefined;
|
|
505
507
|
};
|
|
506
|
-
expandedSize: number;
|
|
507
|
-
resizable: boolean;
|
|
508
508
|
thinSize: number;
|
|
509
509
|
className?: string | undefined;
|
|
510
510
|
style?: Record<string, string | number> | undefined;
|
|
@@ -520,19 +520,19 @@ export declare const ShellSidebarSchema: z.ZodObject<{
|
|
|
520
520
|
} | undefined;
|
|
521
521
|
mode?: "thin" | "expanded" | "collapsed" | undefined;
|
|
522
522
|
onResize?: ((args_0: number, ...args: unknown[]) => void) | undefined;
|
|
523
|
+
onExpand?: ((...args: unknown[]) => void) | undefined;
|
|
524
|
+
onCollapse?: ((...args: unknown[]) => void) | undefined;
|
|
523
525
|
onResizeStart?: ((args_0: number, ...args: unknown[]) => void) | undefined;
|
|
524
526
|
onResizeEnd?: ((args_0: number, ...args: unknown[]) => void) | undefined;
|
|
525
527
|
snapPoints?: number[] | undefined;
|
|
526
528
|
snapTolerance?: number | undefined;
|
|
527
529
|
collapseThreshold?: number | undefined;
|
|
528
|
-
onModeChange?: ((args_0: "expanded" | "collapsed", ...args: unknown[]) => void) | undefined;
|
|
529
|
-
onExpand?: ((...args: unknown[]) => void) | undefined;
|
|
530
|
-
onCollapse?: ((...args: unknown[]) => void) | undefined;
|
|
531
530
|
paneId?: string | undefined;
|
|
532
531
|
persistence?: {
|
|
533
532
|
load?: ((...args: unknown[]) => number | Promise<number> | undefined) | undefined;
|
|
534
533
|
save?: ((args_0: number, ...args: unknown[]) => void | Promise<void>) | undefined;
|
|
535
534
|
} | undefined;
|
|
535
|
+
onModeChange?: ((args_0: "expanded" | "collapsed", ...args: unknown[]) => void) | undefined;
|
|
536
536
|
toggleModes?: "both" | "single" | undefined;
|
|
537
537
|
}, {
|
|
538
538
|
className?: string | undefined;
|
|
@@ -550,13 +550,22 @@ export declare const ShellSidebarSchema: z.ZodObject<{
|
|
|
550
550
|
collapsible?: boolean | undefined;
|
|
551
551
|
mode?: "thin" | "expanded" | "collapsed" | undefined;
|
|
552
552
|
onResize?: ((args_0: number, ...args: unknown[]) => void) | undefined;
|
|
553
|
+
expandedSize?: number | undefined;
|
|
553
554
|
minSize?: number | undefined;
|
|
554
555
|
maxSize?: number | undefined;
|
|
556
|
+
resizable?: boolean | undefined;
|
|
557
|
+
onExpand?: ((...args: unknown[]) => void) | undefined;
|
|
558
|
+
onCollapse?: ((...args: unknown[]) => void) | undefined;
|
|
555
559
|
onResizeStart?: ((args_0: number, ...args: unknown[]) => void) | undefined;
|
|
556
560
|
onResizeEnd?: ((args_0: number, ...args: unknown[]) => void) | undefined;
|
|
557
561
|
snapPoints?: number[] | undefined;
|
|
558
562
|
snapTolerance?: number | undefined;
|
|
559
563
|
collapseThreshold?: number | undefined;
|
|
564
|
+
paneId?: string | undefined;
|
|
565
|
+
persistence?: {
|
|
566
|
+
load?: ((...args: unknown[]) => number | Promise<number> | undefined) | undefined;
|
|
567
|
+
save?: ((args_0: number, ...args: unknown[]) => void | Promise<void>) | undefined;
|
|
568
|
+
} | undefined;
|
|
560
569
|
defaultMode?: "thin" | "expanded" | "collapsed" | {
|
|
561
570
|
initial?: "thin" | "expanded" | "collapsed" | undefined;
|
|
562
571
|
xs?: "thin" | "expanded" | "collapsed" | undefined;
|
|
@@ -566,15 +575,6 @@ export declare const ShellSidebarSchema: z.ZodObject<{
|
|
|
566
575
|
xl?: "thin" | "expanded" | "collapsed" | undefined;
|
|
567
576
|
} | undefined;
|
|
568
577
|
onModeChange?: ((args_0: "expanded" | "collapsed", ...args: unknown[]) => void) | undefined;
|
|
569
|
-
expandedSize?: number | undefined;
|
|
570
|
-
resizable?: boolean | undefined;
|
|
571
|
-
onExpand?: ((...args: unknown[]) => void) | undefined;
|
|
572
|
-
onCollapse?: ((...args: unknown[]) => void) | undefined;
|
|
573
|
-
paneId?: string | undefined;
|
|
574
|
-
persistence?: {
|
|
575
|
-
load?: ((...args: unknown[]) => number | Promise<number> | undefined) | undefined;
|
|
576
|
-
save?: ((args_0: number, ...args: unknown[]) => void | Promise<void>) | undefined;
|
|
577
|
-
} | undefined;
|
|
578
578
|
thinSize?: number | undefined;
|
|
579
579
|
toggleModes?: "both" | "single" | undefined;
|
|
580
580
|
}>;
|
|
@@ -683,9 +683,9 @@ export declare const ShellInspectorSchema: z.ZodObject<{
|
|
|
683
683
|
xl?: "fixed" | "overlay" | "stacked" | undefined;
|
|
684
684
|
};
|
|
685
685
|
collapsible: boolean;
|
|
686
|
+
expandedSize: number;
|
|
686
687
|
minSize: number;
|
|
687
688
|
maxSize: number;
|
|
688
|
-
expandedSize: number;
|
|
689
689
|
resizable: boolean;
|
|
690
690
|
className?: string | undefined;
|
|
691
691
|
style?: Record<string, string | number> | undefined;
|
|
@@ -693,11 +693,18 @@ export declare const ShellInspectorSchema: z.ZodObject<{
|
|
|
693
693
|
children?: any;
|
|
694
694
|
mode?: "expanded" | "collapsed" | undefined;
|
|
695
695
|
onResize?: ((args_0: number, ...args: unknown[]) => void) | undefined;
|
|
696
|
+
onExpand?: ((...args: unknown[]) => void) | undefined;
|
|
697
|
+
onCollapse?: ((...args: unknown[]) => void) | undefined;
|
|
696
698
|
onResizeStart?: ((args_0: number, ...args: unknown[]) => void) | undefined;
|
|
697
699
|
onResizeEnd?: ((args_0: number, ...args: unknown[]) => void) | undefined;
|
|
698
700
|
snapPoints?: number[] | undefined;
|
|
699
701
|
snapTolerance?: number | undefined;
|
|
700
702
|
collapseThreshold?: number | undefined;
|
|
703
|
+
paneId?: string | undefined;
|
|
704
|
+
persistence?: {
|
|
705
|
+
load?: ((...args: unknown[]) => number | Promise<number> | undefined) | undefined;
|
|
706
|
+
save?: ((args_0: number, ...args: unknown[]) => void | Promise<void>) | undefined;
|
|
707
|
+
} | undefined;
|
|
701
708
|
defaultMode?: "expanded" | "collapsed" | {
|
|
702
709
|
initial?: "expanded" | "collapsed" | undefined;
|
|
703
710
|
xs?: "expanded" | "collapsed" | undefined;
|
|
@@ -707,13 +714,6 @@ export declare const ShellInspectorSchema: z.ZodObject<{
|
|
|
707
714
|
xl?: "expanded" | "collapsed" | undefined;
|
|
708
715
|
} | undefined;
|
|
709
716
|
onModeChange?: ((args_0: "expanded" | "collapsed", ...args: unknown[]) => void) | undefined;
|
|
710
|
-
onExpand?: ((...args: unknown[]) => void) | undefined;
|
|
711
|
-
onCollapse?: ((...args: unknown[]) => void) | undefined;
|
|
712
|
-
paneId?: string | undefined;
|
|
713
|
-
persistence?: {
|
|
714
|
-
load?: ((...args: unknown[]) => number | Promise<number> | undefined) | undefined;
|
|
715
|
-
save?: ((args_0: number, ...args: unknown[]) => void | Promise<void>) | undefined;
|
|
716
|
-
} | undefined;
|
|
717
717
|
}, {
|
|
718
718
|
className?: string | undefined;
|
|
719
719
|
style?: Record<string, string | number> | undefined;
|
|
@@ -730,13 +730,22 @@ export declare const ShellInspectorSchema: z.ZodObject<{
|
|
|
730
730
|
collapsible?: boolean | undefined;
|
|
731
731
|
mode?: "expanded" | "collapsed" | undefined;
|
|
732
732
|
onResize?: ((args_0: number, ...args: unknown[]) => void) | undefined;
|
|
733
|
+
expandedSize?: number | undefined;
|
|
733
734
|
minSize?: number | undefined;
|
|
734
735
|
maxSize?: number | undefined;
|
|
736
|
+
resizable?: boolean | undefined;
|
|
737
|
+
onExpand?: ((...args: unknown[]) => void) | undefined;
|
|
738
|
+
onCollapse?: ((...args: unknown[]) => void) | undefined;
|
|
735
739
|
onResizeStart?: ((args_0: number, ...args: unknown[]) => void) | undefined;
|
|
736
740
|
onResizeEnd?: ((args_0: number, ...args: unknown[]) => void) | undefined;
|
|
737
741
|
snapPoints?: number[] | undefined;
|
|
738
742
|
snapTolerance?: number | undefined;
|
|
739
743
|
collapseThreshold?: number | undefined;
|
|
744
|
+
paneId?: string | undefined;
|
|
745
|
+
persistence?: {
|
|
746
|
+
load?: ((...args: unknown[]) => number | Promise<number> | undefined) | undefined;
|
|
747
|
+
save?: ((args_0: number, ...args: unknown[]) => void | Promise<void>) | undefined;
|
|
748
|
+
} | undefined;
|
|
740
749
|
defaultMode?: "expanded" | "collapsed" | {
|
|
741
750
|
initial?: "expanded" | "collapsed" | undefined;
|
|
742
751
|
xs?: "expanded" | "collapsed" | undefined;
|
|
@@ -746,15 +755,6 @@ export declare const ShellInspectorSchema: z.ZodObject<{
|
|
|
746
755
|
xl?: "expanded" | "collapsed" | undefined;
|
|
747
756
|
} | undefined;
|
|
748
757
|
onModeChange?: ((args_0: "expanded" | "collapsed", ...args: unknown[]) => void) | undefined;
|
|
749
|
-
expandedSize?: number | undefined;
|
|
750
|
-
resizable?: boolean | undefined;
|
|
751
|
-
onExpand?: ((...args: unknown[]) => void) | undefined;
|
|
752
|
-
onCollapse?: ((...args: unknown[]) => void) | undefined;
|
|
753
|
-
paneId?: string | undefined;
|
|
754
|
-
persistence?: {
|
|
755
|
-
load?: ((...args: unknown[]) => number | Promise<number> | undefined) | undefined;
|
|
756
|
-
save?: ((args_0: number, ...args: unknown[]) => void | Promise<void>) | undefined;
|
|
757
|
-
} | undefined;
|
|
758
758
|
}>;
|
|
759
759
|
/**
|
|
760
760
|
* Shell.Bottom component schema
|
|
@@ -845,9 +845,9 @@ export declare const ShellBottomSchema: z.ZodObject<{
|
|
|
845
845
|
xl?: "fixed" | "overlay" | "stacked" | undefined;
|
|
846
846
|
};
|
|
847
847
|
collapsible: boolean;
|
|
848
|
+
expandedSize: number;
|
|
848
849
|
minSize: number;
|
|
849
850
|
maxSize: number;
|
|
850
|
-
expandedSize: number;
|
|
851
851
|
resizable: boolean;
|
|
852
852
|
className?: string | undefined;
|
|
853
853
|
style?: Record<string, string | number> | undefined;
|
|
@@ -855,11 +855,18 @@ export declare const ShellBottomSchema: z.ZodObject<{
|
|
|
855
855
|
children?: any;
|
|
856
856
|
mode?: "expanded" | "collapsed" | undefined;
|
|
857
857
|
onResize?: ((args_0: number, ...args: unknown[]) => void) | undefined;
|
|
858
|
+
onExpand?: ((...args: unknown[]) => void) | undefined;
|
|
859
|
+
onCollapse?: ((...args: unknown[]) => void) | undefined;
|
|
858
860
|
onResizeStart?: ((args_0: number, ...args: unknown[]) => void) | undefined;
|
|
859
861
|
onResizeEnd?: ((args_0: number, ...args: unknown[]) => void) | undefined;
|
|
860
862
|
snapPoints?: number[] | undefined;
|
|
861
863
|
snapTolerance?: number | undefined;
|
|
862
864
|
collapseThreshold?: number | undefined;
|
|
865
|
+
paneId?: string | undefined;
|
|
866
|
+
persistence?: {
|
|
867
|
+
load?: ((...args: unknown[]) => number | Promise<number> | undefined) | undefined;
|
|
868
|
+
save?: ((args_0: number, ...args: unknown[]) => void | Promise<void>) | undefined;
|
|
869
|
+
} | undefined;
|
|
863
870
|
defaultMode?: "expanded" | "collapsed" | {
|
|
864
871
|
initial?: "expanded" | "collapsed" | undefined;
|
|
865
872
|
xs?: "expanded" | "collapsed" | undefined;
|
|
@@ -869,13 +876,6 @@ export declare const ShellBottomSchema: z.ZodObject<{
|
|
|
869
876
|
xl?: "expanded" | "collapsed" | undefined;
|
|
870
877
|
} | undefined;
|
|
871
878
|
onModeChange?: ((args_0: "expanded" | "collapsed", ...args: unknown[]) => void) | undefined;
|
|
872
|
-
onExpand?: ((...args: unknown[]) => void) | undefined;
|
|
873
|
-
onCollapse?: ((...args: unknown[]) => void) | undefined;
|
|
874
|
-
paneId?: string | undefined;
|
|
875
|
-
persistence?: {
|
|
876
|
-
load?: ((...args: unknown[]) => number | Promise<number> | undefined) | undefined;
|
|
877
|
-
save?: ((args_0: number, ...args: unknown[]) => void | Promise<void>) | undefined;
|
|
878
|
-
} | undefined;
|
|
879
879
|
}, {
|
|
880
880
|
className?: string | undefined;
|
|
881
881
|
style?: Record<string, string | number> | undefined;
|
|
@@ -892,13 +892,22 @@ export declare const ShellBottomSchema: z.ZodObject<{
|
|
|
892
892
|
collapsible?: boolean | undefined;
|
|
893
893
|
mode?: "expanded" | "collapsed" | undefined;
|
|
894
894
|
onResize?: ((args_0: number, ...args: unknown[]) => void) | undefined;
|
|
895
|
+
expandedSize?: number | undefined;
|
|
895
896
|
minSize?: number | undefined;
|
|
896
897
|
maxSize?: number | undefined;
|
|
898
|
+
resizable?: boolean | undefined;
|
|
899
|
+
onExpand?: ((...args: unknown[]) => void) | undefined;
|
|
900
|
+
onCollapse?: ((...args: unknown[]) => void) | undefined;
|
|
897
901
|
onResizeStart?: ((args_0: number, ...args: unknown[]) => void) | undefined;
|
|
898
902
|
onResizeEnd?: ((args_0: number, ...args: unknown[]) => void) | undefined;
|
|
899
903
|
snapPoints?: number[] | undefined;
|
|
900
904
|
snapTolerance?: number | undefined;
|
|
901
905
|
collapseThreshold?: number | undefined;
|
|
906
|
+
paneId?: string | undefined;
|
|
907
|
+
persistence?: {
|
|
908
|
+
load?: ((...args: unknown[]) => number | Promise<number> | undefined) | undefined;
|
|
909
|
+
save?: ((args_0: number, ...args: unknown[]) => void | Promise<void>) | undefined;
|
|
910
|
+
} | undefined;
|
|
902
911
|
defaultMode?: "expanded" | "collapsed" | {
|
|
903
912
|
initial?: "expanded" | "collapsed" | undefined;
|
|
904
913
|
xs?: "expanded" | "collapsed" | undefined;
|
|
@@ -908,15 +917,6 @@ export declare const ShellBottomSchema: z.ZodObject<{
|
|
|
908
917
|
xl?: "expanded" | "collapsed" | undefined;
|
|
909
918
|
} | undefined;
|
|
910
919
|
onModeChange?: ((args_0: "expanded" | "collapsed", ...args: unknown[]) => void) | undefined;
|
|
911
|
-
expandedSize?: number | undefined;
|
|
912
|
-
resizable?: boolean | undefined;
|
|
913
|
-
onExpand?: ((...args: unknown[]) => void) | undefined;
|
|
914
|
-
onCollapse?: ((...args: unknown[]) => void) | undefined;
|
|
915
|
-
paneId?: string | undefined;
|
|
916
|
-
persistence?: {
|
|
917
|
-
load?: ((...args: unknown[]) => number | Promise<number> | undefined) | undefined;
|
|
918
|
-
save?: ((args_0: number, ...args: unknown[]) => void | Promise<void>) | undefined;
|
|
919
|
-
} | undefined;
|
|
920
920
|
}>;
|
|
921
921
|
/**
|
|
922
922
|
* Shell.Trigger component schema
|
|
@@ -29,6 +29,7 @@ export interface ShellContextValue {
|
|
|
29
29
|
onLeftPres?: (p: PresentationValue) => void;
|
|
30
30
|
onLeftDefaults?: (size: number) => void;
|
|
31
31
|
}
|
|
32
|
+
/** @internal Shell root context. Prefer slice hooks (useSidebarMode, useShellActions, etc.). */
|
|
32
33
|
export declare function useShell(): ShellContextValue;
|
|
33
34
|
export declare function ShellProvider({ value, children }: {
|
|
34
35
|
value: ShellContextValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell.context.d.ts","sourceRoot":"","sources":["../../../src/components/shell.context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEzG,MAAM,WAAW,iBAAiB;IAEhC,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACtC,SAAS,EAA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OAAO;gBAAc,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI;gBAAc,OAAO;mBAAiB,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI;SAAuB,CAAC;AAC5L,wBAAgB,cAAc;aADmC,OAAO;gBAAc,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI;gBAAc,OAAO;mBAAiB,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI;EAKnK"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/shell.context.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nimport type { Breakpoint, PresentationValue, SidebarMode, PaneMode, PaneTarget } from './shell.types.js';\n\nexport interface ShellContextValue {\n // Pane states\n leftMode: PaneMode;\n setLeftMode: (mode: PaneMode) => void;\n panelMode: PaneMode; // Panel state within left container\n setPanelMode: (mode: PaneMode) => void;\n sidebarMode: SidebarMode;\n setSidebarMode: (mode: SidebarMode) => void;\n inspectorMode: PaneMode;\n setInspectorMode: (mode: PaneMode) => void;\n bottomMode: PaneMode;\n setBottomMode: (mode: PaneMode) => void;\n\n // Peek state (layout-only, ephemeral)\n peekTarget: PaneTarget | null;\n setPeekTarget: (target: PaneTarget | null) => void;\n peekPane: (target: PaneTarget) => void;\n clearPeek: () => void;\n\n // Composition detection\n hasLeft: boolean;\n setHasLeft: (has: boolean) => void;\n hasSidebar: boolean;\n setHasSidebar: (has: boolean) => void;\n\n // Presentation resolution\n currentBreakpoint: Breakpoint;\n currentBreakpointReady: boolean;\n leftResolvedPresentation?: PresentationValue;\n\n // Actions\n togglePane: (target: PaneTarget) => void;\n expandPane: (target: PaneTarget) => void;\n collapsePane: (target: PaneTarget) => void;\n // Toggle customization\n setSidebarToggleComputer?: (fn: (current: SidebarMode) => SidebarMode) => void;\n // Dev-only hooks for presentation warnings\n onLeftPres?: (p: PresentationValue) => void;\n // Sizing info for overlay grouping\n onLeftDefaults?: (size: number) => void;\n}\n\nconst ShellContext = React.createContext<ShellContextValue | null>(null);\n\nexport function useShell() {\n const ctx = React.useContext(ShellContext);\n if (!ctx) throw new Error('Shell components must be used within <Shell.Root>');\n return ctx;\n}\n\nexport function ShellProvider({ value, children }: { value: ShellContextValue; children: React.ReactNode }) {\n return <ShellContext.Provider value={value}>{children}</ShellContext.Provider>;\n}\n\n// Phase 7: Split contexts for render isolation\n\n// Pane mode slice contexts\ntype ModeSetter<T> = (mode: T) => void;\n\nexport const LeftModeContext = React.createContext<{ leftMode: PaneMode; setLeftMode: ModeSetter<PaneMode> } | null>(null as any);\nexport function useLeftMode() {\n const ctx = React.useContext(LeftModeContext);\n if (!ctx) throw new Error('useLeftMode must be used within Shell.Root');\n return ctx;\n}\n\nexport const PanelModeContext = React.createContext<{ panelMode: PaneMode; setPanelMode: ModeSetter<PaneMode> } | null>(null as any);\nexport function usePanelMode() {\n const ctx = React.useContext(PanelModeContext);\n if (!ctx) throw new Error('usePanelMode must be used within Shell.Root');\n return ctx;\n}\n\nexport const SidebarModeContext = React.createContext<{ sidebarMode: SidebarMode; setSidebarMode: ModeSetter<SidebarMode> } | null>(null as any);\nexport function useSidebarMode() {\n const ctx = React.useContext(SidebarModeContext);\n if (!ctx) throw new Error('useSidebarMode must be used within Shell.Root');\n return ctx;\n}\n\nexport const InspectorModeContext = React.createContext<{ inspectorMode: PaneMode; setInspectorMode: ModeSetter<PaneMode> } | null>(null as any);\nexport function useInspectorMode() {\n const ctx = React.useContext(InspectorModeContext);\n if (!ctx) throw new Error('useInspectorMode must be used within Shell.Root');\n return ctx;\n}\n\nexport const BottomModeContext = React.createContext<{ bottomMode: PaneMode; setBottomMode: ModeSetter<PaneMode> } | null>(null as any);\nexport function useBottomMode() {\n const ctx = React.useContext(BottomModeContext);\n if (!ctx) throw new Error('useBottomMode must be used within Shell.Root');\n return ctx;\n}\n\n// Presentation slice\nexport const PresentationContext = React.createContext<{ currentBreakpoint: Breakpoint; currentBreakpointReady: boolean; leftResolvedPresentation?: PresentationValue } | null>(null as any);\nexport function usePresentation() {\n const ctx = React.useContext(PresentationContext);\n if (!ctx) throw new Error('usePresentation must be used within Shell.Root');\n return ctx;\n}\n\n// Peek slice\nexport const PeekContext = React.createContext<{ peekTarget: PaneTarget | null; setPeekTarget: (t: PaneTarget | null) => void; peekPane: (t: PaneTarget) => void; clearPeek: () => void } | null>(\n null as any,\n);\nexport function usePeek() {\n const ctx = React.useContext(PeekContext);\n if (!ctx) throw new Error('usePeek must be used within Shell.Root');\n return ctx;\n}\n\n// Actions slice (stable callbacks)\nexport const ActionsContext = React.createContext<{\n togglePane: (t: PaneTarget) => void;\n expandPane: (t: PaneTarget) => void;\n collapsePane: (t: PaneTarget) => void;\n setSidebarToggleComputer?: (fn: (current: SidebarMode) => SidebarMode) => void;\n} | null>(null as any);\nexport function useShellActions() {\n const ctx = React.useContext(ActionsContext);\n if (!ctx) throw new Error('useShellActions must be used within Shell.Root');\n return ctx;\n}\n\n// Composition slice\nexport const CompositionContext = React.createContext<{ hasLeft: boolean; setHasLeft: (v: boolean) => void; hasSidebar: boolean; setHasSidebar: (v: boolean) => void } | null>(null as any);\nexport function useComposition() {\n const ctx = React.useContext(CompositionContext);\n if (!ctx) throw new Error('useComposition must be used within Shell.Root');\n return ctx;\n}\n"],
|
|
5
|
-
"mappings": "AAAA,UAAYA,MAAW,QA6CvB,MAAMC,EAAeD,EAAM,cAAwC,IAAI,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport type { Breakpoint, PresentationValue, SidebarMode, PaneMode, PaneTarget } from './shell.types.js';\n\nexport interface ShellContextValue {\n // Pane states\n leftMode: PaneMode;\n setLeftMode: (mode: PaneMode) => void;\n panelMode: PaneMode; // Panel state within left container\n setPanelMode: (mode: PaneMode) => void;\n sidebarMode: SidebarMode;\n setSidebarMode: (mode: SidebarMode) => void;\n inspectorMode: PaneMode;\n setInspectorMode: (mode: PaneMode) => void;\n bottomMode: PaneMode;\n setBottomMode: (mode: PaneMode) => void;\n\n // Peek state (layout-only, ephemeral)\n peekTarget: PaneTarget | null;\n setPeekTarget: (target: PaneTarget | null) => void;\n peekPane: (target: PaneTarget) => void;\n clearPeek: () => void;\n\n // Composition detection\n hasLeft: boolean;\n setHasLeft: (has: boolean) => void;\n hasSidebar: boolean;\n setHasSidebar: (has: boolean) => void;\n\n // Presentation resolution\n currentBreakpoint: Breakpoint;\n currentBreakpointReady: boolean;\n leftResolvedPresentation?: PresentationValue;\n\n // Actions\n togglePane: (target: PaneTarget) => void;\n expandPane: (target: PaneTarget) => void;\n collapsePane: (target: PaneTarget) => void;\n // Toggle customization\n setSidebarToggleComputer?: (fn: (current: SidebarMode) => SidebarMode) => void;\n // Dev-only hooks for presentation warnings\n onLeftPres?: (p: PresentationValue) => void;\n // Sizing info for overlay grouping\n onLeftDefaults?: (size: number) => void;\n}\n\nconst ShellContext = React.createContext<ShellContextValue | null>(null);\n\n/** @internal Shell root context. Prefer slice hooks (useSidebarMode, useShellActions, etc.). */\nexport function useShell() {\n const ctx = React.useContext(ShellContext);\n if (!ctx) throw new Error('Shell components must be used within <Shell.Root>');\n return ctx;\n}\n\nexport function ShellProvider({ value, children }: { value: ShellContextValue; children: React.ReactNode }) {\n return <ShellContext.Provider value={value}>{children}</ShellContext.Provider>;\n}\n\n// Phase 7: Split contexts for render isolation\n\n// Pane mode slice contexts\ntype ModeSetter<T> = (mode: T) => void;\n\nexport const LeftModeContext = React.createContext<{ leftMode: PaneMode; setLeftMode: ModeSetter<PaneMode> } | null>(null as any);\nexport function useLeftMode() {\n const ctx = React.useContext(LeftModeContext);\n if (!ctx) throw new Error('useLeftMode must be used within Shell.Root');\n return ctx;\n}\n\nexport const PanelModeContext = React.createContext<{ panelMode: PaneMode; setPanelMode: ModeSetter<PaneMode> } | null>(null as any);\nexport function usePanelMode() {\n const ctx = React.useContext(PanelModeContext);\n if (!ctx) throw new Error('usePanelMode must be used within Shell.Root');\n return ctx;\n}\n\nexport const SidebarModeContext = React.createContext<{ sidebarMode: SidebarMode; setSidebarMode: ModeSetter<SidebarMode> } | null>(null as any);\nexport function useSidebarMode() {\n const ctx = React.useContext(SidebarModeContext);\n if (!ctx) throw new Error('useSidebarMode must be used within Shell.Root');\n return ctx;\n}\n\nexport const InspectorModeContext = React.createContext<{ inspectorMode: PaneMode; setInspectorMode: ModeSetter<PaneMode> } | null>(null as any);\nexport function useInspectorMode() {\n const ctx = React.useContext(InspectorModeContext);\n if (!ctx) throw new Error('useInspectorMode must be used within Shell.Root');\n return ctx;\n}\n\nexport const BottomModeContext = React.createContext<{ bottomMode: PaneMode; setBottomMode: ModeSetter<PaneMode> } | null>(null as any);\nexport function useBottomMode() {\n const ctx = React.useContext(BottomModeContext);\n if (!ctx) throw new Error('useBottomMode must be used within Shell.Root');\n return ctx;\n}\n\n// Presentation slice\nexport const PresentationContext = React.createContext<{ currentBreakpoint: Breakpoint; currentBreakpointReady: boolean; leftResolvedPresentation?: PresentationValue } | null>(null as any);\nexport function usePresentation() {\n const ctx = React.useContext(PresentationContext);\n if (!ctx) throw new Error('usePresentation must be used within Shell.Root');\n return ctx;\n}\n\n// Peek slice\nexport const PeekContext = React.createContext<{ peekTarget: PaneTarget | null; setPeekTarget: (t: PaneTarget | null) => void; peekPane: (t: PaneTarget) => void; clearPeek: () => void } | null>(\n null as any,\n);\nexport function usePeek() {\n const ctx = React.useContext(PeekContext);\n if (!ctx) throw new Error('usePeek must be used within Shell.Root');\n return ctx;\n}\n\n// Actions slice (stable callbacks)\nexport const ActionsContext = React.createContext<{\n togglePane: (t: PaneTarget) => void;\n expandPane: (t: PaneTarget) => void;\n collapsePane: (t: PaneTarget) => void;\n setSidebarToggleComputer?: (fn: (current: SidebarMode) => SidebarMode) => void;\n} | null>(null as any);\nexport function useShellActions() {\n const ctx = React.useContext(ActionsContext);\n if (!ctx) throw new Error('useShellActions must be used within Shell.Root');\n return ctx;\n}\n\n// Composition slice\nexport const CompositionContext = React.createContext<{ hasLeft: boolean; setHasLeft: (v: boolean) => void; hasSidebar: boolean; setHasSidebar: (v: boolean) => void } | null>(null as any);\nexport function useComposition() {\n const ctx = React.useContext(CompositionContext);\n if (!ctx) throw new Error('useComposition must be used within Shell.Root');\n return ctx;\n}\n"],
|
|
5
|
+
"mappings": "AAAA,UAAYA,MAAW,QA6CvB,MAAMC,EAAeD,EAAM,cAAwC,IAAI,EAGhE,SAASE,GAAW,CACzB,MAAMC,EAAMH,EAAM,WAAWC,CAAY,EACzC,GAAI,CAACE,EAAK,MAAM,IAAI,MAAM,mDAAmD,EAC7E,OAAOA,CACT,CAEO,SAASC,EAAc,CAAE,MAAAC,EAAO,SAAAC,CAAS,EAA4D,CAC1G,OAAON,EAAA,cAACC,EAAa,SAAb,CAAsB,MAAOI,GAAQC,CAAS,CACxD,CAOO,MAAMC,EAAkBP,EAAM,cAAgF,IAAW,EACzH,SAASQ,GAAc,CAC5B,MAAML,EAAMH,EAAM,WAAWO,CAAe,EAC5C,GAAI,CAACJ,EAAK,MAAM,IAAI,MAAM,4CAA4C,EACtE,OAAOA,CACT,CAEO,MAAMM,EAAmBT,EAAM,cAAkF,IAAW,EAC5H,SAASU,GAAe,CAC7B,MAAMP,EAAMH,EAAM,WAAWS,CAAgB,EAC7C,GAAI,CAACN,EAAK,MAAM,IAAI,MAAM,6CAA6C,EACvE,OAAOA,CACT,CAEO,MAAMQ,EAAqBX,EAAM,cAA4F,IAAW,EACxI,SAASY,GAAiB,CAC/B,MAAMT,EAAMH,EAAM,WAAWW,CAAkB,EAC/C,GAAI,CAACR,EAAK,MAAM,IAAI,MAAM,+CAA+C,EACzE,OAAOA,CACT,CAEO,MAAMU,EAAuBb,EAAM,cAA0F,IAAW,EACxI,SAASc,GAAmB,CACjC,MAAMX,EAAMH,EAAM,WAAWa,CAAoB,EACjD,GAAI,CAACV,EAAK,MAAM,IAAI,MAAM,iDAAiD,EAC3E,OAAOA,CACT,CAEO,MAAMY,EAAoBf,EAAM,cAAoF,IAAW,EAC/H,SAASgB,GAAgB,CAC9B,MAAMb,EAAMH,EAAM,WAAWe,CAAiB,EAC9C,GAAI,CAACZ,EAAK,MAAM,IAAI,MAAM,8CAA8C,EACxE,OAAOA,CACT,CAGO,MAAMc,EAAsBjB,EAAM,cAAuI,IAAW,EACpL,SAASkB,GAAkB,CAChC,MAAMf,EAAMH,EAAM,WAAWiB,CAAmB,EAChD,GAAI,CAACd,EAAK,MAAM,IAAI,MAAM,gDAAgD,EAC1E,OAAOA,CACT,CAGO,MAAMgB,EAAcnB,EAAM,cAC/B,IACF,EACO,SAASoB,GAAU,CACxB,MAAMjB,EAAMH,EAAM,WAAWmB,CAAW,EACxC,GAAI,CAAChB,EAAK,MAAM,IAAI,MAAM,wCAAwC,EAClE,OAAOA,CACT,CAGO,MAAMkB,EAAiBrB,EAAM,cAK1B,IAAW,EACd,SAASsB,GAAkB,CAChC,MAAMnB,EAAMH,EAAM,WAAWqB,CAAc,EAC3C,GAAI,CAAClB,EAAK,MAAM,IAAI,MAAM,gDAAgD,EAC1E,OAAOA,CACT,CAGO,MAAMoB,EAAqBvB,EAAM,cAAuI,IAAW,EACnL,SAASwB,GAAiB,CAC/B,MAAMrB,EAAMH,EAAM,WAAWuB,CAAkB,EAC/C,GAAI,CAACpB,EAAK,MAAM,IAAI,MAAM,+CAA+C,EACzE,OAAOA,CACT",
|
|
6
6
|
"names": ["React", "ShellContext", "useShell", "ctx", "ShellProvider", "value", "children", "LeftModeContext", "useLeftMode", "PanelModeContext", "usePanelMode", "SidebarModeContext", "useSidebarMode", "InspectorModeContext", "useInspectorMode", "BottomModeContext", "useBottomMode", "PresentationContext", "usePresentation", "PeekContext", "usePeek", "ActionsContext", "useShellActions", "CompositionContext", "useComposition"]
|
|
7
7
|
}
|
|
@@ -3,37 +3,14 @@ import { useResponsivePresentation } from './shell.hooks.js';
|
|
|
3
3
|
import { Sidebar } from './_internal/shell-sidebar.js';
|
|
4
4
|
import { Bottom } from './_internal/shell-bottom.js';
|
|
5
5
|
import { Inspector } from './_internal/shell-inspector.js';
|
|
6
|
-
import type { ResponsivePresentation, PaneMode, SidebarMode,
|
|
6
|
+
import type { ResponsivePresentation, PaneMode, SidebarMode, PaneTarget, PaneBaseProps } from './shell.types.js';
|
|
7
7
|
import { useShell } from './shell.context.js';
|
|
8
|
-
|
|
9
|
-
children: React.ReactNode;
|
|
10
|
-
height?: 'full' | 'auto' | string | number;
|
|
11
|
-
}
|
|
12
|
-
declare const Root: React.ForwardRefExoticComponent<ShellRootProps & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const Root: PanelComponent;
|
|
13
9
|
interface ShellHeaderProps extends React.ComponentPropsWithoutRef<'header'> {
|
|
14
10
|
height?: number;
|
|
15
11
|
}
|
|
16
12
|
declare const Header: React.ForwardRefExoticComponent<ShellHeaderProps & React.RefAttributes<HTMLElement>>;
|
|
17
|
-
|
|
18
|
-
presentation?: ResponsivePresentation;
|
|
19
|
-
expandedSize?: number;
|
|
20
|
-
minSize?: number;
|
|
21
|
-
maxSize?: number;
|
|
22
|
-
resizable?: boolean;
|
|
23
|
-
collapsible?: boolean;
|
|
24
|
-
onExpand?: () => void;
|
|
25
|
-
onCollapse?: () => void;
|
|
26
|
-
onResize?: (size: number) => void;
|
|
27
|
-
/** Optional custom content inside the resizer handle (kept unstyled). */
|
|
28
|
-
resizer?: React.ReactNode;
|
|
29
|
-
onResizeStart?: (size: number) => void;
|
|
30
|
-
onResizeEnd?: (size: number) => void;
|
|
31
|
-
snapPoints?: number[];
|
|
32
|
-
snapTolerance?: number;
|
|
33
|
-
collapseThreshold?: number;
|
|
34
|
-
paneId?: string;
|
|
35
|
-
persistence?: PaneSizePersistence;
|
|
36
|
-
}
|
|
13
|
+
type PaneProps = PaneBaseProps;
|
|
37
14
|
interface LeftProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
38
15
|
presentation?: ResponsivePresentation;
|
|
39
16
|
open?: boolean;
|
|
@@ -44,6 +21,9 @@ interface LeftProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
|
44
21
|
collapsible?: boolean;
|
|
45
22
|
onExpand?: () => void;
|
|
46
23
|
onCollapse?: () => void;
|
|
24
|
+
mode?: never;
|
|
25
|
+
defaultMode?: never;
|
|
26
|
+
onModeChange?: never;
|
|
47
27
|
}
|
|
48
28
|
type LeftOpenChangeMeta = {
|
|
49
29
|
reason: 'init' | 'toggle' | 'responsive' | 'panel';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../../src/components/shell.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,yBAAyB,
|
|
1
|
+
{"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../../src/components/shell.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,yBAAyB,EAA6B,MAAM,kBAAkB,CAAC;AAIxF,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,KAAK,EAAqB,sBAAsB,EAAE,QAAQ,EAAE,WAAW,EAAmC,UAAU,EAAc,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjL,OAAO,EAEL,QAAQ,EAUT,MAAM,oBAAoB,CAAC;AA2M5B,QAAA,MAAM,IAAI,EA4QJ,cAAc,CAAC;AAIrB,UAAU,gBAAiB,SAAQ,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC;IACzE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,QAAA,MAAM,MAAM,sFAUV,CAAC;AAIH,KAAK,SAAS,GAAG,aAAa,CAAC;AAG/B,UAAU,SAAU,SAAQ,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC;IAC/D,YAAY,CAAC,EAAE,sBAAsB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C,GAC/C,CAAC,wBAAwB,GAAG,0BAA0B,CAAC,GAAG;IACxD,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACjE,UAAU,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IACrC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AACJ,KAAK,cAAc,GAAG,KAAK,CAAC,yBAAyB,CAAC,gBAAgB,GAAG,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,GAAG;IAC9G,MAAM,EAAE,eAAe,CAAC;CACzB,CAAC;AA+BF,QAAA,MAAM,KAAK,EAoUN,cAAc,CAAC;AAOpB,UAAU,iBAAkB,SAAQ,KAAK,CAAC,wBAAwB,CAAC,MAAM,CAAC;CAAG;AAE7E,QAAA,MAAM,OAAO,uFAAyK,CAAC;AAYvL,KAAK,aAAa,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEtD,UAAU,YAAa,SAAQ,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC;IACrE,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,QAAA,MAAM,OAAO,wFAqEX,CAAC;AAIH,OAAO,EACL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,OAAO,EACP,OAAO,EACP,SAAS,EACT,MAAM,EACN,OAAO,EACP,QAAQ,EACR,yBAAyB,EACzB,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,UAAU,EACf,KAAK,aAAa,GACnB,CAAC"}
|
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
import type { Breakpoint, PresentationValue, ResponsivePresentation } from './shell.types.js';
|
|
2
|
-
|
|
2
|
+
declare function useResponsivePresentation(presentation: ResponsivePresentation): PresentationValue;
|
|
3
3
|
/**
|
|
4
4
|
* Resolve a responsive value (T or responsive map keyed by breakpoints) against the current Shell breakpoint.
|
|
5
5
|
* If no value is defined for the current breakpoint, search smaller breakpoints down to 'initial'.
|
|
6
6
|
* Returns undefined when passed a responsive map with no matching key across the chain.
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
declare function useResponsiveValue<T>(value: T | Partial<Record<Breakpoint, T>> | undefined): T | undefined;
|
|
9
|
+
type ResponsiveStateValue<T> = T | Partial<Record<Breakpoint, T>>;
|
|
10
|
+
interface UseResponsiveInitialStateOptions<T> {
|
|
11
|
+
controlledValue?: ResponsiveStateValue<T>;
|
|
12
|
+
defaultValue?: ResponsiveStateValue<T>;
|
|
13
|
+
currentValue: T;
|
|
14
|
+
setValue: (value: T) => void;
|
|
15
|
+
breakpointReady: boolean;
|
|
16
|
+
onInit?: (value: T) => void;
|
|
17
|
+
onResponsiveChange?: (value: T) => void;
|
|
18
|
+
controlledIsResponsive?: boolean;
|
|
19
|
+
}
|
|
20
|
+
interface UseResponsiveInitialStateResult<T> {
|
|
21
|
+
resolvedControlled?: T;
|
|
22
|
+
resolvedDefault?: T;
|
|
23
|
+
}
|
|
24
|
+
declare function useResponsiveInitialState<T>({ controlledValue, defaultValue, currentValue, setValue, breakpointReady, onInit, onResponsiveChange, controlledIsResponsive, }: UseResponsiveInitialStateOptions<T>): UseResponsiveInitialStateResult<T>;
|
|
25
|
+
export { useResponsivePresentation, useResponsiveValue, useResponsiveInitialState };
|
|
9
26
|
//# sourceMappingURL=shell.hooks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell.hooks.d.ts","sourceRoot":"","sources":["../../../src/components/shell.hooks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAI9F,
|
|
1
|
+
{"version":3,"file":"shell.hooks.d.ts","sourceRoot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AA+B,CAAC,CAAC,CAAC,CAkC1E;AAED,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as d from"react";import{_BREAKPOINTS as c}from"./shell.types.js";import{useShell as T}from"./shell.context.js";function k(e){const{currentBreakpoint:t}=T();return d.useMemo(()=>{if(typeof e=="string")return e;if(e[t])return e[t];const i=[...Object.keys(c)].reverse().concat("initial"),o=i.indexOf(t);for(let s=o+1;s<i.length;s++){const r=i[s];if(e[r])return e[r]}return"fixed"},[e,t])}function p(e){const{currentBreakpoint:t}=T();return d.useMemo(()=>{if(e==null)return;if(typeof e!="object")return e;const n=e;if(n[t]!==void 0)return n[t];const o=[...Object.keys(c)].reverse().concat("initial"),s=o.indexOf(t);for(let r=s+1;r<o.length;r++){const f=o[r];if(n[f]!==void 0)return n[f]}},[e,t])}function B({controlledValue:e,defaultValue:t,currentValue:n,setValue:i,breakpointReady:o,onInit:s,onResponsiveChange:r,controlledIsResponsive:f=!1}){const a=p(e),u=p(t),R=d.useRef(void 0);d.useEffect(()=>{if(a!==void 0){if(R.current=a,n===a){f&&r?.(a);return}i(a),f&&r?.(a)}},[a,n,i,r,f]);const l=d.useRef(!1);return d.useEffect(()=>{l.current||o&&(typeof e<"u"||u!==void 0&&(l.current=!0,n!==u&&i(u),s?.(u)))},[o,e,u,n,i,s]),{resolvedControlled:a,resolvedDefault:u}}export{B as useResponsiveInitialState,k as useResponsivePresentation,p as useResponsiveValue};
|
|
2
2
|
//# sourceMappingURL=shell.hooks.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/shell.hooks.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nimport type { Breakpoint, PresentationValue, ResponsivePresentation } from './shell.types.js';\nimport { _BREAKPOINTS } from './shell.types.js';\nimport { useShell } from './shell.context.js';\n\
|
|
5
|
-
"mappings": "AAAA,UAAYA,MAAW,QAEvB,OAAS,gBAAAC,MAAoB,mBAC7B,OAAS,YAAAC,MAAgB,
|
|
6
|
-
"names": ["React", "_BREAKPOINTS", "useShell", "useResponsivePresentation", "presentation", "currentBreakpoint", "order", "startIdx", "i", "bp", "useResponsiveValue", "value", "map"]
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport type { Breakpoint, PresentationValue, ResponsivePresentation } from './shell.types.js';\nimport { _BREAKPOINTS } from './shell.types.js';\nimport { useShell } from './shell.context.js';\n\nfunction useResponsivePresentation(presentation: ResponsivePresentation): PresentationValue {\n const { currentBreakpoint } = useShell();\n\n return React.useMemo(() => {\n if (typeof presentation === 'string') {\n return presentation;\n }\n\n if (presentation[currentBreakpoint]) {\n return presentation[currentBreakpoint]!;\n }\n\n const bpKeys = Object.keys(_BREAKPOINTS) as Array<keyof typeof _BREAKPOINTS>;\n const order: Breakpoint[] = ([...bpKeys].reverse() as Breakpoint[]).concat('initial' as Breakpoint);\n const startIdx = order.indexOf(currentBreakpoint as Breakpoint);\n\n for (let i = startIdx + 1; i < order.length; i++) {\n const bp = order[i];\n if (presentation[bp]) {\n return presentation[bp]!;\n }\n }\n\n return 'fixed';\n }, [presentation, currentBreakpoint]);\n}\n\n/**\n * Resolve a responsive value (T or responsive map keyed by breakpoints) against the current Shell breakpoint.\n * If no value is defined for the current breakpoint, search smaller breakpoints down to 'initial'.\n * Returns undefined when passed a responsive map with no matching key across the chain.\n */\nfunction useResponsiveValue<T>(value: T | Partial<Record<Breakpoint, T>> | undefined): T | undefined {\n const { currentBreakpoint } = useShell();\n\n return React.useMemo(() => {\n if (value == null) return undefined;\n // Primitive value\n if (typeof value !== 'object') {\n return value as T;\n }\n\n const map = value as Partial<Record<Breakpoint, T>>;\n if (map[currentBreakpoint as Breakpoint] !== undefined) {\n return map[currentBreakpoint as Breakpoint] as T;\n }\n\n const bpKeys = Object.keys(_BREAKPOINTS) as Array<keyof typeof _BREAKPOINTS>;\n const order: Breakpoint[] = ([...bpKeys].reverse() as Breakpoint[]).concat('initial' as Breakpoint);\n const startIdx = order.indexOf(currentBreakpoint as Breakpoint);\n\n for (let i = startIdx + 1; i < order.length; i++) {\n const bp = order[i];\n if (map[bp] !== undefined) {\n return map[bp] as T;\n }\n }\n\n return undefined;\n }, [value, currentBreakpoint]);\n}\n\ntype ResponsiveStateValue<T> = T | Partial<Record<Breakpoint, T>>;\n\ninterface UseResponsiveInitialStateOptions<T> {\n controlledValue?: ResponsiveStateValue<T>;\n defaultValue?: ResponsiveStateValue<T>;\n currentValue: T;\n setValue: (value: T) => void;\n breakpointReady: boolean;\n onInit?: (value: T) => void;\n onResponsiveChange?: (value: T) => void;\n controlledIsResponsive?: boolean;\n}\n\ninterface UseResponsiveInitialStateResult<T> {\n resolvedControlled?: T;\n resolvedDefault?: T;\n}\n\nfunction useResponsiveInitialState<T>({\n controlledValue,\n defaultValue,\n currentValue,\n setValue,\n breakpointReady,\n onInit,\n onResponsiveChange,\n controlledIsResponsive = false,\n}: UseResponsiveInitialStateOptions<T>): UseResponsiveInitialStateResult<T> {\n const resolvedControlled = useResponsiveValue(controlledValue);\n const resolvedDefault = useResponsiveValue(defaultValue);\n\n const lastControlledRef = React.useRef<T | undefined>(undefined);\n React.useEffect(() => {\n if (resolvedControlled === undefined) return;\n lastControlledRef.current = resolvedControlled;\n if (currentValue === resolvedControlled) {\n if (controlledIsResponsive) {\n onResponsiveChange?.(resolvedControlled);\n }\n return;\n }\n setValue(resolvedControlled);\n if (controlledIsResponsive) {\n onResponsiveChange?.(resolvedControlled);\n }\n }, [resolvedControlled, currentValue, setValue, onResponsiveChange, controlledIsResponsive]);\n\n const didInitRef = React.useRef(false);\n React.useEffect(() => {\n if (didInitRef.current) return;\n if (!breakpointReady) return;\n if (typeof controlledValue !== 'undefined') return;\n if (resolvedDefault === undefined) return;\n didInitRef.current = true;\n if (currentValue !== resolvedDefault) {\n setValue(resolvedDefault);\n }\n onInit?.(resolvedDefault);\n }, [breakpointReady, controlledValue, resolvedDefault, currentValue, setValue, onInit]);\n\n return { resolvedControlled, resolvedDefault };\n}\n\nexport { useResponsivePresentation, useResponsiveValue, useResponsiveInitialState };\n"],
|
|
5
|
+
"mappings": "AAAA,UAAYA,MAAW,QAEvB,OAAS,gBAAAC,MAAoB,mBAC7B,OAAS,YAAAC,MAAgB,qBAEzB,SAASC,EAA0BC,EAAyD,CAC1F,KAAM,CAAE,kBAAAC,CAAkB,EAAIH,EAAS,EAEvC,OAAOF,EAAM,QAAQ,IAAM,CACzB,GAAI,OAAOI,GAAiB,SAC1B,OAAOA,EAGT,GAAIA,EAAaC,CAAiB,EAChC,OAAOD,EAAaC,CAAiB,EAIvC,MAAMC,EAAuB,CAAC,GADf,OAAO,KAAKL,CAAY,CACA,EAAE,QAAQ,EAAmB,OAAO,SAAuB,EAC5FM,EAAWD,EAAM,QAAQD,CAA+B,EAE9D,QAASG,EAAID,EAAW,EAAGC,EAAIF,EAAM,OAAQE,IAAK,CAChD,MAAMC,EAAKH,EAAME,CAAC,EAClB,GAAIJ,EAAaK,CAAE,EACjB,OAAOL,EAAaK,CAAE,CAE1B,CAEA,MAAO,OACT,EAAG,CAACL,EAAcC,CAAiB,CAAC,CACtC,CAOA,SAASK,EAAsBC,EAAsE,CACnG,KAAM,CAAE,kBAAAN,CAAkB,EAAIH,EAAS,EAEvC,OAAOF,EAAM,QAAQ,IAAM,CACzB,GAAIW,GAAS,KAAM,OAEnB,GAAI,OAAOA,GAAU,SACnB,OAAOA,EAGT,MAAMC,EAAMD,EACZ,GAAIC,EAAIP,CAA+B,IAAM,OAC3C,OAAOO,EAAIP,CAA+B,EAI5C,MAAMC,EAAuB,CAAC,GADf,OAAO,KAAKL,CAAY,CACA,EAAE,QAAQ,EAAmB,OAAO,SAAuB,EAC5FM,EAAWD,EAAM,QAAQD,CAA+B,EAE9D,QAASG,EAAID,EAAW,EAAGC,EAAIF,EAAM,OAAQE,IAAK,CAChD,MAAMC,EAAKH,EAAME,CAAC,EAClB,GAAII,EAAIH,CAAE,IAAM,OACd,OAAOG,EAAIH,CAAE,CAEjB,CAGF,EAAG,CAACE,EAAON,CAAiB,CAAC,CAC/B,CAoBA,SAASQ,EAA6B,CACpC,gBAAAC,EACA,aAAAC,EACA,aAAAC,EACA,SAAAC,EACA,gBAAAC,EACA,OAAAC,EACA,mBAAAC,EACA,uBAAAC,EAAyB,EAC3B,EAA4E,CAC1E,MAAMC,EAAqBZ,EAAmBI,CAAe,EACvDS,EAAkBb,EAAmBK,CAAY,EAEjDS,EAAoBxB,EAAM,OAAsB,MAAS,EAC/DA,EAAM,UAAU,IAAM,CACpB,GAAIsB,IAAuB,OAE3B,IADAE,EAAkB,QAAUF,EACxBN,IAAiBM,EAAoB,CACnCD,GACFD,IAAqBE,CAAkB,EAEzC,MACF,CACAL,EAASK,CAAkB,EACvBD,GACFD,IAAqBE,CAAkB,EAE3C,EAAG,CAACA,EAAoBN,EAAcC,EAAUG,EAAoBC,CAAsB,CAAC,EAE3F,MAAMI,EAAazB,EAAM,OAAO,EAAK,EACrC,OAAAA,EAAM,UAAU,IAAM,CAChByB,EAAW,SACVP,IACD,OAAOJ,EAAoB,KAC3BS,IAAoB,SACxBE,EAAW,QAAU,GACjBT,IAAiBO,GACnBN,EAASM,CAAe,EAE1BJ,IAASI,CAAe,GAC1B,EAAG,CAACL,EAAiBJ,EAAiBS,EAAiBP,EAAcC,EAAUE,CAAM,CAAC,EAE/E,CAAE,mBAAAG,EAAoB,gBAAAC,CAAgB,CAC/C",
|
|
6
|
+
"names": ["React", "_BREAKPOINTS", "useShell", "useResponsivePresentation", "presentation", "currentBreakpoint", "order", "startIdx", "i", "bp", "useResponsiveValue", "value", "map", "useResponsiveInitialState", "controlledValue", "defaultValue", "currentValue", "setValue", "breakpointReady", "onInit", "onResponsiveChange", "controlledIsResponsive", "resolvedControlled", "resolvedDefault", "lastControlledRef", "didInitRef"]
|
|
7
7
|
}
|