@selfhelp/shared 1.3.0 → 1.3.1
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 +341 -341
- package/LICENSE +381 -381
- package/README.md +57 -57
- package/package.json +102 -102
- package/src/api/__tests__/endpoints.test.ts +45 -45
- package/src/api/index.ts +5 -5
- package/src/assets/__tests__/resolveAssetUrl.test.ts +61 -61
- package/src/assets/index.ts +5 -5
- package/src/assets/resolveAssetUrl.ts +44 -44
- package/src/cms-classes/__tests__/classify.test.ts +63 -63
- package/src/cms-classes/allow-list.ts +158 -158
- package/src/cms-classes/classify.ts +90 -90
- package/src/cms-classes/index.ts +7 -7
- package/src/cms-classes/remap.ts +44 -44
- package/src/condition/__tests__/evaluate.test.ts +54 -54
- package/src/condition/evaluate.ts +121 -121
- package/src/condition/index.ts +5 -5
- package/src/index.ts +25 -25
- package/src/interpolation/__tests__/replaceCalcedValues.test.ts +41 -41
- package/src/interpolation/index.ts +5 -5
- package/src/interpolation/replaceCalcedValues.ts +27 -27
- package/src/plugin-sdk/define.ts +89 -89
- package/src/plugin-sdk/index.ts +103 -103
- package/src/plugin-sdk/lock.ts +124 -124
- package/src/plugin-sdk/manifest.ts +307 -307
- package/src/plugin-sdk/realtime.ts +277 -277
- package/src/plugin-sdk/registry.ts +105 -105
- package/src/plugin-sdk/runtime-shim.ts +140 -140
- package/src/plugin-sdk/types.ts +315 -315
- package/src/plugin-sdk/version.ts +209 -209
- package/src/registry/__tests__/registry.test.ts +135 -135
- package/src/registry/index.ts +94 -94
- package/src/registry/styles.registry.ts +295 -295
- package/src/testing/__tests__/testing-kit.test.ts +228 -228
- package/src/testing/index.ts +483 -483
- package/src/theme/index.ts +6 -6
- package/src/theme/tailwind.ts +73 -73
- package/src/theme/tokens.ts +177 -177
- package/src/types/api/envelope.ts +34 -34
- package/src/types/api/forms.ts +76 -76
- package/src/types/api/index.ts +9 -9
- package/src/types/api/language.ts +12 -12
- package/src/types/api/page.ts +9 -9
- package/src/types/index.ts +17 -17
- package/src/types/mantine/common.ts +142 -142
- package/src/types/pages.ts +107 -107
- package/src/types/styles/auth.ts +184 -184
- package/src/types/styles/base.ts +72 -72
- package/src/types/styles/composite.ts +131 -131
- package/src/types/styles/forms.ts +439 -439
- package/src/types/styles/interactive.ts +165 -165
- package/src/types/styles/layout.ts +184 -184
- package/src/types/styles/media.ts +68 -68
- package/src/types/styles/typography.ts +118 -118
- package/src/types/styles/unknown.ts +220 -220
- package/src/utils/__tests__/transformPageData.test.ts +69 -69
- package/src/utils/spacing.ts +64 -64
- package/src/utils/transformPageData.ts +99 -99
|
@@ -1,165 +1,165 @@
|
|
|
1
|
-
/*
|
|
2
|
-
SPDX-FileCopyrightText: 2026 Humdek, University of Bern
|
|
3
|
-
SPDX-License-Identifier: MPL-2.0
|
|
4
|
-
*/
|
|
5
|
-
import type { IBaseStyle, IContentField, IStyleWithSpacing } from './base';
|
|
6
|
-
import type {
|
|
7
|
-
TMantineSize,
|
|
8
|
-
TMantineColor,
|
|
9
|
-
TMantineRadius,
|
|
10
|
-
TMantineVariant,
|
|
11
|
-
TMantineBadgeVariant,
|
|
12
|
-
TMantineAvatarVariant,
|
|
13
|
-
TMantineChipVariant,
|
|
14
|
-
TMantineIndicatorPosition,
|
|
15
|
-
TMantineThemeIconVariant,
|
|
16
|
-
} from '../mantine/common';
|
|
17
|
-
import type { TMantineIconSize } from './typography';
|
|
18
|
-
|
|
19
|
-
export interface IButtonStyle extends IStyleWithSpacing {
|
|
20
|
-
style_name: 'button';
|
|
21
|
-
mantine_variant?: IContentField<TMantineVariant>;
|
|
22
|
-
mantine_color?: IContentField<TMantineColor>;
|
|
23
|
-
mantine_size?: IContentField<TMantineSize>;
|
|
24
|
-
mantine_radius?: IContentField<TMantineRadius>;
|
|
25
|
-
mantine_left_icon?: IContentField<string>;
|
|
26
|
-
mantine_right_icon?: IContentField<string>;
|
|
27
|
-
mantine_fullwidth?: IContentField<string>;
|
|
28
|
-
mantine_compact?: IContentField<string>;
|
|
29
|
-
mantine_auto_contrast?: IContentField<string>;
|
|
30
|
-
is_link?: IContentField<string>;
|
|
31
|
-
use_mantine_style?: IContentField<string>;
|
|
32
|
-
disabled?: IContentField<string>;
|
|
33
|
-
open_in_new_tab?: IContentField<string>;
|
|
34
|
-
page_keyword?: IContentField<string>;
|
|
35
|
-
url?: IContentField<string>;
|
|
36
|
-
label?: IContentField<string>;
|
|
37
|
-
label_cancel?: IContentField<string>;
|
|
38
|
-
confirmation_title?: IContentField<string>;
|
|
39
|
-
confirmation_continue?: IContentField<string>;
|
|
40
|
-
confirmation_message?: IContentField<string>;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface ILinkStyle extends IStyleWithSpacing {
|
|
44
|
-
style_name: 'link';
|
|
45
|
-
label?: IContentField<string>;
|
|
46
|
-
url?: IContentField<string>;
|
|
47
|
-
open_in_new_tab?: IContentField<string>;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export interface IActionIconStyle extends IStyleWithSpacing {
|
|
51
|
-
style_name: 'action-icon';
|
|
52
|
-
mantine_variant?: IContentField<TMantineVariant>;
|
|
53
|
-
mantine_action_icon_loading?: IContentField<string>;
|
|
54
|
-
mantine_size?: IContentField<TMantineSize>;
|
|
55
|
-
mantine_radius?: IContentField<TMantineRadius>;
|
|
56
|
-
mantine_color?: IContentField<TMantineColor>;
|
|
57
|
-
mantine_left_icon?: IContentField<string>;
|
|
58
|
-
is_link?: IContentField<string>;
|
|
59
|
-
page_keyword?: IContentField<string>;
|
|
60
|
-
open_in_new_tab?: IContentField<string>;
|
|
61
|
-
disabled?: IContentField<string>;
|
|
62
|
-
use_mantine_style?: IContentField<string>;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export interface IAlertStyle extends IStyleWithSpacing {
|
|
66
|
-
style_name: 'alert';
|
|
67
|
-
mantine_alert_title?: IContentField<string>;
|
|
68
|
-
close_button_label?: IContentField<string>;
|
|
69
|
-
mantine_variant?: IContentField<TMantineVariant>;
|
|
70
|
-
mantine_color?: IContentField<TMantineColor>;
|
|
71
|
-
mantine_radius?: IContentField<TMantineRadius>;
|
|
72
|
-
mantine_left_icon?: IContentField<string>;
|
|
73
|
-
mantine_with_close_button?: IContentField<string>;
|
|
74
|
-
content?: IContentField<string>;
|
|
75
|
-
use_mantine_style?: IContentField<string>;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export interface IBadgeStyle extends IStyleWithSpacing {
|
|
79
|
-
style_name: 'badge';
|
|
80
|
-
label?: IContentField<string>;
|
|
81
|
-
mantine_variant?: IContentField<TMantineBadgeVariant>;
|
|
82
|
-
mantine_size?: IContentField<TMantineSize>;
|
|
83
|
-
mantine_left_icon?: IContentField<string>;
|
|
84
|
-
mantine_radius?: IContentField<TMantineRadius>;
|
|
85
|
-
mantine_color?: IContentField<TMantineColor>;
|
|
86
|
-
use_mantine_style?: IContentField<string>;
|
|
87
|
-
mantine_right_icon?: IContentField<string>;
|
|
88
|
-
mantine_auto_contrast?: IContentField<string>;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export interface IAvatarStyle extends IStyleWithSpacing {
|
|
92
|
-
style_name: 'avatar';
|
|
93
|
-
alt?: IContentField<string>;
|
|
94
|
-
mantine_avatar_variant?: IContentField<TMantineAvatarVariant>;
|
|
95
|
-
mantine_size?: IContentField<TMantineSize>;
|
|
96
|
-
mantine_radius?: IContentField<TMantineRadius>;
|
|
97
|
-
mantine_color?: IContentField<TMantineColor>;
|
|
98
|
-
use_mantine_style?: IContentField<string>;
|
|
99
|
-
mantine_left_icon?: IContentField<string>;
|
|
100
|
-
mantine_avatar_initials?: IContentField<string>;
|
|
101
|
-
img_src?: IContentField<string>;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export interface IChipStyle extends IStyleWithSpacing {
|
|
105
|
-
style_name: 'chip';
|
|
106
|
-
label?: IContentField<string>;
|
|
107
|
-
mantine_chip_variant?: IContentField<TMantineChipVariant>;
|
|
108
|
-
mantine_size?: IContentField<TMantineSize>;
|
|
109
|
-
mantine_radius?: IContentField<TMantineRadius>;
|
|
110
|
-
mantine_color?: IContentField<TMantineColor>;
|
|
111
|
-
mantine_chip_checked?: IContentField<string>;
|
|
112
|
-
mantine_chip_multiple?: IContentField<string>;
|
|
113
|
-
disabled?: IContentField<string>;
|
|
114
|
-
use_mantine_style?: IContentField<string>;
|
|
115
|
-
mantine_left_icon?: IContentField<string>;
|
|
116
|
-
mantine_icon_size?: IContentField<TMantineIconSize>;
|
|
117
|
-
name?: IContentField<string>;
|
|
118
|
-
value?: IContentField<string>;
|
|
119
|
-
mantine_chip_on_value?: IContentField<string>;
|
|
120
|
-
mantine_chip_off_value?: IContentField<string>;
|
|
121
|
-
is_required?: IContentField<string>;
|
|
122
|
-
tooltip?: IContentField<string>;
|
|
123
|
-
mantine_tooltip_position?: IContentField<string>;
|
|
124
|
-
chip_on_value?: IContentField<string>;
|
|
125
|
-
chip_off_value?: IContentField<string>;
|
|
126
|
-
chip_checked?: IContentField<string>;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export interface IIndicatorStyle extends IBaseStyle {
|
|
130
|
-
style_name: 'indicator';
|
|
131
|
-
mantine_indicator_processing?: IContentField<string>;
|
|
132
|
-
mantine_indicator_disabled?: IContentField<string>;
|
|
133
|
-
mantine_indicator_size?: IContentField<string>;
|
|
134
|
-
mantine_indicator_position?: IContentField<TMantineIndicatorPosition>;
|
|
135
|
-
label?: IContentField<string>;
|
|
136
|
-
mantine_indicator_inline?: IContentField<string>;
|
|
137
|
-
mantine_indicator_offset?: IContentField<string>;
|
|
138
|
-
mantine_border?: IContentField<string>;
|
|
139
|
-
mantine_radius?: IContentField<TMantineRadius>;
|
|
140
|
-
mantine_color?: IContentField<TMantineColor>;
|
|
141
|
-
use_mantine_style?: IContentField<string>;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
export interface IThemeIconStyle extends IStyleWithSpacing {
|
|
145
|
-
style_name: 'theme-icon';
|
|
146
|
-
mantine_variant?: IContentField<TMantineThemeIconVariant>;
|
|
147
|
-
mantine_size?: IContentField<TMantineSize>;
|
|
148
|
-
mantine_radius?: IContentField<TMantineRadius>;
|
|
149
|
-
mantine_color?: IContentField<TMantineColor>;
|
|
150
|
-
use_mantine_style?: IContentField<string>;
|
|
151
|
-
mantine_left_icon?: IContentField<string>;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
export interface INotificationStyle extends IStyleWithSpacing {
|
|
155
|
-
style_name: 'notification';
|
|
156
|
-
title?: IContentField<string>;
|
|
157
|
-
content?: IContentField<string>;
|
|
158
|
-
mantine_left_icon?: IContentField<string>;
|
|
159
|
-
mantine_color?: IContentField<TMantineColor>;
|
|
160
|
-
mantine_notification_loading?: IContentField<string>;
|
|
161
|
-
mantine_notification_with_close_button?: IContentField<string>;
|
|
162
|
-
mantine_border?: IContentField<string>;
|
|
163
|
-
mantine_radius?: IContentField<TMantineRadius>;
|
|
164
|
-
use_mantine_style?: IContentField<string>;
|
|
165
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
SPDX-FileCopyrightText: 2026 Humdek, University of Bern
|
|
3
|
+
SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
import type { IBaseStyle, IContentField, IStyleWithSpacing } from './base';
|
|
6
|
+
import type {
|
|
7
|
+
TMantineSize,
|
|
8
|
+
TMantineColor,
|
|
9
|
+
TMantineRadius,
|
|
10
|
+
TMantineVariant,
|
|
11
|
+
TMantineBadgeVariant,
|
|
12
|
+
TMantineAvatarVariant,
|
|
13
|
+
TMantineChipVariant,
|
|
14
|
+
TMantineIndicatorPosition,
|
|
15
|
+
TMantineThemeIconVariant,
|
|
16
|
+
} from '../mantine/common';
|
|
17
|
+
import type { TMantineIconSize } from './typography';
|
|
18
|
+
|
|
19
|
+
export interface IButtonStyle extends IStyleWithSpacing {
|
|
20
|
+
style_name: 'button';
|
|
21
|
+
mantine_variant?: IContentField<TMantineVariant>;
|
|
22
|
+
mantine_color?: IContentField<TMantineColor>;
|
|
23
|
+
mantine_size?: IContentField<TMantineSize>;
|
|
24
|
+
mantine_radius?: IContentField<TMantineRadius>;
|
|
25
|
+
mantine_left_icon?: IContentField<string>;
|
|
26
|
+
mantine_right_icon?: IContentField<string>;
|
|
27
|
+
mantine_fullwidth?: IContentField<string>;
|
|
28
|
+
mantine_compact?: IContentField<string>;
|
|
29
|
+
mantine_auto_contrast?: IContentField<string>;
|
|
30
|
+
is_link?: IContentField<string>;
|
|
31
|
+
use_mantine_style?: IContentField<string>;
|
|
32
|
+
disabled?: IContentField<string>;
|
|
33
|
+
open_in_new_tab?: IContentField<string>;
|
|
34
|
+
page_keyword?: IContentField<string>;
|
|
35
|
+
url?: IContentField<string>;
|
|
36
|
+
label?: IContentField<string>;
|
|
37
|
+
label_cancel?: IContentField<string>;
|
|
38
|
+
confirmation_title?: IContentField<string>;
|
|
39
|
+
confirmation_continue?: IContentField<string>;
|
|
40
|
+
confirmation_message?: IContentField<string>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface ILinkStyle extends IStyleWithSpacing {
|
|
44
|
+
style_name: 'link';
|
|
45
|
+
label?: IContentField<string>;
|
|
46
|
+
url?: IContentField<string>;
|
|
47
|
+
open_in_new_tab?: IContentField<string>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface IActionIconStyle extends IStyleWithSpacing {
|
|
51
|
+
style_name: 'action-icon';
|
|
52
|
+
mantine_variant?: IContentField<TMantineVariant>;
|
|
53
|
+
mantine_action_icon_loading?: IContentField<string>;
|
|
54
|
+
mantine_size?: IContentField<TMantineSize>;
|
|
55
|
+
mantine_radius?: IContentField<TMantineRadius>;
|
|
56
|
+
mantine_color?: IContentField<TMantineColor>;
|
|
57
|
+
mantine_left_icon?: IContentField<string>;
|
|
58
|
+
is_link?: IContentField<string>;
|
|
59
|
+
page_keyword?: IContentField<string>;
|
|
60
|
+
open_in_new_tab?: IContentField<string>;
|
|
61
|
+
disabled?: IContentField<string>;
|
|
62
|
+
use_mantine_style?: IContentField<string>;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface IAlertStyle extends IStyleWithSpacing {
|
|
66
|
+
style_name: 'alert';
|
|
67
|
+
mantine_alert_title?: IContentField<string>;
|
|
68
|
+
close_button_label?: IContentField<string>;
|
|
69
|
+
mantine_variant?: IContentField<TMantineVariant>;
|
|
70
|
+
mantine_color?: IContentField<TMantineColor>;
|
|
71
|
+
mantine_radius?: IContentField<TMantineRadius>;
|
|
72
|
+
mantine_left_icon?: IContentField<string>;
|
|
73
|
+
mantine_with_close_button?: IContentField<string>;
|
|
74
|
+
content?: IContentField<string>;
|
|
75
|
+
use_mantine_style?: IContentField<string>;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface IBadgeStyle extends IStyleWithSpacing {
|
|
79
|
+
style_name: 'badge';
|
|
80
|
+
label?: IContentField<string>;
|
|
81
|
+
mantine_variant?: IContentField<TMantineBadgeVariant>;
|
|
82
|
+
mantine_size?: IContentField<TMantineSize>;
|
|
83
|
+
mantine_left_icon?: IContentField<string>;
|
|
84
|
+
mantine_radius?: IContentField<TMantineRadius>;
|
|
85
|
+
mantine_color?: IContentField<TMantineColor>;
|
|
86
|
+
use_mantine_style?: IContentField<string>;
|
|
87
|
+
mantine_right_icon?: IContentField<string>;
|
|
88
|
+
mantine_auto_contrast?: IContentField<string>;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface IAvatarStyle extends IStyleWithSpacing {
|
|
92
|
+
style_name: 'avatar';
|
|
93
|
+
alt?: IContentField<string>;
|
|
94
|
+
mantine_avatar_variant?: IContentField<TMantineAvatarVariant>;
|
|
95
|
+
mantine_size?: IContentField<TMantineSize>;
|
|
96
|
+
mantine_radius?: IContentField<TMantineRadius>;
|
|
97
|
+
mantine_color?: IContentField<TMantineColor>;
|
|
98
|
+
use_mantine_style?: IContentField<string>;
|
|
99
|
+
mantine_left_icon?: IContentField<string>;
|
|
100
|
+
mantine_avatar_initials?: IContentField<string>;
|
|
101
|
+
img_src?: IContentField<string>;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface IChipStyle extends IStyleWithSpacing {
|
|
105
|
+
style_name: 'chip';
|
|
106
|
+
label?: IContentField<string>;
|
|
107
|
+
mantine_chip_variant?: IContentField<TMantineChipVariant>;
|
|
108
|
+
mantine_size?: IContentField<TMantineSize>;
|
|
109
|
+
mantine_radius?: IContentField<TMantineRadius>;
|
|
110
|
+
mantine_color?: IContentField<TMantineColor>;
|
|
111
|
+
mantine_chip_checked?: IContentField<string>;
|
|
112
|
+
mantine_chip_multiple?: IContentField<string>;
|
|
113
|
+
disabled?: IContentField<string>;
|
|
114
|
+
use_mantine_style?: IContentField<string>;
|
|
115
|
+
mantine_left_icon?: IContentField<string>;
|
|
116
|
+
mantine_icon_size?: IContentField<TMantineIconSize>;
|
|
117
|
+
name?: IContentField<string>;
|
|
118
|
+
value?: IContentField<string>;
|
|
119
|
+
mantine_chip_on_value?: IContentField<string>;
|
|
120
|
+
mantine_chip_off_value?: IContentField<string>;
|
|
121
|
+
is_required?: IContentField<string>;
|
|
122
|
+
tooltip?: IContentField<string>;
|
|
123
|
+
mantine_tooltip_position?: IContentField<string>;
|
|
124
|
+
chip_on_value?: IContentField<string>;
|
|
125
|
+
chip_off_value?: IContentField<string>;
|
|
126
|
+
chip_checked?: IContentField<string>;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export interface IIndicatorStyle extends IBaseStyle {
|
|
130
|
+
style_name: 'indicator';
|
|
131
|
+
mantine_indicator_processing?: IContentField<string>;
|
|
132
|
+
mantine_indicator_disabled?: IContentField<string>;
|
|
133
|
+
mantine_indicator_size?: IContentField<string>;
|
|
134
|
+
mantine_indicator_position?: IContentField<TMantineIndicatorPosition>;
|
|
135
|
+
label?: IContentField<string>;
|
|
136
|
+
mantine_indicator_inline?: IContentField<string>;
|
|
137
|
+
mantine_indicator_offset?: IContentField<string>;
|
|
138
|
+
mantine_border?: IContentField<string>;
|
|
139
|
+
mantine_radius?: IContentField<TMantineRadius>;
|
|
140
|
+
mantine_color?: IContentField<TMantineColor>;
|
|
141
|
+
use_mantine_style?: IContentField<string>;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface IThemeIconStyle extends IStyleWithSpacing {
|
|
145
|
+
style_name: 'theme-icon';
|
|
146
|
+
mantine_variant?: IContentField<TMantineThemeIconVariant>;
|
|
147
|
+
mantine_size?: IContentField<TMantineSize>;
|
|
148
|
+
mantine_radius?: IContentField<TMantineRadius>;
|
|
149
|
+
mantine_color?: IContentField<TMantineColor>;
|
|
150
|
+
use_mantine_style?: IContentField<string>;
|
|
151
|
+
mantine_left_icon?: IContentField<string>;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export interface INotificationStyle extends IStyleWithSpacing {
|
|
155
|
+
style_name: 'notification';
|
|
156
|
+
title?: IContentField<string>;
|
|
157
|
+
content?: IContentField<string>;
|
|
158
|
+
mantine_left_icon?: IContentField<string>;
|
|
159
|
+
mantine_color?: IContentField<TMantineColor>;
|
|
160
|
+
mantine_notification_loading?: IContentField<string>;
|
|
161
|
+
mantine_notification_with_close_button?: IContentField<string>;
|
|
162
|
+
mantine_border?: IContentField<string>;
|
|
163
|
+
mantine_radius?: IContentField<TMantineRadius>;
|
|
164
|
+
use_mantine_style?: IContentField<string>;
|
|
165
|
+
}
|