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.
@@ -1,4 +1,4 @@
1
- /* modern-cmdk/react — GPU-composited animations */
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 to customize all animations */
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() approximation of a critically-damped spring (stiffness: 100, damping: 15) */
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
- opacity: 0.5;
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
- opacity: 0.6;
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
- opacity: 0.6;
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
- opacity: 0.5;
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
- /* GPU-composited dialog animation — zero layout thrash */
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
- opacity: 0.8;
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.2.3",
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
- "./styles.css": "./dist/react/styles.css"
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": {
@@ -1 +0,0 @@
1
- export {}
@@ -1,6 +0,0 @@
1
- import { API, FileInfo } from "jscodeshift";
2
- /**
3
- * jscodeshift transform — renames cmdk data attributes in JSX and
4
- * CSS selectors within string/template literals.
5
- */
6
- export default function transform(fileInfo: FileInfo, api: API): string;
@@ -1,6 +0,0 @@
1
- import { API, FileInfo } from "jscodeshift";
2
- /**
3
- * jscodeshift transform — removes forwardRef wrappers and merges the
4
- * ref parameter into the props object as a regular prop.
5
- */
6
- export default function transform(fileInfo: FileInfo, api: API): string;
@@ -1,6 +0,0 @@
1
- import { API, FileInfo } from "jscodeshift";
2
- /**
3
- * jscodeshift transform — rewrites all import/require/re-export paths
4
- * from `cmdk` to `modern-cmdk/react`.
5
- */
6
- export default function transform(fileInfo: FileInfo, api: API): string;
@@ -1,5 +0,0 @@
1
- import { API, FileInfo } from "jscodeshift";
2
- /**
3
- * jscodeshift transform — migrates shouldFilter prop to filter.
4
- */
5
- export default function transform(fileInfo: FileInfo, api: API): string;