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

chore: storybook directory change, modal component, textfield and button component revamp #75

Merged
merged 6 commits into from
Jan 12, 2025
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/tidy-drinks-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@groovy-box/ui': minor
---

storybook directory change, modal component, textfield and button component revamp
36 changes: 0 additions & 36 deletions .github/workflows/button-tests.yaml

This file was deleted.

80 changes: 40 additions & 40 deletions .github/workflows/code_coverage.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
name: Running Code Coverage

on:
push:
branches:
- dev
pull_request:
branches:
- dev

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 2

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm install

- name: Run tests
run: npm run ui:coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: apps/ui/coverage
# name: Running Code Coverage

# on:
# push:
# branches:
# - dev
# pull_request:
# branches:
# - dev

# jobs:
# build:
# runs-on: ubuntu-latest

# strategy:
# matrix:
# node-version: [20.x]

# steps:
# - name: Checkout repository
# uses: actions/checkout@v2
# with:
# fetch-depth: 2

# - name: Set up Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v3
# with:
# node-version: ${{ matrix.node-version }}

# - name: Install dependencies
# run: npm install

# - name: Run tests
# run: npm run ui:coverage

# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v4
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# directory: apps/ui/coverage
36 changes: 0 additions & 36 deletions .github/workflows/textfield-test.yaml

This file was deleted.

1 change: 1 addition & 0 deletions apps/ui/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = {
'react/prop-types': 'off',
'react/react-in-jsx-scope': 'off',
'react/no-children-prop': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
parserOptions: {
project: true,
Expand Down
88 changes: 44 additions & 44 deletions apps/ui/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,55 +4,55 @@ import { defineConfig } from 'vite';
const tsconfigPaths = require('vite-tsconfig-paths').default;

module.exports = {
stories: ['../stories/**/*.stories.@(ts|tsx|js|jsx)'],
stories: ['../lib/**/*.stories.@(ts|tsx|js|jsx)'],

viteFinal: async (config) => {
return mergeConfig(config, {
plugins: [tsconfigPaths()],
});
},

viteConfig: defineConfig({
resolve: {
alias: {
'@': '/src',
'@utils': '/utils',
},
viteFinal: async (config) => {
return mergeConfig(config, {
plugins: [tsconfigPaths()],
});
},
}),

addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-controls',
'@storybook/addon-themes',
'storybook-css-modules',
{
name: '@storybook/addon-postcss',
options: {
postcssLoaderOptions: {
implementation: require('postcss'),
viteConfig: defineConfig({
resolve: {
alias: {
'@': '/src',
'@utils': '/utils',
},
},
},
},
],
}),

// https://storybook.js.org/docs/react/configure/typescript#mainjs-configuration
typescript: {
check: true, // type-check stories during Storybook build
},
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-controls',
'@storybook/addon-themes',
'storybook-css-modules',
{
name: '@storybook/addon-postcss',
options: {
postcssLoaderOptions: {
implementation: require('postcss'),
},
},
},
],

framework: {
name: '@storybook/react-vite',
// options: {
// legacyRootApi: true,
// builder: {
// viteConfigPath: './vite.config.ts',
// },
// },
},
// https://storybook.js.org/docs/react/configure/typescript#mainjs-configuration
typescript: {
check: true, // type-check stories during Storybook build
},

docs: {
autodocs: true,
},
framework: {
name: '@storybook/react-vite',
// options: {
// legacyRootApi: true,
// builder: {
// viteConfigPath: './vite.config.ts',
// },
// },
},

docs: {
autodocs: true,
},
};
100 changes: 50 additions & 50 deletions apps/ui/.storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,69 +1,69 @@
// https://storybook.js.org/docs/react/writing-stories/parameters#global-parameters
import '../lib/tailwind.css';
import '../lib/color-scheme.css';
import { withGlobalStyles } from './decorator';
import '@groovy-box/tokens/src/fonts.css';

const customViewports = {
xs: {
name: 'XS',
styles: {
width: '350px',
height: '963px',
xs: {
name: 'XS',
styles: {
width: '350px',
height: '963px',
},
},
},
sm: {
name: 'SM',
styles: {
width: '600px',
height: '801px',
sm: {
name: 'SM',
styles: {
width: '600px',
height: '801px',
},
},
},
md: {
name: 'MD',
styles: {
width: '900px',
height: '801px',
md: {
name: 'MD',
styles: {
width: '900px',
height: '801px',
},
},
},
lg: {
name: 'LG',
styles: {
width: '1200px',
height: '801px',
lg: {
name: 'LG',
styles: {
width: '1200px',
height: '801px',
},
},
},
xl: {
name: 'XL',
styles: {
width: '1536px',
height: '801px',
xl: {
name: 'XL',
styles: {
width: '1536px',
height: '801px',
},
},
},
};

export const parameters = {
// https://storybook.js.org/docs/react/essentials/actions#automatically-matching-args
actions: { argTypesRegex: '^on.*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
// https://storybook.js.org/docs/react/essentials/actions#automatically-matching-args
actions: { argTypesRegex: '^on.*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
visualViewport: {
customViewports,
},
},
visualViewport: {
customViewports,
},
};

export const globalTypes = {
scheme: {
name: 'Scheme',
description: 'Select light or dark',
defaultValue: 'light',
toolbar: {
icon: 'mirror',
items: ['light', 'dark'],
dynamicTitle: true,
scheme: {
name: 'Scheme',
description: 'Select light or dark',
defaultValue: 'light',
toolbar: {
icon: 'mirror',
items: ['light', 'dark'],
dynamicTitle: true,
},
},
},
};
Loading