Skip to content

Commit fc5d1bd

Browse files
committed
Merge branch 'refs/heads/master' into docs/yossi/new-modal-stories-7719052213
2 parents 19e3135 + e8d093e commit fc5d1bd

File tree

12 files changed

+124
-53
lines changed

12 files changed

+124
-53
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish V2 Storybook
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Release v2 version"]
6+
types:
7+
- completed
8+
workflow_dispatch:
9+
10+
jobs:
11+
build-and-deploy:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
17+
- name: Run Setup
18+
uses: ./.github/actions/setup
19+
with:
20+
npm_token: ${{ secrets.npm_token }}
21+
- name: Build & deploy Storybooks to GitHub Pages
22+
run: |
23+
yarn lerna run build --include-dependencies
24+
yarn lerna run --scope monday-ui-react-core build-storybook
25+
yarn lerna run --scope vibe-storybook-components build-storybook
26+
cd packages/core/static_storybook
27+
echo "vibe.monday.com" > ./CNAME
28+
env:
29+
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
30+
- name: Push storybook-blocks Storybook to Github Pages
31+
if: success()
32+
uses: JamesIves/github-pages-deploy-action@v4.5.0
33+
with:
34+
folder: packages/storybook-blocks/storybook-static
35+
branch: gh-pages
36+
target-folder: storybook-blocks
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
- name: Push core Storybook to Github Pages
40+
uses: JamesIves/github-pages-deploy-action@v4.5.0
41+
with:
42+
target-folder: v2
43+
clean-exclude: storybook-blocks/*
44+
folder: packages/core/static_storybook
45+
branch: gh-pages
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ jobs:
3535
- uses: ./.github/actions/git-creds
3636
- uses: ./.github/actions/download-builds
3737
- name: Generate new versions
38-
run: yarn lerna version --exact --conventional-commits --conventional-graduate -y
38+
run: yarn lerna version --exact --conventional-commits --conventional-graduate --message "Publish [skip ci]" -y
39+
env:
40+
GH_TOKEN: ${{ secrets.VIBE_GITHUB_TOKEN }}
3941
- run: yarn config set registry https://registry.npmjs.org/
4042
- name: Setup .npmrc for publish
4143
id: setup-npmrc

packages/core/.storybook/manager-head.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
33
<meta property="og:title" content="Vibe Design System" />
44
<meta property="og:image" content="https://irp.cdn-website.com/33477119/dms3rep/multi/og-banner.jpeg" />
55
<title>Vibe Design System</title>
6-
<link rel="shortcut icon" href="/favicon.ico" />
76
<script src="https://use.fontawesome.com/660238b999.js"></script>
7+
<script type="module">
8+
const faviconLink = document.querySelector("link[rel='icon']");
9+
if (import.meta.url.includes("localhost")) {
10+
faviconLink.href = "/favicon-dev.ico";
11+
}
12+
</script>
813
<style>
914
body {
1015
font-family: "Figtree", sans-serif;
Binary file not shown.

packages/core/CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,25 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
# [3.3.0](https://github.com/mondaycom/vibe/compare/@vibe/core@3.2.0...@vibe/core@3.3.0) (2024-12-08)
7+
8+
9+
### Bug Fixes
10+
11+
* **Button:** fix secondary disabled border color ([#2622](https://github.com/mondaycom/vibe/issues/2622)) ([0df501d](https://github.com/mondaycom/vibe/commit/0df501db6618f1ae38b6e3581b2e6169da026746))
12+
* support vitest [prerelease] ([#2625](https://github.com/mondaycom/vibe/issues/2625)) ([638b19f](https://github.com/mondaycom/vibe/commit/638b19f9d582d5bc7cc9c8f6f633bde7bc333e55))
13+
* **table:** avoid unnecessary re-rendering of table rows ([#2626](https://github.com/mondaycom/vibe/issues/2626)) ([c83a4c4](https://github.com/mondaycom/vibe/commit/c83a4c4ea09173932b66c7cbe3c14d1266ad1388))
14+
15+
16+
### Features
17+
18+
* **Modal:** animation enhancements and general fixes and enhancements ([#2620](https://github.com/mondaycom/vibe/issues/2620)) ([17a14fe](https://github.com/mondaycom/vibe/commit/17a14fe4e93e23bcdfd4b6da61095bc679185b3b))
19+
* **TransitionView:** fill parent if parent has definite height ([#2629](https://github.com/mondaycom/vibe/issues/2629)) ([da5e3b3](https://github.com/mondaycom/vibe/commit/da5e3b3d98d6f5ccdbfd34a4441526c62b5096b0))
20+
21+
22+
23+
24+
625
# [3.2.0](https://github.com/mondaycom/vibe/compare/@vibe/core@3.1.0...@vibe/core@3.2.0) (2024-12-04)
726

827

packages/core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vibe/core",
3-
"version": "3.2.0",
3+
"version": "3.3.0",
44
"description": "Official monday.com UI resources for application development in React.js",
55
"repository": {
66
"type": "git",
@@ -96,7 +96,7 @@
9696
"react-is": "^16.9.0",
9797
"react-popper": "^2.3.0",
9898
"react-remove-scroll": "^2.6.0",
99-
"react-select": "npm:react-select-module@^3.2.5",
99+
"react-select": "npm:react-select-module@^3.2.6",
100100
"react-transition-group": "^4.4.5",
101101
"react-virtualized-auto-sizer": "^1.0.7",
102102
"react-window": "^1.8.7",

packages/core/src/components/Dropdown/Dropdown.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,14 @@ const Dropdown: VibeComponent<DropdownComponentProps, HTMLElement> & {
141141
const [WindowedMenuList, setWindowedMenuList] = useState(null);
142142
useEffect(() => {
143143
if (isClient()) {
144-
if (process.env.NODE_ENV === "test") {
144+
let isRequireAvailable = false;
145+
try {
146+
isRequireAvailable = typeof require === "function" && typeof module !== "undefined";
147+
} catch (e) {
148+
isRequireAvailable = false;
149+
}
150+
151+
if (isRequireAvailable) {
145152
// eslint-disable-next-line @typescript-eslint/no-var-requires
146153
const module = require("react-windowed-select");
147154
setWindowedMenuList(() => module.WindowedMenuList);

packages/core/src/components/Table/TableRowMenu/TableRowMenu.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const TableRowMenu = forwardRef(
4747
style={{ top: menuButtonPosition }}
4848
onMouseEnter={onMouseOverRowMenu}
4949
onMouseLeave={onMouseLeaveRowMenu}
50+
data-row-menu-id={rowId}
5051
>
5152
<MenuButton
5253
id={id}

packages/core/src/components/Table/TableVirtualizedBody/TableVirtualizedBody.tsx

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { ComponentType, forwardRef, useCallback, useEffect } from "react";
1+
import React, { ComponentType, forwardRef, useCallback, useEffect, useMemo } from "react";
22
import { VibeComponentProps } from "../../../types";
33
import TableBody from "../TableBody/TableBody";
44
import styles from "./TableVirtualizedBody.module.scss";
@@ -101,6 +101,19 @@ const TableVirtualizedBody = forwardRef(
101101
if (!virtualizedWithHeader) markTableAsVirtualized();
102102
}, [markTableAsVirtualized, virtualizedWithHeader]);
103103

104+
const memoizedInnerElementType = useMemo(
105+
() =>
106+
virtualizedWithHeader
107+
? forwardRef(({ children, ...rest }: any, ref: React.Ref<HTMLDivElement>) => (
108+
<div ref={ref} {...rest}>
109+
{headerRenderer!(columns!)}
110+
{children}
111+
</div>
112+
))
113+
: undefined,
114+
[virtualizedWithHeader, headerRenderer, columns]
115+
);
116+
104117
return (
105118
<TableBody
106119
className={cx(
@@ -126,16 +139,7 @@ const TableVirtualizedBody = forwardRef(
126139
outerRef={element => {
127140
virtualizedListRef.current = element;
128141
}}
129-
innerElementType={
130-
virtualizedWithHeader
131-
? forwardRef(({ children, ...rest }, ref) => (
132-
<div ref={ref} {...rest}>
133-
{headerRenderer(columns)}
134-
{children}
135-
</div>
136-
))
137-
: undefined
138-
}
142+
innerElementType={memoizedInnerElementType}
139143
>
140144
{itemRenderer}
141145
</List>

packages/core/src/components/Table/context/TableRowMenuContext/TableRowMenuContext.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export const TableRowMenuProvider = ({ value, children }: TableRowMenuProviderPr
77
const { tableRootRef, hoveredRowRef, isMenuOpen, resetHoveredRow, setHoveredRowRef, setIsMenuOpen } = value;
88
const rowMouseLeaveTimeoutId = useRef<ReturnType<typeof setTimeout>>(null);
99
const [menuButtonPosition, setMenuButtonPosition] = useState(0);
10+
const hasMenuRef = useRef<boolean | null>(null);
1011

1112
const resetTimeout = useCallback(() => {
1213
clearTimeout(rowMouseLeaveTimeoutId.current);
@@ -15,12 +16,18 @@ export const TableRowMenuProvider = ({ value, children }: TableRowMenuProviderPr
1516

1617
const onMouseOverRow = useCallback(
1718
(rowRef: React.RefObject<HTMLDivElement>) => {
18-
if (isMenuOpen || hoveredRowRef?.current === rowRef.current) return;
19+
if (hasMenuRef.current === false || isMenuOpen || hoveredRowRef?.current === rowRef.current) return;
20+
1921
resetTimeout();
2022
setHoveredRowRef(rowRef);
2123
const tableRootTop = tableRootRef.current.getBoundingClientRect().top;
2224
const rowTop = rowRef.current.getBoundingClientRect().top;
2325
setMenuButtonPosition(rowTop - tableRootTop);
26+
if (hasMenuRef.current === null) {
27+
requestAnimationFrame(() => {
28+
hasMenuRef.current = !!document?.querySelector(`[data-row-menu-id]`);
29+
});
30+
}
2431
},
2532
[isMenuOpen, hoveredRowRef, resetTimeout, setHoveredRowRef, tableRootRef]
2633
);

packages/core/src/components/TransitionView/TransitionView.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,31 @@ import { getTestId } from "../../tests/test-ids-utils";
66
import { ComponentDefaultTestId } from "../../tests/constants";
77
import styles from "./TransitionView.module.scss";
88
import SlideTransition from "../SlideTransition/SlideTransition";
9+
import useMergeRef from "../../hooks/useMergeRef";
910

1011
const TransitionView = forwardRef(
1112
(
1213
{ activeStep, direction, height, id, className, "data-testid": dataTestId, children }: TransitionViewProps,
1314
ref: React.ForwardedRef<HTMLDivElement>
1415
) => {
16+
const componentRef = useRef<HTMLDivElement>(null);
17+
const mergedRef = useMergeRef(ref, componentRef);
1518
const slideTransitionRef = useRef<HTMLDivElement>(null);
16-
const [contentHeight, setContentHeight] = useState<number>(height);
17-
const slideTransitionHeight = height || contentHeight > 0 ? "100%" : "auto";
19+
const [contentHeight, setContentHeight] = useState<number | "100%">(height);
20+
const slideTransitionHeight = height || contentHeight === "100%" || contentHeight > 0 ? "100%" : "auto";
1821

1922
useEffect(() => {
2023
if (!slideTransitionRef.current) return;
21-
setContentHeight(slideTransitionRef.current.scrollHeight);
24+
// if parent has definite height, stretch component to fill it, otherwise use content height
25+
setContentHeight(componentRef.current.clientHeight > 0 ? "100%" : slideTransitionRef.current.scrollHeight);
2226
}, [height, slideTransitionRef]);
2327

2428
return (
2529
<div
2630
id={id}
2731
className={cx(styles.slideshow, className)}
2832
data-testid={dataTestId || getTestId(ComponentDefaultTestId.TRANSITION_VIEW, id)}
29-
ref={ref}
33+
ref={mergedRef}
3034
style={{ height: height ?? contentHeight }}
3135
>
3236
<AnimatePresence initial={false} custom={direction}>

yarn.lock

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -17786,10 +17786,10 @@ react-select@3.1.0:
1778617786
react-input-autosize "^2.2.2"
1778717787
react-transition-group "^4.3.0"
1778817788

17789-
"react-select@npm:react-select-module@^3.2.5":
17790-
version "3.2.5"
17791-
resolved "https://registry.npmjs.org/react-select-module/-/react-select-module-3.2.5.tgz#98866bb0a8db3969587492ef35b62e0178115373"
17792-
integrity sha512-Nqb6fhWlEtsvIPWMcN7VLKn50GqqFblaS0d6b37oRfp19vJkCJgnLVFQISirvSrTe0soECQpJfAAqw8K8QyaGQ==
17789+
"react-select@npm:react-select-module@^3.2.6":
17790+
version "3.2.6"
17791+
resolved "https://registry.npmjs.org/react-select-module/-/react-select-module-3.2.6.tgz#f21939951d706b64720233b22e872ede88caa01b"
17792+
integrity sha512-Q8cp+tjtuDWaX48agmJZ5urczp5YDVh8KDkGe+FmkMxjOvdz0PNnjcEvZP6fon7T5x5BFNvoDQnDUFtVRvtiKg==
1779317793
dependencies:
1779417794
"@babel/runtime" "^7.4.4"
1779517795
"@emotion/cache" "^10.0.9"
@@ -19383,16 +19383,7 @@ string-length@^4.0.1:
1938319383
char-regex "^1.0.2"
1938419384
strip-ansi "^6.0.0"
1938519385

19386-
"string-width-cjs@npm:string-width@^4.2.0":
19387-
version "4.2.3"
19388-
resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
19389-
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
19390-
dependencies:
19391-
emoji-regex "^8.0.0"
19392-
is-fullwidth-code-point "^3.0.0"
19393-
strip-ansi "^6.0.1"
19394-
19395-
"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
19386+
"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
1939619387
version "4.2.3"
1939719388
resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
1939819389
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@@ -19487,7 +19478,7 @@ stringify-entities@^4.0.0:
1948719478
character-entities-html4 "^2.0.0"
1948819479
character-entities-legacy "^3.0.0"
1948919480

19490-
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
19481+
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
1949119482
version "6.0.1"
1949219483
resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
1949319484
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
@@ -19501,13 +19492,6 @@ strip-ansi@^3.0.0:
1950119492
dependencies:
1950219493
ansi-regex "^2.0.0"
1950319494

19504-
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
19505-
version "6.0.1"
19506-
resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
19507-
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
19508-
dependencies:
19509-
ansi-regex "^5.0.1"
19510-
1951119495
strip-ansi@^7.0.1, strip-ansi@^7.1.0:
1951219496
version "7.1.0"
1951319497
resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45"
@@ -21330,7 +21314,7 @@ workerpool@6.2.1:
2133021314
resolved "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343"
2133121315
integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==
2133221316

21333-
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
21317+
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
2133421318
version "7.0.0"
2133521319
resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
2133621320
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
@@ -21348,15 +21332,6 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0:
2134821332
string-width "^4.1.0"
2134921333
strip-ansi "^6.0.0"
2135021334

21351-
wrap-ansi@^7.0.0:
21352-
version "7.0.0"
21353-
resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
21354-
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
21355-
dependencies:
21356-
ansi-styles "^4.0.0"
21357-
string-width "^4.1.0"
21358-
strip-ansi "^6.0.0"
21359-
2136021335
wrap-ansi@^8.1.0:
2136121336
version "8.1.0"
2136221337
resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"

0 commit comments

Comments
 (0)