@pollinations/ui 0.1.0-alpha.24 → 0.1.0-alpha.26

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.js CHANGED
@@ -1836,7 +1836,7 @@ var MultiSelect = ({
1836
1836
  import { jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
1837
1837
  var base = "polli-control polli:flex polli:items-center polli:gap-2 polli:rounded-full polli:px-3 polli:py-2 polli:text-left polli:text-sm polli:font-medium polli:whitespace-nowrap polli:transition-colors";
1838
1838
  var activeClasses = "polli:bg-theme-bg-active polli:text-theme-text-strong";
1839
- var inactiveClasses = "polli:text-ink-800 polli:hover:bg-surface-opaque/60 polli:hover:text-ink-950";
1839
+ var inactiveClasses = "polli:text-ink-800 polli:hover:bg-theme-bg-active/40";
1840
1840
  function NavItem({
1841
1841
  as,
1842
1842
  active = false,
@@ -1864,8 +1864,87 @@ function NavItem({
1864
1864
  );
1865
1865
  }
1866
1866
 
1867
+ // src/compositions/OutageNotice.tsx
1868
+ import {
1869
+ useEffect as useEffect4,
1870
+ useLayoutEffect,
1871
+ useRef as useRef3,
1872
+ useSyncExternalStore
1873
+ } from "react";
1874
+ import { Fragment as Fragment6, jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
1875
+ var OUTAGE_MESSAGE = "Pollinations is having a temporary outage. Some services are down for now. Your account, keys and pollen are safe, and nothing is lost.";
1876
+ function subscribeOnline(listener) {
1877
+ window.addEventListener("online", listener);
1878
+ window.addEventListener("offline", listener);
1879
+ return () => {
1880
+ window.removeEventListener("online", listener);
1881
+ window.removeEventListener("offline", listener);
1882
+ };
1883
+ }
1884
+ function useOnline() {
1885
+ return useSyncExternalStore(
1886
+ subscribeOnline,
1887
+ () => navigator.onLine,
1888
+ () => true
1889
+ );
1890
+ }
1891
+ var notices = /* @__PURE__ */ new Set();
1892
+ var listeners = /* @__PURE__ */ new Set();
1893
+ var useIsomorphicLayoutEffect = typeof window === "undefined" ? useEffect4 : useLayoutEffect;
1894
+ function subscribeNotices(listener) {
1895
+ listeners.add(listener);
1896
+ return () => listeners.delete(listener);
1897
+ }
1898
+ function topNotice() {
1899
+ let top;
1900
+ for (const notice of notices) {
1901
+ if (!top || top.compareDocumentPosition(notice) & Node.DOCUMENT_POSITION_PRECEDING) {
1902
+ top = notice;
1903
+ }
1904
+ }
1905
+ return top;
1906
+ }
1907
+ var OutageNotice = ({
1908
+ retrying = false,
1909
+ statusUrl,
1910
+ className
1911
+ }) => {
1912
+ const online = useOnline();
1913
+ const ref = useRef3(null);
1914
+ useIsomorphicLayoutEffect(() => {
1915
+ const notice = ref.current;
1916
+ if (!notice) return;
1917
+ notices.add(notice);
1918
+ for (const listener of listeners) listener();
1919
+ return () => {
1920
+ notices.delete(notice);
1921
+ for (const listener of listeners) listener();
1922
+ };
1923
+ }, []);
1924
+ const isTop = useSyncExternalStore(
1925
+ subscribeNotices,
1926
+ () => !ref.current || topNotice() === ref.current,
1927
+ () => true
1928
+ );
1929
+ let message;
1930
+ if (!isTop) {
1931
+ message = online ? "Unavailable during the outage." : "Unavailable while you\u2019re offline.";
1932
+ } else if (!online) {
1933
+ message = `You\u2019re offline.${retrying ? " This page retries when your connection is back." : ""}`;
1934
+ } else {
1935
+ message = `${OUTAGE_MESSAGE}${retrying ? " Retrying automatically." : ""}`;
1936
+ }
1937
+ return /* @__PURE__ */ jsx26("div", { ref, className, children: /* @__PURE__ */ jsxs20(Alert, { intent: "advisory", children: [
1938
+ message,
1939
+ isTop && online && statusUrl && /* @__PURE__ */ jsxs20(Fragment6, { children: [
1940
+ " ",
1941
+ /* @__PURE__ */ jsx26(InlineLink, { href: statusUrl, children: "Status page" })
1942
+ ] })
1943
+ ] }) });
1944
+ };
1945
+
1867
1946
  // src/compositions/PeriodPicker.tsx
1868
- import { useEffect as useEffect4, useMemo as useMemo2, useRef as useRef3, useState as useState3 } from "react";
1947
+ import { useEffect as useEffect5, useMemo as useMemo2, useRef as useRef4, useState as useState3 } from "react";
1869
1948
 
1870
1949
  // src/lib/period.ts
1871
1950
  var MS_PER_DAY = 864e5;
@@ -1973,7 +2052,7 @@ function isPeriodSelectable(selection, minDate = /* @__PURE__ */ new Date(0), ma
1973
2052
  }
1974
2053
 
1975
2054
  // src/compositions/PeriodPicker.tsx
1976
- import { Fragment as Fragment6, jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
2055
+ import { Fragment as Fragment7, jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
1977
2056
  var WEEKDAY_LABELS = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
1978
2057
  var MONTH_LABELS = [
1979
2058
  "Jan",
@@ -2066,9 +2145,9 @@ var PeriodPicker = ({
2066
2145
  const [open, setOpen] = useState3(false);
2067
2146
  const [viewDate, setViewDate] = useState3(() => periodDate(value));
2068
2147
  const [anchorDate, setAnchorDate] = useState3(() => periodDate(value));
2069
- const emittedSelectionRef = useRef3(null);
2148
+ const emittedSelectionRef = useRef4(null);
2070
2149
  const { granularity, period } = value;
2071
- useEffect4(() => {
2150
+ useEffect5(() => {
2072
2151
  const currentSelectionKey = selectionKey({ granularity, period });
2073
2152
  if (emittedSelectionRef.current === currentSelectionKey) {
2074
2153
  emittedSelectionRef.current = null;
@@ -2102,13 +2181,13 @@ var PeriodPicker = ({
2102
2181
  setOpen(false);
2103
2182
  };
2104
2183
  const viewLabel = value.granularity === "month" ? String(viewDate.getUTCFullYear()) : formatMonthYear(viewDate, "long");
2105
- return /* @__PURE__ */ jsxs20(
2184
+ return /* @__PURE__ */ jsxs21(
2106
2185
  "div",
2107
2186
  {
2108
2187
  className: trigger ? "polli:contents" : "polli:flex polli:w-full polli:flex-wrap polli:items-center polli:gap-2",
2109
2188
  children: [
2110
- !trigger && /* @__PURE__ */ jsx26("div", { className: "polli:flex polli:flex-wrap polli:gap-1.5", children: ["day", "week", "month"].map(
2111
- (granularity2) => /* @__PURE__ */ jsx26(
2189
+ !trigger && /* @__PURE__ */ jsx27("div", { className: "polli:flex polli:flex-wrap polli:gap-1.5", children: ["day", "week", "month"].map(
2190
+ (granularity2) => /* @__PURE__ */ jsx27(
2112
2191
  TabButton,
2113
2192
  {
2114
2193
  active: value.granularity === granularity2,
@@ -2118,13 +2197,13 @@ var PeriodPicker = ({
2118
2197
  granularity2
2119
2198
  )
2120
2199
  ) }),
2121
- /* @__PURE__ */ jsxs20(
2200
+ /* @__PURE__ */ jsxs21(
2122
2201
  Dropdown,
2123
2202
  {
2124
2203
  open,
2125
2204
  onOpenChange: setOpen,
2126
2205
  className: "polli:w-[320px] polli:max-w-[calc(100vw-2rem)] polli:rounded-xl polli:border polli:border-divider polli:bg-surface-opaque polli:p-3.5 polli:shadow-lg",
2127
- trigger: trigger ?? ((isOpen) => /* @__PURE__ */ jsxs20(
2206
+ trigger: trigger ?? ((isOpen) => /* @__PURE__ */ jsxs21(
2128
2207
  "button",
2129
2208
  {
2130
2209
  type: "button",
@@ -2136,15 +2215,15 @@ var PeriodPicker = ({
2136
2215
  isOpen && "polli:bg-theme-bg-hover polli:text-theme-text-strong"
2137
2216
  ),
2138
2217
  children: [
2139
- /* @__PURE__ */ jsx26("span", { className: "polli:truncate", children: summaryLabel }),
2140
- /* @__PURE__ */ jsx26(ChevronIcon, { expanded: isOpen })
2218
+ /* @__PURE__ */ jsx27("span", { className: "polli:truncate", children: summaryLabel }),
2219
+ /* @__PURE__ */ jsx27(ChevronIcon, { expanded: isOpen })
2141
2220
  ]
2142
2221
  }
2143
2222
  )),
2144
2223
  children: [
2145
2224
  header,
2146
- /* @__PURE__ */ jsxs20("div", { className: "polli:mb-3 polli:flex polli:items-center polli:justify-between", children: [
2147
- /* @__PURE__ */ jsx26(
2225
+ /* @__PURE__ */ jsxs21("div", { className: "polli:mb-3 polli:flex polli:items-center polli:justify-between", children: [
2226
+ /* @__PURE__ */ jsx27(
2148
2227
  "button",
2149
2228
  {
2150
2229
  type: "button",
@@ -2158,8 +2237,8 @@ var PeriodPicker = ({
2158
2237
  children: "<"
2159
2238
  }
2160
2239
  ),
2161
- /* @__PURE__ */ jsx26("div", { className: "polli:text-base polli:font-bold polli:text-theme-text-base", children: viewLabel }),
2162
- /* @__PURE__ */ jsx26(
2240
+ /* @__PURE__ */ jsx27("div", { className: "polli:text-base polli:font-bold polli:text-theme-text-base", children: viewLabel }),
2241
+ /* @__PURE__ */ jsx27(
2163
2242
  "button",
2164
2243
  {
2165
2244
  type: "button",
@@ -2174,7 +2253,7 @@ var PeriodPicker = ({
2174
2253
  }
2175
2254
  )
2176
2255
  ] }),
2177
- value.granularity === "month" ? /* @__PURE__ */ jsx26("div", { className: "polli:grid polli:grid-cols-3 polli:gap-1.5", children: MONTH_LABELS.map((label, monthIndex) => {
2256
+ value.granularity === "month" ? /* @__PURE__ */ jsx27("div", { className: "polli:grid polli:grid-cols-3 polli:gap-1.5", children: MONTH_LABELS.map((label, monthIndex) => {
2178
2257
  const date = new Date(
2179
2258
  Date.UTC(
2180
2259
  viewDate.getUTCFullYear(),
@@ -2193,7 +2272,7 @@ var PeriodPicker = ({
2193
2272
  year: "numeric"
2194
2273
  });
2195
2274
  const selected = date.getUTCFullYear() === selectedWindow.start.getUTCFullYear() && date.getUTCMonth() === selectedWindow.start.getUTCMonth();
2196
- return /* @__PURE__ */ jsx26(
2275
+ return /* @__PURE__ */ jsx27(
2197
2276
  "button",
2198
2277
  {
2199
2278
  type: "button",
@@ -2210,9 +2289,9 @@ var PeriodPicker = ({
2210
2289
  },
2211
2290
  label
2212
2291
  );
2213
- }) }) : /* @__PURE__ */ jsxs20(Fragment6, { children: [
2214
- /* @__PURE__ */ jsx26("div", { className: "polli:mb-1 polli:grid polli:grid-cols-7 polli:gap-1 polli:text-center polli:text-xs polli:font-bold polli:uppercase polli:text-theme-text-muted", children: WEEKDAY_LABELS.map((label) => /* @__PURE__ */ jsx26("div", { children: label }, label)) }),
2215
- /* @__PURE__ */ jsx26("div", { className: "polli:grid polli:grid-cols-7 polli:gap-1", children: dates.map((date) => {
2292
+ }) }) : /* @__PURE__ */ jsxs21(Fragment7, { children: [
2293
+ /* @__PURE__ */ jsx27("div", { className: "polli:mb-1 polli:grid polli:grid-cols-7 polli:gap-1 polli:text-center polli:text-xs polli:font-bold polli:uppercase polli:text-theme-text-muted", children: WEEKDAY_LABELS.map((label) => /* @__PURE__ */ jsx27("div", { children: label }, label)) }),
2294
+ /* @__PURE__ */ jsx27("div", { className: "polli:grid polli:grid-cols-7 polli:gap-1", children: dates.map((date) => {
2216
2295
  const inCurrentMonth = date.getUTCMonth() === viewDate.getUTCMonth();
2217
2296
  const selectable = isPeriodSelectable(
2218
2297
  periodFromDate(value.granularity, date),
@@ -2230,7 +2309,7 @@ var PeriodPicker = ({
2230
2309
  }
2231
2310
  )}`;
2232
2311
  const selected = value.granularity === "day" ? sameUtcDay(date, selectedWindow.start) : date >= selectedWindow.start && date < selectedWindow.end;
2233
- return /* @__PURE__ */ jsx26(
2312
+ return /* @__PURE__ */ jsx27(
2234
2313
  "button",
2235
2314
  {
2236
2315
  type: "button",
@@ -2260,7 +2339,7 @@ var PeriodPicker = ({
2260
2339
  };
2261
2340
 
2262
2341
  // src/compositions/Section.tsx
2263
- import { Fragment as Fragment7, jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
2342
+ import { Fragment as Fragment8, jsx as jsx28, jsxs as jsxs22 } from "react/jsx-runtime";
2264
2343
  var Section = ({
2265
2344
  title,
2266
2345
  id,
@@ -2273,13 +2352,13 @@ var Section = ({
2273
2352
  children,
2274
2353
  className
2275
2354
  }) => {
2276
- const body = /* @__PURE__ */ jsxs21(Fragment7, { children: [
2277
- intro && /* @__PURE__ */ jsx27(Text, { as: "div", className: "polli:max-w-2xl", children: intro }),
2355
+ const body = /* @__PURE__ */ jsxs22(Fragment8, { children: [
2356
+ intro && /* @__PURE__ */ jsx28(Text, { as: "div", className: "polli:max-w-2xl", children: intro }),
2278
2357
  children
2279
2358
  ] });
2280
- const content = /* @__PURE__ */ jsxs21(Fragment7, { children: [
2281
- /* @__PURE__ */ jsxs21("header", { className: "polli:flex polli:flex-wrap polli:items-center polli:justify-between polli:gap-3", children: [
2282
- /* @__PURE__ */ jsx27(
2359
+ const content = /* @__PURE__ */ jsxs22(Fragment8, { children: [
2360
+ /* @__PURE__ */ jsxs22("header", { className: "polli:flex polli:flex-wrap polli:items-center polli:justify-between polli:gap-3", children: [
2361
+ /* @__PURE__ */ jsx28(
2283
2362
  Heading,
2284
2363
  {
2285
2364
  as: "h2",
@@ -2288,11 +2367,11 @@ var Section = ({
2288
2367
  children: title
2289
2368
  }
2290
2369
  ),
2291
- action && /* @__PURE__ */ jsx27("div", { className: cn("polli:shrink-0", actionClassName), children: action })
2370
+ action && /* @__PURE__ */ jsx28("div", { className: cn("polli:shrink-0", actionClassName), children: action })
2292
2371
  ] }),
2293
2372
  body
2294
2373
  ] });
2295
- return /* @__PURE__ */ jsx27("section", { id, className: cn("polli:scroll-mt-10", className), children: framed ? /* @__PURE__ */ jsx27(
2374
+ return /* @__PURE__ */ jsx28("section", { id, className: cn("polli:scroll-mt-10", className), children: framed ? /* @__PURE__ */ jsx28(
2296
2375
  Surface,
2297
2376
  {
2298
2377
  variant: "panel",
@@ -2302,11 +2381,11 @@ var Section = ({
2302
2381
  ),
2303
2382
  children: content
2304
2383
  }
2305
- ) : /* @__PURE__ */ jsx27("div", { className: "polli:flex polli:flex-col polli:gap-4", children: content }) });
2384
+ ) : /* @__PURE__ */ jsx28("div", { className: "polli:flex polli:flex-col polli:gap-4", children: content }) });
2306
2385
  };
2307
2386
 
2308
2387
  // src/compositions/SocialCount.tsx
2309
- import { jsx as jsx28, jsxs as jsxs22 } from "react/jsx-runtime";
2388
+ import { jsx as jsx29, jsxs as jsxs23 } from "react/jsx-runtime";
2310
2389
  var networks = {
2311
2390
  discord: {
2312
2391
  Icon: DiscordIcon,
@@ -2327,7 +2406,7 @@ function SocialCount({
2327
2406
  }) {
2328
2407
  const Component = as || "a";
2329
2408
  const { Icon, className: colours } = networks[network];
2330
- return /* @__PURE__ */ jsxs22(
2409
+ return /* @__PURE__ */ jsxs23(
2331
2410
  Component,
2332
2411
  {
2333
2412
  ...rest,
@@ -2337,7 +2416,7 @@ function SocialCount({
2337
2416
  className
2338
2417
  ),
2339
2418
  children: [
2340
- showIcon ? /* @__PURE__ */ jsx28(
2419
+ showIcon ? /* @__PURE__ */ jsx29(
2341
2420
  Icon,
2342
2421
  {
2343
2422
  "aria-hidden": "true",
@@ -2351,7 +2430,7 @@ function SocialCount({
2351
2430
  }
2352
2431
 
2353
2432
  // src/compositions/StatCard.tsx
2354
- import { jsx as jsx29, jsxs as jsxs23 } from "react/jsx-runtime";
2433
+ import { jsx as jsx30, jsxs as jsxs24 } from "react/jsx-runtime";
2355
2434
  var valueVariantClasses = {
2356
2435
  stat: "polli:min-h-8 polli:text-2xl polli:font-bold polli:leading-tight polli:tabular-nums polli:text-theme-text-base",
2357
2436
  fact: "polli:text-sm polli:leading-6 polli:text-theme-text-soft",
@@ -2366,9 +2445,9 @@ var StatCard = ({
2366
2445
  labelClassName,
2367
2446
  valueClassName,
2368
2447
  detailClassName
2369
- }) => variant === "display" ? /* @__PURE__ */ jsxs23("div", { className: cn("polli:flex polli:flex-col polli:gap-1", className), children: [
2370
- /* @__PURE__ */ jsx29("div", { className: cn(valueVariantClasses.display, valueClassName), children: value }),
2371
- /* @__PURE__ */ jsx29(
2448
+ }) => variant === "display" ? /* @__PURE__ */ jsxs24("div", { className: cn("polli:flex polli:flex-col polli:gap-1", className), children: [
2449
+ /* @__PURE__ */ jsx30("div", { className: cn(valueVariantClasses.display, valueClassName), children: value }),
2450
+ /* @__PURE__ */ jsx30(
2372
2451
  Text,
2373
2452
  {
2374
2453
  as: "div",
@@ -2381,8 +2460,8 @@ var StatCard = ({
2381
2460
  children: label
2382
2461
  }
2383
2462
  )
2384
- ] }) : /* @__PURE__ */ jsxs23("div", { className: cn("polli:text-sm", className), children: [
2385
- /* @__PURE__ */ jsx29(
2463
+ ] }) : /* @__PURE__ */ jsxs24("div", { className: cn("polli:text-sm", className), children: [
2464
+ /* @__PURE__ */ jsx30(
2386
2465
  Text,
2387
2466
  {
2388
2467
  as: "div",
@@ -2396,7 +2475,7 @@ var StatCard = ({
2396
2475
  children: label
2397
2476
  }
2398
2477
  ),
2399
- /* @__PURE__ */ jsx29(
2478
+ /* @__PURE__ */ jsx30(
2400
2479
  "div",
2401
2480
  {
2402
2481
  className: cn(
@@ -2407,7 +2486,7 @@ var StatCard = ({
2407
2486
  children: value
2408
2487
  }
2409
2488
  ),
2410
- detail && /* @__PURE__ */ jsx29(
2489
+ detail && /* @__PURE__ */ jsx30(
2411
2490
  Text,
2412
2491
  {
2413
2492
  as: "div",
@@ -2420,8 +2499,8 @@ var StatCard = ({
2420
2499
  ] });
2421
2500
 
2422
2501
  // src/compositions/ToolCallDetails.tsx
2423
- import { Fragment as Fragment8, useState as useState4 } from "react";
2424
- import { jsx as jsx30, jsxs as jsxs24 } from "react/jsx-runtime";
2502
+ import { Fragment as Fragment9, useState as useState4 } from "react";
2503
+ import { jsx as jsx31, jsxs as jsxs25 } from "react/jsx-runtime";
2425
2504
  function formattedValue(value) {
2426
2505
  if (typeof value === "string") return value;
2427
2506
  try {
@@ -2445,8 +2524,8 @@ function linkedValue(value) {
2445
2524
  if (href.endsWith(")")) extraClosingParens--;
2446
2525
  href = href.slice(0, -1);
2447
2526
  }
2448
- return /* @__PURE__ */ jsxs24(Fragment8, { children: [
2449
- /* @__PURE__ */ jsx30(InlineLink, { href, children: href }),
2527
+ return /* @__PURE__ */ jsxs25(Fragment9, { children: [
2528
+ /* @__PURE__ */ jsx31(InlineLink, { href, children: href }),
2450
2529
  segment.slice(href.length)
2451
2530
  ] }, key);
2452
2531
  });
@@ -2455,7 +2534,7 @@ function ToolValue({
2455
2534
  value,
2456
2535
  error = false
2457
2536
  }) {
2458
- return /* @__PURE__ */ jsx30(
2537
+ return /* @__PURE__ */ jsx31(
2459
2538
  "pre",
2460
2539
  {
2461
2540
  className: cn(
@@ -2476,7 +2555,7 @@ var STATUS_LABELS = {
2476
2555
  denied: "Denied"
2477
2556
  };
2478
2557
  function ToolStatus({ status }) {
2479
- const icon = status === "complete" || status === "approval-responded" ? /* @__PURE__ */ jsx30(CheckIcon, { className: "polli:size-3" }) : status === "error" || status === "denied" ? /* @__PURE__ */ jsx30(XIcon, { className: "polli:size-3" }) : /* @__PURE__ */ jsx30(
2558
+ const icon = status === "complete" || status === "approval-responded" ? /* @__PURE__ */ jsx31(CheckIcon, { className: "polli:size-3" }) : status === "error" || status === "denied" ? /* @__PURE__ */ jsx31(XIcon, { className: "polli:size-3" }) : /* @__PURE__ */ jsx31(
2480
2559
  ClockIcon,
2481
2560
  {
2482
2561
  className: cn(
@@ -2485,7 +2564,7 @@ function ToolStatus({ status }) {
2485
2564
  )
2486
2565
  }
2487
2566
  );
2488
- return /* @__PURE__ */ jsxs24(
2567
+ return /* @__PURE__ */ jsxs25(
2489
2568
  "span",
2490
2569
  {
2491
2570
  "data-status": status,
@@ -2511,7 +2590,7 @@ function ToolCallDetails({
2511
2590
  }) {
2512
2591
  const result = error === void 0 ? output : error;
2513
2592
  const [open, setOpen] = useState4(defaultOpen);
2514
- return /* @__PURE__ */ jsxs24(
2593
+ return /* @__PURE__ */ jsxs25(
2515
2594
  "div",
2516
2595
  {
2517
2596
  "data-tool-status": status,
@@ -2520,7 +2599,7 @@ function ToolCallDetails({
2520
2599
  className
2521
2600
  ),
2522
2601
  children: [
2523
- /* @__PURE__ */ jsxs24(
2602
+ /* @__PURE__ */ jsxs25(
2524
2603
  "button",
2525
2604
  {
2526
2605
  type: "button",
@@ -2528,10 +2607,10 @@ function ToolCallDetails({
2528
2607
  onClick: () => setOpen((current) => !current),
2529
2608
  className: "polli-control polli:flex polli:w-full polli:cursor-pointer polli:items-center polli:gap-2 polli:px-3 polli:py-2.5 polli:text-left polli:hover:bg-theme-bg-hover/50",
2530
2609
  children: [
2531
- /* @__PURE__ */ jsx30("span", { className: "polli:flex polli:size-7 polli:shrink-0 polli:items-center polli:justify-center polli:rounded-lg polli:bg-theme-bg-active polli:text-theme-text-strong", children: /* @__PURE__ */ jsx30(ToolIcon, { className: "polli:size-3.5" }) }),
2532
- /* @__PURE__ */ jsx30("code", { className: "polli:min-w-0 polli:truncate polli:text-xs polli:font-semibold polli:text-theme-text-strong", children: name }),
2533
- /* @__PURE__ */ jsx30(ToolStatus, { status }),
2534
- /* @__PURE__ */ jsx30(
2610
+ /* @__PURE__ */ jsx31("span", { className: "polli:flex polli:size-7 polli:shrink-0 polli:items-center polli:justify-center polli:rounded-lg polli:bg-theme-bg-active polli:text-theme-text-strong", children: /* @__PURE__ */ jsx31(ToolIcon, { className: "polli:size-3.5" }) }),
2611
+ /* @__PURE__ */ jsx31("code", { className: "polli:min-w-0 polli:truncate polli:text-xs polli:font-semibold polli:text-theme-text-strong", children: name }),
2612
+ /* @__PURE__ */ jsx31(ToolStatus, { status }),
2613
+ /* @__PURE__ */ jsx31(
2535
2614
  ChevronIcon,
2536
2615
  {
2537
2616
  expanded: open,
@@ -2541,14 +2620,14 @@ function ToolCallDetails({
2541
2620
  ]
2542
2621
  }
2543
2622
  ),
2544
- open && /* @__PURE__ */ jsxs24("div", { className: "polli:flex polli:flex-col polli:gap-4 polli:border-theme-border/30 polli:border-t polli:bg-theme-bg-pale/35 polli:px-3 polli:py-3", children: [
2545
- input !== void 0 && /* @__PURE__ */ jsxs24("div", { className: "polli:flex polli:flex-col polli:gap-1", children: [
2546
- /* @__PURE__ */ jsx30(Text, { size: "xs", tone: "muted", weight: "bold", children: "Parameters" }),
2547
- /* @__PURE__ */ jsx30(ToolValue, { value: input })
2623
+ open && /* @__PURE__ */ jsxs25("div", { className: "polli:flex polli:flex-col polli:gap-4 polli:border-theme-border/30 polli:border-t polli:bg-theme-bg-pale/35 polli:px-3 polli:py-3", children: [
2624
+ input !== void 0 && /* @__PURE__ */ jsxs25("div", { className: "polli:flex polli:flex-col polli:gap-1", children: [
2625
+ /* @__PURE__ */ jsx31(Text, { size: "xs", tone: "muted", weight: "bold", children: "Parameters" }),
2626
+ /* @__PURE__ */ jsx31(ToolValue, { value: input })
2548
2627
  ] }),
2549
- result !== void 0 && /* @__PURE__ */ jsxs24("div", { className: "polli:flex polli:flex-col polli:gap-1", children: [
2550
- /* @__PURE__ */ jsx30(Text, { size: "xs", tone: "muted", weight: "bold", children: error === void 0 ? "Result" : "Error" }),
2551
- /* @__PURE__ */ jsx30(
2628
+ result !== void 0 && /* @__PURE__ */ jsxs25("div", { className: "polli:flex polli:flex-col polli:gap-1", children: [
2629
+ /* @__PURE__ */ jsx31(Text, { size: "xs", tone: "muted", weight: "bold", children: error === void 0 ? "Result" : "Error" }),
2630
+ /* @__PURE__ */ jsx31(
2552
2631
  ToolValue,
2553
2632
  {
2554
2633
  value: result,
@@ -2573,9 +2652,9 @@ function cn2(...inputs) {
2573
2652
  }
2574
2653
 
2575
2654
  // src/lib/use-scroll-lock.ts
2576
- import { useEffect as useEffect5 } from "react";
2655
+ import { useEffect as useEffect6 } from "react";
2577
2656
  function useScrollLock(enabled = true) {
2578
- useEffect5(() => {
2657
+ useEffect6(() => {
2579
2658
  if (!enabled) return;
2580
2659
  const originalBody = document.body.style.overflow;
2581
2660
  const originalHtml = document.documentElement.style.overflow;
@@ -2589,13 +2668,13 @@ function useScrollLock(enabled = true) {
2589
2668
  }
2590
2669
 
2591
2670
  // src/primitives/ButtonGroup.tsx
2592
- import { jsx as jsx31 } from "react/jsx-runtime";
2671
+ import { jsx as jsx32 } from "react/jsx-runtime";
2593
2672
  var ButtonGroup = ({
2594
2673
  className,
2595
2674
  children,
2596
2675
  role = "group",
2597
2676
  ...rest
2598
- }) => /* @__PURE__ */ jsx31(
2677
+ }) => /* @__PURE__ */ jsx32(
2599
2678
  "div",
2600
2679
  {
2601
2680
  ...rest,
@@ -2611,8 +2690,8 @@ var ButtonGroup = ({
2611
2690
  // src/primitives/Drawer.tsx
2612
2691
  import { Dialog as ArkDialog } from "@ark-ui/react/dialog";
2613
2692
  import { Portal } from "@ark-ui/react/portal";
2614
- import { useRef as useRef4 } from "react";
2615
- import { jsx as jsx32, jsxs as jsxs25 } from "react/jsx-runtime";
2693
+ import { useRef as useRef5 } from "react";
2694
+ import { jsx as jsx33, jsxs as jsxs26 } from "react/jsx-runtime";
2616
2695
  var Drawer = ({
2617
2696
  open,
2618
2697
  onOpenChange,
@@ -2621,16 +2700,16 @@ var Drawer = ({
2621
2700
  side = "left",
2622
2701
  contentClassName
2623
2702
  }) => {
2624
- const contentRef = useRef4(null);
2625
- return /* @__PURE__ */ jsx32(
2703
+ const contentRef = useRef5(null);
2704
+ return /* @__PURE__ */ jsx33(
2626
2705
  ArkDialog.Root,
2627
2706
  {
2628
2707
  open,
2629
2708
  initialFocusEl: () => contentRef.current,
2630
2709
  onOpenChange: (details) => onOpenChange(details.open),
2631
- children: /* @__PURE__ */ jsxs25(Portal, { children: [
2632
- /* @__PURE__ */ jsx32(ArkDialog.Backdrop, { className: "polli:fixed polli:inset-0 polli:z-[100] polli:bg-[#000]/40 polli:backdrop-blur-sm" }),
2633
- /* @__PURE__ */ jsx32(ArkDialog.Positioner, { className: "polli:pointer-events-none polli:fixed polli:inset-0 polli:z-[110] polli:h-dvh polli:overflow-hidden", children: /* @__PURE__ */ jsx32(
2710
+ children: /* @__PURE__ */ jsxs26(Portal, { children: [
2711
+ /* @__PURE__ */ jsx33(ArkDialog.Backdrop, { className: "polli:fixed polli:inset-0 polli:z-[100] polli:bg-[#000]/40 polli:backdrop-blur-sm" }),
2712
+ /* @__PURE__ */ jsx33(ArkDialog.Positioner, { className: "polli:pointer-events-none polli:fixed polli:inset-0 polli:z-[110] polli:h-dvh polli:overflow-hidden", children: /* @__PURE__ */ jsx33(
2634
2713
  ArkDialog.Content,
2635
2714
  {
2636
2715
  ref: contentRef,
@@ -2649,7 +2728,7 @@ var Drawer = ({
2649
2728
  };
2650
2729
 
2651
2730
  // src/primitives/IconTile.tsx
2652
- import { jsx as jsx33 } from "react/jsx-runtime";
2731
+ import { jsx as jsx34 } from "react/jsx-runtime";
2653
2732
  var toneClasses = {
2654
2733
  neutral: "polli:bg-theme-bg-subtle polli:text-theme-text-strong",
2655
2734
  // The wallet's Paid and Quest Pollen colours, for rows about money.
@@ -2662,7 +2741,7 @@ function IconTile({
2662
2741
  tone = "neutral",
2663
2742
  color
2664
2743
  }) {
2665
- return /* @__PURE__ */ jsx33(
2744
+ return /* @__PURE__ */ jsx34(
2666
2745
  "span",
2667
2746
  {
2668
2747
  className: cn(
@@ -2673,15 +2752,15 @@ function IconTile({
2673
2752
  color,
2674
2753
  backgroundColor: `color-mix(in oklab, ${color} 14%, transparent)`
2675
2754
  } : void 0,
2676
- children: /* @__PURE__ */ jsx33(Icon, { "aria-hidden": "true", className: "polli:size-6" })
2755
+ children: /* @__PURE__ */ jsx34(Icon, { "aria-hidden": "true", className: "polli:size-6" })
2677
2756
  }
2678
2757
  );
2679
2758
  }
2680
2759
 
2681
2760
  // src/primitives/LiveDot.tsx
2682
- import { jsx as jsx34, jsxs as jsxs26 } from "react/jsx-runtime";
2761
+ import { jsx as jsx35, jsxs as jsxs27 } from "react/jsx-runtime";
2683
2762
  function LiveDot({ className }) {
2684
- return /* @__PURE__ */ jsxs26(
2763
+ return /* @__PURE__ */ jsxs27(
2685
2764
  "span",
2686
2765
  {
2687
2766
  "aria-hidden": "true",
@@ -2690,15 +2769,15 @@ function LiveDot({ className }) {
2690
2769
  className
2691
2770
  ),
2692
2771
  children: [
2693
- /* @__PURE__ */ jsx34("span", { className: "polli:absolute polli:inset-0 polli:animate-ping polli:rounded-full polli:bg-intent-success-bg-bright polli:opacity-60 polli:[animation-duration:2.4s] polli:motion-reduce:hidden" }),
2694
- /* @__PURE__ */ jsx34("span", { className: "polli:relative polli:size-2 polli:rounded-full polli:bg-intent-success-bg-bright" })
2772
+ /* @__PURE__ */ jsx35("span", { className: "polli:absolute polli:inset-0 polli:animate-ping polli:rounded-full polli:bg-intent-success-bg-bright polli:opacity-60 polli:[animation-duration:2.4s] polli:motion-reduce:hidden" }),
2773
+ /* @__PURE__ */ jsx35("span", { className: "polli:relative polli:size-2 polli:rounded-full polli:bg-intent-success-bg-bright" })
2695
2774
  ]
2696
2775
  }
2697
2776
  );
2698
2777
  }
2699
2778
 
2700
2779
  // src/primitives/SegmentedControl.tsx
2701
- import { jsx as jsx35 } from "react/jsx-runtime";
2780
+ import { jsx as jsx36 } from "react/jsx-runtime";
2702
2781
  function SegmentedControl({
2703
2782
  options,
2704
2783
  value,
@@ -2706,7 +2785,7 @@ function SegmentedControl({
2706
2785
  ariaLabel,
2707
2786
  className
2708
2787
  }) {
2709
- return /* @__PURE__ */ jsx35(
2788
+ return /* @__PURE__ */ jsx36(
2710
2789
  "fieldset",
2711
2790
  {
2712
2791
  "aria-label": ariaLabel,
@@ -2716,7 +2795,7 @@ function SegmentedControl({
2716
2795
  ),
2717
2796
  children: options.map((option) => {
2718
2797
  const selected = option.value === value;
2719
- return /* @__PURE__ */ jsx35(
2798
+ return /* @__PURE__ */ jsx36(
2720
2799
  "button",
2721
2800
  {
2722
2801
  type: "button",
@@ -2736,7 +2815,7 @@ function SegmentedControl({
2736
2815
  }
2737
2816
 
2738
2817
  // src/primitives/Skeleton.tsx
2739
- import { jsx as jsx36 } from "react/jsx-runtime";
2818
+ import { jsx as jsx37 } from "react/jsx-runtime";
2740
2819
  var shapeClasses = {
2741
2820
  // Stands in for a card or tile.
2742
2821
  card: "polli:rounded-card",
@@ -2746,7 +2825,7 @@ var shapeClasses = {
2746
2825
  media: ""
2747
2826
  };
2748
2827
  function Skeleton({ shape = "card", className }) {
2749
- return /* @__PURE__ */ jsx36(
2828
+ return /* @__PURE__ */ jsx37(
2750
2829
  "span",
2751
2830
  {
2752
2831
  "aria-hidden": "true",
@@ -2761,7 +2840,7 @@ function Skeleton({ shape = "card", className }) {
2761
2840
 
2762
2841
  // src/primitives/Slider.tsx
2763
2842
  import { forwardRef as forwardRef6 } from "react";
2764
- import { jsx as jsx37 } from "react/jsx-runtime";
2843
+ import { jsx as jsx38 } from "react/jsx-runtime";
2765
2844
  var toNumber = (value) => {
2766
2845
  if (typeof value === "number") return value;
2767
2846
  if (typeof value !== "string" || value.trim() === "") return void 0;
@@ -2801,7 +2880,7 @@ var Slider = forwardRef6(
2801
2880
  ...style,
2802
2881
  ...progressPercent === void 0 ? null : { "--polli-slider-progress": `${progressPercent}%` }
2803
2882
  };
2804
- return /* @__PURE__ */ jsx37(
2883
+ return /* @__PURE__ */ jsx38(
2805
2884
  "input",
2806
2885
  {
2807
2886
  ref,
@@ -2819,14 +2898,14 @@ var Slider = forwardRef6(
2819
2898
  );
2820
2899
 
2821
2900
  // src/primitives/StableLabel.tsx
2822
- import { jsxs as jsxs27 } from "react/jsx-runtime";
2901
+ import { jsxs as jsxs28 } from "react/jsx-runtime";
2823
2902
  function StableLabel({
2824
2903
  text,
2825
2904
  options,
2826
2905
  align = "center",
2827
2906
  prefix
2828
2907
  }) {
2829
- return /* @__PURE__ */ jsxs27(
2908
+ return /* @__PURE__ */ jsxs28(
2830
2909
  "span",
2831
2910
  {
2832
2911
  className: cn(
@@ -2834,7 +2913,7 @@ function StableLabel({
2834
2913
  align === "center" ? "polli:justify-items-center" : "polli:justify-items-start polli:sm:justify-items-end"
2835
2914
  ),
2836
2915
  children: [
2837
- options.map((option) => /* @__PURE__ */ jsxs27(
2916
+ options.map((option) => /* @__PURE__ */ jsxs28(
2838
2917
  "span",
2839
2918
  {
2840
2919
  "aria-hidden": "true",
@@ -2846,7 +2925,7 @@ function StableLabel({
2846
2925
  },
2847
2926
  option
2848
2927
  )),
2849
- /* @__PURE__ */ jsxs27("span", { className: "polli:col-start-1 polli:row-start-1 polli:inline-flex polli:items-center polli:gap-1", children: [
2928
+ /* @__PURE__ */ jsxs28("span", { className: "polli:col-start-1 polli:row-start-1 polli:inline-flex polli:items-center polli:gap-1", children: [
2850
2929
  prefix,
2851
2930
  text
2852
2931
  ] })
@@ -2856,7 +2935,7 @@ function StableLabel({
2856
2935
  }
2857
2936
 
2858
2937
  // src/primitives/Table.tsx
2859
- import { Fragment as Fragment9, jsx as jsx38, jsxs as jsxs28 } from "react/jsx-runtime";
2938
+ import { Fragment as Fragment10, jsx as jsx39, jsxs as jsxs29 } from "react/jsx-runtime";
2860
2939
  var alignClasses = {
2861
2940
  left: "polli:text-left",
2862
2941
  center: "polli:text-center",
@@ -2867,7 +2946,7 @@ var rowIntentClasses = {
2867
2946
  warning: "polli:bg-intent-warning-bg-light/65",
2868
2947
  danger: "polli:bg-intent-danger-bg-light/65"
2869
2948
  };
2870
- var Table = ({ className, ...rest }) => /* @__PURE__ */ jsx38(
2949
+ var Table = ({ className, ...rest }) => /* @__PURE__ */ jsx39(
2871
2950
  "table",
2872
2951
  {
2873
2952
  ...rest,
@@ -2877,7 +2956,7 @@ var Table = ({ className, ...rest }) => /* @__PURE__ */ jsx38(
2877
2956
  )
2878
2957
  }
2879
2958
  );
2880
- var TableHead = ({ className, ...rest }) => /* @__PURE__ */ jsx38(
2959
+ var TableHead = ({ className, ...rest }) => /* @__PURE__ */ jsx39(
2881
2960
  "thead",
2882
2961
  {
2883
2962
  ...rest,
@@ -2887,7 +2966,7 @@ var TableHead = ({ className, ...rest }) => /* @__PURE__ */ jsx38(
2887
2966
  )
2888
2967
  }
2889
2968
  );
2890
- var TableBody = ({ className, ...rest }) => /* @__PURE__ */ jsx38(
2969
+ var TableBody = ({ className, ...rest }) => /* @__PURE__ */ jsx39(
2891
2970
  "tbody",
2892
2971
  {
2893
2972
  ...rest,
@@ -2898,7 +2977,7 @@ var TableRow = ({
2898
2977
  intent = "default",
2899
2978
  className,
2900
2979
  ...rest
2901
- }) => /* @__PURE__ */ jsx38(
2980
+ }) => /* @__PURE__ */ jsx39(
2902
2981
  "tr",
2903
2982
  {
2904
2983
  ...rest,
@@ -2918,9 +2997,9 @@ var TableHeaderCell = ({
2918
2997
  children,
2919
2998
  ...rest
2920
2999
  }) => {
2921
- const content = /* @__PURE__ */ jsxs28(Fragment9, { children: [
2922
- /* @__PURE__ */ jsx38("span", { children }),
2923
- onSort && /* @__PURE__ */ jsx38(
3000
+ const content = /* @__PURE__ */ jsxs29(Fragment10, { children: [
3001
+ /* @__PURE__ */ jsx39("span", { children }),
3002
+ onSort && /* @__PURE__ */ jsx39(
2924
3003
  "span",
2925
3004
  {
2926
3005
  "aria-hidden": "true",
@@ -2937,15 +3016,15 @@ var TableHeaderCell = ({
2937
3016
  className
2938
3017
  );
2939
3018
  if (!onSort) {
2940
- return /* @__PURE__ */ jsx38("th", { ...rest, className: classes, children: content });
3019
+ return /* @__PURE__ */ jsx39("th", { ...rest, className: classes, children: content });
2941
3020
  }
2942
- return /* @__PURE__ */ jsx38(
3021
+ return /* @__PURE__ */ jsx39(
2943
3022
  "th",
2944
3023
  {
2945
3024
  ...rest,
2946
3025
  "aria-sort": active && sortDirection ? sortDirection === "asc" ? "ascending" : "descending" : "none",
2947
3026
  className: classes,
2948
- children: /* @__PURE__ */ jsx38(
3027
+ children: /* @__PURE__ */ jsx39(
2949
3028
  "button",
2950
3029
  {
2951
3030
  type: "button",
@@ -2967,7 +3046,7 @@ var TableCell = ({
2967
3046
  muted = false,
2968
3047
  className,
2969
3048
  ...rest
2970
- }) => /* @__PURE__ */ jsx38(
3049
+ }) => /* @__PURE__ */ jsx39(
2971
3050
  "td",
2972
3051
  {
2973
3052
  ...rest,
@@ -2982,14 +3061,14 @@ var TableCell = ({
2982
3061
  );
2983
3062
 
2984
3063
  // src/primitives/TableDisclosureButton.tsx
2985
- import { jsx as jsx39, jsxs as jsxs29 } from "react/jsx-runtime";
3064
+ import { jsx as jsx40, jsxs as jsxs30 } from "react/jsx-runtime";
2986
3065
  var TableDisclosureButton = ({
2987
3066
  children,
2988
3067
  disabled = false,
2989
3068
  expanded,
2990
3069
  onClick,
2991
3070
  className
2992
- }) => /* @__PURE__ */ jsxs29(
3071
+ }) => /* @__PURE__ */ jsxs30(
2993
3072
  "button",
2994
3073
  {
2995
3074
  type: "button",
@@ -3002,7 +3081,7 @@ var TableDisclosureButton = ({
3002
3081
  className
3003
3082
  ),
3004
3083
  children: [
3005
- /* @__PURE__ */ jsx39(
3084
+ /* @__PURE__ */ jsx40(
3006
3085
  ChevronIcon,
3007
3086
  {
3008
3087
  expanded,
@@ -3118,6 +3197,8 @@ export {
3118
3197
  MultiSelect,
3119
3198
  NavItem,
3120
3199
  NewspaperIcon,
3200
+ OUTAGE_MESSAGE,
3201
+ OutageNotice,
3121
3202
  PauseIcon,
3122
3203
  PencilIcon,
3123
3204
  PeriodPicker,
@@ -3182,6 +3263,7 @@ export {
3182
3263
  periodToWindow,
3183
3264
  setColorMode,
3184
3265
  useColorMode,
3266
+ useOnline,
3185
3267
  useScrollLock
3186
3268
  };
3187
3269
  //# sourceMappingURL=index.js.map