@particle-academy/react-fancy 6.10.0 → 6.11.1
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/CHANGELOG.md +21 -0
- package/dist/{chunk-GEQKNV7E.js → chunk-26GRLVCQ.js} +17 -13
- package/dist/chunk-26GRLVCQ.js.map +1 -0
- package/dist/{chunk-ZHTK4IPQ.js → chunk-4676NOI6.js} +17 -13
- package/dist/chunk-4676NOI6.js.map +1 -0
- package/dist/{chunk-HANQYZW2.cjs → chunk-GB2EGMVQ.cjs} +16 -12
- package/dist/chunk-GB2EGMVQ.cjs.map +1 -0
- package/dist/chunk-HHCVBIMM.js +21 -0
- package/dist/chunk-HHCVBIMM.js.map +1 -0
- package/dist/{chunk-NIFHAFKK.cjs → chunk-JFPBW5MO.cjs} +17 -13
- package/dist/chunk-JFPBW5MO.cjs.map +1 -0
- package/dist/{chunk-ZBXJDQXN.js → chunk-JJYMRV62.js} +17 -13
- package/dist/chunk-JJYMRV62.js.map +1 -0
- package/dist/{chunk-R6O6SLXK.js → chunk-LG2O26CG.js} +13 -8
- package/dist/chunk-LG2O26CG.js.map +1 -0
- package/dist/{chunk-5U2DZ7AV.js → chunk-MUV7OK3W.js} +8 -6
- package/dist/chunk-MUV7OK3W.js.map +1 -0
- package/dist/{chunk-EC4ZYZNK.cjs → chunk-NFUKNVB7.cjs} +13 -8
- package/dist/chunk-NFUKNVB7.cjs.map +1 -0
- package/dist/chunk-RE3PMG47.cjs +23 -0
- package/dist/chunk-RE3PMG47.cjs.map +1 -0
- package/dist/{chunk-7NRG77U5.cjs → chunk-TXQT6S4D.cjs} +16 -12
- package/dist/chunk-TXQT6S4D.cjs.map +1 -0
- package/dist/{chunk-TXTRTTG7.cjs → chunk-UOG3O3KP.cjs} +8 -6
- package/dist/chunk-UOG3O3KP.cjs.map +1 -0
- package/dist/command.cjs +5 -4
- package/dist/command.js +3 -2
- package/dist/drawer.cjs +5 -4
- package/dist/drawer.d.cts +8 -1
- package/dist/drawer.d.ts +8 -1
- package/dist/drawer.js +3 -2
- package/dist/editor.cjs +1 -1
- package/dist/editor.js +1 -1
- package/dist/file-upload.cjs +3 -3
- package/dist/file-upload.js +1 -1
- package/dist/index.cjs +15 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/mobile-menu.cjs +1 -1
- package/dist/mobile-menu.js +1 -1
- package/dist/modal.cjs +5 -4
- package/dist/modal.d.cts +11 -1
- package/dist/modal.d.ts +11 -1
- package/dist/modal.js +3 -2
- package/dist/sidebar.cjs +1 -1
- package/dist/sidebar.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-5U2DZ7AV.js.map +0 -1
- package/dist/chunk-7NRG77U5.cjs.map +0 -1
- package/dist/chunk-EC4ZYZNK.cjs.map +0 -1
- package/dist/chunk-GEQKNV7E.js.map +0 -1
- package/dist/chunk-HANQYZW2.cjs.map +0 -1
- package/dist/chunk-NIFHAFKK.cjs.map +0 -1
- package/dist/chunk-R6O6SLXK.js.map +0 -1
- package/dist/chunk-TXTRTTG7.cjs.map +0 -1
- package/dist/chunk-ZBXJDQXN.js.map +0 -1
- package/dist/chunk-ZHTK4IPQ.js.map +0 -1
package/dist/drawer.cjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkTXQT6S4D_cjs = require('./chunk-TXQT6S4D.cjs');
|
|
4
|
+
require('./chunk-RE3PMG47.cjs');
|
|
5
|
+
require('./chunk-UOG3O3KP.cjs');
|
|
5
6
|
require('./chunk-FQZE5N2N.cjs');
|
|
6
7
|
require('./chunk-MKHYENKR.cjs');
|
|
7
8
|
require('./chunk-TI7D4QDM.cjs');
|
|
@@ -12,11 +13,11 @@ require('./chunk-ZU5Q77OT.cjs');
|
|
|
12
13
|
|
|
13
14
|
Object.defineProperty(exports, "Drawer", {
|
|
14
15
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunkTXQT6S4D_cjs.Drawer; }
|
|
16
17
|
});
|
|
17
18
|
Object.defineProperty(exports, "useDrawer", {
|
|
18
19
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
20
|
+
get: function () { return chunkTXQT6S4D_cjs.useDrawer; }
|
|
20
21
|
});
|
|
21
22
|
//# sourceMappingURL=drawer.cjs.map
|
|
22
23
|
//# sourceMappingURL=drawer.cjs.map
|
package/dist/drawer.d.cts
CHANGED
|
@@ -55,6 +55,8 @@ interface DrawerHeaderProps {
|
|
|
55
55
|
/** Show the close button. Default `true`. */
|
|
56
56
|
closable?: boolean;
|
|
57
57
|
className?: string;
|
|
58
|
+
/** Accessible name of the close button. Default `"Close"`; pass your locale's word. */
|
|
59
|
+
closeLabel?: string;
|
|
58
60
|
}
|
|
59
61
|
interface DrawerBodyProps {
|
|
60
62
|
children: ReactNode;
|
|
@@ -69,7 +71,12 @@ interface DrawerContainerProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
69
71
|
className?: string;
|
|
70
72
|
}
|
|
71
73
|
|
|
72
|
-
|
|
74
|
+
/**
|
|
75
|
+
* The close button draws at 26px (18px icon + `p-1`) and HITS at 44px (WCAG
|
|
76
|
+
* 2.5.5, AAA): a `::before` overhangs it by 9px, inside the header's `py-3`. The
|
|
77
|
+
* look is unchanged; see ModalHeader for why this over a size option.
|
|
78
|
+
*/
|
|
79
|
+
declare function DrawerHeader({ children, closable, className, closeLabel }: DrawerHeaderProps): react.JSX.Element;
|
|
73
80
|
declare namespace DrawerHeader {
|
|
74
81
|
var displayName: string;
|
|
75
82
|
}
|
package/dist/drawer.d.ts
CHANGED
|
@@ -55,6 +55,8 @@ interface DrawerHeaderProps {
|
|
|
55
55
|
/** Show the close button. Default `true`. */
|
|
56
56
|
closable?: boolean;
|
|
57
57
|
className?: string;
|
|
58
|
+
/** Accessible name of the close button. Default `"Close"`; pass your locale's word. */
|
|
59
|
+
closeLabel?: string;
|
|
58
60
|
}
|
|
59
61
|
interface DrawerBodyProps {
|
|
60
62
|
children: ReactNode;
|
|
@@ -69,7 +71,12 @@ interface DrawerContainerProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
69
71
|
className?: string;
|
|
70
72
|
}
|
|
71
73
|
|
|
72
|
-
|
|
74
|
+
/**
|
|
75
|
+
* The close button draws at 26px (18px icon + `p-1`) and HITS at 44px (WCAG
|
|
76
|
+
* 2.5.5, AAA): a `::before` overhangs it by 9px, inside the header's `py-3`. The
|
|
77
|
+
* look is unchanged; see ModalHeader for why this over a size option.
|
|
78
|
+
*/
|
|
79
|
+
declare function DrawerHeader({ children, closable, className, closeLabel }: DrawerHeaderProps): react.JSX.Element;
|
|
73
80
|
declare namespace DrawerHeader {
|
|
74
81
|
var displayName: string;
|
|
75
82
|
}
|
package/dist/drawer.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { Drawer, useDrawer } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { Drawer, useDrawer } from './chunk-JJYMRV62.js';
|
|
2
|
+
import './chunk-HHCVBIMM.js';
|
|
3
|
+
import './chunk-MUV7OK3W.js';
|
|
3
4
|
import './chunk-3K2CEAI7.js';
|
|
4
5
|
import './chunk-5VMILVWD.js';
|
|
5
6
|
import './chunk-RBCMKPBX.js';
|
package/dist/editor.cjs
CHANGED
|
@@ -5,7 +5,7 @@ require('./chunk-A2JUTNE6.cjs');
|
|
|
5
5
|
require('./chunk-T6YELZPJ.cjs');
|
|
6
6
|
require('./chunk-VQJ5LJJH.cjs');
|
|
7
7
|
require('./chunk-4GOOSZEK.cjs');
|
|
8
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-UOG3O3KP.cjs');
|
|
9
9
|
require('./chunk-FQZE5N2N.cjs');
|
|
10
10
|
require('./chunk-AIA5UNQ5.cjs');
|
|
11
11
|
require('./chunk-U4KUW3RK.cjs');
|
package/dist/editor.js
CHANGED
|
@@ -3,7 +3,7 @@ import './chunk-2BXMMVQS.js';
|
|
|
3
3
|
import './chunk-CPY7NHXM.js';
|
|
4
4
|
import './chunk-RP43ZFZP.js';
|
|
5
5
|
import './chunk-ZQ3VXRUY.js';
|
|
6
|
-
import './chunk-
|
|
6
|
+
import './chunk-MUV7OK3W.js';
|
|
7
7
|
import './chunk-3K2CEAI7.js';
|
|
8
8
|
import './chunk-TJ66S5K6.js';
|
|
9
9
|
import './chunk-ZL5QVNKG.js';
|
package/dist/file-upload.cjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkJFPBW5MO_cjs = require('./chunk-JFPBW5MO.cjs');
|
|
4
4
|
require('./chunk-ZU5Q77OT.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "FileUpload", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkJFPBW5MO_cjs.FileUpload; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "useFileUpload", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkJFPBW5MO_cjs.useFileUpload; }
|
|
15
15
|
});
|
|
16
16
|
//# sourceMappingURL=file-upload.cjs.map
|
|
17
17
|
//# sourceMappingURL=file-upload.cjs.map
|
package/dist/file-upload.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -51,7 +51,7 @@ var chunkTH7VP4CL_cjs = require('./chunk-TH7VP4CL.cjs');
|
|
|
51
51
|
var chunkHYU46SOE_cjs = require('./chunk-HYU46SOE.cjs');
|
|
52
52
|
var chunk5NTFXQ4K_cjs = require('./chunk-5NTFXQ4K.cjs');
|
|
53
53
|
var chunk3BBEVHSP_cjs = require('./chunk-3BBEVHSP.cjs');
|
|
54
|
-
var
|
|
54
|
+
var chunkGB2EGMVQ_cjs = require('./chunk-GB2EGMVQ.cjs');
|
|
55
55
|
var chunkCG3RCQVL_cjs = require('./chunk-CG3RCQVL.cjs');
|
|
56
56
|
var chunkGISORLGW_cjs = require('./chunk-GISORLGW.cjs');
|
|
57
57
|
require('./chunk-FJKZ5NOA.cjs');
|
|
@@ -75,24 +75,25 @@ var chunk7K2C744H_cjs = require('./chunk-7K2C744H.cjs');
|
|
|
75
75
|
var chunkVH34IZ7R_cjs = require('./chunk-VH34IZ7R.cjs');
|
|
76
76
|
var chunkZDHLEHYR_cjs = require('./chunk-ZDHLEHYR.cjs');
|
|
77
77
|
var chunkXQF4HCOV_cjs = require('./chunk-XQF4HCOV.cjs');
|
|
78
|
-
var
|
|
78
|
+
var chunkJFPBW5MO_cjs = require('./chunk-JFPBW5MO.cjs');
|
|
79
79
|
var chunkWVSHAJKI_cjs = require('./chunk-WVSHAJKI.cjs');
|
|
80
80
|
var chunkOOZCJLEF_cjs = require('./chunk-OOZCJLEF.cjs');
|
|
81
|
-
var
|
|
81
|
+
var chunkNFUKNVB7_cjs = require('./chunk-NFUKNVB7.cjs');
|
|
82
82
|
var chunkZFXCZ2QO_cjs = require('./chunk-ZFXCZ2QO.cjs');
|
|
83
83
|
require('./chunk-JKD6CFIP.cjs');
|
|
84
84
|
var chunkTBLKVTJC_cjs = require('./chunk-TBLKVTJC.cjs');
|
|
85
85
|
var chunkMAY4NMRI_cjs = require('./chunk-MAY4NMRI.cjs');
|
|
86
86
|
var chunkFQSSVOVQ_cjs = require('./chunk-FQSSVOVQ.cjs');
|
|
87
87
|
var chunkQU6HZH6V_cjs = require('./chunk-QU6HZH6V.cjs');
|
|
88
|
-
var
|
|
88
|
+
var chunkTXQT6S4D_cjs = require('./chunk-TXQT6S4D.cjs');
|
|
89
|
+
require('./chunk-RE3PMG47.cjs');
|
|
89
90
|
var chunkHEGM5LMZ_cjs = require('./chunk-HEGM5LMZ.cjs');
|
|
90
91
|
var chunkGE6TSA3M_cjs = require('./chunk-GE6TSA3M.cjs');
|
|
91
92
|
var chunkA2JUTNE6_cjs = require('./chunk-A2JUTNE6.cjs');
|
|
92
93
|
var chunkT6YELZPJ_cjs = require('./chunk-T6YELZPJ.cjs');
|
|
93
94
|
var chunkVQJ5LJJH_cjs = require('./chunk-VQJ5LJJH.cjs');
|
|
94
95
|
var chunk4GOOSZEK_cjs = require('./chunk-4GOOSZEK.cjs');
|
|
95
|
-
var
|
|
96
|
+
var chunkUOG3O3KP_cjs = require('./chunk-UOG3O3KP.cjs');
|
|
96
97
|
var chunkFQZE5N2N_cjs = require('./chunk-FQZE5N2N.cjs');
|
|
97
98
|
var chunk7PK3OUKR_cjs = require('./chunk-7PK3OUKR.cjs');
|
|
98
99
|
var chunkTTZJ2KXK_cjs = require('./chunk-TTZJ2KXK.cjs');
|
|
@@ -492,11 +493,11 @@ Object.defineProperty(exports, "useMobileMenu", {
|
|
|
492
493
|
});
|
|
493
494
|
Object.defineProperty(exports, "Modal", {
|
|
494
495
|
enumerable: true,
|
|
495
|
-
get: function () { return
|
|
496
|
+
get: function () { return chunkGB2EGMVQ_cjs.Modal; }
|
|
496
497
|
});
|
|
497
498
|
Object.defineProperty(exports, "useModal", {
|
|
498
499
|
enumerable: true,
|
|
499
|
-
get: function () { return
|
|
500
|
+
get: function () { return chunkGB2EGMVQ_cjs.useModal; }
|
|
500
501
|
});
|
|
501
502
|
Object.defineProperty(exports, "MoodMeter", {
|
|
502
503
|
enumerable: true,
|
|
@@ -660,11 +661,11 @@ Object.defineProperty(exports, "validateFolderName", {
|
|
|
660
661
|
});
|
|
661
662
|
Object.defineProperty(exports, "FileUpload", {
|
|
662
663
|
enumerable: true,
|
|
663
|
-
get: function () { return
|
|
664
|
+
get: function () { return chunkJFPBW5MO_cjs.FileUpload; }
|
|
664
665
|
});
|
|
665
666
|
Object.defineProperty(exports, "useFileUpload", {
|
|
666
667
|
enumerable: true,
|
|
667
|
-
get: function () { return
|
|
668
|
+
get: function () { return chunkJFPBW5MO_cjs.useFileUpload; }
|
|
668
669
|
});
|
|
669
670
|
Object.defineProperty(exports, "FullScreen", {
|
|
670
671
|
enumerable: true,
|
|
@@ -676,11 +677,11 @@ Object.defineProperty(exports, "Grid", {
|
|
|
676
677
|
});
|
|
677
678
|
Object.defineProperty(exports, "Command", {
|
|
678
679
|
enumerable: true,
|
|
679
|
-
get: function () { return
|
|
680
|
+
get: function () { return chunkNFUKNVB7_cjs.Command; }
|
|
680
681
|
});
|
|
681
682
|
Object.defineProperty(exports, "useCommand", {
|
|
682
683
|
enumerable: true,
|
|
683
|
-
get: function () { return
|
|
684
|
+
get: function () { return chunkNFUKNVB7_cjs.useCommand; }
|
|
684
685
|
});
|
|
685
686
|
Object.defineProperty(exports, "Composer", {
|
|
686
687
|
enumerable: true,
|
|
@@ -728,11 +729,11 @@ Object.defineProperty(exports, "useContextMenu", {
|
|
|
728
729
|
});
|
|
729
730
|
Object.defineProperty(exports, "Drawer", {
|
|
730
731
|
enumerable: true,
|
|
731
|
-
get: function () { return
|
|
732
|
+
get: function () { return chunkTXQT6S4D_cjs.Drawer; }
|
|
732
733
|
});
|
|
733
734
|
Object.defineProperty(exports, "useDrawer", {
|
|
734
735
|
enumerable: true,
|
|
735
|
-
get: function () { return
|
|
736
|
+
get: function () { return chunkTXQT6S4D_cjs.useDrawer; }
|
|
736
737
|
});
|
|
737
738
|
Object.defineProperty(exports, "Dropdown", {
|
|
738
739
|
enumerable: true,
|
|
@@ -812,7 +813,7 @@ Object.defineProperty(exports, "useFullScreen", {
|
|
|
812
813
|
});
|
|
813
814
|
Object.defineProperty(exports, "useFocusTrap", {
|
|
814
815
|
enumerable: true,
|
|
815
|
-
get: function () { return
|
|
816
|
+
get: function () { return chunkUOG3O3KP_cjs.useFocusTrap; }
|
|
816
817
|
});
|
|
817
818
|
Object.defineProperty(exports, "useAnimation", {
|
|
818
819
|
enumerable: true,
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/theme-tokens.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/theme-tokens.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCO,IAAM,YAAA,GAAe;AAAA,EAC1B,OAAA,EAAS;AAAA,IACP,QAAA,EAAU,iBAAA;AAAA,IACV,YAAA,EAAc,sBAAA;AAAA,IACd,KAAA,EAAO,oBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,QAAA,EAAU,uBAAA;AAAA,IACV,YAAA,EAAc,4BAAA;AAAA,IACd,KAAA,EAAO,uBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,QAAA,EAAU,gBAAA;AAAA,IACV,YAAA,EAAc,qBAAA;AAAA,IACd,KAAA,EAAO,uBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,QAAA,EAAU,uBAAA;AAAA,IACV,YAAA,EAAc,4BAAA;AAAA,IACd,KAAA,EAAO,uBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,KAAA,EAAO;AAAA,IACL,QAAA,EAAU,eAAA;AAAA,IACV,YAAA,EAAc,oBAAA;AAAA,IACd,KAAA,EAAO,oBAAA;AAAA,IACP,IAAA,EAAM,SAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,IAAA,EAAM;AAAA,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sourcesContent":["/**\n * Semantic theme tokens — the small set of colours the kit's DOM components\n * read, so a host can repaint the whole kit with its own palette WITHOUT\n * remapping Tailwind's `zinc` or `violet`.\n *\n * Each role is two CSS custom properties, one per mode:\n *\n * --fancy-surface the light value\n * --fancy-surface-dark the dark value\n *\n * Components read them through their var() FALLBACK, which is the colour the\n * component used before these existed:\n *\n * bg-[color:var(--fancy-surface,var(--color-white))]\n * dark:bg-[color:var(--fancy-surface-dark,var(--color-zinc-900))]\n *\n * So:\n * - **Set nothing and nothing changes.** An unset custom property resolves to\n * its fallback, which is the exact declaration the old `bg-white` produced.\n * - **Set one and every surface follows**, wherever the variable is in scope:\n * `:root`, `body`, or any wrapper element. No selector to match, no layer or\n * specificity to win — a custom property is inherited, not cascaded against.\n * - **Both modes are stated, not derived.** The dark value is a separate\n * variable rather than a flip under `.dark`, so which one applies is decided\n * by the host's own `dark:` variant — the same switch that drives every\n * other `dark:` utility in the kit. (See `dark-variant.css` for a variant\n * that follows `[data-theme=\"dark\"]` as well as `.dark`.)\n *\n * NOT covered, deliberately: colours that ENCODE DATA — chart series,\n * file-type marks, mood and confidence scales, event kinds. Repainting those\n * with a host's neutral palette would erase what they mean. A component's\n * explicit `color` prop (Badge, Button, Callout …) is also untouched: that is\n * the host choosing a hue, not the kit choosing one for it.\n *\n * `light` / `dark` are the defaults exactly as components write them in their\n * fallbacks. `tests/theme-tokens.test.tsx` fails if a component's fallback\n * disagrees with this table, so the table is the contract rather than a\n * description of it.\n */\nexport const THEME_TOKENS = {\n surface: {\n variable: \"--fancy-surface\",\n darkVariable: \"--fancy-surface-dark\",\n light: \"var(--color-white)\",\n dark: \"var(--color-zinc-900)\",\n description: \"Panels, cards, overlays (menus, modals, popovers, toasts), sidebars and navbars.\",\n },\n \"surface-muted\": {\n variable: \"--fancy-surface-muted\",\n darkVariable: \"--fancy-surface-muted-dark\",\n light: \"var(--color-zinc-100)\",\n dark: \"var(--color-zinc-800)\",\n description: \"Hovered and selected rows, chips, inset wells, toolbar buttons.\",\n },\n border: {\n variable: \"--fancy-border\",\n darkVariable: \"--fancy-border-dark\",\n light: \"var(--color-zinc-200)\",\n dark: \"var(--color-zinc-700)\",\n description: \"Outlines, dividers, separators and tracks (skeletons, progress, sliders).\",\n },\n \"border-strong\": {\n variable: \"--fancy-border-strong\",\n darkVariable: \"--fancy-border-strong-dark\",\n light: \"var(--color-zinc-300)\",\n dark: \"var(--color-zinc-700)\",\n description: \"The firmer outline on form controls (inputs, checkboxes, radios) and keycaps.\",\n },\n input: {\n variable: \"--fancy-input\",\n darkVariable: \"--fancy-input-dark\",\n light: \"var(--color-white)\",\n dark: \"#1e1e24\",\n description: \"The field surface of text inputs, checkboxes, radios, OTP cells and pickers.\",\n },\n text: {\n variable: \"--fancy-text\",\n darkVariable: \"--fancy-text-dark\",\n light: \"var(--color-zinc-900)\",\n dark: \"var(--color-zinc-100)\",\n description: \"Strongest foreground: headings, values, field text, active items.\",\n },\n \"text-soft\": {\n variable: \"--fancy-text-soft\",\n darkVariable: \"--fancy-text-soft-dark\",\n light: \"var(--color-zinc-700)\",\n dark: \"var(--color-zinc-300)\",\n description: \"Body copy and menu items: readable, one step back from text.\",\n },\n \"text-muted\": {\n variable: \"--fancy-text-muted\",\n darkVariable: \"--fancy-text-muted-dark\",\n light: \"var(--color-zinc-500)\",\n dark: \"var(--color-zinc-400)\",\n description: \"Descriptions, captions, secondary labels, axis labels.\",\n },\n \"text-faint\": {\n variable: \"--fancy-text-faint\",\n darkVariable: \"--fancy-text-faint-dark\",\n light: \"var(--color-zinc-400)\",\n dark: \"var(--color-zinc-500)\",\n description: \"Placeholders, disabled hints, decorative icons.\",\n },\n \"text-subtle\": {\n variable: \"--fancy-text-subtle\",\n darkVariable: \"--fancy-text-subtle-dark\",\n light: \"var(--color-zinc-600)\",\n dark: \"var(--color-zinc-400)\",\n description: \"Inactive nav labels (Sidebar, Menu, Navbar, MultiSwitch) and secondary prose. Added 5.53.1.\",\n },\n \"surface-hover\": {\n variable: \"--fancy-surface-hover\",\n darkVariable: \"--fancy-surface-hover-dark\",\n light: \"var(--color-zinc-50)\",\n // Tailwind's `bg-zinc-800/50`, written out so a host's value is used as-is.\n dark: \"color-mix(in oklab, var(--color-zinc-800) 50%, transparent)\",\n description: \"The hover fill on nav items, list options and table rows. Added 5.53.1.\",\n },\n focus: {\n variable: \"--fancy-focus\",\n darkVariable: \"--fancy-focus-dark\",\n light: \"var(--color-blue-500)\",\n dark: \"var(--color-blue-400)\",\n description: \"The focus border and ring on form controls.\",\n },\n} as const;\n\nexport type ThemeTokenRole = keyof typeof THEME_TOKENS;\n"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -257,7 +257,18 @@ declare function useControllableState<T>(controlledValue: T | undefined, default
|
|
|
257
257
|
|
|
258
258
|
declare function useOutsideClick(ref: RefObject<HTMLElement | null>, handler: (event: MouseEvent | TouchEvent) => void, enabled?: boolean, ignoreRef?: RefObject<HTMLElement | null>): void;
|
|
259
259
|
|
|
260
|
-
|
|
260
|
+
/**
|
|
261
|
+
* Moves focus into `ref`, keeps Tab inside it, and restores focus on disable.
|
|
262
|
+
*
|
|
263
|
+
* `ref.current` must already be set in the commit where `enabled` turns true:
|
|
264
|
+
* the effect does not run again until `enabled` changes. A panel that mounts
|
|
265
|
+
* later (an animation, a Portal) should key `enabled` on the node — see
|
|
266
|
+
* `useDialogFocusTrap`.
|
|
267
|
+
*
|
|
268
|
+
* `restoreTo`, when it holds an element, is where focus returns on disable
|
|
269
|
+
* instead of whatever was focused when the trap engaged.
|
|
270
|
+
*/
|
|
271
|
+
declare function useFocusTrap(ref: RefObject<HTMLElement | null>, enabled?: boolean, restoreTo?: RefObject<HTMLElement | null>): void;
|
|
261
272
|
|
|
262
273
|
/**
|
|
263
274
|
* Writing direction, read from the DOM rather than passed as a prop.
|
package/dist/index.d.ts
CHANGED
|
@@ -257,7 +257,18 @@ declare function useControllableState<T>(controlledValue: T | undefined, default
|
|
|
257
257
|
|
|
258
258
|
declare function useOutsideClick(ref: RefObject<HTMLElement | null>, handler: (event: MouseEvent | TouchEvent) => void, enabled?: boolean, ignoreRef?: RefObject<HTMLElement | null>): void;
|
|
259
259
|
|
|
260
|
-
|
|
260
|
+
/**
|
|
261
|
+
* Moves focus into `ref`, keeps Tab inside it, and restores focus on disable.
|
|
262
|
+
*
|
|
263
|
+
* `ref.current` must already be set in the commit where `enabled` turns true:
|
|
264
|
+
* the effect does not run again until `enabled` changes. A panel that mounts
|
|
265
|
+
* later (an animation, a Portal) should key `enabled` on the node — see
|
|
266
|
+
* `useDialogFocusTrap`.
|
|
267
|
+
*
|
|
268
|
+
* `restoreTo`, when it holds an element, is where focus returns on disable
|
|
269
|
+
* instead of whatever was focused when the trap engaged.
|
|
270
|
+
*/
|
|
271
|
+
declare function useFocusTrap(ref: RefObject<HTMLElement | null>, enabled?: boolean, restoreTo?: RefObject<HTMLElement | null>): void;
|
|
261
272
|
|
|
262
273
|
/**
|
|
263
274
|
* Writing direction, read from the DOM rather than passed as a prop.
|
package/dist/index.js
CHANGED
|
@@ -49,7 +49,7 @@ export { VideoViewer } from './chunk-VOGI7GX3.js';
|
|
|
49
49
|
export { PdfViewer } from './chunk-UZZJJ3HJ.js';
|
|
50
50
|
export { Menu, useMenu } from './chunk-V64XIPYG.js';
|
|
51
51
|
export { MobileMenu, useMobileMenu } from './chunk-AE6ICNJR.js';
|
|
52
|
-
export { Modal, useModal } from './chunk-
|
|
52
|
+
export { Modal, useModal } from './chunk-26GRLVCQ.js';
|
|
53
53
|
export { MoodMeter } from './chunk-K6Q542VL.js';
|
|
54
54
|
export { Navbar, useNavbar } from './chunk-TKGMH5PA.js';
|
|
55
55
|
import './chunk-CFH6CJQG.js';
|
|
@@ -73,24 +73,25 @@ export { EmojiSelect } from './chunk-R3PCZSBQ.js';
|
|
|
73
73
|
export { Eyebrow } from './chunk-FRUHEDZN.js';
|
|
74
74
|
export { FauxClient } from './chunk-XH24BGEK.js';
|
|
75
75
|
export { FileBrowser, FileBrowserNewFolder, useFileBrowser, validateFolderName } from './chunk-YZW7HQXH.js';
|
|
76
|
-
export { FileUpload, useFileUpload } from './chunk-
|
|
76
|
+
export { FileUpload, useFileUpload } from './chunk-4676NOI6.js';
|
|
77
77
|
export { FullScreen } from './chunk-GZ5Z56QK.js';
|
|
78
78
|
export { Grid } from './chunk-TM3RTWKI.js';
|
|
79
|
-
export { Command, useCommand } from './chunk-
|
|
79
|
+
export { Command, useCommand } from './chunk-LG2O26CG.js';
|
|
80
80
|
export { Composer } from './chunk-J57JSHDC.js';
|
|
81
81
|
import './chunk-J6IQHJET.js';
|
|
82
82
|
export { InlinePasteEditor, PastedFilesInput, pasteMarker, useInlinePaste, usePastePills } from './chunk-FECD3WKN.js';
|
|
83
83
|
export { Popover, usePopover } from './chunk-FNHKZMMI.js';
|
|
84
84
|
export { Container } from './chunk-VKMPVFQK.js';
|
|
85
85
|
export { ContextMenu, useContextMenu } from './chunk-BPTCMI3E.js';
|
|
86
|
-
export { Drawer, useDrawer } from './chunk-
|
|
86
|
+
export { Drawer, useDrawer } from './chunk-JJYMRV62.js';
|
|
87
|
+
import './chunk-HHCVBIMM.js';
|
|
87
88
|
export { Dropdown, useDropdown } from './chunk-H5LJFN7D.js';
|
|
88
89
|
export { Editor, useEditor } from './chunk-PIYQPXLT.js';
|
|
89
90
|
export { THEME_STORAGE_KEY, getThemePreference, initTheme, resolveTheme, setThemePreference, subscribeTheme, useId, useNodeRegistry, useTheme } from './chunk-2BXMMVQS.js';
|
|
90
91
|
export { usePanZoom } from './chunk-CPY7NHXM.js';
|
|
91
92
|
export { FullScreenContext, FullScreenProvider, FullScreenToggle, useFullScreenContext } from './chunk-RP43ZFZP.js';
|
|
92
93
|
export { useFullScreen } from './chunk-ZQ3VXRUY.js';
|
|
93
|
-
export { useFocusTrap } from './chunk-
|
|
94
|
+
export { useFocusTrap } from './chunk-MUV7OK3W.js';
|
|
94
95
|
export { useAnimation } from './chunk-3K2CEAI7.js';
|
|
95
96
|
export { Card } from './chunk-4L3MGQAR.js';
|
|
96
97
|
export { Heading } from './chunk-QPM4CZ4G.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/theme-tokens.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/theme-tokens.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCO,IAAM,YAAA,GAAe;AAAA,EAC1B,OAAA,EAAS;AAAA,IACP,QAAA,EAAU,iBAAA;AAAA,IACV,YAAA,EAAc,sBAAA;AAAA,IACd,KAAA,EAAO,oBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,QAAA,EAAU,uBAAA;AAAA,IACV,YAAA,EAAc,4BAAA;AAAA,IACd,KAAA,EAAO,uBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,QAAA,EAAU,gBAAA;AAAA,IACV,YAAA,EAAc,qBAAA;AAAA,IACd,KAAA,EAAO,uBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,QAAA,EAAU,uBAAA;AAAA,IACV,YAAA,EAAc,4BAAA;AAAA,IACd,KAAA,EAAO,uBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,KAAA,EAAO;AAAA,IACL,QAAA,EAAU,eAAA;AAAA,IACV,YAAA,EAAc,oBAAA;AAAA,IACd,KAAA,EAAO,oBAAA;A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EAAO,uBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA;AAEjB","file":"index.js","sourcesContent":["/**\n * Semantic theme tokens — the small set of colours the kit's DOM components\n * read, so a host can repaint the whole kit with its own palette WITHOUT\n * remapping Tailwind's `zinc` or `violet`.\n *\n * Each role is two CSS custom properties, one per mode:\n *\n * --fancy-surface the light value\n * --fancy-surface-dark the dark value\n *\n * Components read them through their var() FALLBACK, which is the colour the\n * component used before these existed:\n *\n * bg-[color:var(--fancy-surface,var(--color-white))]\n * dark:bg-[color:var(--fancy-surface-dark,var(--color-zinc-900))]\n *\n * So:\n * - **Set nothing and nothing changes.** An unset custom property resolves to\n * its fallback, which is the exact declaration the old `bg-white` produced.\n * - **Set one and every surface follows**, wherever the variable is in scope:\n * `:root`, `body`, or any wrapper element. No selector to match, no layer or\n * specificity to win — a custom property is inherited, not cascaded against.\n * - **Both modes are stated, not derived.** The dark value is a separate\n * variable rather than a flip under `.dark`, so which one applies is decided\n * by the host's own `dark:` variant — the same switch that drives every\n * other `dark:` utility in the kit. (See `dark-variant.css` for a variant\n * that follows `[data-theme=\"dark\"]` as well as `.dark`.)\n *\n * NOT covered, deliberately: colours that ENCODE DATA — chart series,\n * file-type marks, mood and confidence scales, event kinds. Repainting those\n * with a host's neutral palette would erase what they mean. A component's\n * explicit `color` prop (Badge, Button, Callout …) is also untouched: that is\n * the host choosing a hue, not the kit choosing one for it.\n *\n * `light` / `dark` are the defaults exactly as components write them in their\n * fallbacks. `tests/theme-tokens.test.tsx` fails if a component's fallback\n * disagrees with this table, so the table is the contract rather than a\n * description of it.\n */\nexport const THEME_TOKENS = {\n surface: {\n variable: \"--fancy-surface\",\n darkVariable: \"--fancy-surface-dark\",\n light: \"var(--color-white)\",\n dark: \"var(--color-zinc-900)\",\n description: \"Panels, cards, overlays (menus, modals, popovers, toasts), sidebars and navbars.\",\n },\n \"surface-muted\": {\n variable: \"--fancy-surface-muted\",\n darkVariable: \"--fancy-surface-muted-dark\",\n light: \"var(--color-zinc-100)\",\n dark: \"var(--color-zinc-800)\",\n description: \"Hovered and selected rows, chips, inset wells, toolbar buttons.\",\n },\n border: {\n variable: \"--fancy-border\",\n darkVariable: \"--fancy-border-dark\",\n light: \"var(--color-zinc-200)\",\n dark: \"var(--color-zinc-700)\",\n description: \"Outlines, dividers, separators and tracks (skeletons, progress, sliders).\",\n },\n \"border-strong\": {\n variable: \"--fancy-border-strong\",\n darkVariable: \"--fancy-border-strong-dark\",\n light: \"var(--color-zinc-300)\",\n dark: \"var(--color-zinc-700)\",\n description: \"The firmer outline on form controls (inputs, checkboxes, radios) and keycaps.\",\n },\n input: {\n variable: \"--fancy-input\",\n darkVariable: \"--fancy-input-dark\",\n light: \"var(--color-white)\",\n dark: \"#1e1e24\",\n description: \"The field surface of text inputs, checkboxes, radios, OTP cells and pickers.\",\n },\n text: {\n variable: \"--fancy-text\",\n darkVariable: \"--fancy-text-dark\",\n light: \"var(--color-zinc-900)\",\n dark: \"var(--color-zinc-100)\",\n description: \"Strongest foreground: headings, values, field text, active items.\",\n },\n \"text-soft\": {\n variable: \"--fancy-text-soft\",\n darkVariable: \"--fancy-text-soft-dark\",\n light: \"var(--color-zinc-700)\",\n dark: \"var(--color-zinc-300)\",\n description: \"Body copy and menu items: readable, one step back from text.\",\n },\n \"text-muted\": {\n variable: \"--fancy-text-muted\",\n darkVariable: \"--fancy-text-muted-dark\",\n light: \"var(--color-zinc-500)\",\n dark: \"var(--color-zinc-400)\",\n description: \"Descriptions, captions, secondary labels, axis labels.\",\n },\n \"text-faint\": {\n variable: \"--fancy-text-faint\",\n darkVariable: \"--fancy-text-faint-dark\",\n light: \"var(--color-zinc-400)\",\n dark: \"var(--color-zinc-500)\",\n description: \"Placeholders, disabled hints, decorative icons.\",\n },\n \"text-subtle\": {\n variable: \"--fancy-text-subtle\",\n darkVariable: \"--fancy-text-subtle-dark\",\n light: \"var(--color-zinc-600)\",\n dark: \"var(--color-zinc-400)\",\n description: \"Inactive nav labels (Sidebar, Menu, Navbar, MultiSwitch) and secondary prose. Added 5.53.1.\",\n },\n \"surface-hover\": {\n variable: \"--fancy-surface-hover\",\n darkVariable: \"--fancy-surface-hover-dark\",\n light: \"var(--color-zinc-50)\",\n // Tailwind's `bg-zinc-800/50`, written out so a host's value is used as-is.\n dark: \"color-mix(in oklab, var(--color-zinc-800) 50%, transparent)\",\n description: \"The hover fill on nav items, list options and table rows. Added 5.53.1.\",\n },\n focus: {\n variable: \"--fancy-focus\",\n darkVariable: \"--fancy-focus-dark\",\n light: \"var(--color-blue-500)\",\n dark: \"var(--color-blue-400)\",\n description: \"The focus border and ring on form controls.\",\n },\n} as const;\n\nexport type ThemeTokenRole = keyof typeof THEME_TOKENS;\n"]}
|
package/dist/mobile-menu.cjs
CHANGED
|
@@ -4,7 +4,7 @@ var chunk3BBEVHSP_cjs = require('./chunk-3BBEVHSP.cjs');
|
|
|
4
4
|
require('./chunk-A2JUTNE6.cjs');
|
|
5
5
|
require('./chunk-T6YELZPJ.cjs');
|
|
6
6
|
require('./chunk-4GOOSZEK.cjs');
|
|
7
|
-
require('./chunk-
|
|
7
|
+
require('./chunk-UOG3O3KP.cjs');
|
|
8
8
|
require('./chunk-FQZE5N2N.cjs');
|
|
9
9
|
require('./chunk-MKHYENKR.cjs');
|
|
10
10
|
require('./chunk-QQKWI7QP.cjs');
|
package/dist/mobile-menu.js
CHANGED
|
@@ -2,7 +2,7 @@ export { MobileMenu, useMobileMenu } from './chunk-AE6ICNJR.js';
|
|
|
2
2
|
import './chunk-2BXMMVQS.js';
|
|
3
3
|
import './chunk-CPY7NHXM.js';
|
|
4
4
|
import './chunk-ZQ3VXRUY.js';
|
|
5
|
-
import './chunk-
|
|
5
|
+
import './chunk-MUV7OK3W.js';
|
|
6
6
|
import './chunk-3K2CEAI7.js';
|
|
7
7
|
import './chunk-5VMILVWD.js';
|
|
8
8
|
import './chunk-RUEDMYBF.js';
|
package/dist/modal.cjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkGB2EGMVQ_cjs = require('./chunk-GB2EGMVQ.cjs');
|
|
4
|
+
require('./chunk-RE3PMG47.cjs');
|
|
5
|
+
require('./chunk-UOG3O3KP.cjs');
|
|
5
6
|
require('./chunk-FQZE5N2N.cjs');
|
|
6
7
|
require('./chunk-MKHYENKR.cjs');
|
|
7
8
|
require('./chunk-TI7D4QDM.cjs');
|
|
@@ -12,11 +13,11 @@ require('./chunk-ZU5Q77OT.cjs');
|
|
|
12
13
|
|
|
13
14
|
Object.defineProperty(exports, "Modal", {
|
|
14
15
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunkGB2EGMVQ_cjs.Modal; }
|
|
16
17
|
});
|
|
17
18
|
Object.defineProperty(exports, "useModal", {
|
|
18
19
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
20
|
+
get: function () { return chunkGB2EGMVQ_cjs.useModal; }
|
|
20
21
|
});
|
|
21
22
|
//# sourceMappingURL=modal.cjs.map
|
|
22
23
|
//# sourceMappingURL=modal.cjs.map
|
package/dist/modal.d.cts
CHANGED
|
@@ -15,6 +15,8 @@ interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
|
15
15
|
interface ModalHeaderProps {
|
|
16
16
|
children: ReactNode;
|
|
17
17
|
className?: string;
|
|
18
|
+
/** Accessible name of the close button. Default `"Close"`; pass your locale's word. */
|
|
19
|
+
closeLabel?: string;
|
|
18
20
|
}
|
|
19
21
|
interface ModalBodyProps {
|
|
20
22
|
children: ReactNode;
|
|
@@ -25,7 +27,15 @@ interface ModalFooterProps {
|
|
|
25
27
|
className?: string;
|
|
26
28
|
}
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
/**
|
|
31
|
+
* The close button draws at 28px (20px icon + `p-1`) and HITS at 44px, the
|
|
32
|
+
* WCAG 2.5.5 (AAA) target: a `::before` overhangs it by 8px on every side. A
|
|
33
|
+
* pseudo-element is part of its button for hit-testing, so the look, the hover
|
|
34
|
+
* fill and the header's height are all unchanged — the header's `py-4` already
|
|
35
|
+
* has room for the overhang. A size option was the alternative; it would have
|
|
36
|
+
* left every existing Modal at 28px unless someone opted in.
|
|
37
|
+
*/
|
|
38
|
+
declare function ModalHeader({ children, className, closeLabel }: ModalHeaderProps): react.JSX.Element;
|
|
29
39
|
declare namespace ModalHeader {
|
|
30
40
|
var displayName: string;
|
|
31
41
|
}
|
package/dist/modal.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
|
15
15
|
interface ModalHeaderProps {
|
|
16
16
|
children: ReactNode;
|
|
17
17
|
className?: string;
|
|
18
|
+
/** Accessible name of the close button. Default `"Close"`; pass your locale's word. */
|
|
19
|
+
closeLabel?: string;
|
|
18
20
|
}
|
|
19
21
|
interface ModalBodyProps {
|
|
20
22
|
children: ReactNode;
|
|
@@ -25,7 +27,15 @@ interface ModalFooterProps {
|
|
|
25
27
|
className?: string;
|
|
26
28
|
}
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
/**
|
|
31
|
+
* The close button draws at 28px (20px icon + `p-1`) and HITS at 44px, the
|
|
32
|
+
* WCAG 2.5.5 (AAA) target: a `::before` overhangs it by 8px on every side. A
|
|
33
|
+
* pseudo-element is part of its button for hit-testing, so the look, the hover
|
|
34
|
+
* fill and the header's height are all unchanged — the header's `py-4` already
|
|
35
|
+
* has room for the overhang. A size option was the alternative; it would have
|
|
36
|
+
* left every existing Modal at 28px unless someone opted in.
|
|
37
|
+
*/
|
|
38
|
+
declare function ModalHeader({ children, className, closeLabel }: ModalHeaderProps): react.JSX.Element;
|
|
29
39
|
declare namespace ModalHeader {
|
|
30
40
|
var displayName: string;
|
|
31
41
|
}
|
package/dist/modal.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { Modal, useModal } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { Modal, useModal } from './chunk-26GRLVCQ.js';
|
|
2
|
+
import './chunk-HHCVBIMM.js';
|
|
3
|
+
import './chunk-MUV7OK3W.js';
|
|
3
4
|
import './chunk-3K2CEAI7.js';
|
|
4
5
|
import './chunk-5VMILVWD.js';
|
|
5
6
|
import './chunk-RBCMKPBX.js';
|
package/dist/sidebar.cjs
CHANGED
|
@@ -6,7 +6,7 @@ require('./chunk-I27K6NLX.cjs');
|
|
|
6
6
|
require('./chunk-A2JUTNE6.cjs');
|
|
7
7
|
require('./chunk-T6YELZPJ.cjs');
|
|
8
8
|
require('./chunk-4GOOSZEK.cjs');
|
|
9
|
-
require('./chunk-
|
|
9
|
+
require('./chunk-UOG3O3KP.cjs');
|
|
10
10
|
require('./chunk-FQZE5N2N.cjs');
|
|
11
11
|
require('./chunk-MKHYENKR.cjs');
|
|
12
12
|
require('./chunk-QQKWI7QP.cjs');
|
package/dist/sidebar.js
CHANGED
|
@@ -4,7 +4,7 @@ import './chunk-SV5BW3IA.js';
|
|
|
4
4
|
import './chunk-2BXMMVQS.js';
|
|
5
5
|
import './chunk-CPY7NHXM.js';
|
|
6
6
|
import './chunk-ZQ3VXRUY.js';
|
|
7
|
-
import './chunk-
|
|
7
|
+
import './chunk-MUV7OK3W.js';
|
|
8
8
|
import './chunk-3K2CEAI7.js';
|
|
9
9
|
import './chunk-5VMILVWD.js';
|
|
10
10
|
import './chunk-RUEDMYBF.js';
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/use-focus-trap.ts"],"names":[],"mappings":";;;AAEA,IAAM,kBAAA,GAAqB;AAAA,EACzB,SAAA;AAAA,EACA,wBAAA;AAAA,EACA,uBAAA;AAAA,EACA,0BAAA;AAAA,EACA,wBAAA;AAAA,EACA;AACF,CAAA,CAAE,KAAK,IAAI,CAAA;AAEJ,SAAS,YAAA,CACd,GAAA,EACA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,EAAmB,KAAA,EAAM;AAAA,IAC3B,CAAA;AAAA,EACF,CAAA,EAAG,CAAC,GAAA,EAAK,OAAO,CAAC,CAAA;AACnB","file":"chunk-5U2DZ7AV.js","sourcesContent":["import { useEffect, type RefObject } from \"react\";\n\nconst FOCUSABLE_SELECTOR = [\n \"a[href]\",\n \"button:not([disabled])\",\n \"input:not([disabled])\",\n \"textarea:not([disabled])\",\n \"select:not([disabled])\",\n \"[tabindex]:not([tabindex='-1'])\",\n].join(\", \");\n\nexport function useFocusTrap(\n ref: RefObject<HTMLElement | null>,\n enabled: boolean = true,\n): void {\n useEffect(() => {\n if (!enabled) return;\n\n const el = ref.current;\n if (!el) return;\n\n const previouslyFocused = document.activeElement as HTMLElement | null;\n\n const focusables = () =>\n Array.from(el.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR));\n\n // Focus first focusable element\n const first = focusables()[0];\n first?.focus();\n\n const listener = (event: KeyboardEvent) => {\n if (event.key !== \"Tab\") return;\n\n const items = focusables();\n if (items.length === 0) return;\n\n const firstItem = items[0];\n const lastItem = items[items.length - 1];\n\n if (event.shiftKey) {\n if (document.activeElement === firstItem) {\n event.preventDefault();\n lastItem.focus();\n }\n } else {\n if (document.activeElement === lastItem) {\n event.preventDefault();\n firstItem.focus();\n }\n }\n };\n\n el.addEventListener(\"keydown\", listener);\n\n return () => {\n el.removeEventListener(\"keydown\", listener);\n previouslyFocused?.focus();\n };\n }, [ref, enabled]);\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Drawer/Drawer.context.ts","../src/components/Drawer/DrawerHeader.tsx","../src/components/Drawer/DrawerBody.tsx","../src/components/Drawer/DrawerFooter.tsx","../src/components/Drawer/DrawerContainer.tsx","../src/components/Drawer/Drawer.tsx"],"names":["createContext","useContext","jsxs","cn","jsx","X","useRef","useCallback","useEscapeKey","useFocusTrap","useEffect","useAnimation","useMemo","Portal"],"mappings":";;;;;;;;;;;AAGO,IAAM,a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R,IAAA,EAAM,UAAA;AAAA,EACN,MAAA,EAAQ,YAAA;AAAA,EACR,SAAA,EAAW;AACb,CAAC","file":"chunk-7NRG77U5.cjs","sourcesContent":["import { createContext, useContext } from \"react\";\nimport type { DrawerContextValue } from \"./Drawer.types\";\n\nexport const DrawerContext = createContext<DrawerContextValue | null>(null);\n\nexport function useDrawer(): DrawerContextValue {\n const ctx = useContext(DrawerContext);\n if (!ctx) {\n throw new Error(\"Drawer compound components must be used within <Drawer>\");\n }\n return ctx;\n}\n","import { X } from \"lucide-react\";\nimport { cn } from \"../../utils/cn\";\nimport { useDrawer } from \"./Drawer.context\";\nimport type { DrawerHeaderProps } from \"./Drawer.types\";\n\nexport function DrawerHeader({ children, closable = true, className }: DrawerHeaderProps) {\n const { close } = useDrawer();\n\n return (\n <div\n data-react-fancy-drawer-header=\"\"\n className={cn(\n \"flex shrink-0 items-center justify-between border-b border-[color:var(--fancy-border,var(--color-zinc-200))] px-4 py-3 dark:border-[color:var(--fancy-border-dark,var(--color-zinc-700))]\",\n className,\n )}\n >\n <div className=\"text-sm font-semibold text-[color:var(--fancy-text,var(--color-zinc-900))] dark:text-[color:var(--fancy-text-dark,var(--color-zinc-100))]\">{children}</div>\n {closable ? (\n <button\n type=\"button\"\n onClick={close}\n className=\"rounded-lg p-1 text-zinc-400 transition-colors hover:bg-[color:var(--fancy-surface-muted,var(--color-zinc-100))] hover:text-zinc-600 dark:hover:bg-[color:var(--fancy-surface-muted-dark,var(--color-zinc-800))] dark:hover:text-zinc-300\"\n aria-label=\"Close\"\n >\n <X size={18} />\n </button>\n ) : null}\n </div>\n );\n}\n\nDrawerHeader.displayName = \"DrawerHeader\";\n","import { cn } from \"../../utils/cn\";\nimport type { DrawerBodyProps } from \"./Drawer.types\";\n\nexport function DrawerBody({ children, className }: DrawerBodyProps) {\n return (\n <div\n data-react-fancy-drawer-body=\"\"\n className={cn(\"min-h-0 flex-1 overflow-auto px-4 py-3 text-[color:var(--fancy-text-soft,var(--color-zinc-700))] dark:text-[color:var(--fancy-text-soft-dark,var(--color-zinc-300))]\", className)}\n >\n {children}\n </div>\n );\n}\n\nDrawerBody.displayName = \"DrawerBody\";\n","import { cn } from \"../../utils/cn\";\nimport type { DrawerFooterProps } from \"./Drawer.types\";\n\nexport function DrawerFooter({ children, className }: DrawerFooterProps) {\n return (\n <div\n data-react-fancy-drawer-footer=\"\"\n className={cn(\n \"flex shrink-0 items-center justify-end gap-2 border-t border-[color:var(--fancy-border,var(--color-zinc-200))] px-4 py-3 dark:border-[color:var(--fancy-border-dark,var(--color-zinc-700))]\",\n className,\n )}\n >\n {children}\n </div>\n );\n}\n\nDrawerFooter.displayName = \"DrawerFooter\";\n","import { cn } from \"../../utils/cn\";\nimport type { DrawerContainerProps } from \"./Drawer.types\";\n\n/**\n * The anchor for `<Drawer attach=\"container\">`.\n *\n * A container-attached drawer positions itself `absolute`, which resolves\n * against the nearest *positioned* ancestor — so without `relative` somewhere\n * above it, the drawer silently escapes to the viewport and looks like it\n * ignored `attach` entirely. This wrapper supplies `relative` + `overflow-hidden`\n * so the panel slides within the box rather than out of it.\n *\n * <Drawer.Container className=\"h-80 rounded-xl border\">\n * <YourContent />\n * <Drawer attach=\"container\" side=\"bottom\" open={open} onClose={close}>\n * <Drawer.Body>Filters</Drawer.Body>\n * </Drawer>\n * </Drawer.Container>\n *\n * Any element works as long as it is positioned — this is the shortcut, not a\n * requirement. Wrapping a Card, a layout pane, or a prompt-input shell in\n * `relative overflow-hidden` does the same job.\n */\nexport function DrawerContainer({ children, className, ...rest }: DrawerContainerProps) {\n return (\n <div\n data-react-fancy-drawer-container=\"\"\n {...rest}\n className={cn(\"relative overflow-hidden\", className)}\n >\n {children}\n </div>\n );\n}\n\nDrawerContainer.displayName = \"DrawerContainer\";\n","import { useCallback, useEffect, useMemo, useRef } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Portal } from \"../Portal\";\nimport { DrawerContext } from \"./Drawer.context\";\nimport { DrawerHeader } from \"./DrawerHeader\";\nimport { DrawerBody } from \"./DrawerBody\";\nimport { DrawerFooter } from \"./DrawerFooter\";\nimport { DrawerContainer } from \"./DrawerContainer\";\nimport { useFocusTrap } from \"../../hooks/use-focus-trap\";\nimport { useEscapeKey } from \"../../hooks/use-escape-key\";\nimport { useAnimation } from \"../../hooks/use-animation\";\nimport type { DrawerProps, DrawerSide } from \"./Drawer.types\";\n\n/**\n * `size` addresses the drawer's own axis: width on the horizontal edges,\n * height on the vertical ones. Keeping one scale across both means `size=\"lg\"`\n * does not have to be re-learned when a drawer moves from the side to the\n * bottom.\n */\nconst WIDTH = {\n sm: \"w-64\",\n md: \"w-80\",\n lg: \"w-96\",\n xl: \"w-[32rem]\",\n full: \"w-full\",\n} as const;\n\nconst HEIGHT = {\n sm: \"h-32\",\n md: \"h-64\",\n lg: \"h-96\",\n xl: \"h-[32rem]\",\n full: \"h-full\",\n} as const;\n\nconst ANCHOR: Record<DrawerSide, string> = {\n start: \"inset-y-0 start-0\",\n end: \"inset-y-0 end-0\",\n left: \"inset-y-0 left-0\",\n right: \"inset-y-0 right-0\",\n top: \"inset-x-0 top-0\",\n bottom: \"inset-x-0 bottom-0\",\n};\n\nconst ENTER: Record<DrawerSide, string> = {\n start: \"fancy-slide-in-start\",\n end: \"fancy-slide-in-end\",\n left: \"fancy-slide-in-left\",\n right: \"fancy-slide-in-right\",\n top: \"fancy-slide-in-top\",\n bottom: \"fancy-slide-in-bottom\",\n};\n\nconst EXIT: Record<DrawerSide, string> = {\n start: \"fancy-slide-out-start\",\n end: \"fancy-slide-out-end\",\n left: \"fancy-slide-out-left\",\n right: \"fancy-slide-out-right\",\n top: \"fancy-slide-out-top\",\n bottom: \"fancy-slide-out-bottom\",\n};\n\n/** The panel's edge shadow reads as depth away from the anchored edge. */\nconst EDGE: Record<DrawerSide, string> = {\n start: \"border-e\",\n end: \"border-s\",\n left: \"border-r\",\n right: \"border-l\",\n top: \"border-b\",\n bottom: \"border-t\",\n};\n\nfunction DrawerRoot({\n children,\n open,\n onClose,\n side = \"end\",\n size = \"md\",\n attach = \"viewport\",\n backdrop = true,\n dismissOnBackdrop = true,\n dismissOnEscape = true,\n className,\n ...rest\n}: DrawerProps) {\n const panelRef = useRef<HTMLDivElement>(null);\n const horizontal = side !== \"top\" && side !== \"bottom\";\n const isViewport = attach === \"viewport\";\n\n const close = useCallback(() => onClose(), [onClose]);\n useEscapeKey(close, open && dismissOnEscape);\n\n // A container-attached drawer is a panel, not a dialog — trapping focus in it\n // would strand keyboard users inside a Card. Only the viewport form is modal.\n useFocusTrap(panelRef, open && isViewport);\n\n useEffect(() => {\n if (!open || !isViewport) return;\n const original = document.body.style.overflow;\n document.body.style.overflow = \"hidden\";\n return () => {\n document.body.style.overflow = original;\n };\n }, [open, isViewport]);\n\n const { mounted, className: animClass, ref: animRef } = useAnimation({\n open,\n enterClass: ENTER[side],\n exitClass: EXIT[side],\n });\n\n const ctx = useMemo(() => ({ open, close, side }), [open, close, side]);\n\n if (!mounted) return null;\n\n const frame = (\n <div\n data-react-fancy-drawer-frame=\"\"\n className={cn(isViewport ? \"fixed inset-0 z-50\" : \"absolute inset-0 z-20\", !backdrop && \"pointer-events-none\")}\n >\n {backdrop ? (\n <div\n data-react-fancy-drawer-backdrop=\"\"\n className={cn(\n \"absolute inset-0 bg-black/40 transition-opacity\",\n isViewport && \"backdrop-blur-sm\",\n open ? \"opacity-100\" : \"opacity-0\",\n )}\n onClick={dismissOnBackdrop ? close : undefined}\n aria-hidden=\"true\"\n />\n ) : null}\n\n <div\n ref={(node) => {\n panelRef.current = node;\n (animRef as React.MutableRefObject<HTMLElement | null>).current = node;\n }}\n data-react-fancy-drawer=\"\"\n data-side={side}\n role=\"dialog\"\n aria-modal={isViewport || undefined}\n {...rest}\n className={cn(\n \"pointer-events-auto absolute flex flex-col border-[color:var(--fancy-border,var(--color-zinc-200))] bg-[color:var(--fancy-surface,var(--color-white))] shadow-xl dark:border-[color:var(--fancy-border-dark,var(--color-zinc-700))] dark:bg-[color:var(--fancy-surface-dark,var(--color-zinc-900))]\",\n ANCHOR[side],\n EDGE[side],\n horizontal ? WIDTH[size] : HEIGHT[size],\n // Cross-axis fills the anchor; the main axis is capped so a viewport\n // drawer can never grow past the screen on a small device.\n horizontal ? \"h-full\" : \"w-full\",\n isViewport && (horizontal ? \"max-w-[90vw]\" : \"max-h-[90vh]\"),\n !isViewport && (horizontal ? \"max-w-full\" : \"max-h-full\"),\n animClass,\n className,\n )}\n >\n {children}\n </div>\n </div>\n );\n\n return (\n <DrawerContext.Provider value={ctx}>\n {isViewport ? <Portal>{frame}</Portal> : frame}\n </DrawerContext.Provider>\n );\n}\n\nexport const Drawer = Object.assign(DrawerRoot, {\n Header: DrawerHeader,\n Body: DrawerBody,\n Footer: DrawerFooter,\n Container: DrawerContainer,\n});\n"]}
|