@duro-app/cli 3.1.0 → 3.2.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 (2) hide show
  1. package/package.json +5 -5
  2. package/registry.json +186 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duro-app/cli",
3
- "version": "3.1.0",
3
+ "version": "3.2.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Machine-queryable docs for the Duro design system: components, props, recipes, tokens and rules as CLI output, JSON, or an MCP server.",
@@ -45,7 +45,7 @@
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@modelcontextprotocol/sdk": ">=1.0.0",
48
- "@duro-app/ui": "^3.1.0"
48
+ "@duro-app/ui": "^3.2.0"
49
49
  },
50
50
  "peerDependenciesMeta": {
51
51
  "@duro-app/ui": {
@@ -60,9 +60,9 @@
60
60
  "@types/node": "^24.0.0",
61
61
  "ts-morph": "^26.0.0",
62
62
  "typescript": "^5.7.0",
63
- "@duro-app/eslint-plugin": "^3.1.0",
64
- "@duro-app/tokens": "^3.1.0",
65
- "@duro-app/ui": "^3.1.0"
63
+ "@duro-app/eslint-plugin": "^3.2.0",
64
+ "@duro-app/ui": "^3.2.0",
65
+ "@duro-app/tokens": "^3.2.0"
66
66
  },
67
67
  "scripts": {
68
68
  "registry": "node scripts/build-registry.mjs",
package/registry.json CHANGED
@@ -1743,6 +1743,152 @@
1743
1743
  "props": null,
1744
1744
  "sourcePath": "packages/ui/src/components/Dialog/Dialog.tsx"
1745
1745
  },
1746
+ "DragDrop": {
1747
+ "importPath": "@duro-app/ui",
1748
+ "kind": "compound",
1749
+ "meta": {
1750
+ "anatomy": {
1751
+ "required": [
1752
+ "Root",
1753
+ "Zone",
1754
+ "Item"
1755
+ ]
1756
+ },
1757
+ "description": "Move items between zones with one pointer — mouse, pen and touch through the same pointer-event path (touch holds briefly, then drags; a moving touch stays a scroll). A ghost follows the pointer, the zone under it lights up, and the Root announces picks and drops to screen readers. Dragging is pointer-only by design: keep a button or remove affordance that does the same thing.",
1758
+ "example": "<DragDrop.Root onDrop={({item, target}) => move(item.id, target.zone, target.index)}>\n <DragDrop.Zone id=\"roster\" label=\"Roster\">\n <Cluster gap=\"sm\">\n {people.map((p) => (\n <DragDrop.Item key={p.id} id={p.id} zone=\"roster\" label={p.name} data={p}>\n <Button variant=\"secondary\" size=\"small\" onClick={() => slot(p)}>{p.name}</Button>\n </DragDrop.Item>\n ))}\n </Cluster>\n </DragDrop.Zone>\n <DragDrop.Zone id=\"gates\" label=\"Gates\" orientation=\"horizontal\">\n <Inline gap=\"sm\">\n {gates.map((g) => (\n <DragDrop.Item key={g.id} id={g.id} zone=\"gates\" label={g.name} data={g}>\n <Tag removable onRemove={() => unslot(g)}>{g.name}</Tag>\n </DragDrop.Item>\n ))}\n </Inline>\n </DragDrop.Zone>\n</DragDrop.Root>",
1759
+ "relatedTo": [
1760
+ {
1761
+ "component": "Tag",
1762
+ "kind": "composition",
1763
+ "relationship": "A removable Tag inside an Item gives the drop target its non-drag remove path"
1764
+ },
1765
+ {
1766
+ "component": "ScrollArea",
1767
+ "kind": "contrast",
1768
+ "relationship": "ScrollArea drags a thumb along one axis; DragDrop moves items between zones"
1769
+ }
1770
+ ],
1771
+ "whenNotToUse": [
1772
+ "As the ONLY way to do something — every drag needs a tap/click equivalent (WCAG 2.5.7); this component does not provide one",
1773
+ "Long lists that scroll while dragging — the ghost follows the pointer but zones do not auto-scroll",
1774
+ "Sorting tabular data — sort the Table instead",
1775
+ "React Native — Item renders its children without drag behaviour there"
1776
+ ],
1777
+ "whenToUse": [
1778
+ "Slotting things into places — people into approval gates, cards into columns, files into folders",
1779
+ "Reordering a short row or list when the order is visible and meaningful"
1780
+ ]
1781
+ },
1782
+ "name": "DragDrop",
1783
+ "parts": {
1784
+ "Item": {
1785
+ "name": "Item",
1786
+ "props": [
1787
+ {
1788
+ "name": "id",
1789
+ "required": true,
1790
+ "type": "string"
1791
+ },
1792
+ {
1793
+ "description": "The zone this item currently lives in.",
1794
+ "name": "zone",
1795
+ "required": true,
1796
+ "type": "string"
1797
+ },
1798
+ {
1799
+ "description": "Read to screen readers when picked up or dropped.",
1800
+ "name": "label",
1801
+ "required": true,
1802
+ "type": "string"
1803
+ },
1804
+ {
1805
+ "description": "Carried to onDrop untouched.",
1806
+ "name": "data",
1807
+ "required": false,
1808
+ "type": "T"
1809
+ },
1810
+ {
1811
+ "description": "What follows the pointer; defaults to the children.",
1812
+ "name": "preview",
1813
+ "required": false,
1814
+ "type": "ReactNode"
1815
+ },
1816
+ {
1817
+ "default": "false",
1818
+ "name": "disabled",
1819
+ "required": false,
1820
+ "type": "boolean"
1821
+ },
1822
+ {
1823
+ "name": "children",
1824
+ "required": true,
1825
+ "type": "ReactNode"
1826
+ }
1827
+ ],
1828
+ "sourcePath": "packages/ui/src/components/DragDrop/DragDrop.tsx"
1829
+ },
1830
+ "Root": {
1831
+ "name": "Root",
1832
+ "props": [
1833
+ {
1834
+ "description": "Called when an item is released over a zone that accepts it. Reordering inside the item's own zone arrives here too, with the new index.",
1835
+ "name": "onDrop",
1836
+ "required": true,
1837
+ "type": "(event: DragDropEvent<T>) => void"
1838
+ },
1839
+ {
1840
+ "description": "Overrides the default screen-reader announcements.",
1841
+ "name": "announce",
1842
+ "required": false,
1843
+ "type": "(event: {kind: 'pick' | 'drop' | 'cancel'; item: string; zone?: string}) => string"
1844
+ },
1845
+ {
1846
+ "name": "children",
1847
+ "required": true,
1848
+ "type": "ReactNode"
1849
+ }
1850
+ ],
1851
+ "sourcePath": "packages/ui/src/components/DragDrop/DragDrop.tsx"
1852
+ },
1853
+ "Zone": {
1854
+ "name": "Zone",
1855
+ "props": [
1856
+ {
1857
+ "name": "id",
1858
+ "required": true,
1859
+ "type": "string"
1860
+ },
1861
+ {
1862
+ "description": "Read to screen readers when an item is dropped here.",
1863
+ "name": "label",
1864
+ "required": true,
1865
+ "type": "string"
1866
+ },
1867
+ {
1868
+ "default": "'horizontal'",
1869
+ "description": "Which axis items flow along; decides how the insertion index is read from the pointer.",
1870
+ "name": "orientation",
1871
+ "required": false,
1872
+ "type": "'horizontal' | 'vertical'"
1873
+ },
1874
+ {
1875
+ "description": "Refuse an item; the zone then never lights up for it.",
1876
+ "name": "accepts",
1877
+ "required": false,
1878
+ "type": "(item: DragDropItemData<T>) => boolean"
1879
+ },
1880
+ {
1881
+ "name": "children",
1882
+ "required": true,
1883
+ "type": "ReactNode"
1884
+ }
1885
+ ],
1886
+ "sourcePath": "packages/ui/src/components/DragDrop/DragDrop.tsx"
1887
+ }
1888
+ },
1889
+ "props": null,
1890
+ "sourcePath": "packages/ui/src/components/DragDrop/DragDrop.tsx"
1891
+ },
1746
1892
  "Drawer": {
1747
1893
  "importPath": "@duro-app/ui",
1748
1894
  "kind": "compound",
@@ -5878,6 +6024,46 @@
5878
6024
  "props": [],
5879
6025
  "sourcePath": "packages/ui/src/components/Table/useDataTable.ts"
5880
6026
  },
6027
+ "useDragDrop": {
6028
+ "importPath": "@duro-app/ui",
6029
+ "kind": "hook",
6030
+ "meta": {
6031
+ "anatomy": {
6032
+ "required": [
6033
+ "Root",
6034
+ "Zone",
6035
+ "Item"
6036
+ ]
6037
+ },
6038
+ "description": "Move items between zones with one pointer — mouse, pen and touch through the same pointer-event path (touch holds briefly, then drags; a moving touch stays a scroll). A ghost follows the pointer, the zone under it lights up, and the Root announces picks and drops to screen readers. Dragging is pointer-only by design: keep a button or remove affordance that does the same thing.",
6039
+ "example": "<DragDrop.Root onDrop={({item, target}) => move(item.id, target.zone, target.index)}>\n <DragDrop.Zone id=\"roster\" label=\"Roster\">\n <Cluster gap=\"sm\">\n {people.map((p) => (\n <DragDrop.Item key={p.id} id={p.id} zone=\"roster\" label={p.name} data={p}>\n <Button variant=\"secondary\" size=\"small\" onClick={() => slot(p)}>{p.name}</Button>\n </DragDrop.Item>\n ))}\n </Cluster>\n </DragDrop.Zone>\n <DragDrop.Zone id=\"gates\" label=\"Gates\" orientation=\"horizontal\">\n <Inline gap=\"sm\">\n {gates.map((g) => (\n <DragDrop.Item key={g.id} id={g.id} zone=\"gates\" label={g.name} data={g}>\n <Tag removable onRemove={() => unslot(g)}>{g.name}</Tag>\n </DragDrop.Item>\n ))}\n </Inline>\n </DragDrop.Zone>\n</DragDrop.Root>",
6040
+ "relatedTo": [
6041
+ {
6042
+ "component": "Tag",
6043
+ "kind": "composition",
6044
+ "relationship": "A removable Tag inside an Item gives the drop target its non-drag remove path"
6045
+ },
6046
+ {
6047
+ "component": "ScrollArea",
6048
+ "kind": "contrast",
6049
+ "relationship": "ScrollArea drags a thumb along one axis; DragDrop moves items between zones"
6050
+ }
6051
+ ],
6052
+ "whenNotToUse": [
6053
+ "As the ONLY way to do something — every drag needs a tap/click equivalent (WCAG 2.5.7); this component does not provide one",
6054
+ "Long lists that scroll while dragging — the ghost follows the pointer but zones do not auto-scroll",
6055
+ "Sorting tabular data — sort the Table instead",
6056
+ "React Native — Item renders its children without drag behaviour there"
6057
+ ],
6058
+ "whenToUse": [
6059
+ "Slotting things into places — people into approval gates, cards into columns, files into folders",
6060
+ "Reordering a short row or list when the order is visible and meaningful"
6061
+ ]
6062
+ },
6063
+ "name": "useDragDrop",
6064
+ "props": [],
6065
+ "sourcePath": "packages/ui/src/components/DragDrop/DragDrop.tsx"
6066
+ },
5881
6067
  "usePortalMount": {
5882
6068
  "importPath": "@duro-app/ui",
5883
6069
  "kind": "hook",