@pollinations/ui 0.1.0-alpha.3 → 0.1.0-alpha.30

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 (104) hide show
  1. package/README.md +32 -13
  2. package/dist/{Button-CO3Dpbkj.d.cts → Button-BGqClaBr.d.ts} +2 -2
  3. package/dist/{Dialog-yXzIFrDg.d.ts → Dialog-D3Nqt8cE.d.ts} +4 -1
  4. package/dist/app-user-menu/sdk.d.ts +29 -1
  5. package/dist/app-user-menu/sdk.js +120 -729
  6. package/dist/app-user-menu/sdk.js.map +1 -1
  7. package/dist/app.css +13 -0
  8. package/dist/auth/index.d.ts +17 -7
  9. package/dist/auth/index.js +209 -1187
  10. package/dist/auth/index.js.map +1 -1
  11. package/dist/auth/sdk.d.ts +1 -1
  12. package/dist/auth/sdk.js +9 -200
  13. package/dist/auth/sdk.js.map +1 -1
  14. package/dist/brand/badge-made-with.svg +1 -0
  15. package/dist/brand/lockup-horizontal-black.png +0 -0
  16. package/dist/brand/lockup-horizontal-black.svg +3 -3
  17. package/dist/brand/lockup-horizontal-white.png +0 -0
  18. package/dist/brand/lockup-horizontal-white.svg +3 -3
  19. package/dist/brand/lockup-horizontal.svg +4 -1
  20. package/dist/brand/lockup-stacked-black.png +0 -0
  21. package/dist/brand/lockup-stacked-black.svg +1 -1
  22. package/dist/brand/lockup-stacked-white.png +0 -0
  23. package/dist/brand/lockup-stacked-white.svg +1 -1
  24. package/dist/brand/lockup-stacked.svg +1 -1
  25. package/dist/brand/mark-black.png +0 -0
  26. package/dist/brand/mark-black.svg +1 -3
  27. package/dist/brand/mark-white.png +0 -0
  28. package/dist/brand/mark-white.svg +1 -3
  29. package/dist/brand/mark.svg +1 -1
  30. package/dist/brand/polli/polli-lockup-horizontal-black.png +0 -0
  31. package/dist/brand/polli/polli-lockup-horizontal-white.png +0 -0
  32. package/dist/brand/polli/polli.png +0 -0
  33. package/dist/chunk-2BI7XJMG.js +418 -0
  34. package/dist/chunk-2BI7XJMG.js.map +1 -0
  35. package/dist/chunk-3VM5R3OI.js +50 -0
  36. package/dist/chunk-3VM5R3OI.js.map +1 -0
  37. package/dist/chunk-7GDUPN6U.js +115 -0
  38. package/dist/chunk-7GDUPN6U.js.map +1 -0
  39. package/dist/chunk-7NTX3FPZ.js +602 -0
  40. package/dist/chunk-7NTX3FPZ.js.map +1 -0
  41. package/dist/chunk-7XDOOFTL.js +105 -0
  42. package/dist/chunk-7XDOOFTL.js.map +1 -0
  43. package/dist/chunk-DD7MHUFD.js +93 -0
  44. package/dist/chunk-DD7MHUFD.js.map +1 -0
  45. package/dist/chunk-FLQFOTMR.js +107 -0
  46. package/dist/chunk-FLQFOTMR.js.map +1 -0
  47. package/dist/chunk-FRHLA7LM.js +533 -0
  48. package/dist/chunk-FRHLA7LM.js.map +1 -0
  49. package/dist/chunk-LKOYOXBG.js +284 -0
  50. package/dist/chunk-LKOYOXBG.js.map +1 -0
  51. package/dist/chunk-LKUZU37X.js +15 -0
  52. package/dist/chunk-LKUZU37X.js.map +1 -0
  53. package/dist/chunk-LRXUPEQM.js +58 -0
  54. package/dist/chunk-LRXUPEQM.js.map +1 -0
  55. package/dist/chunk-PBNBZKEZ.js +260 -0
  56. package/dist/chunk-PBNBZKEZ.js.map +1 -0
  57. package/dist/chunk-TVPFAM3B.js +88 -0
  58. package/dist/chunk-TVPFAM3B.js.map +1 -0
  59. package/dist/chunk-ZLD4VLUG.js +112 -0
  60. package/dist/chunk-ZLD4VLUG.js.map +1 -0
  61. package/dist/connect.js +100 -0
  62. package/dist/connect.js.map +1 -0
  63. package/dist/gen/index.d.ts +19 -8
  64. package/dist/gen/index.js +64 -450
  65. package/dist/gen/index.js.map +1 -1
  66. package/dist/index-efnABLqH.d.ts +87 -0
  67. package/dist/index.browser.min.js +1 -1
  68. package/dist/index.browser.min.js.map +1 -1
  69. package/dist/index.d.ts +245 -116
  70. package/dist/index.js +1216 -2748
  71. package/dist/index.js.map +1 -1
  72. package/dist/markdown.js +51 -588
  73. package/dist/markdown.js.map +1 -1
  74. package/dist/styles.css +1 -1
  75. package/dist/theme.css +10 -8
  76. package/dist/types-CCy9JNu9.d.ts +6 -0
  77. package/dist/wallet/index.d.ts +5 -0
  78. package/dist/wallet/index.js +17 -356
  79. package/dist/wallet/index.js.map +1 -1
  80. package/package.json +18 -22
  81. package/dist/Button-CO3Dpbkj.d.ts +0 -29
  82. package/dist/Chip-v-ADv6cz.d.cts +0 -18
  83. package/dist/Dialog-yXzIFrDg.d.cts +0 -63
  84. package/dist/app-user-menu/sdk.cjs +0 -893
  85. package/dist/app-user-menu/sdk.cjs.map +0 -1
  86. package/dist/app-user-menu/sdk.d.cts +0 -17
  87. package/dist/auth/index.cjs +0 -1502
  88. package/dist/auth/index.cjs.map +0 -1
  89. package/dist/auth/index.d.cts +0 -109
  90. package/dist/auth/sdk.cjs +0 -239
  91. package/dist/auth/sdk.cjs.map +0 -1
  92. package/dist/auth/sdk.d.cts +0 -40
  93. package/dist/gen/index.cjs +0 -658
  94. package/dist/gen/index.cjs.map +0 -1
  95. package/dist/gen/index.d.cts +0 -80
  96. package/dist/index.cjs +0 -4967
  97. package/dist/index.cjs.map +0 -1
  98. package/dist/index.d.cts +0 -887
  99. package/dist/markdown.cjs +0 -821
  100. package/dist/markdown.cjs.map +0 -1
  101. package/dist/markdown.d.cts +0 -16
  102. package/dist/wallet/index.cjs +0 -415
  103. package/dist/wallet/index.cjs.map +0 -1
  104. package/dist/wallet/index.d.cts +0 -52
