@carbonid1/design-system 5.5.0 → 5.6.1

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/dist/index.d.ts CHANGED
@@ -19,6 +19,8 @@ export { ThemeCycler } from './ThemeCycler/ThemeCycler';
19
19
  export { Toaster } from './Toaster/Toaster';
20
20
  export { toast } from 'sonner';
21
21
  export { useTheme } from 'next-themes';
22
+ export { useHotkeys, useRecordHotkeys, useHotkeysContext, isHotkeyPressed, HotkeysProvider, } from 'react-hotkeys-hook';
23
+ export type { Options, Keys, HotkeyCallback } from 'react-hotkeys-hook';
22
24
  export { cn } from './helpers/cn/cn';
23
25
  export { getModKey } from './helpers/getModKey/getModKey';
24
26
  export { cva } from 'class-variance-authority';
package/dist/index.js CHANGED
@@ -13,6 +13,7 @@ export { ThemeCycler } from './ThemeCycler/ThemeCycler';
13
13
  export { Toaster } from './Toaster/Toaster';
14
14
  export { toast } from 'sonner';
15
15
  export { useTheme } from 'next-themes';
16
+ export { useHotkeys, useRecordHotkeys, useHotkeysContext, isHotkeyPressed, HotkeysProvider, } from 'react-hotkeys-hook';
16
17
  export { cn } from './helpers/cn/cn';
17
18
  export { getModKey } from './helpers/getModKey/getModKey';
18
19
  export { cva } from 'class-variance-authority';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carbonid1/design-system",
3
- "version": "5.5.0",
3
+ "version": "5.6.1",
4
4
  "description": "Shared React UI primitives + design tokens (themes, postcss config)",
5
5
  "repository": {
6
6
  "type": "git",
@@ -24,6 +24,7 @@ import {
24
24
  useTheme,
25
25
  cn,
26
26
  getModKey,
27
+ useHotkeys,
27
28
  } from '@carbonid1/design-system'
28
29
  ```
29
30
 
@@ -75,7 +76,7 @@ Two tiers. Pick by how hard the action is to redo, not how scary it feels.
75
76
  | **Hard to redo** | Undo toast (5s + Cmd/Ctrl+Z) | Delete a record, remove history item |
76
77
  | **Easy to redo** | No confirmation | Toggle flag, remove a tag |
77
78
 
78
- **Undo toast:** action executes immediately → toast with description `${getModKey()}+Z to undo` + "Undo" action button (5s auto-dismiss) → store holds `lastDeleted` for restoration → global `mod+z` hotkey via `react-hotkeys-hook` → sequential deletes overwrite the buffer (only latest is undoable). Never add a modal confirmation for hard-to-redo actions — the undo toast is the confirmation.
79
+ **Undo toast:** action executes immediately → toast with description `${getModKey()}+Z to undo` + "Undo" action button (5s auto-dismiss) → store holds `lastDeleted` for restoration → global `mod+z` hotkey via `useHotkeys` (re-exported from the design system) → sequential deletes overwrite the buffer (only latest is undoable). Never add a modal confirmation for hard-to-redo actions — the undo toast is the confirmation.
79
80
 
80
81
  ## Layout Stability
81
82