panelui-native 0.7.0 → 0.12.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 (161) hide show
  1. package/README.md +5 -3
  2. package/lib/module/components/attachment/index.js +219 -0
  3. package/lib/module/components/attachment/index.js.map +1 -0
  4. package/lib/module/components/bottom-sheet/index.js +53 -3
  5. package/lib/module/components/bottom-sheet/index.js.map +1 -1
  6. package/lib/module/components/button/index.js +19 -1
  7. package/lib/module/components/button/index.js.map +1 -1
  8. package/lib/module/components/dialog/index.js +6 -2
  9. package/lib/module/components/dialog/index.js.map +1 -1
  10. package/lib/module/components/empty-state/index.js +94 -17
  11. package/lib/module/components/empty-state/index.js.map +1 -1
  12. package/lib/module/components/frame/index.js +128 -15
  13. package/lib/module/components/frame/index.js.map +1 -1
  14. package/lib/module/components/input/index.js +107 -15
  15. package/lib/module/components/input/index.js.map +1 -1
  16. package/lib/module/components/line-chart/index.js +1024 -0
  17. package/lib/module/components/line-chart/index.js.map +1 -0
  18. package/lib/module/components/marker/index.js +190 -0
  19. package/lib/module/components/marker/index.js.map +1 -0
  20. package/lib/module/components/message/index.js +24 -8
  21. package/lib/module/components/message/index.js.map +1 -1
  22. package/lib/module/components/message-scroller/index.js +451 -0
  23. package/lib/module/components/message-scroller/index.js.map +1 -0
  24. package/lib/module/components/popover/index.js +511 -0
  25. package/lib/module/components/popover/index.js.map +1 -0
  26. package/lib/module/components/progress/index.js +52 -2
  27. package/lib/module/components/progress/index.js.map +1 -1
  28. package/lib/module/components/radio-group/index.js +132 -17
  29. package/lib/module/components/radio-group/index.js.map +1 -1
  30. package/lib/module/components/section-rail/index.js +355 -0
  31. package/lib/module/components/section-rail/index.js.map +1 -0
  32. package/lib/module/components/select/index.js +245 -56
  33. package/lib/module/components/select/index.js.map +1 -1
  34. package/lib/module/components/separator/index.js +91 -0
  35. package/lib/module/components/separator/index.js.map +1 -0
  36. package/lib/module/components/slider/index.js +355 -0
  37. package/lib/module/components/slider/index.js.map +1 -0
  38. package/lib/module/components/surface/index.js +21 -2
  39. package/lib/module/components/surface/index.js.map +1 -1
  40. package/lib/module/components/switch/index.js +10 -1
  41. package/lib/module/components/switch/index.js.map +1 -1
  42. package/lib/module/components/tabs/index.js +186 -16
  43. package/lib/module/components/tabs/index.js.map +1 -1
  44. package/lib/module/components/toggle-button/index.js +297 -0
  45. package/lib/module/components/toggle-button/index.js.map +1 -0
  46. package/lib/module/hooks/index.js +1 -0
  47. package/lib/module/hooks/index.js.map +1 -1
  48. package/lib/module/hooks/use-keyboard-avoidance.js +57 -8
  49. package/lib/module/hooks/use-keyboard-avoidance.js.map +1 -1
  50. package/lib/module/hooks/use-scroll-sections.js +89 -0
  51. package/lib/module/hooks/use-scroll-sections.js.map +1 -0
  52. package/lib/module/icons/index.js +69 -0
  53. package/lib/module/icons/index.js.map +1 -1
  54. package/lib/module/index.js +11 -2
  55. package/lib/module/index.js.map +1 -1
  56. package/lib/module/native/index.js.map +1 -1
  57. package/lib/module/primitives/keyboard-avoider.js +2 -0
  58. package/lib/module/primitives/keyboard-avoider.js.map +1 -1
  59. package/lib/module/primitives/scrim.js +72 -0
  60. package/lib/module/primitives/scrim.js.map +1 -0
  61. package/lib/module/utils/haptics.js +57 -0
  62. package/lib/module/utils/haptics.js.map +1 -0
  63. package/lib/typescript/src/components/attachment/index.d.ts +93 -0
  64. package/lib/typescript/src/components/attachment/index.d.ts.map +1 -0
  65. package/lib/typescript/src/components/bottom-sheet/index.d.ts +6 -1
  66. package/lib/typescript/src/components/bottom-sheet/index.d.ts.map +1 -1
  67. package/lib/typescript/src/components/button/index.d.ts +9 -4
  68. package/lib/typescript/src/components/button/index.d.ts.map +1 -1
  69. package/lib/typescript/src/components/dialog/index.d.ts +7 -1
  70. package/lib/typescript/src/components/dialog/index.d.ts.map +1 -1
  71. package/lib/typescript/src/components/empty-state/index.d.ts +152 -2
  72. package/lib/typescript/src/components/empty-state/index.d.ts.map +1 -1
  73. package/lib/typescript/src/components/frame/index.d.ts +47 -7
  74. package/lib/typescript/src/components/frame/index.d.ts.map +1 -1
  75. package/lib/typescript/src/components/input/index.d.ts +113 -2
  76. package/lib/typescript/src/components/input/index.d.ts.map +1 -1
  77. package/lib/typescript/src/components/line-chart/index.d.ts +247 -0
  78. package/lib/typescript/src/components/line-chart/index.d.ts.map +1 -0
  79. package/lib/typescript/src/components/marker/index.d.ts +137 -0
  80. package/lib/typescript/src/components/marker/index.d.ts.map +1 -0
  81. package/lib/typescript/src/components/message/index.d.ts +8 -1
  82. package/lib/typescript/src/components/message/index.d.ts.map +1 -1
  83. package/lib/typescript/src/components/message-scroller/index.d.ts +150 -0
  84. package/lib/typescript/src/components/message-scroller/index.d.ts.map +1 -0
  85. package/lib/typescript/src/components/popover/index.d.ts +136 -0
  86. package/lib/typescript/src/components/popover/index.d.ts.map +1 -0
  87. package/lib/typescript/src/components/progress/index.d.ts +33 -0
  88. package/lib/typescript/src/components/progress/index.d.ts.map +1 -1
  89. package/lib/typescript/src/components/radio-group/index.d.ts +39 -0
  90. package/lib/typescript/src/components/radio-group/index.d.ts.map +1 -1
  91. package/lib/typescript/src/components/section-rail/index.d.ts +115 -0
  92. package/lib/typescript/src/components/section-rail/index.d.ts.map +1 -0
  93. package/lib/typescript/src/components/select/index.d.ts +46 -7
  94. package/lib/typescript/src/components/select/index.d.ts.map +1 -1
  95. package/lib/typescript/src/components/separator/index.d.ts +47 -0
  96. package/lib/typescript/src/components/separator/index.d.ts.map +1 -0
  97. package/lib/typescript/src/components/slider/index.d.ts +203 -0
  98. package/lib/typescript/src/components/slider/index.d.ts.map +1 -0
  99. package/lib/typescript/src/components/surface/index.d.ts +51 -2
  100. package/lib/typescript/src/components/surface/index.d.ts.map +1 -1
  101. package/lib/typescript/src/components/switch/index.d.ts.map +1 -1
  102. package/lib/typescript/src/components/tabs/index.d.ts +46 -4
  103. package/lib/typescript/src/components/tabs/index.d.ts.map +1 -1
  104. package/lib/typescript/src/components/toggle-button/index.d.ts +244 -0
  105. package/lib/typescript/src/components/toggle-button/index.d.ts.map +1 -0
  106. package/lib/typescript/src/hooks/index.d.ts +1 -0
  107. package/lib/typescript/src/hooks/index.d.ts.map +1 -1
  108. package/lib/typescript/src/hooks/use-keyboard-avoidance.d.ts +10 -1
  109. package/lib/typescript/src/hooks/use-keyboard-avoidance.d.ts.map +1 -1
  110. package/lib/typescript/src/hooks/use-scroll-sections.d.ts +31 -0
  111. package/lib/typescript/src/hooks/use-scroll-sections.d.ts.map +1 -0
  112. package/lib/typescript/src/icons/index.d.ts +6 -0
  113. package/lib/typescript/src/icons/index.d.ts.map +1 -1
  114. package/lib/typescript/src/index.d.ts +13 -4
  115. package/lib/typescript/src/index.d.ts.map +1 -1
  116. package/lib/typescript/src/native/index.d.ts +16 -1
  117. package/lib/typescript/src/native/index.d.ts.map +1 -1
  118. package/lib/typescript/src/primitives/keyboard-avoider.d.ts +8 -1
  119. package/lib/typescript/src/primitives/keyboard-avoider.d.ts.map +1 -1
  120. package/lib/typescript/src/primitives/scrim.d.ts +21 -0
  121. package/lib/typescript/src/primitives/scrim.d.ts.map +1 -0
  122. package/lib/typescript/src/utils/haptics.d.ts +12 -0
  123. package/lib/typescript/src/utils/haptics.d.ts.map +1 -0
  124. package/package.json +9 -1
  125. package/src/components/attachment/index.tsx +279 -0
  126. package/src/components/bottom-sheet/index.tsx +58 -2
  127. package/src/components/button/index.tsx +26 -5
  128. package/src/components/dialog/index.tsx +10 -1
  129. package/src/components/empty-state/index.tsx +60 -14
  130. package/src/components/frame/index.tsx +175 -29
  131. package/src/components/input/index.tsx +122 -16
  132. package/src/components/line-chart/index.tsx +1224 -0
  133. package/src/components/marker/index.tsx +194 -0
  134. package/src/components/message/index.tsx +29 -5
  135. package/src/components/message-scroller/index.tsx +574 -0
  136. package/src/components/popover/index.tsx +624 -0
  137. package/src/components/progress/index.tsx +81 -1
  138. package/src/components/radio-group/index.tsx +156 -18
  139. package/src/components/section-rail/index.tsx +459 -0
  140. package/src/components/select/index.tsx +265 -52
  141. package/src/components/separator/index.tsx +97 -0
  142. package/src/components/slider/index.tsx +371 -0
  143. package/src/components/surface/index.tsx +29 -3
  144. package/src/components/switch/index.tsx +8 -1
  145. package/src/components/tabs/index.tsx +208 -28
  146. package/src/components/toggle-button/index.tsx +374 -0
  147. package/src/hooks/index.ts +5 -0
  148. package/src/hooks/use-keyboard-avoidance.ts +73 -7
  149. package/src/hooks/use-scroll-sections.ts +127 -0
  150. package/src/icons/index.tsx +48 -0
  151. package/src/index.ts +97 -6
  152. package/src/native/index.ts +13 -1
  153. package/src/primitives/keyboard-avoider.tsx +9 -1
  154. package/src/primitives/scrim.tsx +95 -0
  155. package/src/utils/haptics.ts +63 -0
  156. package/theme.css +64 -2
  157. package/lib/module/components/inline-select/index.js +0 -284
  158. package/lib/module/components/inline-select/index.js.map +0 -1
  159. package/lib/typescript/src/components/inline-select/index.d.ts +0 -48
  160. package/lib/typescript/src/components/inline-select/index.d.ts.map +0 -1
  161. package/src/components/inline-select/index.tsx +0 -332
