@pollinations/ui 0.1.0-alpha.27 → 0.1.0-alpha.29

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/index.d.ts CHANGED
@@ -5,11 +5,11 @@ import { S as ScrollAreaProps, D as DialogProps } from './Dialog-D3Nqt8cE.js';
5
5
  export { a as Dialog, b as DialogBody, c as DialogBodyProps, d as DialogDescription, e as DialogFooter, f as DialogFooterProps, g as DialogHeader, h as DialogHeaderProps, i as DialogTitle, j as ScrollArea } from './Dialog-D3Nqt8cE.js';
6
6
  import { B as ButtonProps, a as ButtonAppearance } from './Button-BGqClaBr.js';
7
7
  export { b as Button } from './Button-BGqClaBr.js';
8
+ import { I as IconProps } from './types-CCy9JNu9.js';
8
9
  import { D as DiscordIcon, G as GitHubIcon } from './index-efnABLqH.js';
9
10
  export { A as AccountIcon, a as AppIcon, b as ArrowLeftIcon, c as ArrowRightIcon, d as AudioIcon, B as BeakerIcon, e as BookIcon, f as BotIcon, g as BugIcon, C as CardIcon, h as ChatIcon, i as CheckIcon, j as ClipboardIcon, k as ClockIcon, l as CloudUploadIcon, m as CodeIcon, n as CubeIcon, o as DatabaseIcon, p as DownloadIcon, E as EarningsIcon, q as ExpandIcon, r as ExternalLinkIcon, s as EyeIcon, t as EyeOffIcon, u as GenApiIcon, v as GitBranchIcon, w as GitPullRequestIcon, x as GlobeIcon, y as GoogleIcon, z as GraduationCapIcon, I as ImageIcon, F as InstagramIcon, K as KeyIcon, L as LinkedInIcon, H as LockIcon, J as LogInIcon, M as LogOutIcon, N as MailIcon, O as McpIcon, P as MegaphoneIcon, Q as MenuIcon, R as MicIcon, S as MoonIcon, T as NewspaperIcon, U as PauseIcon, V as PencilIcon, W as PlayIcon, X as PlusIcon, Y as PowerIcon, Z as PulseIcon, _ as ReasoningIcon, $ as ReceiptIcon, a0 as RefreshIcon, a1 as RobotIcon, a2 as RocketIcon, a3 as SearchIcon, a4 as ShieldCheckIcon, a5 as SignOutIcon, a6 as SparkleIcon, a7 as SparklesIcon, a8 as SpeakerIcon, a9 as SproutIcon, aa as StarIcon, ab as SunIcon, ac as TargetIcon, ad as TerminalIcon, ae as TokensIcon, af as ToolIcon, ag as TrashIcon, ah as TrendUpIcon, ai as UsageIcon, aj as VideoIcon, ak as WalletIcon, al as WarningIcon, am as XIcon, an as XSocialIcon } from './index-efnABLqH.js';
10
11
  export { C as Chip } from './Chip-v-ADv6cz.js';
11
12
  export { Field } from '@ark-ui/react/field';
12
- import { I as IconProps } from './types-CCy9JNu9.js';
13
13
  import '@ark-ui/react/dialog';
14
14
 
