@selfhelp/shared 1.14.17 → 1.14.23

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +136 -0
  2. package/dist/{common-DMm4kymA.d.mts → common-udJ0O8qC.d.mts} +1 -1
  3. package/dist/{common-DMm4kymA.d.ts → common-udJ0O8qC.d.ts} +1 -1
  4. package/dist/index.d.mts +33 -9
  5. package/dist/index.d.ts +33 -9
  6. package/dist/index.js +6 -6
  7. package/dist/index.mjs +6 -6
  8. package/dist/plugin-sdk/index.d.mts +2 -2
  9. package/dist/plugin-sdk/index.d.ts +2 -2
  10. package/dist/plugin-sdk/index.js +1 -1
  11. package/dist/plugin-sdk/index.mjs +1 -1
  12. package/dist/registry/index.d.mts +3 -3
  13. package/dist/registry/index.d.ts +3 -3
  14. package/dist/registry/index.js +1 -1
  15. package/dist/registry/index.mjs +1 -1
  16. package/dist/{styles.registry-D6u2lOw8.d.ts → styles.registry-CZZwODJY.d.mts} +216 -178
  17. package/dist/{styles.registry-DPNHAOM1.d.mts → styles.registry-DQKcvIBZ.d.ts} +216 -178
  18. package/dist/theme/index.d.mts +20 -20
  19. package/dist/theme/index.d.ts +20 -20
  20. package/dist/theme/index.js +5 -5
  21. package/dist/theme/index.mjs +5 -5
  22. package/dist/theme/tailwind.d.mts +2 -2
  23. package/dist/theme/tailwind.d.ts +2 -2
  24. package/package.json +1 -1
  25. package/src/registry/styles.registry.ts +1 -1
  26. package/src/theme/__tests__/semantic.test.ts +19 -19
  27. package/src/theme/mantineVariant.ts +1 -1
  28. package/src/theme/semantic.ts +24 -24
  29. package/src/theme/tailwind.ts +2 -2
  30. package/src/theme/tokens.ts +1 -1
  31. package/src/types/__tests__/mobile-adapters.test.ts +1 -1
  32. package/src/types/mantine/common.ts +1 -1
  33. package/src/types/mobile-adapters.ts +30 -4
  34. package/src/types/styles/auth.ts +13 -9
  35. package/src/types/styles/base.ts +2 -2
  36. package/src/types/styles/composite.ts +7 -7
  37. package/src/types/styles/error.ts +9 -9
  38. package/src/types/styles/forms.ts +99 -59
  39. package/src/types/styles/interactive.ts +42 -32
  40. package/src/types/styles/layout.ts +42 -42
  41. package/src/types/styles/media.ts +6 -6
  42. package/src/types/styles/typography.ts +13 -13
  43. package/src/utils/spacing.ts +1 -1
@@ -1,9 +1,9 @@
1
- import { m as TMantineSize, b as TSharedSize, k as TSharedRadius, T as TMantineColor, p as TMantineVariant } from '../common-DMm4kymA.mjs';
1
+ import { m as TMantineSize, b as TSharedSize, k as TSharedRadius, T as TMantineColor, p as TMantineVariant } from '../common-udJ0O8qC.mjs';
2
2
  export { sharedTailwindExtend, sharedTailwindPreset } from './tailwind.mjs';
3
3
 
4
4
  /**
5
5
  * Mantine semantic token tables. Both the web Mantine theme and the
6
- * mobile HeroUI Native theme extend these so a `shared_size: 'md'` on a
6
+ * mobile HeroUI Native theme extend these so a `size: 'md'` on a
7
7
  * section renders identical sizing regardless of platform.
8
8
  *
9
9
  * Pixel values come straight from Mantine v9 defaults:
@@ -71,7 +71,7 @@ declare function colorToHex(name: string | undefined, shade?: number): string |
71
71
  *
72
72
  * Design rules (mobile rendering plan, section 8.2):
73
73
  * - NO value clamping. The shared scales are the true common denominator
74
- * (`shared_size` = sm|md|lg, `shared_radius` = none|sm|md|lg|full), so every
74
+ * (`size` = sm|md|lg, `radius` = none|sm|md|lg|full), so every
75
75
  * value maps 1:1 to each platform. The backend enforces the same domain
76
76
  * (migration `Version20260618195450`).
77
77
  * - NO implicit cross-platform fallback. These functions take already-resolved
@@ -93,8 +93,8 @@ type TSemanticRadius = TSharedRadius;
93
93
  type TSemanticIntent = 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'neutral';
94
94
  type TSemanticState = 'disabled' | 'loading' | 'invalid' | 'required';
95
95
  /**
96
- * Cross-platform colour + variant authored in the CMS (`shared_color` /
97
- * `shared_variant`). These are stored as Mantine palette / variant *values* —
96
+ * Cross-platform colour + variant authored in the CMS (`color` /
97
+ * `variant`). These are stored as Mantine palette / variant *values* —
98
98
  * the catalog keeps them verbatim (migration `Version20260618143216` renamed the
99
99
  * legacy `mantine_*` fields to `shared_*` without touching the values). They are
100
100
  * the REAL cross-platform appearance fields (there is no `shared_intent` in the
@@ -114,9 +114,9 @@ interface ISharedStyleProps {
114
114
  size?: TSemanticSize;
115
115
  spacing?: TSemanticSpacing;
116
116
  radius?: TSemanticRadius;
117
- /** Mantine palette colour authored via `shared_color` (cross-platform). */
117
+ /** Mantine palette colour authored via `color` (cross-platform). */
118
118
  color?: TSemanticColor;