@@ -0,0 +1,203 @@
1
+ import { View } from 'react-native';
2
+ import { type VariantProps } from 'tailwind-variants';
3
+ declare const sliderVariants: import("tailwind-variants").TVReturnType<{
4
+ color: {
5
+ primary: {
6
+ fill: string;
7
+ thumb: string;
8
+ };
9
+ success: {
10
+ fill: string;
11
+ thumb: string;
12
+ };
13
+ warning: {
14
+ fill: string;
15
+ thumb: string;
16
+ };
17
+ destructive: {
18
+ fill: string;
19
+ thumb: string;
20
+ };
21
+ info: {
22
+ fill: string;
23
+ thumb: string;
24
+ };
25
+ };
26
+ size: {
27
+ sm: {
28
+ track: string;
29
+ thumb: string;
30
+ };
31
+ md: {
32
+ track: string;
33
+ thumb: string;
34
+ };
35
+ lg: {
36
+ track: string;
37
+ thumb: string;
38
+ };
39
+ };
40
+ disabled: {
41
+ true: {
42
+ root: string;
43
+ };
44
+ };
45
+ }, {
46
+ root: string;
47
+ header: string;
48
+ label: string;
49
+ value: string;
50
+ track: string;
51
+ fill: string;
52
+ thumb: string;
53
+ knob: string;
54
+ }, undefined, {
55
+ color: {
56
+ primary: {
57
+ fill: string;
58
+ thumb: string;
59
+ };
60
+ success: {
61
+ fill: string;
62
+ thumb: string;
63
+ };
64
+ warning: {
65
+ fill: string;
66
+ thumb: string;
67
+ };
68
+ destructive: {
69
+ fill: string;
70
+ thumb: string;
71
+ };
72
+ info: {
73
+ fill: string;
74
+ thumb: string;
75
+ };
76
+ };
77
+ size: {
78
+ sm: {
79
+ track: string;
80
+ thumb: string;
81
+ };
82
+ md: {
83
+ track: string;
84
+ thumb: string;
85
+ };
86
+ lg: {
87
+ track: string;
88
+ thumb: string;
89
+ };
90
+ };
91
+ disabled: {
92
+ true: {
93
+ root: string;
94
+ };
95
+ };
96
+ }, {
97
+ root: string;
98
+ header: string;
99
+ label: string;
100
+ value: string;
101
+ track: string;
102
+ fill: string;
103
+ thumb: string;
104
+ knob: string;
105
+ }, import("tailwind-variants").TVReturnType<{
106
+ color: {
107
+ primary: {
108
+ fill: string;
109
+ thumb: string;
110
+ };
111
+ success: {
112
+ fill: string;
113
+ thumb: string;
114
+ };
115
+ warning: {
116
+ fill: string;
117
+ thumb: string;
118
+ };
119
+ destructive: {
120
+ fill: string;
121
+ thumb: string;
122
+ };
123
+ info: {
124
+ fill: string;
125
+ thumb: string;
126
+ };
127
+ };
128
+ size: {
129
+ sm: {
130
+ track: string;
131
+ thumb: string;
132
+ };
133
+ md: {
134
+ track: string;
135
+ thumb: string;
136
+ };
137
+ lg: {
138
+ track: string;
139
+ thumb: string;
140
+ };
141
+ };
142
+ disabled: {
143
+ true: {
144
+ root: string;
145
+ };
146
+ };
147
+ }, {
148
+ root: string;
149
+ header: string;
150
+ label: string;
151
+ value: string;
152
+ track: string;
153
+ fill: string;
154
+ thumb: string;
155
+ knob: string;
156
+ }, undefined, unknown, unknown, undefined>>;
157
+ type SliderVariantProps = VariantProps<typeof sliderVariants>;
158
+ export interface SliderProps extends Omit<SliderVariantProps, 'disabled'> {
159
+ className?: string;
160
+ /** Controlled value. Leave unset and pass `defaultValue` to run uncontrolled. */
161
+ value?: number;
162
+ /** Starting value when uncontrolled. */
163
+ defaultValue?: number;
164
+ /** Lower bound. */
165
+ min?: number;
166
+ /** Upper bound. */
167
+ max?: number;
168
+ /** Snap granularity. The value is always a multiple of `step` from `min`. */
169
+ step?: number;
170
+ /** Fires on every change while dragging — cheap updates only. */
171
+ onValueChange?: (value: number) => void;
172
+ /** Fires once when the gesture ends — the place for expensive side effects. */
173
+ onValueCommit?: (value: number) => void;
174
+ disabled?: boolean;
175
+ /**
176
+ * Render the platform's own slider instead of this one. Requires the
177
+ * optional `@expo/ui` package; without it this prop does nothing.
178
+ *
179
+ * **Theme tokens do not apply** — the platform draws the control, so
180
+ * `color`, `size` and the slot classNames are ignored. `label` and
181
+ * `showValue` still render the caption row above it, since that is ours.
182
+ */
183
+ native?: boolean;
184
+ /** Caption above the track. Also becomes the accessibility label. */
185
+ label?: string;
186
+ /** Show the current value on the caption row, opposite the label. */
187
+ showValue?: boolean;
188
+ /** Format the shown value. Defaults to the rounded number. */
189
+ formatValue?: (value: number) => string;
190
+ /** Extra classes for the caption row. */
191
+ headerClassName?: string;
192
+ /** Extra classes for the unfilled track. */
193
+ trackClassName?: string;
194
+ /** Extra classes for the filled portion. */
195
+ fillClassName?: string;
196
+ /** Extra classes for the draggable thumb. */
197
+ thumbClassName?: string;
198
+ /** Extra classes for the knob inside the thumb. */
199
+ knobClassName?: string;
200
+ }
201
+ export declare const Slider: import("react").ForwardRefExoticComponent<SliderProps & import("react").RefAttributes<View>>;
202
+ export {};
203
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/slider/index.tsx"],"names":[],"mappings":"AAuBA,OAAO,EACL,IAAI,EAGL,MAAM,cAAc,CAAC;AAQtB,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAiB1D,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AA6C;IAC7C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mDAAmD;IACnD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAYD,eAAO,MAAM,MAAM,8FAsNlB,CAAC"}
@@ -7,13 +7,37 @@ declare const surfaceVariants: import("tailwind-variants").TVReturnType<{
7
7
  tertiary: string;
8
8
  transparent: string;
9
9
  };
