@gridui/collection 1.3.0 → 2.0.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/README.md +9 -2
- package/dist/collection-item/collection-item.d.ts +2 -0
- package/dist/index.js +6 -3
- package/dist/index.js.map +2 -2
- package/dist/shared/item-options.d.ts +2 -0
- package/dist/styles.css +13 -4
- package/dist/styles.local.css +13 -4
- package/docs/catalog.json +6 -6
- package/docs/reference/collection-item-button.md +6 -2
- package/docs/reference/collection-item-link.md +6 -2
- package/docs/reference/collection-item.md +8 -2
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# @gridui/collection
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Data family. Public API: `CollectionItem`, `CollectionItemButton`, `CollectionItemButtonProps`, `CollectionItemLink`, `CollectionItemLinkProps`, `CollectionItemProps`.
|
|
4
4
|
|
|
5
5
|
Import components from `@gridui/collection` and load `@gridui/collection/styles.css` after Theme.
|
|
6
6
|
Applications own routes, labels, state persistence, and branding.
|
|
7
7
|
|
|
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-
|
|
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-data/collection/.changeset/history).
|
|
9
9
|
|
|
10
10
|
## Styles
|
|
11
11
|
|
|
@@ -42,3 +42,10 @@ Links keep navigation, download, target, and ref behavior and have no disabled
|
|
|
42
42
|
button API. Keep independent trailing actions in `CollectionItem.actions`.
|
|
43
43
|
|
|
44
44
|
[Component reference](docs/reference/README.md) contains focused API pages for each public component.
|
|
45
|
+
|
|
46
|
+
## Sizing and density
|
|
47
|
+
|
|
48
|
+
CollectionItem and CollectionItemButton/Link accept density compact/comfortable. The item supplies local spacing defaults to its action, which can explicitly override density. Standard/cell layout, selected state, seams and natural content growth remain separate.
|
|
49
|
+
|
|
50
|
+
See the [shared sizing contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/usage/sizing.md)
|
|
51
|
+
for native attributes, scope precedence, tokens and target behavior.
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
* @namespace CollectionItem
|
|
5
5
|
* @description Collection Item
|
|
6
6
|
*/
|
|
7
|
+
import type { Density } from "@gridui/theme";
|
|
7
8
|
import type { ComponentPropsWithRef, FC, ReactNode } from "react";
|
|
8
9
|
export type CollectionItemProps = ComponentPropsWithRef<"li"> & {
|
|
10
|
+
readonly density?: Density;
|
|
9
11
|
readonly actions?: ReactNode;
|
|
10
12
|
readonly layout?: "standard" | "cell" | undefined;
|
|
11
13
|
};
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ var CollectionLayoutContext = createContext("standard");
|
|
|
6
6
|
import { cn } from "@gridui/style-utils";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
var CollectionItem = (props) => {
|
|
9
|
-
const { children, actions, layout = "standard", className, ...restProps } = props;
|
|
9
|
+
const { children, actions, layout = "standard", density = "comfortable", className, ...restProps } = props;
|
|
10
10
|
return /* @__PURE__ */ jsx(
|
|
11
11
|
CollectionLayoutContext,
|
|
12
12
|
{
|
|
@@ -16,6 +16,7 @@ var CollectionItem = (props) => {
|
|
|
16
16
|
{
|
|
17
17
|
...restProps,
|
|
18
18
|
"data-layout": layout,
|
|
19
|
+
"data-density": density,
|
|
19
20
|
className: cn("gridui-collection-item", className),
|
|
20
21
|
children: [
|
|
21
22
|
/* @__PURE__ */ jsx(
|
|
@@ -91,7 +92,7 @@ import { cn as cn2 } from "@gridui/style-utils";
|
|
|
91
92
|
import { useContext } from "react";
|
|
92
93
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
93
94
|
var CollectionItemButton = (props) => {
|
|
94
|
-
const { title, description, icon, metadata, layout: layoutProp, selected, className, type = "button", ...restProps } = props;
|
|
95
|
+
const { title, description, icon, metadata, layout: layoutProp, density, selected, className, type = "button", ...restProps } = props;
|
|
95
96
|
const inheritedLayout = useContext(CollectionLayoutContext);
|
|
96
97
|
const layout = layoutProp ?? inheritedLayout;
|
|
97
98
|
return /* @__PURE__ */ jsx3(
|
|
@@ -100,6 +101,7 @@ var CollectionItemButton = (props) => {
|
|
|
100
101
|
...restProps,
|
|
101
102
|
type,
|
|
102
103
|
"data-layout": layout,
|
|
104
|
+
"data-density": density,
|
|
103
105
|
"data-selected": selected || void 0,
|
|
104
106
|
className: cn2("gridui-collection-action", className),
|
|
105
107
|
children: /* @__PURE__ */ jsx3(
|
|
@@ -121,7 +123,7 @@ import { cn as cn3 } from "@gridui/style-utils";
|
|
|
121
123
|
import { useContext as useContext2 } from "react";
|
|
122
124
|
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
123
125
|
var CollectionItemLink = (props) => {
|
|
124
|
-
const { title, description, icon, metadata, layout: layoutProp, selected, className, ...restProps } = props;
|
|
126
|
+
const { title, description, icon, metadata, layout: layoutProp, density, selected, className, ...restProps } = props;
|
|
125
127
|
const inheritedLayout = useContext2(CollectionLayoutContext);
|
|
126
128
|
const layout = layoutProp ?? inheritedLayout;
|
|
127
129
|
return /* @__PURE__ */ jsx4(
|
|
@@ -129,6 +131,7 @@ var CollectionItemLink = (props) => {
|
|
|
129
131
|
{
|
|
130
132
|
...restProps,
|
|
131
133
|
"data-layout": layout,
|
|
134
|
+
"data-density": density,
|
|
132
135
|
"data-selected": selected || void 0,
|
|
133
136
|
className: cn3("gridui-collection-action", className),
|
|
134
137
|
children: /* @__PURE__ */ jsx4(
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/shared/layout-context.ts", "../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 Shared\n * @description Layout Context\n */\n\nimport { createContext } from \"react\";\n\nexport const CollectionLayoutContext = createContext<\"standard\" | \"cell\">(\"standard\");\n", "/**\n * @author WMXPY\n * @package Collection\n * @namespace CollectionItem\n * @description Collection Item\n */\n\nimport { CollectionLayoutContext } from \"../shared/layout-context\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC, ReactNode } from \"react\";\n\nexport type CollectionItemProps = ComponentPropsWithRef<\"li\"> & {\n readonly actions?: ReactNode;\n readonly layout?: \"standard\" | \"cell\" | undefined;\n};\n\nexport const CollectionItem: FC<CollectionItemProps> = (props: CollectionItemProps) => {\n const { children, actions, layout = \"standard\", className, ...restProps } = props;\n return (<CollectionLayoutContext\n value={layout}\n >\n <li\n {...restProps}\n data-layout={layout}\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 </CollectionLayoutContext>);\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 { CollectionLayoutContext } from \"../shared/layout-context\";\nimport { cn } from \"@gridui/style-utils\";\nimport { type ComponentPropsWithRef, type FC, useContext } 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: layoutProp, selected, className, type = \"button\", ...restProps } = props;\n const inheritedLayout = useContext(CollectionLayoutContext);\n const layout = layoutProp ?? inheritedLayout;\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 { CollectionLayoutContext } from \"../shared/layout-context\";\nimport { cn } from \"@gridui/style-utils\";\nimport { type ComponentPropsWithRef, type FC, useContext } 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: layoutProp, selected, className, ...restProps } = props;\n const inheritedLayout = useContext(CollectionLayoutContext);\n const layout = layoutProp ?? inheritedLayout;\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,qBAAqB;AAEvB,IAAM,0BAA0B,cAAmC,UAAU;;;
|
|
4
|
+
"sourcesContent": ["/**\n * @author WMXPY\n * @package Collection\n * @namespace Shared\n * @description Layout Context\n */\n\nimport { createContext } from \"react\";\n\nexport const CollectionLayoutContext = createContext<\"standard\" | \"cell\">(\"standard\");\n", "/**\n * @author WMXPY\n * @package Collection\n * @namespace CollectionItem\n * @description Collection Item\n */\n\nimport type { Density } from \"@gridui/theme\";\nimport { CollectionLayoutContext } from \"../shared/layout-context\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC, ReactNode } from \"react\";\n\nexport type CollectionItemProps = ComponentPropsWithRef<\"li\"> & {\n readonly density?: Density;\n readonly actions?: ReactNode;\n readonly layout?: \"standard\" | \"cell\" | undefined;\n};\n\nexport const CollectionItem: FC<CollectionItemProps> = (props: CollectionItemProps) => {\n const { children, actions, layout = \"standard\", density = \"comfortable\", className, ...restProps } = props;\n return (<CollectionLayoutContext\n value={layout}\n >\n <li\n {...restProps}\n data-layout={layout}\n data-density={density}\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 </CollectionLayoutContext>);\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 { CollectionLayoutContext } from \"../shared/layout-context\";\nimport { cn } from \"@gridui/style-utils\";\nimport { type ComponentPropsWithRef, type FC, useContext } 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: layoutProp, density, selected, className, type = \"button\", ...restProps } = props;\n const inheritedLayout = useContext(CollectionLayoutContext);\n const layout = layoutProp ?? inheritedLayout;\n return (<button\n {...restProps}\n type={type}\n data-layout={layout}\n data-density={density}\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 { CollectionLayoutContext } from \"../shared/layout-context\";\nimport { cn } from \"@gridui/style-utils\";\nimport { type ComponentPropsWithRef, type FC, useContext } 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: layoutProp, density, selected, className, ...restProps } = props;\n const inheritedLayout = useContext(CollectionLayoutContext);\n const layout = layoutProp ?? inheritedLayout;\n return (<a\n {...restProps}\n data-layout={layout}\n data-density={density}\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": "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",
|
|
6
6
|
"names": ["jsx", "jsxs", "cn", "jsx", "cn", "useContext", "jsx"]
|
|
7
7
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* @namespace Shared
|
|
5
5
|
* @description Item Options
|
|
6
6
|
*/
|
|
7
|
+
import type { Density } from "@gridui/theme";
|
|
7
8
|
import type { ReactNode } from "react";
|
|
8
9
|
export type CollectionItemContentOptions = {
|
|
9
10
|
readonly title: ReactNode;
|
|
@@ -13,5 +14,6 @@ export type CollectionItemContentOptions = {
|
|
|
13
14
|
readonly layout?: "standard" | "cell" | undefined;
|
|
14
15
|
};
|
|
15
16
|
export type CollectionItemActionOptions = CollectionItemContentOptions & {
|
|
17
|
+
readonly density?: Density;
|
|
16
18
|
readonly selected?: boolean | undefined;
|
|
17
19
|
};
|
package/dist/styles.css
CHANGED
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
gap: var(--gridui-space-12);
|
|
23
23
|
width: 100%;
|
|
24
24
|
min-width: 0;
|
|
25
|
-
min-height: var(--gridui-control-min-height-large);
|
|
26
|
-
padding: var(--gridui-space-12);
|
|
25
|
+
min-height: max(var(--gridui-control-min-height-large), var(--gridui-target-min-size));
|
|
26
|
+
padding: var(--gridui-collection-block, var(--gridui-space-16)) var(--gridui-space-12);
|
|
27
27
|
border: 0;
|
|
28
28
|
border-radius: var(--gridui-control-radius);
|
|
29
29
|
background: transparent;
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
.gridui-collection-action[data-layout="cell"] {
|
|
66
66
|
align-items: flex-start;
|
|
67
67
|
height: 100%;
|
|
68
|
-
min-height: var(--gridui-control-min-height);
|
|
69
|
-
padding: var(--gridui-space-16) var(--gridui-space-24);
|
|
68
|
+
min-height: max(var(--gridui-control-min-height-medium), var(--gridui-target-min-size));
|
|
69
|
+
padding: var(--gridui-collection-block, var(--gridui-space-16)) var(--gridui-space-24);
|
|
70
70
|
border-radius: 0;
|
|
71
71
|
}
|
|
72
72
|
.gridui-collection-action[data-layout="cell"] .gridui-collection-copy {
|
|
@@ -100,4 +100,13 @@
|
|
|
100
100
|
min-width: 0;
|
|
101
101
|
border-radius: 0;
|
|
102
102
|
}
|
|
103
|
+
.gridui-collection-item {
|
|
104
|
+
--gridui-collection-block: var(--gridui-space-16);
|
|
105
|
+
}
|
|
106
|
+
:is(.gridui-collection-item, .gridui-collection-action)[data-density="compact"] {
|
|
107
|
+
--gridui-collection-block: var(--gridui-space-8);
|
|
108
|
+
}
|
|
109
|
+
:is(.gridui-collection-item, .gridui-collection-action)[data-density="comfortable"] {
|
|
110
|
+
--gridui-collection-block: var(--gridui-space-16);
|
|
111
|
+
}
|
|
103
112
|
}
|
package/dist/styles.local.css
CHANGED
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
gap: var(--gridui-space-12);
|
|
23
23
|
width: 100%;
|
|
24
24
|
min-width: 0;
|
|
25
|
-
min-height: var(--gridui-control-min-height-large);
|
|
26
|
-
padding: var(--gridui-space-12);
|
|
25
|
+
min-height: max(var(--gridui-control-min-height-large), var(--gridui-target-min-size));
|
|
26
|
+
padding: var(--gridui-collection-block, var(--gridui-space-16)) var(--gridui-space-12);
|
|
27
27
|
border: 0;
|
|
28
28
|
border-radius: var(--gridui-control-radius);
|
|
29
29
|
background: transparent;
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
.gridui-collection-action[data-layout="cell"] {
|
|
66
66
|
align-items: flex-start;
|
|
67
67
|
height: 100%;
|
|
68
|
-
min-height: var(--gridui-control-min-height);
|
|
69
|
-
padding: var(--gridui-space-16) var(--gridui-space-24);
|
|
68
|
+
min-height: max(var(--gridui-control-min-height-medium), var(--gridui-target-min-size));
|
|
69
|
+
padding: var(--gridui-collection-block, var(--gridui-space-16)) var(--gridui-space-24);
|
|
70
70
|
border-radius: 0;
|
|
71
71
|
}
|
|
72
72
|
.gridui-collection-action[data-layout="cell"] .gridui-collection-copy {
|
|
@@ -100,4 +100,13 @@
|
|
|
100
100
|
min-width: 0;
|
|
101
101
|
border-radius: 0;
|
|
102
102
|
}
|
|
103
|
+
.gridui-collection-item {
|
|
104
|
+
--gridui-collection-block: var(--gridui-space-16);
|
|
105
|
+
}
|
|
106
|
+
:is(.gridui-collection-item, .gridui-collection-action)[data-density="compact"] {
|
|
107
|
+
--gridui-collection-block: var(--gridui-space-8);
|
|
108
|
+
}
|
|
109
|
+
:is(.gridui-collection-item, .gridui-collection-action)[data-density="comfortable"] {
|
|
110
|
+
--gridui-collection-block: var(--gridui-space-16);
|
|
111
|
+
}
|
|
103
112
|
}
|
package/docs/catalog.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"name": "@gridui/collection",
|
|
4
|
-
"version": "
|
|
5
|
-
"category": "
|
|
4
|
+
"version": "2.0.0",
|
|
5
|
+
"category": "data",
|
|
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": [
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
],
|
|
52
52
|
"styledImport": "@gridui/collection/styled",
|
|
53
53
|
"examples": [
|
|
54
|
-
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
55
|
-
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
56
|
-
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
57
|
-
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
54
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/collection/stories/collection-cells.mdx",
|
|
55
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/collection/stories/getting-started.mdx",
|
|
56
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/collection/stories/list-actions.mdx",
|
|
57
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/collection/stories/collection.stories.tsx"
|
|
58
58
|
]
|
|
59
59
|
}
|
|
@@ -11,9 +11,9 @@ import "@gridui/theme/styles.css";
|
|
|
11
11
|
import "@gridui/collection/styles.css";
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/collection/README.md) for shared behavior and stylesheet dependencies.
|
|
15
15
|
|
|
16
|
-
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/collection/stories/collection.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
17
|
|
|
18
18
|
## API
|
|
19
19
|
|
|
@@ -77,6 +77,10 @@ Default: ``"button"``
|
|
|
77
77
|
|
|
78
78
|
Layout within the containing region.
|
|
79
79
|
|
|
80
|
+
### density
|
|
81
|
+
|
|
82
|
+
``Density | undefined`` · Optional
|
|
83
|
+
|
|
80
84
|
### selected
|
|
81
85
|
|
|
82
86
|
``boolean | undefined`` · Optional
|
|
@@ -11,9 +11,9 @@ import "@gridui/theme/styles.css";
|
|
|
11
11
|
import "@gridui/collection/styles.css";
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/collection/README.md) for shared behavior and stylesheet dependencies.
|
|
15
15
|
|
|
16
|
-
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/collection/stories/collection.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
17
|
|
|
18
18
|
## API
|
|
19
19
|
|
|
@@ -75,6 +75,10 @@ Called when the corresponding interaction occurs; inspect the arguments in Actio
|
|
|
75
75
|
|
|
76
76
|
Layout within the containing region.
|
|
77
77
|
|
|
78
|
+
### density
|
|
79
|
+
|
|
80
|
+
``Density | undefined`` · Optional
|
|
81
|
+
|
|
78
82
|
### selected
|
|
79
83
|
|
|
80
84
|
``boolean | undefined`` · Optional
|
|
@@ -11,9 +11,9 @@ import "@gridui/theme/styles.css";
|
|
|
11
11
|
import "@gridui/collection/styles.css";
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/collection/README.md) for shared behavior and stylesheet dependencies.
|
|
15
15
|
|
|
16
|
-
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/collection/stories/collection.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
17
|
|
|
18
18
|
## API
|
|
19
19
|
|
|
@@ -55,6 +55,12 @@ Called when the corresponding interaction occurs; inspect the arguments in Actio
|
|
|
55
55
|
|
|
56
56
|
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
57
57
|
|
|
58
|
+
### density
|
|
59
|
+
|
|
60
|
+
``Density | undefined`` · Optional
|
|
61
|
+
|
|
62
|
+
Default: ``"comfortable"``
|
|
63
|
+
|
|
58
64
|
### actions
|
|
59
65
|
|
|
60
66
|
``ReactNode`` · Optional
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridui/collection",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "GridUI React collection",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"react-dom": "^19.2.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@gridui/style-utils": "^4.
|
|
36
|
-
"@gridui/theme": "^
|
|
35
|
+
"@gridui/style-utils": "^4.1.0",
|
|
36
|
+
"@gridui/theme": "^5.0.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@gridui-internal/configuration": "0.0.0-internal",
|
|
40
|
-
"@gridui/button": "
|
|
40
|
+
"@gridui/button": "6.0.0",
|
|
41
41
|
"@jest/globals": "30.5.2",
|
|
42
42
|
"@storybook/react-vite": "10.6.7",
|
|
43
43
|
"@types/jest": "30.0.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@types/react": "19.3.0",
|
|
46
46
|
"@types/react-dom": "19.3.0",
|
|
47
47
|
"jest": "30.5.2",
|
|
48
|
-
"lucide-react": "1.
|
|
48
|
+
"lucide-react": "1.73.0",
|
|
49
49
|
"react": "19.3.1",
|
|
50
50
|
"react-dom": "19.3.1",
|
|
51
51
|
"typescript": "6.0.3"
|