@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.
Files changed (47) hide show
  1. package/CHANGELOG.md +109 -0
  2. package/dist/{common-DMm4kymA.d.mts → common-qaDIAYS3.d.mts} +5 -4
  3. package/dist/{common-DMm4kymA.d.ts → common-qaDIAYS3.d.ts} +5 -4
  4. package/dist/index.d.mts +9 -9
  5. package/dist/index.d.ts +9 -9
  6. package/dist/index.js +99 -175
  7. package/dist/index.mjs +99 -172
  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 +90 -91
  11. package/dist/plugin-sdk/index.mjs +90 -91
  12. package/dist/registry/index.d.mts +3 -3
  13. package/dist/registry/index.d.ts +3 -3
  14. package/dist/registry/index.js +90 -90
  15. package/dist/registry/index.mjs +90 -90
  16. package/dist/{styles.registry-B8IaEULk.d.ts → styles.registry-4W0LzmZB.d.mts} +194 -365
  17. package/dist/{styles.registry-DhkxrV2-.d.mts → styles.registry-D6xMm5VR.d.ts} +194 -365
  18. package/dist/theme/index.d.mts +42 -91
  19. package/dist/theme/index.d.ts +42 -91
  20. package/dist/theme/index.js +9 -85
  21. package/dist/theme/index.mjs +9 -82
  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/plugin-sdk/define.ts +0 -1
  26. package/src/registry/__tests__/platform.test.ts +0 -4
  27. package/src/registry/__tests__/registry.test.ts +0 -2
  28. package/src/registry/styles.registry.ts +90 -96
  29. package/src/theme/__tests__/mantineVariant.test.ts +2 -2
  30. package/src/theme/__tests__/semantic.test.ts +34 -71
  31. package/src/theme/mantineVariant.ts +3 -3
  32. package/src/theme/semantic.ts +45 -185
  33. package/src/theme/tailwind.ts +2 -2
  34. package/src/theme/tokens.ts +3 -3
  35. package/src/types/__tests__/mobile-adapters.test.ts +1 -1
  36. package/src/types/mantine/common.ts +4 -3
  37. package/src/types/mobile-adapters.ts +4 -4
  38. package/src/types/styles/auth.ts +10 -10
  39. package/src/types/styles/base.ts +2 -2
  40. package/src/types/styles/composite.ts +7 -9
  41. package/src/types/styles/error.ts +9 -9
  42. package/src/types/styles/forms.ts +74 -58
  43. package/src/types/styles/interactive.ts +34 -32
  44. package/src/types/styles/layout.ts +42 -42
  45. package/src/types/styles/media.ts +6 -6
  46. package/src/types/styles/typography.ts +13 -13
  47. 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, T as TMantineColor, p as TMantineVariant, k as TSharedRadius } from '../common-qaDIAYS3.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:
@@ -29,8 +29,8 @@ declare const CONTAINER_SIZE_PX: Record<TMantineSize, number>;
29
29
  /**
30
30
  * Mantine palette base colors (color-6 from each scale). Each renderer
31
31
  * maps these to its own theme tokens. For HeroUI Native we feed these
32
- * into the theme builder so `web_color: 'blue'` resolves to the
33
- * same Mantine-blue look on mobile.
32
+ * into the theme builder so the portable `color: 'blue'` field resolves
33
+ * to the same Mantine-blue look on mobile.
34
34
  */
35
35
  declare const COLOR_PALETTE: Record<TCanonicalColor, string>;
36
36
  /**
@@ -62,8 +62,9 @@ declare function colorToHex(name: string | undefined, shade?: number): string |
62
62
 
63
63
  /**
64
64
  * Shared semantic style mapper — the single source of truth that turns
65
- * renderer-agnostic CMS values (`shared_*` fields) into concrete per-platform
66
- * props. Renderers consume this module instead of duplicating mapping logic.
65
+ * renderer-agnostic CMS values (the unprefixed portable fields) into concrete
66
+ * per-platform props. Renderers consume this module instead of duplicating
67
+ * mapping logic.
67
68
  *
68
69
  * - Web -> Mantine (`toMantineSemanticProps`)
69
70
  * - Mobile -> HeroUI Native (`toHeroUiSemanticProps`)
@@ -71,18 +72,19 @@ declare function colorToHex(name: string | undefined, shade?: number): string |
71
72
  *
72
73
  * Design rules (mobile rendering plan, section 8.2):
73
74
  * - 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
75
+ * (`size` = sm|md|lg, `radius` = none|sm|md|lg|full), so every
75
76
  * value maps 1:1 to each platform. The backend enforces the same domain
76
77
  * (migration `Version20260618195450`).
77
78
  * - NO implicit cross-platform fallback. These functions take already-resolved
78
- * SHARED props; the precedence `web_*`/`mobile_*` override -> `shared_*` ->
79
- * component default is applied by each platform renderer, never here.
79
+ * portable props; the precedence `web_*`/`mobile_*` override -> portable
80
+ * (unprefixed) -> component default is applied by each platform renderer,
81
+ * never here.
80
82
  * - Exhaustive enum handling (every switch covers the full domain).
81
83
  *
82
- * Platform-specific props stay separate from these shared values:
84
+ * Platform-specific props stay separate from these portable values:
83
85
  * - `web_*` Mantine-only fields
84
86
  * - `mobile_*` HeroUI/native-only fields
85
- * - shared the semantic fields mapped here
87
+ * - portable the unprefixed semantic fields mapped here
86
88
  */