10
- }, undefined, "overflow-hidden rounded-3xl p-4", {
10
+ padding: {
11
+ none: string;
12
+ sm: string;
13
+ default: string;
14
+ lg: string;
15
+ };
16
+ bordered: {
17
+ true: string;
18
+ };
19
+ elevated: {
20
+ true: string;
21
+ };
22
+ }, undefined, "overflow-hidden rounded-3xl", {
11
23
  variant: {
12
24
  default: string;
13
25
  secondary: string;
14
26
  tertiary: string;
15
27
  transparent: string;
16
28
  };
29
+ padding: {
30
+ none: string;
31
+ sm: string;
32
+ default: string;
33
+ lg: string;
34
+ };
35
+ bordered: {
36
+ true: string;
37
+ };
38
+ elevated: {
39
+ true: string;
40
+ };
17
41
  }, undefined, import("tailwind-variants").TVReturnType<{
18
42
  variant: {
19
43
  default: string;
@@ -21,9 +45,34 @@ declare const surfaceVariants: import("tailwind-variants").TVReturnType<{
21
45
  tertiary: string;
22
46
  transparent: string;
23
47
  };
24
- }, undefined, "overflow-hidden rounded-3xl p-4", unknown, unknown, undefined>>;
48
+ padding: {
49
+ none: string;
50
+ sm: string;
51
+ default: string;
52
+ lg: string;
53
+ };
54
+ bordered: {
55
+ true: string;
56
+ };
57
+ elevated: {
58
+ true: string;
59
+ };
60
+ }, undefined, "overflow-hidden rounded-3xl", unknown, unknown, undefined>>;
25
61
  export interface SurfaceProps extends ViewProps, VariantProps<typeof surfaceVariants> {
26
62
  className?: string;
63
+ /**
64
+ * A hairline border. A surface the same colour as what it sits on needs one
65
+ * to read as a distinct plane rather than dissolving into the background.
66
+ */
67
+ bordered?: boolean;
68
+ /**
69
+ * A soft shadow lifting the surface off the page. Off by default because a
70
+ * nested surface reads its depth from its fill, not from a shadow it would
71
+ * only cast onto its parent.
72
+ */
73
+ elevated?: boolean;
74
+ /** Inner spacing. `none` is for a surface wrapping a bled image or a chart. */
75
+ padding?: 'none' | 'sm' | 'default' | 'lg';
27
76
  }
