@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.
- package/README.md +1 -1
- package/dist/components/animated-height.d.ts +3 -1
- package/dist/components/animated-height.d.ts.map +1 -1
- package/dist/components/animated-height.js +11 -11
- package/dist/components/artifact-chat-container.d.ts.map +1 -1
- package/dist/components/artifact-chat-container.js +81 -82
- package/dist/components/button.d.ts +4 -3
- package/dist/components/button.d.ts.map +1 -1
- package/dist/components/button.js +22 -9
- package/dist/components/canvas.d.ts +91 -0
- package/dist/components/canvas.d.ts.map +1 -0
- package/dist/components/canvas.js +296 -0
- package/dist/components/composer/composer-cards.d.ts +55 -0
- package/dist/components/composer/composer-cards.d.ts.map +1 -0
- package/dist/components/composer/composer-cards.js +351 -0
- package/dist/components/composer/composer.d.ts +9 -1
- package/dist/components/composer/composer.d.ts.map +1 -1
- package/dist/components/composer/composer.js +179 -154
- package/dist/components/context-menu.d.ts +25 -0
- package/dist/components/context-menu.d.ts.map +1 -0
- package/dist/components/context-menu.js +127 -0
- package/dist/components/credenza.d.ts.map +1 -1
- package/dist/components/credenza.js +52 -92
- package/dist/components/cron-editor.d.ts +47 -0
- package/dist/components/cron-editor.d.ts.map +1 -0
- package/dist/components/cron-editor.js +297 -0
- package/dist/components/dropdown-menu.d.ts +3 -1
- package/dist/components/dropdown-menu.d.ts.map +1 -1
- package/dist/components/dropdown-menu.js +5 -5
- package/dist/components/edge-drawer.d.ts.map +1 -1
- package/dist/components/edge-drawer.js +1 -0
- package/dist/components/file-upload.d.ts +121 -0
- package/dist/components/file-upload.d.ts.map +1 -0
- package/dist/components/file-upload.js +405 -0
- package/dist/components/filter-input.d.ts +22 -0
- package/dist/components/filter-input.d.ts.map +1 -0
- package/dist/components/filter-input.js +126 -0
- package/dist/components/filter.d.ts +154 -0
- package/dist/components/filter.d.ts.map +1 -0
- package/dist/components/filter.js +815 -0
- package/dist/components/floating-chat.d.ts.map +1 -1
- package/dist/components/floating-chat.js +71 -88
- package/dist/components/floating-sheet.d.ts.map +1 -1
- package/dist/components/floating-sheet.js +93 -104
- package/dist/components/markdown-editor.d.ts +2 -0
- package/dist/components/markdown-editor.d.ts.map +1 -1
- package/dist/components/markdown-editor.js +46 -45
- package/dist/components/markdown-view.d.ts +6 -1
- package/dist/components/markdown-view.d.ts.map +1 -1
- package/dist/components/markdown-view.js +13 -11
- package/dist/components/navigation-stack.d.ts +3 -5
- package/dist/components/navigation-stack.d.ts.map +1 -1
- package/dist/components/navigation-stack.js +212 -382
- package/dist/components/passkey-enroll-dialog.d.ts +36 -0
- package/dist/components/passkey-enroll-dialog.d.ts.map +1 -0
- package/dist/components/passkey-enroll-dialog.js +234 -0
- package/dist/components/result-table.d.ts +38 -0
- package/dist/components/result-table.d.ts.map +1 -0
- package/dist/components/result-table.js +161 -0
- package/dist/components/schema-tree.d.ts +19 -0
- package/dist/components/schema-tree.d.ts.map +1 -0
- package/dist/components/schema-tree.js +172 -0
- package/dist/components/side-drawer.d.ts.map +1 -1
- package/dist/components/side-drawer.js +117 -143
- package/dist/components/slider.d.ts.map +1 -1
- package/dist/components/slider.js +4 -1
- package/dist/components/spinner-shapes.d.ts +263 -0
- package/dist/components/spinner-shapes.d.ts.map +1 -0
- package/dist/components/spinner-shapes.js +771 -0
- package/dist/components/spinner.d.ts +133 -3
- package/dist/components/spinner.d.ts.map +1 -1
- package/dist/components/spinner.js +445 -29
- package/dist/components/sql-console.d.ts +28 -0
- package/dist/components/sql-console.d.ts.map +1 -0
- package/dist/components/sql-console.js +348 -0
- package/dist/components/sql-editor.d.ts +47 -0
- package/dist/components/sql-editor.d.ts.map +1 -0
- package/dist/components/sql-editor.js +170 -0
- package/dist/components/tab-view.d.ts +2 -2
- package/dist/components/tab-view.d.ts.map +1 -1
- package/dist/components/tab-view.js +63 -49
- package/dist/components/tailscale-login-button.d.ts +53 -0
- package/dist/components/tailscale-login-button.d.ts.map +1 -0
- package/dist/components/tailscale-login-button.js +197 -0
- package/dist/components/time-input.d.ts +46 -0
- package/dist/components/time-input.d.ts.map +1 -0
- package/dist/components/time-input.js +258 -0
- package/dist/components/toast.d.ts +5 -2
- package/dist/components/toast.d.ts.map +1 -1
- package/dist/components/toast.js +249 -125
- package/dist/components/vault-gate.d.ts +60 -0
- package/dist/components/vault-gate.d.ts.map +1 -0
- package/dist/components/vault-gate.js +382 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +85 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +129 -83
- package/dist/lib/back-history.d.ts +5 -0
- package/dist/lib/back-history.d.ts.map +1 -0
- package/dist/lib/back-history.js +44 -0
- package/dist/lib/canvas-math.d.ts +82 -0
- package/dist/lib/canvas-math.d.ts.map +1 -0
- package/dist/lib/canvas-math.js +226 -0
- package/dist/lib/controllable-state.d.ts +4 -0
- package/dist/lib/controllable-state.d.ts.map +1 -0
- package/dist/lib/controllable-state.js +11 -0
- package/dist/lib/cron.d.ts +55 -0
- package/dist/lib/cron.d.ts.map +1 -0
- package/dist/lib/cron.js +269 -0
- package/dist/lib/edge-swipe.d.ts +36 -0
- package/dist/lib/edge-swipe.d.ts.map +1 -0
- package/dist/lib/edge-swipe.js +73 -0
- package/dist/lib/file-upload.d.ts +187 -0
- package/dist/lib/file-upload.d.ts.map +1 -0
- package/dist/lib/file-upload.js +349 -0
- package/dist/lib/filter-query.d.ts +90 -0
- package/dist/lib/filter-query.d.ts.map +1 -0
- package/dist/lib/filter-query.js +459 -0
- package/dist/lib/filter.d.ts +120 -0
- package/dist/lib/filter.d.ts.map +1 -0
- package/dist/lib/filter.js +399 -0
- package/dist/lib/format-bytes.d.ts +3 -0
- package/dist/lib/format-bytes.d.ts.map +1 -0
- package/dist/lib/format-bytes.js +16 -0
- package/dist/lib/gpu-cron.d.ts +51 -0
- package/dist/lib/gpu-cron.d.ts.map +1 -0
- package/dist/lib/gpu-cron.js +81 -0
- package/dist/lib/gpu-query/featurize.d.ts +19 -0
- package/dist/lib/gpu-query/featurize.d.ts.map +1 -0
- package/dist/lib/gpu-query/featurize.js +88 -0
- package/dist/lib/gpu-query/index.d.ts +73 -0
- package/dist/lib/gpu-query/index.d.ts.map +1 -0
- package/dist/lib/gpu-query/index.js +117 -0
- package/dist/lib/gpu-query/kernel.wgsl.d.ts +30 -0
- package/dist/lib/gpu-query/kernel.wgsl.d.ts.map +1 -0
- package/dist/lib/gpu-query/model.d.ts +8 -0
- package/dist/lib/gpu-query/model.d.ts.map +1 -0
- package/dist/lib/gpu-query/model.js +91 -0
- package/dist/lib/gpu-query/schema.d.ts +40 -0
- package/dist/lib/gpu-query/schema.d.ts.map +1 -0
- package/dist/lib/gpu-query/schema.js +0 -0
- package/dist/lib/gpu-query/webgpu.d.ts +12 -0
- package/dist/lib/gpu-query/webgpu.d.ts.map +1 -0
- package/dist/lib/gpu-query/weights.d.ts +17 -0
- package/dist/lib/gpu-query/weights.d.ts.map +1 -0
- package/dist/lib/gpu-query/weights.js +40 -0
- package/dist/lib/gpu-query/weights.json.d.ts +3 -0
- package/dist/lib/gpu-query/weights2.js +25 -0
- package/dist/lib/gpu-time.d.ts +77 -0
- package/dist/lib/gpu-time.d.ts.map +1 -0
- package/dist/lib/gpu-time.js +260 -0
- package/dist/lib/morph-path.d.ts +22 -0
- package/dist/lib/morph-path.d.ts.map +1 -0
- package/dist/lib/morph-path.js +42 -0
- package/dist/lib/passkey.d.ts +120 -0
- package/dist/lib/passkey.d.ts.map +1 -0
- package/dist/lib/passkey.js +186 -0
- package/dist/lib/persistent-state.d.ts +9 -0
- package/dist/lib/persistent-state.d.ts.map +1 -0
- package/dist/lib/persistent-state.js +37 -0
- package/dist/lib/pglite-core.d.ts +219 -0
- package/dist/lib/pglite-core.d.ts.map +1 -0
- package/dist/lib/pglite-core.js +273 -0
- package/dist/lib/pglite-files.d.ts +7 -0
- package/dist/lib/pglite-files.d.ts.map +1 -0
- package/dist/lib/pglite-files.js +17 -0
- package/dist/lib/pglite-schema.d.ts +58 -0
- package/dist/lib/pglite-schema.d.ts.map +1 -0
- package/dist/lib/pglite-schema.js +105 -0
- package/dist/lib/pglite-storage.d.ts +33 -0
- package/dist/lib/pglite-storage.d.ts.map +1 -0
- package/dist/lib/pglite-storage.js +55 -0
- package/dist/lib/pglite-transfer.d.ts +53 -0
- package/dist/lib/pglite-transfer.d.ts.map +1 -0
- package/dist/lib/pglite-transfer.js +126 -0
- package/dist/lib/pglite.d.ts +106 -0
- package/dist/lib/pglite.d.ts.map +1 -0
- package/dist/lib/pglite.js +298 -0
- package/dist/lib/pull-to-refresh.d.ts +24 -0
- package/dist/lib/pull-to-refresh.d.ts.map +1 -0
- package/dist/lib/pull-to-refresh.js +74 -0
- package/dist/lib/scroll-hidden.d.ts +6 -0
- package/dist/lib/scroll-hidden.d.ts.map +1 -0
- package/dist/lib/scroll-hidden.js +21 -0
- package/dist/lib/sql-format.d.ts +62 -0
- package/dist/lib/sql-format.d.ts.map +1 -0
- package/dist/lib/sql-format.js +175 -0
- package/dist/lib/sql-lex.d.ts +25 -0
- package/dist/lib/sql-lex.d.ts.map +1 -0
- package/dist/lib/sql-lex.js +135 -0
- package/dist/lib/tab-lock.d.ts +28 -0
- package/dist/lib/tab-lock.d.ts.map +1 -0
- package/dist/lib/tab-lock.js +80 -0
- package/dist/lib/tailscale-connect.d.ts +56 -0
- package/dist/lib/tailscale-connect.d.ts.map +1 -0
- package/dist/lib/tailscale-connect.js +99 -0
- package/dist/lib/tailscale-fake.d.ts +33 -0
- package/dist/lib/tailscale-fake.d.ts.map +1 -0
- package/dist/lib/tailscale-fake.js +80 -0
- package/dist/lib/tailscale-policy.d.ts +71 -0
- package/dist/lib/tailscale-policy.d.ts.map +1 -0
- package/dist/lib/tailscale-policy.js +244 -0
- package/dist/lib/tailscale-react.d.ts +20 -0
- package/dist/lib/tailscale-react.d.ts.map +1 -0
- package/dist/lib/tailscale-react.js +37 -0
- package/dist/lib/tailscale-router/bridge.d.ts +60 -0
- package/dist/lib/tailscale-router/bridge.d.ts.map +1 -0
- package/dist/lib/tailscale-router/bridge.js +198 -0
- package/dist/lib/tailscale-router/react.d.ts +19 -0
- package/dist/lib/tailscale-router/react.d.ts.map +1 -0
- package/dist/lib/tailscale-router/react.js +52 -0
- package/dist/lib/tailscale.d.ts +204 -0
- package/dist/lib/tailscale.d.ts.map +1 -0
- package/dist/lib/tailscale.js +443 -0
- package/dist/lib/title-flight.d.ts +34 -0
- package/dist/lib/title-flight.d.ts.map +1 -0
- package/dist/lib/title-flight.js +123 -0
- package/dist/lib/vault-react.d.ts +49 -0
- package/dist/lib/vault-react.d.ts.map +1 -0
- package/dist/lib/vault-react.js +196 -0
- package/dist/lib/vault-storage.d.ts +30 -0
- package/dist/lib/vault-storage.d.ts.map +1 -0
- package/dist/lib/vault-storage.js +105 -0
- package/dist/lib/vault.d.ts +200 -0
- package/dist/lib/vault.d.ts.map +1 -0
- package/dist/lib/vault.js +641 -0
- package/dist/tailscale-sw.js +332 -0
- package/package.json +35 -5
- package/dist/components/icon-button.d.ts +0 -19
- package/dist/components/icon-button.d.ts.map +0 -1
- package/dist/components/icon-button.js +0 -31
- package/dist/components/measure-h.d.ts +0 -7
- package/dist/components/measure-h.d.ts.map +0 -1
- 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
|
|
9
|
-
appearing is an event; popping in unannounced reads as a glitch).
|
|
10
|
-
|
|
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":"
|
|
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 {
|
|
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
|
-
|
|
5
|
-
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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 {
|
|
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"}
|