@cloudflare/kumo 2.17.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.
Files changed (106) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/ai/USAGE.md +6 -0
  3. package/ai/component-registry.json +4 -3
  4. package/ai/component-registry.md +23 -0
  5. package/ai/schemas.ts +2 -0
  6. package/dist/.build-complete +1 -1
  7. package/dist/ai/schemas.d.ts +2 -0
  8. package/dist/ai/schemas.js +1 -0
  9. package/dist/{button-Bbi7gFL7.d.ts → button-DBuj7_fo.d.ts} +2 -2
  10. package/dist/catalog.d.ts +4 -1
  11. package/dist/catalog.js +37 -14
  12. package/dist/chunks/{autocomplete-evlm6fj7v7w0g2z2.js → autocomplete-ngrji5wk0xdpq2qc.js} +2 -2
  13. package/dist/chunks/{badge-kyz53p7p0ng393bs.js → badge-f27mwe9gasi4inb6.js} +3 -1
  14. package/dist/chunks/{banner-lvbgdzxq3yndkbot.js → banner-m68xx7eqplxwi73f.js} +21 -10
  15. package/dist/chunks/{breadcrumbs-fsuyq7z6hdh1thjv.js → breadcrumbs-2ra74bio44h1fvuj.js} +2 -2
  16. package/dist/chunks/{button-k7axs4vu1rwx89w3.js → button-cyea767mx5dwgavm.js} +11 -16
  17. package/dist/chunks/{chart-hp3vqwe49tbyywqm.js → chart-g4dnsqiamjh39chn.js} +1 -1
  18. package/dist/chunks/{checkbox-g8b4f2hs5vux3u26.js → checkbox-bcpt8k7ck95vgjc1.js} +5 -5
  19. package/dist/chunks/{clipboard-text-fffd5tpa0iye6r6m.js → clipboard-text-k9ae6rsreg9ol6y2.js} +2 -2
  20. package/dist/chunks/{combobox-iawd8lxwd5b18fce.js → combobox-iuuzrkczst4nmoyh.js} +18 -6
  21. package/dist/chunks/{date-picker-kfoxd4u7ckg4nsez.js → date-picker-o6iov1n67oc4rbom.js} +3 -3
  22. package/dist/chunks/{date-range-picker-hpx3cdu9ve01jx6d.js → date-range-picker-oivlshld01jbel29.js} +1 -1
  23. package/dist/chunks/{dialog-lgrwmsumwpftp2u8.js → dialog-h3zgi4kmimpesv5j.js} +1 -1
  24. package/dist/chunks/{dropdown-o875yxeqod7qp871.js → dropdown-m5a8nwer5hpvnkfk.js} +3 -1
  25. package/dist/chunks/{empty-ir5bg5w4kkisuc1c.js → empty-ghcpxo6x75jg7mw9.js} +1 -1
  26. package/dist/chunks/{field-n7gmbg5xvh6oqbom.js → field-crf1hw5exr2oxemk.js} +1 -1
  27. package/dist/chunks/{inline-copy-text-57r67slswfqvgbaf.js → inline-copy-text-c6wa49ys72pj7k53.js} +1 -1
  28. package/dist/chunks/{input-f0pbcvjudf5zb8ek.js → input-d1230n06m5b1p3rd.js} +2 -2
  29. package/dist/chunks/{input-group-dqo5tcoewbdx86qx.js → input-group-gg4aurpe2s60van9.js} +8 -6
  30. package/dist/chunks/{input-iev3wgdzhkqpae2k.js → input-m6nvwwnydvbdz8rf.js} +2 -2
  31. package/dist/chunks/{label-njfcj6h9utmg2n9l.js → label-cecukn2rbow4ghxg.js} +1 -1
  32. package/dist/chunks/{layer-dialog-n7foup6icxowm82n.js → layer-dialog-eeecim8yf0dzhs2m.js} +2 -2
  33. package/dist/chunks/{menubar-b454nksysu0wicbz.js → menubar-gzlyhmmc4i24prn1.js} +1 -1
  34. package/dist/chunks/{pagination-mwlpbysq4cxmvs45.js → pagination-fkjx0m380ku9zqv9.js} +2 -2
  35. package/dist/chunks/{radio-d3pkrvsldfbdefav.js → radio-co7gt6ihfp5w4jr0.js} +4 -4
  36. package/dist/chunks/{select-fae2ls189jrq902h.js → select-ha59x0uq5ocr1x36.js} +6 -6
  37. package/dist/chunks/{sensitive-input-heb3xapwahzhpq6y.js → sensitive-input-hg58r9x2d9njtysl.js} +3 -3
  38. package/dist/chunks/{sidebar-h6g412ror8p7uo0d.js → sidebar-dgyce0z35tpnxj8t.js} +11 -9
  39. package/dist/chunks/skeleton-line-kmhnp0lx3rxhioxa.js +74 -0
  40. package/dist/chunks/{slider-juwif2d8xa5n0429.js → slider-e395gihi5cjd62ss.js} +1 -1
  41. package/dist/chunks/{switch-ktfauhluw1yi5tkk.js → switch-hqj8v7ll9g14p5my.js} +4 -4
  42. package/dist/chunks/{table-lp41fsw7mqr751hn.js → table-b491wlpxd8jbr9b5.js} +1 -1
  43. package/dist/chunks/{tabs-mmkz7q5rofnmogwt.js → tabs-oi64kuuf2poro26u.js} +2 -2
  44. package/dist/chunks/{tag-input-k6vzllby4qebmv63.js → tag-input-0ombmb7yrn4xk3in.js} +3 -3
  45. package/dist/chunks/{toast-kzwscia42707sau6.js → toast-cmj0e7xvoh9gxxao.js} +1 -1
  46. package/dist/chunks/{toolbar-nnos2ouwfk7i6tpw.js → toolbar-bx2w3vk2if6mp36l.js} +3 -3
  47. package/dist/chunks/unwrap-lazy-element-hzbdkmujhd7iksau.js +45 -0
  48. package/dist/code.js +1 -1
  49. package/dist/components/autocomplete.js +1 -1
  50. package/dist/components/badge.js +1 -1
  51. package/dist/components/banner.d.ts +1 -1
  52. package/dist/components/banner.js +1 -1
  53. package/dist/components/breadcrumbs.js +1 -1
  54. package/dist/components/button.d.ts +2 -2
  55. package/dist/components/button.js +1 -1
  56. package/dist/components/chart.js +1 -1
  57. package/dist/components/checkbox.js +1 -1
  58. package/dist/components/clipboard-text.js +1 -1
  59. package/dist/components/combobox.d.ts +1 -1
  60. package/dist/components/combobox.js +1 -1
  61. package/dist/components/date-picker.js +1 -1
  62. package/dist/components/date-range-picker.js +1 -1
  63. package/dist/components/dialog.js +1 -1
  64. package/dist/components/dropdown.js +1 -1
  65. package/dist/components/empty.js +1 -1
  66. package/dist/components/field.js +1 -1
  67. package/dist/components/inline-copy-text.d.ts +1 -1
  68. package/dist/components/inline-copy-text.js +1 -1
  69. package/dist/components/input-group.d.ts +1 -1
  70. package/dist/components/input-group.js +1 -1
  71. package/dist/components/input.d.ts +1 -1
  72. package/dist/components/input.js +3 -3
  73. package/dist/components/label.js +1 -1
  74. package/dist/components/layer-dialog.js +1 -1
  75. package/dist/components/loader.d.ts +1 -1
  76. package/dist/components/loader.js +1 -1
  77. package/dist/components/menubar.js +1 -1
  78. package/dist/components/pagination.js +1 -1
  79. package/dist/components/radio.js +1 -1
  80. package/dist/components/select.js +1 -1
  81. package/dist/components/sensitive-input.js +1 -1
  82. package/dist/components/sidebar.js +1 -1
  83. package/dist/components/slider.js +1 -1
  84. package/dist/components/switch.js +1 -1
  85. package/dist/components/table.js +1 -1
  86. package/dist/components/tabs.js +1 -1
  87. package/dist/components/tag-input.js +1 -1
  88. package/dist/components/toast.d.ts +1 -1
  89. package/dist/components/toast.js +1 -1
  90. package/dist/components/toolbar.d.ts +1 -1
  91. package/dist/components/toolbar.js +1 -1
  92. package/dist/{index-BMe3cpLB.d.ts → index--HBggSGH.d.ts} +2 -2
  93. package/dist/{index-CSWbPhke.d.ts → index-BAFvYacU.d.ts} +15 -5
  94. package/dist/{index--RbAKeBL.d.ts → index-BfoZI9Hf.d.ts} +2 -2
  95. package/dist/{index-jNWPjJl9.d.ts → index-D4_C1J_8.d.ts} +1 -1
  96. package/dist/{index-BAQwS4mL.d.ts → index-Dx7hOWUc.d.ts} +24 -1
  97. package/dist/{index-CrQi3QCY.d.ts → index-DxOyYZaJ.d.ts} +4 -3
  98. package/dist/index-WCjW8Iot.d.ts +1 -0
  99. package/dist/index.d.ts +9 -9
  100. package/dist/index.js +35 -35
  101. package/dist/{input-group-B3M_WRqm.d.ts → input-group-oXVkmPrY.d.ts} +1 -1
  102. package/dist/styles/kumo-standalone.css +1 -1
  103. package/package.json +1 -1
  104. package/scripts/component-registry/schema-generator.ts +2 -0
  105. package/dist/chunks/skeleton-line-gjf1fecmyy82aejz.js +0 -43
  106. package/dist/index-B-hCpI5K.d.ts +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
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
+
3
29
  ## 2.17.0
