panelui-native 0.12.0 → 0.14.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 (93) hide show
  1. package/README.md +39 -23
  2. package/lib/module/components/button/index.js +12 -9
  3. package/lib/module/components/button/index.js.map +1 -1
  4. package/lib/module/components/chip/index.js +313 -0
  5. package/lib/module/components/chip/index.js.map +1 -0
  6. package/lib/module/components/frame/index.js +41 -39
  7. package/lib/module/components/frame/index.js.map +1 -1
  8. package/lib/module/components/heatmap-chart/index.js +772 -0
  9. package/lib/module/components/heatmap-chart/index.js.map +1 -0
  10. package/lib/module/components/input/index.js +4 -0
  11. package/lib/module/components/input/index.js.map +1 -1
  12. package/lib/module/components/scroll-canvas/index.js +175 -0
  13. package/lib/module/components/scroll-canvas/index.js.map +1 -0
  14. package/lib/module/components/scroll-text/index.js +213 -0
  15. package/lib/module/components/scroll-text/index.js.map +1 -0
  16. package/lib/module/components/select/index.js +20 -24
  17. package/lib/module/components/select/index.js.map +1 -1
  18. package/lib/module/components/slider/index.js +2 -5
  19. package/lib/module/components/slider/index.js.map +1 -1
  20. package/lib/module/components/switch/index.js +15 -17
  21. package/lib/module/components/switch/index.js.map +1 -1
  22. package/lib/module/components/thinking-orb/index.js +741 -0
  23. package/lib/module/components/thinking-orb/index.js.map +1 -0
  24. package/lib/module/components/toggle-button/index.js +12 -3
  25. package/lib/module/components/toggle-button/index.js.map +1 -1
  26. package/lib/module/hooks/index.js +1 -0
  27. package/lib/module/hooks/index.js.map +1 -1
  28. package/lib/module/hooks/use-keyboard-avoidance.js +99 -59
  29. package/lib/module/hooks/use-keyboard-avoidance.js.map +1 -1
  30. package/lib/module/hooks/use-reveal-progress.js +75 -0
  31. package/lib/module/hooks/use-reveal-progress.js.map +1 -0
  32. package/lib/module/index.js +6 -0
  33. package/lib/module/index.js.map +1 -1
  34. package/lib/module/native/index.js.map +1 -1
  35. package/lib/module/primitives/keyboard-avoider.js +21 -2
  36. package/lib/module/primitives/keyboard-avoider.js.map +1 -1
  37. package/lib/module/primitives/scroll-progress.js +114 -0
  38. package/lib/module/primitives/scroll-progress.js.map +1 -0
  39. package/lib/typescript/src/components/button/index.d.ts +3 -4
  40. package/lib/typescript/src/components/button/index.d.ts.map +1 -1
  41. package/lib/typescript/src/components/chip/index.d.ts +304 -0
  42. package/lib/typescript/src/components/chip/index.d.ts.map +1 -0
  43. package/lib/typescript/src/components/frame/index.d.ts +15 -13
  44. package/lib/typescript/src/components/frame/index.d.ts.map +1 -1
  45. package/lib/typescript/src/components/heatmap-chart/index.d.ts +260 -0
  46. package/lib/typescript/src/components/heatmap-chart/index.d.ts.map +1 -0
  47. package/lib/typescript/src/components/input/index.d.ts +19 -4
  48. package/lib/typescript/src/components/input/index.d.ts.map +1 -1
  49. package/lib/typescript/src/components/scroll-canvas/index.d.ts +66 -0
  50. package/lib/typescript/src/components/scroll-canvas/index.d.ts.map +1 -0
  51. package/lib/typescript/src/components/scroll-text/index.d.ts +46 -0
  52. package/lib/typescript/src/components/scroll-text/index.d.ts.map +1 -0
  53. package/lib/typescript/src/components/select/index.d.ts.map +1 -1
  54. package/lib/typescript/src/components/slider/index.d.ts.map +1 -1
  55. package/lib/typescript/src/components/switch/index.d.ts.map +1 -1
  56. package/lib/typescript/src/components/thinking-orb/index.d.ts +28 -0
  57. package/lib/typescript/src/components/thinking-orb/index.d.ts.map +1 -0
  58. package/lib/typescript/src/components/toggle-button/index.d.ts +12 -0
  59. package/lib/typescript/src/components/toggle-button/index.d.ts.map +1 -1
  60. package/lib/typescript/src/hooks/index.d.ts +2 -1
  61. package/lib/typescript/src/hooks/index.d.ts.map +1 -1
  62. package/lib/typescript/src/hooks/use-keyboard-avoidance.d.ts +16 -3
  63. package/lib/typescript/src/hooks/use-keyboard-avoidance.d.ts.map +1 -1
  64. package/lib/typescript/src/hooks/use-reveal-progress.d.ts +56 -0
  65. package/lib/typescript/src/hooks/use-reveal-progress.d.ts.map +1 -0
  66. package/lib/typescript/src/index.d.ts +6 -0
  67. package/lib/typescript/src/index.d.ts.map +1 -1
  68. package/lib/typescript/src/native/index.d.ts +15 -7
  69. package/lib/typescript/src/native/index.d.ts.map +1 -1
  70. package/lib/typescript/src/primitives/keyboard-avoider.d.ts +30 -3
  71. package/lib/typescript/src/primitives/keyboard-avoider.d.ts.map +1 -1
  72. package/lib/typescript/src/primitives/scroll-progress.d.ts +61 -0
  73. package/lib/typescript/src/primitives/scroll-progress.d.ts.map +1 -0
  74. package/package.json +1 -1
  75. package/src/components/button/index.tsx +13 -11
  76. package/src/components/chip/index.tsx +333 -0
  77. package/src/components/frame/index.tsx +39 -50
  78. package/src/components/heatmap-chart/index.tsx +1024 -0
  79. package/src/components/input/index.tsx +23 -4
  80. package/src/components/scroll-canvas/index.tsx +220 -0
  81. package/src/components/scroll-text/index.tsx +277 -0
  82. package/src/components/select/index.tsx +4 -9
  83. package/src/components/slider/index.tsx +4 -7
  84. package/src/components/switch/index.tsx +5 -8
  85. package/src/components/thinking-orb/index.tsx +792 -0
  86. package/src/components/toggle-button/index.tsx +24 -2
  87. package/src/hooks/index.ts +6 -0
  88. package/src/hooks/use-keyboard-avoidance.ts +111 -65
  89. package/src/hooks/use-reveal-progress.ts +106 -0
  90. package/src/index.ts +46 -0
  91. package/src/native/index.ts +15 -7
  92. package/src/primitives/keyboard-avoider.tsx +41 -4
  93. package/src/primitives/scroll-progress.tsx +167 -0
