@gridui/clipboard 1.0.9 → 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 +20 -3
- 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/styled.js +4 -0
- package/dist/styles.css +969 -17
- package/dist/styles.local.css +131 -0
- package/docs/catalog.json +7 -6
- package/docs/reference/copy-button.md +4 -4
- package/docs/reference/copy-path.md +10 -2
- package/package.json +12 -7
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@layer theme, base, components, utilities;
|
|
3
|
+
@layer utilities {
|
|
4
|
+
.gridui-u-clipboard--col-span-full {
|
|
5
|
+
grid-column: 1 / -1;
|
|
6
|
+
}
|
|
7
|
+
.gridui-u-clipboard--flex {
|
|
8
|
+
display: flex;
|
|
9
|
+
}
|
|
10
|
+
.gridui-u-clipboard--grid {
|
|
11
|
+
display: grid;
|
|
12
|
+
}
|
|
13
|
+
.gridui-u-clipboard--min-w-0 {
|
|
14
|
+
min-width: 0px;
|
|
15
|
+
}
|
|
16
|
+
.gridui-u-clipboard--cursor-pointer {
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
}
|
|
19
|
+
.gridui-u-clipboard--grid-cols-\[minmax\(0\,1fr\)_auto\] {
|
|
20
|
+
grid-template-columns: minmax(0,1fr) auto;
|
|
21
|
+
}
|
|
22
|
+
.gridui-u-clipboard--items-center {
|
|
23
|
+
align-items: center;
|
|
24
|
+
}
|
|
25
|
+
.gridui-u-clipboard--justify-center {
|
|
26
|
+
justify-content: center;
|
|
27
|
+
}
|
|
28
|
+
.gridui-u-clipboard--gap-gridui-8 {
|
|
29
|
+
gap: var(--gridui-space-8);
|
|
30
|
+
}
|
|
31
|
+
.gridui-u-clipboard--self-center {
|
|
32
|
+
align-self: center;
|
|
33
|
+
}
|
|
34
|
+
.gridui-u-clipboard--rounded-none {
|
|
35
|
+
border-radius: 0;
|
|
36
|
+
}
|
|
37
|
+
.gridui-u-clipboard--bg-background {
|
|
38
|
+
background-color: var(--gridui-background);
|
|
39
|
+
}
|
|
40
|
+
.gridui-u-clipboard--bg-surface {
|
|
41
|
+
background-color: var(--gridui-surface);
|
|
42
|
+
}
|
|
43
|
+
.gridui-u-clipboard--px-\(--gridui-copy-inline\) {
|
|
44
|
+
padding-inline: var(--gridui-copy-inline);
|
|
45
|
+
}
|
|
46
|
+
.gridui-u-clipboard--px-gridui-24 {
|
|
47
|
+
padding-inline: var(--gridui-space-24);
|
|
48
|
+
}
|
|
49
|
+
.gridui-u-clipboard--py-\(--gridui-copy-block\) {
|
|
50
|
+
padding-block: var(--gridui-copy-block);
|
|
51
|
+
}
|
|
52
|
+
.gridui-u-clipboard--py-gridui-8 {
|
|
53
|
+
padding-block: var(--gridui-space-8);
|
|
54
|
+
}
|
|
55
|
+
.gridui-u-clipboard--type-code {
|
|
56
|
+
font: var(--gridui-type-code);
|
|
57
|
+
font-family: var(--gridui-font-mono);
|
|
58
|
+
letter-spacing: normal;
|
|
59
|
+
}
|
|
60
|
+
.gridui-u-clipboard--type-supporting {
|
|
61
|
+
font: var(--gridui-type-supporting);
|
|
62
|
+
font-family: var(--gridui-font-body);
|
|
63
|
+
letter-spacing: normal;
|
|
64
|
+
}
|
|
65
|
+
.gridui-u-clipboard--type-ui {
|
|
66
|
+
font: var(--gridui-type-ui);
|
|
67
|
+
font-family: var(--gridui-font-body);
|
|
68
|
+
letter-spacing: normal;
|
|
69
|
+
}
|
|
70
|
+
.gridui-u-clipboard--wrap-anywhere {
|
|
71
|
+
overflow-wrap: anywhere;
|
|
72
|
+
}
|
|
73
|
+
.gridui-u-clipboard--text-foreground {
|
|
74
|
+
color: var(--gridui-foreground);
|
|
75
|
+
}
|
|
76
|
+
.gridui-u-clipboard--text-muted {
|
|
77
|
+
color: var(--gridui-muted);
|
|
78
|
+
}
|
|
79
|
+
.gridui-u-clipboard--select-text {
|
|
80
|
+
-webkit-user-select: text;
|
|
81
|
+
user-select: text;
|
|
82
|
+
}
|
|
83
|
+
.gridui-u-clipboard--\[\&_svg\]\:shrink-0 svg {
|
|
84
|
+
flex-shrink: 0;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
@layer components {
|
|
88
|
+
.gridui-copy-path {
|
|
89
|
+
--_gridui-copy-path-border: var(--gridui-control-border);
|
|
90
|
+
}
|
|
91
|
+
.gridui-copy-path[data-frame="standalone"] {
|
|
92
|
+
border: 1px solid var(--_gridui-copy-path-border);
|
|
93
|
+
}
|
|
94
|
+
.gridui-copy-path[data-frame="integrated"] {
|
|
95
|
+
--_gridui-copy-path-border: var(--gridui-border);
|
|
96
|
+
}
|
|
97
|
+
.gridui-copy-path .gridui-copy-path-action {
|
|
98
|
+
border: 0;
|
|
99
|
+
border-inline-start: 1px solid var(--_gridui-copy-path-border);
|
|
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
|
+
}
|
|
112
|
+
.gridui-copy-status {
|
|
113
|
+
display: inline-grid;
|
|
114
|
+
min-width: 0;
|
|
115
|
+
vertical-align: middle;
|
|
116
|
+
}
|
|
117
|
+
.gridui-copy-status > span {
|
|
118
|
+
grid-area: 1 / 1;
|
|
119
|
+
overflow-wrap: anywhere;
|
|
120
|
+
}
|
|
121
|
+
.gridui-copy-status > [aria-hidden="true"] {
|
|
122
|
+
visibility: hidden;
|
|
123
|
+
}
|
|
124
|
+
.gridui-copy-button {
|
|
125
|
+
display: inline-grid;
|
|
126
|
+
grid-template-columns: minmax(0, auto) minmax(0, 1fr);
|
|
127
|
+
align-items: center;
|
|
128
|
+
gap: var(--gridui-space-8);
|
|
129
|
+
max-width: 100%;
|
|
130
|
+
}
|
|
131
|
+
}
|
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": [
|
|
@@ -40,10 +40,11 @@
|
|
|
40
40
|
"@gridui/input/styles.css",
|
|
41
41
|
"@gridui/clipboard/styles.css"
|
|
42
42
|
],
|
|
43
|
+
"styledImport": "@gridui/clipboard/styled",
|
|
43
44
|
"examples": [
|
|
44
|
-
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
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-
|
|
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"
|
|
48
49
|
]
|
|
49
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",
|
|
@@ -10,14 +10,19 @@
|
|
|
10
10
|
"docs"
|
|
11
11
|
],
|
|
12
12
|
"sideEffects": [
|
|
13
|
-
"**/*.css"
|
|
13
|
+
"**/*.css",
|
|
14
|
+
"./dist/styled.js"
|
|
14
15
|
],
|
|
15
16
|
"exports": {
|
|
16
17
|
".": {
|
|
17
18
|
"types": "./dist/index.d.ts",
|
|
18
19
|
"import": "./dist/index.js"
|
|
19
20
|
},
|
|
20
|
-
"./styles.css": "./dist/styles.css"
|
|
21
|
+
"./styles.css": "./dist/styles.css",
|
|
22
|
+
"./styled": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"import": "./dist/styled.js"
|
|
25
|
+
}
|
|
21
26
|
},
|
|
22
27
|
"publishConfig": {
|
|
23
28
|
"access": "public"
|
|
@@ -27,11 +32,11 @@
|
|
|
27
32
|
"react-dom": "^19.2.0"
|
|
28
33
|
},
|
|
29
34
|
"dependencies": {
|
|
30
|
-
"@gridui/button": "^
|
|
31
|
-
"@gridui/input": "^
|
|
32
|
-
"@gridui/theme": "^
|
|
35
|
+
"@gridui/button": "^6.0.0",
|
|
36
|
+
"@gridui/input": "^5.0.0",
|
|
37
|
+
"@gridui/theme": "^5.0.0",
|
|
33
38
|
"class-variance-authority": "0.7.1",
|
|
34
|
-
"lucide-react": "1.
|
|
39
|
+
"lucide-react": "1.73.0"
|
|
35
40
|
},
|
|
36
41
|
"devDependencies": {
|
|
37
42
|
"@gridui-internal/configuration": "0.0.0-internal",
|