28
77
  export declare const Surface: import("react").ForwardRefExoticComponent<SurfaceProps & import("react").RefAttributes<View>>;
29
78
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/surface/index.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAAc,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;8EAanB,CAAC;AAEH,MAAM,WAAW,YACf,SAAQ,SAAS,EACf,YAAY,CAAC,OAAO,eAAe,CAAC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,OAAO,+FAYnB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/surface/index.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAAc,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0EA0BnB,CAAC;AAEH,MAAM,WAAW,YACf,SAAQ,SAAS,EACf,YAAY,CAAC,OAAO,eAAe,CAAC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAAC;CAC5C;AAED,eAAO,MAAM,OAAO,+FAYnB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/switch/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAa,IAAI,EAAE,MAAM,cAAc,CAAC;AAO/C,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAK1D,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAkBlB,CAAC;AAIH,MAAM,WAAW,WAAY,SAAQ,YAAY,CAAC,OAAO,cAAc,CAAC;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IACf,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM,8FAkDlB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/switch/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAa,IAAI,EAAE,MAAM,cAAc,CAAC;AAO/C,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAK1D,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAkBlB,CAAC;AAWH,MAAM,WAAW,WAAY,SAAQ,YAAY,CAAC,OAAO,cAAc,CAAC;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IACf,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM,8FAkDlB,CAAC"}
@@ -1,30 +1,72 @@
1
+ /**
2
+ * Tabs — segmented navigation between panels.
3
+ *
4
+ * The active tab is marked by one indicator that slides between measured
5
+ * trigger positions rather than by a style on each trigger. That is what makes
6
+ * the movement continuous: there is a single thing travelling, so a switch two
7
+ * tabs away reads as one gesture instead of two states swapping.
8
+ *
9
+ * ```tsx
10
+ * <Tabs defaultValue="account">
11
+ * <Tabs.List>
12
+ * <Tabs.Trigger value="account">Account</Tabs.Trigger>
13
+ * <Tabs.Trigger value="team" badge={<Badge>3</Badge>}>Team</Tabs.Trigger>
14
+ * </Tabs.List>
15
+ * <Tabs.Content value="account">…</Tabs.Content>
16
+ * </Tabs>
17
+ * ```
18
+ */
1
19
  import { type ReactNode } from 'react';