@@ -0,0 +1,56 @@
1
+ /**
2
+ * useRevealProgress — how far an element has travelled through the viewport.
3
+ *
4
+ * The number every scroll-driven effect is really made of: `0` before the
5
+ * element has arrived, `1` once it has passed, and a smooth scrub between the
6
+ * two. What an effect *does* with it — recolour, fade, zoom, step through
7
+ * frames — is the only part that differs.
8
+ *
9
+ * The window is set the way a scroll-trigger's is: `start` and `end` are
10
+ * positions down the viewport, as fractions of its height. Progress is `0`
11
+ * while the element's **top** is still below `start`, and reaches `1` when its
12
+ * **bottom** passes `end` — so a tall block scrubs across its own height rather
13
+ * than snapping the moment its first line appears.
14
+ *
15
+ * ```tsx
16
+ * const { ref, progress } = useRevealProgress({ start: 0.9, end: 0.5 });
17
+ *
18
+ * <Animated.View ref={ref} style={useAnimatedStyle(() => ({
19
+ * opacity: progress.value,
20
+ * }))} />
21
+ * ```
22
+ *
23
+ * The element is measured on the UI thread whenever the scroll position
24
+ * changes — not every frame, and not once at layout. Once is wrong the moment
25
+ * anything above it resizes; every frame is a measurement pass for a value that
26
+ * only changes when the scroller moves.
27
+ */
28
+ import { type View } from 'react-native';
29
+ import { type AnimatedRef, type SharedValue } from 'react-native-reanimated';
30
+ export interface UseRevealProgressOptions {
31
+ /**
32
+ * Where down the viewport the element's top sits when progress is `0`, as a
33
+ * fraction of the viewport height. `0.9` starts it just before it appears.
34
+ */
35
+ start?: number;
36
+ /**
37
+ * Where down the viewport the element's bottom sits when progress reaches
38
+ * `1`. Smaller values mean a longer scrub.
39
+ */
40
+ end?: number;
41
+ /**
42
+ * Drive the effect from a value of your own instead of from the scroll
43
+ * position. Anything passed here is used as-is and nothing is measured.
44
+ */
45
+ progress?: SharedValue<number>;
46
+ /** Set false to hold progress at `1`, as though the element had passed. */
47
+ enabled?: boolean;
48
+ }
49
+ export interface UseRevealProgressResult {
50
+ /** Attach to the element whose travel drives the effect. */
51
+ ref: AnimatedRef<View>;
52
+ /** `0` before, `1` after, scrubbed between. */
53
+ progress: SharedValue<number>;
54
+ }
55
+ export declare function useRevealProgress({ start, end, progress: external, enabled, }?: UseRevealProgressOptions): UseRevealProgressResult;
56
+ //# sourceMappingURL=use-reveal-progress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-reveal-progress.d.ts","sourceRoot":"","sources":["../../../../src/hooks/use-reveal-progress.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAAuB,KAAK,IAAI,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AAGjC,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC/B,2EAA2E;IAC3E,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,uBAAuB;IACtC,4DAA4D;IAC5D,GAAG,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;IACvB,+CAA+C;IAC/C,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC/B;AAED,wBAAgB,iBAAiB,CAAC,EAChC,KAAW,EACX,GAAS,EACT,QAAQ,EAAE,QAAQ,EAClB,OAAc,GACf,GAAE,wBAA6B,GAAG,uBAAuB,CAoCzD"}
@@ -4,6 +4,7 @@ export { Portal, PortalHost, PortalProvider } from './primitives/portal.js';
4
4
  export { Text, type TextProps } from './primitives/text.js';
