modern-cmdk 1.2.3 → 1.4.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/LICENSE +1 -1
- package/README.md +109 -154
- package/dist/codemod/cli.mjs +205 -120
- package/dist/codemod/transforms/data-attrs.mjs +1 -1
- package/dist/core/index.d.mts +10 -10
- package/dist/core/index.mjs +9 -8
- package/dist/react/chunk-dialog.mjs +237 -0
- package/dist/react/dialog.d.mts +18 -0
- package/dist/react/dialog.mjs +3 -0
- package/dist/react/index.d.mts +11 -333
- package/dist/react/index.mjs +34 -1373
- package/dist/react/styles.css +18 -9
- package/package.json +8 -12
- package/dist/codemod/cli.d.mts +0 -1
- package/dist/codemod/transforms/data-attrs.d.mts +0 -6
- package/dist/codemod/transforms/forward-ref.d.mts +0 -6
- package/dist/codemod/transforms/import-rewrite.d.mts +0 -6
- package/dist/codemod/transforms/should-filter.d.mts +0 -5
package/dist/react/styles.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* modern-cmdk/react —
|
|
1
|
+
/* modern-cmdk/react — tokens, item and list transitions; the dialog and overlay transitions are declared but inert until DT-19 */
|
|
2
2
|
/* All animations respect prefers-reduced-motion */
|
|
3
3
|
/* Spring easing via linear() approximation — perceptually smooth */
|
|
4
4
|
/* Scroll-driven animations via animation-timeline: scroll() */
|
|
@@ -6,6 +6,12 @@
|
|
|
6
6
|
/* CSS Logical Properties: full RTL/LTR support */
|
|
7
7
|
/* CSS Nesting, @layer cascade control, oklch() color space */
|
|
8
8
|
/* Container queries for responsive item layout */
|
|
9
|
+
/* Secondary text (group headings, shortcuts, empty state, placeholder) is coloured with
|
|
10
|
+
--command-muted-color, never faded with opacity: opacity stacks on the consumer's text
|
|
11
|
+
colour and cannot be checked against it. The default is light-dark(), so it follows the
|
|
12
|
+
used color-scheme of the page (set color-scheme on :root or a parent, or override the
|
|
13
|
+
token); it is 4.5:1 or better on white, black and the usual near-white / near-black
|
|
14
|
+
surfaces. Only [data-disabled] items keep opacity (WCAG 1.4.3 exempts disabled controls). */
|
|
9
15
|
|
|
10
16
|
/* ─── CSS Custom Properties ─── */
|
|
11
17
|
|
|
@@ -40,7 +46,7 @@
|
|
|
40
46
|
}
|
|
41
47
|
|
|
42
48
|
/* ─── User-Customizable Animation Properties ─── */
|
|
43
|
-
/* Override these on [data-command-root] or :root
|
|
49
|
+
/* Override these with unlayered CSS on [data-command-root] loaded after this file, or on a more specific unlayered selector; this block sits outside every @layer, so a normal (non-!important) value set inside a layer loses here whatever its selector, and a :root value is shadowed by this declaration */
|
|
44
50
|
|
|
45
51
|
[data-command-root] {
|
|
46
52
|
--command-spring-easing: linear(
|
|
@@ -99,10 +105,11 @@
|
|
|
99
105
|
--command-item-height: 44px;
|
|
100
106
|
--command-fade-edge-size: 16px;
|
|
101
107
|
--command-highlight-color: oklch(0.85 0.15 90 / 0.3);
|
|
108
|
+
--command-muted-color: light-dark(oklch(0.45 0.015 260), oklch(0.75 0.015 260));
|
|
102
109
|
}
|
|
103
110
|
|
|
104
111
|
/* ─── Spring Easing ─── */
|
|
105
|
-
/* linear()
|
|
112
|
+
/* linear() spring approximations: --command-spring-easing settles without overshoot; --command-spring-easing-bouncy peaks at 1.033 before settling */
|
|
106
113
|
/* Generated from spring physics: x(t) = 1 - e^(-zt)(cos(wd*t) + (zw/wd)sin(wd*t)) */
|
|
107
114
|
|
|
108
115
|
@layer command.base, command.layout, command.animation, command.a11y;
|
|
@@ -173,7 +180,9 @@
|
|
|
173
180
|
font: inherit;
|
|
174
181
|
|
|
175
182
|
&::placeholder {
|
|
176
|
-
|
|
183
|
+
color: var(--command-muted-color);
|
|
184
|
+
/* Firefox fades ::placeholder by default; the colour token carries the contrast */
|
|
185
|
+
opacity: 1;
|
|
177
186
|
}
|
|
178
187
|
}
|
|
179
188
|
|
|
@@ -232,7 +241,7 @@
|
|
|
232
241
|
font-size: 0.75em;
|
|
233
242
|
text-transform: uppercase;
|
|
234
243
|
letter-spacing: 0.05em;
|
|
235
|
-
|
|
244
|
+
color: var(--command-muted-color);
|
|
236
245
|
}
|
|
237
246
|
|
|
238
247
|
/* ─── Separator ─── */
|
|
@@ -255,7 +264,7 @@
|
|
|
255
264
|
|
|
256
265
|
[data-command-empty] {
|
|
257
266
|
text-align: center;
|
|
258
|
-
|
|
267
|
+
color: var(--command-muted-color);
|
|
259
268
|
}
|
|
260
269
|
|
|
261
270
|
/* ─── Shortcut Badge ─── */
|
|
@@ -263,7 +272,7 @@
|
|
|
263
272
|
[data-command-shortcut] {
|
|
264
273
|
font-family: inherit;
|
|
265
274
|
font-size: 0.75em;
|
|
266
|
-
|
|
275
|
+
color: var(--command-muted-color);
|
|
267
276
|
letter-spacing: 0.05em;
|
|
268
277
|
}
|
|
269
278
|
|
|
@@ -332,7 +341,7 @@
|
|
|
332
341
|
}
|
|
333
342
|
|
|
334
343
|
/* ─── Dialog Animations ─── */
|
|
335
|
-
/*
|
|
344
|
+
/* Dialog transitions: inert until DT-19 */
|
|
336
345
|
/* Spring easing via linear() approximation */
|
|
337
346
|
|
|
338
347
|
[data-command-dialog][data-state="open"] {
|
|
@@ -543,7 +552,7 @@
|
|
|
543
552
|
}
|
|
544
553
|
|
|
545
554
|
[data-command-group-heading] {
|
|
546
|
-
|
|
555
|
+
color: inherit;
|
|
547
556
|
}
|
|
548
557
|
|
|
549
558
|
[data-command-highlight] {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "modern-cmdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The definitive command palette engine for the modern web",
|
|
6
6
|
"license": "MIT",
|
|
@@ -8,24 +8,24 @@
|
|
|
8
8
|
"bugs": {
|
|
9
9
|
"url": "https://github.com/ABCrimson/modern-cmdk/issues"
|
|
10
10
|
},
|
|
11
|
-
"engines": {
|
|
12
|
-
"node": ">=26.4.0"
|
|
13
|
-
},
|
|
14
11
|
"publishConfig": {
|
|
15
12
|
"access": "public"
|
|
16
13
|
},
|
|
17
14
|
"exports": {
|
|
18
15
|
".": {
|
|
19
16
|
"types": "./dist/core/index.d.mts",
|
|
20
|
-
"import": "./dist/core/index.mjs",
|
|
21
17
|
"default": "./dist/core/index.mjs"
|
|
22
18
|
},
|
|
23
19
|
"./react": {
|
|
24
20
|
"types": "./dist/react/index.d.mts",
|
|
25
|
-
"import": "./dist/react/index.mjs",
|
|
26
21
|
"default": "./dist/react/index.mjs"
|
|
27
22
|
},
|
|
28
|
-
"./
|
|
23
|
+
"./react/dialog": {
|
|
24
|
+
"types": "./dist/react/dialog.d.mts",
|
|
25
|
+
"default": "./dist/react/dialog.mjs"
|
|
26
|
+
},
|
|
27
|
+
"./styles.css": "./dist/react/styles.css",
|
|
28
|
+
"./package.json": "./package.json"
|
|
29
29
|
},
|
|
30
30
|
"main": "./dist/core/index.mjs",
|
|
31
31
|
"types": "./dist/core/index.d.mts",
|
|
@@ -37,8 +37,7 @@
|
|
|
37
37
|
"LICENSE"
|
|
38
38
|
],
|
|
39
39
|
"sideEffects": [
|
|
40
|
-
"./dist/react/styles.css"
|
|
41
|
-
"./dist/react/index.mjs"
|
|
40
|
+
"./dist/react/styles.css"
|
|
42
41
|
],
|
|
43
42
|
"peerDependencies": {
|
|
44
43
|
"react": ">=19.0.0 <21.0.0",
|
|
@@ -51,9 +50,6 @@
|
|
|
51
50
|
},
|
|
52
51
|
"react-dom": {
|
|
53
52
|
"optional": true
|
|
54
|
-
},
|
|
55
|
-
"radix-ui": {
|
|
56
|
-
"optional": true
|
|
57
53
|
}
|
|
58
54
|
},
|
|
59
55
|
"dependencies": {
|
package/dist/codemod/cli.d.mts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {}
|