@selfhelp/shared 1.14.9 → 1.14.12
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 +73 -0
- package/dist/{common-DVC0R_AX.d.mts → common-DMm4kymA.d.mts} +1 -1
- package/dist/{common-DVC0R_AX.d.ts → common-DMm4kymA.d.ts} +1 -1
- package/dist/index.d.mts +10 -4
- package/dist/index.d.ts +10 -4
- package/dist/index.js +50 -0
- package/dist/index.mjs +46 -0
- package/dist/plugin-sdk/index.d.mts +2 -2
- package/dist/plugin-sdk/index.d.ts +2 -2
- package/dist/registry/index.d.mts +3 -3
- package/dist/registry/index.d.ts +3 -3
- package/dist/{styles.registry-BkHw6CdG.d.ts → styles.registry-CA6p55GE.d.mts} +45 -44
- package/dist/{styles.registry-CImqMXS4.d.mts → styles.registry-DACrC1dz.d.ts} +45 -44
- package/dist/theme/index.d.mts +42 -2
- package/dist/theme/index.d.ts +42 -2
- package/dist/theme/index.js +50 -0
- package/dist/theme/index.mjs +46 -0
- package/package.json +1 -1
- package/src/theme/__tests__/semantic.test.ts +77 -0
- package/src/theme/semantic.ts +95 -0
- package/src/types/mobile-adapters.ts +6 -0
- package/src/types/styles/layout.ts +60 -45
package/dist/theme/index.mjs
CHANGED
|
@@ -343,6 +343,48 @@ function mapChipVariantToHeroUiVariant(variant) {
|
|
|
343
343
|
return "primary";
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
|
+
function parseDimensionToReactNative(value) {
|
|
347
|
+
if (value === void 0 || value === null) return void 0;
|
|
348
|
+
if (typeof value === "number") return Number.isFinite(value) ? value : void 0;
|
|
349
|
+
const trimmed = value.trim();
|
|
350
|
+
if (trimmed === "") return void 0;
|
|
351
|
+
if (trimmed === "auto") return "auto";
|
|
352
|
+
const pct = /^(\d+(?:\.\d+)?)%$/.exec(trimmed);
|
|
353
|
+
if (pct) {
|
|
354
|
+
const n = Number(pct[1]);
|
|
355
|
+
return `${n}%`;
|
|
356
|
+
}
|
|
357
|
+
const px2 = /^(\d+(?:\.\d+)?)(?:px)?$/.exec(trimmed);
|
|
358
|
+
if (px2) return Number(px2[1]);
|
|
359
|
+
return void 0;
|
|
360
|
+
}
|
|
361
|
+
function parseDimensionToWeb(value) {
|
|
362
|
+
if (value === void 0 || value === null) return void 0;
|
|
363
|
+
if (typeof value === "number") return value;
|
|
364
|
+
const trimmed = value.trim();
|
|
365
|
+
return trimmed === "" ? void 0 : trimmed;
|
|
366
|
+
}
|
|
367
|
+
function gridSpanToReactNativeColumn(span, cols = 12) {
|
|
368
|
+
const totalCols = cols > 0 ? cols : 12;
|
|
369
|
+
if (span === "auto") return { flexBasis: 0, flexGrow: 1, flexShrink: 1 };
|
|
370
|
+
if (span === "content") return { flexBasis: "auto", flexGrow: 0, flexShrink: 0 };
|
|
371
|
+
const n = typeof span === "number" ? span : Number.parseInt(String(span ?? ""), 10);
|
|
372
|
+
if (!Number.isFinite(n) || n <= 0) return { flexBasis: "100%", flexGrow: 0, flexShrink: 1 };
|
|
373
|
+
const clamped = Math.min(n, totalCols);
|
|
374
|
+
const pct = Math.round(clamped / totalCols * 1e4) / 100;
|
|
375
|
+
return { flexBasis: `${pct}%`, flexGrow: 0, flexShrink: 1 };
|
|
376
|
+
}
|
|
377
|
+
function mapDividerVariantToReactNative(variant) {
|
|
378
|
+
switch (variant) {
|
|
379
|
+
case "dashed":
|
|
380
|
+
return "dashed";
|
|
381
|
+
case "dotted":
|
|
382
|
+
return "dotted";
|
|
383
|
+
case "solid":
|
|
384
|
+
default:
|
|
385
|
+
return "solid";
|
|
386
|
+
}
|
|
387
|
+
}
|
|
346
388
|
function hasState(states, state) {
|
|
347
389
|
return !!states && states.includes(state);
|
|
348
390
|
}
|
|
@@ -539,8 +581,10 @@ export {
|
|
|
539
581
|
SPACING_PX,
|
|
540
582
|
SPACING_TO_TAILWIND,
|
|
541
583
|
colorToHex,
|
|
584
|
+
gridSpanToReactNativeColumn,
|
|
542
585
|
mapAccordionVariantToHeroUiVariant,
|
|
543
586
|
mapChipVariantToHeroUiVariant,
|
|
587
|
+
mapDividerVariantToReactNative,
|
|
544
588
|
mapIntentToHeroUiButtonVariant,
|
|
545
589
|
mapIntentToHeroUiColor,
|
|
546
590
|
mapIntentToMantine,
|
|
@@ -552,6 +596,8 @@ export {
|
|
|
552
596
|
mapSizeToHeroUi,
|
|
553
597
|
mapSizeToMantine,
|
|
554
598
|
mapSpacingToPx,
|
|
599
|
+
parseDimensionToReactNative,
|
|
600
|
+
parseDimensionToWeb,
|
|
555
601
|
radiusToPx,
|
|
556
602
|
resolveMantineVariant,
|
|
557
603
|
resolveSharedStyle,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@selfhelp/shared",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.12",
|
|
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",
|
|
@@ -5,6 +5,8 @@ SPDX-License-Identifier: MPL-2.0
|
|
|
5
5
|
import { describe, expect, it } from 'vitest';
|
|
6
6
|
import {
|
|
7
7
|
FULL_RADIUS_PX,
|
|
8
|
+
gridSpanToReactNativeColumn,
|
|
9
|
+
mapDividerVariantToReactNative,
|
|
8
10
|
mapIntentToHeroUiButtonVariant,
|
|
9
11
|
mapIntentToHeroUiColor,
|
|
10
12
|
mapIntentToMantine,
|
|
@@ -18,6 +20,8 @@ import {
|
|
|
18
20
|
mapSizeToHeroUi,
|
|
19
21
|
mapSizeToMantine,
|
|
20
22
|
mapSpacingToPx,
|
|
23
|
+
parseDimensionToReactNative,
|
|
24
|
+
parseDimensionToWeb,
|
|
21
25
|
resolveSharedStyle,
|
|
22
26
|
resolveSharedStyleProps,
|
|
23
27
|
toHeroUiSemanticProps,
|
|
@@ -315,4 +319,77 @@ describe('semantic style mapper', () => {
|
|
|
315
319
|
expect(toReactNativeSemanticStyle({})).toEqual({});
|
|
316
320
|
});
|
|
317
321
|
});
|
|
322
|
+
|
|
323
|
+
describe('layout dimensions (shared_width/height)', () => {
|
|
324
|
+
it('strips the px suffix to a unitless number for React Native', () => {
|
|
325
|
+
expect(parseDimensionToReactNative('320px')).toBe(320);
|
|
326
|
+
expect(parseDimensionToReactNative('320')).toBe(320);
|
|
327
|
+
expect(parseDimensionToReactNative(320)).toBe(320);
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
it('keeps percentages and auto for React Native', () => {
|
|
331
|
+
expect(parseDimensionToReactNative('50%')).toBe('50%');
|
|
332
|
+
expect(parseDimensionToReactNative('auto')).toBe('auto');
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
it('returns undefined for empty/invalid dimensions (renderer keeps its default)', () => {
|
|
336
|
+
expect(parseDimensionToReactNative('')).toBeUndefined();
|
|
337
|
+
expect(parseDimensionToReactNative(' ')).toBeUndefined();
|
|
338
|
+
expect(parseDimensionToReactNative(undefined)).toBeUndefined();
|
|
339
|
+
expect(parseDimensionToReactNative(null)).toBeUndefined();
|
|
340
|
+
expect(parseDimensionToReactNative('10rem')).toBeUndefined();
|
|
341
|
+
});
|
|
342
|
+
|
|
343
|
+
it('passes a dimension through verbatim for web (Mantine)', () => {
|
|
344
|
+
expect(parseDimensionToWeb('320px')).toBe('320px');
|
|
345
|
+
expect(parseDimensionToWeb('100%')).toBe('100%');
|
|
346
|
+
expect(parseDimensionToWeb('auto')).toBe('auto');
|
|
347
|
+
expect(parseDimensionToWeb('')).toBeUndefined();
|
|
348
|
+
expect(parseDimensionToWeb(undefined)).toBeUndefined();
|
|
349
|
+
});
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
describe('grid span -> React Native column', () => {
|
|
353
|
+
it('converts a numeric span to a flex-basis percentage of cols', () => {
|
|
354
|
+
expect(gridSpanToReactNativeColumn(6, 12)).toEqual({
|
|
355
|
+
flexBasis: '50%',
|
|
356
|
+
flexGrow: 0,
|
|
357
|
+
flexShrink: 1,
|
|
358
|
+
});
|
|
359
|
+
expect(gridSpanToReactNativeColumn(1, 4)).toEqual({
|
|
360
|
+
flexBasis: '25%',
|
|
361
|
+
flexGrow: 0,
|
|
362
|
+
flexShrink: 1,
|
|
363
|
+
});
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
it('grows to share space for "auto" and sizes to content for "content"', () => {
|
|
367
|
+
expect(gridSpanToReactNativeColumn('auto')).toEqual({
|
|
368
|
+
flexBasis: 0,
|
|
369
|
+
flexGrow: 1,
|
|
370
|
+
flexShrink: 1,
|
|
371
|
+
});
|
|
372
|
+
expect(gridSpanToReactNativeColumn('content')).toEqual({
|
|
373
|
+
flexBasis: 'auto',
|
|
374
|
+
flexGrow: 0,
|
|
375
|
+
flexShrink: 0,
|
|
376
|
+
});
|
|
377
|
+
});
|
|
378
|
+
|
|
379
|
+
it('clamps an oversized span and falls back to a full row for invalid input', () => {
|
|
380
|
+
expect(gridSpanToReactNativeColumn(99, 12).flexBasis).toBe('100%');
|
|
381
|
+
expect(gridSpanToReactNativeColumn('nope', 12).flexBasis).toBe('100%');
|
|
382
|
+
expect(gridSpanToReactNativeColumn(0, 12).flexBasis).toBe('100%');
|
|
383
|
+
});
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
describe('divider variant -> React Native borderStyle', () => {
|
|
387
|
+
it('maps the identical vocabulary and defaults to solid', () => {
|
|
388
|
+
expect(mapDividerVariantToReactNative('solid')).toBe('solid');
|
|
389
|
+
expect(mapDividerVariantToReactNative('dashed')).toBe('dashed');
|
|
390
|
+
expect(mapDividerVariantToReactNative('dotted')).toBe('dotted');
|
|
391
|
+
expect(mapDividerVariantToReactNative(undefined)).toBe('solid');
|
|
392
|
+
expect(mapDividerVariantToReactNative('bogus')).toBe('solid');
|
|
393
|
+
});
|
|
394
|
+
});
|
|
318
395
|
});
|
package/src/theme/semantic.ts
CHANGED
|
@@ -475,6 +475,101 @@ export function mapChipVariantToHeroUiVariant(
|
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
477
|
|
|
478
|
+
// ===== layout dimensions (shared_width / shared_height / grid span / divider) =====
|
|
479
|
+
|
|
480
|
+
/** A React Native-safe dimension: a px number, a percentage string, or "auto". */
|
|
481
|
+
export type TReactNativeDimension = number | `${number}%` | 'auto';
|
|
482
|
+
|
|
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
|
|
486
|
+
* string verbatim ("320px", "100%", "auto"); React Native does NOT accept a
|
|
487
|
+
* unit suffix, so a px value must become a unitless number:
|
|
488
|
+
* "320px" | "320" | 320 -> 320 (number)
|
|
489
|
+
* "50%" -> "50%" (percentage string)
|
|
490
|
+
* "auto" -> "auto"
|
|
491
|
+
* ""/undefined/unknown -> undefined (renderer keeps its default)
|
|
492
|
+
*/
|
|
493
|
+
export function parseDimensionToReactNative(
|
|
494
|
+
value: string | number | undefined | null,
|
|
495
|
+
): TReactNativeDimension | undefined {
|
|
496
|
+
if (value === undefined || value === null) return undefined;
|
|
497
|
+
if (typeof value === 'number') return Number.isFinite(value) ? value : undefined;
|
|
498
|
+
const trimmed = value.trim();
|
|
499
|
+
if (trimmed === '') return undefined;
|
|
500
|
+
if (trimmed === 'auto') return 'auto';
|
|
501
|
+
const pct = /^(\d+(?:\.\d+)?)%$/.exec(trimmed);
|
|
502
|
+
if (pct) {
|
|
503
|
+
const n = Number(pct[1]);
|
|
504
|
+
return `${n}%`;
|
|
505
|
+
}
|
|
506
|
+
const px = /^(\d+(?:\.\d+)?)(?:px)?$/.exec(trimmed);
|
|
507
|
+
if (px) return Number(px[1]);
|
|
508
|
+
return undefined;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* Web pass-through for a CMS dimension: Mantine accepts "320px"/"100%"/"auto"
|
|
513
|
+
* verbatim. Returns undefined for empty so the renderer omits the prop.
|
|
514
|
+
*/
|
|
515
|
+
export function parseDimensionToWeb(
|
|
516
|
+
value: string | number | undefined | null,
|
|
517
|
+
): string | number | undefined {
|
|
518
|
+
if (value === undefined || value === null) return undefined;
|
|
519
|
+
if (typeof value === 'number') return value;
|
|
520
|
+
const trimmed = value.trim();
|
|
521
|
+
return trimmed === '' ? undefined : trimmed;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
/** React Native flex layout for one emulated grid column. */
|
|
525
|
+
export interface IReactNativeGridColumn {
|
|
526
|
+
flexBasis: TReactNativeDimension;
|
|
527
|
+
flexGrow: number;
|
|
528
|
+
flexShrink: number;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
/**
|
|
532
|
+
* Convert a Mantine `Grid.Col` span into a React Native flex layout for the
|
|
533
|
+
* emulated mobile grid. `cols` is the parent grid's column count (Mantine
|
|
534
|
+
* default 12).
|
|
535
|
+
* number -> a flex-basis percentage of (span / cols)
|
|
536
|
+
* "auto" -> grow to share remaining space (flexGrow 1, basis 0)
|
|
537
|
+
* "content" -> size to content (no grow/shrink, basis auto)
|
|
538
|
+
* invalid -> full row ("100%")
|
|
539
|
+
*/
|
|
540
|
+
export function gridSpanToReactNativeColumn(
|
|
541
|
+
span: string | number | undefined | null,
|
|
542
|
+
cols: number = 12,
|
|
543
|
+
): IReactNativeGridColumn {
|
|
544
|
+
const totalCols = cols > 0 ? cols : 12;
|
|
545
|
+
if (span === 'auto') return { flexBasis: 0, flexGrow: 1, flexShrink: 1 };
|
|
546
|
+
if (span === 'content') return { flexBasis: 'auto', flexGrow: 0, flexShrink: 0 };
|
|
547
|
+
const n = typeof span === 'number' ? span : Number.parseInt(String(span ?? ''), 10);
|
|
548
|
+
if (!Number.isFinite(n) || n <= 0) return { flexBasis: '100%', flexGrow: 0, flexShrink: 1 };
|
|
549
|
+
const clamped = Math.min(n, totalCols);
|
|
550
|
+
const pct = Math.round((clamped / totalCols) * 10000) / 100;
|
|
551
|
+
return { flexBasis: `${pct}%`, flexGrow: 0, flexShrink: 1 };
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* Map a `shared_divider_variant` (solid/dashed/dotted) onto a React Native
|
|
556
|
+
* `borderStyle`. The vocabularies are identical, so this validates the domain
|
|
557
|
+
* and falls back to 'solid'.
|
|
558
|
+
*/
|
|
559
|
+
export function mapDividerVariantToReactNative(
|
|
560
|
+
variant: string | undefined | null,
|
|
561
|
+
): 'solid' | 'dashed' | 'dotted' {
|
|
562
|
+
switch (variant) {
|
|
563
|
+
case 'dashed':
|
|
564
|
+
return 'dashed';
|
|
565
|
+
case 'dotted':
|
|
566
|
+
return 'dotted';
|
|
567
|
+
case 'solid':
|
|
568
|
+
default:
|
|
569
|
+
return 'solid';
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
|
|
478
573
|
// ===== state helpers =====
|
|
479
574
|
|
|
480
575
|
function hasState(states: readonly TSemanticState[] | undefined, state: TSemanticState): boolean {
|
|
@@ -114,6 +114,12 @@ export interface IMobileCheckboxProps extends IMobileAdapterBaseProps {
|
|
|
114
114
|
onSelectedChange?: (next: boolean) => void;
|
|
115
115
|
isDisabled?: boolean;
|
|
116
116
|
label?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Where the label sits relative to the box. Mirrors the cross-platform
|
|
119
|
+
* `shared_label_position` field (Mantine `labelPosition` on web). Defaults
|
|
120
|
+
* to `right`.
|
|
121
|
+
*/
|
|
122
|
+
labelPosition?: 'left' | 'right';
|
|
117
123
|
}
|
|
118
124
|
|
|
119
125
|
export interface IMobileSelectOption {
|
|
@@ -4,7 +4,6 @@ SPDX-License-Identifier: MPL-2.0
|
|
|
4
4
|
*/
|
|
5
5
|
import type { IBaseStyle, IContentField, IStyleWithSpacing } from './base';
|
|
6
6
|
import type {
|
|
7
|
-
TMantineSpacing,
|
|
8
7
|
TMantineColor,
|
|
9
8
|
TMantineOrientation,
|
|
10
9
|
TMantineDirection,
|
|
@@ -12,34 +11,43 @@ import type {
|
|
|
12
11
|
TMantineJustify,
|
|
13
12
|
TMantineAlign,
|
|
14
13
|
TMantineGridSpan,
|
|
14
|
+
TMantineGridGrow,
|
|
15
|
+
TMantineGridOverflow,
|
|
15
16
|
TSharedSize,
|
|
16
17
|
TSharedRadius,
|
|
17
18
|
} from '../mantine/common';
|
|
18
19
|
|
|
19
20
|
// Style-specific helper types only used in layout interfaces
|
|
20
21
|
export type TMantineBorder = '0' | '1';
|
|
21
|
-
// Cross-platform border toggle (card family): Mantine `withBorder` on
|
|
22
|
-
// a themed border
|
|
22
|
+
// Cross-platform border toggle (card family + paper): Mantine `withBorder` on
|
|
23
|
+
// web, a themed border on mobile.
|
|
23
24
|
export type TSharedBorder = '0' | '1';
|
|
25
|
+
// Cross-platform width/height/min/max dimension (e.g. "100%", "320px", "auto").
|
|
26
|
+
// Drives the web (Mantine) and the mobile (RN flexbox) renderer via the mapper.
|
|
27
|
+
export type TSharedDimension = string;
|
|
24
28
|
export type TMantineWidth = string;
|
|
25
29
|
export type TMantineHeight = string;
|
|
30
|
+
// Cross-platform divider line style (Mantine `variant` / RN `borderStyle`).
|
|
31
|
+
export type TSharedDividerVariant = 'solid' | 'dashed' | 'dotted';
|
|
32
|
+
export type TSharedDividerLabelPosition = 'left' | 'center' | 'right';
|
|
26
33
|
export type TMantineDividerVariant = 'solid' | 'dashed' | 'dotted';
|
|
27
34
|
export type TMantinePaperShadow = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
28
35
|
export type TMantineCardShadow = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
29
36
|
export type TMantineCardPadding = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
30
37
|
export type TMantineGap = '0' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
38
|
+
// Cross-platform grid column count (string-encoded integer).
|
|
39
|
+
export type TSharedCols = string;
|
|
31
40
|
export type TMantineCols = string;
|
|
32
41
|
export type TMantineGridOffset = string;
|
|
33
42
|
export type TMantineGridOrder = string;
|
|
34
43
|
export type TMantineScrollAreaSize = string;
|
|
35
|
-
export type TMantineScrollAreaType = 'hover' | 'always' | 'never' | 'scroll';
|
|
44
|
+
export type TMantineScrollAreaType = 'hover' | 'always' | 'auto' | 'never' | 'scroll';
|
|
36
45
|
|
|
37
46
|
export interface IContainerStyle extends IStyleWithSpacing {
|
|
38
47
|
style_name: 'container';
|
|
39
48
|
shared_size?: IContentField<TSharedSize>;
|
|
40
49
|
web_fluid?: IContentField<string>;
|
|
41
|
-
|
|
42
|
-
web_py?: IContentField<TMantineSpacing>;}
|
|
50
|
+
}
|
|
43
51
|
|
|
44
52
|
export interface IBoxStyle extends IStyleWithSpacing {
|
|
45
53
|
style_name: 'box';
|
|
@@ -52,8 +60,8 @@ export interface IFlexStyle extends IStyleWithSpacing {
|
|
|
52
60
|
shared_align?: IContentField<TMantineAlign>;
|
|
53
61
|
shared_direction?: IContentField<TMantineDirection>;
|
|
54
62
|
shared_wrap?: IContentField<TMantineWrap>;
|
|
55
|
-
|
|
56
|
-
|
|
63
|
+
shared_width?: IContentField<TSharedDimension>;
|
|
64
|
+
shared_height?: IContentField<TSharedDimension>;
|
|
57
65
|
}
|
|
58
66
|
|
|
59
67
|
export interface IGroupStyle extends IStyleWithSpacing {
|
|
@@ -61,10 +69,10 @@ export interface IGroupStyle extends IStyleWithSpacing {
|
|
|
61
69
|
shared_gap?: IContentField<TMantineGap>;
|
|
62
70
|
shared_justify?: IContentField<TMantineJustify>;
|
|
63
71
|
shared_align?: IContentField<TMantineAlign>;
|
|
72
|
+
shared_width?: IContentField<TSharedDimension>;
|
|
73
|
+
shared_height?: IContentField<TSharedDimension>;
|
|
64
74
|
web_group_wrap?: IContentField<'0' | '1'>;
|
|
65
75
|
web_group_grow?: IContentField<'0' | '1'>;
|
|
66
|
-
web_width?: IContentField<TMantineWidth>;
|
|
67
|
-
web_height?: IContentField<TMantineHeight>;
|
|
68
76
|
}
|
|
69
77
|
|
|
70
78
|
export interface IStackStyle extends IStyleWithSpacing {
|
|
@@ -72,71 +80,77 @@ export interface IStackStyle extends IStyleWithSpacing {
|
|
|
72
80
|
shared_gap?: IContentField<TMantineGap>;
|
|
73
81
|
shared_justify?: IContentField<TMantineJustify>;
|
|
74
82
|
shared_align?: IContentField<TMantineAlign>;
|
|
75
|
-
|
|
76
|
-
|
|
83
|
+
shared_width?: IContentField<TSharedDimension>;
|
|
84
|
+
shared_height?: IContentField<TSharedDimension>;
|
|
77
85
|
}
|
|
78
86
|
|
|
79
87
|
export interface ISimpleGridStyle extends IStyleWithSpacing {
|
|
80
88
|
style_name: 'simple-grid';
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
89
|
+
shared_cols?: IContentField<TSharedCols>;
|
|
90
|
+
shared_gap?: IContentField<TMantineGap>;
|
|
91
|
+
shared_vertical_spacing?: IContentField<TMantineGap>;
|
|
92
|
+
shared_width?: IContentField<TSharedDimension>;
|
|
93
|
+
shared_height?: IContentField<TSharedDimension>;
|
|
94
|
+
// Web-only responsive column overrides; clear to inherit shared_cols.
|
|
95
|
+
web_cols_sm?: IContentField<TSharedCols>;
|
|
96
|
+
web_cols_md?: IContentField<TSharedCols>;
|
|
97
|
+
web_cols_lg?: IContentField<TSharedCols>;
|
|
87
98
|
}
|
|
88
99
|
|
|
89
100
|
export interface IGridStyle extends IStyleWithSpacing {
|
|
90
101
|
style_name: 'grid';
|
|
91
|
-
|
|
102
|
+
shared_cols?: IContentField<TSharedCols>;
|
|
92
103
|
shared_gap?: IContentField<TMantineGap>;
|
|
93
104
|
shared_justify?: IContentField<TMantineJustify>;
|
|
94
105
|
shared_align?: IContentField<TMantineAlign>;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
106
|
+
shared_width?: IContentField<TSharedDimension>;
|
|
107
|
+
shared_height?: IContentField<TSharedDimension>;
|
|
108
|
+
web_grid_overflow?: IContentField<TMantineGridOverflow>;
|
|
109
|
+
}
|
|
98
110
|
|
|
99
111
|
export interface IGridColumnStyle extends IStyleWithSpacing {
|
|
100
112
|
style_name: 'grid-column';
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
113
|
+
shared_grid_span?: IContentField<TMantineGridSpan>;
|
|
114
|
+
shared_grid_offset?: IContentField<TMantineGridOffset>;
|
|
115
|
+
shared_grid_order?: IContentField<TMantineGridOrder>;
|
|
116
|
+
shared_grid_grow?: IContentField<TMantineGridGrow>;
|
|
117
|
+
shared_width?: IContentField<TSharedDimension>;
|
|
118
|
+
shared_height?: IContentField<TSharedDimension>;
|
|
119
|
+
}
|
|
107
120
|
|
|
108
121
|
export interface ISpaceStyle extends IStyleWithSpacing {
|
|
109
122
|
style_name: 'space';
|
|
110
123
|
shared_size?: IContentField<TSharedSize>;
|
|
111
|
-
|
|
124
|
+
shared_orientation?: IContentField<TMantineOrientation>;
|
|
112
125
|
}
|
|
113
126
|
|
|
114
|
-
export interface IDividerStyle extends
|
|
127
|
+
export interface IDividerStyle extends IStyleWithSpacing {
|
|
115
128
|
style_name: 'divider';
|
|
116
|
-
|
|
129
|
+
shared_divider_variant?: IContentField<TSharedDividerVariant>;
|
|
117
130
|
shared_size?: IContentField<TSharedSize>;
|
|
118
131
|
divider_label?: IContentField<string>;
|
|
119
|
-
|
|
132
|
+
shared_divider_label_position?: IContentField<TSharedDividerLabelPosition>;
|
|
120
133
|
shared_orientation?: IContentField<TMantineOrientation>;
|
|
121
134
|
shared_color?: IContentField<TMantineColor>;}
|
|
122
135
|
|
|
123
136
|
export interface IPaperStyle extends IStyleWithSpacing {
|
|
124
137
|
style_name: 'paper';
|
|
138
|
+
// Optional auto-styled heading rendered above the content when non-empty;
|
|
139
|
+
// never auto-creates a child section.
|
|
140
|
+
title?: IContentField<string>;
|
|
125
141
|
web_paper_shadow?: IContentField<TMantinePaperShadow>;
|
|
126
142
|
shared_radius?: IContentField<TSharedRadius>;
|
|
127
|
-
|
|
128
|
-
web_py?: IContentField<TMantineSpacing>;
|
|
129
|
-
web_border?: IContentField<TMantineBorder>;}
|
|
143
|
+
shared_border?: IContentField<TSharedBorder>;}
|
|
130
144
|
|
|
131
|
-
export interface ICenterStyle extends
|
|
145
|
+
export interface ICenterStyle extends IStyleWithSpacing {
|
|
132
146
|
style_name: 'center';
|
|
133
147
|
web_center_inline?: IContentField<string>;
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
148
|
+
shared_width?: IContentField<TSharedDimension>;
|
|
149
|
+
shared_height?: IContentField<TSharedDimension>;
|
|
150
|
+
shared_miw?: IContentField<TSharedDimension>;
|
|
151
|
+
shared_mih?: IContentField<TSharedDimension>;
|
|
152
|
+
shared_maw?: IContentField<TSharedDimension>;
|
|
153
|
+
shared_mah?: IContentField<TSharedDimension>;
|
|
140
154
|
}
|
|
141
155
|
|
|
142
156
|
export interface IScrollAreaStyle extends IStyleWithSpacing {
|
|
@@ -145,8 +159,7 @@ export interface IScrollAreaStyle extends IStyleWithSpacing {
|
|
|
145
159
|
web_scroll_area_type?: IContentField<TMantineScrollAreaType>;
|
|
146
160
|
web_scroll_area_offset_scrollbars?: IContentField<string>;
|
|
147
161
|
web_scroll_area_scroll_hide_delay?: IContentField<string>;
|
|
148
|
-
|
|
149
|
-
web_width?: IContentField<TMantineWidth>;
|
|
162
|
+
shared_height?: IContentField<TSharedDimension>;
|
|
150
163
|
}
|
|
151
164
|
|
|
152
165
|
export interface ICardStyle extends IStyleWithSpacing {
|
|
@@ -157,7 +170,9 @@ export interface ICardStyle extends IStyleWithSpacing {
|
|
|
157
170
|
img_src?: IContentField<string>;
|
|
158
171
|
// Cross-platform border (Mantine withBorder / themed border on mobile).
|
|
159
172
|
shared_border?: IContentField<TSharedBorder>;
|
|
160
|
-
|
|
173
|
+
// NOTE: no web-only card padding — padding is the portable `shared_spacing`
|
|
174
|
+
// (pt/pb/ps/pe), which renders on web AND mobile. The renderer keeps a fixed
|
|
175
|
+
// Mantine inner padding ("md") as the default + Card.Section bleed reference.
|
|
161
176
|
web_card_shadow?: IContentField<TMantineCardShadow>;
|
|
162
177
|
shared_radius?: IContentField<TSharedRadius>;}
|
|
163
178
|
|