Skip to content

Commit 157d90f

Browse files
Merge branch 'master' into master
2 parents da9d757 + a97ab42 commit 157d90f

File tree

282 files changed

+3452
-829
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

282 files changed

+3452
-829
lines changed
Lines changed: 231 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,231 @@
1+
---
2+
description: Use when creating interactive examples for Vibe's Storybook Playground (vibe.monday.com/playground) - including bug reproductions, component demonstrations, feasibility testing, or consumer examples. Triggered by keywords like "playground", "reproduce bug", "interactive example", "user reported an issue" or "demonstrate".
3+
alwaysApply: false
4+
---
5+
6+
# Playground Reproduce
7+
8+
## Overview
9+
10+
Vibe supports a Playground in its Storybook, accessible at `vibe.monday.com/playground`.
11+
12+
Your goal is to output a working playground code *directly in the chat* (do not write it to a file).
13+
14+
Behind the scenes, this playground uses:
15+
16+
- **CodeMirror** for the editor interface (via `storybook-addon-playground` addon)
17+
- **React Live** for rendering the code in real-time
18+
19+
## When to Use the Playground
20+
21+
The Playground is for **one-time usage scenarios**:
22+
23+
- Creating bug reproductions for issue reports
24+
- Testing component combinations and integrations
25+
- Validating if a feature is feasible with current or updated code
26+
- Demonstrating to consumers how to achieve specific behaviors
27+
- Helping consumers understand usage patterns
28+
29+
**Important**: Playground examples are NOT for documentation or long-term storage. They are ephemeral demonstrations.
30+
31+
## React Live Constraints
32+
33+
React Live has strict requirements for the code format:
34+
35+
### ✅ MUST: Single Anonymous Component
36+
37+
The code MUST be wrapped in a single anonymous arrow function component:
38+
39+
```javascript
40+
() => {
41+
const [timesClicked, setTimesClicked] = useState(0);
42+
43+
function onButtonClick() {
44+
setTimesClicked(prev => prev + 1);
45+
}
46+
47+
return (
48+
<Flex direction="column" gap="medium">
49+
<Button onClick={onButtonClick}>
50+
Clicked {timesClicked} time{timesClicked === 1 ? "" : "s"}
51+
</Button>
52+
</Flex>
53+
);
54+
};
55+
```
56+
57+
### ❌ CANNOT: Multiple Root Components
58+
59+
React Live cannot render multiple components at the root level. This will NOT work:
60+
61+
```javascript
62+
// ❌ Bad - Multiple root components
63+
const ComponentA = () => <div>A</div>;
64+
const ComponentB = () => <div>B</div>;
65+
```
66+
67+
### ✅ WORKAROUND: Define Components Inside
68+
69+
For multi-component bugs (e.g., re-render issues), define child components INSIDE the root anonymous component:
70+
71+
```javascript
72+
() => {
73+
const ChildComponent = ({ value }) => {
74+
console.log("ChildComponent rendered");
75+
return <div>{value}</div>;
76+
};
77+
78+
const AnotherComponent = () => {
79+
return <Text>Another component</Text>;
80+
};
81+
82+
return (
83+
<Flex direction="column" gap="small">
84+
<ChildComponent value="test" />
85+
<AnotherComponent />
86+
</Flex>
87+
);
88+
};
89+
```
90+
91+
## Available Components
92+
93+
### Default Components (Vibe 3.0 / Next)
94+
95+
All Vibe components are available by their standard names and default to the "next" versions:
96+
97+
```javascript
98+
<Button />
99+
<Dropdown />
100+
<Modal />
101+
<TextField />
102+
```
103+
104+
### Icons
105+
106+
Access all Vibe icons via the `VibeIcons` prefix:
107+
108+
```javascript
109+
<VibeIcons.RemoveRound />
110+
<VibeIcons.Check />
111+
<VibeIcons.Close />
112+
```
113+
114+
### Legacy Components (Vibe 2.0)
115+
116+
To use older versions of components, use the `VibeLegacy` prefix:
117+
118+
```javascript
119+
<VibeLegacy.Modal />
120+
<VibeLegacy.Dropdown />
121+
```
122+
123+
### React Hooks
124+
125+
All standard React hooks are available (`useState`, `useEffect`, `useCallback`, etc.).
126+
127+
## Editor Tabs
128+
129+
The Playground has two tabs:
130+
131+
### JSX Tab
132+
133+
Write your component code here using the anonymous component format.
134+
135+
### CSS Tab
136+
137+
Write CSS styles here. Reference these styles in the JSX tab using `className`:
138+
139+
```javascript
140+
// JSX tab
141+
() => {
142+
return <div className="my-custom-class">Styled content</div>;
143+
}
144+
145+
// CSS tab
146+
.my-custom-class {
147+
background: red;
148+
padding: 16px;
149+
}
150+
```
151+
152+
**Note**: CSS Modules are NOT supported. Use plain class names as strings.
153+
154+
## Best Practices
155+
156+
### Keep It Simple
157+
158+
Focus ONLY on reproducing the specific issue. Don't add unrelated complexity.
159+
160+
```javascript
161+
// ❌ Bad - Bug about Menu text, but adding unnecessary icons
162+
() => {
163+
return (
164+
<Menu>
165+
<MenuItem icon={<VibeIcons.Check />}>Item with icon</MenuItem>
166+
<MenuItem icon={<VibeIcons.Star />}>Another with icon</MenuItem>
167+
</Menu>
168+
);
169+
};
170+
171+
// ✅ Good - Focus on the Menu text issue
172+
() => {
173+
return (
174+
<Menu>
175+
<MenuItem>Simple menu item text</MenuItem>
176+
<MenuItem>Another menu item</MenuItem>
177+
</Menu>
178+
);
179+
};
180+
```
181+
182+
### Ask Questions
183+
184+
Before generating playground code, ask human:
185+
186+
- What is the specific behavior they're trying to reproduce?
187+
- Which components are involved?
188+
- What should the expected vs. actual behavior be?
189+
- Are there any specific props or states that trigger the issue?
190+
- More related questions you think are worth asking.
191+
- Do not bug human with too many questions if you think you already understood most of the issue and what human wants.
192+
193+
### Use JavaScript, Not TypeScript
194+
195+
TypeScript types are valid code but add no value in the Playground. Keep code simple by using Javascript only.
196+
197+
### Minimal Reproduction
198+
199+
Strip away everything not essential to demonstrating the issue:
200+
201+
```javascript
202+
// ❌ Too complex for a simple button bug
203+
() => {
204+
const [state, setState] = useState({ count: 0, enabled: true, label: "Click" });
205+
const handleClick = useCallback(() => {
206+
setState(prev => ({ ...prev, count: prev.count + 1 }));
207+
}, []);
208+
209+
return (
210+
<Flex direction="column" gap="large" padding="large">
211+
<Heading>Button Test</Heading>
212+
<Button onClick={handleClick}>
213+
{state.label} {state.count}
214+
</Button>
215+
</Flex>
216+
);
217+
};
218+
219+
// ✅ Minimal reproduction
220+
() => {
221+
return <Button>Test button label</Button>;
222+
};
223+
```
224+
225+
## Accessing the Playground
226+
227+
Users can access the playground directly at: **vibe.monday.com/playground**
228+
229+
Or navigate through Storybook UI to the "Playground" story.
230+
231+
Press `D` on the keyboard to toggle the editor visibility in Storybook.