87
89
 
88
90
  /** Cross-platform size: the true common denominator (HeroUI Native has no xs/xl). */
@@ -90,16 +92,13 @@ type TSemanticSize = TSharedSize;
90
92
  type TSemanticSpacing = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
91
93
  /** Cross-platform radius. `full` = pill; `none` = square. */
92
94
  type TSemanticRadius = TSharedRadius;
93
- type TSemanticIntent = 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'neutral';
94
95
  type TSemanticState = 'disabled' | 'loading' | 'invalid' | 'required';
95
96
  /**
96
- * Cross-platform colour + variant authored in the CMS (`shared_color` /
97
- * `shared_variant`). These are stored as Mantine palette / variant *values* —
98
- * the catalog keeps them verbatim (migration `Version20260618143216` renamed the
99
- * legacy `mantine_*` fields to `shared_*` without touching the values). They are
100
- * the REAL cross-platform appearance fields (there is no `shared_intent` in the
101
- * live catalog); the mapper maps them onto HeroUI Native for mobile, while the
102
- * web renderer feeds them straight into Mantine.
97
+ * Cross-platform colour + variant authored in the CMS (`color` /
98
+ * `variant`), stored as Mantine palette / variant *values* kept verbatim by the
99
+ * catalog. They are the canonical cross-platform appearance fields; the mapper
100
+ * maps them onto HeroUI Native for mobile, while the web renderer feeds them
101
+ * straight into Mantine.
103
102
  */
104
103
  type TSemanticColor = TMantineColor;
105
104
  type TSemanticVariant = TMantineVariant;
@@ -114,28 +113,22 @@ interface ISharedStyleProps {
114
113
  size?: TSemanticSize;
115
114
  spacing?: TSemanticSpacing;
116
115
  radius?: TSemanticRadius;
117
- /** Mantine palette colour authored via `shared_color` (cross-platform). */
116
+ /** Mantine palette colour authored via `color` (cross-platform). */
118
117
  color?: TSemanticColor;
119
- /** Mantine variant authored via `shared_variant` (cross-platform). */
118
+ /** Mantine variant authored via `variant` (cross-platform). */
120
119
  variant?: TSemanticVariant;
121
- /**
122
- * Legacy semantic intent. Kept for back-compat; `shared_intent` is NOT in the
123
- * live catalog, so real CMS sections drive appearance through `color` /
124
- * `variant` above. Used as the final fallback in the platform resolvers.
125
- */
126
- intent?: TSemanticIntent;
127
120
  /** Active boolean states. Stored as a small set so multiple can apply. */
128
121
  states?: readonly TSemanticState[];
129
122
  /** Layout: stretch the control to the full width of its container. */
130
123
  fullWidth?: boolean;
131
124
  }
