react-restyle-components 0.2.38 → 0.2.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -4
- package/lib/package.json +2 -2
- package/lib/src/App.js +1 -1
- package/lib/src/core-components/atoms/button/Button.stories.d.ts +3 -3
- package/lib/src/core-components/atoms/button/Button.stories.js +1 -1
- package/lib/src/core-components/atoms/button/_button.component.d.ts +7 -0
- package/lib/src/core-components/atoms/button/_button.component.js +20 -0
- package/lib/src/core-components/atoms/button/button.component.d.ts +0 -1
- package/lib/src/core-components/atoms/button/button.component.js +5 -4
- package/lib/src/core-components/atoms/button/buttonGroup/buttonGroup.component.d.ts +1 -1
- package/lib/src/core-components/atoms/button/buttonGroup/buttonGroup.component.js +1 -1
- package/lib/src/core-components/atoms/check-box/checkBox.component.d.ts +1 -1
- package/lib/src/core-components/atoms/check-box/checkBox.component.js +1 -1
- package/lib/src/core-components/atoms/date-picker/date-picker.component.d.ts +1 -1
- package/lib/src/core-components/atoms/date-picker/date-picker.component.js +1 -1
- package/lib/src/core-components/atoms/form/form.component.d.ts +1 -1
- package/lib/src/core-components/atoms/form/form.component.js +1 -1
- package/lib/src/core-components/atoms/grid/grid.component.d.ts +1 -1
- package/lib/src/core-components/atoms/grid/grid.component.js +1 -1
- package/lib/src/core-components/atoms/icons/icons.component.d.ts +1 -1
- package/lib/src/core-components/atoms/icons/icons.component.js +1 -1
- package/lib/src/core-components/atoms/input/input-otp.component.d.ts +1 -1
- package/lib/src/core-components/atoms/input/input-otp.component.js +1 -1
- package/lib/src/core-components/atoms/input/input-pin.component.d.ts +1 -1
- package/lib/src/core-components/atoms/input/input-pin.component.js +1 -1
- package/lib/src/core-components/atoms/input/input.component.d.ts +1 -1
- package/lib/src/core-components/atoms/input/input.component.js +1 -1
- package/lib/src/core-components/atoms/input-dropdown/input-dropdown.component.d.ts +1 -1
- package/lib/src/core-components/atoms/input-dropdown/input-dropdown.component.js +1 -1
- package/lib/src/core-components/atoms/list/list.component.d.ts +1 -1
- package/lib/src/core-components/atoms/list/list.component.js +1 -1
- package/lib/src/core-components/atoms/loader/loader.component.d.ts +1 -1
- package/lib/src/core-components/atoms/loader/loader.component.js +1 -1
- package/lib/src/core-components/atoms/radio/radio.component.d.ts +1 -1
- package/lib/src/core-components/atoms/radio/radio.component.js +1 -1
- package/lib/src/core-components/atoms/stepper/stepper.component.d.ts +1 -1
- package/lib/src/core-components/atoms/stepper/stepper.component.js +1 -1
- package/lib/src/core-components/atoms/tabs/_tabs.component.d.ts +16 -0
- package/lib/src/core-components/atoms/tabs/_tabs.component.js +19 -0
- package/lib/src/core-components/atoms/tabs/tabs.component.js +0 -1
- package/lib/src/core-components/atoms/tabs/tabs.stories.d.ts +1 -1
- package/lib/src/core-components/atoms/tabs/tabs.stories.js +1 -1
- package/lib/src/core-components/atoms/timer/timer.component.d.ts +1 -1
- package/lib/src/core-components/atoms/timer/timer.component.js +1 -1
- package/lib/src/core-components/index.d.ts +32 -0
- package/lib/src/core-components/index.js +32 -32
- package/lib/src/core-components/molecules/auto-complete-filter-multiple-select-multiple-fields-display/auto-complete-filter-multiple-select-multiple-fields-display.component.d.ts +1 -1
- package/lib/src/core-components/molecules/auto-complete-filter-multiple-select-multiple-fields-display/auto-complete-filter-multiple-select-multiple-fields-display.component.js +1 -1
- package/lib/src/core-components/molecules/auto-complete-filter-single-select-multiple-fields-display/auto-complete-filter-single-select-multiple-fields-display.component.d.ts +1 -1
- package/lib/src/core-components/molecules/auto-complete-filter-single-select-multiple-fields-display/auto-complete-filter-single-select-multiple-fields-display.component.js +1 -1
- package/lib/src/core-components/molecules/auto-complete-group-by/auto-complete-group-by.component.d.ts +1 -1
- package/lib/src/core-components/molecules/auto-complete-group-by/auto-complete-group-by.component.js +1 -1
- package/lib/src/core-components/molecules/autocomplete/autocomplete.d.ts +1 -1
- package/lib/src/core-components/molecules/autocomplete/autocomplete.js +1 -1
- package/lib/src/core-components/molecules/color-picker-modal/color-picker-modal.component.d.ts +1 -1
- package/lib/src/core-components/molecules/color-picker-modal/color-picker-modal.component.js +1 -1
- package/lib/src/core-components/molecules/css-multiline-input/css-multiline-input.component.d.ts +1 -1
- package/lib/src/core-components/molecules/css-multiline-input/css-multiline-input.component.js +1 -1
- package/lib/src/core-components/molecules/multi-select/multi-select.component.d.ts +1 -1
- package/lib/src/core-components/molecules/multi-select/multi-select.component.js +1 -1
- package/lib/src/core-components/molecules/multi-select-with-field/multi-select-with-field.component.js +7 -7
- package/lib/src/core-utils/utility.util.d.ts +0 -1
- package/lib/src/core-utils/utility.util.js +0 -3
- package/lib/src/tc.module.css +0 -1
- package/package.json +2 -2
package/README.md
CHANGED
package/lib/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-restyle-components",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.39",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easy use restyle components",
|
|
6
6
|
"author": {
|
|
@@ -71,6 +71,7 @@
|
|
|
71
71
|
"@storybook/addon-interactions": "^8.0.6",
|
|
72
72
|
"@storybook/addon-links": "^8.0.6",
|
|
73
73
|
"@storybook/addon-onboarding": "^8.0.6",
|
|
74
|
+
"@storybook/addon-postcss": "^2.0.0",
|
|
74
75
|
"@storybook/addon-themes": "^8.4.7",
|
|
75
76
|
"@storybook/addon-webpack5-compiler-swc": "^1.0.2",
|
|
76
77
|
"@storybook/blocks": "^8.0.6",
|
|
@@ -92,7 +93,6 @@
|
|
|
92
93
|
"husky": "^7.0.4",
|
|
93
94
|
"jest": "^29.7.0",
|
|
94
95
|
"lint-staged": "^12.4.0",
|
|
95
|
-
"postcss": "^8.4.49",
|
|
96
96
|
"postcss-loader": "^8.1.1",
|
|
97
97
|
"prettier": "^3.3.3",
|
|
98
98
|
"react-router-dom": "^7.0.2",
|
package/lib/src/App.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import './App.css';
|
|
3
|
-
import { Tab, Tabs } from './core-components';
|
|
3
|
+
import { Tab, Tabs } from './core-components/atoms/tabs/_tabs.component';
|
|
4
4
|
function App() {
|
|
5
5
|
const [color, setColor] = useState('#aabbcc');
|
|
6
6
|
return (React.createElement("div", { className: "flex flex-col gap-4 p-4" },
|
|
@@ -31,7 +31,7 @@ declare const meta: {
|
|
|
31
31
|
suppressContentEditableWarning?: boolean | undefined;
|
|
32
32
|
suppressHydrationWarning?: boolean | undefined;
|
|
33
33
|
accessKey?: string | undefined;
|
|
34
|
-
autoCapitalize?: "off" | "
|
|
34
|
+
autoCapitalize?: (string & {}) | "off" | "on" | "none" | "sentences" | "words" | "characters" | undefined;
|
|
35
35
|
autoFocus?: boolean | undefined;
|
|
36
36
|
contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
37
37
|
contextMenu?: string | undefined;
|
|
@@ -72,7 +72,7 @@ declare const meta: {
|
|
|
72
72
|
results?: number | undefined;
|
|
73
73
|
security?: string | undefined;
|
|
74
74
|
unselectable?: "off" | "on" | undefined;
|
|
75
|
-
inputMode?: "search" | "text" | "
|
|
75
|
+
inputMode?: "search" | "text" | "email" | "tel" | "url" | "none" | "numeric" | "decimal" | undefined;
|
|
76
76
|
is?: string | undefined;
|
|
77
77
|
"aria-activedescendant"?: string | undefined;
|
|
78
78
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
@@ -86,7 +86,7 @@ declare const meta: {
|
|
|
86
86
|
"aria-colindextext"?: string | undefined;
|
|
87
87
|
"aria-colspan"?: number | undefined;
|
|
88
88
|
"aria-controls"?: string | undefined;
|
|
89
|
-
"aria-current"?: boolean | "time" | "
|
|
89
|
+
"aria-current"?: boolean | "time" | "date" | "true" | "false" | "page" | "step" | "location" | undefined;
|
|
90
90
|
"aria-describedby"?: string | undefined;
|
|
91
91
|
"aria-description"?: string | undefined;
|
|
92
92
|
"aria-details"?: string | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TooltipProvider } from '../tooltip/tooltip.component';
|
|
3
|
-
import { Button } from './
|
|
3
|
+
import { Button } from './_button.component';
|
|
4
4
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction
|
|
5
5
|
const meta = {
|
|
6
6
|
title: 'Design System/Atoms/Button',
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ButtonProps } from './Button.types';
|
|
3
|
+
import '../../../tc.module.css';
|
|
4
|
+
/**
|
|
5
|
+
* It's a `<button>button</button>`. Pass in regular button props such as onClick as well as any of the props defined here.
|
|
6
|
+
*/
|
|
7
|
+
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { Tooltip } from '../tooltip/tooltip.component';
|
|
4
|
+
import '../../../tc.module.css';
|
|
5
|
+
/**
|
|
6
|
+
* It's a `<button>button</button>`. Pass in regular button props such as onClick as well as any of the props defined here.
|
|
7
|
+
*/
|
|
8
|
+
export const Button = forwardRef(({ variant = 'solid', tooltip, disabled = false, type = 'button', className, children, ...args }, ref) => {
|
|
9
|
+
const buttonColorClass = variant === 'solid'
|
|
10
|
+
? 'text-white bg-[#007BFF] hover:bg-[#007BFF] hover:shadow-lg text-white'
|
|
11
|
+
: 'dark:text-white text-black border border-gray-400 hover:shadow-lg';
|
|
12
|
+
const button = (React.createElement("button", { ref: ref, ...args, className: `${className} rounded-100px px-3 py-1 text-md ${buttonColorClass} pt-2 pb-2 font-nunitoSansRegular ${disabled ? 'opacity-50' : 'opacity-100'}`, type: type, disabled: disabled }, children));
|
|
13
|
+
if (tooltip) {
|
|
14
|
+
return React.createElement(Tooltip, { content: tooltip }, button);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
return button;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
Button.displayName = 'Button';
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import { Tooltip } from '../tooltip/tooltip.component';
|
|
4
|
-
import '../../../tc.css';
|
|
4
|
+
import s from '../../../tc.module.css';
|
|
5
|
+
import { cn } from '../../../core-utils';
|
|
5
6
|
/**
|
|
6
7
|
* It's a `<button>button</button>`. Pass in regular button props such as onClick as well as any of the props defined here.
|
|
7
8
|
*/
|
|
8
9
|
export const Button = forwardRef(({ variant = 'solid', tooltip, disabled = false, type = 'button', className, children, ...args }, ref) => {
|
|
9
10
|
const buttonColorClass = variant === 'solid'
|
|
10
|
-
? 'text-white bg-[#007BFF] hover:bg-[#007BFF] hover:shadow-lg text-white'
|
|
11
|
-
: 'dark:text-white
|
|
12
|
-
const button = (React.createElement("button", { ref: ref, ...args, className:
|
|
11
|
+
? cn(s['text-white'], s['bg-[#007BFF]'], s['hover:bg-[#007BFF]'], s['hover:shadow-lg'], s['text-white'])
|
|
12
|
+
: cn(s['dark:text-white'], s['text-black'], s['border'], s['border-gray-400'], s['hover:shadow-lg']);
|
|
13
|
+
const button = (React.createElement("button", { ref: ref, ...args, className: cn(s['rounded-100px'], s['px-3'], s['py-1'], s['text-md'], buttonColorClass, s['pt-2'], s['pb-2'], s['font-nunitoSansRegular'], disabled ? s['opacity-50'] : s['opacity-100'], className), type: type, disabled: disabled }, children));
|
|
13
14
|
if (tooltip) {
|
|
14
15
|
return React.createElement(Tooltip, { content: tooltip }, button);
|
|
15
16
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import '../../../../tc.css';
|
|
3
|
+
import '../../../../tc.module.css';
|
|
4
4
|
export declare const ButtonGroup: ({ children, orientation, className, }: {
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
orientation?: "horizontal" | "vertical" | undefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import '../../../../tc.css';
|
|
2
|
+
import '../../../../tc.module.css';
|
|
3
3
|
export const ButtonGroup = ({ children, orientation = 'horizontal', className, }) => (React.createElement("div", { className: `flex ${orientation == 'horizontal' ? 'flex-row' : 'flex-col'} w-fit gap-2 ${className}` }, children));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import '../../../tc.css';
|
|
2
|
+
import '../../../tc.module.css';
|
|
3
3
|
import { UnCheckbox, CheckedBox } from '../../../library/assets/svg';
|
|
4
4
|
import { InputWrapper } from '../form/form.component';
|
|
5
5
|
export const CheckBox = ({ title = 'Banks', data = [{ title: 'SBI Bank', checked: false }], className, onChange, }) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState, forwardRef } from 'react';
|
|
2
|
-
import '../../../tc.css';
|
|
2
|
+
import '../../../tc.module.css';
|
|
3
3
|
import DatePicker from 'react-datepicker';
|
|
4
4
|
import 'react-datepicker/dist/react-datepicker.css';
|
|
5
5
|
import { DatePickerSvg } from '../../../library/assets/svg';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
import '../../../tc.css';
|
|
3
|
+
import '../../../tc.module.css';
|
|
4
4
|
export const Label = (props) => (React.createElement(React.Fragment, null,
|
|
5
5
|
React.createElement("label", { htmlFor: props.htmlFor, className: `${props.hasError ? 'text-red-400' : 'text-current'} block text-3xs font-medium mb-1`, style: { ...props.style } }, props.children)));
|
|
6
6
|
export const InputWrapper = (props) => (React.createElement("div", { className: props.className, ref: props.ref },
|
|
@@ -2,7 +2,7 @@ import React, { Suspense } from 'react';
|
|
|
2
2
|
import _ from 'lodash';
|
|
3
3
|
import { Tooltip } from '../tooltip/tooltip.component';
|
|
4
4
|
import loadable from '@loadable/component';
|
|
5
|
-
import '../../../tc.css';
|
|
5
|
+
import '../../../tc.module.css';
|
|
6
6
|
let lib = 'md';
|
|
7
7
|
export const Icon = ({ nameIcon, propsIcon, tooltip = '', isDisable = false, onClick, }) => {
|
|
8
8
|
try {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
2
|
import React, { useEffect, useRef } from 'react';
|
|
3
3
|
import './input-otp.styles.css';
|
|
4
|
-
import '../../../tc.css';
|
|
4
|
+
import '../../../tc.module.css';
|
|
5
5
|
export const InputOtp = ({ className, pin, onPinChanged, }) => {
|
|
6
6
|
const pinLength = 6;
|
|
7
7
|
const Pin_Min_Value = 0;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
import React, { useRef, useState } from 'react';
|
|
3
3
|
import './input.styles.css';
|
|
4
|
-
import '../../../tc.css';
|
|
4
|
+
import '../../../tc.module.css';
|
|
5
5
|
export const InputPin = ({ title, className, defaultPin, errorMsg, defaultMsg, hasError, onPinChanged, }) => {
|
|
6
6
|
const pin = useRef([]);
|
|
7
7
|
const [reload, setReload] = useState(false);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
3
|
import './input.styles.css';
|
|
4
|
-
import '../../../tc.css';
|
|
4
|
+
import '../../../tc.module.css';
|
|
5
5
|
export const Input = ({ title, defaultValue, className, disable, hasError, errorMsg, defaultMsg, inputStyle, autoComplete, maxlength = 40, onChange, onBlur, }) => {
|
|
6
6
|
const [value, setValue] = useState(defaultValue);
|
|
7
7
|
const onKeyUpValue = (event) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useEffect, useRef } from 'react';
|
|
2
2
|
import { UpArrow, DownArrow } from '../../../library/assets/svg';
|
|
3
|
-
import '../../../tc.css';
|
|
3
|
+
import '../../../tc.module.css';
|
|
4
4
|
export const InputDropdown = ({ items, className, hasError, title, onChange, }) => {
|
|
5
5
|
const [isOpen, setIsOpen] = useState(false);
|
|
6
6
|
const [value, setValue] = useState('');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Container, Row, Spinner } from 'reactstrap';
|
|
3
|
-
import '../../../tc.css';
|
|
3
|
+
import '../../../tc.module.css';
|
|
4
4
|
export const Loader = () => (React.createElement(Container, { fluid: true, className: "vh-50 d-flex" },
|
|
5
5
|
React.createElement(Row, { className: "justify-content-center align-self-center w-100 text-center" },
|
|
6
6
|
React.createElement(Spinner, { color: "primary" }))));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { CheckedRadio, UncheckRadio } from '../../../library/assets/svg';
|
|
3
3
|
import { InputWrapper } from '../form/form.component';
|
|
4
|
-
import '../../../tc.css';
|
|
4
|
+
import '../../../tc.module.css';
|
|
5
5
|
export const Radio = ({ title = 'Source', data = [], className, onChange, }) => {
|
|
6
6
|
const [list, setList] = useState(data);
|
|
7
7
|
const width = 20;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import '../../../tc.css';
|
|
2
|
+
import '../../../tc.module.css';
|
|
3
3
|
export const Stepper = ({ className = '', steps, currentStep = 1, onStepClick, }) => {
|
|
4
4
|
const finalClass = `${className} w-full px-4 sm:px-8`;
|
|
5
5
|
const progressClass = 'absolute my-4 top-1/2 left-0 h-0.5 transform -translate-y-1/2 bg-orange transition-width ease-in-out duration-500';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface TabProps {
|
|
3
|
+
title: string;
|
|
4
|
+
children: React.JSX.Element;
|
|
5
|
+
}
|
|
6
|
+
export declare const Tab: ({ title, children }: TabProps) => React.JSX.Element;
|
|
7
|
+
export interface TabsProps {
|
|
8
|
+
options: Array<{
|
|
9
|
+
title: string;
|
|
10
|
+
content?: React.JSX.Element;
|
|
11
|
+
inActive?: boolean;
|
|
12
|
+
}>;
|
|
13
|
+
children: React.JSX.Element[];
|
|
14
|
+
}
|
|
15
|
+
export declare const Tabs: ({ options, children }: TabsProps) => React.JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { cn } from '../../../core-utils';
|
|
3
|
+
export const Tab = ({ title, children }) => {
|
|
4
|
+
return (React.createElement("div", { className: cn('flex'), key: title }, children));
|
|
5
|
+
};
|
|
6
|
+
export const Tabs = ({ options, children }) => {
|
|
7
|
+
const [activeTab, setActiveTab] = useState(0);
|
|
8
|
+
const [selected, setSelected] = useState(options[0].title);
|
|
9
|
+
const tabs = React.Children.toArray(children).filter((child) => React.isValidElement(child) && child.type === Tab);
|
|
10
|
+
return (React.createElement(React.Fragment, null,
|
|
11
|
+
React.createElement("div", { className: cn('flex flex-col w-full') },
|
|
12
|
+
React.createElement("div", { className: cn('flex border-b') }, options?.map((tab, index) => (React.createElement("button", { type: "button", key: index, className: cn('py-2', 'px-4', 'mr-1', 'border-none', 'rounded-t-md', 'shadow-inner', 'cursor-pointer', activeTab === index && 'bg-blue-500', activeTab === index && 'border-none', activeTab === index && 'text-white'), onClick: () => {
|
|
13
|
+
setSelected(tab?.title);
|
|
14
|
+
!tab.inActive && setActiveTab(index);
|
|
15
|
+
}, disabled: tab.inActive }, tab.title)))),
|
|
16
|
+
React.createElement("div", { className: cn('p-2', 'border', 'border-solid', 'border-slate-600', 'rounded-b-md') }, options[activeTab]?.content
|
|
17
|
+
? options[activeTab]?.content
|
|
18
|
+
: tabs[options?.findIndex((item) => item.title === selected)]))));
|
|
19
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Tabs, Tab } from './
|
|
2
|
+
import { Tabs, Tab } from './_tabs.component';
|
|
3
3
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction
|
|
4
4
|
const meta = {
|
|
5
5
|
title: 'Design System/Atoms/Tabs',
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
|
3
3
|
import React, { useEffect, useState, useImperativeHandle } from 'react';
|
|
4
4
|
import { TimerSVG } from '../../../library/assets/svg';
|
|
5
|
-
import '../../../tc.css';
|
|
5
|
+
import '../../../tc.module.css';
|
|
6
6
|
// eslint-disable-next-line react/display-name
|
|
7
7
|
export const Timer = React.forwardRef(({ onClear }, ref) => {
|
|
8
8
|
const width = 15;
|
|
@@ -1 +1,33 @@
|
|
|
1
|
+
import * as Form from './atoms/form/form.component';
|
|
2
|
+
export * from './atoms/button/button.component';
|
|
3
|
+
export * from './atoms/button/buttonGroup/buttonGroup.component';
|
|
4
|
+
export * from './atoms/check-box/checkBox.component';
|
|
5
|
+
export * from './atoms/date-picker/date-picker.component';
|
|
6
|
+
export * from './atoms/input/input-otp.component';
|
|
7
|
+
export * from './atoms/input/input-pin.component';
|
|
8
|
+
export * from './atoms/input/input.component';
|
|
9
|
+
export * from './atoms/input-dropdown/input-dropdown.component';
|
|
10
|
+
export * from './atoms/loader/loader.component';
|
|
11
|
+
export * from './atoms/radio/radio.component';
|
|
12
|
+
export * from './atoms/stepper/stepper.component';
|
|
13
|
+
export * from './atoms/timer/timer.component';
|
|
14
|
+
export * from './atoms/tooltip/tooltip.component';
|
|
15
|
+
export * from './atoms/icons/icons.component';
|
|
1
16
|
export * from './atoms/tabs/tabs.component';
|
|
17
|
+
export * from './atoms/grid/grid.component';
|
|
18
|
+
export * from './atoms/list/list.component';
|
|
19
|
+
export * from './atoms/pdf/pdf-images.components';
|
|
20
|
+
export * from './atoms/pdf/pdf-table.components';
|
|
21
|
+
export * from './atoms/pdf/pdf-typography.components';
|
|
22
|
+
export * from './atoms/pdf/pdf-wrapped-view.components';
|
|
23
|
+
export * from './molecules/css-multiline-input/css-multiline-input.component';
|
|
24
|
+
export * from './molecules/auto-complete-filter-multiple-select-multiple-fields-display/auto-complete-filter-multiple-select-multiple-fields-display.component';
|
|
25
|
+
export * from './molecules/auto-complete-filter-single-select-multiple-fields-display/auto-complete-filter-single-select-multiple-fields-display.component';
|
|
26
|
+
export * from './molecules/multi-select/multi-select.component';
|
|
27
|
+
export * from './molecules/multi-select-with-field/multi-select-with-field.component';
|
|
28
|
+
export * from './molecules/modal-confirm/modal-confirm.component';
|
|
29
|
+
export * from './molecules/autocomplete/autocomplete';
|
|
30
|
+
export * from './molecules/auto-complete-group-by/auto-complete-group-by.component';
|
|
31
|
+
export * from './molecules/color-picker/color-picker.component';
|
|
32
|
+
export * from './molecules/color-picker-modal/color-picker-modal.component';
|
|
33
|
+
export { Form };
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import * as Form from './atoms/form/form.component';
|
|
2
|
+
export * from './atoms/button/button.component';
|
|
3
|
+
export * from './atoms/button/buttonGroup/buttonGroup.component';
|
|
4
|
+
export * from './atoms/check-box/checkBox.component';
|
|
5
|
+
export * from './atoms/date-picker/date-picker.component';
|
|
6
|
+
export * from './atoms/input/input-otp.component';
|
|
7
|
+
export * from './atoms/input/input-pin.component';
|
|
8
|
+
export * from './atoms/input/input.component';
|
|
9
|
+
export * from './atoms/input-dropdown/input-dropdown.component';
|
|
10
|
+
export * from './atoms/loader/loader.component';
|
|
11
|
+
export * from './atoms/radio/radio.component';
|
|
12
|
+
export * from './atoms/stepper/stepper.component';
|
|
13
|
+
export * from './atoms/timer/timer.component';
|
|
14
|
+
export * from './atoms/tooltip/tooltip.component';
|
|
15
|
+
export * from './atoms/icons/icons.component';
|
|
16
16
|
export * from './atoms/tabs/tabs.component';
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
17
|
+
export * from './atoms/grid/grid.component';
|
|
18
|
+
export * from './atoms/list/list.component';
|
|
19
|
+
export * from './atoms/pdf/pdf-images.components';
|
|
20
|
+
export * from './atoms/pdf/pdf-table.components';
|
|
21
|
+
export * from './atoms/pdf/pdf-typography.components';
|
|
22
|
+
export * from './atoms/pdf/pdf-wrapped-view.components';
|
|
23
|
+
export * from './molecules/css-multiline-input/css-multiline-input.component';
|
|
24
|
+
export * from './molecules/auto-complete-filter-multiple-select-multiple-fields-display/auto-complete-filter-multiple-select-multiple-fields-display.component';
|
|
25
|
+
export * from './molecules/auto-complete-filter-single-select-multiple-fields-display/auto-complete-filter-single-select-multiple-fields-display.component';
|
|
26
|
+
export * from './molecules/multi-select/multi-select.component';
|
|
27
|
+
export * from './molecules/multi-select-with-field/multi-select-with-field.component';
|
|
28
|
+
export * from './molecules/modal-confirm/modal-confirm.component';
|
|
29
|
+
export * from './molecules/autocomplete/autocomplete';
|
|
30
|
+
export * from './molecules/auto-complete-group-by/auto-complete-group-by.component';
|
|
31
|
+
export * from './molecules/color-picker/color-picker.component';
|
|
32
|
+
export * from './molecules/color-picker-modal/color-picker-modal.component';
|
|
33
|
+
export { Form };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
import React, { useState, useEffect, useRef } from 'react';
|
|
3
3
|
import { Icon } from '../../atoms/icons/icons.component';
|
|
4
|
-
import '../../../tc.css';
|
|
4
|
+
import '../../../tc.module.css';
|
|
5
5
|
export const AutoCompleteFilterMultipleSelectMultipleFieldsDisplay = ({ uniqueField = '_id', isSelectedStringArray = false, loader = false, placeholder = 'Search...', data, hasError = false, disable = false, isUpperCase = false, name, onFilter, onUpdate, onSelect, onBlur, }) => {
|
|
6
6
|
const [value, setValue] = useState('');
|
|
7
7
|
const [options, setOptions] = useState();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
import React, { useState, useEffect, useRef } from 'react';
|
|
3
3
|
import { Icon } from '../../atoms/icons/icons.component';
|
|
4
|
-
import '../../../tc.css';
|
|
4
|
+
import '../../../tc.module.css';
|
|
5
5
|
export const AutoCompleteFilterSingleSelectMultiFieldsDisplay = ({ disable = false, loader = false, displayValue = '', placeholder = 'Search...', data, hasError = false, className, posstion = 'absolute', onFilter, onSelect, onBlur, }) => {
|
|
6
6
|
const [value, setValue] = useState(displayValue);
|
|
7
7
|
const [options, setOptions] = useState(data.list);
|
package/lib/src/core-components/molecules/auto-complete-group-by/auto-complete-group-by.component.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import React, { useState, useEffect, useRef } from 'react';
|
|
3
3
|
import { Icon } from '../../atoms/icons/icons.component';
|
|
4
4
|
// import PerfectScrollbar from 'react-perfect-scrollbar';
|
|
5
|
-
import '../../../tc.css';
|
|
5
|
+
import '../../../tc.module.css';
|
|
6
6
|
export const AutocompleteGroupBy = (props) => {
|
|
7
7
|
//const [userRouter, setUserRouter] = useState<any>()
|
|
8
8
|
const [value, setValue] = useState(props.displayValue);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useRef, useEffect, useCallback } from 'react';
|
|
2
2
|
// import './autocomplete.css';
|
|
3
|
-
import '../../../tc.css';
|
|
3
|
+
import '../../../tc.module.css';
|
|
4
4
|
const LI_ELEMENT_HEIGHT = 34;
|
|
5
5
|
export const Autocomplete = ({ value = '', onValueChange, options = [], }) => {
|
|
6
6
|
const [activeOption, setActiveOption] = useState(value === '' || options.indexOf(value) === -1 ? 0 : options.indexOf(value));
|
package/lib/src/core-components/molecules/color-picker-modal/color-picker-modal.component.js
CHANGED
|
@@ -2,7 +2,7 @@ import React, { useCallback, useRef, useState } from 'react';
|
|
|
2
2
|
import { HexColorPicker } from 'react-colorful';
|
|
3
3
|
import { useClickOutside } from '../../../hooks';
|
|
4
4
|
import './color-picker-modal.css';
|
|
5
|
-
import '../../../tc.css';
|
|
5
|
+
import '../../../tc.module.css';
|
|
6
6
|
export const ColorPickerModal = ({ color, onChange, onClose, }) => {
|
|
7
7
|
const popover = useRef();
|
|
8
8
|
const [isOpen, toggle] = useState(false);
|
package/lib/src/core-components/molecules/css-multiline-input/css-multiline-input.component.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useState, useRef } from 'react';
|
|
2
2
|
import * as Form from '../../atoms/form/form.component';
|
|
3
3
|
import { properties as propertiesObj } from './css-properties';
|
|
4
|
-
import '../../../tc.css';
|
|
4
|
+
import '../../../tc.module.css';
|
|
5
5
|
const mapToArray = (arr) => {
|
|
6
6
|
const res = [];
|
|
7
7
|
arr.forEach(function (obj, index) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect, useRef } from 'react';
|
|
2
|
-
import '../../../tc.css';
|
|
2
|
+
import '../../../tc.module.css';
|
|
3
3
|
export const MultiSelect = ({ options = [], selectedItems = [], hasError = false, onSelect, }) => {
|
|
4
4
|
const [selectedOptions, setSelectedOptions] = useState([]);
|
|
5
5
|
const [isListOpen, setIsListOpen] = useState(false);
|
|
@@ -4,7 +4,7 @@ import _ from 'lodash';
|
|
|
4
4
|
export const MultiSelectWithField = ({ displayField = '', options = [], selectedItems = [], hasError = false, onSelect, }) => {
|
|
5
5
|
const [selectedOptions, setSelectedOptions] = useState([]);
|
|
6
6
|
const [isListOpen, setIsListOpen] = useState(false);
|
|
7
|
-
const useOutsideAlerter = ref => {
|
|
7
|
+
const useOutsideAlerter = (ref) => {
|
|
8
8
|
useEffect(() => {
|
|
9
9
|
function handleClickOutside(event) {
|
|
10
10
|
if (ref.current && !ref.current.contains(event.target) && isListOpen) {
|
|
@@ -24,20 +24,20 @@ export const MultiSelectWithField = ({ displayField = '', options = [], selected
|
|
|
24
24
|
useOutsideAlerter(wrapperRef);
|
|
25
25
|
return (React.createElement(React.Fragment, null,
|
|
26
26
|
React.createElement("div", { className: `flex dark:bg-boxdark dark:text-white flex-col w-full rounded-md border-2 ${hasError ? 'border-red ' : 'border-gray-300'}`, ref: wrapperRef },
|
|
27
|
-
React.createElement("span", { className:
|
|
27
|
+
React.createElement("span", { className: "p-2 mt-1 shadow-sm", onClick: () => {
|
|
28
28
|
setIsListOpen(!isListOpen);
|
|
29
29
|
} }, selectedOptions?.length > 0
|
|
30
30
|
? `${selectedOptions?.length} Items`
|
|
31
31
|
: 'Select'),
|
|
32
32
|
React.createElement("div", { className: `flex mx-2 ${isListOpen ? `show` : `hidden`}` }, options
|
|
33
|
-
? options?.length > 0 && (React.createElement("ul", { className:
|
|
34
|
-
React.createElement("input", { className:
|
|
33
|
+
? options?.length > 0 && (React.createElement("ul", { className: "flex flex-col gap-1 p-2" }, options?.map((item, index) => (React.createElement("li", { key: index, className: "flex items-center" },
|
|
34
|
+
React.createElement("input", { className: "flex bg-black", type: "checkbox", checked: !_.isEmpty(selectedOptions?.find((e) => e[displayField]?.toUpperCase() ==
|
|
35
35
|
item[displayField]?.toUpperCase()))
|
|
36
36
|
? true
|
|
37
37
|
: false, onChange: () => {
|
|
38
|
-
if (!_.isEmpty(selectedOptions?.find(e => e[displayField]?.toUpperCase() ==
|
|
38
|
+
if (!_.isEmpty(selectedOptions?.find((e) => e[displayField]?.toUpperCase() ==
|
|
39
39
|
item[displayField]?.toUpperCase()))) {
|
|
40
|
-
setSelectedOptions(selectedOptions?.filter(e => e[displayField]?.toUpperCase() !=
|
|
40
|
+
setSelectedOptions(selectedOptions?.filter((e) => e[displayField]?.toUpperCase() !=
|
|
41
41
|
item[displayField]?.toUpperCase()));
|
|
42
42
|
}
|
|
43
43
|
else {
|
|
@@ -53,6 +53,6 @@ export const MultiSelectWithField = ({ displayField = '', options = [], selected
|
|
|
53
53
|
onSelect(selectedOptions);
|
|
54
54
|
} }),
|
|
55
55
|
' ',
|
|
56
|
-
React.createElement("span", { className:
|
|
56
|
+
React.createElement("span", { className: "flex ml-2 dark:text-white text-center" }, item[displayField]))))))
|
|
57
57
|
: null))));
|
|
58
58
|
};
|
package/lib/src/tc.module.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-restyle-components",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.40",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easy use restyle components",
|
|
6
6
|
"author": {
|
|
@@ -71,6 +71,7 @@
|
|
|
71
71
|
"@storybook/addon-interactions": "^8.0.6",
|
|
72
72
|
"@storybook/addon-links": "^8.0.6",
|
|
73
73
|
"@storybook/addon-onboarding": "^8.0.6",
|
|
74
|
+
"@storybook/addon-postcss": "^2.0.0",
|
|
74
75
|
"@storybook/addon-themes": "^8.4.7",
|
|
75
76
|
"@storybook/addon-webpack5-compiler-swc": "^1.0.2",
|
|
76
77
|
"@storybook/blocks": "^8.0.6",
|
|
@@ -92,7 +93,6 @@
|
|
|
92
93
|
"husky": "^7.0.4",
|
|
93
94
|
"jest": "^29.7.0",
|
|
94
95
|
"lint-staged": "^12.4.0",
|
|
95
|
-
"postcss": "^8.4.49",
|
|
96
96
|
"postcss-loader": "^8.1.1",
|
|
97
97
|
"prettier": "^3.3.3",
|
|
98
98
|
"react-router-dom": "^7.0.2",
|