react-restyle-components 0.2.43 → 0.2.44

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.
Files changed (37) hide show
  1. package/lib/package.json +7 -5
  2. package/lib/src/core-components/atoms/button/button.component.d.ts +0 -3
  3. package/lib/src/core-components/atoms/button/button.component.d.ts.map +1 -1
  4. package/lib/src/core-components/atoms/button/button.component.js +1 -4
  5. package/lib/src/core-components/atoms/button/buttonGroup/buttonGroup.component.d.ts +0 -1
  6. package/lib/src/core-components/atoms/button/buttonGroup/buttonGroup.component.d.ts.map +1 -1
  7. package/lib/src/core-components/atoms/button/buttonGroup/buttonGroup.component.js +3 -2
  8. package/lib/src/core-components/atoms/check-box/checkBox.component.d.ts +0 -1
  9. package/lib/src/core-components/atoms/check-box/checkBox.component.d.ts.map +1 -1
  10. package/lib/src/core-components/atoms/check-box/checkBox.component.js +4 -5
  11. package/lib/src/core-components/atoms/date-picker/date-picker.component.d.ts +0 -1
  12. package/lib/src/core-components/atoms/date-picker/date-picker.component.d.ts.map +1 -1
  13. package/lib/src/core-components/atoms/date-picker/date-picker.component.js +4 -3
  14. package/lib/src/core-components/atoms/form/form.component.d.ts.map +1 -1
  15. package/lib/src/core-components/atoms/form/form.component.js +37 -13
  16. package/lib/src/core-components/atoms/grid/grid.component.d.ts +0 -1
  17. package/lib/src/core-components/atoms/grid/grid.component.d.ts.map +1 -1
  18. package/lib/src/core-components/atoms/grid/grid.component.js +3 -2
  19. package/lib/src/core-components/atoms/icons/icons.component.d.ts.map +1 -1
  20. package/lib/src/core-components/atoms/icons/icons.component.js +4 -2
  21. package/lib/src/core-components/atoms/input/input-otp.component.d.ts +0 -1
  22. package/lib/src/core-components/atoms/input/input-otp.component.d.ts.map +1 -1
  23. package/lib/src/core-components/atoms/input/input-otp.component.js +3 -2
  24. package/lib/src/core-components/atoms/input/input.component.d.ts +0 -1
  25. package/lib/src/core-components/atoms/input/input.component.d.ts.map +1 -1
  26. package/lib/src/core-components/atoms/input/input.component.js +4 -3
  27. package/lib/src/core-components/atoms/input-dropdown/input-dropdown.component.d.ts.map +1 -1
  28. package/lib/src/core-components/atoms/input-dropdown/input-dropdown.component.js +5 -3
  29. package/lib/src/core-components/atoms/loader/loader.component.d.ts.map +1 -1
  30. package/lib/src/core-components/atoms/radio/radio.component.d.ts.map +1 -1
  31. package/lib/src/core-components/atoms/stepper/stepper.component.d.ts +0 -1
  32. package/lib/src/core-components/atoms/stepper/stepper.component.d.ts.map +1 -1
  33. package/lib/src/core-components/atoms/stepper/stepper.component.js +0 -1
  34. 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 +2 -1
  35. 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.map +1 -1
  36. package/lib/src/core-components/molecules/auto-complete-filter-single-select-multiple-fields-display/auto-complete-filter-single-select-multiple-fields-display.component.js +2 -2
  37. package/package.json +7 -5
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-restyle-components",
3
- "version": "0.2.42",
3
+ "version": "0.2.43",
4
4
  "private": false,
5
5
  "description": "Easy use restyle components",
6
6
  "author": {
@@ -24,6 +24,7 @@
24
24
  "storybook": "storybook dev -p 6006",
25
25
  "build-storybook": "rm -rf docs-build && storybook build -o docs-build",
26
26
  "deploy-storybook": "gh-pages -d docs-build",
27
+ "serve-storybook": "npm run build-storybook -- -o ./docs-build && npx http-server ./docs-build",
27
28
  "lint": "eslint .",
28
29
  "lint:fix": "eslint --fix .",
29
30
  "prettier": "prettier --write '**/*.{js,jsx}'",
@@ -45,7 +46,7 @@
45
46
  "@testing-library/jest-dom": "^5.17.0",
46
47
  "@testing-library/user-event": "^13.5.0",
47
48
  "@types/jest": "^27.5.2",
48
- "@types/node": "^16.18.113",
49
+ "@types/node": "^22.10.2",
49
50
  "@types/react": "^18.3.11",
50
51
  "@types/react-dom": "^18.3.0",
51
52
  "buffer": "^6.0.3",
@@ -83,13 +84,13 @@
83
84
  "@svgr/webpack": "^8.1.0",
84
85
  "@tailwindcss/forms": "^0.5.9",
85
86
  "@testing-library/react": "^16.0.1",
87
+ "@vitejs/plugin-react": "^4.2.1",
86
88
  "@vitest/coverage-c8": "^0.31.4",
87
89
  "@vitest/ui": "^0.31.4",
88
90
  "autoprefixer": "^10.4.19",
89
91
  "copyfiles": "^2.4.1",
90
92
  "craco-alias": "^3.0.1",
91
93
  "css-loader": "^7.1.2",
92
- "@vitejs/plugin-react": "^4.2.1",
93
94
  "eslint": "^9.14.0",
94
95
  "eslint-plugin-storybook": "^0.8.0",
95
96
  "gh-pages": "^3.2.3",
@@ -102,11 +103,11 @@
102
103
  "sass": "^1.77.5",
103
104
  "sass-loader": "^14.2.1",
104
105
  "storybook": "^8.0.6",
106
+ "storybook-css-modules": "^1.0.8",
105
107
  "storybook-multilevel-sort": "^2.0.1",
106
108
  "style-loader": "^4.0.0",
107
109
  "tailwindcss": "^3.4.14",
108
110
  "ts-jest": "^29.2.5",
109
- "webpack": "^5.72.0",
110
111
  "vite": "^5.0.11",
111
112
  "vite-plugin-css-injected-by-js": "^3.1.1",
112
113
  "vite-plugin-dts": "^2.3.0",
@@ -115,7 +116,8 @@
115
116
  "vite-plugin-svgr": "^4.2.0",
116
117
  "vite-tsconfig-paths": "^4.2.0",
117
118
  "vitest": "^0.31.4",
118
- "vitest-dom": "^0.1.0"
119
+ "vitest-dom": "^0.1.0",
120
+ "webpack": "^5.72.0"
119
121
  },
