Skip to content

Commit

Permalink
Merge pull request #182 from brainstormforce/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
vrundakansara authored Nov 7, 2024
2 parents 2250c2e + 4129af9 commit 66b33e3
Show file tree
Hide file tree
Showing 44 changed files with 14,766 additions and 14,792 deletions.
27,595 changes: 13,274 additions & 14,321 deletions package-lock.json

Large diffs are not rendered by default.

247 changes: 127 additions & 120 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,124 +1,131 @@
{
"name": "@bsf/force-ui",
"version": "1.0.0",
"description": "Library of components for the BSF project",
"main": "./dist/force-ui.js",
"module": "./dist/force-ui.js",
"type": "module",
"exports": {
"./package.json": "./package.json",
".": {
"import": "./dist/force-ui.js",
"types": "./dist/force-ui.d.ts"
"name": "@bsf/force-ui",
"version": "1.0.0",
"description": "Library of components for the BSF project",
"main": "./dist/force-ui.js",
"module": "./dist/force-ui.js",
"type": "module",
"exports": {
"./package.json": "./package.json",
".": {
"import": "./dist/force-ui.js",
"types": "./dist/force-ui.d.ts"
},
"./withTW": {
"import": "./dist/withTW.js",
"types": "./dist/withTW.d.ts",
"require": "./dist/withTW.cjs"
}
},
"./withTW": {
"import": "./dist/withTW.js",
"types": "./dist/withTW.d.ts",
"require": "./dist/withTW.cjs"
}
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "cross-env tsc -b && vite build",
"start": "cross-env tsc -b && vite build -w",
"pretty-fix": "prettier --write .",
"pretty-lint": "prettier --check .",
"lint:js": "eslint ./src",
"eslint:js-fix": "eslint ./src --fix",
"lint:js-fix": "npm run pretty-fix && npm run eslint:js-fix",
"lint:css": "stylelint **/*.{scss,css}",
"lint:css-fix": "stylelint **/*.{scss,css} --fix",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"chromatic": "npx chromatic --project-token CHROMATIC_PROJECT_TOKEN",
"package": "sh bin/build.sh",
"release": "npm run build && npm run package ",
"deploy-storybook": "storybook-to-ghpages"
},
"repository": {
"type": "git",
"url": "git+https://github.com/rahulvarma722/bsf-admin-ui.git"
},
"volta": {
"node": "18.15.0"
},
"keywords": [
"bsf",
"components",
"library"
],
"license": "ISC",
"peerDependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"dependencies": {
"@emotion/is-prop-valid": "^1.3.0",
"@floating-ui/react": "^0.26.20",
"@lexical/react": "^0.17.0",
"@lexical/utils": "^0.17.0",
"clsx": "^2.1.1",
"date-fns": "^4.1.0",
"deepmerge": "^4.3.1",
"framer-motion": "^11.3.29",
"lexical": "^0.17.0",
"lodash": "^4.17.21",
"lucide-react": "^0.417.0",
"nanoid": "^5.0.7",
"react-day-picker": "^9.1.3",
"styled-components": "^6.1.12",
"tailwind-merge": "^2.4.0",
"tailwindcss-scoped-preflight": "^3.4.3"
},
"devDependencies": {
"@chromatic-com/storybook": "^1.9.0",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.13.0",
"@storybook/addon-essentials": "^8.3.5",
"@storybook/addon-interactions": "^8.3.5",
"@storybook/addon-links": "^8.3.5",
"@storybook/addon-onboarding": "^8.3.5",
"@storybook/blocks": "^8.3.5",
"@storybook/react": "^8.3.5",
"@storybook/react-vite": "^8.3.5",
"@storybook/storybook-deployer": "^2.8.16",
"@storybook/test": "^8.3.5",
"@tailwindcss/container-queries": "^0.1.1",
"@types/react": "^18.3.10",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^8.11.0",
"@vitejs/plugin-react": "^4.3.2",
"@wordpress/eslint-plugin": "^20.3.0",
"@wordpress/prettier-config": "^4.4.0",
"@wordpress/stylelint-config": "^23.2.0",
"autoprefixer": "^10.4.19",
"chromatic": "^11.7.1",
"cross-env": "^7.0.3",
"eslint": "^8.41.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
"eslint-plugin-react-refresh": "^0.4.12",
"eslint-plugin-storybook": "^0.9.0",
"globals": "^15.9.0",
"postcss": "^8.4.39",
"prettier": "^3.2.5",
"storybook": "^8.3.5",
"storybook-addon-paddings": "^6.0.2",
"stylelint": "^16.8.2",
"tailwindcss": "^3.4.10",
"typescript": "5.4.2",
"typescript-eslint": "^8.7.0",
"vite": "^5.4.8",
"vite-plugin-dts": "^4.2.3"
},
"browserslist": [
"last 1 version",
"> 1%",
"IE 10"
],
"bugs": {
"url": "https://github.com/rahulvarma722/bsf-admin-ui/issues"
},
"homepage": "https://github.com/rahulvarma722/bsf-admin-ui#readme"
"import": "./dist/withTW.js",
"types": "./dist/withTW.d.ts",
"require": "./dist/withTW.cjs"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "cross-env tsc -b && vite build",
"start": "cross-env tsc -b && vite build -w",
"pretty-fix": "prettier --write .",
"pretty-lint": "prettier --check .",
"lint:js": "eslint ./src",
"eslint:js-fix": "eslint ./src --fix",
"lint:js-fix": "npm run pretty-fix && npm run eslint:js-fix",
"lint:css": "stylelint **/*.{scss,css}",
"lint:css-fix": "stylelint **/*.{scss,css} --fix",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"chromatic": "npx chromatic --project-token CHROMATIC_PROJECT_TOKEN",
"package": "sh bin/build.sh",
"release": "npm run build && npm run package ",
"deploy-storybook": "storybook-to-ghpages"
},
"repository": {
"type": "git",
"url": "git+https://github.com/rahulvarma722/bsf-admin-ui.git"
},
"volta": {
"node": "18.15.0"
},
"keywords": [
"bsf",
"components",
"library"
],
"license": "ISC",
"peerDependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"dependencies": {
"@emotion/is-prop-valid": "^1.3.0",
"@floating-ui/react": "^0.26.20",
"@lexical/react": "^0.17.0",
"@lexical/utils": "^0.17.0",
"clsx": "^2.1.1",
"date-fns": "^4.1.0",
"deepmerge": "^4.3.1",
"framer-motion": "^11.3.29",
"lexical": "^0.17.0",
"lodash": "^4.17.21",
"lucide-react": "^0.417.0",
"nanoid": "^5.0.7",
"react-day-picker": "^9.1.3",
"recharts": "^2.13.0",
"styled-components": "^6.1.12",
"tailwind-merge": "^2.4.0",
"tailwindcss-scoped-preflight": "^3.4.3"
},
"devDependencies": {
"@chromatic-com/storybook": "^1.9.0",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.13.0",
"@storybook/addon-essentials": "^8.3.5",
"@storybook/addon-interactions": "^8.3.5",
"@storybook/addon-links": "^8.3.5",
"@storybook/addon-onboarding": "^8.3.5",
"@storybook/blocks": "^8.3.5",
"@storybook/react": "^8.3.5",
"@storybook/react-vite": "^8.3.5",
"@storybook/storybook-deployer": "^2.8.16",
"@storybook/test": "^8.3.5",
"@tailwindcss/container-queries": "^0.1.1",
"@types/lodash": "^4.17.13",
"@types/react": "^18.3.10",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^8.11.0",
"@vitejs/plugin-react": "^4.3.2",
"@wordpress/eslint-plugin": "^20.3.0",
"@wordpress/prettier-config": "^4.4.0",
"@wordpress/stylelint-config": "^23.2.0",
"autoprefixer": "^10.4.19",
"chromatic": "^11.7.1",
"cross-env": "^7.0.3",
"eslint": "^8.41.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
"eslint-plugin-react-refresh": "^0.4.12",
"eslint-plugin-storybook": "^0.9.0",
"globals": "^15.9.0",
"postcss": "^8.4.39",
"prettier": "^3.2.5",
"storybook": "^8.3.5",
"storybook-addon-paddings": "^6.0.2",
"stylelint": "^16.8.2",
"tailwindcss": "^3.4.10",
"typescript": "5.4.2",
"typescript-eslint": "^8.7.0",
"vite": "^5.4.8",
"vite-plugin-dts": "^4.2.3"
},
"browserslist": [
"last 1 version",
"> 1%",
"IE 10"
],
"bugs": {
"url": "https://github.com/rahulvarma722/bsf-admin-ui/issues"
},
"homepage": "https://github.com/rahulvarma722/bsf-admin-ui#readme"
}
2 changes: 1 addition & 1 deletion src/components/accordion/accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export const AccordionTrigger = ( {
return (
<ChevronDown
className={ cn(
'flex-shrink-0 text-icon-secondary transition-transform duration-300 ease-in-out',
'flex-shrink-0 text-icon-secondary size-5 transition-transform duration-300 ease-in-out',
isOpen ? 'rotate-180' : 'rotate-0'
) }
/>
Expand Down
13 changes: 13 additions & 0 deletions src/components/alert/alert.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,19 @@ export const Success: Story = {
},
};

export const WithLongStringAndWithoutCloseButton: Story = {
args: {
variant: 'neutral',
content: (
<p className="m-0">
<b className="mr-1">Designer’s Note:</b>Adjusting or changing
components here will update it on all other pages or templates
where it is been used
</p>
),
},
};

export const Stack: Story = {
args: {
variant: 'info',
Expand Down
28 changes: 10 additions & 18 deletions src/components/alert/alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,20 @@ import { X } from 'lucide-react';
export interface AlertProps {
/** Defines the style variant of the alert. */
variant?: 'neutral' | 'info' | 'warning' | 'error' | 'success';

/** Defines the theme of the alert. */
theme?: 'light' | 'dark';

/** Defines the design of the alert. */
design?: 'inline' | 'stack';

/** Defines the title of the alert. */
title?: string;

title?: React.ReactNode;
/** Defines the content of the alert. */
content?: string;

content?: React.ReactNode;
/** Defines the extra classes. */
className?: string;

/** Callback function for close event. */
onClose?: () => void;

/** Custom Icon for the alert. */
icon?: React.ReactElement | null;

/** Defines the action of the alert. */
action?: {
label: string;
Expand Down Expand Up @@ -95,7 +87,7 @@ const Alert = ( {
<div className="self-start flex items-center justify-center [&_svg]:size-5 shrink-0">
{ getIcon( { variant, icon, theme } ) }
</div>
<div className="flex flex-col items-start justify-start gap-0.5">
<div className="flex flex-col items-start justify-start gap-0.5 mr-7">
{ getTitle( { title, theme } ) }
{ getContent( { content, theme } ) }
{ action?.label &&
Expand Down Expand Up @@ -141,14 +133,14 @@ const Alert = ( {
<div className="self-start flex items-center justify-center [&_svg]:size-5 shrink-0">
{ getIcon( { variant, icon, theme } ) }
</div>
<div className="flex items-start justify-start gap-1 mr-10 [&>span:first-child]:shrink-0 px-1">
{ getTitle( { title, theme } ) }
{ getContent( { content, theme } ) }
</div>
<p className="content-start space-x-1 my-0 mr-10 px-1">
{ getTitle( { title, theme, inline: true } ) }
{ getContent( { content, theme, inline: true } ) }
</p>
</div>
<div className="flex items-center justify-start gap-4 [&_svg]:size-4">
<div className="flex h-full justify-start gap-4 [&_svg]:size-4">
{ action?.label && typeof action?.onClick === 'function' && (
<div className="flex h-5">
<div className="self-center flex h-5">
{ getAction( {
actionLabel: action?.label,
actionType: action?.type ?? 'button',
Expand All @@ -160,7 +152,7 @@ const Alert = ( {
{ typeof onClose === 'function' && (
<button
className={ cn(
'bg-transparent m-0 border-none p-0.5 focus:outline-none active:outline-none cursor-pointer size-5',
'self-start bg-transparent m-0 border-none p-0.5 focus:outline-none active:outline-none cursor-pointer size-5',
closeIconClassNames[ theme ] ??
closeIconClassNames.light
) }
Expand Down
Loading

0 comments on commit 66b33e3

Please sign in to comment.