package/README.md CHANGED
@@ -46,7 +46,8 @@ The root `@pollinations/ui` entry also ships a browser IIFE bundle for
46
46
  no-build pages. It exposes SDK-free primitives and compositions on
47
47
  `window.PollinationsUI`. Non-root subpaths such as `@pollinations/ui/auth`,
48
48
  `@pollinations/ui/wallet`, `@pollinations/ui/gen`, and
49
- `@pollinations/ui/app-user-menu/sdk` remain ESM/CJS-only.
49
+ `@pollinations/ui/app-user-menu/sdk` are ESM-only. The alpha package ships
50
+ ES modules with shared chunks; it does not include a CommonJS build.
50
51
 
51
52
  React 19 no longer ships UMD builds, so load React from an ESM CDN first, set
52
53
  the globals expected by the IIFE bundle, then load `@pollinations/ui`:
@@ -82,12 +83,17 @@ the globals expected by the IIFE bundle, then load `@pollinations/ui`:
82
83
  ```
83
84
 
84
85
  The browser bundle keeps React and ReactDOM external via those globals, but it
85
- does bundle the root entry's package dependencies, including Ark UI,
86
- react-markdown, remark, and rehype.
86
+ does bundle the root entry's package dependencies, including Ark UI. Markdown
87
+ and its react-markdown/remark/rehype dependencies are available only through
88
+ the ESM `@pollinations/ui/markdown` subpath.
87
89
 
88
90
  React's guidance on loading React 19 without UMD builds:
89
91
  https://react.dev/blog/2024/04/25/react-19-upgrade-guide#umd-builds-removed
90
92
 
93
+ `dist/connect.js` is a separate, self-contained bundle (React included) that
94
+ defines the `<polli-connect>` Connect button. Usage:
95
+ [Drop-in Button](../../BRING_YOUR_OWN_POLLEN.md#-drop-in-button-no-build-step).
96
+
91
97
  For Pollinations apps that use unprefixed Tailwind utilities, import the
92
98
  package-owned app stylesheet instead:
93
99
 
@@ -130,16 +136,27 @@ Wallet colors and utilities are bundled into the main stylesheet
130
136
 
131
137
  ## Dialog layout
132
138
 
133
- `Dialog` uses one responsive frame for forms, confirmations, and results:
134
- full viewport without a border below 640px, contained with rounded corners on
135
- larger screens. `size` controls desktop width only. Use `DialogHeader`, `DialogBody` (scrolling content), and `DialogFooter`
136
- for consistent spacing and actions; avoid overriding viewport dimensions
137
- in consumers. The frame uses Enter’s themed panel color; inset cards use the
138
- neutral `Surface` default. `AuthModal` uses the same frame for standalone pages.
139
+ `Dialog` keeps rounded corners at every width. Below 480px it spans the phone
140
+ width with an 8px vertical gap; larger viewports have a 16px outer inset and use
141
+ the `size` width limit. Height follows the content, capped by the available
142
+ viewport. Confirmations and completed results follow the same phone-width rule.
143
+
144
+ Use `DialogHeader`, `DialogBody` (scrolling content), and `DialogFooter` for
145
+ consistent spacing and actions. The frame uses Enter's themed panel color;
146
+ inner cards use the neutral `Surface` default. `AuthModal` uses the same frame
147
+ for standalone pages. Content such as document previews can request a height,
148
+ which remains capped by the shared frame.
149
+
150
+ Enter's `ResourceDialog` keeps expandable forms top-aligned at every width;
151
+ completed results use the centered `Dialog`. Both inherit the same viewport sizing.
139
152
 
140
- Enter's `ResourceDialog` keeps dashboard forms and confirmations contained on
141
- mobile too, with viewport margins and scrollable content. Keep that exception
142
- in the shared dashboard wrapper rather than repeating dimensions in consumers.
153
+ Actions that write server data use a bordered button (`intent="commit"`).
154
+ Navigation and export actions, including device Continue and Copy and close,
155
+ use the default filled style. Sign-in uses `intent="brand"`; destructive
156
+ confirmations use `intent="danger"`. Cancel/Decline/Close actions use the muted,
157
+ borderless `intent="neutral"` style.
158
+ Saved-card checkout preserves its dedicated footer: full-width Confirm with
159
+ Cancel and the alternative payment-method link on the line below.
143
160
 
144
161
  ## What's exported
145
162
 
@@ -181,10 +198,12 @@ in the shared dashboard wrapper rather than repeating dimensions in consumers.
181
198
  `Switch`, `TabButton`, `Table`, `TableBody`, `TableCell`, `TableHead`,
182
199
  `TableHeaderCell`, `TableRow`, `Text`, `Textarea`, `Tooltip`.
183
200
  - **Design compositions** — `Alert`, `CodeBlock`, `Collapsible`,
184
- `CopyButton`, `EditableCombobox`, `EditableComboboxToken`,
201
+ `CopyButton`, `CopyStateIcon`, `EditableCombobox`, `EditableComboboxToken`,
185
202
  `ExternalLinkButton`, `FieldStack`, `FileUpload`, `InfoTip`, `LinkCard`,
186
203
  `MediaPlaceholder`, `MultiSelect`, `NavItem`, `PeriodPicker`, `Section`,
187
204
  `StatCard`.
205
+ `CopyButton` shows the one copy feedback (a check and "Copied"); a spot that
206
+ draws its own icon uses `CopyStateIcon`, a clipboard that turns into a check.
188
207
  `FieldStack` supports label, helper, action, error, and opt-in aligned label
189
208
  rows for compact forms.
190
209
  `EditableCombobox.startContent` renders content inside a wrapping input shell
@@ -2,14 +2,14 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { PropsWithChildren, ReactNode } from 'react';
3
3
 
4
4
  /** Semantic action roles. Label recipes live on Chip. */
5
- type ButtonIntent = "danger" | "info" | "neutral" | "brand" | "commit";
5
+ type ButtonIntent = "danger" | "info" | "neutral" | "brand" | "commit" | "surface";
6
6
  type ButtonAppearance = "pill" | "raised";
7
7
  declare const pillSizes: {
8
8
  readonly icon: "polli:h-12 polli:w-12 polli:p-0";
9
9
  readonly xs: "polli:h-5 polli:px-1.5 polli:py-0 polli:text-[11px] polli:leading-none";
10
10
  readonly sm: "polli:min-h-7 polli:px-2 polli:pt-0.5 polli:pb-1";
11
11
  readonly md: "polli:min-h-9 polli:px-4 polli:pt-1.5 polli:pb-2";
12
- readonly lg: "polli:min-h-12 polli:px-6 polli:py-3";
12
+ readonly lg: "polli:min-h-12 polli:px-6 polli:py-3 polli:text-base";
13
13
  };
14
14
  type BaseButtonProps = {
15
15
  icon?: ReactNode;
@@ -56,7 +56,10 @@ type DialogBodyProps = ScrollAreaProps & {
56
56
  footnote?: ReactNode;
57
57
  bodyClassName?: string;
58
58
  };
59
- /** Full-height scroll area with floating actions and an optional bottom link. */
59
+ /**
60
+ * Scroll area whose actions follow the content and stay pinned to the bottom
61
+ * once the content scrolls, so a short screen never opens a gap above them.
62
+ */
60
63
  declare function DialogBody({ children, actions, footnote, bodyClassName, className, ...props }: DialogBodyProps): react_jsx_runtime.JSX.Element;
61
64
  declare const DialogFooter: FC<DialogFooterProps>;
62
65
 
@@ -1,4 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { a as AppIcon, D as DiscordIcon, g as BugIcon } from '../index-efnABLqH.js';
3
+ import '../types-CCy9JNu9.js';
4
+ import 'react';
2
5
 
3
6
  type AppUserMenuLabels = {
4
7
  authorize: string;
@@ -7,11 +10,36 @@ type AppUserMenuLabels = {
7
10
  buyPollen: string;
8
11
  logout: string;
9
12
  };
13
+ declare const MENU_LINK_ICONS: {
14
+ app: typeof AppIcon;
15
+ discord: typeof DiscordIcon;
16
+ bug: typeof BugIcon;
17
+ };
10
18
  type AppUserMenuProps = {
11
19
  /** Optional caller-owned dashboard destination for the linked avatar. */
12
20
  dashboardHref?: string;
21
+ /** Larger logged-out action for prominent placements such as a page hero. */
22
+ connectSize?: keyof typeof CONNECT_SIZES;
13
23
  labels?: Partial<AppUserMenuLabels>;
24
+ /** Class for the dropdown panel, which renders in a portal outside the menu. */
25
+ menuClassName?: string;
26
+ menuLinks?: {
27
+ label: string;
28
+ href: string;
29
+ icon?: keyof typeof MENU_LINK_ICONS;
30
+ }[];
31
+ showBuyPollen?: boolean;
32
+ };
33
+ declare const CONNECT_SIZES: {
34
+ md: {
35
+ button: string;
36
+ mark: string;
37
+ };
38
+ lg: {
39
+ button: string;
40
+ mark: string;
41
+ };
14
42
  };
15
- declare function AppUserMenu({ dashboardHref, labels: labelOverrides, }: AppUserMenuProps): react_jsx_runtime.JSX.Element;
43
+ declare function AppUserMenu({ dashboardHref, connectSize, labels: labelOverrides, menuClassName, menuLinks, showBuyPollen, }: AppUserMenuProps): react_jsx_runtime.JSX.Element;
16
44
 
17
45
  export { AppUserMenu, type AppUserMenuLabels, type AppUserMenuProps };