@gridui/source-list 1.0.7 → 1.2.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 +18 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +2 -2
- package/dist/source-list/source-list.d.ts +2 -0
- package/dist/styled.js +2 -0
- package/dist/styles.css +10 -2
- package/dist/styles.local.css +74 -0
- package/docs/catalog.json +2 -1
- package/docs/reference/source-list.md +6 -0
- package/package.json +10 -5
package/README.md
CHANGED
|
@@ -3,8 +3,25 @@
|
|
|
3
3
|
Data family. Public API: `SourceItem`, `SourceList`, `SourceListProps`.
|
|
4
4
|
|
|
5
5
|
Import components from `@gridui/source-list` and load `@gridui/source-list/styles.css` after Theme.
|
|
6
|
-
|
|
6
|
+
Applications own routes, labels, state persistence, and branding.
|
|
7
|
+
|
|
8
|
+
## Styles
|
|
9
|
+
|
|
10
|
+
Load Theme once. Use `@gridui/source-list/styled` for automatic component CSS in
|
|
11
|
+
CSS-aware bundlers, or keep the CSS-free root import and load `@gridui/source-list/styles.css`.
|
|
12
|
+
Both entries expose the same root API. The standalone stylesheet includes component
|
|
13
|
+
dependency styles; Theme/reset remain separate. See the
|
|
14
|
+
[integration guide](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/usage/integration.md)
|
|
15
|
+
for static HTML loading, SSR limits, and avoiding duplicate CSS.
|
|
16
|
+
|
|
7
17
|
|
|
8
18
|
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/source-list/.changeset/history).
|
|
9
19
|
|
|
10
20
|
[Component reference](docs/reference/README.md) contains focused API pages for each public component.
|
|
21
|
+
|
|
22
|
+
## Sizing and density
|
|
23
|
+
|
|
24
|
+
density compact/comfortable changes source-item block spacing; comfortable is the default. Titles, descriptions and quotations preserve their typography, native links and intrinsic content height.
|
|
25
|
+
|
|
26
|
+
See the [shared sizing contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/usage/sizing.md)
|
|
27
|
+
for native attributes, scope precedence, tokens and target behavior.
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
// src/source-list/style.ts
|
|
2
2
|
import { cva } from "class-variance-authority";
|
|
3
|
-
var sourceListStyles = cva("gridui-u-source-list--m-0 gridui-u-source-list--min-w-0 gridui-u-source-list--list-decimal gridui-u-source-list--ps-gridui-32");
|
|
4
|
-
var sourceItemStyles = cva("gridui-u-source-list--border-b gridui-u-source-list--border-border gridui-u-source-list--py-gridui-
|
|
3
|
+
var sourceListStyles = cva("gridui-source-list gridui-u-source-list--m-0 gridui-u-source-list--min-w-0 gridui-u-source-list--list-decimal gridui-u-source-list--ps-gridui-32");
|
|
4
|
+
var sourceItemStyles = cva("gridui-u-source-list--border-b gridui-u-source-list--border-border gridui-u-source-list--py-(--gridui-source-block) gridui-u-source-list--wrap-anywhere gridui-u-source-list--[&_a]:text-link gridui-u-source-list--[&_blockquote]:mx-0 gridui-u-source-list--[&_blockquote]:border-s-2 gridui-u-source-list--[&_blockquote]:border-border gridui-u-source-list--[&_blockquote]:ps-gridui-16");
|
|
5
5
|
var sourceMetaStyles = cva("gridui-u-source-list--text-muted gridui-u-source-list--type-caption");
|
|
6
6
|
|
|
7
7
|
// src/source-list/source-list.tsx
|
|
8
8
|
import { cn } from "@gridui/style-utils";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
var SourceList = (props) => {
|
|
11
|
-
const { sources, label, emptyLabel, className, ...restProps } = props;
|
|
11
|
+
const { sources, label, density = "comfortable", emptyLabel, className, ...restProps } = props;
|
|
12
12
|
return /* @__PURE__ */ jsxs(
|
|
13
13
|
"ol",
|
|
14
14
|
{
|
|
15
15
|
...restProps,
|
|
16
16
|
"aria-label": label,
|
|
17
|
+
"data-density": density,
|
|
17
18
|
className: cn(sourceListStyles(), className),
|
|
18
19
|
children: [
|
|
19
20
|
sources.length === 0 && /* @__PURE__ */ jsx(
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/source-list/style.ts", "../src/source-list/source-list.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * @author WMXPY\n * @package Source List\n * @namespace SourceList\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const sourceListStyles = cva(\"gridui-u-source-list--m-0 gridui-u-source-list--min-w-0 gridui-u-source-list--list-decimal gridui-u-source-list--ps-gridui-32\");\n\nexport const sourceItemStyles = cva(\"gridui-u-source-list--border-b gridui-u-source-list--border-border gridui-u-source-list--py-gridui-
|
|
5
|
-
"mappings": ";AAOA,SAAS,WAAW;AAEb,IAAM,mBAAmB,IAAI
|
|
4
|
+
"sourcesContent": ["/**\n * @author WMXPY\n * @package Source List\n * @namespace SourceList\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const sourceListStyles = cva(\"gridui-source-list gridui-u-source-list--m-0 gridui-u-source-list--min-w-0 gridui-u-source-list--list-decimal gridui-u-source-list--ps-gridui-32\");\n\nexport const sourceItemStyles = cva(\"gridui-u-source-list--border-b gridui-u-source-list--border-border gridui-u-source-list--py-(--gridui-source-block) gridui-u-source-list--wrap-anywhere gridui-u-source-list--[&_a]:text-link gridui-u-source-list--[&_blockquote]:mx-0 gridui-u-source-list--[&_blockquote]:border-s-2 gridui-u-source-list--[&_blockquote]:border-border gridui-u-source-list--[&_blockquote]:ps-gridui-16\");\n\nexport const sourceMetaStyles = cva(\"gridui-u-source-list--text-muted gridui-u-source-list--type-caption\");\n", "/**\n * @author WMXPY\n * @package Source List\n * @namespace SourceList\n * @description Source List\n */\n\nimport type { Density } from \"@gridui/theme\";\nimport { sourceItemStyles, sourceListStyles, sourceMetaStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type SourceItem = {\n readonly id: string;\n readonly title: string;\n readonly href: string;\n readonly description?: string;\n readonly excerpt?: string;\n};\n\nexport type SourceListProps = Omit<ComponentPropsWithRef<\"ol\">, \"children\"> & {\n readonly density?: Density;\n readonly sources: readonly SourceItem[];\n readonly label: string;\n readonly emptyLabel: string;\n};\n\nexport const SourceList: FC<SourceListProps> = (props: SourceListProps) => {\n const { sources, label, density = \"comfortable\", emptyLabel, className, ...restProps } = props;\n return (<ol\n {...restProps}\n aria-label={label}\n data-density={density}\n className={cn(sourceListStyles(), className)}\n >\n {sources.length === 0 && (<li\n className={sourceMetaStyles()}\n >\n {emptyLabel}\n </li>)}\n {sources.map(source => {\n return (<li\n key={source.id}\n className={sourceItemStyles()}\n >\n <a\n href={source.href}\n >\n {source.title}\n </a>\n {source.description && (<p\n className={sourceMetaStyles()}\n >\n {source.description}\n </p>)}\n {source.excerpt && (<blockquote>\n {source.excerpt}\n </blockquote>)}\n </li>);\n })}\n </ol>);\n};\n"],
|
|
5
|
+
"mappings": ";AAOA,SAAS,WAAW;AAEb,IAAM,mBAAmB,IAAI,kJAAkJ;AAE/K,IAAM,mBAAmB,IAAI,8XAA8X;AAE3Z,IAAM,mBAAmB,IAAI,qEAAqE;;;ACJzG,SAAS,UAAU;AA0Be,cAMd,YANc;AAR3B,IAAM,aAAkC,CAAC,UAA2B;AACvE,QAAM,EAAE,SAAS,OAAO,UAAU,eAAe,YAAY,WAAW,GAAG,UAAU,IAAI;AACzF,SAAQ;AAAA,IAAC;AAAA;AAAA,MACJ,GAAG;AAAA,MACJ,cAAY;AAAA,MACZ,gBAAc;AAAA,MACd,WAAW,GAAG,iBAAiB,GAAG,SAAS;AAAA,MAE1C;AAAA,gBAAQ,WAAW,KAAM;AAAA,UAAC;AAAA;AAAA,YACvB,WAAW,iBAAiB;AAAA,YAE3B;AAAA;AAAA,QACL;AAAA,QACC,QAAQ,IAAI,YAAU;AACnB,iBAAQ;AAAA,YAAC;AAAA;AAAA,cAEL,WAAW,iBAAiB;AAAA,cAE5B;AAAA;AAAA,kBAAC;AAAA;AAAA,oBACG,MAAM,OAAO;AAAA,oBAEZ,iBAAO;AAAA;AAAA,gBACZ;AAAA,gBACC,OAAO,eAAgB;AAAA,kBAAC;AAAA;AAAA,oBACrB,WAAW,iBAAiB;AAAA,oBAE3B,iBAAO;AAAA;AAAA,gBACZ;AAAA,gBACC,OAAO,WAAY,oBAAC,gBAChB,iBAAO,SACZ;AAAA;AAAA;AAAA,YAfK,OAAO;AAAA,UAgBhB;AAAA,QACJ,CAAC;AAAA;AAAA;AAAA,EACL;AACJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* @namespace SourceList
|
|
5
5
|
* @description Source List
|
|
6
6
|
*/
|
|
7
|
+
import type { Density } from "@gridui/theme";
|
|
7
8
|
import type { ComponentPropsWithRef, FC } from "react";
|
|
8
9
|
export type SourceItem = {
|
|
9
10
|
readonly id: string;
|
|
@@ -13,6 +14,7 @@ export type SourceItem = {
|
|
|
13
14
|
readonly excerpt?: string;
|
|
14
15
|
};
|
|
15
16
|
export type SourceListProps = Omit<ComponentPropsWithRef<"ol">, "children"> & {
|
|
17
|
+
readonly density?: Density;
|
|
16
18
|
readonly sources: readonly SourceItem[];
|
|
17
19
|
readonly label: string;
|
|
18
20
|
readonly emptyLabel: string;
|
package/dist/styled.js
ADDED
package/dist/styles.css
CHANGED
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
.gridui-u-source-list--border-border {
|
|
19
19
|
border-color: var(--gridui-border);
|
|
20
20
|
}
|
|
21
|
-
.gridui-u-source-list--py
|
|
22
|
-
padding-block: var(--gridui-
|
|
21
|
+
.gridui-u-source-list--py-\(--gridui-source-block\) {
|
|
22
|
+
padding-block: var(--gridui-source-block);
|
|
23
23
|
}
|
|
24
24
|
.gridui-u-source-list--ps-gridui-32 {
|
|
25
25
|
padding-inline-start: var(--gridui-space-32);
|
|
@@ -52,6 +52,14 @@
|
|
|
52
52
|
padding-inline-start: var(--gridui-space-16);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
+
@layer components {
|
|
56
|
+
.gridui-source-list {
|
|
57
|
+
--gridui-source-block: var(--gridui-space-8);
|
|
58
|
+
}
|
|
59
|
+
.gridui-source-list[data-density="compact"] {
|
|
60
|
+
--gridui-source-block: var(--gridui-space-4);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
55
63
|
@property --tw-border-style {
|
|
56
64
|
syntax: "*";
|
|
57
65
|
inherits: false;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@layer properties;
|
|
3
|
+
@layer theme, base, components, utilities;
|
|
4
|
+
@layer utilities {
|
|
5
|
+
.gridui-u-source-list--m-0 {
|
|
6
|
+
margin: 0px;
|
|
7
|
+
}
|
|
8
|
+
.gridui-u-source-list--min-w-0 {
|
|
9
|
+
min-width: 0px;
|
|
10
|
+
}
|
|
11
|
+
.gridui-u-source-list--list-decimal {
|
|
12
|
+
list-style-type: decimal;
|
|
13
|
+
}
|
|
14
|
+
.gridui-u-source-list--border-b {
|
|
15
|
+
border-bottom-style: var(--tw-border-style);
|
|
16
|
+
border-bottom-width: 1px;
|
|
17
|
+
}
|
|
18
|
+
.gridui-u-source-list--border-border {
|
|
19
|
+
border-color: var(--gridui-border);
|
|
20
|
+
}
|
|
21
|
+
.gridui-u-source-list--py-\(--gridui-source-block\) {
|
|
22
|
+
padding-block: var(--gridui-source-block);
|
|
23
|
+
}
|
|
24
|
+
.gridui-u-source-list--ps-gridui-32 {
|
|
25
|
+
padding-inline-start: var(--gridui-space-32);
|
|
26
|
+
}
|
|
27
|
+
.gridui-u-source-list--type-caption {
|
|
28
|
+
font: var(--gridui-type-caption);
|
|
29
|
+
font-family: var(--gridui-font-body);
|
|
30
|
+
letter-spacing: normal;
|
|
31
|
+
}
|
|
32
|
+
.gridui-u-source-list--wrap-anywhere {
|
|
33
|
+
overflow-wrap: anywhere;
|
|
34
|
+
}
|
|
35
|
+
.gridui-u-source-list--text-muted {
|
|
36
|
+
color: var(--gridui-muted);
|
|
37
|
+
}
|
|
38
|
+
.gridui-u-source-list--\[\&_a\]\:text-link a {
|
|
39
|
+
color: var(--gridui-link);
|
|
40
|
+
}
|
|
41
|
+
.gridui-u-source-list--\[\&_blockquote\]\:mx-0 blockquote {
|
|
42
|
+
margin-inline: 0px;
|
|
43
|
+
}
|
|
44
|
+
.gridui-u-source-list--\[\&_blockquote\]\:border-s-2 blockquote {
|
|
45
|
+
border-inline-start-style: var(--tw-border-style);
|
|
46
|
+
border-inline-start-width: 2px;
|
|
47
|
+
}
|
|
48
|
+
.gridui-u-source-list--\[\&_blockquote\]\:border-border blockquote {
|
|
49
|
+
border-color: var(--gridui-border);
|
|
50
|
+
}
|
|
51
|
+
.gridui-u-source-list--\[\&_blockquote\]\:ps-gridui-16 blockquote {
|
|
52
|
+
padding-inline-start: var(--gridui-space-16);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
@layer components {
|
|
56
|
+
.gridui-source-list {
|
|
57
|
+
--gridui-source-block: var(--gridui-space-8);
|
|
58
|
+
}
|
|
59
|
+
.gridui-source-list[data-density="compact"] {
|
|
60
|
+
--gridui-source-block: var(--gridui-space-4);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
@property --tw-border-style {
|
|
64
|
+
syntax: "*";
|
|
65
|
+
inherits: false;
|
|
66
|
+
initial-value: solid;
|
|
67
|
+
}
|
|
68
|
+
@layer properties {
|
|
69
|
+
@supports ((-webkit-hyphens: none) and (not (margin-trim: block))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
|
70
|
+
*, ::before, ::after, ::backdrop {
|
|
71
|
+
--tw-border-style: solid;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
package/docs/catalog.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"name": "@gridui/source-list",
|
|
4
|
-
"version": "1.0
|
|
4
|
+
"version": "1.2.0",
|
|
5
5
|
"category": "data",
|
|
6
6
|
"description": "GridUI React source list",
|
|
7
7
|
"usage": "Component reference contains focused API pages for each public component.",
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"@gridui/theme/styles.css",
|
|
32
32
|
"@gridui/source-list/styles.css"
|
|
33
33
|
],
|
|
34
|
+
"styledImport": "@gridui/source-list/styled",
|
|
34
35
|
"examples": [
|
|
35
36
|
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/source-list/stories/getting-started.mdx",
|
|
36
37
|
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/source-list/stories/references.mdx",
|
|
@@ -49,6 +49,12 @@ Called when the corresponding interaction occurs; inspect the arguments in Actio
|
|
|
49
49
|
|
|
50
50
|
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
51
51
|
|
|
52
|
+
### density
|
|
53
|
+
|
|
54
|
+
``Density | undefined`` · Optional
|
|
55
|
+
|
|
56
|
+
Default: ``"comfortable"``
|
|
57
|
+
|
|
52
58
|
### sources
|
|
53
59
|
|
|
54
60
|
``readonly SourceItem[]`` · Required
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridui/source-list",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "GridUI React source list",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -10,14 +10,19 @@
|
|
|
10
10
|
"docs"
|
|
11
11
|
],
|
|
12
12
|
"sideEffects": [
|
|
13
|
-
"**/*.css"
|
|
13
|
+
"**/*.css",
|
|
14
|
+
"./dist/styled.js"
|
|
14
15
|
],
|
|
15
16
|
"exports": {
|
|
16
17
|
".": {
|
|
17
18
|
"types": "./dist/index.d.ts",
|
|
18
19
|
"import": "./dist/index.js"
|
|
19
20
|
},
|
|
20
|
-
"./styles.css": "./dist/styles.css"
|
|
21
|
+
"./styles.css": "./dist/styles.css",
|
|
22
|
+
"./styled": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"import": "./dist/styled.js"
|
|
25
|
+
}
|
|
21
26
|
},
|
|
22
27
|
"publishConfig": {
|
|
23
28
|
"access": "public"
|
|
@@ -27,8 +32,8 @@
|
|
|
27
32
|
"react-dom": "^19.2.0"
|
|
28
33
|
},
|
|
29
34
|
"dependencies": {
|
|
30
|
-
"@gridui/style-utils": "^4.
|
|
31
|
-
"@gridui/theme": "^
|
|
35
|
+
"@gridui/style-utils": "^4.1.0",
|
|
36
|
+
"@gridui/theme": "^5.0.0",
|
|
32
37
|
"class-variance-authority": "0.7.1"
|
|
33
38
|
},
|
|
34
39
|
"devDependencies": {
|