15
15
  type DropdownProps = {
@@ -229,6 +229,10 @@ 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 a check once copied. */
233
+ declare function CopyStateIcon({ copied, ...props }: IconProps & {
234
+ copied: boolean;
235
+ }): react_jsx_runtime.JSX.Element;
232
236
  type CopyValue = string | (() => string | Promise<string>);
233
237
  type CopyButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "className" | "onClick" | "type" | "value"> & {
234
238
  value: CopyValue;
@@ -588,6 +592,9 @@ declare function ToolCallDetails({ name, input, output, error, status, defaultOp
588
592
  /** Class merge for apps consuming the unprefixed Tailwind bridge in app.css. */
589
593
  declare function cn(...inputs: (string | undefined | null | false)[]): string;
590
594
 
595
+ /** A count short enough for a label: 999, 1.2K, 12K, 123K, 1.5M. */
596
+ declare function formatCount(value: number): string;
597
+
591
598
  /**
592
599
  * Locks page scroll while enabled and restores the original overflow values on
593
600
  * cleanup.
@@ -1006,4 +1013,4 @@ type TextOwnProps<T extends ElementType> = PropsWithChildren<{
1006
1013
  type TextProps<T extends ElementType = "p"> = TextOwnProps<T> & Omit<ComponentPropsWithoutRef<T>, keyof TextOwnProps<T>>;
1007
1014
  declare function Text<T extends ElementType = "p">({ as, size, tone, weight, className, children, ...rest }: TextProps<T>): react_jsx_runtime.JSX.Element;
1008
1015
 
1009
- export { AccountIdentity, AccountIdentityLink, type AccountIdentityLinkProps, type AccountIdentityProps, AccountMenu, type AccountMenuProps, Alert, type AlertProps, AppBrand, type AppBrandProps, AppHeader, type AppHeaderProps, BrandMark, type BrandMarkProps, ButtonAppearance, ButtonGroup, type ButtonGroupProps, ButtonProps, Callout, type CalloutProps, ChatConversation, ChatConversationContent, type ChatConversationContentProps, type ChatConversationProps, ChatMessage, ChatMessageActions, type ChatMessageActionsProps, ChatMessageContent, type ChatMessageContentProps, ChatMessageHeader, type ChatMessageHeaderProps, type ChatMessageProps, type ChatMessageRole, ChatPromptInput, ChatPromptInputFooter, type ChatPromptInputFooterProps, type ChatPromptInputProps, ChatPromptTextarea, ChevronIcon, CodeBlock, type CodeBlockProps, Collapsible, type CollapsibleProps, ColorModeToggle, ConfirmationDialog, type ConfirmationDialogProps, ContentHeader, type ContentHeaderProps, CopyButton, type CopyButtonProps, CopyField, type CopyFieldProps, DialogProps, DiscordIcon, Drawer, type DrawerProps, Dropdown, DropdownItem, type DropdownItemProps, type DropdownProps, EditableCombobox, type EditableComboboxProps, EditableComboboxToken, type EditableComboboxTokenProps, EmptyState, type EmptyStateProps, ExternalLinkButton, type ExternalLinkButtonProps, Eyebrow, type EyebrowProps, FieldStack, type FieldStackProps, FileUpload, type FileUploadProps, GitHubIcon, Heading, type HeadingProps, IconButton, type IconButtonIntent, type IconButtonProps, type IconButtonVariant, IconProps, IconTile, type IconTileProps, InfoTip, InlineLink, type InlineLinkProps, Input, type InputProps, KeyChip, type KeyChipProps, LinkCard, type LinkCardProps, LiveDot, LoadingStatus, MediaPlaceholder, type MediaPlaceholderProps, MultiSelect, type MultiSelectProps, NavItem, type NavItemProps, OUTAGE_MESSAGE, OutageNotice, type OutageNoticeProps, type PeriodGranularity, PeriodPicker, type PeriodPickerProps, type PeriodSelection, ScrollAreaProps, Section, type SectionProps, SegmentedControl, type SegmentedControlOption, type SegmentedControlProps, Skeleton, type SkeletonProps, Slider, type SliderProps, SocialCount, type SocialCountProps, StableLabel, type StableLabelProps, StatCard, type StatCardProps, Surface, type SurfaceProps, Switch, type SwitchProps, type SwitchSize, type SwitchStatus, TabButton, type TabButtonProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableDisclosureButton, type TableDisclosureButtonProps, TableHead, type TableHeadProps, TableHeaderCell, type TableHeaderCellProps, type TableProps, TableRow, type TableRowProps, Text, type TextProps, Textarea, type TextareaProps, ToolCallDetails, type ToolCallDetailsProps, type ToolCallStatus, Tooltip, cn, currentPeriod, getPeriodBucketKeys, isPeriodSelectable, periodBucketKeyToDate, periodFromDate, periodToWindow, setColorMode, useColorMode, useOnline, useScrollLock };
1016
+ export { AccountIdentity, AccountIdentityLink, type AccountIdentityLinkProps, type AccountIdentityProps, AccountMenu, type AccountMenuProps, Alert, type AlertProps, AppBrand, type AppBrandProps, AppHeader, type AppHeaderProps, BrandMark, type BrandMarkProps, ButtonAppearance, ButtonGroup, type ButtonGroupProps, ButtonProps, Callout, type CalloutProps, ChatConversation, ChatConversationContent, type ChatConversationContentProps, type ChatConversationProps, ChatMessage, ChatMessageActions, type ChatMessageActionsProps, ChatMessageContent, type ChatMessageContentProps, ChatMessageHeader, type ChatMessageHeaderProps, type ChatMessageProps, type ChatMessageRole, ChatPromptInput, ChatPromptInputFooter, type ChatPromptInputFooterProps, type ChatPromptInputProps, ChatPromptTextarea, ChevronIcon, CodeBlock, type CodeBlockProps, Collapsible, type CollapsibleProps, ColorModeToggle, ConfirmationDialog, type ConfirmationDialogProps, ContentHeader, type ContentHeaderProps, CopyButton, type CopyButtonProps, CopyField, type CopyFieldProps, CopyStateIcon, DialogProps, DiscordIcon, Drawer, type DrawerProps, Dropdown, DropdownItem, type DropdownItemProps, type DropdownProps, EditableCombobox, type EditableComboboxProps, EditableComboboxToken, type EditableComboboxTokenProps, EmptyState, type EmptyStateProps, ExternalLinkButton, type ExternalLinkButtonProps, Eyebrow, type EyebrowProps, FieldStack, type FieldStackProps, FileUpload, type FileUploadProps, GitHubIcon, Heading, type HeadingProps, IconButton, type IconButtonIntent, type IconButtonProps, type IconButtonVariant, IconProps, IconTile, type IconTileProps, InfoTip, InlineLink, type InlineLinkProps, Input, type InputProps, KeyChip, type KeyChipProps, LinkCard, type LinkCardProps, LiveDot, LoadingStatus, MediaPlaceholder, type MediaPlaceholderProps, MultiSelect, type MultiSelectProps, NavItem, type NavItemProps, OUTAGE_MESSAGE, OutageNotice, type OutageNoticeProps, type PeriodGranularity, PeriodPicker, type PeriodPickerProps, type PeriodSelection, ScrollAreaProps, Section, type SectionProps, SegmentedControl, type SegmentedControlOption, type SegmentedControlProps, Skeleton, type SkeletonProps, Slider, type SliderProps, SocialCount, type SocialCountProps, StableLabel, type StableLabelProps, StatCard, type StatCardProps, Surface, type SurfaceProps, Switch, type SwitchProps, type SwitchSize, type SwitchStatus, TabButton, type TabButtonProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableDisclosureButton, type TableDisclosureButtonProps, TableHead, type TableHeadProps, TableHeaderCell, type TableHeaderCellProps, type TableProps, TableRow, type TableRowProps, Text, type TextProps, Textarea, type TextareaProps, ToolCallDetails, type ToolCallDetailsProps, type ToolCallStatus, Tooltip, cn, currentPeriod, formatCount, getPeriodBucketKeys, isPeriodSelectable, periodBucketKeyToDate, periodFromDate, periodToWindow, setColorMode, useColorMode, useOnline, useScrollLock };
package/dist/index.js CHANGED
@@ -36,8 +36,9 @@ import {
36
36
  import {
37
37
  CodeBlock,
38
38
  CopyButton,
39
+ CopyStateIcon,
39
40
  Tooltip
40
- } from "./chunk-5D7HRDJS.js";
41
+ } from "./chunk-2BI7XJMG.js";
41
42
  import {
42
43
  Heading,
43
44
  Text
@@ -754,7 +755,7 @@ function CopyField({
754
755
  {
755
756
  "aria-hidden": "true",
756
757
  className: "polli:flex polli:size-4 polli:shrink-0 polli:[&>svg]:size-full",
757
- children: copied ? /* @__PURE__ */ jsx12(CheckIcon, {}) : /* @__PURE__ */ jsx12(ClipboardIcon, {})
758
+ children: /* @__PURE__ */ jsx12(CopyStateIcon, { copied })
758
759
  }
759
760
  )
760
761
  ] })