119
- /** Mantine variant authored via `shared_variant` (cross-platform). */
119
+ /** Mantine variant authored via `variant` (cross-platform). */
120
120
  variant?: TSemanticVariant;
121
121
  /**
122
122
  * Legacy semantic intent. Kept for back-compat; `shared_intent` is NOT in the
@@ -232,7 +232,7 @@ declare function mapIntentToHeroUiButtonVariant(intent: TSemanticIntent | undefi
232
232
  */
233
233
  declare function mapIntentToHeroUiColor(intent: TSemanticIntent | undefined): THeroUiColor | undefined;
234
234
  /**
235
- * Map a Mantine palette colour (`shared_color`) onto a HeroUI Native semantic
235
+ * Map a Mantine palette colour (`color`) onto a HeroUI Native semantic
236
236
  * colour (Chip / Tag / status surfaces). The Mantine palette is broad; it
237
237
  * collapses onto HeroUI's five semantic colours by hue family:
238
238
  * red/pink -> danger
@@ -243,14 +243,14 @@ declare function mapIntentToHeroUiColor(intent: TSemanticIntent | undefined): TH
243
243
  */
244
244
  declare function mapMantineColorToHeroUiColor(color: TSemanticColor | undefined): THeroUiColor | undefined;
245
245
  /**
246
- * Map a Mantine palette colour (`shared_color`) onto a HeroUI Native **Button**
247
- * variant when no explicit `shared_variant` is authored. HeroUI buttons encode
246
+ * Map a Mantine palette colour (`color`) onto a HeroUI Native **Button**
247
+ * variant when no explicit `variant` is authored. HeroUI buttons encode
248
248
  * colour in the variant, so the destructive hue becomes `danger`, neutral hues
249
249
  * become `secondary`, and everything else stays the prominent `primary`.
250
250
  */
251
251
  declare function mapMantineColorToHeroUiButtonVariant(color: TSemanticColor | undefined): THeroUiButtonVariant | undefined;
252
252
  /**
253
- * Map a Mantine variant (`shared_variant`) onto the HeroUI Native Button
253
+ * Map a Mantine variant (`variant`) onto the HeroUI Native Button
254
254
  * vocabulary:
255
255
  * filled / gradient -> primary
256
256
  * light / white / default -> secondary
@@ -259,14 +259,14 @@ declare function mapMantineColorToHeroUiButtonVariant(color: TSemanticColor | un
259
259
  */
260
260
  declare function mapMantineVariantToHeroUiButtonVariant(variant: TSemanticVariant | undefined): THeroUiButtonVariant | undefined;
261
261
  /**
262
- * Map the accordion variant token (`shared_accordion_variant`: Mantine
262
+ * Map the accordion variant token (`accordion_variant`: Mantine
263
263
  * default/contained/filled/separated) onto the HeroUI Native Accordion `variant`
264
264
  * vocabulary. HeroUI Native only has `default` (plain list) and `surface`
265
265
  * (grouped container), so every "boxed" Mantine variant collapses to `surface`.
266
266
  */
267
267
  declare function mapAccordionVariantToHeroUiVariant(variant: string | undefined): 'default' | 'surface';
268
268
  /**
269
- * Map the chip variant token (`shared_chip_variant`: Mantine
269
+ * Map the chip variant token (`chip_variant`: Mantine
270
270
  * filled/outline/light) onto the HeroUI Native Chip `variant` vocabulary
271
271
  * (`primary`/`secondary`/`tertiary`/`soft`):
272
272
  * - filled -> primary (solid accent fill)
@@ -277,8 +277,8 @@ declare function mapChipVariantToHeroUiVariant(variant: string | undefined): 'pr
277
277
  /** A React Native-safe dimension: a px number, a percentage string, or "auto". */
278
278
  type TReactNativeDimension = number | `${number}%` | 'auto';
279
279
  /**
280
- * Parse a CMS dimension string (`shared_width`/`shared_height`/`shared_mi*`/
281
- * `shared_ma*`) into a React Native-safe value. Web (Mantine) accepts the raw
280
+ * Parse a CMS dimension string (`shared_width`/`shared_height`/`mih`/`miw`/
281
+ * `mah`/`maw`) into a React Native-safe value. Web (Mantine) accepts the raw
282
282
  * string verbatim ("320px", "100%", "auto"); React Native does NOT accept a
283
283
  * unit suffix, so a px value must become a unitless number:
284
284
  * "320px" | "320" | 320 -> 320 (number)
@@ -309,7 +309,7 @@ interface IReactNativeGridColumn {
309
309
  */
310
310
  declare function gridSpanToReactNativeColumn(span: string | number | undefined | null, cols?: number): IReactNativeGridColumn;
311
311
  /**
312
- * Map a `shared_divider_variant` (solid/dashed/dotted) onto a React Native
312
+ * Map a `divider_variant` (solid/dashed/dotted) onto a React Native
313
313
  * `borderStyle`. The vocabularies are identical, so this validates the domain
314
314
  * and falls back to 'solid'.
315
315
  */
