@gridui/source-list 1.0.4 → 1.0.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/index.js +3 -3
- package/dist/index.js.map +2 -2
- package/dist/styles.css +16 -16
- package/docs/catalog.json +6 -3
- package/docs/reference/README.md +4 -0
- package/docs/reference/source-list.md +63 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -6,3 +6,5 @@ Import components from `@gridui/source-list` and load `@gridui/source-list/style
|
|
|
6
6
|
Load styles for any composed dependency used by this family. Applications own routes, labels, state persistence, and branding.
|
|
7
7
|
|
|
8
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-core/source-list/.changeset/history).
|
|
9
|
+
|
|
10
|
+
[Component reference](docs/reference/README.md) contains focused API pages for each public component.
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// src/source-list/style.ts
|
|
2
2
|
import { cva } from "class-variance-authority";
|
|
3
|
-
var sourceListStyles = cva("gridui-u-m-0 gridui-u-min-w-0 gridui-u-list-decimal gridui-u-ps-gridui-32");
|
|
4
|
-
var sourceItemStyles = cva("gridui-u-border-b gridui-u-border-border gridui-u-py-gridui-8 gridui-u-wrap-anywhere gridui-u-[&_a]:text-link gridui-u-[&_blockquote]:mx-0 gridui-u-[&_blockquote]:border-s-2 gridui-u-[&_blockquote]:border-border gridui-u-[&_blockquote]:ps-gridui-16");
|
|
5
|
-
var sourceMetaStyles = cva("gridui-u-text-muted gridui-u-type-caption");
|
|
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-8 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
|
+
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";
|
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-m-0 gridui-u-min-w-0 gridui-u-list-decimal gridui-u-ps-gridui-32\");\n\nexport const sourceItemStyles = cva(\"gridui-u-border-b gridui-u-border-border gridui-u-py-gridui-8 gridui-u-wrap-anywhere gridui-u-[&_a]:text-link gridui-u-[&_blockquote]:mx-0 gridui-u-[&_blockquote]:border-s-2 gridui-u-[&_blockquote]:border-border gridui-u-[&_blockquote]:ps-gridui-16\");\n\nexport const sourceMetaStyles = cva(\"gridui-u-text-muted gridui-u-type-caption\");\n", "/**\n * @author WMXPY\n * @package Source List\n * @namespace SourceList\n * @description Source List\n */\n\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 sources: readonly SourceItem[];\n readonly label: string;\n readonly emptyLabel: string;\n};\n\nexport const SourceList: FC<SourceListProps> = (props: SourceListProps) => {\n const { sources, label, emptyLabel, className, ...restProps } = props;\n return (<ol\n {...restProps}\n aria-label={label}\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
|
|
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-8 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 { 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 sources: readonly SourceItem[];\n readonly label: string;\n readonly emptyLabel: string;\n};\n\nexport const SourceList: FC<SourceListProps> = (props: SourceListProps) => {\n const { sources, label, emptyLabel, className, ...restProps } = props;\n return (<ol\n {...restProps}\n aria-label={label}\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,+HAA+H;AAE5J,IAAM,mBAAmB,IAAI,+WAA+W;AAE5Y,IAAM,mBAAmB,IAAI,qEAAqE;;;ACLzG,SAAS,UAAU;AAwBe,cAMd,YANc;AAP3B,IAAM,aAAkC,CAAC,UAA2B;AACvE,QAAM,EAAE,SAAS,OAAO,YAAY,WAAW,GAAG,UAAU,IAAI;AAChE,SAAQ;AAAA,IAAC;AAAA;AAAA,MACJ,GAAG;AAAA,MACJ,cAAY;AAAA,MACZ,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
|
}
|
package/dist/styles.css
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
/*! tailwindcss v4.3.
|
|
1
|
+
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
2
2
|
@layer properties;
|
|
3
3
|
@layer theme, base, components, utilities;
|
|
4
4
|
@layer utilities {
|
|
5
|
-
.gridui-u-m-0 {
|
|
5
|
+
.gridui-u-source-list--m-0 {
|
|
6
6
|
margin: 0px;
|
|
7
7
|
}
|
|
8
|
-
.gridui-u-min-w-0 {
|
|
8
|
+
.gridui-u-source-list--min-w-0 {
|
|
9
9
|
min-width: 0px;
|
|
10
10
|
}
|
|
11
|
-
.gridui-u-list-decimal {
|
|
11
|
+
.gridui-u-source-list--list-decimal {
|
|
12
12
|
list-style-type: decimal;
|
|
13
13
|
}
|
|
14
|
-
.gridui-u-border-b {
|
|
14
|
+
.gridui-u-source-list--border-b {
|
|
15
15
|
border-bottom-style: var(--tw-border-style);
|
|
16
16
|
border-bottom-width: 1px;
|
|
17
17
|
}
|
|
18
|
-
.gridui-u-border-border {
|
|
18
|
+
.gridui-u-source-list--border-border {
|
|
19
19
|
border-color: var(--gridui-border);
|
|
20
20
|
}
|
|
21
|
-
.gridui-u-py-gridui-8 {
|
|
21
|
+
.gridui-u-source-list--py-gridui-8 {
|
|
22
22
|
padding-block: var(--gridui-space-8);
|
|
23
23
|
}
|
|
24
|
-
.gridui-u-ps-gridui-32 {
|
|
24
|
+
.gridui-u-source-list--ps-gridui-32 {
|
|
25
25
|
padding-inline-start: var(--gridui-space-32);
|
|
26
26
|
}
|
|
27
|
-
.gridui-u-type-caption {
|
|
27
|
+
.gridui-u-source-list--type-caption {
|
|
28
28
|
font: var(--gridui-type-caption);
|
|
29
29
|
letter-spacing: normal;
|
|
30
30
|
}
|
|
31
|
-
.gridui-u-wrap-anywhere {
|
|
31
|
+
.gridui-u-source-list--wrap-anywhere {
|
|
32
32
|
overflow-wrap: anywhere;
|
|
33
33
|
}
|
|
34
|
-
.gridui-u-text-muted {
|
|
34
|
+
.gridui-u-source-list--text-muted {
|
|
35
35
|
color: var(--gridui-muted);
|
|
36
36
|
}
|
|
37
|
-
.gridui-u
|
|
37
|
+
.gridui-u-source-list--\[\&_a\]\:text-link a {
|
|
38
38
|
color: var(--gridui-link);
|
|
39
39
|
}
|
|
40
|
-
.gridui-u
|
|
40
|
+
.gridui-u-source-list--\[\&_blockquote\]\:mx-0 blockquote {
|
|
41
41
|
margin-inline: 0px;
|
|
42
42
|
}
|
|
43
|
-
.gridui-u
|
|
43
|
+
.gridui-u-source-list--\[\&_blockquote\]\:border-s-2 blockquote {
|
|
44
44
|
border-inline-start-style: var(--tw-border-style);
|
|
45
45
|
border-inline-start-width: 2px;
|
|
46
46
|
}
|
|
47
|
-
.gridui-u
|
|
47
|
+
.gridui-u-source-list--\[\&_blockquote\]\:border-border blockquote {
|
|
48
48
|
border-color: var(--gridui-border);
|
|
49
49
|
}
|
|
50
|
-
.gridui-u
|
|
50
|
+
.gridui-u-source-list--\[\&_blockquote\]\:ps-gridui-16 blockquote {
|
|
51
51
|
padding-inline-start: var(--gridui-space-16);
|
|
52
52
|
}
|
|
53
53
|
}
|
package/docs/catalog.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"name": "@gridui/source-list",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.6",
|
|
5
5
|
"category": "core",
|
|
6
6
|
"description": "GridUI React source list",
|
|
7
|
-
"usage": "
|
|
7
|
+
"usage": "Component reference contains focused API pages for each public component.",
|
|
8
8
|
"documentation": [
|
|
9
|
-
"README.md"
|
|
9
|
+
"README.md",
|
|
10
|
+
"docs/reference/README.md",
|
|
11
|
+
"docs/reference/source-list.md"
|
|
10
12
|
],
|
|
11
13
|
"exports": [
|
|
12
14
|
{
|
|
@@ -30,6 +32,7 @@
|
|
|
30
32
|
"@gridui/source-list/styles.css"
|
|
31
33
|
],
|
|
32
34
|
"examples": [
|
|
35
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/source-list/stories/references.mdx",
|
|
33
36
|
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/source-list/stories/source-list.stories.tsx"
|
|
34
37
|
]
|
|
35
38
|
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# SourceList
|
|
3
|
+
|
|
4
|
+
Displays references or supporting sources as a list. Use it to keep source titles and metadata close to the content they support.
|
|
5
|
+
|
|
6
|
+
Import from ``@gridui/source-list`` and load Theme before this family's stylesheet.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { SourceList } from "@gridui/source-list";
|
|
10
|
+
import "@gridui/theme/styles.css";
|
|
11
|
+
import "@gridui/source-list/styles.css";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/source-list/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/source-list/stories/source-list.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<HTMLOListElement, Element>): void`` · Optional
|
|
25
|
+
|
|
26
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
27
|
+
|
|
28
|
+
### onBlur
|
|
29
|
+
|
|
30
|
+
``(event: FocusEvent<HTMLOListElement, Element>): void`` · Optional
|
|
31
|
+
|
|
32
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
33
|
+
|
|
34
|
+
### onChange
|
|
35
|
+
|
|
36
|
+
``(event: ChangeEvent<HTMLOListElement, Element>): void`` · Optional
|
|
37
|
+
|
|
38
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
39
|
+
|
|
40
|
+
### onSubmit
|
|
41
|
+
|
|
42
|
+
``(event: SubmitEvent<HTMLOListElement>): void`` · Optional
|
|
43
|
+
|
|
44
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
45
|
+
|
|
46
|
+
### onClick
|
|
47
|
+
|
|
48
|
+
``(event: MouseEvent<HTMLOListElement, MouseEvent>): void`` · Optional
|
|
49
|
+
|
|
50
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
51
|
+
|
|
52
|
+
### sources
|
|
53
|
+
|
|
54
|
+
``readonly SourceItem[]`` · Required
|
|
55
|
+
|
|
56
|
+
### label
|
|
57
|
+
|
|
58
|
+
``string`` · Required
|
|
59
|
+
|
|
60
|
+
### emptyLabel
|
|
61
|
+
|
|
62
|
+
``string`` · Required
|
|
63
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridui/source-list",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "GridUI React source list",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -27,7 +27,7 @@
|
|
|
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
|
"class-variance-authority": "0.7.1"
|
|
33
33
|
},
|