2
20
  import { type ViewProps } from 'react-native';
21
+ export type TabsVariant = 'segmented' | 'underline' | 'pill';
3
22
  export interface TabsProps extends ViewProps {
4
23
  className?: string;
5
24
  value?: string;
6
25
  onValueChange?: (value: string) => void;
7
26
  defaultValue: string;
27
+ /**
28
+ * `segmented` is a chip travelling inside a recessed track, `underline` is a
29
+ * rule under the active tab, `pill` is a filled chip on the page.
30
+ */
31
+ variant?: TabsVariant;
32
+ /**
33
+ * Keep inactive panels mounted and hidden instead of unmounting them, so a
34
+ * scroll position or a half-filled form survives a switch away and back.
35
+ * Costs the render of every panel up front.
36
+ */
37
+ keepMounted?: boolean;
8
38
  children: ReactNode;
9
39
  }
10
- declare function TabsRoot({ className, value, onValueChange, defaultValue, children, ...props }: TabsProps): import("react").JSX.Element;
40
+ declare function TabsRoot({ className, value, onValueChange, defaultValue, variant, keepMounted, children, ...props }: TabsProps): import("react").JSX.Element;
11
41
  export interface TabsListProps extends ViewProps {
12
42
  className?: string;
43
+ /**
44
+ * Lay the triggers out at their natural widths inside a horizontal scroller
45
+ * instead of splitting the row between them. For more tabs than fit — which
46
+ * a fixed row answers by crushing every label.
47
+ */
48
+ scrollable?: boolean;
13
49
  children: ReactNode;
14
50
  }