@@ -330,10 +330,10 @@ declare function toMantineSemanticProps(props: ISharedStyleProps): IMantineResol
330
330
  *
331
331
  * Appearance precedence (mirrors the web renderer, which reads the same CMS
332
332
  * fields straight into Mantine):
333
- * 1. `shared_variant` (Mantine variant) mapped onto the HeroUI button vocab;
334
- * 2. else `shared_color` (Mantine palette) mapped onto a button variant;
333
+ * 1. `variant` (Mantine variant) mapped onto the HeroUI button vocab;
334
+ * 2. else `color` (Mantine palette) mapped onto a button variant;
335
335
  * 3. else the legacy `intent` mapping (back-compat fallback).
336
- * The semantic `color` is resolved from `shared_color` first, then `intent`.
336
+ * The semantic `color` is resolved from `color` first, then `intent`.
337
337
  */
338
338
  declare function toHeroUiSemanticProps(props: ISharedStyleProps): IHeroUiResolvedStyle;
339
339
  /**
@@ -366,7 +366,7 @@ declare const resolveSharedStyleForMobile: typeof toHeroUiSemanticProps;
366
366
  * - `semantic.ts` maps renderer-agnostic shared fields
367
367
  * (`intent` / `size` / `radius` / `spacing`) per platform.
368
368
  * - `mantineVariant.ts` resolves a Mantine palette `color` + `variant` value
369
- * pair (e.g. the semantic `shared_color` + `web_variant`)
369
+ * pair (e.g. the semantic `color` + `web_variant`)
370
370
  * into concrete RGB. Its only runtime
371
371
  * consumer today is the mobile **Expo Web preview**
372
372
  * fallback (where `heroui-native` cannot render and the
@@ -1,9 +1,9 @@
1
- import { m as TMantineSize, b as TSharedSize, k as TSharedRadius, T as TMantineColor, p as TMantineVariant } from '../common-DMm4kymA.js';
1
+ import { m as TMantineSize, b as TSharedSize, k as TSharedRadius, T as TMantineColor, p as TMantineVariant } from '../common-udJ0O8qC.js';
2
2
  export { sharedTailwindExtend, sharedTailwindPreset } from './tailwind.js';
3
3
 
4
4
  /**
5
5
  * Mantine semantic token tables. Both the web Mantine theme and the
6
- * mobile HeroUI Native theme extend these so a `shared_size: 'md'` on a
6
+ * mobile HeroUI Native theme extend these so a `size: 'md'` on a
7
7
  * section renders identical sizing regardless of platform.
8
8
  *
9
9
  * Pixel values come straight from Mantine v9 defaults:
@@ -71,7 +71,7 @@ declare function colorToHex(name: string | undefined, shade?: number): string |
71
71
  *
72
72
  * Design rules (mobile rendering plan, section 8.2):
73
73
  * - NO value clamping. The shared scales are the true common denominator
74
- * (`shared_size` = sm|md|lg, `shared_radius` = none|sm|md|lg|full), so every
74
+ * (`size` = sm|md|lg, `radius` = none|sm|md|lg|full), so every
75
75
  * value maps 1:1 to each platform. The backend enforces the same domain
76
76
  * (migration `Version20260618195450`).
77
77
  * - NO implicit cross-platform fallback. These functions take already-resolved
@@ -93,8 +93,8 @@ type TSemanticRadius = TSharedRadius;
93
93
  type TSemanticIntent = 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'neutral';
94
94
  type TSemanticState = 'disabled' | 'loading' | 'invalid' | 'required';
95
95
  /**
96
- * Cross-platform colour + variant authored in the CMS (`shared_color` /
97
- * `shared_variant`). These are stored as Mantine palette / variant *values* —
96
+ * Cross-platform colour + variant authored in the CMS (`color` /
97
+ * `variant`). These are stored as Mantine palette / variant *values* —
98
98
  * the catalog keeps them verbatim (migration `Version20260618143216` renamed the
99
99
  * legacy `mantine_*` fields to `shared_*` without touching the values). They are
100
100
  * the REAL cross-platform appearance fields (there is no `shared_intent` in the
@@ -114,9 +114,9 @@ interface ISharedStyleProps {
114
114
  size?: TSemanticSize;
115
115
  spacing?: TSemanticSpacing;
116
116
  radius?: TSemanticRadius;
117
- /** Mantine palette colour authored via `shared_color` (cross-platform). */
117
+ /** Mantine palette colour authored via `color` (cross-platform). */
118
118
  color?: TSemanticColor;
119
- /** Mantine variant authored via `shared_variant` (cross-platform). */
119
+ /** Mantine variant authored via `variant` (cross-platform). */
120
120
  variant?: TSemanticVariant;
121
121
  /**
122
122
  * Legacy semantic intent. Kept for back-compat; `shared_intent` is NOT in the
@@ -232,7 +232,7 @@ declare function mapIntentToHeroUiButtonVariant(intent: TSemanticIntent | undefi
232
232
  */
233
233
  declare function mapIntentToHeroUiColor(intent: TSemanticIntent | undefined): THeroUiColor | undefined;
