@mrmeg/expo-ui 0.14.0 → 0.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.
Files changed (54) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +6 -6
  3. package/dist/components/Accordion.d.ts +1 -1
  4. package/dist/components/Accordion.js +25 -19
  5. package/dist/components/Badge.js +6 -5
  6. package/dist/components/BottomSheet.js +21 -19
  7. package/dist/components/Button.d.ts +2 -1
  8. package/dist/components/Button.js +14 -4
  9. package/dist/components/Checkbox.js +49 -19
  10. package/dist/components/Collapsible.d.ts +1 -1
  11. package/dist/components/Collapsible.js +22 -16
  12. package/dist/components/Drawer.js +8 -7
  13. package/dist/components/DropdownMenu.d.ts +1 -1
  14. package/dist/components/DropdownMenu.js +80 -59
  15. package/dist/components/EmptyState.d.ts +7 -1
  16. package/dist/components/EmptyState.js +23 -7
  17. package/dist/components/InputOTP.js +6 -2
  18. package/dist/components/Item.d.ts +93 -0
  19. package/dist/components/Item.js +125 -0
  20. package/dist/components/Label.js +7 -2
  21. package/dist/components/Notification.js +10 -22
  22. package/dist/components/Popover.d.ts +3 -18
  23. package/dist/components/Popover.js +10 -6
  24. package/dist/components/RadioGroup.js +49 -22
  25. package/dist/components/SectionHeader.d.ts +42 -0
  26. package/dist/components/SectionHeader.js +41 -0
  27. package/dist/components/Select.js +73 -41
  28. package/dist/components/Skeleton.js +2 -2
  29. package/dist/components/StatCard.d.ts +45 -0
  30. package/dist/components/StatCard.js +41 -0
  31. package/dist/components/StyledText.d.ts +20 -10
  32. package/dist/components/StyledText.js +64 -25
  33. package/dist/components/Switch.js +84 -57
  34. package/dist/components/Tabs.js +43 -12
  35. package/dist/components/TextInput.js +8 -9
  36. package/dist/components/Toggle.js +69 -42
  37. package/dist/components/ToggleGroup.js +82 -55
  38. package/dist/components/index.d.ts +3 -0
  39. package/dist/components/index.js +3 -0
  40. package/dist/constants/fonts.d.ts +3 -0
  41. package/dist/constants/fonts.js +35 -12
  42. package/dist/constants/index.d.ts +1 -0
  43. package/dist/constants/index.js +1 -0
  44. package/dist/constants/motion.d.ts +24 -0
  45. package/dist/constants/motion.js +24 -0
  46. package/dist/constants/spacing.d.ts +7 -7
  47. package/dist/constants/spacing.js +7 -7
  48. package/dist/hooks/useResources.d.ts +4 -2
  49. package/dist/hooks/useResources.js +30 -8
  50. package/dist/hooks/useStaggeredEntrance.d.ts +1 -1
  51. package/dist/hooks/useStaggeredEntrance.js +2 -1
  52. package/dist/hooks/useTheme.d.ts +1 -1
  53. package/dist/hooks/useTheme.js +53 -16
  54. package/package.json +20 -19
