@pollinations/ui 0.0.1

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 (61) hide show
  1. package/README.md +219 -0
  2. package/dist/Button-CNzpisJf.d.cts +26 -0
  3. package/dist/Button-DMJ2K6Gr.d.ts +26 -0
  4. package/dist/Chip-BS8ronOu.d.ts +20 -0
  5. package/dist/Chip-DyqWrq0r.d.cts +20 -0
  6. package/dist/app.css +87 -0
  7. package/dist/assets/logo-wordmark.svg +1 -0
  8. package/dist/assets/logo.svg +4 -0
  9. package/dist/auth/index.cjs +225 -0
  10. package/dist/auth/index.cjs.map +1 -0
  11. package/dist/auth/index.d.cts +28 -0
  12. package/dist/auth/index.d.ts +28 -0
  13. package/dist/auth/index.js +194 -0
  14. package/dist/auth/index.js.map +1 -0
  15. package/dist/auth/sdk.cjs +220 -0
  16. package/dist/auth/sdk.cjs.map +1 -0
  17. package/dist/auth/sdk.d.cts +53 -0
  18. package/dist/auth/sdk.d.ts +53 -0
  19. package/dist/auth/sdk.js +187 -0
  20. package/dist/auth/sdk.js.map +1 -0
  21. package/dist/fonts/fraunces-soft-bold.woff2 +0 -0
  22. package/dist/fonts/lct-mogi-a.woff2 +0 -0
  23. package/dist/fonts/uncut-sans-variable.woff2 +0 -0
  24. package/dist/index.cjs +1771 -0
  25. package/dist/index.cjs.map +1 -0
  26. package/dist/index.d.cts +340 -0
  27. package/dist/index.d.ts +340 -0
  28. package/dist/index.js +1706 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/licenses/Fraunces-OFL.txt +93 -0
  31. package/dist/licenses/LCT-Mogi-OFL.txt +93 -0
  32. package/dist/licenses/UncutSans-OFL.txt +94 -0
  33. package/dist/modality/index.cjs +115 -0
  34. package/dist/modality/index.cjs.map +1 -0
  35. package/dist/modality/index.d.cts +45 -0
  36. package/dist/modality/index.d.ts +45 -0
  37. package/dist/modality/index.js +87 -0
  38. package/dist/modality/index.js.map +1 -0
  39. package/dist/showcase/index.cjs +2851 -0
  40. package/dist/showcase/index.cjs.map +1 -0
  41. package/dist/showcase/index.d.cts +19 -0
  42. package/dist/showcase/index.d.ts +19 -0
  43. package/dist/showcase/index.js +2839 -0
  44. package/dist/showcase/index.js.map +1 -0
  45. package/dist/styles.css +2 -0
  46. package/dist/theme-DfHMjWB7.d.cts +16 -0
  47. package/dist/theme-DfHMjWB7.d.ts +16 -0
  48. package/dist/wallet/index.cjs +190 -0
  49. package/dist/wallet/index.cjs.map +1 -0
  50. package/dist/wallet/index.d.cts +30 -0
  51. package/dist/wallet/index.d.ts +30 -0
  52. package/dist/wallet/index.js +157 -0
  53. package/dist/wallet/index.js.map +1 -0
  54. package/dist/wallet/sdk.cjs +203 -0
  55. package/dist/wallet/sdk.cjs.map +1 -0
  56. package/dist/wallet/sdk.d.cts +33 -0
  57. package/dist/wallet/sdk.d.ts +33 -0
  58. package/dist/wallet/sdk.js +172 -0
  59. package/dist/wallet/sdk.js.map +1 -0
  60. package/dist/wallet.css +73 -0
  61. package/package.json +105 -0