234
234
  /**
235
- * Map a Mantine palette colour (`shared_color`) onto a HeroUI Native semantic
235
+ * Map a Mantine palette colour (`color`) onto a HeroUI Native semantic
236
236
  * colour (Chip / Tag / status surfaces). The Mantine palette is broad; it
237
237
  * collapses onto HeroUI's five semantic colours by hue family:
238
238
  * red/pink -> danger
@@ -243,14 +243,14 @@ declare function mapIntentToHeroUiColor(intent: TSemanticIntent | undefined): TH
243
243
  */
244
244
  declare function mapMantineColorToHeroUiColor(color: TSemanticColor | undefined): THeroUiColor | undefined;
245
245
  /**
246
- * Map a Mantine palette colour (`shared_color`) onto a HeroUI Native **Button**
247
- * variant when no explicit `shared_variant` is authored. HeroUI buttons encode
246
+ * Map a Mantine palette colour (`color`) onto a HeroUI Native **Button**
247
+ * variant when no explicit `variant` is authored. HeroUI buttons encode
248
248
  * colour in the variant, so the destructive hue becomes `danger`, neutral hues
249
249
  * become `secondary`, and everything else stays the prominent `primary`.
250
250
  */
251
251
  declare function mapMantineColorToHeroUiButtonVariant(color: TSemanticColor | undefined): THeroUiButtonVariant | undefined;
252
252
  /**
253
- * Map a Mantine variant (`shared_variant`) onto the HeroUI Native Button
253
+ * Map a Mantine variant (`variant`) onto the HeroUI Native Button
254
254
  * vocabulary:
255
255
  * filled / gradient -> primary
256
256
  * light / white / default -> secondary
@@ -259,14 +259,14 @@ declare function mapMantineColorToHeroUiButtonVariant(color: TSemanticColor | un
259
259
  */
260
260
  declare function mapMantineVariantToHeroUiButtonVariant(variant: TSemanticVariant | undefined): THeroUiButtonVariant | undefined;
261
261
  /**
262
- * Map the accordion variant token (`shared_accordion_variant`: Mantine
262
+ * Map the accordion variant token (`accordion_variant`: Mantine
263
263
  * default/contained/filled/separated) onto the HeroUI Native Accordion `variant`
264
264
  * vocabulary. HeroUI Native only has `default` (plain list) and `surface`
265
265
  * (grouped container), so every "boxed" Mantine variant collapses to `surface`.
266
266
  */
267
267
  declare function mapAccordionVariantToHeroUiVariant(variant: string | undefined): 'default' | 'surface';
268
268
  /**
269
- * Map the chip variant token (`shared_chip_variant`: Mantine
269
+ * Map the chip variant token (`chip_variant`: Mantine
270
270
  * filled/outline/light) onto the HeroUI Native Chip `variant` vocabulary
271
271
  * (`primary`/`secondary`/`tertiary`/`soft`):
272
272
  * - filled -> primary (solid accent fill)
@@ -277,8 +277,8 @@ declare function mapChipVariantToHeroUiVariant(variant: string | undefined): 'pr
277
277
  /** A React Native-safe dimension: a px number, a percentage string, or "auto". */
278
278
  type TReactNativeDimension = number | `${number}%` | 'auto';
279
279
  /**
280
- * Parse a CMS dimension string (`shared_width`/`shared_height`/`shared_mi*`/
281
- * `shared_ma*`) into a React Native-safe value. Web (Mantine) accepts the raw
280
+ * Parse a CMS dimension string (`shared_width`/`shared_height`/`mih`/`miw`/
281
+ * `mah`/`maw`) into a React Native-safe value. Web (Mantine) accepts the raw
282
282
  * string verbatim ("320px", "100%", "auto"); React Native does NOT accept a
283
283
  * unit suffix, so a px value must become a unitless number:
284
284
  * "320px" | "320" | 320 -> 320 (number)
@@ -309,7 +309,7 @@ interface IReactNativeGridColumn {
309
309
  */
310
310
  declare function gridSpanToReactNativeColumn(span: string | number | undefined | null, cols?: number): IReactNativeGridColumn;
311
311
  /**
312
- * Map a `shared_divider_variant` (solid/dashed/dotted) onto a React Native
312
+ * Map a `divider_variant` (solid/dashed/dotted) onto a React Native
313
313
  * `borderStyle`. The vocabularies are identical, so this validates the domain
314
314
  * and falls back to 'solid'.
315
315
  */
@@ -330,10 +330,10 @@ declare function toMantineSemanticProps(props: ISharedStyleProps): IMantineResol
330
330
  *
331
331
  * Appearance precedence (mirrors the web renderer, which reads the same CMS
332
332
  * fields straight into Mantine):
333
- * 1. `shared_variant` (Mantine variant) mapped onto the HeroUI button vocab;
334
- * 2. else `shared_color` (Mantine palette) mapped onto a button variant;
333
+ * 1. `variant` (Mantine variant) mapped onto the HeroUI button vocab;
334
+ * 2. else `color` (Mantine palette) mapped onto a button variant;
335
335
  * 3. else the legacy `intent` mapping (back-compat fallback).
336
- * The semantic `color` is resolved from `shared_color` first, then `intent`.
336
+ * The semantic `color` is resolved from `color` first, then `intent`.
337
337
  */
338
338
  declare function toHeroUiSemanticProps(props: ISharedStyleProps): IHeroUiResolvedStyle;
