Skip to content

Commit

Permalink
Merge pull request #75 from SySagar/dev
Browse files Browse the repository at this point in the history
chore: storybook directory change, modal component, textfield and button component revamp
  • Loading branch information
SySagar authored Jan 12, 2025
2 parents 0dfa277 + e138034 commit d7d36e6
Show file tree
Hide file tree
Showing 37 changed files with 1,515 additions and 1,033 deletions.
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

0 comments on commit d7d36e6

Please sign in to comment.