panelui-native 0.75.1 → 0.76.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 (151) hide show
  1. package/lib/module/components/ai-input/ai-input-growth.js +62 -0
  2. package/lib/module/components/ai-input/ai-input-growth.js.map +1 -0
  3. package/lib/module/components/ai-input/index.js +1568 -0
  4. package/lib/module/components/ai-input/index.js.map +1 -0
  5. package/lib/module/components/alert/index.js +1 -1
  6. package/lib/module/components/alert/index.js.map +1 -1
  7. package/lib/module/components/avatar/avatar-source.js +15 -0
  8. package/lib/module/components/avatar/avatar-source.js.map +1 -0
  9. package/lib/module/components/avatar/index.js +32 -31
  10. package/lib/module/components/avatar/index.js.map +1 -1
  11. package/lib/module/components/bottom-sheet/index.js +3 -2
  12. package/lib/module/components/bottom-sheet/index.js.map +1 -1
  13. package/lib/module/components/button-group/index.js +2 -3
  14. package/lib/module/components/button-group/index.js.map +1 -1
  15. package/lib/module/components/carousel/index.js +10 -7
  16. package/lib/module/components/carousel/index.js.map +1 -1
  17. package/lib/module/components/collapsible/index.js +1 -1
  18. package/lib/module/components/collapsible/index.js.map +1 -1
  19. package/lib/module/components/field/index.js +7 -8
  20. package/lib/module/components/field/index.js.map +1 -1
  21. package/lib/module/components/label/index.js +1 -1
  22. package/lib/module/components/label/index.js.map +1 -1
  23. package/lib/module/components/marquee/index.js +36 -11
  24. package/lib/module/components/marquee/index.js.map +1 -1
  25. package/lib/module/components/marquee/marquee-math.js +22 -6
  26. package/lib/module/components/marquee/marquee-math.js.map +1 -1
  27. package/lib/module/components/plan/index.js +2 -1
  28. package/lib/module/components/plan/index.js.map +1 -1
  29. package/lib/module/components/plot/index.js +27 -9
  30. package/lib/module/components/plot/index.js.map +1 -1
  31. package/lib/module/components/search-bar/index.js +11 -3
  32. package/lib/module/components/search-bar/index.js.map +1 -1
  33. package/lib/module/components/split-view/index.js +26 -27
  34. package/lib/module/components/split-view/index.js.map +1 -1
  35. package/lib/module/components/split-view/split-view-lifecycle.js +32 -0
  36. package/lib/module/components/split-view/split-view-lifecycle.js.map +1 -0
  37. package/lib/module/components/splitter/index.js +7 -13
  38. package/lib/module/components/splitter/index.js.map +1 -1
  39. package/lib/module/components/splitter/splitter-math.js +14 -0
  40. package/lib/module/components/splitter/splitter-math.js.map +1 -1
  41. package/lib/module/components/tabs/index.js +1 -1
  42. package/lib/module/components/tabs/index.js.map +1 -1
  43. package/lib/module/components/timeline/index.js +156 -42
  44. package/lib/module/components/timeline/index.js.map +1 -1
  45. package/lib/module/components/timeline/timeline-geometry.js +11 -0
  46. package/lib/module/components/timeline/timeline-geometry.js.map +1 -1
  47. package/lib/module/components/toast/index.js +1 -1
  48. package/lib/module/components/toast/index.js.map +1 -1
  49. package/lib/module/components/tooltip/index.js +2 -2
  50. package/lib/module/components/tooltip/index.js.map +1 -1
  51. package/lib/module/components/tree/index.js +2 -2
  52. package/lib/module/components/tree/index.js.map +1 -1
  53. package/lib/module/components/typography/index.js +2 -1
  54. package/lib/module/components/typography/index.js.map +1 -1
  55. package/lib/module/components/waterfall-chart/index.js +22 -3
  56. package/lib/module/components/waterfall-chart/index.js.map +1 -1
  57. package/lib/module/hooks/use-disclosure.js +10 -8
  58. package/lib/module/hooks/use-disclosure.js.map +1 -1
  59. package/lib/module/icons/index.js +135 -0
  60. package/lib/module/icons/index.js.map +1 -1
  61. package/lib/module/index.js +5 -1
  62. package/lib/module/index.js.map +1 -1
  63. package/lib/module/primitives/controllable-state.js +61 -0
  64. package/lib/module/primitives/controllable-state.js.map +1 -0
  65. package/lib/module/primitives/finite-chart.js +15 -0
  66. package/lib/module/primitives/finite-chart.js.map +1 -0
  67. package/lib/module/primitives/glass.js +136 -0
  68. package/lib/module/primitives/glass.js.map +1 -0
  69. package/lib/module/primitives/scrim.js +8 -1
  70. package/lib/module/primitives/scrim.js.map +1 -1
  71. package/lib/typescript/src/components/ai-input/ai-input-growth.d.ts +59 -0
  72. package/lib/typescript/src/components/ai-input/ai-input-growth.d.ts.map +1 -0
  73. package/lib/typescript/src/components/ai-input/index.d.ts +423 -0
  74. package/lib/typescript/src/components/ai-input/index.d.ts.map +1 -0
  75. package/lib/typescript/src/components/avatar/avatar-source.d.ts +4 -0
  76. package/lib/typescript/src/components/avatar/avatar-source.d.ts.map +1 -0
  77. package/lib/typescript/src/components/avatar/index.d.ts.map +1 -1
  78. package/lib/typescript/src/components/bottom-sheet/index.d.ts +10 -1
  79. package/lib/typescript/src/components/bottom-sheet/index.d.ts.map +1 -1
  80. package/lib/typescript/src/components/carousel/index.d.ts.map +1 -1
  81. package/lib/typescript/src/components/marquee/index.d.ts +15 -6
  82. package/lib/typescript/src/components/marquee/index.d.ts.map +1 -1
  83. package/lib/typescript/src/components/marquee/marquee-math.d.ts +6 -0
  84. package/lib/typescript/src/components/marquee/marquee-math.d.ts.map +1 -1
  85. package/lib/typescript/src/components/plan/index.d.ts.map +1 -1
  86. package/lib/typescript/src/components/plot/index.d.ts +2 -1
  87. package/lib/typescript/src/components/plot/index.d.ts.map +1 -1
  88. package/lib/typescript/src/components/search-bar/index.d.ts.map +1 -1
  89. package/lib/typescript/src/components/split-view/index.d.ts.map +1 -1
  90. package/lib/typescript/src/components/split-view/split-view-lifecycle.d.ts +14 -0
  91. package/lib/typescript/src/components/split-view/split-view-lifecycle.d.ts.map +1 -0
  92. package/lib/typescript/src/components/splitter/index.d.ts +2 -2
  93. package/lib/typescript/src/components/splitter/index.d.ts.map +1 -1
  94. package/lib/typescript/src/components/splitter/splitter-math.d.ts +2 -0
  95. package/lib/typescript/src/components/splitter/splitter-math.d.ts.map +1 -1
  96. package/lib/typescript/src/components/timeline/index.d.ts +24 -2
  97. package/lib/typescript/src/components/timeline/index.d.ts.map +1 -1
  98. package/lib/typescript/src/components/timeline/timeline-geometry.d.ts +2 -0
  99. package/lib/typescript/src/components/timeline/timeline-geometry.d.ts.map +1 -1
  100. package/lib/typescript/src/components/toast/index.d.ts.map +1 -1
  101. package/lib/typescript/src/components/waterfall-chart/index.d.ts +2 -1
  102. package/lib/typescript/src/components/waterfall-chart/index.d.ts.map +1 -1
  103. package/lib/typescript/src/hooks/use-disclosure.d.ts.map +1 -1
  104. package/lib/typescript/src/icons/index.d.ts +18 -0
  105. package/lib/typescript/src/icons/index.d.ts.map +1 -1
  106. package/lib/typescript/src/index.d.ts +3 -1
  107. package/lib/typescript/src/index.d.ts.map +1 -1
  108. package/lib/typescript/src/primitives/controllable-state.d.ts +33 -0
  109. package/lib/typescript/src/primitives/controllable-state.d.ts.map +1 -0
  110. package/lib/typescript/src/primitives/finite-chart.d.ts +5 -0
  111. package/lib/typescript/src/primitives/finite-chart.d.ts.map +1 -0
  112. package/lib/typescript/src/primitives/glass.d.ts +43 -0
  113. package/lib/typescript/src/primitives/glass.d.ts.map +1 -0
  114. package/lib/typescript/src/primitives/scrim.d.ts +7 -0
  115. package/lib/typescript/src/primitives/scrim.d.ts.map +1 -1
  116. package/package.json +7 -2
  117. package/src/components/ai-input/ai-input-growth.ts +65 -0
  118. package/src/components/ai-input/index.tsx +1937 -0
  119. package/src/components/alert/index.tsx +1 -1
  120. package/src/components/avatar/avatar-source.ts +18 -0
  121. package/src/components/avatar/index.tsx +35 -27
  122. package/src/components/bottom-sheet/index.tsx +15 -3
  123. package/src/components/button-group/index.tsx +1 -1
  124. package/src/components/carousel/index.tsx +10 -11
  125. package/src/components/collapsible/index.tsx +1 -1
  126. package/src/components/field/index.tsx +4 -4
  127. package/src/components/label/index.tsx +1 -1
  128. package/src/components/marquee/index.tsx +56 -12
  129. package/src/components/marquee/marquee-math.ts +26 -3
  130. package/src/components/plan/index.tsx +6 -2
  131. package/src/components/plot/index.tsx +37 -11
  132. package/src/components/search-bar/index.tsx +9 -3
  133. package/src/components/split-view/index.tsx +24 -33
  134. package/src/components/split-view/split-view-lifecycle.ts +43 -0
  135. package/src/components/splitter/index.tsx +7 -11
  136. package/src/components/splitter/splitter-math.ts +28 -0
  137. package/src/components/tabs/index.tsx +1 -1
  138. package/src/components/timeline/index.tsx +189 -34
  139. package/src/components/timeline/timeline-geometry.ts +11 -0
  140. package/src/components/toast/index.tsx +6 -1
  141. package/src/components/tooltip/index.tsx +1 -1
  142. package/src/components/tree/index.tsx +2 -2
  143. package/src/components/typography/index.tsx +2 -2
  144. package/src/components/waterfall-chart/index.tsx +37 -4
  145. package/src/hooks/use-disclosure.ts +7 -12
  146. package/src/icons/index.tsx +106 -0
  147. package/src/index.ts +27 -0
  148. package/src/primitives/controllable-state.ts +112 -0
  149. package/src/primitives/finite-chart.ts +14 -0
  150. package/src/primitives/glass.tsx +171 -0
  151. package/src/primitives/scrim.tsx +7 -1
