@gridui/collection 1.1.2 → 1.1.5
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/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 +51 -0
- package/package.json +7 -9
|
@@ -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;AAC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Aa,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;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"name": "@gridui/collection",
|
|
4
|
+
"version": "1.1.5",
|
|
5
|
+
"category": "core",
|
|
6
|
+
"description": "GridUI React collection",
|
|
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
|
+
"documentation": [
|
|
9
|
+
"README.md",
|
|
10
|
+
"docs/collection.md"
|
|
11
|
+
],
|
|
12
|
+
"exports": [
|
|
13
|
+
{
|
|
14
|
+
"name": "CollectionItem",
|
|
15
|
+
"kind": "component",
|
|
16
|
+
"importPath": "@gridui/collection"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "CollectionItemButton",
|
|
20
|
+
"kind": "component",
|
|
21
|
+
"importPath": "@gridui/collection"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "CollectionItemButtonProps",
|
|
25
|
+
"kind": "type",
|
|
26
|
+
"importPath": "@gridui/collection"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "CollectionItemLink",
|
|
30
|
+
"kind": "component",
|
|
31
|
+
"importPath": "@gridui/collection"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "CollectionItemLinkProps",
|
|
35
|
+
"kind": "type",
|
|
36
|
+
"importPath": "@gridui/collection"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "CollectionItemProps",
|
|
40
|
+
"kind": "type",
|
|
41
|
+
"importPath": "@gridui/collection"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"styles": [
|
|
45
|
+
"@gridui/theme/styles.css",
|
|
46
|
+
"@gridui/collection/styles.css"
|
|
47
|
+
],
|
|
48
|
+
"examples": [
|
|
49
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/collection/stories/collection.stories.tsx"
|
|
50
|
+
]
|
|
51
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridui/collection",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "GridUI React collection",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -27,28 +27,26 @@
|
|
|
27
27
|
"react-dom": "^19.2.0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@gridui/style-utils": "^
|
|
31
|
-
"@gridui/theme": "^2.5.
|
|
30
|
+
"@gridui/style-utils": "^3.0.0",
|
|
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.0.0",
|
|
36
36
|
"@jest/globals": "30.5.2",
|
|
37
|
-
"@storybook/react-vite": "10.6.
|
|
37
|
+
"@storybook/react-vite": "10.6.6",
|
|
38
38
|
"@types/jest": "30.0.0",
|
|
39
39
|
"@types/node": "26.6.6",
|
|
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"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "node ../../scripts/compilation/package.ts",
|
|
50
|
-
"compile": "tsc --project tsconfig.json"
|
|
51
|
-
"test": "jest --passWithNoTests",
|
|
52
|
-
"coverage": "jest --coverage --passWithNoTests"
|
|
50
|
+
"compile": "tsc --project tsconfig.json"
|
|
53
51
|
}
|
|
54
52
|
}
|