@brett_lamy/ui 4.0.0 → 5.0.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 (234) hide show
  1. package/README.md +1 -1
  2. package/dist/components/animated-height.d.ts +3 -1
  3. package/dist/components/animated-height.d.ts.map +1 -1
  4. package/dist/components/animated-height.js +11 -11
  5. package/dist/components/artifact-chat-container.d.ts.map +1 -1
  6. package/dist/components/artifact-chat-container.js +81 -82
  7. package/dist/components/button.d.ts +4 -3
  8. package/dist/components/button.d.ts.map +1 -1
  9. package/dist/components/button.js +22 -9
  10. package/dist/components/canvas.d.ts +91 -0
  11. package/dist/components/canvas.d.ts.map +1 -0
  12. package/dist/components/canvas.js +296 -0
  13. package/dist/components/composer/composer-cards.d.ts +55 -0
  14. package/dist/components/composer/composer-cards.d.ts.map +1 -0
  15. package/dist/components/composer/composer-cards.js +351 -0
  16. package/dist/components/composer/composer.d.ts +9 -1
  17. package/dist/components/composer/composer.d.ts.map +1 -1
  18. package/dist/components/composer/composer.js +179 -154
  19. package/dist/components/context-menu.d.ts +25 -0
  20. package/dist/components/context-menu.d.ts.map +1 -0
  21. package/dist/components/context-menu.js +127 -0
  22. package/dist/components/credenza.d.ts.map +1 -1
  23. package/dist/components/credenza.js +52 -92
  24. package/dist/components/cron-editor.d.ts +47 -0
  25. package/dist/components/cron-editor.d.ts.map +1 -0
  26. package/dist/components/cron-editor.js +297 -0
  27. package/dist/components/dropdown-menu.d.ts +3 -1
  28. package/dist/components/dropdown-menu.d.ts.map +1 -1
  29. package/dist/components/dropdown-menu.js +5 -5
  30. package/dist/components/edge-drawer.d.ts.map +1 -1
  31. package/dist/components/edge-drawer.js +1 -0
  32. package/dist/components/file-upload.d.ts +121 -0
  33. package/dist/components/file-upload.d.ts.map +1 -0
  34. package/dist/components/file-upload.js +405 -0
  35. package/dist/components/filter-input.d.ts +22 -0
  36. package/dist/components/filter-input.d.ts.map +1 -0
  37. package/dist/components/filter-input.js +126 -0
  38. package/dist/components/filter.d.ts +154 -0
  39. package/dist/components/filter.d.ts.map +1 -0
  40. package/dist/components/filter.js +815 -0
  41. package/dist/components/floating-chat.d.ts.map +1 -1
  42. package/dist/components/floating-chat.js +71 -88
  43. package/dist/components/floating-sheet.d.ts.map +1 -1
  44. package/dist/components/floating-sheet.js +93 -104
  45. package/dist/components/markdown-editor.d.ts +2 -0
  46. package/dist/components/markdown-editor.d.ts.map +1 -1
  47. package/dist/components/markdown-editor.js +46 -45
  48. package/dist/components/markdown-view.d.ts +6 -1
  49. package/dist/components/markdown-view.d.ts.map +1 -1
  50. package/dist/components/markdown-view.js +13 -11
  51. package/dist/components/navigation-stack.d.ts +3 -5
  52. package/dist/components/navigation-stack.d.ts.map +1 -1
  53. package/dist/components/navigation-stack.js +212 -382
  54. package/dist/components/passkey-enroll-dialog.d.ts +36 -0
  55. package/dist/components/passkey-enroll-dialog.d.ts.map +1 -0
  56. package/dist/components/passkey-enroll-dialog.js +234 -0
  57. package/dist/components/result-table.d.ts +38 -0
  58. package/dist/components/result-table.d.ts.map +1 -0
  59. package/dist/components/result-table.js +161 -0
  60. package/dist/components/schema-tree.d.ts +19 -0
  61. package/dist/components/schema-tree.d.ts.map +1 -0
  62. package/dist/components/schema-tree.js +172 -0
  63. package/dist/components/side-drawer.d.ts.map +1 -1
  64. package/dist/components/side-drawer.js +117 -143
  65. package/dist/components/slider.d.ts.map +1 -1
  66. package/dist/components/slider.js +4 -1
  67. package/dist/components/spinner-shapes.d.ts +263 -0
  68. package/dist/components/spinner-shapes.d.ts.map +1 -0
  69. package/dist/components/spinner-shapes.js +771 -0
  70. package/dist/components/spinner.d.ts +133 -3
  71. package/dist/components/spinner.d.ts.map +1 -1
  72. package/dist/components/spinner.js +445 -29
  73. package/dist/components/sql-console.d.ts +28 -0
  74. package/dist/components/sql-console.d.ts.map +1 -0
  75. package/dist/components/sql-console.js +348 -0
  76. package/dist/components/sql-editor.d.ts +47 -0
  77. package/dist/components/sql-editor.d.ts.map +1 -0
  78. package/dist/components/sql-editor.js +170 -0
  79. package/dist/components/tab-view.d.ts +2 -2
  80. package/dist/components/tab-view.d.ts.map +1 -1
  81. package/dist/components/tab-view.js +63 -49
  82. package/dist/components/tailscale-login-button.d.ts +53 -0
  83. package/dist/components/tailscale-login-button.d.ts.map +1 -0
  84. package/dist/components/tailscale-login-button.js +197 -0
  85. package/dist/components/time-input.d.ts +46 -0
  86. package/dist/components/time-input.d.ts.map +1 -0
  87. package/dist/components/time-input.js +258 -0
  88. package/dist/components/toast.d.ts +5 -2
  89. package/dist/components/toast.d.ts.map +1 -1
  90. package/dist/components/toast.js +249 -125
  91. package/dist/components/vault-gate.d.ts +60 -0
  92. package/dist/components/vault-gate.d.ts.map +1 -0
  93. package/dist/components/vault-gate.js +382 -0
  94. package/dist/index.css +1 -1
  95. package/dist/index.d.ts +85 -3
  96. package/dist/index.d.ts.map +1 -1
  97. package/dist/index.js +129 -83
  98. package/dist/lib/back-history.d.ts +5 -0
  99. package/dist/lib/back-history.d.ts.map +1 -0
  100. package/dist/lib/back-history.js +44 -0
  101. package/dist/lib/canvas-math.d.ts +82 -0
  102. package/dist/lib/canvas-math.d.ts.map +1 -0
  103. package/dist/lib/canvas-math.js +226 -0
  104. package/dist/lib/controllable-state.d.ts +4 -0
  105. package/dist/lib/controllable-state.d.ts.map +1 -0
  106. package/dist/lib/controllable-state.js +11 -0
  107. package/dist/lib/cron.d.ts +55 -0
  108. package/dist/lib/cron.d.ts.map +1 -0
  109. package/dist/lib/cron.js +269 -0
  110. package/dist/lib/edge-swipe.d.ts +36 -0
  111. package/dist/lib/edge-swipe.d.ts.map +1 -0
  112. package/dist/lib/edge-swipe.js +73 -0
  113. package/dist/lib/file-upload.d.ts +187 -0
  114. package/dist/lib/file-upload.d.ts.map +1 -0
  115. package/dist/lib/file-upload.js +349 -0
  116. package/dist/lib/filter-query.d.ts +90 -0
  117. package/dist/lib/filter-query.d.ts.map +1 -0
  118. package/dist/lib/filter-query.js +459 -0
  119. package/dist/lib/filter.d.ts +120 -0
  120. package/dist/lib/filter.d.ts.map +1 -0
  121. package/dist/lib/filter.js +399 -0
  122. package/dist/lib/format-bytes.d.ts +3 -0
  123. package/dist/lib/format-bytes.d.ts.map +1 -0
  124. package/dist/lib/format-bytes.js +16 -0
  125. package/dist/lib/gpu-cron.d.ts +51 -0
  126. package/dist/lib/gpu-cron.d.ts.map +1 -0
  127. package/dist/lib/gpu-cron.js +81 -0
  128. package/dist/lib/gpu-query/featurize.d.ts +19 -0
  129. package/dist/lib/gpu-query/featurize.d.ts.map +1 -0
  130. package/dist/lib/gpu-query/featurize.js +88 -0
  131. package/dist/lib/gpu-query/index.d.ts +73 -0
  132. package/dist/lib/gpu-query/index.d.ts.map +1 -0
  133. package/dist/lib/gpu-query/index.js +117 -0
  134. package/dist/lib/gpu-query/kernel.wgsl.d.ts +30 -0
  135. package/dist/lib/gpu-query/kernel.wgsl.d.ts.map +1 -0
  136. package/dist/lib/gpu-query/model.d.ts +8 -0
  137. package/dist/lib/gpu-query/model.d.ts.map +1 -0
  138. package/dist/lib/gpu-query/model.js +91 -0
  139. package/dist/lib/gpu-query/schema.d.ts +40 -0
  140. package/dist/lib/gpu-query/schema.d.ts.map +1 -0
  141. package/dist/lib/gpu-query/schema.js +0 -0
  142. package/dist/lib/gpu-query/webgpu.d.ts +12 -0
  143. package/dist/lib/gpu-query/webgpu.d.ts.map +1 -0
  144. package/dist/lib/gpu-query/weights.d.ts +17 -0
  145. package/dist/lib/gpu-query/weights.d.ts.map +1 -0
  146. package/dist/lib/gpu-query/weights.js +40 -0
  147. package/dist/lib/gpu-query/weights.json.d.ts +3 -0
  148. package/dist/lib/gpu-query/weights2.js +25 -0
  149. package/dist/lib/gpu-time.d.ts +77 -0
  150. package/dist/lib/gpu-time.d.ts.map +1 -0
  151. package/dist/lib/gpu-time.js +260 -0
  152. package/dist/lib/morph-path.d.ts +22 -0
  153. package/dist/lib/morph-path.d.ts.map +1 -0
  154. package/dist/lib/morph-path.js +42 -0
  155. package/dist/lib/passkey.d.ts +120 -0
  156. package/dist/lib/passkey.d.ts.map +1 -0
  157. package/dist/lib/passkey.js +186 -0
  158. package/dist/lib/persistent-state.d.ts +9 -0
  159. package/dist/lib/persistent-state.d.ts.map +1 -0
  160. package/dist/lib/persistent-state.js +37 -0
  161. package/dist/lib/pglite-core.d.ts +219 -0
  162. package/dist/lib/pglite-core.d.ts.map +1 -0
  163. package/dist/lib/pglite-core.js +273 -0
  164. package/dist/lib/pglite-files.d.ts +7 -0
  165. package/dist/lib/pglite-files.d.ts.map +1 -0
  166. package/dist/lib/pglite-files.js +17 -0
  167. package/dist/lib/pglite-schema.d.ts +58 -0
  168. package/dist/lib/pglite-schema.d.ts.map +1 -0
  169. package/dist/lib/pglite-schema.js +105 -0
  170. package/dist/lib/pglite-storage.d.ts +33 -0
  171. package/dist/lib/pglite-storage.d.ts.map +1 -0
  172. package/dist/lib/pglite-storage.js +55 -0
  173. package/dist/lib/pglite-transfer.d.ts +53 -0
  174. package/dist/lib/pglite-transfer.d.ts.map +1 -0
  175. package/dist/lib/pglite-transfer.js +126 -0
  176. package/dist/lib/pglite.d.ts +106 -0
  177. package/dist/lib/pglite.d.ts.map +1 -0
  178. package/dist/lib/pglite.js +298 -0
  179. package/dist/lib/pull-to-refresh.d.ts +24 -0
  180. package/dist/lib/pull-to-refresh.d.ts.map +1 -0
  181. package/dist/lib/pull-to-refresh.js +74 -0
  182. package/dist/lib/scroll-hidden.d.ts +6 -0
  183. package/dist/lib/scroll-hidden.d.ts.map +1 -0
  184. package/dist/lib/scroll-hidden.js +21 -0
  185. package/dist/lib/sql-format.d.ts +62 -0
  186. package/dist/lib/sql-format.d.ts.map +1 -0
  187. package/dist/lib/sql-format.js +175 -0
  188. package/dist/lib/sql-lex.d.ts +25 -0
  189. package/dist/lib/sql-lex.d.ts.map +1 -0
  190. package/dist/lib/sql-lex.js +135 -0
  191. package/dist/lib/tab-lock.d.ts +28 -0
  192. package/dist/lib/tab-lock.d.ts.map +1 -0
  193. package/dist/lib/tab-lock.js +80 -0
  194. package/dist/lib/tailscale-connect.d.ts +56 -0
  195. package/dist/lib/tailscale-connect.d.ts.map +1 -0
  196. package/dist/lib/tailscale-connect.js +99 -0
  197. package/dist/lib/tailscale-fake.d.ts +33 -0
  198. package/dist/lib/tailscale-fake.d.ts.map +1 -0
  199. package/dist/lib/tailscale-fake.js +80 -0
  200. package/dist/lib/tailscale-policy.d.ts +71 -0
  201. package/dist/lib/tailscale-policy.d.ts.map +1 -0
  202. package/dist/lib/tailscale-policy.js +244 -0
  203. package/dist/lib/tailscale-react.d.ts +20 -0
  204. package/dist/lib/tailscale-react.d.ts.map +1 -0
  205. package/dist/lib/tailscale-react.js +37 -0
  206. package/dist/lib/tailscale-router/bridge.d.ts +60 -0
  207. package/dist/lib/tailscale-router/bridge.d.ts.map +1 -0
  208. package/dist/lib/tailscale-router/bridge.js +198 -0
  209. package/dist/lib/tailscale-router/react.d.ts +19 -0
  210. package/dist/lib/tailscale-router/react.d.ts.map +1 -0
  211. package/dist/lib/tailscale-router/react.js +52 -0
  212. package/dist/lib/tailscale.d.ts +204 -0
  213. package/dist/lib/tailscale.d.ts.map +1 -0
  214. package/dist/lib/tailscale.js +443 -0
  215. package/dist/lib/title-flight.d.ts +34 -0
  216. package/dist/lib/title-flight.d.ts.map +1 -0
  217. package/dist/lib/title-flight.js +123 -0
  218. package/dist/lib/vault-react.d.ts +49 -0
  219. package/dist/lib/vault-react.d.ts.map +1 -0
  220. package/dist/lib/vault-react.js +196 -0
  221. package/dist/lib/vault-storage.d.ts +30 -0
  222. package/dist/lib/vault-storage.d.ts.map +1 -0
  223. package/dist/lib/vault-storage.js +105 -0
  224. package/dist/lib/vault.d.ts +200 -0
  225. package/dist/lib/vault.d.ts.map +1 -0
  226. package/dist/lib/vault.js +641 -0
  227. package/dist/tailscale-sw.js +332 -0
  228. package/package.json +35 -5
  229. package/dist/components/icon-button.d.ts +0 -19
  230. package/dist/components/icon-button.d.ts.map +0 -1
  231. package/dist/components/icon-button.js +0 -31
  232. package/dist/components/measure-h.d.ts +0 -7
  233. package/dist/components/measure-h.d.ts.map +0 -1
  234. package/dist/components/measure-h.js +0 -20
