@agentero/design-system 0.26.2 → 0.27.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.
- package/mcp/manifests/components.html +381 -134
- package/mcp/manifests/components.json +330 -42
- package/package.json +6 -1
- package/src/button/button.d.ts +3 -24
- package/src/button/button.js +17 -21
- 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/table/index.d.ts +0 -1
- package/theme/base.css +5 -0
|
@@ -1248,7 +1248,7 @@
|
|
|
1248
1248
|
"displayName": "Button",
|
|
1249
1249
|
"exportName": "Button",
|
|
1250
1250
|
"filePath": "/home/runner/work/design-system/design-system/src/button/button.tsx",
|
|
1251
|
-
"description": "Button is the design system's primary actionable control. Use it for any\ninteraction that triggers behavior, submits a form, or navigates the user.\nBy default Button renders a `<button>`; pass `asChild` to render its single\nchild element as the underlying tag instead — Button merges its styles,\n`className`, `ref`, and props onto whatever the consumer nests. This keeps\nthe design system framework-agnostic: route a plain `<a>`, a Next.js\n`<Link>`, a React Router `<Link>`, or any custom element through the same\nvisual treatment.\n\nPick `variant` to express hierarchy (`primary` for the main CTA,\n`secondary` / `tertiary` for supporting actions, `ghost` for low-emphasis\ninline actions, `link` for text-only actions). Use `status=\"danger\"` for\ndestructive actions and `loading` to block interaction while async work\nresolves
|
|
1251
|
+
"description": "Button is the design system's primary actionable control. Use it for any\ninteraction that triggers behavior, submits a form, or navigates the user.\nBy default Button renders a `<button>`; pass `asChild` to render its single\nchild element as the underlying tag instead — Button merges its styles,\n`className`, `ref`, and props onto whatever the consumer nests. This keeps\nthe design system framework-agnostic: route a plain `<a>`, a Next.js\n`<Link>`, a React Router `<Link>`, or any custom element through the same\nvisual treatment.\n\nPick `variant` to express hierarchy (`primary` for the main CTA,\n`secondary` / `tertiary` for supporting actions, `ghost` for low-emphasis\ninline actions, `link` for text-only actions). Use `status=\"danger\"` for\ndestructive actions and `loading` to block interaction while async work\nresolves.\n\nDo **not** use Button for toggle states (prefer a Switch or ToggleButton),\nfor passive decorative anchors without action intent (use a plain `<a>`),\nor with `variant=\"link\"` when loading or when the button has no text\nchildren — both combinations log a dev-only warning (silent in production).",
|
|
1252
1252
|
"jsDocTags": {
|
|
1253
1253
|
"summary": [
|
|
1254
1254
|
"Primary actionable control; renders a `<button>` or, with `asChild`, any nested element"
|
|
@@ -1513,25 +1513,6 @@
|
|
|
1513
1513
|
}
|
|
1514
1514
|
]
|
|
1515
1515
|
},
|
|
1516
|
-
"scaleOnPress": {
|
|
1517
|
-
"name": "scaleOnPress",
|
|
1518
|
-
"required": false,
|
|
1519
|
-
"type": {
|
|
1520
|
-
"name": "boolean"
|
|
1521
|
-
},
|
|
1522
|
-
"description": "When `true`, the button dips to 97% while held so the control answers the\npointer instead of only changing color. Defaults to `false`.\n\nHas no effect with `variant=\"link\"` (scaling bare text with no padding or\nbackground reads as a wobble) or while the button is disabled or loading,\nincluding the `asChild` anchor form, which stays keyboard-focusable and\nwould otherwise dip on Enter. The dip is gated behind `motion-safe`, so it\ndisappears under `prefers-reduced-motion`.",
|
|
1523
|
-
"defaultValue": null,
|
|
1524
|
-
"parent": {
|
|
1525
|
-
"name": "ButtonBaseProps",
|
|
1526
|
-
"fileName": "src/button/button.tsx"
|
|
1527
|
-
},
|
|
1528
|
-
"declarations": [
|
|
1529
|
-
{
|
|
1530
|
-
"name": "TypeLiteral",
|
|
1531
|
-
"fileName": "src/button/button.tsx"
|
|
1532
|
-
}
|
|
1533
|
-
]
|
|
1534
|
-
},
|
|
1535
1516
|
"ref": {
|
|
1536
1517
|
"name": "ref",
|
|
1537
1518
|
"required": false,
|
|
@@ -1577,7 +1558,7 @@
|
|
|
1577
1558
|
"id": "components-button--default",
|
|
1578
1559
|
"name": "Default",
|
|
1579
1560
|
"snippet": "const Default = () => <Button variant=\"primary\" size=\"sm\">{TEXT}</Button>;",
|
|
1580
|
-
"description": "Args-controlled playground. Toggle `variant`, `size`, `status`, `loading`,\n`disabled`,
|
|
1561
|
+
"description": "Args-controlled playground. Toggle `variant`, `size`, `status`, `loading`,\n`disabled`, and `rounded` from the Controls panel to explore every visual\ncombination of the Button.",
|
|
1581
1562
|
"summary": "Default args playground for Button"
|
|
1582
1563
|
},
|
|
1583
1564
|
{
|
|
@@ -1642,13 +1623,6 @@
|
|
|
1642
1623
|
"snippet": "const AsChild = () => (\n <Row>\n <Button asChild variant=\"primary\">\n <a href=\"/dashboard\">Go to dashboard</a>\n </Button>\n <Button asChild variant=\"secondary\">\n <a href=\"https://agentero.com\" target=\"_blank\" rel=\"noreferrer\">\n Visit Agentero\n </a>\n </Button>\n </Row>\n);",
|
|
1643
1624
|
"description": "`asChild` renders Button's styles on the nested child element rather than\non a `<button>` — the child receives Button's `className`, `ref`, and\nmerged props via Radix's `Slot` primitive. Use it to turn any anchor or\nframework `Link` into a Button without coupling the design system to a\nrouter. In app code, swap the plain `<a>` below for your framework's Link\n(`next/link`, `react-router`, `@tanstack/react-router`, etc.).",
|
|
1644
1625
|
"summary": "`asChild` composes Button's styles onto any element"
|
|
1645
|
-
},
|
|
1646
|
-
{
|
|
1647
|
-
"id": "components-button--pressed",
|
|
1648
|
-
"name": "Pressed",
|
|
1649
|
-
"snippet": "const Pressed = () => (\n <Stack>\n <Row>\n {NON_LINK_VARIANTS.map(variant => (\n <Button key={variant} variant={variant} scaleOnPress>\n Press {variant}\n </Button>\n ))}\n </Row>\n <Row>\n <Button variant=\"primary\">Opted out stays still</Button>\n <Button variant=\"link\" scaleOnPress>\n Link stays still\n </Button>\n <Button variant=\"primary\" scaleOnPress disabled>\n Disabled stays still\n </Button>\n <Button asChild variant=\"secondary\" scaleOnPress disabled>\n <a href=\"/dashboard\">Disabled anchor stays still</a>\n </Button>\n </Row>\n </Stack>\n);",
|
|
1650
|
-
"description": "With `scaleOnPress`, a button dips to 97% while held so the control answers\nthe pointer rather than only changing color. Press and hold one below to\nfeel it — the effect is deliberately small, and if a quick click draws the\neye it is too strong. It is off by default: pass the prop where the extra\nfeedback is wanted.\n\n`variant=\"link\"` is excluded even with the prop set: it has no padding or\nbackground, so scaling bare text reads as a wobble rather than a button\nbeing pushed. Disabled buttons are excluded too, including the `asChild`\nanchor form, which stays keyboard-focusable and would otherwise dip on\nEnter. The whole effect is gated behind `motion-safe`, so it disappears\nunder `prefers-reduced-motion`.",
|
|
1651
|
-
"summary": "Opt-in press feedback via `scaleOnPress`, excluding `link` and disabled"
|
|
1652
1626
|
}
|
|
1653
1627
|
],
|
|
1654
1628
|
"import": "import { Button } from \"@agentero/design-system\";"
|
|
@@ -1698,6 +1672,320 @@
|
|
|
1698
1672
|
],
|
|
1699
1673
|
"import": "import { CheckList } from \"@agentero/design-system\";"
|
|
1700
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
|
+
},
|
|
1701
1989
|
"components-command": {
|
|
1702
1990
|
"id": "components-command",
|
|
1703
1991
|
"name": "Command.Root",
|
|
@@ -4410,13 +4698,13 @@
|
|
|
4410
4698
|
}
|
|
4411
4699
|
]
|
|
4412
4700
|
},
|
|
4413
|
-
"
|
|
4414
|
-
"name": "
|
|
4701
|
+
"required": {
|
|
4702
|
+
"name": "required",
|
|
4415
4703
|
"required": false,
|
|
4416
4704
|
"type": {
|
|
4417
|
-
"name": "
|
|
4705
|
+
"name": "boolean"
|
|
4418
4706
|
},
|
|
4419
|
-
"description": "
|
|
4707
|
+
"description": "Marks the control required for both the browser and assistive technology.",
|
|
4420
4708
|
"defaultValue": null,
|
|
4421
4709
|
"parent": {
|
|
4422
4710
|
"name": "InputHTMLAttributes",
|
|
@@ -4433,13 +4721,13 @@
|
|
|
4433
4721
|
}
|
|
4434
4722
|
]
|
|
4435
4723
|
},
|
|
4436
|
-
"
|
|
4437
|
-
"name": "
|
|
4724
|
+
"placeholder": {
|
|
4725
|
+
"name": "placeholder",
|
|
4438
4726
|
"required": false,
|
|
4439
4727
|
"type": {
|
|
4440
|
-
"name": "
|
|
4728
|
+
"name": "string"
|
|
4441
4729
|
},
|
|
4442
|
-
"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.",
|
|
4443
4731
|
"defaultValue": null,
|
|
4444
4732
|
"parent": {
|
|
4445
4733
|
"name": "InputHTMLAttributes",
|
|
@@ -4456,13 +4744,13 @@
|
|
|
4456
4744
|
}
|
|
4457
4745
|
]
|
|
4458
4746
|
},
|
|
4459
|
-
"
|
|
4460
|
-
"name": "
|
|
4747
|
+
"readOnly": {
|
|
4748
|
+
"name": "readOnly",
|
|
4461
4749
|
"required": false,
|
|
4462
4750
|
"type": {
|
|
4463
4751
|
"name": "boolean"
|
|
4464
4752
|
},
|
|
4465
|
-
"description": "
|
|
4753
|
+
"description": "Keeps the value focusable and copyable but not editable, and still\nsubmits it. Unlike `disabled`, it stays in the tab order.",
|
|
4466
4754
|
"defaultValue": null,
|
|
4467
4755
|
"parent": {
|
|
4468
4756
|
"name": "InputHTMLAttributes",
|
|
@@ -4617,12 +4905,12 @@
|
|
|
4617
4905
|
"defaultValue": null,
|
|
4618
4906
|
"parent": {
|
|
4619
4907
|
"name": "PrimitivePropsWithRef",
|
|
4620
|
-
"fileName": "node_modules/
|
|
4908
|
+
"fileName": "node_modules/@radix-ui/react-label/node_modules/@radix-ui/react-primitive/dist/index.d.mts"
|
|
4621
4909
|
},
|
|
4622
4910
|
"declarations": [
|
|
4623
4911
|
{
|
|
4624
4912
|
"name": "TypeLiteral",
|
|
4625
|
-
"fileName": "node_modules/
|
|
4913
|
+
"fileName": "node_modules/@radix-ui/react-label/node_modules/@radix-ui/react-primitive/dist/index.d.mts"
|
|
4626
4914
|
}
|
|
4627
4915
|
]
|
|
4628
4916
|
},
|
|
@@ -7287,6 +7575,6 @@
|
|
|
7287
7575
|
},
|
|
7288
7576
|
"meta": {
|
|
7289
7577
|
"docgen": "react-component-meta",
|
|
7290
|
-
"durationMs":
|
|
7578
|
+
"durationMs": 2995
|
|
7291
7579
|
}
|
|
7292
7580
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentero/design-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
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",
|
package/src/button/button.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ButtonHTMLAttributes, ReactNode, Ref } from 'react';
|
|
|
2
2
|
/**
|
|
3
3
|
* Style recipe for Button using tailwind-variants. Single-slot recipe whose
|
|
4
4
|
* variants (`variant`, `size`, `status`, `hasOnlyIcon`, `disabled`, `rounded`,
|
|
5
|
-
* `align`, `fitContent
|
|
5
|
+
* `align`, `fitContent`) plus compound variants drive
|
|
6
6
|
* destructive and disabled treatments. All colors route through design-system tokens defined in
|
|
7
7
|
* `themes/base.css`.
|
|
8
8
|
*
|
|
@@ -12,9 +12,6 @@ import { ButtonHTMLAttributes, ReactNode, Ref } from 'react';
|
|
|
12
12
|
* @summary tailwind-variants recipe backing the Button component styles
|
|
13
13
|
*/
|
|
14
14
|
export declare const buttonRecipe: import('tailwind-variants').TVReturnType<{
|
|
15
|
-
scaleOnPress: {
|
|
16
|
-
true: string[];
|
|
17
|
-
};
|
|
18
15
|
variant: {
|
|
19
16
|
primary: string[];
|
|
20
17
|
secondary: string[];
|
|
@@ -50,9 +47,6 @@ export declare const buttonRecipe: import('tailwind-variants').TVReturnType<{
|
|
|
50
47
|
true: string;
|
|
51
48
|
};
|
|
52
49
|
}, undefined, string[], {
|
|
53
|
-
scaleOnPress: {
|
|
54
|
-
true: string[];
|
|
55
|
-
};
|
|
56
50
|
variant: {
|
|
57
51
|
primary: string[];
|
|
58
52
|
secondary: string[];
|
|
@@ -88,9 +82,6 @@ export declare const buttonRecipe: import('tailwind-variants').TVReturnType<{
|
|
|
88
82
|
true: string;
|
|
89
83
|
};
|
|
90
84
|
}, undefined, import('tailwind-variants').TVReturnType<{
|
|
91
|
-
scaleOnPress: {
|
|
92
|
-
true: string[];
|
|
93
|
-
};
|
|
94
85
|
variant: {
|
|
95
86
|
primary: string[];
|
|
96
87
|
secondary: string[];
|
|
@@ -210,17 +201,6 @@ type ButtonBaseProps = {
|
|
|
210
201
|
* its content. Useful for inline actions inside tight containers.
|
|
211
202
|
*/
|
|
212
203
|
fitContent?: boolean;
|
|
213
|
-
/**
|
|
214
|
-
* When `true`, the button dips to 97% while held so the control answers the
|
|
215
|
-
* pointer instead of only changing color. Defaults to `false`.
|
|
216
|
-
*
|
|
217
|
-
* Has no effect with `variant="link"` (scaling bare text with no padding or
|
|
218
|
-
* background reads as a wobble) or while the button is disabled or loading,
|
|
219
|
-
* including the `asChild` anchor form, which stays keyboard-focusable and
|
|
220
|
-
* would otherwise dip on Enter. The dip is gated behind `motion-safe`, so it
|
|
221
|
-
* disappears under `prefers-reduced-motion`.
|
|
222
|
-
*/
|
|
223
|
-
scaleOnPress?: boolean;
|
|
224
204
|
/**
|
|
225
205
|
* Ref forwarded to the underlying element. Typed as a union covering both
|
|
226
206
|
* `<button>` and `<a>` because `asChild` lets consumers render either tag
|
|
@@ -265,8 +245,7 @@ export type ButtonProps = ButtonBaseProps & ButtonHTMLAttributes<HTMLButtonEleme
|
|
|
265
245
|
* `secondary` / `tertiary` for supporting actions, `ghost` for low-emphasis
|
|
266
246
|
* inline actions, `link` for text-only actions). Use `status="danger"` for
|
|
267
247
|
* destructive actions and `loading` to block interaction while async work
|
|
268
|
-
* resolves.
|
|
269
|
-
* dip while held.
|
|
248
|
+
* resolves.
|
|
270
249
|
*
|
|
271
250
|
* Do **not** use Button for toggle states (prefer a Switch or ToggleButton),
|
|
272
251
|
* for passive decorative anchors without action intent (use a plain `<a>`),
|
|
@@ -296,5 +275,5 @@ export type ButtonProps = ButtonBaseProps & ButtonHTMLAttributes<HTMLButtonEleme
|
|
|
296
275
|
* Delete account
|
|
297
276
|
* </Button>
|
|
298
277
|
*/
|
|
299
|
-
export declare const Button: ({ children, asChild, variant, size, status, loading, rounded, align, fitContent,
|
|
278
|
+
export declare const Button: ({ children, asChild, variant, size, status, loading, rounded, align, fitContent, disabled, iconOnly, ref, className, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
300
279
|
export {};
|
package/src/button/button.js
CHANGED
|
@@ -10,7 +10,7 @@ var c = t({
|
|
|
10
10
|
"font-semibold rounded-md cursor-pointer",
|
|
11
11
|
"bg-transparent no-underline",
|
|
12
12
|
"border border-solid border-transparent",
|
|
13
|
-
"transition-[background-color,border-color,color
|
|
13
|
+
"transition-[background-color,border-color,color] duration-150",
|
|
14
14
|
"[-webkit-tap-highlight-color:transparent]",
|
|
15
15
|
"[&_svg]:[flex:0_0_fit-content]",
|
|
16
16
|
"[&_svg_path[fill]]:fill-current",
|
|
@@ -20,7 +20,6 @@ var c = t({
|
|
|
20
20
|
"focus-visible:outline-focus-ring-button-primary"
|
|
21
21
|
],
|
|
22
22
|
variants: {
|
|
23
|
-
scaleOnPress: { true: ["motion-safe:active:[transform:scale(0.97)]", "motion-safe:active:ease-out-expo"] },
|
|
24
23
|
variant: {
|
|
25
24
|
primary: [
|
|
26
25
|
"bg-bg-button-primary-enable border-bg-button-primary-enable",
|
|
@@ -52,8 +51,7 @@ var c = t({
|
|
|
52
51
|
"px-0 underline",
|
|
53
52
|
"[text-underline-offset:var(--text-underline-offset)]",
|
|
54
53
|
"text-text-button-link-enable",
|
|
55
|
-
"[&_svg]:fill-icon-button-link-enable"
|
|
56
|
-
"motion-safe:active:[transform:none]"
|
|
54
|
+
"[&_svg]:fill-icon-button-link-enable"
|
|
57
55
|
]
|
|
58
56
|
},
|
|
59
57
|
size: {
|
|
@@ -64,7 +62,7 @@ var c = t({
|
|
|
64
62
|
},
|
|
65
63
|
status: { danger: "focus-visible:outline-focus-ring-button-destructive" },
|
|
66
64
|
hasOnlyIcon: { true: "aspect-square px-0 min-w-[unset]" },
|
|
67
|
-
disabled: { true: "cursor-not-allowed pointer-events-none
|
|
65
|
+
disabled: { true: "cursor-not-allowed pointer-events-none" },
|
|
68
66
|
rounded: { true: "rounded-full" },
|
|
69
67
|
align: {
|
|
70
68
|
center: "justify-center",
|
|
@@ -240,7 +238,6 @@ var c = t({
|
|
|
240
238
|
}
|
|
241
239
|
],
|
|
242
240
|
defaultVariants: {
|
|
243
|
-
scaleOnPress: !1,
|
|
244
241
|
variant: "primary",
|
|
245
242
|
size: "sm",
|
|
246
243
|
align: "center"
|
|
@@ -249,29 +246,28 @@ var c = t({
|
|
|
249
246
|
"aria-label": "loading",
|
|
250
247
|
role: "status",
|
|
251
248
|
className: e("absolute inset-0 grid place-items-center", "rounded-[inherit] bg-inherit", "before:content-[\"\"] before:block before:size-[1em]", "before:border-2 before:border-solid before:rounded-full", "before:border-current before:border-t-transparent", "before:animate-spin before:[animation-duration:0.5s]")
|
|
252
|
-
}), u = ({ children: t, asChild: u, variant: d, size: f, status: p, loading: m, rounded: h, align: g, fitContent: _,
|
|
253
|
-
let
|
|
254
|
-
process.env.NODE_ENV !== "production" && (m && d === "link" && console.warn("Button with variant link and loading is not supported"),
|
|
255
|
-
let
|
|
249
|
+
}), u = ({ children: t, asChild: u, variant: d, size: f, status: p, loading: m, rounded: h, align: g, fitContent: _, disabled: v, iconOnly: y, ref: b, className: x, ...S }) => {
|
|
250
|
+
let C = u ? !!y : i.toArray(t).every((e) => a(e)), w = v || m;
|
|
251
|
+
process.env.NODE_ENV !== "production" && (m && d === "link" && console.warn("Button with variant link and loading is not supported"), C && d === "link" && console.warn("Button with no text and variant link is not supported. Use it with variant tertiary instead"), u && y && a(t) && i.toArray(t.props.children).some((e) => !a(e)) && console.warn("Button with asChild and iconOnly should only contain icon children; text found inside the wrapper element"));
|
|
252
|
+
let T = e(c({
|
|
256
253
|
variant: d,
|
|
257
254
|
size: f,
|
|
258
|
-
hasOnlyIcon:
|
|
259
|
-
disabled:
|
|
255
|
+
hasOnlyIcon: C,
|
|
256
|
+
disabled: w,
|
|
260
257
|
status: p,
|
|
261
258
|
rounded: h,
|
|
262
259
|
align: g,
|
|
263
|
-
fitContent: _
|
|
264
|
-
|
|
265
|
-
}), S);
|
|
260
|
+
fitContent: _
|
|
261
|
+
}), x);
|
|
266
262
|
return /* @__PURE__ */ r(u ? o : "button", {
|
|
267
263
|
"data-slot": "button",
|
|
268
264
|
...u ? {
|
|
269
|
-
"aria-disabled":
|
|
270
|
-
"data-disabled":
|
|
271
|
-
} : { disabled:
|
|
272
|
-
...
|
|
273
|
-
className:
|
|
274
|
-
ref:
|
|
265
|
+
"aria-disabled": w || void 0,
|
|
266
|
+
"data-disabled": w || void 0
|
|
267
|
+
} : { disabled: w },
|
|
268
|
+
...S,
|
|
269
|
+
className: T,
|
|
270
|
+
ref: b,
|
|
275
271
|
children: [m && /* @__PURE__ */ n(l, {}), u ? /* @__PURE__ */ n(s, { children: t }) : t]
|
|
276
272
|
});
|
|
277
273
|
};
|