339
339
  /**
@@ -366,7 +366,7 @@ declare const resolveSharedStyleForMobile: typeof toHeroUiSemanticProps;
366
366
  * - `semantic.ts` maps renderer-agnostic shared fields
367
367
  * (`intent` / `size` / `radius` / `spacing`) per platform.
368
368
  * - `mantineVariant.ts` resolves a Mantine palette `color` + `variant` value
369
- * pair (e.g. the semantic `shared_color` + `web_variant`)
369
+ * pair (e.g. the semantic `color` + `web_variant`)
370
370
  * into concrete RGB. Its only runtime
371
371
  * consumer today is the mobile **Expo Web preview**
372
372
  * fallback (where `heroui-native` cannot render and the
@@ -465,19 +465,19 @@ function readBool(value) {
465
465
  }
466
466
  function resolveSharedStyleProps(fields) {
467
467
  const resolved = {};
468
- const size = readString(fields.shared_size);
468
+ const size = readString(fields.size);
469
469
  if (size !== void 0 && SEMANTIC_SIZES.includes(size)) {
470
470
  resolved.size = size;
471
471
  }
472
- const radius = readString(fields.shared_radius);
472
+ const radius = readString(fields.radius);
473
473
  if (radius !== void 0 && SEMANTIC_RADII.includes(radius)) {
474
474
  resolved.radius = radius;
475
475
  }
476
- const color = readString(fields.shared_color);
476
+ const color = readString(fields.color);
477
477
  if (color !== void 0) {
478
478
  resolved.color = color;
479
479
  }
480
- const variant = readString(fields.shared_variant);
480
+ const variant = readString(fields.variant);
481
481
  if (variant !== void 0) {
482
482
  resolved.variant = variant;
483
483
  }
@@ -485,7 +485,7 @@ function resolveSharedStyleProps(fields) {
485
485
  if (intent !== void 0 && SEMANTIC_INTENTS.includes(intent)) {
486
486
  resolved.intent = intent;
487
487
  }
488
- const fullWidth = readBool(fields.shared_full_width);
488
+ const fullWidth = readBool(fields.full_width);
489
489
  if (fullWidth !== void 0) {
490
490
  resolved.fullWidth = fullWidth;
491
491
  }
@@ -400,19 +400,19 @@ function readBool(value) {
400
400
  }
401
401
  function resolveSharedStyleProps(fields) {
402
402
  const resolved = {};
403
- const size = readString(fields.shared_size);
403
+ const size = readString(fields.size);
404
404
  if (size !== void 0 && SEMANTIC_SIZES.includes(size)) {
405
405
  resolved.size = size;
406
406
  }
407
- const radius = readString(fields.shared_radius);
407
+ const radius = readString(fields.radius);
408
408
  if (radius !== void 0 && SEMANTIC_RADII.includes(radius)) {
409
409
  resolved.radius = radius;
410
410
  }
411
- const color = readString(fields.shared_color);
411
+ const color = readString(fields.color);
412
412
  if (color !== void 0) {
413
413
  resolved.color = color;
414
414
  }
415
- const variant = readString(fields.shared_variant);
415
+ const variant = readString(fields.variant);
416
416
  if (variant !== void 0) {
417
417
  resolved.variant = variant;
418
418
  }
@@ -420,7 +420,7 @@ function resolveSharedStyleProps(fields) {
420
420
  if (intent !== void 0 && SEMANTIC_INTENTS.includes(intent)) {
421
421
  resolved.intent = intent;
422
422
  }
423
- const fullWidth = readBool(fields.shared_full_width);
423
+ const fullWidth = readBool(fields.full_width);
424
424
  if (fullWidth !== void 0) {
425
425
  resolved.fullWidth = fullWidth;
426
426
  }
@@ -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 `shared_size`, `shared_radius`,
5
- * `shared_spacing`, and the color palette so a class like `p-md` or
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
  /**
@@ -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 `shared_size`, `shared_radius`,
5
- * `shared_spacing`, and the color palette so a class like `p-md` or
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.17",
3
+ "version": "1.14.23",
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",
@@ -191,7 +191,7 @@ export const BASE_STYLE_REGISTRY = {
191
191
  input: { description: 'Plain HTML input', category: 'forms', frontendOnly: true, canHaveChildren: false },
192
192
  'text-input': { description: 'Mantine TextInput', category: 'forms', frontendOnly: true, canHaveChildren: false },
193
193
  textarea: { description: 'Mantine Textarea', category: 'forms', frontendOnly: true, canHaveChildren: false },
194
- 'rich-text-editor': { description: 'Tiptap editor on web; READ-ONLY viewer on mobile v1', category: 'forms', frontendOnly: true, canHaveChildren: false },
194
+ 'rich-text-editor': { description: 'Tiptap editor on web; native inline-format toolbar editor on mobile', category: 'forms', frontendOnly: true, canHaveChildren: false },
195
195
  select: { description: 'HTML select / Mantine Select', category: 'forms', frontendOnly: true, canHaveChildren: false },
196
196
  radio: { description: 'Mantine Radio / RadioGroup', category: 'forms', frontendOnly: true, canHaveChildren: false },
197
197
  checkbox: { description: 'Mantine Checkbox', category: 'forms', frontendOnly: true, canHaveChildren: false },
@@ -119,10 +119,10 @@ describe('semantic style mapper', () => {
119
119
  it('reads valid shared_* values', () => {
120
120
  expect(
121
121
  resolveSharedStyleProps({
122
- shared_size: 'lg',
123
- shared_radius: 'full',
122
+ size: 'lg',
123
+ radius: 'full',
124
124
  shared_intent: 'danger',
125
- shared_full_width: '1',
125
+ full_width: '1',
126
126
  }),
127
127
  ).toEqual({ size: 'lg', radius: 'full', intent: 'danger', fullWidth: true });
128
128
  });
@@ -131,8 +131,8 @@ describe('semantic style mapper', () => {
131
131
  // Stale Mantine values (xs/xl) are NOT mapped; the renderer falls
132
132
  // through to its component default rather than silently clamping.
133
133
  const resolved = resolveSharedStyleProps({
134
- shared_size: 'xl',
135
- shared_radius: 'xs',
134
+ size: 'xl',
135
+ radius: 'xs',
136
136
  shared_intent: 'bogus',
137
137
  });
138
138
  expect(resolved.size).toBeUndefined();
@@ -140,26 +140,26 @@ describe('semantic style mapper', () => {
140
140
  expect(resolved.intent).toBeUndefined();
141
141
  });
142
142
 
143
- it('coerces shared_full_width booleans', () => {
144
- expect(resolveSharedStyleProps({ shared_full_width: '0' }).fullWidth).toBe(false);
145
- expect(resolveSharedStyleProps({ shared_full_width: true }).fullWidth).toBe(true);
143
+ it('coerces full_width booleans', () => {
144
+ expect(resolveSharedStyleProps({ full_width: '0' }).fullWidth).toBe(false);
145
+ expect(resolveSharedStyleProps({ full_width: true }).fullWidth).toBe(true);
146
146
  expect(resolveSharedStyleProps({}).fullWidth).toBeUndefined();
147
147
  });
148
148
 
149
- it('reads shared_color and shared_variant (the REAL cross-platform fields)', () => {
150
- const resolved = resolveSharedStyleProps({ shared_color: 'red', shared_variant: 'light' });
149
+ it('reads color and variant (the REAL cross-platform fields)', () => {
150
+ const resolved = resolveSharedStyleProps({ color: 'red', variant: 'light' });
151
151
  expect(resolved.color).toBe('red');
152
152
  expect(resolved.variant).toBe('light');
153
153
  });
154
154
 
155
- it('treats an empty shared_color / shared_variant as absent', () => {
156
- const resolved = resolveSharedStyleProps({ shared_color: '', shared_variant: '' });
155
+ it('treats an empty color / variant as absent', () => {
156
+ const resolved = resolveSharedStyleProps({ color: '', variant: '' });
157
157
  expect(resolved.color).toBeUndefined();
158
158
  expect(resolved.variant).toBeUndefined();
159
159
  });
160
160
  });
161
161
 
162
- describe('Mantine colour/variant -> HeroUI Native (real shared_color/shared_variant)', () => {
162
+ describe('Mantine colour/variant -> HeroUI Native (real color/variant)', () => {
163
163
  it('maps a Mantine palette colour to a HeroUI semantic colour', () => {
164
164
  expect(mapMantineColorToHeroUiColor('red')).toBe('danger');
165
165
  expect(mapMantineColorToHeroUiColor('green')).toBe('success');
@@ -199,7 +199,7 @@ describe('semantic style mapper', () => {
199
199
  expect(mapMantineColorToHeroUiButtonVariant('blue')).toBe('primary');
200
200
  });
201
201
 
202
- it('toHeroUiSemanticProps prefers shared_variant, then shared_color, then intent', () => {
202
+ it('toHeroUiSemanticProps prefers variant, then color, then intent', () => {
203
203
  expect(
204
204
  toHeroUiSemanticProps({ variant: 'outline', color: 'red', intent: 'primary' }).buttonVariant,
205
205
  ).toBe('outline');
@@ -213,12 +213,12 @@ describe('semantic style mapper', () => {
213
213
  });
214
214
  });
215
215
 
216
- it('resolves a real CMS button section (shared_color + shared_variant + shared_size)', () => {
216
+ it('resolves a real CMS button section (color + variant + size)', () => {
217
217
  const props = resolveSharedStyleProps({
218
- shared_color: 'red',
219
- shared_variant: 'filled',
220
- shared_size: 'lg',
221
- shared_radius: 'md',
218
+ color: 'red',
219
+ variant: 'filled',
220
+ size: 'lg',
221
+ radius: 'md',
222
222
  });
223
223
  expect(toHeroUiSemanticProps(props)).toMatchObject({
224
224
  size: 'lg',
@@ -16,7 +16,7 @@ SPDX-License-Identifier: MPL-2.0
16
16
  * - `semantic.ts` maps renderer-agnostic shared fields
17
17
  * (`intent` / `size` / `radius` / `spacing`) per platform.
18
18
  * - `mantineVariant.ts` resolves a Mantine palette `color` + `variant` value
19
- * pair (e.g. the semantic `shared_color` + `web_variant`)
19
+ * pair (e.g. the semantic `color` + `web_variant`)
20
20
  * into concrete RGB. Its only runtime
21
21
  * consumer today is the mobile **Expo Web preview**
22
22
  * fallback (where `heroui-native` cannot render and the
@@ -13,7 +13,7 @@ SPDX-License-Identifier: MPL-2.0
13
13
  *
14
14
  * Design rules (mobile rendering plan, section 8.2):
15
15
  * - NO value clamping. The shared scales are the true common denominator
16
- * (`shared_size` = sm|md|lg, `shared_radius` = none|sm|md|lg|full), so every
16
+ * (`size` = sm|md|lg, `radius` = none|sm|md|lg|full), so every
17
17
  * value maps 1:1 to each platform. The backend enforces the same domain
18
18
  * (migration `Version20260618195450`).
19
19
  * - NO implicit cross-platform fallback. These functions take already-resolved
@@ -47,8 +47,8 @@ export type TSemanticIntent =
47
47
  export type TSemanticState = 'disabled' | 'loading' | 'invalid' | 'required';
48
48
 
49
49
  /**
50
- * Cross-platform colour + variant authored in the CMS (`shared_color` /
51
- * `shared_variant`). These are stored as Mantine palette / variant *values* —
50
+ * Cross-platform colour + variant authored in the CMS (`color` /
51
+ * `variant`). These are stored as Mantine palette / variant *values* —
52
52
  * the catalog keeps them verbatim (migration `Version20260618143216` renamed the
53
53
  * legacy `mantine_*` fields to `shared_*` without touching the values). They are
54
54
  * the REAL cross-platform appearance fields (there is no `shared_intent` in the
@@ -81,9 +81,9 @@ export interface ISharedStyleProps {
81
81
  size?: TSemanticSize;
82
82
  spacing?: TSemanticSpacing;
83
83
  radius?: TSemanticRadius;
84
- /** Mantine palette colour authored via `shared_color` (cross-platform). */
84
+ /** Mantine palette colour authored via `color` (cross-platform). */
85
85
  color?: TSemanticColor;
