@cloudflare/kumo 2.16.0 → 2.18.0
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/CHANGELOG.md +47 -0
- package/ai/USAGE.md +6 -0
- package/ai/component-registry.json +37 -10
- package/ai/component-registry.md +81 -3
- package/ai/schemas.ts +3 -0
- package/dist/.build-complete +1 -1
- package/dist/ai/schemas.d.ts +4 -0
- package/dist/ai/schemas.js +2 -0
- package/dist/{button-Bbi7gFL7.d.ts → button-DBuj7_fo.d.ts} +2 -2
- package/dist/catalog.d.ts +4 -1
- package/dist/catalog.js +37 -14
- package/dist/chunks/{autocomplete-ht782okfv7nv75mq.js → autocomplete-ngrji5wk0xdpq2qc.js} +2 -2
- package/dist/chunks/{badge-kyz53p7p0ng393bs.js → badge-f27mwe9gasi4inb6.js} +3 -1
- package/dist/chunks/{banner-cpla8vqjxaulggyd.js → banner-m68xx7eqplxwi73f.js} +21 -10
- package/dist/chunks/{breadcrumbs-oyuqwb09l08uhok2.js → breadcrumbs-2ra74bio44h1fvuj.js} +2 -2
- package/dist/chunks/{button-oxy32x5w9x9az80g.js → button-cyea767mx5dwgavm.js} +12 -17
- package/dist/chunks/{chart-hp3vqwe49tbyywqm.js → chart-g4dnsqiamjh39chn.js} +1 -1
- package/dist/chunks/{checkbox-o9627970y7c9ciqy.js → checkbox-bcpt8k7ck95vgjc1.js} +5 -5
- package/dist/chunks/{clipboard-text-c0ad6lzyxauxduv1.js → clipboard-text-k9ae6rsreg9ol6y2.js} +17 -6
- package/dist/chunks/{combobox-kgf0gmniahm15n81.js → combobox-iuuzrkczst4nmoyh.js} +18 -6
- package/dist/chunks/{date-picker-oee5ehsrepnlmltj.js → date-picker-o6iov1n67oc4rbom.js} +78 -6
- package/dist/chunks/{date-range-picker-hpx3cdu9ve01jx6d.js → date-range-picker-oivlshld01jbel29.js} +1 -1
- package/dist/chunks/{dialog-lgrwmsumwpftp2u8.js → dialog-h3zgi4kmimpesv5j.js} +1 -1
- package/dist/chunks/{dropdown-o875yxeqod7qp871.js → dropdown-m5a8nwer5hpvnkfk.js} +3 -1
- package/dist/chunks/{empty-ft85jcbs7fd5t3tn.js → empty-ghcpxo6x75jg7mw9.js} +1 -1
- package/dist/chunks/{field-jzzlgre0jmrr38o2.js → field-crf1hw5exr2oxemk.js} +7 -2
- package/dist/chunks/{inline-copy-text-57r67slswfqvgbaf.js → inline-copy-text-c6wa49ys72pj7k53.js} +1 -1
- package/dist/chunks/{input-jk86hoj6nqfhl5u8.js → input-d1230n06m5b1p3rd.js} +2 -2
- package/dist/chunks/{input-group-hc2qp3m6gsfomqvr.js → input-group-gg4aurpe2s60van9.js} +9 -7
- package/dist/chunks/{input-jsnp6etq7rbjjj9e.js → input-m6nvwwnydvbdz8rf.js} +2 -2
- package/dist/chunks/{label-hugrtzreeqk5mtqu.js → label-cecukn2rbow4ghxg.js} +2 -2
- package/dist/chunks/{layer-dialog-dwrrgv1wasrerow4.js → layer-dialog-eeecim8yf0dzhs2m.js} +12 -4
- package/dist/chunks/{menubar-m5pqhx7lu5z7mkks.js → menubar-gzlyhmmc4i24prn1.js} +2 -2
- package/dist/chunks/{pagination-nyknrk1lyexwgyrx.js → pagination-fkjx0m380ku9zqv9.js} +2 -2
- package/dist/chunks/{radio-d3pkrvsldfbdefav.js → radio-co7gt6ihfp5w4jr0.js} +4 -4
- package/dist/chunks/{select-owq85889zm4y23ws.js → select-ha59x0uq5ocr1x36.js} +6 -6
- package/dist/chunks/{sensitive-input-nzwvjuwlpb51ze04.js → sensitive-input-hg58r9x2d9njtysl.js} +3 -3
- package/dist/chunks/{sidebar-gluq5b5oacrdk4m4.js → sidebar-dgyce0z35tpnxj8t.js} +13 -11
- package/dist/chunks/skeleton-line-kmhnp0lx3rxhioxa.js +74 -0
- package/dist/chunks/{slider-juwif2d8xa5n0429.js → slider-e395gihi5cjd62ss.js} +1 -1
- package/dist/chunks/{switch-mqf1ulvle4nd6d2t.js → switch-hqj8v7ll9g14p5my.js} +4 -4
- package/dist/chunks/{table-nysse5tiwf47gg4k.js → table-b491wlpxd8jbr9b5.js} +1 -1
- package/dist/chunks/{tabs-mmkz7q5rofnmogwt.js → tabs-oi64kuuf2poro26u.js} +2 -2
- package/dist/chunks/{tag-input-fjfzlsaxmnqee7dk.js → tag-input-0ombmb7yrn4xk3in.js} +4 -4
- package/dist/chunks/{toast-b4t9rt9y1sumcmy2.js → toast-cmj0e7xvoh9gxxao.js} +60 -52
- package/dist/chunks/{toolbar-l9laewk5jvf4u0si.js → toolbar-bx2w3vk2if6mp36l.js} +3 -3
- package/dist/chunks/{tooltip-lguwh8bjhxwnjfus.js → tooltip-bcymn9bfyz29fvji.js} +2 -0
- package/dist/chunks/unwrap-lazy-element-hzbdkmujhd7iksau.js +45 -0
- package/dist/code.js +1 -1
- package/dist/components/autocomplete.js +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/banner.d.ts +1 -1
- package/dist/components/banner.js +1 -1
- package/dist/components/breadcrumbs.js +1 -1
- package/dist/components/button.d.ts +2 -2
- package/dist/components/button.js +1 -1
- package/dist/components/chart.js +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/clipboard-text.d.ts +1 -1
- package/dist/components/clipboard-text.js +1 -1
- package/dist/components/combobox.d.ts +1 -1
- package/dist/components/combobox.js +1 -1
- package/dist/components/date-picker.d.ts +1 -1
- package/dist/components/date-picker.js +1 -1
- package/dist/components/date-range-picker.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/dropdown.js +1 -1
- package/dist/components/empty.js +1 -1
- package/dist/components/field.js +1 -1
- package/dist/components/inline-copy-text.d.ts +1 -1
- package/dist/components/inline-copy-text.js +1 -1
- package/dist/components/input-group.d.ts +1 -1
- package/dist/components/input-group.js +1 -1
- package/dist/components/input.d.ts +1 -1
- package/dist/components/input.js +3 -3
- package/dist/components/label.js +1 -1
- package/dist/components/layer-dialog.d.ts +1 -1
- package/dist/components/layer-dialog.js +1 -1
- package/dist/components/loader.d.ts +1 -1
- package/dist/components/loader.js +1 -1
- package/dist/components/menubar.js +1 -1
- package/dist/components/pagination.js +1 -1
- package/dist/components/radio.js +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/sensitive-input.js +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/slider.js +1 -1
- package/dist/components/switch.js +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/tabs.js +1 -1
- package/dist/components/tag-input.js +1 -1
- package/dist/components/toast.d.ts +1 -1
- package/dist/components/toast.js +1 -1
- package/dist/components/toolbar.d.ts +1 -1
- package/dist/components/toolbar.js +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/{index-BMe3cpLB.d.ts → index--HBggSGH.d.ts} +2 -2
- package/dist/{index-CSWbPhke.d.ts → index-BAFvYacU.d.ts} +15 -5
- package/dist/{index--RbAKeBL.d.ts → index-BfoZI9Hf.d.ts} +2 -2
- package/dist/{index-DJIRVD5B.d.ts → index-CReGk3Dc.d.ts} +6 -0
- package/dist/{index-jNWPjJl9.d.ts → index-D4_C1J_8.d.ts} +1 -1
- package/dist/{index-5bJAnzUo.d.ts → index-Dmbgjww7.d.ts} +1 -0
- package/dist/{index-BAQwS4mL.d.ts → index-Dx7hOWUc.d.ts} +24 -1
- package/dist/{index-CrQi3QCY.d.ts → index-DxOyYZaJ.d.ts} +4 -3
- package/dist/index-WCjW8Iot.d.ts +1 -0
- package/dist/{index-DNsSKNUe.d.ts → index-bBPKMepR.d.ts} +4 -0
- package/dist/index.d.ts +12 -12
- package/dist/index.js +36 -36
- package/dist/{input-group-B3M_WRqm.d.ts → input-group-oXVkmPrY.d.ts} +1 -1
- package/dist/styles/kumo-binding.css +159 -0
- package/dist/styles/kumo-standalone.css +1 -1
- package/dist/styles/kumo.css +0 -545
- package/package.json +1 -1
- package/scripts/component-registry/schema-generator.ts +2 -0
- package/scripts/format-generated.ts +12 -0
- package/scripts/generate-primitives.ts +16 -12
- package/scripts/theme-generator/index.ts +2 -2
- package/dist/chunks/skeleton-line-gjf1fecmyy82aejz.js +0 -43
- package/dist/index-B-hCpI5K.d.ts +0 -1
- package/dist/index-DhOvcB0m.d.ts +0 -60
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
# @cloudflare/kumo
|
|
2
2
|
|
|
3
|
+
## 2.18.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9d8b6e5: Add a `variant="sketch"` option to `SkeletonLine`: a wireframe-style placeholder with a rounded fill and sliding shimmer, a 1px outline, and construction strokes that overshoot each corner by 4px.
|
|
8
|
+
- 085332b: Add `href` to `Banner.Action` so actions can render as links. Link actions use `LinkButton`, so they respect `LinkProvider` and support `external`.
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- 39d33de: Keep keyboard focus visible in forced-colors mode when browsers suppress box-shadow rings. Controls retain a system-color outline, including the shared focus containers used by InputGroup, TagInput, and Slider. Keep tab outlines inside the scrolling tab list so all four edges remain visible.
|
|
13
|
+
- 99e73d6: `Button` and `LinkButton` labels are now vertically centered regardless of where the button sits on the page. The bottom-padding text lift is removed, and `base` and `lg` buttons use a 20px line height (`leading-5`) so the gap between the label and the button edge is a whole pixel. With the old 21px line height that gap was 7.5px, and browsers rounded the text up or down depending on the button's position, so labels could render 1px high. `Select` triggers use the same size classes and get the same fix. The reduced leading padding for icon + text buttons is unchanged.
|
|
14
|
+
- 12cd0fa: Fix several catalog runtime bugs:
|
|
15
|
+
|
|
16
|
+
- `setByPath` replaces `null` intermediate values instead of throwing, and ignores `__proto__`/`constructor`/`prototype` segments
|
|
17
|
+
- `getByPath` and `setByPath` decode JSON Pointer escapes (`~1` → `/`, `~0` → `~`)
|
|
18
|
+
- `{ auth }` conditions now work inside `and`/`or`/`not` visibility expressions (evaluator, `LogicExpression` type, and Zod schema). Unrecognised `auth` values now hide the element instead of showing it
|
|
19
|
+
- `resolveProps` resolves `{ path }` references inside arrays
|
|
20
|
+
- `hasAction` no longer reports `Object.prototype` names such as `toString` as registered actions
|
|
21
|
+
|
|
22
|
+
- d8a668e: Loosen and balance choice descriptions: `Radio.Item` and `Checkbox.Item` card descriptions, and the `Radio.Group`, `Checkbox.Group`, and `Switch.Group` descriptions, now use `leading-snug` (matching `Field` and `Select` descriptions) and `text-pretty`, so multi-line descriptions are easier to read and don't end on a single orphaned word.
|
|
23
|
+
- a813d01: Forward trigger props (`aria-label`, `aria-labelledby`, `aria-describedby`, `id`, handlers, etc.) from `Combobox.TriggerValue` to its trigger button instead of dropping them on `Value`, so comboboxes without a visible `label` can have an accessible name. `Combobox.TriggerMultipleWithInput` now accepts `aria-label`, `aria-labelledby` and `aria-describedby` for its input.
|
|
24
|
+
- 3450917: Guard `Combobox.TriggerValue`'s `placeholder` prop type so it stays `ReactNode` and can't be narrowed to `string` by the forwarded trigger (button) props.
|
|
25
|
+
- 1c85bb3: fix(date-picker): reset day button background, border, padding and margin, and the weekday header background, so host app button and table styles don't leak into the calendar
|
|
26
|
+
- cbb7fe8: `Button`, `LinkButton`, `Badge`, `DropdownMenu` items, `Sidebar.MenuButton` and `InputGroup.Button` no longer crash with React error #306 when `icon` is an element passed from a React Server Component. React can deliver such an element as a lazy reference, which Kumo now unwraps before deciding whether to render `icon` as an element or a component (#891).
|
|
27
|
+
- 33bdabd: Keep Dialog and alertdialog content within the dynamic viewport and allow tall content to scroll. Preserve the natural height of LayerCard sections so long forms and their final actions remain reachable on small screens.
|
|
28
|
+
|
|
29
|
+
## 2.17.0
|
|
30
|
+
|
|
31
|
+
### Minor Changes
|
|
32
|
+
|
|
33
|
+
- c2b2fc4: Add a `masked` option to `ClipboardText` for sensitive values that should be hidden initially and revealed on demand.
|
|
34
|
+
- 7d1c776: Refresh DatePicker's styling. Days are 32px squares in 36px columns with 8px between weeks and 14px text, and the previous and next buttons are borderless squares that match the days. Two-month views sit side by side, range bands are rounded at their ends and where weeks wrap, and month and year dropdowns (`captionLayout="dropdown"`) are styled.
|
|
35
|
+
|
|
36
|
+
DatePicker now uses Kumo tokens instead of hard-coded colors, so it follows the active theme, and `@cloudflare/kumo/styles/standalone` now styles it too. Month-change animations respect `prefers-reduced-motion`.
|
|
37
|
+
|
|
38
|
+
The `.rdp-*` rules and `--rdp-*` variables in `kumo.css` are gone, apart from the month-change animations. If you customized DatePicker through them, use the `classNames` prop instead.
|
|
39
|
+
|
|
40
|
+
- 40eaa25: Fix the toast bump animation cutting off a toast's slide-in when the same `id` is added again while the toast is still entering. Duplicate adds through `createKumoToastManager()` now bump too, and toast motion respects `prefers-reduced-motion`. Toast surface styles now live on an inner `[data-kumo-part="surface"]` element instead of the `role="dialog"` root.
|
|
41
|
+
|
|
42
|
+
### Patch Changes
|
|
43
|
+
|
|
44
|
+
- 06726b0: `Field` no longer renders a `<label>` when it would be empty: when `label` and `labelTooltip` are each `undefined`, `null`, a boolean or `""`, and there is no "(optional)" indicator. This fixes `Input`, `InputArea` and `TagInput` without a `label` but with a description or error: they no longer show an empty row above the control, and their `aria-label` is no longer replaced by an empty accessible name.
|
|
45
|
+
- 595463b: Format generated primitive and theme files with Oxfmt so codegen does not create formatting-only changes.
|
|
46
|
+
- 3aa0d59: Hide the native scrollbars of the LayerDialog body and Sidebar content with Kumo's own CSS. Base UI only hides them with a style element it injects into the document head, so client routers that swap the head (such as Astro's ClientRouter) or a Content Security Policy that blocks inline styles could leave empty scrollbar tracks along the dialog body.
|
|
47
|
+
- 890a6ab: Add a full-width `LayerDialog.Separator` for dividing sections of dialog body content.
|
|
48
|
+
- 4185bb1: `Tooltip` now keeps its own trigger out of the tab order while the tooltip is `disabled`. This applies only when Kumo renders the trigger (no `render` or `asChild`), for example around truncated `Text` that needs a tooltip only when it overflows. A disabled tooltip there has nothing to reveal, so keyboard users no longer stop on it. Custom triggers passed through `render` keep their own focus behavior.
|
|
49
|
+
|
|
3
50
|
## 2.16.0
|
|
4
51
|
|
|
5
52
|
### Minor Changes
|
package/ai/USAGE.md
CHANGED
|
@@ -136,6 +136,12 @@ import { PlusIcon, TrashIcon, GearIcon } from "@phosphor-icons/react";
|
|
|
136
136
|
<DropdownMenu.Item icon={TrashIcon} variant="danger">Delete</DropdownMenu.Item>
|
|
137
137
|
```
|
|
138
138
|
|
|
139
|
+
`icon` props also accept a rendered element, including one passed from a React Server Component:
|
|
140
|
+
|
|
141
|
+
```tsx
|
|
142
|
+
<Button icon={<PlusIcon weight="bold" />}>Add Worker</Button>
|
|
143
|
+
```
|
|
144
|
+
|
|
139
145
|
## Controlled State Reference
|
|
140
146
|
|
|
141
147
|
| Component | Value Prop | Change Callback | Default Prop |
|
|
@@ -411,6 +411,7 @@
|
|
|
411
411
|
"<Banner\n icon={<Info weight=\"fill\" />}\n title=\"Custom content supported\"\n description={\n <Text DANGEROUS_className=\"text-inherit\">\n This banner supports <strong>custom content</strong> with Text.\n </Text>\n }\n />",
|
|
412
412
|
"<div className=\"w-full space-y-3\">\n <Banner\n icon={<Info weight=\"fill\" />}\n title=\"Update available\"\n description=\"A new version is ready to install.\"\n action={\n <>\n <Banner.Action>Update</Banner.Action>\n <Banner.Action variant=\"ghost\" icon={<X />} aria-label=\"Dismiss\" />\n </>\n }\n />\n <Banner\n variant=\"error\"\n icon={<WarningCircle weight=\"fill\" />}\n title=\"Save failed\"\n description=\"We couldn't save your changes. Please try again.\"\n action={\n <>\n <Banner.Action>Retry</Banner.Action>\n <Banner.Action variant=\"ghost\" icon={<X />} aria-label=\"Dismiss\" />\n </>\n }\n />\n <Banner\n variant=\"alert\"\n icon={<WarningCircle weight=\"fill\" />}\n title=\"Save failed\"\n description=\"We couldn't save your changes. Please try again.\"\n action={\n <>\n <Banner.Action>Retry</Banner.Action>\n <Banner.Action variant=\"ghost\" icon={<X />} aria-label=\"Dismiss\" />\n </>\n }\n />\n <Banner\n variant=\"secondary\"\n icon={<WarningCircle weight=\"fill\" />}\n title=\"Save failed\"\n description=\"We couldn't save your changes. Please try again.\"\n action={\n <>\n <Banner.Action>Retry</Banner.Action>\n <Banner.Action variant=\"ghost\" icon={<X />} aria-label=\"Dismiss\" />\n </>\n }\n />\n </div>",
|
|
413
413
|
"<div className=\"w-full space-y-3\">\n <Banner\n icon={<Warning weight=\"fill\" />}\n variant=\"error\"\n title=\"Your account is 90 days past due.\"\n description=\"Pay now to avoid interruption.\"\n action={\n <>\n <Banner.Action>Pay now</Banner.Action>\n <Banner.Action variant=\"secondary\">Go to billing</Banner.Action>\n </>\n }\n />\n </div>",
|
|
414
|
+
"<Banner\n icon={<Warning weight=\"fill\" />}\n variant=\"alert\"\n title=\"Review your payment method\"\n description=\"Add a credit or debit card directly in Billing to continue.\"\n action={\n <>\n <Banner.Action\n variant=\"secondary\"\n href=\"https://developers.cloudflare.com/billing/\"\n external\n >\n View docs\n </Banner.Action>\n <Banner.Action href=\"https://dash.cloudflare.com/\">\n Manage payments\n </Banner.Action>\n </>\n }\n />",
|
|
414
415
|
"<div className=\"w-full space-y-3\">\n <Banner\n icon={<Info weight=\"fill\" />}\n title=\"Update available\"\n description=\"A new version is ready to install.\"\n action={\n <>\n <Banner.Action>Update</Banner.Action>\n <Banner.Action variant=\"ghost\" icon={<X />} aria-label=\"Dismiss\" />\n </>\n }\n />\n <Banner\n variant=\"alert\"\n icon={<Warning weight=\"fill\" />}\n title=\"Session expiring\"\n description=\"Your session will expire in 5 minutes.\"\n action={\n <>\n <Banner.Action>Extend</Banner.Action>\n <Banner.Action variant=\"ghost\" icon={<X />} aria-label=\"Dismiss\" />\n </>\n }\n />\n <Banner\n variant=\"error\"\n icon={<WarningCircle weight=\"fill\" />}\n title=\"Save failed\"\n description=\"We couldn't save your changes. Please try again.\"\n action={\n <>\n <Banner.Action>Retry</Banner.Action>\n <Banner.Action variant=\"ghost\" icon={<X />} aria-label=\"Dismiss\" />\n </>\n }\n />\n <Banner\n variant=\"secondary\"\n icon={<Info weight=\"fill\" />}\n title=\"Heads up\"\n description=\"This is a secondary informational banner.\"\n action={\n <>\n <Banner.Action>Got it</Banner.Action>\n <Banner.Action variant=\"ghost\" icon={<X />} aria-label=\"Dismiss\" />\n </>\n }\n />\n </div>",
|
|
415
416
|
"<Banner\n size=\"sm\"\n description=\"A DNS record for puppies.cloudflare.dev already exists in this zone.\"\n action={<Link href=\"#\">Manage DNS for puppies.cloudflare.dev</Link>}\n />",
|
|
416
417
|
"<Banner\n size=\"sm\"\n description=\"A DNS record for puppies.cloudflare.dev already exists in this zone.\"\n action={\n <>\n <Banner.Action>Manage DNS</Banner.Action>\n <Banner.Action variant=\"ghost\">\n <X />\n </Banner.Action>\n </>\n }\n />",
|
|
@@ -715,8 +716,8 @@
|
|
|
715
716
|
"classes": {
|
|
716
717
|
"xs": "h-5 gap-1 rounded-sm px-1.5 text-xs",
|
|
717
718
|
"sm": "h-6.5 gap-1 rounded-md px-2 text-xs",
|
|
718
|
-
"base": "h-9 gap-1.5 rounded-lg px-3 text-base",
|
|
719
|
-
"lg": "h-10 gap-2 rounded-lg px-4 text-base"
|
|
719
|
+
"base": "h-9 gap-1.5 rounded-lg px-3 text-base leading-5",
|
|
720
|
+
"lg": "h-10 gap-2 rounded-lg px-4 text-base leading-5"
|
|
720
721
|
},
|
|
721
722
|
"default": "base"
|
|
722
723
|
},
|
|
@@ -1362,6 +1363,11 @@
|
|
|
1362
1363
|
"optional": true,
|
|
1363
1364
|
"description": "If provided, this text will be copied to clipboard instead of the `text` prop."
|
|
1364
1365
|
},
|
|
1366
|
+
"masked": {
|
|
1367
|
+
"type": "boolean",
|
|
1368
|
+
"optional": true,
|
|
1369
|
+
"description": "Masks the text initially and adds a control to reveal or hide it."
|
|
1370
|
+
},
|
|
1365
1371
|
"className": {
|
|
1366
1372
|
"type": "string",
|
|
1367
1373
|
"optional": true,
|
|
@@ -1382,6 +1388,7 @@
|
|
|
1382
1388
|
"<ClipboardText text=\"0c239dd2\" />",
|
|
1383
1389
|
"<ClipboardText text=\"abc123\" />",
|
|
1384
1390
|
"<ClipboardText text=\"sk_live_51H8...\" />",
|
|
1391
|
+
"<div className=\"w-full max-w-xs\">\n <ClipboardText className=\"w-full\" text=\"sk_live_51H8_abc123\" masked />\n </div>",
|
|
1385
1392
|
"<ClipboardText\n text=\"sk_live_***********\"\n textToCopy=\"sk_live_51H8_abc123\"\n />",
|
|
1386
1393
|
"<ClipboardText text=\"https://example.com/very/long/url/path\" />",
|
|
1387
1394
|
"<ClipboardText\n text=\"npx kumo add button\"\n tooltip={{ text: \"Copy\", copiedText: \"Copied!\", side: \"top\" }}\n />"
|
|
@@ -3111,17 +3118,29 @@
|
|
|
3111
3118
|
}
|
|
3112
3119
|
},
|
|
3113
3120
|
"examples": [
|
|
3114
|
-
"<div className=\"flex flex-col gap-4\">\n <DatePicker\n mode=\"single\"\n selected={date}\n onChange={(d) => {\n if (d) {\n setDate(d);\n }\n }}\n />\n <p className=\"text-sm text-kumo-subtle\">\n Selected: {date ? date.toLocaleDateString() : \"None\"}\n </p>\n </div>",
|
|
3115
|
-
"<div className=\"flex flex-col gap-4\">\n <DatePicker\n mode=\"multiple\"\n selected={dates}\n onChange={setDates}\n max={5}\n />\n <p className=\"text-sm text-kumo-subtle\">\n Selected: {dates?.length ?? 0} date(s)\n </p>\n </div>",
|
|
3116
|
-
"<div className=\"flex flex-col gap-4\">\n <DatePicker\n mode=\"range\"\n selected={range}\n onChange={setRange}\n numberOfMonths={2}\n />\n <p className=\"text-sm text-kumo-subtle\">\n Range:{\" \"}\n {range?.from\n ? `${range.from.toLocaleDateString()} - ${range.to?.toLocaleDateString() ?? \"...\"}`\n : \"None\"}\n </p>\n </div>",
|
|
3117
|
-
"<div className=\"flex flex-col gap-4\">\n <DatePicker\n mode=\"range\"\n selected={range}\n onChange={setRange}\n min={3}\n max={7}\n footer={\n <span className=\"text-xs text-kumo-subtle\">Select 3-7 nights</span>\n }\n />\n </div>",
|
|
3121
|
+
"<div className=\"flex flex-col gap-4\">\n <DatePicker\n className=\"p-3\"\n mode=\"single\"\n selected={date}\n onChange={(d) => {\n if (d) {\n setDate(d);\n }\n }}\n />\n <p className=\"text-sm text-kumo-subtle\">\n Selected: {date ? date.toLocaleDateString() : \"None\"}\n </p>\n </div>",
|
|
3122
|
+
"<div className=\"flex flex-col gap-4\">\n <DatePicker\n className=\"p-3\"\n mode=\"multiple\"\n selected={dates}\n onChange={setDates}\n max={5}\n />\n <p className=\"text-sm text-kumo-subtle\">\n Selected: {dates?.length ?? 0} date(s)\n </p>\n </div>",
|
|
3123
|
+
"<div className=\"flex flex-col gap-4\">\n <DatePicker\n className=\"p-3\"\n mode=\"range\"\n selected={range}\n onChange={setRange}\n numberOfMonths={2}\n />\n <p className=\"text-sm text-kumo-subtle\">\n Range:{\" \"}\n {range?.from\n ? `${range.from.toLocaleDateString()} - ${range.to?.toLocaleDateString() ?? \"...\"}`\n : \"None\"}\n </p>\n </div>",
|
|
3124
|
+
"<div className=\"flex flex-col gap-4\">\n <DatePicker\n className=\"p-3\"\n mode=\"range\"\n selected={range}\n onChange={setRange}\n min={3}\n max={7}\n footer={\n <span className=\"text-xs text-kumo-subtle\">Select 3-7 nights</span>\n }\n />\n </div>",
|
|
3125
|
+
"<DatePicker\n className=\"p-3\"\n mode=\"single\"\n selected={date}\n onChange={setDate}\n captionLayout=\"dropdown\"\n startMonth={new Date(2020, 0)}\n endMonth={new Date(2030, 11)}\n />",
|
|
3118
3126
|
"<Popover>\n <Popover.Trigger\n render={<Button variant=\"outline\" icon={CalendarDotsIcon} />}\n >\n {date ? date.toLocaleDateString() : \"Pick a date\"}\n </Popover.Trigger>\n <Popover.Content className=\"p-3\">\n <DatePicker mode=\"single\" selected={date} onChange={setDate} />\n </Popover.Content>\n </Popover>",
|
|
3119
3127
|
"<Popover>\n <Popover.Trigger\n render={<Button variant=\"outline\" icon={CalendarDotsIcon} />}\n >\n {formatRange()}\n </Popover.Trigger>\n <Popover.Content className=\"p-3\">\n <DatePicker\n mode=\"range\"\n selected={range}\n onChange={setRange}\n numberOfMonths={2}\n />\n </Popover.Content>\n </Popover>",
|
|
3120
|
-
"<Popover>\n <Popover.Trigger\n render={<Button variant=\"outline\" icon={CalendarDotsIcon} />}\n >\n {formatRange()}\n </Popover.Trigger>\n <Popover.Content className=\"p-0\">\n <div className=\"flex\">\n <div className=\"flex flex-col gap-1 border-r border-kumo-hairline p-2 text-sm\">\n {presets.map((preset) => {\n const isActive = isPresetActive(preset);\n return (\n <button\n key={preset.label}\n type=\"button\"\n onClick={() => handlePresetClick(preset)}\n className={`rounded-md px-3 py-1.5 text-left whitespace-nowrap ${\n isActive\n ? \"bg-kumo-
|
|
3121
|
-
"<DatePicker\n mode=\"multiple\"\n selected={dates}\n onChange={setDates}\n max={maxDays}\n disabled={unavailableDates}\n fixedWeeks\n footer={\n <p className=\"w-full pt-2 text-xs text-kumo-subtle\">\n {selectedCount}/{maxDays} days selected. Grayed dates are unavailable.\n </p>\n }\n />"
|
|
3128
|
+
"<Popover>\n <Popover.Trigger\n render={<Button variant=\"outline\" icon={CalendarDotsIcon} />}\n >\n {formatRange()}\n </Popover.Trigger>\n <Popover.Content className=\"p-0\">\n <div className=\"flex\">\n <div className=\"flex flex-col gap-1 border-r border-kumo-hairline p-2 text-sm\">\n {presets.map((preset) => {\n const isActive = isPresetActive(preset);\n return (\n <button\n key={preset.label}\n type=\"button\"\n onClick={() => handlePresetClick(preset)}\n className={`rounded-md px-3 py-1.5 text-left whitespace-nowrap ${\n isActive\n ? \"bg-kumo-contrast text-kumo-inverse\"\n : \"text-kumo-subtle hover:bg-kumo-control\"\n }`}\n >\n {preset.label}\n </button>\n );\n })}\n </div>\n <div className=\"p-3\">\n <DatePicker\n mode=\"range\"\n selected={range}\n onChange={setRange}\n month={month}\n onMonthChange={setMonth}\n numberOfMonths={2}\n />\n </div>\n </div>\n </Popover.Content>\n </Popover>",
|
|
3129
|
+
"<DatePicker\n className=\"p-3\"\n mode=\"multiple\"\n selected={dates}\n onChange={setDates}\n max={maxDays}\n disabled={unavailableDates}\n fixedWeeks\n footer={\n <p className=\"w-full pt-2 text-xs text-kumo-subtle\">\n {selectedCount}/{maxDays} days selected. Grayed dates are unavailable.\n </p>\n }\n />"
|
|
3122
3130
|
],
|
|
3123
3131
|
"colors": [
|
|
3124
|
-
"bg-kumo-base"
|
|
3132
|
+
"bg-kumo-base",
|
|
3133
|
+
"bg-kumo-contrast",
|
|
3134
|
+
"bg-kumo-fill",
|
|
3135
|
+
"bg-kumo-interact",
|
|
3136
|
+
"bg-kumo-tint",
|
|
3137
|
+
"ring-kumo-brand",
|
|
3138
|
+
"ring-kumo-line",
|
|
3139
|
+
"text-kumo-default",
|
|
3140
|
+
"text-kumo-inactive",
|
|
3141
|
+
"text-kumo-inverse",
|
|
3142
|
+
"text-kumo-link",
|
|
3143
|
+
"text-kumo-subtle"
|
|
3125
3144
|
]
|
|
3126
3145
|
},
|
|
3127
3146
|
"DateRangePicker": {
|
|
@@ -4145,7 +4164,7 @@
|
|
|
4145
4164
|
"text-kumo-default"
|
|
4146
4165
|
],
|
|
4147
4166
|
"styling": {
|
|
4148
|
-
"baseClasses": "group/inline-copy flex min-w-0 max-w-full cursor-pointer items-center gap-1 rounded-xs border-0 bg-transparent p-0 focus-visible:outline-
|
|
4167
|
+
"baseClasses": "group/inline-copy flex min-w-0 max-w-full cursor-pointer items-center gap-1 rounded-xs border-0 bg-transparent p-0 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-kumo-brand"
|
|
4149
4168
|
}
|
|
4150
4169
|
},
|
|
4151
4170
|
"Input": {
|
|
@@ -4636,6 +4655,7 @@
|
|
|
4636
4655
|
"<LayerDialog.Root>\n <LayerDialog.Trigger\n render={(props) => <Button {...props}>Open settings</Button>}\n />\n <LayerDialog.Content>\n <LayerDialog.Title>Configure custom hostname</LayerDialog.Title>\n <LayerDialog.Description>\n Route requests for this hostname to your Worker.\n </LayerDialog.Description>\n <LayerDialog.Body>\n <div className=\"flex flex-col gap-5\">\n <Input\n label=\"Hostname\"\n onChange={(event) => setHostname(event.target.value)}\n value={hostname}\n />\n <Input\n label=\"Display name\"\n onChange={(event) => setName(event.target.value)}\n value={name}\n />\n </div>\n </LayerDialog.Body>\n <LayerDialog.Actions>\n <LayerDialog.Action\n disabled={!hostname || !name}\n onClick={() => undefined}\n >\n Save hostname\n </LayerDialog.Action>\n </LayerDialog.Actions>\n </LayerDialog.Content>\n </LayerDialog.Root>",
|
|
4637
4656
|
"<LayerDialog.Root>\n <LayerDialog.Trigger\n render={(props) => <Button {...props}>Create deployment</Button>}\n />\n <LayerDialog.Content>\n <LayerDialog.Title>Create deployment</LayerDialog.Title>\n <LayerDialog.Description>\n The browser owns the form’s native validation and submission state.\n </LayerDialog.Description>\n <LayerDialog.Body>\n <form\n id={formId}\n className=\"flex flex-col gap-5\"\n onSubmit={(event) => event.preventDefault()}\n >\n <Input\n label=\"Service name\"\n name=\"serviceName\"\n placeholder=\"production-api\"\n required\n />\n <Input\n label=\"Compatibility date\"\n name=\"compatibilityDate\"\n required\n type=\"date\"\n />\n </form>\n </LayerDialog.Body>\n <LayerDialog.Actions dismissLabel=\"Cancel\">\n <LayerDialog.Action form={formId} type=\"submit\">\n Create deployment\n </LayerDialog.Action>\n </LayerDialog.Actions>\n </LayerDialog.Content>\n </LayerDialog.Root>",
|
|
4638
4657
|
"<LayerDialog.Root>\n <LayerDialog.Trigger\n render={(props) => <Button {...props}>Choose a Worker</Button>}\n />\n <LayerDialog.Content>\n <LayerDialog.Title>Choose a Worker</LayerDialog.Title>\n <LayerDialog.Description>\n Select the Worker that handles requests for this route.\n </LayerDialog.Description>\n <LayerDialog.Body>\n <div className=\"flex flex-col gap-3\">\n <Input\n aria-label=\"Search Workers\"\n onChange={(event) => setQuery(event.target.value)}\n placeholder=\"Search Workers\"\n type=\"search\"\n value={query}\n />\n {matches.length > 0 ? (\n <ul className=\"flex flex-col divide-y divide-kumo-hairline rounded-lg border border-kumo-hairline\">\n {matches.map((worker) => (\n <li key={worker} className=\"px-3 py-2 text-kumo-default\">\n {worker}\n </li>\n ))}\n </ul>\n ) : (\n <Text variant=\"secondary\">No Workers match “{query}”.</Text>\n )}\n </div>\n </LayerDialog.Body>\n </LayerDialog.Content>\n </LayerDialog.Root>",
|
|
4658
|
+
"<LayerDialog.Root>\n <LayerDialog.Trigger\n render={(props) => <Button {...props}>Review deployment</Button>}\n />\n <LayerDialog.Content>\n <LayerDialog.Title>Deployment summary</LayerDialog.Title>\n <LayerDialog.Description>\n Review the configuration before deploying.\n </LayerDialog.Description>\n <LayerDialog.Body>\n <Text variant=\"secondary\">\n production-api will deploy to the global network.\n </Text>\n <LayerDialog.Separator />\n <Text variant=\"secondary\">\n The deployment uses compatibility date 2026-10-26.\n </Text>\n </LayerDialog.Body>\n <LayerDialog.Actions>\n <LayerDialog.Action>Deploy</LayerDialog.Action>\n </LayerDialog.Actions>\n </LayerDialog.Content>\n </LayerDialog.Root>",
|
|
4639
4659
|
"<div className=\"flex flex-wrap justify-center gap-3\">\n <LayerDialog.Root>\n <LayerDialog.Trigger\n render={(props) => <Button {...props}>Edit deployment</Button>}\n />\n <LayerDialog.Content>\n <LayerDialog.Title>Save deployment</LayerDialog.Title>\n <LayerDialog.Description>\n Deploy these changes now, or keep them as a draft.\n </LayerDialog.Description>\n <LayerDialog.Body>\n <Text variant=\"secondary\">\n The alternate save outcome is related to the primary action, so it\n lives in its split-button menu rather than as an unrelated footer\n button.\n </Text>\n </LayerDialog.Body>\n <LayerDialog.Actions>\n <LayerDialog.Action\n menu={[\n <DropdownMenu.Item key=\"draft\">\n Save as draft\n </DropdownMenu.Item>,\n ]}\n menuLabel=\"Save options\"\n >\n Save and deploy\n </LayerDialog.Action>\n </LayerDialog.Actions>\n </LayerDialog.Content>\n </LayerDialog.Root>\n\n <LayerDialog.Alert>\n <LayerDialog.Trigger\n render={(props) => (\n <Button {...props} variant=\"secondary\">\n Delete deployment\n </Button>\n )}\n />\n <LayerDialog.Content>\n <LayerDialog.Title>Delete deployment</LayerDialog.Title>\n <LayerDialog.Description>\n This permanently removes the deployment and cannot be undone.\n </LayerDialog.Description>\n <LayerDialog.Body>\n <Text variant=\"secondary\">\n The destructive split button keeps every part of the action,\n including the menu trigger, visually consistent.\n </Text>\n </LayerDialog.Body>\n <LayerDialog.Actions>\n <LayerDialog.Action\n menu={[\n <DropdownMenu.Item key=\"delete-with-tokens\">\n Delete and revoke tokens\n </DropdownMenu.Item>,\n ]}\n menuLabel=\"Delete options\"\n variant=\"destructive\"\n >\n Delete deployment\n </LayerDialog.Action>\n </LayerDialog.Actions>\n </LayerDialog.Content>\n </LayerDialog.Alert>\n </div>",
|
|
4640
4660
|
"<LayerDialog.Root>\n <LayerDialog.Trigger\n render={(props) => <Button {...props}>Edit profile</Button>}\n />\n <LayerDialog.Content>\n <LayerDialog.Title>Edit profile</LayerDialog.Title>\n <LayerDialog.Description>\n Update the profile information shown to your teammates. Changes are\n not saved until you confirm.\n </LayerDialog.Description>\n <LayerDialog.Body>\n <div className=\"flex flex-col gap-5\">\n <Input\n label=\"Display name\"\n onChange={(event) => setName(event.target.value)}\n value={name}\n />\n <Input\n label=\"Email address\"\n onChange={(event) => setEmail(event.target.value)}\n type=\"email\"\n value={email}\n />\n </div>\n </LayerDialog.Body>\n <LayerDialog.Actions dismissLabel=\"Cancel\">\n <LayerDialog.Action\n disabled={!email || !name}\n onClick={() => undefined}\n >\n Save changes\n </LayerDialog.Action>\n </LayerDialog.Actions>\n </LayerDialog.Content>\n </LayerDialog.Root>",
|
|
4641
4661
|
"<LayerDialog.Alert>\n <LayerDialog.Trigger\n render={(props) => (\n <Button variant=\"secondary-destructive\" {...props}>\n Delete Worker\n </Button>\n )}\n />\n <LayerDialog.Content>\n <LayerDialog.Title>Delete Worker</LayerDialog.Title>\n <LayerDialog.Description>\n Deleting{\" \"}\n <strong className=\"font-medium text-kumo-default\">\n {workerName}\n </strong>{\" \"}\n is permanent.\n </LayerDialog.Description>\n <LayerDialog.Body>\n <div className=\"flex flex-col gap-5\">\n <Text variant=\"secondary\">\n This deletes the Worker, deployments, and configuration. If this\n Worker consumes Queues, those connections are removed first.\n Queues, D1 databases, and messages stay in your account.\n </Text>\n <Input\n label={\n <>\n Type{\" \"}\n <strong className=\"font-medium text-kumo-default\">\n {workerName}\n </strong>{\" \"}\n to confirm\n </>\n }\n onChange={(event) => setConfirmation(event.target.value)}\n placeholder={workerName}\n value={confirmation}\n />\n </div>\n </LayerDialog.Body>\n <LayerDialog.Actions>\n <LayerDialog.Action\n disabled={confirmation !== workerName}\n onClick={() => undefined}\n variant=\"destructive\"\n >\n Delete Worker\n </LayerDialog.Action>\n </LayerDialog.Actions>\n </LayerDialog.Content>\n </LayerDialog.Alert>",
|
|
@@ -4651,6 +4671,7 @@
|
|
|
4651
4671
|
"bg-kumo-contrast",
|
|
4652
4672
|
"bg-kumo-elevated",
|
|
4653
4673
|
"bg-kumo-fill",
|
|
4674
|
+
"bg-kumo-hairline",
|
|
4654
4675
|
"bg-kumo-recessed",
|
|
4655
4676
|
"border-kumo-hairline"
|
|
4656
4677
|
],
|
|
@@ -4730,6 +4751,11 @@
|
|
|
4730
4751
|
}
|
|
4731
4752
|
}
|
|
4732
4753
|
},
|
|
4754
|
+
"Separator": {
|
|
4755
|
+
"name": "Separator",
|
|
4756
|
+
"description": "Separator sub-component",
|
|
4757
|
+
"props": {}
|
|
4758
|
+
},
|
|
4733
4759
|
"Action": {
|
|
4734
4760
|
"name": "Action",
|
|
4735
4761
|
"description": "Action sub-component",
|
|
@@ -7892,6 +7918,7 @@
|
|
|
7892
7918
|
"<Toasty>\n <ToastDescriptionOnlyButton />\n </Toasty>",
|
|
7893
7919
|
"<Toasty>\n <ToastSuccessButton />\n </Toasty>",
|
|
7894
7920
|
"<Toasty>\n <ToastMultipleButton />\n </Toasty>",
|
|
7921
|
+
"<Toasty>\n <ToastDeduplicatedButton />\n </Toasty>",
|
|
7895
7922
|
"<Toasty>\n <ToastErrorButton />\n </Toasty>",
|
|
7896
7923
|
"<Toasty>\n <ToastWarningButton />\n </Toasty>",
|
|
7897
7924
|
"<Toasty>\n <ToastInfoButton />\n </Toasty>",
|
package/ai/component-registry.md
CHANGED
|
@@ -553,6 +553,29 @@ Action sub-component
|
|
|
553
553
|
</div>
|
|
554
554
|
```
|
|
555
555
|
|
|
556
|
+
```tsx
|
|
557
|
+
<Banner
|
|
558
|
+
icon={<Warning weight="fill" />}
|
|
559
|
+
variant="alert"
|
|
560
|
+
title="Review your payment method"
|
|
561
|
+
description="Add a credit or debit card directly in Billing to continue."
|
|
562
|
+
action={
|
|
563
|
+
<>
|
|
564
|
+
<Banner.Action
|
|
565
|
+
variant="secondary"
|
|
566
|
+
href="https://developers.cloudflare.com/billing/"
|
|
567
|
+
external
|
|
568
|
+
>
|
|
569
|
+
View docs
|
|
570
|
+
</Banner.Action>
|
|
571
|
+
<Banner.Action href="https://dash.cloudflare.com/">
|
|
572
|
+
Manage payments
|
|
573
|
+
</Banner.Action>
|
|
574
|
+
</>
|
|
575
|
+
}
|
|
576
|
+
/>
|
|
577
|
+
```
|
|
578
|
+
|
|
556
579
|
```tsx
|
|
557
580
|
<Banner
|
|
558
581
|
size="sm"
|
|
@@ -1794,6 +1817,8 @@ Read-only text field with a one-click copy-to-clipboard button.
|
|
|
1794
1817
|
The text to display and copy to clipboard.
|
|
1795
1818
|
- `textToCopy`: string
|
|
1796
1819
|
If provided, this text will be copied to clipboard instead of the `text` prop.
|
|
1820
|
+
- `masked`: boolean
|
|
1821
|
+
Masks the text initially and adds a control to reveal or hide it.
|
|
1797
1822
|
- `className`: string
|
|
1798
1823
|
Additional CSS classes merged via `cn()`.
|
|
1799
1824
|
- `tooltip`: object
|
|
@@ -1857,6 +1882,12 @@ Read-only text field with a one-click copy-to-clipboard button.
|
|
|
1857
1882
|
<ClipboardText text="0c239dd2" />
|
|
1858
1883
|
```
|
|
1859
1884
|
|
|
1885
|
+
```tsx
|
|
1886
|
+
<div className="w-full max-w-xs">
|
|
1887
|
+
<ClipboardText className="w-full" text="sk_live_51H8_abc123" masked />
|
|
1888
|
+
</div>
|
|
1889
|
+
```
|
|
1890
|
+
|
|
1860
1891
|
```tsx
|
|
1861
1892
|
<ClipboardText
|
|
1862
1893
|
text="sk_live_***********"
|
|
@@ -3338,13 +3369,14 @@ DatePicker — a date selection calendar.
|
|
|
3338
3369
|
|
|
3339
3370
|
**Colors (kumo tokens used):**
|
|
3340
3371
|
|
|
3341
|
-
`bg-kumo-base`
|
|
3372
|
+
`bg-kumo-base`, `bg-kumo-contrast`, `bg-kumo-fill`, `bg-kumo-interact`, `bg-kumo-tint`, `ring-kumo-brand`, `ring-kumo-line`, `text-kumo-default`, `text-kumo-inactive`, `text-kumo-inverse`, `text-kumo-link`, `text-kumo-subtle`
|
|
3342
3373
|
|
|
3343
3374
|
**Examples:**
|
|
3344
3375
|
|
|
3345
3376
|
```tsx
|
|
3346
3377
|
<div className="flex flex-col gap-4">
|
|
3347
3378
|
<DatePicker
|
|
3379
|
+
className="p-3"
|
|
3348
3380
|
mode="single"
|
|
3349
3381
|
selected={date}
|
|
3350
3382
|
onChange={(d) => {
|
|
@@ -3362,6 +3394,7 @@ DatePicker — a date selection calendar.
|
|
|
3362
3394
|
```tsx
|
|
3363
3395
|
<div className="flex flex-col gap-4">
|
|
3364
3396
|
<DatePicker
|
|
3397
|
+
className="p-3"
|
|
3365
3398
|
mode="multiple"
|
|
3366
3399
|
selected={dates}
|
|
3367
3400
|
onChange={setDates}
|
|
@@ -3376,6 +3409,7 @@ DatePicker — a date selection calendar.
|
|
|
3376
3409
|
```tsx
|
|
3377
3410
|
<div className="flex flex-col gap-4">
|
|
3378
3411
|
<DatePicker
|
|
3412
|
+
className="p-3"
|
|
3379
3413
|
mode="range"
|
|
3380
3414
|
selected={range}
|
|
3381
3415
|
onChange={setRange}
|
|
@@ -3393,6 +3427,7 @@ DatePicker — a date selection calendar.
|
|
|
3393
3427
|
```tsx
|
|
3394
3428
|
<div className="flex flex-col gap-4">
|
|
3395
3429
|
<DatePicker
|
|
3430
|
+
className="p-3"
|
|
3396
3431
|
mode="range"
|
|
3397
3432
|
selected={range}
|
|
3398
3433
|
onChange={setRange}
|
|
@@ -3405,6 +3440,18 @@ DatePicker — a date selection calendar.
|
|
|
3405
3440
|
</div>
|
|
3406
3441
|
```
|
|
3407
3442
|
|
|
3443
|
+
```tsx
|
|
3444
|
+
<DatePicker
|
|
3445
|
+
className="p-3"
|
|
3446
|
+
mode="single"
|
|
3447
|
+
selected={date}
|
|
3448
|
+
onChange={setDate}
|
|
3449
|
+
captionLayout="dropdown"
|
|
3450
|
+
startMonth={new Date(2020, 0)}
|
|
3451
|
+
endMonth={new Date(2030, 11)}
|
|
3452
|
+
/>
|
|
3453
|
+
```
|
|
3454
|
+
|
|
3408
3455
|
```tsx
|
|
3409
3456
|
<Popover>
|
|
3410
3457
|
<Popover.Trigger
|
|
@@ -3455,7 +3502,7 @@ DatePicker — a date selection calendar.
|
|
|
3455
3502
|
onClick={() => handlePresetClick(preset)}
|
|
3456
3503
|
className={`rounded-md px-3 py-1.5 text-left whitespace-nowrap ${
|
|
3457
3504
|
isActive
|
|
3458
|
-
? "bg-kumo-
|
|
3505
|
+
? "bg-kumo-contrast text-kumo-inverse"
|
|
3459
3506
|
: "text-kumo-subtle hover:bg-kumo-control"
|
|
3460
3507
|
}`}
|
|
3461
3508
|
>
|
|
@@ -3481,6 +3528,7 @@ DatePicker — a date selection calendar.
|
|
|
3481
3528
|
|
|
3482
3529
|
```tsx
|
|
3483
3530
|
<DatePicker
|
|
3531
|
+
className="p-3"
|
|
3484
3532
|
mode="multiple"
|
|
3485
3533
|
selected={dates}
|
|
3486
3534
|
onChange={setDates}
|
|
@@ -5742,7 +5790,7 @@ LayerDialog component
|
|
|
5742
5790
|
|
|
5743
5791
|
**Colors (kumo tokens used):**
|
|
5744
5792
|
|
|
5745
|
-
`bg-kumo-base`, `bg-kumo-contrast`, `bg-kumo-elevated`, `bg-kumo-fill`, `bg-kumo-recessed`, `border-kumo-hairline`
|
|
5793
|
+
`bg-kumo-base`, `bg-kumo-contrast`, `bg-kumo-elevated`, `bg-kumo-fill`, `bg-kumo-hairline`, `bg-kumo-recessed`, `border-kumo-hairline`
|
|
5746
5794
|
|
|
5747
5795
|
**Sub-Components:**
|
|
5748
5796
|
|
|
@@ -5792,6 +5840,10 @@ Body sub-component
|
|
|
5792
5840
|
Props:
|
|
5793
5841
|
- `children`: ReactNode (required)
|
|
5794
5842
|
|
|
5843
|
+
#### LayerDialog.Separator
|
|
5844
|
+
|
|
5845
|
+
Separator sub-component
|
|
5846
|
+
|
|
5795
5847
|
#### LayerDialog.Action
|
|
5796
5848
|
|
|
5797
5849
|
Action sub-component
|
|
@@ -5935,6 +5987,32 @@ Props:
|
|
|
5935
5987
|
</LayerDialog.Root>
|
|
5936
5988
|
```
|
|
5937
5989
|
|
|
5990
|
+
```tsx
|
|
5991
|
+
<LayerDialog.Root>
|
|
5992
|
+
<LayerDialog.Trigger
|
|
5993
|
+
render={(props) => <Button {...props}>Review deployment</Button>}
|
|
5994
|
+
/>
|
|
5995
|
+
<LayerDialog.Content>
|
|
5996
|
+
<LayerDialog.Title>Deployment summary</LayerDialog.Title>
|
|
5997
|
+
<LayerDialog.Description>
|
|
5998
|
+
Review the configuration before deploying.
|
|
5999
|
+
</LayerDialog.Description>
|
|
6000
|
+
<LayerDialog.Body>
|
|
6001
|
+
<Text variant="secondary">
|
|
6002
|
+
production-api will deploy to the global network.
|
|
6003
|
+
</Text>
|
|
6004
|
+
<LayerDialog.Separator />
|
|
6005
|
+
<Text variant="secondary">
|
|
6006
|
+
The deployment uses compatibility date 2026-10-26.
|
|
6007
|
+
</Text>
|
|
6008
|
+
</LayerDialog.Body>
|
|
6009
|
+
<LayerDialog.Actions>
|
|
6010
|
+
<LayerDialog.Action>Deploy</LayerDialog.Action>
|
|
6011
|
+
</LayerDialog.Actions>
|
|
6012
|
+
</LayerDialog.Content>
|
|
6013
|
+
</LayerDialog.Root>
|
|
6014
|
+
```
|
|
6015
|
+
|
|
5938
6016
|
```tsx
|
|
5939
6017
|
<div className="flex flex-wrap justify-center gap-3">
|
|
5940
6018
|
<LayerDialog.Root>
|
package/ai/schemas.ts
CHANGED
|
@@ -46,6 +46,7 @@ export type LogicExpression =
|
|
|
46
46
|
| { or: LogicExpression[] }
|
|
47
47
|
| { not: LogicExpression }
|
|
48
48
|
| { path: string }
|
|
49
|
+
| { auth: "signedIn" | "signedOut" }
|
|
49
50
|
| { eq: [DynamicValue, DynamicValue] }
|
|
50
51
|
| { neq: [DynamicValue, DynamicValue] }
|
|
51
52
|
| { gt: [DynamicValue, DynamicValue] }
|
|
@@ -60,6 +61,7 @@ const LogicExpressionSchema: z.ZodType<LogicExpression> = z.lazy(() =>
|
|
|
60
61
|
z.object({ or: z.array(LogicExpressionSchema) }),
|
|
61
62
|
z.object({ not: LogicExpressionSchema }),
|
|
62
63
|
z.object({ path: z.string() }),
|
|
64
|
+
z.object({ auth: z.enum(["signedIn", "signedOut"]) }),
|
|
63
65
|
z.object({ eq: z.tuple([DynamicValueSchema, DynamicValueSchema]) }),
|
|
64
66
|
z.object({ neq: z.tuple([DynamicValueSchema, DynamicValueSchema]) }),
|
|
65
67
|
z.object({ gt: z.tuple([DynamicValueSchema, DynamicValueSchema]) }),
|
|
@@ -255,6 +257,7 @@ export const ClipboardTextPropsSchema = z.object({
|
|
|
255
257
|
size: z.enum(["sm", "base", "lg"]).optional(), // Size of the clipboard text field. - `"sm"` — Small clipboard text for compact UIs - `"base"` — Default clipboard text size - `"lg"` — Large clipboard text for prominent display
|
|
256
258
|
text: z.string(), // The text to display and copy to clipboard.
|
|
257
259
|
textToCopy: z.string().optional(), // If provided, this text will be copied to clipboard instead of the `text` prop.
|
|
260
|
+
masked: z.boolean().optional(), // Masks the text initially and adds a control to reveal or hide it.
|
|
258
261
|
className: z.string().optional(), // Additional CSS classes merged via `cn()`.
|
|
259
262
|
tooltip: z.unknown().optional(), // Tooltip config. Shows tooltip on hover, anchored toast on click.
|
|
260
263
|
labels: z.unknown().optional(), // Accessible labels for i18n.
|
package/dist/.build-complete
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1794240799832
|
package/dist/ai/schemas.d.ts
CHANGED
|
@@ -31,6 +31,8 @@ export type LogicExpression = {
|
|
|
31
31
|
not: LogicExpression;
|
|
32
32
|
} | {
|
|
33
33
|
path: string;
|
|
34
|
+
} | {
|
|
35
|
+
auth: "signedIn" | "signedOut";
|
|
34
36
|
} | {
|
|
35
37
|
eq: [DynamicValue, DynamicValue];
|
|
36
38
|
} | {
|
|
@@ -322,6 +324,7 @@ export declare const ClipboardTextPropsSchema: z.ZodObject<{
|
|
|
322
324
|
}>>;
|
|
323
325
|
text: z.ZodString;
|
|
324
326
|
textToCopy: z.ZodOptional<z.ZodString>;
|
|
327
|
+
masked: z.ZodOptional<z.ZodBoolean>;
|
|
325
328
|
className: z.ZodOptional<z.ZodString>;
|
|
326
329
|
tooltip: z.ZodOptional<z.ZodUnknown>;
|
|
327
330
|
labels: z.ZodOptional<z.ZodUnknown>;
|
|
@@ -1809,6 +1812,7 @@ export declare const ComponentPropsSchemas: {
|
|
|
1809
1812
|
}>>;
|
|
1810
1813
|
text: z.ZodString;
|
|
1811
1814
|
textToCopy: z.ZodOptional<z.ZodString>;
|
|
1815
|
+
masked: z.ZodOptional<z.ZodBoolean>;
|
|
1812
1816
|
className: z.ZodOptional<z.ZodString>;
|
|
1813
1817
|
tooltip: z.ZodOptional<z.ZodUnknown>;
|
|
1814
1818
|
labels: z.ZodOptional<z.ZodUnknown>;
|
package/dist/ai/schemas.js
CHANGED
|
@@ -4055,6 +4055,7 @@ const LogicExpressionSchema = lazy(() => union([
|
|
|
4055
4055
|
object({ or: array(LogicExpressionSchema) }),
|
|
4056
4056
|
object({ not: LogicExpressionSchema }),
|
|
4057
4057
|
object({ path: string() }),
|
|
4058
|
+
object({ auth: _enum(["signedIn", "signedOut"]) }),
|
|
4058
4059
|
object({ eq: tuple([DynamicValueSchema, DynamicValueSchema]) }),
|
|
4059
4060
|
object({ neq: tuple([DynamicValueSchema, DynamicValueSchema]) }),
|
|
4060
4061
|
object({ gt: tuple([DynamicValueSchema, DynamicValueSchema]) }),
|
|
@@ -4366,6 +4367,7 @@ const ClipboardTextPropsSchema = object({
|
|
|
4366
4367
|
]).optional(),
|
|
4367
4368
|
text: string(),
|
|
4368
4369
|
textToCopy: string().optional(),
|
|
4370
|
+
masked: boolean().optional(),
|
|
4369
4371
|
className: string().optional(),
|
|
4370
4372
|
tooltip: unknown().optional(),
|
|
4371
4373
|
labels: unknown().optional()
|
|
@@ -27,11 +27,11 @@ declare const KUMO_BUTTON_VARIANTS: {
|
|
|
27
27
|
readonly description: "Small button for secondary actions";
|
|
28
28
|
};
|
|
29
29
|
readonly base: {
|
|
30
|
-
readonly classes: "h-9 gap-1.5 rounded-lg px-3 text-base";
|
|
30
|
+
readonly classes: "h-9 gap-1.5 rounded-lg px-3 text-base leading-5";
|
|
31
31
|
readonly description: "Default button size";
|
|
32
32
|
};
|
|
33
33
|
readonly lg: {
|
|
34
|
-
readonly classes: "h-10 gap-2 rounded-lg px-4 text-base";
|
|
34
|
+
readonly classes: "h-10 gap-2 rounded-lg px-4 text-base leading-5";
|
|
35
35
|
readonly description: "Large button for primary CTAs";
|
|
36
36
|
};
|
|
37
37
|
};
|
package/dist/catalog.d.ts
CHANGED
|
@@ -29,6 +29,8 @@ type LogicExpression = {
|
|
|
29
29
|
not: LogicExpression;
|
|
30
30
|
} | {
|
|
31
31
|
path: string;
|
|
32
|
+
} | {
|
|
33
|
+
auth: "signedIn" | "signedOut";
|
|
32
34
|
} | {
|
|
33
35
|
eq: [DynamicValue, DynamicValue];
|
|
34
36
|
} | {
|
|
@@ -333,7 +335,8 @@ export declare function isDynamicPath(value: unknown): value is {
|
|
|
333
335
|
export declare function resolveDynamicValue<T>(value: DynamicValue<T>, dataModel: DataModel): T | undefined;
|
|
334
336
|
/**
|
|
335
337
|
* Resolve all dynamic values in an object.
|
|
336
|
-
* Recursively resolves any { path: string } references
|
|
338
|
+
* Recursively resolves any { path: string } references, including
|
|
339
|
+
* those nested inside arrays.
|
|
337
340
|
*/
|
|
338
341
|
export declare function resolveProps(props: Record<string, unknown>, dataModel: DataModel): Record<string, unknown>;
|
|
339
342
|
//#endregion
|
package/dist/catalog.js
CHANGED
|
@@ -70,7 +70,7 @@ function createKumoCatalog(config = {}) {
|
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
72
|
hasAction(name) {
|
|
73
|
-
return name
|
|
73
|
+
return Object.hasOwn(actions, name);
|
|
74
74
|
},
|
|
75
75
|
validateElement(element) {
|
|
76
76
|
try {
|
|
@@ -195,6 +195,18 @@ async function initCatalog(_catalog) {
|
|
|
195
195
|
}
|
|
196
196
|
//#endregion
|
|
197
197
|
//#region src/catalog/data.ts
|
|
198
|
+
const FORBIDDEN_KEYS = /* @__PURE__ */ new Set([
|
|
199
|
+
"__proto__",
|
|
200
|
+
"constructor",
|
|
201
|
+
"prototype"
|
|
202
|
+
]);
|
|
203
|
+
/**
|
|
204
|
+
* Split a JSON Pointer into segments, decoding `~1` to `/` and `~0` to `~`
|
|
205
|
+
* (RFC 6901). A leading slash is optional.
|
|
206
|
+
*/
|
|
207
|
+
function parsePath(path) {
|
|
208
|
+
return (path.startsWith("/") ? path.slice(1) : path).split("/").map((segment) => segment.replace(/~1/g, "/").replace(/~0/g, "~"));
|
|
209
|
+
}
|
|
198
210
|
/**
|
|
199
211
|
* Get a value from an object by JSON Pointer path.
|
|
200
212
|
*
|
|
@@ -206,7 +218,7 @@ async function initCatalog(_catalog) {
|
|
|
206
218
|
*/
|
|
207
219
|
function getByPath(obj, path) {
|
|
208
220
|
if (!path || path === "/") return obj;
|
|
209
|
-
const segments =
|
|
221
|
+
const segments = parsePath(path);
|
|
210
222
|
let current = obj;
|
|
211
223
|
for (const segment of segments) {
|
|
212
224
|
if (current === null || current === void 0) return;
|
|
@@ -225,12 +237,13 @@ function getByPath(obj, path) {
|
|
|
225
237
|
* // data is now { user: { name: "John" } }
|
|
226
238
|
*/
|
|
227
239
|
function setByPath(obj, path, value) {
|
|
228
|
-
const segments =
|
|
229
|
-
if (segments.
|
|
240
|
+
const segments = parsePath(path);
|
|
241
|
+
if (segments.some((segment) => FORBIDDEN_KEYS.has(segment))) return;
|
|
230
242
|
let current = obj;
|
|
231
243
|
for (let i = 0; i < segments.length - 1; i++) {
|
|
232
244
|
const segment = segments[i];
|
|
233
|
-
|
|
245
|
+
const next = Object.hasOwn(current, segment) ? current[segment] : void 0;
|
|
246
|
+
if (typeof next !== "object" || next === null) current[segment] = {};
|
|
234
247
|
current = current[segment];
|
|
235
248
|
}
|
|
236
249
|
const lastSegment = segments[segments.length - 1];
|
|
@@ -257,15 +270,20 @@ function resolveDynamicValue(value, dataModel) {
|
|
|
257
270
|
if (isDynamicPath(value)) return getByPath(dataModel, value.path);
|
|
258
271
|
return value;
|
|
259
272
|
}
|
|
273
|
+
function resolveValue(value, dataModel) {
|
|
274
|
+
if (isDynamicPath(value)) return getByPath(dataModel, value.path);
|
|
275
|
+
if (Array.isArray(value)) return value.map((item) => resolveValue(item, dataModel));
|
|
276
|
+
if (typeof value === "object" && value !== null) return resolveProps(value, dataModel);
|
|
277
|
+
return value;
|
|
278
|
+
}
|
|
260
279
|
/**
|
|
261
280
|
* Resolve all dynamic values in an object.
|
|
262
|
-
* Recursively resolves any { path: string } references
|
|
281
|
+
* Recursively resolves any { path: string } references, including
|
|
282
|
+
* those nested inside arrays.
|
|
263
283
|
*/
|
|
264
284
|
function resolveProps(props, dataModel) {
|
|
265
285
|
const resolved = {};
|
|
266
|
-
for (const [key, value] of Object.entries(props))
|
|
267
|
-
else if (typeof value === "object" && value !== null && !Array.isArray(value)) resolved[key] = resolveProps(value, dataModel);
|
|
268
|
-
else resolved[key] = value;
|
|
286
|
+
for (const [key, value] of Object.entries(props)) resolved[key] = resolveValue(value, dataModel);
|
|
269
287
|
return resolved;
|
|
270
288
|
}
|
|
271
289
|
//#endregion
|
|
@@ -283,9 +301,18 @@ function isTruthy(value) {
|
|
|
283
301
|
return Boolean(value);
|
|
284
302
|
}
|
|
285
303
|
/**
|
|
304
|
+
* Evaluate an auth condition.
|
|
305
|
+
*/
|
|
306
|
+
function evaluateAuth(auth, ctx) {
|
|
307
|
+
if (auth === "signedIn") return ctx.auth.isSignedIn;
|
|
308
|
+
if (auth === "signedOut") return !ctx.auth.isSignedIn;
|
|
309
|
+
return false;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
286
312
|
* Evaluate a logic expression.
|
|
287
313
|
*/
|
|
288
314
|
function evaluateLogicExpression(expr, ctx) {
|
|
315
|
+
if ("auth" in expr) return evaluateAuth(expr.auth, ctx);
|
|
289
316
|
if ("path" in expr && !("eq" in expr) && !("neq" in expr)) return isTruthy(getByPath(ctx.data, expr.path));
|
|
290
317
|
if ("and" in expr) return expr.and.every((e) => evaluateLogicExpression(e, ctx));
|
|
291
318
|
if ("or" in expr) return expr.or.some((e) => evaluateLogicExpression(e, ctx));
|
|
@@ -340,11 +367,7 @@ function evaluateLogicExpression(expr, ctx) {
|
|
|
340
367
|
function evaluateVisibility(condition, ctx) {
|
|
341
368
|
if (condition === void 0) return true;
|
|
342
369
|
if (typeof condition === "boolean") return condition;
|
|
343
|
-
if ("auth" in condition)
|
|
344
|
-
if (condition.auth === "signedIn") return ctx.auth.isSignedIn;
|
|
345
|
-
if (condition.auth === "signedOut") return !ctx.auth.isSignedIn;
|
|
346
|
-
return true;
|
|
347
|
-
}
|
|
370
|
+
if ("auth" in condition) return evaluateAuth(condition.auth, ctx);
|
|
348
371
|
if ("path" in condition && !("and" in condition) && !("or" in condition)) return isTruthy(getByPath(ctx.data, condition.path));
|
|
349
372
|
return evaluateLogicExpression(condition, ctx);
|
|
350
373
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as cn } from "./vendor-styling-gs32v7xt5znc8kg0.js";
|
|
3
3
|
import { t as resolveVariant } from "./resolve-variant-l6x5ksfrjtu4m66l.js";
|
|
4
|
-
import { t as Field } from "./field-
|
|
5
|
-
import { n as KUMO_INPUT_VARIANTS, r as inputVariants } from "./input-
|
|
4
|
+
import { t as Field } from "./field-crf1hw5exr2oxemk.js";
|
|
5
|
+
import { n as KUMO_INPUT_VARIANTS, r as inputVariants } from "./input-d1230n06m5b1p3rd.js";
|
|
6
6
|
import { a as ComboboxGroupLabel, c as ComboboxCollection, l as ComboboxInput, o as ComboboxGroup, s as ComboboxList, t as ComboboxEmpty, w as useCoreFilter } from "./ComboboxEmpty-gkt1y5b81a4983v7.js";
|
|
7
7
|
import { n as ComboboxPositioner, r as ComboboxPortal, t as ComboboxPopup } from "./ComboboxPopup-n8cbgys9st446j1i.js";
|
|
8
8
|
import { n as AutocompleteRoot, t as AutocompleteItem } from "./AutocompleteItem-36ysm5nwbsd0snr6.js";
|