@gridui/collection 0.0.0-stage → 0.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 CHANGED
@@ -1,3 +1,8 @@
1
- # Temporary Holding Version
1
+ # @gridui/collection
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Core family. Public API: `CollectionItem`, `CollectionItemButton`, `CollectionItemButtonProps`, `CollectionItemLink`, `CollectionItemLinkProps`, `CollectionItemProps`.
4
+
5
+ Import components from `@gridui/collection` and load `@gridui/collection/styles.css` after Theme.
6
+ Load styles for any composed dependency used by this family. Applications own routes, labels, state persistence, and branding.
7
+
8
+ See [component ownership](../../docs/component-ownership.md) and [release history](.changeset/history/).
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Collection
4
+ * @namespace CollectionItem
5
+ * @description Collection Item
6
+ */
7
+ import type { ComponentPropsWithRef, FC, ReactNode } from "react";
8
+ export type CollectionItemProps = ComponentPropsWithRef<"li"> & {
9
+ readonly actions?: ReactNode;
10
+ };
11
+ export declare const CollectionItem: FC<CollectionItemProps>;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Collection
4
+ * @namespace CollectionItemButton
5
+ * @description Collection Item Button
6
+ */
7
+ import { type CollectionItemContentProps } from "../shared/item-content";
8
+ import type { ComponentPropsWithRef, FC } from "react";
9
+ export type CollectionItemButtonProps = Omit<ComponentPropsWithRef<"button">, "title" | "children"> & CollectionItemContentProps;
10
+ export declare const CollectionItemButton: FC<CollectionItemButtonProps>;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Collection
4
+ * @namespace CollectionItemLink
5
+ * @description Collection Item Link
6
+ */
7
+ import { type CollectionItemContentProps } from "../shared/item-content";
8
+ import type { ComponentPropsWithRef, FC } from "react";
9
+ export type CollectionItemLinkProps = Omit<ComponentPropsWithRef<"a">, "title" | "children"> & CollectionItemContentProps & {
10
+ readonly href: string;
11
+ };
12
+ export declare const CollectionItemLink: FC<CollectionItemLinkProps>;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Collection
4
+ * @namespace Root
5
+ * @description Index
6
+ */
7
+ export type { CollectionItemProps } from "./collection-item/collection-item";
8
+ export { CollectionItem } from "./collection-item/collection-item";
9
+ export type { CollectionItemButtonProps } from "./collection-item-button/collection-item-button";
10
+ export { CollectionItemButton } from "./collection-item-button/collection-item-button";
11
+ export type { CollectionItemLinkProps } from "./collection-item-link/collection-item-link";
12
+ export { CollectionItemLink } from "./collection-item-link/collection-item-link";
package/dist/index.js ADDED
@@ -0,0 +1,127 @@
1
+ // src/collection-item/collection-item.tsx
2
+ import { cn } from "@gridui/style-utils";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ var CollectionItem = (props) => {
5
+ const { children, actions, className, ...restProps } = props;
6
+ return /* @__PURE__ */ jsxs(
7
+ "li",
8
+ {
9
+ ...restProps,
10
+ className: cn("gridui-collection-item", className),
11
+ children: [
12
+ /* @__PURE__ */ jsx(
13
+ "div",
14
+ {
15
+ className: "gridui-collection-primary",
16
+ children
17
+ }
18
+ ),
19
+ actions && /* @__PURE__ */ jsx(
20
+ "div",
21
+ {
22
+ className: "gridui-collection-actions",
23
+ children: actions
24
+ }
25
+ )
26
+ ]
27
+ }
28
+ );
29
+ };
30
+
31
+ // src/shared/item-content.tsx
32
+ import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
33
+ var CollectionItemContent = (props) => {
34
+ const { title, description, icon, metadata } = props;
35
+ return /* @__PURE__ */ jsxs2(Fragment, { children: [
36
+ icon && /* @__PURE__ */ jsx2(
37
+ "span",
38
+ {
39
+ className: "gridui-collection-icon",
40
+ "aria-hidden": "true",
41
+ children: icon
42
+ }
43
+ ),
44
+ /* @__PURE__ */ jsxs2(
45
+ "span",
46
+ {
47
+ className: "gridui-collection-copy",
48
+ children: [
49
+ /* @__PURE__ */ jsx2(
50
+ "span",
51
+ {
52
+ className: "gridui-collection-title",
53
+ children: title
54
+ }
55
+ ),
56
+ description !== void 0 && description !== null && /* @__PURE__ */ jsx2(
57
+ "span",
58
+ {
59
+ className: "gridui-collection-description",
60
+ children: description
61
+ }
62
+ )
63
+ ]
64
+ }
65
+ ),
66
+ metadata !== void 0 && metadata !== null && /* @__PURE__ */ jsx2(
67
+ "span",
68
+ {
69
+ className: "gridui-collection-metadata",
70
+ children: metadata
71
+ }
72
+ )
73
+ ] });
74
+ };
75
+
76
+ // src/collection-item-button/collection-item-button.tsx
77
+ import { cn as cn2 } from "@gridui/style-utils";
78
+ import { jsx as jsx3 } from "react/jsx-runtime";
79
+ var CollectionItemButton = (props) => {
80
+ const { title, description, icon, metadata, className, type = "button", ...restProps } = props;
81
+ return /* @__PURE__ */ jsx3(
82
+ "button",
83
+ {
84
+ ...restProps,
85
+ type,
86
+ className: cn2("gridui-collection-action", className),
87
+ children: /* @__PURE__ */ jsx3(
88
+ CollectionItemContent,
89
+ {
90
+ title,
91
+ description,
92
+ icon,
93
+ metadata
94
+ }
95
+ )
96
+ }
97
+ );
98
+ };
99
+
100
+ // src/collection-item-link/collection-item-link.tsx
101
+ import { cn as cn3 } from "@gridui/style-utils";
102
+ import { jsx as jsx4 } from "react/jsx-runtime";
103
+ var CollectionItemLink = (props) => {
104
+ const { title, description, icon, metadata, className, ...restProps } = props;
105
+ return /* @__PURE__ */ jsx4(
106
+ "a",
107
+ {
108
+ ...restProps,
109
+ className: cn3("gridui-collection-action", className),
110
+ children: /* @__PURE__ */ jsx4(
111
+ CollectionItemContent,
112
+ {
113
+ title,
114
+ description,
115
+ icon,
116
+ metadata
117
+ }
118
+ )
119
+ }
120
+ );
121
+ };
122
+ export {
123
+ CollectionItem,
124
+ CollectionItemButton,
125
+ CollectionItemLink
126
+ };
127
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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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AAA,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;",
6
+ "names": ["jsx", "jsxs", "cn", "jsx", "cn", "jsx"]
7
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Collection
4
+ * @namespace Shared
5
+ * @description Item Content
6
+ */
7
+ import type { FC, ReactNode } from "react";
8
+ export type CollectionItemContentProps = {
9
+ readonly title: ReactNode;
10
+ readonly description?: ReactNode;
11
+ readonly icon?: ReactNode;
12
+ readonly metadata?: ReactNode;
13
+ };
14
+ export declare const CollectionItemContent: FC<CollectionItemContentProps>;
@@ -0,0 +1,74 @@
1
+ /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
2
+ @layer theme, base, components, utilities;
3
+ @layer utilities;
4
+ @layer components {
5
+ .gridui-collection-item {
6
+ display: flex;
7
+ align-items: center;
8
+ gap: var(--gridui-space-8);
9
+ list-style: none;
10
+ min-width: 0;
11
+ border-bottom: 1px solid var(--gridui-border);
12
+ }
13
+ .gridui-collection-primary {
14
+ flex: 1;
15
+ min-width: 0;
16
+ }
17
+ .gridui-collection-action {
18
+ box-sizing: border-box;
19
+ display: flex;
20
+ align-items: center;
21
+ gap: calc(var(--gridui-space-8) + var(--gridui-space-4));
22
+ width: 100%;
23
+ min-width: 0;
24
+ min-height: 48px;
25
+ padding: calc(var(--gridui-space-8) + var(--gridui-space-4));
26
+ border: 0;
27
+ border-radius: 4px;
28
+ background: transparent;
29
+ color: inherit;
30
+ font: inherit;
31
+ text-align: start;
32
+ text-decoration: none;
33
+ cursor: pointer;
34
+ }
35
+ .gridui-collection-action:hover {
36
+ background: var(--gridui-surface-hover);
37
+ }
38
+ .gridui-collection-action:disabled {
39
+ opacity: .5;
40
+ cursor: not-allowed;
41
+ }
42
+ .gridui-collection-action[aria-current] {
43
+ background: var(--gridui-surface-hover);
44
+ }
45
+ .gridui-collection-icon {
46
+ display: inline-flex;
47
+ flex: none;
48
+ }
49
+ .gridui-collection-copy {
50
+ display: flex;
51
+ flex-direction: column;
52
+ flex: 1;
53
+ min-width: 0;
54
+ overflow-wrap: anywhere;
55
+ }
56
+ .gridui-collection-title {
57
+ font-weight: 500;
58
+ }
59
+ .gridui-collection-description, .gridui-collection-metadata {
60
+ color: var(--gridui-muted);
61
+ font-size: .875em;
62
+ overflow-wrap: anywhere;
63
+ }
64
+ .gridui-collection-metadata {
65
+ max-width: 35%;
66
+ }
67
+ .gridui-collection-actions {
68
+ display: flex;
69
+ flex-wrap: wrap;
70
+ gap: var(--gridui-space-4);
71
+ flex: none;
72
+ max-width: 40%;
73
+ }
74
+ }
package/package.json CHANGED
@@ -1,6 +1,50 @@
1
1
  {
2
2
  "name": "@gridui/collection",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.0.0",
4
+ "description": "GridUI React collection",
5
+ "license": "UNLICENSED",
6
+ "type": "module",
7
+ "files": [
8
+ "dist",
9
+ "README.md"
10
+ ],
11
+ "sideEffects": [
12
+ "**/*.css"
13
+ ],
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "import": "./dist/index.js"
18
+ },
19
+ "./styles.css": "./dist/styles.css"
20
+ },
21
+ "publishConfig": {
22
+ "access": "public"
23
+ },
24
+ "peerDependencies": {
25
+ "react": "^19.2.0",
26
+ "react-dom": "^19.2.0"
27
+ },
28
+ "dependencies": {
29
+ "@gridui/style-utils": "^2.1.2",
30
+ "@gridui/theme": "^2.1.2"
31
+ },
32
+ "devDependencies": {
33
+ "@gridui-internal/configuration": "0.0.0",
34
+ "@jest/globals": "30.5.2",
35
+ "@types/jest": "30.0.0",
36
+ "@types/node": "26.6.5",
37
+ "@types/react": "19.3.0",
38
+ "@types/react-dom": "19.3.0",
39
+ "jest": "30.5.2",
40
+ "react": "19.3.1",
41
+ "react-dom": "19.3.1",
42
+ "typescript": "6.0.3"
43
+ },
44
+ "scripts": {
45
+ "build": "node ../../scripts/compilation/package.ts",
46
+ "compile": "tsc --project tsconfig.json",
47
+ "test": "jest --passWithNoTests",
48
+ "coverage": "jest --coverage --passWithNoTests"
49
+ }
6
50
  }