@selfhelp/shared 1.14.23 → 1.15.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 +67 -0
- package/dist/{common-udJ0O8qC.d.mts → common-qaDIAYS3.d.mts} +5 -4
- package/dist/{common-udJ0O8qC.d.ts → common-qaDIAYS3.d.ts} +5 -4
- package/dist/index.d.mts +121 -5
- package/dist/index.d.ts +121 -5
- package/dist/index.js +105 -170
- package/dist/index.mjs +104 -167
- package/dist/{manifest-C8sBTLJb.d.mts → manifest-8YXAk-4o.d.mts} +8 -0
- package/dist/{manifest-C8sBTLJb.d.ts → manifest-8YXAk-4o.d.ts} +8 -0
- package/dist/plugin-sdk/index.d.mts +41 -4
- package/dist/plugin-sdk/index.d.ts +41 -4
- package/dist/plugin-sdk/index.js +103 -91
- package/dist/plugin-sdk/index.mjs +101 -91
- package/dist/registry/index.d.mts +3 -3
- package/dist/registry/index.d.ts +3 -3
- package/dist/registry/index.js +90 -90
- package/dist/registry/index.mjs +90 -90
- package/dist/{styles.registry-CZZwODJY.d.mts → styles.registry-4W0LzmZB.d.mts} +2 -189
- package/dist/{styles.registry-DQKcvIBZ.d.ts → styles.registry-D6xMm5VR.d.ts} +2 -189
- package/dist/testing/index.d.mts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/theme/index.d.mts +27 -76
- package/dist/theme/index.d.ts +27 -76
- package/dist/theme/index.js +4 -80
- package/dist/theme/index.mjs +4 -77
- package/package.json +1 -1
- package/src/plugin-sdk/__tests__/version.test.ts +40 -0
- package/src/plugin-sdk/define.ts +0 -1
- package/src/plugin-sdk/index.ts +2 -0
- package/src/plugin-sdk/manifest.ts +8 -0
- package/src/plugin-sdk/registry.ts +11 -0
- package/src/plugin-sdk/version.ts +38 -0
- package/src/registry/__tests__/platform.test.ts +0 -4
- package/src/registry/__tests__/registry.test.ts +0 -2
- package/src/registry/styles.registry.ts +90 -96
- package/src/theme/__tests__/mantineVariant.test.ts +2 -2
- package/src/theme/__tests__/semantic.test.ts +16 -53
- package/src/theme/mantineVariant.ts +3 -3
- package/src/theme/semantic.ts +24 -164
- package/src/theme/tokens.ts +2 -2
- package/src/types/__tests__/distribution.test.ts +55 -1
- package/src/types/api/index.ts +1 -0
- package/src/types/api/mobile-preview.ts +71 -0
- package/src/types/distribution.ts +54 -1
- package/src/types/mantine/common.ts +4 -3
- package/src/types/styles/base.ts +1 -1
- package/src/types/styles/composite.ts +0 -2
package/dist/index.js
CHANGED
|
@@ -47,6 +47,7 @@ __export(index_exports, {
|
|
|
47
47
|
HEADER_CLIENT_TYPE: () => HEADER_CLIENT_TYPE,
|
|
48
48
|
LINE_HEIGHT: () => LINE_HEIGHT,
|
|
49
49
|
LITERAL_CLASSES: () => LITERAL_CLASSES,
|
|
50
|
+
MOBILE_PREVIEW_ENDPOINTS: () => MOBILE_PREVIEW_ENDPOINTS,
|
|
50
51
|
PERMISSIONS: () => PERMISSIONS,
|
|
51
52
|
RADIUS_PX: () => RADIUS_PX,
|
|
52
53
|
RELEASE_CHANNELS: () => RELEASE_CHANNELS,
|
|
@@ -81,9 +82,6 @@ __export(index_exports, {
|
|
|
81
82
|
mapAccordionVariantToHeroUiVariant: () => mapAccordionVariantToHeroUiVariant,
|
|
82
83
|
mapChipVariantToHeroUiVariant: () => mapChipVariantToHeroUiVariant,
|
|
83
84
|
mapDividerVariantToReactNative: () => mapDividerVariantToReactNative,
|
|
84
|
-
mapIntentToHeroUiButtonVariant: () => mapIntentToHeroUiButtonVariant,
|
|
85
|
-
mapIntentToHeroUiColor: () => mapIntentToHeroUiColor,
|
|
86
|
-
mapIntentToMantine: () => mapIntentToMantine,
|
|
87
85
|
mapMantineColorToHeroUiButtonVariant: () => mapMantineColorToHeroUiButtonVariant,
|
|
88
86
|
mapMantineColorToHeroUiColor: () => mapMantineColorToHeroUiColor,
|
|
89
87
|
mapMantineVariantToHeroUiButtonVariant: () => mapMantineVariantToHeroUiButtonVariant,
|
|
@@ -194,109 +192,118 @@ var SYSTEM_ENDPOINTS = {
|
|
|
194
192
|
UPDATE_FRONTEND_REQUEST: `${SYSTEM_PREFIX}/update/frontend/request`
|
|
195
193
|
};
|
|
196
194
|
|
|
195
|
+
// src/types/api/mobile-preview.ts
|
|
196
|
+
var MOBILE_PREVIEW_PREFIX = "/cms-api/v1";
|
|
197
|
+
var MOBILE_PREVIEW_ENDPOINTS = {
|
|
198
|
+
/** Admin-only: mint a one-time preview session code. */
|
|
199
|
+
SESSION: `${MOBILE_PREVIEW_PREFIX}/admin/mobile-preview/session`,
|
|
200
|
+
/** Public: exchange a one-time code for a scoped preview JWT. */
|
|
201
|
+
EXCHANGE: `${MOBILE_PREVIEW_PREFIX}/mobile-preview/session/exchange`
|
|
202
|
+
};
|
|
203
|
+
|
|
197
204
|
// src/types/distribution.ts
|
|
198
205
|
var RELEASE_CHANNELS = ["stable", "beta", "nightly", "test"];
|
|
199
206
|
|
|
200
207
|
// src/registry/styles.registry.ts
|
|
201
208
|
var BASE_STYLE_REGISTRY = {
|
|
202
209
|
// ===== auth =====
|
|
203
|
-
login: { description: "User login form", category: "auth",
|
|
204
|
-
register: { description: "User registration form", category: "auth",
|
|
205
|
-
validate: { description: "Email/account validation flow", category: "auth",
|
|
206
|
-
"reset-password": { description: "Reset password form", category: "auth",
|
|
207
|
-
"two-factor-auth": { description: "Two-factor auth code form", category: "auth",
|
|
208
|
-
profile: { description: "User profile management", category: "auth",
|
|
210
|
+
login: { description: "User login form", category: "auth", canHaveChildren: false },
|
|
211
|
+
register: { description: "User registration form", category: "auth", canHaveChildren: false },
|
|
212
|
+
validate: { description: "Email/account validation flow", category: "auth", canHaveChildren: true },
|
|
213
|
+
"reset-password": { description: "Reset password form", category: "auth", canHaveChildren: false },
|
|
214
|
+
"two-factor-auth": { description: "Two-factor auth code form", category: "auth", canHaveChildren: false },
|
|
215
|
+
profile: { description: "User profile management", category: "auth", canHaveChildren: false },
|
|
209
216
|
// ===== layout =====
|
|
210
|
-
container: { description: "Mantine Container with responsive max-width", category: "layout",
|
|
211
|
-
box: { description: "Generic Mantine Box wrapper", category: "layout",
|
|
212
|
-
flex: { description: "Mantine Flex layout", category: "layout",
|
|
213
|
-
group: { description: "Mantine Group horizontal layout", category: "layout",
|
|
214
|
-
stack: { description: "Mantine Stack vertical layout", category: "layout",
|
|
215
|
-
"simple-grid": { description: "Mantine SimpleGrid", category: "layout",
|
|
216
|
-
grid: { description: "Mantine Grid", category: "layout",
|
|
217
|
-
"grid-column": { description: "Mantine Grid.Col", category: "layout",
|
|
218
|
-
space: { description: "Mantine Space spacer", category: "layout",
|
|
219
|
-
divider: { description: "Mantine Divider", category: "layout",
|
|
220
|
-
paper: { description: "Mantine Paper surface", category: "layout",
|
|
221
|
-
center: { description: "Mantine Center alignment", category: "layout",
|
|
222
|
-
"scroll-area": { description: "Mantine ScrollArea", category: "layout",
|
|
223
|
-
card: { description: "Mantine Card", category: "layout",
|
|
224
|
-
"card-segment": { description: "Mantine Card.Section", category: "layout",
|
|
225
|
-
"aspect-ratio": { description: "Mantine AspectRatio wrapper", category: "layout",
|
|
226
|
-
"background-image": { description: "Mantine BackgroundImage", category: "layout",
|
|
217
|
+
container: { description: "Mantine Container with responsive max-width", category: "layout", canHaveChildren: true },
|
|
218
|
+
box: { description: "Generic Mantine Box wrapper", category: "layout", canHaveChildren: true },
|
|
219
|
+
flex: { description: "Mantine Flex layout", category: "layout", canHaveChildren: true },
|
|
220
|
+
group: { description: "Mantine Group horizontal layout", category: "layout", canHaveChildren: true },
|
|
221
|
+
stack: { description: "Mantine Stack vertical layout", category: "layout", canHaveChildren: true },
|
|
222
|
+
"simple-grid": { description: "Mantine SimpleGrid", category: "layout", canHaveChildren: true },
|
|
223
|
+
grid: { description: "Mantine Grid", category: "layout", canHaveChildren: true },
|
|
224
|
+
"grid-column": { description: "Mantine Grid.Col", category: "layout", canHaveChildren: true },
|
|
225
|
+
space: { description: "Mantine Space spacer", category: "layout", canHaveChildren: false },
|
|
226
|
+
divider: { description: "Mantine Divider", category: "layout", canHaveChildren: false },
|
|
227
|
+
paper: { description: "Mantine Paper surface", category: "layout", canHaveChildren: true },
|
|
228
|
+
center: { description: "Mantine Center alignment", category: "layout", canHaveChildren: true },
|
|
229
|
+
"scroll-area": { description: "Mantine ScrollArea", category: "layout", canHaveChildren: true },
|
|
230
|
+
card: { description: "Mantine Card", category: "layout", canHaveChildren: true },
|
|
231
|
+
"card-segment": { description: "Mantine Card.Section", category: "layout", canHaveChildren: true },
|
|
232
|
+
"aspect-ratio": { description: "Mantine AspectRatio wrapper", category: "layout", canHaveChildren: true },
|
|
233
|
+
"background-image": { description: "Mantine BackgroundImage", category: "layout", canHaveChildren: true },
|
|
227
234
|
// ===== typography =====
|
|
228
|
-
title: { description: "Mantine Title", category: "typography",
|
|
229
|
-
text: { description: "Mantine Text", category: "typography",
|
|
230
|
-
code: { description: "Mantine Code (inline / block)", category: "typography",
|
|
231
|
-
highlight: { description: "Mantine Highlight", category: "typography",
|
|
232
|
-
blockquote: { description: "Mantine Blockquote", category: "typography",
|
|
233
|
-
"html-tag": { description: "Generic HTML tag wrapper (web), maps to View on RN", category: "typography",
|
|
234
|
-
kbd: { description: "Mantine Kbd", category: "typography",
|
|
235
|
-
typography: { description: "Mantine Typography wrapper", category: "typography",
|
|
236
|
-
fieldset: { description: "Mantine Fieldset", category: "typography",
|
|
237
|
-
spoiler: { description: "Mantine Spoiler reveal", category: "typography",
|
|
235
|
+
title: { description: "Mantine Title", category: "typography", canHaveChildren: false },
|
|
236
|
+
text: { description: "Mantine Text", category: "typography", canHaveChildren: false },
|
|
237
|
+
code: { description: "Mantine Code (inline / block)", category: "typography", canHaveChildren: false },
|
|
238
|
+
highlight: { description: "Mantine Highlight", category: "typography", canHaveChildren: false },
|
|
239
|
+
blockquote: { description: "Mantine Blockquote", category: "typography", canHaveChildren: false },
|
|
240
|
+
"html-tag": { description: "Generic HTML tag wrapper (web), maps to View on RN", category: "typography", canHaveChildren: true },
|
|
241
|
+
kbd: { description: "Mantine Kbd", category: "typography", canHaveChildren: false },
|
|
242
|
+
typography: { description: "Mantine Typography wrapper", category: "typography", canHaveChildren: true },
|
|
243
|
+
fieldset: { description: "Mantine Fieldset", category: "typography", canHaveChildren: true },
|
|
244
|
+
spoiler: { description: "Mantine Spoiler reveal", category: "typography", canHaveChildren: true },
|
|
238
245
|
// ===== media =====
|
|
239
|
-
image: { description: "Mantine Image / RN Image", category: "media",
|
|
240
|
-
video: { description: "HTML5 video / expo-video", category: "media",
|
|
241
|
-
audio: { description: "HTML5 audio / expo-audio", category: "media",
|
|
242
|
-
figure: { description: "Figure with caption", category: "media",
|
|
243
|
-
carousel: { description: "Embla on web, reanimated-carousel on RN", category: "media",
|
|
246
|
+
image: { description: "Mantine Image / RN Image", category: "media", canHaveChildren: false },
|
|
247
|
+
video: { description: "HTML5 video / expo-video", category: "media", canHaveChildren: false },
|
|
248
|
+
audio: { description: "HTML5 audio / expo-audio", category: "media", canHaveChildren: false },
|
|
249
|
+
figure: { description: "Figure with caption", category: "media", canHaveChildren: true },
|
|
250
|
+
carousel: { description: "Embla on web, reanimated-carousel on RN", category: "media", canHaveChildren: true },
|
|
244
251
|
// ===== interactive =====
|
|
245
|
-
button: { description: "Mantine Button / HeroUI Button", category: "interactive",
|
|
246
|
-
link: { description: "Anchor / Pressable navigation", category: "interactive",
|
|
247
|
-
"action-icon": { description: "Mantine ActionIcon", category: "interactive",
|
|
248
|
-
alert: { description: "Mantine Alert", category: "interactive",
|
|
249
|
-
badge: { description: "Mantine Badge", category: "interactive",
|
|
250
|
-
avatar: { description: "Mantine Avatar", category: "interactive",
|
|
251
|
-
chip: { description: "Mantine Chip", category: "interactive",
|
|
252
|
-
indicator: { description: "Mantine Indicator dot", category: "interactive",
|
|
253
|
-
"theme-icon": { description: "Mantine ThemeIcon", category: "interactive",
|
|
254
|
-
notification: { description: "Mantine Notification", category: "interactive",
|
|
252
|
+
button: { description: "Mantine Button / HeroUI Button", category: "interactive", canHaveChildren: false },
|
|
253
|
+
link: { description: "Anchor / Pressable navigation", category: "interactive", canHaveChildren: false },
|
|
254
|
+
"action-icon": { description: "Mantine ActionIcon", category: "interactive", canHaveChildren: false },
|
|
255
|
+
alert: { description: "Mantine Alert", category: "interactive", canHaveChildren: true },
|
|
256
|
+
badge: { description: "Mantine Badge", category: "interactive", canHaveChildren: false },
|
|
257
|
+
avatar: { description: "Mantine Avatar", category: "interactive", canHaveChildren: false },
|
|
258
|
+
chip: { description: "Mantine Chip", category: "interactive", canHaveChildren: false },
|
|
259
|
+
indicator: { description: "Mantine Indicator dot", category: "interactive", canHaveChildren: true },
|
|
260
|
+
"theme-icon": { description: "Mantine ThemeIcon", category: "interactive", canHaveChildren: false },
|
|
261
|
+
notification: { description: "Mantine Notification", category: "interactive", canHaveChildren: false },
|
|
255
262
|
// ===== forms =====
|
|
256
|
-
"form-log": { description: "Append-only form (one row per submit)", category: "forms",
|
|
257
|
-
"form-record": { description: "Per-user record form", category: "forms",
|
|
258
|
-
input: { description: "Plain HTML input", category: "forms",
|
|
259
|
-
"text-input": { description: "Mantine TextInput", category: "forms",
|
|
260
|
-
textarea: { description: "Mantine Textarea", category: "forms",
|
|
261
|
-
"rich-text-editor": { description: "Tiptap editor on web; native inline-format toolbar editor on mobile", category: "forms",
|
|
262
|
-
select: { description: "HTML select / Mantine Select", category: "forms",
|
|
263
|
-
radio: { description: "Mantine Radio / RadioGroup", category: "forms",
|
|
264
|
-
checkbox: { description: "Mantine Checkbox", category: "forms",
|
|
265
|
-
slider: { description: "Mantine Slider", category: "forms",
|
|
266
|
-
"range-slider": { description: "Mantine RangeSlider", category: "forms",
|
|
267
|
-
datepicker: { description: "Mantine DatePicker", category: "forms",
|
|
268
|
-
switch: { description: "Mantine Switch", category: "forms",
|
|
269
|
-
combobox: { description: "Mantine Combobox", category: "forms",
|
|
270
|
-
"color-input": { description: "Mantine ColorInput", category: "forms",
|
|
271
|
-
"color-picker": { description: "Mantine ColorPicker", category: "forms",
|
|
272
|
-
"file-input": { description: "Mantine FileInput / DocumentPicker on RN", category: "forms",
|
|
273
|
-
"number-input": { description: "Mantine NumberInput", category: "forms",
|
|
274
|
-
"segmented-control": { description: "Mantine SegmentedControl", category: "forms",
|
|
275
|
-
rating: { description: "Mantine Rating", category: "forms",
|
|
276
|
-
progress: { description: "Mantine Progress", category: "forms",
|
|
277
|
-
"progress-root": { description: "Mantine Progress.Root", category: "forms",
|
|
278
|
-
"progress-section": { description: "Mantine Progress.Section", category: "forms",
|
|
263
|
+
"form-log": { description: "Append-only form (one row per submit)", category: "forms", canHaveChildren: true },
|
|
264
|
+
"form-record": { description: "Per-user record form", category: "forms", canHaveChildren: true },
|
|
265
|
+
input: { description: "Plain HTML input", category: "forms", canHaveChildren: false },
|
|
266
|
+
"text-input": { description: "Mantine TextInput", category: "forms", canHaveChildren: false },
|
|
267
|
+
textarea: { description: "Mantine Textarea", category: "forms", canHaveChildren: false },
|
|
268
|
+
"rich-text-editor": { description: "Tiptap editor on web; native inline-format toolbar editor on mobile", category: "forms", canHaveChildren: false },
|
|
269
|
+
select: { description: "HTML select / Mantine Select", category: "forms", canHaveChildren: false },
|
|
270
|
+
radio: { description: "Mantine Radio / RadioGroup", category: "forms", canHaveChildren: false },
|
|
271
|
+
checkbox: { description: "Mantine Checkbox", category: "forms", canHaveChildren: false },
|
|
272
|
+
slider: { description: "Mantine Slider", category: "forms", canHaveChildren: false },
|
|
273
|
+
"range-slider": { description: "Mantine RangeSlider", category: "forms", canHaveChildren: false },
|
|
274
|
+
datepicker: { description: "Mantine DatePicker", category: "forms", canHaveChildren: false },
|
|
275
|
+
switch: { description: "Mantine Switch", category: "forms", canHaveChildren: false },
|
|
276
|
+
combobox: { description: "Mantine Combobox", category: "forms", canHaveChildren: false },
|
|
277
|
+
"color-input": { description: "Mantine ColorInput", category: "forms", canHaveChildren: false },
|
|
278
|
+
"color-picker": { description: "Mantine ColorPicker", category: "forms", canHaveChildren: false },
|
|
279
|
+
"file-input": { description: "Mantine FileInput / DocumentPicker on RN", category: "forms", canHaveChildren: false },
|
|
280
|
+
"number-input": { description: "Mantine NumberInput", category: "forms", canHaveChildren: false },
|
|
281
|
+
"segmented-control": { description: "Mantine SegmentedControl", category: "forms", canHaveChildren: false },
|
|
282
|
+
rating: { description: "Mantine Rating", category: "forms", canHaveChildren: false },
|
|
283
|
+
progress: { description: "Mantine Progress", category: "forms", canHaveChildren: false },
|
|
284
|
+
"progress-root": { description: "Mantine Progress.Root", category: "forms", canHaveChildren: true },
|
|
285
|
+
"progress-section": { description: "Mantine Progress.Section", category: "forms", canHaveChildren: false },
|
|
279
286
|
// ===== composite =====
|
|
280
|
-
accordion: { description: "Mantine Accordion", category: "composite",
|
|
281
|
-
"accordion-item": { description: "Mantine Accordion.Item", category: "composite",
|
|
282
|
-
tabs: { description: "Mantine Tabs", category: "composite",
|
|
283
|
-
tab: { description: "Mantine Tabs.Tab + Tabs.Panel pair", category: "composite",
|
|
284
|
-
timeline: { description: "Mantine Timeline", category: "composite",
|
|
285
|
-
list: { description: "Mantine List", category: "composite",
|
|
286
|
-
"list-item": { description: "Mantine List.Item", category: "composite",
|
|
287
|
-
"entry-list": { description: "Data-driven list of entries (form-log table)", category: "composite",
|
|
288
|
-
"entry-record": { description: "Single-record container", category: "composite",
|
|
289
|
-
"entry-record-delete": { description: "Inline delete confirmation for an entry", category: "composite",
|
|
290
|
-
loop: { description: "Loop / repeater over backend-provided rows", category: "composite",
|
|
291
|
-
"timeline-item": { description: "A single entry inside a timeline (child-only)", category: "composite",
|
|
287
|
+
accordion: { description: "Mantine Accordion", category: "composite", canHaveChildren: true },
|
|
288
|
+
"accordion-item": { description: "Mantine Accordion.Item", category: "composite", canHaveChildren: true },
|
|
289
|
+
tabs: { description: "Mantine Tabs", category: "composite", canHaveChildren: true },
|
|
290
|
+
tab: { description: "Mantine Tabs.Tab + Tabs.Panel pair", category: "composite", canHaveChildren: true },
|
|
291
|
+
timeline: { description: "Mantine Timeline", category: "composite", canHaveChildren: true },
|
|
292
|
+
list: { description: "Mantine List", category: "composite", canHaveChildren: true },
|
|
293
|
+
"list-item": { description: "Mantine List.Item", category: "composite", canHaveChildren: true },
|
|
294
|
+
"entry-list": { description: "Data-driven list of entries (form-log table)", category: "composite", canHaveChildren: true },
|
|
295
|
+
"entry-record": { description: "Single-record container", category: "composite", canHaveChildren: true },
|
|
296
|
+
"entry-record-delete": { description: "Inline delete confirmation for an entry", category: "composite", canHaveChildren: false },
|
|
297
|
+
loop: { description: "Loop / repeater over backend-provided rows", category: "composite", canHaveChildren: true },
|
|
298
|
+
"timeline-item": { description: "A single entry inside a timeline (child-only)", category: "composite", canHaveChildren: true },
|
|
292
299
|
// ===== system / data / reference (established backend catalog) =====
|
|
293
|
-
"no-access": { description: "Access-denied surface shown when the user lacks page access", category: "auth",
|
|
294
|
-
missing: { description: 'Generic "content missing" system surface', category: "auth",
|
|
295
|
-
"not-found": { description: "Page-not-found system surface", category: "auth",
|
|
296
|
-
version: { description: "Build/version diagnostic surface", category: "auth",
|
|
297
|
-
"ref-container": { description: "Renders content referenced from another section", category: "layout",
|
|
298
|
-
"data-container": { description: "Data-scoped container (renders subtree against a data scope)", category: "layout",
|
|
299
|
-
"show-user-input": { description: "Displays previously submitted user input as a list/card view", category: "forms",
|
|
300
|
+
"no-access": { description: "Access-denied surface shown when the user lacks page access", category: "auth", canHaveChildren: false },
|
|
301
|
+
missing: { description: 'Generic "content missing" system surface', category: "auth", canHaveChildren: false },
|
|
302
|
+
"not-found": { description: "Page-not-found system surface", category: "auth", canHaveChildren: false },
|
|
303
|
+
version: { description: "Build/version diagnostic surface", category: "auth", canHaveChildren: false },
|
|
304
|
+
"ref-container": { description: "Renders content referenced from another section", category: "layout", canHaveChildren: true },
|
|
305
|
+
"data-container": { description: "Data-scoped container (renders subtree against a data scope)", category: "layout", canHaveChildren: true },
|
|
306
|
+
"show-user-input": { description: "Displays previously submitted user input as a list/card view", category: "forms", canHaveChildren: false }
|
|
300
307
|
};
|
|
301
308
|
var STYLE_REGISTRY = BASE_STYLE_REGISTRY;
|
|
302
309
|
var PLUGIN_STYLE_REGISTRY = {};
|
|
@@ -603,14 +610,6 @@ var sharedTailwindPreset = {
|
|
|
603
610
|
var FULL_RADIUS_PX = 9999;
|
|
604
611
|
var SEMANTIC_SIZES = ["sm", "md", "lg"];
|
|
605
612
|
var SEMANTIC_RADII = ["none", "sm", "md", "lg", "full"];
|
|
606
|
-
var SEMANTIC_INTENTS = [
|
|
607
|
-
"primary",
|
|
608
|
-
"secondary",
|
|
609
|
-
"success",
|
|
610
|
-
"warning",
|
|
611
|
-
"danger",
|
|
612
|
-
"neutral"
|
|
613
|
-
];
|
|
614
613
|
function mapSizeToMantine(size) {
|
|
615
614
|
return size;
|
|
616
615
|
}
|
|
@@ -666,63 +665,6 @@ function mapSpacingToPx(spacing2) {
|
|
|
666
665
|
if (spacing2 === "none") return 0;
|
|
667
666
|
return SPACING_PX[spacing2];
|
|
668
667
|
}
|
|
669
|
-
function mapIntentToMantine(intent) {
|
|
670
|
-
if (!intent) return void 0;
|
|
671
|
-
switch (intent) {
|
|
672
|
-
case "primary":
|
|
673
|
-
return { color: "blue", variant: "filled" };
|
|
674
|
-
case "secondary":
|
|
675
|
-
return { color: "gray", variant: "light" };
|
|
676
|
-
case "success":
|
|
677
|
-
return { color: "green", variant: "filled" };
|
|
678
|
-
case "warning":
|
|
679
|
-
return { color: "yellow", variant: "filled" };
|
|
680
|
-
case "danger":
|
|
681
|
-
return { color: "red", variant: "filled" };
|
|
682
|
-
case "neutral":
|
|
683
|
-
return { color: "gray", variant: "default" };
|
|
684
|
-
default:
|
|
685
|
-
return void 0;
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
function mapIntentToHeroUiButtonVariant(intent) {
|
|
689
|
-
if (!intent) return void 0;
|
|
690
|
-
switch (intent) {
|
|
691
|
-
case "primary":
|
|
692
|
-
return "primary";
|
|
693
|
-
case "secondary":
|
|
694
|
-
return "secondary";
|
|
695
|
-
case "success":
|
|
696
|
-
return "primary";
|
|
697
|
-
case "warning":
|
|
698
|
-
return "primary";
|
|
699
|
-
case "danger":
|
|
700
|
-
return "danger";
|
|
701
|
-
case "neutral":
|
|
702
|
-
return "secondary";
|
|
703
|
-
default:
|
|
704
|
-
return void 0;
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
function mapIntentToHeroUiColor(intent) {
|
|
708
|
-
if (!intent) return void 0;
|
|
709
|
-
switch (intent) {
|
|
710
|
-
case "primary":
|
|
711
|
-
return "accent";
|
|
712
|
-
case "secondary":
|
|
713
|
-
return "default";
|
|
714
|
-
case "success":
|
|
715
|
-
return "success";
|
|
716
|
-
case "warning":
|
|
717
|
-
return "warning";
|
|
718
|
-
case "danger":
|
|
719
|
-
return "danger";
|
|
720
|
-
case "neutral":
|
|
721
|
-
return "default";
|
|
722
|
-
default:
|
|
723
|
-
return void 0;
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
668
|
function mapMantineColorToHeroUiColor(color) {
|
|
727
669
|
if (!color) return void 0;
|
|
728
670
|
switch (color) {
|
|
@@ -870,10 +812,6 @@ function resolveSharedStyleProps(fields) {
|
|
|
870
812
|
if (variant !== void 0) {
|
|
871
813
|
resolved.variant = variant;
|
|
872
814
|
}
|
|
873
|
-
const intent = readString(fields.shared_intent);
|
|
874
|
-
if (intent !== void 0 && SEMANTIC_INTENTS.includes(intent)) {
|
|
875
|
-
resolved.intent = intent;
|
|
876
|
-
}
|
|
877
815
|
const fullWidth = readBool(fields.full_width);
|
|
878
816
|
if (fullWidth !== void 0) {
|
|
879
817
|
resolved.fullWidth = fullWidth;
|
|
@@ -881,12 +819,11 @@ function resolveSharedStyleProps(fields) {
|
|
|
881
819
|
return resolved;
|
|
882
820
|
}
|
|
883
821
|
function toMantineSemanticProps(props) {
|
|
884
|
-
const intent = mapIntentToMantine(props.intent);
|
|
885
822
|
const spacing2 = props.spacing && props.spacing !== "none" ? props.spacing : void 0;
|
|
886
823
|
return {
|
|
887
824
|
size: mapSizeToMantine(props.size),
|
|
888
|
-
color:
|
|
889
|
-
variant:
|
|
825
|
+
color: props.color,
|
|
826
|
+
variant: props.variant,
|
|
890
827
|
radius: mapRadiusToMantine(props.radius),
|
|
891
828
|
spacing: spacing2,
|
|
892
829
|
disabled: hasState(props.states, "disabled") || void 0,
|
|
@@ -897,8 +834,8 @@ function toMantineSemanticProps(props) {
|
|
|
897
834
|
};
|
|
898
835
|
}
|
|
899
836
|
function toHeroUiSemanticProps(props) {
|
|
900
|
-
const buttonVariant = mapMantineVariantToHeroUiButtonVariant(props.variant) ?? mapMantineColorToHeroUiButtonVariant(props.color)
|
|
901
|
-
const color = mapMantineColorToHeroUiColor(props.color)
|
|
837
|
+
const buttonVariant = mapMantineVariantToHeroUiButtonVariant(props.variant) ?? mapMantineColorToHeroUiButtonVariant(props.color);
|
|
838
|
+
const color = mapMantineColorToHeroUiColor(props.color);
|
|
902
839
|
return {
|
|
903
840
|
size: mapSizeToHeroUi(props.size),
|
|
904
841
|
buttonVariant,
|
|
@@ -1594,6 +1531,7 @@ function transformPagesData(pages) {
|
|
|
1594
1531
|
HEADER_CLIENT_TYPE,
|
|
1595
1532
|
LINE_HEIGHT,
|
|
1596
1533
|
LITERAL_CLASSES,
|
|
1534
|
+
MOBILE_PREVIEW_ENDPOINTS,
|
|
1597
1535
|
PERMISSIONS,
|
|
1598
1536
|
RADIUS_PX,
|
|
1599
1537
|
RELEASE_CHANNELS,
|
|
@@ -1628,9 +1566,6 @@ function transformPagesData(pages) {
|
|
|
1628
1566
|
mapAccordionVariantToHeroUiVariant,
|
|
1629
1567
|
mapChipVariantToHeroUiVariant,
|
|
1630
1568
|
mapDividerVariantToReactNative,
|
|
1631
|
-
mapIntentToHeroUiButtonVariant,
|
|
1632
|
-
mapIntentToHeroUiColor,
|
|
1633
|
-
mapIntentToMantine,
|
|
1634
1569
|
mapMantineColorToHeroUiButtonVariant,
|
|
1635
1570
|
mapMantineColorToHeroUiColor,
|
|
1636
1571
|
mapMantineVariantToHeroUiButtonVariant,
|