@pollinations/ui 0.1.0-alpha.32 → 0.1.0-alpha.33
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/dist/{chunk-2BI7XJMG.js → chunk-ZQGGDZVD.js} +21 -22
- package/dist/chunk-ZQGGDZVD.js.map +1 -0
- package/dist/index.browser.min.js +1 -1
- package/dist/index.browser.min.js.map +1 -1
- package/dist/index.d.ts +7 -6
- package/dist/index.js +6 -20
- package/dist/index.js.map +1 -1
- package/dist/markdown.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-2BI7XJMG.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -229,20 +229,21 @@ type ContentHeaderProps = {
|
|
|
229
229
|
/** Shared page/section heading rhythm with an optional trailing action. */
|
|
230
230
|
declare function ContentHeader({ eyebrow, title, subtitle, action, variant, className, }: ContentHeaderProps): react_jsx_runtime.JSX.Element;
|
|
231
231
|
|
|
232
|
-
/** The copy state as an icon: a clipboard, then
|
|
233
|
-
|
|
232
|
+
/** The copy state as an icon: a clipboard, then an amber check once copied.
|
|
233
|
+
* The icon is the only thing a copy changes: labels and colours stay put. */
|
|
234
|
+
declare function CopyStateIcon({ copied, className, ...props }: IconProps & {
|
|
234
235
|
copied: boolean;
|
|
235
236
|
}): react_jsx_runtime.JSX.Element;
|
|
236
237
|
type CopyValue = string | (() => string | Promise<string>);
|
|
237
238
|
type CopyButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "className" | "onClick" | "type" | "value"> & {
|
|
238
239
|
value: CopyValue;
|
|
239
240
|
children: ReactNode | ((copied: boolean) => ReactNode);
|
|
240
|
-
|
|
241
|
+
/** Extra hover content, e.g. the full value behind a short label. Copy
|
|
242
|
+
* buttons don't need one to say "copy": the icon does. */
|
|
241
243
|
tooltip?: ReactNode;
|
|
242
244
|
tooltipAlign?: "start" | "center";
|
|
243
245
|
tooltipClampToViewport?: boolean;
|
|
244
246
|
tooltipMaxWidth?: number;
|
|
245
|
-
copiedTooltip?: ReactNode;
|
|
246
247
|
tooltipClassName?: string;
|
|
247
248
|
className?: string | ((copied: boolean) => string);
|
|
248
249
|
variant?: "plain" | "button";
|
|
@@ -251,13 +252,13 @@ type CopyButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"
|
|
|
251
252
|
onCopied?: () => void;
|
|
252
253
|
onCopyError?: (error: unknown) => void;
|
|
253
254
|
};
|
|
254
|
-
declare function CopyButton({ value, children,
|
|
255
|
+
declare function CopyButton({ value, children, tooltip, tooltipAlign, tooltipClampToViewport, tooltipMaxWidth, tooltipClassName, className, variant, intent, onCopied, onCopyError, ...buttonProps }: CopyButtonProps): react_jsx_runtime.JSX.Element;
|
|
255
256
|
|
|
256
257
|
declare const sizeClasses$1: {
|
|
257
258
|
readonly md: "polli:min-h-10 polli:gap-3 polli:rounded-lg polli:border polli:border-divider polli:bg-theme-bg-pale polli:px-3 polli:py-2 polli:text-theme-text-base polli:hover:text-theme-text-strong";
|
|
258
259
|
readonly sm: "polli:min-h-7 polli:gap-2 polli:rounded-[0.875rem] polli:bg-theme-bg-subtle polli:px-3 polli:py-1 polli:text-theme-text-base polli:hover:bg-theme-text-muted/25 polli:hover:text-theme-text-strong";
|
|
259
260
|
};
|
|
260
|
-
type CopyFieldProps = Pick<CopyButtonProps, "value" | "onCopied" | "onCopyError"
|
|
261
|
+
type CopyFieldProps = Pick<CopyButtonProps, "value" | "onCopied" | "onCopyError"> & {
|
|
261
262
|
/** Accessible name, e.g. "Copy secret key". */
|
|
262
263
|
label: string;
|
|
263
264
|
/** What to show; defaults to a string value or the label for lazy values. */
|
package/dist/index.js
CHANGED
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
CopyButton,
|
|
39
39
|
CopyStateIcon,
|
|
40
40
|
Tooltip
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-ZQGGDZVD.js";
|
|
42
42
|
import {
|
|
43
43
|
Heading,
|
|
44
44
|
Text
|
|
@@ -746,7 +746,6 @@ function CopyField({
|
|
|
746
746
|
{
|
|
747
747
|
...copy,
|
|
748
748
|
value,
|
|
749
|
-
tooltip: null,
|
|
750
749
|
"aria-label": label,
|
|
751
750
|
className: cn(
|
|
752
751
|
"polli:flex polli:w-full polli:cursor-pointer polli:items-center polli:text-left polli:font-mono polli:text-xs polli:transition-colors",
|
|
@@ -766,8 +765,7 @@ function CopyField({
|
|
|
766
765
|
),
|
|
767
766
|
children: /* @__PURE__ */ jsx12(CopyStateIcon, { copied })
|
|
768
767
|
}
|
|
769
|
-
)
|
|
770
|
-
/* @__PURE__ */ jsx12("span", { className: "polli:sr-only", "aria-live": "polite", children: copied ? "Copied" : "" })
|
|
768
|
+
)
|
|
771
769
|
] })
|
|
772
770
|
}
|
|
773
771
|
);
|
|
@@ -1534,24 +1532,12 @@ function KeyChip({
|
|
|
1534
1532
|
CopyButton,
|
|
1535
1533
|
{
|
|
1536
1534
|
value,
|
|
1537
|
-
tooltip: null,
|
|
1538
1535
|
"aria-label": label,
|
|
1539
1536
|
className: "polli:inline-flex polli:cursor-pointer polli:rounded-lg",
|
|
1540
|
-
children: (copied) => /* @__PURE__ */ jsxs15(
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
className: cn(
|
|
1545
|
-
chipClassName,
|
|
1546
|
-
"polli:transition-colors",
|
|
1547
|
-
className
|
|
1548
|
-
),
|
|
1549
|
-
children: [
|
|
1550
|
-
/* @__PURE__ */ jsx21(CopyStateIcon, { copied, "aria-hidden": "true" }),
|
|
1551
|
-
copied ? "Copied" : text
|
|
1552
|
-
]
|
|
1553
|
-
}
|
|
1554
|
-
)
|
|
1537
|
+
children: (copied) => /* @__PURE__ */ jsxs15(Chip, { intent: "neutral", className: cn(chipClassName, className), children: [
|
|
1538
|
+
/* @__PURE__ */ jsx21(CopyStateIcon, { copied, "aria-hidden": "true" }),
|
|
1539
|
+
text
|
|
1540
|
+
] })
|
|
1555
1541
|
}
|
|
1556
1542
|
);
|
|
1557
1543
|
}
|