132
- type TMantineMappedColor = 'blue' | 'gray' | 'green' | 'yellow' | 'red';
133
- type TMantineMappedVariant = 'filled' | 'light' | 'outline' | 'default';
134
125
  interface IMantineResolvedStyle {
135
126
  /** Mantine accepts sm|md|lg 1:1 (a subset of its xs..xl scale). */
136
127
  size?: TSemanticSize;
137
- color?: TMantineMappedColor;
138
- variant?: TMantineMappedVariant;
128
+ /** Mantine palette colour, read verbatim from the `color` field. */
129
+ color?: TSemanticColor;
130
+ /** Mantine variant, read verbatim from the `variant` field. */
131
+ variant?: TSemanticVariant;
139
132
  /** Mantine `radius` accepts a token or a number; pill => FULL_RADIUS_PX. */
140
133
  radius?: TSemanticSize | number;
141
134
  /** Margin/padding spacing token (xs..xl); `none` => undefined. */
@@ -154,9 +147,9 @@ type THeroUiButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'outline' | '
154
147
  type THeroUiColor = 'accent' | 'default' | 'success' | 'warning' | 'danger';
155
148
  interface IHeroUiResolvedStyle {
156
149
  size?: THeroUiSize;
157
- /** Intent mapped onto the Button variant vocabulary. */
150
+ /** Button variant derived from the Mantine `variant`/`color`. */
158
151
  buttonVariant?: THeroUiButtonVariant;
159
- /** Intent mapped onto the semantic color vocabulary (Chip/Tag/etc). */
152
+ /** Semantic color derived from the Mantine `color` (Chip/Tag/etc). */
160
153
  color?: THeroUiColor;
161
154
  /** Resolved radius in px (pill => FULL_RADIUS_PX, none => 0). */
162
155
  radiusPx?: number;
@@ -191,48 +184,7 @@ declare function mapRadiusToMantine(radius: TSemanticRadius | undefined): TSeman
191
184
  /** Resolve a semantic spacing token to px (none => 0). */
192
185
  declare function mapSpacingToPx(spacing: TSemanticSpacing | undefined): number | undefined;
193
186
  /**
194
- * Map a semantic intent to a Mantine `{ color, variant }` pair.
195
- * primary -> blue / filled
196
- * secondary -> gray / light
197
- * success -> green / filled
198
- * warning -> yellow / filled
199
- * danger -> red / filled
200
- * neutral -> gray / default
201
- */
202
- declare function mapIntentToMantine(intent: TSemanticIntent | undefined): {
203
- color: TMantineMappedColor;
204
- variant: TMantineMappedVariant;
205
- } | undefined;
206
- /**
207
- * Map a semantic intent to a HeroUI Native **Button** variant.
208
- *
209
- * HeroUI buttons have no dedicated success/warning variant. Rather than
210
- * silently collapse them, the dedicated status surfaces use
211
- * {@link mapIntentToHeroUiColor}; the Button variant maps success/warning to
212
- * `primary` because that is the closest *prominent* action affordance, and the
213
- * status color is carried separately. This is an explicit semantic choice, not
214
- * a clamp that hides an unsupported size/scale value.
215
- * primary -> primary
216
- * secondary -> secondary
217
- * success -> primary (status color carried by mapIntentToHeroUiColor)
218
- * warning -> primary (status color carried by mapIntentToHeroUiColor)
219
- * danger -> danger
220
- * neutral -> secondary
221
- */
222
- declare function mapIntentToHeroUiButtonVariant(intent: TSemanticIntent | undefined): THeroUiButtonVariant | undefined;
223
- /**
224
- * Map a semantic intent to a HeroUI Native semantic color (Chip/Tag/
225
- * status surfaces, which DO support success/warning).
226
- * primary -> accent
227
- * secondary -> default
228
- * success -> success
229
- * warning -> warning
230
- * danger -> danger
231
- * neutral -> default
232
- */
233
- declare function mapIntentToHeroUiColor(intent: TSemanticIntent | undefined): THeroUiColor | undefined;
234
- /**
235
- * Map a Mantine palette colour (`shared_color`) onto a HeroUI Native semantic
187
+ * Map a Mantine palette colour (`color`) onto a HeroUI Native semantic
236
188
  * colour (Chip / Tag / status surfaces). The Mantine palette is broad; it
237
189
  * collapses onto HeroUI's five semantic colours by hue family:
238
190
  * red/pink -> danger
@@ -243,14 +195,14 @@ declare function mapIntentToHeroUiColor(intent: TSemanticIntent | undefined): TH
243
195
  */
244
196
  declare function mapMantineColorToHeroUiColor(color: TSemanticColor | undefined): THeroUiColor | undefined;
245
197
  /**
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
198
+ * Map a Mantine palette colour (`color`) onto a HeroUI Native **Button**
199
+ * variant when no explicit `variant` is authored. HeroUI buttons encode
248
200
  * colour in the variant, so the destructive hue becomes `danger`, neutral hues
249
201
  * become `secondary`, and everything else stays the prominent `primary`.
250
202
  */
251
203
  declare function mapMantineColorToHeroUiButtonVariant(color: TSemanticColor | undefined): THeroUiButtonVariant | undefined;
252
204
  /**
253
- * Map a Mantine variant (`shared_variant`) onto the HeroUI Native Button
205
+ * Map a Mantine variant (`variant`) onto the HeroUI Native Button
254
206
  * vocabulary:
255
207
  * filled / gradient -> primary
256
208
  * light / white / default -> secondary
@@ -259,14 +211,14 @@ declare function mapMantineColorToHeroUiButtonVariant(color: TSemanticColor | un
259
211
  */
260
212
  declare function mapMantineVariantToHeroUiButtonVariant(variant: TSemanticVariant | undefined): THeroUiButtonVariant | undefined;
261
213
  /**
262
- * Map the accordion variant token (`shared_accordion_variant`: Mantine
214
+ * Map the accordion variant token (`accordion_variant`: Mantine
263
215
  * default/contained/filled/separated) onto the HeroUI Native Accordion `variant`
264
216
  * vocabulary. HeroUI Native only has `default` (plain list) and `surface`
265
217
  * (grouped container), so every "boxed" Mantine variant collapses to `surface`.
266
218
  */
267
219
  declare function mapAccordionVariantToHeroUiVariant(variant: string | undefined): 'default' | 'surface';
268
220
  /**
269
- * Map the chip variant token (`shared_chip_variant`: Mantine
221
+ * Map the chip variant token (`chip_variant`: Mantine
270
222
  * filled/outline/light) onto the HeroUI Native Chip `variant` vocabulary
271
223
  * (`primary`/`secondary`/`tertiary`/`soft`):
272
224
  * - filled -> primary (solid accent fill)
@@ -277,8 +229,8 @@ declare function mapChipVariantToHeroUiVariant(variant: string | undefined): 'pr
277
229
  /** A React Native-safe dimension: a px number, a percentage string, or "auto". */
278
230
  type TReactNativeDimension = number | `${number}%` | 'auto';
279
231
  /**
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
232
+ * Parse a CMS dimension string (`shared_width`/`shared_height`/`mih`/`miw`/
233
+ * `mah`/`maw`) into a React Native-safe value. Web (Mantine) accepts the raw
282
234
  * string verbatim ("320px", "100%", "auto"); React Native does NOT accept a
283
235
  * unit suffix, so a px value must become a unitless number:
284
236
  * "320px" | "320" | 320 -> 320 (number)
@@ -309,7 +261,7 @@ interface IReactNativeGridColumn {
309
261
  */
310
262
  declare function gridSpanToReactNativeColumn(span: string | number | undefined | null, cols?: number): IReactNativeGridColumn;
311
263
  /**
312
- * Map a `shared_divider_variant` (solid/dashed/dotted) onto a React Native
264
+ * Map a `divider_variant` (solid/dashed/dotted) onto a React Native
313
265
  * `borderStyle`. The vocabularies are identical, so this validates the domain
314
266
  * and falls back to 'solid'.
315
267
  */
@@ -330,10 +282,9 @@ declare function toMantineSemanticProps(props: ISharedStyleProps): IMantineResol
330
282
  *
331
283
  * Appearance precedence (mirrors the web renderer, which reads the same CMS
332
284
  * 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;
335
- * 3. else the legacy `intent` mapping (back-compat fallback).
336
- * The semantic `color` is resolved from `shared_color` first, then `intent`.
285
+ * 1. `variant` (Mantine variant) mapped onto the HeroUI button vocab;
286
+ * 2. else `color` (Mantine palette) mapped onto a button variant.
287
+ * The semantic `color` is resolved from `color`.
337
288
  */
338
289
  declare function toHeroUiSemanticProps(props: ISharedStyleProps): IHeroUiResolvedStyle;
339
290
  /**
@@ -363,10 +314,10 @@ declare const resolveSharedStyleForMobile: typeof toHeroUiSemanticProps;
363
314
  * SCOPE — this is NOT the semantic mapper (`semantic.ts`). The two have
364
315
  * different input domains and both live here so there is exactly one home
365
316
  * for style mapping:
366
- * - `semantic.ts` maps renderer-agnostic shared fields
367
- * (`intent` / `size` / `radius` / `spacing`) per platform.
317
+ * - `semantic.ts` maps renderer-agnostic unprefixed portable fields
318
+ * (`color` / `variant` / `size` / `radius` / `spacing`) per platform.
368
319
  * - `mantineVariant.ts` resolves a Mantine palette `color` + `variant` value
369
- * pair (e.g. the semantic `shared_color` + `web_variant`)
320
+ * pair (e.g. the portable `color` + `variant`)
370
321
  * into concrete RGB. Its only runtime
371
322
  * consumer today is the mobile **Expo Web preview**
372
323
  * fallback (where `heroui-native` cannot render and the
@@ -394,4 +345,4 @@ interface IResolvedVariant {
394
345
  }
395
346
  declare function resolveMantineVariant(variant: string | undefined, color: string | undefined): IResolvedVariant;
396
347
 
397
- export { COLOR_PALETTE, COLOR_SCALES, CONTAINER_SIZE_PX, FONT_SIZE_PX, FULL_RADIUS_PX, type IHeroUiResolvedStyle, type IMantineResolvedStyle, type IReactNativeGridColumn, type IReactNativeResolvedStyle, type IReactNativeThemeScales, type IResolvedVariant, type ISharedStyleProps, type ISpacingResolved, LINE_HEIGHT, RADIUS_PX, SPACING_PX, SPACING_TO_TAILWIND, type TCanonicalColor, type TCanonicalRadius, type TCanonicalSpacing, type THeroUiButtonVariant, type THeroUiColor, type THeroUiSize, type TMantineMappedColor, type TMantineMappedVariant, type TReactNativeDimension, type TSemanticColor, type TSemanticIntent, type TSemanticRadius, type TSemanticSize, type TSemanticSpacing, type TSemanticState, type TSemanticVariant, colorToHex, gridSpanToReactNativeColumn, mapAccordionVariantToHeroUiVariant, mapChipVariantToHeroUiVariant, mapDividerVariantToReactNative, mapIntentToHeroUiButtonVariant, mapIntentToHeroUiColor, mapIntentToMantine, mapMantineColorToHeroUiButtonVariant, mapMantineColorToHeroUiColor, mapMantineVariantToHeroUiButtonVariant, mapRadiusToMantine, mapRadiusToPx, mapSizeToHeroUi, mapSizeToMantine, mapSpacingToPx, parseDimensionToReactNative, parseDimensionToWeb, radiusToPx, resolveMantineVariant, resolveSharedStyle, resolveSharedStyleForMobile, resolveSharedStyleForWeb, resolveSharedStyleProps, sizeToFontPx, spacingToPx, toHeroUiSemanticProps, toMantineSemanticProps, toReactNativeSemanticStyle };
348
+ export { COLOR_PALETTE, COLOR_SCALES, CONTAINER_SIZE_PX, FONT_SIZE_PX, FULL_RADIUS_PX, type IHeroUiResolvedStyle, type IMantineResolvedStyle, type IReactNativeGridColumn, type IReactNativeResolvedStyle, type IReactNativeThemeScales, type IResolvedVariant, type ISharedStyleProps, type ISpacingResolved, LINE_HEIGHT, RADIUS_PX, SPACING_PX, SPACING_TO_TAILWIND, type TCanonicalColor, type TCanonicalRadius, type TCanonicalSpacing, type THeroUiButtonVariant, type THeroUiColor, type THeroUiSize, type TReactNativeDimension, type TSemanticColor, type TSemanticRadius, type TSemanticSize, type TSemanticSpacing, type TSemanticState, type TSemanticVariant, colorToHex, gridSpanToReactNativeColumn, mapAccordionVariantToHeroUiVariant, mapChipVariantToHeroUiVariant, mapDividerVariantToReactNative, mapMantineColorToHeroUiButtonVariant, mapMantineColorToHeroUiColor, mapMantineVariantToHeroUiButtonVariant, mapRadiusToMantine, mapRadiusToPx, mapSizeToHeroUi, mapSizeToMantine, mapSpacingToPx, parseDimensionToReactNative, parseDimensionToWeb, radiusToPx, resolveMantineVariant, resolveSharedStyle, resolveSharedStyleForMobile, resolveSharedStyleForWeb, resolveSharedStyleProps, sizeToFontPx, spacingToPx, toHeroUiSemanticProps, toMantineSemanticProps, toReactNativeSemanticStyle };
@@ -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, T as TMantineColor, p as TMantineVariant, k as TSharedRadius } from '../common-qaDIAYS3.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:
@@ -29,8 +29,8 @@ declare const CONTAINER_SIZE_PX: Record<TMantineSize, number>;
29
29
  /**
30
30
  * Mantine palette base colors (color-6 from each scale). Each renderer
31
31
  * maps these to its own theme tokens. For HeroUI Native we feed these
32
- * into the theme builder so `web_color: 'blue'` resolves to the
33
- * same Mantine-blue look on mobile.
32
+ * into the theme builder so the portable `color: 'blue'` field resolves
33
+ * to the same Mantine-blue look on mobile.
34
34
  */
35
35
  declare const COLOR_PALETTE: Record<TCanonicalColor, string>;
36
36
  /**
@@ -62,8 +62,9 @@ declare function colorToHex(name: string | undefined, shade?: number): string |
62
62
 
63
63
  /**
64
64
  * Shared semantic style mapper — the single source of truth that turns
65
- * renderer-agnostic CMS values (`shared_*` fields) into concrete per-platform
66
- * props. Renderers consume this module instead of duplicating mapping logic.
65
+ * renderer-agnostic CMS values (the unprefixed portable fields) into concrete
66
+ * per-platform props. Renderers consume this module instead of duplicating
67
+ * mapping logic.
67
68
  *
68
69
  * - Web -> Mantine (`toMantineSemanticProps`)
69
70
  * - Mobile -> HeroUI Native (`toHeroUiSemanticProps`)
@@ -71,18 +72,19 @@ declare function colorToHex(name: string | undefined, shade?: number): string |
71
72
  *
72
73
  * Design rules (mobile rendering plan, section 8.2):
73
74
  * - 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
75
+ * (`size` = sm|md|lg, `radius` = none|sm|md|lg|full), so every
75
76
  * value maps 1:1 to each platform. The backend enforces the same domain
76
77
  * (migration `Version20260618195450`).
77
78
  * - NO implicit cross-platform fallback. These functions take already-resolved
78
- * SHARED props; the precedence `web_*`/`mobile_*` override -> `shared_*` ->
79
- * component default is applied by each platform renderer, never here.
79
+ * portable props; the precedence `web_*`/`mobile_*` override -> portable
80
+ * (unprefixed) -> component default is applied by each platform renderer,
81
+ * never here.
80
82
  * - Exhaustive enum handling (every switch covers the full domain).
81
83
  *
82
- * Platform-specific props stay separate from these shared values:
84
+ * Platform-specific props stay separate from these portable values:
83
85
  * - `web_*` Mantine-only fields
84
86
  * - `mobile_*` HeroUI/native-only fields
85
- * - shared the semantic fields mapped here
87
+ * - portable the unprefixed semantic fields mapped here
86
88
  */
87
89
 
88
90
  /** Cross-platform size: the true common denominator (HeroUI Native has no xs/xl). */
@@ -90,16 +92,13 @@ type TSemanticSize = TSharedSize;
90
92
  type TSemanticSpacing = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
91
93
  /** Cross-platform radius. `full` = pill; `none` = square. */
92
94
  type TSemanticRadius = TSharedRadius;
93
- type TSemanticIntent = 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'neutral';
94
95
  type TSemanticState = 'disabled' | 'loading' | 'invalid' | 'required';
95
96
  /**
96
- * Cross-platform colour + variant authored in the CMS (`shared_color` /
97
- * `shared_variant`). These are stored as Mantine palette / variant *values* —
98
- * the catalog keeps them verbatim (migration `Version20260618143216` renamed the
99
- * legacy `mantine_*` fields to `shared_*` without touching the values). They are
100
- * the REAL cross-platform appearance fields (there is no `shared_intent` in the
101
- * live catalog); the mapper maps them onto HeroUI Native for mobile, while the
102
- * web renderer feeds them straight into Mantine.
97
+ * Cross-platform colour + variant authored in the CMS (`color` /
98
+ * `variant`), stored as Mantine palette / variant *values* kept verbatim by the
99
+ * catalog. They are the canonical cross-platform appearance fields; the mapper
100
+ * maps them onto HeroUI Native for mobile, while the web renderer feeds them
101
+ * straight into Mantine.
103
102
  */
104
103
  type TSemanticColor = TMantineColor;
105
104
  type TSemanticVariant = TMantineVariant;
@@ -114,28 +113,22 @@ interface ISharedStyleProps {
114
113
  size?: TSemanticSize;
115
114
  spacing?: TSemanticSpacing;
116
115
  radius?: TSemanticRadius;
117
- /** Mantine palette colour authored via `shared_color` (cross-platform). */
116
+ /** Mantine palette colour authored via `color` (cross-platform). */
118
117
  color?: TSemanticColor;
119
- /** Mantine variant authored via `shared_variant` (cross-platform). */
118
+ /** Mantine variant authored via `variant` (cross-platform). */
120
119
  variant?: TSemanticVariant;
121
- /**
122
- * Legacy semantic intent. Kept for back-compat; `shared_intent` is NOT in the
123
- * live catalog, so real CMS sections drive appearance through `color` /
124
- * `variant` above. Used as the final fallback in the platform resolvers.
125
- */
126
- intent?: TSemanticIntent;
127
120
  /** Active boolean states. Stored as a small set so multiple can apply. */
128
121
  states?: readonly TSemanticState[];
129
122
  /** Layout: stretch the control to the full width of its container. */
130
123
  fullWidth?: boolean;
131
124
  }
132
- type TMantineMappedColor = 'blue' | 'gray' | 'green' | 'yellow' | 'red';
133
- type TMantineMappedVariant = 'filled' | 'light' | 'outline' | 'default';
134
125
  interface IMantineResolvedStyle {
135
126
  /** Mantine accepts sm|md|lg 1:1 (a subset of its xs..xl scale). */
136
127
  size?: TSemanticSize;
137
- color?: TMantineMappedColor;
138
- variant?: TMantineMappedVariant;
128
+ /** Mantine palette colour, read verbatim from the `color` field. */
129
+ color?: TSemanticColor;
130
+ /** Mantine variant, read verbatim from the `variant` field. */
131
+ variant?: TSemanticVariant;
139
132
  /** Mantine `radius` accepts a token or a number; pill => FULL_RADIUS_PX. */
140
133
  radius?: TSemanticSize | number;
141
134
  /** Margin/padding spacing token (xs..xl); `none` => undefined. */
@@ -154,9 +147,9 @@ type THeroUiButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'outline' | '
154
147
  type THeroUiColor = 'accent' | 'default' | 'success' | 'warning' | 'danger';
155
148
  interface IHeroUiResolvedStyle {
156
149
  size?: THeroUiSize;
157
- /** Intent mapped onto the Button variant vocabulary. */
150
+ /** Button variant derived from the Mantine `variant`/`color`. */
158
151
  buttonVariant?: THeroUiButtonVariant;
159
- /** Intent mapped onto the semantic color vocabulary (Chip/Tag/etc). */
152
+ /** Semantic color derived from the Mantine `color` (Chip/Tag/etc). */
160
153
  color?: THeroUiColor;
161
154
  /** Resolved radius in px (pill => FULL_RADIUS_PX, none => 0). */
162
155
  radiusPx?: number;
@@ -191,48 +184,7 @@ declare function mapRadiusToMantine(radius: TSemanticRadius | undefined): TSeman
191
184
  /** Resolve a semantic spacing token to px (none => 0). */
192
185
  declare function mapSpacingToPx(spacing: TSemanticSpacing | undefined): number | undefined;
193
186
  /**
194
- * Map a semantic intent to a Mantine `{ color, variant }` pair.
195
- * primary -> blue / filled
196
- * secondary -> gray / light
197
- * success -> green / filled
198
- * warning -> yellow / filled
199
- * danger -> red / filled
200
- * neutral -> gray / default
201
- */
202
- declare function mapIntentToMantine(intent: TSemanticIntent | undefined): {
203
- color: TMantineMappedColor;
204
- variant: TMantineMappedVariant;
205
- } | undefined;
206
- /**
207
- * Map a semantic intent to a HeroUI Native **Button** variant.
208
- *
209
- * HeroUI buttons have no dedicated success/warning variant. Rather than
210
- * silently collapse them, the dedicated status surfaces use
211
- * {@link mapIntentToHeroUiColor}; the Button variant maps success/warning to
212
- * `primary` because that is the closest *prominent* action affordance, and the
213
- * status color is carried separately. This is an explicit semantic choice, not
214
- * a clamp that hides an unsupported size/scale value.
215
- * primary -> primary
216
- * secondary -> secondary
217
- * success -> primary (status color carried by mapIntentToHeroUiColor)
218
- * warning -> primary (status color carried by mapIntentToHeroUiColor)
219
- * danger -> danger
220
- * neutral -> secondary
221
- */
222
- declare function mapIntentToHeroUiButtonVariant(intent: TSemanticIntent | undefined): THeroUiButtonVariant | undefined;
223
- /**
224
- * Map a semantic intent to a HeroUI Native semantic color (Chip/Tag/
225
- * status surfaces, which DO support success/warning).
226
- * primary -> accent
227
- * secondary -> default
228
- * success -> success
229
- * warning -> warning
230
- * danger -> danger
231
- * neutral -> default
232
- */
233
- declare function mapIntentToHeroUiColor(intent: TSemanticIntent | undefined): THeroUiColor | undefined;
234
- /**
235
- * Map a Mantine palette colour (`shared_color`) onto a HeroUI Native semantic
187
+ * Map a Mantine palette colour (`color`) onto a HeroUI Native semantic
236
188
  * colour (Chip / Tag / status surfaces). The Mantine palette is broad; it
237
189
  * collapses onto HeroUI's five semantic colours by hue family:
238
190
  * red/pink -> danger
@@ -243,14 +195,14 @@ declare function mapIntentToHeroUiColor(intent: TSemanticIntent | undefined): TH
243
195
  */
244
196
  declare function mapMantineColorToHeroUiColor(color: TSemanticColor | undefined): THeroUiColor | undefined;
245
197
  /**
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
198
+ * Map a Mantine palette colour (`color`) onto a HeroUI Native **Button**
199
+ * variant when no explicit `variant` is authored. HeroUI buttons encode
248
200
  * colour in the variant, so the destructive hue becomes `danger`, neutral hues
249
201
  * become `secondary`, and everything else stays the prominent `primary`.
250
202
  */
251
203
  declare function mapMantineColorToHeroUiButtonVariant(color: TSemanticColor | undefined): THeroUiButtonVariant | undefined;
252
204
  /**
253
- * Map a Mantine variant (`shared_variant`) onto the HeroUI Native Button
205
+ * Map a Mantine variant (`variant`) onto the HeroUI Native Button
254
206
  * vocabulary:
255
207
  * filled / gradient -> primary
256
208
  * light / white / default -> secondary
@@ -259,14 +211,14 @@ declare function mapMantineColorToHeroUiButtonVariant(color: TSemanticColor | un
259
211
  */
260
212
  declare function mapMantineVariantToHeroUiButtonVariant(variant: TSemanticVariant | undefined): THeroUiButtonVariant | undefined;
261
213
  /**
262
- * Map the accordion variant token (`shared_accordion_variant`: Mantine
214
+ * Map the accordion variant token (`accordion_variant`: Mantine
263
215
  * default/contained/filled/separated) onto the HeroUI Native Accordion `variant`
264
216
  * vocabulary. HeroUI Native only has `default` (plain list) and `surface`
265
217
  * (grouped container), so every "boxed" Mantine variant collapses to `surface`.
266
218
  */
267
219
  declare function mapAccordionVariantToHeroUiVariant(variant: string | undefined): 'default' | 'surface';
268
220
  /**
269
- * Map the chip variant token (`shared_chip_variant`: Mantine
221
+ * Map the chip variant token (`chip_variant`: Mantine
270
222
  * filled/outline/light) onto the HeroUI Native Chip `variant` vocabulary
271
223
  * (`primary`/`secondary`/`tertiary`/`soft`):
272
224
  * - filled -> primary (solid accent fill)
@@ -277,8 +229,8 @@ declare function mapChipVariantToHeroUiVariant(variant: string | undefined): 'pr
277
229
  /** A React Native-safe dimension: a px number, a percentage string, or "auto". */
278
230
  type TReactNativeDimension = number | `${number}%` | 'auto';
279
231
  /**
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
232
+ * Parse a CMS dimension string (`shared_width`/`shared_height`/`mih`/`miw`/
233
+ * `mah`/`maw`) into a React Native-safe value. Web (Mantine) accepts the raw
282
234
  * string verbatim ("320px", "100%", "auto"); React Native does NOT accept a
283
235
  * unit suffix, so a px value must become a unitless number:
284
236
  * "320px" | "320" | 320 -> 320 (number)
@@ -309,7 +261,7 @@ interface IReactNativeGridColumn {
309
261
  */
310
262
  declare function gridSpanToReactNativeColumn(span: string | number | undefined | null, cols?: number): IReactNativeGridColumn;
311
263
  /**
312
- * Map a `shared_divider_variant` (solid/dashed/dotted) onto a React Native
264
+ * Map a `divider_variant` (solid/dashed/dotted) onto a React Native
313
265
  * `borderStyle`. The vocabularies are identical, so this validates the domain
314
266
  * and falls back to 'solid'.
315
267
  */
@@ -330,10 +282,9 @@ declare function toMantineSemanticProps(props: ISharedStyleProps): IMantineResol
330
282
  *
331
283
  * Appearance precedence (mirrors the web renderer, which reads the same CMS
332
284
  * 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;
335
- * 3. else the legacy `intent` mapping (back-compat fallback).
336
- * The semantic `color` is resolved from `shared_color` first, then `intent`.
285
+ * 1. `variant` (Mantine variant) mapped onto the HeroUI button vocab;
286
+ * 2. else `color` (Mantine palette) mapped onto a button variant.
287
+ * The semantic `color` is resolved from `color`.
337
288
  */
338
289
  declare function toHeroUiSemanticProps(props: ISharedStyleProps): IHeroUiResolvedStyle;
339
290
  /**
@@ -363,10 +314,10 @@ declare const resolveSharedStyleForMobile: typeof toHeroUiSemanticProps;
363
314
  * SCOPE — this is NOT the semantic mapper (`semantic.ts`). The two have
364
315
  * different input domains and both live here so there is exactly one home
365
316
  * for style mapping:
366
- * - `semantic.ts` maps renderer-agnostic shared fields
367
- * (`intent` / `size` / `radius` / `spacing`) per platform.
317
+ * - `semantic.ts` maps renderer-agnostic unprefixed portable fields
318
+ * (`color` / `variant` / `size` / `radius` / `spacing`) per platform.
368
319
  * - `mantineVariant.ts` resolves a Mantine palette `color` + `variant` value
369
- * pair (e.g. the semantic `shared_color` + `web_variant`)
320
+ * pair (e.g. the portable `color` + `variant`)
370
321
  * into concrete RGB. Its only runtime
371
322
  * consumer today is the mobile **Expo Web preview**
372
323
  * fallback (where `heroui-native` cannot render and the
@@ -394,4 +345,4 @@ interface IResolvedVariant {
394
345
  }
395
346
  declare function resolveMantineVariant(variant: string | undefined, color: string | undefined): IResolvedVariant;
396
347
 
397
- export { COLOR_PALETTE, COLOR_SCALES, CONTAINER_SIZE_PX, FONT_SIZE_PX, FULL_RADIUS_PX, type IHeroUiResolvedStyle, type IMantineResolvedStyle, type IReactNativeGridColumn, type IReactNativeResolvedStyle, type IReactNativeThemeScales, type IResolvedVariant, type ISharedStyleProps, type ISpacingResolved, LINE_HEIGHT, RADIUS_PX, SPACING_PX, SPACING_TO_TAILWIND, type TCanonicalColor, type TCanonicalRadius, type TCanonicalSpacing, type THeroUiButtonVariant, type THeroUiColor, type THeroUiSize, type TMantineMappedColor, type TMantineMappedVariant, type TReactNativeDimension, type TSemanticColor, type TSemanticIntent, type TSemanticRadius, type TSemanticSize, type TSemanticSpacing, type TSemanticState, type TSemanticVariant, colorToHex, gridSpanToReactNativeColumn, mapAccordionVariantToHeroUiVariant, mapChipVariantToHeroUiVariant, mapDividerVariantToReactNative, mapIntentToHeroUiButtonVariant, mapIntentToHeroUiColor, mapIntentToMantine, mapMantineColorToHeroUiButtonVariant, mapMantineColorToHeroUiColor, mapMantineVariantToHeroUiButtonVariant, mapRadiusToMantine, mapRadiusToPx, mapSizeToHeroUi, mapSizeToMantine, mapSpacingToPx, parseDimensionToReactNative, parseDimensionToWeb, radiusToPx, resolveMantineVariant, resolveSharedStyle, resolveSharedStyleForMobile, resolveSharedStyleForWeb, resolveSharedStyleProps, sizeToFontPx, spacingToPx, toHeroUiSemanticProps, toMantineSemanticProps, toReactNativeSemanticStyle };
348
+ export { COLOR_PALETTE, COLOR_SCALES, CONTAINER_SIZE_PX, FONT_SIZE_PX, FULL_RADIUS_PX, type IHeroUiResolvedStyle, type IMantineResolvedStyle, type IReactNativeGridColumn, type IReactNativeResolvedStyle, type IReactNativeThemeScales, type IResolvedVariant, type ISharedStyleProps, type ISpacingResolved, LINE_HEIGHT, RADIUS_PX, SPACING_PX, SPACING_TO_TAILWIND, type TCanonicalColor, type TCanonicalRadius, type TCanonicalSpacing, type THeroUiButtonVariant, type THeroUiColor, type THeroUiSize, type TReactNativeDimension, type TSemanticColor, type TSemanticRadius, type TSemanticSize, type TSemanticSpacing, type TSemanticState, type TSemanticVariant, colorToHex, gridSpanToReactNativeColumn, mapAccordionVariantToHeroUiVariant, mapChipVariantToHeroUiVariant, mapDividerVariantToReactNative, mapMantineColorToHeroUiButtonVariant, mapMantineColorToHeroUiColor, mapMantineVariantToHeroUiButtonVariant, mapRadiusToMantine, mapRadiusToPx, mapSizeToHeroUi, mapSizeToMantine, mapSpacingToPx, parseDimensionToReactNative, parseDimensionToWeb, radiusToPx, resolveMantineVariant, resolveSharedStyle, resolveSharedStyleForMobile, resolveSharedStyleForWeb, resolveSharedStyleProps, sizeToFontPx, spacingToPx, toHeroUiSemanticProps, toMantineSemanticProps, toReactNativeSemanticStyle };