panelui-native 0.81.0 → 0.83.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 (73) hide show
  1. package/lib/module/components/bottom-sheet/index.js +189 -21
  2. package/lib/module/components/bottom-sheet/index.js.map +1 -1
  3. package/lib/module/components/button/index.js +13 -0
  4. package/lib/module/components/button/index.js.map +1 -1
  5. package/lib/module/components/button-group/index.js +3 -0
  6. package/lib/module/components/button-group/index.js.map +1 -1
  7. package/lib/module/components/image-generation/dot-field.js +267 -0
  8. package/lib/module/components/image-generation/dot-field.js.map +1 -0
  9. package/lib/module/components/image-generation/index.js +459 -0
  10. package/lib/module/components/image-generation/index.js.map +1 -0
  11. package/lib/module/components/kpi/index.js +2 -4
  12. package/lib/module/components/kpi/index.js.map +1 -1
  13. package/lib/module/components/menu/index.js +8 -16
  14. package/lib/module/components/menu/index.js.map +1 -1
  15. package/lib/module/components/panelside/index.js +340 -33
  16. package/lib/module/components/panelside/index.js.map +1 -1
  17. package/lib/module/components/select/index.js +127 -23
  18. package/lib/module/components/select/index.js.map +1 -1
  19. package/lib/module/components/slide-button/index.js +610 -0
  20. package/lib/module/components/slide-button/index.js.map +1 -0
  21. package/lib/module/components/slide-button/slide-button-track.js +98 -0
  22. package/lib/module/components/slide-button/slide-button-track.js.map +1 -0
  23. package/lib/module/icons/index.js +553 -1934
  24. package/lib/module/icons/index.js.map +1 -1
  25. package/lib/module/index.js +3 -1
  26. package/lib/module/index.js.map +1 -1
  27. package/lib/module/native/index.js +24 -0
  28. package/lib/module/native/index.js.map +1 -1
  29. package/lib/module/primitives/portal.js +15 -1
  30. package/lib/module/primitives/portal.js.map +1 -1
  31. package/lib/typescript/src/components/bottom-sheet/index.d.ts +17 -1
  32. package/lib/typescript/src/components/bottom-sheet/index.d.ts.map +1 -1
  33. package/lib/typescript/src/components/button/index.d.ts +12 -0
  34. package/lib/typescript/src/components/button/index.d.ts.map +1 -1
  35. package/lib/typescript/src/components/button-group/index.d.ts +9 -0
  36. package/lib/typescript/src/components/button-group/index.d.ts.map +1 -1
  37. package/lib/typescript/src/components/image-generation/dot-field.d.ts +96 -0
  38. package/lib/typescript/src/components/image-generation/dot-field.d.ts.map +1 -0
  39. package/lib/typescript/src/components/image-generation/index.d.ts +134 -0
  40. package/lib/typescript/src/components/image-generation/index.d.ts.map +1 -0
  41. package/lib/typescript/src/components/kpi/index.d.ts.map +1 -1
  42. package/lib/typescript/src/components/menu/index.d.ts.map +1 -1
  43. package/lib/typescript/src/components/panelside/index.d.ts +194 -10
  44. package/lib/typescript/src/components/panelside/index.d.ts.map +1 -1
  45. package/lib/typescript/src/components/select/index.d.ts +75 -2
  46. package/lib/typescript/src/components/select/index.d.ts.map +1 -1
  47. package/lib/typescript/src/components/slide-button/index.d.ts +317 -0
  48. package/lib/typescript/src/components/slide-button/index.d.ts.map +1 -0
  49. package/lib/typescript/src/components/slide-button/slide-button-track.d.ts +70 -0
  50. package/lib/typescript/src/components/slide-button/slide-button-track.d.ts.map +1 -0
  51. package/lib/typescript/src/icons/index.d.ts +136 -189
  52. package/lib/typescript/src/icons/index.d.ts.map +1 -1
  53. package/lib/typescript/src/index.d.ts +4 -2
  54. package/lib/typescript/src/index.d.ts.map +1 -1
  55. package/lib/typescript/src/native/index.d.ts +26 -0
  56. package/lib/typescript/src/native/index.d.ts.map +1 -1
  57. package/lib/typescript/src/primitives/portal.d.ts.map +1 -1
  58. package/package.json +3 -2
  59. package/src/components/bottom-sheet/index.tsx +223 -20
  60. package/src/components/button/index.tsx +10 -2
  61. package/src/components/button-group/index.tsx +1 -0
  62. package/src/components/image-generation/dot-field.ts +282 -0
  63. package/src/components/image-generation/index.tsx +537 -0
  64. package/src/components/kpi/index.tsx +2 -4
  65. package/src/components/menu/index.tsx +10 -15
  66. package/src/components/panelside/index.tsx +498 -33
  67. package/src/components/select/index.tsx +158 -31
  68. package/src/components/slide-button/index.tsx +681 -0
  69. package/src/components/slide-button/slide-button-track.ts +100 -0
  70. package/src/icons/index.tsx +338 -1327
  71. package/src/index.ts +28 -0
  72. package/src/native/index.ts +45 -0
  73. package/src/primitives/portal.tsx +15 -1
package/src/index.ts CHANGED
@@ -334,6 +334,7 @@ export {
334
334
  } from './components/radar-chart';