@@ -1,11 +1,141 @@
1
1
  import { CSSProperties } from 'react';
2
+ import { ShapeAnimation, ShapeVariant } from './spinner-shapes';
3
+ /** Each animation's variants: how long one cycle takes (ms) and when each part starts within it (ms). */
4
+ declare const PATTERNS: {
5
+ orbit: {
6
+ chase: {
7
+ duration: number;
8
+ delays: number[];
9
+ };
10
+ oppose: {
11
+ duration: number;
12
+ delays: number[];
13
+ };
14
+ breathe: {
15
+ duration: number;
16
+ delays: number[];
17
+ };
18
+ };
19
+ beacon: {
20
+ rise: {
21
+ duration: number;
22
+ delays: number[];
23
+ };
24
+ fall: {
25
+ duration: number;
26
+ delays: number[];
27
+ };
28
+ balance: {
29
+ duration: number;
30
+ delays: number[];
31
+ };
32
+ };
33
+ matrix: {
34
+ diagonal: {
35
+ duration: number;
36
+ delays: number[];
37
+ };
38
+ ripple: {
39
+ duration: number;
40
+ delays: number[];
41
+ };
42
+ scan: {
43
+ duration: number;
44
+ delays: number[];
45
+ };
46
+ };
47
+ cells: {
48
+ merge: {
49
+ duration: number;
50
+ delays: number[];
51
+ };
52
+ spread: {
53
+ duration: number;
54
+ delays: number[];
55
+ };
56
+ checker: {
57
+ duration: number;
58
+ delays: number[];
59
+ };
60
+ };
61
+ register: {
62
+ shift: {
63
+ duration: number;
64
+ delays: number[];
65
+ };
66
+ invert: {
67
+ duration: number;
68
+ delays: number[];
69
+ };
70
+ pair: {
71
+ duration: number;
72
+ delays: number[];
73
+ };
74
+ };
75
+ bands: {
76
+ descend: {
77
+ duration: number;
78
+ delays: number[];
79
+ };
80
+ ascend: {
81
+ duration: number;
82
+ delays: number[];
83
+ };
84
+ split: {
85
+ duration: number;
86
+ delays: number[];
87
+ };
88
+ };
89
+ lift: {
90
+ rise: {
91
+ duration: number;
92
+ delays: number[];
93
+ };
94
+ fall: {
95
+ duration: number;
96
+ delays: number[];
97
+ };
98
+ breathe: {
99
+ duration: number;
100
+ delays: number[];
101
+ };
102
+ };
103
+ };
104
+ type PortedAnimation = keyof typeof PATTERNS;
105
+ export type SpinnerAnimation = 'ios' | PortedAnimation | ShapeAnimation;
106
+ /** Every variant name. A variant that the chosen animation does not have falls back to its first. */
107
+ export type SpinnerVariant = {
108
+ [A in PortedAnimation]: keyof (typeof PATTERNS)[A];
109
+ }[PortedAnimation] | ShapeVariant;
110
+ export interface SpinnerAnimationInfo {
111
+ id: SpinnerAnimation;
112
+ label: string;
113
+ /** The animation's variants, the first being the default (empty for `ios`). */
114
+ variants: readonly string[];
115
+ }
116
+ /** The animations to choose from, with their labels and variants — for a picker or a gallery. */
117
+ export declare const spinnerAnimations: readonly SpinnerAnimationInfo[];
2
118
  export interface SpinnerProps {
119
+ /** Which loader (default `ios`). */
120
+ animation?: SpinnerAnimation;
121
+ /** The variant of the chosen animation (see `spinnerAnimations`); the first when omitted or unknown. */
122
+ variant?: SpinnerVariant;
123
+ /** `ios` only: turn the spokes. The other loaders always animate unless `paused`. */
3
124
  spin?: boolean;
125
+ /** Width and height in px: 22 for `ios`, 32 for the others (12–160). */
4
126
  size?: number;
127
+ /** Playback speed of the other loaders, 0.25–3 (default 1). */
128
+ speed?: number;
129
+ /** Hold the other loaders still. */
130
+ paused?: boolean;
131
+ /** An accessible name. Without one the spinner is decorative (`aria-hidden`); with one it is a `role="status"`. */
132
+ label?: string;
5
133
  className?: string;
6
134
  style?: CSSProperties;
7
135
  }
