@selfhelp/shared 1.14.20 → 1.14.24
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 +109 -0
- package/dist/{common-DMm4kymA.d.mts → common-qaDIAYS3.d.mts} +5 -4
- package/dist/{common-DMm4kymA.d.ts → common-qaDIAYS3.d.ts} +5 -4
- package/dist/index.d.mts +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.js +99 -175
- package/dist/index.mjs +99 -172
- package/dist/plugin-sdk/index.d.mts +2 -2
- package/dist/plugin-sdk/index.d.ts +2 -2
- package/dist/plugin-sdk/index.js +90 -91
- package/dist/plugin-sdk/index.mjs +90 -91
- package/dist/registry/index.d.mts +3 -3
- package/dist/registry/index.d.ts +3 -3
- package/dist/registry/index.js +90 -90
- package/dist/registry/index.mjs +90 -90
- package/dist/{styles.registry-B8IaEULk.d.ts → styles.registry-4W0LzmZB.d.mts} +194 -365
- package/dist/{styles.registry-DhkxrV2-.d.mts → styles.registry-D6xMm5VR.d.ts} +194 -365
- package/dist/theme/index.d.mts +42 -91
- package/dist/theme/index.d.ts +42 -91
- package/dist/theme/index.js +9 -85
- package/dist/theme/index.mjs +9 -82
- package/dist/theme/tailwind.d.mts +2 -2
- package/dist/theme/tailwind.d.ts +2 -2
- package/package.json +1 -1
- package/src/plugin-sdk/define.ts +0 -1
- package/src/registry/__tests__/platform.test.ts +0 -4
- package/src/registry/__tests__/registry.test.ts +0 -2
- package/src/registry/styles.registry.ts +90 -96
- package/src/theme/__tests__/mantineVariant.test.ts +2 -2
- package/src/theme/__tests__/semantic.test.ts +34 -71
- package/src/theme/mantineVariant.ts +3 -3
- package/src/theme/semantic.ts +45 -185
- package/src/theme/tailwind.ts +2 -2
- package/src/theme/tokens.ts +3 -3
- package/src/types/__tests__/mobile-adapters.test.ts +1 -1
- package/src/types/mantine/common.ts +4 -3
- package/src/types/mobile-adapters.ts +4 -4
- package/src/types/styles/auth.ts +10 -10
- package/src/types/styles/base.ts +2 -2
- package/src/types/styles/composite.ts +7 -9
- package/src/types/styles/error.ts +9 -9
- package/src/types/styles/forms.ts +74 -58
- package/src/types/styles/interactive.ts +34 -32
- package/src/types/styles/layout.ts +42 -42
- package/src/types/styles/media.ts +6 -6
- package/src/types/styles/typography.ts +13 -13
- package/src/utils/spacing.ts +1 -1
package/dist/theme/index.js
CHANGED
|
@@ -34,9 +34,6 @@ __export(theme_exports, {
|
|
|
34
34
|
mapAccordionVariantToHeroUiVariant: () => mapAccordionVariantToHeroUiVariant,
|
|
35
35
|
mapChipVariantToHeroUiVariant: () => mapChipVariantToHeroUiVariant,
|
|
36
36
|
mapDividerVariantToReactNative: () => mapDividerVariantToReactNative,
|
|
37
|
-
mapIntentToHeroUiButtonVariant: () => mapIntentToHeroUiButtonVariant,
|
|
38
|
-
mapIntentToHeroUiColor: () => mapIntentToHeroUiColor,
|
|
39
|
-
mapIntentToMantine: () => mapIntentToMantine,
|
|
40
37
|
mapMantineColorToHeroUiButtonVariant: () => mapMantineColorToHeroUiButtonVariant,
|
|
41
38
|
mapMantineColorToHeroUiColor: () => mapMantineColorToHeroUiColor,
|
|
42
39
|
mapMantineVariantToHeroUiButtonVariant: () => mapMantineVariantToHeroUiButtonVariant,
|
|
@@ -214,14 +211,6 @@ var sharedTailwindPreset = {
|
|
|
214
211
|
var FULL_RADIUS_PX = 9999;
|
|
215
212
|
var SEMANTIC_SIZES = ["sm", "md", "lg"];
|
|
216
213
|
var SEMANTIC_RADII = ["none", "sm", "md", "lg", "full"];
|
|
217
|
-
var SEMANTIC_INTENTS = [
|
|
218
|
-
"primary",
|
|
219
|
-
"secondary",
|
|
220
|
-
"success",
|
|
221
|
-
"warning",
|
|
222
|
-
"danger",
|
|
223
|
-
"neutral"
|
|
224
|
-
];
|
|
225
214
|
function mapSizeToMantine(size) {
|
|
226
215
|
return size;
|
|
227
216
|
}
|
|
@@ -277,63 +266,6 @@ function mapSpacingToPx(spacing2) {
|
|
|
277
266
|
if (spacing2 === "none") return 0;
|
|
278
267
|
return SPACING_PX[spacing2];
|
|
279
268
|
}
|
|
280
|
-
function mapIntentToMantine(intent) {
|
|
281
|
-
if (!intent) return void 0;
|
|
282
|
-
switch (intent) {
|
|
283
|
-
case "primary":
|
|
284
|
-
return { color: "blue", variant: "filled" };
|
|
285
|
-
case "secondary":
|
|
286
|
-
return { color: "gray", variant: "light" };
|
|
287
|
-
case "success":
|
|
288
|
-
return { color: "green", variant: "filled" };
|
|
289
|
-
case "warning":
|
|
290
|
-
return { color: "yellow", variant: "filled" };
|
|
291
|
-
case "danger":
|
|
292
|
-
return { color: "red", variant: "filled" };
|
|
293
|
-
case "neutral":
|
|
294
|
-
return { color: "gray", variant: "default" };
|
|
295
|
-
default:
|
|
296
|
-
return void 0;
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
function mapIntentToHeroUiButtonVariant(intent) {
|
|
300
|
-
if (!intent) return void 0;
|
|
301
|
-
switch (intent) {
|
|
302
|
-
case "primary":
|
|
303
|
-
return "primary";
|
|
304
|
-
case "secondary":
|
|
305
|
-
return "secondary";
|
|
306
|
-
case "success":
|
|
307
|
-
return "primary";
|
|
308
|
-
case "warning":
|
|
309
|
-
return "primary";
|
|
310
|
-
case "danger":
|
|
311
|
-
return "danger";
|
|
312
|
-
case "neutral":
|
|
313
|
-
return "secondary";
|
|
314
|
-
default:
|
|
315
|
-
return void 0;
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
function mapIntentToHeroUiColor(intent) {
|
|
319
|
-
if (!intent) return void 0;
|
|
320
|
-
switch (intent) {
|
|
321
|
-
case "primary":
|
|
322
|
-
return "accent";
|
|
323
|
-
case "secondary":
|
|
324
|
-
return "default";
|
|
325
|
-
case "success":
|
|
326
|
-
return "success";
|
|
327
|
-
case "warning":
|
|
328
|
-
return "warning";
|
|
329
|
-
case "danger":
|
|
330
|
-
return "danger";
|
|
331
|
-
case "neutral":
|
|
332
|
-
return "default";
|
|
333
|
-
default:
|
|
334
|
-
return void 0;
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
269
|
function mapMantineColorToHeroUiColor(color) {
|
|
338
270
|
if (!color) return void 0;
|
|
339
271
|
switch (color) {
|
|
@@ -465,39 +397,34 @@ function readBool(value) {
|
|
|
465
397
|
}
|
|
466
398
|
function resolveSharedStyleProps(fields) {
|
|
467
399
|
const resolved = {};
|
|
468
|
-
const size = readString(fields.
|
|
400
|
+
const size = readString(fields.size);
|
|
469
401
|
if (size !== void 0 && SEMANTIC_SIZES.includes(size)) {
|
|
470
402
|
resolved.size = size;
|
|
471
403
|
}
|
|
472
|
-
const radius = readString(fields.
|
|
404
|
+
const radius = readString(fields.radius);
|
|
473
405
|
if (radius !== void 0 && SEMANTIC_RADII.includes(radius)) {
|
|
474
406
|
resolved.radius = radius;
|
|
475
407
|
}
|
|
476
|
-
const color = readString(fields.
|
|
408
|
+
const color = readString(fields.color);
|
|
477
409
|
if (color !== void 0) {
|
|
478
410
|
resolved.color = color;
|
|
479
411
|
}
|
|
480
|
-
const variant = readString(fields.
|
|
412
|
+
const variant = readString(fields.variant);
|
|
481
413
|
if (variant !== void 0) {
|
|
482
414
|
resolved.variant = variant;
|
|
483
415
|
}
|
|
484
|
-
const
|
|
485
|
-
if (intent !== void 0 && SEMANTIC_INTENTS.includes(intent)) {
|
|
486
|
-
resolved.intent = intent;
|
|
487
|
-
}
|
|
488
|
-
const fullWidth = readBool(fields.shared_full_width);
|
|
416
|
+
const fullWidth = readBool(fields.full_width);
|
|
489
417
|
if (fullWidth !== void 0) {
|
|
490
418
|
resolved.fullWidth = fullWidth;
|
|
491
419
|
}
|
|
492
420
|
return resolved;
|
|
493
421
|
}
|
|
494
422
|
function toMantineSemanticProps(props) {
|
|
495
|
-
const intent = mapIntentToMantine(props.intent);
|
|
496
423
|
const spacing2 = props.spacing && props.spacing !== "none" ? props.spacing : void 0;
|
|
497
424
|
return {
|
|
498
425
|
size: mapSizeToMantine(props.size),
|
|
499
|
-
color:
|
|
500
|
-
variant:
|
|
426
|
+
color: props.color,
|
|
427
|
+
variant: props.variant,
|
|
501
428
|
radius: mapRadiusToMantine(props.radius),
|
|
502
429
|
spacing: spacing2,
|
|
503
430
|
disabled: hasState(props.states, "disabled") || void 0,
|
|
@@ -508,8 +435,8 @@ function toMantineSemanticProps(props) {
|
|
|
508
435
|
};
|
|
509
436
|
}
|
|
510
437
|
function toHeroUiSemanticProps(props) {
|
|
511
|
-
const buttonVariant = mapMantineVariantToHeroUiButtonVariant(props.variant) ?? mapMantineColorToHeroUiButtonVariant(props.color)
|
|
512
|
-
const color = mapMantineColorToHeroUiColor(props.color)
|
|
438
|
+
const buttonVariant = mapMantineVariantToHeroUiButtonVariant(props.variant) ?? mapMantineColorToHeroUiButtonVariant(props.color);
|
|
439
|
+
const color = mapMantineColorToHeroUiColor(props.color);
|
|
513
440
|
return {
|
|
514
441
|
size: mapSizeToHeroUi(props.size),
|
|
515
442
|
buttonVariant,
|
|
@@ -651,9 +578,6 @@ function resolveMantineVariant(variant, color) {
|
|
|
651
578
|
mapAccordionVariantToHeroUiVariant,
|
|
652
579
|
mapChipVariantToHeroUiVariant,
|
|
653
580
|
mapDividerVariantToReactNative,
|
|
654
|
-
mapIntentToHeroUiButtonVariant,
|
|
655
|
-
mapIntentToHeroUiColor,
|
|
656
|
-
mapIntentToMantine,
|
|
657
581
|
mapMantineColorToHeroUiButtonVariant,
|
|
658
582
|
mapMantineColorToHeroUiColor,
|
|
659
583
|
mapMantineVariantToHeroUiButtonVariant,
|
package/dist/theme/index.mjs
CHANGED
|
@@ -149,14 +149,6 @@ var sharedTailwindPreset = {
|
|
|
149
149
|
var FULL_RADIUS_PX = 9999;
|
|
150
150
|
var SEMANTIC_SIZES = ["sm", "md", "lg"];
|
|
151
151
|
var SEMANTIC_RADII = ["none", "sm", "md", "lg", "full"];
|
|
152
|
-
var SEMANTIC_INTENTS = [
|
|
153
|
-
"primary",
|
|
154
|
-
"secondary",
|
|
155
|
-
"success",
|
|
156
|
-
"warning",
|
|
157
|
-
"danger",
|
|
158
|
-
"neutral"
|
|
159
|
-
];
|
|
160
152
|
function mapSizeToMantine(size) {
|
|
161
153
|
return size;
|
|
162
154
|
}
|
|
@@ -212,63 +204,6 @@ function mapSpacingToPx(spacing2) {
|
|
|
212
204
|
if (spacing2 === "none") return 0;
|
|
213
205
|
return SPACING_PX[spacing2];
|
|
214
206
|
}
|
|
215
|
-
function mapIntentToMantine(intent) {
|
|
216
|
-
if (!intent) return void 0;
|
|
217
|
-
switch (intent) {
|
|
218
|
-
case "primary":
|
|
219
|
-
return { color: "blue", variant: "filled" };
|
|
220
|
-
case "secondary":
|
|
221
|
-
return { color: "gray", variant: "light" };
|
|
222
|
-
case "success":
|
|
223
|
-
return { color: "green", variant: "filled" };
|
|
224
|
-
case "warning":
|
|
225
|
-
return { color: "yellow", variant: "filled" };
|
|
226
|
-
case "danger":
|
|
227
|
-
return { color: "red", variant: "filled" };
|
|
228
|
-
case "neutral":
|
|
229
|
-
return { color: "gray", variant: "default" };
|
|
230
|
-
default:
|
|
231
|
-
return void 0;
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
function mapIntentToHeroUiButtonVariant(intent) {
|
|
235
|
-
if (!intent) return void 0;
|
|
236
|
-
switch (intent) {
|
|
237
|
-
case "primary":
|
|
238
|
-
return "primary";
|
|
239
|
-
case "secondary":
|
|
240
|
-
return "secondary";
|
|
241
|
-
case "success":
|
|
242
|
-
return "primary";
|
|
243
|
-
case "warning":
|
|
244
|
-
return "primary";
|
|
245
|
-
case "danger":
|
|
246
|
-
return "danger";
|
|
247
|
-
case "neutral":
|
|
248
|
-
return "secondary";
|
|
249
|
-
default:
|
|
250
|
-
return void 0;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
function mapIntentToHeroUiColor(intent) {
|
|
254
|
-
if (!intent) return void 0;
|
|
255
|
-
switch (intent) {
|
|
256
|
-
case "primary":
|
|
257
|
-
return "accent";
|
|
258
|
-
case "secondary":
|
|
259
|
-
return "default";
|
|
260
|
-
case "success":
|
|
261
|
-
return "success";
|
|
262
|
-
case "warning":
|
|
263
|
-
return "warning";
|
|
264
|
-
case "danger":
|
|
265
|
-
return "danger";
|
|
266
|
-
case "neutral":
|
|
267
|
-
return "default";
|
|
268
|
-
default:
|
|
269
|
-
return void 0;
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
207
|
function mapMantineColorToHeroUiColor(color) {
|
|
273
208
|
if (!color) return void 0;
|
|
274
209
|
switch (color) {
|
|
@@ -400,39 +335,34 @@ function readBool(value) {
|
|
|
400
335
|
}
|
|
401
336
|
function resolveSharedStyleProps(fields) {
|
|
402
337
|
const resolved = {};
|
|
403
|
-
const size = readString(fields.
|
|
338
|
+
const size = readString(fields.size);
|
|
404
339
|
if (size !== void 0 && SEMANTIC_SIZES.includes(size)) {
|
|
405
340
|
resolved.size = size;
|
|
406
341
|
}
|
|
407
|
-
const radius = readString(fields.
|
|
342
|
+
const radius = readString(fields.radius);
|
|
408
343
|
if (radius !== void 0 && SEMANTIC_RADII.includes(radius)) {
|
|
409
344
|
resolved.radius = radius;
|
|
410
345
|
}
|
|
411
|
-
const color = readString(fields.
|
|
346
|
+
const color = readString(fields.color);
|
|
412
347
|
if (color !== void 0) {
|
|
413
348
|
resolved.color = color;
|
|
414
349
|
}
|
|
415
|
-
const variant = readString(fields.
|
|
350
|
+
const variant = readString(fields.variant);
|
|
416
351
|
if (variant !== void 0) {
|
|
417
352
|
resolved.variant = variant;
|
|
418
353
|
}
|
|
419
|
-
const
|
|
420
|
-
if (intent !== void 0 && SEMANTIC_INTENTS.includes(intent)) {
|
|
421
|
-
resolved.intent = intent;
|
|
422
|
-
}
|
|
423
|
-
const fullWidth = readBool(fields.shared_full_width);
|
|
354
|
+
const fullWidth = readBool(fields.full_width);
|
|
424
355
|
if (fullWidth !== void 0) {
|
|
425
356
|
resolved.fullWidth = fullWidth;
|
|
426
357
|
}
|
|
427
358
|
return resolved;
|
|
428
359
|
}
|
|
429
360
|
function toMantineSemanticProps(props) {
|
|
430
|
-
const intent = mapIntentToMantine(props.intent);
|
|
431
361
|
const spacing2 = props.spacing && props.spacing !== "none" ? props.spacing : void 0;
|
|
432
362
|
return {
|
|
433
363
|
size: mapSizeToMantine(props.size),
|
|
434
|
-
color:
|
|
435
|
-
variant:
|
|
364
|
+
color: props.color,
|
|
365
|
+
variant: props.variant,
|
|
436
366
|
radius: mapRadiusToMantine(props.radius),
|
|
437
367
|
spacing: spacing2,
|
|
438
368
|
disabled: hasState(props.states, "disabled") || void 0,
|
|
@@ -443,8 +373,8 @@ function toMantineSemanticProps(props) {
|
|
|
443
373
|
};
|
|
444
374
|
}
|
|
445
375
|
function toHeroUiSemanticProps(props) {
|
|
446
|
-
const buttonVariant = mapMantineVariantToHeroUiButtonVariant(props.variant) ?? mapMantineColorToHeroUiButtonVariant(props.color)
|
|
447
|
-
const color = mapMantineColorToHeroUiColor(props.color)
|
|
376
|
+
const buttonVariant = mapMantineVariantToHeroUiButtonVariant(props.variant) ?? mapMantineColorToHeroUiButtonVariant(props.color);
|
|
377
|
+
const color = mapMantineColorToHeroUiColor(props.color);
|
|
448
378
|
return {
|
|
449
379
|
size: mapSizeToHeroUi(props.size),
|
|
450
380
|
buttonVariant,
|
|
@@ -585,9 +515,6 @@ export {
|
|
|
585
515
|
mapAccordionVariantToHeroUiVariant,
|
|
586
516
|
mapChipVariantToHeroUiVariant,
|
|
587
517
|
mapDividerVariantToReactNative,
|
|
588
|
-
mapIntentToHeroUiButtonVariant,
|
|
589
|
-
mapIntentToHeroUiColor,
|
|
590
|
-
mapIntentToMantine,
|
|
591
518
|
mapMantineColorToHeroUiButtonVariant,
|
|
592
519
|
mapMantineColorToHeroUiColor,
|
|
593
520
|
mapMantineVariantToHeroUiButtonVariant,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared Tailwind preset extended by both the web frontend (Tailwind v4)
|
|
3
3
|
* and the mobile app (Uniwind v4 inside HeroUI Native). Anchors the same
|
|
4
|
-
* scale values that drive `
|
|
5
|
-
* `
|
|
4
|
+
* scale values that drive `size`, `radius`,
|
|
5
|
+
* `spacing`, and the color palette so a class like `p-md` or
|
|
6
6
|
* `text-blue-6` resolves identically on web and mobile.
|
|
7
7
|
*/
|
|
8
8
|
/**
|
package/dist/theme/tailwind.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared Tailwind preset extended by both the web frontend (Tailwind v4)
|
|
3
3
|
* and the mobile app (Uniwind v4 inside HeroUI Native). Anchors the same
|
|
4
|
-
* scale values that drive `
|
|
5
|
-
* `
|
|
4
|
+
* scale values that drive `size`, `radius`,
|
|
5
|
+
* `spacing`, and the color palette so a class like `p-md` or
|
|
6
6
|
* `text-blue-6` resolves identically on web and mobile.
|
|
7
7
|
*/
|
|
8
8
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@selfhelp/shared",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.24",
|
|
4
4
|
"description": "Shared TypeScript package for SelfHelp web frontend and mobile app: style registry, types, API contracts, Mantine theme tokens, condition + interpolation engines, CMS class allow-list.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
package/src/plugin-sdk/define.ts
CHANGED
|
@@ -54,7 +54,6 @@ describe('style render-target targeting', () => {
|
|
|
54
54
|
const mobileOnly: IStyleRegistryEntry = {
|
|
55
55
|
description: 'QA mobile-only plugin style',
|
|
56
56
|
category: 'plugin',
|
|
57
|
-
frontendOnly: true,
|
|
58
57
|
canHaveChildren: false,
|
|
59
58
|
platforms: ['mobile'],
|
|
60
59
|
};
|
|
@@ -81,7 +80,6 @@ describe('style render-target targeting', () => {
|
|
|
81
80
|
const webOnly: IStyleRegistryEntry = {
|
|
82
81
|
description: 'QA web-only plugin style',
|
|
83
82
|
category: 'plugin',
|
|
84
|
-
frontendOnly: true,
|
|
85
83
|
canHaveChildren: false,
|
|
86
84
|
platforms: ['web'],
|
|
87
85
|
};
|
|
@@ -121,7 +119,6 @@ describe('style placement targeting', () => {
|
|
|
121
119
|
const rootOnly: IStyleRegistryEntry = {
|
|
122
120
|
description: 'QA root-only plugin style',
|
|
123
121
|
category: 'plugin',
|
|
124
|
-
frontendOnly: true,
|
|
125
122
|
canHaveChildren: false,
|
|
126
123
|
placement: 'rootOnly',
|
|
127
124
|
};
|
|
@@ -136,7 +133,6 @@ describe('style placement targeting', () => {
|
|
|
136
133
|
const childOnly: IStyleRegistryEntry = {
|
|
137
134
|
description: 'QA container-only plugin style',
|
|
138
135
|
category: 'plugin',
|
|
139
|
-
frontendOnly: true,
|
|
140
136
|
canHaveChildren: false,
|
|
141
137
|
placement: 'containerOnly',
|
|
142
138
|
};
|
|
@@ -36,7 +36,6 @@ const PLUGIN_ID = 'qa-shp-registry-test';
|
|
|
36
36
|
const pluginEntry: IStyleRegistryEntry = {
|
|
37
37
|
description: 'QA plugin style for registry tests',
|
|
38
38
|
category: 'plugin',
|
|
39
|
-
frontendOnly: true,
|
|
40
39
|
canHaveChildren: false,
|
|
41
40
|
};
|
|
42
41
|
|
|
@@ -64,7 +63,6 @@ describe('shared style registry', () => {
|
|
|
64
63
|
expect(typeof entry.description, `${name}.description`).toBe('string');
|
|
65
64
|
expect(entry.description.length, `${name}.description not empty`).toBeGreaterThan(0);
|
|
66
65
|
expect(ALLOWED_CATEGORIES.has(entry.category), `${name}.category`).toBe(true);
|
|
67
|
-
expect(entry.frontendOnly, `${name}.frontendOnly`).toBe(true);
|
|
68
66
|
expect(typeof entry.canHaveChildren, `${name}.canHaveChildren`).toBe('boolean');
|
|
69
67
|
}
|
|
70
68
|
});
|
|
@@ -78,12 +78,6 @@ export interface IStyleRegistryEntry {
|
|
|
78
78
|
| 'forms'
|
|
79
79
|
| 'composite'
|
|
80
80
|
| 'plugin';
|
|
81
|
-
/**
|
|
82
|
-
* Whether the style is intended for end-user pages. Mobile renders
|
|
83
|
-
* only `frontendOnly: true` styles. Today every entry below is true;
|
|
84
|
-
* if/when an admin-only style is added it must be marked false.
|
|
85
|
-
*/
|
|
86
|
-
frontendOnly: true;
|
|
87
81
|
/**
|
|
88
82
|
* Whether the style can have child sections (mirrors backend
|
|
89
83
|
* `styles.can_have_children`). Renderers use this to short-circuit
|
|
@@ -128,110 +122,110 @@ export interface IPluginStyleRegistryEntry extends IStyleRegistryEntry {
|
|
|
128
122
|
*/
|
|
129
123
|
export const BASE_STYLE_REGISTRY = {
|
|
130
124
|
// ===== auth =====
|
|
131
|
-
login: { description: 'User login form', category: 'auth',
|
|
132
|
-
register: { description: 'User registration form', category: 'auth',
|
|
133
|
-
validate: { description: 'Email/account validation flow', category: 'auth',
|
|
134
|
-
'reset-password': { description: 'Reset password form', category: 'auth',
|
|
135
|
-
'two-factor-auth': { description: 'Two-factor auth code form', category: 'auth',
|
|
136
|
-
profile: { description: 'User profile management', category: 'auth',
|
|
125
|
+
login: { description: 'User login form', category: 'auth', canHaveChildren: false },
|
|
126
|
+
register: { description: 'User registration form', category: 'auth', canHaveChildren: false },
|
|
127
|
+
validate: { description: 'Email/account validation flow', category: 'auth', canHaveChildren: true },
|
|
128
|
+
'reset-password': { description: 'Reset password form', category: 'auth', canHaveChildren: false },
|
|
129
|
+
'two-factor-auth': { description: 'Two-factor auth code form', category: 'auth', canHaveChildren: false },
|
|
130
|
+
profile: { description: 'User profile management', category: 'auth', canHaveChildren: false },
|
|
137
131
|
|
|
138
132
|
// ===== layout =====
|
|
139
|
-
container: { description: 'Mantine Container with responsive max-width', category: 'layout',
|
|
140
|
-
box: { description: 'Generic Mantine Box wrapper', category: 'layout',
|
|
141
|
-
flex: { description: 'Mantine Flex layout', category: 'layout',
|
|
142
|
-
group: { description: 'Mantine Group horizontal layout', category: 'layout',
|
|
143
|
-
stack: { description: 'Mantine Stack vertical layout', category: 'layout',
|
|
144
|
-
'simple-grid': { description: 'Mantine SimpleGrid', category: 'layout',
|
|
145
|
-
grid: { description: 'Mantine Grid', category: 'layout',
|
|
146
|
-
'grid-column': { description: 'Mantine Grid.Col', category: 'layout',
|
|
147
|
-
space: { description: 'Mantine Space spacer', category: 'layout',
|
|
148
|
-
divider: { description: 'Mantine Divider', category: 'layout',
|
|
149
|
-
paper: { description: 'Mantine Paper surface', category: 'layout',
|
|
150
|
-
center: { description: 'Mantine Center alignment', category: 'layout',
|
|
151
|
-
'scroll-area': { description: 'Mantine ScrollArea', category: 'layout',
|
|
152
|
-
card: { description: 'Mantine Card', category: 'layout',
|
|
153
|
-
'card-segment': { description: 'Mantine Card.Section', category: 'layout',
|
|
154
|
-
'aspect-ratio': { description: 'Mantine AspectRatio wrapper', category: 'layout',
|
|
155
|
-
'background-image': { description: 'Mantine BackgroundImage', category: 'layout',
|
|
133
|
+
container: { description: 'Mantine Container with responsive max-width', category: 'layout', canHaveChildren: true },
|
|
134
|
+
box: { description: 'Generic Mantine Box wrapper', category: 'layout', canHaveChildren: true },
|
|
135
|
+
flex: { description: 'Mantine Flex layout', category: 'layout', canHaveChildren: true },
|
|
136
|
+
group: { description: 'Mantine Group horizontal layout', category: 'layout', canHaveChildren: true },
|
|
137
|
+
stack: { description: 'Mantine Stack vertical layout', category: 'layout', canHaveChildren: true },
|
|
138
|
+
'simple-grid': { description: 'Mantine SimpleGrid', category: 'layout', canHaveChildren: true },
|
|
139
|
+
grid: { description: 'Mantine Grid', category: 'layout', canHaveChildren: true },
|
|
140
|
+
'grid-column': { description: 'Mantine Grid.Col', category: 'layout', canHaveChildren: true },
|
|
141
|
+
space: { description: 'Mantine Space spacer', category: 'layout', canHaveChildren: false },
|
|
142
|
+
divider: { description: 'Mantine Divider', category: 'layout', canHaveChildren: false },
|
|
143
|
+
paper: { description: 'Mantine Paper surface', category: 'layout', canHaveChildren: true },
|
|
144
|
+
center: { description: 'Mantine Center alignment', category: 'layout', canHaveChildren: true },
|
|
145
|
+
'scroll-area': { description: 'Mantine ScrollArea', category: 'layout', canHaveChildren: true },
|
|
146
|
+
card: { description: 'Mantine Card', category: 'layout', canHaveChildren: true },
|
|
147
|
+
'card-segment': { description: 'Mantine Card.Section', category: 'layout', canHaveChildren: true },
|
|
148
|
+
'aspect-ratio': { description: 'Mantine AspectRatio wrapper', category: 'layout', canHaveChildren: true },
|
|
149
|
+
'background-image': { description: 'Mantine BackgroundImage', category: 'layout', canHaveChildren: true },
|
|
156
150
|
|
|
157
151
|
// ===== typography =====
|
|
158
|
-
title: { description: 'Mantine Title', category: 'typography',
|
|
159
|
-
text: { description: 'Mantine Text', category: 'typography',
|
|
160
|
-
code: { description: 'Mantine Code (inline / block)', category: 'typography',
|
|
161
|
-
highlight: { description: 'Mantine Highlight', category: 'typography',
|
|
162
|
-
blockquote: { description: 'Mantine Blockquote', category: 'typography',
|
|
163
|
-
'html-tag': { description: 'Generic HTML tag wrapper (web), maps to View on RN', category: 'typography',
|
|
164
|
-
kbd: { description: 'Mantine Kbd', category: 'typography',
|
|
165
|
-
typography: { description: 'Mantine Typography wrapper', category: 'typography',
|
|
166
|
-
fieldset: { description: 'Mantine Fieldset', category: 'typography',
|
|
167
|
-
spoiler: { description: 'Mantine Spoiler reveal', category: 'typography',
|
|
152
|
+
title: { description: 'Mantine Title', category: 'typography', canHaveChildren: false },
|
|
153
|
+
text: { description: 'Mantine Text', category: 'typography', canHaveChildren: false },
|
|
154
|
+
code: { description: 'Mantine Code (inline / block)', category: 'typography', canHaveChildren: false },
|
|
155
|
+
highlight: { description: 'Mantine Highlight', category: 'typography', canHaveChildren: false },
|
|
156
|
+
blockquote: { description: 'Mantine Blockquote', category: 'typography', canHaveChildren: false },
|
|
157
|
+
'html-tag': { description: 'Generic HTML tag wrapper (web), maps to View on RN', category: 'typography', canHaveChildren: true },
|
|
158
|
+
kbd: { description: 'Mantine Kbd', category: 'typography', canHaveChildren: false },
|
|
159
|
+
typography: { description: 'Mantine Typography wrapper', category: 'typography', canHaveChildren: true },
|
|
160
|
+
fieldset: { description: 'Mantine Fieldset', category: 'typography', canHaveChildren: true },
|
|
161
|
+
spoiler: { description: 'Mantine Spoiler reveal', category: 'typography', canHaveChildren: true },
|
|
168
162
|
|
|
169
163
|
// ===== media =====
|
|
170
|
-
image: { description: 'Mantine Image / RN Image', category: 'media',
|
|
171
|
-
video: { description: 'HTML5 video / expo-video', category: 'media',
|
|
172
|
-
audio: { description: 'HTML5 audio / expo-audio', category: 'media',
|
|
173
|
-
figure: { description: 'Figure with caption', category: 'media',
|
|
174
|
-
carousel: { description: 'Embla on web, reanimated-carousel on RN', category: 'media',
|
|
164
|
+
image: { description: 'Mantine Image / RN Image', category: 'media', canHaveChildren: false },
|
|
165
|
+
video: { description: 'HTML5 video / expo-video', category: 'media', canHaveChildren: false },
|
|
166
|
+
audio: { description: 'HTML5 audio / expo-audio', category: 'media', canHaveChildren: false },
|
|
167
|
+
figure: { description: 'Figure with caption', category: 'media', canHaveChildren: true },
|
|
168
|
+
carousel: { description: 'Embla on web, reanimated-carousel on RN', category: 'media', canHaveChildren: true },
|
|
175
169
|
|
|
176
170
|
// ===== interactive =====
|
|
177
|
-
button: { description: 'Mantine Button / HeroUI Button', category: 'interactive',
|
|
178
|
-
link: { description: 'Anchor / Pressable navigation', category: 'interactive',
|
|
179
|
-
'action-icon': { description: 'Mantine ActionIcon', category: 'interactive',
|
|
180
|
-
alert: { description: 'Mantine Alert', category: 'interactive',
|
|
181
|
-
badge: { description: 'Mantine Badge', category: 'interactive',
|
|
182
|
-
avatar: { description: 'Mantine Avatar', category: 'interactive',
|
|
183
|
-
chip: { description: 'Mantine Chip', category: 'interactive',
|
|
184
|
-
indicator: { description: 'Mantine Indicator dot', category: 'interactive',
|
|
185
|
-
'theme-icon': { description: 'Mantine ThemeIcon', category: 'interactive',
|
|
186
|
-
notification: { description: 'Mantine Notification', category: 'interactive',
|
|
171
|
+
button: { description: 'Mantine Button / HeroUI Button', category: 'interactive', canHaveChildren: false },
|
|
172
|
+
link: { description: 'Anchor / Pressable navigation', category: 'interactive', canHaveChildren: false },
|
|
173
|
+
'action-icon': { description: 'Mantine ActionIcon', category: 'interactive', canHaveChildren: false },
|
|
174
|
+
alert: { description: 'Mantine Alert', category: 'interactive', canHaveChildren: true },
|
|
175
|
+
badge: { description: 'Mantine Badge', category: 'interactive', canHaveChildren: false },
|
|
176
|
+
avatar: { description: 'Mantine Avatar', category: 'interactive', canHaveChildren: false },
|
|
177
|
+
chip: { description: 'Mantine Chip', category: 'interactive', canHaveChildren: false },
|
|
178
|
+
indicator: { description: 'Mantine Indicator dot', category: 'interactive', canHaveChildren: true },
|
|
179
|
+
'theme-icon': { description: 'Mantine ThemeIcon', category: 'interactive', canHaveChildren: false },
|
|
180
|
+
notification: { description: 'Mantine Notification', category: 'interactive', canHaveChildren: false },
|
|
187
181
|
|
|
188
182
|
// ===== forms =====
|
|
189
|
-
'form-log': { description: 'Append-only form (one row per submit)', category: 'forms',
|
|
190
|
-
'form-record': { description: 'Per-user record form', category: 'forms',
|
|
191
|
-
input: { description: 'Plain HTML input', category: 'forms',
|
|
192
|
-
'text-input': { description: 'Mantine TextInput', category: 'forms',
|
|
193
|
-
textarea: { description: 'Mantine Textarea', category: 'forms',
|
|
194
|
-
'rich-text-editor': { description: 'Tiptap editor on web;
|
|
195
|
-
select: { description: 'HTML select / Mantine Select', category: 'forms',
|
|
196
|
-
radio: { description: 'Mantine Radio / RadioGroup', category: 'forms',
|
|
197
|
-
checkbox: { description: 'Mantine Checkbox', category: 'forms',
|
|
198
|
-
slider: { description: 'Mantine Slider', category: 'forms',
|
|
199
|
-
'range-slider': { description: 'Mantine RangeSlider', category: 'forms',
|
|
200
|
-
datepicker: { description: 'Mantine DatePicker', category: 'forms',
|
|
201
|
-
switch: { description: 'Mantine Switch', category: 'forms',
|
|
202
|
-
combobox: { description: 'Mantine Combobox', category: 'forms',
|
|
203
|
-
'color-input': { description: 'Mantine ColorInput', category: 'forms',
|
|
204
|
-
'color-picker': { description: 'Mantine ColorPicker', category: 'forms',
|
|
205
|
-
'file-input': { description: 'Mantine FileInput / DocumentPicker on RN', category: 'forms',
|
|
206
|
-
'number-input': { description: 'Mantine NumberInput', category: 'forms',
|
|
207
|
-
'segmented-control': { description: 'Mantine SegmentedControl', category: 'forms',
|
|
208
|
-
rating: { description: 'Mantine Rating', category: 'forms',
|
|
209
|
-
progress: { description: 'Mantine Progress', category: 'forms',
|
|
210
|
-
'progress-root': { description: 'Mantine Progress.Root', category: 'forms',
|
|
211
|
-
'progress-section': { description: 'Mantine Progress.Section', category: 'forms',
|
|
183
|
+
'form-log': { description: 'Append-only form (one row per submit)', category: 'forms', canHaveChildren: true },
|
|
184
|
+
'form-record': { description: 'Per-user record form', category: 'forms', canHaveChildren: true },
|
|
185
|
+
input: { description: 'Plain HTML input', category: 'forms', canHaveChildren: false },
|
|
186
|
+
'text-input': { description: 'Mantine TextInput', category: 'forms', canHaveChildren: false },
|
|
187
|
+
textarea: { description: 'Mantine Textarea', category: 'forms', canHaveChildren: false },
|
|
188
|
+
'rich-text-editor': { description: 'Tiptap editor on web; native inline-format toolbar editor on mobile', category: 'forms', canHaveChildren: false },
|
|
189
|
+
select: { description: 'HTML select / Mantine Select', category: 'forms', canHaveChildren: false },
|
|
190
|
+
radio: { description: 'Mantine Radio / RadioGroup', category: 'forms', canHaveChildren: false },
|
|
191
|
+
checkbox: { description: 'Mantine Checkbox', category: 'forms', canHaveChildren: false },
|
|
192
|
+
slider: { description: 'Mantine Slider', category: 'forms', canHaveChildren: false },
|
|
193
|
+
'range-slider': { description: 'Mantine RangeSlider', category: 'forms', canHaveChildren: false },
|
|
194
|
+
datepicker: { description: 'Mantine DatePicker', category: 'forms', canHaveChildren: false },
|
|
195
|
+
switch: { description: 'Mantine Switch', category: 'forms', canHaveChildren: false },
|
|
196
|
+
combobox: { description: 'Mantine Combobox', category: 'forms', canHaveChildren: false },
|
|
197
|
+
'color-input': { description: 'Mantine ColorInput', category: 'forms', canHaveChildren: false },
|
|
198
|
+
'color-picker': { description: 'Mantine ColorPicker', category: 'forms', canHaveChildren: false },
|
|
199
|
+
'file-input': { description: 'Mantine FileInput / DocumentPicker on RN', category: 'forms', canHaveChildren: false },
|
|
200
|
+
'number-input': { description: 'Mantine NumberInput', category: 'forms', canHaveChildren: false },
|
|
201
|
+
'segmented-control': { description: 'Mantine SegmentedControl', category: 'forms', canHaveChildren: false },
|
|
202
|
+
rating: { description: 'Mantine Rating', category: 'forms', canHaveChildren: false },
|
|
203
|
+
progress: { description: 'Mantine Progress', category: 'forms', canHaveChildren: false },
|
|
204
|
+
'progress-root': { description: 'Mantine Progress.Root', category: 'forms', canHaveChildren: true },
|
|
205
|
+
'progress-section': { description: 'Mantine Progress.Section', category: 'forms', canHaveChildren: false },
|
|
212
206
|
|
|
213
207
|
// ===== composite =====
|
|
214
|
-
accordion: { description: 'Mantine Accordion', category: 'composite',
|
|
215
|
-
'accordion-item': { description: 'Mantine Accordion.Item', category: 'composite',
|
|
216
|
-
tabs: { description: 'Mantine Tabs', category: 'composite',
|
|
217
|
-
tab: { description: 'Mantine Tabs.Tab + Tabs.Panel pair', category: 'composite',
|
|
218
|
-
timeline: { description: 'Mantine Timeline', category: 'composite',
|
|
219
|
-
list: { description: 'Mantine List', category: 'composite',
|
|
220
|
-
'list-item': { description: 'Mantine List.Item', category: 'composite',
|
|
221
|
-
'entry-list': { description: 'Data-driven list of entries (form-log table)', category: 'composite',
|
|
222
|
-
'entry-record': { description: 'Single-record container', category: 'composite',
|
|
223
|
-
'entry-record-delete': { description: 'Inline delete confirmation for an entry', category: 'composite',
|
|
224
|
-
loop: { description: 'Loop / repeater over backend-provided rows', category: 'composite',
|
|
225
|
-
'timeline-item': { description: 'A single entry inside a timeline (child-only)', category: 'composite',
|
|
208
|
+
accordion: { description: 'Mantine Accordion', category: 'composite', canHaveChildren: true },
|
|
209
|
+
'accordion-item': { description: 'Mantine Accordion.Item', category: 'composite', canHaveChildren: true },
|
|
210
|
+
tabs: { description: 'Mantine Tabs', category: 'composite', canHaveChildren: true },
|
|
211
|
+
tab: { description: 'Mantine Tabs.Tab + Tabs.Panel pair', category: 'composite', canHaveChildren: true },
|
|
212
|
+
timeline: { description: 'Mantine Timeline', category: 'composite', canHaveChildren: true },
|
|
213
|
+
list: { description: 'Mantine List', category: 'composite', canHaveChildren: true },
|
|
214
|
+
'list-item': { description: 'Mantine List.Item', category: 'composite', canHaveChildren: true },
|
|
215
|
+
'entry-list': { description: 'Data-driven list of entries (form-log table)', category: 'composite', canHaveChildren: true },
|
|
216
|
+
'entry-record': { description: 'Single-record container', category: 'composite', canHaveChildren: true },
|
|
217
|
+
'entry-record-delete': { description: 'Inline delete confirmation for an entry', category: 'composite', canHaveChildren: false },
|
|
218
|
+
loop: { description: 'Loop / repeater over backend-provided rows', category: 'composite', canHaveChildren: true },
|
|
219
|
+
'timeline-item': { description: 'A single entry inside a timeline (child-only)', category: 'composite', canHaveChildren: true },
|
|
226
220
|
|
|
227
221
|
// ===== system / data / reference (established backend catalog) =====
|
|
228
|
-
'no-access': { description: 'Access-denied surface shown when the user lacks page access', category: 'auth',
|
|
229
|
-
missing: { description: 'Generic "content missing" system surface', category: 'auth',
|
|
230
|
-
'not-found': { description: 'Page-not-found system surface', category: 'auth',
|
|
231
|
-
version: { description: 'Build/version diagnostic surface', category: 'auth',
|
|
232
|
-
'ref-container': { description: 'Renders content referenced from another section', category: 'layout',
|
|
233
|
-
'data-container': { description: 'Data-scoped container (renders subtree against a data scope)', category: 'layout',
|
|
234
|
-
'show-user-input': { description: 'Displays previously submitted user input as a list/card view', category: 'forms',
|
|
222
|
+
'no-access': { description: 'Access-denied surface shown when the user lacks page access', category: 'auth', canHaveChildren: false },
|
|
223
|
+
missing: { description: 'Generic "content missing" system surface', category: 'auth', canHaveChildren: false },
|
|
224
|
+
'not-found': { description: 'Page-not-found system surface', category: 'auth', canHaveChildren: false },
|
|
225
|
+
version: { description: 'Build/version diagnostic surface', category: 'auth', canHaveChildren: false },
|
|
226
|
+
'ref-container': { description: 'Renders content referenced from another section', category: 'layout', canHaveChildren: true },
|
|
227
|
+
'data-container': { description: 'Data-scoped container (renders subtree against a data scope)', category: 'layout', canHaveChildren: true },
|
|
228
|
+
'show-user-input': { description: 'Displays previously submitted user input as a list/card view', category: 'forms', canHaveChildren: false },
|
|
235
229
|
} as const satisfies Record<string, IStyleRegistryEntry>;
|
|
236
230
|
|
|
237
231
|
/**
|
|
@@ -8,8 +8,8 @@ import { COLOR_PALETTE, COLOR_SCALES } from '../tokens';
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* The Mantine palette resolver is the single cross-repo source of truth for
|
|
11
|
-
* `
|
|
12
|
-
*
|
|
11
|
+
* the portable `color` + `variant` fields -> concrete RGB (consumed by the
|
|
12
|
+
* mobile renderer). Every variant branch is pinned so a regression surfaces
|
|
13
13
|
* immediately and neither repo re-implements the ladder.
|
|
14
14
|
*/
|
|
15
15
|
describe('resolveMantineVariant', () => {
|