335
335
  export {
336
336
  Select,
337
+ useSelectSearch,
337
338
  type SelectProps,
338
339
  type SelectItemProps,
339
340
  type SelectGroupProps,
@@ -514,6 +515,12 @@ export {
514
515
  type FormFieldRenderProps,
515
516
  type UseFieldOptions,
516
517
  } from './components/form';
518
+ export {
519
+ ImageGeneration,
520
+ type ImageGenerationProps,
521
+ type ImageGenerationFieldProps,
522
+ type ImageGenerationStatus,
523
+ } from './components/image-generation';
517
524
  export { Input, type InputProps } from './components/input';
518
525
  export {
519
526
  InputGroup,
@@ -542,14 +549,26 @@ export {
542
549
  type PanelsideItemLabelProps,
543
550
  type PanelsideItemBadgeProps,
544
551
  type PanelsideActionProps,
552
+ type PanelsideItemActionsProps,
545
553
  type PanelsideFooterProps,
546
554
  type PanelsideCtaProps,
547
555
  type PanelsideSceneProps,
556
+ type PanelsidePagesProps,
557
+ type PanelsidePageProps,
548
558
  type PanelsideTriggerProps,
559
+ type PanelsideSearchTriggerProps,
560
+ type PanelsideSearchSheetProps,
561
+ type PanelsideSearchTabsProps,
562
+ type PanelsideSearchTabProps,
563
+ type PanelsideSearchResultsProps,
564
+ type PanelsideSearchResultProps,
565
+ type PanelsideSearchFieldProps,
549
566
  type PanelsideMode,
550
567
  type PanelsideSwipeFrom,
551
568
  type PanelsideItemSize,
552
569
  type PanelsideCtaSize,
570
+ type PanelsideSurface,
571
+ type PanelsideControlVariant,
553
572
  type UsePanelsideResult,
554
573
  } from './components/panelside';
555
574
  export {
@@ -1072,6 +1091,15 @@ export {
1072
1091
  type ThinkingOrbState,
1073
1092
  } from './components/thinking-orb';
1074
1093
  export { Skeleton, type SkeletonProps } from './components/skeleton';
1094
+ export {
1095
+ SlideButton,
1096
+ useSlideButton,
1097
+ type SlideButtonProps,
1098
+ type SlideButtonLabelProps,
1099
+ type SlideButtonThumbProps,
1100
+ type SlideButtonVariant,
1101
+ type SlideButtonSize,
1102
+ } from './components/slide-button';
1075
1103
  export { Slider, type SliderProps } from './components/slider';
1076
1104
  export {
1077
1105
  Sortable,
@@ -145,6 +145,20 @@ interface SwiftUIModifiers {
145
145
  cornerRadius?: number
146
146
  ) => unknown;
147
147
  controlSize: (size: 'mini' | 'small' | 'regular' | 'large' | 'extraLarge') => unknown;
148
+ /**
149
+ * Paints a sheet's own surface, rather than a background behind its content.
150
+ *
151
+ * It is the only way out of the material a sheet is drawn in by default, and
152
+ * it reaches what an ordinary background cannot: the grabber's strip at the
153
+ * top and the safe-area inset at the bottom, which belong to the sheet's
154
+ * chrome and not to anything hosted inside it.
155
+ *
156
+ * **iOS 16.4 and up.** Below that it is inert and the sheet keeps its
157
+ * material — the same shape as glass being inert below iOS 26, and the same
158
+ * trap: indistinguishable from the prop not working. Check the OS before
159
+ * changing any code on a report of "the colour did nothing".
160
+ */
161
+ presentationBackground: (color: string) => unknown;
148
162
  }
149
163
 
150
164
  let modifiersResolved = false;
@@ -165,3 +179,34 @@ export function getSwiftUIModifiers(): SwiftUIModifiers | null {
165
179
 
166
180
  return modifiers;
167
181
  }
182
+
183
+ /**
184
+ * The Compose view modifiers — the other half of the same door.
185
+ *
186
+ * Android's toolkit has its own modifier system and its own vocabulary, so a
187
+ * modifier built for one platform is not a modifier the other can read. Where
188
+ * both are asked the same question the answers are written separately, here and
189
+ * above, rather than one being sent to both.
190
+ */
191
+ interface ComposeModifiers {
192
+ background: (color: string) => unknown;
193
+ }
194
+
195
+ let composeResolved = false;
196
+ let compose: ComposeModifiers | null = null;
197
+
198
+ export function getComposeModifiers(): ComposeModifiers | null {
199
+ if (composeResolved) return compose;
200
+ composeResolved = true;
201
+
202
+ if (Platform.OS !== 'android') return null;
203
+
204
+ try {
205
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
206
+ compose = require('@expo/ui/jetpack-compose/modifiers') as ComposeModifiers;
207
+ } catch {
208
+ compose = null;
209
+ }
210
+
211
+ return compose;
212
+ }
@@ -75,11 +75,25 @@ export function Portal({ children }: { children: ReactNode }) {
75
75
  const store = usePortalStore('Portal');
76
76
  const key = useId();
77
77
 
78
+ /*
79
+ * Two effects, because they answer to different things.
80
+ *
81
+ * `children` is a new element on every render of whatever owns the portal,
82
+ * so an effect that both mounted and unmounted on it ran `unmount` then
83
+ * `mount` for every one of those renders — deleting the key from the store
84
+ * and putting it straight back, twice through `emit`, twice through a new
85
+ * Map, and a full re-render of the host each time. An open sheet re-rendering
86
+ * as its content changes paid that on every frame it changed on.
87
+ *
88
+ * Split, the update is an update and the teardown happens once, when the
89
+ * portal actually goes away.
90
+ */
78
91
  useEffect(() => {
79
92
  store.mount(key, children);
80
- return () => store.unmount(key);
81
93
  }, [store, key, children]);
82
94
 
95
+ useEffect(() => () => store.unmount(key), [store, key]);
96
+
83
97
  return null;
84
98
  }
85
99