@selfhelp/shared 1.0.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.
Files changed (64) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/LICENSE +381 -0
  3. package/README.md +266 -0
  4. package/dist/common-B96dASgu.d.mts +80 -0
  5. package/dist/common-B96dASgu.d.ts +80 -0
  6. package/dist/index-Bg60YTsF.d.mts +1743 -0
  7. package/dist/index-DEOVT86P.d.ts +1743 -0
  8. package/dist/index.d.mts +597 -0
  9. package/dist/index.d.ts +597 -0
  10. package/dist/index.js +796 -0
  11. package/dist/index.mjs +718 -0
  12. package/dist/registry/index.d.mts +2 -0
  13. package/dist/registry/index.d.ts +2 -0
  14. package/dist/registry/index.js +134 -0
  15. package/dist/registry/index.mjs +105 -0
  16. package/dist/theme/index.d.mts +63 -0
  17. package/dist/theme/index.d.ts +63 -0
  18. package/dist/theme/index.js +202 -0
  19. package/dist/theme/index.mjs +162 -0
  20. package/dist/theme/tailwind.d.mts +36 -0
  21. package/dist/theme/tailwind.d.ts +36 -0
  22. package/dist/theme/tailwind.js +125 -0
  23. package/dist/theme/tailwind.mjs +97 -0
  24. package/package.json +69 -0
  25. package/src/api/endpoints.ts +58 -0
  26. package/src/api/index.ts +5 -0
  27. package/src/assets/index.ts +5 -0
  28. package/src/assets/resolveAssetUrl.ts +44 -0
  29. package/src/cms-classes/allow-list.ts +158 -0
  30. package/src/cms-classes/classify.ts +90 -0
  31. package/src/cms-classes/index.ts +7 -0
  32. package/src/cms-classes/remap.ts +44 -0
  33. package/src/condition/evaluate.ts +121 -0
  34. package/src/condition/index.ts +5 -0
  35. package/src/index.ts +25 -0
  36. package/src/interpolation/index.ts +5 -0
  37. package/src/interpolation/replaceCalcedValues.ts +27 -0
  38. package/src/registry/index.ts +37 -0
  39. package/src/registry/styles.registry.ts +158 -0
  40. package/src/theme/index.ts +6 -0
  41. package/src/theme/tailwind.ts +73 -0
  42. package/src/theme/tokens.ts +177 -0
  43. package/src/types/api/auth.ts +46 -0
  44. package/src/types/api/envelope.ts +34 -0
  45. package/src/types/api/forms.ts +38 -0
  46. package/src/types/api/index.ts +9 -0
  47. package/src/types/api/language.ts +12 -0
  48. package/src/types/api/page.ts +9 -0
  49. package/src/types/auth.ts +110 -0
  50. package/src/types/index.ts +17 -0
  51. package/src/types/mantine/common.ts +142 -0
  52. package/src/types/pages.ts +107 -0
  53. package/src/types/styles/auth.ts +165 -0
  54. package/src/types/styles/base.ts +72 -0
  55. package/src/types/styles/composite.ts +131 -0
  56. package/src/types/styles/forms.ts +439 -0
  57. package/src/types/styles/interactive.ts +165 -0
  58. package/src/types/styles/layout.ts +184 -0
  59. package/src/types/styles/media.ts +68 -0
  60. package/src/types/styles/typography.ts +118 -0
  61. package/src/types/styles/unknown.ts +220 -0
  62. package/src/utils/index.ts +6 -0
  63. package/src/utils/spacing.ts +64 -0
  64. package/src/utils/transformPageData.ts +93 -0