5
5
  export { KeyboardAvoider, type KeyboardAvoiderProps, } from './primitives/keyboard-avoider.js';
6
6
  export { AnimatedPressable, type AnimatedPressableProps, } from './primitives/animated-pressable.js';
7
+ export { ScrollProgress, useScrollProgress, type ScrollProgressProps, type ScrollProgressValue, } from './primitives/scroll-progress.js';
7
8
  export { hasNativeUI } from './native/index.js';
8
9
  export { hasHaptics, selectionTick } from './utils/haptics.js';
9
10
  export { Accordion, type AccordionProps, type AccordionItemProps, type AccordionTriggerProps, type AccordionIndicatorProps, type AccordionContentProps, type AccordionVariant, type AccordionSelectionMode, } from './components/accordion/index.js';
@@ -16,11 +17,13 @@ export { Button, type ButtonProps } from './components/button/index.js';
16
17
  export { ToggleButton, ToggleButtonGroup, useToggleButton, type ToggleButtonProps, type ToggleButtonGroupProps, type ToggleButtonLabelProps, type ToggleButtonSize, type ToggleButtonVariant, type ToggleSelectionMode, } from './components/toggle-button/index.js';
17
18
  export { Dialog, type DialogProps, type DialogContentProps, } from './components/dialog/index.js';
18
19
  export { Frame, type FrameProps, type FrameRootProps, type FramePanelProps, type FrameRowProps, type FrameSectionProps, type FrameVariant, } from './components/frame/index.js';
20
+ export { HeatmapChart, useHeatmapChart, buildHeatmapCalendar, type HeatmapChartProps, type HeatmapCellsProps, type HeatmapSeparatorProps, type HeatmapXAxisProps, type HeatmapYAxisProps, type HeatmapTooltipProps, type HeatmapLegendProps, type HeatmapColumn, type HeatmapBin, type HeatmapCell, type HeatmapLayout, } from './components/heatmap-chart/index.js';
19
21
  export { Select, type SelectProps, type SelectItemProps, type SelectPresentation, } from './components/select/index.js';
20
22
  export { SectionRail, type SectionRailProps, type SectionRailTriggerProps, type SectionRailBarProps, type SectionRailContentProps, type SectionRailItemProps, type SectionRailPlacement, type SectionRailAlign, } from './components/section-rail/index.js';