86
- /** Mantine variant authored via `shared_variant` (cross-platform). */
86
+ /** Mantine variant authored via `variant` (cross-platform). */
87
87
  variant?: TSemanticVariant;
88
88
  /**
89
89
  * Legacy semantic intent. Kept for back-compat; `shared_intent` is NOT in the
@@ -349,7 +349,7 @@ export function mapIntentToHeroUiColor(
349
349
  // ===== color / variant (the REAL cross-platform appearance fields) =====
350
350
 
351
351
  /**
352
- * Map a Mantine palette colour (`shared_color`) onto a HeroUI Native semantic
352
+ * Map a Mantine palette colour (`color`) onto a HeroUI Native semantic
353
353
  * colour (Chip / Tag / status surfaces). The Mantine palette is broad; it
354
354
  * collapses onto HeroUI's five semantic colours by hue family:
355
355
  * red/pink -> danger
@@ -382,8 +382,8 @@ export function mapMantineColorToHeroUiColor(
382
382
  }
383
383
 
384
384
  /**
385
- * Map a Mantine palette colour (`shared_color`) onto a HeroUI Native **Button**
386
- * variant when no explicit `shared_variant` is authored. HeroUI buttons encode
385
+ * Map a Mantine palette colour (`color`) onto a HeroUI Native **Button**
386
+ * variant when no explicit `variant` is authored. HeroUI buttons encode
387
387
  * colour in the variant, so the destructive hue becomes `danger`, neutral hues
388
388
  * become `secondary`, and everything else stays the prominent `primary`.
389
389
  */
