@gridui/collection 1.1.4 → 1.1.6
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 +2 -0
- package/dist/collection-item-button/collection-item-button.d.ts +2 -4
- package/dist/collection-item-link/collection-item-link.d.ts +2 -3
- package/dist/index.js.map +2 -2
- package/dist/shared/item-content.d.ts +3 -8
- package/dist/shared/item-options.d.ts +17 -0
- package/dist/styles.css +9 -3
- package/docs/catalog.json +8 -2
- package/docs/reference/README.md +6 -0
- package/docs/reference/collection-item-button.md +85 -0
- package/docs/reference/collection-item-link.md +83 -0
- package/docs/reference/collection-item.md +61 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -30,3 +30,5 @@ Selected items and links with an active `aria-current` use a persistent neutral
|
|
|
30
30
|
surface through hover. Disabled buttons retain native disabled behavior.
|
|
31
31
|
Links keep navigation, download, target, and ref behavior and have no disabled
|
|
32
32
|
button API. Keep independent trailing actions in `CollectionItem.actions`.
|
|
33
|
+
|
|
34
|
+
[Component reference](docs/reference/README.md) contains focused API pages for each public component.
|
|
@@ -4,9 +4,7 @@
|
|
|
4
4
|
* @namespace CollectionItemButton
|
|
5
5
|
* @description Collection Item Button
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
7
|
+
import type { CollectionItemActionOptions } from "../shared/item-options";
|
|
8
8
|
import type { ComponentPropsWithRef, FC } from "react";
|
|
9
|
-
export type CollectionItemButtonProps = Omit<ComponentPropsWithRef<"button">, "title" | "children"> &
|
|
10
|
-
readonly selected?: boolean | undefined;
|
|
11
|
-
};
|
|
9
|
+
export type CollectionItemButtonProps = Omit<ComponentPropsWithRef<"button">, "title" | "children"> & CollectionItemActionOptions;
|
|
12
10
|
export declare const CollectionItemButton: FC<CollectionItemButtonProps>;
|
|
@@ -4,10 +4,9 @@
|
|
|
4
4
|
* @namespace CollectionItemLink
|
|
5
5
|
* @description Collection Item Link
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
7
|
+
import type { CollectionItemActionOptions } from "../shared/item-options";
|
|
8
8
|
import type { ComponentPropsWithRef, FC } from "react";
|
|
9
|
-
export type CollectionItemLinkProps = Omit<ComponentPropsWithRef<"a">, "title" | "children"> &
|
|
9
|
+
export type CollectionItemLinkProps = Omit<ComponentPropsWithRef<"a">, "title" | "children"> & CollectionItemActionOptions & {
|
|
10
10
|
readonly href: string;
|
|
11
|
-
readonly selected?: boolean | undefined;
|
|
12
11
|
};
|
|
13
12
|
export declare const CollectionItemLink: FC<CollectionItemLinkProps>;
|
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 {
|
|
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;;;
|
|
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 { CollectionItemContentOptions } from \"./item-options\";\nimport type { FC } from \"react\";\n\nexport type CollectionItemContentProps = CollectionItemContentOptions;\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 } from \"../shared/item-content\";\nimport type { CollectionItemActionOptions } from \"../shared/item-options\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type CollectionItemButtonProps = Omit<ComponentPropsWithRef<\"button\">, \"title\" | \"children\"> & CollectionItemActionOptions;\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 } from \"../shared/item-content\";\nimport type { CollectionItemActionOptions } from \"../shared/item-options\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type CollectionItemLinkProps = Omit<ComponentPropsWithRef<\"a\">, \"title\" | \"children\"> & CollectionItemActionOptions & {\n readonly href: string;\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;;;ACjBmE,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;;;AClCA,SAAS,MAAAE,WAAU;AAcX,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;;;ACtBA,SAAS,MAAAC,WAAU;AAeX,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
|
}
|
|
@@ -4,12 +4,7 @@
|
|
|
4
4
|
* @namespace Shared
|
|
5
5
|
* @description Item Content
|
|
6
6
|
*/
|
|
7
|
-
import type {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
readonly description?: ReactNode;
|
|
11
|
-
readonly icon?: ReactNode;
|
|
12
|
-
readonly metadata?: ReactNode;
|
|
13
|
-
readonly layout?: "standard" | "cell" | undefined;
|
|
14
|
-
};
|
|
7
|
+
import type { CollectionItemContentOptions } from "./item-options";
|
|
8
|
+
import type { FC } from "react";
|
|
9
|
+
export type CollectionItemContentProps = CollectionItemContentOptions;
|
|
15
10
|
export declare const CollectionItemContent: FC<CollectionItemContentProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Collection
|
|
4
|
+
* @namespace Shared
|
|
5
|
+
* @description Item Options
|
|
6
|
+
*/
|
|
7
|
+
import type { ReactNode } from "react";
|
|
8
|
+
export type CollectionItemContentOptions = {
|
|
9
|
+
readonly title: ReactNode;
|
|
10
|
+
readonly description?: ReactNode;
|
|
11
|
+
readonly icon?: ReactNode;
|
|
12
|
+
readonly metadata?: ReactNode;
|
|
13
|
+
readonly layout?: "standard" | "cell" | undefined;
|
|
14
|
+
};
|
|
15
|
+
export type CollectionItemActionOptions = CollectionItemContentOptions & {
|
|
16
|
+
readonly selected?: boolean | undefined;
|
|
17
|
+
};
|
package/dist/styles.css
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
/*! tailwindcss v4.3.
|
|
1
|
+
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
2
2
|
@layer theme, base, components, utilities;
|
|
3
3
|
@layer utilities;
|
|
4
4
|
@layer components {
|
|
5
5
|
.gridui-collection-item {
|
|
6
6
|
display: flex;
|
|
7
|
-
align-items:
|
|
8
|
-
gap:
|
|
7
|
+
align-items: stretch;
|
|
8
|
+
gap: 0;
|
|
9
9
|
list-style: none;
|
|
10
10
|
min-width: 0;
|
|
11
11
|
border-bottom: 1px solid var(--gridui-border);
|
|
12
12
|
}
|
|
13
13
|
.gridui-collection-primary {
|
|
14
|
+
display: flex;
|
|
14
15
|
flex: 1;
|
|
15
16
|
min-width: 0;
|
|
16
17
|
}
|
|
@@ -74,8 +75,13 @@
|
|
|
74
75
|
.gridui-collection-action[data-layout="cell"] .gridui-collection-metadata {
|
|
75
76
|
max-width: none;
|
|
76
77
|
}
|
|
78
|
+
.gridui-collection-primary > .gridui-collection-action {
|
|
79
|
+
height: auto;
|
|
80
|
+
border-radius: 0;
|
|
81
|
+
}
|
|
77
82
|
.gridui-collection-actions {
|
|
78
83
|
display: flex;
|
|
84
|
+
align-items: center;
|
|
79
85
|
flex-wrap: wrap;
|
|
80
86
|
gap: var(--gridui-space-4);
|
|
81
87
|
flex: none;
|
package/docs/catalog.json
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"name": "@gridui/collection",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.6",
|
|
5
5
|
"category": "core",
|
|
6
6
|
"description": "GridUI React collection",
|
|
7
7
|
"usage": "`CollectionItemButton` and `CollectionItemLink` accept `layout=\"cell\"` and `selected`. A cell fills its structural region, uses square corners and 16/24 spacing, and stacks title, description, and metadata with consistent row gaps. Grid or the containing list owns the surrounding seams. The default `standard` layout retains trailing metadata.",
|
|
8
8
|
"documentation": [
|
|
9
9
|
"README.md",
|
|
10
|
-
"docs/collection.md"
|
|
10
|
+
"docs/collection.md",
|
|
11
|
+
"docs/reference/README.md",
|
|
12
|
+
"docs/reference/collection-item-button.md",
|
|
13
|
+
"docs/reference/collection-item-link.md",
|
|
14
|
+
"docs/reference/collection-item.md"
|
|
11
15
|
],
|
|
12
16
|
"exports": [
|
|
13
17
|
{
|
|
@@ -46,6 +50,8 @@
|
|
|
46
50
|
"@gridui/collection/styles.css"
|
|
47
51
|
],
|
|
48
52
|
"examples": [
|
|
53
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/collection/stories/collection-cells.mdx",
|
|
54
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/collection/stories/list-actions.mdx",
|
|
49
55
|
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/collection/stories/collection.stories.tsx"
|
|
50
56
|
]
|
|
51
57
|
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# CollectionItemButton
|
|
3
|
+
|
|
4
|
+
Compose CollectionItemButton with CollectionItem inside the same @gridui/collection component family.
|
|
5
|
+
|
|
6
|
+
Import from ``@gridui/collection`` and load Theme before this family's stylesheet.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { CollectionItemButton } from "@gridui/collection";
|
|
10
|
+
import "@gridui/theme/styles.css";
|
|
11
|
+
import "@gridui/collection/styles.css";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/collection/README.md) for shared behavior and stylesheet dependencies.
|
|
15
|
+
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/collection/stories/collection.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
|
+
|
|
18
|
+
## API
|
|
19
|
+
|
|
20
|
+
The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
|
|
21
|
+
|
|
22
|
+
### onFocus
|
|
23
|
+
|
|
24
|
+
``(event: FocusEvent<HTMLButtonElement, Element>): void`` · Optional
|
|
25
|
+
|
|
26
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
27
|
+
|
|
28
|
+
### onBlur
|
|
29
|
+
|
|
30
|
+
``(event: FocusEvent<HTMLButtonElement, Element>): void`` · Optional
|
|
31
|
+
|
|
32
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
33
|
+
|
|
34
|
+
### onChange
|
|
35
|
+
|
|
36
|
+
``(event: ChangeEvent<HTMLButtonElement, Element>): void`` · Optional
|
|
37
|
+
|
|
38
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
39
|
+
|
|
40
|
+
### onSubmit
|
|
41
|
+
|
|
42
|
+
``(event: SubmitEvent<HTMLButtonElement>): void`` · Optional
|
|
43
|
+
|
|
44
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
45
|
+
|
|
46
|
+
### onClick
|
|
47
|
+
|
|
48
|
+
``(event: MouseEvent<HTMLButtonElement, MouseEvent>): void`` · Optional
|
|
49
|
+
|
|
50
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
51
|
+
|
|
52
|
+
### type
|
|
53
|
+
|
|
54
|
+
``"button" | "submit" | "reset" | undefined`` · Optional
|
|
55
|
+
|
|
56
|
+
Default: ``"button"``
|
|
57
|
+
|
|
58
|
+
### title
|
|
59
|
+
|
|
60
|
+
``ReactNode`` · Required
|
|
61
|
+
|
|
62
|
+
### description
|
|
63
|
+
|
|
64
|
+
``ReactNode`` · Optional
|
|
65
|
+
|
|
66
|
+
### icon
|
|
67
|
+
|
|
68
|
+
``ReactNode`` · Optional
|
|
69
|
+
|
|
70
|
+
### metadata
|
|
71
|
+
|
|
72
|
+
``ReactNode`` · Optional
|
|
73
|
+
|
|
74
|
+
### layout
|
|
75
|
+
|
|
76
|
+
``"cell" | "standard" | undefined`` · Optional
|
|
77
|
+
|
|
78
|
+
Default: ``"standard"``
|
|
79
|
+
|
|
80
|
+
Layout within the containing region.
|
|
81
|
+
|
|
82
|
+
### selected
|
|
83
|
+
|
|
84
|
+
``boolean | undefined`` · Optional
|
|
85
|
+
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# CollectionItemLink
|
|
3
|
+
|
|
4
|
+
Compose CollectionItemLink with CollectionItem inside the same @gridui/collection component family.
|
|
5
|
+
|
|
6
|
+
Import from ``@gridui/collection`` and load Theme before this family's stylesheet.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { CollectionItemLink } from "@gridui/collection";
|
|
10
|
+
import "@gridui/theme/styles.css";
|
|
11
|
+
import "@gridui/collection/styles.css";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/collection/README.md) for shared behavior and stylesheet dependencies.
|
|
15
|
+
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/collection/stories/collection.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
|
+
|
|
18
|
+
## API
|
|
19
|
+
|
|
20
|
+
The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
|
|
21
|
+
|
|
22
|
+
### onFocus
|
|
23
|
+
|
|
24
|
+
``(event: FocusEvent<HTMLAnchorElement, Element>): void`` · Optional
|
|
25
|
+
|
|
26
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
27
|
+
|
|
28
|
+
### onBlur
|
|
29
|
+
|
|
30
|
+
``(event: FocusEvent<HTMLAnchorElement, Element>): void`` · Optional
|
|
31
|
+
|
|
32
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
33
|
+
|
|
34
|
+
### onChange
|
|
35
|
+
|
|
36
|
+
``(event: ChangeEvent<HTMLAnchorElement, Element>): void`` · Optional
|
|
37
|
+
|
|
38
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
39
|
+
|
|
40
|
+
### onSubmit
|
|
41
|
+
|
|
42
|
+
``(event: SubmitEvent<HTMLAnchorElement>): void`` · Optional
|
|
43
|
+
|
|
44
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
45
|
+
|
|
46
|
+
### onClick
|
|
47
|
+
|
|
48
|
+
``(event: MouseEvent<HTMLAnchorElement, MouseEvent>): void`` · Optional
|
|
49
|
+
|
|
50
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
51
|
+
|
|
52
|
+
### href
|
|
53
|
+
|
|
54
|
+
``string`` · Required
|
|
55
|
+
|
|
56
|
+
### title
|
|
57
|
+
|
|
58
|
+
``ReactNode`` · Required
|
|
59
|
+
|
|
60
|
+
### description
|
|
61
|
+
|
|
62
|
+
``ReactNode`` · Optional
|
|
63
|
+
|
|
64
|
+
### icon
|
|
65
|
+
|
|
66
|
+
``ReactNode`` · Optional
|
|
67
|
+
|
|
68
|
+
### metadata
|
|
69
|
+
|
|
70
|
+
``ReactNode`` · Optional
|
|
71
|
+
|
|
72
|
+
### layout
|
|
73
|
+
|
|
74
|
+
``"cell" | "standard" | undefined`` · Optional
|
|
75
|
+
|
|
76
|
+
Default: ``"standard"``
|
|
77
|
+
|
|
78
|
+
Layout within the containing region.
|
|
79
|
+
|
|
80
|
+
### selected
|
|
81
|
+
|
|
82
|
+
``boolean | undefined`` · Optional
|
|
83
|
+
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# CollectionItem
|
|
3
|
+
|
|
4
|
+
Combines a primary action or link with independent trailing actions in one row. Use it for selectable records that also offer actions such as pinning or removing.
|
|
5
|
+
|
|
6
|
+
Import from ``@gridui/collection`` and load Theme before this family's stylesheet.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { CollectionItem } from "@gridui/collection";
|
|
10
|
+
import "@gridui/theme/styles.css";
|
|
11
|
+
import "@gridui/collection/styles.css";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/collection/README.md) for shared behavior and stylesheet dependencies.
|
|
15
|
+
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/collection/stories/collection.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
|
+
|
|
18
|
+
## API
|
|
19
|
+
|
|
20
|
+
The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
|
|
21
|
+
|
|
22
|
+
### children
|
|
23
|
+
|
|
24
|
+
``ReactNode`` · Optional
|
|
25
|
+
|
|
26
|
+
Content rendered inside the component.
|
|
27
|
+
|
|
28
|
+
### onFocus
|
|
29
|
+
|
|
30
|
+
``(event: FocusEvent<HTMLLIElement, Element>): void`` · Optional
|
|
31
|
+
|
|
32
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
33
|
+
|
|
34
|
+
### onBlur
|
|
35
|
+
|
|
36
|
+
``(event: FocusEvent<HTMLLIElement, Element>): void`` · Optional
|
|
37
|
+
|
|
38
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
39
|
+
|
|
40
|
+
### onChange
|
|
41
|
+
|
|
42
|
+
``(event: ChangeEvent<HTMLLIElement, Element>): void`` · Optional
|
|
43
|
+
|
|
44
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
45
|
+
|
|
46
|
+
### onSubmit
|
|
47
|
+
|
|
48
|
+
``(event: SubmitEvent<HTMLLIElement>): void`` · Optional
|
|
49
|
+
|
|
50
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
51
|
+
|
|
52
|
+
### onClick
|
|
53
|
+
|
|
54
|
+
``(event: MouseEvent<HTMLLIElement, MouseEvent>): void`` · Optional
|
|
55
|
+
|
|
56
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
57
|
+
|
|
58
|
+
### actions
|
|
59
|
+
|
|
60
|
+
``ReactNode`` · Optional
|
|
61
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridui/collection",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"description": "GridUI React collection",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"react-dom": "^19.2.0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@gridui/style-utils": "^
|
|
30
|
+
"@gridui/style-utils": "^4.0.0",
|
|
31
31
|
"@gridui/theme": "^2.5.3"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@gridui-internal/configuration": "0.0.0-internal",
|
|
35
|
-
"@gridui/button": "
|
|
35
|
+
"@gridui/button": "4.1.0",
|
|
36
36
|
"@jest/globals": "30.5.2",
|
|
37
37
|
"@storybook/react-vite": "10.6.6",
|
|
38
38
|
"@types/jest": "30.0.0",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@types/react": "19.3.0",
|
|
41
41
|
"@types/react-dom": "19.3.0",
|
|
42
42
|
"jest": "30.5.2",
|
|
43
|
-
"lucide-react": "1.
|
|
43
|
+
"lucide-react": "1.70.0",
|
|
44
44
|
"react": "19.3.1",
|
|
45
45
|
"react-dom": "19.3.1",
|
|
46
46
|
"typescript": "6.0.3"
|