division-ds 0.5.0 → 0.6.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/AGENTS.md
CHANGED
|
@@ -51,7 +51,7 @@ installs these rules into that project's `AGENTS.md`, `GEMINI.md` and Cursor rul
|
|
|
51
51
|
`.claude/skills/` (Claude Code).
|
|
52
52
|
|
|
53
53
|
An agent that supports MCP can have the docs and the same checks as tools instead:
|
|
54
|
-
`claude mcp add division-ds -- npx -y division-ds@0.
|
|
54
|
+
`claude mcp add division-ds -- npx -y division-ds@0.5.0 mcp` (`list_components`, `get_component`,
|
|
55
55
|
`search`, `get_tokens`, `validate_code`, `check_contrast`, `get_add_command`,
|
|
56
56
|
`get_review_checklist`).
|
|
57
57
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "division-ds",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Checks a project that uses Division DS components (raw colours, invented tokens, touching buttons, unknown props), and serves the docs and the same checks to agents over MCP.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Victor Ilioiu",
|
|
@@ -20,7 +20,7 @@ Paths are from the Division DS repository root. Installed with shadcn they start
|
|
|
20
20
|
| Prop | Type | Default | Description |
|
|
21
21
|
|---|---|---|---|
|
|
22
22
|
| `label` | `string` | | Required. The name screen readers give the navigation region. |
|
|
23
|
-
| `groups` | `SidebarGroup[]` | | Required. Each group has title, icon, items, collapsible and defaultOpen. |
|
|
23
|
+
| `groups` | `SidebarGroup[]` | | Required. Each group has title, icon, items, collapsible and defaultOpen, and optionally action (a small icon button at the right end of the title row, beside the fold toggle, never inside it) and footer (under the items, lined up with them, hidden while the group is folded). |
|
|
24
24
|
| `header` | `ReactNode` | | Sits above the groups: a product name, a workspace switcher. |
|
|
25
25
|
| `footer` | `ReactNode` | | Pinned below the groups when the Sidebar has a height (h-full in a column layout): the signed-in account, a help link. |
|
|
26
26
|
| `renderLink` | `(props: LinkRenderProps) => ReactNode` | `a plain anchor` | Pass your router's link component here. Map href to its own prop, and pass className, aria-current and onClick through. |
|
|
@@ -54,6 +54,13 @@ export type SidebarGroup = {
|
|
|
54
54
|
collapsible?: boolean
|
|
55
55
|
/** Ignored when the group holds the current item, which always starts open. @default true */
|
|
56
56
|
defaultOpen?: boolean
|
|
57
|
+
/** Drawn at the far right of the title row: a small icon button, e.g. a ghost size="sm" Button
|
|
58
|
+
* with a Plus icon and aria-label="New project". It sits beside the fold toggle, never inside it,
|
|
59
|
+
* so pressing it does not open or close the group. The title truncates before it is pushed out. */
|
|
60
|
+
action?: ReactNode
|
|
61
|
+
/** Drawn under the items, inside the group, lined up with the items' left edge and padding: an
|
|
62
|
+
* "Add project" button. Hidden (and unreachable by Tab) while the group is folded. */
|
|
63
|
+
footer?: ReactNode
|
|
57
64
|
}
|
|
58
65
|
```
|
|
59
66
|
|
|
@@ -104,6 +111,36 @@ const FOOTER = <p className="text-xs text-[var(--color-text-secondary)]">Signed
|
|
|
104
111
|
</div>
|
|
105
112
|
```
|
|
106
113
|
|
|
114
|
+
### A Projects group with an action in its title row and a footer under its items
|
|
115
|
+
|
|
116
|
+
```tsx
|
|
117
|
+
const PROJECT_GROUPS: SidebarGroup[] = [
|
|
118
|
+
{
|
|
119
|
+
title: 'Projects',
|
|
120
|
+
icon: <FolderKanban />,
|
|
121
|
+
action: (
|
|
122
|
+
<IconButton label="New project" variant="ghost" size="sm">
|
|
123
|
+
<Plus aria-hidden="true" />
|
|
124
|
+
</IconButton>
|
|
125
|
+
),
|
|
126
|
+
items: [
|
|
127
|
+
{ label: 'Spring restock', href: '#spring-restock', icon: <Folder /> },
|
|
128
|
+
{ label: 'Warehouse move', href: '#warehouse-move', icon: <Folder /> },
|
|
129
|
+
],
|
|
130
|
+
footer: (
|
|
131
|
+
<Button variant="ghost" size="sm">
|
|
132
|
+
<Plus aria-hidden="true" />
|
|
133
|
+
New project
|
|
134
|
+
</Button>
|
|
135
|
+
),
|
|
136
|
+
},
|
|
137
|
+
]
|
|
138
|
+
|
|
139
|
+
<div className="max-w-64">
|
|
140
|
+
<Sidebar label="Projects navigation" groups={PROJECT_GROUPS} />
|
|
141
|
+
</div>
|
|
142
|
+
```
|
|
143
|
+
|
|
107
144
|
### In a sheet on a narrow screen: picking a link closes the sheet, through renderLink
|
|
108
145
|
|
|
109
146
|
```tsx
|
|
@@ -189,5 +226,7 @@ const closeOnChoose = ({ onClick, ...props }: LinkRenderProps) => (
|
|
|
189
226
|
- **nav**: The navigation region. Screen readers call it by the label prop.
|
|
190
227
|
- **Group title**: A disclosure button (one that shows and hides the list) when the group can fold, plain text when it can't. It's text.secondary, so it still reads on a raised panel. Its list opens and closes by animating its height. Opening also fades and slides each item in, each one a little later than the one before (capped, so a long group never feels slow). Closing fades everything out together, all at once. If someone has asked their system for less motion (prefers-reduced-motion: reduce), both happen instantly.
|
|
191
228
|
- **Item**: An icon, a label and an optional count. The current page gets the fill, plus aria-current, an ARIA attribute (Accessible Rich Internet Applications, the labels screen readers rely on) that tells screen readers this is the page you are on.
|
|
229
|
+
- **Group action**: Optional. A small icon button at the right end of the title row, such as New project. It sits next to the fold toggle, not inside it, so pressing it never folds the group. A long title is cut short before it can push the action out.
|
|
230
|
+
- **Group footer**: Optional. Under the group's items and lined up with them: an Add project button. It folds away with the items.
|
|
192
231
|
- **Header**: Sits above the groups: a product name, a workspace switcher.
|
|
193
232
|
- **Footer**: Pinned below the groups: the signed-in account, a help link.
|
|
@@ -11935,7 +11935,7 @@
|
|
|
11935
11935
|
{
|
|
11936
11936
|
"name": "groups",
|
|
11937
11937
|
"type": "SidebarGroup[]",
|
|
11938
|
-
"description": "Required. Each group has title, icon, items, collapsible and defaultOpen."
|
|
11938
|
+
"description": "Required. Each group has title, icon, items, collapsible and defaultOpen, and optionally action (a small icon button at the right end of the title row, beside the fold toggle, never inside it) and footer (under the items, lined up with them, hidden while the group is folded)."
|
|
11939
11939
|
},
|
|
11940
11940
|
{
|
|
11941
11941
|
"name": "header",
|
|
@@ -11974,7 +11974,7 @@
|
|
|
11974
11974
|
{
|
|
11975
11975
|
"name": "SidebarGroup",
|
|
11976
11976
|
"kind": "type",
|
|
11977
|
-
"code": "export type SidebarGroup = {\n /** Also the React key for this group; unique within a Sidebar. */\n title: string\n /** Drawn before the title, aria-hidden; the title alone names the group. */\n icon?: ReactNode\n items: SidebarItem[]\n /** @default true */\n collapsible?: boolean\n /** Ignored when the group holds the current item, which always starts open. @default true */\n defaultOpen?: boolean\n}",
|
|
11977
|
+
"code": "export type SidebarGroup = {\n /** Also the React key for this group; unique within a Sidebar. */\n title: string\n /** Drawn before the title, aria-hidden; the title alone names the group. */\n icon?: ReactNode\n items: SidebarItem[]\n /** @default true */\n collapsible?: boolean\n /** Ignored when the group holds the current item, which always starts open. @default true */\n defaultOpen?: boolean\n /** Drawn at the far right of the title row: a small icon button, e.g. a ghost size=\"sm\" Button\n * with a Plus icon and aria-label=\"New project\". It sits beside the fold toggle, never inside it,\n * so pressing it does not open or close the group. The title truncates before it is pushed out. */\n action?: ReactNode\n /** Drawn under the items, inside the group, lined up with the items' left edge and padding: an\n * \"Add project\" button. Hidden (and unreachable by Tab) while the group is folded. */\n footer?: ReactNode\n}",
|
|
11978
11978
|
"from": "src/components/organisms/sidebar/Sidebar"
|
|
11979
11979
|
}
|
|
11980
11980
|
],
|
|
@@ -12021,6 +12021,14 @@
|
|
|
12021
12021
|
"part": "Item",
|
|
12022
12022
|
"description": "An icon, a label and an optional count. The current page gets the fill, plus aria-current, an ARIA attribute (Accessible Rich Internet Applications, the labels screen readers rely on) that tells screen readers this is the page you are on."
|
|
12023
12023
|
},
|
|
12024
|
+
{
|
|
12025
|
+
"part": "Group action",
|
|
12026
|
+
"description": "Optional. A small icon button at the right end of the title row, such as New project. It sits next to the fold toggle, not inside it, so pressing it never folds the group. A long title is cut short before it can push the action out."
|
|
12027
|
+
},
|
|
12028
|
+
{
|
|
12029
|
+
"part": "Group footer",
|
|
12030
|
+
"description": "Optional. Under the group's items and lined up with them: an Add project button. It folds away with the items."
|
|
12031
|
+
},
|
|
12024
12032
|
{
|
|
12025
12033
|
"part": "Header",
|
|
12026
12034
|
"description": "Sits above the groups: a product name, a workspace switcher."
|
|
@@ -12035,6 +12043,10 @@
|
|
|
12035
12043
|
"caption": "Dashboard navigation",
|
|
12036
12044
|
"source": "const GROUPS: SidebarGroup[] = [\n {\n title: 'Operations',\n icon: <Warehouse />,\n items: [\n { label: 'Overview', href: '#overview', icon: <LayoutDashboard /> },\n { label: 'Orders', href: '#orders', icon: <Package />, current: true, count: 12 },\n { label: 'Shipments', href: '#shipments', icon: <Truck /> },\n { label: 'Returns', href: '#returns', icon: <Inbox />, count: 3 },\n ],\n },\n {\n title: 'Catalogue',\n icon: <Boxes />,\n defaultOpen: false,\n items: [\n { label: 'Products', href: '#products', icon: <Box /> },\n { label: 'Inventory', href: '#inventory', icon: <Map /> },\n ],\n },\n {\n title: 'Account',\n icon: <UserCog />,\n collapsible: false,\n items: [\n { label: 'Settings', href: '#settings', icon: <Settings /> },\n { label: 'Team', href: '#team', icon: <Users /> },\n ],\n },\n]\n\nconst HEADER = <p className=\"font-display font-semibold\">Hexline ops</p>\n\nconst FOOTER = <p className=\"text-xs text-[var(--color-text-secondary)]\">Signed in as Ana Pop</p>\n\n<div className=\"max-w-64\">\n <Sidebar label=\"Dashboard navigation\" groups={GROUPS} header={HEADER} footer={FOOTER} />\n</div>"
|
|
12037
12045
|
},
|
|
12046
|
+
{
|
|
12047
|
+
"caption": "A Projects group with an action in its title row and a footer under its items",
|
|
12048
|
+
"source": "const PROJECT_GROUPS: SidebarGroup[] = [\n {\n title: 'Projects',\n icon: <FolderKanban />,\n action: (\n <IconButton label=\"New project\" variant=\"ghost\" size=\"sm\">\n <Plus aria-hidden=\"true\" />\n </IconButton>\n ),\n items: [\n { label: 'Spring restock', href: '#spring-restock', icon: <Folder /> },\n { label: 'Warehouse move', href: '#warehouse-move', icon: <Folder /> },\n ],\n footer: (\n <Button variant=\"ghost\" size=\"sm\">\n <Plus aria-hidden=\"true\" />\n New project\n </Button>\n ),\n },\n]\n\n<div className=\"max-w-64\">\n <Sidebar label=\"Projects navigation\" groups={PROJECT_GROUPS} />\n</div>"
|
|
12049
|
+
},
|
|
12038
12050
|
{
|
|
12039
12051
|
"caption": "In a sheet on a narrow screen: picking a link closes the sheet, through renderLink",
|
|
12040
12052
|
"source": "const GROUPS: SidebarGroup[] = [\n {\n title: 'Operations',\n icon: <Warehouse />,\n items: [\n { label: 'Overview', href: '#overview', icon: <LayoutDashboard /> },\n { label: 'Orders', href: '#orders', icon: <Package />, current: true, count: 12 },\n { label: 'Shipments', href: '#shipments', icon: <Truck /> },\n { label: 'Returns', href: '#returns', icon: <Inbox />, count: 3 },\n ],\n },\n {\n title: 'Catalogue',\n icon: <Boxes />,\n defaultOpen: false,\n items: [\n { label: 'Products', href: '#products', icon: <Box /> },\n { label: 'Inventory', href: '#inventory', icon: <Map /> },\n ],\n },\n {\n title: 'Account',\n icon: <UserCog />,\n collapsible: false,\n items: [\n { label: 'Settings', href: '#settings', icon: <Settings /> },\n { label: 'Team', href: '#team', icon: <Users /> },\n ],\n },\n]\n\nconst HEADER = <p className=\"font-display font-semibold\">Hexline ops</p>\n\nconst FOOTER = <p className=\"text-xs text-[var(--color-text-secondary)]\">Signed in as Ana Pop</p>\n\nconst closeOnChoose = ({ onClick, ...props }: LinkRenderProps) => (\n <SheetClose asChild type={undefined}>\n <a {...props} onClick={onClick} />\n </SheetClose>\n)\n\n<Sheet>\n <SheetTrigger asChild>\n <Button variant=\"secondary\">Open navigation</Button>\n </SheetTrigger>\n <SheetContent side=\"left\" title=\"Navigation\">\n <Sidebar\n label=\"Dashboard navigation, in a sheet\"\n groups={GROUPS}\n header={HEADER}\n footer={FOOTER}\n renderLink={closeOnChoose}\n />\n </SheetContent>\n</Sheet>"
|