@gridui/clipboard 0.0.0-stage → 0.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 +19 -2
- package/dist/copy-button/copy-button.d.ts +15 -0
- package/dist/copy-path/copy-path.d.ts +16 -0
- package/dist/copy-path/style.d.ts +15 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +230 -0
- package/dist/index.js.map +7 -0
- package/dist/shared/clipboard.d.ts +7 -0
- package/dist/styles.css +140 -0
- package/package.json +50 -3
package/README.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @gridui/clipboard
|
|
2
|
+
|
|
3
|
+
Core family. Public API: `CopyButton`, `CopyButtonProps`, `CopyPath`, `CopyPathProps`.
|
|
4
|
+
|
|
5
|
+
Import components from `@gridui/clipboard` and load `@gridui/clipboard/styles.css` after Theme.
|
|
6
|
+
Load styles for any composed dependency used by this family. Applications own routes, labels, state persistence, and branding.
|
|
7
|
+
|
|
8
|
+
See [component ownership](../../docs/component-ownership.md) and [release history](.changeset/history/).
|
|
9
|
+
|
|
10
|
+
## Behavior
|
|
11
|
+
|
|
12
|
+
`CopyPath` displays an exact `value` and an explicit copy button. Callers supply
|
|
13
|
+
its accessible `label`, `copyLabel`, `copiedLabel`, and `failedLabel`. Clipboard
|
|
14
|
+
success is announced only after the write resolves; unavailable or denied
|
|
15
|
+
clipboard access selects the visible path for manual copying and reports failure.
|
|
16
|
+
`frame="integrated"` omits outer borders so a parent grid owns its seams and
|
|
17
|
+
uses the grid border color for the copy button's separator;
|
|
18
|
+
standalone mode supplies a straight control border. Neither mode adds external
|
|
19
|
+
padding or expands environment variables, usernames, or path placeholders.
|
|
2
20
|
|
|
3
|
-
This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Clipboard
|
|
4
|
+
* @namespace CopyButton
|
|
5
|
+
* @description Copy Button
|
|
6
|
+
*/
|
|
7
|
+
import { type ButtonProps, type ButtonVariants } from "@gridui/button";
|
|
8
|
+
import { type FC } from "react";
|
|
9
|
+
export type CopyButtonProps = Omit<ButtonProps, "children" | "onClick" | "value"> & ButtonVariants & {
|
|
10
|
+
readonly value: string;
|
|
11
|
+
readonly label: string;
|
|
12
|
+
readonly copiedLabel: string;
|
|
13
|
+
readonly failedLabel: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const CopyButton: FC<CopyButtonProps>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Clipboard
|
|
4
|
+
* @namespace CopyPath
|
|
5
|
+
* @description Copy Path
|
|
6
|
+
*/
|
|
7
|
+
import { type FC } from "react";
|
|
8
|
+
export type CopyPathProps = {
|
|
9
|
+
readonly value: string;
|
|
10
|
+
readonly label: string;
|
|
11
|
+
readonly copyLabel: string;
|
|
12
|
+
readonly copiedLabel: string;
|
|
13
|
+
readonly failedLabel: string;
|
|
14
|
+
readonly frame?: "standalone" | "integrated";
|
|
15
|
+
};
|
|
16
|
+
export declare const CopyPath: FC<CopyPathProps>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Clipboard
|
|
4
|
+
* @namespace CopyPath
|
|
5
|
+
* @description Style
|
|
6
|
+
*/
|
|
7
|
+
export declare const copyPathStyles: (props?: ({
|
|
8
|
+
frame?: "standalone" | "integrated" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
+
export declare const copyPathRowStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
11
|
+
export declare const copyPathValueStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
12
|
+
export declare const copyPathActionStyles: (props?: ({
|
|
13
|
+
frame?: "standalone" | "integrated" | null | undefined;
|
|
14
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
15
|
+
export declare const copyPathStatusStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Clipboard
|
|
4
|
+
* @namespace Root
|
|
5
|
+
* @description Index
|
|
6
|
+
*/
|
|
7
|
+
export type { CopyButtonProps } from "./copy-button/copy-button";
|
|
8
|
+
export { CopyButton } from "./copy-button/copy-button";
|
|
9
|
+
export type { CopyPathProps } from "./copy-path/copy-path";
|
|
10
|
+
export { CopyPath } from "./copy-path/copy-path";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
// src/shared/clipboard.ts
|
|
2
|
+
var copyPath = async (value) => {
|
|
3
|
+
try {
|
|
4
|
+
await navigator.clipboard.writeText(value);
|
|
5
|
+
return true;
|
|
6
|
+
} catch {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
// src/copy-button/copy-button.tsx
|
|
12
|
+
import { Button } from "@gridui/button";
|
|
13
|
+
import { Textarea } from "@gridui/input";
|
|
14
|
+
import { useEffect, useRef, useState } from "react";
|
|
15
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
+
var CopyButton = (props) => {
|
|
17
|
+
const { value, label, copiedLabel, failedLabel, disabled, ...restProps } = props;
|
|
18
|
+
const [
|
|
19
|
+
result,
|
|
20
|
+
setResult
|
|
21
|
+
] = useState(null);
|
|
22
|
+
const [
|
|
23
|
+
busy,
|
|
24
|
+
setBusy
|
|
25
|
+
] = useState(false);
|
|
26
|
+
const manualCopyInput = useRef(null);
|
|
27
|
+
const isMounted = useRef(true);
|
|
28
|
+
const currentValue = useRef(value);
|
|
29
|
+
currentValue.current = value;
|
|
30
|
+
const copyInFlight = useRef(false);
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
isMounted.current = true;
|
|
33
|
+
return () => {
|
|
34
|
+
isMounted.current = false;
|
|
35
|
+
};
|
|
36
|
+
}, []);
|
|
37
|
+
const visibleResult = result?.value === value ? result : null;
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (visibleResult && !visibleResult.success) {
|
|
40
|
+
manualCopyInput.current?.focus();
|
|
41
|
+
manualCopyInput.current?.select();
|
|
42
|
+
}
|
|
43
|
+
}, [visibleResult]);
|
|
44
|
+
const copyValue = async () => {
|
|
45
|
+
if (disabled || copyInFlight.current) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
copyInFlight.current = true;
|
|
49
|
+
setBusy(true);
|
|
50
|
+
setResult(null);
|
|
51
|
+
const success = await copyPath(value);
|
|
52
|
+
copyInFlight.current = false;
|
|
53
|
+
if (isMounted.current) {
|
|
54
|
+
setBusy(false);
|
|
55
|
+
if (value === currentValue.current) {
|
|
56
|
+
setResult({
|
|
57
|
+
value,
|
|
58
|
+
success
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
const message = visibleResult?.success ? copiedLabel : failedLabel;
|
|
64
|
+
return /* @__PURE__ */ jsxs("span", { children: [
|
|
65
|
+
/* @__PURE__ */ jsx(
|
|
66
|
+
Button,
|
|
67
|
+
{
|
|
68
|
+
...restProps,
|
|
69
|
+
disabled: disabled || busy,
|
|
70
|
+
onClick: () => {
|
|
71
|
+
void copyValue();
|
|
72
|
+
},
|
|
73
|
+
children: label
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
/* @__PURE__ */ jsx(
|
|
77
|
+
"span",
|
|
78
|
+
{
|
|
79
|
+
role: "status",
|
|
80
|
+
children: visibleResult ? message : ""
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
visibleResult && !visibleResult.success && /* @__PURE__ */ jsx(
|
|
84
|
+
Textarea,
|
|
85
|
+
{
|
|
86
|
+
ref: manualCopyInput,
|
|
87
|
+
"aria-label": failedLabel,
|
|
88
|
+
value,
|
|
89
|
+
readOnly: true
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
] });
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// src/copy-path/style.ts
|
|
96
|
+
import { cva } from "class-variance-authority";
|
|
97
|
+
var copyPathStyles = cva("gridui-copy-path min-w-0 rounded-none", {
|
|
98
|
+
variants: {
|
|
99
|
+
frame: {
|
|
100
|
+
standalone: "border border-solid border-control-border",
|
|
101
|
+
integrated: ""
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
defaultVariants: { frame: "standalone" }
|
|
105
|
+
});
|
|
106
|
+
var copyPathRowStyles = cva("grid min-w-0 grid-cols-[minmax(0,1fr)_auto] bg-surface");
|
|
107
|
+
var copyPathValueStyles = cva("min-w-0 self-center px-gridui-24 py-gridui-16 type-code text-foreground wrap-anywhere select-text");
|
|
108
|
+
var copyPathActionStyles = cva("flex min-h-11 items-center justify-center gap-gridui-8 rounded-none border-0 border-l border-solid bg-background px-gridui-16 py-gridui-8 text-foreground type-ui hover:bg-surface-hover cursor-pointer [&_svg]:h-gridui-16 [&_svg]:w-gridui-16 [&_svg]:shrink-0 disabled:cursor-wait", {
|
|
109
|
+
variants: {
|
|
110
|
+
frame: {
|
|
111
|
+
standalone: "border-control-border",
|
|
112
|
+
integrated: "border-border"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
defaultVariants: { frame: "standalone" }
|
|
116
|
+
});
|
|
117
|
+
var copyPathStatusStyles = cva("px-gridui-24 py-gridui-8 type-supporting text-muted empty:hidden");
|
|
118
|
+
|
|
119
|
+
// src/copy-path/copy-path.tsx
|
|
120
|
+
import { Check, Copy } from "lucide-react";
|
|
121
|
+
import { useRef as useRef2, useState as useState2 } from "react";
|
|
122
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
123
|
+
var CopyPath = (props) => {
|
|
124
|
+
const {
|
|
125
|
+
value,
|
|
126
|
+
label,
|
|
127
|
+
copyLabel,
|
|
128
|
+
copiedLabel,
|
|
129
|
+
failedLabel,
|
|
130
|
+
frame = "standalone"
|
|
131
|
+
} = props;
|
|
132
|
+
const [
|
|
133
|
+
result,
|
|
134
|
+
setResult
|
|
135
|
+
] = useState2(null);
|
|
136
|
+
const [
|
|
137
|
+
pending,
|
|
138
|
+
setPending
|
|
139
|
+
] = useState2(false);
|
|
140
|
+
const code = useRef2(null);
|
|
141
|
+
const current = result?.value === value ? result : null;
|
|
142
|
+
let statusLabel = "";
|
|
143
|
+
if (current) {
|
|
144
|
+
statusLabel = current.copied ? copiedLabel : failedLabel;
|
|
145
|
+
}
|
|
146
|
+
const copy = async () => {
|
|
147
|
+
if (pending) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
setPending(true);
|
|
151
|
+
const copied = await copyPath(value);
|
|
152
|
+
if (!copied && code.current?.textContent === value) {
|
|
153
|
+
const range = document.createRange();
|
|
154
|
+
range.selectNodeContents(code.current);
|
|
155
|
+
const selection = window.getSelection();
|
|
156
|
+
selection?.removeAllRanges();
|
|
157
|
+
selection?.addRange(range);
|
|
158
|
+
}
|
|
159
|
+
setResult({
|
|
160
|
+
value,
|
|
161
|
+
copied
|
|
162
|
+
});
|
|
163
|
+
setPending(false);
|
|
164
|
+
};
|
|
165
|
+
return /* @__PURE__ */ jsxs2(
|
|
166
|
+
"div",
|
|
167
|
+
{
|
|
168
|
+
className: copyPathStyles({ frame }),
|
|
169
|
+
role: "group",
|
|
170
|
+
"aria-label": label,
|
|
171
|
+
children: [
|
|
172
|
+
/* @__PURE__ */ jsxs2(
|
|
173
|
+
"div",
|
|
174
|
+
{
|
|
175
|
+
className: copyPathRowStyles(),
|
|
176
|
+
children: [
|
|
177
|
+
/* @__PURE__ */ jsx2(
|
|
178
|
+
"code",
|
|
179
|
+
{
|
|
180
|
+
ref: code,
|
|
181
|
+
className: copyPathValueStyles(),
|
|
182
|
+
children: value
|
|
183
|
+
}
|
|
184
|
+
),
|
|
185
|
+
/* @__PURE__ */ jsxs2(
|
|
186
|
+
"button",
|
|
187
|
+
{
|
|
188
|
+
type: "button",
|
|
189
|
+
className: copyPathActionStyles({ frame }),
|
|
190
|
+
disabled: pending,
|
|
191
|
+
onClick: () => {
|
|
192
|
+
void copy();
|
|
193
|
+
},
|
|
194
|
+
children: [
|
|
195
|
+
current?.copied ? /* @__PURE__ */ jsx2(
|
|
196
|
+
Check,
|
|
197
|
+
{
|
|
198
|
+
"aria-hidden": "true"
|
|
199
|
+
}
|
|
200
|
+
) : /* @__PURE__ */ jsx2(
|
|
201
|
+
Copy,
|
|
202
|
+
{
|
|
203
|
+
"aria-hidden": "true"
|
|
204
|
+
}
|
|
205
|
+
),
|
|
206
|
+
copyLabel
|
|
207
|
+
]
|
|
208
|
+
}
|
|
209
|
+
)
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
),
|
|
213
|
+
/* @__PURE__ */ jsx2(
|
|
214
|
+
"p",
|
|
215
|
+
{
|
|
216
|
+
role: "status",
|
|
217
|
+
"aria-live": "polite",
|
|
218
|
+
className: copyPathStatusStyles(),
|
|
219
|
+
children: statusLabel
|
|
220
|
+
}
|
|
221
|
+
)
|
|
222
|
+
]
|
|
223
|
+
}
|
|
224
|
+
);
|
|
225
|
+
};
|
|
226
|
+
export {
|
|
227
|
+
CopyButton,
|
|
228
|
+
CopyPath
|
|
229
|
+
};
|
|
230
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/shared/clipboard.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 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 CopyButton\n * @description Copy Button\n */\n\nimport { copyPath } from \"../shared/clipboard\";\nimport { Button, type ButtonProps, type ButtonVariants } from \"@gridui/button\";\nimport { Textarea } from \"@gridui/input\";\nimport { type FC, useEffect, useRef, useState } from \"react\";\n\nexport type CopyButtonProps = Omit<ButtonProps, \"children\" | \"onClick\" | \"value\"> & ButtonVariants & {\n readonly value: string;\n readonly label: string;\n readonly copiedLabel: string;\n readonly failedLabel: string;\n};\n\nexport const CopyButton: FC<CopyButtonProps> = (props: CopyButtonProps) => {\n const { value, label, copiedLabel, failedLabel, disabled, ...restProps } = props;\n const [\n result,\n setResult,\n ] = useState<{\n value: string;\n success: boolean;\n } | null>(null);\n const [\n busy,\n setBusy,\n ] = useState(false);\n const manualCopyInput = useRef<HTMLTextAreaElement>(null);\n const isMounted = useRef(true);\n const currentValue = useRef(value);\n currentValue.current = value;\n const copyInFlight = useRef(false);\n useEffect(() => {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n }, []);\n const visibleResult = result?.value === value ? result : null;\n useEffect(() => {\n if (visibleResult && !visibleResult.success) {\n manualCopyInput.current?.focus();\n manualCopyInput.current?.select();\n }\n }, [visibleResult]);\n const copyValue = async () => {\n if (disabled || copyInFlight.current) {\n return;\n }\n copyInFlight.current = true;\n setBusy(true);\n setResult(null);\n const success = await copyPath(value);\n copyInFlight.current = false;\n if (isMounted.current) {\n setBusy(false);\n // A completed request must not report success for a newer value.\n if (value === currentValue.current) {\n setResult({\n value,\n success,\n });\n }\n }\n };\n const message = visibleResult?.success ? copiedLabel : failedLabel;\n return (<span>\n <Button\n {...restProps}\n disabled={disabled || busy}\n onClick={() => {\n void copyValue();\n }}\n >\n {label}\n </Button>\n <span\n role=\"status\"\n >\n {visibleResult ? message : \"\"}\n </span>\n {visibleResult && !visibleResult.success && (<Textarea\n ref={manualCopyInput}\n aria-label={failedLabel}\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 min-w-0 rounded-none\", {\n variants: {\n frame: {\n standalone: \"border border-solid border-control-border\",\n integrated: \"\",\n },\n },\n defaultVariants: { frame: \"standalone\" },\n});\n\nexport const copyPathRowStyles = cva(\"grid min-w-0 grid-cols-[minmax(0,1fr)_auto] bg-surface\");\n\nexport const copyPathValueStyles = cva(\"min-w-0 self-center px-gridui-24 py-gridui-16 type-code text-foreground wrap-anywhere select-text\");\n\nexport const copyPathActionStyles = cva(\"flex min-h-11 items-center justify-center gap-gridui-8 rounded-none border-0 border-l border-solid bg-background px-gridui-16 py-gridui-8 text-foreground type-ui hover:bg-surface-hover cursor-pointer [&_svg]:h-gridui-16 [&_svg]:w-gridui-16 [&_svg]:shrink-0 disabled:cursor-wait\", {\n variants: {\n frame: {\n standalone: \"border-control-border\",\n integrated: \"border-border\",\n },\n },\n defaultVariants: { frame: \"standalone\" },\n});\n\nexport const copyPathStatusStyles = cva(\"px-gridui-24 py-gridui-8 type-supporting text-muted empty:hidden\");\n", "/**\n * @author WMXPY\n * @package Clipboard\n * @namespace CopyPath\n * @description Copy Path\n */\n\nimport { copyPath } from \"../shared/clipboard\";\nimport { copyPathActionStyles, copyPathRowStyles, copyPathStatusStyles, copyPathStyles, copyPathValueStyles } from \"./style\";\nimport { Check, Copy } from \"lucide-react\";\nimport { type FC, useRef, useState } from \"react\";\n\nexport type CopyPathProps = {\n readonly value: string;\n readonly label: string;\n readonly copyLabel: string;\n readonly copiedLabel: string;\n readonly failedLabel: string;\n readonly frame?: \"standalone\" | \"integrated\";\n};\n\nexport const CopyPath: FC<CopyPathProps> = (props: CopyPathProps) => {\n const {\n value,\n label,\n copyLabel,\n copiedLabel,\n failedLabel,\n frame = \"standalone\",\n } = props;\n const [\n result,\n setResult,\n ] = useState<{\n value: string;\n copied: boolean;\n } | null>(null);\n const [\n pending,\n setPending,\n ] = useState(false);\n const code = useRef<HTMLElement>(null);\n const current = result?.value === value ? result : null;\n let statusLabel = \"\";\n if (current) {\n statusLabel = current.copied ? copiedLabel : failedLabel;\n }\n const copy = async (): Promise<void> => {\n if (pending) {\n return;\n }\n setPending(true);\n const copied = await copyPath(value);\n if (!copied && 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 setResult({\n value,\n copied,\n });\n setPending(false);\n };\n return (<div\n className={copyPathStyles({ frame })}\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 type=\"button\"\n className={copyPathActionStyles({ frame })}\n disabled={pending}\n onClick={() => {\n void copy();\n }}\n >\n {current?.copied ? (<Check\n aria-hidden=\"true\"\n />) : (<Copy\n aria-hidden=\"true\"\n />)}\n {copyLabel}\n </button>\n </div>\n <p\n role=\"status\"\n aria-live=\"polite\"\n className={copyPathStatusStyles()}\n >\n {statusLabel}\n </p>\n </div>);\n};\n"],
|
|
5
|
+
"mappings": ";AAOO,IAAM,WAAW,OAAO,UAAoC;AAC/D,MAAI;AACA,UAAM,UAAU,UAAU,UAAU,KAAK;AACzC,WAAO;AAAA,EACX,QAAQ;AACJ,WAAO;AAAA,EACX;AACJ;;;ACNA,SAAS,cAAqD;AAC9D,SAAS,gBAAgB;AACzB,SAAkB,WAAW,QAAQ,gBAAgB;AA6DzC,SACJ,KADI;AApDL,IAAM,aAAkC,CAAC,UAA2B;AACvE,QAAM,EAAE,OAAO,OAAO,aAAa,aAAa,UAAU,GAAG,UAAU,IAAI;AAC3E,QAAM;AAAA,IACF;AAAA,IACA;AAAA,EACJ,IAAI,SAGM,IAAI;AACd,QAAM;AAAA,IACF;AAAA,IACA;AAAA,EACJ,IAAI,SAAS,KA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windcss.com */
|
|
2
|
+
@layer properties;
|
|
3
|
+
@layer theme, base, components, utilities;
|
|
4
|
+
@layer theme {
|
|
5
|
+
:root, :host {
|
|
6
|
+
--spacing: 0.25rem;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
@layer utilities {
|
|
10
|
+
.flex {
|
|
11
|
+
display: flex;
|
|
12
|
+
}
|
|
13
|
+
.grid {
|
|
14
|
+
display: grid;
|
|
15
|
+
}
|
|
16
|
+
.min-h-11 {
|
|
17
|
+
min-height: calc(var(--spacing) * 11);
|
|
18
|
+
}
|
|
19
|
+
.min-w-0 {
|
|
20
|
+
min-width: 0px;
|
|
21
|
+
}
|
|
22
|
+
.cursor-pointer {
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
}
|
|
25
|
+
.grid-cols-\[minmax\(0\,1fr\)_auto\] {
|
|
26
|
+
grid-template-columns: minmax(0,1fr) auto;
|
|
27
|
+
}
|
|
28
|
+
.items-center {
|
|
29
|
+
align-items: center;
|
|
30
|
+
}
|
|
31
|
+
.justify-center {
|
|
32
|
+
justify-content: center;
|
|
33
|
+
}
|
|
34
|
+
.gap-gridui-8 {
|
|
35
|
+
gap: var(--gridui-space-8);
|
|
36
|
+
}
|
|
37
|
+
.self-center {
|
|
38
|
+
align-self: center;
|
|
39
|
+
}
|
|
40
|
+
.rounded-none {
|
|
41
|
+
border-radius: 0;
|
|
42
|
+
}
|
|
43
|
+
.border {
|
|
44
|
+
border-style: var(--tw-border-style);
|
|
45
|
+
border-width: 1px;
|
|
46
|
+
}
|
|
47
|
+
.border-0 {
|
|
48
|
+
border-style: var(--tw-border-style);
|
|
49
|
+
border-width: 0px;
|
|
50
|
+
}
|
|
51
|
+
.border-l {
|
|
52
|
+
border-left-style: var(--tw-border-style);
|
|
53
|
+
border-left-width: 1px;
|
|
54
|
+
}
|
|
55
|
+
.border-solid {
|
|
56
|
+
--tw-border-style: solid;
|
|
57
|
+
border-style: solid;
|
|
58
|
+
}
|
|
59
|
+
.border-border {
|
|
60
|
+
border-color: var(--gridui-border);
|
|
61
|
+
}
|
|
62
|
+
.border-control-border {
|
|
63
|
+
border-color: var(--gridui-control-border);
|
|
64
|
+
}
|
|
65
|
+
.bg-background {
|
|
66
|
+
background-color: var(--gridui-background);
|
|
67
|
+
}
|
|
68
|
+
.bg-surface {
|
|
69
|
+
background-color: var(--gridui-surface);
|
|
70
|
+
}
|
|
71
|
+
.px-gridui-16 {
|
|
72
|
+
padding-inline: var(--gridui-space-16);
|
|
73
|
+
}
|
|
74
|
+
.px-gridui-24 {
|
|
75
|
+
padding-inline: var(--gridui-space-24);
|
|
76
|
+
}
|
|
77
|
+
.py-gridui-8 {
|
|
78
|
+
padding-block: var(--gridui-space-8);
|
|
79
|
+
}
|
|
80
|
+
.py-gridui-16 {
|
|
81
|
+
padding-block: var(--gridui-space-16);
|
|
82
|
+
}
|
|
83
|
+
.type-code {
|
|
84
|
+
font: var(--gridui-type-code);
|
|
85
|
+
letter-spacing: normal;
|
|
86
|
+
}
|
|
87
|
+
.type-supporting {
|
|
88
|
+
font: var(--gridui-type-supporting);
|
|
89
|
+
letter-spacing: normal;
|
|
90
|
+
}
|
|
91
|
+
.type-ui {
|
|
92
|
+
font: var(--gridui-type-ui);
|
|
93
|
+
letter-spacing: normal;
|
|
94
|
+
}
|
|
95
|
+
.wrap-anywhere {
|
|
96
|
+
overflow-wrap: anywhere;
|
|
97
|
+
}
|
|
98
|
+
.text-foreground {
|
|
99
|
+
color: var(--gridui-foreground);
|
|
100
|
+
}
|
|
101
|
+
.text-muted {
|
|
102
|
+
color: var(--gridui-muted);
|
|
103
|
+
}
|
|
104
|
+
.select-text {
|
|
105
|
+
-webkit-user-select: text;
|
|
106
|
+
user-select: text;
|
|
107
|
+
}
|
|
108
|
+
.empty\:hidden:empty {
|
|
109
|
+
display: none;
|
|
110
|
+
}
|
|
111
|
+
@media (hover: hover) {
|
|
112
|
+
.hover\:bg-surface-hover:hover {
|
|
113
|
+
background-color: var(--gridui-surface-hover);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
.disabled\:cursor-wait:disabled {
|
|
117
|
+
cursor: wait;
|
|
118
|
+
}
|
|
119
|
+
.\[\&_svg\]\:h-gridui-16 svg {
|
|
120
|
+
height: var(--gridui-space-16);
|
|
121
|
+
}
|
|
122
|
+
.\[\&_svg\]\:w-gridui-16 svg {
|
|
123
|
+
width: var(--gridui-space-16);
|
|
124
|
+
}
|
|
125
|
+
.\[\&_svg\]\:shrink-0 svg {
|
|
126
|
+
flex-shrink: 0;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
@property --tw-border-style {
|
|
130
|
+
syntax: "*";
|
|
131
|
+
inherits: false;
|
|
132
|
+
initial-value: solid;
|
|
133
|
+
}
|
|
134
|
+
@layer properties {
|
|
135
|
+
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
|
136
|
+
*, ::before, ::after, ::backdrop {
|
|
137
|
+
--tw-border-style: solid;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,53 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridui/clipboard",
|
|
3
|
-
"version": "0.0.0
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "GridUI React clipboard",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"README.md"
|
|
10
|
+
],
|
|
11
|
+
"sideEffects": [
|
|
12
|
+
"**/*.css"
|
|
13
|
+
],
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./styles.css": "./dist/styles.css"
|
|
20
|
+
},
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"react": "^19.2.0",
|
|
26
|
+
"react-dom": "^19.2.0"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@gridui/button": "^2.1.1",
|
|
30
|
+
"@gridui/input": "^0.0.0",
|
|
31
|
+
"@gridui/theme": "^2.1.2",
|
|
32
|
+
"class-variance-authority": "0.7.1",
|
|
33
|
+
"lucide-react": "1.62.0"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@gridui-internal/configuration": "0.0.0",
|
|
37
|
+
"@jest/globals": "30.5.2",
|
|
38
|
+
"@types/jest": "30.0.0",
|
|
39
|
+
"@types/node": "26.6.5",
|
|
40
|
+
"@types/react": "19.3.0",
|
|
41
|
+
"@types/react-dom": "19.3.0",
|
|
42
|
+
"jest": "30.5.2",
|
|
43
|
+
"react": "19.3.1",
|
|
44
|
+
"react-dom": "19.3.1",
|
|
45
|
+
"typescript": "6.0.3"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "node ../../scripts/compilation/package.ts",
|
|
49
|
+
"compile": "tsc --project tsconfig.json",
|
|
50
|
+
"test": "jest",
|
|
51
|
+
"coverage": "jest --coverage"
|
|
52
|
+
}
|
|
6
53
|
}
|