@@ -1536,7 +1537,7 @@ function KeyChip({
1536
1537
  className
1537
1538
  ),
1538
1539
  children: [
1539
- copied ? /* @__PURE__ */ jsx21(CheckIcon, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx21(ClipboardIcon, { "aria-hidden": "true" }),
1540
+ /* @__PURE__ */ jsx21(CopyStateIcon, { copied, "aria-hidden": "true" }),
1540
1541
  copied ? "Copied" : text
1541
1542
  ]
1542
1543
  }
@@ -2651,6 +2652,16 @@ function cn2(...inputs) {
2651
2652
  return twMerge(clsx(...inputs));
2652
2653
  }
2653
2654
 
2655
+ // src/lib/format-count.ts
2656
+ var compactCount = new Intl.NumberFormat("en", { notation: "compact" });
2657
+ function formatCount(value) {
2658
+ const abs = Math.abs(value);
2659
+ if (abs < 1e3) return compactCount.format(Math.trunc(value));
2660
+ const unit = 10 ** (3 * Math.floor(Math.log10(abs) / 3));
2661
+ const step = abs / unit < 10 ? unit / 10 : unit;
2662
+ return compactCount.format(Math.trunc(value / step) * step);
2663
+ }
2664
+
2654
2665
  // src/lib/use-scroll-lock.ts
2655
2666
  import { useEffect as useEffect6 } from "react";
2656
2667
  function useScrollLock(enabled = true) {
@@ -3137,6 +3148,7 @@ export {
3137
3148
  ContentHeader,
3138
3149
  CopyButton,
3139
3150
  CopyField,
3151
+ CopyStateIcon,
3140
3152
  CubeIcon,
3141
3153
  DatabaseIcon,
3142
3154
  Dialog,
@@ -3256,6 +3268,7 @@ export {
3256
3268
  XSocialIcon,
3257
3269
  cn2 as cn,
3258
3270
  currentPeriod,
3271
+ formatCount,
3259
3272
  getPeriodBucketKeys,
3260
3273
  isPeriodSelectable,
3261
3274
  periodBucketKeyToDate,