.github/actions/download-builds/action.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ runs:
88
uses: actions/download-artifact@v4
99
with:
1010
name: ci-builds-${{ github.run_id }}-${{ github.run_attempt }}
11-
path: packages/

.github/workflows/build-and-upload.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,7 @@ jobs:
4141
uses: actions/upload-artifact@v4
4242
with:
4343
name: ci-builds-${{ github.run_id }}-${{ github.run_attempt }}
44-
path: "./packages/*/dist/"
44+
path: |
45+
./packages/*/dist/
46+
./components/*/dist/
4547
if-no-files-found: ignore

.github/workflows/bundle-size.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
paths:
66
- "packages/core/src/components/**"
77
- "packages/core/package.json"
8+
- "components/**"
89

910
permissions:
1011
pull-requests: write

components/button/CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Change Log
2+
3+
All notable changes to this project will be documented in this file.
4+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5+
6+
## [3.0.3](https://github.com/mondaycom/vibe/compare/@vibe/[email protected]...@vibe/[email protected]) (2025-10-26)
7+
8+
**Note:** Version bump only for package @vibe/button
9+
10+
11+
12+
13+
14+
## [3.0.2](https://github.com/mondaycom/vibe/compare/@vibe/[email protected]...@vibe/[email protected]) (2025-10-26)
15+
16+
17+
### Bug Fixes
18+
19+
* remove unneeded dev dependencies ([#3157](https://github.com/mondaycom/vibe/issues/3157)) ([eec1792](https://github.com/mondaycom/vibe/commit/eec17924422cb0478bb713290919d80a516cd436))
20+
21+
22+
23+
24+
25+
## 3.0.1 (2025-10-25)
26+
27+
**Note:** Version bump only for package @vibe/button

components/button/package.json

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"name": "@vibe/button",
3+
"version": "3.0.3",
4+
"description": "Vibe sub-package for button components",
5+
"repository": {
6+
"type": "git",
7+
"url": "git+https://github.com/mondaycom/vibe.git",
8+
"directory": "components/button"
9+
},
10+
"bugs": {
11+
"url": "https://github.com/mondaycom/vibe/issues"
12+
},
13+
"homepage": "https://github.com/mondaycom/vibe#readme",
14+
"author": "monday.com",
15+
"license": "MIT",
16+
"type": "module",
17+
"main": "dist/index.js",
18+
"types": "dist/index.d.ts",
19+
"files": [
20+
"dist"
21+
],
22+
"exports": {
23+
"./package.json": "./package.json",
24+
".": {
25+
"types": "./dist/index.d.ts",
26+
"import": "./dist/index.js",
27+
"default": "./dist/index.js"
28+
}
29+
},
30+
"scripts": {
31+
"build": "rollup -c",
32+
"test": "vitest run",
33+
"storybook": "storybook dev -p 7008",
34+
"lint": "eslint \"./src/**/*.{js,jsx,ts,tsx}\""
35+
},
36+
"dependencies": {
37+
"@vibe/icon": "3.0.3",
38+
"@vibe/loader": "3.0.3",
39+
"@vibe/shared": "3.0.3",
40+
"classnames": "^2.5.1",
41+
"es-toolkit": "^1.39.10"
42+
},
43+
"devDependencies": {
44+
"@testing-library/react": "^12.1.2",
45+
"@vibe/config": "3.0.2",
46+
"@vibe/icons": "1.9.0",
47+
"@vibe/storybook-config": "3.0.2",
48+
"react": "^16.13.0",
49+
"react-dom": "^16.13.0",
50+
"react-test-renderer": "16",
51+
"typescript": "^4.7.3",
52+
"vibe-storybook-components": "1.0.2",
53+
"vitest": "^1.6.0"
54+
},
55+
"peerDependencies": {
56+
"react": ">=16.9.0",
57+
"react-dom": ">=16.9.0"
58+
},
59+
"sideEffects": [
60+
"*.scss",
61+
"*.css",
62+
"*.scss.js",
63+
"*.css.js"
64+
],
65+
"eslintConfig": {
66+
"extends": [
67+
"../../node_modules/@vibe/config/.eslintrc.cjs"
68+
]
69+
}
70+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import config from "@vibe/config/rollup.config";
2+
3+
export default config;

packages/core/src/components/Button/Button.module.scss renamed to components/button/src/Button/Button.module.scss

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
@import "~monday-ui-style/dist/mixins";
2-
@import "../../styles/typography";
3-
@import "../../styles/states";
2+
43
$disabled-on-primary-color-opacity: 0.5;
54

65
.button {
@@ -544,7 +543,6 @@ $disabled-on-primary-color-opacity: 0.5;
544543
color: var(--fixed-dark-color);
545544
}
546545

547-
548546
.kindTertiary.colorOnInvertedBackground {
549547
color: var(--text-color-on-inverted);
550548
}

0 commit comments

Comments
 (0)