Skip to content

Commit f2e753f

Browse files
Merge pull request #7 from mezh-hq/development
Fixes styling conflicts with other design systems
2 parents d9a59a7 + 8d914f7 commit f2e753f

File tree

10 files changed

+49
-16
lines changed

10 files changed

+49
-16
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Changelog
2+
3+
# v2.0.0 [2024-07-31]
4+
5+
## Patch with Breaking Changes
6+
7+
### Fixes
8+
- Styling conflicts with other design systems by scoping the Tailwind base styles
9+
10+
### Breaking Changes
11+
- Wraps the toolkit with a div with the class name "stk-core" to enable scoping of the toolkit styles. An additional property is added to the style prop under `core` to allow customization of the core div.
12+
13+
---
14+
15+
# v1.0.0 [2024-06-18]
16+
17+
## Initial Stable Release

bun.lockb

464 Bytes
Binary file not shown.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mezh-hq/react-seat-toolkit",
3-
"version": "1.3.8",
3+
"version": "2.0.0-blizzard.2",
44
"description": "React UI library to design and render seat layouts",
55
"main": "dist/index.cjs",
66
"module": "dist/index.mjs",
@@ -28,7 +28,7 @@
2828
"build:types": "bunx tsc --project ./tsconfig.declaration.json && tsc-alias --project ./tsconfig.declaration.json && cd dist && ls -d */ | grep -Ev 'actions|types' | xargs rm -rf && cp ./index.d.ts ./index.slim.d.ts",
2929
"bump-version": "bunx --bun automatic-versioning --disable-auto-sync --recursive $(if [ \"$TAG\" != \"latest\" ]; then echo --prerelease; fi) --prerelease-branch=development --prerelease-tag=$TAG --name=@mezh-hq/react-seat-toolkit --ignore-prefixes=ci",
3030
"format": "bunx prettier --write --cache \"**/*.{js,jsx,ts,tsx,md,css,yml}\"",
31-
"lint": "bun run --bun eslint . --ext js,jsx,ts,tsx,mdx --ignore-path .gitignore --fix --cache --report-unused-disable-directives",
31+
"lint": "bun run --bun eslint . --ext js,jsx,ts,tsx --ignore-path .gitignore --fix --cache --report-unused-disable-directives",
3232
"storybook": "NODE_ENV=storybook storybook dev -p 6006",
3333
"build-storybook": "storybook build",
3434
"postbuild": "bun build:types && bun build:css",
@@ -116,8 +116,9 @@
116116
"sonner": "1.5.0",
117117
"storybook": "7.3.2",
118118
"storybook-addon-deep-controls": "0.2.1",
119-
"tailwindcss": "3.4.1",
119+
"tailwindcss": "3.4.6",
120120
"tailwindcss-animate": "1.0.6",
121+
"tailwindcss-scoped-preflight": "3.4.3",
121122
"tsc-alias": "1.8.8",
122123
"vite": "4.5.2"
123124
},

src/hooks/breakpoint.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useEffect, useState } from "react";
2-
import { screens } from "../../tailwind.config";
2+
import { screens } from "../utils/tailwind";
33

44
const calculateBreakpoints = () =>
55
Object.entries(screens).reduce((acc, [key, value]) => {

src/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Provider } from "react-redux";
2+
import { twMerge } from "tailwind-merge";
23
import { default as Core, TooltipProvider } from "@/components";
34
import { store } from "@/store";
45
import { type ISTKProps } from "./types";
@@ -11,7 +12,12 @@ export const SeatToolkit = (props: ISTKProps) => {
1112
return (
1213
<Provider store={store}>
1314
<TooltipProvider>
14-
<Core {...props} />
15+
<div
16+
className={twMerge("stk-core h-full w-full", props.styles?.core?.container?.className)}
17+
style={props.styles?.core?.container?.properties}
18+
>
19+
<Core {...props} />
20+
</div>
1521
</TooltipProvider>
1622
</Provider>
1723
);

src/styles/storybook.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ body,
44
#storybook-root {
55
min-height: 100% !important;
66
height: 100% !important;
7+
font-family: "Inter", sans-serif !important;
78
}
89
body {
910
margin-right: 0px !important;

src/types/styles.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ export interface IStyles {
8787
};
8888
};
8989
core?: {
90+
container?: IStyle;
9091
button?: IStyle;
9192
};
9293
}

src/utils/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ids, selectors } from "@/constants";
44
export * from "./d3";
55
export * from "./transformer";
66
export * from "./workspace";
7+
export * from "./tailwind";
78

89
export const fallible = (fn: Function) => {
910
try {

src/utils/tailwind.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export const screens = {
2+
xs: "400px",
3+
xsm: "450px",
4+
sm: "640px",
5+
md: "768px",
6+
lg: "1024px",
7+
xl: "1280px",
8+
xxl: "1536px"
9+
};

tailwind.config.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
import animate from "tailwindcss-animate";
2-
3-
export const screens = {
4-
xs: "400px",
5-
xsm: "450px",
6-
sm: "640px",
7-
md: "768px",
8-
lg: "1024px",
9-
xl: "1280px",
10-
xxl: "1536px"
11-
};
2+
import { isolateInsideOfContainer, scopedPreflightStyles } from "tailwindcss-scoped-preflight";
3+
import { screens } from "./src/utils/tailwind";
124

135
/** @type {import('tailwindcss').Config} */
146
export default {
@@ -26,5 +18,10 @@ export default {
2618
}
2719
}
2820
},
29-
plugins: [animate]
21+
plugins: [
22+
animate,
23+
scopedPreflightStyles({
24+
isolationStrategy: isolateInsideOfContainer(".stk-core")
25+
})
26+
]
3027
};

0 commit comments

Comments
 (0)