4
30
 
5
31
  ### 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
  },
@@ -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-none focus-visible:ring-2 focus-visible:ring-kumo-brand"
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": {
@@ -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"
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]) }),
@@ -1 +1 @@
1
- 1793640397744
1
+ 1794240799832
@@ -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
  } | {
@@ -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
  };
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 in actions;
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 = path.startsWith("/") ? path.slice(1).split("/") : path.split("/");
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 = path.startsWith("/") ? path.slice(1).split("/") : path.split("/");
229
- if (segments.length === 0) return;
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
- if (!(segment in current) || typeof current[segment] !== "object") current[segment] = {};
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)) if (isDynamicPath(value)) resolved[key] = getByPath(dataModel, value.path);
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-n7gmbg5xvh6oqbom.js";
5
- import { n as KUMO_INPUT_VARIANTS, r as inputVariants } from "./input-f0pbcvjudf5zb8ek.js";
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";
@@ -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 React from "react";
5
6
  import { jsx, jsxs } from "react/jsx-runtime";
6
7
  //#region src/components/badge/badge.tsx
@@ -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 = (IconComponent) => {
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-k7axs4vu1rwx89w3.js";
5
+ import { n as LinkButton, t as Button } from "./button-cyea767mx5dwgavm.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`. It inherits Button's sizing, interaction,
57
- * loading, and accessibility behavior while supplying banner-specific accent styles.
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({ variant = "primary", className, style, ...props }, ref) {
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
- return /* @__PURE__ */ jsx(Button, {
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
- ...props
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-k7axs4vu1rwx89w3.js";
5
+ import { t as Button } from "./button-cyea767mx5dwgavm.js";
6
6
  import { t as useCopyFeedback } from "./use-copy-feedback-gl55ghst0csvpv4j.js";
7
- import { t as SkeletonLine } from "./skeleton-line-gjf1fecmyy82aejz.js";
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
  },
@@ -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-none 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
+ 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 ICON_CENTER_CLASSES = "[&>svg:first-child]:translate-y-(--kumo-button-text-lift) [&>span.relative>svg:first-child]:translate-y-(--kumo-button-text-lift)";
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 cn(TEXT_LIFT_CLASSES[size], iconNode != null && [ICON_LEADING_PADDING[size], ICON_CENTER_CLASSES]);
96
+ if (shape !== "base" || !hasText || iconNode == null) return void 0;
97
+ return ICON_LEADING_PADDING[size];
104
98
  };
105
- const renderIconNode = (IconComponent) => {
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
- }), getTextClasses(shape, size, iconNode, children), disabled && "cursor-not-allowed opacity-50", className),
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
- }), getTextClasses(shape, size, iconNode, children), "flex items-center no-underline! select-text", className),
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-gjf1fecmyy82aejz.js";
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-njfcj6h9utmg2n9l.js";
3
+ import { r as Label } from "./label-cecukn2rbow4ghxg.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-none", 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),
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-none 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"),
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
  ]
