@selfhelp/shared 1.8.0 → 1.10.0
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 +48 -0
- package/dist/{common-B96dASgu.d.mts → common-CJSHQL1E.d.mts} +13 -1
- package/dist/{common-B96dASgu.d.ts → common-CJSHQL1E.d.ts} +13 -1
- package/dist/index.d.mts +7 -44
- package/dist/index.d.ts +7 -44
- package/dist/index.js +395 -8
- package/dist/index.mjs +371 -8
- package/dist/plugin-sdk/index.d.mts +2 -2
- package/dist/plugin-sdk/index.d.ts +2 -2
- package/dist/plugin-sdk/index.js +10 -1
- package/dist/plugin-sdk/index.mjs +10 -1
- package/dist/registry/index.d.mts +42 -4
- package/dist/registry/index.d.ts +42 -4
- package/dist/registry/index.js +56 -3
- package/dist/registry/index.mjs +48 -2
- package/dist/{styles.registry-ClluRYkN.d.ts → styles.registry-BV1iF7k-.d.ts} +678 -461
- package/dist/{styles.registry-nl8uzvMN.d.mts → styles.registry-DkoT-FmN.d.mts} +678 -461
- package/dist/theme/index.d.mts +225 -4
- package/dist/theme/index.d.ts +225 -4
- package/dist/theme/index.js +343 -9
- package/dist/theme/index.mjs +325 -8
- package/dist/theme/tailwind.d.mts +2 -2
- package/dist/theme/tailwind.d.ts +2 -2
- package/package.json +1 -1
- package/src/registry/__tests__/platform.test.ts +187 -0
- package/src/registry/index.ts +73 -0
- package/src/registry/styles.registry.ts +60 -0
- package/src/theme/__tests__/mantineVariant.test.ts +87 -0
- package/src/theme/__tests__/semantic.test.ts +231 -0
- package/src/theme/index.ts +2 -0
- package/src/theme/mantineVariant.ts +145 -0
- package/src/theme/semantic.ts +472 -0
- package/src/theme/tailwind.ts +2 -2
- package/src/theme/tokens.ts +2 -2
- package/src/types/mantine/common.ts +13 -0
- package/src/types/styles/auth.ts +11 -11
- package/src/types/styles/base.ts +4 -4
- package/src/types/styles/composite.ts +59 -45
- package/src/types/styles/error.ts +24 -13
- package/src/types/styles/forms.ts +184 -184
- package/src/types/styles/interactive.ts +81 -76
- package/src/types/styles/layout.ts +103 -85
- package/src/types/styles/media.ts +20 -20
- package/src/types/styles/typography.ts +39 -39
- package/src/types/styles/unknown.ts +20 -2
- package/src/utils/spacing.ts +1 -1
|
@@ -29,56 +29,56 @@ export type TMantineIconSize = string;
|
|
|
29
29
|
export interface ITitleStyle extends IStyleWithSpacing {
|
|
30
30
|
style_name: 'title';
|
|
31
31
|
content?: IContentField<string>;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
web_title_order?: IContentField<TMantineTitleOrder>;
|
|
33
|
+
shared_size?: IContentField<TMantineSize>;
|
|
34
|
+
web_title_text_wrap?: IContentField<TMantineTitleTextWrap>;
|
|
35
|
+
web_title_line_clamp?: IContentField<TMantineTitleLineClamp>;
|
|
36
|
+
use_web_style?: IContentField<string>;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
export interface ITextStyle extends IStyleWithSpacing {
|
|
40
40
|
style_name: 'text';
|
|
41
41
|
text?: IContentField<string>;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
42
|
+
shared_size?: IContentField<TMantineSize>;
|
|
43
|
+
web_color?: IContentField<TMantineColor>;
|
|
44
|
+
web_text_font_weight?: IContentField<TMantineTextFontWeight>;
|
|
45
|
+
web_text_font_style?: IContentField<TMantineTextFontStyle>;
|
|
46
|
+
web_text_text_decoration?: IContentField<TMantineTextDecoration>;
|
|
47
|
+
web_text_text_transform?: IContentField<TMantineTextTransform>;
|
|
48
|
+
shared_text_align?: IContentField<TMantineTextAlign>;
|
|
49
|
+
web_text_variant?: IContentField<TMantineTextVariant>;
|
|
50
|
+
web_text_gradient?: IContentField<string>;
|
|
51
|
+
web_text_truncate?: IContentField<TMantineTextTruncate>;
|
|
52
|
+
web_text_line_clamp?: IContentField<TMantineLineClamp>;
|
|
53
|
+
web_text_inherit?: IContentField<TMantineTextInherit>;
|
|
54
|
+
web_text_span?: IContentField<TMantineTextSpan>;
|
|
55
|
+
use_web_style?: IContentField<string>;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
export interface ICodeStyle extends IStyleWithSpacing {
|
|
59
59
|
style_name: 'code';
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
web_code_block?: IContentField<string>;
|
|
61
|
+
web_color?: IContentField<TMantineColor>;
|
|
62
|
+
use_web_style?: IContentField<string>;
|
|
63
63
|
content?: IContentField<string>;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
export interface IHighlightStyle extends IStyleWithSpacing {
|
|
67
67
|
style_name: 'highlight';
|
|
68
68
|
text?: IContentField<string>;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
web_highlight_highlight?: IContentField<string>;
|
|
70
|
+
web_color?: IContentField<TMantineColor>;
|
|
71
|
+
use_web_style?: IContentField<string>;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
export interface IBlockquoteStyle extends IStyleWithSpacing {
|
|
75
75
|
style_name: 'blockquote';
|
|
76
76
|
content?: IContentField<string>;
|
|
77
77
|
cite?: IContentField<string>;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
web_left_icon?: IContentField<string>;
|
|
79
|
+
web_icon_size?: IContentField<TMantineIconSize>;
|
|
80
|
+
web_color?: IContentField<TMantineColor>;
|
|
81
|
+
use_web_style?: IContentField<string>;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
export interface IHtmlTagStyle extends IBaseStyle {
|
|
@@ -90,29 +90,29 @@ export interface IHtmlTagStyle extends IBaseStyle {
|
|
|
90
90
|
export interface IKbdStyle extends IStyleWithSpacing {
|
|
91
91
|
style_name: 'kbd';
|
|
92
92
|
label?: IContentField<string>;
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
shared_size?: IContentField<TMantineSize>;
|
|
94
|
+
use_web_style?: IContentField<string>;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
export interface ITypographyStyle extends IStyleWithSpacing {
|
|
98
98
|
style_name: 'typography';
|
|
99
|
-
|
|
99
|
+
use_web_style?: IContentField<string>;
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
export interface IFieldsetStyle extends IStyleWithSpacing {
|
|
103
103
|
style_name: 'fieldset';
|
|
104
104
|
label?: IContentField<string>;
|
|
105
105
|
legend?: IContentField<string>;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
web_fieldset_variant?: IContentField<TMantineFieldsetVariant>;
|
|
107
|
+
shared_radius?: IContentField<TMantineRadius>;
|
|
108
|
+
use_web_style?: IContentField<string>;
|
|
109
109
|
disabled?: IContentField<string>;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
export interface ISpoilerStyle extends IStyleWithSpacing {
|
|
113
113
|
style_name: 'spoiler';
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
114
|
+
web_height?: IContentField<TMantineSpoilerMaxHeight>;
|
|
115
|
+
web_spoiler_show_label?: IContentField<string>;
|
|
116
|
+
web_spoiler_hide_label?: IContentField<string>;
|
|
117
|
+
use_web_style?: IContentField<string>;
|
|
118
118
|
}
|
|
@@ -29,6 +29,8 @@ import type {
|
|
|
29
29
|
ICardSegmentStyle,
|
|
30
30
|
IAspectRatioStyle,
|
|
31
31
|
IBackgroundImageStyle,
|
|
32
|
+
IRefContainerStyle,
|
|
33
|
+
IDataContainerStyle,
|
|
32
34
|
} from './layout';
|
|
33
35
|
import type {
|
|
34
36
|
ITitleStyle,
|
|
@@ -85,6 +87,7 @@ import type {
|
|
|
85
87
|
IProgressStyle,
|
|
86
88
|
IProgressRootStyle,
|
|
87
89
|
IProgressSectionStyle,
|
|
90
|
+
IShowUserInputStyle,
|
|
88
91
|
} from './forms';
|
|
89
92
|
import type {
|
|
90
93
|
IAccordionStyle,
|
|
@@ -92,6 +95,7 @@ import type {
|
|
|
92
95
|
ITabsStyle,
|
|
93
96
|
ITabStyle,
|
|
94
97
|
ITimelineStyle,
|
|
98
|
+
ITimelineItemStyle,
|
|
95
99
|
IListStyle,
|
|
96
100
|
IListItemStyle,
|
|
97
101
|
IEntryListStyle,
|
|
@@ -99,6 +103,12 @@ import type {
|
|
|
99
103
|
IEntryRecordDeleteStyle,
|
|
100
104
|
ILoopStyle,
|
|
101
105
|
} from './composite';
|
|
106
|
+
import type {
|
|
107
|
+
INoAccessStyle,
|
|
108
|
+
INotFoundStyle,
|
|
109
|
+
IMissingStyle,
|
|
110
|
+
IVersionStyle,
|
|
111
|
+
} from './error';
|
|
102
112
|
|
|
103
113
|
/**
|
|
104
114
|
* Discriminated union of every supported user-facing style. Adding a new
|
|
@@ -190,7 +200,15 @@ export type TStyle =
|
|
|
190
200
|
| IEntryListStyle
|
|
191
201
|
| IEntryRecordStyle
|
|
192
202
|
| IEntryRecordDeleteStyle
|
|
193
|
-
| ILoopStyle
|
|
203
|
+
| ILoopStyle
|
|
204
|
+
| ITimelineItemStyle
|
|
205
|
+
| INoAccessStyle
|
|
206
|
+
| INotFoundStyle
|
|
207
|
+
| IMissingStyle
|
|
208
|
+
| IVersionStyle
|
|
209
|
+
| IRefContainerStyle
|
|
210
|
+
| IDataContainerStyle
|
|
211
|
+
| IShowUserInputStyle;
|
|
194
212
|
|
|
195
213
|
/**
|
|
196
214
|
* Discriminator — name of every supported style. Derived from the
|
|
@@ -216,5 +234,5 @@ export interface IUnknownStyle {
|
|
|
216
234
|
fields: Record<string, IContentField<unknown>>;
|
|
217
235
|
css?: string;
|
|
218
236
|
css_mobile?: string;
|
|
219
|
-
|
|
237
|
+
use_web_style?: IContentField<string>;
|
|
220
238
|
}
|
package/src/utils/spacing.ts
CHANGED
|
@@ -3,7 +3,7 @@ SPDX-FileCopyrightText: 2026 Humdek, University of Bern
|
|
|
3
3
|
SPDX-License-Identifier: MPL-2.0
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
|
-
* Parse the unified `
|
|
6
|
+
* Parse the unified `shared_spacing` field. The CMS
|
|
7
7
|
* stores this as a JSON string with optional keys for each side:
|
|
8
8
|
*
|
|
9
9
|
* { "mt": "md", "mb": "lg", "ms": "0", "me": "auto",
|