@selfhelp/shared 1.14.20 → 1.14.24
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 +109 -0
- package/dist/{common-DMm4kymA.d.mts → common-qaDIAYS3.d.mts} +5 -4
- package/dist/{common-DMm4kymA.d.ts → common-qaDIAYS3.d.ts} +5 -4
- package/dist/index.d.mts +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.js +99 -175
- package/dist/index.mjs +99 -172
- package/dist/plugin-sdk/index.d.mts +2 -2
- package/dist/plugin-sdk/index.d.ts +2 -2
- package/dist/plugin-sdk/index.js +90 -91
- package/dist/plugin-sdk/index.mjs +90 -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-B8IaEULk.d.ts → styles.registry-4W0LzmZB.d.mts} +194 -365
- package/dist/{styles.registry-DhkxrV2-.d.mts → styles.registry-D6xMm5VR.d.ts} +194 -365
- package/dist/theme/index.d.mts +42 -91
- package/dist/theme/index.d.ts +42 -91
- package/dist/theme/index.js +9 -85
- package/dist/theme/index.mjs +9 -82
- package/dist/theme/tailwind.d.mts +2 -2
- package/dist/theme/tailwind.d.ts +2 -2
- package/package.json +1 -1
- package/src/plugin-sdk/define.ts +0 -1
- 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 +34 -71
- package/src/theme/mantineVariant.ts +3 -3
- package/src/theme/semantic.ts +45 -185
- package/src/theme/tailwind.ts +2 -2
- package/src/theme/tokens.ts +3 -3
- package/src/types/__tests__/mobile-adapters.test.ts +1 -1
- package/src/types/mantine/common.ts +4 -3
- package/src/types/mobile-adapters.ts +4 -4
- package/src/types/styles/auth.ts +10 -10
- package/src/types/styles/base.ts +2 -2
- package/src/types/styles/composite.ts +7 -9
- package/src/types/styles/error.ts +9 -9
- package/src/types/styles/forms.ts +74 -58
- package/src/types/styles/interactive.ts +34 -32
- package/src/types/styles/layout.ts +42 -42
- package/src/types/styles/media.ts +6 -6
- package/src/types/styles/typography.ts +13 -13
- package/src/utils/spacing.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -81,9 +81,6 @@ __export(index_exports, {
|
|
|
81
81
|
mapAccordionVariantToHeroUiVariant: () => mapAccordionVariantToHeroUiVariant,
|
|
82
82
|
mapChipVariantToHeroUiVariant: () => mapChipVariantToHeroUiVariant,
|
|
83
83
|
mapDividerVariantToReactNative: () => mapDividerVariantToReactNative,
|
|
84
|
-
mapIntentToHeroUiButtonVariant: () => mapIntentToHeroUiButtonVariant,
|
|
85
|
-
mapIntentToHeroUiColor: () => mapIntentToHeroUiColor,
|
|
86
|
-
mapIntentToMantine: () => mapIntentToMantine,
|
|
87
84
|
mapMantineColorToHeroUiButtonVariant: () => mapMantineColorToHeroUiButtonVariant,
|
|
88
85
|
mapMantineColorToHeroUiColor: () => mapMantineColorToHeroUiColor,
|
|
89
86
|
mapMantineVariantToHeroUiButtonVariant: () => mapMantineVariantToHeroUiButtonVariant,
|
|
@@ -200,103 +197,103 @@ var RELEASE_CHANNELS = ["stable", "beta", "nightly", "test"];
|
|
|
200
197
|
// src/registry/styles.registry.ts
|
|
201
198
|
var BASE_STYLE_REGISTRY = {
|
|
202
199
|
// ===== 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",
|
|
200
|
+
login: { description: "User login form", category: "auth", canHaveChildren: false },
|
|
201
|
+
register: { description: "User registration form", category: "auth", canHaveChildren: false },
|
|
202
|
+
validate: { description: "Email/account validation flow", category: "auth", canHaveChildren: true },
|
|
203
|
+
"reset-password": { description: "Reset password form", category: "auth", canHaveChildren: false },
|
|
204
|
+
"two-factor-auth": { description: "Two-factor auth code form", category: "auth", canHaveChildren: false },
|
|
205
|
+
profile: { description: "User profile management", category: "auth", canHaveChildren: false },
|
|
209
206
|
// ===== 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",
|
|
207
|
+
container: { description: "Mantine Container with responsive max-width", category: "layout", canHaveChildren: true },
|
|
208
|
+
box: { description: "Generic Mantine Box wrapper", category: "layout", canHaveChildren: true },
|
|
209
|
+
flex: { description: "Mantine Flex layout", category: "layout", canHaveChildren: true },
|
|
210
|
+
group: { description: "Mantine Group horizontal layout", category: "layout", canHaveChildren: true },
|
|
211
|
+
stack: { description: "Mantine Stack vertical layout", category: "layout", canHaveChildren: true },
|
|
212
|
+
"simple-grid": { description: "Mantine SimpleGrid", category: "layout", canHaveChildren: true },
|
|
213
|
+
grid: { description: "Mantine Grid", category: "layout", canHaveChildren: true },
|
|
214
|
+
"grid-column": { description: "Mantine Grid.Col", category: "layout", canHaveChildren: true },
|
|
215
|
+
space: { description: "Mantine Space spacer", category: "layout", canHaveChildren: false },
|
|
216
|
+
divider: { description: "Mantine Divider", category: "layout", canHaveChildren: false },
|
|
217
|
+
paper: { description: "Mantine Paper surface", category: "layout", canHaveChildren: true },
|
|
218
|
+
center: { description: "Mantine Center alignment", category: "layout", canHaveChildren: true },
|
|
219
|
+
"scroll-area": { description: "Mantine ScrollArea", category: "layout", canHaveChildren: true },
|
|
220
|
+
card: { description: "Mantine Card", category: "layout", canHaveChildren: true },
|
|
221
|
+
"card-segment": { description: "Mantine Card.Section", category: "layout", canHaveChildren: true },
|
|
222
|
+
"aspect-ratio": { description: "Mantine AspectRatio wrapper", category: "layout", canHaveChildren: true },
|
|
223
|
+
"background-image": { description: "Mantine BackgroundImage", category: "layout", canHaveChildren: true },
|
|
227
224
|
// ===== 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",
|
|
225
|
+
title: { description: "Mantine Title", category: "typography", canHaveChildren: false },
|
|
226
|
+
text: { description: "Mantine Text", category: "typography", canHaveChildren: false },
|
|
227
|
+
code: { description: "Mantine Code (inline / block)", category: "typography", canHaveChildren: false },
|
|
228
|
+
highlight: { description: "Mantine Highlight", category: "typography", canHaveChildren: false },
|
|
229
|
+
blockquote: { description: "Mantine Blockquote", category: "typography", canHaveChildren: false },
|
|
230
|
+
"html-tag": { description: "Generic HTML tag wrapper (web), maps to View on RN", category: "typography", canHaveChildren: true },
|
|
231
|
+
kbd: { description: "Mantine Kbd", category: "typography", canHaveChildren: false },
|
|
232
|
+
typography: { description: "Mantine Typography wrapper", category: "typography", canHaveChildren: true },
|
|
233
|
+
fieldset: { description: "Mantine Fieldset", category: "typography", canHaveChildren: true },
|
|
234
|
+
spoiler: { description: "Mantine Spoiler reveal", category: "typography", canHaveChildren: true },
|
|
238
235
|
// ===== 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",
|
|
236
|
+
image: { description: "Mantine Image / RN Image", category: "media", canHaveChildren: false },
|
|
237
|
+
video: { description: "HTML5 video / expo-video", category: "media", canHaveChildren: false },
|
|
238
|
+
audio: { description: "HTML5 audio / expo-audio", category: "media", canHaveChildren: false },
|
|
239
|
+
figure: { description: "Figure with caption", category: "media", canHaveChildren: true },
|
|
240
|
+
carousel: { description: "Embla on web, reanimated-carousel on RN", category: "media", canHaveChildren: true },
|
|
244
241
|
// ===== 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",
|
|
242
|
+
button: { description: "Mantine Button / HeroUI Button", category: "interactive", canHaveChildren: false },
|
|
243
|
+
link: { description: "Anchor / Pressable navigation", category: "interactive", canHaveChildren: false },
|
|
244
|
+
"action-icon": { description: "Mantine ActionIcon", category: "interactive", canHaveChildren: false },
|
|
245
|
+
alert: { description: "Mantine Alert", category: "interactive", canHaveChildren: true },
|
|
246
|
+
badge: { description: "Mantine Badge", category: "interactive", canHaveChildren: false },
|
|
247
|
+
avatar: { description: "Mantine Avatar", category: "interactive", canHaveChildren: false },
|
|
248
|
+
chip: { description: "Mantine Chip", category: "interactive", canHaveChildren: false },
|
|
249
|
+
indicator: { description: "Mantine Indicator dot", category: "interactive", canHaveChildren: true },
|
|
250
|
+
"theme-icon": { description: "Mantine ThemeIcon", category: "interactive", canHaveChildren: false },
|
|
251
|
+
notification: { description: "Mantine Notification", category: "interactive", canHaveChildren: false },
|
|
255
252
|
// ===== 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;
|
|
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",
|
|
253
|
+
"form-log": { description: "Append-only form (one row per submit)", category: "forms", canHaveChildren: true },
|
|
254
|
+
"form-record": { description: "Per-user record form", category: "forms", canHaveChildren: true },
|
|
255
|
+
input: { description: "Plain HTML input", category: "forms", canHaveChildren: false },
|
|
256
|
+
"text-input": { description: "Mantine TextInput", category: "forms", canHaveChildren: false },
|
|
257
|
+
textarea: { description: "Mantine Textarea", category: "forms", canHaveChildren: false },
|
|
258
|
+
"rich-text-editor": { description: "Tiptap editor on web; native inline-format toolbar editor on mobile", category: "forms", canHaveChildren: false },
|
|
259
|
+
select: { description: "HTML select / Mantine Select", category: "forms", canHaveChildren: false },
|
|
260
|
+
radio: { description: "Mantine Radio / RadioGroup", category: "forms", canHaveChildren: false },
|
|
261
|
+
checkbox: { description: "Mantine Checkbox", category: "forms", canHaveChildren: false },
|
|
262
|
+
slider: { description: "Mantine Slider", category: "forms", canHaveChildren: false },
|
|
263
|
+
"range-slider": { description: "Mantine RangeSlider", category: "forms", canHaveChildren: false },
|
|
264
|
+
datepicker: { description: "Mantine DatePicker", category: "forms", canHaveChildren: false },
|
|
265
|
+
switch: { description: "Mantine Switch", category: "forms", canHaveChildren: false },
|
|
266
|
+
combobox: { description: "Mantine Combobox", category: "forms", canHaveChildren: false },
|
|
267
|
+
"color-input": { description: "Mantine ColorInput", category: "forms", canHaveChildren: false },
|
|
268
|
+
"color-picker": { description: "Mantine ColorPicker", category: "forms", canHaveChildren: false },
|
|
269
|
+
"file-input": { description: "Mantine FileInput / DocumentPicker on RN", category: "forms", canHaveChildren: false },
|
|
270
|
+
"number-input": { description: "Mantine NumberInput", category: "forms", canHaveChildren: false },
|
|
271
|
+
"segmented-control": { description: "Mantine SegmentedControl", category: "forms", canHaveChildren: false },
|
|
272
|
+
rating: { description: "Mantine Rating", category: "forms", canHaveChildren: false },
|
|
273
|
+
progress: { description: "Mantine Progress", category: "forms", canHaveChildren: false },
|
|
274
|
+
"progress-root": { description: "Mantine Progress.Root", category: "forms", canHaveChildren: true },
|
|
275
|
+
"progress-section": { description: "Mantine Progress.Section", category: "forms", canHaveChildren: false },
|
|
279
276
|
// ===== 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",
|
|
277
|
+
accordion: { description: "Mantine Accordion", category: "composite", canHaveChildren: true },
|
|
278
|
+
"accordion-item": { description: "Mantine Accordion.Item", category: "composite", canHaveChildren: true },
|
|
279
|
+
tabs: { description: "Mantine Tabs", category: "composite", canHaveChildren: true },
|
|
280
|
+
tab: { description: "Mantine Tabs.Tab + Tabs.Panel pair", category: "composite", canHaveChildren: true },
|
|
281
|
+
timeline: { description: "Mantine Timeline", category: "composite", canHaveChildren: true },
|
|
282
|
+
list: { description: "Mantine List", category: "composite", canHaveChildren: true },
|
|
283
|
+
"list-item": { description: "Mantine List.Item", category: "composite", canHaveChildren: true },
|
|
284
|
+
"entry-list": { description: "Data-driven list of entries (form-log table)", category: "composite", canHaveChildren: true },
|
|
285
|
+
"entry-record": { description: "Single-record container", category: "composite", canHaveChildren: true },
|
|
286
|
+
"entry-record-delete": { description: "Inline delete confirmation for an entry", category: "composite", canHaveChildren: false },
|
|
287
|
+
loop: { description: "Loop / repeater over backend-provided rows", category: "composite", canHaveChildren: true },
|
|
288
|
+
"timeline-item": { description: "A single entry inside a timeline (child-only)", category: "composite", canHaveChildren: true },
|
|
292
289
|
// ===== 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",
|
|
290
|
+
"no-access": { description: "Access-denied surface shown when the user lacks page access", category: "auth", canHaveChildren: false },
|
|
291
|
+
missing: { description: 'Generic "content missing" system surface', category: "auth", canHaveChildren: false },
|
|
292
|
+
"not-found": { description: "Page-not-found system surface", category: "auth", canHaveChildren: false },
|
|
293
|
+
version: { description: "Build/version diagnostic surface", category: "auth", canHaveChildren: false },
|
|
294
|
+
"ref-container": { description: "Renders content referenced from another section", category: "layout", canHaveChildren: true },
|
|
295
|
+
"data-container": { description: "Data-scoped container (renders subtree against a data scope)", category: "layout", canHaveChildren: true },
|
|
296
|
+
"show-user-input": { description: "Displays previously submitted user input as a list/card view", category: "forms", canHaveChildren: false }
|
|
300
297
|
};
|
|
301
298
|
var STYLE_REGISTRY = BASE_STYLE_REGISTRY;
|
|
302
299
|
var PLUGIN_STYLE_REGISTRY = {};
|
|
@@ -603,14 +600,6 @@ var sharedTailwindPreset = {
|
|
|
603
600
|
var FULL_RADIUS_PX = 9999;
|
|
604
601
|
var SEMANTIC_SIZES = ["sm", "md", "lg"];
|
|
605
602
|
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
603
|
function mapSizeToMantine(size) {
|
|
615
604
|
return size;
|
|
616
605
|
}
|
|
@@ -666,63 +655,6 @@ function mapSpacingToPx(spacing2) {
|
|
|
666
655
|
if (spacing2 === "none") return 0;
|
|
667
656
|
return SPACING_PX[spacing2];
|
|
668
657
|
}
|
|
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
658
|
function mapMantineColorToHeroUiColor(color) {
|
|
727
659
|
if (!color) return void 0;
|
|
728
660
|
switch (color) {
|
|
@@ -854,39 +786,34 @@ function readBool(value) {
|
|
|
854
786
|
}
|
|
855
787
|
function resolveSharedStyleProps(fields) {
|
|
856
788
|
const resolved = {};
|
|
857
|
-
const size = readString(fields.
|
|
789
|
+
const size = readString(fields.size);
|
|
858
790
|
if (size !== void 0 && SEMANTIC_SIZES.includes(size)) {
|
|
859
791
|
resolved.size = size;
|
|
860
792
|
}
|
|
861
|
-
const radius = readString(fields.
|
|
793
|
+
const radius = readString(fields.radius);
|
|
862
794
|
if (radius !== void 0 && SEMANTIC_RADII.includes(radius)) {
|
|
863
795
|
resolved.radius = radius;
|
|
864
796
|
}
|
|
865
|
-
const color = readString(fields.
|
|
797
|
+
const color = readString(fields.color);
|
|
866
798
|
if (color !== void 0) {
|
|
867
799
|
resolved.color = color;
|
|
868
800
|
}
|
|
869
|
-
const variant = readString(fields.
|
|
801
|
+
const variant = readString(fields.variant);
|
|
870
802
|
if (variant !== void 0) {
|
|
871
803
|
resolved.variant = variant;
|
|
872
804
|
}
|
|
873
|
-
const
|
|
874
|
-
if (intent !== void 0 && SEMANTIC_INTENTS.includes(intent)) {
|
|
875
|
-
resolved.intent = intent;
|
|
876
|
-
}
|
|
877
|
-
const fullWidth = readBool(fields.shared_full_width);
|
|
805
|
+
const fullWidth = readBool(fields.full_width);
|
|
878
806
|
if (fullWidth !== void 0) {
|
|
879
807
|
resolved.fullWidth = fullWidth;
|
|
880
808
|
}
|
|
881
809
|
return resolved;
|
|
882
810
|
}
|
|
883
811
|
function toMantineSemanticProps(props) {
|
|
884
|
-
const intent = mapIntentToMantine(props.intent);
|
|
885
812
|
const spacing2 = props.spacing && props.spacing !== "none" ? props.spacing : void 0;
|
|
886
813
|
return {
|
|
887
814
|
size: mapSizeToMantine(props.size),
|
|
888
|
-
color:
|
|
889
|
-
variant:
|
|
815
|
+
color: props.color,
|
|
816
|
+
variant: props.variant,
|
|
890
817
|
radius: mapRadiusToMantine(props.radius),
|
|
891
818
|
spacing: spacing2,
|
|
892
819
|
disabled: hasState(props.states, "disabled") || void 0,
|
|
@@ -897,8 +824,8 @@ function toMantineSemanticProps(props) {
|
|
|
897
824
|
};
|
|
898
825
|
}
|
|
899
826
|
function toHeroUiSemanticProps(props) {
|
|
900
|
-
const buttonVariant = mapMantineVariantToHeroUiButtonVariant(props.variant) ?? mapMantineColorToHeroUiButtonVariant(props.color)
|
|
901
|
-
const color = mapMantineColorToHeroUiColor(props.color)
|
|
827
|
+
const buttonVariant = mapMantineVariantToHeroUiButtonVariant(props.variant) ?? mapMantineColorToHeroUiButtonVariant(props.color);
|
|
828
|
+
const color = mapMantineColorToHeroUiColor(props.color);
|
|
902
829
|
return {
|
|
903
830
|
size: mapSizeToHeroUi(props.size),
|
|
904
831
|
buttonVariant,
|
|
@@ -1628,9 +1555,6 @@ function transformPagesData(pages) {
|
|
|
1628
1555
|
mapAccordionVariantToHeroUiVariant,
|
|
1629
1556
|
mapChipVariantToHeroUiVariant,
|
|
1630
1557
|
mapDividerVariantToReactNative,
|
|
1631
|
-
mapIntentToHeroUiButtonVariant,
|
|
1632
|
-
mapIntentToHeroUiColor,
|
|
1633
|
-
mapIntentToMantine,
|
|
1634
1558
|
mapMantineColorToHeroUiButtonVariant,
|
|
1635
1559
|
mapMantineColorToHeroUiColor,
|
|
1636
1560
|
mapMantineVariantToHeroUiButtonVariant,
|