@pollinations/ui 0.1.0-alpha.0 → 0.1.0-alpha.3
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 +151 -87
- package/dist/Button-CO3Dpbkj.d.cts +29 -0
- package/dist/Button-CO3Dpbkj.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-yXzIFrDg.d.cts +63 -0
- package/dist/Dialog-yXzIFrDg.d.ts +63 -0
- package/dist/app-user-menu/sdk.cjs +893 -0
- package/dist/app-user-menu/sdk.cjs.map +1 -0
- package/dist/{compositions/app-user.d.cts → app-user-menu/sdk.d.cts} +6 -7
- package/dist/{compositions/app-user.d.ts → app-user-menu/sdk.d.ts} +6 -7
- package/dist/app-user-menu/sdk.js +872 -0
- package/dist/app-user-menu/sdk.js.map +1 -0
- package/dist/app.css +7 -32
- package/dist/auth/index.cjs +1346 -76
- package/dist/auth/index.cjs.map +1 -1
- package/dist/auth/index.d.cts +88 -6
- package/dist/auth/index.d.ts +88 -6
- package/dist/auth/index.js +1343 -75
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/sdk.cjs +78 -60
- package/dist/auth/sdk.cjs.map +1 -1
- package/dist/auth/sdk.d.cts +2 -15
- package/dist/auth/sdk.d.ts +2 -15
- package/dist/auth/sdk.js +77 -57
- package/dist/auth/sdk.js.map +1 -1
- 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 +1 -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 +3 -0
- package/dist/brand/mark-white.png +0 -0
- package/dist/brand/mark-white.svg +3 -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 +658 -0
- package/dist/gen/index.cjs.map +1 -0
- package/dist/gen/index.d.cts +80 -0
- package/dist/gen/index.d.ts +80 -0
- package/dist/gen/index.js +630 -0
- package/dist/gen/index.js.map +1 -0
- package/dist/index.browser.min.js +2 -0
- package/dist/index.browser.min.js.map +1 -0
- package/dist/index.cjs +3847 -1490
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +632 -218
- package/dist/index.d.ts +632 -218
- package/dist/index.js +3744 -1450
- package/dist/index.js.map +1 -1
- package/dist/licenses/Geist-OFL.txt +93 -0
- package/dist/markdown.cjs +821 -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 +792 -0
- package/dist/markdown.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/theme.css +92 -0
- package/dist/wallet/index.cjs +258 -45
- package/dist/wallet/index.cjs.map +1 -1
- package/dist/wallet/index.d.cts +29 -7
- package/dist/wallet/index.d.ts +29 -7
- package/dist/wallet/index.js +257 -45
- package/dist/wallet/index.js.map +1 -1
- package/package.json +104 -102
- package/dist/Button-BvLF_Km2.d.cts +0 -26
- package/dist/Button-DQAZzvyQ.d.ts +0 -26
- package/dist/Chip-C5impfYd.d.ts +0 -20
- package/dist/Chip-SM52sUbZ.d.cts +0 -20
- package/dist/assets/logo-wordmark.svg +0 -1
- package/dist/assets/logo.svg +0 -4
- package/dist/compositions/app-user.cjs +0 -497
- package/dist/compositions/app-user.cjs.map +0 -1
- package/dist/compositions/app-user.js +0 -469
- package/dist/compositions/app-user.js.map +0 -1
- package/dist/modality/index.cjs +0 -86
- package/dist/modality/index.cjs.map +0 -1
- package/dist/modality/index.d.cts +0 -26
- package/dist/modality/index.d.ts +0 -26
- package/dist/modality/index.js +0 -59
- package/dist/modality/index.js.map +0 -1
- package/dist/models/index.cjs +0 -508
- package/dist/models/index.cjs.map +0 -1
- package/dist/models/index.d.cts +0 -22
- package/dist/models/index.d.ts +0 -22
- package/dist/models/index.js +0 -486
- package/dist/models/index.js.map +0 -1
- package/dist/theme-VMRlhqST.d.cts +0 -9
- package/dist/theme-VMRlhqST.d.ts +0 -9
- package/dist/wallet/sdk.cjs +0 -206
- package/dist/wallet/sdk.cjs.map +0 -1
- package/dist/wallet/sdk.d.cts +0 -33
- package/dist/wallet/sdk.d.ts +0 -33
- package/dist/wallet/sdk.js +0 -175
- package/dist/wallet/sdk.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# @pollinations/ui
|
|
2
2
|
|
|
3
|
-
Internal UI primitives for Pollinations apps.
|
|
4
|
-
state from
|
|
5
|
-
core
|
|
3
|
+
Internal UI primitives, compositions, and modules for Pollinations apps.
|
|
4
|
+
SDK-backed subpaths consume auth state from
|
|
5
|
+
[`@pollinations/sdk/react`](../sdk/README.md#react-auth-provider); core
|
|
6
|
+
primitives and display recipes stay SDK-free.
|
|
6
7
|
|
|
7
8
|
## Install
|
|
8
9
|
|
|
@@ -17,62 +18,76 @@ npm install @pollinations/ui
|
|
|
17
18
|
npm install @pollinations/ui@alpha
|
|
18
19
|
```
|
|
19
20
|
|
|
20
|
-
Install `@pollinations/sdk` too when using
|
|
21
|
-
|
|
21
|
+
Install `@pollinations/sdk` too when using the
|
|
22
|
+
`@pollinations/ui/app-user-menu/sdk` subpath.
|
|
22
23
|
|
|
23
24
|
## Usage
|
|
24
25
|
|
|
25
26
|
```tsx
|
|
26
27
|
import "@pollinations/ui/styles.css";
|
|
27
|
-
import { PolliProvider
|
|
28
|
+
import { PolliProvider } from "@pollinations/sdk/react";
|
|
28
29
|
import { Surface } from "@pollinations/ui";
|
|
29
|
-
import {
|
|
30
|
-
LoginButton,
|
|
31
|
-
LogoutButton,
|
|
32
|
-
UserAvatar,
|
|
33
|
-
UserName,
|
|
34
|
-
WhenLoggedIn,
|
|
35
|
-
WhenLoggedOut,
|
|
36
|
-
} from "@pollinations/ui/auth/sdk";
|
|
37
|
-
import {
|
|
38
|
-
Balance,
|
|
39
|
-
KeyBudget,
|
|
40
|
-
KeyExpiry,
|
|
41
|
-
KeyModels,
|
|
42
|
-
KeyPrefix,
|
|
43
|
-
} from "@pollinations/ui/wallet/sdk";
|
|
44
|
-
|
|
45
|
-
function RecentRequests() {
|
|
46
|
-
const { data: usage } = useAccountKeyUsage({ days: 7, limit: 5 });
|
|
47
|
-
return <span>{usage?.usage.length ?? 0} recent requests</span>;
|
|
48
|
-
}
|
|
30
|
+
import { AppUserMenu } from "@pollinations/ui/app-user-menu/sdk";
|
|
49
31
|
|
|
50
32
|
export function App() {
|
|
51
33
|
return (
|
|
52
34
|
<PolliProvider appKey="pk_your_publishable_key" permissions={["profile"]}>
|
|
53
|
-
<Surface
|
|
54
|
-
<
|
|
55
|
-
<LoginButton theme="amber">
|
|
56
|
-
Log in with Pollinations
|
|
57
|
-
</LoginButton>
|
|
58
|
-
</WhenLoggedOut>
|
|
59
|
-
<WhenLoggedIn>
|
|
60
|
-
<UserAvatar size="md" />
|
|
61
|
-
<UserName />
|
|
62
|
-
<Balance />
|
|
63
|
-
<KeyPrefix />
|
|
64
|
-
<KeyBudget />
|
|
65
|
-
<KeyExpiry />
|
|
66
|
-
<KeyModels />
|
|
67
|
-
<RecentRequests />
|
|
68
|
-
<LogoutButton theme="amber">Log out</LogoutButton>
|
|
69
|
-
</WhenLoggedIn>
|
|
35
|
+
<Surface>
|
|
36
|
+
<AppUserMenu />
|
|
70
37
|
</Surface>
|
|
71
38
|
</PolliProvider>
|
|
72
39
|
);
|
|
73
40
|
}
|
|
74
41
|
```
|
|
75
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
|
+
|
|
76
91
|
For Pollinations apps that use unprefixed Tailwind utilities, import the
|
|
77
92
|
package-owned app stylesheet instead:
|
|
78
93
|
|
|
@@ -86,51 +101,96 @@ and generic `polli-ui-root`, `polli-ui-body`, and `polli-ui-shell` classes.
|
|
|
86
101
|
Canonical Pollinations source SVGs are exported from the package:
|
|
87
102
|
|
|
88
103
|
```ts
|
|
89
|
-
import
|
|
90
|
-
import
|
|
104
|
+
import markUrl from "@pollinations/ui/brand/mark.svg";
|
|
105
|
+
import lockupUrl from "@pollinations/ui/brand/lockup-horizontal.svg";
|
|
91
106
|
```
|
|
92
107
|
|
|
93
108
|
The SVG sources use `currentColor`. Apps control the rendered color by inlining
|
|
94
109
|
them or using them as masks. Root-level favicon, PWA icon, and SEO files stay
|
|
95
110
|
app-owned.
|
|
96
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
|
+
|
|
97
128
|
Wallet colors and utilities are bundled into the main stylesheet
|
|
98
129
|
(`@pollinations/ui/styles.css`) — no separate import needed.
|
|
99
130
|
|
|
131
|
+
## Dialog layout
|
|
132
|
+
|
|
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
|
+
|
|
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.
|
|
143
|
+
|
|
100
144
|
## What's exported
|
|
101
145
|
|
|
102
146
|
- `@pollinations/ui` exports SDK-free design primitives, helpers, and
|
|
103
|
-
|
|
104
|
-
- `@pollinations/ui/auth` exports
|
|
147
|
+
compositions. These can be used without Pollinations auth.
|
|
148
|
+
- `@pollinations/ui/auth` exports `PollinationsSignInButton` (official brand
|
|
149
|
+
asset, outlined amber styling, accessible provider label) and `DashboardSignIn`
|
|
150
|
+
(the shared satellite-app sign-in page). Apps supply the sign-in action; these
|
|
151
|
+
components do not issue credentials or choose an authentication method.
|
|
152
|
+
- `@pollinations/ui/auth` also exports SDK-free auth modal pieces:
|
|
105
153
|
`AuthModal`, `AuthModalHeader`, `AuthModalLoading`, `AuthInfoCard`, and
|
|
106
154
|
`ErrorBanner`.
|
|
107
155
|
- `@pollinations/ui/auth/sdk` exports identity/session components that read
|
|
108
156
|
from the surrounding `<PolliProvider>`:
|
|
109
|
-
- **null when not logged in (or before data loads):** `
|
|
110
|
-
`
|
|
157
|
+
- **null when not logged in (or before data loads):** `UserAvatar`,
|
|
158
|
+
`UserName`, `WhenLoggedIn`.
|
|
111
159
|
- **shown only when logged out:** `LoginButton`, `WhenLoggedOut`.
|
|
112
160
|
|
|
113
161
|
These are intentionally bare wrappers around `useAuth*` hooks. They render
|
|
114
|
-
the data and nothing else — no default copy
|
|
115
|
-
|
|
162
|
+
the data and nothing else — no default copy and no default intent. The app
|
|
163
|
+
composes layout, copy, and color.
|
|
116
164
|
- `@pollinations/ui/wallet` exports SDK-free wallet-specific display helpers
|
|
117
|
-
and recipes: `formatPollen`, `PaidChip`, `TierChip`, `
|
|
165
|
+
and recipes: `formatPollen`, `PaidChip`, `TierChip`, `WalletKindIcon`,
|
|
118
166
|
`WalletBalanceCard`, `PAID_BALANCE_CHART_COLOR`, and
|
|
119
167
|
`TIER_BALANCE_CHART_COLOR`.
|
|
120
|
-
- `@pollinations/ui/
|
|
121
|
-
|
|
122
|
-
- `@pollinations/ui/
|
|
123
|
-
|
|
124
|
-
`
|
|
125
|
-
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
`
|
|
129
|
-
|
|
130
|
-
|
|
168
|
+
- `@pollinations/ui/app-user-menu/sdk` exports the SDK-backed app account
|
|
169
|
+
menu module.
|
|
170
|
+
- `@pollinations/ui/gen` exports generation UI modules and modality helpers:
|
|
171
|
+
`ModelSelector`, `ModalityChip`, `ModalityDot`, `ModalityTab`,
|
|
172
|
+
`categoryLabel`, and `getModalityKey`.
|
|
173
|
+
- `@pollinations/ui/markdown` exports `Markdown` and `Prose`, kept off the
|
|
174
|
+
root entry so react-markdown only loads where documents render.
|
|
175
|
+
- `@pollinations/ui/brand/*` exports the canonical brand kit — `mark`,
|
|
176
|
+
`wordmark`, `lockup-horizontal`, `lockup-stacked` (currentColor SVG masters
|
|
177
|
+
plus `-black`/`-white` SVG + PNG), and the `polli/` mascot PNGs.
|
|
178
|
+
- **Design primitives** — `Button`, `ButtonGroup`, `Chip`, `ChevronIcon`,
|
|
179
|
+
`Dialog`, `DialogTitle`, `Dropdown`, `DropdownItem`, `Field`, `Heading`,
|
|
180
|
+
`IconButton`, `InlineLink`, `Input`, `ScrollArea`, `Slider`, `Surface`,
|
|
181
|
+
`Switch`, `TabButton`, `Table`, `TableBody`, `TableCell`, `TableHead`,
|
|
182
|
+
`TableHeaderCell`, `TableRow`, `Text`, `Textarea`, `Tooltip`.
|
|
183
|
+
- **Design compositions** — `Alert`, `CodeBlock`, `Collapsible`,
|
|
184
|
+
`CopyButton`, `EditableCombobox`, `EditableComboboxToken`,
|
|
185
|
+
`ExternalLinkButton`, `FieldStack`, `FileUpload`, `InfoTip`, `LinkCard`,
|
|
186
|
+
`MediaPlaceholder`, `MultiSelect`, `NavItem`, `PeriodPicker`, `Section`,
|
|
187
|
+
`StatCard`.
|
|
188
|
+
`FieldStack` supports label, helper, action, error, and opt-in aligned label
|
|
189
|
+
rows for compact forms.
|
|
190
|
+
`EditableCombobox.startContent` renders content inside a wrapping input shell
|
|
191
|
+
and replaces the standalone chevron trigger.
|
|
131
192
|
- **Helpers** — `cn`, `useScrollLock`, `currentPeriod`,
|
|
132
193
|
`getPeriodBucketKeys`, `periodBucketKeyToDate`.
|
|
133
|
-
- **Theme** — `themes` (runtime array of theme names), `ThemeName` (type).
|
|
134
194
|
|
|
135
195
|
For per-request usage data and other dynamic queries, call the opt-in hooks
|
|
136
196
|
from `@pollinations/sdk/react` (`useAccountKeyUsage`, `useAccountKey`,
|
|
@@ -139,19 +199,24 @@ from `@pollinations/sdk/react` (`useAccountKeyUsage`, `useAccountKey`,
|
|
|
139
199
|
## Source Layout
|
|
140
200
|
|
|
141
201
|
- `src/primitives/*` contains generic, SDK-free building blocks.
|
|
202
|
+
- `src/compositions/*` contains SDK-free recipes that compose primitives.
|
|
142
203
|
- `src/modules/*` contains package-owned recipes with domain assumptions
|
|
143
|
-
such as auth, wallet, and
|
|
204
|
+
such as auth, wallet, app-user-menu, and gen.
|
|
144
205
|
- Public subpath exports (`@pollinations/ui/auth`,
|
|
145
|
-
`@pollinations/ui/
|
|
146
|
-
`@pollinations/ui/
|
|
147
|
-
directly from those
|
|
206
|
+
`@pollinations/ui/wallet`, `@pollinations/ui/gen`,
|
|
207
|
+
`@pollinations/ui/markdown`, `@pollinations/ui/app-user-menu/sdk`) are
|
|
208
|
+
built directly from those source layers.
|
|
148
209
|
|
|
149
210
|
## Theming
|
|
150
211
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
212
|
+
Import `@pollinations/ui/styles.css` once at the app entry. The package uses a
|
|
213
|
+
single app accent by default; primitives read the current cascade through
|
|
214
|
+
`--polli-color-*` variables.
|
|
215
|
+
|
|
216
|
+
Use `data-theme="neutral"` on chrome that should carry no accent, such as a
|
|
217
|
+
global rail. Use `data-theme="accent"` inside a neutral subtree to re-assert
|
|
218
|
+
the app accent for controls. Do not use per-component theme props; compose
|
|
219
|
+
layout and state with primitives instead.
|
|
155
220
|
|
|
156
221
|
## Public design tokens
|
|
157
222
|
|
|
@@ -162,7 +227,7 @@ count as breaking.
|
|
|
162
227
|
Public tokens sit under the `--polli-*` namespace so they do not collide
|
|
163
228
|
with host app tokens.
|
|
164
229
|
|
|
165
|
-
**
|
|
230
|
+
**Accent-aware (resolve against the current accent or neutral scope):**
|
|
166
231
|
|
|
167
232
|
| Token | Purpose |
|
|
168
233
|
| ----------------------------- | --------------------------------------------- |
|
|
@@ -196,23 +261,22 @@ Wallet tokens are public (bundled into `@pollinations/ui/styles.css`):
|
|
|
196
261
|
| `--polli-color-paid-pale` | Paid-balance wash. |
|
|
197
262
|
| `--polli-color-paid-soft` | Paid-balance marker. |
|
|
198
263
|
| `--polli-color-paid-deep` | Paid-balance text. |
|
|
199
|
-
| `--polli-color-tier-pale` |
|
|
200
|
-
| `--polli-color-tier-soft` |
|
|
201
|
-
| `--polli-color-tier-deep` |
|
|
264
|
+
| `--polli-color-tier-pale` | Quest Pollen wash. |
|
|
265
|
+
| `--polli-color-tier-soft` | Quest Pollen marker. |
|
|
266
|
+
| `--polli-color-tier-deep` | Quest Pollen text. |
|
|
202
267
|
|
|
203
268
|
**Intent (theme-independent):**
|
|
204
269
|
|
|
205
|
-
| Token
|
|
206
|
-
|
|
|
207
|
-
| `--polli-color-danger-bg-light`
|
|
208
|
-
| `--polli-color-danger-text`
|
|
209
|
-
| `--polli-color-danger-border`
|
|
210
|
-
| `--polli-color-success-
|
|
211
|
-
| `--polli-color-success-
|
|
212
|
-
| `--polli-color-success-
|
|
213
|
-
| `--polli-color-warning-bg-light`
|
|
214
|
-
| `--polli-color-warning-text`
|
|
215
|
-
| `--polli-color-warning-border` | Warning border. |
|
|
270
|
+
| Token | Purpose |
|
|
271
|
+
| ------------------------------------------ | -------------------------------- |
|
|
272
|
+
| `--polli-color-danger-bg-light` | Error surface background. |
|
|
273
|
+
| `--polli-color-danger-text` | Error text foreground. |
|
|
274
|
+
| `--polli-color-danger-border` | Error border. |
|
|
275
|
+
| `--polli-color-success-text` | Success text foreground. |
|
|
276
|
+
| `--polli-color-success-bright` | Filled success background. |
|
|
277
|
+
| `--polli-color-success-text-on-bright` | Text on filled success surfaces. |
|
|
278
|
+
| `--polli-color-warning-bg-light` | Warning surface background. |
|
|
279
|
+
| `--polli-color-warning-text` | Warning text foreground. |
|
|
216
280
|
|
|
217
281
|
**Example:**
|
|
218
282
|
|
|
@@ -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";
|
|
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";
|
|
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";
|
|
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";
|
|
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,63 @@
|
|
|
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
|
+
/** Full-height scroll area with floating actions and an optional bottom link. */
|
|
60
|
+
declare function DialogBody({ children, actions, footnote, bodyClassName, className, ...props }: DialogBodyProps): react_jsx_runtime.JSX.Element;
|
|
61
|
+
declare const DialogFooter: FC<DialogFooterProps>;
|
|
62
|
+
|
|
63
|
+
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,63 @@
|
|
|
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
|
+
/** Full-height scroll area with floating actions and an optional bottom link. */
|
|
60
|
+
declare function DialogBody({ children, actions, footnote, bodyClassName, className, ...props }: DialogBodyProps): react_jsx_runtime.JSX.Element;
|
|
61
|
+
declare const DialogFooter: FC<DialogFooterProps>;
|
|
62
|
+
|
|
63
|
+
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 };
|