@nexus-cross/design-system 2.0.2 → 2.0.4
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/claude-rules/nexus/CLAUDE.md +109 -0
- package/cursor-rules/CLAUDE.md +5 -0
- package/cursor-rules/nexus-project-setup.mdc +106 -6
- package/cursor-rules/nexus-ui-api.mdc +60 -3
- package/dist/chunks/{chunk-JICW6KWH.js → chunk-7G7U4DP2.js} +1 -1
- package/dist/chunks/{chunk-3VFBPFZF.mjs → chunk-7WWQ5DS3.mjs} +10 -5
- package/dist/chunks/{chunk-HHXDOKXY.js → chunk-F24AY3HI.js} +2 -2
- package/dist/chunks/{chunk-6H7V2I3X.mjs → chunk-FY2N42XN.mjs} +6 -1
- package/dist/chunks/{chunk-3NSJMG3G.mjs → chunk-JFZLKFFM.mjs} +1 -1
- package/dist/chunks/{chunk-XEHFB62A.js → chunk-NRO7I4EI.js} +2 -6
- package/dist/chunks/{chunk-LNC3TV6N.mjs → chunk-P4JV4WRB.mjs} +1 -1
- package/dist/chunks/{chunk-U53UA76K.js → chunk-R744EATX.js} +26 -21
- package/dist/chunks/{chunk-HUPAHDJ7.js → chunk-TAHDSSA6.js} +6 -0
- package/dist/chunks/{chunk-YEWKPWK3.mjs → chunk-U6OEUBIF.mjs} +2 -6
- package/dist/chunks/{chunk-VCN7DMCQ.js → chunk-USPFWZ7H.js} +1 -1
- package/dist/chunks/{chunk-U56AGSLE.mjs → chunk-WBCXHGRL.mjs} +2 -2
- package/dist/hooks/useCheckDevice.d.ts.map +1 -1
- package/dist/hooks/useCheckDevice.js +2 -2
- package/dist/hooks/useCheckDevice.mjs +1 -1
- package/dist/hooks/useDraggableBottomSheet.js +2 -2
- package/dist/hooks/useDraggableBottomSheet.mjs +1 -1
- package/dist/hooks/useModal.js +2 -2
- package/dist/hooks/useModal.mjs +1 -1
- package/dist/image-upload.js +3 -3
- package/dist/image-upload.mjs +1 -1
- package/dist/index.js +19 -19
- package/dist/index.mjs +5 -5
- package/dist/modal/components/ModalContainer.d.ts.map +1 -1
- package/dist/modal/components/ModalTemplate.d.ts +1 -0
- package/dist/modal/components/ModalTemplate.d.ts.map +1 -1
- package/dist/modal/constants.d.ts +14 -0
- package/dist/modal/constants.d.ts.map +1 -1
- package/dist/modal/index.js +14 -14
- package/dist/modal/index.mjs +4 -4
- package/dist/schemas/_all.json +9 -4
- package/dist/schemas/modal.d.ts +3 -0
- package/dist/schemas/modal.d.ts.map +1 -1
- package/dist/schemas/modalTemplate.json +9 -4
- package/dist/schemas.js +17 -4
- package/dist/schemas.mjs +17 -4
- package/dist/styles/.generated/built.d.ts +1 -1
- package/dist/styles/.generated/built.d.ts.map +1 -1
- package/dist/styles/layer.js +2 -2
- package/dist/styles/layer.mjs +1 -1
- package/dist/styles.css +15 -3
- package/dist/styles.js +2 -2
- package/dist/styles.layered.css +15 -3
- package/dist/styles.mjs +1 -1
- package/dist/tokens/company.css +1 -1
- package/dist/tokens/css.css +1 -1
- package/dist/tokens-domains/gamehub-vars.css +122 -0
- package/dist/tokens-domains/gamehub.css +121 -0
- package/dist/tokens-domains/prediction-vars.css +1 -1
- package/dist/tokens-domains/prediction.css +1 -1
- package/package.json +4 -5
package/dist/schemas/modal.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare const modalTemplatePropsSchema: z.ZodObject<{
|
|
|
7
7
|
dimClose: z.ZodDefault<z.ZodBoolean>;
|
|
8
8
|
hideHeader: z.ZodDefault<z.ZodBoolean>;
|
|
9
9
|
hideFooter: z.ZodDefault<z.ZodBoolean>;
|
|
10
|
+
hideCloseBtn: z.ZodDefault<z.ZodBoolean>;
|
|
10
11
|
footer: z.ZodOptional<z.ZodAny>;
|
|
11
12
|
animation: z.ZodOptional<z.ZodObject<{
|
|
12
13
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -44,6 +45,7 @@ export declare const modalTemplatePropsSchema: z.ZodObject<{
|
|
|
44
45
|
layout: "draggable" | "default" | "bottom-sheet" | "slide-left" | "slide-right" | "full-page" | "full-page-reverse";
|
|
45
46
|
hideHeader: boolean;
|
|
46
47
|
hideFooter: boolean;
|
|
48
|
+
hideCloseBtn: boolean;
|
|
47
49
|
enableDrag: boolean;
|
|
48
50
|
showDim: boolean;
|
|
49
51
|
dimClose: boolean;
|
|
@@ -85,6 +87,7 @@ export declare const modalTemplatePropsSchema: z.ZodObject<{
|
|
|
85
87
|
desc?: any;
|
|
86
88
|
hideHeader?: boolean | undefined;
|
|
87
89
|
hideFooter?: boolean | undefined;
|
|
90
|
+
hideCloseBtn?: boolean | undefined;
|
|
88
91
|
innerClassName?: string | undefined;
|
|
89
92
|
bodyClassName?: string | undefined;
|
|
90
93
|
footerClassName?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../src/schemas/modal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,eAAO,MAAM,wBAAwB
|
|
1
|
+
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../src/schemas/modal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgFlC,CAAC;AAEJ,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BzB,CAAC"}
|
|
@@ -44,6 +44,11 @@
|
|
|
44
44
|
"default": true,
|
|
45
45
|
"description": "Hide footer"
|
|
46
46
|
},
|
|
47
|
+
"hideCloseBtn": {
|
|
48
|
+
"type": "boolean",
|
|
49
|
+
"default": false,
|
|
50
|
+
"description": "Hide the X close button in the header"
|
|
51
|
+
},
|
|
47
52
|
"footer": {
|
|
48
53
|
"description": "Custom footer (ReactElement)"
|
|
49
54
|
},
|
|
@@ -95,15 +100,15 @@
|
|
|
95
100
|
},
|
|
96
101
|
"className": {
|
|
97
102
|
"type": "string",
|
|
98
|
-
"description": "Root wrapper style"
|
|
103
|
+
"description": "Root wrapper style — applied to the full-screen `position: fixed; inset: 0` flex container that centers the modal. NOTE: width / max-width / height utilities (`w-[400px]`, `max-w-[92vw]`, `h-*`) MUST NOT go here — they will resize the wrap layer, not the panel. Put sizing on `innerClassName` instead."
|
|
99
104
|
},
|
|
100
105
|
"innerClassName": {
|
|
101
106
|
"type": "string",
|
|
102
|
-
"description": "Modal
|
|
107
|
+
"description": "Modal panel (the actual dialog box) style — apply ALL sizing utilities here: `w-[400px]`, `max-w-[92vw]`, `min-h-*`, `max-h-[80vh]`, `rounded-*`, panel background, etc. This is the most common override point."
|
|
103
108
|
},
|
|
104
109
|
"bodyClassName": {
|
|
105
110
|
"type": "string",
|
|
106
|
-
"description": "Body area style"
|
|
111
|
+
"description": "Body area style (inside the panel, between header and footer)"
|
|
107
112
|
},
|
|
108
113
|
"footerClassName": {
|
|
109
114
|
"type": "string",
|
|
@@ -119,7 +124,7 @@
|
|
|
119
124
|
}
|
|
120
125
|
},
|
|
121
126
|
"additionalProperties": false,
|
|
122
|
-
"description": "Modal template. All modal components must be wrapped with ModalTemplate.\n\nWHEN TO USE:\n • Force user decision (delete confirm, submit confirm, blocking dialog)\n • Long form/flow that needs full attention\n • Side panel that doesn't block main flow → Drawer instead\n • Inline contextual UI → Popover instead\n • Short hint → Tooltip instead\n\nPREFERRED API: use modal() / useModal() imperative API rather than mounting <ModalTemplate> directly. modal() handles stacking, focus return, ESC, and background scroll automatically.\n\nANTI-PATTERNS:\n ✗ Custom <div className=\"fixed inset-0\"> → modal() (loses focus trap, a11y)\n ✗ Direct <ModalTemplate> mount in render tree → wrap with modal()\n ✗ Modal with no title for screen readers → always pass title prop\n ✗ Multiple modals stacking confusingly → use isAlone:true to close prior modals"
|
|
127
|
+
"description": "Modal template. All modal components must be wrapped with ModalTemplate.\n\nWHEN TO USE:\n • Force user decision (delete confirm, submit confirm, blocking dialog)\n • Long form/flow that needs full attention\n • Side panel that doesn't block main flow → Drawer instead\n • Inline contextual UI → Popover instead\n • Short hint → Tooltip instead\n\nPREFERRED API: use modal() / useModal() imperative API rather than mounting <ModalTemplate> directly. modal() handles stacking, focus return, ESC, and background scroll automatically.\n\nSIZING (must read — most common AI mistake):\n • The modal has TWO layers:\n 1. wrap = full-screen `position: fixed; inset: 0` flex container → controlled by `className`\n 2. panel = the actual dialog box rendered at the center → controlled by `innerClassName`\n • Sizing utilities (`w-*`, `max-w-*`, `min-w-*`, `h-*`, `max-h-*`) MUST go on `innerClassName`.\n • Putting `w-[400px] max-w-[92vw]` on `className` shrinks the wrap (the centering layer), NOT the panel — the panel keeps its default width and the modal looks broken.\n\nANTI-PATTERNS:\n ✗ Custom <div className=\"fixed inset-0\"> → modal() (loses focus trap, a11y)\n ✗ Direct <ModalTemplate> mount in render tree → wrap with modal()\n ✗ Modal with no title for screen readers → always pass title prop\n ✗ Multiple modals stacking confusingly → use isAlone:true to close prior modals\n ✗ <ModalTemplate className=\"w-[400px] max-w-[92vw]\"> → put sizing on `innerClassName` instead"
|
|
123
128
|
}
|
|
124
129
|
},
|
|
125
130
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
package/dist/schemas.js
CHANGED
|
@@ -1331,15 +1331,20 @@ var modalTemplatePropsSchema = zod.z.object({
|
|
|
1331
1331
|
dimClose: zod.z.boolean().default(true).describe("Close on dim click"),
|
|
1332
1332
|
hideHeader: zod.z.boolean().default(false).describe("Hide header"),
|
|
1333
1333
|
hideFooter: zod.z.boolean().default(true).describe("Hide footer"),
|
|
1334
|
+
hideCloseBtn: zod.z.boolean().default(false).describe("Hide the X close button in the header"),
|
|
1334
1335
|
footer: zod.z.any().optional().describe("Custom footer (ReactElement)"),
|
|
1335
1336
|
animation: animationOptionsSchema.optional().describe("Modal animation"),
|
|
1336
1337
|
enableDrag: zod.z.boolean().default(true).describe("Enable drag (bottom-sheet/draggable layouts)"),
|
|
1337
1338
|
dragPersistKey: zod.z.string().optional().describe("Drag position persistence key"),
|
|
1338
1339
|
close: zod.z.any().describe("Modal close function (isAnimation?: boolean) => void (auto-injected)"),
|
|
1339
1340
|
children: zod.z.any().describe("Modal body (ReactNode, required)"),
|
|
1340
|
-
className: zod.z.string().optional().describe(
|
|
1341
|
-
|
|
1342
|
-
|
|
1341
|
+
className: zod.z.string().optional().describe(
|
|
1342
|
+
"Root wrapper style \u2014 applied to the full-screen `position: fixed; inset: 0` flex container that centers the modal. NOTE: width / max-width / height utilities (`w-[400px]`, `max-w-[92vw]`, `h-*`) MUST NOT go here \u2014 they will resize the wrap layer, not the panel. Put sizing on `innerClassName` instead."
|
|
1343
|
+
),
|
|
1344
|
+
innerClassName: zod.z.string().optional().describe(
|
|
1345
|
+
"Modal panel (the actual dialog box) style \u2014 apply ALL sizing utilities here: `w-[400px]`, `max-w-[92vw]`, `min-h-*`, `max-h-[80vh]`, `rounded-*`, panel background, etc. This is the most common override point."
|
|
1346
|
+
),
|
|
1347
|
+
bodyClassName: zod.z.string().optional().describe("Body area style (inside the panel, between header and footer)"),
|
|
1343
1348
|
footerClassName: zod.z.string().optional().describe("Footer area style"),
|
|
1344
1349
|
dimClassName: zod.z.string().optional().describe("Dim overlay style"),
|
|
1345
1350
|
headerClassName: zod.z.string().optional().describe("Header area style")
|
|
@@ -1355,11 +1360,19 @@ WHEN TO USE:
|
|
|
1355
1360
|
|
|
1356
1361
|
PREFERRED API: use modal() / useModal() imperative API rather than mounting <ModalTemplate> directly. modal() handles stacking, focus return, ESC, and background scroll automatically.
|
|
1357
1362
|
|
|
1363
|
+
SIZING (must read \u2014 most common AI mistake):
|
|
1364
|
+
\u2022 The modal has TWO layers:
|
|
1365
|
+
1. wrap = full-screen \`position: fixed; inset: 0\` flex container \u2192 controlled by \`className\`
|
|
1366
|
+
2. panel = the actual dialog box rendered at the center \u2192 controlled by \`innerClassName\`
|
|
1367
|
+
\u2022 Sizing utilities (\`w-*\`, \`max-w-*\`, \`min-w-*\`, \`h-*\`, \`max-h-*\`) MUST go on \`innerClassName\`.
|
|
1368
|
+
\u2022 Putting \`w-[400px] max-w-[92vw]\` on \`className\` shrinks the wrap (the centering layer), NOT the panel \u2014 the panel keeps its default width and the modal looks broken.
|
|
1369
|
+
|
|
1358
1370
|
ANTI-PATTERNS:
|
|
1359
1371
|
\u2717 Custom <div className="fixed inset-0"> \u2192 modal() (loses focus trap, a11y)
|
|
1360
1372
|
\u2717 Direct <ModalTemplate> mount in render tree \u2192 wrap with modal()
|
|
1361
1373
|
\u2717 Modal with no title for screen readers \u2192 always pass title prop
|
|
1362
|
-
\u2717 Multiple modals stacking confusingly \u2192 use isAlone:true to close prior modals
|
|
1374
|
+
\u2717 Multiple modals stacking confusingly \u2192 use isAlone:true to close prior modals
|
|
1375
|
+
\u2717 <ModalTemplate className="w-[400px] max-w-[92vw]"> \u2192 put sizing on \`innerClassName\` instead`
|
|
1363
1376
|
);
|
|
1364
1377
|
var modalCallSchema = zod.z.object({
|
|
1365
1378
|
component: zod.z.any().describe("Modal component (required). Automatically receives close/resolve as props"),
|
package/dist/schemas.mjs
CHANGED
|
@@ -1329,15 +1329,20 @@ var modalTemplatePropsSchema = z.object({
|
|
|
1329
1329
|
dimClose: z.boolean().default(true).describe("Close on dim click"),
|
|
1330
1330
|
hideHeader: z.boolean().default(false).describe("Hide header"),
|
|
1331
1331
|
hideFooter: z.boolean().default(true).describe("Hide footer"),
|
|
1332
|
+
hideCloseBtn: z.boolean().default(false).describe("Hide the X close button in the header"),
|
|
1332
1333
|
footer: z.any().optional().describe("Custom footer (ReactElement)"),
|
|
1333
1334
|
animation: animationOptionsSchema.optional().describe("Modal animation"),
|
|
1334
1335
|
enableDrag: z.boolean().default(true).describe("Enable drag (bottom-sheet/draggable layouts)"),
|
|
1335
1336
|
dragPersistKey: z.string().optional().describe("Drag position persistence key"),
|
|
1336
1337
|
close: z.any().describe("Modal close function (isAnimation?: boolean) => void (auto-injected)"),
|
|
1337
1338
|
children: z.any().describe("Modal body (ReactNode, required)"),
|
|
1338
|
-
className: z.string().optional().describe(
|
|
1339
|
-
|
|
1340
|
-
|
|
1339
|
+
className: z.string().optional().describe(
|
|
1340
|
+
"Root wrapper style \u2014 applied to the full-screen `position: fixed; inset: 0` flex container that centers the modal. NOTE: width / max-width / height utilities (`w-[400px]`, `max-w-[92vw]`, `h-*`) MUST NOT go here \u2014 they will resize the wrap layer, not the panel. Put sizing on `innerClassName` instead."
|
|
1341
|
+
),
|
|
1342
|
+
innerClassName: z.string().optional().describe(
|
|
1343
|
+
"Modal panel (the actual dialog box) style \u2014 apply ALL sizing utilities here: `w-[400px]`, `max-w-[92vw]`, `min-h-*`, `max-h-[80vh]`, `rounded-*`, panel background, etc. This is the most common override point."
|
|
1344
|
+
),
|
|
1345
|
+
bodyClassName: z.string().optional().describe("Body area style (inside the panel, between header and footer)"),
|
|
1341
1346
|
footerClassName: z.string().optional().describe("Footer area style"),
|
|
1342
1347
|
dimClassName: z.string().optional().describe("Dim overlay style"),
|
|
1343
1348
|
headerClassName: z.string().optional().describe("Header area style")
|
|
@@ -1353,11 +1358,19 @@ WHEN TO USE:
|
|
|
1353
1358
|
|
|
1354
1359
|
PREFERRED API: use modal() / useModal() imperative API rather than mounting <ModalTemplate> directly. modal() handles stacking, focus return, ESC, and background scroll automatically.
|
|
1355
1360
|
|
|
1361
|
+
SIZING (must read \u2014 most common AI mistake):
|
|
1362
|
+
\u2022 The modal has TWO layers:
|
|
1363
|
+
1. wrap = full-screen \`position: fixed; inset: 0\` flex container \u2192 controlled by \`className\`
|
|
1364
|
+
2. panel = the actual dialog box rendered at the center \u2192 controlled by \`innerClassName\`
|
|
1365
|
+
\u2022 Sizing utilities (\`w-*\`, \`max-w-*\`, \`min-w-*\`, \`h-*\`, \`max-h-*\`) MUST go on \`innerClassName\`.
|
|
1366
|
+
\u2022 Putting \`w-[400px] max-w-[92vw]\` on \`className\` shrinks the wrap (the centering layer), NOT the panel \u2014 the panel keeps its default width and the modal looks broken.
|
|
1367
|
+
|
|
1356
1368
|
ANTI-PATTERNS:
|
|
1357
1369
|
\u2717 Custom <div className="fixed inset-0"> \u2192 modal() (loses focus trap, a11y)
|
|
1358
1370
|
\u2717 Direct <ModalTemplate> mount in render tree \u2192 wrap with modal()
|
|
1359
1371
|
\u2717 Modal with no title for screen readers \u2192 always pass title prop
|
|
1360
|
-
\u2717 Multiple modals stacking confusingly \u2192 use isAlone:true to close prior modals
|
|
1372
|
+
\u2717 Multiple modals stacking confusingly \u2192 use isAlone:true to close prior modals
|
|
1373
|
+
\u2717 <ModalTemplate className="w-[400px] max-w-[92vw]"> \u2192 put sizing on \`innerClassName\` instead`
|
|
1361
1374
|
);
|
|
1362
1375
|
var modalCallSchema = z.object({
|
|
1363
1376
|
component: z.any().describe("Modal component (required). Automatically receives close/resolve as props"),
|