@agentero/design-system 0.26.3 → 0.27.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/mcp/manifests/components.html +428 -83
- package/mcp/manifests/components.json +336 -15
- package/package.json +6 -1
- package/src/checkbox/checkbox.d.ts +74 -0
- package/src/checkbox/checkbox.js +43 -0
- package/src/checkbox/icons.d.ts +5 -0
- package/src/checkbox/icons.js +28 -0
- package/src/checkbox/index.d.ts +2 -0
- package/src/checkbox/index.js +2 -0
- package/src/dropdown-menu/dropdown-menu.js +2 -2
- package/src/hover-card/hover-card.js +1 -1
- package/src/modal/modal.js +2 -2
- package/src/popover/popover.js +1 -1
- package/theme/base.css +24 -6
|
@@ -1672,6 +1672,320 @@
|
|
|
1672
1672
|
],
|
|
1673
1673
|
"import": "import { CheckList } from \"@agentero/design-system\";"
|
|
1674
1674
|
},
|
|
1675
|
+
"components-checkbox": {
|
|
1676
|
+
"id": "components-checkbox",
|
|
1677
|
+
"name": "Checkbox",
|
|
1678
|
+
"path": "./src/checkbox/checkbox.stories.tsx",
|
|
1679
|
+
"jsDocTags": {
|
|
1680
|
+
"summary": [
|
|
1681
|
+
"Base checkbox control, with mixed state, unaware of form libraries"
|
|
1682
|
+
],
|
|
1683
|
+
"example": [
|
|
1684
|
+
"<Label htmlFor=\"terms\">I accept the terms</Label>\n<Checkbox id=\"terms\" name=\"terms\" required />"
|
|
1685
|
+
]
|
|
1686
|
+
},
|
|
1687
|
+
"description": "Base control for a boolean the user confirms later. Headless: pair it with\na `Label` and `htmlFor`, or give it an `aria-label`. There is no `status`\nprop — set `aria-invalid` and the destructive treatment follows.",
|
|
1688
|
+
"summary": "Base checkbox control, with mixed state, unaware of form libraries",
|
|
1689
|
+
"reactComponentMeta": {
|
|
1690
|
+
"displayName": "Checkbox",
|
|
1691
|
+
"exportName": "Checkbox",
|
|
1692
|
+
"filePath": "/home/runner/work/design-system/design-system/src/checkbox/checkbox.tsx",
|
|
1693
|
+
"description": "Base control for a boolean the user confirms later: one item of a\nmulti-select, a terms tick, a row picked for a bulk action. Supports the\nmixed state for a parent that summarises a partially selected group.\nKeeps the legacy 16px surface, glyphs and state colours during adoption.\n\nHeadless like [Input](?path=/docs/components-input--docs): pair it with\n[Label](?path=/docs/components-label--docs) and `htmlFor`, or give it an\n`aria-label`. There is no `status` prop — set `aria-invalid`.\n\nUse [Switch](?path=/docs/components-switch--docs) when the change applies\nimmediately, and [CheckList](?path=/docs/components-check-list--docs) for a\nread-only list of ticked items.",
|
|
1694
|
+
"jsDocTags": {
|
|
1695
|
+
"summary": [
|
|
1696
|
+
"Base checkbox control, with mixed state, unaware of form libraries"
|
|
1697
|
+
],
|
|
1698
|
+
"example": [
|
|
1699
|
+
"<Label htmlFor=\"terms\">I accept the terms</Label>\n<Checkbox id=\"terms\" name=\"terms\" required />"
|
|
1700
|
+
]
|
|
1701
|
+
},
|
|
1702
|
+
"props": {
|
|
1703
|
+
"defaultChecked": {
|
|
1704
|
+
"name": "defaultChecked",
|
|
1705
|
+
"required": false,
|
|
1706
|
+
"type": {
|
|
1707
|
+
"name": "CheckedState | undefined"
|
|
1708
|
+
},
|
|
1709
|
+
"description": "Initial state for an uncontrolled checkbox.",
|
|
1710
|
+
"defaultValue": null,
|
|
1711
|
+
"parent": {
|
|
1712
|
+
"name": "CheckboxProps",
|
|
1713
|
+
"fileName": "node_modules/@radix-ui/react-checkbox/dist/index.d.mts"
|
|
1714
|
+
},
|
|
1715
|
+
"declarations": [
|
|
1716
|
+
{
|
|
1717
|
+
"name": "CheckboxProps",
|
|
1718
|
+
"fileName": "node_modules/@radix-ui/react-checkbox/dist/index.d.mts"
|
|
1719
|
+
},
|
|
1720
|
+
{
|
|
1721
|
+
"name": "TypeLiteral",
|
|
1722
|
+
"fileName": "src/checkbox/checkbox.tsx"
|
|
1723
|
+
}
|
|
1724
|
+
]
|
|
1725
|
+
},
|
|
1726
|
+
"aria-invalid": {
|
|
1727
|
+
"name": "aria-invalid",
|
|
1728
|
+
"required": false,
|
|
1729
|
+
"type": {
|
|
1730
|
+
"name": "boolean | \"true\" | \"false\" | \"grammar\" | \"spelling\" | undefined"
|
|
1731
|
+
},
|
|
1732
|
+
"description": "Indicates the entered value does not conform to the format expected by the application.\nDrives the destructive border and fill. Point `aria-describedby` at the error message.",
|
|
1733
|
+
"defaultValue": null,
|
|
1734
|
+
"parent": {
|
|
1735
|
+
"name": "AriaAttributes",
|
|
1736
|
+
"fileName": "node_modules/@types/react/index.d.ts"
|
|
1737
|
+
},
|
|
1738
|
+
"declarations": [
|
|
1739
|
+
{
|
|
1740
|
+
"name": "AriaAttributes",
|
|
1741
|
+
"fileName": "node_modules/@types/react/index.d.ts"
|
|
1742
|
+
},
|
|
1743
|
+
{
|
|
1744
|
+
"name": "TypeLiteral",
|
|
1745
|
+
"fileName": "src/checkbox/checkbox.tsx"
|
|
1746
|
+
}
|
|
1747
|
+
]
|
|
1748
|
+
},
|
|
1749
|
+
"asChild": {
|
|
1750
|
+
"name": "asChild",
|
|
1751
|
+
"required": false,
|
|
1752
|
+
"type": {
|
|
1753
|
+
"name": "boolean"
|
|
1754
|
+
},
|
|
1755
|
+
"description": "",
|
|
1756
|
+
"defaultValue": null,
|
|
1757
|
+
"parent": {
|
|
1758
|
+
"name": "PrimitivePropsWithRef",
|
|
1759
|
+
"fileName": "node_modules/@radix-ui/react-label/node_modules/@radix-ui/react-primitive/dist/index.d.mts"
|
|
1760
|
+
},
|
|
1761
|
+
"declarations": [
|
|
1762
|
+
{
|
|
1763
|
+
"name": "TypeLiteral",
|
|
1764
|
+
"fileName": "node_modules/@radix-ui/react-label/node_modules/@radix-ui/react-primitive/dist/index.d.mts"
|
|
1765
|
+
}
|
|
1766
|
+
]
|
|
1767
|
+
},
|
|
1768
|
+
"value": {
|
|
1769
|
+
"name": "value",
|
|
1770
|
+
"required": false,
|
|
1771
|
+
"type": {
|
|
1772
|
+
"name": "string | (readonly string[] & string) | undefined"
|
|
1773
|
+
},
|
|
1774
|
+
"description": "Value submitted when checked. Defaults to `'on'`.",
|
|
1775
|
+
"defaultValue": null,
|
|
1776
|
+
"parent": {
|
|
1777
|
+
"name": "ButtonHTMLAttributes",
|
|
1778
|
+
"fileName": "node_modules/@types/react/index.d.ts"
|
|
1779
|
+
},
|
|
1780
|
+
"declarations": [
|
|
1781
|
+
{
|
|
1782
|
+
"name": "ButtonHTMLAttributes",
|
|
1783
|
+
"fileName": "node_modules/@types/react/index.d.ts"
|
|
1784
|
+
},
|
|
1785
|
+
{
|
|
1786
|
+
"name": "TypeLiteral",
|
|
1787
|
+
"fileName": "src/checkbox/checkbox.tsx"
|
|
1788
|
+
}
|
|
1789
|
+
]
|
|
1790
|
+
},
|
|
1791
|
+
"disabled": {
|
|
1792
|
+
"name": "disabled",
|
|
1793
|
+
"required": false,
|
|
1794
|
+
"type": {
|
|
1795
|
+
"name": "boolean"
|
|
1796
|
+
},
|
|
1797
|
+
"description": "Blocks interaction and greys the box out; the value is not submitted.",
|
|
1798
|
+
"defaultValue": null,
|
|
1799
|
+
"parent": {
|
|
1800
|
+
"name": "ButtonHTMLAttributes",
|
|
1801
|
+
"fileName": "node_modules/@types/react/index.d.ts"
|
|
1802
|
+
},
|
|
1803
|
+
"declarations": [
|
|
1804
|
+
{
|
|
1805
|
+
"name": "ButtonHTMLAttributes",
|
|
1806
|
+
"fileName": "node_modules/@types/react/index.d.ts"
|
|
1807
|
+
},
|
|
1808
|
+
{
|
|
1809
|
+
"name": "TypeLiteral",
|
|
1810
|
+
"fileName": "src/checkbox/checkbox.tsx"
|
|
1811
|
+
}
|
|
1812
|
+
]
|
|
1813
|
+
},
|
|
1814
|
+
"name": {
|
|
1815
|
+
"name": "name",
|
|
1816
|
+
"required": false,
|
|
1817
|
+
"type": {
|
|
1818
|
+
"name": "string"
|
|
1819
|
+
},
|
|
1820
|
+
"description": "Form field name. Needed for uncontrolled form usage.",
|
|
1821
|
+
"defaultValue": null,
|
|
1822
|
+
"parent": {
|
|
1823
|
+
"name": "ButtonHTMLAttributes",
|
|
1824
|
+
"fileName": "node_modules/@types/react/index.d.ts"
|
|
1825
|
+
},
|
|
1826
|
+
"declarations": [
|
|
1827
|
+
{
|
|
1828
|
+
"name": "ButtonHTMLAttributes",
|
|
1829
|
+
"fileName": "node_modules/@types/react/index.d.ts"
|
|
1830
|
+
},
|
|
1831
|
+
{
|
|
1832
|
+
"name": "TypeLiteral",
|
|
1833
|
+
"fileName": "src/checkbox/checkbox.tsx"
|
|
1834
|
+
}
|
|
1835
|
+
]
|
|
1836
|
+
},
|
|
1837
|
+
"checked": {
|
|
1838
|
+
"name": "checked",
|
|
1839
|
+
"required": false,
|
|
1840
|
+
"type": {
|
|
1841
|
+
"name": "CheckedState | undefined"
|
|
1842
|
+
},
|
|
1843
|
+
"description": "Controlled state. `'indeterminate'` renders a dash and announces `aria-checked=\"mixed\"`.",
|
|
1844
|
+
"defaultValue": null,
|
|
1845
|
+
"parent": {
|
|
1846
|
+
"name": "CheckboxProps",
|
|
1847
|
+
"fileName": "node_modules/@radix-ui/react-checkbox/dist/index.d.mts"
|
|
1848
|
+
},
|
|
1849
|
+
"declarations": [
|
|
1850
|
+
{
|
|
1851
|
+
"name": "CheckboxProps",
|
|
1852
|
+
"fileName": "node_modules/@radix-ui/react-checkbox/dist/index.d.mts"
|
|
1853
|
+
},
|
|
1854
|
+
{
|
|
1855
|
+
"name": "TypeLiteral",
|
|
1856
|
+
"fileName": "src/checkbox/checkbox.tsx"
|
|
1857
|
+
}
|
|
1858
|
+
]
|
|
1859
|
+
},
|
|
1860
|
+
"required": {
|
|
1861
|
+
"name": "required",
|
|
1862
|
+
"required": false,
|
|
1863
|
+
"type": {
|
|
1864
|
+
"name": "boolean"
|
|
1865
|
+
},
|
|
1866
|
+
"description": "Marks the control required for the browser and assistive technology.",
|
|
1867
|
+
"defaultValue": null,
|
|
1868
|
+
"parent": {
|
|
1869
|
+
"name": "CheckboxProps",
|
|
1870
|
+
"fileName": "node_modules/@radix-ui/react-checkbox/dist/index.d.mts"
|
|
1871
|
+
},
|
|
1872
|
+
"declarations": [
|
|
1873
|
+
{
|
|
1874
|
+
"name": "CheckboxProps",
|
|
1875
|
+
"fileName": "node_modules/@radix-ui/react-checkbox/dist/index.d.mts"
|
|
1876
|
+
},
|
|
1877
|
+
{
|
|
1878
|
+
"name": "TypeLiteral",
|
|
1879
|
+
"fileName": "src/checkbox/checkbox.tsx"
|
|
1880
|
+
}
|
|
1881
|
+
]
|
|
1882
|
+
},
|
|
1883
|
+
"onCheckedChange": {
|
|
1884
|
+
"name": "onCheckedChange",
|
|
1885
|
+
"required": false,
|
|
1886
|
+
"type": {
|
|
1887
|
+
"name": "(checked: CheckedState) => void"
|
|
1888
|
+
},
|
|
1889
|
+
"description": "Fires with the next state (`true`, `false` or `'indeterminate'`) on click and on Space.",
|
|
1890
|
+
"defaultValue": null,
|
|
1891
|
+
"parent": {
|
|
1892
|
+
"name": "CheckboxProps",
|
|
1893
|
+
"fileName": "node_modules/@radix-ui/react-checkbox/dist/index.d.mts"
|
|
1894
|
+
},
|
|
1895
|
+
"declarations": [
|
|
1896
|
+
{
|
|
1897
|
+
"name": "CheckboxProps",
|
|
1898
|
+
"fileName": "node_modules/@radix-ui/react-checkbox/dist/index.d.mts"
|
|
1899
|
+
},
|
|
1900
|
+
{
|
|
1901
|
+
"name": "TypeLiteral",
|
|
1902
|
+
"fileName": "src/checkbox/checkbox.tsx"
|
|
1903
|
+
}
|
|
1904
|
+
]
|
|
1905
|
+
}
|
|
1906
|
+
}
|
|
1907
|
+
},
|
|
1908
|
+
"stories": [
|
|
1909
|
+
{
|
|
1910
|
+
"id": "components-checkbox--default",
|
|
1911
|
+
"name": "Default",
|
|
1912
|
+
"snippet": "const Default = () => <Checkbox disabled={false} aria-label=\"Select row\" />;",
|
|
1913
|
+
"description": "",
|
|
1914
|
+
"summary": "Default standalone checkbox"
|
|
1915
|
+
},
|
|
1916
|
+
{
|
|
1917
|
+
"id": "components-checkbox--checked",
|
|
1918
|
+
"name": "Checked",
|
|
1919
|
+
"snippet": "const Checked = () => <Checkbox disabled={false} aria-label=\"Select row\" defaultChecked />;",
|
|
1920
|
+
"description": "",
|
|
1921
|
+
"summary": "Checked state"
|
|
1922
|
+
},
|
|
1923
|
+
{
|
|
1924
|
+
"id": "components-checkbox--indeterminate",
|
|
1925
|
+
"name": "Indeterminate",
|
|
1926
|
+
"snippet": "const Indeterminate = () => <Checkbox disabled={false} aria-label=\"Select row\" checked=\"indeterminate\" />;",
|
|
1927
|
+
"description": "A state you set, never one the user clicks into: use it for a parent that\ngoverns a partially selected group.",
|
|
1928
|
+
"summary": "Mixed state for a partially selected group"
|
|
1929
|
+
},
|
|
1930
|
+
{
|
|
1931
|
+
"id": "components-checkbox--uncontrolled-indeterminate",
|
|
1932
|
+
"name": "Uncontrolled Indeterminate",
|
|
1933
|
+
"snippet": "const UncontrolledIndeterminate = () => <Checkbox disabled={false} aria-label=\"Select row\" defaultChecked=\"indeterminate\" />;",
|
|
1934
|
+
"description": "Starts mixed without a controlled value, then toggles through checked and unchecked.",
|
|
1935
|
+
"summary": "Uncontrolled checkbox starting in the mixed state"
|
|
1936
|
+
},
|
|
1937
|
+
{
|
|
1938
|
+
"id": "components-checkbox--disabled",
|
|
1939
|
+
"name": "Disabled",
|
|
1940
|
+
"snippet": "const Disabled = () => (\n <div className=\"flex items-center gap-6\">\n <Checkbox disabled aria-label=\"Disabled unchecked\" />\n <Checkbox disabled defaultChecked aria-label=\"Disabled checked\" />\n <Checkbox disabled checked=\"indeterminate\" aria-label=\"Disabled mixed\" />\n </div>\n);",
|
|
1941
|
+
"description": "",
|
|
1942
|
+
"summary": "Disabled in every state"
|
|
1943
|
+
},
|
|
1944
|
+
{
|
|
1945
|
+
"id": "components-checkbox--invalid",
|
|
1946
|
+
"name": "Invalid",
|
|
1947
|
+
"snippet": "const Invalid = () => (\n <div className=\"flex flex-col gap-2\">\n <div className=\"flex items-center gap-2\">\n <Checkbox id=\"terms\" aria-invalid aria-describedby=\"terms-error\" required />\n <Label htmlFor=\"terms\">I accept the terms of service</Label>\n </div>\n <p id=\"terms-error\" className=\"text-sm text-text-input-destructive\">\n You must accept the terms to continue.\n </p>\n </div>\n);",
|
|
1948
|
+
"description": "",
|
|
1949
|
+
"summary": "Failed validation, driven by aria-invalid"
|
|
1950
|
+
},
|
|
1951
|
+
{
|
|
1952
|
+
"id": "components-checkbox--with-label",
|
|
1953
|
+
"name": "With Label",
|
|
1954
|
+
"snippet": "const WithLabel = () => (\n <div className=\"flex items-center gap-2\">\n <Checkbox id=\"newsletter\" name=\"newsletter\" />\n <Label htmlFor=\"newsletter\">Email me product updates</Label>\n </div>\n);",
|
|
1955
|
+
"description": "",
|
|
1956
|
+
"summary": "Labelled checkbox with the text in the hit target"
|
|
1957
|
+
},
|
|
1958
|
+
{
|
|
1959
|
+
"id": "components-checkbox--controlled",
|
|
1960
|
+
"name": "Controlled",
|
|
1961
|
+
"snippet": "const Controlled = () => {\n const [accepted, setAccepted] = useState(false);\n\n return (\n <div className=\"flex items-center gap-2\">\n <Checkbox\n id=\"controlled\"\n checked={accepted}\n onCheckedChange={value => setAccepted(value === true)}\n />\n <Label htmlFor=\"controlled\">Auto-renew policy {accepted ? '(on)' : '(off)'}</Label>\n </div>\n );\n};",
|
|
1962
|
+
"description": "",
|
|
1963
|
+
"summary": "Controlled checkbox driven by component state"
|
|
1964
|
+
},
|
|
1965
|
+
{
|
|
1966
|
+
"id": "components-checkbox--select-all",
|
|
1967
|
+
"name": "Select All",
|
|
1968
|
+
"snippet": "const SelectAll = () => {\n const carriers = ['Openly', 'Lemonade', 'Bamboo'];\n const [selected, setSelected] = useState<string[]>(['Openly']);\n const allSelected = selected.length === carriers.length;\n\n return (\n <div className=\"flex flex-col gap-3\">\n <div className=\"flex items-center gap-2\">\n <Checkbox\n id=\"select-all\"\n checked={allSelected ? true : selected.length > 0 ? 'indeterminate' : false}\n onCheckedChange={value => setSelected(value === true ? carriers : [])}\n />\n <Label htmlFor=\"select-all\">Select all carriers</Label>\n </div>\n <div className=\"ms-6 flex flex-col gap-2\">\n {carriers.map(carrier => (\n <div key={carrier} className=\"flex items-center gap-2\">\n <Checkbox\n id={carrier}\n checked={selected.includes(carrier)}\n onCheckedChange={value =>\n setSelected(prev =>\n value === true ? [...prev, carrier] : prev.filter(name => name !== carrier)\n )\n }\n />\n <Label htmlFor={carrier}>{carrier}</Label>\n </div>\n ))}\n </div>\n </div>\n );\n};",
|
|
1969
|
+
"description": "",
|
|
1970
|
+
"summary": "Parent select-all checkbox governing a group"
|
|
1971
|
+
},
|
|
1972
|
+
{
|
|
1973
|
+
"id": "components-checkbox--inside-selected-group",
|
|
1974
|
+
"name": "Inside Selected Group",
|
|
1975
|
+
"snippet": "const InsideSelectedGroup = () => (\n <div className=\"group\" data-state=\"checked\">\n <Checkbox aria-label=\"Select carriers\" defaultChecked=\"indeterminate\" />\n </div>\n);",
|
|
1976
|
+
"description": "A surrounding selection container must not change the checkbox's own glyph.",
|
|
1977
|
+
"summary": "Mixed checkbox inside another selected group"
|
|
1978
|
+
},
|
|
1979
|
+
{
|
|
1980
|
+
"id": "components-checkbox--legacy-states",
|
|
1981
|
+
"name": "Legacy States",
|
|
1982
|
+
"snippet": "const LegacyStates = () => (\n <div className=\"flex flex-col gap-6\">\n {[false, true].map(invalid => (\n <div key={String(invalid)} className=\"flex flex-col gap-4\">\n {[false, true].map(disabled => (\n <div key={String(disabled)} className=\"flex items-center gap-6\">\n {([false, true, 'indeterminate'] as const).map(checked => (\n <Checkbox\n key={String(checked)}\n aria-label={`${invalid ? 'Invalid' : 'Valid'} ${disabled ? 'disabled' : 'enabled'} ${checked}`}\n checked={checked}\n disabled={disabled}\n aria-invalid={invalid}\n />\n ))}\n </div>\n ))}\n </div>\n ))}\n </div>\n);",
|
|
1983
|
+
"description": "Preserves the legacy palette and 16px footprint for every value and validation state.",
|
|
1984
|
+
"summary": "Legacy checkbox colours across all interaction states"
|
|
1985
|
+
}
|
|
1986
|
+
],
|
|
1987
|
+
"import": "import { Checkbox, Label } from \"@agentero/design-system\";"
|
|
1988
|
+
},
|
|
1675
1989
|
"components-command": {
|
|
1676
1990
|
"id": "components-command",
|
|
1677
1991
|
"name": "Command.Root",
|
|
@@ -4384,13 +4698,13 @@
|
|
|
4384
4698
|
}
|
|
4385
4699
|
]
|
|
4386
4700
|
},
|
|
4387
|
-
"
|
|
4388
|
-
"name": "
|
|
4701
|
+
"required": {
|
|
4702
|
+
"name": "required",
|
|
4389
4703
|
"required": false,
|
|
4390
4704
|
"type": {
|
|
4391
|
-
"name": "
|
|
4705
|
+
"name": "boolean"
|
|
4392
4706
|
},
|
|
4393
|
-
"description": "
|
|
4707
|
+
"description": "Marks the control required for both the browser and assistive technology.",
|
|
4394
4708
|
"defaultValue": null,
|
|
4395
4709
|
"parent": {
|
|
4396
4710
|
"name": "InputHTMLAttributes",
|
|
@@ -4407,13 +4721,13 @@
|
|
|
4407
4721
|
}
|
|
4408
4722
|
]
|
|
4409
4723
|
},
|
|
4410
|
-
"
|
|
4411
|
-
"name": "
|
|
4724
|
+
"placeholder": {
|
|
4725
|
+
"name": "placeholder",
|
|
4412
4726
|
"required": false,
|
|
4413
4727
|
"type": {
|
|
4414
|
-
"name": "
|
|
4728
|
+
"name": "string"
|
|
4415
4729
|
},
|
|
4416
|
-
"description": "
|
|
4730
|
+
"description": "Short hint shown while the field is empty. It disappears on the first\nkeystroke, so it is never a substitute for a label.",
|
|
4417
4731
|
"defaultValue": null,
|
|
4418
4732
|
"parent": {
|
|
4419
4733
|
"name": "InputHTMLAttributes",
|
|
@@ -4430,13 +4744,13 @@
|
|
|
4430
4744
|
}
|
|
4431
4745
|
]
|
|
4432
4746
|
},
|
|
4433
|
-
"
|
|
4434
|
-
"name": "
|
|
4747
|
+
"readOnly": {
|
|
4748
|
+
"name": "readOnly",
|
|
4435
4749
|
"required": false,
|
|
4436
4750
|
"type": {
|
|
4437
4751
|
"name": "boolean"
|
|
4438
4752
|
},
|
|
4439
|
-
"description": "
|
|
4753
|
+
"description": "Keeps the value focusable and copyable but not editable, and still\nsubmits it. Unlike `disabled`, it stays in the tab order.",
|
|
4440
4754
|
"defaultValue": null,
|
|
4441
4755
|
"parent": {
|
|
4442
4756
|
"name": "InputHTMLAttributes",
|
|
@@ -4591,12 +4905,12 @@
|
|
|
4591
4905
|
"defaultValue": null,
|
|
4592
4906
|
"parent": {
|
|
4593
4907
|
"name": "PrimitivePropsWithRef",
|
|
4594
|
-
"fileName": "node_modules/
|
|
4908
|
+
"fileName": "node_modules/@radix-ui/react-label/node_modules/@radix-ui/react-primitive/dist/index.d.mts"
|
|
4595
4909
|
},
|
|
4596
4910
|
"declarations": [
|
|
4597
4911
|
{
|
|
4598
4912
|
"name": "TypeLiteral",
|
|
4599
|
-
"fileName": "node_modules/
|
|
4913
|
+
"fileName": "node_modules/@radix-ui/react-label/node_modules/@radix-ui/react-primitive/dist/index.d.mts"
|
|
4600
4914
|
}
|
|
4601
4915
|
]
|
|
4602
4916
|
},
|
|
@@ -5296,9 +5610,16 @@
|
|
|
5296
5610
|
"snippet": "const WithAnchor = () => (\n <Popover.Root>\n <div className=\"flex flex-col items-center gap-4\">\n <Popover.Anchor className=\"rounded-md border border-border-default-base-primary px-4 py-2 text-sm text-text-default-base-secondary\">\n Anchored here\n </Popover.Anchor>\n <Popover.Trigger asChild>\n <Button variant=\"secondary\">Toggle from below</Button>\n </Popover.Trigger>\n </div>\n <Popover.Content side=\"top\">\n <p className=\"text-sm text-text-default-base-primary\">Positioned against the anchor</p>\n </Popover.Content>\n </Popover.Root>\n);",
|
|
5297
5611
|
"description": "`Anchor` positions the Content against an element other than the Trigger —\nuseful when the visual anchor differs from the toggle button.",
|
|
5298
5612
|
"summary": "Popover positioned against a separate `Anchor` element"
|
|
5613
|
+
},
|
|
5614
|
+
{
|
|
5615
|
+
"id": "components-popover--modal-from-inside-popover",
|
|
5616
|
+
"name": "Modal From Inside Popover",
|
|
5617
|
+
"snippet": "const ModalFromInsidePopover = () => (\n <Popover.Root>\n <Popover.Trigger asChild>\n <Button variant=\"secondary\">Renewal 2026</Button>\n </Popover.Trigger>\n <Popover.Content align=\"start\">\n <div className=\"flex flex-col gap-3\">\n <p className=\"text-sm text-text-default-base-primary\">\n Applied to 12 contracts across 3 carriers.\n </p>\n <Modal.Root>\n <Modal.Trigger asChild>\n <Button variant=\"secondary\" size=\"sm\">\n Delete tag\n </Button>\n </Modal.Trigger>\n <Modal.Content>\n <Modal.Title>Delete this tag?</Modal.Title>\n <Modal.Description>\n It will be removed from the 12 contracts that carry it.\n </Modal.Description>\n <Modal.Footer>\n <Modal.Close asChild>\n <Button variant=\"ghost\">Cancel</Button>\n </Modal.Close>\n <Button variant=\"primary\">Delete</Button>\n </Modal.Footer>\n </Modal.Content>\n </Modal.Root>\n </div>\n </Popover.Content>\n </Popover.Root>\n);",
|
|
5618
|
+
"description": "A Modal opened from a button inside the Popover. Both share\n`--z-index-top-layer`, so the modal opens last and paints over the popover\nwhile the overlay dims it. The popover stays mounted underneath, which keeps\nfocus returning to its trigger once the modal closes.",
|
|
5619
|
+
"summary": "Modal opened from inside a Popover paints above it"
|
|
5299
5620
|
}
|
|
5300
5621
|
],
|
|
5301
|
-
"import": "import { Button, Popover } from \"@agentero/design-system\";"
|
|
5622
|
+
"import": "import { Button, Modal, Popover } from \"@agentero/design-system\";"
|
|
5302
5623
|
},
|
|
5303
5624
|
"components-progress": {
|
|
5304
5625
|
"id": "components-progress",
|
|
@@ -7261,6 +7582,6 @@
|
|
|
7261
7582
|
},
|
|
7262
7583
|
"meta": {
|
|
7263
7584
|
"docgen": "react-component-meta",
|
|
7264
|
-
"durationMs":
|
|
7585
|
+
"durationMs": 4717
|
|
7265
7586
|
}
|
|
7266
7587
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentero/design-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.1",
|
|
4
4
|
"description": "A React component library built with Tailwind CSS v4 and Radix UI primitives",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -45,6 +45,10 @@
|
|
|
45
45
|
"types": "./src/check-list/index.d.ts",
|
|
46
46
|
"import": "./src/check-list/index.js"
|
|
47
47
|
},
|
|
48
|
+
"./checkbox": {
|
|
49
|
+
"types": "./src/checkbox/index.d.ts",
|
|
50
|
+
"import": "./src/checkbox/index.js"
|
|
51
|
+
},
|
|
48
52
|
"./command": {
|
|
49
53
|
"types": "./src/command/index.d.ts",
|
|
50
54
|
"import": "./src/command/index.js"
|
|
@@ -150,6 +154,7 @@
|
|
|
150
154
|
"dependencies": {
|
|
151
155
|
"@radix-ui/react-accordion": "^1.2.14",
|
|
152
156
|
"@radix-ui/react-avatar": "^1.1.11",
|
|
157
|
+
"@radix-ui/react-checkbox": "^1.3.11",
|
|
153
158
|
"@radix-ui/react-dialog": "^1.1.19",
|
|
154
159
|
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
155
160
|
"@radix-ui/react-hover-card": "^1.1.19",
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { ComponentPropsWithRef } from 'react';
|
|
2
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
3
|
+
/** Style recipe for Checkbox. Slots: `root` (the box), `indicator` (the glyph). */
|
|
4
|
+
export declare const checkboxRecipe: import('tailwind-variants').TVReturnType<{
|
|
5
|
+
[key: string]: {
|
|
6
|
+
[key: string]: import('tailwind-merge').ClassNameValue | {
|
|
7
|
+
root?: import('tailwind-merge').ClassNameValue;
|
|
8
|
+
indicator?: import('tailwind-merge').ClassNameValue;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
} | {
|
|
12
|
+
[x: string]: {
|
|
13
|
+
[x: string]: import('tailwind-merge').ClassNameValue | {
|
|
14
|
+
root?: import('tailwind-merge').ClassNameValue;
|
|
15
|
+
indicator?: import('tailwind-merge').ClassNameValue;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
} | {}, {
|
|
19
|
+
root: string[];
|
|
20
|
+
indicator: string;
|
|
21
|
+
}, undefined, {
|
|
22
|
+
[key: string]: {
|
|
23
|
+
[key: string]: import('tailwind-merge').ClassNameValue | {
|
|
24
|
+
root?: import('tailwind-merge').ClassNameValue;
|
|
25
|
+
indicator?: import('tailwind-merge').ClassNameValue;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
} | {}, {
|
|
29
|
+
root: string[];
|
|
30
|
+
indicator: string;
|
|
31
|
+
}, import('tailwind-variants').TVReturnType<unknown, {
|
|
32
|
+
root: string[];
|
|
33
|
+
indicator: string;
|
|
34
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
35
|
+
/** Radix Checkbox root props; the ones redeclared here are the ones docgen would otherwise omit. */
|
|
36
|
+
export type CheckboxProps = Omit<ComponentPropsWithRef<typeof CheckboxPrimitive.Root>, 'children'> & {
|
|
37
|
+
/** Controlled state. `'indeterminate'` renders a dash and announces `aria-checked="mixed"`. */
|
|
38
|
+
checked?: CheckboxPrimitive.CheckboxProps['checked'];
|
|
39
|
+
/** Initial state for an uncontrolled checkbox. */
|
|
40
|
+
defaultChecked?: CheckboxPrimitive.CheckboxProps['defaultChecked'];
|
|
41
|
+
/** Fires with the next state (`true`, `false` or `'indeterminate'`) on click and on Space. */
|
|
42
|
+
onCheckedChange?: CheckboxPrimitive.CheckboxProps['onCheckedChange'];
|
|
43
|
+
/** Blocks interaction and greys the box out; the value is not submitted. */
|
|
44
|
+
disabled?: boolean;
|
|
45
|
+
/** Marks the control required for the browser and assistive technology. */
|
|
46
|
+
required?: boolean;
|
|
47
|
+
/** Form field name. Needed for uncontrolled form usage. */
|
|
48
|
+
name?: string;
|
|
49
|
+
/** Value submitted when checked. Defaults to `'on'`. */
|
|
50
|
+
value?: string;
|
|
51
|
+
/** Drives the destructive border and fill. Point `aria-describedby` at the error message. */
|
|
52
|
+
'aria-invalid'?: ComponentPropsWithRef<'button'>['aria-invalid'];
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Base control for a boolean the user confirms later: one item of a
|
|
56
|
+
* multi-select, a terms tick, a row picked for a bulk action. Supports the
|
|
57
|
+
* mixed state for a parent that summarises a partially selected group.
|
|
58
|
+
* Keeps the legacy 16px surface, glyphs and state colours during adoption.
|
|
59
|
+
*
|
|
60
|
+
* Headless like [Input](?path=/docs/components-input--docs): pair it with
|
|
61
|
+
* [Label](?path=/docs/components-label--docs) and `htmlFor`, or give it an
|
|
62
|
+
* `aria-label`. There is no `status` prop — set `aria-invalid`.
|
|
63
|
+
*
|
|
64
|
+
* Use [Switch](?path=/docs/components-switch--docs) when the change applies
|
|
65
|
+
* immediately, and [CheckList](?path=/docs/components-check-list--docs) for a
|
|
66
|
+
* read-only list of ticked items.
|
|
67
|
+
*
|
|
68
|
+
* @summary Base checkbox control, with mixed state, unaware of form libraries
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* <Label htmlFor="terms">I accept the terms</Label>
|
|
72
|
+
* <Checkbox id="terms" name="terms" required />
|
|
73
|
+
*/
|
|
74
|
+
export declare const Checkbox: ({ className, ref, ...props }: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import { IconCheck as t, IconMinus as n } from "./icons.js";
|
|
3
|
+
import { tv as r } from "tailwind-variants";
|
|
4
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
import * as o from "@radix-ui/react-checkbox";
|
|
6
|
+
//#region src/checkbox/checkbox.tsx
|
|
7
|
+
var s = r({ slots: {
|
|
8
|
+
root: [
|
|
9
|
+
"group/checkbox box-border inline-flex size-4 shrink-0 appearance-none items-center justify-center rounded-sm",
|
|
10
|
+
"border border-solid border-border-input-default bg-bg-input-normal",
|
|
11
|
+
"cursor-pointer transition-colors duration-200 ease-in-out",
|
|
12
|
+
"data-[state=checked]:border-bg-checkbox-selected data-[state=checked]:bg-bg-checkbox-selected",
|
|
13
|
+
"data-[state=indeterminate]:border-bg-checkbox-selected data-[state=indeterminate]:bg-bg-checkbox-selected",
|
|
14
|
+
"outline-solid outline-2 outline-offset-2 outline-transparent",
|
|
15
|
+
"focus-visible:outline-focus-ring-button-primary",
|
|
16
|
+
"aria-invalid:border-border-input-destructive",
|
|
17
|
+
"aria-invalid:focus-visible:outline-focus-ring-button-destructive",
|
|
18
|
+
"aria-invalid:data-[state=checked]:border-bg-default-danger-primary aria-invalid:data-[state=checked]:bg-bg-default-danger-primary",
|
|
19
|
+
"aria-invalid:data-[state=indeterminate]:border-bg-default-danger-primary aria-invalid:data-[state=indeterminate]:bg-bg-default-danger-primary",
|
|
20
|
+
"disabled:cursor-not-allowed disabled:border-border-checkbox-disabled",
|
|
21
|
+
"disabled:data-[state=checked]:border-bg-checkbox-disabled disabled:data-[state=checked]:bg-bg-checkbox-disabled",
|
|
22
|
+
"disabled:data-[state=indeterminate]:border-bg-checkbox-disabled disabled:data-[state=indeterminate]:bg-bg-checkbox-disabled",
|
|
23
|
+
"aria-invalid:disabled:border-bg-checkbox-invalid-disabled",
|
|
24
|
+
"aria-invalid:disabled:data-[state=checked]:border-bg-checkbox-invalid-disabled aria-invalid:disabled:data-[state=checked]:bg-bg-checkbox-invalid-disabled",
|
|
25
|
+
"aria-invalid:disabled:data-[state=indeterminate]:border-bg-checkbox-invalid-disabled aria-invalid:disabled:data-[state=indeterminate]:bg-bg-checkbox-invalid-disabled"
|
|
26
|
+
],
|
|
27
|
+
indicator: "flex items-center justify-center text-text-default-base-inverse-primary"
|
|
28
|
+
} }), c = ({ className: r, ref: c, ...l }) => {
|
|
29
|
+
let u = s();
|
|
30
|
+
return /* @__PURE__ */ i(o.Root, {
|
|
31
|
+
ref: c,
|
|
32
|
+
"data-slot": "checkbox",
|
|
33
|
+
className: e(u.root(), r),
|
|
34
|
+
...l,
|
|
35
|
+
children: /* @__PURE__ */ a(o.Indicator, {
|
|
36
|
+
"data-slot": "checkbox-indicator",
|
|
37
|
+
className: u.indicator(),
|
|
38
|
+
children: [/* @__PURE__ */ i(t, { className: "hidden size-3.5 group-data-[state=checked]/checkbox:block" }), /* @__PURE__ */ i(n, { className: "hidden size-3.5 group-data-[state=indeterminate]/checkbox:block" })]
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
//#endregion
|
|
43
|
+
export { c as Checkbox, s as checkboxRecipe };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SVGProps } from 'react';
|
|
2
|
+
/** @summary Material Sharp check used by the legacy checkbox */
|
|
3
|
+
export declare const IconCheck: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
/** @summary Rounded minus used by the legacy checkbox's mixed state */
|
|
5
|
+
export declare const IconMinus: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
//#region src/checkbox/icons.tsx
|
|
3
|
+
var t = (t) => /* @__PURE__ */ e("svg", {
|
|
4
|
+
width: "24",
|
|
5
|
+
height: "24",
|
|
6
|
+
viewBox: "0 0 24 24",
|
|
7
|
+
fill: "currentColor",
|
|
8
|
+
stroke: "currentColor",
|
|
9
|
+
"aria-hidden": "true",
|
|
10
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
11
|
+
...t,
|
|
12
|
+
children: /* @__PURE__ */ e("path", { d: "M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z" })
|
|
13
|
+
}), n = (t) => /* @__PURE__ */ e("svg", {
|
|
14
|
+
width: "24",
|
|
15
|
+
height: "24",
|
|
16
|
+
viewBox: "0 0 24 24",
|
|
17
|
+
fill: "none",
|
|
18
|
+
stroke: "currentColor",
|
|
19
|
+
strokeWidth: "2",
|
|
20
|
+
strokeLinecap: "round",
|
|
21
|
+
strokeLinejoin: "round",
|
|
22
|
+
"aria-hidden": "true",
|
|
23
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
24
|
+
...t,
|
|
25
|
+
children: /* @__PURE__ */ e("path", { d: "M5 12h14" })
|
|
26
|
+
});
|
|
27
|
+
//#endregion
|
|
28
|
+
export { t as IconCheck, n as IconMinus };
|
|
@@ -17,7 +17,7 @@ var s = ({ className: t, ...n }) => /* @__PURE__ */ r(a.Trigger, {
|
|
|
17
17
|
s.displayName = "DropdownMenu.Trigger";
|
|
18
18
|
var c = a.Portal, l = n({
|
|
19
19
|
base: [
|
|
20
|
-
"z-
|
|
20
|
+
"z-(--z-index-top-layer) flex flex-col rounded-lg bg-bg-default-base-primary p-1 shadow-xl",
|
|
21
21
|
"border border-border-default-base-primary",
|
|
22
22
|
"will-change-[transform,opacity]",
|
|
23
23
|
"data-[state=open]:animate-[dropdownSlideIn_200ms_ease-out]",
|
|
@@ -73,7 +73,7 @@ var h = ({ className: n, children: o, ...s }) => /* @__PURE__ */ i(a.SubTrigger,
|
|
|
73
73
|
});
|
|
74
74
|
h.displayName = "DropdownMenu.SubTrigger";
|
|
75
75
|
var g = n({ base: [
|
|
76
|
-
"z-
|
|
76
|
+
"z-(--z-index-top-layer) flex flex-col rounded-lg bg-bg-default-base-primary p-1 shadow-xl",
|
|
77
77
|
"border border-border-default-base-primary",
|
|
78
78
|
"will-change-[transform,opacity]",
|
|
79
79
|
"data-[state=open]:animate-[dropdownSlideIn_200ms_ease-out]",
|
|
@@ -14,7 +14,7 @@ var o = (e) => /* @__PURE__ */ n(i.Trigger, {
|
|
|
14
14
|
});
|
|
15
15
|
o.displayName = "HoverCard.Trigger";
|
|
16
16
|
var s = i.Portal, c = t({ base: [
|
|
17
|
-
"z-(--z-index-
|
|
17
|
+
"z-(--z-index-top-layer) max-w-80 rounded-lg bg-bg-default-base-primary p-4 shadow-xl",
|
|
18
18
|
"border border-border-default-base-primary",
|
|
19
19
|
"text-sm text-text-default-base-primary",
|
|
20
20
|
"will-change-[transform,opacity]",
|