@@ -404,7 +404,7 @@ export function mapMantineColorToHeroUiButtonVariant(
404
404
  }
405
405
 
406
406
  /**
407
- * Map a Mantine variant (`shared_variant`) onto the HeroUI Native Button
407
+ * Map a Mantine variant (`variant`) onto the HeroUI Native Button
408
408
  * vocabulary:
409
409
  * filled / gradient -> primary
410
410
  * light / white / default -> secondary
@@ -434,7 +434,7 @@ export function mapMantineVariantToHeroUiButtonVariant(
434
434
  }
435
435
 
436
436
  /**
437
- * Map the accordion variant token (`shared_accordion_variant`: Mantine
437
+ * Map the accordion variant token (`accordion_variant`: Mantine
438
438
  * default/contained/filled/separated) onto the HeroUI Native Accordion `variant`
439
439
  * vocabulary. HeroUI Native only has `default` (plain list) and `surface`
440
440
  * (grouped container), so every "boxed" Mantine variant collapses to `surface`.
@@ -454,7 +454,7 @@ export function mapAccordionVariantToHeroUiVariant(
454
454
  }
455
455
 
456
456
  /**
457
- * Map the chip variant token (`shared_chip_variant`: Mantine
457
+ * Map the chip variant token (`chip_variant`: Mantine
458
458
  * filled/outline/light) onto the HeroUI Native Chip `variant` vocabulary
459
459
  * (`primary`/`secondary`/`tertiary`/`soft`):
460
460
  * - filled -> primary (solid accent fill)
@@ -475,14 +475,14 @@ export function mapChipVariantToHeroUiVariant(
475
475
  }
476
476
  }
477
477
 
478
- // ===== layout dimensions (shared_width / shared_height / grid span / divider) =====
478
+ // ===== layout dimensions (shared_width / shared_height / mih/miw/mah/maw / grid span / divider) =====
479
479
 
480
480
  /** A React Native-safe dimension: a px number, a percentage string, or "auto". */
481
481
  export type TReactNativeDimension = number | `${number}%` | 'auto';
482
482
 