21
23
  export { Tabs, type TabsProps, type TabsListProps, type TabsTriggerProps, type TabsContentProps, } from './components/tabs/index.js';
22
24
  export { Card, type CardProps } from './components/card/index.js';
23
25
  export { Checkbox, type CheckboxProps } from './components/checkbox/index.js';
26
+ export { Chip, useChip, type ChipProps, type ChipLabelProps, type ChipVariant, type ChipSize, } from './components/chip/index.js';
24
27
  export { EmptyState, type EmptyStateProps, type EmptyStateMediaProps, } from './components/empty-state/index.js';
25
28
  export { Input, type InputProps } from './components/input/index.js';
26
29
  export { InputGroup, type InputGroupProps, type InputGroupInputProps, type InputGroupDecoratorProps, } from './components/input-group/index.js';
@@ -36,6 +39,9 @@ export { RadioGroup, type RadioGroupProps, type RadioGroupItemProps, } from './c
36
39
  export { ScrollFade, type ScrollFadeProps, } from './components/scroll-fade/index.js';
37
40
  export { Separator, type SeparatorProps } from './components/separator/index.js';
38
41
  export { Shimmer, type ShimmerProps } from './components/shimmer/index.js';
42
+ export { ScrollText, type ScrollTextProps, type ScrollTextEffect, type ScrollTextSplit, } from './components/scroll-text/index.js';
43
+ export { ScrollCanvas, type ScrollCanvasProps, type ScrollCanvasEffect, } from './components/scroll-canvas/index.js';
44
+ export { ThinkingOrb, type ThinkingOrbProps, type ThinkingOrbState, } from './components/thinking-orb/index.js';
39
45
  export { Skeleton, type SkeletonProps } from './components/skeleton/index.js';
40
46
  export { Slider, type SliderProps } from './components/slider/index.js';
41
47
  export { Spinner, type SpinnerProps } from './components/spinner/index.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,kCAA+B,CAAC;AAG3F,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,gBAAgB,GACtB,MAAM,sBAAmB,CAAC;AAG3B,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,wBAAqB,CAAC;AACzE,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,sBAAmB,CAAC;AACzD,OAAO,EACL,eAAe,EACf,KAAK,oBAAoB,GAC1B,MAAM,kCAA+B,CAAC;AACvC,OAAO,EACL,iBAAiB,EACjB,KAAK,sBAAsB,GAC5B,MAAM,oCAAiC,CAAC;AAGzC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAU,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,oBAAiB,CAAC;AAG5D,OAAO,EACL,SAAS,EACT,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,GAC5B,MAAM,iCAAwB,CAAC;AAChC,OAAO,EACL,KAAK,EACL,KAAK,UAAU,EACf,KAAK,mBAAmB,GACzB,MAAM,6BAAoB,CAAC;AAC5B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iB,EACtB,KAAK,eAAe,EACpB,KAAK,YAAY,GAClB,MAAM,gCAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,EACL,aAAa,EACb,KAAK,EACL,QAAQ,EACR,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,eAAe,GACrB,MAAM,6BAAoB,CAAC;AAC5B,OAAO,EACL,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,GACzB,MAAM,kCAAyB,CAAC;AAGjC,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,SAAS,EACT,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,iBAAiB,EACjB,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,WAAW,EACX,aAAa,EACb,cAAc,EACd,WAAW,EACX,UAAU,EACV,QAAQ,EACR,cAAc,EACd,eAAe,EACf,eAAe,EACf,OAAO,EACP,KAAK,EACL,YAAY,EACZ,KAAK,SAAS,GACf,MAAM,kBAAS,CAAC;AAGjB,cAAc,kBAAS,CAAC;AAGxB,OAAO,EAAE,EAAE,EAAE,MAAM,eAAY,CAAC"}