@@ -42,7 +42,7 @@ function getCachedOrCompute(key, compute) {
42
42
  * - getTextColorForBackground("#000") → "light"
43
43
  * - getContrastingColor("#f4f4f4", "#222", "#fff") → "#222"
44
44
  * - withAlpha("#336699", 0.6) → "rgba(51,102,153,0.6)"
45
- * - getShadowStyle('base') → { boxShadow: "0px 1px 3px rgba(0, 0, 0, 0.1)" }
45
+ * - getShadowStyle('base') → { boxShadow: "0px 2px 6px rgba(0, 0, 0, 0.05), 0px 4px 12px rgba(0, 0, 0, 0.03)" }
46
46
  */
47
47
  export function useTheme() {
48
48
  const userTheme = useThemeStore((s) => s.userTheme);
@@ -100,29 +100,66 @@ export function useTheme() {
100
100
  * `boxShadow` has no separate opacity field, each preset's opacity is folded
101
101
  * into the color's alpha via `withAlpha`. `elevation` is dropped — `boxShadow`
102
102
  * renders shadows on Android in 0.85+.
103
+ *
104
+ * Every preset (except `sharp` and `glow`, which are deliberately
105
+ * single-layer) is a dual-layer shadow: a tight "contact" layer plus a
106
+ * wider, softer "ambient" layer, pitsi-ui-style. Layers are comma-joined
107
+ * into one `boxShadow` value.
103
108
  */
104
109
  const getShadowStyle = useCallback((type) => {
105
- // Each preset: [offsetX, offsetY, blurRadius, color, opacity].
110
+ // Each preset is one or more layers of [offsetX, offsetY, blurRadius, color, opacity].
106
111
  // Darker themes get a stronger alpha so shadows stay visible.
107
112
  const boost = theme.dark ? 3 : 1;
108
113
  const overlay = theme.colors.overlay;
109
114
  const shadowConfigs = {
110
- base: { x: 0, y: 1, blur: 3, color: overlay, opacity: 0.1 },
111
- soft: { x: 0, y: 4, blur: 6, color: overlay, opacity: 0.1 },
112
- sharp: { x: 0, y: 1, blur: 1, color: overlay, opacity: 0.15 },
113
- subtle: { x: 0, y: 1, blur: 2, color: overlay, opacity: 0.05 },
114
- elevated: { x: 0, y: 20, blur: 40, color: overlay, opacity: 0.15 },
115
- glow: { x: 0, y: 4, blur: 20, color: theme.colors.primary, opacity: 0.4 },
116
- glass: { x: 0, y: 4, blur: 30, color: overlay, opacity: 0.05 },
117
- card: { x: 0, y: 2, blur: 8, color: overlay, opacity: 0.08 },
118
- cardHover: { x: 0, y: 8, blur: 24, color: overlay, opacity: 0.12 },
119
- cardSubtle: { x: 0, y: 1, blur: 3, color: overlay, opacity: 0.08 },
115
+ subtle: [
116
+ { x: 0, y: 1, blur: 3, color: overlay, opacity: 0.04 },
117
+ { x: 0, y: 2, blur: 8, color: overlay, opacity: 0.03 },
118
+ ],
119
+ base: [
120
+ { x: 0, y: 2, blur: 6, color: overlay, opacity: 0.05 },
121
+ { x: 0, y: 4, blur: 12, color: overlay, opacity: 0.03 },
122
+ ],
123
+ soft: [
124
+ { x: 0, y: 4, blur: 10, color: overlay, opacity: 0.05 },
125
+ { x: 0, y: 8, blur: 20, color: overlay, opacity: 0.03 },
126
+ ],
127
+ card: [
128
+ { x: 0, y: 4, blur: 12, color: overlay, opacity: 0.05 },
129
+ { x: 0, y: 8, blur: 24, color: overlay, opacity: 0.03 },
130
+ ],
131
+ cardSubtle: [
132
+ { x: 0, y: 1, blur: 3, color: overlay, opacity: 0.05 },
133
+ { x: 0, y: 3, blur: 9, color: overlay, opacity: 0.03 },
134
+ ],
135
+ cardHover: [
136
+ { x: 0, y: 8, blur: 24, color: overlay, opacity: 0.06 },
137
+ { x: 0, y: 16, blur: 48, color: overlay, opacity: 0.04 },
138
+ ],
139
+ elevated: [
140
+ { x: 0, y: 16, blur: 48, color: overlay, opacity: 0.08 },
141
+ { x: 0, y: 32, blur: 96, color: overlay, opacity: 0.05 },
142
+ ],
143
+ glass: [
144
+ { x: 0, y: 4, blur: 30, color: overlay, opacity: 0.05 },
145
+ { x: 0, y: 8, blur: 60, color: overlay, opacity: 0.03 },
146
+ ],
147
+ // Single layer — intentional crispness, not a soft dual-layer shadow.
148
+ sharp: [
149
+ { x: 0, y: 1, blur: 1, color: overlay, opacity: 0.15 },
150
+ ],
151
+ // Single layer — already a deliberate, vivid accent glow.
152
+ glow: [
153
+ { x: 0, y: 4, blur: 20, color: theme.colors.primary, opacity: 0.4 },
154
+ ],
120
155
  };
121
- const { x, y, blur, color, opacity } = shadowConfigs[type];
122
- // Don't boost the glow accent — it's already a deliberate, vivid alpha.
123
- const alpha = color === theme.colors.primary ? opacity : Math.min(opacity * boost, 1);
156
+ const layers = shadowConfigs[type].map(({ x, y, blur, color, opacity }) => {
157
+ // Don't boost the glow accent — it's already a deliberate, vivid alpha.
158
+ const alpha = color === theme.colors.primary ? opacity : Math.min(opacity * boost, 1);
159
+ return `${x}px ${y}px ${blur}px ${withAlpha(color, alpha)}`;
160
+ });
124
161
  return {
125
- boxShadow: `${x}px ${y}px ${blur}px ${withAlpha(color, alpha)}`,
162
+ boxShadow: layers.join(", "),
126
163
  };
127
164
  }, [theme]);
128
165
  const getFocusRingStyle = useCallback((offset = 2) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrmeg/expo-ui",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "private": false,
5
5
  "description": "Reusable Expo and React Native UI primitives for MrMeg projects.",
6
6
  "keywords": [
@@ -88,25 +88,26 @@
88
88
  "publish:dry-run": "bun pm pack --dry-run"
89
89
  },
90
90
  "dependencies": {
91
+ "@expo-google-fonts/inter": "^0.4.2",
91
92
  "@expo/vector-icons": ">=15.0.0 <16.0.0",
92
- "@rn-primitives/accordion": "~1.4.0",
93
- "@rn-primitives/alert-dialog": "~1.4.0",
94
- "@rn-primitives/checkbox": "~1.4.0",
95
- "@rn-primitives/collapsible": "~1.4.0",
96
- "@rn-primitives/dialog": "~1.4.0",
97
- "@rn-primitives/dropdown-menu": "~1.4.0",
98
- "@rn-primitives/label": "~1.4.0",
99
- "@rn-primitives/popover": "~1.4.0",
100
- "@rn-primitives/portal": "~1.4.0",
101
- "@rn-primitives/radio-group": "~1.4.0",
102
- "@rn-primitives/select": "~1.4.0",
103
- "@rn-primitives/separator": "~1.4.0",
104
- "@rn-primitives/slot": "~1.4.0",
105
- "@rn-primitives/switch": "~1.4.0",
106
- "@rn-primitives/tabs": "~1.4.0",
107
- "@rn-primitives/toggle": "~1.4.0",
108
- "@rn-primitives/toggle-group": "~1.4.0",
109
- "@rn-primitives/tooltip": "~1.4.0"
93
+ "@rn-primitives/accordion": "~1.5.2",
94
+ "@rn-primitives/alert-dialog": "~1.5.2",
95
+ "@rn-primitives/checkbox": "~1.5.2",
96
+ "@rn-primitives/collapsible": "~1.5.2",
97
+ "@rn-primitives/dialog": "~1.5.2",
98
+ "@rn-primitives/dropdown-menu": "~1.5.2",
99
+ "@rn-primitives/label": "~1.5.2",
100
+ "@rn-primitives/popover": "~1.5.2",
101
+ "@rn-primitives/portal": "~1.5.2",
102
+ "@rn-primitives/radio-group": "~1.5.2",
103
+ "@rn-primitives/select": "~1.5.2",
104
+ "@rn-primitives/separator": "~1.5.2",
105
+ "@rn-primitives/slot": "~1.5.2",
106
+ "@rn-primitives/switch": "~1.5.2",
107
+ "@rn-primitives/tabs": "~1.5.2",
108
+ "@rn-primitives/toggle": "~1.5.2",
109
+ "@rn-primitives/toggle-group": "~1.5.2",
110
+ "@rn-primitives/tooltip": "~1.5.2"
110
111
  },
111
112
  "peerDependencies": {
112
113
  "@expo/ui": ">=56.0.0 <58.0.0",