@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,80 @@
1
+ /**
2
+ * Shared Mantine semantic types used by both web (Mantine v9) and mobile
3
+ * (HeroUI Native + Uniwind, where these are mapped through the theme tokens).
4
+ *
5
+ * Whenever a value here changes, both renderers must update their token
6
+ * mapping in `src/theme/tokens.ts`.
7
+ */
8
+ type TMantineSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
9
+ type TMantineRadius = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | string;
10
+ type TMantineSpacing = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'none' | string;
11
+ type TMantineVariant = 'default' | 'filled' | 'light' | 'outline' | 'subtle' | 'transparent' | 'white' | 'gradient';
12
+ type TMantineColor = 'gray' | 'red' | 'pink' | 'grape' | 'violet' | 'indigo' | 'blue' | 'cyan' | 'teal' | 'green' | 'lime' | 'yellow' | 'orange' | 'dark' | string;
13
+ type TMantineOrientation = 'horizontal' | 'vertical';
14
+ type TMantineDirection = 'row' | 'column' | 'row-reverse' | 'column-reverse';
15
+ type TMantineWrap = 'nowrap' | 'wrap' | 'wrap-reverse';
16
+ type TMantineJustify = 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly';
17
+ type TMantineAlign = 'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline';
18
+ type TMantineColorFormat = 'hex' | 'rgba' | 'rgb' | 'hsl' | 'hsla';
19
+ type TMantineGridSpan = 'auto' | 'content' | string;
20
+ type TMantineGridOverflow = 'visible' | 'hidden';
21
+ type TMantineTabsVariant = 'default' | 'outline' | 'pills';
22
+ type TMantineFileAccept = 'image/*' | 'video/*' | 'audio/*' | 'application/pdf' | string;
23
+ type TMantineClampBehavior = 'strict' | 'blur' | 'none';
24
+ type TMantineChipVariant = 'filled' | 'outline' | 'light';
25
+ type TMantineFieldsetVariant = 'default' | 'filled' | 'unstyled';
26
+ type TMantineAccordionVariant = 'default' | 'contained' | 'filled' | 'separated';
27
+ type TMantineAvatarVariant = 'default' | 'filled' | 'light' | 'outline' | 'subtle' | 'transparent' | 'white';
28
+ type TMantineBadgeVariant = 'default' | 'filled' | 'light' | 'outline' | 'dot' | 'transparent' | 'white' | 'gradient';
29
+ type TMantineIndicatorPosition = 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'top-center' | 'bottom-center' | 'middle-start' | 'middle-end';
30
+ type TMantineKbdSize = TMantineSize;
31
+ type TMantineThemeIconVariant = TMantineVariant;
32
+ type TMantineTimelineLineVariant = 'solid' | 'dashed' | 'dotted';
33
+ type TMantineTitleOrder = '1' | '2' | '3' | '4' | '5' | '6';
34
+ type TMantineCodeBlock = '0' | '1';
35
+ type TMantineHighlight = string;
36
+ type TMantineSpoilerMaxHeight = string;
37
+ type TMantineRatingCount = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | string;
38
+ type TMantineRatingFractions = '1' | '2' | '3' | '4' | '5' | string;
39
+ type TMantineNotificationWithCloseButton = '0' | '1';
40
+ type TMantineAspectRatio = string;
41
+ type TMantineColorPickerSwatchesPerRow = string;
42
+ type TMantineActionIconLoading = '0' | '1';
43
+ type TMantineGroupWrap = '0' | '1';
44
+ type TMantineGroupGrow = '0' | '1';
45
+ type TMantineGridGrow = '0' | '1';
46
+ type TMantineTabDisabled = '0' | '1';
47
+ type TMantineColorInputSwatches = string;
48
+ type TMantineColorPickerSwatches = string;
49
+ type TMantineFileInputMultiple = '0' | '1';
50
+ type TMantineNumberInputDecimalScale = string;
51
+ type TMantineRangeSliderMarks = string;
52
+ type TMantineChipChecked = '0' | '1';
53
+ type TMantineChipMultiple = '0' | '1';
54
+ type TMantineRatingReadonly = '0' | '1';
55
+ type TMantineSpaceHorizontal = '0' | '1';
56
+ type TMantineCenterInline = '0' | '1';
57
+ type TMantineContainerFluid = '0' | '1';
58
+ type TMantineFullWidth = '0' | '1';
59
+ type TMantineCompact = '0' | '1';
60
+ type TMantineAutoContrast = '0' | '1';
61
+ type TMantineIsLink = '0' | '1';
62
+ type TMantineUseMantineStyle = '0' | '1';
63
+ type TMantineDisabled = '0' | '1';
64
+ type TMantineOpenInNewTab = '0' | '1';
65
+ type TMantineLoading = '0' | '1';
66
+ type TMantineMultiple = '0' | '1';
67
+ type TMantineChecked = '0' | '1';
68
+ type TMantineReadonly = '0' | '1';
69
+ type TMantineWithCloseButton = '0' | '1';
70
+ type TMantineProcessing = '0' | '1';
71
+ type TMantineBlock = '0' | '1';
72
+ type TMantineWithIcon = '0' | '1';
73
+ type TMantineAllowStepClick = '0' | '1';
74
+ type TMantineAllowNextClicks = '0' | '1';
75
+ type TMantineSwatches = string;
76
+ type TMantineGrow = '0' | '1';
77
+ type TMantineInline = '0' | '1';
78
+ type TMantineFluid = '0' | '1';
79
+
80
+ export type { TMantineKbdSize as $, TMantineBlock as A, TMantineCenterInline as B, TMantineChecked as C, TMantineChipChecked as D, TMantineChipMultiple as E, TMantineClampBehavior as F, TMantineCodeBlock as G, TMantineColorFormat as H, TMantineColorInputSwatches as I, TMantineColorPickerSwatches as J, TMantineColorPickerSwatchesPerRow as K, TMantineCompact as L, TMantineContainerFluid as M, TMantineDisabled as N, TMantineFileAccept as O, TMantineFileInputMultiple as P, TMantineFluid as Q, TMantineFullWidth as R, TMantineGridGrow as S, TMantineRadius as T, TMantineGridOverflow as U, TMantineGroupGrow as V, TMantineGroupWrap as W, TMantineGrow as X, TMantineHighlight as Y, TMantineInline as Z, TMantineIsLink as _, TMantineSize as a, TMantineLoading as a0, TMantineMultiple as a1, TMantineNotificationWithCloseButton as a2, TMantineNumberInputDecimalScale as a3, TMantineOpenInNewTab as a4, TMantineProcessing as a5, TMantineRangeSliderMarks as a6, TMantineRatingCount as a7, TMantineRatingFractions as a8, TMantineRatingReadonly as a9, TMantineReadonly as aa, TMantineSpaceHorizontal as ab, TMantineSwatches as ac, TMantineTabDisabled as ad, TMantineUseMantineStyle as ae, TMantineWithCloseButton as af, TMantineWithIcon as ag, TMantineSpacing as b, TMantineJustify as c, TMantineAlign as d, TMantineDirection as e, TMantineWrap as f, TMantineGridSpan as g, TMantineOrientation as h, TMantineColor as i, TMantineTitleOrder as j, TMantineFieldsetVariant as k, TMantineSpoilerMaxHeight as l, TMantineVariant as m, TMantineBadgeVariant as n, TMantineAvatarVariant as o, TMantineChipVariant as p, TMantineIndicatorPosition as q, TMantineThemeIconVariant as r, TMantineAccordionVariant as s, TMantineTabsVariant as t, TMantineTimelineLineVariant as u, TMantineActionIconLoading as v, TMantineAllowNextClicks as w, TMantineAllowStepClick as x, TMantineAspectRatio as y, TMantineAutoContrast as z };
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Shared Mantine semantic types used by both web (Mantine v9) and mobile
3
+ * (HeroUI Native + Uniwind, where these are mapped through the theme tokens).
4
+ *
5
+ * Whenever a value here changes, both renderers must update their token
6
+ * mapping in `src/theme/tokens.ts`.
7
+ */
8
+ type TMantineSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
9
+ type TMantineRadius = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | string;
10
+ type TMantineSpacing = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'none' | string;
11
+ type TMantineVariant = 'default' | 'filled' | 'light' | 'outline' | 'subtle' | 'transparent' | 'white' | 'gradient';
12
+ type TMantineColor = 'gray' | 'red' | 'pink' | 'grape' | 'violet' | 'indigo' | 'blue' | 'cyan' | 'teal' | 'green' | 'lime' | 'yellow' | 'orange' | 'dark' | string;
13
+ type TMantineOrientation = 'horizontal' | 'vertical';
14
+ type TMantineDirection = 'row' | 'column' | 'row-reverse' | 'column-reverse';
15
+ type TMantineWrap = 'nowrap' | 'wrap' | 'wrap-reverse';
16
+ type TMantineJustify = 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly';
17
+ type TMantineAlign = 'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline';
18
+ type TMantineColorFormat = 'hex' | 'rgba' | 'rgb' | 'hsl' | 'hsla';
19
+ type TMantineGridSpan = 'auto' | 'content' | string;
20
+ type TMantineGridOverflow = 'visible' | 'hidden';
21
+ type TMantineTabsVariant = 'default' | 'outline' | 'pills';
22
+ type TMantineFileAccept = 'image/*' | 'video/*' | 'audio/*' | 'application/pdf' | string;
23
+ type TMantineClampBehavior = 'strict' | 'blur' | 'none';
24
+ type TMantineChipVariant = 'filled' | 'outline' | 'light';
25
+ type TMantineFieldsetVariant = 'default' | 'filled' | 'unstyled';
26
+ type TMantineAccordionVariant = 'default' | 'contained' | 'filled' | 'separated';
27
+ type TMantineAvatarVariant = 'default' | 'filled' | 'light' | 'outline' | 'subtle' | 'transparent' | 'white';
28
+ type TMantineBadgeVariant = 'default' | 'filled' | 'light' | 'outline' | 'dot' | 'transparent' | 'white' | 'gradient';
29
+ type TMantineIndicatorPosition = 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'top-center' | 'bottom-center' | 'middle-start' | 'middle-end';
30
+ type TMantineKbdSize = TMantineSize;
31
+ type TMantineThemeIconVariant = TMantineVariant;
32
+ type TMantineTimelineLineVariant = 'solid' | 'dashed' | 'dotted';
33
+ type TMantineTitleOrder = '1' | '2' | '3' | '4' | '5' | '6';
34
+ type TMantineCodeBlock = '0' | '1';
35
+ type TMantineHighlight = string;
36
+ type TMantineSpoilerMaxHeight = string;
37
+ type TMantineRatingCount = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | string;
38
+ type TMantineRatingFractions = '1' | '2' | '3' | '4' | '5' | string;
39
+ type TMantineNotificationWithCloseButton = '0' | '1';
40
+ type TMantineAspectRatio = string;
41
+ type TMantineColorPickerSwatchesPerRow = string;
42
+ type TMantineActionIconLoading = '0' | '1';
43
+ type TMantineGroupWrap = '0' | '1';
44
+ type TMantineGroupGrow = '0' | '1';
45
+ type TMantineGridGrow = '0' | '1';
46
+ type TMantineTabDisabled = '0' | '1';
47
+ type TMantineColorInputSwatches = string;
48
+ type TMantineColorPickerSwatches = string;
49
+ type TMantineFileInputMultiple = '0' | '1';
50
+ type TMantineNumberInputDecimalScale = string;
51
+ type TMantineRangeSliderMarks = string;
52
+ type TMantineChipChecked = '0' | '1';
53
+ type TMantineChipMultiple = '0' | '1';
54
+ type TMantineRatingReadonly = '0' | '1';
55
+ type TMantineSpaceHorizontal = '0' | '1';
56
+ type TMantineCenterInline = '0' | '1';
57
+ type TMantineContainerFluid = '0' | '1';
58
+ type TMantineFullWidth = '0' | '1';
59
+ type TMantineCompact = '0' | '1';
60
+ type TMantineAutoContrast = '0' | '1';
61
+ type TMantineIsLink = '0' | '1';
62
+ type TMantineUseMantineStyle = '0' | '1';
63
+ type TMantineDisabled = '0' | '1';
64
+ type TMantineOpenInNewTab = '0' | '1';
65
+ type TMantineLoading = '0' | '1';
66
+ type TMantineMultiple = '0' | '1';
67
+ type TMantineChecked = '0' | '1';
68
+ type TMantineReadonly = '0' | '1';
69
+ type TMantineWithCloseButton = '0' | '1';
70
+ type TMantineProcessing = '0' | '1';
71
+ type TMantineBlock = '0' | '1';
72
+ type TMantineWithIcon = '0' | '1';
73
+ type TMantineAllowStepClick = '0' | '1';
74
+ type TMantineAllowNextClicks = '0' | '1';
75
+ type TMantineSwatches = string;
76
+ type TMantineGrow = '0' | '1';
77
+ type TMantineInline = '0' | '1';
78
+ type TMantineFluid = '0' | '1';
79
+
80
+ export type { TMantineKbdSize as $, TMantineBlock as A, TMantineCenterInline as B, TMantineChecked as C, TMantineChipChecked as D, TMantineChipMultiple as E, TMantineClampBehavior as F, TMantineCodeBlock as G, TMantineColorFormat as H, TMantineColorInputSwatches as I, TMantineColorPickerSwatches as J, TMantineColorPickerSwatchesPerRow as K, TMantineCompact as L, TMantineContainerFluid as M, TMantineDisabled as N, TMantineFileAccept as O, TMantineFileInputMultiple as P, TMantineFluid as Q, TMantineFullWidth as R, TMantineGridGrow as S, TMantineRadius as T, TMantineGridOverflow as U, TMantineGroupGrow as V, TMantineGroupWrap as W, TMantineGrow as X, TMantineHighlight as Y, TMantineInline as Z, TMantineIsLink as _, TMantineSize as a, TMantineLoading as a0, TMantineMultiple as a1, TMantineNotificationWithCloseButton as a2, TMantineNumberInputDecimalScale as a3, TMantineOpenInNewTab as a4, TMantineProcessing as a5, TMantineRangeSliderMarks as a6, TMantineRatingCount as a7, TMantineRatingFractions as a8, TMantineRatingReadonly as a9, TMantineReadonly as aa, TMantineSpaceHorizontal as ab, TMantineSwatches as ac, TMantineTabDisabled as ad, TMantineUseMantineStyle as ae, TMantineWithCloseButton as af, TMantineWithIcon as ag, TMantineSpacing as b, TMantineJustify as c, TMantineAlign as d, TMantineDirection as e, TMantineWrap as f, TMantineGridSpan as g, TMantineOrientation as h, TMantineColor as i, TMantineTitleOrder as j, TMantineFieldsetVariant as k, TMantineSpoilerMaxHeight as l, TMantineVariant as m, TMantineBadgeVariant as n, TMantineAvatarVariant as o, TMantineChipVariant as p, TMantineIndicatorPosition as q, TMantineThemeIconVariant as r, TMantineAccordionVariant as s, TMantineTabsVariant as t, TMantineTimelineLineVariant as u, TMantineActionIconLoading as v, TMantineAllowNextClicks as w, TMantineAllowStepClick as x, TMantineAspectRatio as y, TMantineAutoContrast as z };