@@ -5,13 +5,15 @@ interface NativeUIModule {
5
5
  /**
6
6
  * Whether the host resizes itself to the platform content.
7
7
  *
8
- * Every control here gives the host an explicit height instead, and takes
9
- * its width from ordinary layout. The measurement arrives a frame late and
10
- * again whenever the platform's content changes, so a host left to work
11
- * its own size out renders at nothing and then jumps — on first paint, and
12
- * again on first press. The per-axis form does not help; the answer is not
13
- * to ask. Only the natively-presented sheet still uses it, where the host
14
- * is a zero-size anchor rather than the control itself.
8
+ * This is on for every control here, and it is the whole answer to the
9
+ * jump. Sizing the *host* and leaving the control unsized inside it hands
10
+ * the platform a box it never agreed to: it lays out against its own
11
+ * intrinsic size, and settles into the box on the first thing that forces
12
+ * a second pass — which for a button is the first press.
13
+ *
14
+ * The per-axis form is for a control with no intrinsic width, like a
15
+ * slider or a picker: the width comes from ordinary layout and only the
16
+ * height is reported back.
15
17
  */
16
18
  matchContents?: boolean | {
17
19
  vertical?: boolean;
@@ -30,6 +32,12 @@ interface NativeUIModule {
30
32
  matchContents?: boolean;
31
33
  style?: unknown;
32
34
  }>;
35
+ /**
36
+ * `style` here is not a React Native style — it is the small portable subset
37
+ * (`width`, `height`, padding, `backgroundColor`, `borderRadius`, `opacity`)
38
+ * that the toolkit compiles into real SwiftUI and Compose modifiers. It is
39
+ * how a control is given a definite size without the host having to guess.
40
+ */
33
41
  Button: ComponentType<Record<string, unknown>>;
34
42
  Switch: ComponentType<Record<string, unknown>>;
35
43
  Slider: ComponentType<Record<string, unknown>>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/native/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,UAAU,cAAc;IACtB,IAAI,EAAE,aAAa,CAAC;QAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;QACrB;;;;;;;;;;WAUG;QACH,aAAa,CAAC,EAAE,OAAO,GAAG;YAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;YAAC,UAAU,CAAC,EAAE,OAAO,CAAA;SAAE,CAAC;QACvE,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC,CAAC;IACH;;;;OAIG;IACH,UAAU,EAAE,aAAa,CAAC;QACxB,QAAQ,CAAC,EAAE,SAAS,CAAC;QACrB,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB,KAAK,CAAC,EAAE,OAAO,CAAC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,CAAC,EAAE,OAAO,CAAC;KACjB,CAAC,CAAC;IACH;;;;;OAKG;IACH,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC/C,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC/C,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC/C,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG;QAC/C,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;KAC9C,CAAC;IACF,WAAW,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACrD;AAKD;;;;GAIG;AACH,wBAAgB,WAAW,IAAI,cAAc,GAAG,IAAI,CAgBnD;AAED,gEAAgE;AAChE,wBAAgB,WAAW,IAAI,OAAO,CAErC"}
@@ -1,12 +1,28 @@
1
1
  /**
2
- * KeyboardAvoider — a view that lifts itself just clear of the keyboard.
2
+ * KeyboardAvoider — a view that keeps itself clear of the keyboard.
3
3
  *
4
4
  * A thin wrapper over `useKeyboardAvoidance` for the common case of "keep this
5
5
  * box visible", so a form does not have to wire the ref, layout handler and
6
6
  * animated style by hand.
7
+ *
8
+ * ```tsx
9
+ * // In the flow of a scrolling page: lifts by the overlap, follows the scroll.
10
+ * <KeyboardAvoider active={focused}>…</KeyboardAvoider>
11
+ *
12
+ * // Pinned to the bottom edge: rides the keyboard up and back down.
13
+ * <KeyboardAvoider
14
+ * mode="dock"
15
+ * bottomInset={insets.bottom}
16
+ * className="absolute left-0 right-0"
17
+ * style={{ bottom: insets.bottom + 16 }}
18
+ * >
19
+ * …
20
+ * </KeyboardAvoider>
21
+ * ```
7
22
  */
8
23
  import type { ReactNode } from 'react';
9
24
  import type { ViewProps } from 'react-native';
25
+ import { type KeyboardAvoidanceMode } from '../hooks/use-keyboard-avoidance.js';
10
26
  export interface KeyboardAvoiderProps extends ViewProps {
11
27
  className?: string;
12
28
  /** Set false to leave the content where it is. */
@@ -18,11 +34,22 @@ export interface KeyboardAvoiderProps extends ViewProps {
18
34
  * screen stay put.
19
35
  */
20
36
  active?: boolean;
21
- /** Gap to keep between the content's bottom edge and the keyboard. */
37
+ /**
38
+ * `lift` moves in-flow content up by its overlap with the keyboard and keeps
39
+ * tracking it as the page scrolls. `dock` travels with the keyboard, for a
40
+ * bar already pinned near the bottom edge.
41
+ */
42
+ mode?: KeyboardAvoidanceMode;
43
+ /** Gap to keep between the content's bottom edge and the keyboard. `lift` only. */
22
44
  offset?: number;
45
+ /**
46
+ * How far above the bottom edge the bar already sits — usually the safe area
47
+ * inset it is positioned by. `dock` only.
48
+ */
49
+ bottomInset?: number;
23
50
  children?: ReactNode;
24
51
  }
25
- export declare function KeyboardAvoider({ className, enabled, active, offset, children, style, onLayout, ...props }: KeyboardAvoiderProps): import("react").JSX.Element;
52
+ export declare function KeyboardAvoider({ className, enabled, active, mode, offset, bottomInset, children, style, onLayout, ...props }: KeyboardAvoiderProps): import("react").JSX.Element;
26
53
  export declare namespace KeyboardAvoider {
27
54
  var displayName: string;
28
55
  }
@@ -1 +1 @@
1
- {"version":3,"file":"keyboard-avoider.d.ts","sourceRoot":"","sources":["../../../../src/primitives/keyboard-avoider.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI9C,MAAM,WAAW,oBAAqB,SAAQ,SAAS;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,sEAAsE;IACtE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,OAAc,EACd,MAAa,EACb,MAAW,EACX,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,oBAAoB,+BAiBtB;yBA1Be,eAAe"}
1
+ {"version":3,"file":"keyboard-avoider.d.ts","sourceRoot":"","sources":["../../../../src/primitives/keyboard-avoider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,oCAAiC,CAAC;AAEzC,MAAM,WAAW,oBAAqB,SAAQ,SAAS;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,IAAI,CAAC,EAAE,qBAAqB,CAAC;IAC7B,mFAAmF;IACnF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,OAAc,EACd,MAAa,EACb,IAAa,EACb,MAAW,EACX,WAAe,EACf,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,oBAAoB,+BAuBtB;yBAlCe,eAAe"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * ScrollProgress — publishes a scroll container's position so children can
3
+ * animate against it.
4
+ *
5
+ * Scroll-driven effects all need the same two numbers: where the scroller is,
6
+ * and how tall its viewport is. Every component that wanted them measuring for
7
+ * itself would mean one scroll listener per effect and one measurement pass per
8
+ * effect per frame, for two values that are the same for all of them.
9
+ *
10
+ * It wraps the scroll view you already have rather than replacing it — the
11
+ * child is cloned with an animated scroll handler composed onto it, the same
12
+ * way `ScrollFade` does — so a `FlatList`, a `SectionList` or your own
13
+ * scrollable all work, and nothing has to be rewritten to adopt it.
14
+ *
15
+ * ```tsx
16
+ * <ScrollProgress>
17
+ * <ScrollView>
18
+ * <ScrollText>…</ScrollText>
19
+ * </ScrollView>
20
+ * </ScrollProgress>
21
+ * ```
22
+ *
23
+ * Both values are shared values, so the whole chain from scroll event to
24
+ * animated style stays on the UI thread and nothing re-renders as you scroll.
25
+ */
26
+ import { type ReactNode } from 'react';
27
+ import { type ViewProps } from 'react-native';
28
+ import { type SharedValue } from 'react-native-reanimated';
29
+ export interface ScrollProgressValue {
30
+ /** Distance scrolled, in pixels. */
31
+ offset: SharedValue<number>;
32
+ /** Height of the visible area. */
33
+ viewport: SharedValue<number>;
34
+ /** Total height of the content. */
35
+ content: SharedValue<number>;
36
+ /**
37
+ * Window-space top edge of the scroller. What turns an element's measured
38
+ * `pageY` into a position inside *this* viewport rather than the screen's —
39
+ * they differ by whatever sits above the scroller, and assuming they do not
40
+ * is why scroll effects drift under a header.
41
+ */
42
+ top: SharedValue<number>;
43
+ }
44
+ /**
45
+ * The nearest enclosing scroll container's position, or `null` outside one.
46
+ *
47
+ * It returns null rather than throwing because every consumer of this also
48
+ * takes an explicit `progress` prop — a component that can be driven by hand
49
+ * should not insist on a provider it does not need.
50
+ */
51
+ export declare function useScrollProgress(): ScrollProgressValue | null;
52
+ export interface ScrollProgressProps extends ViewProps {
53
+ className?: string;
54
+ /** Exactly one scrollable — a ScrollView, FlatList, or anything like them. */
55
+ children?: ReactNode;
56
+ }
57
+ export declare function ScrollProgress({ className, children, ...props }: ScrollProgressProps): import("react").JSX.Element;
58
+ export declare namespace ScrollProgress {
59
+ var displayName: string;
60
+ }
61
+ //# sourceMappingURL=scroll-progress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scroll-progress.d.ts","sourceRoot":"","sources":["../../../../src/primitives/scroll-progress.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EASL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAgC,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAC5E,OAAiB,EAKf,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,mBAAmB;IAClC,oCAAoC;IACpC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5B,kCAAkC;IAClC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC9B,mCAAmC;IACnC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B;;;;;OAKG;IACH,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC1B;AAID;;;;;;GAMG;AACH,wBAAgB,iBAAiB,IAAI,mBAAmB,GAAG,IAAI,CAE9D;AASD,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,+BA6EpF;yBA7Ee,cAAc"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "panelui-native",
3
- "version": "0.12.0",
3
+ "version": "0.14.0",
4
4
  "description": "High-performance React Native UI components for Expo. Semantic design tokens, powered by Uniwind (Tailwind v4) and Reanimated.",
5
5
  "main": "./lib/module/index.js",
6
6
  "module": "./lib/module/index.js",
@@ -115,22 +115,23 @@ export interface ButtonProps
115
115
  * `primary`/`destructive` → filled, `outline` → outlined, everything else
116
116
  * → text; `size` sets the height.
117
117
  *
118
- * A native button **fills the width it is given**, because the host is told
119
- * its size rather than left to measure the platform's content — which is
120
- * what made it collapse and then jump on first press. Put it in a row to
121
- * share the width, or in a narrower parent to shrink it.
118
+ * A native button **sizes itself to its label**, the way a platform button
119
+ * is supposed to. It does not stretch to fill its container, and `fullWidth`
120
+ * has no effect on it.
122
121
  */
123
122
  native?: boolean;
124
123
  }
125
124
 
126
125
  /**
127
- * Height given to the native host, matching the styled scale above.
126
+ * Height given to the platform button, matching the styled scale above.
128
127
  *
129
- * The host is told its size rather than asked to work it out. `matchContents`
130
- * measures the platform's own content a frame late and again when that content
131
- * changes — so the button renders at nothing, collapses against whatever sits
132
- * above it, and jolts into place on the first press. Width comes from ordinary
133
- * layout instead, which is why a native button fills its container.
128
+ * It goes on the button rather than on the host, and that distinction is the
129
+ * whole fix for the jump. A host sized to a number with an unsized control
130
+ * inside it hands the platform a box the control never agreed to: SwiftUI and
131
+ * Compose both lay out against their own intrinsic size and only settle into
132
+ * the box when something forces a second pass — which for a button is the
133
+ * first press. Given a definite height of its own, the button has nothing left
134
+ * to recompute, and the host follows it with `matchContents`.
134
135
  */
135
136
  const NATIVE_HEIGHT: Record<NonNullable<ButtonVariantProps['size']>, number> = {
136
137
  sm: 36,
@@ -199,11 +200,12 @@ export const Button = forwardRef<View, ButtonProps>(
199
200
  const isStringLabel = typeof children === 'string';
200
201
 
201
202
  return (
202
- <Host style={{ height: NATIVE_HEIGHT[size ?? 'md'] }}>
203
+ <Host matchContents>
203
204
  <NativeButton
204
205
  label={isStringLabel ? children : undefined}
205
206
  variant={NATIVE_VARIANT[variant ?? 'primary']}
206
207
  disabled={isDisabled}
208
+ style={{ height: NATIVE_HEIGHT[size ?? 'md'] }}
207
209
  onPress={props.onPress}
208
210
  >
209
211
  {/* Non-string children are React Native views, and the native