8
- /** iOS activity indicator: eight fading spokes, stepped rotation. It grows in when it mounts (a spinner
9
- appearing is an event; popping in unannounced reads as a glitch). */
10
- export declare function Spinner({ spin, size, className, style }: SpinnerProps): import("react/jsx-runtime").JSX.Element;
136
+ /** A loading indicator. The default is the iOS activity indicator (eight fading spokes, stepped rotation); it grows in
137
+ when it mounts (a spinner appearing is an event; popping in unannounced reads as a glitch). `animation` picks one of
138
+ one of the twenty loaders instead. */
139
+ export declare function Spinner({ animation, variant, spin, size, speed, paused, label, className, style }: SpinnerProps): import("react/jsx-runtime").JSX.Element;
140
+ export {};
11
141
  //# sourceMappingURL=spinner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../src/components/spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAG3C,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED;wEACwE;AACxE,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,IAAS,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,YAAY,2CAS1E"}
1
+ {"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../src/components/spinner.tsx"],"names":[],"mappings":"AACA,OAAO,EAA+B,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAExE,OAAO,EAAkC,KAAK,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AA4B1G,yGAAyG;AACzG,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCqC,CAAC;AAEpD,KAAK,eAAe,GAAG,MAAM,OAAO,QAAQ,CAAC;AAC7C,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,eAAe,GAAG,cAAc,CAAC;AACxE,qGAAqG;AACrG,MAAM,MAAM,cAAc,GAAG;KAAG,CAAC,IAAI,eAAe,GAAG,MAAM,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC,eAAe,CAAC,GAAG,YAAY,CAAC;AAEpH,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,gBAAgB,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7B;AAED,iGAAiG;AACjG,eAAO,MAAM,iBAAiB,EAAE,SAAS,oBAAoB,EAU5D,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,oCAAoC;IACpC,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,wGAAwG;IACxG,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,qFAAqF;IACrF,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,wEAAwE;IACxE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mHAAmH;IACnH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAuFD;;yCAEyC;AACzC,wBAAgB,OAAO,CAAC,EAAE,SAAiB,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAS,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,YAAY,2CAsC3H"}
@@ -1,35 +1,451 @@
1
+ "use client";
1
2
  import { cn as e } from "../lib/utils.js";
