Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge alpha <- styled-system #1492

Merged
merged 3 commits into from
Jul 13, 2023
Merged
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
5 changes: 5 additions & 0 deletions .changeset/tall-maps-lick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@channel.io/bezier-react": major
---

Export the css style sheet for the new design system.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
/packages/bezier-react/src/components/Overlay/ @sungik-choi
/packages/bezier-react/src/components/ProgressBar/ @Dogdriip
/packages/bezier-react/src/components/SectionLabel/ @sungik-choi
/packages/bezier-react/src/components/Spinner/ @quino0627
/packages/bezier-react/src/components/Spinner/ @sungik-choi
/packages/bezier-react/src/components/Stack/ @sungik-choi
/packages/bezier-react/src/components/Status/ @sungik-choi
/packages/bezier-react/src/components/Tabs/ @sungik-choi
Expand Down
9 changes: 7 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{
"eslint.workingDirectories": [{ "mode": "auto" }]
}
"eslint.workingDirectories": [
{
"mode": "auto"
}
],
"typescript.tsdk": "node_modules/typescript/lib"
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@channel.io/stylelint-config": "^1.2.0",
"@commitlint/cli": "^17.6.5",
"@commitlint/config-conventional": "^17.6.5",
"@storybook/addon-styling": "^1.3.2",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^7.32.0",
"eslint-config-bezier": "workspace:*",
Expand All @@ -35,7 +36,8 @@
"stylelint": "^13.13.1",
"ts-node": "^10.9.1",
"turbo": "^1.10.3",
"typescript": "^4.9.5"
"typescript": "^4.9.5",
"typescript-plugin-css-modules": "^5.0.1"
},
"engines": {
"node": "18.15.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/bezier-react/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ module.exports = {
position: 'after',
},
{
pattern: './**/*.styled',
pattern: './**/*.+(styled|scss)',
group: 'sibling',
position: 'after',
},
Expand Down
8 changes: 8 additions & 0 deletions packages/bezier-react/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ module.exports = {
'@storybook/addon-toolbars',
'@storybook/addon-docs',
'@storybook/addon-backgrounds',
{
name: '@storybook/addon-styling',
options: {
sass: {
implementation: require('sass'),
},
},
},
],
features: {
postcss: false,
Expand Down
2 changes: 2 additions & 0 deletions packages/bezier-react/.storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import {
import BezierProvider from '~/src/providers/BezierProvider'
import { Text } from '~/src/components/Text'

import '~/src/styles/index.scss'

const FoundationKeyword = {
Light: 'light',
Dark: 'dark',
Expand Down
13 changes: 12 additions & 1 deletion packages/bezier-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,16 @@
"types": "./dist/types/index.d.ts",
"require": "./dist/cjs/index.js",
"import": "./dist/esm/index.mjs"
},
"./style.css": {
"require": "./dist/cjs/style.css",
"import": "./dist/esm/style.css"
}
},
"sideEffects": false,
"sideEffects": [
"**/*.css",
"**/*.scss"
],
"files": [
"dist",
"!dist/*.tsbuildinfo",
Expand Down Expand Up @@ -92,6 +99,7 @@
"@types/react-dom": "^18.2.6",
"@types/styled-components": "^5.1.26",
"@types/uuid": "^9.0.2",
"autoprefixer": "^10.4.14",
"babel-loader": "^9.1.2",
"babel-plugin-styled-components": "^2.1.3",
"babel-preset-react-app": "^10.0.1",
Expand All @@ -108,8 +116,11 @@
"react-dom": "^18.2.0",
"rollup": "^3.25.1",
"rollup-plugin-node-externals": "^6.1.1",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-visualizer": "^5.9.2",
"sass": "^1.63.6",
"styled-components": "^5.3.11",
"the-new-css-reset": "^1.9.0",
"ts-prune": "^0.10.3",
"tsconfig": "workspace:*",
"tsconfig-paths-webpack-plugin": "^4.0.1",
Expand Down
13 changes: 13 additions & 0 deletions packages/bezier-react/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ import babel from '@rollup/plugin-babel'
import commonjs from '@rollup/plugin-commonjs'
import { nodeResolve } from '@rollup/plugin-node-resolve'
import url from '@rollup/plugin-url'
import autoprefixer from 'autoprefixer'
import { defineConfig } from 'rollup'
import nodeExternals from 'rollup-plugin-node-externals'
import postcss from 'rollup-plugin-postcss'
import { visualizer } from 'rollup-plugin-visualizer'

const pkg = JSON.parse(
Expand All @@ -33,6 +35,17 @@ const generateConfig = ({
replacement: rootDir,
}],
}),
postcss({
extract: 'style.css',
autoModules: true,
modules: {
/**
* ex. Bezier-Button__Button__1w3e4
*/
generateScopedName: 'Bezier-[folder]__[local]__[hash:base64:5]',
},
plugins: [autoprefixer()],
}),
/**
* **IMPORTANT**: Order matters!
* If you're also using @rollup/plugin-node-resolve, make sure this plugin comes before it in the plugins array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,21 +213,6 @@ exports[`Button Test > Disabled Test > Button can have disabled attribute 1`] =
`;

exports[`Button Test > Loading Test > Active prop change Button to hover style 1`] = `
.c5 {
display: inline-block;
width: 16px;
height: 16px;
border-style: solid;
border-width: 2px;
border-top-color: transparent;
border-right-color: inherit;
border-bottom-color: inherit;
border-left-color: inherit;
border-radius: 50%;
-webkit-animation: epmXAj 1s infinite linear;
animation: epmXAj 1s infinite linear;
}

.c2 {
font-size: 1.4rem;
line-height: 1.8rem;
Expand Down Expand Up @@ -355,9 +340,8 @@ exports[`Button Test > Loading Test > Active prop change Button to hover style 1
class="c4"
>
<div
class="c5"
class="Spinner s"
data-testid="bezier-react-spinner"
size="16"
/>
</div>
</button>
Expand Down
60 changes: 60 additions & 0 deletions packages/bezier-react/src/components/Spinner/Spinner.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
@mixin size($size) {
width: $size;
height: $size;
}

@layer components {
@keyframes spin {
0% {
transform: rotate(0deg);
}

100% {
transform: rotate(360deg);
}
}

.Spinner {
--bezier-spinner-color: inherit;

display: inline-block;
border-style: solid;
border-top-color: transparent;
border-right-color: var(--bezier-spinner-color);
border-bottom-color: var(--bezier-spinner-color);
border-left-color: var(--bezier-spinner-color);
border-radius: 50%;
animation: spin 1s linear infinite;

&.xl {
@include size(50px);
border-width: 4px;
}

&.l,
&.m {
border-width: 3px;
}

&.l {
@include size(24px);
}

&.m {
@include size(20px);
}

&.s,
&.xs {
border-width: 2px;
}

&.s {
@include size(16px);
}

&.xs {
@include size(12px);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ const Template: Story<SpinnerProps> = ({ ...args }) => <Spinner {...args} />
export const Primary = Template.bind({})
Primary.args = {
size: SpinnerSize.M,
color: 'bg-black-dark',
}
55 changes: 0 additions & 55 deletions packages/bezier-react/src/components/Spinner/Spinner.styled.ts

This file was deleted.

Loading