@@ -0,0 +1,340 @@
1
+ export { B as Button, a as ButtonProps } from './Button-DMJ2K6Gr.js';
2
+ import * as react from 'react';
3
+ import { FC, ReactNode, ButtonHTMLAttributes, ComponentPropsWithoutRef, PropsWithChildren, CSSProperties } from 'react';
4
+ export { C as Chip } from './Chip-BS8ronOu.js';
5
+ import * as react_jsx_runtime from 'react/jsx-runtime';
6
+ import { Dialog as Dialog$1 } from '@ark-ui/react/dialog';
7
+ import { T as ThemeName } from './theme-DfHMjWB7.js';
8
+ export { t as themeColors, a as themes } from './theme-DfHMjWB7.js';
9
+ export { Field } from '@ark-ui/react/field';
10
+
11
+ /** Class merge for apps consuming the unprefixed Tailwind bridge in app.css. */
12
+ declare function cn(...inputs: (string | undefined | null | false)[]): string;
13
+
14
+ type PeriodGranularity = "day" | "week" | "month";
15
+ type PeriodSelection = {
16
+ granularity: PeriodGranularity;
17
+ period: string;
18
+ };
19
+ declare function currentPeriod(): PeriodSelection;
20
+ declare function getPeriodBucketKeys(selection: PeriodSelection): string[];
21
+ declare function periodBucketKeyToDate(bucketKey: string, granularity: PeriodGranularity): Date;
22
+
23
+ /**
24
+ * Locks page scroll while enabled and restores the original overflow values on
25
+ * cleanup.
26
+ */
27
+ declare function useScrollLock(enabled?: boolean): void;
28
+
29
+ type ChevronIconProps = {
30
+ /** Rotate 180° when expanded/open. */
31
+ expanded?: boolean;
32
+ className?: string;
33
+ };
34
+ /**
35
+ * Canonical chevron used for collapsibles, dropdown triggers, and select pills
36
+ * across the app. One icon everywhere.
37
+ */
38
+ declare const ChevronIcon: FC<ChevronIconProps>;
39
+
40
+ type CollapsibleProps = {
41
+ /** Header content (label, hint, etc). */
42
+ label: ReactNode;
43
+ expanded: boolean;
44
+ onToggle: () => void;
45
+ children: ReactNode;
46
+ disabled?: boolean;
47
+ /** Outer wrapper classes — base bg, border, etc. */
48
+ wrapperClassName?: string;
49
+ /** Trigger hover classes. Defaults to `polli:hover:bg-theme-bg-active`. */
50
+ hoverClassName?: string;
51
+ /** Trigger focus classes. */
52
+ focusClassName?: string;
53
+ /** Expanded panel classes. Defaults to a top border separator. */
54
+ panelClassName?: string;
55
+ /** Accessible label for the toggle button when label is non-text. */
56
+ ariaLabel?: string;
57
+ };
58
+ /**
59
+ * Collapsible row primitive. One chevron, one hover/rounded behaviour for
60
+ * every collapsible in the UI. Use this for any "click to reveal nested
61
+ * content" UI — nested settings, grouped controls, optional details.
62
+ *
63
+ * For dropdown/popover triggers (date pickers, menus) use a button with
64
+ * <ChevronIcon /> directly — that's a different interaction.
65
+ */
66
+ declare const Collapsible: FC<CollapsibleProps>;
67
+
68
+ type CopyValue = string | (() => string | Promise<string>);
69
+ type CopyButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "className" | "onClick" | "type" | "value"> & {
70
+ value: CopyValue;
71
+ children: ReactNode | ((copied: boolean) => ReactNode);
72
+ copiedTimeoutMs?: number;
73
+ tooltip?: ReactNode;
74
+ copiedTooltip?: ReactNode;
75
+ tooltipClassName?: string;
76
+ className?: string | ((copied: boolean) => string);
77
+ onCopied?: () => void;
78
+ onCopyError?: (error: unknown) => void;
79
+ };
80
+ declare function CopyButton({ value, children, copiedTimeoutMs, tooltip, copiedTooltip, tooltipClassName, className, onCopied, onCopyError, ...buttonProps }: CopyButtonProps): react_jsx_runtime.JSX.Element;
81
+
82
+ declare const sizeClasses: {
83
+ readonly sm: "polli:max-w-md";
84
+ readonly md: "polli:max-w-xl";
85
+ readonly lg: "polli:max-w-2xl";
86
+ };
87
+ type DialogProps = {
88
+ open: boolean;
89
+ onOpenChange?: (open: boolean) => void;
90
+ trigger?: ReactNode;
91
+ triggerAsChild?: boolean;
92
+ triggerClassName?: string;
93
+ title?: ReactNode;
94
+ titleClassName?: string;
95
+ ariaLabel?: string;
96
+ labelledBy?: string;
97
+ theme?: ThemeName;
98
+ size?: keyof typeof sizeClasses;
99
+ showBackdrop?: boolean;
100
+ backdropClassName?: string;
101
+ positionerClassName?: string;
102
+ contentClassName?: string;
103
+ children: ReactNode;
104
+ };
105
+ declare const Dialog: FC<DialogProps>;
106
+ declare const DialogTitle: react.ForwardRefExoticComponent<Dialog$1.TitleProps & react.RefAttributes<HTMLHeadingElement>>;
107
+
108
+ type DropdownProps = {
109
+ theme: ThemeName;
110
+ /** Trigger element; receives the current open state (e.g. to rotate a chevron). */
111
+ trigger: (open: boolean) => ReactNode;
112
+ /** Panel content. As a function, receives `close` to dismiss after a selection. */
113
+ children: ReactNode | ((close: () => void) => ReactNode);
114
+ /** Panel placement relative to the trigger. */
115
+ align?: "start" | "end";
116
+ /** Controlled open state. Omit to let the Dropdown manage its own. */
117
+ open?: boolean;
118
+ onOpenChange?: (open: boolean) => void;
119
+ /** Replaces the default themed surface (e.g. a differently-coloured menu). */
120
+ panelClassName?: string;
121
+ /** Appended after the surface (widths, padding, max-height…). */
122
+ className?: string;
123
+ };
124
+ declare const Dropdown: FC<DropdownProps>;
125
+
126
+ type ExternalLinkButtonProps = {
127
+ theme: ThemeName;
128
+ href: string;
129
+ size?: "small" | "medium" | "large";
130
+ className?: string;
131
+ children: ReactNode;
132
+ };
133
+ declare const ExternalLinkButton: FC<ExternalLinkButtonProps>;
134
+
135
+ /** IconButton only supports `danger` (delete icons). */
136
+ type IconButtonIntent = "danger";
137
+ type IconButtonProps = {
138
+ intent?: IconButtonIntent;
139
+ title?: string;
140
+ onClick: () => void;
141
+ children: ReactNode;
142
+ className?: string;
143
+ };
144
+ declare const IconButton: FC<IconButtonProps>;
145
+
146
+ type InfoTipProps = {
147
+ text?: ReactNode;
148
+ content?: ReactNode;
149
+ label?: string;
150
+ };
151
+ /**
152
+ * Small "i" badge that opens a tooltip on hover, click, or focus.
153
+ *
154
+ * Both the badge and the popup follow the page theme: badge reads
155
+ * `bg-theme-bg-active`; popup uses the universal recipe via `<Tooltip>`
156
+ * (`bg-theme-bg-pale` + `border-theme-border` + `text-theme-text-strong`,
157
+ * viewport-clamped). Cursor on the badge is `cursor-help`.
158
+ */
159
+ declare const InfoTip: FC<InfoTipProps>;
160
+
161
+ type InputProps = React.ComponentPropsWithoutRef<"input"> & {
162
+ error?: boolean;
163
+ hideNumberSteppers?: boolean;
164
+ };
165
+ declare const Input: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & {
166
+ error?: boolean;
167
+ hideNumberSteppers?: boolean;
168
+ } & react.RefAttributes<HTMLInputElement>>;
169
+
170
+ /** Icons inherit color via currentColor and size via className or SVG props. */
171
+ type IconProps = ComponentPropsWithoutRef<"svg">;
172
+
173
+ declare function AppIcon(props: IconProps): react_jsx_runtime.JSX.Element;
174
+ declare function BeakerIcon(props: IconProps): react_jsx_runtime.JSX.Element;
175
+ declare function BookIcon(props: IconProps): react_jsx_runtime.JSX.Element;
176
+ declare function CheckIcon(props: IconProps): react_jsx_runtime.JSX.Element;
177
+ declare function ClipboardIcon(props: IconProps): react_jsx_runtime.JSX.Element;
178
+ declare function ClockIcon(props: IconProps): react_jsx_runtime.JSX.Element;
179
+ declare function DiscordIcon(props: IconProps): react_jsx_runtime.JSX.Element;
180
+ declare function DownloadIcon(props: IconProps): react_jsx_runtime.JSX.Element;
181
+ declare function ExternalLinkIcon(props: IconProps): react_jsx_runtime.JSX.Element;
182
+ declare function GenApiIcon(props: IconProps): react_jsx_runtime.JSX.Element;
183
+ declare function GitHubIcon(props: IconProps): react_jsx_runtime.JSX.Element;
184
+ declare function ImageIcon(props: IconProps): react_jsx_runtime.JSX.Element;
185
+ declare function LockIcon(props: IconProps): react_jsx_runtime.JSX.Element;
186
+ declare function MailIcon(props: IconProps): react_jsx_runtime.JSX.Element;
187
+ declare function McpIcon(props: IconProps): react_jsx_runtime.JSX.Element;
188
+ declare function MenuIcon(props: IconProps): react_jsx_runtime.JSX.Element;
189
+ declare function TerminalIcon(props: IconProps): react_jsx_runtime.JSX.Element;
190
+ declare function TokensIcon(props: IconProps): react_jsx_runtime.JSX.Element;
191
+ declare function TrendUpIcon(props: IconProps): react_jsx_runtime.JSX.Element;
192
+ declare function WalletIcon(props: IconProps): react_jsx_runtime.JSX.Element;
193
+ declare function XIcon(props: IconProps): react_jsx_runtime.JSX.Element;
194
+
195
+ type MultiSelectOption = {
196
+ value: string;
197
+ label: string;
198
+ };
199
+ type MultiSelectProps = {
200
+ options: MultiSelectOption[];
201
+ selected: string[];
202
+ onChange: (selected: string[]) => void;
203
+ placeholder: string;
204
+ disabled?: boolean;
205
+ disabledText?: string;
206
+ align?: "start" | "end";
207
+ label?: string;
208
+ theme: ThemeName;
209
+ };
210
+ declare const MultiSelect: FC<MultiSelectProps>;
211
+
212
+ type PeriodPickerProps = {
213
+ value: PeriodSelection;
214
+ onChange: (value: PeriodSelection) => void;
215
+ theme: ThemeName;
216
+ minDate?: Date;
217
+ maxDate?: Date;
218
+ };
219
+ declare const PeriodPicker: FC<PeriodPickerProps>;
220
+
221
+ type ScrollAxis = "y" | "x" | "both";
222
+ type ScrollAreaOwnProps = {
223
+ /** Override the ambient cascade theme for this scroller's thumb. */
224
+ theme?: ThemeName;
225
+ /** Scroll direction. Default `y`. */
226
+ axis?: ScrollAxis;
227
+ /** Idle time before the thumb fades out, in ms. Default `2000`. */
228
+ hideDelayMs?: number;
229
+ className?: string;
230
+ };
231
+ type ScrollAreaProps = PropsWithChildren<ScrollAreaOwnProps & Omit<ComponentPropsWithoutRef<"div">, keyof ScrollAreaOwnProps>>;
232
+ /**
233
+ * Themed auto-hide scroll container. Thumb color follows the nearest
234
+ * `[data-theme="..."]` ancestor; pass `theme` to override locally.
235
+ */
236
+ declare const ScrollArea: react.ForwardRefExoticComponent<ScrollAreaOwnProps & Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof ScrollAreaOwnProps> & {
237
+ children?: react.ReactNode | undefined;
238
+ } & react.RefAttributes<HTMLDivElement>>;
239
+
240
+ type SectionProps = {
241
+ title: string;
242
+ theme: ThemeName;
243
+ id?: string;
244
+ framed?: boolean;
245
+ action?: ReactNode;
246
+ actionClassName?: string;
247
+ children: ReactNode;
248
+ className?: string;
249
+ };
250
+ declare const Section: FC<SectionProps>;
251
+
252
+ type SliderProps = Omit<React.ComponentPropsWithoutRef<"input">, "type"> & {
253
+ /** Fill percentage from 0-100. Falls back to value/min/max when omitted. */
254
+ progress?: number;
255
+ };
256
+ declare const Slider: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "type"> & {
257
+ /** Fill percentage from 0-100. Falls back to value/min/max when omitted. */
258
+ progress?: number;
259
+ } & react.RefAttributes<HTMLInputElement>>;
260
+
261
+ type StatCardProps = {
262
+ label: ReactNode;
263
+ value: ReactNode;
264
+ detail?: ReactNode;
265
+ theme?: ThemeName;
266
+ className?: string;
267
+ labelClassName?: string;
268
+ valueClassName?: string;
269
+ detailClassName?: string;
270
+ };
271
+ declare const StatCard: FC<StatCardProps>;
272
+
273
+ type SurfaceVariant = "panel" | "card" | "card-themed";
274
+ type SurfaceOwnProps = {
275
+ /** Override the cascade theme for this surface's subtree. */
276
+ theme?: ThemeName;
277
+ /**
278
+ * Visual role.
279
+ * - `panel` — outer container: bordered, semi-transparent theme bg
280
+ * - `card` — borderless white inner (default)
281
+ * - `card-themed` — borderless theme-tinted inner (deeper than panel)
282
+ */
283
+ variant?: SurfaceVariant;
284
+ className?: string;
285
+ };
286
+ type SurfaceProps = PropsWithChildren<SurfaceOwnProps & Omit<ComponentPropsWithoutRef<"div">, keyof SurfaceOwnProps | "color">>;
287
+ declare const Surface: FC<SurfaceProps>;
288
+
289
+ type SwitchStatus = "off" | "on" | "invalid";
290
+ type SwitchProps = {
291
+ checked: boolean;
292
+ onChange: (next: boolean) => void;
293
+ /** Visual status. Drives track colour only. Defaults to `checked ? "on" : "off"`. */
294
+ status?: SwitchStatus;
295
+ /** Accessible label (aria-label). Not rendered visibly. */
296
+ ariaLabel?: string;
297
+ disabled?: boolean;
298
+ className?: string;
299
+ };
300
+ /**
301
+ * Binary toggle primitive. Universal palette — does NOT follow the page
302
+ * theme. Three states: off (white), on (soft green), invalid (soft red,
303
+ * for "enabled but needs attention").
304
+ *
305
+ * `checked` drives thumb position; `status` drives track colour. So
306
+ * `checked={true} status="invalid"` renders thumb-right with a red track.
307
+ */
308
+ declare const Switch: FC<SwitchProps>;
309
+
310
+ type TabButtonProps = {
311
+ active: boolean;
312
+ onClick: () => void;
313
+ children: ReactNode;
314
+ /** Optional cascade override; defaults to inherited [data-theme]. */
315
+ theme?: ThemeName;
316
+ size?: "medium" | "small";
317
+ ariaLabel?: string;
318
+ disabled?: boolean;
319
+ className?: string;
320
+ };
321
+ declare const TabButton: FC<TabButtonProps>;
322
+
323
+ type TooltipProps = {
324
+ children: ReactNode;
325
+ content: ReactNode;
326
+ ariaLabel?: string;
327
+ className?: string;
328
+ onClick?: () => void;
329
+ style?: CSSProperties;
330
+ triggerAs?: "button" | "span";
331
+ /**
332
+ * When true, the inner cursor wrapper uses display:contents so the
333
+ * trigger's flex/grid layout applies directly to the caller's children
334
+ * without an inline wrapper in the way.
335
+ */
336
+ displayContents?: boolean;
337
+ };
338
+ declare const Tooltip: FC<TooltipProps>;
339
+
340
+ export { AppIcon, BeakerIcon, BookIcon, CheckIcon, ChevronIcon, ClipboardIcon, ClockIcon, Collapsible, type CollapsibleProps, CopyButton, type CopyButtonProps, Dialog, type DialogProps, DialogTitle, DiscordIcon, DownloadIcon, Dropdown, type DropdownProps, ExternalLinkButton, type ExternalLinkButtonProps, ExternalLinkIcon, GenApiIcon, GitHubIcon, IconButton, type IconProps, ImageIcon, InfoTip, Input, type InputProps, LockIcon, MailIcon, McpIcon, MenuIcon, MultiSelect, type MultiSelectProps, type PeriodGranularity, PeriodPicker, type PeriodPickerProps, type PeriodSelection, ScrollArea, type ScrollAreaProps, Section, type SectionProps, Slider, type SliderProps, StatCard, type StatCardProps, Surface, Switch, type SwitchProps, type SwitchStatus, TabButton, type TabButtonProps, TerminalIcon, ThemeName, TokensIcon, Tooltip, TrendUpIcon, WalletIcon, XIcon, cn, currentPeriod, getPeriodBucketKeys, periodBucketKeyToDate, useScrollLock };