@cloudflare/kumo 1.4.1 → 1.5.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 +30 -0
- package/README.md +15 -7
- package/ai/component-registry.json +55 -131
- package/ai/component-registry.md +182 -135
- package/ai/schemas.ts +6 -4
- package/bin/kumo.js +23 -19
- package/dist/.build-complete +1 -1
- package/dist/ai/schemas.d.ts +2147 -0
- package/dist/ai/schemas.d.ts.map +1 -0
- package/dist/button-Bh96oxRL.js.map +1 -1
- package/dist/catalog.js +1 -1
- package/dist/{checkbox-C1LPq8eL.js → checkbox-CWANiedi.js} +3 -3
- package/dist/{checkbox-C1LPq8eL.js.map → checkbox-CWANiedi.js.map} +1 -1
- package/dist/{clipboard-text-CJSI9X2m.js → clipboard-text-B32_yb2r.js} +10 -10
- package/dist/clipboard-text-B32_yb2r.js.map +1 -0
- package/dist/{combobox-CWxn5aHA.js → combobox-C9koouxM.js} +4 -4
- package/dist/{combobox-CWxn5aHA.js.map → combobox-C9koouxM.js.map} +1 -1
- package/dist/command-line/cli.js +16 -17
- package/dist/command-line/commands/ai.js +2 -3
- package/dist/{command-palette-J50WKjS7.js → command-palette-TGXgr6Vq.js} +2 -2
- package/dist/{command-palette-J50WKjS7.js.map → command-palette-TGXgr6Vq.js.map} +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/clipboard-text.js +1 -1
- package/dist/components/combobox.js +1 -1
- package/dist/components/command-palette.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/dropdown.js +1 -1
- package/dist/components/field.js +1 -1
- package/dist/components/input.js +8 -7
- package/dist/components/label.js +1 -1
- package/dist/components/link.js +1 -1
- package/dist/components/menubar.js +1 -1
- package/dist/components/meter.js +1 -1
- package/dist/components/pagination.js +1 -1
- package/dist/components/popover.js +1 -1
- package/dist/components/radio.js +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/sensitive-input.js +1 -1
- package/dist/components/switch.js +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/tabs.js +1 -1
- package/dist/components/toast.js +5 -4
- package/dist/components/tooltip.js +1 -1
- package/dist/dialog-CpCeOqSZ.js +97 -0
- package/dist/dialog-CpCeOqSZ.js.map +1 -0
- package/dist/{dropdown-BAyk1knz.js → dropdown-DFeFcKfn.js} +3 -3
- package/dist/{dropdown-BAyk1knz.js.map → dropdown-DFeFcKfn.js.map} +1 -1
- package/dist/{field-B7ORz5ej.js → field-Dt-XuSaQ.js} +3 -3
- package/dist/{field-B7ORz5ej.js.map → field-Dt-XuSaQ.js.map} +1 -1
- package/dist/index.js +137 -124
- package/dist/index.js.map +1 -1
- package/dist/{input-D6YgDfDG.js → input-GZAWBXYX.js} +3 -3
- package/dist/{input-D6YgDfDG.js.map → input-GZAWBXYX.js.map} +1 -1
- package/dist/{input-area-DN_Ncliw.js → input-area-CS1-ceY4.js} +21 -19
- package/dist/input-area-CS1-ceY4.js.map +1 -0
- package/dist/{input-group-BXzBwH4p.js → input-group-COo-wz5O.js} +2 -2
- package/dist/{input-group-BXzBwH4p.js.map → input-group-COo-wz5O.js.map} +1 -1
- package/dist/label-ChZ2Pp5p.js +58 -0
- package/dist/label-ChZ2Pp5p.js.map +1 -0
- package/dist/{link-CcuZKqob.js → link-Mj2WM1AS.js} +2 -2
- package/dist/{link-CcuZKqob.js.map → link-Mj2WM1AS.js.map} +1 -1
- package/dist/{menubar-CzimiryS.js → menubar-CbXWXQYR.js} +2 -2
- package/dist/{menubar-CzimiryS.js.map → menubar-CbXWXQYR.js.map} +1 -1
- package/dist/{meter-BrJnHJ3Q.js → meter-Bu5f3mAc.js} +2 -2
- package/dist/{meter-BrJnHJ3Q.js.map → meter-Bu5f3mAc.js.map} +1 -1
- package/dist/{pagination-D0x9KQSk.js → pagination-Cf-yRO-n.js} +21 -20
- package/dist/pagination-Cf-yRO-n.js.map +1 -0
- package/dist/{popover-CtKDH8Yc.js → popover-D7yeRosi.js} +2 -2
- package/dist/{popover-CtKDH8Yc.js.map → popover-D7yeRosi.js.map} +1 -1
- package/dist/primitives/accordion.js +1 -1
- package/dist/primitives/alert-dialog.js +1 -1
- package/dist/primitives/autocomplete.js +1 -1
- package/dist/primitives/avatar.js +1 -1
- package/dist/primitives/button.js +1 -1
- package/dist/primitives/checkbox-group.js +1 -1
- package/dist/primitives/checkbox.js +1 -1
- package/dist/primitives/collapsible.js +1 -1
- package/dist/primitives/combobox.js +1 -1
- package/dist/primitives/context-menu.js +1 -1
- package/dist/primitives/dialog.js +1 -1
- package/dist/primitives/direction-provider.js +1 -1
- package/dist/primitives/field.js +1 -1
- package/dist/primitives/fieldset.js +1 -1
- package/dist/primitives/form.js +1 -1
- package/dist/primitives/input.js +1 -1
- package/dist/primitives/menu.js +1 -1
- package/dist/primitives/menubar.js +1 -1
- package/dist/primitives/meter.js +1 -1
- package/dist/primitives/navigation-menu.js +1 -1
- package/dist/primitives/number-field.js +1 -1
- package/dist/primitives/popover.js +1 -1
- package/dist/primitives/preview-card.js +1 -1
- package/dist/primitives/progress.js +1 -1
- package/dist/primitives/radio-group.js +1 -1
- package/dist/primitives/radio.js +1 -1
- package/dist/primitives/scroll-area.js +1 -1
- package/dist/primitives/select.js +1 -1
- package/dist/primitives/separator.js +1 -1
- package/dist/primitives/slider.js +1 -1
- package/dist/primitives/switch.js +1 -1
- package/dist/primitives/tabs.js +1 -1
- package/dist/primitives/toast.js +1 -1
- package/dist/primitives/toggle-group.js +1 -1
- package/dist/primitives/toggle.js +1 -1
- package/dist/primitives/toolbar.js +1 -1
- package/dist/primitives/tooltip.js +1 -1
- package/dist/primitives.js +1 -1
- package/dist/{radio-CYejLANA.js → radio-CKn09bGo.js} +2 -2
- package/dist/{radio-CYejLANA.js.map → radio-CKn09bGo.js.map} +1 -1
- package/dist/{schemas-DCw6TIy0.js → schemas-H10xB2M_.js} +10 -9
- package/dist/{schemas-DCw6TIy0.js.map → schemas-H10xB2M_.js.map} +1 -1
- package/dist/{select-D4rKQAax.js → select-DvpgiOau.js} +3 -3
- package/dist/{select-D4rKQAax.js.map → select-DvpgiOau.js.map} +1 -1
- package/dist/{sensitive-input-DYvAmxkN.js → sensitive-input-BuYT6U6C.js} +4 -4
- package/dist/{sensitive-input-DYvAmxkN.js.map → sensitive-input-BuYT6U6C.js.map} +1 -1
- package/dist/src/blocks/delete-resource/delete-resource.d.ts.map +1 -1
- package/dist/src/blocks/delete-resource/delete-resource.tsx +213 -0
- package/dist/src/blocks/page-header/page-header.tsx +99 -0
- package/dist/src/blocks/resource-list/resource-list.test.tsx +28 -0
- package/dist/src/blocks/resource-list/resource-list.tsx +69 -0
- package/dist/src/command-line/commands/ai.d.ts.map +1 -1
- package/dist/src/components/button/button.d.ts +20 -12
- package/dist/src/components/button/button.d.ts.map +1 -1
- package/dist/src/components/dialog/dialog.d.ts +54 -13
- package/dist/src/components/dialog/dialog.d.ts.map +1 -1
- package/dist/src/components/dialog/index.d.ts +1 -1
- package/dist/src/components/dialog/index.d.ts.map +1 -1
- package/dist/src/components/input/index.d.ts +1 -1
- package/dist/src/components/input/index.d.ts.map +1 -1
- package/dist/src/components/input/input-area.d.ts +19 -0
- package/dist/src/components/input/input-area.d.ts.map +1 -1
- package/dist/src/components/label/label.d.ts +5 -3
- package/dist/src/components/label/label.d.ts.map +1 -1
- package/dist/src/components/pagination/pagination.d.ts +8 -1
- package/dist/src/components/pagination/pagination.d.ts.map +1 -1
- package/dist/src/components/table/table.d.ts +2 -0
- package/dist/src/components/table/table.d.ts.map +1 -1
- package/dist/src/components/toast/index.d.ts +1 -1
- package/dist/src/components/toast/index.d.ts.map +1 -1
- package/dist/src/components/toast/toast.d.ts +2 -0
- package/dist/src/components/toast/toast.d.ts.map +1 -1
- package/dist/src/index.d.ts +3 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/styles/kumo-standalone.css +1 -1
- package/dist/{switch-z7FE1nQE.js → switch-Tu34uFoa.js} +3 -3
- package/dist/{switch-z7FE1nQE.js.map → switch-Tu34uFoa.js.map} +1 -1
- package/dist/table-DtUrZ2Rj.js +149 -0
- package/dist/table-DtUrZ2Rj.js.map +1 -0
- package/dist/{tabs-DAEeuQLd.js → tabs-B7THfqHW.js} +2 -2
- package/dist/{tabs-DAEeuQLd.js.map → tabs-B7THfqHW.js.map} +1 -1
- package/dist/{toast-B8ebpHaU.js → toast-Du4y8qng.js} +16 -14
- package/dist/{toast-B8ebpHaU.js.map → toast-Du4y8qng.js.map} +1 -1
- package/dist/{tooltip-C4DRhJi1.js → tooltip-BxV1H6AV.js} +2 -2
- package/dist/{tooltip-C4DRhJi1.js.map → tooltip-BxV1H6AV.js.map} +1 -1
- package/dist/{vendor-base-ui-kX0wjdav.js → vendor-base-ui-CQ6wEonS.js} +5 -5
- package/dist/{vendor-base-ui-kX0wjdav.js.map → vendor-base-ui-CQ6wEonS.js.map} +1 -1
- package/package.json +1 -1
- package/scripts/component-registry/index.ts +68 -12
- package/scripts/css-build.ts +47 -1
- package/dist/clipboard-text-CJSI9X2m.js.map +0 -1
- package/dist/dialog-x9n9wI13.js +0 -77
- package/dist/dialog-x9n9wI13.js.map +0 -1
- package/dist/input-area-DN_Ncliw.js.map +0 -1
- package/dist/label-B4FY8MX_.js +0 -50
- package/dist/label-B4FY8MX_.js.map +0 -1
- package/dist/pagination-D0x9KQSk.js.map +0 -1
- package/dist/table-Sd2Etb1N.js +0 -153
- package/dist/table-Sd2Etb1N.js.map +0 -1
package/ai/component-registry.md
CHANGED
|
@@ -231,12 +231,6 @@ Primary action trigger. Supports multiple variants, sizes, shapes, icons, and lo
|
|
|
231
231
|
|
|
232
232
|
**Props:**
|
|
233
233
|
|
|
234
|
-
- `children`: ReactNode
|
|
235
|
-
- `className`: string
|
|
236
|
-
- `icon`: ReactNode
|
|
237
|
-
Icon from `@phosphor-icons/react` or a React element. Rendered before children.
|
|
238
|
-
- `loading`: boolean
|
|
239
|
-
Shows a loading spinner and disables interaction.
|
|
240
234
|
- `shape`: enum [default: base]
|
|
241
235
|
- `"base"`: Default rectangular button shape
|
|
242
236
|
- `"square"`: Square button for icon-only actions
|
|
@@ -271,6 +265,12 @@ Primary action trigger. Supports multiple variants, sizes, shapes, icons, and lo
|
|
|
271
265
|
- `not-disabled`: `not-disabled:hover:border-secondary! not-disabled:hover:bg-kumo-control`
|
|
272
266
|
- `disabled`: `disabled:bg-kumo-control/50 disabled:!text-kumo-danger/70`
|
|
273
267
|
- `data-state`: `data-[state=open]:bg-kumo-control`
|
|
268
|
+
- `children`: ReactNode
|
|
269
|
+
- `className`: string
|
|
270
|
+
- `icon`: ReactNode
|
|
271
|
+
Icon from `@phosphor-icons/react` or a React element. Rendered before children.
|
|
272
|
+
- `loading`: boolean
|
|
273
|
+
Shows a loading spinner and disables interaction.
|
|
274
274
|
- `id`: string
|
|
275
275
|
- `lang`: string
|
|
276
276
|
- `title`: string
|
|
@@ -288,7 +288,12 @@ Primary action trigger. Supports multiple variants, sizes, shapes, icons, and lo
|
|
|
288
288
|
```tsx
|
|
289
289
|
<div className="flex flex-wrap items-center gap-2">
|
|
290
290
|
<Button variant="secondary">Button</Button>
|
|
291
|
-
<Button
|
|
291
|
+
<Button
|
|
292
|
+
variant="secondary"
|
|
293
|
+
shape="square"
|
|
294
|
+
icon={PlusIcon}
|
|
295
|
+
aria-label="Add"
|
|
296
|
+
/>
|
|
292
297
|
</div>
|
|
293
298
|
```
|
|
294
299
|
|
|
@@ -321,8 +326,18 @@ Primary action trigger. Supports multiple variants, sizes, shapes, icons, and lo
|
|
|
321
326
|
|
|
322
327
|
```tsx
|
|
323
328
|
<div className="flex flex-wrap items-center gap-3">
|
|
324
|
-
<Button
|
|
325
|
-
|
|
329
|
+
<Button
|
|
330
|
+
variant="secondary"
|
|
331
|
+
shape="square"
|
|
332
|
+
icon={PlusIcon}
|
|
333
|
+
aria-label="Add item"
|
|
334
|
+
/>
|
|
335
|
+
<Button
|
|
336
|
+
variant="secondary"
|
|
337
|
+
shape="circle"
|
|
338
|
+
icon={PlusIcon}
|
|
339
|
+
aria-label="Add item"
|
|
340
|
+
/>
|
|
326
341
|
</div>
|
|
327
342
|
```
|
|
328
343
|
|
|
@@ -1818,81 +1833,23 @@ This is a compound component. Use these sub-components:
|
|
|
1818
1833
|
|
|
1819
1834
|
#### Dialog.Root
|
|
1820
1835
|
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
Props:
|
|
1824
|
-
- `open`: boolean - Whether the dialog is currently open (controlled mode)
|
|
1825
|
-
- `defaultOpen`: boolean [default: false] - Whether the dialog is initially open (uncontrolled mode)
|
|
1826
|
-
- `onOpenChange`: (open: boolean, event: Event) => void - Callback fired when the dialog opens or closes
|
|
1827
|
-
- `modal`: boolean | 'trap-focus' [default: true] - Whether the dialog is modal. When true, focus is trapped and page scroll is locked
|
|
1828
|
-
- `dismissible`: boolean [default: true] - Whether clicking outside closes the dialog
|
|
1829
|
-
|
|
1830
|
-
Usage:
|
|
1831
|
-
```tsx
|
|
1832
|
-
<Dialog.Root open={isOpen} onOpenChange={setIsOpen}>
|
|
1833
|
-
```
|
|
1834
|
-
```tsx
|
|
1835
|
-
<Dialog.Root defaultOpen={false}>
|
|
1836
|
-
```
|
|
1836
|
+
Root sub-component
|
|
1837
1837
|
|
|
1838
1838
|
#### Dialog.Trigger
|
|
1839
1839
|
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
Props:
|
|
1843
|
-
- `render`: ReactElement | ((props, state) => ReactElement) - Custom element to render instead of the default button
|
|
1844
|
-
- `disabled`: boolean - Whether the trigger is disabled
|
|
1845
|
-
|
|
1846
|
-
Usage:
|
|
1847
|
-
```tsx
|
|
1848
|
-
<Dialog.Trigger render={<Button>Open</Button>} />
|
|
1849
|
-
```
|
|
1850
|
-
```tsx
|
|
1851
|
-
<Dialog.Trigger>Open Dialog</Dialog.Trigger>
|
|
1852
|
-
```
|
|
1840
|
+
Trigger sub-component
|
|
1853
1841
|
|
|
1854
1842
|
#### Dialog.Title
|
|
1855
1843
|
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
Props:
|
|
1859
|
-
- `render`: ReactElement | ((props, state) => ReactElement) - Custom element to render instead of the default h2
|
|
1860
|
-
|
|
1861
|
-
Usage:
|
|
1862
|
-
```tsx
|
|
1863
|
-
<Dialog.Title>Confirm Action</Dialog.Title>
|
|
1864
|
-
```
|
|
1865
|
-
```tsx
|
|
1866
|
-
<Dialog.Title render={<h3 />}>Custom Heading</Dialog.Title>
|
|
1867
|
-
```
|
|
1844
|
+
Title sub-component
|
|
1868
1845
|
|
|
1869
1846
|
#### Dialog.Description
|
|
1870
1847
|
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
Props:
|
|
1874
|
-
- `render`: ReactElement | ((props, state) => ReactElement) - Custom element to render instead of the default p
|
|
1875
|
-
|
|
1876
|
-
Usage:
|
|
1877
|
-
```tsx
|
|
1878
|
-
<Dialog.Description>Are you sure you want to proceed?</Dialog.Description>
|
|
1879
|
-
```
|
|
1848
|
+
Description sub-component
|
|
1880
1849
|
|
|
1881
1850
|
#### Dialog.Close
|
|
1882
1851
|
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
Props:
|
|
1886
|
-
- `render`: ReactElement | ((props, state) => ReactElement) - Custom element to render instead of the default button
|
|
1887
|
-
- `disabled`: boolean - Whether the close button is disabled
|
|
1888
|
-
|
|
1889
|
-
Usage:
|
|
1890
|
-
```tsx
|
|
1891
|
-
<Dialog.Close render={<Button>Cancel</Button>} />
|
|
1892
|
-
```
|
|
1893
|
-
```tsx
|
|
1894
|
-
<Dialog.Close>×</Dialog.Close>
|
|
1895
|
-
```
|
|
1852
|
+
Close sub-component
|
|
1896
1853
|
|
|
1897
1854
|
|
|
1898
1855
|
**Examples:**
|
|
@@ -1913,6 +1870,7 @@ Usage:
|
|
|
1913
1870
|
variant="secondary"
|
|
1914
1871
|
shape="square"
|
|
1915
1872
|
icon={<X />}
|
|
1873
|
+
aria-label="Close"
|
|
1916
1874
|
/>
|
|
1917
1875
|
)}
|
|
1918
1876
|
/>
|
|
@@ -1941,6 +1899,7 @@ Usage:
|
|
|
1941
1899
|
variant="secondary"
|
|
1942
1900
|
shape="square"
|
|
1943
1901
|
icon={<X />}
|
|
1902
|
+
aria-label="Close"
|
|
1944
1903
|
/>
|
|
1945
1904
|
)}
|
|
1946
1905
|
/>
|
|
@@ -1969,6 +1928,48 @@ Usage:
|
|
|
1969
1928
|
</Dialog.Root>
|
|
1970
1929
|
```
|
|
1971
1930
|
|
|
1931
|
+
```tsx
|
|
1932
|
+
<Dialog.Root disablePointerDismissal>
|
|
1933
|
+
<Dialog.Trigger
|
|
1934
|
+
render={(p) => (
|
|
1935
|
+
<Button {...p} variant="destructive">
|
|
1936
|
+
Delete Project
|
|
1937
|
+
</Button>
|
|
1938
|
+
)}
|
|
1939
|
+
/>
|
|
1940
|
+
<Dialog className="p-8">
|
|
1941
|
+
<div className="mb-4 flex items-center gap-3">
|
|
1942
|
+
<div className="flex h-10 w-10 items-center justify-center rounded-full bg-kumo-danger/20">
|
|
1943
|
+
<Warning size={20} className="text-kumo-danger" />
|
|
1944
|
+
</div>
|
|
1945
|
+
<Dialog.Title className="text-xl font-semibold">
|
|
1946
|
+
Delete Project?
|
|
1947
|
+
</Dialog.Title>
|
|
1948
|
+
</div>
|
|
1949
|
+
<Dialog.Description className="text-kumo-subtle">
|
|
1950
|
+
This action cannot be undone. This will permanently delete the project
|
|
1951
|
+
and all associated data.
|
|
1952
|
+
</Dialog.Description>
|
|
1953
|
+
<div className="mt-8 flex justify-end gap-2">
|
|
1954
|
+
<Dialog.Close
|
|
1955
|
+
render={(props) => (
|
|
1956
|
+
<Button variant="secondary" {...props}>
|
|
1957
|
+
Cancel
|
|
1958
|
+
</Button>
|
|
1959
|
+
)}
|
|
1960
|
+
/>
|
|
1961
|
+
<Dialog.Close
|
|
1962
|
+
render={(props) => (
|
|
1963
|
+
<Button variant="destructive" {...props}>
|
|
1964
|
+
Delete
|
|
1965
|
+
</Button>
|
|
1966
|
+
)}
|
|
1967
|
+
/>
|
|
1968
|
+
</div>
|
|
1969
|
+
</Dialog>
|
|
1970
|
+
</Dialog.Root>
|
|
1971
|
+
```
|
|
1972
|
+
|
|
1972
1973
|
|
|
1973
1974
|
---
|
|
1974
1975
|
|
|
@@ -2653,8 +2654,10 @@ Label component for form fields. Provides a standardized way to display labels
|
|
|
2653
2654
|
Tooltip content displayed next to the label via an info icon.
|
|
2654
2655
|
- `className`: string
|
|
2655
2656
|
Additional CSS classes merged via `cn()`.
|
|
2657
|
+
- `htmlFor`: string
|
|
2658
|
+
The id of the form element this label is associated with
|
|
2656
2659
|
- `asContent`: boolean
|
|
2657
|
-
When
|
|
2660
|
+
When true, only renders the inline content (indicators, tooltip) without the outer label element with font styling. Useful when composed inside another label element that already provides the text styling.
|
|
2658
2661
|
|
|
2659
2662
|
**Colors (kumo tokens used):**
|
|
2660
2663
|
|
|
@@ -2757,7 +2760,12 @@ Secondary sub-component
|
|
|
2757
2760
|
<LayerCard>
|
|
2758
2761
|
<LayerCard.Secondary className="flex items-center justify-between">
|
|
2759
2762
|
<div>Next Steps</div>
|
|
2760
|
-
<Button
|
|
2763
|
+
<Button
|
|
2764
|
+
variant="ghost"
|
|
2765
|
+
size="sm"
|
|
2766
|
+
shape="square"
|
|
2767
|
+
aria-label="Go to next steps"
|
|
2768
|
+
>
|
|
2761
2769
|
<ArrowRightIcon size={16} />
|
|
2762
2770
|
</Button>
|
|
2763
2771
|
</LayerCard.Secondary>
|
|
@@ -3082,6 +3090,8 @@ Page navigation controls with page count display.
|
|
|
3082
3090
|
Number of items displayed per page.
|
|
3083
3091
|
- `totalCount`: number
|
|
3084
3092
|
Total number of items across all pages.
|
|
3093
|
+
- `text`: object
|
|
3094
|
+
Method to provide custom pagination text
|
|
3085
3095
|
|
|
3086
3096
|
**Colors (kumo tokens used):**
|
|
3087
3097
|
|
|
@@ -3106,6 +3116,16 @@ Page navigation controls with page count display.
|
|
|
3106
3116
|
/>
|
|
3107
3117
|
```
|
|
3108
3118
|
|
|
3119
|
+
```tsx
|
|
3120
|
+
<Pagination
|
|
3121
|
+
text={({ perPage }) => `Page ${page} - showing ${perPage} per page`}
|
|
3122
|
+
page={page}
|
|
3123
|
+
setPage={setPage}
|
|
3124
|
+
perPage={25}
|
|
3125
|
+
totalCount={100}
|
|
3126
|
+
/>
|
|
3127
|
+
```
|
|
3128
|
+
|
|
3109
3129
|
|
|
3110
3130
|
---
|
|
3111
3131
|
|
|
@@ -3161,7 +3181,7 @@ Close sub-component
|
|
|
3161
3181
|
```tsx
|
|
3162
3182
|
<Popover>
|
|
3163
3183
|
<Popover.Trigger asChild>
|
|
3164
|
-
<Button shape="square" icon={BellIcon} />
|
|
3184
|
+
<Button shape="square" icon={BellIcon} aria-label="Notifications" />
|
|
3165
3185
|
</Popover.Trigger>
|
|
3166
3186
|
<Popover.Content>
|
|
3167
3187
|
<Popover.Title>Notifications</Popover.Title>
|
|
@@ -3479,29 +3499,12 @@ Option sub-component
|
|
|
3479
3499
|
<Select
|
|
3480
3500
|
className="w-[200px]"
|
|
3481
3501
|
value={value}
|
|
3482
|
-
onValueChange={(v) => setValue(v ?? "
|
|
3483
|
-
|
|
3502
|
+
onValueChange={(v) => setValue(v ?? "apple")}
|
|
3503
|
+
items={{ apple: "Apple", banana: "Banana", cherry: "Cherry" }}
|
|
3484
3504
|
>
|
|
3485
|
-
<Select.Option value="
|
|
3486
|
-
<Select.Option value="
|
|
3487
|
-
<Select.Option value="
|
|
3488
|
-
</Select>
|
|
3489
|
-
```
|
|
3490
|
-
|
|
3491
|
-
```tsx
|
|
3492
|
-
<Select
|
|
3493
|
-
className="w-[200px]"
|
|
3494
|
-
value={value}
|
|
3495
|
-
onValueChange={(v) => setValue(v as string)}
|
|
3496
|
-
items={{
|
|
3497
|
-
bug: "Bug",
|
|
3498
|
-
documentation: "Documentation",
|
|
3499
|
-
feature: "Feature",
|
|
3500
|
-
}}
|
|
3501
|
-
>
|
|
3502
|
-
<Select.Option value="bug">Bug</Select.Option>
|
|
3503
|
-
<Select.Option value="documentation">Documentation</Select.Option>
|
|
3504
|
-
<Select.Option value="feature">Feature</Select.Option>
|
|
3505
|
+
<Select.Option value="apple">Apple</Select.Option>
|
|
3506
|
+
<Select.Option value="banana">Banana</Select.Option>
|
|
3507
|
+
<Select.Option value="cherry">Cherry</Select.Option>
|
|
3505
3508
|
</Select>
|
|
3506
3509
|
```
|
|
3507
3510
|
|
|
@@ -3964,16 +3967,27 @@ ResizeHandle sub-component
|
|
|
3964
3967
|
<Table>
|
|
3965
3968
|
<Table.Header>
|
|
3966
3969
|
<Table.Row>
|
|
3967
|
-
<Table.CheckHead
|
|
3970
|
+
<Table.CheckHead
|
|
3971
|
+
checked={selectedIds.size === rows.length}
|
|
3972
|
+
indeterminate={
|
|
3973
|
+
selectedIds.size > 0 && selectedIds.size < rows.length
|
|
3974
|
+
}
|
|
3975
|
+
onValueChange={toggleAll}
|
|
3976
|
+
aria-label="Select all rows"
|
|
3977
|
+
/>
|
|
3968
3978
|
<Table.Head>Subject</Table.Head>
|
|
3969
3979
|
<Table.Head>From</Table.Head>
|
|
3970
3980
|
<Table.Head>Date</Table.Head>
|
|
3971
3981
|
</Table.Row>
|
|
3972
3982
|
</Table.Header>
|
|
3973
3983
|
<Table.Body>
|
|
3974
|
-
{
|
|
3984
|
+
{rows.map((row) => (
|
|
3975
3985
|
<Table.Row key={row.id}>
|
|
3976
|
-
<Table.CheckCell
|
|
3986
|
+
<Table.CheckCell
|
|
3987
|
+
checked={selectedIds.has(row.id)}
|
|
3988
|
+
onValueChange={() => toggleRow(row.id)}
|
|
3989
|
+
aria-label={`Select ${row.subject}`}
|
|
3990
|
+
/>
|
|
3977
3991
|
<Table.Cell>{row.subject}</Table.Cell>
|
|
3978
3992
|
<Table.Cell>{row.from}</Table.Cell>
|
|
3979
3993
|
<Table.Cell>{row.date}</Table.Cell>
|
|
@@ -3991,31 +4005,35 @@ ResizeHandle sub-component
|
|
|
3991
4005
|
<Table>
|
|
3992
4006
|
<Table.Header>
|
|
3993
4007
|
<Table.Row>
|
|
3994
|
-
<Table.CheckHead
|
|
4008
|
+
<Table.CheckHead
|
|
4009
|
+
checked={selectedIds.size === rows.length}
|
|
4010
|
+
indeterminate={
|
|
4011
|
+
selectedIds.size > 0 && selectedIds.size < rows.length
|
|
4012
|
+
}
|
|
4013
|
+
onValueChange={toggleAll}
|
|
4014
|
+
aria-label="Select all rows"
|
|
4015
|
+
/>
|
|
3995
4016
|
<Table.Head>Subject</Table.Head>
|
|
3996
4017
|
<Table.Head>From</Table.Head>
|
|
3997
4018
|
<Table.Head>Date</Table.Head>
|
|
3998
4019
|
</Table.Row>
|
|
3999
4020
|
</Table.Header>
|
|
4000
4021
|
<Table.Body>
|
|
4001
|
-
|
|
4002
|
-
<Table.
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
<Table.Cell>Cloudflare</Table.Cell>
|
|
4017
|
-
<Table.Cell>1 hour ago</Table.Cell>
|
|
4018
|
-
</Table.Row>
|
|
4022
|
+
{rows.map((row) => (
|
|
4023
|
+
<Table.Row
|
|
4024
|
+
key={row.id}
|
|
4025
|
+
variant={selectedIds.has(row.id) ? "selected" : "default"}
|
|
4026
|
+
>
|
|
4027
|
+
<Table.CheckCell
|
|
4028
|
+
checked={selectedIds.has(row.id)}
|
|
4029
|
+
onValueChange={() => toggleRow(row.id)}
|
|
4030
|
+
aria-label={`Select ${row.subject}`}
|
|
4031
|
+
/>
|
|
4032
|
+
<Table.Cell>{row.subject}</Table.Cell>
|
|
4033
|
+
<Table.Cell>{row.from}</Table.Cell>
|
|
4034
|
+
<Table.Cell>{row.date}</Table.Cell>
|
|
4035
|
+
</Table.Row>
|
|
4036
|
+
))}
|
|
4019
4037
|
</Table.Body>
|
|
4020
4038
|
</Table>
|
|
4021
4039
|
</LayerCard.Primary>
|
|
@@ -4057,7 +4075,8 @@ ResizeHandle sub-component
|
|
|
4057
4075
|
<LayerCard.Primary className="w-full overflow-x-auto p-0">
|
|
4058
4076
|
<Table layout="fixed">
|
|
4059
4077
|
<colgroup>
|
|
4060
|
-
<col
|
|
4078
|
+
<col />{" "}
|
|
4079
|
+
{/* Checkbox column - width handled by Table.CheckHead/CheckCell */}
|
|
4061
4080
|
<col />
|
|
4062
4081
|
<col style={{ width: "150px" }} />
|
|
4063
4082
|
<col style={{ width: "120px" }} />
|
|
@@ -4065,7 +4084,14 @@ ResizeHandle sub-component
|
|
|
4065
4084
|
</colgroup>
|
|
4066
4085
|
<Table.Header>
|
|
4067
4086
|
<Table.Row>
|
|
4068
|
-
<Table.CheckHead
|
|
4087
|
+
<Table.CheckHead
|
|
4088
|
+
checked={selectedIds.size === emailData.length}
|
|
4089
|
+
indeterminate={
|
|
4090
|
+
selectedIds.size > 0 && selectedIds.size < emailData.length
|
|
4091
|
+
}
|
|
4092
|
+
onValueChange={toggleAll}
|
|
4093
|
+
aria-label="Select all rows"
|
|
4094
|
+
/>
|
|
4069
4095
|
<Table.Head>Subject</Table.Head>
|
|
4070
4096
|
<Table.Head>From</Table.Head>
|
|
4071
4097
|
<Table.Head>Date</Table.Head>
|
|
@@ -4073,13 +4099,14 @@ ResizeHandle sub-component
|
|
|
4073
4099
|
</Table.Row>
|
|
4074
4100
|
</Table.Header>
|
|
4075
4101
|
<Table.Body>
|
|
4076
|
-
{emailData.map((row
|
|
4102
|
+
{emailData.map((row) => (
|
|
4077
4103
|
<Table.Row
|
|
4078
4104
|
key={row.id}
|
|
4079
|
-
variant={
|
|
4105
|
+
variant={selectedIds.has(row.id) ? "selected" : "default"}
|
|
4080
4106
|
>
|
|
4081
4107
|
<Table.CheckCell
|
|
4082
|
-
checked={
|
|
4108
|
+
checked={selectedIds.has(row.id)}
|
|
4109
|
+
onValueChange={() => toggleRow(row.id)}
|
|
4083
4110
|
aria-label={`Select ${row.subject}`}
|
|
4084
4111
|
/>
|
|
4085
4112
|
<Table.Cell>
|
|
@@ -4102,14 +4129,30 @@ ResizeHandle sub-component
|
|
|
4102
4129
|
<span className="truncate">{row.date}</span>
|
|
4103
4130
|
</Table.Cell>
|
|
4104
4131
|
<Table.Cell className="text-right">
|
|
4105
|
-
<
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4132
|
+
<DropdownMenu>
|
|
4133
|
+
<DropdownMenu.Trigger
|
|
4134
|
+
render={
|
|
4135
|
+
<Button
|
|
4136
|
+
variant="ghost"
|
|
4137
|
+
size="sm"
|
|
4138
|
+
shape="square"
|
|
4139
|
+
aria-label="More options"
|
|
4140
|
+
>
|
|
4141
|
+
<DotsThree weight="bold" size={16} />
|
|
4142
|
+
</Button>
|
|
4143
|
+
}
|
|
4144
|
+
/>
|
|
4145
|
+
<DropdownMenu.Content>
|
|
4146
|
+
<DropdownMenu.Item icon={Eye}>View</DropdownMenu.Item>
|
|
4147
|
+
<DropdownMenu.Item icon={PencilSimple}>
|
|
4148
|
+
Edit
|
|
4149
|
+
</DropdownMenu.Item>
|
|
4150
|
+
<DropdownMenu.Separator />
|
|
4151
|
+
<DropdownMenu.Item icon={Trash} variant="danger">
|
|
4152
|
+
Delete
|
|
4153
|
+
</DropdownMenu.Item>
|
|
4154
|
+
</DropdownMenu.Content>
|
|
4155
|
+
</DropdownMenu>
|
|
4113
4156
|
</Table.Cell>
|
|
4114
4157
|
</Table.Row>
|
|
4115
4158
|
))}
|
|
@@ -4438,7 +4481,7 @@ Accessible popup that shows additional information on hover/focus. Wrap your app
|
|
|
4438
4481
|
```tsx
|
|
4439
4482
|
<TooltipProvider>
|
|
4440
4483
|
<Tooltip content="Add new item" asChild>
|
|
4441
|
-
<Button shape="square" icon={PlusIcon} />
|
|
4484
|
+
<Button shape="square" icon={PlusIcon} aria-label="Add new item" />
|
|
4442
4485
|
</Tooltip>
|
|
4443
4486
|
</TooltipProvider>
|
|
4444
4487
|
```
|
|
@@ -4447,10 +4490,14 @@ Accessible popup that shows additional information on hover/focus. Wrap your app
|
|
|
4447
4490
|
<TooltipProvider>
|
|
4448
4491
|
<div className="flex gap-2">
|
|
4449
4492
|
<Tooltip content="Add" asChild>
|
|
4450
|
-
<Button shape="square" icon={PlusIcon} />
|
|
4493
|
+
<Button shape="square" icon={PlusIcon} aria-label="Add" />
|
|
4451
4494
|
</Tooltip>
|
|
4452
4495
|
<Tooltip content="Change language" asChild>
|
|
4453
|
-
<Button
|
|
4496
|
+
<Button
|
|
4497
|
+
shape="square"
|
|
4498
|
+
icon={TranslateIcon}
|
|
4499
|
+
aria-label="Change language"
|
|
4500
|
+
/>
|
|
4454
4501
|
</Tooltip>
|
|
4455
4502
|
</div>
|
|
4456
4503
|
</TooltipProvider>
|
package/ai/schemas.ts
CHANGED
|
@@ -131,13 +131,13 @@ export const BreadcrumbsPropsSchema = z.object({
|
|
|
131
131
|
});
|
|
132
132
|
|
|
133
133
|
export const ButtonPropsSchema = z.object({
|
|
134
|
+
shape: z.enum(["base", "square", "circle"]).optional(),
|
|
135
|
+
size: z.enum(["xs", "sm", "base", "lg"]).optional(),
|
|
136
|
+
variant: z.enum(["primary", "secondary", "ghost", "destructive", "secondary-destructive", "outline"]).optional(),
|
|
134
137
|
children: z.union([z.string(), z.number(), z.boolean(), z.null(), DynamicValueSchema]).optional(),
|
|
135
138
|
className: z.string().optional(),
|
|
136
139
|
icon: z.union([z.string(), z.number(), z.boolean(), z.null(), DynamicValueSchema]).optional(), // Icon from `@phosphor-icons/react` or a React element. Rendered before children.
|
|
137
140
|
loading: z.boolean().optional(), // Shows a loading spinner and disables interaction.
|
|
138
|
-
shape: z.enum(["base", "square", "circle"]).optional(), // Button shape. - `"base"` — Default rectangular button - `"square"` — Square button for icon-only actions - `"circle"` — Circular button for icon-only actions
|
|
139
|
-
size: z.enum(["xs", "sm", "base", "lg"]).optional(), // Button size. - `"xs"` — Extra small for compact UIs - `"sm"` — Small for secondary actions - `"base"` — Default size - `"lg"` — Large for primary CTAs
|
|
140
|
-
variant: z.enum(["primary", "secondary", "ghost", "destructive", "secondary-destructive", "outline"]).optional(), // Visual style of the button. - `"primary"` — High-emphasis, brand-colored for primary actions - `"secondary"` — Default style with border for most actions - `"ghost"` — Minimal, no background for tertiary actions - `"destructive"` — Danger button for destructive actions - `"secondary-destructive"` — Secondary style with destructive text - `"outline"` — Bordered with transparent background
|
|
141
141
|
id: z.string().optional(),
|
|
142
142
|
lang: z.string().optional(),
|
|
143
143
|
title: z.string().optional(),
|
|
@@ -526,7 +526,8 @@ export const LabelPropsSchema = z.object({
|
|
|
526
526
|
showOptional: z.boolean().optional(), // When `true`, shows gray "(optional)" text after the label.
|
|
527
527
|
tooltip: z.union([z.string(), z.number(), z.boolean(), z.null(), DynamicValueSchema]).optional(), // Tooltip content displayed next to the label via an info icon.
|
|
528
528
|
className: z.string().optional(), // Additional CSS classes merged via `cn()`.
|
|
529
|
-
|
|
529
|
+
htmlFor: z.string().optional(), // The id of the form element this label is associated with
|
|
530
|
+
asContent: z.boolean().optional(), // When true, only renders the inline content (indicators, tooltip) without the outer label element with font styling. Useful when composed inside another label element that already provides the text styling.
|
|
530
531
|
});
|
|
531
532
|
|
|
532
533
|
export const LayerCardPropsSchema = z.object({
|
|
@@ -582,6 +583,7 @@ export const PaginationPropsSchema = z.object({
|
|
|
582
583
|
page: z.number().optional(), // Current page number (1-indexed).
|
|
583
584
|
perPage: z.number().optional(), // Number of items displayed per page.
|
|
584
585
|
totalCount: z.number().optional(), // Total number of items across all pages.
|
|
586
|
+
text: z.unknown().optional(), // Method to provide custom pagination text
|
|
585
587
|
});
|
|
586
588
|
|
|
587
589
|
export const PopoverPropsSchema = z.object({
|
package/bin/kumo.js
CHANGED
|
@@ -7,26 +7,30 @@ import { fileURLToPath, pathToFileURL } from "node:url";
|
|
|
7
7
|
const __filename = fileURLToPath(import.meta.url);
|
|
8
8
|
const __dirname = path.dirname(__filename);
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
async function main() {
|
|
11
|
+
const distCliPath = path.resolve(__dirname, "../dist/command-line/cli.js");
|
|
12
|
+
if (existsSync(distCliPath)) {
|
|
13
|
+
await import(pathToFileURL(distCliPath).href);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
15
16
|
|
|
16
|
-
// In a repo checkout, the CLI may not be built yet. If `tsx` is available,
|
|
17
|
-
// run the TypeScript entrypoint directly.
|
|
18
|
-
const srcCliPath = path.resolve(__dirname, "../src/command-line/cli.ts");
|
|
19
|
-
if (existsSync(srcCliPath)) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
// In a repo checkout, the CLI may not be built yet. If `tsx` is available,
|
|
18
|
+
// run the TypeScript entrypoint directly.
|
|
19
|
+
const srcCliPath = path.resolve(__dirname, "../src/command-line/cli.ts");
|
|
20
|
+
if (existsSync(srcCliPath)) {
|
|
21
|
+
const result = spawnSync(
|
|
22
|
+
process.execPath,
|
|
23
|
+
["--import", "tsx", srcCliPath, ...process.argv.slice(2)],
|
|
24
|
+
{ stdio: "inherit" },
|
|
25
|
+
);
|
|
25
26
|
|
|
26
|
-
|
|
27
|
+
process.exit(result.status ?? 1);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
console.error(
|
|
31
|
+
"Kumo CLI entrypoint not found. If you're in the repo, run: pnpm --filter @cloudflare/kumo build",
|
|
32
|
+
);
|
|
33
|
+
process.exit(1);
|
|
27
34
|
}
|
|
28
35
|
|
|
29
|
-
|
|
30
|
-
"Kumo CLI entrypoint not found. If you're in the repo, run: pnpm --filter @cloudflare/kumo build",
|
|
31
|
-
);
|
|
32
|
-
process.exit(1);
|
|
36
|
+
main();
|
package/dist/.build-complete
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1771248145491
|