15
- declare function TabsList({ className, children, ...props }: TabsListProps): import("react").JSX.Element;
51
+ declare function TabsList({ className, scrollable, children, ...props }: TabsListProps): import("react").JSX.Element;
16
52
  export interface TabsTriggerProps {
17
53
  className?: string;
18
54
  value: string;
55
+ /** Rendered before the label. */
56
+ icon?: ReactNode;
57
+ /** Rendered after the label — a count, a dot, a status. */
58
+ badge?: ReactNode;
59
+ /** Unselectable, dimmed, and announced as disabled. */
60
+ disabled?: boolean;
19
61
  children: ReactNode;
20
62
  }
21
- declare function TabsTrigger({ className, value, children }: TabsTriggerProps): import("react").JSX.Element;
63
+ declare function TabsTrigger({ className, value, icon, badge, disabled, children, }: TabsTriggerProps): import("react").JSX.Element;
22
64
  export interface TabsContentProps extends ViewProps {
23
65
  className?: string;
24
66
  value: string;
25
67
  children: ReactNode;
26
68
  }
27
- declare function TabsContent({ className, value, children, ...props }: TabsContentProps): import("react").JSX.Element | null;
69
+ declare function TabsContent({ className, value, children, style, ...props }: TabsContentProps): import("react").JSX.Element | null;
28
70
  export declare const Tabs: typeof TabsRoot & {
29
71
  List: typeof TabsList;
30
72
  Trigger: typeof TabsTrigger;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/tabs/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAA2C,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAkCvF,MAAM,WAAW,SAAU,SAAQ,SAAS;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,C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SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,sCA4BrF;AAED,eAAO,MAAM,IAAI;;;;CAIf,CAAC"}
@@ -0,0 +1,244 @@
1
+ /**
2
+ * ToggleButton — a button that stays down.
3
+ *
4
+ * The difference from Button is the whole point: a button does something and
5
+ * springs back, a toggle button *is* something afterwards. So the selected
6
+ * state is the loud one — a filled accent surface — and the resting state is
7
+ * quiet, either a soft fill or nothing at all.
8
+ *
9
+ * ```tsx
10
+ * <ToggleButton defaultSelected>Like</ToggleButton>
11
+ *
12
+ * <ToggleButton iconOnly accessibilityLabel="Bold">
13
+ * <BoldIcon size={16} />
14
+ * </ToggleButton>
15
+ * ```
16
+ *
17
+ * `ToggleButtonGroup` takes over the state for a set of them — a segmented
18
+ * toolbar in `multiple` mode, an either-or choice in `single`. Inside a group
19
+ * each button needs an `id`, which is the value the group reports.
20
+ *
21
+ * ```tsx
22
+ * <ToggleButtonGroup selectionMode="multiple" value={marks} onValueChange={setMarks}>
23
+ * <ToggleButton id="bold" iconOnly accessibilityLabel="Bold">…</ToggleButton>
24
+ * <ToggleButton id="italic" iconOnly accessibilityLabel="Italic">…</ToggleButton>
25
+ * </ToggleButtonGroup>
26
+ * ```
27
+ */
28
+ import { type ReactNode } from 'react';
29
+ import { View, type ViewProps } from 'react-native';
30
+ import { type VariantProps } from 'tailwind-variants';
31
+ import { type AnimatedPressableProps } from '../../primitives/animated-pressable.js';
32
+ declare const toggleVariants: import("tailwind-variants").TVReturnType<{
33
+ variant: {
34
+ /** A soft fill at rest, so the control is visible before you touch it. */
35
+ default: {
36
+ root: string;
37
+ };
38
+ /** Nothing at rest — for a dense toolbar where six fills would be noise. */
39
+ ghost: {
40
+ root: string;
41
+ };
42
+ };
43
+ size: {
44
+ sm: {
45
+ root: string;
46
+ label: string;
47
+ };
48
+ md: {
49
+ root: string;
50
+ label: string;
51
+ };
52
+ lg: {
53
+ root: string;
54
+ label: string;
55
+ };
56
+ };
57
+ selected: {
58
+ true: {
59
+ root: string;
60
+ label: string;
61
+ };
62
+ false: {
63
+ label: string;
64
+ };
65
+ };
66
+ iconOnly: {
67
+ true: {
68
+ root: string;
69
+ };
70
+ };
71
+ disabled: {
72
+ true: {
73
+ root: string;
74
+ };
75
+ };
76
+ }, {
77
+ root: string;
78
+ label: string;
79
+ }, undefined, {
80
+ variant: {
81
+ /** A soft fill at rest, so the control is visible before you touch it. */
82
+ default: {
83
+ root: string;
84
+ };
85
+ /** Nothing at rest — for a dense toolbar where six fills would be noise. */
86
+ ghost: {
87
+ root: string;
88
+ };
89
+ };
90
+ size: {
91
+ sm: {
92
+ root: string;
93
+ label: string;
94
+ };
95
+ md: {
96
+ root: string;
97
+ label: string;
98
+ };
99
+ lg: {
100
+ root: string;
101
+ label: string;
102
+ };
103
+ };
104
+ selected: {
105
+ true: {
106
+ root: string;
107
+ label: string;
108
+ };
109
+ false: {
110
+ label: string;
111
+ };
112
+ };
113
+ iconOnly: {
114
+ true: {
115
+ root: string;
116
+ };
117
+ };
118
+ disabled: {
119
+ true: {
120
+ root: string;
121
+ };
122
+ };
123
+ }, {
124
+ root: string;
125
+ label: string;
126
+ }, import("tailwind-variants").TVReturnType<{
127
+ variant: {
128
+ /** A soft fill at rest, so the control is visible before you touch it. */
129
+ default: {
130
+ root: string;
131
+ };
132
+ /** Nothing at rest — for a dense toolbar where six fills would be noise. */
133
+ ghost: {
134
+ root: string;
135
+ };
136
+ };
137
+ size: {
138
+ sm: {
139
+ root: string;
140
+ label: string;
141
+ };
142
+ md: {
143
+ root: string;
144
+ label: string;
145
+ };
146
+ lg: {
147
+ root: string;
148
+ label: string;
149
+ };
150
+ };
151
+ selected: {
152
+ true: {
153
+ root: string;
154
+ label: string;
155
+ };
156
+ false: {
157
+ label: string;
158
+ };
159
+ };
160
+ iconOnly: {
161
+ true: {
162
+ root: string;
163
+ };
164
+ };
165
+ disabled: {
166
+ true: {
167
+ root: string;
168
+ };
169
+ };
170
+ }, {
171
+ root: string;
172
+ label: string;
173
+ }, undefined, unknown, unknown, undefined>>;
174
+ type ToggleVariantProps = VariantProps<typeof toggleVariants>;
175
+ export type ToggleButtonSize = NonNullable<ToggleVariantProps['size']>;
176
+ export type ToggleButtonVariant = NonNullable<ToggleVariantProps['variant']>;
177
+ export type ToggleSelectionMode = 'single' | 'multiple';
178
+ export interface ToggleButtonGroupProps extends ViewProps {
179
+ className?: string;
180
+ /**
181
+ * `multiple` is a set of independent marks — bold *and* italic. `single` is
182
+ * an either-or choice where picking one clears the last.
183
+ */
184
+ selectionMode?: ToggleSelectionMode;
185
+ /** Selected ids. Controlled — pair with `onValueChange`. */
186
+ value?: string[];
187
+ /** Starting selection when uncontrolled. */
188
+ defaultValue?: string[];
189
+ onValueChange?: (value: string[]) => void;
190
+ /** Disables every button in the group. */
191
+ disabled?: boolean;
192
+ /** Applied to every button that does not set its own. */
193
+ variant?: ToggleButtonVariant;
194
+ size?: ToggleButtonSize;
195
+ children: ReactNode;
196
+ }
197
+ declare const ToggleButtonGroup: import("react").ForwardRefExoticComponent<ToggleButtonGroupProps & import("react").RefAttributes<View>>;
198
+ interface ToggleStateValue {
199
+ selected: boolean;
200
+ disabled: boolean;
201
+ }
202
+ /**
203
+ * The toggle's own state, for anything rendered inside it — an icon that
204
+ * changes shape when selected, a count that only shows when it is on.
205
+ */
206
+ export declare function useToggleButton(): ToggleStateValue;
207
+ export interface ToggleButtonProps extends Omit<AnimatedPressableProps, 'children' | 'disabled'>, Omit<ToggleVariantProps, 'selected' | 'disabled' | 'iconOnly'> {
208
+ children?: ReactNode;
209
+ className?: string;
210
+ /** Extra classes for the label when children is a string. */
211
+ labelClassName?: string;
212
+ /** Identifies this button within a `ToggleButtonGroup`. Required there. */
213
+ id?: string;
214
+ /** Controlled selection. Ignored inside a group, which owns the state. */
215
+ selected?: boolean;
216
+ /** Starting state when uncontrolled and outside a group. */
217
+ defaultSelected?: boolean;
218
+ onSelectedChange?: (selected: boolean) => void;
219
+ disabled?: boolean;
220
+ /** Square, with no horizontal padding — for a single icon. */
221
+ iconOnly?: boolean;
222
+ /** Extra classes applied only while selected. */
223
+ selectedClassName?: string;
224
+ /** Extra classes applied only while unselected. */
225
+ unselectedClassName?: string;
226
+ }
227
+ export interface ToggleButtonLabelProps {
228
+ className?: string;
229
+ children: ReactNode;
230
+ }
231
+ /**
232
+ * The label, when the button holds more than a string — an icon beside text.
233
+ * It reads the selected state itself, so composing the two does not mean
234
+ * threading the colour through by hand.
235
+ */
236
+ declare function ToggleButtonLabel({ className, children }: ToggleButtonLabelProps): import("react").JSX.Element;
237
+ declare namespace ToggleButtonLabel {
238
+ var displayName: string;
239
+ }
240
+ export declare const ToggleButton: import("react").ForwardRefExoticComponent<ToggleButtonProps & import("react").RefAttributes<View>> & {
241
+ Label: typeof ToggleButtonLabel;
242
+ };
243
+ export { ToggleButtonGroup };
244
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/toggle-button/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG1D,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,wCAAqC,CAAC;AAI7C,QAAA,MAAM,cAAc;;QAOd,0EAA0E;;;;QAE1E,4EAA4E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAF5E,0EAA0E;;;;QAE1E,4EAA4E;;;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AE,UAAU,GAAG,UAAU,GAAG,UAAU,CAAC;IAChE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,2EAA2E;IAC3E,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4DAA4D;IAC5D,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iDAAiD;IACjD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mDAAmD;IACnD,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAsGD,MAAM,WAAW,sBAAsB;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;GAIG;AACH,iBAAS,iBAAiB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,sBAAsB,+BAczE;kBAdQ,iBAAiB;;;AAiB1B,eAAO,MAAM,YAAY;;CAEvB,CAAC;AAEH,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
@@ -3,6 +3,7 @@ export { useDisclosure, type UseDisclosureOptions, type UseDisclosureResult, } f
3
3
  export { useBreakpoint, BREAKPOINTS, type Breakpoint, type UseBreakpointResult, } from './use-breakpoint.js';
4
4
  export { useKeyboard, type UseKeyboardResult } from './use-keyboard.js';
5
5
  export { useKeyboardAvoidance, type UseKeyboardAvoidanceOptions, type UseKeyboardAvoidanceResult, } from './use-keyboard-avoidance.js';
6
+ export { useScrollSections, type UseScrollSectionsOptions, type UseScrollSectionsResult, } from './use-scroll-sections.js';
6
7
  export { useDebouncedValue } from './use-debounced-value.js';
7
8
  export { usePrevious } from './use-previous.js';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,GAC9B,MAAM,4BAAyB,CAAC;AACjC,OAAO,EACL,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,qBAAkB,CAAC;AAC1B,OAAO,EACL,aAAa,EACb,WAAW,EACX,KAAK,UAAU,EACf,KAAK,mBAAmB,GACzB,MAAM,qBAAkB,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAgB,CAAC;AACrE,OAAO,EACL,oBAAoB,EACpB,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,GAChC,MAAM,6BAA0B,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAAuB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,GAC9B,MAAM,4BAAyB,CAAC;AACjC,OAAO,EACL,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,qBAAkB,CAAC;AAC1B,OAAO,EACL,aAAa,EACb,WAAW,EACX,KAAK,UAAU,EACf,KAAK,mBAAmB,GACzB,MAAM,qBAAkB,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAgB,CAAC;AACrE,OAAO,EACL,oBAAoB,EACpB,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,GAChC,MAAM,6BAA0B,CAAC;AAClC,OAAO,EACL,iBAAiB,EACjB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,GAC7B,MAAM,0BAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAAuB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAgB,CAAC"}
@@ -3,6 +3,15 @@ import { useAnimatedStyle, type AnimatedRef } from 'react-native-reanimated';
3
3
  export interface UseKeyboardAvoidanceOptions {
4
4
  /** Set false to leave the element where it is. */
5
5
  enabled?: boolean;
6
+ /**
7
+ * Whether this element is the one that should get out of the keyboard's way.
8
+ *
9
+ * Defaults to true, which suits a composer or a toolbar: it rides the
10
+ * keyboard whatever is focused. A *field* wants the opposite — pass its own
11
+ * focus state, or every field on the screen lifts whenever any one of them
12
+ * is tapped, and they all arrive at the same place on top of each other.
13
+ */
14
+ active?: boolean;
6
15
  /** Gap to keep between the element's bottom edge and the keyboard. */
7
16
  offset?: number;
8
17
  }
@@ -16,5 +25,5 @@ export interface UseKeyboardAvoidanceResult {
16
25
  }
17
26
  /** True when the keyboard controller is driving this, rather than the fallback. */
18
27
  export declare function hasKeyboardController(): boolean;
19
- export declare function useKeyboardAvoidance({ enabled, offset, }?: UseKeyboardAvoidanceOptions): UseKeyboardAvoidanceResult;
28
+ export declare function useKeyboardAvoidance({ enabled, active, offset, }?: UseKeyboardAvoidanceOptions): UseKeyboardAvoidanceResult;
20
29
  //# sourceMappingURL=use-keyboard-avoidance.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-keyboard-avoidance.d.ts","sourceRoot":"","sources":["../../../../src/hooks/use-keyboard-avoidance.ts"],"names":[],"mappings":"AAkCA,OAAO,EAAuB,KAAK,iBAAiB,EAAE,KAAK,IAAI,EAAE,MAAM,cAAc,CAAC;AACtF,OAAO,EAGL,gBAAgB,EAEhB,KAAK,WAAW,EAEjB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,2BAA2B;IAC1C,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