@pollinations/ui 0.1.0-alpha.1 → 0.1.0-alpha.11
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 +148 -36
- package/dist/Button-BGqClaBr.d.cts +29 -0
- package/dist/Button-BGqClaBr.d.ts +29 -0
- package/dist/Chip-v-ADv6cz.d.cts +18 -0
- package/dist/Chip-v-ADv6cz.d.ts +18 -0
- package/dist/Dialog-D3Nqt8cE.d.cts +66 -0
- package/dist/Dialog-D3Nqt8cE.d.ts +66 -0
- package/dist/app-user-menu/sdk.cjs +684 -243
- package/dist/app-user-menu/sdk.cjs.map +1 -1
- package/dist/app-user-menu/sdk.d.cts +18 -7
- package/dist/app-user-menu/sdk.d.ts +18 -7
- package/dist/app-user-menu/sdk.js +689 -241
- package/dist/app-user-menu/sdk.js.map +1 -1
- package/dist/app.css +19 -122
- package/dist/auth/index.cjs +1372 -86
- package/dist/auth/index.cjs.map +1 -1
- package/dist/auth/index.d.cts +91 -6
- package/dist/auth/index.d.ts +91 -6
- package/dist/auth/index.js +1369 -85
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/sdk.cjs +250 -0
- package/dist/auth/sdk.cjs.map +1 -0
- package/dist/auth/sdk.d.cts +40 -0
- package/dist/auth/sdk.d.ts +40 -0
- package/dist/auth/sdk.js +219 -0
- package/dist/auth/sdk.js.map +1 -0
- package/dist/brand/badge-made-with.svg +1 -0
- package/dist/brand/lockup-horizontal-black.png +0 -0
- package/dist/brand/lockup-horizontal-black.svg +4 -0
- package/dist/brand/lockup-horizontal-white.png +0 -0
- package/dist/brand/lockup-horizontal-white.svg +4 -0
- package/dist/brand/lockup-horizontal.svg +4 -0
- package/dist/brand/lockup-stacked-black.png +0 -0
- package/dist/brand/lockup-stacked-black.svg +4 -0
- package/dist/brand/lockup-stacked-white.png +0 -0
- package/dist/brand/lockup-stacked-white.svg +4 -0
- package/dist/brand/lockup-stacked.svg +4 -0
- package/dist/brand/mark-black.png +0 -0
- package/dist/brand/mark-black.svg +1 -0
- package/dist/brand/mark-white.png +0 -0
- package/dist/brand/mark-white.svg +1 -0
- package/dist/brand/mark.svg +1 -0
- package/dist/brand/polli/polli-lockup-horizontal-black.png +0 -0
- package/dist/brand/polli/polli-lockup-horizontal-white.png +0 -0
- package/dist/brand/polli/polli-lockup-stacked-black.png +0 -0
- package/dist/brand/polli/polli-lockup-stacked-white.png +0 -0
- package/dist/brand/polli/polli.png +0 -0
- package/dist/brand/wordmark-black.png +0 -0
- package/dist/brand/wordmark-black.svg +1 -0
- package/dist/brand/wordmark-white.png +0 -0
- package/dist/brand/wordmark-white.svg +1 -0
- package/dist/brand/wordmark.svg +1 -0
- package/dist/fonts/geist-pixel-square.woff2 +0 -0
- package/dist/gen/index.cjs +459 -218
- package/dist/gen/index.cjs.map +1 -1
- package/dist/gen/index.d.cts +75 -19
- package/dist/gen/index.d.ts +75 -19
- package/dist/gen/index.js +453 -216
- package/dist/gen/index.js.map +1 -1
- package/dist/index.browser.min.js +2 -0
- package/dist/index.browser.min.js.map +1 -0
- package/dist/index.cjs +4104 -1820
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +686 -199
- package/dist/index.d.ts +686 -199
- package/dist/index.js +3668 -1451
- package/dist/index.js.map +1 -1
- package/dist/licenses/Geist-OFL.txt +93 -0
- package/dist/markdown.cjs +836 -0
- package/dist/markdown.cjs.map +1 -0
- package/dist/markdown.d.cts +16 -0
- package/dist/markdown.d.ts +16 -0
- package/dist/markdown.js +807 -0
- package/dist/markdown.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/theme.css +94 -0
- package/dist/types-CCy9JNu9.d.cts +6 -0
- package/dist/types-CCy9JNu9.d.ts +6 -0
- package/dist/wallet/index.cjs +295 -65
- package/dist/wallet/index.cjs.map +1 -1
- package/dist/wallet/index.d.cts +30 -7
- package/dist/wallet/index.d.ts +30 -7
- package/dist/wallet/index.js +294 -65
- package/dist/wallet/index.js.map +1 -1
- package/package.json +106 -89
- package/dist/Chip-CQCq34kS.d.cts +0 -20
- package/dist/Chip-Cj4xG7Te.d.ts +0 -20
- package/dist/assets/logo-wordmark.svg +0 -1
- package/dist/assets/logo.svg +0 -4
- package/dist/theme-jRPPBmld.d.cts +0 -20
- package/dist/theme-jRPPBmld.d.ts +0 -20
package/README.md
CHANGED
|
@@ -32,14 +32,62 @@ import { AppUserMenu } from "@pollinations/ui/app-user-menu/sdk";
|
|
|
32
32
|
export function App() {
|
|
33
33
|
return (
|
|
34
34
|
<PolliProvider appKey="pk_your_publishable_key" permissions={["profile"]}>
|
|
35
|
-
<Surface
|
|
36
|
-
<AppUserMenu
|
|
35
|
+
<Surface>
|
|
36
|
+
<AppUserMenu />
|
|
37
37
|
</Surface>
|
|
38
38
|
</PolliProvider>
|
|
39
39
|
);
|
|
40
40
|
}
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
+
### CDN / `<script>` Tag
|
|
44
|
+
|
|
45
|
+
The root `@pollinations/ui` entry also ships a browser IIFE bundle for
|
|
46
|
+
no-build pages. It exposes SDK-free primitives and compositions on
|
|
47
|
+
`window.PollinationsUI`. Non-root subpaths such as `@pollinations/ui/auth`,
|
|
48
|
+
`@pollinations/ui/wallet`, `@pollinations/ui/gen`, and
|
|
49
|
+
`@pollinations/ui/app-user-menu/sdk` remain ESM/CJS-only.
|
|
50
|
+
|
|
51
|
+
React 19 no longer ships UMD builds, so load React from an ESM CDN first, set
|
|
52
|
+
the globals expected by the IIFE bundle, then load `@pollinations/ui`:
|
|
53
|
+
|
|
54
|
+
```html
|
|
55
|
+
<link
|
|
56
|
+
rel="stylesheet"
|
|
57
|
+
href="https://cdn.jsdelivr.net/npm/@pollinations/ui@alpha/styles.css"
|
|
58
|
+
/>
|
|
59
|
+
<div id="root"></div>
|
|
60
|
+
<script type="module">
|
|
61
|
+
import React from "https://esm.sh/react@19";
|
|
62
|
+
import * as ReactDOM from "https://esm.sh/react-dom@19";
|
|
63
|
+
import * as ReactDOMClient from "https://esm.sh/react-dom@19/client";
|
|
64
|
+
|
|
65
|
+
window.React = React;
|
|
66
|
+
window.ReactDOM = { ...ReactDOM, ...ReactDOMClient };
|
|
67
|
+
|
|
68
|
+
await new Promise((resolve, reject) => {
|
|
69
|
+
const script = document.createElement("script");
|
|
70
|
+
script.src = "https://cdn.jsdelivr.net/npm/@pollinations/ui@alpha";
|
|
71
|
+
script.onload = resolve;
|
|
72
|
+
script.onerror = reject;
|
|
73
|
+
document.head.appendChild(script);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const { Button } = window.PollinationsUI;
|
|
77
|
+
|
|
78
|
+
window.ReactDOM.createRoot(document.getElementById("root")).render(
|
|
79
|
+
React.createElement(Button, null, "Generate"),
|
|
80
|
+
);
|
|
81
|
+
</script>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
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.
|
|
87
|
+
|
|
88
|
+
React's guidance on loading React 19 without UMD builds:
|
|
89
|
+
https://react.dev/blog/2024/04/25/react-19-upgrade-guide#umd-builds-removed
|
|
90
|
+
|
|
43
91
|
For Pollinations apps that use unprefixed Tailwind utilities, import the
|
|
44
92
|
package-owned app stylesheet instead:
|
|
45
93
|
|
|
@@ -53,46 +101,107 @@ and generic `polli-ui-root`, `polli-ui-body`, and `polli-ui-shell` classes.
|
|
|
53
101
|
Canonical Pollinations source SVGs are exported from the package:
|
|
54
102
|
|
|
55
103
|
```ts
|
|
56
|
-
import
|
|
57
|
-
import
|
|
104
|
+
import markUrl from "@pollinations/ui/brand/mark.svg";
|
|
105
|
+
import lockupUrl from "@pollinations/ui/brand/lockup-horizontal.svg";
|
|
58
106
|
```
|
|
59
107
|
|
|
60
108
|
The SVG sources use `currentColor`. Apps control the rendered color by inlining
|
|
61
109
|
them or using them as masks. Root-level favicon, PWA icon, and SEO files stay
|
|
62
110
|
app-owned.
|
|
63
111
|
|
|
112
|
+
The whole kit derives from two atomic sources — `mark.svg` and `wordmark.svg`
|
|
113
|
+
(both `currentColor`) plus the raster bee `polli/polli.png`. One zero-config
|
|
114
|
+
command rebuilds everything:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
npm run brand
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
It refreshes the committed derivatives in `src/brand`, and writes every
|
|
121
|
+
favicon / PWA / apple-touch / maskable / OG / social asset to `brand-out/`
|
|
122
|
+
(gitignored) — copy those into a site's `public/`. Colours are fixed to the two
|
|
123
|
+
brand themes matching enter.pollinations.ai (icons gold on transparent,
|
|
124
|
+
OG/social dark on cream), resolved from `theme-palette.json`. Sizes and padding
|
|
125
|
+
are data in `scripts/brand/presets.js` — `pad` keeps avatars clear of a circular
|
|
126
|
+
mask; add a platform by adding a line.
|
|
127
|
+
|
|
64
128
|
Wallet colors and utilities are bundled into the main stylesheet
|
|
65
129
|
(`@pollinations/ui/styles.css`) — no separate import needed.
|
|
66
130
|
|
|
131
|
+
## Dialog layout
|
|
132
|
+
|
|
133
|
+
`Dialog` keeps rounded corners at every width. Below 480px it spans the phone
|
|
134
|
+
width with an 8px vertical gap; larger viewports have a 16px outer inset and use
|
|
135
|
+
the `size` width limit. Height follows the content, capped by the available
|
|
136
|
+
viewport. Confirmations and completed results follow the same phone-width rule.
|
|
137
|
+
|
|
138
|
+
Use `DialogHeader`, `DialogBody` (scrolling content), and `DialogFooter` for
|
|
139
|
+
consistent spacing and actions. The frame uses Enter's themed panel color;
|
|
140
|
+
inner cards use the neutral `Surface` default. `AuthModal` uses the same frame
|
|
141
|
+
for standalone pages. Content such as document previews can request a height,
|
|
142
|
+
which remains capped by the shared frame.
|
|
143
|
+
|
|
144
|
+
Enter's `ResourceDialog` keeps expandable forms top-aligned at every width;
|
|
145
|
+
completed results use the centered `Dialog`. Both inherit the same viewport sizing.
|
|
146
|
+
|
|
147
|
+
Actions that write server data use a bordered button (`intent="commit"`).
|
|
148
|
+
Navigation and export actions, including device Continue and Copy and close,
|
|
149
|
+
use the default filled style. Sign-in uses `intent="brand"`; destructive
|
|
150
|
+
confirmations use `intent="danger"`. Cancel/Decline/Close actions use the muted,
|
|
151
|
+
borderless `intent="neutral"` style.
|
|
152
|
+
Saved-card checkout preserves its dedicated footer: full-width Confirm with
|
|
153
|
+
Cancel and the alternative payment-method link on the line below.
|
|
154
|
+
|
|
67
155
|
## What's exported
|
|
68
156
|
|
|
69
157
|
- `@pollinations/ui` exports SDK-free design primitives, helpers, and
|
|
70
|
-
|
|
71
|
-
- `@pollinations/ui/auth` exports
|
|
158
|
+
compositions. These can be used without Pollinations auth.
|
|
159
|
+
- `@pollinations/ui/auth` exports `PollinationsSignInButton` (official brand
|
|
160
|
+
asset, outlined amber styling, accessible provider label) and `DashboardSignIn`
|
|
161
|
+
(the shared satellite-app sign-in page). Apps supply the sign-in action; these
|
|
162
|
+
components do not issue credentials or choose an authentication method.
|
|
163
|
+
- `@pollinations/ui/auth` also exports SDK-free auth modal pieces:
|
|
72
164
|
`AuthModal`, `AuthModalHeader`, `AuthModalLoading`, `AuthInfoCard`, and
|
|
73
165
|
`ErrorBanner`.
|
|
166
|
+
- `@pollinations/ui/auth/sdk` exports identity/session components that read
|
|
167
|
+
from the surrounding `<PolliProvider>`:
|
|
168
|
+
- **null when not logged in (or before data loads):** `UserAvatar`,
|
|
169
|
+
`UserName`, `WhenLoggedIn`.
|
|
170
|
+
- **shown only when logged out:** `LoginButton`, `WhenLoggedOut`.
|
|
171
|
+
|
|
172
|
+
These are intentionally bare wrappers around `useAuth*` hooks. They render
|
|
173
|
+
the data and nothing else — no default copy and no default intent. The app
|
|
174
|
+
composes layout, copy, and color.
|
|
74
175
|
- `@pollinations/ui/wallet` exports SDK-free wallet-specific display helpers
|
|
75
|
-
and recipes: `formatPollen`, `PaidChip`, `TierChip`, `
|
|
176
|
+
and recipes: `formatPollen`, `PaidChip`, `TierChip`, `WalletKindIcon`,
|
|
76
177
|
`WalletBalanceCard`, `PAID_BALANCE_CHART_COLOR`, and
|
|
77
178
|
`TIER_BALANCE_CHART_COLOR`.
|
|
78
179
|
- `@pollinations/ui/app-user-menu/sdk` exports the SDK-backed app account
|
|
79
180
|
menu module.
|
|
80
|
-
- `@pollinations/ui/gen` exports
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
181
|
+
- `@pollinations/ui/gen` exports generation UI modules and modality helpers:
|
|
182
|
+
`ModelSelector`, `ModalityChip`, `ModalityDot`, `ModalityTab`,
|
|
183
|
+
`categoryLabel`, and `getModalityKey`.
|
|
184
|
+
- `@pollinations/ui/markdown` exports `Markdown` and `Prose`, kept off the
|
|
185
|
+
root entry so react-markdown only loads where documents render.
|
|
186
|
+
- `@pollinations/ui/brand/*` exports the canonical brand kit — `mark`,
|
|
187
|
+
`wordmark`, `lockup-horizontal`, `lockup-stacked` (currentColor SVG masters
|
|
188
|
+
plus `-black`/`-white` SVG + PNG), and the `polli/` mascot PNGs.
|
|
84
189
|
- **Design primitives** — `Button`, `ButtonGroup`, `Chip`, `ChevronIcon`,
|
|
85
190
|
`Dialog`, `DialogTitle`, `Dropdown`, `DropdownItem`, `Field`, `Heading`,
|
|
86
191
|
`IconButton`, `InlineLink`, `Input`, `ScrollArea`, `Slider`, `Surface`,
|
|
87
192
|
`Switch`, `TabButton`, `Table`, `TableBody`, `TableCell`, `TableHead`,
|
|
88
193
|
`TableHeaderCell`, `TableRow`, `Text`, `Textarea`, `Tooltip`.
|
|
89
194
|
- **Design compositions** — `Alert`, `CodeBlock`, `Collapsible`,
|
|
90
|
-
`CopyButton`, `
|
|
91
|
-
`
|
|
92
|
-
`
|
|
195
|
+
`CopyButton`, `EditableCombobox`, `EditableComboboxToken`,
|
|
196
|
+
`ExternalLinkButton`, `FieldStack`, `FileUpload`, `InfoTip`, `LinkCard`,
|
|
197
|
+
`MediaPlaceholder`, `MultiSelect`, `NavItem`, `PeriodPicker`, `Section`,
|
|
198
|
+
`StatCard`.
|
|
199
|
+
`FieldStack` supports label, helper, action, error, and opt-in aligned label
|
|
200
|
+
rows for compact forms.
|
|
201
|
+
`EditableCombobox.startContent` renders content inside a wrapping input shell
|
|
202
|
+
and replaces the standalone chevron trigger.
|
|
93
203
|
- **Helpers** — `cn`, `useScrollLock`, `currentPeriod`,
|
|
94
204
|
`getPeriodBucketKeys`, `periodBucketKeyToDate`.
|
|
95
|
-
- **Theme** — `themes` (runtime array of theme names), `ThemeName` (type).
|
|
96
205
|
|
|
97
206
|
For per-request usage data and other dynamic queries, call the opt-in hooks
|
|
98
207
|
from `@pollinations/sdk/react` (`useAccountKeyUsage`, `useAccountKey`,
|
|
@@ -106,15 +215,19 @@ from `@pollinations/sdk/react` (`useAccountKeyUsage`, `useAccountKey`,
|
|
|
106
215
|
such as auth, wallet, app-user-menu, and gen.
|
|
107
216
|
- Public subpath exports (`@pollinations/ui/auth`,
|
|
108
217
|
`@pollinations/ui/wallet`, `@pollinations/ui/gen`,
|
|
109
|
-
`@pollinations/ui/app-user-menu/sdk`) are
|
|
110
|
-
layers.
|
|
218
|
+
`@pollinations/ui/markdown`, `@pollinations/ui/app-user-menu/sdk`) are
|
|
219
|
+
built directly from those source layers.
|
|
111
220
|
|
|
112
221
|
## Theming
|
|
113
222
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
223
|
+
Import `@pollinations/ui/styles.css` once at the app entry. The package uses a
|
|
224
|
+
single app accent by default; primitives read the current cascade through
|
|
225
|
+
`--polli-color-*` variables.
|
|
226
|
+
|
|
227
|
+
Use `data-theme="neutral"` on chrome that should carry no accent, such as a
|
|
228
|
+
global rail. Use `data-theme="accent"` inside a neutral subtree to re-assert
|
|
229
|
+
the app accent for controls. Do not use per-component theme props; compose
|
|
230
|
+
layout and state with primitives instead.
|
|
118
231
|
|
|
119
232
|
## Public design tokens
|
|
120
233
|
|
|
@@ -125,7 +238,7 @@ count as breaking.
|
|
|
125
238
|
Public tokens sit under the `--polli-*` namespace so they do not collide
|
|
126
239
|
with host app tokens.
|
|
127
240
|
|
|
128
|
-
**
|
|
241
|
+
**Accent-aware (resolve against the current accent or neutral scope):**
|
|
129
242
|
|
|
130
243
|
| Token | Purpose |
|
|
131
244
|
| ----------------------------- | --------------------------------------------- |
|
|
@@ -159,23 +272,22 @@ Wallet tokens are public (bundled into `@pollinations/ui/styles.css`):
|
|
|
159
272
|
| `--polli-color-paid-pale` | Paid-balance wash. |
|
|
160
273
|
| `--polli-color-paid-soft` | Paid-balance marker. |
|
|
161
274
|
| `--polli-color-paid-deep` | Paid-balance text. |
|
|
162
|
-
| `--polli-color-tier-pale` |
|
|
163
|
-
| `--polli-color-tier-soft` |
|
|
164
|
-
| `--polli-color-tier-deep` |
|
|
275
|
+
| `--polli-color-tier-pale` | Quest Pollen wash. |
|
|
276
|
+
| `--polli-color-tier-soft` | Quest Pollen marker. |
|
|
277
|
+
| `--polli-color-tier-deep` | Quest Pollen text. |
|
|
165
278
|
|
|
166
279
|
**Intent (theme-independent):**
|
|
167
280
|
|
|
168
|
-
| Token
|
|
169
|
-
|
|
|
170
|
-
| `--polli-color-danger-bg-light`
|
|
171
|
-
| `--polli-color-danger-text`
|
|
172
|
-
| `--polli-color-danger-border`
|
|
173
|
-
| `--polli-color-success-
|
|
174
|
-
| `--polli-color-success-
|
|
175
|
-
| `--polli-color-success-
|
|
176
|
-
| `--polli-color-warning-bg-light`
|
|
177
|
-
| `--polli-color-warning-text`
|
|
178
|
-
| `--polli-color-warning-border` | Warning border. |
|
|
281
|
+
| Token | Purpose |
|
|
282
|
+
| ------------------------------------------ | -------------------------------- |
|
|
283
|
+
| `--polli-color-danger-bg-light` | Error surface background. |
|
|
284
|
+
| `--polli-color-danger-text` | Error text foreground. |
|
|
285
|
+
| `--polli-color-danger-border` | Error border. |
|
|
286
|
+
| `--polli-color-success-text` | Success text foreground. |
|
|
287
|
+
| `--polli-color-success-bright` | Filled success background. |
|
|
288
|
+
| `--polli-color-success-text-on-bright` | Text on filled success surfaces. |
|
|
289
|
+
| `--polli-color-warning-bg-light` | Warning surface background. |
|
|
290
|
+
| `--polli-color-warning-text` | Warning text foreground. |
|
|
179
291
|
|
|
180
292
|
**Example:**
|
|
181
293
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { PropsWithChildren, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
/** Semantic action roles. Label recipes live on Chip. */
|
|
5
|
+
type ButtonIntent = "danger" | "info" | "neutral" | "brand" | "commit" | "surface";
|
|
6
|
+
type ButtonAppearance = "pill" | "raised";
|
|
7
|
+
declare const pillSizes: {
|
|
8
|
+
readonly icon: "polli:h-12 polli:w-12 polli:p-0";
|
|
9
|
+
readonly xs: "polli:h-5 polli:px-1.5 polli:py-0 polli:text-[11px] polli:leading-none";
|
|
10
|
+
readonly sm: "polli:min-h-7 polli:px-2 polli:pt-0.5 polli:pb-1";
|
|
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 polli:text-base";
|
|
13
|
+
};
|
|
14
|
+
type BaseButtonProps = {
|
|
15
|
+
icon?: ReactNode;
|
|
16
|
+
/** Optional semantic recipe; omit for the ambient theme button. */
|
|
17
|
+
intent?: ButtonIntent;
|
|
18
|
+
/** `raised` is the stronger website CTA treatment. */
|
|
19
|
+
appearance?: ButtonAppearance;
|
|
20
|
+
size?: keyof typeof pillSizes;
|
|
21
|
+
className?: string;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
};
|
|
24
|
+
type ButtonProps<T extends React.ElementType = "button"> = PropsWithChildren<BaseButtonProps> & {
|
|
25
|
+
as?: T;
|
|
26
|
+
} & Omit<React.ComponentPropsWithoutRef<T>, keyof BaseButtonProps | "as">;
|
|
27
|
+
declare function Button<T extends React.ElementType = "button">({ as, children, icon, intent, appearance, size, className, disabled, ...buttonProps }: ButtonProps<T>): react_jsx_runtime.JSX.Element;
|
|
28
|
+
|
|
29
|
+
export { type ButtonProps as B, type ButtonAppearance as a, Button as b };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { PropsWithChildren, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
/** Semantic action roles. Label recipes live on Chip. */
|
|
5
|
+
type ButtonIntent = "danger" | "info" | "neutral" | "brand" | "commit" | "surface";
|
|
6
|
+
type ButtonAppearance = "pill" | "raised";
|
|
7
|
+
declare const pillSizes: {
|
|
8
|
+
readonly icon: "polli:h-12 polli:w-12 polli:p-0";
|
|
9
|
+
readonly xs: "polli:h-5 polli:px-1.5 polli:py-0 polli:text-[11px] polli:leading-none";
|
|
10
|
+
readonly sm: "polli:min-h-7 polli:px-2 polli:pt-0.5 polli:pb-1";
|
|
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 polli:text-base";
|
|
13
|
+
};
|
|
14
|
+
type BaseButtonProps = {
|
|
15
|
+
icon?: ReactNode;
|
|
16
|
+
/** Optional semantic recipe; omit for the ambient theme button. */
|
|
17
|
+
intent?: ButtonIntent;
|
|
18
|
+
/** `raised` is the stronger website CTA treatment. */
|
|
19
|
+
appearance?: ButtonAppearance;
|
|
20
|
+
size?: keyof typeof pillSizes;
|
|
21
|
+
className?: string;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
};
|
|
24
|
+
type ButtonProps<T extends React.ElementType = "button"> = PropsWithChildren<BaseButtonProps> & {
|
|
25
|
+
as?: T;
|
|
26
|
+
} & Omit<React.ComponentPropsWithoutRef<T>, keyof BaseButtonProps | "as">;
|
|
27
|
+
declare function Button<T extends React.ElementType = "button">({ as, children, icon, intent, appearance, size, className, disabled, ...buttonProps }: ButtonProps<T>): react_jsx_runtime.JSX.Element;
|
|
28
|
+
|
|
29
|
+
export { type ButtonProps as B, type ButtonAppearance as a, Button as b };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FC, ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
|
|
3
|
+
/** Semantic chip labels for status and metadata badges. */
|
|
4
|
+
type ChipIntent = "news" | "new" | "free" | "alpha" | "neutral" | "success" | "warning" | "info" | "danger";
|
|
5
|
+
declare const chipSizes: {
|
|
6
|
+
readonly icon: "polli:h-5 polli:w-5 polli:p-0 polli:text-xs";
|
|
7
|
+
readonly sm: "polli:h-5 polli:px-2 polli:text-xs";
|
|
8
|
+
readonly md: "polli:h-6 polli:px-2.5 polli:text-sm";
|
|
9
|
+
readonly lg: "polli:h-7 polli:px-3 polli:text-sm";
|
|
10
|
+
};
|
|
11
|
+
type ChipProps = ComponentPropsWithoutRef<"span"> & {
|
|
12
|
+
/** Semantic intent. */
|
|
13
|
+
intent?: ChipIntent;
|
|
14
|
+
size?: keyof typeof chipSizes;
|
|
15
|
+
};
|
|
16
|
+
declare const Chip: FC<ChipProps>;
|
|
17
|
+
|
|
18
|
+
export { Chip as C, type ChipProps as a };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FC, ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
|
|
3
|
+
/** Semantic chip labels for status and metadata badges. */
|
|
4
|
+
type ChipIntent = "news" | "new" | "free" | "alpha" | "neutral" | "success" | "warning" | "info" | "danger";
|
|
5
|
+
declare const chipSizes: {
|
|
6
|
+
readonly icon: "polli:h-5 polli:w-5 polli:p-0 polli:text-xs";
|
|
7
|
+
readonly sm: "polli:h-5 polli:px-2 polli:text-xs";
|
|
8
|
+
readonly md: "polli:h-6 polli:px-2.5 polli:text-sm";
|
|
9
|
+
readonly lg: "polli:h-7 polli:px-3 polli:text-sm";
|
|
10
|
+
};
|
|
11
|
+
type ChipProps = ComponentPropsWithoutRef<"span"> & {
|
|
12
|
+
/** Semantic intent. */
|
|
13
|
+
intent?: ChipIntent;
|
|
14
|
+
size?: keyof typeof chipSizes;
|
|
15
|
+
};
|
|
16
|
+
declare const Chip: FC<ChipProps>;
|
|
17
|
+
|
|
18
|
+
export { Chip as C, type ChipProps as a };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { PropsWithChildren, ComponentPropsWithoutRef, ReactNode, FC } from 'react';
|
|
4
|
+
import { Dialog as Dialog$1 } from '@ark-ui/react/dialog';
|
|
5
|
+
|
|
6
|
+
type ScrollAxis = "y" | "x" | "both";
|
|
7
|
+
type ScrollAreaOwnProps = {
|
|
8
|
+
/** Scroll direction. Default `y`. */
|
|
9
|
+
axis?: ScrollAxis;
|
|
10
|
+
/** Use the system scrollbar instead of the custom auto-hiding track. */
|
|
11
|
+
scrollbar?: "subtle" | "native";
|
|
12
|
+
className?: string;
|
|
13
|
+
};
|
|
14
|
+
type ScrollAreaProps = PropsWithChildren<ScrollAreaOwnProps & Omit<ComponentPropsWithoutRef<"div">, keyof ScrollAreaOwnProps>>;
|
|
15
|
+
/** Scroll container with an optional themed, auto-hiding scrollbar. */
|
|
16
|
+
declare const ScrollArea: react.ForwardRefExoticComponent<ScrollAreaOwnProps & Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof ScrollAreaOwnProps> & {
|
|
17
|
+
children?: react.ReactNode | undefined;
|
|
18
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
|
|
20
|
+
declare const sizeClasses: {
|
|
21
|
+
readonly sm: "polli:max-w-md";
|
|
22
|
+
readonly md: "polli:max-w-xl";
|
|
23
|
+
readonly lg: "polli:max-w-[800px]";
|
|
24
|
+
readonly xl: "polli:max-w-6xl";
|
|
25
|
+
};
|
|
26
|
+
type DialogProps = {
|
|
27
|
+
open: boolean;
|
|
28
|
+
onOpenChange?: (open: boolean) => void;
|
|
29
|
+
trigger?: ReactNode;
|
|
30
|
+
triggerAsChild?: boolean;
|
|
31
|
+
triggerClassName?: string;
|
|
32
|
+
title?: ReactNode;
|
|
33
|
+
ariaLabel?: string;
|
|
34
|
+
labelledBy?: string;
|
|
35
|
+
size?: keyof typeof sizeClasses;
|
|
36
|
+
showBackdrop?: boolean;
|
|
37
|
+
backdropBlur?: boolean;
|
|
38
|
+
positionerClassName?: string;
|
|
39
|
+
contentClassName?: string;
|
|
40
|
+
children: ReactNode;
|
|
41
|
+
};
|
|
42
|
+
declare const Dialog: FC<DialogProps>;
|
|
43
|
+
declare const DialogTitle: react.ForwardRefExoticComponent<Dialog$1.TitleProps & react.RefAttributes<HTMLHeadingElement>>;
|
|
44
|
+
declare const DialogDescription: react.ForwardRefExoticComponent<Dialog$1.DescriptionProps & react.RefAttributes<HTMLDivElement>>;
|
|
45
|
+
type DialogHeaderProps = Omit<ComponentPropsWithoutRef<"div">, "title"> & {
|
|
46
|
+
title?: ReactNode;
|
|
47
|
+
description?: ReactNode;
|
|
48
|
+
inBody?: boolean;
|
|
49
|
+
titleClassName?: string;
|
|
50
|
+
descriptionClassName?: string;
|
|
51
|
+
};
|
|
52
|
+
declare const DialogHeader: FC<DialogHeaderProps>;
|
|
53
|
+
type DialogFooterProps = ComponentPropsWithoutRef<"div">;
|
|
54
|
+
type DialogBodyProps = ScrollAreaProps & {
|
|
55
|
+
actions?: ReactNode;
|
|
56
|
+
footnote?: ReactNode;
|
|
57
|
+
bodyClassName?: string;
|
|
58
|
+
};
|
|
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
|
+
*/
|
|
63
|
+
declare function DialogBody({ children, actions, footnote, bodyClassName, className, ...props }: DialogBodyProps): react_jsx_runtime.JSX.Element;
|
|
64
|
+
declare const DialogFooter: FC<DialogFooterProps>;
|
|
65
|
+
|
|
66
|
+
export { type DialogProps as D, type ScrollAreaProps as S, Dialog as a, DialogBody as b, type DialogBodyProps as c, DialogDescription as d, DialogFooter as e, type DialogFooterProps as f, DialogHeader as g, type DialogHeaderProps as h, DialogTitle as i, ScrollArea as j };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { PropsWithChildren, ComponentPropsWithoutRef, ReactNode, FC } from 'react';
|
|
4
|
+
import { Dialog as Dialog$1 } from '@ark-ui/react/dialog';
|
|
5
|
+
|
|
6
|
+
type ScrollAxis = "y" | "x" | "both";
|
|
7
|
+
type ScrollAreaOwnProps = {
|
|
8
|
+
/** Scroll direction. Default `y`. */
|
|
9
|
+
axis?: ScrollAxis;
|
|
10
|
+
/** Use the system scrollbar instead of the custom auto-hiding track. */
|
|
11
|
+
scrollbar?: "subtle" | "native";
|
|
12
|
+
className?: string;
|
|
13
|
+
};
|
|
14
|
+
type ScrollAreaProps = PropsWithChildren<ScrollAreaOwnProps & Omit<ComponentPropsWithoutRef<"div">, keyof ScrollAreaOwnProps>>;
|
|
15
|
+
/** Scroll container with an optional themed, auto-hiding scrollbar. */
|
|
16
|
+
declare const ScrollArea: react.ForwardRefExoticComponent<ScrollAreaOwnProps & Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof ScrollAreaOwnProps> & {
|
|
17
|
+
children?: react.ReactNode | undefined;
|
|
18
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
|
|
20
|
+
declare const sizeClasses: {
|
|
21
|
+
readonly sm: "polli:max-w-md";
|
|
22
|
+
readonly md: "polli:max-w-xl";
|
|
23
|
+
readonly lg: "polli:max-w-[800px]";
|
|
24
|
+
readonly xl: "polli:max-w-6xl";
|
|
25
|
+
};
|
|
26
|
+
type DialogProps = {
|
|
27
|
+
open: boolean;
|
|
28
|
+
onOpenChange?: (open: boolean) => void;
|
|
29
|
+
trigger?: ReactNode;
|
|
30
|
+
triggerAsChild?: boolean;
|
|
31
|
+
triggerClassName?: string;
|
|
32
|
+
title?: ReactNode;
|
|
33
|
+
ariaLabel?: string;
|
|
34
|
+
labelledBy?: string;
|
|
35
|
+
size?: keyof typeof sizeClasses;
|
|
36
|
+
showBackdrop?: boolean;
|
|
37
|
+
backdropBlur?: boolean;
|
|
38
|
+
positionerClassName?: string;
|
|
39
|
+
contentClassName?: string;
|
|
40
|
+
children: ReactNode;
|
|
41
|
+
};
|
|
42
|
+
declare const Dialog: FC<DialogProps>;
|
|
43
|
+
declare const DialogTitle: react.ForwardRefExoticComponent<Dialog$1.TitleProps & react.RefAttributes<HTMLHeadingElement>>;
|
|
44
|
+
declare const DialogDescription: react.ForwardRefExoticComponent<Dialog$1.DescriptionProps & react.RefAttributes<HTMLDivElement>>;
|
|
45
|
+
type DialogHeaderProps = Omit<ComponentPropsWithoutRef<"div">, "title"> & {
|
|
46
|
+
title?: ReactNode;
|
|
47
|
+
description?: ReactNode;
|
|
48
|
+
inBody?: boolean;
|
|
49
|
+
titleClassName?: string;
|
|
50
|
+
descriptionClassName?: string;
|
|
51
|
+
};
|
|
52
|
+
declare const DialogHeader: FC<DialogHeaderProps>;
|
|
53
|
+
type DialogFooterProps = ComponentPropsWithoutRef<"div">;
|
|
54
|
+
type DialogBodyProps = ScrollAreaProps & {
|
|
55
|
+
actions?: ReactNode;
|
|
56
|
+
footnote?: ReactNode;
|
|
57
|
+
bodyClassName?: string;
|
|
58
|
+
};
|
|
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
|
+
*/
|
|
63
|
+
declare function DialogBody({ children, actions, footnote, bodyClassName, className, ...props }: DialogBodyProps): react_jsx_runtime.JSX.Element;
|
|
64
|
+
declare const DialogFooter: FC<DialogFooterProps>;
|
|
65
|
+
|
|
66
|
+
export { type DialogProps as D, type ScrollAreaProps as S, Dialog as a, DialogBody as b, type DialogBodyProps as c, DialogDescription as d, DialogFooter as e, type DialogFooterProps as f, DialogHeader as g, type DialogHeaderProps as h, DialogTitle as i, ScrollArea as j };
|