@@ -3,9 +3,9 @@ import { t as cn } from "./vendor-styling-gs32v7xt5znc8kg0.js";
3
3
  import { t as resolveVariant } from "./resolve-variant-l6x5ksfrjtu4m66l.js";
4
4
  import { a as TooltipTrigger, i as TooltipPortal, n as TooltipPositioner, s as TooltipRoot, t as TooltipPopup } from "./TooltipPopup-furysmeyb68uycbz.js";
5
5
  import { t as TooltipProvider } from "./TooltipProvider-hyans0ens4axh1y8.js";
6
- import { t as Button } from "./button-k7axs4vu1rwx89w3.js";
6
+ import { t as Button } from "./button-cyea767mx5dwgavm.js";
7
7
  import { a as ToastDescription, h as ToastProvider, l as ToastRoot, n as useToastManager, p as ToastViewport, r as ToastPositioner, t as createToastManager } from "./createToastManager-cxjmn4jx3ejh85fs.js";
8
- import { r as inputVariants } from "./input-f0pbcvjudf5zb8ek.js";
8
+ import { r as inputVariants } from "./input-d1230n06m5b1p3rd.js";
9
9
  import { forwardRef, useCallback, useEffect, useRef, useState } from "react";
10
10
  import { jsx, jsxs } from "react/jsx-runtime";
