@selfhelp/shared 1.14.6 → 1.14.8
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 +39 -0
- package/dist/index.d.mts +13 -3
- package/dist/index.d.ts +13 -3
- package/dist/index.js +13 -0
- package/dist/index.mjs +12 -0
- package/dist/plugin-sdk/index.d.mts +1 -1
- package/dist/plugin-sdk/index.d.ts +1 -1
- package/dist/registry/index.d.mts +2 -2
- package/dist/registry/index.d.ts +2 -2
- package/dist/{styles.registry-CxVYVra_.d.ts → styles.registry-CRtHSMQq.d.ts} +2 -1
- package/dist/{styles.registry-DcE83d4x.d.mts → styles.registry-zgJnv5zg.d.mts} +2 -1
- package/dist/theme/index.d.mts +8 -1
- package/dist/theme/index.d.ts +8 -1
- package/dist/theme/index.js +13 -0
- package/dist/theme/index.mjs +12 -0
- package/package.json +1 -1
- package/src/theme/__tests__/semantic.test.ts +9 -0
- package/src/theme/semantic.ts +20 -0
- package/src/types/__tests__/mobile-adapters.test.ts +9 -0
- package/src/types/mobile-adapters.ts +10 -0
- package/src/types/styles/composite.ts +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,45 @@ All notable changes to `@selfhelp/shared` will be documented in this file.
|
|
|
9
9
|
|
|
10
10
|
This project follows semantic versioning.
|
|
11
11
|
|
|
12
|
+
## v1.14.8
|
|
13
|
+
|
|
14
|
+
Accordion polish wave (accordion / accordion-item) — align the typed contracts
|
|
15
|
+
with the backend `Version20260619183601` migration and the coupled web + mobile
|
|
16
|
+
renderer reads. Patch bump: a renamed optional style field, one additive optional
|
|
17
|
+
content field, and a new additive mobile mapper helper.
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- **`IAccordionStyle`:** the variant is now the cross-platform
|
|
22
|
+
`shared_accordion_variant` (`TMantineAccordionVariant`); the web-only
|
|
23
|
+
`web_accordion_variant` was renamed (the backend migrated the field by id, so
|
|
24
|
+
authored values + options are preserved). Web maps it to the Mantine variant;
|
|
25
|
+
mobile maps it through `mapAccordionVariantToHeroUiVariant`.
|
|
26
|
+
|
|
27
|
+
### Added
|
|
28
|
+
|
|
29
|
+
- **`IAccordionItemStyle.description`:** optional translatable subtitle
|
|
30
|
+
(`IContentField<string>`) rendered under the item label on both platforms;
|
|
31
|
+
empty = hidden.
|
|
32
|
+
- **`mapAccordionVariantToHeroUiVariant(variant)`:** maps the accordion variant
|
|
33
|
+
token (`default`/`contained`/`filled`/`separated`) onto the HeroUI Native
|
|
34
|
+
Accordion `variant` (`default` | `surface`) — boxed Mantine variants collapse
|
|
35
|
+
to `surface`.
|
|
36
|
+
|
|
37
|
+
## v1.14.7
|
|
38
|
+
|
|
39
|
+
Mobile button authored-colour parity. Patch bump: one additive optional prop on
|
|
40
|
+
the mobile button adapter contract.
|
|
41
|
+
|
|
42
|
+
### Added
|
|
43
|
+
|
|
44
|
+
- **`IMobileButtonProps.accentColor`:** optional resolved hex that overrides the
|
|
45
|
+
HeroUI variant fill so a CMS style can colour the mobile button for
|
|
46
|
+
cross-platform parity with the web Mantine `color` prop (e.g. `login`'s
|
|
47
|
+
`shared_color`). The adapter keeps the variant's readable foreground (white
|
|
48
|
+
label on a filled button); leave undefined to use the variant's themed colour.
|
|
49
|
+
Resolve it through `resolveMantineVariant(...).accent`, never a hard-coded hex.
|
|
50
|
+
|
|
12
51
|
## v1.14.6
|
|
13
52
|
|
|
14
53
|
Style polish wave (alert/badge/avatar/button/login) — align the typed contracts
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { T as TStyleName, j as IContentField } from './styles.registry-
|
|
2
|
-
export { B as BASE_STYLE_REGISTRY, k as IAccordionItemStyle, l as IAccordionStyle, m as IActionIconStyle, n as IAlertStyle, o as IAspectRatioStyle, p as IAudioStyle, q as IAvatarStyle, r as IBackgroundImageStyle, s as IBadgeStyle, t as IBaseStyle, u as IBlockquoteStyle, v as IBoxStyle, w as IButtonStyle, x as ICardSegmentStyle, y as ICardStyle, z as ICarouselStyle, A as ICenterStyle, C as ICheckboxStyle, D as IChipStyle, E as ICodeStyle, F as IColorInputStyle, G as IColorPickerStyle, H as IComboboxStyle, J as IContainerStyle, K as IDataContainerStyle, L as IDatePickerStyle, M as IDividerStyle, N as IEntryListStyle, O as IEntryRecordDeleteStyle, P as IEntryRecordStyle, Q as IFieldsetStyle, R as IFigureStyle, U as IFileInputStyle, V as IFlexStyle, W as IFormLogStyle, X as IFormRecordStyle, Y as IFormStyle, Z as IGridColumnStyle, $ as IGridStyle, a0 as IGroupStyle, a1 as IHighlightStyle, a2 as IHtmlTagStyle, a3 as IImageStyle, a4 as IIndicatorStyle, a5 as IInputStyle, a6 as IKbdStyle, a7 as ILinkStyle, a8 as IListItemStyle, a9 as IListStyle, aa as ILoginStyle, ab as ILoopStyle, ac as IMissingStyle, ad as INoAccessStyle, ae as INotFoundStyle, af as INotificationStyle, ag as INumberInputStyle, ah as IPaperStyle, a as IPluginStyleRegistryEntry, ai as IProfileStyle, aj as IProgressRootStyle, ak as IProgressSectionStyle, al as IProgressStyle, am as IRadioStyle, an as IRangeSliderStyle, ao as IRatingStyle, ap as IRefContainerStyle, aq as IRegisterStyle, ar as IResetPasswordStyle, as as IRichTextEditorStyle, at as IScrollAreaStyle, au as ISegmentedControlStyle, av as ISelectStyle, aw as IShowUserInputEntry, ax as IShowUserInputStyle, ay as ISimpleGridStyle, az as ISliderStyle, aA as ISpaceStyle, aB as ISpoilerStyle, aC as IStackStyle, I as IStyleRegistryEntry, aD as IStyleWithSpacing, aE as ISwitchStyle, aF as ITabStyle, aG as ITabsStyle, aH as ITextInputStyle, aI as ITextStyle, aJ as ITextareaStyle, aK as IThemeIconStyle, aL as ITimelineItemStyle, aM as ITimelineStyle, aN as ITitleStyle, aO as ITwoFactorAuthStyle, aP as ITypographyStyle, aQ as IUnknownStyle, aR as IValidateStyle, aS as IVersionStyle, aT as IVideoStyle, S as STYLE_REGISTRY, c as TConcretePlatform, aU as TMantineAccordionChevronPosition, aV as TMantineAccordionDisableChevronRotation, aW as TMantineAccordionLoop, aX as TMantineAccordionMultiple, aY as TMantineBorder, aZ as TMantineCardShadow, a_ as TMantineCheckboxLabelPosition, a$ as TMantineCols, b0 as TMantineDividerVariant, b1 as TMantineGap, b2 as TMantineGridOffset, b3 as TMantineGridOrder, b4 as TMantineHeight, b5 as TMantineIconSize, b6 as TMantineImageFit, b7 as TMantineLineClamp, b8 as TMantineListCenter, b9 as TMantineListStyleType, ba as TMantineListType, bb as TMantineListWithPadding, bc as TMantinePaperShadow, bd as TMantineProgressTransition, be as TMantineScrollAreaSize, bf as TMantineScrollAreaType, bg as TMantineTextAlign, bh as TMantineTextDecoration, bi as TMantineTextFontStyle, bj as TMantineTextFontWeight, bk as TMantineTextInherit, bl as TMantineTextInputVariant, bm as TMantineTextSpan, bn as TMantineTextTransform, bo as TMantineTextTruncate, bp as TMantineTextVariant, bq as TMantineTextareaAutosize, br as TMantineTextareaResize, bs as TMantineTextareaVariant, bt as TMantineTimelineAlign, bu as TMantineTitleLineClamp, bv as TMantineTitleTextWrap, bw as TMantineTranslatable, bx as TMantineUseInputWrapper, by as TMantineWidth, bz as TStyle, b as TStylePlacement, d as TStylePlatform, e as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, f as _resetPluginStyleRegistry, g as extendStyleRegistry, h as getMergedStyleRegistry, i as getPluginStyleRegistry } from './styles.registry-
|
|
1
|
+
import { T as TStyleName, j as IContentField } from './styles.registry-zgJnv5zg.mjs';
|
|
2
|
+
export { B as BASE_STYLE_REGISTRY, k as IAccordionItemStyle, l as IAccordionStyle, m as IActionIconStyle, n as IAlertStyle, o as IAspectRatioStyle, p as IAudioStyle, q as IAvatarStyle, r as IBackgroundImageStyle, s as IBadgeStyle, t as IBaseStyle, u as IBlockquoteStyle, v as IBoxStyle, w as IButtonStyle, x as ICardSegmentStyle, y as ICardStyle, z as ICarouselStyle, A as ICenterStyle, C as ICheckboxStyle, D as IChipStyle, E as ICodeStyle, F as IColorInputStyle, G as IColorPickerStyle, H as IComboboxStyle, J as IContainerStyle, K as IDataContainerStyle, L as IDatePickerStyle, M as IDividerStyle, N as IEntryListStyle, O as IEntryRecordDeleteStyle, P as IEntryRecordStyle, Q as IFieldsetStyle, R as IFigureStyle, U as IFileInputStyle, V as IFlexStyle, W as IFormLogStyle, X as IFormRecordStyle, Y as IFormStyle, Z as IGridColumnStyle, $ as IGridStyle, a0 as IGroupStyle, a1 as IHighlightStyle, a2 as IHtmlTagStyle, a3 as IImageStyle, a4 as IIndicatorStyle, a5 as IInputStyle, a6 as IKbdStyle, a7 as ILinkStyle, a8 as IListItemStyle, a9 as IListStyle, aa as ILoginStyle, ab as ILoopStyle, ac as IMissingStyle, ad as INoAccessStyle, ae as INotFoundStyle, af as INotificationStyle, ag as INumberInputStyle, ah as IPaperStyle, a as IPluginStyleRegistryEntry, ai as IProfileStyle, aj as IProgressRootStyle, ak as IProgressSectionStyle, al as IProgressStyle, am as IRadioStyle, an as IRangeSliderStyle, ao as IRatingStyle, ap as IRefContainerStyle, aq as IRegisterStyle, ar as IResetPasswordStyle, as as IRichTextEditorStyle, at as IScrollAreaStyle, au as ISegmentedControlStyle, av as ISelectStyle, aw as IShowUserInputEntry, ax as IShowUserInputStyle, ay as ISimpleGridStyle, az as ISliderStyle, aA as ISpaceStyle, aB as ISpoilerStyle, aC as IStackStyle, I as IStyleRegistryEntry, aD as IStyleWithSpacing, aE as ISwitchStyle, aF as ITabStyle, aG as ITabsStyle, aH as ITextInputStyle, aI as ITextStyle, aJ as ITextareaStyle, aK as IThemeIconStyle, aL as ITimelineItemStyle, aM as ITimelineStyle, aN as ITitleStyle, aO as ITwoFactorAuthStyle, aP as ITypographyStyle, aQ as IUnknownStyle, aR as IValidateStyle, aS as IVersionStyle, aT as IVideoStyle, S as STYLE_REGISTRY, c as TConcretePlatform, aU as TMantineAccordionChevronPosition, aV as TMantineAccordionDisableChevronRotation, aW as TMantineAccordionLoop, aX as TMantineAccordionMultiple, aY as TMantineBorder, aZ as TMantineCardShadow, a_ as TMantineCheckboxLabelPosition, a$ as TMantineCols, b0 as TMantineDividerVariant, b1 as TMantineGap, b2 as TMantineGridOffset, b3 as TMantineGridOrder, b4 as TMantineHeight, b5 as TMantineIconSize, b6 as TMantineImageFit, b7 as TMantineLineClamp, b8 as TMantineListCenter, b9 as TMantineListStyleType, ba as TMantineListType, bb as TMantineListWithPadding, bc as TMantinePaperShadow, bd as TMantineProgressTransition, be as TMantineScrollAreaSize, bf as TMantineScrollAreaType, bg as TMantineTextAlign, bh as TMantineTextDecoration, bi as TMantineTextFontStyle, bj as TMantineTextFontWeight, bk as TMantineTextInherit, bl as TMantineTextInputVariant, bm as TMantineTextSpan, bn as TMantineTextTransform, bo as TMantineTextTruncate, bp as TMantineTextVariant, bq as TMantineTextareaAutosize, br as TMantineTextareaResize, bs as TMantineTextareaVariant, bt as TMantineTimelineAlign, bu as TMantineTitleLineClamp, bv as TMantineTitleTextWrap, bw as TMantineTranslatable, bx as TMantineUseInputWrapper, by as TMantineWidth, bz as TStyle, b as TStylePlacement, d as TStylePlatform, e as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, f as _resetPluginStyleRegistry, g as extendStyleRegistry, h as getMergedStyleRegistry, i as getPluginStyleRegistry } from './styles.registry-zgJnv5zg.mjs';
|
|
3
3
|
export { u as TMantineAccordionVariant, x as TMantineActionIconLoading, e as TMantineAlign, y as TMantineAllowNextClicks, z as TMantineAllowStepClick, A as TMantineAspectRatio, B as TMantineAutoContrast, q as TMantineAvatarVariant, p as TMantineBadgeVariant, C as TMantineBlock, D as TMantineCenterInline, E as TMantineChecked, F as TMantineChipChecked, G as TMantineChipMultiple, r as TMantineChipVariant, H as TMantineClampBehavior, I as TMantineCodeBlock, T as TMantineColor, J as TMantineColorFormat, K as TMantineColorInputSwatches, L as TMantineColorPickerSwatches, M as TMantineColorPickerSwatchesPerRow, N as TMantineCompact, O as TMantineContainerFluid, f as TMantineDirection, P as TMantineDisabled, m as TMantineFieldsetVariant, Q as TMantineFileAccept, R as TMantineFileInputMultiple, S as TMantineFluid, U as TMantineFullWidth, V as TMantineGridGrow, W as TMantineGridOverflow, h as TMantineGridSpan, X as TMantineGroupGrow, Y as TMantineGroupWrap, Z as TMantineGrow, _ as TMantineHighlight, s as TMantineIndicatorPosition, $ as TMantineInline, a0 as TMantineIsLink, d as TMantineJustify, a1 as TMantineKbdSize, a2 as TMantineLoading, a3 as TMantineMultiple, a4 as TMantineNotificationWithCloseButton, a5 as TMantineNumberInputDecimalScale, a6 as TMantineOpenInNewTab, i as TMantineOrientation, a7 as TMantineProcessing, a as TMantineRadius, a8 as TMantineRangeSliderMarks, a9 as TMantineRatingCount, aa as TMantineRatingFractions, ab as TMantineRatingReadonly, ac as TMantineReadonly, l as TMantineSize, ad as TMantineSpaceHorizontal, c as TMantineSpacing, n as TMantineSpoilerMaxHeight, ae as TMantineSwatches, af as TMantineTabDisabled, v as TMantineTabsVariant, t as TMantineThemeIconVariant, w as TMantineTimelineLineVariant, k as TMantineTitleOrder, ag as TMantineUseMantineStyle, o as TMantineVariant, ah as TMantineWithCloseButton, ai as TMantineWithIcon, g as TMantineWrap, j as TSharedRadius, b as TSharedSize } from './common-DVC0R_AX.mjs';
|
|
4
4
|
import { ReactNode, ComponentType } from 'react';
|
|
5
5
|
import { THeroUiButtonVariant, THeroUiSize } from './theme/index.mjs';
|
|
6
|
-
export { COLOR_PALETTE, COLOR_SCALES, CONTAINER_SIZE_PX, FONT_SIZE_PX, FULL_RADIUS_PX, IHeroUiResolvedStyle, IMantineResolvedStyle, IReactNativeResolvedStyle, IReactNativeThemeScales, IResolvedVariant, ISharedStyleProps, ISpacingResolved, LINE_HEIGHT, RADIUS_PX, SPACING_PX, SPACING_TO_TAILWIND, TCanonicalColor, TCanonicalRadius, TCanonicalSpacing, THeroUiColor, TMantineMappedColor, TMantineMappedVariant, TSemanticColor, TSemanticIntent, TSemanticRadius, TSemanticSize, TSemanticSpacing, TSemanticState, TSemanticVariant, colorToHex, mapIntentToHeroUiButtonVariant, mapIntentToHeroUiColor, mapIntentToMantine, mapMantineColorToHeroUiButtonVariant, mapMantineColorToHeroUiColor, mapMantineVariantToHeroUiButtonVariant, mapRadiusToMantine, mapRadiusToPx, mapSizeToHeroUi, mapSizeToMantine, mapSpacingToPx, radiusToPx, resolveMantineVariant, resolveSharedStyle, resolveSharedStyleForMobile, resolveSharedStyleForWeb, resolveSharedStyleProps, sizeToFontPx, spacingToPx, toHeroUiSemanticProps, toMantineSemanticProps, toReactNativeSemanticStyle } from './theme/index.mjs';
|
|
6
|
+
export { COLOR_PALETTE, COLOR_SCALES, CONTAINER_SIZE_PX, FONT_SIZE_PX, FULL_RADIUS_PX, IHeroUiResolvedStyle, IMantineResolvedStyle, IReactNativeResolvedStyle, IReactNativeThemeScales, IResolvedVariant, ISharedStyleProps, ISpacingResolved, LINE_HEIGHT, RADIUS_PX, SPACING_PX, SPACING_TO_TAILWIND, TCanonicalColor, TCanonicalRadius, TCanonicalSpacing, THeroUiColor, TMantineMappedColor, TMantineMappedVariant, TSemanticColor, TSemanticIntent, TSemanticRadius, TSemanticSize, TSemanticSpacing, TSemanticState, TSemanticVariant, colorToHex, mapAccordionVariantToHeroUiVariant, mapIntentToHeroUiButtonVariant, mapIntentToHeroUiColor, mapIntentToMantine, mapMantineColorToHeroUiButtonVariant, mapMantineColorToHeroUiColor, mapMantineVariantToHeroUiButtonVariant, mapRadiusToMantine, mapRadiusToPx, mapSizeToHeroUi, mapSizeToMantine, mapSpacingToPx, radiusToPx, resolveMantineVariant, resolveSharedStyle, resolveSharedStyleForMobile, resolveSharedStyleForWeb, resolveSharedStyleProps, sizeToFontPx, spacingToPx, toHeroUiSemanticProps, toMantineSemanticProps, toReactNativeSemanticStyle } from './theme/index.mjs';
|
|
7
7
|
export { TAnyStyleName, TPluginStyleImplMap, TStyleImplMap, getRegistryEntry, getRegistryEntryAny, getStylePlacement, getStylePlatforms, getStylePluginId, isKnownStyleName, isRegisteredStyleName, isStyleAllowedOnPage, isStylePlacementAllowed, isStyleSupportedOnPlatform, setToStylePlatform, stylePlatformToSet } from './registry/index.mjs';
|
|
8
8
|
export { sharedTailwindExtend, sharedTailwindPreset } from './theme/tailwind.mjs';
|
|
9
9
|
|
|
@@ -1192,6 +1192,16 @@ interface IMobileButtonProps extends IMobileAdapterBaseProps {
|
|
|
1192
1192
|
isLoading?: boolean;
|
|
1193
1193
|
isIconOnly?: boolean;
|
|
1194
1194
|
fullWidth?: boolean;
|
|
1195
|
+
/**
|
|
1196
|
+
* Optional concrete background colour (resolved hex) that overrides the
|
|
1197
|
+
* variant's themed fill, used for cross-platform parity when a CMS style
|
|
1198
|
+
* exposes an authored colour (e.g. `login`'s `shared_color`, which Mantine
|
|
1199
|
+
* applies to the web button via `color`). The adapter keeps the variant's
|
|
1200
|
+
* readable foreground (white on a filled button). Leave undefined to use the
|
|
1201
|
+
* variant's default themed colour. Resolve it through the shared mapper
|
|
1202
|
+
* (`resolveMantineVariant(...).accent`), never a hard-coded hex in a renderer.
|
|
1203
|
+
*/
|
|
1204
|
+
accentColor?: string;
|
|
1195
1205
|
children?: ReactNode;
|
|
1196
1206
|
}
|
|
1197
1207
|
interface IMobileTextProps extends IMobileAdapterBaseProps {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { T as TStyleName, j as IContentField } from './styles.registry-
|
|
2
|
-
export { B as BASE_STYLE_REGISTRY, k as IAccordionItemStyle, l as IAccordionStyle, m as IActionIconStyle, n as IAlertStyle, o as IAspectRatioStyle, p as IAudioStyle, q as IAvatarStyle, r as IBackgroundImageStyle, s as IBadgeStyle, t as IBaseStyle, u as IBlockquoteStyle, v as IBoxStyle, w as IButtonStyle, x as ICardSegmentStyle, y as ICardStyle, z as ICarouselStyle, A as ICenterStyle, C as ICheckboxStyle, D as IChipStyle, E as ICodeStyle, F as IColorInputStyle, G as IColorPickerStyle, H as IComboboxStyle, J as IContainerStyle, K as IDataContainerStyle, L as IDatePickerStyle, M as IDividerStyle, N as IEntryListStyle, O as IEntryRecordDeleteStyle, P as IEntryRecordStyle, Q as IFieldsetStyle, R as IFigureStyle, U as IFileInputStyle, V as IFlexStyle, W as IFormLogStyle, X as IFormRecordStyle, Y as IFormStyle, Z as IGridColumnStyle, $ as IGridStyle, a0 as IGroupStyle, a1 as IHighlightStyle, a2 as IHtmlTagStyle, a3 as IImageStyle, a4 as IIndicatorStyle, a5 as IInputStyle, a6 as IKbdStyle, a7 as ILinkStyle, a8 as IListItemStyle, a9 as IListStyle, aa as ILoginStyle, ab as ILoopStyle, ac as IMissingStyle, ad as INoAccessStyle, ae as INotFoundStyle, af as INotificationStyle, ag as INumberInputStyle, ah as IPaperStyle, a as IPluginStyleRegistryEntry, ai as IProfileStyle, aj as IProgressRootStyle, ak as IProgressSectionStyle, al as IProgressStyle, am as IRadioStyle, an as IRangeSliderStyle, ao as IRatingStyle, ap as IRefContainerStyle, aq as IRegisterStyle, ar as IResetPasswordStyle, as as IRichTextEditorStyle, at as IScrollAreaStyle, au as ISegmentedControlStyle, av as ISelectStyle, aw as IShowUserInputEntry, ax as IShowUserInputStyle, ay as ISimpleGridStyle, az as ISliderStyle, aA as ISpaceStyle, aB as ISpoilerStyle, aC as IStackStyle, I as IStyleRegistryEntry, aD as IStyleWithSpacing, aE as ISwitchStyle, aF as ITabStyle, aG as ITabsStyle, aH as ITextInputStyle, aI as ITextStyle, aJ as ITextareaStyle, aK as IThemeIconStyle, aL as ITimelineItemStyle, aM as ITimelineStyle, aN as ITitleStyle, aO as ITwoFactorAuthStyle, aP as ITypographyStyle, aQ as IUnknownStyle, aR as IValidateStyle, aS as IVersionStyle, aT as IVideoStyle, S as STYLE_REGISTRY, c as TConcretePlatform, aU as TMantineAccordionChevronPosition, aV as TMantineAccordionDisableChevronRotation, aW as TMantineAccordionLoop, aX as TMantineAccordionMultiple, aY as TMantineBorder, aZ as TMantineCardShadow, a_ as TMantineCheckboxLabelPosition, a$ as TMantineCols, b0 as TMantineDividerVariant, b1 as TMantineGap, b2 as TMantineGridOffset, b3 as TMantineGridOrder, b4 as TMantineHeight, b5 as TMantineIconSize, b6 as TMantineImageFit, b7 as TMantineLineClamp, b8 as TMantineListCenter, b9 as TMantineListStyleType, ba as TMantineListType, bb as TMantineListWithPadding, bc as TMantinePaperShadow, bd as TMantineProgressTransition, be as TMantineScrollAreaSize, bf as TMantineScrollAreaType, bg as TMantineTextAlign, bh as TMantineTextDecoration, bi as TMantineTextFontStyle, bj as TMantineTextFontWeight, bk as TMantineTextInherit, bl as TMantineTextInputVariant, bm as TMantineTextSpan, bn as TMantineTextTransform, bo as TMantineTextTruncate, bp as TMantineTextVariant, bq as TMantineTextareaAutosize, br as TMantineTextareaResize, bs as TMantineTextareaVariant, bt as TMantineTimelineAlign, bu as TMantineTitleLineClamp, bv as TMantineTitleTextWrap, bw as TMantineTranslatable, bx as TMantineUseInputWrapper, by as TMantineWidth, bz as TStyle, b as TStylePlacement, d as TStylePlatform, e as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, f as _resetPluginStyleRegistry, g as extendStyleRegistry, h as getMergedStyleRegistry, i as getPluginStyleRegistry } from './styles.registry-
|
|
1
|
+
import { T as TStyleName, j as IContentField } from './styles.registry-CRtHSMQq.js';
|
|
2
|
+
export { B as BASE_STYLE_REGISTRY, k as IAccordionItemStyle, l as IAccordionStyle, m as IActionIconStyle, n as IAlertStyle, o as IAspectRatioStyle, p as IAudioStyle, q as IAvatarStyle, r as IBackgroundImageStyle, s as IBadgeStyle, t as IBaseStyle, u as IBlockquoteStyle, v as IBoxStyle, w as IButtonStyle, x as ICardSegmentStyle, y as ICardStyle, z as ICarouselStyle, A as ICenterStyle, C as ICheckboxStyle, D as IChipStyle, E as ICodeStyle, F as IColorInputStyle, G as IColorPickerStyle, H as IComboboxStyle, J as IContainerStyle, K as IDataContainerStyle, L as IDatePickerStyle, M as IDividerStyle, N as IEntryListStyle, O as IEntryRecordDeleteStyle, P as IEntryRecordStyle, Q as IFieldsetStyle, R as IFigureStyle, U as IFileInputStyle, V as IFlexStyle, W as IFormLogStyle, X as IFormRecordStyle, Y as IFormStyle, Z as IGridColumnStyle, $ as IGridStyle, a0 as IGroupStyle, a1 as IHighlightStyle, a2 as IHtmlTagStyle, a3 as IImageStyle, a4 as IIndicatorStyle, a5 as IInputStyle, a6 as IKbdStyle, a7 as ILinkStyle, a8 as IListItemStyle, a9 as IListStyle, aa as ILoginStyle, ab as ILoopStyle, ac as IMissingStyle, ad as INoAccessStyle, ae as INotFoundStyle, af as INotificationStyle, ag as INumberInputStyle, ah as IPaperStyle, a as IPluginStyleRegistryEntry, ai as IProfileStyle, aj as IProgressRootStyle, ak as IProgressSectionStyle, al as IProgressStyle, am as IRadioStyle, an as IRangeSliderStyle, ao as IRatingStyle, ap as IRefContainerStyle, aq as IRegisterStyle, ar as IResetPasswordStyle, as as IRichTextEditorStyle, at as IScrollAreaStyle, au as ISegmentedControlStyle, av as ISelectStyle, aw as IShowUserInputEntry, ax as IShowUserInputStyle, ay as ISimpleGridStyle, az as ISliderStyle, aA as ISpaceStyle, aB as ISpoilerStyle, aC as IStackStyle, I as IStyleRegistryEntry, aD as IStyleWithSpacing, aE as ISwitchStyle, aF as ITabStyle, aG as ITabsStyle, aH as ITextInputStyle, aI as ITextStyle, aJ as ITextareaStyle, aK as IThemeIconStyle, aL as ITimelineItemStyle, aM as ITimelineStyle, aN as ITitleStyle, aO as ITwoFactorAuthStyle, aP as ITypographyStyle, aQ as IUnknownStyle, aR as IValidateStyle, aS as IVersionStyle, aT as IVideoStyle, S as STYLE_REGISTRY, c as TConcretePlatform, aU as TMantineAccordionChevronPosition, aV as TMantineAccordionDisableChevronRotation, aW as TMantineAccordionLoop, aX as TMantineAccordionMultiple, aY as TMantineBorder, aZ as TMantineCardShadow, a_ as TMantineCheckboxLabelPosition, a$ as TMantineCols, b0 as TMantineDividerVariant, b1 as TMantineGap, b2 as TMantineGridOffset, b3 as TMantineGridOrder, b4 as TMantineHeight, b5 as TMantineIconSize, b6 as TMantineImageFit, b7 as TMantineLineClamp, b8 as TMantineListCenter, b9 as TMantineListStyleType, ba as TMantineListType, bb as TMantineListWithPadding, bc as TMantinePaperShadow, bd as TMantineProgressTransition, be as TMantineScrollAreaSize, bf as TMantineScrollAreaType, bg as TMantineTextAlign, bh as TMantineTextDecoration, bi as TMantineTextFontStyle, bj as TMantineTextFontWeight, bk as TMantineTextInherit, bl as TMantineTextInputVariant, bm as TMantineTextSpan, bn as TMantineTextTransform, bo as TMantineTextTruncate, bp as TMantineTextVariant, bq as TMantineTextareaAutosize, br as TMantineTextareaResize, bs as TMantineTextareaVariant, bt as TMantineTimelineAlign, bu as TMantineTitleLineClamp, bv as TMantineTitleTextWrap, bw as TMantineTranslatable, bx as TMantineUseInputWrapper, by as TMantineWidth, bz as TStyle, b as TStylePlacement, d as TStylePlatform, e as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, f as _resetPluginStyleRegistry, g as extendStyleRegistry, h as getMergedStyleRegistry, i as getPluginStyleRegistry } from './styles.registry-CRtHSMQq.js';
|
|
3
3
|
export { u as TMantineAccordionVariant, x as TMantineActionIconLoading, e as TMantineAlign, y as TMantineAllowNextClicks, z as TMantineAllowStepClick, A as TMantineAspectRatio, B as TMantineAutoContrast, q as TMantineAvatarVariant, p as TMantineBadgeVariant, C as TMantineBlock, D as TMantineCenterInline, E as TMantineChecked, F as TMantineChipChecked, G as TMantineChipMultiple, r as TMantineChipVariant, H as TMantineClampBehavior, I as TMantineCodeBlock, T as TMantineColor, J as TMantineColorFormat, K as TMantineColorInputSwatches, L as TMantineColorPickerSwatches, M as TMantineColorPickerSwatchesPerRow, N as TMantineCompact, O as TMantineContainerFluid, f as TMantineDirection, P as TMantineDisabled, m as TMantineFieldsetVariant, Q as TMantineFileAccept, R as TMantineFileInputMultiple, S as TMantineFluid, U as TMantineFullWidth, V as TMantineGridGrow, W as TMantineGridOverflow, h as TMantineGridSpan, X as TMantineGroupGrow, Y as TMantineGroupWrap, Z as TMantineGrow, _ as TMantineHighlight, s as TMantineIndicatorPosition, $ as TMantineInline, a0 as TMantineIsLink, d as TMantineJustify, a1 as TMantineKbdSize, a2 as TMantineLoading, a3 as TMantineMultiple, a4 as TMantineNotificationWithCloseButton, a5 as TMantineNumberInputDecimalScale, a6 as TMantineOpenInNewTab, i as TMantineOrientation, a7 as TMantineProcessing, a as TMantineRadius, a8 as TMantineRangeSliderMarks, a9 as TMantineRatingCount, aa as TMantineRatingFractions, ab as TMantineRatingReadonly, ac as TMantineReadonly, l as TMantineSize, ad as TMantineSpaceHorizontal, c as TMantineSpacing, n as TMantineSpoilerMaxHeight, ae as TMantineSwatches, af as TMantineTabDisabled, v as TMantineTabsVariant, t as TMantineThemeIconVariant, w as TMantineTimelineLineVariant, k as TMantineTitleOrder, ag as TMantineUseMantineStyle, o as TMantineVariant, ah as TMantineWithCloseButton, ai as TMantineWithIcon, g as TMantineWrap, j as TSharedRadius, b as TSharedSize } from './common-DVC0R_AX.js';
|
|
4
4
|
import { ReactNode, ComponentType } from 'react';
|
|
5
5
|
import { THeroUiButtonVariant, THeroUiSize } from './theme/index.js';
|
|
6
|
-
export { COLOR_PALETTE, COLOR_SCALES, CONTAINER_SIZE_PX, FONT_SIZE_PX, FULL_RADIUS_PX, IHeroUiResolvedStyle, IMantineResolvedStyle, IReactNativeResolvedStyle, IReactNativeThemeScales, IResolvedVariant, ISharedStyleProps, ISpacingResolved, LINE_HEIGHT, RADIUS_PX, SPACING_PX, SPACING_TO_TAILWIND, TCanonicalColor, TCanonicalRadius, TCanonicalSpacing, THeroUiColor, TMantineMappedColor, TMantineMappedVariant, TSemanticColor, TSemanticIntent, TSemanticRadius, TSemanticSize, TSemanticSpacing, TSemanticState, TSemanticVariant, colorToHex, mapIntentToHeroUiButtonVariant, mapIntentToHeroUiColor, mapIntentToMantine, mapMantineColorToHeroUiButtonVariant, mapMantineColorToHeroUiColor, mapMantineVariantToHeroUiButtonVariant, mapRadiusToMantine, mapRadiusToPx, mapSizeToHeroUi, mapSizeToMantine, mapSpacingToPx, radiusToPx, resolveMantineVariant, resolveSharedStyle, resolveSharedStyleForMobile, resolveSharedStyleForWeb, resolveSharedStyleProps, sizeToFontPx, spacingToPx, toHeroUiSemanticProps, toMantineSemanticProps, toReactNativeSemanticStyle } from './theme/index.js';
|
|
6
|
+
export { COLOR_PALETTE, COLOR_SCALES, CONTAINER_SIZE_PX, FONT_SIZE_PX, FULL_RADIUS_PX, IHeroUiResolvedStyle, IMantineResolvedStyle, IReactNativeResolvedStyle, IReactNativeThemeScales, IResolvedVariant, ISharedStyleProps, ISpacingResolved, LINE_HEIGHT, RADIUS_PX, SPACING_PX, SPACING_TO_TAILWIND, TCanonicalColor, TCanonicalRadius, TCanonicalSpacing, THeroUiColor, TMantineMappedColor, TMantineMappedVariant, TSemanticColor, TSemanticIntent, TSemanticRadius, TSemanticSize, TSemanticSpacing, TSemanticState, TSemanticVariant, colorToHex, mapAccordionVariantToHeroUiVariant, mapIntentToHeroUiButtonVariant, mapIntentToHeroUiColor, mapIntentToMantine, mapMantineColorToHeroUiButtonVariant, mapMantineColorToHeroUiColor, mapMantineVariantToHeroUiButtonVariant, mapRadiusToMantine, mapRadiusToPx, mapSizeToHeroUi, mapSizeToMantine, mapSpacingToPx, radiusToPx, resolveMantineVariant, resolveSharedStyle, resolveSharedStyleForMobile, resolveSharedStyleForWeb, resolveSharedStyleProps, sizeToFontPx, spacingToPx, toHeroUiSemanticProps, toMantineSemanticProps, toReactNativeSemanticStyle } from './theme/index.js';
|
|
7
7
|
export { TAnyStyleName, TPluginStyleImplMap, TStyleImplMap, getRegistryEntry, getRegistryEntryAny, getStylePlacement, getStylePlatforms, getStylePluginId, isKnownStyleName, isRegisteredStyleName, isStyleAllowedOnPage, isStylePlacementAllowed, isStyleSupportedOnPlatform, setToStylePlatform, stylePlatformToSet } from './registry/index.js';
|
|
8
8
|
export { sharedTailwindExtend, sharedTailwindPreset } from './theme/tailwind.js';
|
|
9
9
|
|
|
@@ -1192,6 +1192,16 @@ interface IMobileButtonProps extends IMobileAdapterBaseProps {
|
|
|
1192
1192
|
isLoading?: boolean;
|
|
1193
1193
|
isIconOnly?: boolean;
|
|
1194
1194
|
fullWidth?: boolean;
|
|
1195
|
+
/**
|
|
1196
|
+
* Optional concrete background colour (resolved hex) that overrides the
|
|
1197
|
+
* variant's themed fill, used for cross-platform parity when a CMS style
|
|
1198
|
+
* exposes an authored colour (e.g. `login`'s `shared_color`, which Mantine
|
|
1199
|
+
* applies to the web button via `color`). The adapter keeps the variant's
|
|
1200
|
+
* readable foreground (white on a filled button). Leave undefined to use the
|
|
1201
|
+
* variant's default themed colour. Resolve it through the shared mapper
|
|
1202
|
+
* (`resolveMantineVariant(...).accent`), never a hard-coded hex in a renderer.
|
|
1203
|
+
*/
|
|
1204
|
+
accentColor?: string;
|
|
1195
1205
|
children?: ReactNode;
|
|
1196
1206
|
}
|
|
1197
1207
|
interface IMobileTextProps extends IMobileAdapterBaseProps {
|
package/dist/index.js
CHANGED
|
@@ -76,6 +76,7 @@ __export(index_exports, {
|
|
|
76
76
|
isStyleAllowedOnPage: () => isStyleAllowedOnPage,
|
|
77
77
|
isStylePlacementAllowed: () => isStylePlacementAllowed,
|
|
78
78
|
isStyleSupportedOnPlatform: () => isStyleSupportedOnPlatform,
|
|
79
|
+
mapAccordionVariantToHeroUiVariant: () => mapAccordionVariantToHeroUiVariant,
|
|
79
80
|
mapIntentToHeroUiButtonVariant: () => mapIntentToHeroUiButtonVariant,
|
|
80
81
|
mapIntentToHeroUiColor: () => mapIntentToHeroUiColor,
|
|
81
82
|
mapIntentToMantine: () => mapIntentToMantine,
|
|
@@ -766,6 +767,17 @@ function mapMantineVariantToHeroUiButtonVariant(variant) {
|
|
|
766
767
|
return void 0;
|
|
767
768
|
}
|
|
768
769
|
}
|
|
770
|
+
function mapAccordionVariantToHeroUiVariant(variant) {
|
|
771
|
+
switch (variant) {
|
|
772
|
+
case "contained":
|
|
773
|
+
case "filled":
|
|
774
|
+
case "separated":
|
|
775
|
+
return "surface";
|
|
776
|
+
case "default":
|
|
777
|
+
default:
|
|
778
|
+
return "default";
|
|
779
|
+
}
|
|
780
|
+
}
|
|
769
781
|
function hasState(states, state) {
|
|
770
782
|
return !!states && states.includes(state);
|
|
771
783
|
}
|
|
@@ -1337,6 +1349,7 @@ function transformPagesData(pages) {
|
|
|
1337
1349
|
isStyleAllowedOnPage,
|
|
1338
1350
|
isStylePlacementAllowed,
|
|
1339
1351
|
isStyleSupportedOnPlatform,
|
|
1352
|
+
mapAccordionVariantToHeroUiVariant,
|
|
1340
1353
|
mapIntentToHeroUiButtonVariant,
|
|
1341
1354
|
mapIntentToHeroUiColor,
|
|
1342
1355
|
mapIntentToMantine,
|
package/dist/index.mjs
CHANGED
|
@@ -652,6 +652,17 @@ function mapMantineVariantToHeroUiButtonVariant(variant) {
|
|
|
652
652
|
return void 0;
|
|
653
653
|
}
|
|
654
654
|
}
|
|
655
|
+
function mapAccordionVariantToHeroUiVariant(variant) {
|
|
656
|
+
switch (variant) {
|
|
657
|
+
case "contained":
|
|
658
|
+
case "filled":
|
|
659
|
+
case "separated":
|
|
660
|
+
return "surface";
|
|
661
|
+
case "default":
|
|
662
|
+
default:
|
|
663
|
+
return "default";
|
|
664
|
+
}
|
|
665
|
+
}
|
|
655
666
|
function hasState(states, state) {
|
|
656
667
|
return !!states && states.includes(state);
|
|
657
668
|
}
|
|
@@ -1222,6 +1233,7 @@ export {
|
|
|
1222
1233
|
isStyleAllowedOnPage,
|
|
1223
1234
|
isStylePlacementAllowed,
|
|
1224
1235
|
isStyleSupportedOnPlatform,
|
|
1236
|
+
mapAccordionVariantToHeroUiVariant,
|
|
1225
1237
|
mapIntentToHeroUiButtonVariant,
|
|
1226
1238
|
mapIntentToHeroUiColor,
|
|
1227
1239
|
mapIntentToMantine,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { I as IPluginManifest, a as IPluginManifestAdminPage, b as IPluginManifestApiRoute, c as IPluginManifestAsset, d as IPluginManifestCapability, e as IPluginManifestCompatibility, f as IPluginManifestConflict, g as IPluginManifestDataAccess, h as IPluginManifestDependency, i as IPluginManifestExternalHost, j as IPluginManifestFeatureFlag, k as IPluginManifestHealth, l as IPluginManifestLookupExtension, m as IPluginManifestMobile, n as IPluginManifestPermission, o as IPluginManifestRealtimeTopic, p as IPluginManifestScheduledJob, q as IPluginManifestSecurity, r as IPluginManifestStyle, s as IPluginManifestTrustLevel } from '../manifest-C8sBTLJb.mjs';
|
|
2
|
-
import { I as IStyleRegistryEntry } from '../styles.registry-
|
|
2
|
+
import { I as IStyleRegistryEntry } from '../styles.registry-zgJnv5zg.mjs';
|
|
3
3
|
import '../common-DVC0R_AX.mjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { I as IPluginManifest, a as IPluginManifestAdminPage, b as IPluginManifestApiRoute, c as IPluginManifestAsset, d as IPluginManifestCapability, e as IPluginManifestCompatibility, f as IPluginManifestConflict, g as IPluginManifestDataAccess, h as IPluginManifestDependency, i as IPluginManifestExternalHost, j as IPluginManifestFeatureFlag, k as IPluginManifestHealth, l as IPluginManifestLookupExtension, m as IPluginManifestMobile, n as IPluginManifestPermission, o as IPluginManifestRealtimeTopic, p as IPluginManifestScheduledJob, q as IPluginManifestSecurity, r as IPluginManifestStyle, s as IPluginManifestTrustLevel } from '../manifest-C8sBTLJb.js';
|
|
2
|
-
import { I as IStyleRegistryEntry } from '../styles.registry-
|
|
2
|
+
import { I as IStyleRegistryEntry } from '../styles.registry-CRtHSMQq.js';
|
|
3
3
|
import '../common-DVC0R_AX.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TStyleName, I as IStyleRegistryEntry, a as IPluginStyleRegistryEntry, b as TStylePlacement, c as TConcretePlatform, d as TStylePlatform } from '../styles.registry-
|
|
2
|
-
export { B as BASE_STYLE_REGISTRY, S as STYLE_REGISTRY, e as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, f as _resetPluginStyleRegistry, g as extendStyleRegistry, h as getMergedStyleRegistry, i as getPluginStyleRegistry } from '../styles.registry-
|
|
1
|
+
import { T as TStyleName, I as IStyleRegistryEntry, a as IPluginStyleRegistryEntry, b as TStylePlacement, c as TConcretePlatform, d as TStylePlatform } from '../styles.registry-zgJnv5zg.mjs';
|
|
2
|
+
export { B as BASE_STYLE_REGISTRY, S as STYLE_REGISTRY, e as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, f as _resetPluginStyleRegistry, g as extendStyleRegistry, h as getMergedStyleRegistry, i as getPluginStyleRegistry } from '../styles.registry-zgJnv5zg.mjs';
|
|
3
3
|
import '../common-DVC0R_AX.mjs';
|
|
4
4
|
|
|
5
5
|
/**
|
package/dist/registry/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TStyleName, I as IStyleRegistryEntry, a as IPluginStyleRegistryEntry, b as TStylePlacement, c as TConcretePlatform, d as TStylePlatform } from '../styles.registry-
|
|
2
|
-
export { B as BASE_STYLE_REGISTRY, S as STYLE_REGISTRY, e as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, f as _resetPluginStyleRegistry, g as extendStyleRegistry, h as getMergedStyleRegistry, i as getPluginStyleRegistry } from '../styles.registry-
|
|
1
|
+
import { T as TStyleName, I as IStyleRegistryEntry, a as IPluginStyleRegistryEntry, b as TStylePlacement, c as TConcretePlatform, d as TStylePlatform } from '../styles.registry-CRtHSMQq.js';
|
|
2
|
+
export { B as BASE_STYLE_REGISTRY, S as STYLE_REGISTRY, e as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, f as _resetPluginStyleRegistry, g as extendStyleRegistry, h as getMergedStyleRegistry, i as getPluginStyleRegistry } from '../styles.registry-CRtHSMQq.js';
|
|
3
3
|
import '../common-DVC0R_AX.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1035,7 +1035,7 @@ type TMantineListWithPadding = '0' | '1';
|
|
|
1035
1035
|
type TMantineListCenter = '0' | '1';
|
|
1036
1036
|
interface IAccordionStyle extends IStyleWithSpacing {
|
|
1037
1037
|
style_name: 'accordion';
|
|
1038
|
-
|
|
1038
|
+
shared_accordion_variant?: IContentField<TMantineAccordionVariant>;
|
|
1039
1039
|
shared_multiple?: IContentField<TMantineAccordionMultiple>;
|
|
1040
1040
|
web_accordion_chevron_position?: IContentField<TMantineAccordionChevronPosition>;
|
|
1041
1041
|
web_accordion_chevron_size?: IContentField<string>;
|
|
@@ -1049,6 +1049,7 @@ interface IAccordionItemStyle extends IStyleWithSpacing {
|
|
|
1049
1049
|
style_name: 'accordion-item';
|
|
1050
1050
|
web_accordion_item_value?: IContentField<string>;
|
|
1051
1051
|
label?: IContentField<string>;
|
|
1052
|
+
description?: IContentField<string>;
|
|
1052
1053
|
web_accordion_item_icon?: IContentField<string>;
|
|
1053
1054
|
disabled?: IContentField<string>;
|
|
1054
1055
|
}
|
|
@@ -1035,7 +1035,7 @@ type TMantineListWithPadding = '0' | '1';
|
|
|
1035
1035
|
type TMantineListCenter = '0' | '1';
|
|
1036
1036
|
interface IAccordionStyle extends IStyleWithSpacing {
|
|
1037
1037
|
style_name: 'accordion';
|
|
1038
|
-
|
|
1038
|
+
shared_accordion_variant?: IContentField<TMantineAccordionVariant>;
|
|
1039
1039
|
shared_multiple?: IContentField<TMantineAccordionMultiple>;
|
|
1040
1040
|
web_accordion_chevron_position?: IContentField<TMantineAccordionChevronPosition>;
|
|
1041
1041
|
web_accordion_chevron_size?: IContentField<string>;
|
|
@@ -1049,6 +1049,7 @@ interface IAccordionItemStyle extends IStyleWithSpacing {
|
|
|
1049
1049
|
style_name: 'accordion-item';
|
|
1050
1050
|
web_accordion_item_value?: IContentField<string>;
|
|
1051
1051
|
label?: IContentField<string>;
|
|
1052
|
+
description?: IContentField<string>;
|
|
1052
1053
|
web_accordion_item_icon?: IContentField<string>;
|
|
1053
1054
|
disabled?: IContentField<string>;
|
|
1054
1055
|
}
|
package/dist/theme/index.d.mts
CHANGED
|
@@ -258,6 +258,13 @@ declare function mapMantineColorToHeroUiButtonVariant(color: TSemanticColor | un
|
|
|
258
258
|
* subtle / transparent -> ghost
|
|
259
259
|
*/
|
|
260
260
|
declare function mapMantineVariantToHeroUiButtonVariant(variant: TSemanticVariant | undefined): THeroUiButtonVariant | undefined;
|
|
261
|
+
/**
|
|
262
|
+
* Map the accordion variant token (`shared_accordion_variant`: Mantine
|
|
263
|
+
* default/contained/filled/separated) onto the HeroUI Native Accordion `variant`
|
|
264
|
+
* vocabulary. HeroUI Native only has `default` (plain list) and `surface`
|
|
265
|
+
* (grouped container), so every "boxed" Mantine variant collapses to `surface`.
|
|
266
|
+
*/
|
|
267
|
+
declare function mapAccordionVariantToHeroUiVariant(variant: string | undefined): 'default' | 'surface';
|
|
261
268
|
/**
|
|
262
269
|
* Read the `shared_*` CMS fields of a section into {@link ISharedStyleProps}.
|
|
263
270
|
*
|
|
@@ -338,4 +345,4 @@ interface IResolvedVariant {
|
|
|
338
345
|
}
|
|
339
346
|
declare function resolveMantineVariant(variant: string | undefined, color: string | undefined): IResolvedVariant;
|
|
340
347
|
|
|
341
|
-
export { COLOR_PALETTE, COLOR_SCALES, CONTAINER_SIZE_PX, FONT_SIZE_PX, FULL_RADIUS_PX, type IHeroUiResolvedStyle, type IMantineResolvedStyle, 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 TSemanticColor, type TSemanticIntent, type TSemanticRadius, type TSemanticSize, type TSemanticSpacing, type TSemanticState, type TSemanticVariant, colorToHex, mapIntentToHeroUiButtonVariant, mapIntentToHeroUiColor, mapIntentToMantine, mapMantineColorToHeroUiButtonVariant, mapMantineColorToHeroUiColor, mapMantineVariantToHeroUiButtonVariant, mapRadiusToMantine, mapRadiusToPx, mapSizeToHeroUi, mapSizeToMantine, mapSpacingToPx, 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 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 TSemanticColor, type TSemanticIntent, type TSemanticRadius, type TSemanticSize, type TSemanticSpacing, type TSemanticState, type TSemanticVariant, colorToHex, mapAccordionVariantToHeroUiVariant, mapIntentToHeroUiButtonVariant, mapIntentToHeroUiColor, mapIntentToMantine, mapMantineColorToHeroUiButtonVariant, mapMantineColorToHeroUiColor, mapMantineVariantToHeroUiButtonVariant, mapRadiusToMantine, mapRadiusToPx, mapSizeToHeroUi, mapSizeToMantine, mapSpacingToPx, radiusToPx, resolveMantineVariant, resolveSharedStyle, resolveSharedStyleForMobile, resolveSharedStyleForWeb, resolveSharedStyleProps, sizeToFontPx, spacingToPx, toHeroUiSemanticProps, toMantineSemanticProps, toReactNativeSemanticStyle };
|
package/dist/theme/index.d.ts
CHANGED
|
@@ -258,6 +258,13 @@ declare function mapMantineColorToHeroUiButtonVariant(color: TSemanticColor | un
|
|
|
258
258
|
* subtle / transparent -> ghost
|
|
259
259
|
*/
|
|
260
260
|
declare function mapMantineVariantToHeroUiButtonVariant(variant: TSemanticVariant | undefined): THeroUiButtonVariant | undefined;
|
|
261
|
+
/**
|
|
262
|
+
* Map the accordion variant token (`shared_accordion_variant`: Mantine
|
|
263
|
+
* default/contained/filled/separated) onto the HeroUI Native Accordion `variant`
|
|
264
|
+
* vocabulary. HeroUI Native only has `default` (plain list) and `surface`
|
|
265
|
+
* (grouped container), so every "boxed" Mantine variant collapses to `surface`.
|
|
266
|
+
*/
|
|
267
|
+
declare function mapAccordionVariantToHeroUiVariant(variant: string | undefined): 'default' | 'surface';
|
|
261
268
|
/**
|
|
262
269
|
* Read the `shared_*` CMS fields of a section into {@link ISharedStyleProps}.
|
|
263
270
|
*
|
|
@@ -338,4 +345,4 @@ interface IResolvedVariant {
|
|
|
338
345
|
}
|
|
339
346
|
declare function resolveMantineVariant(variant: string | undefined, color: string | undefined): IResolvedVariant;
|
|
340
347
|
|
|
341
|
-
export { COLOR_PALETTE, COLOR_SCALES, CONTAINER_SIZE_PX, FONT_SIZE_PX, FULL_RADIUS_PX, type IHeroUiResolvedStyle, type IMantineResolvedStyle, 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 TSemanticColor, type TSemanticIntent, type TSemanticRadius, type TSemanticSize, type TSemanticSpacing, type TSemanticState, type TSemanticVariant, colorToHex, mapIntentToHeroUiButtonVariant, mapIntentToHeroUiColor, mapIntentToMantine, mapMantineColorToHeroUiButtonVariant, mapMantineColorToHeroUiColor, mapMantineVariantToHeroUiButtonVariant, mapRadiusToMantine, mapRadiusToPx, mapSizeToHeroUi, mapSizeToMantine, mapSpacingToPx, 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 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 TSemanticColor, type TSemanticIntent, type TSemanticRadius, type TSemanticSize, type TSemanticSpacing, type TSemanticState, type TSemanticVariant, colorToHex, mapAccordionVariantToHeroUiVariant, mapIntentToHeroUiButtonVariant, mapIntentToHeroUiColor, mapIntentToMantine, mapMantineColorToHeroUiButtonVariant, mapMantineColorToHeroUiColor, mapMantineVariantToHeroUiButtonVariant, mapRadiusToMantine, mapRadiusToPx, mapSizeToHeroUi, mapSizeToMantine, mapSpacingToPx, radiusToPx, resolveMantineVariant, resolveSharedStyle, resolveSharedStyleForMobile, resolveSharedStyleForWeb, resolveSharedStyleProps, sizeToFontPx, spacingToPx, toHeroUiSemanticProps, toMantineSemanticProps, toReactNativeSemanticStyle };
|
package/dist/theme/index.js
CHANGED
|
@@ -30,6 +30,7 @@ __export(theme_exports, {
|
|
|
30
30
|
SPACING_PX: () => SPACING_PX,
|
|
31
31
|
SPACING_TO_TAILWIND: () => SPACING_TO_TAILWIND,
|
|
32
32
|
colorToHex: () => colorToHex,
|
|
33
|
+
mapAccordionVariantToHeroUiVariant: () => mapAccordionVariantToHeroUiVariant,
|
|
33
34
|
mapIntentToHeroUiButtonVariant: () => mapIntentToHeroUiButtonVariant,
|
|
34
35
|
mapIntentToHeroUiColor: () => mapIntentToHeroUiColor,
|
|
35
36
|
mapIntentToMantine: () => mapIntentToMantine,
|
|
@@ -380,6 +381,17 @@ function mapMantineVariantToHeroUiButtonVariant(variant) {
|
|
|
380
381
|
return void 0;
|
|
381
382
|
}
|
|
382
383
|
}
|
|
384
|
+
function mapAccordionVariantToHeroUiVariant(variant) {
|
|
385
|
+
switch (variant) {
|
|
386
|
+
case "contained":
|
|
387
|
+
case "filled":
|
|
388
|
+
case "separated":
|
|
389
|
+
return "surface";
|
|
390
|
+
case "default":
|
|
391
|
+
default:
|
|
392
|
+
return "default";
|
|
393
|
+
}
|
|
394
|
+
}
|
|
383
395
|
function hasState(states, state) {
|
|
384
396
|
return !!states && states.includes(state);
|
|
385
397
|
}
|
|
@@ -577,6 +589,7 @@ function resolveMantineVariant(variant, color) {
|
|
|
577
589
|
SPACING_PX,
|
|
578
590
|
SPACING_TO_TAILWIND,
|
|
579
591
|
colorToHex,
|
|
592
|
+
mapAccordionVariantToHeroUiVariant,
|
|
580
593
|
mapIntentToHeroUiButtonVariant,
|
|
581
594
|
mapIntentToHeroUiColor,
|
|
582
595
|
mapIntentToMantine,
|
package/dist/theme/index.mjs
CHANGED
|
@@ -321,6 +321,17 @@ function mapMantineVariantToHeroUiButtonVariant(variant) {
|
|
|
321
321
|
return void 0;
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
|
+
function mapAccordionVariantToHeroUiVariant(variant) {
|
|
325
|
+
switch (variant) {
|
|
326
|
+
case "contained":
|
|
327
|
+
case "filled":
|
|
328
|
+
case "separated":
|
|
329
|
+
return "surface";
|
|
330
|
+
case "default":
|
|
331
|
+
default:
|
|
332
|
+
return "default";
|
|
333
|
+
}
|
|
334
|
+
}
|
|
324
335
|
function hasState(states, state) {
|
|
325
336
|
return !!states && states.includes(state);
|
|
326
337
|
}
|
|
@@ -517,6 +528,7 @@ export {
|
|
|
517
528
|
SPACING_PX,
|
|
518
529
|
SPACING_TO_TAILWIND,
|
|
519
530
|
colorToHex,
|
|
531
|
+
mapAccordionVariantToHeroUiVariant,
|
|
520
532
|
mapIntentToHeroUiButtonVariant,
|
|
521
533
|
mapIntentToHeroUiColor,
|
|
522
534
|
mapIntentToMantine,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@selfhelp/shared",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.8",
|
|
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",
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
mapIntentToMantine,
|
|
11
11
|
mapMantineColorToHeroUiButtonVariant,
|
|
12
12
|
mapMantineColorToHeroUiColor,
|
|
13
|
+
mapAccordionVariantToHeroUiVariant,
|
|
13
14
|
mapMantineVariantToHeroUiButtonVariant,
|
|
14
15
|
mapRadiusToMantine,
|
|
15
16
|
mapRadiusToPx,
|
|
@@ -172,6 +173,14 @@ describe('semantic style mapper', () => {
|
|
|
172
173
|
expect(mapMantineVariantToHeroUiButtonVariant('transparent')).toBe('ghost');
|
|
173
174
|
});
|
|
174
175
|
|
|
176
|
+
it('maps the accordion variant token onto the HeroUI Native accordion variant', () => {
|
|
177
|
+
expect(mapAccordionVariantToHeroUiVariant('default')).toBe('default');
|
|
178
|
+
expect(mapAccordionVariantToHeroUiVariant('contained')).toBe('surface');
|
|
179
|
+
expect(mapAccordionVariantToHeroUiVariant('filled')).toBe('surface');
|
|
180
|
+
expect(mapAccordionVariantToHeroUiVariant('separated')).toBe('surface');
|
|
181
|
+
expect(mapAccordionVariantToHeroUiVariant(undefined)).toBe('default');
|
|
182
|
+
});
|
|
183
|
+
|
|
175
184
|
it('derives a button variant from the colour when no variant is set', () => {
|
|
176
185
|
expect(mapMantineColorToHeroUiButtonVariant('red')).toBe('danger');
|
|
177
186
|
expect(mapMantineColorToHeroUiButtonVariant('gray')).toBe('secondary');
|
package/src/theme/semantic.ts
CHANGED
|
@@ -433,6 +433,26 @@ export function mapMantineVariantToHeroUiButtonVariant(
|
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
|
|
436
|
+
/**
|
|
437
|
+
* Map the accordion variant token (`shared_accordion_variant`: Mantine
|
|
438
|
+
* default/contained/filled/separated) onto the HeroUI Native Accordion `variant`
|
|
439
|
+
* vocabulary. HeroUI Native only has `default` (plain list) and `surface`
|
|
440
|
+
* (grouped container), so every "boxed" Mantine variant collapses to `surface`.
|
|
441
|
+
*/
|
|
442
|
+
export function mapAccordionVariantToHeroUiVariant(
|
|
443
|
+
variant: string | undefined,
|
|
444
|
+
): 'default' | 'surface' {
|
|
445
|
+
switch (variant) {
|
|
446
|
+
case 'contained':
|
|
447
|
+
case 'filled':
|
|
448
|
+
case 'separated':
|
|
449
|
+
return 'surface';
|
|
450
|
+
case 'default':
|
|
451
|
+
default:
|
|
452
|
+
return 'default';
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
|
|
436
456
|
// ===== state helpers =====
|
|
437
457
|
|
|
438
458
|
function hasState(states: readonly TSemanticState[] | undefined, state: TSemanticState): boolean {
|
|
@@ -56,6 +56,15 @@ const _exhaustiveBackward: ContractKey = '' as ListedKey;
|
|
|
56
56
|
void _exhaustiveForward;
|
|
57
57
|
void _exhaustiveBackward;
|
|
58
58
|
|
|
59
|
+
/**
|
|
60
|
+
* Compile-time lock for the authored-colour button passthrough: `MobileButton`
|
|
61
|
+
* accepts an optional `accentColor` (resolved hex) so a CMS style can colour the
|
|
62
|
+
* button for cross-platform parity (e.g. `login`'s `shared_color`). If the prop
|
|
63
|
+
* is removed or retyped, this assignment fails to type-check.
|
|
64
|
+
*/
|
|
65
|
+
const _buttonAcceptsAccentColor: IMobileButtonProps = { accentColor: '#fab005' };
|
|
66
|
+
void _buttonAcceptsAccentColor;
|
|
67
|
+
|
|
59
68
|
describe('mobile UI adapter contract', () => {
|
|
60
69
|
it('exposes exactly the milestone-one capability set', () => {
|
|
61
70
|
// A trivial component every capability key can hold; proves a complete
|
|
@@ -45,6 +45,16 @@ export interface IMobileButtonProps extends IMobileAdapterBaseProps {
|
|
|
45
45
|
isLoading?: boolean;
|
|
46
46
|
isIconOnly?: boolean;
|
|
47
47
|
fullWidth?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Optional concrete background colour (resolved hex) that overrides the
|
|
50
|
+
* variant's themed fill, used for cross-platform parity when a CMS style
|
|
51
|
+
* exposes an authored colour (e.g. `login`'s `shared_color`, which Mantine
|
|
52
|
+
* applies to the web button via `color`). The adapter keeps the variant's
|
|
53
|
+
* readable foreground (white on a filled button). Leave undefined to use the
|
|
54
|
+
* variant's default themed colour. Resolve it through the shared mapper
|
|
55
|
+
* (`resolveMantineVariant(...).accent`), never a hard-coded hex in a renderer.
|
|
56
|
+
*/
|
|
57
|
+
accentColor?: string;
|
|
48
58
|
children?: ReactNode;
|
|
49
59
|
}
|
|
50
60
|
|
|
@@ -40,9 +40,10 @@ export type TMantineListCenter = '0' | '1';
|
|
|
40
40
|
|
|
41
41
|
export interface IAccordionStyle extends IStyleWithSpacing {
|
|
42
42
|
style_name: 'accordion';
|
|
43
|
-
//
|
|
44
|
-
//
|
|
45
|
-
|
|
43
|
+
// Cross-platform variant token: web -> Mantine variant
|
|
44
|
+
// (default/contained/filled/separated), mobile -> HeroUI Native
|
|
45
|
+
// default ('default') / surface (contained/filled/separated).
|
|
46
|
+
shared_accordion_variant?: IContentField<TMantineAccordionVariant>;
|
|
46
47
|
// RF-19: selection mode (single vs multiple open) is portable; mobile reads it.
|
|
47
48
|
shared_multiple?: IContentField<TMantineAccordionMultiple>;
|
|
48
49
|
web_accordion_chevron_position?: IContentField<TMantineAccordionChevronPosition>;
|
|
@@ -57,6 +58,8 @@ export interface IAccordionItemStyle extends IStyleWithSpacing {
|
|
|
57
58
|
style_name: 'accordion-item';
|
|
58
59
|
web_accordion_item_value?: IContentField<string>;
|
|
59
60
|
label?: IContentField<string>;
|
|
61
|
+
// Optional subtitle rendered under the item label (both platforms).
|
|
62
|
+
description?: IContentField<string>;
|
|
60
63
|
web_accordion_item_icon?: IContentField<string>;
|
|
61
64
|
disabled?: IContentField<string>;}
|
|
62
65
|
|