2
- import { jsx as t } from "react/jsx-runtime";
3
+ import { SHAPES as t, SHAPE_IDS as n, ShapeLoader as r } from "./spinner-shapes.js";
4
+ import { useEffect as i, useRef as a, useState as o } from "react";
5
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
3
6
  //#region src/components/spinner.tsx
4
- function n({ spin: n, size: r = 22, className: i, style: a }) {
5
- return /* @__PURE__ */ t("svg", {
7
+ var l = {
8
+ orbit: {
9
+ chase: {
10
+ duration: 960,
11
+ delays: [
12
+ 0,
13
+ 120,
14
+ 240,
15
+ 360,
16
+ 480,
17
+ 600,
18
+ 720,
19
+ 840
20
+ ]
21
+ },
22
+ oppose: {
23
+ duration: 1100,
24
+ delays: [
25
+ 0,
26
+ 120,
27
+ 240,
28
+ 360,
29
+ 0,
30
+ 120,
31
+ 240,
32
+ 360
33
+ ]
34
+ },
35
+ breathe: {
36
+ duration: 1500,
37
+ delays: [
38
+ 0,
39
+ 0,
40
+ 0,
41
+ 0,
42
+ 0,
43
+ 0,
44
+ 0,
45
+ 0
46
+ ]
47
+ }
48
+ },
49
+ beacon: {
50
+ rise: {
51
+ duration: 980,
52
+ delays: [
53
+ 0,
54
+ 90,
55
+ 180,
56
+ 270,
57
+ 360
58
+ ]
59
+ },
60
+ fall: {
61
+ duration: 980,
62
+ delays: [
63
+ 360,
64
+ 270,
65
+ 180,
66
+ 90,
67
+ 0
68
+ ]
69
+ },
70
+ balance: {
71
+ duration: 1180,
72
+ delays: [
73
+ 0,
74
+ 180,
75
+ 360,
76
+ 180,
77
+ 0
78
+ ]
79
+ }
80
+ },
81
+ matrix: {
82
+ diagonal: {
83
+ duration: 1040,
84
+ delays: [
85
+ 0,
86
+ 90,
87
+ 180,
88
+ 90,
89
+ 180,
90
+ 270,
91
+ 180,
92
+ 270,
93
+ 360
94
+ ]
95
+ },
96
+ ripple: {
97
+ duration: 1160,
98
+ delays: [
99
+ 240,
100
+ 120,
101
+ 240,
102
+ 120,
103
+ 0,
104
+ 120,
105
+ 240,
106
+ 120,
107
+ 240
108
+ ]
109
+ },
110
+ scan: {
111
+ duration: 980,
112
+ delays: [
113
+ 0,
114
+ 0,
115
+ 0,
116
+ 180,
117
+ 180,
118
+ 180,
119
+ 360,
120
+ 360,
121
+ 360
122
+ ]
123
+ }
124
+ },
125
+ cells: {
126
+ merge: {
127
+ duration: 1120,
128
+ delays: [
129
+ 0,
130
+ 100,
131
+ 200,
132
+ 300
133
+ ]
134
+ },
135
+ spread: {
136
+ duration: 1120,
137
+ delays: [
138
+ 300,
139
+ 200,
140
+ 100,
141
+ 0
142
+ ]
143
+ },
144
+ checker: {
145
+ duration: 1260,
146
+ delays: [
147
+ 0,
148
+ 280,
149
+ 280,
150
+ 0
151
+ ]
152
+ }
153
+ },
154
+ register: {
155
+ shift: {
156
+ duration: 1040,
157
+ delays: [
158
+ 0,
159
+ 90,
160
+ 180,
161
+ 270,
162
+ 360,
163
+ 450
164
+ ]
165
+ },
166
+ invert: {
167
+ duration: 1220,
168
+ delays: [
169
+ 0,
170
+ 0,
171
+ 0,
172
+ 260,
173
+ 260,
174
+ 260
175
+ ]
176
+ },
177
+ pair: {
178
+ duration: 1320,
179
+ delays: [
180
+ 0,
181
+ 0,
182
+ 220,
183
+ 220,
184
+ 440,
185
+ 440
186
+ ]
187
+ }
188
+ },
189
+ bands: {
190
+ descend: {
191
+ duration: 1060,
192
+ delays: [
193
+ 0,
194
+ 180,
195
+ 360
196
+ ]
197
+ },
198
+ ascend: {
199
+ duration: 1060,
200
+ delays: [
201
+ 360,
202
+ 180,
203
+ 0
204
+ ]
205
+ },
206
+ split: {
207
+ duration: 1260,
208
+ delays: [
209
+ 0,
210
+ 280,
211
+ 0
212
+ ]
213
+ }
214
+ },
215
+ lift: {
216
+ rise: {
217
+ duration: 1240,
218
+ delays: [
219
+ 0,
220
+ 120,
221
+ 240,
222
+ 360
223
+ ]
224
+ },
225
+ fall: {
226
+ duration: 1240,
227
+ delays: [
228
+ 360,
229
+ 240,
230
+ 120,
231
+ 0
232
+ ]
233
+ },
234
+ breathe: {
235
+ duration: 1560,
236
+ delays: [
237
+ 0,
238
+ 100,
239
+ 200,
240
+ 300
241
+ ]
242
+ }
243
+ }
244
+ }, u = [
245
+ {
246
+ id: "ios",
247
+ label: "iOS",
248
+ variants: []
249
+ },
250
+ {
251
+ id: "orbit",
252
+ label: "Orbit",
253
+ variants: Object.keys(l.orbit)
254
+ },
255
+ {
256
+ id: "beacon",
257
+ label: "Bars",
258
+ variants: Object.keys(l.beacon)
259
+ },
260
+ {
261
+ id: "matrix",
262
+ label: "Matrix",
263
+ variants: Object.keys(l.matrix)
264
+ },
265
+ {
266
+ id: "cells",
267
+ label: "Merge",
268
+ variants: Object.keys(l.cells)
269
+ },
270
+ {
271
+ id: "register",
272
+ label: "Encode",
273
+ variants: Object.keys(l.register)
274
+ },
275
+ {
276
+ id: "bands",
277
+ label: "Scan",
278
+ variants: Object.keys(l.bands)
279
+ },
280
+ {
281
+ id: "lift",
282
+ label: "Lift",
283
+ variants: Object.keys(l.lift)
284
+ },
285
+ ...n.map((e) => ({
286
+ id: e,
287
+ label: t[e].label,
288
+ variants: Object.keys(t[e].variants)
289
+ }))
290
+ ], d = (e) => e in t, f = (e, t, n, r) => Number.isFinite(e) ? Math.min(n, Math.max(t, e)) : r, p = (e, t) => ({
291
+ "--bl-ld-d": `${e.duration}ms`,
292
+ "--bl-ld-delay": `${e.delays[t]}ms`
293
+ });
294
+ function m({ animation: e, variant: t }) {
295
+ let n = l[e], r = n[t] ? t : Object.keys(n)[0], i = n[r];
296
+ switch (e) {
297
+ case "orbit": return /* @__PURE__ */ s("span", {
298
+ className: "bl-ld-orbit-indicator",
299
+ "data-variant": r,
300
+ children: i.delays.map((e, t) => /* @__PURE__ */ s("span", {
301
+ className: "bl-ld-orbit-node",
302
+ style: { "--bl-ld-angle": `${t * 45}deg` },
303
+ children: /* @__PURE__ */ s("span", {
304
+ className: "bl-ld-orbit-dot",
305
+ style: p(i, t)
306
+ })
307
+ }, t))
308
+ });
309
+ case "beacon": return /* @__PURE__ */ s("span", {
310
+ className: "bl-ld-beacon-indicator",
311
+ "data-variant": r,
312
+ children: i.delays.map((e, t) => /* @__PURE__ */ s("span", {
313
+ className: "bl-ld-beacon-indicator__bar",
314
+ style: {
315
+ ...p(i, t),
316
+ "--bl-ld-bar": `${7 + Math.abs(2 - t) * 2}px`
317
+ }
318
+ }, t))
319
+ });
320
+ case "matrix": return /* @__PURE__ */ s("span", {
321
+ className: "bl-ld-matrix-indicator",
322
+ "data-variant": r,
323
+ children: i.delays.map((e, t) => /* @__PURE__ */ s("span", {
324
+ className: "bl-ld-matrix-indicator__dot",
325
+ style: p(i, t)
326
+ }, t))
327
+ });
328
+ case "cells": return /* @__PURE__ */ s("span", {
329
+ className: "bl-ld-cell-indicator",
330
+ "data-variant": r,
331
+ children: i.delays.map((e, t) => /* @__PURE__ */ s("span", {
332
+ className: "bl-ld-cell-indicator__cell",
333
+ style: p(i, t)
334
+ }, t))
335
+ });
336
+ case "register": return /* @__PURE__ */ s("span", {
337
+ className: "bl-ld-register-indicator",
338
+ "data-variant": r,
339
+ children: i.delays.map((e, t) => /* @__PURE__ */ s("span", {
340
+ className: "bl-ld-register-indicator__bit",
341
+ "data-bit": t % 2 == 0 ? "one" : "zero",
342
+ style: p(i, t)
343
+ }, t))
344
+ });
345
+ case "bands": return /* @__PURE__ */ s("span", {
346
+ className: "bl-ld-band-indicator",
347
+ "data-variant": r,
348
+ children: i.delays.map((e, t) => /* @__PURE__ */ c("span", {
349
+ className: "bl-ld-band-indicator__row",
350
+ children: [/* @__PURE__ */ s("span", { className: "bl-ld-band-indicator__rail" }), /* @__PURE__ */ s("span", {
351
+ className: "bl-ld-band-indicator__segment",
352
+ style: p(i, t)
353
+ })]
354
+ }, t))
355
+ });
356
+ case "lift": return /* @__PURE__ */ s("span", {
357
+ className: "bl-ld-lift-queue-indicator",
358
+ "data-variant": r,
359
+ children: i.delays.map((e, t) => /* @__PURE__ */ s("span", {
360
+ className: "bl-ld-lift-queue-indicator__level",
361
+ style: {
362
+ ...p(i, t),
363
+ "--bl-ld-level": t
364
+ }
365
+ }, t))
366
+ });
367
+ }
368
+ }
369
+ function h(e, t) {
370
+ let [n, r] = o(!0);
371
+ return i(() => {
372
+ if (!t) return;
373
+ let n = e.current, i = !0, a = () => r(i && !document.hidden);
374
+ document.addEventListener("visibilitychange", a);
375
+ let o = typeof IntersectionObserver > "u" || !n ? null : new IntersectionObserver(([e]) => {
376
+ i = e.isIntersecting, a();
377
+ });
378
+ return o && n && o.observe(n), a(), () => {
379
+ document.removeEventListener("visibilitychange", a), o?.disconnect();
380
+ };
381
+ }, [e, t]), n;
382
+ }
383
+ function g({ animation: t = "ios", variant: n, spin: i, size: o, speed: c = 1, paused: l, label: u, className: p, style: g }) {
384
+ let _ = a(null), v = t !== "ios", y = h(_, v);
385
+ if (!v) {
386
+ let t = o ?? 22;
387
+ return /* @__PURE__ */ s("svg", {
388
+ "data-slot": "spinner",
389
+ "data-animation": "ios",
390
+ className: e("block transition-[scale,opacity] duration-spring-snappy ease-spring-snappy starting:scale-50 starting:opacity-0 motion-reduce:transition-none", i && "animate-[blSpin_.75s_steps(8)_infinite]", p),
391
+ width: t,
392
+ height: t,
393
+ viewBox: "0 0 24 24",
394
+ style: g,
395
+ ...u ? {
396
+ role: "status",
397
+ "aria-label": u
398
+ } : { "aria-hidden": !0 },
399
+ children: [
400
+ 0,
401
+ 1,
402
+ 2,
403
+ 3,
404
+ 4,
405
+ 5,
406
+ 6,
407
+ 7
408
+ ].map((e) => /* @__PURE__ */ s("rect", {
409
+ x: "11.1",
410
+ y: "2.8",
411
+ width: "1.8",
412
+ height: "5.2",
413
+ rx: "0.9",
414
+ fill: "currentColor",
415
+ opacity: (e + 1) / 8,
416
+ transform: `rotate(${e * 45} 12 12)`
417
+ }, e))
418
+ });
419
+ }
420
+ let b = f(o ?? 32, 12, 160, 32);
421
+ return /* @__PURE__ */ s("span", {
422
+ ref: _,
6
423
  "data-slot": "spinner",
7
- className: e("block transition-[scale,opacity] duration-spring-snappy ease-spring-snappy starting:scale-50 starting:opacity-0 motion-reduce:transition-none", n && "animate-[blSpin_.75s_steps(8)_infinite]", i),
8
- width: r,
9
- height: r,
10
- viewBox: "0 0 24 24",
11
- style: a,
12
- "aria-hidden": "true",
13
- children: [
14
- 0,
15
- 1,
16
- 2,
17
- 3,
18
- 4,
19
- 5,
20
- 6,
21
- 7
22
- ].map((e) => /* @__PURE__ */ t("rect", {
23
- x: "11.1",
24
- y: "2.8",
25
- width: "1.8",
26
- height: "5.2",
27
- rx: "0.9",
28
- fill: "currentColor",
29
- opacity: (e + 1) / 8,
30
- transform: `rotate(${e * 45} 12 12)`
31
- }, e))
424
+ "data-animation": t,
425
+ "data-paused": l || !y || void 0,
426
+ className: e("bl-ld", p),
427
+ style: {
428
+ "--bl-ld-size": `${b}px`,
429
+ "--bl-ld-scale": b / 24,
430
+ "--bl-ld-speed": f(c, .25, 3, 1),
431
+ ...g
432
+ },
433
+ ...u ? {
434
+ role: "status",
435
+ "aria-label": u
436
+ } : { "aria-hidden": !0 },
437
+ children: /* @__PURE__ */ s("span", {
438
+ className: "bl-ld-stage",
439
+ "aria-hidden": "true",
440
+ children: d(t) ? /* @__PURE__ */ s(r, {
441
+ animation: t,
442
+ variant: n ?? ""
443
+ }) : /* @__PURE__ */ s(m, {
444
+ animation: t,
445
+ variant: n ?? ""
446
+ })
447
+ })
32
448
  });
33
449
  }
34
450
  //#endregion
35
- export { n as Spinner };
451
+ export { g as Spinner, u as spinnerAnimations };
@@ -0,0 +1,28 @@
1
+ import { ComponentProps, ReactNode } from 'react';
2
+ import { VariantProps } from 'class-variance-authority';
3
+ import { RunOutcome } from '../lib/pglite-core';
4
+ export declare const sqlConsoleVariants: (props?: ({
5
+ layout?: "split" | "stacked" | null | undefined;
6
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
+ export interface SqlConsoleProps extends Omit<ComponentProps<'div'>, 'children' | 'onError'>, VariantProps<typeof sqlConsoleVariants> {
8
+ /** The editor's initial text. */
9
+ defaultValue?: string;
10
+ /** Keep the history in localStorage under this key. */
11
+ historyKey?: string;
12
+ /** Show the schema / history column (default true). */
13
+ sidebar?: boolean;
14
+ /** Show export / import in the header (default true). */
15
+ transfer?: boolean;
16
+ /** Called after each run (also failed ones). */
17
+ onRun?: (sql: string, outcome: RunOutcome) => void;
18
+ /** Extra header content (a database picker, a delete button). */
19
+ headerActions?: ReactNode;
20
+ /** The result tables' height cap (CSS length, default `18rem`). */
21
+ resultMaxHeight?: string;
22
+ /** Run `defaultValue` once the database is ready (default false). */
23
+ autoRun?: boolean;
24
+ /** Show how long statements took (default true). Turn it off where the screen must be reproducible. */
25
+ timing?: boolean;
26
+ }
27
+ export declare function SqlConsole({ defaultValue, historyKey, sidebar, transfer, onRun, headerActions, resultMaxHeight, autoRun, timing, layout, className, ...props }: SqlConsoleProps): import("react/jsx-runtime").JSX.Element;
28
+ //# sourceMappingURL=sql-console.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sql-console.d.ts","sourceRoot":"","sources":["../../src/components/sql-console.tsx"],"names":[],"mappings":"AACA,OAAO,EAA4C,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACtG,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAQlE,OAAO,EAAwD,KAAK,UAAU,EAAiB,MAAM,mBAAmB,CAAC;AAiBzH,eAAO,MAAM,kBAAkB;;8EAU7B,CAAC;AAEH,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC,EAAE,YAAY,CAAC,OAAO,kBAAkB,CAAC;IACnI,iCAAiC;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uDAAuD;IACvD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gDAAgD;IAChD,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,KAAK,IAAI,CAAC;IACnD,iEAAiE;IACjE,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,mEAAmE;IACnE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qEAAqE;IACrE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uGAAuG;IACvG,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAoCD,wBAAgB,UAAU,CAAC,EACzB,YAAiB,EAAE,UAAU,EAAE,OAAc,EAAE,QAAe,EAAE,KAAK,EAAE,aAAa,EAAE,eAAyB,EAAE,OAAe,EAAE,MAAa,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,EAC7K,EAAE,eAAe,2CA8MjB"}