11
11
  import { CheckIcon, CopyIcon, EyeIcon, EyeSlashIcon } from "@phosphor-icons/react";
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { t as cn } from "./vendor-styling-gs32v7xt5znc8kg0.js";
3
3
  import { n as usePortalContainer } from "./portal-provider-eveknxf26oudn7pp.js";
4
- import { t as Field } from "./field-n7gmbg5xvh6oqbom.js";
5
- import { n as KUMO_INPUT_VARIANTS, r as inputVariants } from "./input-f0pbcvjudf5zb8ek.js";
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 { C as useComboboxFilter, a as ComboboxGroupLabel, c as ComboboxCollection, l as ComboboxInput, n as ComboboxItem, o as ComboboxGroup, s as ComboboxList, t as ComboboxEmpty } from "./ComboboxEmpty-gkt1y5b81a4983v7.js";
7
7
  import { a as ComboboxItemIndicator, i as ComboboxChips, n as ComboboxChipRemove, o as ComboboxValue, r as ComboboxChip, s as ComboboxRoot, t as createComboboxItems } from "./createItems-n07tfwx89cdoar18.js";
8
8
  import { n as ComboboxIcon, r as ComboboxTrigger, t as ComboboxClear } from "./ComboboxClear-ioejwvtnmqanph88.js";
@@ -86,18 +86,29 @@ const triggerValueIconStyles = {
86
86
  iconRight: "right-3"
87
87
  }
88
88
  };
89
- function TriggerValue({ className, render, ...props }) {
89
+ /**
90
+ * Drops keys whose value is `undefined`. Base UI's `mergeProps` lets an
91
+ * explicit `undefined` override internal props, so e.g.
92
+ * `aria-labelledby={undefined}` would erase the Field label's id.
93
+ */
94
+ function omitUndefined(props) {
95
+ return Object.fromEntries(Object.entries(props).filter(([, value]) => value !== void 0));
96
+ }
97
+ function TriggerValue({ className, children, placeholder, ...triggerProps }) {
90
98
  const { size, hasError } = useContext(ComboboxContext);
91
99
  const iconStyles = triggerValueIconStyles[size];
92
100
  return /* @__PURE__ */ jsxs(ComboboxTrigger, {
93
101
  "data-kumo-component": "Combobox",
94
102
  "data-kumo-part": "trigger",
95
- render,
103
+ ...omitUndefined(triggerProps),
96
104
  className: cn(inputVariants({
97
105
  size,
98
106
  variant: hasError ? "error" : "default"
99
107
  }), "relative flex items-center", "data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50", "data-[placeholder]:text-kumo-placeholder", iconStyles.padding, className),
100
- children: [/* @__PURE__ */ jsx(ComboboxValue, { ...props }), /* @__PURE__ */ jsx(ComboboxIcon, {
108
+ children: [/* @__PURE__ */ jsx(ComboboxValue, {
109
+ placeholder,
110
+ children
111
+ }), /* @__PURE__ */ jsx(ComboboxIcon, {
101
112
  className: cn("absolute top-1/2 flex -translate-y-1/2 items-center text-kumo-subtle", iconStyles.iconRight),
102
113
  children: /* @__PURE__ */ jsx(CaretUpDownIcon, {
103
114
  size: iconStyles.iconSize,
@@ -233,10 +244,11 @@ const sizeToMinHeight = {
233
244
  base: "min-h-9",
234
245
  lg: "min-h-10"
235
246
  };
236
- function TriggerMultipleWithInput({ placeholder, renderItem, className, inputSide = "right", value: controlledValue }) {
247
+ function TriggerMultipleWithInput({ placeholder, renderItem, className, inputSide = "right", value: controlledValue, ...inputProps }) {
237
248
  const { size, hasError } = useContext(ComboboxContext);
238
249
  const chipsToRender = controlledValue;
239
250
  const renderTriggerInput = (className) => /* @__PURE__ */ jsx(ComboboxInput, {
251
+ ...omitUndefined(inputProps),
240
252
  placeholder,
241
253
  className
242
254
  });