Skip to content

Commit

Permalink
Merge branch 'main' into feat/sidebar-header-size
Browse files Browse the repository at this point in the history
  • Loading branch information
dougfabris authored Jun 13, 2024
2 parents 3e93561 + 756430c commit 83bee5a
Show file tree
Hide file tree
Showing 110 changed files with 12,370 additions and 14,026 deletions.
5 changes: 5 additions & 0 deletions .changeset/nine-countries-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/fuselage": minor
---

feat(fuselage): `Contextualbar` components size improvements
5 changes: 5 additions & 0 deletions .changeset/rotten-melons-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/fuselage": patch
---

fix(fuselage): decrease `InputBox` small inline paddings
4 changes: 2 additions & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
steps:
- uses: actions/setup-node@v2
with:
node-version: "14.21.3"
node-version: "22.2.0"
- uses: actions/checkout@v2
- name: Turbo Cache
id: turbo-cache
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
steps:
- uses: actions/setup-node@v2
with:
node-version: "14.21.3"
node-version: "22.2.0"
registry-url: "https://registry.npmjs.org"
scope: "@rocket.chat"
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
- uses: actions/setup-node@v2
with:
node-version: "14.21.3"
node-version: "22.2.0"
- uses: actions/checkout@v2
- uses: actions/cache@v2
id: yarn-cache
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
!/.yarn/sdks
!/.yarn/versions
/.pnp.*
/lerna-debug.log
/static
node_modules/
storybook-static/
Expand Down
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"javascriptreact",
"typescript",
"typescriptreact",
"markdown",
"mdx",
"pegjs"
],
Expand Down
363 changes: 0 additions & 363 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

This file was deleted.

9 changes: 0 additions & 9 deletions .yarn/plugins/@yarnpkg/plugin-typescript.cjs

This file was deleted.

550 changes: 0 additions & 550 deletions .yarn/plugins/@yarnpkg/plugin-version.cjs

This file was deleted.

28 changes: 0 additions & 28 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

This file was deleted.

873 changes: 0 additions & 873 deletions .yarn/releases/yarn-3.5.0.cjs

This file was deleted.

894 changes: 894 additions & 0 deletions .yarn/releases/yarn-4.2.2.cjs

Large diffs are not rendered by default.

18 changes: 6 additions & 12 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
defaultSemverRangePrefix: ~
compressionLevel: mixed

defaultSemverRangePrefix: "~"

enableGlobalCache: false

nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
spec: "@yarnpkg/plugin-version"
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
spec: "@yarnpkg/plugin-typescript"

yarnPath: .yarn/releases/yarn-3.5.0.cjs
yarnPath: .yarn/releases/yarn-4.2.2.cjs
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Rocket.Chat
Copyright (c) 2024 Rocket.Chat

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
16 changes: 6 additions & 10 deletions _templates/create-package/library/prompt.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const fs = require("fs");

