Skip to content

Commit e9215e6

Browse files
committed
feat(Item): show actions on hover
1 parent df91f10 commit e9215e6

35 files changed

+438
-39
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@cube-dev/ui-kit": minor
3+
---
4+
5+
Add `showActionsOnHover` prop to Item component. When enabled, actions are hidden by default and revealed smoothly on hover, focus, or focus-within states using opacity transitions. This provides a cleaner interface while keeping actions easily accessible without content shifting.
6+

.cursor/rules/documentation.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
description: When updating the component documentation file *.docs.mdx
2+
description: When creating or updating the component documentation file *.docs.mdx
33
alwaysApply: false
44
---
55
# Component Documentation Guidelines

.cursor/rules/storybook.mdc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
description: When updating storybook files and documentatino files *.stories.tsx, *.docs.mdx
2+
description: When creating or updating storybook files and documentatino files *.stories.tsx, *.docs.mdx
33
alwaysApply: false
44
---
55
## Imports
66

77
### Stories Files (.stories.tsx)
88
- Import types: `import type { Meta, StoryObj } from '@storybook/react-vite';`
99
- Import `StoryFn` for custom template functions
10-
- For interactive tests: `import { userEvent, within } from 'storybook/test';` (NOT from `@testing-library/react`)
10+
- For interactive tests: `import { userEvent, within } from '@storybook/test';` (NOT from `@testing-library/react`)
1111

1212
### Documentation Files (.docs.mdx)
1313
- `import { Meta, Canvas, Story, Controls } from '@storybook/addon-docs/blocks';`
@@ -103,7 +103,7 @@ export const Interactive: StoryObj = {
103103
};
104104
```
105105

106-
**Important:** Always import `userEvent` and `within` from `'storybook/test'` in story files. This ensures they respect Storybook's configuration (e.g., `testIdAttribute: 'data-qa'` set in `.storybook/preview.jsx`). Do NOT use `@testing-library/react` imports in stories.
106+
**Important:** Always import `userEvent` and `within` from `'@storybook/test'` in story files. This ensures they respect Storybook's configuration (e.g., `testIdAttribute: 'data-qa'` set in `.storybook/preview.jsx`). Do NOT use `@testing-library/react` imports in stories.
107107

108108
## MDX Documentation Structure
109109

.storybook/preview.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import { configure } from '@storybook/test';
12
import isChromatic from 'chromatic/isChromatic';
23
import { config } from 'react-transition-group';
3-
import { configure } from 'storybook/test';
44

55
import { Root } from '../src';
66

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
"@react-stately/utils": "^3.10.8",
7676
"@react-types/shared": "^3.31.0",
7777
"@sparticuz/chromium": "^137.0.1",
78+
"@storybook/test": "^8.6.14",
7879
"@tabler/icons-react": "^3.31.0",
7980
"@tanstack/react-virtual": "^3.13.12",
8081
"@trivago/prettier-plugin-sort-imports": "^5.2.2",

pnpm-lock.yaml

Lines changed: 137 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/actions/CommandMenu/CommandMenu.stories.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
import {
2+
expect,
3+
findByRole,
4+
userEvent,
5+
waitFor,
6+
within,
7+
} from '@storybook/test';
18
import {
29
IconArrowBack,
310
IconArrowForward,
@@ -11,7 +18,6 @@ import {
1118
IconSelect,
1219
} from '@tabler/icons-react';
1320
import React, { useState } from 'react';
14-
import { expect, findByRole, userEvent, waitFor, within } from 'storybook/test';
1521

1622
import { EditIcon, TrashIcon } from '../../../icons';
1723
import { tasty } from '../../../tasty';

0 commit comments

Comments
 (0)