483
483
  /**
484
- * Parse a CMS dimension string (`shared_width`/`shared_height`/`shared_mi*`/
485
- * `shared_ma*`) into a React Native-safe value. Web (Mantine) accepts the raw
484
+ * Parse a CMS dimension string (`shared_width`/`shared_height`/`mih`/`miw`/
485
+ * `mah`/`maw`) into a React Native-safe value. Web (Mantine) accepts the raw
486
486
  * string verbatim ("320px", "100%", "auto"); React Native does NOT accept a
487
487
  * unit suffix, so a px value must become a unitless number:
488
488
  * "320px" | "320" | 320 -> 320 (number)
@@ -552,7 +552,7 @@ export function gridSpanToReactNativeColumn(
552
552
  }
553
553
 
554
554
  /**
555
- * Map a `shared_divider_variant` (solid/dashed/dotted) onto a React Native
555
+ * Map a `divider_variant` (solid/dashed/dotted) onto a React Native
556
556
  * `borderStyle`. The vocabularies are identical, so this validates the domain
557
557
  * and falls back to 'solid'.
558
558
  */
@@ -601,26 +601,26 @@ function readBool(value: unknown): boolean | undefined {
601
601
  export function resolveSharedStyleProps(fields: Record<string, unknown>): ISharedStyleProps {
602
602
  const resolved: ISharedStyleProps = {};
603
603
 
604
- const size = readString(fields.shared_size);
604
+ const size = readString(fields.size);
605
605
  if (size !== undefined && (SEMANTIC_SIZES as readonly string[]).includes(size)) {
606
606
  resolved.size = size as TSemanticSize;
607
607
  }
608
608
 
609
- const radius = readString(fields.shared_radius);
609
+ const radius = readString(fields.radius);
610
610
  if (radius !== undefined && (SEMANTIC_RADII as readonly string[]).includes(radius)) {
611
611
  resolved.radius = radius as TSemanticRadius;
612
612
  }
613
613
 
614
- // `shared_color` / `shared_variant` are the REAL cross-platform appearance
614
+ // `color` / `variant` are the REAL cross-platform appearance
615
615
  // fields (Mantine palette/variant values stored verbatim). Read them
616
616
  // open-domain — the palette is intentionally broad and platform mappers
617
617
  // collapse it; an unknown value simply falls through to a renderer default.
618
- const color = readString(fields.shared_color);
618
+ const color = readString(fields.color);
619
619
  if (color !== undefined) {
620
620
  resolved.color = color;
621
621
  }
622
622
 
623
- const variant = readString(fields.shared_variant);
623
+ const variant = readString(fields.variant);
624
624
  if (variant !== undefined) {
625
625
  resolved.variant = variant as TSemanticVariant;
626
626
  }
@@ -632,7 +632,7 @@ export function resolveSharedStyleProps(fields: Record<string, unknown>): IShare
632
632
  resolved.intent = intent as TSemanticIntent;
633
633
  }
634
634
 
635
- const fullWidth = readBool(fields.shared_full_width);
635
+ const fullWidth = readBool(fields.full_width);
636
636
  if (fullWidth !== undefined) {
637
637
  resolved.fullWidth = fullWidth;
638
638
  }
@@ -665,10 +665,10 @@ export function toMantineSemanticProps(props: ISharedStyleProps): IMantineResolv
665
665
  *
666
666
  * Appearance precedence (mirrors the web renderer, which reads the same CMS
667
667
  * fields straight into Mantine):
668
- * 1. `shared_variant` (Mantine variant) mapped onto the HeroUI button vocab;
669
- * 2. else `shared_color` (Mantine palette) mapped onto a button variant;
668
+ * 1. `variant` (Mantine variant) mapped onto the HeroUI button vocab;
669
+ * 2. else `color` (Mantine palette) mapped onto a button variant;
670
670
  * 3. else the legacy `intent` mapping (back-compat fallback).
671
- * The semantic `color` is resolved from `shared_color` first, then `intent`.
671
+ * The semantic `color` is resolved from `color` first, then `intent`.
672
672
  */
673
673
  export function toHeroUiSemanticProps(props: ISharedStyleProps): IHeroUiResolvedStyle {
674
674
  const buttonVariant =
@@ -5,8 +5,8 @@ SPDX-License-Identifier: MPL-2.0
5
5
  /**
6
6
  * Shared Tailwind preset extended by both the web frontend (Tailwind v4)
7
7
  * and the mobile app (Uniwind v4 inside HeroUI Native). Anchors the same
8
- * scale values that drive `shared_size`, `shared_radius`,
9
- * `shared_spacing`, and the color palette so a class like `p-md` or
8
+ * scale values that drive `size`, `radius`,
9
+ * `spacing`, and the color palette so a class like `p-md` or
10
10
  * `text-blue-6` resolves identically on web and mobile.
11
11
  */
12
12
 
@@ -4,7 +4,7 @@ SPDX-License-Identifier: MPL-2.0
4
4
  */
5
5
  /**
6
6
  * Mantine semantic token tables. Both the web Mantine theme and the
7
- * mobile HeroUI Native theme extend these so a `shared_size: 'md'` on a
7
+ * mobile HeroUI Native theme extend these so a `size: 'md'` on a
8
8
  * section renders identical sizing regardless of platform.
9
9
  *
10
10
  * Pixel values come straight from Mantine v9 defaults: