@gridui/citation-popover 1.0.0 → 1.0.2
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 +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +2 -2
- package/dist/styles.css +10 -10
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -5,4 +5,4 @@ Dashboard family. Public API: `CitationPopover`, `CitationPopoverProps`.
|
|
|
5
5
|
Import components from `@gridui/citation-popover` and load `@gridui/citation-popover/styles.css` after Theme.
|
|
6
6
|
Load styles for any composed dependency used by this family. Applications own routes, labels, state persistence, and branding.
|
|
7
7
|
|
|
8
|
-
See [component ownership](
|
|
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-dashboard/citation-popover/.changeset/history).
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/citation-popover/style.ts
|
|
2
2
|
import { cva } from "class-variance-authority";
|
|
3
|
-
var citationStyles = cva("w-80 max-w-[calc(100vw-32px)] wrap-anywhere [&_a]:text-link");
|
|
4
|
-
var citationQuoteStyles = cva("mx-0 border-s-2 border-border ps-gridui-16 [&_mark]:bg-accent-background [&_mark]:text-accent-foreground");
|
|
3
|
+
var citationStyles = cva("gridui-u-w-80 gridui-u-max-w-[calc(100vw-32px)] gridui-u-wrap-anywhere gridui-u-[&_a]:text-link");
|
|
4
|
+
var citationQuoteStyles = cva("gridui-u-mx-0 gridui-u-border-s-2 gridui-u-border-border gridui-u-ps-gridui-16 gridui-u-[&_mark]:bg-accent-background gridui-u-[&_mark]:text-accent-foreground");
|
|
5
5
|
|
|
6
6
|
// src/citation-popover/citation-popover.tsx
|
|
7
7
|
import { Popover, PopoverPanel, PopoverTrigger } from "@gridui/popover";
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/citation-popover/style.ts", "../src/citation-popover/citation-popover.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * @author WMXPY\n * @package Citation Popover\n * @namespace CitationPopover\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const citationStyles = cva(\"w-80 max-w-[calc(100vw-32px)] wrap-anywhere [&_a]:text-link\");\n\nexport const citationQuoteStyles = cva(\"mx-0 border-s-2 border-border ps-gridui-16 [&_mark]:bg-accent-background [&_mark]:text-accent-foreground\");\n", "/**\n * @author WMXPY\n * @package Citation Popover\n * @namespace CitationPopover\n * @description Citation Popover\n */\n\nimport { citationQuoteStyles, citationStyles } from \"./style\";\nimport { Popover, PopoverPanel, PopoverTrigger } from \"@gridui/popover\";\nimport type { SourceItem } from \"@gridui/source-list\";\nimport { type FC, type ReactNode, useId } from \"react\";\n\nexport type CitationPopoverProps = {\n readonly source: SourceItem;\n readonly marker: ReactNode;\n readonly label: string;\n readonly openLabel: string;\n readonly quote?: string;\n readonly unmatchedLabel: string;\n};\n\nexport const CitationPopover: FC<CitationPopoverProps> = (props: CitationPopoverProps) => {\n const { source, marker, label, openLabel, quote, unmatchedLabel } = props;\n const id = useId();\n const excerpt = source.excerpt ?? \"\";\n const index = quote ? excerpt.indexOf(quote) : -1;\n return (<Popover>\n <PopoverTrigger\n aria-label={label}\n >\n {marker}\n </PopoverTrigger>\n <PopoverPanel\n aria-labelledby={id}\n className={citationStyles()}\n >\n <strong\n id={id}\n >\n {source.title}\n </strong>\n {source.description && (<p>\n {source.description}\n </p>)}\n {excerpt && (<blockquote\n className={citationQuoteStyles()}\n >\n {quote && index >= 0 ? (<>\n {excerpt.slice(0, index)}\n <mark>\n {quote}\n </mark>\n {excerpt.slice(index + quote.length)}\n </>) : excerpt}\n </blockquote>)}\n {quote && index < 0 && (<p\n role=\"status\"\n >\n {unmatchedLabel}\n </p>)}\n <a\n href={source.href}\n >\n {openLabel}\n </a>\n </PopoverPanel>\n </Popover>);\n};\n"],
|
|
5
|
-
"mappings": ";AAOA,SAAS,WAAW;AAEb,IAAM,iBAAiB,IAAI,
|
|
4
|
+
"sourcesContent": ["/**\n * @author WMXPY\n * @package Citation Popover\n * @namespace CitationPopover\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const citationStyles = cva(\"gridui-u-w-80 gridui-u-max-w-[calc(100vw-32px)] gridui-u-wrap-anywhere gridui-u-[&_a]:text-link\");\n\nexport const citationQuoteStyles = cva(\"gridui-u-mx-0 gridui-u-border-s-2 gridui-u-border-border gridui-u-ps-gridui-16 gridui-u-[&_mark]:bg-accent-background gridui-u-[&_mark]:text-accent-foreground\");\n", "/**\n * @author WMXPY\n * @package Citation Popover\n * @namespace CitationPopover\n * @description Citation Popover\n */\n\nimport { citationQuoteStyles, citationStyles } from \"./style\";\nimport { Popover, PopoverPanel, PopoverTrigger } from \"@gridui/popover\";\nimport type { SourceItem } from \"@gridui/source-list\";\nimport { type FC, type ReactNode, useId } from \"react\";\n\nexport type CitationPopoverProps = {\n readonly source: SourceItem;\n readonly marker: ReactNode;\n readonly label: string;\n readonly openLabel: string;\n readonly quote?: string;\n readonly unmatchedLabel: string;\n};\n\nexport const CitationPopover: FC<CitationPopoverProps> = (props: CitationPopoverProps) => {\n const { source, marker, label, openLabel, quote, unmatchedLabel } = props;\n const id = useId();\n const excerpt = source.excerpt ?? \"\";\n const index = quote ? excerpt.indexOf(quote) : -1;\n return (<Popover>\n <PopoverTrigger\n aria-label={label}\n >\n {marker}\n </PopoverTrigger>\n <PopoverPanel\n aria-labelledby={id}\n className={citationStyles()}\n >\n <strong\n id={id}\n >\n {source.title}\n </strong>\n {source.description && (<p>\n {source.description}\n </p>)}\n {excerpt && (<blockquote\n className={citationQuoteStyles()}\n >\n {quote && index >= 0 ? (<>\n {excerpt.slice(0, index)}\n <mark>\n {quote}\n </mark>\n {excerpt.slice(index + quote.length)}\n </>) : excerpt}\n </blockquote>)}\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AEZ;AAAA;AAAA,UACL;AAAA;AAAA;AAAA,IACJ;AAAA,KACJ;AACJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/styles.css
CHANGED
|
@@ -7,35 +7,35 @@
|
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
@layer utilities {
|
|
10
|
-
.mx-0 {
|
|
10
|
+
.gridui-u-mx-0 {
|
|
11
11
|
margin-inline: 0px;
|
|
12
12
|
}
|
|
13
|
-
.w-80 {
|
|
13
|
+
.gridui-u-w-80 {
|
|
14
14
|
width: calc(var(--spacing) * 80);
|
|
15
15
|
}
|
|
16
|
-
.max-w-\[calc\(100vw-32px\)\] {
|
|
16
|
+
.gridui-u-max-w-\[calc\(100vw-32px\)\] {
|
|
17
17
|
max-width: calc(100vw - 32px);
|
|
18
18
|
}
|
|
19
|
-
.border-s-2 {
|
|
19
|
+
.gridui-u-border-s-2 {
|
|
20
20
|
border-inline-start-style: var(--tw-border-style);
|
|
21
21
|
border-inline-start-width: 2px;
|
|
22
22
|
}
|
|
23
|
-
.border-border {
|
|
23
|
+
.gridui-u-border-border {
|
|
24
24
|
border-color: var(--gridui-border);
|
|
25
25
|
}
|
|
26
|
-
.ps-gridui-16 {
|
|
26
|
+
.gridui-u-ps-gridui-16 {
|
|
27
27
|
padding-inline-start: var(--gridui-space-16);
|
|
28
28
|
}
|
|
29
|
-
.wrap-anywhere {
|
|
29
|
+
.gridui-u-wrap-anywhere {
|
|
30
30
|
overflow-wrap: anywhere;
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
.gridui-u-\[\&_a\]\:text-link a {
|
|
33
33
|
color: var(--gridui-link);
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
.gridui-u-\[\&_mark\]\:bg-accent-background mark {
|
|
36
36
|
background-color: var(--gridui-accent-background);
|
|
37
37
|
}
|
|
38
|
-
|
|
38
|
+
.gridui-u-\[\&_mark\]\:text-accent-foreground mark {
|
|
39
39
|
color: var(--gridui-accent-foreground);
|
|
40
40
|
}
|
|
41
41
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridui/citation-popover",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "GridUI React citation popover",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -26,16 +26,17 @@
|
|
|
26
26
|
"react-dom": "^19.2.0"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@gridui/popover": "^1.
|
|
30
|
-
"@gridui/source-list": "^1.0.
|
|
31
|
-
"@gridui/theme": "^2.
|
|
29
|
+
"@gridui/popover": "^1.1.2",
|
|
30
|
+
"@gridui/source-list": "^1.0.2",
|
|
31
|
+
"@gridui/theme": "^2.3.2",
|
|
32
32
|
"class-variance-authority": "0.7.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@gridui-internal/configuration": "0.0.0",
|
|
35
|
+
"@gridui-internal/configuration": "0.0.0-internal",
|
|
36
36
|
"@jest/globals": "30.5.2",
|
|
37
|
+
"@storybook/react-vite": "10.6.5",
|
|
37
38
|
"@types/jest": "30.0.0",
|
|
38
|
-
"@types/node": "26.6.
|
|
39
|
+
"@types/node": "26.6.6",
|
|
39
40
|
"@types/react": "19.3.0",
|
|
40
41
|
"@types/react-dom": "19.3.0",
|
|
41
42
|
"jest": "30.5.2",
|