Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/storybook-dark-mode-fork.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@rocket.chat/storybook-dark-mode': minor
---

Declares `storybook` as a peer dependency, at `^9.0.0`. The addon has always imported from `storybook/preview-api`, `storybook/manager-api`, `storybook/theming` and several `storybook/internal/*` paths, but never said so, which left the requirement implicit and the internal APIs it relies on without a version contract.

Also stops shipping `.d.ts` and `.d.ts.map` files inside `dist/esm` and `dist/cjs`. Declarations were being emitted three times over and only the `dist/ts` copy is referenced by `types`, so the other two were dead weight in the tarball. Anything deep-importing types from `dist/esm` or `dist/cjs` — as opposed to resolving them through the package entry point — needs to use `dist/ts` instead.
2 changes: 1 addition & 1 deletion packages/livechat/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const config: StorybookConfig = {
},
},
'@storybook/addon-webpack5-compiler-swc',
'storybook-dark-mode',
'@rocket.chat/storybook-dark-mode',
],

framework: {
Expand Down
2 changes: 1 addition & 1 deletion packages/livechat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"@rocket.chat/fuselage-hooks": "^0.43.1",
"@rocket.chat/fuselage-tokens": "^0.34.0",
"@rocket.chat/logo": "^0.33.2",
"@rocket.chat/storybook-dark-mode": "workspace:~",
"@rocket.chat/ui-contexts": "workspace:^",
"@storybook/addon-docs": "^9.1.20",
"@storybook/addon-styling-webpack": "^1.0.1",
Expand Down Expand Up @@ -101,7 +102,6 @@
"sass": "~1.80.7",
"sass-loader": "~16.0.8",
"storybook": "^9.1.20",
"storybook-dark-mode": "^5.0.0",
"style-loader": "^1.3.0",
"stylelint": "^16.10.0",
"stylelint-order": "^6.0.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/storybook-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
"@rocket.chat/emitter": "workspace:~",
"@rocket.chat/fuselage-hooks": "^0.43.1",
"@rocket.chat/fuselage-tokens": "^0.34.0",
"@rocket.chat/storybook-dark-mode": "workspace:~",
"@storybook/addon-a11y": "^9.1.20",
"@storybook/addon-docs": "^9.1.20",
"@storybook/addon-styling-webpack": "^2.0.0",
"@storybook/addon-webpack5-compiler-swc": "^4.0.3",
"@storybook/react-webpack5": "^9.1.20",
"react-virtuoso": "~4.18.12",
"storybook": "^9.1.20",
"storybook-dark-mode": "^5.0.0",
"webpack": "~5.104.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/storybook-config/src/DocsContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { DARK_MODE_EVENT_NAME } from '@rocket.chat/storybook-dark-mode';
import { DocsContainer as BaseContainer } from '@storybook/addon-docs/blocks';
import type { ComponentPropsWithoutRef } from 'react';
import { useEffect, useState } from 'react';
import { addons } from 'storybook/preview-api';
import { themes } from 'storybook/theming';
import { DARK_MODE_EVENT_NAME } from 'storybook-dark-mode';

const channel = addons.getChannel();

Expand Down
2 changes: 1 addition & 1 deletion packages/storybook-config/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const baseConfig = (customConfig?: Partial<StorybookConfig>): StorybookConfig =>
addons: [
getAbsolutePath('@storybook/addon-a11y'),
getAbsolutePath('@storybook/addon-docs'),
getAbsolutePath('storybook-dark-mode'),
getAbsolutePath('@rocket.chat/storybook-dark-mode'),
getAbsolutePath('@storybook/addon-webpack5-compiler-swc'),
getAbsolutePath('@storybook/addon-styling-webpack'),
],
Expand Down
2 changes: 1 addition & 1 deletion packages/storybook-config/src/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { PaletteStyleTag } from '@rocket.chat/fuselage';
import surface from '@rocket.chat/fuselage-tokens/dist/surface.json';
import { useDarkMode } from '@rocket.chat/storybook-dark-mode';
import type { Parameters, Decorator } from '@storybook/react';
import { themes } from 'storybook/theming';
import { useDarkMode } from 'storybook-dark-mode';

import manifest from '../package.json';
import DocsContainer from './DocsContainer';
Expand Down
19 changes: 19 additions & 0 deletions packages/storybook-dark-mode/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# @rocket.chat/storybook-dark-mode

## 4.2.1

### Patch Changes

- [#2060](https://github.com/RocketChat/fuselage/pull/2060) [`ee381bb`](https://github.com/RocketChat/fuselage/commit/ee381bb32982d0f4ed9ef26385b5016e0a2e4023) Thanks [@tassoevan](https://github.com/tassoevan)! - feat: Remove deprecations and keep documentation comments

## 4.2.0

### Minor Changes

- [#1999](https://github.com/RocketChat/fuselage/pull/1999) [`6e37f9d`](https://github.com/RocketChat/fuselage/commit/6e37f9d2fee4c9ebeb8ea2c1601bbd4c89905859) Thanks [@tassoevan](https://github.com/tassoevan)! - feat!: Upgrade to React 19

## 4.1.0

### Minor Changes

- [#1849](https://github.com/RocketChat/fuselage/pull/1849) [`99b319c`](https://github.com/RocketChat/fuselage/commit/99b319c6c2ef1015d1d1edb027068c23dc1e29d9) Thanks [@tassoevan](https://github.com/tassoevan)! - feat(storybook-dark-mode): Fork `storybook-dark-mode`
20 changes: 20 additions & 0 deletions packages/storybook-dark-mode/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 2019 Andrew Lisowski <lisowski54@gmail.com>
Copyright (c) 2026 Rocket.Chat Technologies Corp.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.
51 changes: 51 additions & 0 deletions packages/storybook-dark-mode/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"name": "@rocket.chat/storybook-dark-mode",
"version": "4.2.1",
"description": "Toggle between light and dark mode in Storybook (Rocket.Chat fork)",
"repository": {
"type": "git",
"url": "git+https://github.com/RocketChat/Rocket.Chat.git",
"directory": "packages/storybook-dark-mode"
},
"license": "MIT",
"author": "Andrew Lisowski <lisowski54@gmail.com>",
"contributors": [
"Rocket.Chat Technologies Corp."
],
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "dist/ts/index.d.ts",
"files": [
"src",
"dist",
"preset.js"
],
"scripts": {
"build": "rm -rf dist && tsc -p tsconfig.esm.json && tsc -p tsconfig.cjs.json && tsc -p tsconfig.build.json",
"lint": "eslint .",
"lint:fix": "eslint . --fix"
},
"dependencies": {
"@storybook/global": "~5.0.0",
"@storybook/icons": "~1.6.0",
"fast-deep-equal": "~3.1.3"
},
"devDependencies": {
"@rocket.chat/tsconfig": "workspace:~",
"@types/react": "~19.2.18",
"@types/react-dom": "~19.2.4",
"eslint": "~9.39.5",
"react": "~19.2.8",
"react-dom": "~19.2.8",
"storybook": "^9.1.20",
"typescript": "~5.9.3"
},
"peerDependencies": {
"react": "*",
"react-dom": "*",
"storybook": "^9.0.0"
},
"volta": {
"extends": "../../package.json"
}
}
7 changes: 7 additions & 0 deletions packages/storybook-dark-mode/preset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function managerEntries(entry = []) {
return [...entry, require.resolve('./dist/esm/preset/manager')];
}

module.exports = {
managerEntries,
};
Loading
Loading