120
122
  "eslintConfig": {
121
123
  "extends": [
@@ -1,7 +1,4 @@
1
1
  import React from 'react';
2
2
  import { ButtonProps } from './Button.types';
3
- /**
4
- * It's a `<button>button</button>`. Pass in regular button props such as onClick as well as any of the props defined here.
5
- */
6
3
  export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
7
4
  //# sourceMappingURL=button.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"button.component.d.ts","sourceRoot":"","sources":["../../../../../src/core-components/atoms/button/button.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAI3C;;GAEG;AACH,eAAO,MAAM,MAAM,uIA0DlB,CAAC"}
1
+ {"version":3,"file":"button.component.d.ts","sourceRoot":"","sources":["../../../../../src/core-components/atoms/button/button.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAK3C,eAAO,MAAM,MAAM,uIA0DlB,CAAC"}
@@ -3,14 +3,11 @@ import { forwardRef } from 'react';
3
3
  import { Tooltip } from '../tooltip/tooltip.component';
4
4
  import s from '../../../tc.module.css';
5
5
  import { cn } from '../../../core-utils';
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.
8
- */
9
6
  export const Button = forwardRef(({ variant = 'solid', tooltip, disabled = false, type = 'button', className, children, ...args }, ref) => {
10
7
  const buttonColorClass = variant === 'solid'
11
8
  ? cn(s['text-white'], s['bg-[#007BFF]'], s['hover:bg-[#007BFF]'], s['hover:shadow-lg'], s['text-white'])
12
9
  : cn(s['dark:text-white'], s['text-black'], s['border'], s['border-gray-400'], s['hover:shadow-lg']);
13
- const button = (_jsx("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: children }));
10
+ const button = (_jsx("button", { ref: ref, ...args, className: cn(s['rounded-100px'], s['px-3'], s['py-1'], s['text-md'], s['pt-2'], s['pb-2'], s['font-nunitoSansRegular'], disabled ? s['opacity-50'] : s['opacity-100'], buttonColorClass, className), type: type, disabled: disabled, children: children }));
14
11
  if (tooltip) {
15
12
  return _jsx(Tooltip, { content: tooltip, children: button });
16
13
  }
@@ -1,5 +1,4 @@
1
1
  import { ReactNode } from 'react';
2
- import '../../../../tc.module.css';
3
2
  export declare const ButtonGroup: ({ children, orientation, className, }: {
4
3
  children: ReactNode;
5
4
  orientation?: "horizontal" | "vertical" | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"buttonGroup.component.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/atoms/button/buttonGroup/buttonGroup.component.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAChC,OAAO,2BAA2B,CAAC;AAEnC,eAAO,MAAM,WAAW;cAKZ,SAAS;;;6CASpB,CAAC"}
1
+ {"version":3,"file":"buttonGroup.component.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/atoms/button/buttonGroup/buttonGroup.component.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAIhC,eAAO,MAAM,WAAW;cAKZ,SAAS;;;6CAepB,CAAC"}
@@ -1,3 +1,4 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import '../../../../tc.module.css';
3
- export const ButtonGroup = ({ children, orientation = 'horizontal', className, }) => (_jsx("div", { className: `flex ${orientation == 'horizontal' ? 'flex-row' : 'flex-col'} w-fit gap-2 ${className}`, children: children }));
2
+ import s from '../../../../tc.module.css';
3
+ import { cn } from '../../../../core-utils';
4
+ export const ButtonGroup = ({ children, orientation = 'horizontal', className, }) => (_jsx("div", { className: cn(s.flex, orientation == 'horizontal' ? s['flex-row'] : s['flex-col'], s['w-fit'], s['gap-2'], className), children: children }));
@@ -1,4 +1,3 @@
1
- import '../../../tc.module.css';
2
1
  interface CheckBoxProps {
3
2
  title: string;
4
3
  data: Array<any>;
@@ -1 +1 @@
1
- {"version":3,"file":"checkBox.component.d.ts","sourceRoot":"","sources":["../../../../../src/core-components/atoms/check-box/checkBox.component.tsx"],"names":[],"mappings":"AACA,OAAO,wBAAwB,CAAC;AAMhC,UAAU,aAAa;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CAChC;AAED,eAAO,MAAM,QAAQ,0CAKlB,aAAa,4CAqCf,CAAC"}
1
+ {"version":3,"file":"checkBox.component.d.ts","sourceRoot":"","sources":["../../../../../src/core-components/atoms/check-box/checkBox.component.tsx"],"names":[],"mappings":"AAMA,UAAU,aAAa;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CAChC;AAED,eAAO,MAAM,QAAQ,0CAKlB,aAAa,4CAmCf,CAAC"}
@@ -1,14 +1,13 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState } from 'react';
3
- import '../../../tc.module.css';
3
+ import s from '../../../tc.module.css';
4
+ import { cn } from '../../../core-utils';
4
5
  import { UnCheckbox, CheckedBox } from '../../../library/assets/svg';
5
- // import UnCheckbox from '../../../library/assets/svg/UnCheckbox.svg?react';
6
- // import CheckedBox from '../../../library/assets/svg/CheckedBox.svg?react';
7
6
  import { InputWrapper } from '../form/form.component';
8
7
  export const CheckBox = ({ title = 'Banks', data = [{ title: 'SBI Bank', checked: false }], className, onChange, }) => {
9
8
  const [list, setList] = useState(data);
10
9
  const width = 20;
11
- return (_jsx(InputWrapper, { label: title, children: list?.map((item, index) => (_jsxs("div", { className: `${className} flex flex-row items-center `, onClick: () => {
10
+ return (_jsx(InputWrapper, { label: title, children: list?.map((item, index) => (_jsxs("div", { className: `${cn(s.flex, s['flex-row'], s['items-center'])} ${className}`, onClick: () => {
12
11
  const result = list?.map((e, i) => {
13
12
  if (i === index)
14
13
  return { ...e, checked: !item.checked };
@@ -17,5 +16,5 @@ export const CheckBox = ({ title = 'Banks', data = [{ title: 'SBI Bank', checked
17
16
  });
18
17
  setList(result);
19
18
  onChange(result?.filter((item) => item.checked));
20
- }, children: [_jsx("div", { className: "flex mt-1", children: item.checked ? (_jsx(CheckedBox, { width: width, height: width, fill: "#E7503D", stroke: "E7503D" })) : (_jsx(UnCheckbox, { width: width, height: width })) }), _jsx("span", { children: item?.title })] }, index))) }));
19
+ }, children: [_jsx("div", { className: cn(s.flex, s['mt-1']), children: item.checked ? (_jsx(CheckedBox, { width: width, height: width, fill: "#E7503D", stroke: "E7503D" })) : (_jsx(UnCheckbox, { width: width, height: width })) }), _jsx("span", { children: item?.title })] }, index))) }));
21
20
  };
@@ -1,4 +1,3 @@
1
- import '../../../tc.module.css';
2
1
  import 'react-datepicker/dist/react-datepicker.css';
3
2
  interface DatePickerProps {
4
3
  title: string;
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker.component.d.ts","sourceRoot":"","sources":["../../../../../src/core-components/atoms/date-picker/date-picker.component.tsx"],"names":[],"mappings":"AACA,OAAO,wBAAwB,CAAC;AAEhC,OAAO,4CAA4C,CAAC;AAKpD,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,cAAc,mEAOxB,eAAe,4CAoCjB,CAAC"}
1
+ {"version":3,"file":"date-picker.component.d.ts","sourceRoot":"","sources":["../../../../../src/core-components/atoms/date-picker/date-picker.component.tsx"],"names":[],"mappings":"AAEA,OAAO,4CAA4C,CAAC;AAOpD,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,cAAc,mEAOxB,eAAe,4CAkDjB,CAAC"}
@@ -1,19 +1,20 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState, forwardRef } from 'react';
3
- import '../../../tc.module.css';
4
3
  import DatePicker from 'react-datepicker';
5
4
  import 'react-datepicker/dist/react-datepicker.css';
6
5
  import { DatePickerSvg } from '../../../library/assets/svg';
7
6
  import dayjs from 'dayjs';
8
7
  import { InputWrapper } from '../form/form.component';
8
+ import s from '../../../tc.module.css';
9
+ import { cn } from '../../../core-utils';
9
10
  export const DatePickerComp = ({ title = 'Title', className, disable, value, showFormat = 'yyyy-MM-dd', placeholder = 'Select Date', }) => {
10
11
  const [pickedDate, setPickedDate] = useState(value && dayjs(value).toDate());
11
12
  const CustomInput = forwardRef((props, ref) => {
12
- return (_jsxs("div", { onClick: !disable && props.onClick, ref: ref, className: " border-gray-light place-items-center border rounded-md px-2 flex ", children: [_jsx("label", { className: "mr-3 font-arimaRegular text-primaryCharcoal text-lg", children: props.value || props.placeholder }), _jsx(DatePickerSvg, { width: 15, height: 15 })] }));
13
+ return (_jsxs("div", { onClick: !disable && props.onClick, ref: ref, className: cn(s['border-gray-light'], s['place-items-center'], s['border'], s['rounded-md'], s['px-2'], s.flex), children: [_jsx("label", { className: cn(s['mr-3'], s['font-arimaRegular'], s['text-primaryCharcoal'], s['text-lg']), children: props.value || props.placeholder }), _jsx(DatePickerSvg, { width: 15, height: 15 })] }));
13
14
  });
14
15
  CustomInput.displayName = 'CustomInput';
15
16
  const handleChanges = (date) => {
16
17
  setPickedDate(date);
17
18
  };
18
- return (_jsx(InputWrapper, { label: title, children: _jsx("div", { className: `${className} flex zIndex-999`, children: _jsx(DatePicker, { selected: pickedDate || new Date(), dateFormat: showFormat, placeholder: placeholder, onChange: handleChanges, customInput: _jsx(CustomInput, {}) }) }) }));
19
+ return (_jsx(InputWrapper, { label: title, children: _jsx("div", { className: cn(s.flex, s['zIndex-999'], className), children: _jsx(DatePicker, { selected: pickedDate || new Date(), dateFormat: showFormat, placeholder: placeholder, onChange: handleChanges, customInput: _jsx(CustomInput, {}) }) }) }));
19
20
  };
@@ -1 +1 @@
1
- {"version":3,"file":"form.component.d.ts","sourceRoot":"","sources":["../../../../../src/core-components/atoms/form/form.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiC,MAAM,OAAO,CAAC;AAGtD,OAAO,wBAAwB,CAAC;AAEhC,UAAU,UAAU;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,UAAU,CAYrD,CAAC;AAEF,UAAU,iBAAiB;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAanE,CA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C;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CAC7B;AAED,eAAO,MAAM,SAAS,UAAW,cAAc,4CAgB9C,CAAC;AAEF,UAAU,WAAY,SAAQ,iBAAiB;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAChC,KAAK,CAAC,EAAE,GAAG,CAAC;CACb;AAED,eAAO,MAAM,MAAM,UAAW,WAAW,4CA4DxC,CAAC;AAEF,eAAO,MAAM,sBAAsB,UAAW,WAAW,4CA4DxD,CAAC"}
1
+ {"version":3,"file":"form.component.d.ts","sourceRoot":"","sources":["../../../../../src/core-components/atoms/form/form.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiC,MAAM,OAAO,CAAC;AAKtD,OAAO,wBAAwB,CAAC;AAEhC,UAAU,UAAU;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,UAAU,CAarD,CAAC;AAEF,UAAU,iBAAiB;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,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eAAO,MAAM,QAAQ,yDAapB,CAAC;AAEF,UAAU,cAAe,SAAQ,iBAAiB;IAChD,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CAC7B;AAED,eAAO,MAAM,SAAS,UAAW,cAAc,4CA6B9C,CAAC;AAEF,UAAU,WAAY,SAAQ,iBAAiB;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAChC,KAAK,CAAC,EAAE,GAAG,CAAC;CACb;AAED,eAAO,MAAM,MAAM,UAAW,WAAW,4CA4DxC,CAAC;AAEF,eAAO,MAAM,sBAAsB,UAAW,WAAW,4CA4DxD,CAAC"}
@@ -1,9 +1,14 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React, { useState, useEffect } from 'react';
3
3
  import classNames from 'classnames';
4
+ import s from '../../../tc.module.css';
5
+ import { cn } from '../../../core-utils';
4
6
  import '../../../tc.module.css';
5
- export const Label = (props) => (_jsx(_Fragment, { children: _jsx("label", { htmlFor: props.htmlFor, className: `${props.hasError ? 'text-red-400' : 'text-current'} block text-3xs font-medium mb-1`, style: { ...props.style }, children: props.children }) }));
6
- export const InputWrapper = (props) => (_jsxs("div", { className: props.className, ref: props.ref, children: [_jsx(Label, { htmlFor: props.id || '', hasError: props.hasError, style: { ...props.style }, children: _jsx("span", { className: "dark:text-white w-10", children: props.label }) }), props.children] }));
7
+ export const Label = (props) => (_jsx(_Fragment, { children: _jsx("label", { htmlFor: props.htmlFor, className: cn(s['block'], s['text-3xs'], s['font-medium'], s['mb-1'], {
8
+ [s['text-red-400']]: props.hasError,
9
+ [s['text-current']]: !props.hasError,
10
+ }), style: { ...props.style }, children: props.children }) }));
11
+ export const InputWrapper = (props) => (_jsxs("div", { className: cn(props.className), ref: props.ref, children: [_jsx(Label, { htmlFor: props.id || '', hasError: props.hasError, style: { ...props.style }, children: _jsx("span", { className: cn(s['dark:text-white'], s['w-10']), children: props.label }) }), props.children] }));
7
12
  export const Input = React.forwardRef((props, ref) => {
8
13
  const handleKeyPress = (e) => {
9
14
  const key = e.key;
@@ -12,7 +17,10 @@ export const Input = React.forwardRef((props, ref) => {
12
17
  e.preventDefault();
13
18
  }
14
19
  };
15
- return (_jsx(InputWrapper, { label: props.label, id: props.id, hasError: props.hasError, style: props.wrapperStyle, className: props.labelClassName, children: _jsx("input", { type: props.type || 'text', id: props.id, ref: props.inputRef, "data-testid": "INPT", autoFocus: props?.isAutoFocus || false, name: props.name, style: props.style, defaultValue: props.defaultValue, placeholder: props.placeholder, required: props.required || false, disabled: props.disabled || false, autoComplete: "given-name", maxLength: props.maxLength, value: props.value, onChange: (e) => props.onChange && props.onChange(e.target.value), onKeyPress: (e) => handleKeyPress(e), className: `${props.className} leading-4 p-2 dark:bg-boxdark focus:outline-none focus:ring block w-full shadow-sm sm:text-base border-2 ${props.hasError ? 'border-red ' : 'border-gray-300'} rounded-md `, onBlur: (e) => props.onBlur && props.onBlur(e.target.value), onKeyDown: props.onKeyDown && props.onKeyDown }) }));
20
+ return (_jsx(InputWrapper, { label: props.label, id: props.id, hasError: props.hasError, style: props.wrapperStyle, className: props.labelClassName, children: _jsx("input", { type: props.type || 'text', id: props.id, ref: props.inputRef, "data-testid": "INPT", autoFocus: props?.isAutoFocus || false, name: props.name, style: props.style, defaultValue: props.defaultValue, placeholder: props.placeholder, required: props.required || false, disabled: props.disabled || false, autoComplete: "given-name", maxLength: props.maxLength, value: props.value, onChange: (e) => props.onChange && props.onChange(e.target.value), onKeyPress: (e) => handleKeyPress(e), className: cn(props.className, s['leading-4'], s['p-2'], s['dark:bg-boxdark'], s['focus:outline-none'], s['focus:ring'], s['block'], s['w-full'], s['shadow-sm'], s['sm:text-base'], s['border-2'], s['rounded-md'], {
21
+ [s['border-red']]: props.hasError,
22
+ [s['border-gray-300']]: !props.hasError,
23
+ }), onBlur: (e) => props.onBlur && props.onBlur(e.target.value), onKeyDown: props.onKeyDown && props.onKeyDown }) }));
16
24
  });
17
25
  export const InputPassword = React.forwardRef((props, ref) => {
18
26
  const [showPassword, setShowPassword] = useState(false);
@@ -22,9 +30,10 @@ export const InputPassword = React.forwardRef((props, ref) => {
22
30
  const handleMouseUp = () => {
23
31
  setShowPassword(false);
24
32
  };
25
- return (_jsx(InputWrapper, { label: props.label, id: props.id, hasError: props.hasError, style: props.wrapperStyle, className: props.labelClassName, children: _jsxs("div", { className: "flex items-center relative", children: [_jsx("input", { type: showPassword ? 'text' : 'password', id: props.id, ref: props.inputRef, "data-testid": "INPT", autoFocus: props?.isAutoFocus || false, name: props.name, style: props.style, defaultValue: props.defaultValue, placeholder: props.placeholder, required: props.required || false, disabled: props.disabled || false, autoComplete: "given-name", maxLength: props.maxLength, value: props.value, onChange: (e) => props.onChange && props.onChange(e.target.value),
26
- // onKeyPress={e => handleKeyPress(e)}
27
- className: `${props.className} leading-4 p-2 focus:outline-none focus:ring block w-full shadow-sm sm:text-base border-2 ${props.hasError ? 'border-red ' : 'border-gray-300'} rounded-md dark:bg-boxdark`, onBlur: (e) => props.onBlur && props.onBlur(e.target.value), onKeyDown: props.onKeyDown && props.onKeyDown }), _jsx("div", { className: "flex absolute right-3", children: _jsx("svg", { className: "h-6 dark:bg-boxdark", fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 576 512", onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, onMouseLeave: handleMouseUp, children: showPassword ? (_jsx("path", { fill: "currentColor", d: "M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z" })) : (_jsx("path", { fill: "currentColor", d: "M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z" })) }) })] }) }));
33
+ return (_jsx(InputWrapper, { label: props.label, id: props.id, hasError: props.hasError, style: props.wrapperStyle, className: props.labelClassName, children: _jsxs("div", { className: cn(s['flex'], s['items-center'], s['relative']), children: [_jsx("input", { type: showPassword ? 'text' : 'password', id: props.id, ref: props.inputRef, "data-testid": "INPT", autoFocus: props?.isAutoFocus || false, name: props.name, style: props.style, defaultValue: props.defaultValue, placeholder: props.placeholder, required: props.required || false, disabled: props.disabled || false, autoComplete: "given-name", maxLength: props.maxLength, value: props.value, onChange: (e) => props.onChange && props.onChange(e.target.value), className: cn(props.className, s['leading-4'], s['p-2'], s['focus:outline-none'], s['focus:ring'], s['block'], s['w-full'], s['shadow-sm'], s['sm:text-base'], s['border-2'], s['rounded-md'], s['dark:bg-boxdark'], {
34
+ [s['border-red']]: props.hasError,
35
+ [s['border-gray-300']]: !props.hasError,
36
+ }), onBlur: (e) => props.onBlur && props.onBlur(e.target.value), onKeyDown: props.onKeyDown && props.onKeyDown }), _jsx("div", { className: cn(s['flex'], s['absolute'], s['right-3']), children: _jsx("svg", { className: cn(s['h-6'], s['dark:bg-boxdark']), fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 576 512", onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, onMouseLeave: handleMouseUp, children: showPassword ? (_jsx("path", { fill: "currentColor", d: "M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z" })) : (_jsx("path", { fill: "currentColor", d: "M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z" })) }) })] }) }));
28
37
  });
29
38
  export const Input1 = React.forwardRef((props, ref) => {
30
39
  const handleKeyPress = (e) => {
@@ -34,7 +43,10 @@ export const Input1 = React.forwardRef((props, ref) => {
34
43
  e.preventDefault();
35
44
  }
36
45
  };
37
- return (_jsx(InputWrapper, { label: props.label, id: props.id, hasError: props.hasError, style: props.wrapperStyle, className: props.labelClassName, children: _jsx("input", { type: props.type || 'text', id: props.id, ref: props.inputRef, "data-testid": "INPT", autoFocus: props?.isAutoFocus || false, name: props.name, style: props.style, defaultValue: props.defaultValue, placeholder: props.placeholder, required: props.required || false, disabled: props.disabled || false, autoComplete: "given-name", maxLength: props.maxLength, value: props.value, onChange: (e) => props.onChange && props.onChange(e.target.value), onKeyPress: (e) => handleKeyPress(e), className: `${props.className} leading-4 p-2 focus:outline-none focus:ring block w-full shadow-sm sm:text-base border-2 ${props.hasError ? 'border-red ' : 'border-gray-300'} rounded-md dark:text-black`, onBlur: (e) => props.onBlur && props.onBlur(e), onKeyDown: props.onKeyDown }) }));
46
+ return (_jsx(InputWrapper, { label: props.label, id: props.id, hasError: props.hasError, style: props.wrapperStyle, className: props.labelClassName, children: _jsx("input", { type: props.type || 'text', id: props.id, ref: props.inputRef, "data-testid": "INPT", autoFocus: props?.isAutoFocus || false, name: props.name, style: props.style, defaultValue: props.defaultValue, placeholder: props.placeholder, required: props.required || false, disabled: props.disabled || false, autoComplete: "given-name", maxLength: props.maxLength, value: props.value, onChange: (e) => props.onChange && props.onChange(e.target.value), onKeyPress: (e) => handleKeyPress(e), className: cn(props.className, s['leading-4'], s['p-2'], s['focus:outline-none'], s['focus:ring'], s['block'], s['w-full'], s['shadow-sm'], s['sm:text-base'], s['border-2'], s['rounded-md'], s['dark:text-black'], {
47
+ [s['border-red']]: props.hasError,
48
+ [s['border-gray-300']]: !props.hasError,
49
+ }), onBlur: (e) => props.onBlur && props.onBlur(e), onKeyDown: props.onKeyDown }) }));
38
50
  });
39
51
  export const Input2 = React.forwardRef((props, ref) => {
40
52
  const [isBlur, setIsBlur] = useState(true);
@@ -51,7 +63,10 @@ export const Input2 = React.forwardRef((props, ref) => {
51
63
  return (_jsx(InputWrapper, { label: props.label, id: props.id, hasError: props.hasError, style: props.wrapperStyle, className: props.labelClassName, children: _jsx("input", { type: props.type || 'text', id: props.id, ref: props.inputRef, "data-testid": "INPT", autoFocus: props?.isAutoFocus || false, name: props.name, style: props.style, defaultValue: props.defaultValue, placeholder: props.placeholder, required: props.required || false, disabled: props.disabled || false, autoComplete: "given-name", maxLength: props.maxLength, value: props.value, onChange: (e) => {
52
64
  setIsBlur(true);
53
65
  props.onChange && props.onChange(e.target.value);
54
- }, onKeyPress: (e) => handleKeyPress(e), className: `${props.className} leading-4 p-2 focus:outline-none focus:ring block w-full shadow-sm sm:text-base border-2 ${props.hasError ? 'border-red ' : 'border-gray-300'} rounded-md dark:text-black`, onKeyDown: (e) => {
66
+ }, onKeyPress: (e) => handleKeyPress(e), className: cn(props.className, s['leading-4'], s['p-2'], s['focus:outline-none'], s['focus:ring'], s['block'], s['w-full'], s['shadow-sm'], s['sm:text-base'], s['border-2'], s['rounded-md'], s['dark:text-black'], {
67
+ [s['border-red']]: props.hasError,
68
+ [s['border-gray-300']]: !props.hasError,
69
+ }), onKeyDown: (e) => {
55
70
  if (e.keyCode == 13) {
56
71
  setIsBlur(false);
57
72
  props.onBlur && props.onBlur(e.target.value);
@@ -61,15 +76,24 @@ export const Input2 = React.forwardRef((props, ref) => {
61
76
  handleBlur(e.target.value);
62
77
  } }) }));
63
78
  });
64
- export const MultilineInput = (props) => (_jsx(InputWrapper, { label: props.label, id: props.id, className: props.className, children: _jsx("textarea", { id: props.id, autoComplete: "given-name", value: props.value, disabled: props.disabled, style: props.style, rows: props.rows, onKeyUp: props.onKeyUp && props.onKeyUp, placeholder: props.placeholder, onChange: (e) => props.onChange && props.onChange(e.target.value), onBlur: (e) => props.onBlur && props.onBlur(e.target.value), className: `leading-4 p-2 focus:outline-none focus:ring block w-full shadow-sm sm:text-base border-2 ${props.hasError ? 'border-red ' : 'border-gray-300'} rounded-md dark:bg-boxdark`, defaultValue: props.defaultValue }) }));
65
- export const InputRadio = (props) => (_jsx(InputWrapper, { label: props.label, id: props.id, style: props.labelStyle, children: props.values?.map((item, key) => (_jsxs("div", { className: "flex items-center gap-2", onClick: () => {
79
+ export const MultilineInput = (props) => (_jsx(InputWrapper, { label: props.label, id: props.id, className: props.className, children: _jsx("textarea", { id: props.id, autoComplete: "given-name", value: props.value, disabled: props.disabled, style: props.style, rows: props.rows, onKeyUp: props.onKeyUp && props.onKeyUp, placeholder: props.placeholder, onChange: (e) => props.onChange && props.onChange(e.target.value), onBlur: (e) => props.onBlur && props.onBlur(e.target.value), className: cn(s['leading-4'], s['p-2'], s['focus:outline-none'], s['focus:ring'], s['block'], s['w-full'], s['shadow-sm'], s['sm:text-base'], s['border-2'], s['rounded-md'], s['dark:bg-boxdark'], {
80
+ [s['border-red']]: props.hasError,
81
+ [s['border-gray-300']]: !props.hasError,
82
+ }), defaultValue: props.defaultValue }) }));
83
+ export const InputRadio = (props) => (_jsx(InputWrapper, { label: props.label, id: props.id, style: props.labelStyle, children: props.values?.map((item, key) => (_jsxs("div", { className: cn(s['flex'], s['items-center'], s['gap-2']), onClick: () => {
66
84
  props.onChange && props.onChange(item.value);
67
- }, children: [_jsx("input", { type: "radio", id: props.id, name: props.name, value: item.value, checked: item.value == props.value ? true : false, onChange: () => props.onChange && props.onChange(item.value), className: "w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600" }, key), _jsx(Label, { htmlFor: props.id || '', style: { marginTop: 6 }, children: item.label })] }, key))) }));
68
- export const InputDate = ({ name, value, placeholder, use12Hours = true, label, id, hasError, disabled, format, onChange, onFocusRemove, }) => (_jsx(InputWrapper, { label: label, id: id, hasError: hasError, children: _jsx("input", { type: "date", id: id, name: name, disabled: disabled || false, value: value, onChange: (e) => onChange && onChange(e), className: `leading-4 p-2 focus:outline-none focus:ring block w-full shadow-sm sm:text-base border-2 ${hasError ? 'border-red ' : 'border-gray-300'} rounded-md` }) }));
85
+ }, children: [_jsx("input", { type: "radio", id: props.id, name: props.name, value: item.value, checked: item.value == props.value ? true : false, onChange: () => props.onChange && props.onChange(item.value), className: cn(s['w-4'], s['h-4'], s['text-blue-600'], s['bg-gray-100'], s['border-gray-300'], s['focus:ring-blue-500'], s['dark:focus:ring-blue-600'], s['dark:ring-offset-gray-800'], s['focus:ring-2'], s['dark:bg-gray-700'], s['dark:border-gray-600']) }, key), _jsx(Label, { htmlFor: props.id || '', style: { marginTop: 6 }, children: item.label })] }, key))) }));
86
+ export const InputDate = ({ name, value, placeholder, use12Hours = true, label, id, hasError, disabled, format, onChange, onFocusRemove, }) => (_jsx(InputWrapper, { label: label, id: id, hasError: hasError, children: _jsx("input", { type: "date", id: id, name: name, disabled: disabled || false, value: value, onChange: (e) => onChange && onChange(e), className: cn(s['leading-4'], s['p-2'], s['focus:outline-none'], s['focus:ring'], s['block'], s['w-full'], s['shadow-sm'], s['sm:text-base'], s['border-2'], {
87
+ [s['border-red']]: hasError,
88
+ [s['border-gray-300']]: !hasError,
89
+ }) }) }));
69
90
  export const CheckBox = (props) => {
70
91
  return (_jsxs("div", { children: [_jsx("input", { onClick: props.handleCheckChieldElement, type: "checkbox", checked: props.isChecked, value: props.value }, props.id), ' ', props.value] }));
71
92
  };
72
- export const InputFile = (props) => (_jsx(InputWrapper, { label: props.label, id: props.id, children: _jsx("input", { type: "file", id: props.id, name: props.name, disabled: props.disabled || false, accept: props.accept, value: props.value, onChange: (e) => props.onChange && props.onChange(e), className: `leading-4 p-2 focus:outline-none focus:ring block w-full shadow-sm sm:text-base border-2 ${props.hasError ? 'border-red ' : 'border-gray-300'} rounded-md`, multiple: props.multiple }) }));
93
+ export const InputFile = (props) => (_jsx(InputWrapper, { label: props.label, id: props.id, children: _jsx("input", { type: "file", id: props.id, name: props.name, disabled: props.disabled || false, accept: props.accept, value: props.value, onChange: (e) => props.onChange && props.onChange(e), className: cn(s['leading-4'], s['p-2'], s['focus:outline-none'], s['focus:ring'], s['block'], s['w-full'], s['shadow-sm'], s['sm:text-base'], s['border-2'], s['rounded-md'], {
94
+ [s['border-red']]: props.hasError,
95
+ [s['border-gray-300']]: !props.hasError,
96
+ }), multiple: props.multiple }) }));
73
97
  export const Toggle = (props) => {
74
98
  const [toggle, setToggle] = useState(props.value);
75
99
  const { onChange, disabled, className, isToggleLabel = true } = props;
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import '../../../tc.module.css';
3
2
  interface GridProps {
4
3
  cols?: number;
5
4
  children?: React.ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"grid.component.d.ts","sourceRoot":"","sources":["../../../../../src/core-components/atoms/grid/grid.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,wBAAwB,CAAC;AAChC,UAAU,SAAS;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAInD,CAAC"}
1
+ {"version":3,"file":"grid.component.d.ts","sourceRoot":"","sources":["../../../../../src/core-components/atoms/grid/grid.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,SAAS;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAInD,CAAC"}
@@ -1,3 +1,4 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import '../../../tc.module.css';
3
- export const Grid = (props) => (_jsx("div", { className: `xl:grid sm:inline-block grid-cols-${props.cols || 1} gap-3`, children: props.children }));
2
+ import s from '../../../tc.module.css';
3
+ import { cn } from '../../../core-utils';
4
+ export const Grid = (props) => (_jsx("div", { className: cn(s[`xl:grid`], s[`sm:inline-block`], s[`grid-cols-${props.cols || 1}`], s[`gap-3`]), children: props.children }));
@@ -1 +1 @@
1
- {"version":3,"file":"icons.component.d.ts","sourceRoot":"","sources":["../../../../../src/core-components/atoms/icons/icons.component.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAE9C,OAAO,wBAAwB,CAAC;AAEhC,UAAU,SAAS;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAGD,eAAO,MAAM,IAAI,0DAMd,SAAS,KAAG,WA2Cd,CAAC"}
1
+ {"version":3,"file":"icons.component.d.ts","sourceRoot":"","sources":["../../../../../src/core-components/atoms/icons/icons.component.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAI9C,OAAO,wBAAwB,CAAC;AAEhC,UAAU,SAAS;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAGD,eAAO,MAAM,IAAI,0DAMd,SAAS,KAAG,WA4Cd,CAAC"}
@@ -3,6 +3,8 @@ import { Suspense } from 'react';
3
3
  import _ from 'lodash';
4
4
  import { Tooltip } from '../tooltip/tooltip.component';
5
5
  import loadable from '@loadable/component';
6
+ import s from '../../../tc.module.css';
7
+ import { cn } from '../../../core-utils';
6
8
  import '../../../tc.module.css';
7
9
  let lib = 'md';
8
10
  export const Icon = ({ nameIcon, propsIcon, tooltip = '', isDisable = false, onClick, }) => {
@@ -24,10 +26,10 @@ export const Icon = ({ nameIcon, propsIcon, tooltip = '', isDisable = false, onC
24
26
  ElementIcon = loadable(() => import('react-icons/fa'), {
25
27
  resolveComponent: (el) => el[nameIcon] != null ? el[nameIcon] : el[Object.keys(el.default)[0]],
26
28
  });
27
- return (_jsx("div", { onClick: () => {
29
+ return (_jsx("div", { className: cn(s.iconContainer), onClick: () => {
28
30
  if (!isDisable)
29
31
  onClick && onClick();
30
- }, children: !_.isEmpty(tooltip) ? (_jsx(Tooltip, { content: tooltip, children: _jsx(ElementIcon, { ...iconProps }) })) : (_jsx(Suspense, { fallback: _jsx("div", { children: "Loading..." }), children: _jsx(ElementIcon, { ...iconProps }) })) }));
32
+ }, children: !_.isEmpty(tooltip) ? (_jsx(Tooltip, { content: tooltip, children: _jsx(ElementIcon, { ...iconProps, className: cn(s.icon) }) })) : (_jsx(Suspense, { fallback: _jsx("div", { children: "Loading..." }), children: _jsx(ElementIcon, { ...iconProps, className: cn(s.icon) }) })) }));
31
33
  }
32
34
  catch (error) {
33
35
  return _jsx(_Fragment, {});
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import './input-otp.styles.css';
3
2
  import '../../../tc.module.css';
4
3
  interface PinInputGridProps {
5
4
  title?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"input-otp.component.d.ts","sourceRoot":"","sources":["../../../../../src/core-components/atoms/input/input-otp.component.tsx"],"names":[],"mappings":"AACA,OAAO,KAA0B,MAAM,OAAO,CAAC;AAC/C,OAAO,wBAAwB,CAAC;AAEhC,OAAO,wBAAwB,CAAC;AAChC,UAAU,iBAAiB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAE/B,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACrE;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAyFhD,CAAC"}
1
+ {"version":3,"file":"input-otp.component.d.ts","sourceRoot":"","sources":["../../../../../src/core-components/atoms/input/input-otp.component.tsx"],"names":[],"mappings":"AACA,OAAO,KAA0B,MAAM,OAAO,CAAC;AAI/C,OAAO,wBAAwB,CAAC;AAChC,UAAU,iBAAiB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAE/B,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACrE;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAyFhD,CAAC"}
@@ -1,7 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  /* eslint-disable no-console */
3
3
  import { useEffect, useRef } from 'react';
4
- import './input-otp.styles.css';
4
+ import s from '../../../tc.module.css';
5
+ import { cn } from '../../../core-utils';
5
6
  import '../../../tc.module.css';
6
7
  export const InputOtp = ({ className, pin, onPinChanged, }) => {
7
8
  const pinLength = 6;
@@ -45,7 +46,7 @@ export const InputOtp = ({ className, pin, onPinChanged, }) => {
45
46
  onPinChanged(undefined, index);
46
47
  }
47
48
  };
48
- return (_jsx("div", { className: `${className} relative`, children: _jsx("div", { className: "flex space-x-1 bg-background-secondary rounded-lg outline-offset-8", children: Array.from({ length: pinLength }, (_, index) => (_jsx("input", { "data-testid": "onPinChanged", className: "pt-3 pb-2 block w-full px-0 text-5xl font-extrabold border-b-0 text-orange mt-0 bg-transparent text-center z-20 appearance-none focus:outline-none font-arimaRegular", onKeyDown: (event) => onKeyDown(event, index), onMouseUp: () => {
49
+ return (_jsx("div", { className: cn(className, s['relative']), children: _jsx("div", { className: cn(s['flex'], s['space-x-1'], s['bg-background-secondary'], s['rounded-lg'], s['outline-offset-8']), children: Array.from({ length: pinLength }, (_, index) => (_jsx("input", { "data-testid": "onPinChanged", className: cn(s['pt-3'], s['pb-2'], s['block'], s['w-full'], s['px-0'], s['text-5xl'], s['font-extrabold'], s['border-b-0'], s['text-orange'], s['mt-0'], s['bg-transparent'], s['text-center'], s['z-20'], s['appearance-none'], s['focus:outline-none'], s['font-arimaRegular']), onKeyDown: (event) => onKeyDown(event, index), onMouseUp: () => {
49
50
  if (pin.join('').length <= 0) {
50
51
  changePinFocus(0);
51
52
  }
@@ -1,5 +1,4 @@
1
1
  import './input.styles.css';
2
- import '../../../tc.module.css';
3
2
  interface InputProps {
4
3
  title: string;
5
4
  defaultValue: string;
@@ -1 +1 @@
1
- {"version":3,"file":"input.component.d.ts","sourceRoot":"","sources":["../../../../../src/core-components/atoms/input/input.component.tsx"],"names":[],"mappings":"AAEA,OAAO,oBAAoB,CAAC;AAE5B,OAAO,wBAAwB,CAAC;AAChC,UAAU,UAAU;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CAC/B;AAED,eAAO,MAAM,KAAK,wIAaf,UAAU,4CAyCZ,CAAC"}
1
+ {"version":3,"file":"input.component.d.ts","sourceRoot":"","sources":["../../../../../src/core-components/atoms/input/input.component.tsx"],"names":[],"mappings":"AAEA,OAAO,oBAAoB,CAAC;AAI5B,UAAU,UAAU;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CAC/B;AAED,eAAO,MAAM,KAAK,wIAaf,UAAU,4CAyCZ,CAAC"}
@@ -2,14 +2,15 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  /* eslint-disable no-console */
3
3
  import { useState } from 'react';
4
4
  import './input.styles.css';
5
- import '../../../tc.module.css';
5
+ import s from '../../../tc.module.css';
6
+ import { cn } from '../../../core-utils';
6
7
  export const Input = ({ title, defaultValue, className, disable, hasError, errorMsg, defaultMsg, inputStyle, autoComplete, maxlength = 40, onChange, onBlur, }) => {
7
8
  const [value, setValue] = useState(defaultValue);
8
9
  const onKeyUpValue = (event) => {
9
10
  onChange(event.target.value);
10
11
  };
11
- return (_jsxs("div", { className: `${className} relative`, children: [_jsx("input", { "data-testid": "inputElement", type: "text", name: "name", value: value, placeholder: " ", disabled: disable, className: `pt-3 pb-2 bg-transparent block w-full px-0 mt-0 rounded-none border-0 border-b appearance-none focus:outline-none focus:ring-0 focus:border-gray-secondary border-gray-secondary font-arimaRegular ${inputStyle}`, onChange: (e) => {
12
+ return (_jsxs("div", { className: cn(className, s.relative), children: [_jsx("input", { "data-testid": "inputElement", type: "text", name: "name", value: value, placeholder: " ", disabled: disable, className: cn(s['pt-3'], s['pb-2'], s['bg-transparent'], s['block'], s['w-full'], s['px-0'], s['mt-0'], s['rounded-none'], s['border-0'], s['border-b'], s['appearance-none'], s['focus:outline-none'], s['focus:ring-0'], s['focus:border-gray-secondary'], s['border-gray-secondary'], s['font-arimaRegular'], inputStyle), onChange: (e) => {
12
13
  setValue(e.target.value);
13
14
  onChange && onChange(e.target.value);
14
- }, onKeyUp: onKeyUpValue, onBlur: (e) => onBlur && onBlur(e.target.value), autoComplete: autoComplete, maxLength: maxlength }), _jsx("label", { className: "absolute duration-300 top-3 -z-1 origin-0 text-gray-dark-secondary font-arimaRegular text-md", children: title }), hasError && hasError?.type !== 'required' && (_jsx("span", { className: "text-sm text-red text-4xs", id: "error", children: `${errorMsg || ''}` })), (!hasError || hasError?.type === 'required') && (_jsx("span", { className: "text-sm text-4xs", id: "error", children: `${defaultMsg || ''}` }))] }));
15
+ }, onKeyUp: onKeyUpValue, onBlur: (e) => onBlur && onBlur(e.target.value), autoComplete: autoComplete, maxLength: maxlength }), _jsx("label", { className: cn(s['absolute'], s['duration-300'], s['top-3'], s['-z-1'], s['origin-0'], s['text-gray-dark-secondary'], s['font-arimaRegular'], s['text-md']), children: title }), hasError && hasError?.type !== 'required' && (_jsx("span", { className: cn(s['text-sm'], s['text-red'], s['text-4xs']), id: "error", children: `${errorMsg || ''}` })), (!hasError || hasError?.type === 'required') && (_jsx("span", { className: cn(s['text-sm'], s['text-4xs']), id: "error", children: `${defaultMsg || ''}` }))] }));
15
16
  };
@@ -1 +1 @@
1
- {"version":3,"file":"input-dropdown.component.d.ts","sourceRoot":"","sources":["../../../../../src/core-components/atoms/input-dropdown/input-dropdown.component.tsx"],"names":[],"mappings":"AAGA,OAAO,wBAAwB,CAAC;AAChC,UAAU,kBAAkB;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED,eAAO,MAAM,aAAa,qDAMvB,kBAAkB,4CA0EpB,CAAC"}
1
+ {"version":3,"file":"input-dropdown.component.d.ts","sourceRoot":"","sources":["../../../../../src/core-components/atoms/input-dropdown/input-dropdown.component.tsx"],"names":[],"mappings":"AAKA,OAAO,wBAAwB,CAAC;AAChC,UAAU,kBAAkB;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED,eAAO,MAAM,aAAa,qDAMvB,kBAAkB,4CA0EpB,CAAC"}
@@ -1,6 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState, useEffect, useRef } from 'react';
3
3
  import { UpArrow, DownArrow } from '../../../library/assets/svg';
4
+ import s from '../../../tc.module.css';
5
+ import { cn } from '../../../core-utils';
4
6
  import '../../../tc.module.css';
5
7
  export const InputDropdown = ({ items, className, hasError, title, onChange, }) => {
6
8
  const [isOpen, setIsOpen] = useState(false);
@@ -22,10 +24,10 @@ export const InputDropdown = ({ items, className, hasError, title, onChange, })
22
24
  };
23
25
  const wrapperRef = useRef(null);
24
26
  useOutsideAlerter(wrapperRef);
25
- return (_jsxs("div", { className: `${className} relative`, children: [_jsxs("div", { className: "flex flex-row items-center ", children: [_jsx("input", { type: "text", name: "name", placeholder: title, value: value, className: " pt-3 pb-2 w-full px-0 mt-0 bg-transparent border-gray-secondary border-0 border-b appearance-none focus:outline-none focus:ring-0 font-arimaRegular text-md", onClick: () => {
27
+ return (_jsxs("div", { className: cn(className, s['relative']), children: [_jsxs("div", { className: cn(s['flex'], s['flex-row'], s['items-center']), children: [_jsx("input", { type: "text", name: "name", placeholder: title, value: value, className: cn(s['pt-3'], s['pb-2'], s['w-full'], s['px-0'], s['mt-0'], s['bg-transparent'], s['border-gray-secondary'], s['border-0'], s['border-b'], s['appearance-none'], s['focus:outline-none'], s['focus:ring-0'], s['font-arimaRegular'], s['text-md']), onClick: () => {
26
28
  setIsOpen(!isOpen);
27
- }, onChange: (event) => onChange && onChange(event.target.value) }), !isOpen && (_jsx("img", { src: UpArrow, className: "absolute h-4 w-4 right-0" })), isOpen && (_jsx("img", { src: DownArrow, className: "absolute h-4 w-4 right-0" }))] }), isOpen && (_jsx("div", { className: "z-10 w-full absolute text-base list-none bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700", ref: wrapperRef, children: _jsx("ul", { className: "py-1", children: items.map((item, index) => (_jsx("li", { className: "block py-2 px-4 text-md hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 font-arimaRegular", onClick: () => {
29
+ }, onChange: (event) => onChange && onChange(event.target.value) }), !isOpen && (_jsx("img", { src: UpArrow, className: cn(s['absolute'], s['h-4'], s['w-4'], s['right-0']) })), isOpen && (_jsx("img", { src: DownArrow, className: cn(s['absolute'], s['h-4'], s['w-4'], s['right-0']) }))] }), isOpen && (_jsx("div", { className: cn(s['z-10'], s['w-full'], s['absolute'], s['text-base'], s['list-none'], s['bg-white'], s['rounded'], s['divide-y'], s['divide-gray-100'], s['shadow'], s['dark:bg-gray-700']), ref: wrapperRef, children: _jsx("ul", { className: s['py-1'], children: items.map((item, index) => (_jsx("li", { className: cn(s['block'], s['py-2'], s['px-4'], s['text-md'], s['hover:bg-gray-100'], s['dark:hover:bg-gray-600'], s['dark:text-gray-200'], s['font-arimaRegular']), onClick: () => {
28
30
  setValue(item);
29
31
  setIsOpen(!isOpen);
30
- }, children: item }, index))) }) })), hasError && (_jsx("span", { className: "text-primaryCharcoal text-4xs", id: "error", children: `${title} is required` }))] }));
32
+ }, children: item }, index))) }) })), hasError && (_jsx("span", { className: cn(s['text-primaryCharcoal'], s['text-4xs']), id: "error", children: `${title} is required` }))] }));
31
33
  };
@@ -1 +1 @@
1
- {"version":3,"file":"loader.component.d.ts","sourceRoot":"","sources":["../../../../../src/core-components/atoms/loader/loader.component.tsx"],"names":[],"mappings":"AAGA,OAAO,wBAAwB,CAAC;AAEhC,eAAO,MAAM,MAAM,+CAMlB,CAAC;AAEF,eAAO,MAAM,WAAW,+CAkEvB,CAAC"}
1
+ {"version":3,"file":"loader.component.d.ts","sourceRoot":"","sources":["../../../../../src/core-components/atoms/loader/loader.component.tsx"],"names":[],"mappings":"AAKA,OAAO,wBAAwB,CAAC;AAEhC,eAAO,MAAM,MAAM,+CAMlB,CAAC;AAEF,eAAO,MAAM,WAAW,+CAkEvB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"radio.component.d.ts","sourceRoot":"","sources":["../../../../../src/core-components/atoms/radio/radio.component.tsx"],"names":[],"mappings":"AAIA,OAAO,wBAAwB,CAAC;AAChC,UAAU,UAAU;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,CAAC,IAAI,KAAA,KAAK,IAAI,CAAC;CAC1B;AAED,eAAO,MAAM,KAAK,0CAKf,UAAU,4CAgCZ,CAAC"}
1
+ {"version":3,"file":"radio.component.d.ts","sourceRoot":"","sources":["../../../../../src/core-components/atoms/radio/radio.component.tsx"],"names":[],"mappings":"AAMA,OAAO,wBAAwB,CAAC;AAChC,UAAU,UAAU;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,CAAC,IAAI,KAAA,KAAK,IAAI,CAAC;CAC1B;AAED,eAAO,MAAM,KAAK,0CAKf,UAAU,4CAgCZ,CAAC"}
@@ -1,4 +1,3 @@
1
- import '../../../tc.module.css';
2
1
  interface StepperProps {
3
2
  className?: string;
4
3
  steps: Array<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"stepper.component.d.ts","sourceRoot":"","sources":["../../../../../src/core-components/atoms/stepper/stepper.component.tsx"],"names":[],"mappings":"AAEA,OAAO,wBAAwB,CAAC;AAEhC,UAAU,YAAY;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,CAAC,WAAW,KAAA,EAAE,KAAK,KAAA,KAAK,IAAI,CAAC;CAC3C;AAED,eAAO,MAAM,OAAO,oDAKjB,YAAY,4CAyDd,CAAC"}
1
+ {"version":3,"file":"stepper.component.d.ts","sourceRoot":"","sources":["../../../../../src/core-components/atoms/stepper/stepper.component.tsx"],"names":[],"mappings":"AAIA,UAAU,YAAY;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,CAAC,WAAW,KAAA,EAAE,KAAK,KAAA,KAAK,IAAI,CAAC;CAC3C;AAED,eAAO,MAAM,OAAO,oDAKjB,YAAY,4CAyDd,CAAC"}
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import '../../../tc.module.css';
3
2
  export const Stepper = ({ className = '', steps, currentStep = 1, onStepClick, }) => {
4
3
  const finalClass = `${className} w-full px-4 sm:px-8`;
5
4
  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';
@@ -8,10 +8,11 @@ interface AutoCompleteFilterSingleSelectMultiFieldsDisplayProps {
8
8
  hasError?: boolean;
9
9
  className?: string;
10
10
  posstion?: string;
11
+ keyboard?: string;
11
12
  onFilter?: (item: any) => void;
12
13
  onSelect?: (item: any) => any;
13
14
  onBlur?: (item: any) => any;
14
15
  }
15
- export declare const AutoCompleteFilterSingleSelectMultiFieldsDisplay: ({ disable, loader, displayValue, placeholder, data, hasError, className, posstion, onFilter, onSelect, onBlur, }: AutoCompleteFilterSingleSelectMultiFieldsDisplayProps) => import("react/jsx-runtime").JSX.Element;
16
+ export declare const AutoCompleteFilterSingleSelectMultiFieldsDisplay: ({ disable, loader, displayValue, placeholder, data, hasError, className, posstion, keyboard, onFilter, onSelect, onBlur, }: AutoCompleteFilterSingleSelectMultiFieldsDisplayProps) => import("react/jsx-runtime").JSX.Element;
16
17
  export {};
17
18
  //# sourceMappingURL=auto-complete-filter-single-select-multiple-fields-display.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auto-complete-filter-single-select-multiple-fields-display.component.d.ts","sourceRoot":"","sources":["../../../../../src/core-components/molecules/auto-complete-filter-single-select-multiple-fields-display/auto-complete-filter-single-select-multiple-fields-display.component.tsx"],"names":[],"mappings":"AAIA,OAAO,wBAAwB,CAAC;AAEhC,UAAU,qDAAqD;IAC7D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,GAAG,CAAC;IACV,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC;IAC9B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC;CAC7B;AAED,eAAO,MAAM,gDAAgD,qHAY1D,qDAAqD,4CA8JvD,CAAC"}
1
+ {"version":3,"file":"auto-complete-filter-single-select-multiple-fields-display.component.d.ts","sourceRoot":"","sources":["../../../../../src/core-components/molecules/auto-complete-filter-single-select-multiple-fields-display/auto-complete-filter-single-select-multiple-fields-display.component.tsx"],"names":[],"mappings":"AAIA,OAAO,wBAAwB,CAAC;AAEhC,UAAU,qDAAqD;IAC7D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,GAAG,CAAC;IACV,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC;IAC9B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC;CAC7B;AAED,eAAO,MAAM,gDAAgD,+HAa1D,qDAAqD,4CA8JvD,CAAC"}
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
3
3
  import { useState, useEffect, useRef } from 'react';
4
4
  import { Icon } from '../../atoms/icons/icons.component';
5
5
  import '../../../tc.module.css';
6
- export const AutoCompleteFilterSingleSelectMultiFieldsDisplay = ({ disable = false, loader = false, displayValue = '', placeholder = 'Search...', data, hasError = false, className, posstion = 'absolute', onFilter, onSelect, onBlur, }) => {
6
+ export const AutoCompleteFilterSingleSelectMultiFieldsDisplay = ({ disable = false, loader = false, displayValue = '', placeholder = 'Search...', data, hasError = false, className, posstion = 'absolute', keyboard = 'text', onFilter, onSelect, onBlur, }) => {
7
7
  const [value, setValue] = useState(displayValue);
8
8
  const [options, setOptions] = useState(data.list);
9
9
  const [isListOpen, setIsListOpen] = useState(false);
@@ -55,7 +55,7 @@ export const AutoCompleteFilterSingleSelectMultiFieldsDisplay = ({ disable = fal
55
55
  }
56
56
  }
57
57
  };
58
- return (_jsx(_Fragment, { children: _jsxs("div", { ref: wrapperRef, className: "w-full relative", children: [_jsxs("div", { className: `flex items-center leading-4 p-2 focus:outline-none focus:ring w-full shadow-sm sm:text-base border-2 ${hasError ? 'border-red' : 'border-gray-300'} rounded-md dark:text-black`, children: [_jsx("input", { placeholder: placeholder, value: value, className: `${className} w-full focus:outline-none bg-none dark:text-black`, onKeyUp: onKeyUp, onChange: onChange, onClick: () => setIsListOpen(true), disabled: disable, onMouseDown: () => setValue(''), onBlur: (e) => onBlur && onBlur(e), onKeyDown: onKeyDown }), isListOpen ? (_jsx(Icon, { nameIcon: "FaChevronUp", propsIcon: {
58
+ return (_jsx(_Fragment, { children: _jsxs("div", { ref: wrapperRef, className: "w-full relative", children: [_jsxs("div", { className: `flex items-center leading-4 p-2 focus:outline-none focus:ring w-full shadow-sm sm:text-base border-2 ${hasError ? 'border-red' : 'border-gray-300'} rounded-md dark:text-black`, children: [_jsx("input", { placeholder: placeholder, type: keyboard, value: value, className: `${className} w-full focus:outline-none bg-none dark:text-black`, onKeyUp: onKeyUp, onChange: onChange, onClick: () => setIsListOpen(true), disabled: disable, onMouseDown: () => setValue(''), onBlur: (e) => onBlur && onBlur(e), onKeyDown: onKeyDown }), isListOpen ? (_jsx(Icon, { nameIcon: "FaChevronUp", propsIcon: {
59
59
  color: '#000000',
60
60
  size: 22,
61
61
  } })) : (_jsx(Icon, { nameIcon: "FaChevronDown", propsIcon: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-restyle-components",
3
- "version": "0.2.43",
3
+ "version": "0.2.44",
4
4
  "private": false,
5
5
  "description": "Easy use restyle components",
6
6
  "author": {
@@ -24,6 +24,7 @@
24
24
  "storybook": "storybook dev -p 6006",
25
25
  "build-storybook": "rm -rf docs-build && storybook build -o docs-build",
26
26
  "deploy-storybook": "gh-pages -d docs-build",
27
+ "serve-storybook": "npm run build-storybook -- -o ./docs-build && npx http-server ./docs-build",
27
28
  "lint": "eslint .",
28
29
  "lint:fix": "eslint --fix .",
29
30
  "prettier": "prettier --write '**/*.{js,jsx}'",
@@ -45,7 +46,7 @@
45
46
  "@testing-library/jest-dom": "^5.17.0",
46
47
  "@testing-library/user-event": "^13.5.0",
47
48
  "@types/jest": "^27.5.2",
48
- "@types/node": "^16.18.113",
49
+ "@types/node": "^22.10.2",
49
50
  "@types/react": "^18.3.11",
50
51
  "@types/react-dom": "^18.3.0",
51
52
  "buffer": "^6.0.3",
@@ -83,13 +84,13 @@
83
84
  "@svgr/webpack": "^8.1.0",
84
85
  "@tailwindcss/forms": "^0.5.9",
85
86
  "@testing-library/react": "^16.0.1",
87
+ "@vitejs/plugin-react": "^4.2.1",
86
88
  "@vitest/coverage-c8": "^0.31.4",
87
89
  "@vitest/ui": "^0.31.4",
88
90
  "autoprefixer": "^10.4.19",
89
91
  "copyfiles": "^2.4.1",
90
92
  "craco-alias": "^3.0.1",
91
93
  "css-loader": "^7.1.2",
92
- "@vitejs/plugin-react": "^4.2.1",
93
94
  "eslint": "^9.14.0",
94
95
  "eslint-plugin-storybook": "^0.8.0",
95
96
  "gh-pages": "^3.2.3",
@@ -102,11 +103,11 @@
102
103
  "sass": "^1.77.5",
103
104
  "sass-loader": "^14.2.1",
104
105
  "storybook": "^8.0.6",
106
+ "storybook-css-modules": "^1.0.8",
105
107
  "storybook-multilevel-sort": "^2.0.1",
106
108
  "style-loader": "^4.0.0",
107
109
  "tailwindcss": "^3.4.14",
108
110
  "ts-jest": "^29.2.5",
109
- "webpack": "^5.72.0",
110
111
  "vite": "^5.0.11",
111
112
  "vite-plugin-css-injected-by-js": "^3.1.1",
112
113
  "vite-plugin-dts": "^2.3.0",
@@ -115,7 +116,8 @@
115
116
  "vite-plugin-svgr": "^4.2.0",
116
117
  "vite-tsconfig-paths": "^4.2.0",
117
118
  "vitest": "^0.31.4",
118
- "vitest-dom": "^0.1.0"
119
+ "vitest-dom": "^0.1.0",
120
+ "webpack": "^5.72.0"
119
121
  },
120
122
  "eslintConfig": {
121
123
  "extends": [