@@ -0,0 +1,2 @@
1
+ export { aj as IStyleRegistryEntry, az as STYLE_REGISTRY, bg as TStyleImplMap, bh as TStyleRegistryKey, bi as _AssertRegistryMatchesStyleName, bj as getRegistryEntry, bk as isKnownStyleName } from '../index-Bg60YTsF.mjs';
2
+ import '../common-B96dASgu.mjs';
@@ -0,0 +1,2 @@
1
+ export { aj as IStyleRegistryEntry, az as STYLE_REGISTRY, bg as TStyleImplMap, bh as TStyleRegistryKey, bi as _AssertRegistryMatchesStyleName, bj as getRegistryEntry, bk as isKnownStyleName } from '../index-DEOVT86P.js';
2
+ import '../common-B96dASgu.js';
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/registry/index.ts
21
+ var registry_exports = {};
22
+ __export(registry_exports, {
23
+ STYLE_REGISTRY: () => STYLE_REGISTRY,
24
+ getRegistryEntry: () => getRegistryEntry,
25
+ isKnownStyleName: () => isKnownStyleName
26
+ });
27
+ module.exports = __toCommonJS(registry_exports);
28
+
29
+ // src/registry/styles.registry.ts
30
+ var STYLE_REGISTRY = {
31
+ // ===== auth =====
32
+ login: { description: "User login form", category: "auth", frontendOnly: true, canHaveChildren: false },
33
+ register: { description: "User registration form", category: "auth", frontendOnly: true, canHaveChildren: false },
34
+ validate: { description: "Email/account validation flow", category: "auth", frontendOnly: true, canHaveChildren: true },
35
+ resetPassword: { description: "Reset password form", category: "auth", frontendOnly: true, canHaveChildren: false },
36
+ twoFactorAuth: { description: "Two-factor auth code form", category: "auth", frontendOnly: true, canHaveChildren: false },
37
+ profile: { description: "User profile management", category: "auth", frontendOnly: true, canHaveChildren: false },
38
+ // ===== layout =====
39
+ container: { description: "Mantine Container with responsive max-width", category: "layout", frontendOnly: true, canHaveChildren: true },
40
+ box: { description: "Generic Mantine Box wrapper", category: "layout", frontendOnly: true, canHaveChildren: true },
41
+ flex: { description: "Mantine Flex layout", category: "layout", frontendOnly: true, canHaveChildren: true },
42
+ group: { description: "Mantine Group horizontal layout", category: "layout", frontendOnly: true, canHaveChildren: true },
43
+ stack: { description: "Mantine Stack vertical layout", category: "layout", frontendOnly: true, canHaveChildren: true },
44
+ "simple-grid": { description: "Mantine SimpleGrid", category: "layout", frontendOnly: true, canHaveChildren: true },
45
+ grid: { description: "Mantine Grid", category: "layout", frontendOnly: true, canHaveChildren: true },
46
+ "grid-column": { description: "Mantine Grid.Col", category: "layout", frontendOnly: true, canHaveChildren: true },
47
+ space: { description: "Mantine Space spacer", category: "layout", frontendOnly: true, canHaveChildren: false },
48
+ divider: { description: "Mantine Divider", category: "layout", frontendOnly: true, canHaveChildren: false },
49
+ paper: { description: "Mantine Paper surface", category: "layout", frontendOnly: true, canHaveChildren: true },
50
+ center: { description: "Mantine Center alignment", category: "layout", frontendOnly: true, canHaveChildren: true },
51
+ "scroll-area": { description: "Mantine ScrollArea", category: "layout", frontendOnly: true, canHaveChildren: true },
52
+ card: { description: "Mantine Card", category: "layout", frontendOnly: true, canHaveChildren: true },
53
+ "card-segment": { description: "Mantine Card.Section", category: "layout", frontendOnly: true, canHaveChildren: true },
54
+ "aspect-ratio": { description: "Mantine AspectRatio wrapper", category: "layout", frontendOnly: true, canHaveChildren: true },
55
+ "background-image": { description: "Mantine BackgroundImage", category: "layout", frontendOnly: true, canHaveChildren: true },
56
+ // ===== typography =====
57
+ title: { description: "Mantine Title", category: "typography", frontendOnly: true, canHaveChildren: false },
58
+ text: { description: "Mantine Text", category: "typography", frontendOnly: true, canHaveChildren: false },
59
+ code: { description: "Mantine Code (inline / block)", category: "typography", frontendOnly: true, canHaveChildren: false },
60
+ highlight: { description: "Mantine Highlight", category: "typography", frontendOnly: true, canHaveChildren: false },
61
+ blockquote: { description: "Mantine Blockquote", category: "typography", frontendOnly: true, canHaveChildren: false },
62
+ "html-tag": { description: "Generic HTML tag wrapper (web), maps to View on RN", category: "typography", frontendOnly: true, canHaveChildren: true },
63
+ kbd: { description: "Mantine Kbd", category: "typography", frontendOnly: true, canHaveChildren: false },
64
+ typography: { description: "Mantine Typography wrapper", category: "typography", frontendOnly: true, canHaveChildren: true },
65
+ fieldset: { description: "Mantine Fieldset", category: "typography", frontendOnly: true, canHaveChildren: true },
66
+ spoiler: { description: "Mantine Spoiler reveal", category: "typography", frontendOnly: true, canHaveChildren: true },
67
+ // ===== media =====
68
+ image: { description: "Mantine Image / RN Image", category: "media", frontendOnly: true, canHaveChildren: false },
69
+ video: { description: "HTML5 video / expo-video", category: "media", frontendOnly: true, canHaveChildren: false },
70
+ audio: { description: "HTML5 audio / expo-audio", category: "media", frontendOnly: true, canHaveChildren: false },
71
+ figure: { description: "Figure with caption", category: "media", frontendOnly: true, canHaveChildren: true },
72
+ carousel: { description: "Embla on web, reanimated-carousel on RN", category: "media", frontendOnly: true, canHaveChildren: true },
73
+ // ===== interactive =====
74
+ button: { description: "Mantine Button / HeroUI Button", category: "interactive", frontendOnly: true, canHaveChildren: false },
75
+ link: { description: "Anchor / Pressable navigation", category: "interactive", frontendOnly: true, canHaveChildren: false },
76
+ "action-icon": { description: "Mantine ActionIcon", category: "interactive", frontendOnly: true, canHaveChildren: false },
77
+ alert: { description: "Mantine Alert", category: "interactive", frontendOnly: true, canHaveChildren: true },
78
+ badge: { description: "Mantine Badge", category: "interactive", frontendOnly: true, canHaveChildren: false },
79
+ avatar: { description: "Mantine Avatar", category: "interactive", frontendOnly: true, canHaveChildren: false },
80
+ chip: { description: "Mantine Chip", category: "interactive", frontendOnly: true, canHaveChildren: false },
81
+ indicator: { description: "Mantine Indicator dot", category: "interactive", frontendOnly: true, canHaveChildren: true },
82
+ "theme-icon": { description: "Mantine ThemeIcon", category: "interactive", frontendOnly: true, canHaveChildren: false },
83
+ notification: { description: "Mantine Notification", category: "interactive", frontendOnly: true, canHaveChildren: false },
84
+ // ===== forms =====
85
+ "form-log": { description: "Append-only form (one row per submit)", category: "forms", frontendOnly: true, canHaveChildren: true },
86
+ "form-record": { description: "Per-user record form", category: "forms", frontendOnly: true, canHaveChildren: true },
87
+ input: { description: "Plain HTML input", category: "forms", frontendOnly: true, canHaveChildren: false },
88
+ "text-input": { description: "Mantine TextInput", category: "forms", frontendOnly: true, canHaveChildren: false },
89
+ textarea: { description: "Mantine Textarea", category: "forms", frontendOnly: true, canHaveChildren: false },
90
+ "rich-text-editor": { description: "Tiptap editor on web; READ-ONLY viewer on mobile v1", category: "forms", frontendOnly: true, canHaveChildren: false },
91
+ select: { description: "HTML select / Mantine Select", category: "forms", frontendOnly: true, canHaveChildren: false },
92
+ radio: { description: "Mantine Radio / RadioGroup", category: "forms", frontendOnly: true, canHaveChildren: false },
93
+ checkbox: { description: "Mantine Checkbox", category: "forms", frontendOnly: true, canHaveChildren: false },
94
+ slider: { description: "Mantine Slider", category: "forms", frontendOnly: true, canHaveChildren: false },
95
+ "range-slider": { description: "Mantine RangeSlider", category: "forms", frontendOnly: true, canHaveChildren: false },
96
+ datepicker: { description: "Mantine DatePicker", category: "forms", frontendOnly: true, canHaveChildren: false },
97
+ switch: { description: "Mantine Switch", category: "forms", frontendOnly: true, canHaveChildren: false },
98
+ combobox: { description: "Mantine Combobox", category: "forms", frontendOnly: true, canHaveChildren: false },
99
+ "color-input": { description: "Mantine ColorInput", category: "forms", frontendOnly: true, canHaveChildren: false },
100
+ "color-picker": { description: "Mantine ColorPicker", category: "forms", frontendOnly: true, canHaveChildren: false },
101
+ "file-input": { description: "Mantine FileInput / DocumentPicker on RN", category: "forms", frontendOnly: true, canHaveChildren: false },
102
+ "number-input": { description: "Mantine NumberInput", category: "forms", frontendOnly: true, canHaveChildren: false },
103
+ "segmented-control": { description: "Mantine SegmentedControl", category: "forms", frontendOnly: true, canHaveChildren: false },
104
+ rating: { description: "Mantine Rating", category: "forms", frontendOnly: true, canHaveChildren: false },
105
+ progress: { description: "Mantine Progress", category: "forms", frontendOnly: true, canHaveChildren: false },
106
+ "progress-root": { description: "Mantine Progress.Root", category: "forms", frontendOnly: true, canHaveChildren: true },
107
+ "progress-section": { description: "Mantine Progress.Section", category: "forms", frontendOnly: true, canHaveChildren: false },
108
+ // ===== composite =====
109
+ accordion: { description: "Mantine Accordion", category: "composite", frontendOnly: true, canHaveChildren: true },
110
+ "accordion-item": { description: "Mantine Accordion.Item", category: "composite", frontendOnly: true, canHaveChildren: true },
111
+ tabs: { description: "Mantine Tabs", category: "composite", frontendOnly: true, canHaveChildren: true },
112
+ tab: { description: "Mantine Tabs.Tab + Tabs.Panel pair", category: "composite", frontendOnly: true, canHaveChildren: true },
113
+ timeline: { description: "Mantine Timeline", category: "composite", frontendOnly: true, canHaveChildren: true },
114
+ list: { description: "Mantine List", category: "composite", frontendOnly: true, canHaveChildren: true },
115
+ "list-item": { description: "Mantine List.Item", category: "composite", frontendOnly: true, canHaveChildren: true },
116
+ entryList: { description: "Data-driven list of entries (form-log table)", category: "composite", frontendOnly: true, canHaveChildren: true },
117
+ entryRecord: { description: "Single-record container", category: "composite", frontendOnly: true, canHaveChildren: true },
118
+ entryRecordDelete: { description: "Inline delete confirmation for an entry", category: "composite", frontendOnly: true, canHaveChildren: false },
119
+ loop: { description: "Loop / repeater over backend-provided rows", category: "composite", frontendOnly: true, canHaveChildren: true }
120
+ };
121
+
122
+ // src/registry/index.ts
123
+ function getRegistryEntry(name) {
124
+ return STYLE_REGISTRY[name];
125
+ }
126
+ function isKnownStyleName(name) {
127
+ return Object.prototype.hasOwnProperty.call(STYLE_REGISTRY, name);
128
+ }
129
+ // Annotate the CommonJS export names for ESM import in node:
130
+ 0 && (module.exports = {
131
+ STYLE_REGISTRY,
132
+ getRegistryEntry,
133
+ isKnownStyleName
134
+ });
@@ -0,0 +1,105 @@
1
+ // src/registry/styles.registry.ts
2
+ var STYLE_REGISTRY = {
3
+ // ===== auth =====
4
+ login: { description: "User login form", category: "auth", frontendOnly: true, canHaveChildren: false },
5
+ register: { description: "User registration form", category: "auth", frontendOnly: true, canHaveChildren: false },
6
+ validate: { description: "Email/account validation flow", category: "auth", frontendOnly: true, canHaveChildren: true },
7
+ resetPassword: { description: "Reset password form", category: "auth", frontendOnly: true, canHaveChildren: false },
8
+ twoFactorAuth: { description: "Two-factor auth code form", category: "auth", frontendOnly: true, canHaveChildren: false },
9
+ profile: { description: "User profile management", category: "auth", frontendOnly: true, canHaveChildren: false },
10
+ // ===== layout =====
11
+ container: { description: "Mantine Container with responsive max-width", category: "layout", frontendOnly: true, canHaveChildren: true },
12
+ box: { description: "Generic Mantine Box wrapper", category: "layout", frontendOnly: true, canHaveChildren: true },
13
+ flex: { description: "Mantine Flex layout", category: "layout", frontendOnly: true, canHaveChildren: true },
14
+ group: { description: "Mantine Group horizontal layout", category: "layout", frontendOnly: true, canHaveChildren: true },
15
+ stack: { description: "Mantine Stack vertical layout", category: "layout", frontendOnly: true, canHaveChildren: true },
16
+ "simple-grid": { description: "Mantine SimpleGrid", category: "layout", frontendOnly: true, canHaveChildren: true },
17
+ grid: { description: "Mantine Grid", category: "layout", frontendOnly: true, canHaveChildren: true },
18
+ "grid-column": { description: "Mantine Grid.Col", category: "layout", frontendOnly: true, canHaveChildren: true },
19
+ space: { description: "Mantine Space spacer", category: "layout", frontendOnly: true, canHaveChildren: false },
20
+ divider: { description: "Mantine Divider", category: "layout", frontendOnly: true, canHaveChildren: false },
21
+ paper: { description: "Mantine Paper surface", category: "layout", frontendOnly: true, canHaveChildren: true },
22
+ center: { description: "Mantine Center alignment", category: "layout", frontendOnly: true, canHaveChildren: true },
23
+ "scroll-area": { description: "Mantine ScrollArea", category: "layout", frontendOnly: true, canHaveChildren: true },
24
+ card: { description: "Mantine Card", category: "layout", frontendOnly: true, canHaveChildren: true },
25
+ "card-segment": { description: "Mantine Card.Section", category: "layout", frontendOnly: true, canHaveChildren: true },
26
+ "aspect-ratio": { description: "Mantine AspectRatio wrapper", category: "layout", frontendOnly: true, canHaveChildren: true },
27
+ "background-image": { description: "Mantine BackgroundImage", category: "layout", frontendOnly: true, canHaveChildren: true },
28
+ // ===== typography =====
29
+ title: { description: "Mantine Title", category: "typography", frontendOnly: true, canHaveChildren: false },
30
+ text: { description: "Mantine Text", category: "typography", frontendOnly: true, canHaveChildren: false },
31
+ code: { description: "Mantine Code (inline / block)", category: "typography", frontendOnly: true, canHaveChildren: false },
32
+ highlight: { description: "Mantine Highlight", category: "typography", frontendOnly: true, canHaveChildren: false },
33
+ blockquote: { description: "Mantine Blockquote", category: "typography", frontendOnly: true, canHaveChildren: false },
34
+ "html-tag": { description: "Generic HTML tag wrapper (web), maps to View on RN", category: "typography", frontendOnly: true, canHaveChildren: true },
35
+ kbd: { description: "Mantine Kbd", category: "typography", frontendOnly: true, canHaveChildren: false },
36
+ typography: { description: "Mantine Typography wrapper", category: "typography", frontendOnly: true, canHaveChildren: true },
37
+ fieldset: { description: "Mantine Fieldset", category: "typography", frontendOnly: true, canHaveChildren: true },
38
+ spoiler: { description: "Mantine Spoiler reveal", category: "typography", frontendOnly: true, canHaveChildren: true },
39
+ // ===== media =====
40
+ image: { description: "Mantine Image / RN Image", category: "media", frontendOnly: true, canHaveChildren: false },
41
+ video: { description: "HTML5 video / expo-video", category: "media", frontendOnly: true, canHaveChildren: false },
42
+ audio: { description: "HTML5 audio / expo-audio", category: "media", frontendOnly: true, canHaveChildren: false },
43
+ figure: { description: "Figure with caption", category: "media", frontendOnly: true, canHaveChildren: true },
44
+ carousel: { description: "Embla on web, reanimated-carousel on RN", category: "media", frontendOnly: true, canHaveChildren: true },
45
+ // ===== interactive =====
46
+ button: { description: "Mantine Button / HeroUI Button", category: "interactive", frontendOnly: true, canHaveChildren: false },
47
+ link: { description: "Anchor / Pressable navigation", category: "interactive", frontendOnly: true, canHaveChildren: false },
48
+ "action-icon": { description: "Mantine ActionIcon", category: "interactive", frontendOnly: true, canHaveChildren: false },
49
+ alert: { description: "Mantine Alert", category: "interactive", frontendOnly: true, canHaveChildren: true },
50
+ badge: { description: "Mantine Badge", category: "interactive", frontendOnly: true, canHaveChildren: false },
51
+ avatar: { description: "Mantine Avatar", category: "interactive", frontendOnly: true, canHaveChildren: false },
52
+ chip: { description: "Mantine Chip", category: "interactive", frontendOnly: true, canHaveChildren: false },
53
+ indicator: { description: "Mantine Indicator dot", category: "interactive", frontendOnly: true, canHaveChildren: true },
54
+ "theme-icon": { description: "Mantine ThemeIcon", category: "interactive", frontendOnly: true, canHaveChildren: false },
55
+ notification: { description: "Mantine Notification", category: "interactive", frontendOnly: true, canHaveChildren: false },
56
+ // ===== forms =====
57
+ "form-log": { description: "Append-only form (one row per submit)", category: "forms", frontendOnly: true, canHaveChildren: true },
58
+ "form-record": { description: "Per-user record form", category: "forms", frontendOnly: true, canHaveChildren: true },
59
+ input: { description: "Plain HTML input", category: "forms", frontendOnly: true, canHaveChildren: false },
60
+ "text-input": { description: "Mantine TextInput", category: "forms", frontendOnly: true, canHaveChildren: false },
61
+ textarea: { description: "Mantine Textarea", category: "forms", frontendOnly: true, canHaveChildren: false },
62
+ "rich-text-editor": { description: "Tiptap editor on web; READ-ONLY viewer on mobile v1", category: "forms", frontendOnly: true, canHaveChildren: false },
63
+ select: { description: "HTML select / Mantine Select", category: "forms", frontendOnly: true, canHaveChildren: false },
64
+ radio: { description: "Mantine Radio / RadioGroup", category: "forms", frontendOnly: true, canHaveChildren: false },
65
+ checkbox: { description: "Mantine Checkbox", category: "forms", frontendOnly: true, canHaveChildren: false },
66
+ slider: { description: "Mantine Slider", category: "forms", frontendOnly: true, canHaveChildren: false },
67
+ "range-slider": { description: "Mantine RangeSlider", category: "forms", frontendOnly: true, canHaveChildren: false },
68
+ datepicker: { description: "Mantine DatePicker", category: "forms", frontendOnly: true, canHaveChildren: false },
69
+ switch: { description: "Mantine Switch", category: "forms", frontendOnly: true, canHaveChildren: false },
70
+ combobox: { description: "Mantine Combobox", category: "forms", frontendOnly: true, canHaveChildren: false },
71
+ "color-input": { description: "Mantine ColorInput", category: "forms", frontendOnly: true, canHaveChildren: false },
72
+ "color-picker": { description: "Mantine ColorPicker", category: "forms", frontendOnly: true, canHaveChildren: false },
73
+ "file-input": { description: "Mantine FileInput / DocumentPicker on RN", category: "forms", frontendOnly: true, canHaveChildren: false },
74
+ "number-input": { description: "Mantine NumberInput", category: "forms", frontendOnly: true, canHaveChildren: false },
75
+ "segmented-control": { description: "Mantine SegmentedControl", category: "forms", frontendOnly: true, canHaveChildren: false },
76
+ rating: { description: "Mantine Rating", category: "forms", frontendOnly: true, canHaveChildren: false },
77
+ progress: { description: "Mantine Progress", category: "forms", frontendOnly: true, canHaveChildren: false },
78
+ "progress-root": { description: "Mantine Progress.Root", category: "forms", frontendOnly: true, canHaveChildren: true },
79
+ "progress-section": { description: "Mantine Progress.Section", category: "forms", frontendOnly: true, canHaveChildren: false },
80
+ // ===== composite =====
81
+ accordion: { description: "Mantine Accordion", category: "composite", frontendOnly: true, canHaveChildren: true },
82
+ "accordion-item": { description: "Mantine Accordion.Item", category: "composite", frontendOnly: true, canHaveChildren: true },
83
+ tabs: { description: "Mantine Tabs", category: "composite", frontendOnly: true, canHaveChildren: true },
84
+ tab: { description: "Mantine Tabs.Tab + Tabs.Panel pair", category: "composite", frontendOnly: true, canHaveChildren: true },
85
+ timeline: { description: "Mantine Timeline", category: "composite", frontendOnly: true, canHaveChildren: true },
86
+ list: { description: "Mantine List", category: "composite", frontendOnly: true, canHaveChildren: true },
87
+ "list-item": { description: "Mantine List.Item", category: "composite", frontendOnly: true, canHaveChildren: true },
88
+ entryList: { description: "Data-driven list of entries (form-log table)", category: "composite", frontendOnly: true, canHaveChildren: true },
89
+ entryRecord: { description: "Single-record container", category: "composite", frontendOnly: true, canHaveChildren: true },
90
+ entryRecordDelete: { description: "Inline delete confirmation for an entry", category: "composite", frontendOnly: true, canHaveChildren: false },
91
+ loop: { description: "Loop / repeater over backend-provided rows", category: "composite", frontendOnly: true, canHaveChildren: true }
92
+ };
93
+
94
+ // src/registry/index.ts
95
+ function getRegistryEntry(name) {
96
+ return STYLE_REGISTRY[name];
97
+ }
98
+ function isKnownStyleName(name) {
99
+ return Object.prototype.hasOwnProperty.call(STYLE_REGISTRY, name);
100
+ }
101
+ export {
102
+ STYLE_REGISTRY,
103
+ getRegistryEntry,
104
+ isKnownStyleName
105
+ };
@@ -0,0 +1,63 @@
1
+ import { a as TMantineSize } from '../common-B96dASgu.mjs';
2
+ export { sharedTailwindExtend, sharedTailwindPreset } from './tailwind.mjs';
3
+
4
+ /**
5
+ * Mantine semantic token tables. Both the web Mantine theme and the
6
+ * mobile HeroUI Native theme extend these so a `mantine_size: 'md'` on a
7
+ * section renders identical sizing regardless of platform.
8
+ *
9
+ * Pixel values come straight from Mantine v9 defaults:
10
+ * https://mantine.dev/theming/sizes/
11
+ */
12
+
13
+ /** Canonical spacing tokens (without the `string` escape hatch). */
14
+ type TCanonicalSpacing = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
15
+ type TCanonicalRadius = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
16
+ type TCanonicalColor = 'gray' | 'red' | 'pink' | 'grape' | 'violet' | 'indigo' | 'blue' | 'cyan' | 'teal' | 'green' | 'lime' | 'yellow' | 'orange' | 'dark';
17
+ /** xs..xl -> font-size px (Mantine `theme.fontSizes`). */
18
+ declare const FONT_SIZE_PX: Record<TMantineSize, number>;
19
+ /** xs..xl -> line-height. */
20
+ declare const LINE_HEIGHT: Record<TMantineSize, number>;
21
+ /** xs..xl -> spacing px (Mantine `theme.spacing`). */
22
+ declare const SPACING_PX: Record<TCanonicalSpacing, number>;
23
+ /** Mantine spacing -> Tailwind spacing class suffix. */
24
+ declare const SPACING_TO_TAILWIND: Record<TCanonicalSpacing, string>;
25
+ /** xs..xl -> border-radius px. */
26
+ declare const RADIUS_PX: Record<TCanonicalRadius, number>;
27
+ /** Mantine container size -> max-width px. */
28
+ declare const CONTAINER_SIZE_PX: Record<TMantineSize, number>;
29
+ /**
30
+ * Mantine palette base colors (color-6 from each scale). Each renderer
31
+ * maps these to its own theme tokens. For HeroUI Native we feed these
32
+ * into the theme builder so `mantine_color: 'blue'` resolves to the
33
+ * same Mantine-blue look on mobile.
34
+ */
35
+ declare const COLOR_PALETTE: Record<TCanonicalColor, string>;
36
+ /**
37
+ * Full Mantine color scales (0..9). The renderer can pick a shade
38
+ * (default 6 for `light`/`filled`).
39
+ */
40
+ declare const COLOR_SCALES: Record<TCanonicalColor, readonly string[]>;
41
+ interface ISpacingResolved {
42
+ mt?: number | string;
43
+ mb?: number | string;
44
+ ms?: number | string;
45
+ me?: number | string;
46
+ pt?: number | string;
47
+ pb?: number | string;
48
+ ps?: number | string;
49
+ pe?: number | string;
50
+ }
51
+ /** Resolve a spacing token (xs..xl/none) to a px value, passing through any non-Mantine string verbatim. */
52
+ declare function spacingToPx(token: string | undefined): number | string | undefined;
53
+ /** Resolve a Mantine size to a font-size px value, passing through any non-Mantine string verbatim. */
54
+ declare function sizeToFontPx(token: string | undefined): number | string | undefined;
55
+ /** Resolve a Mantine radius to a px value, passing through any non-Mantine string verbatim. */
56
+ declare function radiusToPx(token: string | undefined): number | string | undefined;
57
+ /**
58
+ * Resolve a Mantine palette color name + optional shade index to a hex
59
+ * string. Passes raw hex/css color values through unchanged.
60
+ */
61
+ declare function colorToHex(name: string | undefined, shade?: number): string | undefined;
62
+
63
+ export { COLOR_PALETTE, COLOR_SCALES, CONTAINER_SIZE_PX, FONT_SIZE_PX, type ISpacingResolved, LINE_HEIGHT, RADIUS_PX, SPACING_PX, SPACING_TO_TAILWIND, type TCanonicalColor, type TCanonicalRadius, type TCanonicalSpacing, colorToHex, radiusToPx, sizeToFontPx, spacingToPx };
@@ -0,0 +1,63 @@
1
+ import { a as TMantineSize } from '../common-B96dASgu.js';
2
+ export { sharedTailwindExtend, sharedTailwindPreset } from './tailwind.js';
3
+
4
+ /**
5
+ * Mantine semantic token tables. Both the web Mantine theme and the
6
+ * mobile HeroUI Native theme extend these so a `mantine_size: 'md'` on a
7
+ * section renders identical sizing regardless of platform.
8
+ *
9
+ * Pixel values come straight from Mantine v9 defaults:
10
+ * https://mantine.dev/theming/sizes/
11
+ */
12
+
13
+ /** Canonical spacing tokens (without the `string` escape hatch). */
14
+ type TCanonicalSpacing = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
15
+ type TCanonicalRadius = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
16
+ type TCanonicalColor = 'gray' | 'red' | 'pink' | 'grape' | 'violet' | 'indigo' | 'blue' | 'cyan' | 'teal' | 'green' | 'lime' | 'yellow' | 'orange' | 'dark';
17
+ /** xs..xl -> font-size px (Mantine `theme.fontSizes`). */
18
+ declare const FONT_SIZE_PX: Record<TMantineSize, number>;
19
+ /** xs..xl -> line-height. */
20
+ declare const LINE_HEIGHT: Record<TMantineSize, number>;
21
+ /** xs..xl -> spacing px (Mantine `theme.spacing`). */
22
+ declare const SPACING_PX: Record<TCanonicalSpacing, number>;
23
+ /** Mantine spacing -> Tailwind spacing class suffix. */
24
+ declare const SPACING_TO_TAILWIND: Record<TCanonicalSpacing, string>;
25
+ /** xs..xl -> border-radius px. */
26
+ declare const RADIUS_PX: Record<TCanonicalRadius, number>;
27
+ /** Mantine container size -> max-width px. */
28
+ declare const CONTAINER_SIZE_PX: Record<TMantineSize, number>;
29
+ /**
30
+ * Mantine palette base colors (color-6 from each scale). Each renderer
31
+ * maps these to its own theme tokens. For HeroUI Native we feed these
32
+ * into the theme builder so `mantine_color: 'blue'` resolves to the
33
+ * same Mantine-blue look on mobile.
34
+ */
35
+ declare const COLOR_PALETTE: Record<TCanonicalColor, string>;
36
+ /**
37
+ * Full Mantine color scales (0..9). The renderer can pick a shade
38
+ * (default 6 for `light`/`filled`).
39
+ */
40
+ declare const COLOR_SCALES: Record<TCanonicalColor, readonly string[]>;
41
+ interface ISpacingResolved {
42
+ mt?: number | string;
43
+ mb?: number | string;
44
+ ms?: number | string;
45
+ me?: number | string;
46
+ pt?: number | string;
47
+ pb?: number | string;
48
+ ps?: number | string;
49
+ pe?: number | string;
50
+ }
51
+ /** Resolve a spacing token (xs..xl/none) to a px value, passing through any non-Mantine string verbatim. */
52
+ declare function spacingToPx(token: string | undefined): number | string | undefined;
53
+ /** Resolve a Mantine size to a font-size px value, passing through any non-Mantine string verbatim. */
54
+ declare function sizeToFontPx(token: string | undefined): number | string | undefined;
55
+ /** Resolve a Mantine radius to a px value, passing through any non-Mantine string verbatim. */
56
+ declare function radiusToPx(token: string | undefined): number | string | undefined;
57
+ /**
58
+ * Resolve a Mantine palette color name + optional shade index to a hex
59
+ * string. Passes raw hex/css color values through unchanged.
60
+ */
61
+ declare function colorToHex(name: string | undefined, shade?: number): string | undefined;
62
+
63
+ export { COLOR_PALETTE, COLOR_SCALES, CONTAINER_SIZE_PX, FONT_SIZE_PX, type ISpacingResolved, LINE_HEIGHT, RADIUS_PX, SPACING_PX, SPACING_TO_TAILWIND, type TCanonicalColor, type TCanonicalRadius, type TCanonicalSpacing, colorToHex, radiusToPx, sizeToFontPx, spacingToPx };
@@ -0,0 +1,202 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/theme/index.ts
21
+ var theme_exports = {};
22
+ __export(theme_exports, {
23
+ COLOR_PALETTE: () => COLOR_PALETTE,
24
+ COLOR_SCALES: () => COLOR_SCALES,
25
+ CONTAINER_SIZE_PX: () => CONTAINER_SIZE_PX,
26
+ FONT_SIZE_PX: () => FONT_SIZE_PX,
27
+ LINE_HEIGHT: () => LINE_HEIGHT,
28
+ RADIUS_PX: () => RADIUS_PX,
29
+ SPACING_PX: () => SPACING_PX,
30
+ SPACING_TO_TAILWIND: () => SPACING_TO_TAILWIND,
31
+ colorToHex: () => colorToHex,
32
+ radiusToPx: () => radiusToPx,
33
+ sharedTailwindExtend: () => sharedTailwindExtend,
34
+ sharedTailwindPreset: () => sharedTailwindPreset,
35
+ sizeToFontPx: () => sizeToFontPx,
36
+ spacingToPx: () => spacingToPx
37
+ });
38
+ module.exports = __toCommonJS(theme_exports);
39
+
40
+ // src/theme/tokens.ts
41
+ var FONT_SIZE_PX = {
42
+ xs: 12,
43
+ sm: 14,
44
+ md: 16,
45
+ lg: 18,
46
+ xl: 20
47
+ };
48
+ var LINE_HEIGHT = {
49
+ xs: 1.4,
50
+ sm: 1.45,
51
+ md: 1.55,
52
+ lg: 1.6,
53
+ xl: 1.65
54
+ };
55
+ var SPACING_PX = {
56
+ none: 0,
57
+ xs: 10,
58
+ sm: 12,
59
+ md: 16,
60
+ lg: 20,
61
+ xl: 32
62
+ };
63
+ var SPACING_TO_TAILWIND = {
64
+ none: "0",
65
+ xs: "2.5",
66
+ sm: "3",
67
+ md: "4",
68
+ lg: "5",
69
+ xl: "8"
70
+ };
71
+ var RADIUS_PX = {
72
+ xs: 2,
73
+ sm: 4,
74
+ md: 8,
75
+ lg: 16,
76
+ xl: 32
77
+ };
78
+ var CONTAINER_SIZE_PX = {
79
+ xs: 540,
80
+ sm: 720,
81
+ md: 960,
82
+ lg: 1140,
83
+ xl: 1320
84
+ };
85
+ var COLOR_PALETTE = {
86
+ gray: "#868e96",
87
+ red: "#fa5252",
88
+ pink: "#e64980",
89
+ grape: "#be4bdb",
90
+ violet: "#7950f2",
91
+ indigo: "#4c6ef5",
92
+ blue: "#228be6",
93
+ cyan: "#15aabf",
94
+ teal: "#12b886",
95
+ green: "#40c057",
96
+ lime: "#82c91e",
97
+ yellow: "#fab005",
98
+ orange: "#fd7e14",
99
+ dark: "#212529"
100
+ };
101
+ var COLOR_SCALES = {
102
+ gray: ["#f8f9fa", "#f1f3f5", "#e9ecef", "#dee2e6", "#ced4da", "#adb5bd", "#868e96", "#495057", "#343a40", "#212529"],
103
+ red: ["#fff5f5", "#ffe3e3", "#ffc9c9", "#ffa8a8", "#ff8787", "#ff6b6b", "#fa5252", "#f03e3e", "#e03131", "#c92a2a"],
104
+ pink: ["#fff0f6", "#ffdeeb", "#fcc2d7", "#faa2c1", "#f783ac", "#f06595", "#e64980", "#d6336c", "#c2255c", "#a61e4d"],
105
+ grape: ["#f8f0fc", "#f3d9fa", "#eebefa", "#e599f7", "#da77f2", "#cc5de8", "#be4bdb", "#ae3ec9", "#9c36b5", "#862e9c"],
106
+ violet: ["#f3f0ff", "#e5dbff", "#d0bfff", "#b197fc", "#9775fa", "#845ef7", "#7950f2", "#7048e8", "#6741d9", "#5f3dc4"],
107
+ indigo: ["#edf2ff", "#dbe4ff", "#bac8ff", "#91a7ff", "#748ffc", "#5c7cfa", "#4c6ef5", "#4263eb", "#3b5bdb", "#364fc7"],
108
+ blue: ["#e7f5ff", "#d0ebff", "#a5d8ff", "#74c0fc", "#4dabf7", "#339af0", "#228be6", "#1c7ed6", "#1971c2", "#1864ab"],
109
+ cyan: ["#e3fafc", "#c5f6fa", "#99e9f2", "#66d9e8", "#3bc9db", "#22b8cf", "#15aabf", "#1098ad", "#0c8599", "#0b7285"],
110
+ teal: ["#e6fcf5", "#c3fae8", "#96f2d7", "#63e6be", "#38d9a9", "#20c997", "#12b886", "#0ca678", "#099268", "#087f5b"],
111
+ green: ["#ebfbee", "#d3f9d8", "#b2f2bb", "#8ce99a", "#69db7c", "#51cf66", "#40c057", "#37b24d", "#2f9e44", "#2b8a3e"],
112
+ lime: ["#f4fce3", "#e9fac8", "#d8f5a2", "#c0eb75", "#a9e34b", "#94d82d", "#82c91e", "#74b816", "#66a80f", "#5c940d"],
113
+ yellow: ["#fff9db", "#fff3bf", "#ffec99", "#ffe066", "#ffd43b", "#fcc419", "#fab005", "#f59f00", "#f08c00", "#e67700"],
114
+ orange: ["#fff4e6", "#ffe8cc", "#ffd8a8", "#ffc078", "#ffa94d", "#ff922b", "#fd7e14", "#f76707", "#e8590c", "#d9480f"],
115
+ dark: ["#c1c2c5", "#a6a7ab", "#909296", "#5c5f66", "#373a40", "#2c2e33", "#25262b", "#1a1b1e", "#141517", "#101113"]
116
+ };
117
+ function spacingToPx(token) {
118
+ if (!token || token === "none") return void 0;
119
+ if (token in SPACING_PX) return SPACING_PX[token];
120
+ return token;
121
+ }
122
+ function sizeToFontPx(token) {
123
+ if (!token) return void 0;
124
+ if (token in FONT_SIZE_PX) return FONT_SIZE_PX[token];
125
+ return token;
126
+ }
127
+ function radiusToPx(token) {
128
+ if (!token) return void 0;
129
+ if (token in RADIUS_PX) return RADIUS_PX[token];
130
+ return token;
131
+ }
132
+ function colorToHex(name, shade = 6) {
133
+ if (!name) return void 0;
134
+ if (name.startsWith("#") || name.startsWith("rgb") || name.startsWith("hsl")) return name;
135
+ const scale = COLOR_SCALES[name];
136
+ if (!scale) return name;
137
+ return scale[Math.max(0, Math.min(9, shade))];
138
+ }
139
+
140
+ // src/theme/tailwind.ts
141
+ var px = (n) => n === void 0 ? "0px" : `${n}px`;
142
+ var colorScaleToTailwind = (scale) => {
143
+ const out = {};
144
+ scale.forEach((value, idx) => {
145
+ out[String(idx)] = value;
146
+ });
147
+ return out;
148
+ };
149
+ var colors = {};
150
+ for (const [name, scale] of Object.entries(COLOR_SCALES)) {
151
+ colors[name] = colorScaleToTailwind(scale);
152
+ }
153
+ var spacing = {
154
+ none: px(SPACING_PX.none),
155
+ xs: px(SPACING_PX.xs),
156
+ sm: px(SPACING_PX.sm),
157
+ md: px(SPACING_PX.md),
158
+ lg: px(SPACING_PX.lg),
159
+ xl: px(SPACING_PX.xl)
160
+ };
161
+ var borderRadius = {
162
+ xs: px(RADIUS_PX.xs),
163
+ sm: px(RADIUS_PX.sm),
164
+ md: px(RADIUS_PX.md),
165
+ lg: px(RADIUS_PX.lg),
166
+ xl: px(RADIUS_PX.xl)
167
+ };
168
+ var fontSize = {
169
+ xs: [px(FONT_SIZE_PX.xs), { lineHeight: String(LINE_HEIGHT.xs) }],
170
+ sm: [px(FONT_SIZE_PX.sm), { lineHeight: String(LINE_HEIGHT.sm) }],
171
+ md: [px(FONT_SIZE_PX.md), { lineHeight: String(LINE_HEIGHT.md) }],
172
+ lg: [px(FONT_SIZE_PX.lg), { lineHeight: String(LINE_HEIGHT.lg) }],
173
+ xl: [px(FONT_SIZE_PX.xl), { lineHeight: String(LINE_HEIGHT.xl) }]
174
+ };
175
+ var sharedTailwindExtend = {
176
+ colors,
177
+ spacing,
178
+ borderRadius,
179
+ fontSize
180
+ };
181
+ var sharedTailwindPreset = {
182
+ theme: {
183
+ extend: sharedTailwindExtend
184
+ }
185
+ };
186
+ // Annotate the CommonJS export names for ESM import in node:
187
+ 0 && (module.exports = {
188
+ COLOR_PALETTE,
189
+ COLOR_SCALES,
190
+ CONTAINER_SIZE_PX,
191
+ FONT_SIZE_PX,
192
+ LINE_HEIGHT,
193
+ RADIUS_PX,
194
+ SPACING_PX,
195
+ SPACING_TO_TAILWIND,
196
+ colorToHex,
197
+ radiusToPx,
198
+ sharedTailwindExtend,
199
+ sharedTailwindPreset,
200
+ sizeToFontPx,
201
+ spacingToPx
202
+ });