@gridui/collection 1.0.2 → 1.1.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/README.md CHANGED
@@ -5,4 +5,28 @@ Core family. Public API: `CollectionItem`, `CollectionItemButton`, `CollectionIt
5
5
  Import components from `@gridui/collection` and load `@gridui/collection/styles.css` after Theme.
6
6
  Load styles for any composed dependency used by this family. Applications own routes, labels, state persistence, and branding.
7
7
 
8
- See [component ownership](../../docs/component-ownership.md) and [release history](.changeset/history/).
8
+ See [component ownership](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/component-ownership.md) and [release history](https://github.com/sudo-ui/GridUI-React-Monorepo/tree/main/packages-core/collection/.changeset/history).
9
+
10
+ ## Selected cells
11
+
12
+ `CollectionItemButton` and `CollectionItemLink` accept `layout="cell"` and
13
+ `selected`. A cell fills its structural region, uses square corners and 16/24
14
+ spacing, and stacks title, description, and metadata with consistent row gaps.
15
+ Grid or the containing list owns the surrounding seams. The default `standard`
16
+ layout retains trailing metadata.
17
+
18
+ ```tsx
19
+ <GridItem padding={0}>
20
+ <CollectionItemButton layout="cell" title={call.caller}
21
+ description={call.startedAt} metadata={call.summary}
22
+ selected={selected === call.id} aria-pressed={selected === call.id}
23
+ onClick={() => setSelected(call.id)} />
24
+ </GridItem>
25
+ ```
26
+
27
+ `selected` controls appearance and does not infer ARIA semantics or a selection
28
+ model. Supply the pressed/current attributes appropriate to the application.
29
+ Selected items and links with an active `aria-current` use a persistent neutral
30
+ surface through hover. Disabled buttons retain native disabled behavior.
31
+ Links keep navigation, download, target, and ref behavior and have no disabled
32
+ button API. Keep independent trailing actions in `CollectionItem.actions`.
@@ -6,5 +6,7 @@
6
6
  */
7
7
  import { type CollectionItemContentProps } from "../shared/item-content";
8
8
  import type { ComponentPropsWithRef, FC } from "react";
9
- export type CollectionItemButtonProps = Omit<ComponentPropsWithRef<"button">, "title" | "children"> & CollectionItemContentProps;
9
+ export type CollectionItemButtonProps = Omit<ComponentPropsWithRef<"button">, "title" | "children"> & CollectionItemContentProps & {
10
+ readonly selected?: boolean | undefined;
11
+ };
10
12
  export declare const CollectionItemButton: FC<CollectionItemButtonProps>;
@@ -8,5 +8,6 @@ import { type CollectionItemContentProps } from "../shared/item-content";
8
8
  import type { ComponentPropsWithRef, FC } from "react";
9
9
  export type CollectionItemLinkProps = Omit<ComponentPropsWithRef<"a">, "title" | "children"> & CollectionItemContentProps & {
10
10
  readonly href: string;
11
+ readonly selected?: boolean | undefined;
11
12
  };
12
13
  export declare const CollectionItemLink: FC<CollectionItemLinkProps>;
package/dist/index.js CHANGED
@@ -31,7 +31,14 @@ var CollectionItem = (props) => {
31
31
  // src/shared/item-content.tsx
32
32
  import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
33
33
  var CollectionItemContent = (props) => {
34
- const { title, description, icon, metadata } = props;
34
+ const { title, description, icon, metadata, layout = "standard" } = props;
35
+ const details = metadata !== void 0 && metadata !== null ? /* @__PURE__ */ jsx2(
36
+ "span",
37
+ {
38
+ className: "gridui-collection-metadata",
39
+ children: metadata
40
+ }
41
+ ) : null;
35
42
  return /* @__PURE__ */ jsxs2(Fragment, { children: [
36
43
  icon && /* @__PURE__ */ jsx2(
37
44
  "span",
@@ -59,17 +66,12 @@ var CollectionItemContent = (props) => {
59
66
  className: "gridui-collection-description",
60
67
  children: description
61
68
  }
62
- )
69
+ ),
70
+ layout === "cell" && details
63
71
  ]
64
72
  }
65
73
  ),
66
- metadata !== void 0 && metadata !== null && /* @__PURE__ */ jsx2(
67
- "span",
68
- {
69
- className: "gridui-collection-metadata",
70
- children: metadata
71
- }
72
- )
74
+ layout !== "cell" && details
73
75
  ] });
74
76
  };
75
77
 
@@ -77,12 +79,14 @@ var CollectionItemContent = (props) => {
77
79
  import { cn as cn2 } from "@gridui/style-utils";
78
80
  import { jsx as jsx3 } from "react/jsx-runtime";
79
81
  var CollectionItemButton = (props) => {
80
- const { title, description, icon, metadata, className, type = "button", ...restProps } = props;
82
+ const { title, description, icon, metadata, layout = "standard", selected, className, type = "button", ...restProps } = props;
81
83
  return /* @__PURE__ */ jsx3(
82
84
  "button",
83
85
  {
84
86
  ...restProps,
85
87
  type,
88
+ "data-layout": layout,
89
+ "data-selected": selected || void 0,
86
90
  className: cn2("gridui-collection-action", className),
87
91
  children: /* @__PURE__ */ jsx3(
88
92
  CollectionItemContent,
@@ -90,7 +94,8 @@ var CollectionItemButton = (props) => {
90
94
  title,
91
95
  description,
92
96
  icon,
93
- metadata
97
+ metadata,
98
+ layout
94
99
  }
95
100
  )
96
101
  }
@@ -101,11 +106,13 @@ var CollectionItemButton = (props) => {
101
106
  import { cn as cn3 } from "@gridui/style-utils";
102
107
  import { jsx as jsx4 } from "react/jsx-runtime";
103
108
  var CollectionItemLink = (props) => {
104
- const { title, description, icon, metadata, className, ...restProps } = props;
109
+ const { title, description, icon, metadata, layout = "standard", selected, className, ...restProps } = props;
105
110
  return /* @__PURE__ */ jsx4(
106
111
  "a",
107
112
  {
108
113
  ...restProps,
114
+ "data-layout": layout,
115
+ "data-selected": selected || void 0,
109
116
  className: cn3("gridui-collection-action", className),
110
117
  children: /* @__PURE__ */ jsx4(
111
118
  CollectionItemContent,
@@ -113,7 +120,8 @@ var CollectionItemLink = (props) => {
113
120
  title,
114
121
  description,
115
122
  icon,
116
- metadata
123
+ metadata,
124
+ layout
117
125
  }
118
126
  )
119
127
  }
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/collection-item/collection-item.tsx", "../src/shared/item-content.tsx", "../src/collection-item-button/collection-item-button.tsx", "../src/collection-item-link/collection-item-link.tsx"],
4
- "sourcesContent": ["/**\n * @author WMXPY\n * @package Collection\n * @namespace CollectionItem\n * @description Collection Item\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC, ReactNode } from \"react\";\n\nexport type CollectionItemProps = ComponentPropsWithRef<\"li\"> & {\n readonly actions?: ReactNode;\n};\n\nexport const CollectionItem: FC<CollectionItemProps> = (props: CollectionItemProps) => {\n const { children, actions, className, ...restProps } = props;\n return (<li\n {...restProps}\n className={cn(\"gridui-collection-item\", className)}\n >\n <div\n className=\"gridui-collection-primary\"\n >\n {children}\n </div>\n {actions && (<div\n className=\"gridui-collection-actions\"\n >\n {actions}\n </div>)}\n </li>);\n};\n", "/**\n * @author WMXPY\n * @package Collection\n * @namespace Shared\n * @description Item Content\n */\n\nimport type { FC, ReactNode } from \"react\";\n\nexport type CollectionItemContentProps = {\n readonly title: ReactNode;\n readonly description?: ReactNode;\n readonly icon?: ReactNode;\n readonly metadata?: ReactNode;\n};\n\nexport const CollectionItemContent: FC<CollectionItemContentProps> = (props: CollectionItemContentProps) => {\n const { title, description, icon, metadata } = props;\n return (<>\n {icon && (<span\n className=\"gridui-collection-icon\"\n aria-hidden=\"true\"\n >\n {icon}\n </span>)}\n <span\n className=\"gridui-collection-copy\"\n >\n <span\n className=\"gridui-collection-title\"\n >\n {title}\n </span>\n {description !== undefined && description !== null && (<span\n className=\"gridui-collection-description\"\n >\n {description}\n </span>)}\n </span>\n {metadata !== undefined && metadata !== null && (<span\n className=\"gridui-collection-metadata\"\n >\n {metadata}\n </span>)}\n </>);\n};\n", "/**\n * @author WMXPY\n * @package Collection\n * @namespace CollectionItemButton\n * @description Collection Item Button\n */\n\nimport { CollectionItemContent, type CollectionItemContentProps } from \"../shared/item-content\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type CollectionItemButtonProps = Omit<ComponentPropsWithRef<\"button\">, \"title\" | \"children\"> & CollectionItemContentProps;\n\nexport const CollectionItemButton: FC<CollectionItemButtonProps> = (props: CollectionItemButtonProps) => {\n const { title, description, icon, metadata, className, type = \"button\", ...restProps } = props;\n return (<button\n {...restProps}\n type={type}\n className={cn(\"gridui-collection-action\", className)}\n >\n <CollectionItemContent\n title={title}\n description={description}\n icon={icon}\n metadata={metadata}\n />\n </button>);\n};\n", "/**\n * @author WMXPY\n * @package Collection\n * @namespace CollectionItemLink\n * @description Collection Item Link\n */\n\nimport { CollectionItemContent, type CollectionItemContentProps } from \"../shared/item-content\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type CollectionItemLinkProps = Omit<ComponentPropsWithRef<\"a\">, \"title\" | \"children\"> & CollectionItemContentProps & {\n readonly href: string;\n};\n\nexport const CollectionItemLink: FC<CollectionItemLinkProps> = (props: CollectionItemLinkProps) => {\n const { title, description, icon, metadata, className, ...restProps } = props;\n return (<a\n {...restProps}\n className={cn(\"gridui-collection-action\", className)}\n >\n <CollectionItemContent\n title={title}\n description={description}\n icon={icon}\n metadata={metadata}\n />\n </a>);\n};\n"],
5
- "mappings": ";AAOA,SAAS,UAAU;AASP,SAIJ,KAJI;AAFL,IAAM,iBAA0C,CAAC,UAA+B;AACnF,QAAM,EAAE,UAAU,SAAS,WAAW,GAAG,UAAU,IAAI;AACvD,SAAQ;AAAA,IAAC;AAAA;AAAA,MACJ,GAAG;AAAA,MACJ,WAAW,GAAG,0BAA0B,SAAS;AAAA,MAEjD;AAAA;AAAA,UAAC;AAAA;AAAA,YACG,WAAU;AAAA,YAET;AAAA;AAAA,QACL;AAAA,QACC,WAAY;AAAA,UAAC;AAAA;AAAA,YACV,WAAU;AAAA,YAET;AAAA;AAAA,QACL;AAAA;AAAA;AAAA,EACJ;AACJ;;;ACbY,mBACM,OAAAA,MAMV,QAAAC,aAPI;AAFL,IAAM,wBAAwD,CAAC,UAAsC;AACxG,QAAM,EAAE,OAAO,aAAa,MAAM,SAAS,IAAI;AAC/C,SAAQ,gBAAAA,MAAA,YACH;AAAA,YAAS,gBAAAD;AAAA,MAAC;AAAA;AAAA,QACP,WAAU;AAAA,QACV,eAAY;AAAA,QAEX;AAAA;AAAA,IACL;AAAA,IACA,gBAAAC;AAAA,MAAC;AAAA;AAAA,QACG,WAAU;AAAA,QAEV;AAAA,0BAAAD;AAAA,YAAC;AAAA;AAAA,cACG,WAAU;AAAA,cAET;AAAA;AAAA,UACL;AAAA,UACC,gBAAgB,UAAa,gBAAgB,QAAS,gBAAAA;AAAA,YAAC;AAAA;AAAA,cACpD,WAAU;AAAA,cAET;AAAA;AAAA,UACL;AAAA;AAAA;AAAA,IACJ;AAAA,IACC,aAAa,UAAa,aAAa,QAAS,gBAAAA;AAAA,MAAC;AAAA;AAAA,QAC9C,WAAU;AAAA,QAET;AAAA;AAAA,IACL;AAAA,KACJ;AACJ;;;ACrCA,SAAS,MAAAE,WAAU;AAYX,gBAAAC,YAAA;AAPD,IAAM,uBAAsD,CAAC,UAAqC;AACrG,QAAM,EAAE,OAAO,aAAa,MAAM,UAAU,WAAW,OAAO,UAAU,GAAG,UAAU,IAAI;AACzF,SAAQ,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACJ,GAAG;AAAA,MACJ;AAAA,MACA,WAAWD,IAAG,4BAA4B,SAAS;AAAA,MAEnD,0BAAAC;AAAA,QAAC;AAAA;AAAA,UACG;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA;AAAA,MACJ;AAAA;AAAA,EACJ;AACJ;;;ACnBA,SAAS,MAAAC,WAAU;AAaX,gBAAAC,YAAA;AAND,IAAM,qBAAkD,CAAC,UAAmC;AAC/F,QAAM,EAAE,OAAO,aAAa,MAAM,UAAU,WAAW,GAAG,UAAU,IAAI;AACxE,SAAQ,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACJ,GAAG;AAAA,MACJ,WAAWD,IAAG,4BAA4B,SAAS;AAAA,MAEnD,0BAAAC;AAAA,QAAC;AAAA;AAAA,UACG;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA;AAAA,MACJ;AAAA;AAAA,EACJ;AACJ;",
4
+ "sourcesContent": ["/**\n * @author WMXPY\n * @package Collection\n * @namespace CollectionItem\n * @description Collection Item\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC, ReactNode } from \"react\";\n\nexport type CollectionItemProps = ComponentPropsWithRef<\"li\"> & {\n readonly actions?: ReactNode;\n};\n\nexport const CollectionItem: FC<CollectionItemProps> = (props: CollectionItemProps) => {\n const { children, actions, className, ...restProps } = props;\n return (<li\n {...restProps}\n className={cn(\"gridui-collection-item\", className)}\n >\n <div\n className=\"gridui-collection-primary\"\n >\n {children}\n </div>\n {actions && (<div\n className=\"gridui-collection-actions\"\n >\n {actions}\n </div>)}\n </li>);\n};\n", "/**\n * @author WMXPY\n * @package Collection\n * @namespace Shared\n * @description Item Content\n */\n\nimport type { FC, ReactNode } from \"react\";\n\nexport type CollectionItemContentProps = {\n readonly title: ReactNode;\n readonly description?: ReactNode;\n readonly icon?: ReactNode;\n readonly metadata?: ReactNode;\n readonly layout?: \"standard\" | \"cell\" | undefined;\n};\n\nexport const CollectionItemContent: FC<CollectionItemContentProps> = (props: CollectionItemContentProps) => {\n const { title, description, icon, metadata, layout = \"standard\" } = props;\n const details = metadata !== undefined && metadata !== null ? (<span\n className=\"gridui-collection-metadata\"\n >\n {metadata}\n </span>) : null;\n return (<>\n {icon && (<span\n className=\"gridui-collection-icon\"\n aria-hidden=\"true\"\n >\n {icon}\n </span>)}\n <span\n className=\"gridui-collection-copy\"\n >\n <span\n className=\"gridui-collection-title\"\n >\n {title}\n </span>\n {description !== undefined && description !== null && (<span\n className=\"gridui-collection-description\"\n >\n {description}\n </span>)}\n {layout === \"cell\" && details}\n </span>\n {layout !== \"cell\" && details}\n </>);\n};\n", "/**\n * @author WMXPY\n * @package Collection\n * @namespace CollectionItemButton\n * @description Collection Item Button\n */\n\nimport { CollectionItemContent, type CollectionItemContentProps } from \"../shared/item-content\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type CollectionItemButtonProps = Omit<ComponentPropsWithRef<\"button\">, \"title\" | \"children\"> & CollectionItemContentProps & {\n readonly selected?: boolean | undefined;\n};\n\nexport const CollectionItemButton: FC<CollectionItemButtonProps> = (props: CollectionItemButtonProps) => {\n const { title, description, icon, metadata, layout = \"standard\", selected, className, type = \"button\", ...restProps } = props;\n return (<button\n {...restProps}\n type={type}\n data-layout={layout}\n data-selected={selected || undefined}\n className={cn(\"gridui-collection-action\", className)}\n >\n <CollectionItemContent\n title={title}\n description={description}\n icon={icon}\n metadata={metadata}\n layout={layout}\n />\n </button>);\n};\n", "/**\n * @author WMXPY\n * @package Collection\n * @namespace CollectionItemLink\n * @description Collection Item Link\n */\n\nimport { CollectionItemContent, type CollectionItemContentProps } from \"../shared/item-content\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type CollectionItemLinkProps = Omit<ComponentPropsWithRef<\"a\">, \"title\" | \"children\"> & CollectionItemContentProps & {\n readonly href: string;\n readonly selected?: boolean | undefined;\n};\n\nexport const CollectionItemLink: FC<CollectionItemLinkProps> = (props: CollectionItemLinkProps) => {\n const { title, description, icon, metadata, layout = \"standard\", selected, className, ...restProps } = props;\n return (<a\n {...restProps}\n data-layout={layout}\n data-selected={selected || undefined}\n className={cn(\"gridui-collection-action\", className)}\n >\n <CollectionItemContent\n title={title}\n description={description}\n icon={icon}\n metadata={metadata}\n layout={layout}\n />\n </a>);\n};\n"],
5
+ "mappings": ";AAOA,SAAS,UAAU;AASP,SAIJ,KAJI;AAFL,IAAM,iBAA0C,CAAC,UAA+B;AACnF,QAAM,EAAE,UAAU,SAAS,WAAW,GAAG,UAAU,IAAI;AACvD,SAAQ;AAAA,IAAC;AAAA;AAAA,MACJ,GAAG;AAAA,MACJ,WAAW,GAAG,0BAA0B,SAAS;AAAA,MAEjD;AAAA;AAAA,UAAC;AAAA;AAAA,YACG,WAAU;AAAA,YAET;AAAA;AAAA,QACL;AAAA,QACC,WAAY;AAAA,UAAC;AAAA;AAAA,YACV,WAAU;AAAA,YAET;AAAA;AAAA,QACL;AAAA;AAAA;AAAA,EACJ;AACJ;;;ACZmE,SAKvD,UALuD,OAAAA,MAY3D,QAAAC,aAZ2D;AAF5D,IAAM,wBAAwD,CAAC,UAAsC;AACxG,QAAM,EAAE,OAAO,aAAa,MAAM,UAAU,SAAS,WAAW,IAAI;AACpE,QAAM,UAAU,aAAa,UAAa,aAAa,OAAQ,gBAAAD;AAAA,IAAC;AAAA;AAAA,MAC5D,WAAU;AAAA,MAET;AAAA;AAAA,EACL,IAAW;AACX,SAAQ,gBAAAC,MAAA,YACH;AAAA,YAAS,gBAAAD;AAAA,MAAC;AAAA;AAAA,QACP,WAAU;AAAA,QACV,eAAY;AAAA,QAEX;AAAA;AAAA,IACL;AAAA,IACA,gBAAAC;AAAA,MAAC;AAAA;AAAA,QACG,WAAU;AAAA,QAEV;AAAA,0BAAAD;AAAA,YAAC;AAAA;AAAA,cACG,WAAU;AAAA,cAET;AAAA;AAAA,UACL;AAAA,UACC,gBAAgB,UAAa,gBAAgB,QAAS,gBAAAA;AAAA,YAAC;AAAA;AAAA,cACpD,WAAU;AAAA,cAET;AAAA;AAAA,UACL;AAAA,UACC,WAAW,UAAU;AAAA;AAAA;AAAA,IAC1B;AAAA,IACC,WAAW,UAAU;AAAA,KAC1B;AACJ;;;ACxCA,SAAS,MAAAE,WAAU;AAgBX,gBAAAC,YAAA;AATD,IAAM,uBAAsD,CAAC,UAAqC;AACrG,QAAM,EAAE,OAAO,aAAa,MAAM,UAAU,SAAS,YAAY,UAAU,WAAW,OAAO,UAAU,GAAG,UAAU,IAAI;AACxH,SAAQ,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACJ,GAAG;AAAA,MACJ;AAAA,MACA,eAAa;AAAA,MACb,iBAAe,YAAY;AAAA,MAC3B,WAAWD,IAAG,4BAA4B,SAAS;AAAA,MAEnD,0BAAAC;AAAA,QAAC;AAAA;AAAA,UACG;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA;AAAA,MACJ;AAAA;AAAA,EACJ;AACJ;;;ACxBA,SAAS,MAAAC,WAAU;AAgBX,gBAAAC,YAAA;AARD,IAAM,qBAAkD,CAAC,UAAmC;AAC/F,QAAM,EAAE,OAAO,aAAa,MAAM,UAAU,SAAS,YAAY,UAAU,WAAW,GAAG,UAAU,IAAI;AACvG,SAAQ,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACJ,GAAG;AAAA,MACJ,eAAa;AAAA,MACb,iBAAe,YAAY;AAAA,MAC3B,WAAWD,IAAG,4BAA4B,SAAS;AAAA,MAEnD,0BAAAC;AAAA,QAAC;AAAA;AAAA,UACG;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA;AAAA,MACJ;AAAA;AAAA,EACJ;AACJ;",
6
6
  "names": ["jsx", "jsxs", "cn", "jsx", "cn", "jsx"]
7
7
  }
@@ -10,5 +10,6 @@ export type CollectionItemContentProps = {
10
10
  readonly description?: ReactNode;
11
11
  readonly icon?: ReactNode;
12
12
  readonly metadata?: ReactNode;
13
+ readonly layout?: "standard" | "cell" | undefined;
13
14
  };
14
15
  export declare const CollectionItemContent: FC<CollectionItemContentProps>;
package/dist/styles.css CHANGED
@@ -32,15 +32,12 @@
32
32
  text-decoration: none;
33
33
  cursor: pointer;
34
34
  }
35
- .gridui-collection-action:hover {
36
- background: var(--gridui-surface-hover);
37
- }
38
35
  .gridui-collection-action:disabled {
39
36
  opacity: .5;
40
37
  cursor: not-allowed;
41
38
  }
42
- .gridui-collection-action[aria-current]:not([aria-current="false"], [aria-current=""]) {
43
- background: var(--gridui-surface-hover);
39
+ .gridui-collection-action[data-selected="true"], .gridui-collection-action[aria-current]:not([aria-current="false"], [aria-current=""]) {
40
+ background: var(--gridui-brand-tint);
44
41
  }
45
42
  .gridui-collection-icon {
46
43
  display: inline-flex;
@@ -64,6 +61,19 @@
64
61
  .gridui-collection-metadata {
65
62
  max-width: 35%;
66
63
  }
64
+ .gridui-collection-action[data-layout="cell"] {
65
+ align-items: flex-start;
66
+ height: 100%;
67
+ min-height: 2.75rem;
68
+ padding: var(--gridui-space-16) var(--gridui-space-24);
69
+ border-radius: 0;
70
+ }
71
+ .gridui-collection-action[data-layout="cell"] .gridui-collection-copy {
72
+ gap: var(--gridui-space-8);
73
+ }
74
+ .gridui-collection-action[data-layout="cell"] .gridui-collection-metadata {
75
+ max-width: none;
76
+ }
67
77
  .gridui-collection-actions {
68
78
  display: flex;
69
79
  flex-wrap: wrap;
@@ -0,0 +1,30 @@
1
+ # Collection items
2
+
3
+ Import `CollectionItem`, `CollectionItemButton`, `CollectionItemLink`, and their
4
+ prop types from `@gridui/collection`. Load `@gridui/collection/styles.css` after Theme. Place items
5
+ inside a native `ul` or `ol`; the item is a noninteractive `li` with primary content
6
+ and an optional independent `actions` slot.
7
+
8
+ ```tsx
9
+ <ul>
10
+ <CollectionItem actions={<Button aria-label="Remove draft" onClick={remove}>Remove</Button>}>
11
+ <CollectionItemButton title="Draft" description="Last edited today"
12
+ icon={<DocumentIcon />} metadata="3 pages" onClick={openDraft} />
13
+ </CollectionItem>
14
+ <CollectionItem>
15
+ <CollectionItemLink title="Guide" href="/guide" />
16
+ </CollectionItem>
17
+ </ul>
18
+ ```
19
+
20
+ Buttons default to `type="button"`; native disabled, keyboard, event and ref
21
+ behavior remains. Links require `href` and preserve browser navigation, target and
22
+ modifier-click behavior. Both accept `title`, `description`, decorative `icon`,
23
+ and `metadata` slots. These slots must contain noninteractive phrasing content;
24
+ put secondary controls in the item's `actions` slot. Main and trailing actions
25
+ are siblings, so activating a trailing action does not invoke the main action.
26
+
27
+ Use `aria-current="page"` on a current destination when appropriate. No implicit
28
+ selection model, listbox role, roving focus, router, or virtualization is added.
29
+ Custom primary content can be passed directly to `CollectionItem`. Consumers own
30
+ ordering, loading, empty states, data formatting and action labels.
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@gridui/collection",
3
- "version": "1.0.2",
3
+ "version": "1.1.1",
4
4
  "description": "GridUI React collection",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist",
9
+ "docs",
9
10
  "README.md"
10
11
  ],
11
12
  "sideEffects": [
@@ -26,17 +27,20 @@
26
27
  "react-dom": "^19.2.0"
27
28
  },
28
29
  "dependencies": {
29
- "@gridui/style-utils": "^2.1.3",
30
- "@gridui/theme": "^2.2.1"
30
+ "@gridui/style-utils": "^2.1.4",
31
+ "@gridui/theme": "^2.4.0"
31
32
  },
32
33
  "devDependencies": {
33
34
  "@gridui-internal/configuration": "0.0.0-internal",
35
+ "@gridui/button": "3.0.0",
34
36
  "@jest/globals": "30.5.2",
37
+ "@storybook/react-vite": "10.6.5",
35
38
  "@types/jest": "30.0.0",
36
39
  "@types/node": "26.6.6",
37
40
  "@types/react": "19.3.0",
38
41
  "@types/react-dom": "19.3.0",
39
42
  "jest": "30.5.2",
43
+ "lucide-react": "1.66.0",
40
44
  "react": "19.3.1",
41
45
  "react-dom": "19.3.1",
42
46
  "typescript": "6.0.3"