@gridui/citation-popover 1.0.4 → 1.0.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/index.js +2 -2
- package/dist/index.js.map +2 -2
- package/dist/styles.css +11 -11
- package/docs/catalog.json +1 -1
- package/package.json +3 -3
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("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");
|
|
3
|
+
var citationStyles = cva("gridui-u-citation-popover--w-80 gridui-u-citation-popover--max-w-[calc(100vw-32px)] gridui-u-citation-popover--wrap-anywhere gridui-u-citation-popover--[&_a]:text-link");
|
|
4
|
+
var citationQuoteStyles = cva("gridui-u-citation-popover--mx-0 gridui-u-citation-popover--border-s-2 gridui-u-citation-popover--border-border gridui-u-citation-popover--ps-gridui-16 gridui-u-citation-popover--[&_mark]:bg-accent-background gridui-u-citation-popover--[&_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(\"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>)}\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-citation-popover--w-80 gridui-u-citation-popover--max-w-[calc(100vw-32px)] gridui-u-citation-popover--wrap-anywhere gridui-u-citation-popover--[&_a]:text-link\");\n\nexport const citationQuoteStyles = cva(\"gridui-u-citation-popover--mx-0 gridui-u-citation-popover--border-s-2 gridui-u-citation-popover--border-border gridui-u-citation-popover--ps-gridui-16 gridui-u-citation-popover--[&_mark]:bg-accent-background gridui-u-citation-popover--[&_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 {open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
|
"names": []
|
|
7
7
|
}
|
package/dist/styles.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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 theme {
|
|
@@ -7,35 +7,35 @@
|
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
@layer utilities {
|
|
10
|
-
.gridui-u-mx-0 {
|
|
10
|
+
.gridui-u-citation-popover--mx-0 {
|
|
11
11
|
margin-inline: 0px;
|
|
12
12
|
}
|
|
13
|
-
.gridui-u-w-80 {
|
|
13
|
+
.gridui-u-citation-popover--w-80 {
|
|
14
14
|
width: calc(var(--spacing) * 80);
|
|
15
15
|
}
|
|
16
|
-
.gridui-u-max-w-\[calc\(100vw-32px\)\] {
|
|
16
|
+
.gridui-u-citation-popover--max-w-\[calc\(100vw-32px\)\] {
|
|
17
17
|
max-width: calc(100vw - 32px);
|
|
18
18
|
}
|
|
19
|
-
.gridui-u-border-s-2 {
|
|
19
|
+
.gridui-u-citation-popover--border-s-2 {
|
|
20
20
|
border-inline-start-style: var(--tw-border-style);
|
|
21
21
|
border-inline-start-width: 2px;
|
|
22
22
|
}
|
|
23
|
-
.gridui-u-border-border {
|
|
23
|
+
.gridui-u-citation-popover--border-border {
|
|
24
24
|
border-color: var(--gridui-border);
|
|
25
25
|
}
|
|
26
|
-
.gridui-u-ps-gridui-16 {
|
|
26
|
+
.gridui-u-citation-popover--ps-gridui-16 {
|
|
27
27
|
padding-inline-start: var(--gridui-space-16);
|
|
28
28
|
}
|
|
29
|
-
.gridui-u-wrap-anywhere {
|
|
29
|
+
.gridui-u-citation-popover--wrap-anywhere {
|
|
30
30
|
overflow-wrap: anywhere;
|
|
31
31
|
}
|
|
32
|
-
.gridui-u
|
|
32
|
+
.gridui-u-citation-popover--\[\&_a\]\:text-link a {
|
|
33
33
|
color: var(--gridui-link);
|
|
34
34
|
}
|
|
35
|
-
.gridui-u
|
|
35
|
+
.gridui-u-citation-popover--\[\&_mark\]\:bg-accent-background mark {
|
|
36
36
|
background-color: var(--gridui-accent-background);
|
|
37
37
|
}
|
|
38
|
-
.gridui-u
|
|
38
|
+
.gridui-u-citation-popover--\[\&_mark\]\:text-accent-foreground mark {
|
|
39
39
|
color: var(--gridui-accent-foreground);
|
|
40
40
|
}
|
|
41
41
|
}
|
package/docs/catalog.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridui/citation-popover",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "GridUI React citation popover",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"react-dom": "^19.2.0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@gridui/popover": "^1.1.
|
|
31
|
-
"@gridui/source-list": "^1.0.
|
|
30
|
+
"@gridui/popover": "^1.1.7",
|
|
31
|
+
"@gridui/source-list": "^1.0.5",
|
|
32
32
|
"@gridui/theme": "^2.5.3",
|
|
33
33
|
"class-variance-authority": "0.7.1"
|
|
34
34
|
},
|