@gridui/clipboard 1.1.0 → 2.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 +9 -2
- package/dist/copy-path/copy-path.d.ts +2 -0
- package/dist/index.js +5 -2
- package/dist/index.js.map +2 -2
- package/dist/styles.css +121 -100
- package/dist/styles.local.css +16 -19
- package/docs/catalog.json +6 -6
- package/docs/reference/copy-button.md +4 -4
- package/docs/reference/copy-path.md +10 -2
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# @gridui/clipboard
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Controls family. Public API: `CopyButton`, `CopyButtonProps`, `CopyPath`, `CopyPathProps`.
|
|
4
4
|
|
|
5
5
|
Import components from `@gridui/clipboard` and load `@gridui/clipboard/styles.css` after Theme.
|
|
6
6
|
Applications own routes, labels, state persistence, and branding.
|
|
7
7
|
|
|
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-
|
|
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-controls/clipboard/.changeset/history).
|
|
9
9
|
|
|
10
10
|
## Styles
|
|
11
11
|
|
|
@@ -36,3 +36,10 @@ padding or expands environment variables, usernames, or path placeholders.
|
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
[Component reference](docs/reference/README.md) contains focused API pages for each public component.
|
|
39
|
+
|
|
40
|
+
## Sizing and density
|
|
41
|
+
|
|
42
|
+
CopyButton inherits Button size, including extra-large. CopyPath accepts small, medium (default) or large for its path/action geometry; long paths remain readable and can grow the row.
|
|
43
|
+
|
|
44
|
+
See the [shared sizing contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/usage/sizing.md)
|
|
45
|
+
for native attributes, scope precedence, tokens and target behavior.
|
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
* @namespace CopyPath
|
|
5
5
|
* @description Copy Path
|
|
6
6
|
*/
|
|
7
|
+
import type { Size } from "@gridui/theme";
|
|
7
8
|
import type { CopyOptions } from "../shared/copy-options";
|
|
8
9
|
import { type FC } from "react";
|
|
9
10
|
export type CopyPathProps = CopyOptions & {
|
|
11
|
+
readonly size?: Size;
|
|
10
12
|
readonly label: string;
|
|
11
13
|
readonly copyLabel: string;
|
|
12
14
|
readonly frame?: "standalone" | "integrated";
|
package/dist/index.js
CHANGED
|
@@ -154,8 +154,8 @@ var CopyButton = (props) => {
|
|
|
154
154
|
import { cva as cva2 } from "class-variance-authority";
|
|
155
155
|
var copyPathStyles = cva2("gridui-copy-path gridui-u-clipboard--min-w-0 gridui-u-clipboard--rounded-none");
|
|
156
156
|
var copyPathRowStyles = cva2("gridui-u-clipboard--grid gridui-u-clipboard--min-w-0 gridui-u-clipboard--grid-cols-[minmax(0,1fr)_auto] gridui-u-clipboard--bg-surface");
|
|
157
|
-
var copyPathValueStyles = cva2("gridui-u-clipboard--min-w-0 gridui-u-clipboard--self-center gridui-u-clipboard--px-gridui-
|
|
158
|
-
var copyPathActionStyles = cva2("gridui-copy-path-action gridui-u-clipboard--flex gridui-u-clipboard--
|
|
157
|
+
var copyPathValueStyles = cva2("gridui-u-clipboard--min-w-0 gridui-u-clipboard--self-center gridui-u-clipboard--px-(--gridui-copy-inline) gridui-u-clipboard--py-(--gridui-copy-block) gridui-u-clipboard--type-code gridui-u-clipboard--text-foreground gridui-u-clipboard--wrap-anywhere gridui-u-clipboard--select-text");
|
|
158
|
+
var copyPathActionStyles = cva2("gridui-copy-path-action gridui-u-clipboard--flex gridui-u-clipboard--items-center gridui-u-clipboard--justify-center gridui-u-clipboard--gap-gridui-8 gridui-u-clipboard--rounded-none gridui-u-clipboard--bg-background gridui-u-clipboard--text-foreground gridui-u-clipboard--type-ui gridui-u-clipboard--cursor-pointer gridui-u-clipboard--[&_svg]:shrink-0");
|
|
159
159
|
var copyPathStatusStyles = cva2("gridui-u-clipboard--px-gridui-24 gridui-u-clipboard--py-gridui-8 gridui-u-clipboard--type-supporting gridui-u-clipboard--text-muted");
|
|
160
160
|
|
|
161
161
|
// src/copy-path/copy-path.tsx
|
|
@@ -166,6 +166,7 @@ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
|
166
166
|
var CopyPath = (props) => {
|
|
167
167
|
const {
|
|
168
168
|
value,
|
|
169
|
+
size = "medium",
|
|
169
170
|
label,
|
|
170
171
|
copyLabel,
|
|
171
172
|
copiedLabel,
|
|
@@ -193,6 +194,7 @@ var CopyPath = (props) => {
|
|
|
193
194
|
{
|
|
194
195
|
className: copyPathStyles(),
|
|
195
196
|
"data-frame": frame,
|
|
197
|
+
"data-size": size,
|
|
196
198
|
role: "group",
|
|
197
199
|
"aria-label": label,
|
|
198
200
|
children: [
|
|
@@ -212,6 +214,7 @@ var CopyPath = (props) => {
|
|
|
212
214
|
/* @__PURE__ */ jsx3(
|
|
213
215
|
Button2,
|
|
214
216
|
{
|
|
217
|
+
size,
|
|
215
218
|
type: "button",
|
|
216
219
|
className: copyPathActionStyles(),
|
|
217
220
|
variant: "quiet",
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/shared/copy-status.tsx", "../src/shared/clipboard.ts", "../src/shared/use-copy.ts", "../src/copy-button/copy-button.tsx", "../src/copy-path/style.ts", "../src/copy-path/copy-path.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * @author WMXPY\n * @package Clipboard\n * @namespace Shared\n * @description Copy Status\n */\n\nimport { cva } from \"class-variance-authority\";\nimport type { FC } from \"react\";\n\nconst copyStatusStyles = cva(\"gridui-copy-status\");\n\nexport type CopyStatusProps = {\n readonly copiedLabel: string;\n readonly failedLabel: string;\n readonly message: string;\n readonly className?: string;\n};\n\nexport const CopyStatus: FC<CopyStatusProps> = (props: CopyStatusProps) => {\n const { copiedLabel, failedLabel, message, className } = props;\n return (<span\n className={copyStatusStyles({ className })}\n >\n <span\n aria-hidden=\"true\"\n >\n {copiedLabel}\n </span>\n <span\n aria-hidden=\"true\"\n >\n {failedLabel}\n </span>\n <span\n role=\"status\"\n >\n {message}\n </span>\n </span>);\n};\n", "/**\n * @author WMXPY\n * @package Clipboard\n * @namespace Shared\n * @description Clipboard\n */\n\nexport const copyPath = async (value: string): Promise<boolean> => {\n try {\n await navigator.clipboard.writeText(value);\n return true;\n } catch {\n return false;\n }\n};\n", "/**\n * @author WMXPY\n * @package Clipboard\n * @namespace Shared\n * @description Use Copy\n */\n\nimport { copyPath } from \"./clipboard\";\nimport { useEffect, useRef, useState } from \"react\";\n\nexport const useCopy = (value: string) => {\n const [\n result,\n setResult,\n ] = useState<{\n value: string;\n success: boolean;\n } | null>(null);\n const [\n pending,\n setPending,\n ] = useState(false);\n const active = useRef(false);\n const mounted = useRef(true);\n const currentValue = useRef(value);\n currentValue.current = value;\n useEffect(() => {\n mounted.current = true;\n return () => {\n mounted.current = false;\n };\n }, []);\n const copy = async (): Promise<boolean | undefined> => {\n if (active.current) {\n return undefined;\n }\n active.current = true;\n setPending(true);\n const success = await copyPath(value);\n active.current = false;\n // Activity can disconnect effects while preserving pending state.\n setPending(false);\n if (!mounted.current) {\n return undefined;\n }\n if (value !== currentValue.current) {\n return undefined;\n }\n setResult({\n value,\n success,\n });\n return success;\n };\n return {\n pending,\n copy,\n result: result?.value === value ? result : null,\n };\n};\n", "/**\n * @author WMXPY\n * @package Clipboard\n * @namespace CopyButton\n * @description Copy Button\n */\n\nimport type { CopyOptions } from \"../shared/copy-options\";\nimport { CopyStatus } from \"../shared/copy-status\";\nimport { useCopy } from \"../shared/use-copy\";\nimport { Button, type ButtonProps, type ButtonVariants } from \"@gridui/button\";\nimport { Textarea } from \"@gridui/input\";\nimport { type FC, useEffect, useRef } from \"react\";\n\nexport type CopyButtonProps = Omit<ButtonProps, \"children\" | \"onClick\" | \"value\"> & ButtonVariants & CopyOptions & {\n readonly label: string;\n};\n\nexport const CopyButton: FC<CopyButtonProps> = (props: CopyButtonProps) => {\n const { value, label, copiedLabel, failedLabel, disabled, loading, ...restProps } = props;\n const { result: visibleResult, pending, copy } = useCopy(value);\n const manualCopyInput = useRef<HTMLTextAreaElement>(null);\n useEffect(() => {\n if (visibleResult && !visibleResult.success) {\n manualCopyInput.current?.focus();\n manualCopyInput.current?.select();\n }\n }, [visibleResult]);\n const message = visibleResult?.success ? copiedLabel : failedLabel;\n return (<span\n className=\"gridui-copy-button\"\n >\n <Button\n {...restProps}\n disabled={disabled}\n loading={loading || pending}\n onClick={() => {\n void copy();\n }}\n >\n {label}\n </Button>\n <CopyStatus\n copiedLabel={copiedLabel}\n failedLabel={failedLabel}\n message={visibleResult ? message : \"\"}\n />\n {visibleResult && !visibleResult.success && (<Textarea\n ref={manualCopyInput}\n aria-label={failedLabel}\n className=\"gridui-u-clipboard--col-span-full\"\n value={value}\n readOnly\n />)}\n </span>);\n};\n", "/**\n * @author WMXPY\n * @package Clipboard\n * @namespace CopyPath\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const copyPathStyles = cva(\"gridui-copy-path gridui-u-clipboard--min-w-0 gridui-u-clipboard--rounded-none\");\n\nexport const copyPathRowStyles = cva(\"gridui-u-clipboard--grid gridui-u-clipboard--min-w-0 gridui-u-clipboard--grid-cols-[minmax(0,1fr)_auto] gridui-u-clipboard--bg-surface\");\n\nexport const copyPathValueStyles = cva(\"gridui-u-clipboard--min-w-0 gridui-u-clipboard--self-center gridui-u-clipboard--px-gridui-
|
|
5
|
-
"mappings": ";AAOA,SAAS,WAAW;AAcR,SAGJ,KAHI;AAXZ,IAAM,mBAAmB,IAAI,oBAAoB;AAS1C,IAAM,aAAkC,CAAC,UAA2B;AACvE,QAAM,EAAE,aAAa,aAAa,SAA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AAEb,IAAM,iBAAiBA,KAAI,+EAA+E;AAE1G,IAAM,oBAAoBA,KAAI,wIAAwI;AAEtK,IAAM,sBAAsBA,KAAI,
|
|
4
|
+
"sourcesContent": ["/**\n * @author WMXPY\n * @package Clipboard\n * @namespace Shared\n * @description Copy Status\n */\n\nimport { cva } from \"class-variance-authority\";\nimport type { FC } from \"react\";\n\nconst copyStatusStyles = cva(\"gridui-copy-status\");\n\nexport type CopyStatusProps = {\n readonly copiedLabel: string;\n readonly failedLabel: string;\n readonly message: string;\n readonly className?: string;\n};\n\nexport const CopyStatus: FC<CopyStatusProps> = (props: CopyStatusProps) => {\n const { copiedLabel, failedLabel, message, className } = props;\n return (<span\n className={copyStatusStyles({ className })}\n >\n <span\n aria-hidden=\"true\"\n >\n {copiedLabel}\n </span>\n <span\n aria-hidden=\"true\"\n >\n {failedLabel}\n </span>\n <span\n role=\"status\"\n >\n {message}\n </span>\n </span>);\n};\n", "/**\n * @author WMXPY\n * @package Clipboard\n * @namespace Shared\n * @description Clipboard\n */\n\nexport const copyPath = async (value: string): Promise<boolean> => {\n try {\n await navigator.clipboard.writeText(value);\n return true;\n } catch {\n return false;\n }\n};\n", "/**\n * @author WMXPY\n * @package Clipboard\n * @namespace Shared\n * @description Use Copy\n */\n\nimport { copyPath } from \"./clipboard\";\nimport { useEffect, useRef, useState } from \"react\";\n\nexport const useCopy = (value: string) => {\n const [\n result,\n setResult,\n ] = useState<{\n value: string;\n success: boolean;\n } | null>(null);\n const [\n pending,\n setPending,\n ] = useState(false);\n const active = useRef(false);\n const mounted = useRef(true);\n const currentValue = useRef(value);\n currentValue.current = value;\n useEffect(() => {\n mounted.current = true;\n return () => {\n mounted.current = false;\n };\n }, []);\n const copy = async (): Promise<boolean | undefined> => {\n if (active.current) {\n return undefined;\n }\n active.current = true;\n setPending(true);\n const success = await copyPath(value);\n active.current = false;\n // Activity can disconnect effects while preserving pending state.\n setPending(false);\n if (!mounted.current) {\n return undefined;\n }\n if (value !== currentValue.current) {\n return undefined;\n }\n setResult({\n value,\n success,\n });\n return success;\n };\n return {\n pending,\n copy,\n result: result?.value === value ? result : null,\n };\n};\n", "/**\n * @author WMXPY\n * @package Clipboard\n * @namespace CopyButton\n * @description Copy Button\n */\n\nimport type { CopyOptions } from \"../shared/copy-options\";\nimport { CopyStatus } from \"../shared/copy-status\";\nimport { useCopy } from \"../shared/use-copy\";\nimport { Button, type ButtonProps, type ButtonVariants } from \"@gridui/button\";\nimport { Textarea } from \"@gridui/input\";\nimport { type FC, useEffect, useRef } from \"react\";\n\nexport type CopyButtonProps = Omit<ButtonProps, \"children\" | \"onClick\" | \"value\"> & ButtonVariants & CopyOptions & {\n readonly label: string;\n};\n\nexport const CopyButton: FC<CopyButtonProps> = (props: CopyButtonProps) => {\n const { value, label, copiedLabel, failedLabel, disabled, loading, ...restProps } = props;\n const { result: visibleResult, pending, copy } = useCopy(value);\n const manualCopyInput = useRef<HTMLTextAreaElement>(null);\n useEffect(() => {\n if (visibleResult && !visibleResult.success) {\n manualCopyInput.current?.focus();\n manualCopyInput.current?.select();\n }\n }, [visibleResult]);\n const message = visibleResult?.success ? copiedLabel : failedLabel;\n return (<span\n className=\"gridui-copy-button\"\n >\n <Button\n {...restProps}\n disabled={disabled}\n loading={loading || pending}\n onClick={() => {\n void copy();\n }}\n >\n {label}\n </Button>\n <CopyStatus\n copiedLabel={copiedLabel}\n failedLabel={failedLabel}\n message={visibleResult ? message : \"\"}\n />\n {visibleResult && !visibleResult.success && (<Textarea\n ref={manualCopyInput}\n aria-label={failedLabel}\n className=\"gridui-u-clipboard--col-span-full\"\n value={value}\n readOnly\n />)}\n </span>);\n};\n", "/**\n * @author WMXPY\n * @package Clipboard\n * @namespace CopyPath\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const copyPathStyles = cva(\"gridui-copy-path gridui-u-clipboard--min-w-0 gridui-u-clipboard--rounded-none\");\n\nexport const copyPathRowStyles = cva(\"gridui-u-clipboard--grid gridui-u-clipboard--min-w-0 gridui-u-clipboard--grid-cols-[minmax(0,1fr)_auto] gridui-u-clipboard--bg-surface\");\n\nexport const copyPathValueStyles = cva(\"gridui-u-clipboard--min-w-0 gridui-u-clipboard--self-center gridui-u-clipboard--px-(--gridui-copy-inline) gridui-u-clipboard--py-(--gridui-copy-block) gridui-u-clipboard--type-code gridui-u-clipboard--text-foreground gridui-u-clipboard--wrap-anywhere gridui-u-clipboard--select-text\");\n\nexport const copyPathActionStyles = cva(\"gridui-copy-path-action gridui-u-clipboard--flex gridui-u-clipboard--items-center gridui-u-clipboard--justify-center gridui-u-clipboard--gap-gridui-8 gridui-u-clipboard--rounded-none gridui-u-clipboard--bg-background gridui-u-clipboard--text-foreground gridui-u-clipboard--type-ui gridui-u-clipboard--cursor-pointer gridui-u-clipboard--[&_svg]:shrink-0\");\n\nexport const copyPathStatusStyles = cva(\"gridui-u-clipboard--px-gridui-24 gridui-u-clipboard--py-gridui-8 gridui-u-clipboard--type-supporting gridui-u-clipboard--text-muted\");\n", "/**\n * @author WMXPY\n * @package Clipboard\n * @namespace CopyPath\n * @description Copy Path\n */\n\nimport type { Size } from \"@gridui/theme\";\nimport type { CopyOptions } from \"../shared/copy-options\";\nimport { CopyStatus } from \"../shared/copy-status\";\nimport { useCopy } from \"../shared/use-copy\";\nimport { copyPathActionStyles, copyPathRowStyles, copyPathStatusStyles, copyPathStyles, copyPathValueStyles } from \"./style\";\nimport { Button } from \"@gridui/button\";\nimport { Check, Copy } from \"lucide-react\";\nimport { type FC, useRef } from \"react\";\n\nexport type CopyPathProps = CopyOptions & {\n readonly size?: Size;\n readonly label: string;\n readonly copyLabel: string;\n readonly frame?: \"standalone\" | \"integrated\";\n};\n\nexport const CopyPath: FC<CopyPathProps> = (props: CopyPathProps) => {\n const {\n value,\n size = \"medium\",\n label,\n copyLabel,\n copiedLabel,\n failedLabel,\n frame = \"standalone\",\n } = props;\n const { pending, result, copy } = useCopy(value);\n const code = useRef<HTMLElement>(null);\n let statusLabel = \"\";\n if (result) {\n statusLabel = result.success ? copiedLabel : failedLabel;\n }\n const copyValue = async (): Promise<void> => {\n const success = await copy();\n if (success === false && code.current?.textContent === value) {\n const range = document.createRange();\n range.selectNodeContents(code.current);\n const selection = window.getSelection();\n selection?.removeAllRanges();\n selection?.addRange(range);\n }\n };\n return (<div\n className={copyPathStyles()}\n data-frame={frame}\n data-size={size}\n role=\"group\"\n aria-label={label}\n >\n <div\n className={copyPathRowStyles()}\n >\n <code\n ref={code}\n className={copyPathValueStyles()}\n >\n {value}\n </code>\n <Button\n size={size}\n type=\"button\"\n className={copyPathActionStyles()}\n variant=\"quiet\"\n loading={pending}\n startIcon={result?.success ? (<Check\n aria-hidden=\"true\"\n />) : (<Copy\n aria-hidden=\"true\"\n />)}\n onClick={() => {\n void copyValue();\n }}\n >\n {copyLabel}\n </Button>\n </div>\n <CopyStatus\n copiedLabel={copiedLabel}\n failedLabel={failedLabel}\n message={statusLabel}\n className={copyPathStatusStyles()}\n />\n </div>);\n};\n"],
|
|
5
|
+
"mappings": ";AAOA,SAAS,WAAW;AAcR,SAGJ,KAHI;AAXZ,IAAM,mBAAmB,IAAI,oBAAoB;AAS1C,IAAM,aAAkC,CAAC,UAA2B;AACvE,QAAM,EAAE,aAAa,aAAa,SAAS,UAAU,IAAI;AACzD,SAAQ;AAAA,IAAC;AAAA;AAAA,MACL,WAAW,iBAAiB,EAAE,UAAU,CAAC;AAAA,MAEzC;AAAA;AAAA,UAAC;AAAA;AAAA,YACG,eAAY;AAAA,YAEX;AAAA;AAAA,QACL;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACG,eAAY;AAAA,YAEX;AAAA;AAAA,QACL;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACG,MAAK;AAAA,YAEJ;AAAA;AAAA,QACL;AAAA;AAAA;AAAA,EACJ;AACJ;;;ACjCO,IAAM,WAAW,OAAO,UAAoC;AAC/D,MAAI;AACA,UAAM,UAAU,UAAU,UAAU,KAAK;AACzC,WAAO;AAA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AAAA;AAAA,YACG;AAAA,YACA;AAAA,YACA,SAAS;AAAA,YACT,WAAW,qBAAqB;AAAA;AAAA,QACpC;AAAA;AAAA;AAAA,EACJ;AACJ;",
|
|
6
6
|
"names": ["useEffect", "useRef", "jsx", "jsxs", "cva", "Button", "useRef", "jsx", "jsxs"]
|
|
7
7
|
}
|
package/dist/styles.css
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
2
2
|
@layer properties;
|
|
3
3
|
@layer theme, base, components, utilities;
|
|
4
|
-
@layer theme {
|
|
5
|
-
:root, :host {
|
|
6
|
-
--spacing: 0.25rem;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
4
|
@layer utilities {
|
|
10
5
|
.gridui-u-button--pointer-events-none {
|
|
11
6
|
pointer-events: none;
|
|
@@ -13,24 +8,13 @@
|
|
|
13
8
|
.gridui-u-button--inline-flex {
|
|
14
9
|
display: inline-flex;
|
|
15
10
|
}
|
|
11
|
+
.gridui-u-button--size-\(--_gridui-button-min\) {
|
|
12
|
+
width: var(--_gridui-button-min);
|
|
13
|
+
height: var(--_gridui-button-min);
|
|
14
|
+
}
|
|
16
15
|
.gridui-u-button--h-full {
|
|
17
16
|
height: 100%;
|
|
18
17
|
}
|
|
19
|
-
.gridui-u-button--h-gridui-control {
|
|
20
|
-
height: var(--gridui-control-min-height);
|
|
21
|
-
}
|
|
22
|
-
.gridui-u-button--min-h-18 {
|
|
23
|
-
min-height: calc(var(--spacing) * 18);
|
|
24
|
-
}
|
|
25
|
-
.gridui-u-button--min-h-gridui-control {
|
|
26
|
-
min-height: var(--gridui-control-min-height);
|
|
27
|
-
}
|
|
28
|
-
.gridui-u-button--min-h-gridui-control-large {
|
|
29
|
-
min-height: var(--gridui-control-min-height-large);
|
|
30
|
-
}
|
|
31
|
-
.gridui-u-button--min-h-gridui-control-small {
|
|
32
|
-
min-height: var(--gridui-control-min-height-small);
|
|
33
|
-
}
|
|
34
18
|
.gridui-u-button--w-fit {
|
|
35
19
|
width: fit-content;
|
|
36
20
|
}
|
|
@@ -40,14 +24,14 @@
|
|
|
40
24
|
.gridui-u-button--w-gridui-64 {
|
|
41
25
|
width: var(--gridui-space-64);
|
|
42
26
|
}
|
|
43
|
-
.gridui-u-button--w-gridui-control {
|
|
44
|
-
width: var(--gridui-control-min-height);
|
|
45
|
-
}
|
|
46
27
|
.gridui-u-button--w-gridui-control-large {
|
|
47
|
-
width: var(--gridui-control-min-height-large);
|
|
28
|
+
width: max(var(--gridui-control-min-height-large), var(--gridui-target-min-size));
|
|
29
|
+
}
|
|
30
|
+
.gridui-u-button--w-gridui-control-medium {
|
|
31
|
+
width: max(var(--gridui-control-min-height-medium), var(--gridui-target-min-size));
|
|
48
32
|
}
|
|
49
33
|
.gridui-u-button--w-gridui-control-small {
|
|
50
|
-
width: var(--gridui-control-min-height-small);
|
|
34
|
+
width: max(var(--gridui-control-min-height-small), var(--gridui-target-min-size));
|
|
51
35
|
}
|
|
52
36
|
.gridui-u-button--max-w-full {
|
|
53
37
|
max-width: 100%;
|
|
@@ -253,35 +237,10 @@
|
|
|
253
237
|
.gridui-u-button--\[\&_svg\]\:shrink-0 svg {
|
|
254
238
|
flex-shrink: 0;
|
|
255
239
|
}
|
|
256
|
-
.gridui-u-button--\[\&\.gridui-button-extra-large\]\:h-18.gridui-button-extra-large {
|
|
257
|
-
height: calc(var(--spacing) * 18);
|
|
258
|
-
}
|
|
259
|
-
.gridui-u-button--\[\&\.gridui-button-extra-large\]\:w-18.gridui-button-extra-large {
|
|
260
|
-
width: calc(var(--spacing) * 18);
|
|
261
|
-
}
|
|
262
|
-
.gridui-u-button--\[\&\.gridui-button-large\]\:h-gridui-control-large.gridui-button-large {
|
|
263
|
-
height: var(--gridui-control-min-height-large);
|
|
264
|
-
}
|
|
265
|
-
.gridui-u-button--\[\&\.gridui-button-large\]\:w-gridui-control-large.gridui-button-large {
|
|
266
|
-
width: var(--gridui-control-min-height-large);
|
|
267
|
-
}
|
|
268
|
-
.gridui-u-button--\[\&\.gridui-button-small\]\:h-gridui-control-small.gridui-button-small {
|
|
269
|
-
height: var(--gridui-control-min-height-small);
|
|
270
|
-
}
|
|
271
|
-
.gridui-u-button--\[\&\.gridui-button-small\]\:w-gridui-control-small.gridui-button-small {
|
|
272
|
-
width: var(--gridui-control-min-height-small);
|
|
273
|
-
}
|
|
274
|
-
@media (pointer: coarse) {
|
|
275
|
-
.gridui-u-button--pointer-coarse\:\[\&\.gridui-button-small\]\:h-gridui-control.gridui-button-small {
|
|
276
|
-
height: var(--gridui-control-min-height);
|
|
277
|
-
}
|
|
278
|
-
.gridui-u-button--pointer-coarse\:\[\&\.gridui-button-small\]\:w-gridui-control.gridui-button-small {
|
|
279
|
-
width: var(--gridui-control-min-height);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
240
|
}
|
|
283
241
|
@layer components {
|
|
284
242
|
.gridui-button {
|
|
243
|
+
min-height: var(--_gridui-button-min);
|
|
285
244
|
border: 1px solid transparent;
|
|
286
245
|
}
|
|
287
246
|
.gridui-button-cell {
|
|
@@ -327,8 +286,27 @@
|
|
|
327
286
|
transform: var(--gridui-motion-transform, translate(calc(-1 * var(--gridui-space-4)), calc(-1 * var(--gridui-space-4))));
|
|
328
287
|
}
|
|
329
288
|
}
|
|
289
|
+
.gridui-button-medium {
|
|
290
|
+
--_gridui-button-min: max(var(--gridui-control-min-height-medium), var(--gridui-target-min-size));
|
|
291
|
+
padding-block: var(--gridui-space-8);
|
|
292
|
+
padding-inline: var(--gridui-space-16);
|
|
293
|
+
}
|
|
294
|
+
.gridui-button-small {
|
|
295
|
+
--_gridui-button-min: max(var(--gridui-control-min-height-small), var(--gridui-target-min-size));
|
|
296
|
+
padding-block: var(--gridui-space-4);
|
|
297
|
+
padding-inline: var(--gridui-space-8);
|
|
298
|
+
}
|
|
299
|
+
.gridui-button-large {
|
|
300
|
+
--_gridui-button-min: max(var(--gridui-control-min-height-large), var(--gridui-target-min-size));
|
|
301
|
+
padding-block: var(--gridui-space-8);
|
|
302
|
+
padding-inline: var(--gridui-space-24);
|
|
303
|
+
}
|
|
304
|
+
.gridui-button-extra-large {
|
|
305
|
+
--_gridui-button-min: max(var(--gridui-control-min-height-extra-large), var(--gridui-target-min-size));
|
|
306
|
+
padding-block: var(--gridui-space-16);
|
|
307
|
+
padding-inline: var(--gridui-space-24);
|
|
308
|
+
}
|
|
330
309
|
.gridui-button-group {
|
|
331
|
-
--gridui-button-group-padding-block: var(--gridui-space-24);
|
|
332
310
|
container: gridui-button-group / inline-size;
|
|
333
311
|
min-width: 0;
|
|
334
312
|
}
|
|
@@ -371,12 +349,19 @@
|
|
|
371
349
|
min-width: 0;
|
|
372
350
|
}
|
|
373
351
|
.gridui-button-group-items[data-layout="cells"] > [data-gridui-button-group-item] {
|
|
374
|
-
|
|
375
|
-
padding: var(--gridui-button-group-padding-block) var(--gridui-space-24);
|
|
352
|
+
padding-block: var(--gridui-button-group-padding-block, var(--_gridui-button-group-block, var(--gridui-space-8)));
|
|
376
353
|
border: 0;
|
|
377
354
|
border-radius: 0;
|
|
378
355
|
}
|
|
379
356
|
}
|
|
357
|
+
@layer components {
|
|
358
|
+
.gridui-button-group-items > [data-size="small"] {
|
|
359
|
+
--_gridui-button-group-block: var(--gridui-space-4);
|
|
360
|
+
}
|
|
361
|
+
.gridui-button-group-items > [data-size="extra-large"] {
|
|
362
|
+
--_gridui-button-group-block: var(--gridui-space-16);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
380
365
|
@property --tw-border-style {
|
|
381
366
|
syntax: "*";
|
|
382
367
|
inherits: false;
|
|
@@ -403,11 +388,6 @@
|
|
|
403
388
|
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
404
389
|
@layer properties;
|
|
405
390
|
@layer theme, base, components, utilities;
|
|
406
|
-
@layer theme {
|
|
407
|
-
:root, :host {
|
|
408
|
-
--spacing: 0.25rem;
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
391
|
@layer utilities {
|
|
412
392
|
.gridui-u-overlay--z-\(--gridui-z-popover\) {
|
|
413
393
|
z-index: var(--gridui-z-popover);
|
|
@@ -422,9 +402,6 @@
|
|
|
422
402
|
width: var(--gridui-space-16);
|
|
423
403
|
height: var(--gridui-space-16);
|
|
424
404
|
}
|
|
425
|
-
.gridui-u-overlay--min-h-10 {
|
|
426
|
-
min-height: calc(var(--spacing) * 10);
|
|
427
|
-
}
|
|
428
405
|
.gridui-u-overlay--min-w-0 {
|
|
429
406
|
min-width: 0px;
|
|
430
407
|
}
|
|
@@ -463,15 +440,9 @@
|
|
|
463
440
|
.gridui-u-overlay--p-0 {
|
|
464
441
|
padding: 0px;
|
|
465
442
|
}
|
|
466
|
-
.gridui-u-overlay--p-gridui-8 {
|
|
467
|
-
padding: var(--gridui-space-8);
|
|
468
|
-
}
|
|
469
443
|
.gridui-u-overlay--px-gridui-8 {
|
|
470
444
|
padding-inline: var(--gridui-space-8);
|
|
471
445
|
}
|
|
472
|
-
.gridui-u-overlay--py-gridui-8 {
|
|
473
|
-
padding-block: var(--gridui-space-8);
|
|
474
|
-
}
|
|
475
446
|
.gridui-u-overlay--type-data {
|
|
476
447
|
font: var(--gridui-type-data);
|
|
477
448
|
font-family: var(--gridui-font-body);
|
|
@@ -578,6 +549,25 @@
|
|
|
578
549
|
animation: none;
|
|
579
550
|
}
|
|
580
551
|
}
|
|
552
|
+
.gridui-overlay-list {
|
|
553
|
+
--gridui-overlay-row-min: var(--gridui-control-min-height-medium);
|
|
554
|
+
--gridui-overlay-row-padding: var(--gridui-space-8);
|
|
555
|
+
}
|
|
556
|
+
.gridui-overlay-density-compact {
|
|
557
|
+
--gridui-overlay-row-min: var(--gridui-control-min-height-small);
|
|
558
|
+
--gridui-overlay-row-padding: var(--gridui-space-4);
|
|
559
|
+
}
|
|
560
|
+
.gridui-overlay-density-comfortable {
|
|
561
|
+
--gridui-overlay-row-min: var(--gridui-control-min-height-medium);
|
|
562
|
+
--gridui-overlay-row-padding: var(--gridui-space-8);
|
|
563
|
+
}
|
|
564
|
+
.gridui-overlay-list-item {
|
|
565
|
+
min-block-size: max(var(--gridui-overlay-row-min, var(--gridui-control-min-height-medium)), var(--gridui-target-min-size));
|
|
566
|
+
padding-block: var(--gridui-overlay-row-padding, var(--gridui-space-8));
|
|
567
|
+
}
|
|
568
|
+
.gridui-overlay-list-label {
|
|
569
|
+
padding-block: var(--gridui-overlay-row-padding, var(--gridui-space-8));
|
|
570
|
+
}
|
|
581
571
|
}
|
|
582
572
|
@property --tw-border-style {
|
|
583
573
|
syntax: "*";
|
|
@@ -602,11 +592,14 @@
|
|
|
602
592
|
.gridui-u-input--inline-flex {
|
|
603
593
|
display: inline-flex;
|
|
604
594
|
}
|
|
605
|
-
.gridui-u-input--min-h-gridui-control {
|
|
606
|
-
min-height: var(--gridui-control-min-height);
|
|
595
|
+
.gridui-u-input--min-h-gridui-control-large {
|
|
596
|
+
min-height: max(var(--gridui-control-min-height-large), var(--gridui-target-min-size));
|
|
597
|
+
}
|
|
598
|
+
.gridui-u-input--min-h-gridui-control-medium {
|
|
599
|
+
min-height: max(var(--gridui-control-min-height-medium), var(--gridui-target-min-size));
|
|
607
600
|
}
|
|
608
601
|
.gridui-u-input--min-h-gridui-control-small {
|
|
609
|
-
min-height: var(--gridui-control-min-height-small);
|
|
602
|
+
min-height: max(var(--gridui-control-min-height-small), var(--gridui-target-min-size));
|
|
610
603
|
}
|
|
611
604
|
.gridui-u-input--w-0 {
|
|
612
605
|
width: 0px;
|
|
@@ -665,9 +658,15 @@
|
|
|
665
658
|
.gridui-u-input--px-gridui-8 {
|
|
666
659
|
padding-inline: var(--gridui-space-8);
|
|
667
660
|
}
|
|
661
|
+
.gridui-u-input--px-gridui-16 {
|
|
662
|
+
padding-inline: var(--gridui-space-16);
|
|
663
|
+
}
|
|
668
664
|
.gridui-u-input--py-gridui-4 {
|
|
669
665
|
padding-block: var(--gridui-space-4);
|
|
670
666
|
}
|
|
667
|
+
.gridui-u-input--py-gridui-8 {
|
|
668
|
+
padding-block: var(--gridui-space-8);
|
|
669
|
+
}
|
|
671
670
|
.gridui-u-input--type-input {
|
|
672
671
|
font: var(--gridui-type-input);
|
|
673
672
|
font-family: var(--gridui-font-body);
|
|
@@ -681,6 +680,21 @@
|
|
|
681
680
|
.gridui-u-input--text-foreground {
|
|
682
681
|
color: var(--gridui-foreground);
|
|
683
682
|
}
|
|
683
|
+
.gridui-u-input--\[--gridui-control-icon\:var\(--gridui-icon-size\)\] {
|
|
684
|
+
--gridui-control-icon: var(--gridui-icon-size);
|
|
685
|
+
}
|
|
686
|
+
.gridui-u-input--\[--gridui-control-icon\:var\(--gridui-icon-size-large\)\] {
|
|
687
|
+
--gridui-control-icon: var(--gridui-icon-size-large);
|
|
688
|
+
}
|
|
689
|
+
.gridui-u-input--\[--gridui-control-size\:max\(var\(--gridui-control-min-height-large\)\,var\(--gridui-target-min-size\)\)\] {
|
|
690
|
+
--gridui-control-size: max(var(--gridui-control-min-height-large), var(--gridui-target-min-size));
|
|
691
|
+
}
|
|
692
|
+
.gridui-u-input--\[--gridui-control-size\:max\(var\(--gridui-control-min-height-medium\)\,var\(--gridui-target-min-size\)\)\] {
|
|
693
|
+
--gridui-control-size: max(var(--gridui-control-min-height-medium), var(--gridui-target-min-size));
|
|
694
|
+
}
|
|
695
|
+
.gridui-u-input--\[--gridui-control-size\:max\(var\(--gridui-control-min-height-small\)\,var\(--gridui-target-min-size\)\)\] {
|
|
696
|
+
--gridui-control-size: max(var(--gridui-control-min-height-small), var(--gridui-target-min-size));
|
|
697
|
+
}
|
|
684
698
|
.gridui-u-input--disabled\:cursor-not-allowed:disabled {
|
|
685
699
|
cursor: not-allowed;
|
|
686
700
|
}
|
|
@@ -690,6 +704,10 @@
|
|
|
690
704
|
.gridui-u-input--aria-invalid\:border-status-danger-border[aria-invalid="true"] {
|
|
691
705
|
border-color: var(--gridui-status-danger-border);
|
|
692
706
|
}
|
|
707
|
+
.gridui-u-input--\[\&_svg\]\:size-\(--gridui-control-icon\) svg {
|
|
708
|
+
width: var(--gridui-control-icon);
|
|
709
|
+
height: var(--gridui-control-icon);
|
|
710
|
+
}
|
|
693
711
|
.gridui-u-input--\[\&\>svg\]\:size-gridui-16 > svg {
|
|
694
712
|
width: var(--gridui-space-16);
|
|
695
713
|
height: var(--gridui-space-16);
|
|
@@ -697,7 +715,7 @@
|
|
|
697
715
|
}
|
|
698
716
|
@layer components {
|
|
699
717
|
.gridui-input-group {
|
|
700
|
-
--_gridui-input-height: var(--gridui-control-min-height);
|
|
718
|
+
--_gridui-input-height: max(var(--gridui-control-min-height-medium), var(--gridui-target-min-size));
|
|
701
719
|
position: relative;
|
|
702
720
|
display: flex;
|
|
703
721
|
flex-wrap: wrap;
|
|
@@ -710,8 +728,8 @@
|
|
|
710
728
|
border-radius: var(--gridui-control-radius);
|
|
711
729
|
color: var(--gridui-foreground);
|
|
712
730
|
background: var(--gridui-background);
|
|
713
|
-
&[data-
|
|
714
|
-
--_gridui-input-height: var(--gridui-control-min-height-small);
|
|
731
|
+
&[data-size="small"] {
|
|
732
|
+
--_gridui-input-height: max(var(--gridui-control-min-height-small), var(--gridui-target-min-size));
|
|
715
733
|
}
|
|
716
734
|
> .gridui-control {
|
|
717
735
|
flex: 1;
|
|
@@ -767,9 +785,12 @@
|
|
|
767
785
|
.gridui-input-group-button {
|
|
768
786
|
flex: none;
|
|
769
787
|
}
|
|
788
|
+
.gridui-input-group[data-size="large"] {
|
|
789
|
+
--_gridui-input-height: max(var(--gridui-control-min-height-large), var(--gridui-target-min-size));
|
|
790
|
+
}
|
|
770
791
|
.gridui-textarea-frame {
|
|
771
792
|
--_gridui-textarea-padding: var(--gridui-space-8);
|
|
772
|
-
--_gridui-textarea-control-minimum: var(--gridui-control-min-height);
|
|
793
|
+
--_gridui-textarea-control-minimum: max(var(--gridui-control-min-height-medium), var(--gridui-target-min-size));
|
|
773
794
|
--_gridui-textarea-resize-height: 0px;
|
|
774
795
|
--_gridui-textarea-footer-height: 0px;
|
|
775
796
|
--_gridui-textarea-border: 2px;
|
|
@@ -780,9 +801,9 @@
|
|
|
780
801
|
flex-direction: column;
|
|
781
802
|
min-height: calc(var(--_gridui-textarea-min-body) + var(--_gridui-textarea-chrome));
|
|
782
803
|
padding: 0;
|
|
783
|
-
&[data-
|
|
804
|
+
&[data-size="small"] {
|
|
784
805
|
--_gridui-textarea-padding: var(--gridui-space-4);
|
|
785
|
-
--_gridui-textarea-control-minimum: var(--gridui-control-min-height-small);
|
|
806
|
+
--_gridui-textarea-control-minimum: max(var(--gridui-control-min-height-small), var(--gridui-target-min-size));
|
|
786
807
|
}
|
|
787
808
|
&[data-grouped] {
|
|
788
809
|
--_gridui-textarea-border: 0px;
|
|
@@ -794,7 +815,7 @@
|
|
|
794
815
|
--_gridui-textarea-resize-height: var(--gridui-space-32);
|
|
795
816
|
}
|
|
796
817
|
&:is([data-resize-handle="footer"], [data-footer]) {
|
|
797
|
-
--_gridui-textarea-footer-height: var(--gridui-control-min-height);
|
|
818
|
+
--_gridui-textarea-footer-height: max(var(--gridui-control-min-height-medium), var(--gridui-target-min-size));
|
|
798
819
|
}
|
|
799
820
|
&[data-max-rows] {
|
|
800
821
|
max-height: calc(var(--_gridui-textarea-max-rows) * 1lh + 2 * var(--_gridui-textarea-padding) + var(--_gridui-textarea-chrome));
|
|
@@ -850,7 +871,7 @@
|
|
|
850
871
|
display: flex;
|
|
851
872
|
flex: none;
|
|
852
873
|
align-items: stretch;
|
|
853
|
-
min-height: var(--gridui-control-min-height);
|
|
874
|
+
min-height: max(var(--gridui-control-min-height-medium), var(--gridui-target-min-size));
|
|
854
875
|
border-top: 1px solid;
|
|
855
876
|
border-color: inherit;
|
|
856
877
|
background: var(--gridui-surface);
|
|
@@ -870,7 +891,7 @@
|
|
|
870
891
|
flex: none;
|
|
871
892
|
align-items: center;
|
|
872
893
|
justify-content: center;
|
|
873
|
-
width: var(--gridui-control-min-height);
|
|
894
|
+
width: max(var(--gridui-control-min-height-medium), var(--gridui-target-min-size));
|
|
874
895
|
margin: 0;
|
|
875
896
|
padding: 0;
|
|
876
897
|
border: 0;
|
|
@@ -909,9 +930,12 @@
|
|
|
909
930
|
}
|
|
910
931
|
@media (pointer: coarse) {
|
|
911
932
|
.gridui-textarea-frame:is([data-resize-handle="corner"], [data-resize-handle="edge"]) {
|
|
912
|
-
--_gridui-textarea-resize-height: var(--gridui-control-min-height);
|
|
933
|
+
--_gridui-textarea-resize-height: max(var(--gridui-control-min-height-medium), var(--gridui-target-min-size));
|
|
913
934
|
}
|
|
914
935
|
}
|
|
936
|
+
.gridui-textarea-frame[data-size="large"] {
|
|
937
|
+
--_gridui-textarea-control-minimum: max(var(--gridui-control-min-height-large), var(--gridui-target-min-size));
|
|
938
|
+
}
|
|
915
939
|
.gridui-input-group > input[type="search"]::-webkit-search-cancel-button {
|
|
916
940
|
appearance: none;
|
|
917
941
|
}
|
|
@@ -931,11 +955,6 @@
|
|
|
931
955
|
|
|
932
956
|
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
933
957
|
@layer theme, base, components, utilities;
|
|
934
|
-
@layer theme {
|
|
935
|
-
:root, :host {
|
|
936
|
-
--spacing: 0.25rem;
|
|
937
|
-
}
|
|
938
|
-
}
|
|
939
958
|
@layer utilities {
|
|
940
959
|
.gridui-u-clipboard--col-span-full {
|
|
941
960
|
grid-column: 1 / -1;
|
|
@@ -946,9 +965,6 @@
|
|
|
946
965
|
.gridui-u-clipboard--grid {
|
|
947
966
|
display: grid;
|
|
948
967
|
}
|
|
949
|
-
.gridui-u-clipboard--min-h-11 {
|
|
950
|
-
min-height: calc(var(--spacing) * 11);
|
|
951
|
-
}
|
|
952
968
|
.gridui-u-clipboard--min-w-0 {
|
|
953
969
|
min-width: 0px;
|
|
954
970
|
}
|
|
@@ -979,18 +995,18 @@
|
|
|
979
995
|
.gridui-u-clipboard--bg-surface {
|
|
980
996
|
background-color: var(--gridui-surface);
|
|
981
997
|
}
|
|
982
|
-
.gridui-u-clipboard--px
|
|
983
|
-
padding-inline: var(--gridui-
|
|
998
|
+
.gridui-u-clipboard--px-\(--gridui-copy-inline\) {
|
|
999
|
+
padding-inline: var(--gridui-copy-inline);
|
|
984
1000
|
}
|
|
985
1001
|
.gridui-u-clipboard--px-gridui-24 {
|
|
986
1002
|
padding-inline: var(--gridui-space-24);
|
|
987
1003
|
}
|
|
1004
|
+
.gridui-u-clipboard--py-\(--gridui-copy-block\) {
|
|
1005
|
+
padding-block: var(--gridui-copy-block);
|
|
1006
|
+
}
|
|
988
1007
|
.gridui-u-clipboard--py-gridui-8 {
|
|
989
1008
|
padding-block: var(--gridui-space-8);
|
|
990
1009
|
}
|
|
991
|
-
.gridui-u-clipboard--py-gridui-16 {
|
|
992
|
-
padding-block: var(--gridui-space-16);
|
|
993
|
-
}
|
|
994
1010
|
.gridui-u-clipboard--type-code {
|
|
995
1011
|
font: var(--gridui-type-code);
|
|
996
1012
|
font-family: var(--gridui-font-mono);
|
|
@@ -1019,12 +1035,6 @@
|
|
|
1019
1035
|
-webkit-user-select: text;
|
|
1020
1036
|
user-select: text;
|
|
1021
1037
|
}
|
|
1022
|
-
.gridui-u-clipboard--\[\&_svg\]\:h-gridui-16 svg {
|
|
1023
|
-
height: var(--gridui-space-16);
|
|
1024
|
-
}
|
|
1025
|
-
.gridui-u-clipboard--\[\&_svg\]\:w-gridui-16 svg {
|
|
1026
|
-
width: var(--gridui-space-16);
|
|
1027
|
-
}
|
|
1028
1038
|
.gridui-u-clipboard--\[\&_svg\]\:shrink-0 svg {
|
|
1029
1039
|
flex-shrink: 0;
|
|
1030
1040
|
}
|
|
@@ -1043,6 +1053,17 @@
|
|
|
1043
1053
|
border: 0;
|
|
1044
1054
|
border-inline-start: 1px solid var(--_gridui-copy-path-border);
|
|
1045
1055
|
}
|
|
1056
|
+
.gridui-copy-path {
|
|
1057
|
+
--gridui-copy-inline: var(--gridui-space-16);
|
|
1058
|
+
--gridui-copy-block: var(--gridui-space-8);
|
|
1059
|
+
}
|
|
1060
|
+
.gridui-copy-path[data-size="small"] {
|
|
1061
|
+
--gridui-copy-inline: var(--gridui-space-8);
|
|
1062
|
+
--gridui-copy-block: var(--gridui-space-4);
|
|
1063
|
+
}
|
|
1064
|
+
.gridui-copy-path[data-size="large"] {
|
|
1065
|
+
--gridui-copy-inline: var(--gridui-space-24);
|
|
1066
|
+
}
|
|
1046
1067
|
.gridui-copy-status {
|
|
1047
1068
|
display: inline-grid;
|
|
1048
1069
|
min-width: 0;
|
package/dist/styles.local.css
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
2
2
|
@layer theme, base, components, utilities;
|
|
3
|
-
@layer theme {
|
|
4
|
-
:root, :host {
|
|
5
|
-
--spacing: 0.25rem;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
3
|
@layer utilities {
|
|
9
4
|
.gridui-u-clipboard--col-span-full {
|
|
10
5
|
grid-column: 1 / -1;
|
|
@@ -15,9 +10,6 @@
|
|
|
15
10
|
.gridui-u-clipboard--grid {
|
|
16
11
|
display: grid;
|
|
17
12
|
}
|
|
18
|
-
.gridui-u-clipboard--min-h-11 {
|
|
19
|
-
min-height: calc(var(--spacing) * 11);
|
|
20
|
-
}
|
|
21
13
|
.gridui-u-clipboard--min-w-0 {
|
|
22
14
|
min-width: 0px;
|
|
23
15
|
}
|
|
@@ -48,18 +40,18 @@
|
|
|
48
40
|
.gridui-u-clipboard--bg-surface {
|
|
49
41
|
background-color: var(--gridui-surface);
|
|
50
42
|
}
|
|
51
|
-
.gridui-u-clipboard--px
|
|
52
|
-
padding-inline: var(--gridui-
|
|
43
|
+
.gridui-u-clipboard--px-\(--gridui-copy-inline\) {
|
|
44
|
+
padding-inline: var(--gridui-copy-inline);
|
|
53
45
|
}
|
|
54
46
|
.gridui-u-clipboard--px-gridui-24 {
|
|
55
47
|
padding-inline: var(--gridui-space-24);
|
|
56
48
|
}
|
|
49
|
+
.gridui-u-clipboard--py-\(--gridui-copy-block\) {
|
|
50
|
+
padding-block: var(--gridui-copy-block);
|
|
51
|
+
}
|
|
57
52
|
.gridui-u-clipboard--py-gridui-8 {
|
|
58
53
|
padding-block: var(--gridui-space-8);
|
|
59
54
|
}
|
|
60
|
-
.gridui-u-clipboard--py-gridui-16 {
|
|
61
|
-
padding-block: var(--gridui-space-16);
|
|
62
|
-
}
|
|
63
55
|
.gridui-u-clipboard--type-code {
|
|
64
56
|
font: var(--gridui-type-code);
|
|
65
57
|
font-family: var(--gridui-font-mono);
|
|
@@ -88,12 +80,6 @@
|
|
|
88
80
|
-webkit-user-select: text;
|
|
89
81
|
user-select: text;
|
|
90
82
|
}
|
|
91
|
-
.gridui-u-clipboard--\[\&_svg\]\:h-gridui-16 svg {
|
|
92
|
-
height: var(--gridui-space-16);
|
|
93
|
-
}
|
|
94
|
-
.gridui-u-clipboard--\[\&_svg\]\:w-gridui-16 svg {
|
|
95
|
-
width: var(--gridui-space-16);
|
|
96
|
-
}
|
|
97
83
|
.gridui-u-clipboard--\[\&_svg\]\:shrink-0 svg {
|
|
98
84
|
flex-shrink: 0;
|
|
99
85
|
}
|
|
@@ -112,6 +98,17 @@
|
|
|
112
98
|
border: 0;
|
|
113
99
|
border-inline-start: 1px solid var(--_gridui-copy-path-border);
|
|
114
100
|
}
|
|
101
|
+
.gridui-copy-path {
|
|
102
|
+
--gridui-copy-inline: var(--gridui-space-16);
|
|
103
|
+
--gridui-copy-block: var(--gridui-space-8);
|
|
104
|
+
}
|
|
105
|
+
.gridui-copy-path[data-size="small"] {
|
|
106
|
+
--gridui-copy-inline: var(--gridui-space-8);
|
|
107
|
+
--gridui-copy-block: var(--gridui-space-4);
|
|
108
|
+
}
|
|
109
|
+
.gridui-copy-path[data-size="large"] {
|
|
110
|
+
--gridui-copy-inline: var(--gridui-space-24);
|
|
111
|
+
}
|
|
115
112
|
.gridui-copy-status {
|
|
116
113
|
display: inline-grid;
|
|
117
114
|
min-width: 0;
|
package/docs/catalog.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"name": "@gridui/clipboard",
|
|
4
|
-
"version": "
|
|
5
|
-
"category": "
|
|
4
|
+
"version": "2.0.0",
|
|
5
|
+
"category": "controls",
|
|
6
6
|
"description": "GridUI React clipboard",
|
|
7
7
|
"usage": "`CopyPath` displays an exact `value` and an explicit copy button. Callers supply its accessible `label`, `copyLabel`, `copiedLabel`, and `failedLabel`. Clipboard success is announced only after the write resolves; unavailable or denied clipboard access selects the visible path for manual copying and reports failure. Both copy controls retain focus while pending and block repeated activation with an immediate in-flight lock. Result feedback reserves space for both supplied messages, including wrapping, and remains visible during a retry. Failed manual copy content remains mounted while retrying. Stale completions cannot report a result for a newer value. Clipboard writes start directly from the action.",
|
|
8
8
|
"documentation": [
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
],
|
|
43
43
|
"styledImport": "@gridui/clipboard/styled",
|
|
44
44
|
"examples": [
|
|
45
|
-
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
46
|
-
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
47
|
-
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
48
|
-
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
45
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-controls/clipboard/stories/copying.mdx",
|
|
46
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-controls/clipboard/stories/getting-started.mdx",
|
|
47
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-controls/clipboard/stories/copy-button.stories.tsx",
|
|
48
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-controls/clipboard/stories/copy-path.stories.tsx"
|
|
49
49
|
]
|
|
50
50
|
}
|
|
@@ -11,9 +11,9 @@ import "@gridui/theme/styles.css";
|
|
|
11
11
|
import "@gridui/clipboard/styles.css";
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-controls/clipboard/README.md) for shared behavior and stylesheet dependencies.
|
|
15
15
|
|
|
16
|
-
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-controls/clipboard/stories/copy-button.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
17
|
|
|
18
18
|
## API
|
|
19
19
|
|
|
@@ -27,7 +27,7 @@ Visual variant.
|
|
|
27
27
|
|
|
28
28
|
### size
|
|
29
29
|
|
|
30
|
-
``
|
|
30
|
+
``ActionSize | undefined`` · Optional
|
|
31
31
|
|
|
32
32
|
Component size preset.
|
|
33
33
|
|
|
@@ -79,7 +79,7 @@ Called when the corresponding interaction occurs; inspect the arguments in Actio
|
|
|
79
79
|
|
|
80
80
|
### startIconSize
|
|
81
81
|
|
|
82
|
-
``"
|
|
82
|
+
``"medium" | "large" | "extra-large" | undefined`` · Optional
|
|
83
83
|
|
|
84
84
|
### endIcon
|
|
85
85
|
|
|
@@ -11,9 +11,9 @@ import "@gridui/theme/styles.css";
|
|
|
11
11
|
import "@gridui/clipboard/styles.css";
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-controls/clipboard/README.md) for shared behavior and stylesheet dependencies.
|
|
15
15
|
|
|
16
|
-
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-controls/clipboard/stories/copy-path.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
17
|
|
|
18
18
|
## API
|
|
19
19
|
|
|
@@ -33,6 +33,14 @@ Controlled value. Pair with the corresponding change callback.
|
|
|
33
33
|
|
|
34
34
|
``string`` · Required
|
|
35
35
|
|
|
36
|
+
### size
|
|
37
|
+
|
|
38
|
+
``Size | undefined`` · Optional
|
|
39
|
+
|
|
40
|
+
Default: ``"medium"``
|
|
41
|
+
|
|
42
|
+
Component size preset.
|
|
43
|
+
|
|
36
44
|
### label
|
|
37
45
|
|
|
38
46
|
``string`` · Required
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridui/clipboard",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "GridUI React clipboard",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
"react-dom": "^19.2.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@gridui/button": "^
|
|
36
|
-
"@gridui/input": "^
|
|
37
|
-
"@gridui/theme": "^
|
|
35
|
+
"@gridui/button": "^6.0.0",
|
|
36
|
+
"@gridui/input": "^5.0.0",
|
|
37
|
+
"@gridui/theme": "^5.0.0",
|
|
38
38
|
"class-variance-authority": "0.7.1",
|
|
39
|
-
"lucide-react": "1.
|
|
39
|
+
"lucide-react": "1.73.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@gridui-internal/configuration": "0.0.0-internal",
|