@@ -2,6 +2,13 @@ import { type ViewProps } from 'react-native';
2
2
  type BlurTint = 'light' | 'dark' | 'default' | 'systemMaterial';
3
3
  /** True when a real blur can be drawn — for a caller that wants to know. */
4
4
  export declare const hasBlur: boolean;
5
+ /**
6
+ * Whether the device asks for Reduce Transparency: `true`, `false`, or `null`
7
+ * while the platform has not answered yet. Exported because every material in
8
+ * the library has to respect the same preference, and two copies of this would
9
+ * be two answers.
10
+ */
11
+ export declare function useReduceTransparency(): boolean | null;
5
12
  export interface ScrimProps extends Omit<ViewProps, 'children'> {
6
13
  /** Frost the backdrop instead of dimming it. Falls back to a dim if it can't. */
7
14
  blur?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"scrim.d.ts","sourceRoot":"","sources":["../../../../src/primitives/scrim.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAuC,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGnF,KAAK,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,gBAAgB,CAAC;AAwBhE,4EAA4E;AAC5E,eAAO,MAAM,OAAO,SAAoB,CAAC;AAkGzC,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IAC7D,iFAAiF;IACjF,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gCAAgC;IAChC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,KAAK,CAAC,EACpB,IAAY,EACZ,SAAc,EACd,IAAgB,EAChB,YAA4B,EAC5B,KAAK,EACL,GAAG,KAAK,EACT,EAAE,UAAU,+BA+CZ;yBAtDe,KAAK"}
1
+ {"version":3,"file":"scrim.d.ts","sourceRoot":"","sources":["../../../../src/primitives/scrim.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAuC,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGnF,KAAK,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,gBAAgB,CAAC;AAwBhE,4EAA4E;AAC5E,eAAO,MAAM,OAAO,SAAoB,CAAC;AAqEzC;;;;;GAKG;AACH,wBAAgB,qBAAqB,mBAapC;AAgBD,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IAC7D,iFAAiF;IACjF,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gCAAgC;IAChC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,KAAK,CAAC,EACpB,IAAY,EACZ,SAAc,EACd,IAAgB,EAChB,YAA4B,EAC5B,KAAK,EACL,GAAG,KAAK,EACT,EAAE,UAAU,+BA+CZ;yBAtDe,KAAK"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "panelui-native",
3
- "version": "0.75.1",
3
+ "version": "0.76.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",
@@ -90,7 +90,8 @@
90
90
  "clean": "rm -rf lib",
91
91
  "verify:package": "node scripts/verify-package.mjs",
92
92
  "generate:subpaths": "node scripts/generate-subpath-exports.mjs --write",
93
- "check:subpaths": "node scripts/generate-subpath-exports.mjs"
93
+ "check:subpaths": "node scripts/generate-subpath-exports.mjs",
94
+ "benchmark:components": "node --experimental-strip-types scripts/benchmark-component-scale.mjs"
94
95
  },
95
96
  "keywords": [
96
97
  "react-native",
@@ -132,6 +133,7 @@
132
133
  "expo-blur": ">=13.0.0",
133
134
  "expo-clipboard": ">=7.0.0",
134
135
  "expo-file-system": ">=17.0.0",
136
+ "expo-glass-effect": ">=57.0.0",
135
137
  "expo-haptics": ">=13.0.0",
136
138
  "expo-linear-gradient": ">=13.0.0",
137
139
  "expo-location": ">=18.0.0",
@@ -186,6 +188,9 @@
186
188
  "expo-file-system": {
187
189
  "optional": true
188
190
  },
191
+ "expo-glass-effect": {
192
+ "optional": true
193
+ },
189
194
  "expo-haptics": {
190
195
  "optional": true
191
196
  },
@@ -0,0 +1,65 @@
1
+ /**
2
+ * How tall the composer's field is allowed to be.
3
+ *
4
+ * Separated from the component because it is the one piece of AI Input with a
5
+ * right answer that can be checked without a device: a composer that opens at
6
+ * the wrong height, or grows past where it was told to stop, is a bug nobody
7
+ * notices until the send button is off the bottom of the screen.
8
+ *
9
+ * ## Bounds, not a measured height
10
+ *
11
+ * The obvious way to grow a field is to measure its content and set a height
12
+ * from it. That is a loop with a different answer on each platform — the
13
+ * measurement reports the text's height on one and the clipped height of the
14
+ * box we just set on another, where the field can then never grow at all.
15
+ *
16
+ * So nothing is measured. The field is given a floor and a ceiling and left to
17
+ * size itself between them, which is the layout engine's job and which it does
18
+ * without telling anybody. Past the ceiling a multiline field scrolls its own
19
+ * content, and that is the whole mechanism.
20
+ */
21
+
22
+ /** Type size and the leading it is given, per `size`. */
23
+ export const AI_INPUT_METRICS = {
24
+ sm: { fontSize: 15, lineHeight: 20, padding: 10 },
25
+ md: { fontSize: 16, lineHeight: 22, padding: 12 },
26
+ lg: { fontSize: 17, lineHeight: 24, padding: 14 },
27
+ } as const;
28
+
29
+ export type AIInputSize = keyof typeof AI_INPUT_METRICS;
30
+
31
+ export interface GrowthMetrics {
32
+ lineHeight: number;
33
+ padding: number;
34
+ }
35
+
36
+ /** The box a whole number of lines asks for: the lines, plus both paddings. */
37
+ export function heightForLines(metrics: GrowthMetrics, lines: number): number {
38
+ return lines * metrics.lineHeight + metrics.padding * 2;
39
+ }
40
+
41
+ export interface GrowthBounds {
42
+ minHeight: number;
43
+ maxHeight: number;
44
+ }
45
+
46
+ /**
47
+ * The floor and ceiling a field grows between.
48
+ *
49
+ * At least one line, so an empty composer is the size of an empty composer.
50
+ * Never below the floor, so a `maxRows` under `minRows` — a caller
51
+ * contradicting itself — resolves to the height that was asked for outright
52
+ * rather than to one shorter than the field was told to open at.
53
+ */
54
+ export function growthBounds(
55
+ metrics: GrowthMetrics,
56
+ minRows: number,
57
+ maxRows: number
58
+ ): GrowthBounds {
59
+ const floor = Math.max(1, Math.floor(minRows) || 1);
60
+ const ceiling = Math.max(floor, Math.floor(maxRows) || floor);
61
+ return {
62
+ minHeight: heightForLines(metrics, floor),
63
+ maxHeight: heightForLines(metrics, ceiling),
64
+ };
65
+ }