module.exports = {
prompt: async ({ prompter, args }) => {
const { package } = await prompter.prompt({
prompt: async ({ prompter }) => {
const { package: packageName } = await prompter.prompt({
type: "input",
name: "package",
message: "What's the package name?",
Expand All @@ -14,17 +12,15 @@ module.exports = {
message: "What's the package description?",
});

let { version } = JSON.parse(await fs.promises.readFile("lerna.json"));

({ version } = await prompter.prompt({
const { version } = await prompter.prompt({
type: "input",
name: "version",
default: version,
default: "0.0.1",
message: "What's the package version?",
}));
});

return {
package,
package: packageName,
description,
version,
};
Expand Down
11 changes: 0 additions & 11 deletions lerna.json

This file was deleted.

25 changes: 15 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,25 @@
"@changesets/changelog-github": "~0.4.8",
"@changesets/cli": "~2.26.2",
"bump": "workspace:~",
"husky": "~7.0.4",
"husky": "~9.0.11",
"hygen": "~6.1.5",
"lerna": "~4.0.0",
"lint-staged": "~13.2.1",
"turbo": "~1.1.10",
"pinst": "~3.0.0",
"turbo": "~1.13.3",
"update-readme": "workspace:~",
"webpack": "~5.78.0"
},
"scripts": {
"postinstall": "husky install",
"postinstall": "husky install && yarn build",
"prepack": "pinst --disable",
"postpack": "pinst --enable",
"ci": "yarn turbo run build lint test build-storybook --cache-dir=\".turbo\"",
"clean": "yarn workspaces foreach -v --topological-dev run clean",
"build": "yarn turbo run build",
"lint": "yarn turbo run lint",
"lint-and-fix": "yarn workspaces foreach -v --topological-dev run lint-and-fix",
"test": "yarn turbo run test",
"docs": "yarn workspaces foreach -v --topological-dev run docs",
"docs": "yarn turbo run docs",
"build-storybook": "yarn turbo run build-storybook --cache-dir=\".turbo\"",
"update-readme": "update-readme",
"resolve-workspace-deps": "yarn workspace scripts run resolve-workspace-deps",
Expand All @@ -35,15 +37,18 @@
"changeset": "changeset",
"release-next": "yarn workspaces foreach --no-private -v npm publish --tag next --tolerate-republish"
},
"devEngines": {
"node": "~14.21.3"
"engines": {
"node": "22.2.0"
},
"volta": {
"node": "14.21.3",
"yarn": "1.22.19"
"node": "22.2.0",
"yarn": "4.2.2"
},
"packageManager": "yarn@3.5.0",
"packageManager": "yarn@4.2.2",
"resolutions": {
"@storybook/react-docgen-typescript-plugin@1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0": "patch:@storybook/react-docgen-typescript-plugin@npm%3A1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0#./.yarn/patches/@storybook-react-docgen-typescript-plugin-npm-1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0-b31cc57c40.patch"
},
"eslintConfig": {
"extends": "@rocket.chat/eslint-config-alt"
}
}
6 changes: 3 additions & 3 deletions packages/css-in-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@
"rollup": "~2.67.3",
"rollup-plugin-terser": "~7.0.2",
"ts-jest": "~29.1.0",
"typedoc": "~0.24.1",
"typescript": "~5.0.4"
"typedoc": "~0.25.13",
"typescript": "~5.4.5"
},
"dependencies": {
"@emotion/hash": "^0.9.0",
"@rocket.chat/css-supports": "workspace:~",
"@rocket.chat/memo": "workspace:~",
"@rocket.chat/stylis-logical-props-middleware": "workspace:~",
"stylis": "~4.1.3"
"stylis": "~4.3.2"
}
}
4 changes: 2 additions & 2 deletions packages/css-supports/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
"lint-staged": "~13.2.1",
"prettier": "~2.8.7",
"rimraf": "~3.0.2",
"typedoc": "~0.24.1",
"typescript": "~5.0.4"
"typedoc": "~0.25.13",
"typescript": "~5.4.5"
},
"dependencies": {
"@rocket.chat/memo": "workspace:~"
Expand Down
4 changes: 2 additions & 2 deletions packages/emitter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"rollup": "~2.67.3",
"rollup-plugin-terser": "~7.0.2",
"ts-jest": "~29.1.0",
"typedoc": "~0.24.1",
"typescript": "~5.0.4"
"typedoc": "~0.25.13",
"typescript": "~5.4.5"
}
}
4 changes: 2 additions & 2 deletions packages/fuselage-hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@
"rollup-plugin-terser": "~7.0.2",
"testing-utils": "workspace:~",
"ts-jest": "~29.1.0",
"typedoc": "~0.24.1",
"typescript": "~5.0.4"
"typedoc": "~0.25.13",
"typescript": "~5.4.5"
},
"peerDependencies": {
"@rocket.chat/fuselage-tokens": "*",
Expand Down
6 changes: 6 additions & 0 deletions packages/fuselage-toastbar/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @rocket.chat/fuselage-toastbar

## 0.32.0

### Minor Changes

- [#1389](https://github.com/RocketChat/fuselage/pull/1389) [`8c80efc47`](https://github.com/RocketChat/fuselage/commit/8c80efc47f3779869875336da88b3185c06a508b) Thanks [@dougfabris](https://github.com/dougfabris)! - feat(fuselage-toastbar): Add RTL support

## 0.31.26

### Patch Changes
Expand Down
12 changes: 8 additions & 4 deletions packages/fuselage-toastbar/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rocket.chat/fuselage-toastbar",
"version": "0.31.26",
"version": "0.32.0",
"description": "Fuselage ToastBar component",
"keywords": [
"rocketchat",
Expand Down Expand Up @@ -72,8 +72,8 @@
"rimraf": "~3.0.2",
"storybook-dark-mode": "~1.1.2",
"ts-jest": "~29.1.0",
"typedoc": "~0.24.1",
"typescript": "~5.0.4"
"typedoc": "~0.25.13",
"typescript": "~5.4.5"
},
"peerDependencies": {
"@rocket.chat/fuselage": "*",
Expand All @@ -96,7 +96,11 @@
"testMatch": [
"<rootDir>/src/**/*.spec.[jt]s?(x)"
],
"testEnvironment": "jsdom"
"testEnvironment": "jsdom",
"setupFilesAfterEnv": [
"@testing-library/jest-dom/extend-expect",
"testing-utils/setup/noErrorsLogged"
]
},
"volta": {
"extends": "../../package.json"
Expand Down
65 changes: 59 additions & 6 deletions packages/fuselage-toastbar/src/ToastBar.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,65 @@
import { composeStories } from '@storybook/testing-react';
import { render } from '@testing-library/react';
import { render, getByRole, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';

import * as stories from './stories';
import * as stories from './ToastBar.stories';
import ToastBarProvider from './ToastBarProvider';

const { ToastBarWithData } = composeStories(stories);
const { Default, TopEnd } = composeStories(stories, {
decorators: [
(Story) => (
<ToastBarProvider>
<Story />
</ToastBarProvider>
),
],
});

const topEndStyle = {
top: '0',
right: '0',
};

const topStartStyle = {
top: '0',
left: '0',
};

describe('[fuselage-toastbar rendering]', () => {
test('should display ToastBar on the top right of the screen by default', async () => {
render(<TopEnd />);
const toast = screen.queryByRole('alert');
const toastContainer = toast?.parentElement?.parentElement?.parentElement;

expect(toastContainer).toHaveStyle(topEndStyle);
});

test('should display ToastBar on the top right of the screen', async () => {
document.body.setAttribute('dir', 'ltr');
render(<TopEnd />);
const toast = screen.queryByRole('alert');
const toastContainer = toast?.parentElement?.parentElement?.parentElement;

expect(toastContainer).toHaveStyle(topEndStyle);
});

test('should display ToastBar on the top left of the screen', async () => {
document.body.setAttribute('dir', 'rtl');
render(<TopEnd />);
const toast = screen.queryByRole('alert');
const toastContainer = toast?.parentElement?.parentElement?.parentElement;

expect(toastContainer).toHaveStyle(topStartStyle);
});
});

describe('[fuselage-toastbar interacting]', () => {
test('should dispatch the ToastBar on click', async () => {
const { container } = render(<Default />);
const button = getByRole(container, 'button');

describe('[ToastBarWithData Component]', () => {
it('renders without crashing', () => {
render(<ToastBarWithData />);
userEvent.click(button);
const toasts = screen.queryAllByRole('alert');
toasts.forEach((toast) => expect(toast).toBeInTheDocument());
});
});
Loading

0 comments on commit 83bee5a

Please sign in to comment.