@cloudflare/kumo 2.17.0 → 2.18.1
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 +46 -0
- package/ai/USAGE.md +6 -0
- package/ai/component-registry.json +7 -6
- package/ai/component-registry.md +24 -1
- package/ai/schemas.ts +3 -1
- package/dist/.build-complete +1 -1
- package/dist/ai/schemas.d.ts +2 -0
- package/dist/ai/schemas.js +1 -0
- package/dist/{button-Bbi7gFL7.d.ts → button-DzavLWXm.d.ts} +3 -3
- package/dist/catalog.d.ts +4 -1
- package/dist/catalog.js +37 -14
- package/dist/chunks/{autocomplete-evlm6fj7v7w0g2z2.js → autocomplete-kx87ui5sodpxx2zm.js} +2 -2
- package/dist/chunks/{badge-kyz53p7p0ng393bs.js → badge-g0m6j3nji45tiink.js} +4 -2
- package/dist/chunks/{banner-lvbgdzxq3yndkbot.js → banner-mo1xl9ww734kgsqh.js} +21 -10
- package/dist/chunks/{breadcrumbs-fsuyq7z6hdh1thjv.js → breadcrumbs-o63hllvg6zlbxvcr.js} +2 -2
- package/dist/chunks/{button-k7axs4vu1rwx89w3.js → button-hzvowfkbathmx8yg.js} +12 -17
- package/dist/chunks/{chart-hp3vqwe49tbyywqm.js → chart-g4dnsqiamjh39chn.js} +1 -1
- package/dist/chunks/{checkbox-g8b4f2hs5vux3u26.js → checkbox-oav03hnpbj06x31v.js} +5 -5
- package/dist/chunks/{clipboard-text-fffd5tpa0iye6r6m.js → clipboard-text-ldk0zyq1qtey1yux.js} +2 -2
- package/dist/chunks/{combobox-iawd8lxwd5b18fce.js → combobox-iwqfbp2cn3z54azu.js} +18 -6
- package/dist/chunks/{command-palette-el4x943vpmid0po0.js → command-palette-d45ueqbuxygu87ir.js} +1 -1
- package/dist/chunks/{date-picker-kfoxd4u7ckg4nsez.js → date-picker-ija2bz17ai6ypnao.js} +3 -3
- package/dist/chunks/{date-range-picker-hpx3cdu9ve01jx6d.js → date-range-picker-oivlshld01jbel29.js} +1 -1
- package/dist/chunks/{dialog-lgrwmsumwpftp2u8.js → dialog-g7wavhkdv2gplwq9.js} +2 -2
- package/dist/chunks/{dropdown-o875yxeqod7qp871.js → dropdown-m5a8nwer5hpvnkfk.js} +3 -1
- package/dist/chunks/{empty-ir5bg5w4kkisuc1c.js → empty-dzm61keqaezmp452.js} +1 -1
- package/dist/chunks/{field-n7gmbg5xvh6oqbom.js → field-gkrpde59au4kjh7q.js} +1 -1
- package/dist/chunks/{inline-copy-text-57r67slswfqvgbaf.js → inline-copy-text-c6wa49ys72pj7k53.js} +1 -1
- package/dist/chunks/{input-iev3wgdzhkqpae2k.js → input-ehb5hnwkr2kx9rpw.js} +2 -2
- package/dist/chunks/{input-f0pbcvjudf5zb8ek.js → input-ggn78losfydwdjqg.js} +2 -2
- package/dist/chunks/{input-group-dqo5tcoewbdx86qx.js → input-group-grlfeiivjuhd7jif.js} +8 -6
- package/dist/chunks/{label-njfcj6h9utmg2n9l.js → label-f9vvtexndkpjlrv0.js} +1 -1
- package/dist/chunks/{layer-card-mar4dya5kl1vvie6.js → layer-card-lsmeuqic9i1isv2b.js} +2 -2
- package/dist/chunks/{layer-dialog-n7foup6icxowm82n.js → layer-dialog-cwpiki9rq2s6yidp.js} +3 -3
- package/dist/chunks/{menubar-b454nksysu0wicbz.js → menubar-gzlyhmmc4i24prn1.js} +1 -1
- package/dist/chunks/{pagination-mwlpbysq4cxmvs45.js → pagination-h5l4b9bfmf78s6jq.js} +2 -2
- package/dist/chunks/{radio-d3pkrvsldfbdefav.js → radio-nf717i5ypsga9zdh.js} +34 -33
- package/dist/chunks/{select-fae2ls189jrq902h.js → select-ei05w4df1th4fa4e.js} +10 -10
- package/dist/chunks/{sensitive-input-heb3xapwahzhpq6y.js → sensitive-input-owfvgxmefm5lzzx8.js} +4 -3
- package/dist/chunks/{sidebar-h6g412ror8p7uo0d.js → sidebar-jhwzfl3xpsfns60z.js} +11 -9
- package/dist/chunks/skeleton-line-kmhnp0lx3rxhioxa.js +74 -0
- package/dist/chunks/{slider-juwif2d8xa5n0429.js → slider-e395gihi5cjd62ss.js} +1 -1
- package/dist/chunks/{surface-ginwpan1pz61l6k2.js → surface-jr8x5hy0gucjk5ig.js} +1 -1
- package/dist/chunks/{switch-ktfauhluw1yi5tkk.js → switch-e1dsoxucn07fz00t.js} +4 -4
- package/dist/chunks/{table-lp41fsw7mqr751hn.js → table-m0xshmsbxq2h1sho.js} +1 -1
- package/dist/chunks/{tabs-mmkz7q5rofnmogwt.js → tabs-oi64kuuf2poro26u.js} +2 -2
- package/dist/chunks/{tag-input-k6vzllby4qebmv63.js → tag-input-fm0pwt6kea4q137b.js} +3 -3
- package/dist/chunks/{toast-kzwscia42707sau6.js → toast-iojuzen6iavawpc9.js} +1 -1
- package/dist/chunks/{toolbar-nnos2ouwfk7i6tpw.js → toolbar-3wkkukczgo0bk6mo.js} +3 -3
- package/dist/chunks/unwrap-lazy-element-hzbdkmujhd7iksau.js +45 -0
- package/dist/code.js +1 -1
- package/dist/command-line/cli.js +6 -5
- package/dist/components/autocomplete.js +1 -1
- package/dist/components/badge.d.ts +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.js +1 -1
- package/dist/components/combobox.d.ts +1 -1
- package/dist/components/combobox.js +1 -1
- package/dist/components/command-palette.js +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-card.js +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.d.ts +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/surface.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/{index-BMe3cpLB.d.ts → index-CUT5x1Z2.d.ts} +2 -2
- package/dist/{index-jNWPjJl9.d.ts → index-D4_C1J_8.d.ts} +1 -1
- package/dist/index-DL1-uSuH.d.ts +1 -0
- package/dist/{index-CdSf6Vfc.d.ts → index-DmhpD22M.d.ts} +1 -1
- package/dist/{index-DWZia2ui.d.ts → index-DwNMa4LN.d.ts} +5 -1
- 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-CSWbPhke.d.ts → index-NnHba-T1.d.ts} +15 -5
- package/dist/{index--RbAKeBL.d.ts → index-aahL-0Zw.d.ts} +2 -2
- package/dist/index-wD5WGQQz.d.ts +136 -0
- package/dist/index.d.ts +11 -11
- package/dist/index.js +38 -38
- package/dist/{input-group-B3M_WRqm.d.ts → input-group-8gEtPiKw.d.ts} +1 -1
- package/dist/styles/kumo-standalone.css +1 -1
- package/package.json +1 -1
- package/scripts/component-registry/schema-generator.ts +2 -0
- package/dist/chunks/skeleton-line-gjf1fecmyy82aejz.js +0 -43
- package/dist/index-B-hCpI5K.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,51 @@
|
|
|
1
1
|
# @cloudflare/kumo
|
|
2
2
|
|
|
3
|
+
## 2.18.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8729c71: fix(dialog): let flex column dialogs shrink a scrollable body again
|
|
8
|
+
|
|
9
|
+
2.18.0 added `*:shrink-0` to every `Dialog`, which stopped dialogs built as `flex flex-col max-h-[…] overflow-hidden` with a `flex-1 min-h-0 overflow-y-auto` body from scrolling: the body kept its full height and the footer was clipped out of reach. `Dialog` no longer sets `flex-shrink` on its children. `LayerCard.Primary` and `LayerCard.Secondary` now carry `shrink-0` themselves, so layered dialogs still keep their sections from being squashed, and a section can opt back into shrinking with `className="min-h-0 flex-1"`.
|
|
10
|
+
|
|
11
|
+
If you added `*:shrink` to a `Dialog` to work around 2.18.0, it is no longer needed and can be removed.
|
|
12
|
+
|
|
13
|
+
- 63d0398: Fix `kumo migrate` so that stdout stays valid JSON when no token migrations are pending. The "No pending token migrations." text now goes to stderr, and stdout is a JSON object with an empty `classes` map. `--classes` output is unchanged.
|
|
14
|
+
- aede2c3: Remove the inherited resting background from ghost buttons so translucent parent surfaces do not appear darker beneath them.
|
|
15
|
+
- 68ead88: Name `Radio.Group`'s radiogroup with its legend.
|
|
16
|
+
|
|
17
|
+
`Radio.Group` rendered an unnamed `role="radiogroup"` element around a `<fieldset>` that the legend named, so assistive technology announced a radiogroup with no name. The radiogroup now renders as the fieldset itself, so there is one element, `<fieldset role="radiogroup">`, named by its `legend` or `Radio.Legend`. Queries like `getByRole("group", { name })` for a radio group's legend become `getByRole("radiogroup", { name })`.
|
|
18
|
+
|
|
19
|
+
- 27f8615: Select: a visible `label` now names the trigger whatever its type. A ReactNode label, such as a translated `<Trans>` element, used to leave the trigger unnamed or named by its placeholder. The trigger now points `aria-labelledby` at the rendered label, which also keeps the name when `render` sets the trigger's `id`. A consumer `aria-labelledby` next to a visible label is now honored.
|
|
20
|
+
- ac1cbbf: Fix `SensitiveInput` not forwarding `required` to the native input. The prop only decorated the label, so an empty required field did not block form submission.
|
|
21
|
+
- 8c058ff: Fix Badge height inconsistencies by setting an explicit line-height instead of relying on the parent or consumer typography theme.
|
|
22
|
+
|
|
23
|
+
## 2.18.0
|
|
24
|
+
|
|
25
|
+
### Minor Changes
|
|
26
|
+
|
|
27
|
+
- 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.
|
|
28
|
+
- 085332b: Add `href` to `Banner.Action` so actions can render as links. Link actions use `LinkButton`, so they respect `LinkProvider` and support `external`.
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- 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.
|
|
33
|
+
- 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.
|
|
34
|
+
- 12cd0fa: Fix several catalog runtime bugs:
|
|
35
|
+
|
|
36
|
+
- `setByPath` replaces `null` intermediate values instead of throwing, and ignores `__proto__`/`constructor`/`prototype` segments
|
|
37
|
+
- `getByPath` and `setByPath` decode JSON Pointer escapes (`~1` → `/`, `~0` → `~`)
|
|
38
|
+
- `{ 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
|
|
39
|
+
- `resolveProps` resolves `{ path }` references inside arrays
|
|
40
|
+
- `hasAction` no longer reports `Object.prototype` names such as `toString` as registered actions
|
|
41
|
+
|
|
42
|
+
- 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.
|
|
43
|
+
- 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.
|
|
44
|
+
- 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.
|
|
45
|
+
- 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
|
|
46
|
+
- 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).
|
|
47
|
+
- 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.
|
|
48
|
+
|
|
3
49
|
## 2.17.0
|
|
4
50
|
|
|
5
51
|
### 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 |
|
|
@@ -307,7 +307,7 @@
|
|
|
307
307
|
"text-kumo-success",
|
|
308
308
|
"text-kumo-warning"
|
|
309
309
|
],
|
|
310
|
-
"baseStyles": "inline-flex w-fit flex-none shrink-0 items-center justify-self-start gap-1 rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap [a:hover_&]:ring [a:hover_&]:ring-current"
|
|
310
|
+
"baseStyles": "inline-flex w-fit flex-none shrink-0 items-center justify-self-start gap-1 rounded-full px-2 py-0.5 text-xs/4 font-medium whitespace-nowrap [a:hover_&]:ring [a:hover_&]:ring-current"
|
|
311
311
|
},
|
|
312
312
|
"Banner": {
|
|
313
313
|
"name": "Banner",
|
|
@@ -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
|
},
|
|
@@ -742,7 +743,7 @@
|
|
|
742
743
|
"classes": {
|
|
743
744
|
"primary": "relative overflow-hidden bg-(--kumo-button-emphasis-bg) !text-white ring ring-(--kumo-button-emphasis-ring) focus:ring-(--kumo-button-emphasis-ring) focus-visible:ring-(--kumo-button-emphasis-ring) active:ring-(--kumo-button-emphasis-ring) disabled:opacity-50",
|
|
744
745
|
"secondary": "bg-kumo-base !text-kumo-default ring not-disabled:hover:bg-kumo-tint disabled:bg-kumo-base/50 disabled:!text-kumo-default/70 ring-kumo-line data-[state=open]:bg-kumo-base",
|
|
745
|
-
"ghost": "text-kumo-default hover:bg-kumo-tint shadow-none
|
|
746
|
+
"ghost": "text-kumo-default hover:bg-kumo-tint shadow-none",
|
|
746
747
|
"destructive": "relative overflow-hidden bg-(--kumo-button-emphasis-bg) !text-white ring ring-(--kumo-button-emphasis-ring) focus:ring-(--kumo-button-emphasis-ring) focus-visible:ring-(--kumo-button-emphasis-ring) active:ring-(--kumo-button-emphasis-ring) disabled:opacity-50",
|
|
747
748
|
"secondary-destructive": "bg-kumo-base !text-kumo-danger ring not-disabled:hover:!text-kumo-danger not-disabled:hover:ring-kumo-danger/30 disabled:bg-kumo-base/50 disabled:!text-kumo-danger/70 ring-kumo-line data-[state=open]:bg-kumo-base",
|
|
748
749
|
"outline": "bg-transparent text-kumo-default ring ring-kumo-line transition-colors not-disabled:hover:text-kumo-strong not-disabled:hover:ring-kumo-focus/25"
|
|
@@ -4163,7 +4164,7 @@
|
|
|
4163
4164
|
"text-kumo-default"
|
|
4164
4165
|
],
|
|
4165
4166
|
"styling": {
|
|
4166
|
-
"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"
|
|
4167
4168
|
}
|
|
4168
4169
|
},
|
|
4169
4170
|
"Input": {
|
|
@@ -5744,7 +5745,7 @@
|
|
|
5744
5745
|
"render": {
|
|
5745
5746
|
"type": "ReactNode",
|
|
5746
5747
|
"optional": true,
|
|
5747
|
-
"description": "Replaces the trigger element while preserving Select behavior."
|
|
5748
|
+
"description": "Replaces the trigger element while preserving Select behavior. Set the trigger's `id` with Select's `id` prop: Base UI does not see an `id` set here, so clicking the label would not focus the trigger."
|
|
5748
5749
|
},
|
|
5749
5750
|
"size": {
|
|
5750
5751
|
"type": "enum",
|
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"
|
|
@@ -7918,7 +7941,7 @@ The function takes a `data` object parameter with the following properties:
|
|
|
7918
7941
|
- `className`: string
|
|
7919
7942
|
Additional CSS classes merged via `cn()`.
|
|
7920
7943
|
- `render`: ReactNode
|
|
7921
|
-
Replaces the trigger element while preserving Select behavior.
|
|
7944
|
+
Replaces the trigger element while preserving Select behavior. Set the trigger's `id` with Select's `id` prop: Base UI does not see an `id` set here, so clicking the label would not focus the trigger.
|
|
7922
7945
|
- `size`: enum [default: base]
|
|
7923
7946
|
Size of the select trigger. Matches Input component sizes.
|
|
7924
7947
|
- `label`: ReactNode
|
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]) }),
|
|
@@ -819,7 +821,7 @@ export const SelectPropsSchema = z.object({
|
|
|
819
821
|
sideOffset: z.unknown().optional(), // Distance between the anchor and the popup in pixels. Also accepts a function that returns the distance to read the dimensions of the anchor and positioner elements, along with its side and alignment. The function takes a `data` object parameter with the following properties: - `data.anchor`: the dimensions of the anchor element with properties `width` and `height`. - `data.positioner`: the dimensions of the positioner element with properties `width` and `height`. - `data.side`: which side of the anchor element the positioner is aligned against. - `data.align`: how the positioner is aligned relative to the specified side.
|
|
820
822
|
sticky: z.boolean().optional(), // Whether to maintain the popup in the viewport after the anchor element was scrolled out of view.
|
|
821
823
|
className: z.string().optional(), // Additional CSS classes merged via `cn()`.
|
|
822
|
-
render: z.union([z.string(), z.number(), z.boolean(), z.null(), DynamicValueSchema]).optional(), // Replaces the trigger element while preserving Select behavior.
|
|
824
|
+
render: z.union([z.string(), z.number(), z.boolean(), z.null(), DynamicValueSchema]).optional(), // Replaces the trigger element while preserving Select behavior. Set the trigger's `id` with Select's `id` prop: Base UI does not see an `id` set here, so clicking the label would not focus the trigger.
|
|
823
825
|
size: z.enum(["xs", "sm", "base", "lg"]).optional(), // Size of the select trigger. Matches Input component sizes.
|
|
824
826
|
label: z.union([z.string(), z.number(), z.boolean(), z.null(), DynamicValueSchema]).optional(), // Label content for the select. When provided, enables the Field wrapper with a visible label above the select. For accessibility without a visible label, use `aria-label` instead.
|
|
825
827
|
hideLabel: z.boolean().optional(),
|
package/dist/.build-complete
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1794507274531
|
package/dist/ai/schemas.d.ts
CHANGED
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]) }),
|
|
@@ -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
|
};
|
|
@@ -59,7 +59,7 @@ declare const KUMO_BUTTON_VARIANTS: {
|
|
|
59
59
|
readonly description: "Default button style for most actions";
|
|
60
60
|
};
|
|
61
61
|
readonly ghost: {
|
|
62
|
-
readonly classes: "text-kumo-default hover:bg-kumo-tint shadow-none
|
|
62
|
+
readonly classes: "text-kumo-default hover:bg-kumo-tint shadow-none";
|
|
63
63
|
readonly description: "Minimal button with no background";
|
|
64
64
|
};
|
|
65
65
|
readonly destructive: {
|
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-gkrpde59au4kjh7q.js";
|
|
5
|
+
import { n as KUMO_INPUT_VARIANTS, r as inputVariants } from "./input-ggn78losfydwdjqg.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";
|
|
@@ -1,11 +1,12 @@
|
|
|
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 unwrapLazyElement } from "./unwrap-lazy-element-hzbdkmujhd7iksau.js";
|
|
4
5
|
import React from "react";
|
|
5
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
//#region src/components/badge/badge.tsx
|
|
7
8
|
/** Base styles applied to all badge variants. */
|
|
8
|
-
const KUMO_BADGE_BASE_STYLES = "inline-flex w-fit flex-none shrink-0 items-center justify-self-start gap-1 rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap [a:hover_&]:ring [a:hover_&]:ring-current";
|
|
9
|
+
const KUMO_BADGE_BASE_STYLES = "inline-flex w-fit flex-none shrink-0 items-center justify-self-start gap-1 rounded-full px-2 py-0.5 text-xs/4 font-medium whitespace-nowrap [a:hover_&]:ring [a:hover_&]:ring-current";
|
|
9
10
|
/** Badge variant definitions mapping variant names to their Tailwind classes and descriptions. */
|
|
10
11
|
const KUMO_BADGE_VARIANTS = {
|
|
11
12
|
variant: {
|
|
@@ -123,7 +124,8 @@ function badgeVariants({ variant = KUMO_BADGE_DEFAULT_VARIANTS.variant, appearan
|
|
|
123
124
|
const appearanceClasses = resolveVariant(KUMO_BADGE_VARIANTS.appearance, appearance, KUMO_BADGE_DEFAULT_VARIANTS.appearance).classes;
|
|
124
125
|
return cn(KUMO_BADGE_BASE_STYLES, appearance === "dot" ? "" : variantClasses, appearanceClasses);
|
|
125
126
|
}
|
|
126
|
-
const renderIconNode = (
|
|
127
|
+
const renderIconNode = (iconProp) => {
|
|
128
|
+
const IconComponent = unwrapLazyElement(iconProp);
|
|
127
129
|
if (!IconComponent) return null;
|
|
128
130
|
const Component = IconComponent;
|
|
129
131
|
const icon = React.isValidElement(IconComponent) ? IconComponent : /* @__PURE__ */ jsx(Component, {});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { t as cn } from "./vendor-styling-gs32v7xt5znc8kg0.js";
|
|
3
3
|
import { t as resolveVariant } from "./resolve-variant-l6x5ksfrjtu4m66l.js";
|
|
4
4
|
import { r as Link } from "./link-h84bkh8eem39p529.js";
|
|
5
|
-
import { t as Button } from "./button-
|
|
5
|
+
import { n as LinkButton, t as Button } from "./button-hzvowfkbathmx8yg.js";
|
|
6
6
|
import { createContext, forwardRef, isValidElement, useContext } from "react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
//#region src/components/banner/banner-action.tsx
|
|
@@ -53,28 +53,39 @@ function bannerActionAccentVars(accent) {
|
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
|
-
* A banner CTA built on Kumo's `Button
|
|
57
|
-
*
|
|
56
|
+
* A banner CTA built on Kumo's `Button`, or `LinkButton` when `href` is set. It
|
|
57
|
+
* inherits their sizing, interaction, and accessibility behavior while supplying
|
|
58
|
+
* banner-specific accent styles.
|
|
58
59
|
*
|
|
59
60
|
* @example
|
|
60
61
|
* ```tsx
|
|
61
62
|
* <Banner.Action onClick={retry}>Retry</Banner.Action>
|
|
63
|
+
* <Banner.Action href="/billing">Manage payments</Banner.Action>
|
|
62
64
|
* <Banner.Action variant="ghost" icon={<X />} aria-label="Dismiss" />
|
|
63
65
|
* ```
|
|
64
66
|
*/
|
|
65
|
-
const BannerAction = forwardRef(function BannerAction(
|
|
67
|
+
const BannerAction = forwardRef(function BannerAction(props, ref) {
|
|
66
68
|
const banner = useContext(BannerActionContext);
|
|
69
|
+
const variant = props.variant ?? "primary";
|
|
67
70
|
const styles = BANNER_ACTION_ACCENTS[banner.variant];
|
|
68
|
-
|
|
69
|
-
ref,
|
|
71
|
+
const shared = {
|
|
70
72
|
variant: variant === "secondary" ? "outline" : variant,
|
|
71
73
|
size: banner.size,
|
|
72
|
-
className: cn(variant !== "primary" && styles[variant], className),
|
|
74
|
+
className: cn(variant !== "primary" && styles[variant], props.className),
|
|
73
75
|
style: variant === "primary" ? {
|
|
74
76
|
...bannerActionAccentVars(styles.accent),
|
|
75
|
-
...style
|
|
76
|
-
} : style
|
|
77
|
-
|
|
77
|
+
...props.style
|
|
78
|
+
} : props.style
|
|
79
|
+
};
|
|
80
|
+
if (props.href !== void 0) return /* @__PURE__ */ jsx(LinkButton, {
|
|
81
|
+
ref,
|
|
82
|
+
...props,
|
|
83
|
+
...shared
|
|
84
|
+
});
|
|
85
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
86
|
+
ref,
|
|
87
|
+
...props,
|
|
88
|
+
...shared
|
|
78
89
|
});
|
|
79
90
|
});
|
|
80
91
|
BannerAction.displayName = "Banner.Action";
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { t as cn } from "./vendor-styling-gs32v7xt5znc8kg0.js";
|
|
3
3
|
import { t as resolveVariant } from "./resolve-variant-l6x5ksfrjtu4m66l.js";
|
|
4
4
|
import { n as useLinkComponent } from "./link-provider-kbwllpbo24fvgioj.js";
|
|
5
|
-
import { t as Button } from "./button-
|
|
5
|
+
import { t as Button } from "./button-hzvowfkbathmx8yg.js";
|
|
6
6
|
import { t as useCopyFeedback } from "./use-copy-feedback-gl55ghst0csvpv4j.js";
|
|
7
|
-
import { t as SkeletonLine } from "./skeleton-line-
|
|
7
|
+
import { t as SkeletonLine } from "./skeleton-line-kmhnp0lx3rxhioxa.js";
|
|
8
8
|
import { Children, cloneElement, isValidElement } from "react";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import { CheckIcon, CopyIcon } from "@phosphor-icons/react";
|
|
@@ -1,6 +1,7 @@
|
|
|
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 unwrapLazyElement } from "./unwrap-lazy-element-hzbdkmujhd7iksau.js";
|
|
4
5
|
import { n as useLinkComponent } from "./link-provider-kbwllpbo24fvgioj.js";
|
|
5
6
|
import { t as Loader } from "./loader-kv5nk8j8tsuesxqo.js";
|
|
6
7
|
import { t as Tooltip } from "./tooltip-bcymn9bfyz29fvji.js";
|
|
@@ -34,11 +35,11 @@ const KUMO_BUTTON_VARIANTS = {
|
|
|
34
35
|
description: "Small button for secondary actions"
|
|
35
36
|
},
|
|
36
37
|
base: {
|
|
37
|
-
classes: "h-9 gap-1.5 rounded-lg px-3 text-base",
|
|
38
|
+
classes: "h-9 gap-1.5 rounded-lg px-3 text-base leading-5",
|
|
38
39
|
description: "Default button size"
|
|
39
40
|
},
|
|
40
41
|
lg: {
|
|
41
|
-
classes: "h-10 gap-2 rounded-lg px-4 text-base",
|
|
42
|
+
classes: "h-10 gap-2 rounded-lg px-4 text-base leading-5",
|
|
42
43
|
description: "Large button for primary CTAs"
|
|
43
44
|
}
|
|
44
45
|
},
|
|
@@ -58,7 +59,7 @@ const KUMO_BUTTON_VARIANTS = {
|
|
|
58
59
|
description: "Default button style for most actions"
|
|
59
60
|
},
|
|
60
61
|
ghost: {
|
|
61
|
-
classes: "text-kumo-default hover:bg-kumo-tint shadow-none
|
|
62
|
+
classes: "text-kumo-default hover:bg-kumo-tint shadow-none",
|
|
62
63
|
description: "Minimal button with no background"
|
|
63
64
|
},
|
|
64
65
|
destructive: {
|
|
@@ -82,27 +83,21 @@ const KUMO_BUTTON_DEFAULT_VARIANTS = {
|
|
|
82
83
|
};
|
|
83
84
|
function buttonVariants({ variant = KUMO_BUTTON_DEFAULT_VARIANTS.variant, size = KUMO_BUTTON_DEFAULT_VARIANTS.size, shape = KUMO_BUTTON_DEFAULT_VARIANTS.shape } = {}) {
|
|
84
85
|
const isCompactShape = shape === "square" || shape === "circle";
|
|
85
|
-
return cn("group flex w-max shrink-0 items-center font-medium select-none", "border-0 shadow-xs", "focus:ring-kumo-focus/50 focus:outline-
|
|
86
|
+
return cn("group flex w-max shrink-0 items-center font-medium select-none", "border-0 shadow-xs", "focus:ring-kumo-focus/50 focus:outline-hidden focus-visible:ring-2 focus-visible:ring-kumo-brand", "cursor-pointer", "disabled:cursor-not-allowed disabled:text-kumo-subtle", resolveVariant(KUMO_BUTTON_VARIANTS.size, size, KUMO_BUTTON_DEFAULT_VARIANTS.size).classes, resolveVariant(KUMO_BUTTON_VARIANTS.shape, shape, KUMO_BUTTON_DEFAULT_VARIANTS.shape).classes, isCompactShape && resolveVariant(KUMO_BUTTON_VARIANTS.compactSize, size, KUMO_BUTTON_DEFAULT_VARIANTS.size).classes, resolveVariant(KUMO_BUTTON_VARIANTS.variant, variant, KUMO_BUTTON_DEFAULT_VARIANTS.variant).classes);
|
|
86
87
|
}
|
|
87
|
-
const TEXT_LIFT_CLASSES = {
|
|
88
|
-
xs: "pb-px [--kumo-button-text-lift:0.5px]",
|
|
89
|
-
sm: "pb-px [--kumo-button-text-lift:0.5px]",
|
|
90
|
-
base: "pb-0.5 [--kumo-button-text-lift:1px]",
|
|
91
|
-
lg: "pb-0.5 [--kumo-button-text-lift:1px]"
|
|
92
|
-
};
|
|
93
88
|
const ICON_LEADING_PADDING = {
|
|
94
89
|
xs: "pl-1",
|
|
95
90
|
sm: "pl-1.5",
|
|
96
91
|
base: "pl-2.5",
|
|
97
92
|
lg: "pl-3.5"
|
|
98
93
|
};
|
|
99
|
-
const
|
|
100
|
-
const getTextClasses = (shape, size, iconNode, children) => {
|
|
94
|
+
const getIconPaddingClasses = (shape, size, iconNode, children) => {
|
|
101
95
|
const hasText = React.Children.toArray(children).some((child) => child !== "");
|
|
102
|
-
if (shape !== "base" || !hasText) return void 0;
|
|
103
|
-
return
|
|
96
|
+
if (shape !== "base" || !hasText || iconNode == null) return void 0;
|
|
97
|
+
return ICON_LEADING_PADDING[size];
|
|
104
98
|
};
|
|
105
|
-
const renderIconNode = (
|
|
99
|
+
const renderIconNode = (iconProp) => {
|
|
100
|
+
const IconComponent = unwrapLazyElement(iconProp);
|
|
106
101
|
if (!IconComponent) return null;
|
|
107
102
|
if (React.isValidElement(IconComponent)) return IconComponent;
|
|
108
103
|
return /* @__PURE__ */ jsx(IconComponent, {});
|
|
@@ -180,7 +175,7 @@ const Button = React.forwardRef(({ children, className, disabled, loading, shape
|
|
|
180
175
|
variant,
|
|
181
176
|
size,
|
|
182
177
|
shape
|
|
183
|
-
}),
|
|
178
|
+
}), getIconPaddingClasses(shape, size, iconNode, children), disabled && "cursor-not-allowed opacity-50", className),
|
|
184
179
|
disabled: loading || disabled,
|
|
185
180
|
style: emphasisStyle ? {
|
|
186
181
|
...emphasisStyle,
|
|
@@ -257,7 +252,7 @@ const LinkButton = React.forwardRef(({ children, className, disabled = false, ex
|
|
|
257
252
|
variant,
|
|
258
253
|
size,
|
|
259
254
|
shape
|
|
260
|
-
}),
|
|
255
|
+
}), getIconPaddingClasses(shape, size, iconNode, children), "flex items-center no-underline! select-text", className),
|
|
261
256
|
href,
|
|
262
257
|
style: emphasisStyle ? {
|
|
263
258
|
...emphasisStyle,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { t as cn } from "./vendor-styling-gs32v7xt5znc8kg0.js";
|
|
3
3
|
import { a as TooltipTrigger, i as TooltipPortal, n as TooltipPositioner, s as TooltipRoot, t as TooltipPopup } from "./TooltipPopup-furysmeyb68uycbz.js";
|
|
4
4
|
import { t as Text } from "./text-me99rjbjkaff98gp.js";
|
|
5
|
-
import { t as SkeletonLine } from "./skeleton-line-
|
|
5
|
+
import { t as SkeletonLine } from "./skeleton-line-kmhnp0lx3rxhioxa.js";
|
|
6
6
|
import { forwardRef, memo, useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
7
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
//#region src/components/chart/Color.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as cn } from "./vendor-styling-gs32v7xt5znc8kg0.js";
|
|
3
|
-
import { r as Label } from "./label-
|
|
3
|
+
import { r as Label } from "./label-f9vvtexndkpjlrv0.js";
|
|
4
4
|
import { n as FieldsetRoot, t as FieldsetLegend } from "./FieldsetLegend-gl9z9eezr0xg9zr7.js";
|
|
5
5
|
import { n as FieldRoot, t as FieldLabel } from "./FieldLabel-fjc7tdis7rcbq8o4.js";
|
|
6
6
|
import { t as CheckboxGroup$1 } from "./CheckboxGroup-581mfftu99wvjb3a.js";
|
|
@@ -56,7 +56,7 @@ const CheckboxBase = forwardRef(({ className, checked, indeterminate, disabled,
|
|
|
56
56
|
indeterminate,
|
|
57
57
|
disabled,
|
|
58
58
|
onCheckedChange,
|
|
59
|
-
className: cn("relative flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border-0 bg-kumo-base ring after:absolute after:-inset-x-3 after:-inset-y-2 focus:outline-
|
|
59
|
+
className: cn("relative flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border-0 bg-kumo-base ring after:absolute after:-inset-x-3 after:-inset-y-2 focus:outline-hidden", label && "mt-0.5", variant === "error" ? "ring-kumo-danger" : "ring-kumo-hairline", !disabled && "hover:ring-kumo-hairline focus:ring-2 focus:ring-kumo-focus focus-visible:ring-2 focus-visible:ring-kumo-brand", "data-[checked]:bg-kumo-contrast data-[checked]:ring-kumo-contrast data-[indeterminate]:bg-kumo-contrast data-[indeterminate]:ring-kumo-contrast", disabled && "cursor-not-allowed opacity-50", className),
|
|
60
60
|
...props,
|
|
61
61
|
children: /* @__PURE__ */ jsx(CheckboxIndicator, {
|
|
62
62
|
keepMounted: true,
|
|
@@ -117,7 +117,7 @@ const CheckboxItem = forwardRef(({ className, checked, indeterminate, disabled,
|
|
|
117
117
|
className: "text-base font-medium text-kumo-default",
|
|
118
118
|
children: label
|
|
119
119
|
}), description && /* @__PURE__ */ jsx("span", {
|
|
120
|
-
className: "text-sm text-kumo-subtle",
|
|
120
|
+
className: "text-sm leading-snug text-pretty text-kumo-subtle",
|
|
121
121
|
children: description
|
|
122
122
|
})]
|
|
123
123
|
}), /* @__PURE__ */ jsx(CheckboxRoot, {
|
|
@@ -130,7 +130,7 @@ const CheckboxItem = forwardRef(({ className, checked, indeterminate, disabled,
|
|
|
130
130
|
indeterminate,
|
|
131
131
|
disabled,
|
|
132
132
|
onCheckedChange,
|
|
133
|
-
className: cn("relative mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border-0 bg-kumo-base ring focus:ring-kumo-focus focus:outline-
|
|
133
|
+
className: cn("relative mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border-0 bg-kumo-base ring focus:ring-kumo-focus focus:outline-hidden focus-visible:ring-2 focus-visible:ring-kumo-brand", variant === "error" ? "ring-kumo-danger" : "ring-kumo-line", !disabled && variant !== "error" && "group-hover:ring-kumo-hairline", "data-[checked]:bg-kumo-contrast data-[checked]:ring-kumo-contrast data-[indeterminate]:bg-kumo-contrast data-[indeterminate]:ring-kumo-contrast"),
|
|
134
134
|
children: indicator
|
|
135
135
|
})]
|
|
136
136
|
});
|
|
@@ -193,7 +193,7 @@ function CheckboxGroup({ legend, children, error, description, defaultValue, val
|
|
|
193
193
|
children: error
|
|
194
194
|
}),
|
|
195
195
|
description && /* @__PURE__ */ jsx("p", {
|
|
196
|
-
className: "text-sm text-kumo-subtle",
|
|
196
|
+
className: "text-sm leading-snug text-pretty text-kumo-subtle",
|
|
197
197
|
children: description
|
|
198
198
|
})
|
|
199
199
|
]
|