dhre-component-lib 0.0.8 → 0.0.9

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 (82) hide show
  1. package/package.json +6 -3
  2. package/jest.config.ts +0 -10
  3. package/rollup.config.mjs +0 -37
  4. package/setupTests.ts +0 -1
  5. package/src/__mocks__/styleMock.js +0 -1
  6. package/src/components/Avatar/Avatar.test.tsx +0 -53
  7. package/src/components/Avatar/Avatar.tsx +0 -28
  8. package/src/components/Avatar/index.ts +0 -1
  9. package/src/components/Badge/Badge.module.scss +0 -14
  10. package/src/components/Badge/Badge.test.tsx +0 -59
  11. package/src/components/Badge/Badge.tsx +0 -25
  12. package/src/components/Badge/index.ts +0 -1
  13. package/src/components/BreadCrumb/BreadCrumb.test.tsx +0 -90
  14. package/src/components/BreadCrumb/BreadCrumb.tsx +0 -45
  15. package/src/components/BreadCrumb/Breadcrumb.module.scss +0 -20
  16. package/src/components/BreadCrumb/index.ts +0 -1
  17. package/src/components/Button/Button.module.scss +0 -66
  18. package/src/components/Button/Button.test.tsx +0 -49
  19. package/src/components/Button/Button.tsx +0 -29
  20. package/src/components/Button/index.ts +0 -1
  21. package/src/components/Checkbox/Checkbox.test.tsx +0 -93
  22. package/src/components/Checkbox/Checkbox.tsx +0 -35
  23. package/src/components/Checkbox/index.ts +0 -1
  24. package/src/components/CircularProgress/CircularProgress.module.scss +0 -19
  25. package/src/components/CircularProgress/CircularProgress.test.tsx +0 -39
  26. package/src/components/CircularProgress/CircularProgress.tsx +0 -37
  27. package/src/components/CircularProgress/index.ts +0 -1
  28. package/src/components/Divider/Divider.test.tsx +0 -44
  29. package/src/components/Divider/Divider.tsx +0 -24
  30. package/src/components/Divider/index.ts +0 -1
  31. package/src/components/Enum.ts +0 -19
  32. package/src/components/InputTextField/InputTextField.test.tsx +0 -118
  33. package/src/components/InputTextField/InputTextField.tsx +0 -48
  34. package/src/components/InputTextField/index.ts +0 -1
  35. package/src/components/Link/Link.test.tsx +0 -55
  36. package/src/components/Link/Link.tsx +0 -33
  37. package/src/components/Link/index.ts +0 -1
  38. package/src/components/Map/Directions.tsx +0 -36
  39. package/src/components/Map/GoogleMap.module.scss +0 -5
  40. package/src/components/Map/GoogleMap.tsx +0 -186
  41. package/src/components/Map/GoogleMapsLoader.tsx +0 -12
  42. package/src/components/Map/index.ts +0 -2
  43. package/src/components/Modal/Modal.module.scss +0 -26
  44. package/src/components/Modal/Modal.test.tsx +0 -74
  45. package/src/components/Modal/Modal.tsx +0 -39
  46. package/src/components/Modal/index.ts +0 -1
  47. package/src/components/Notification/Notification.module.scss +0 -20
  48. package/src/components/Notification/Notification.test.tsx +0 -53
  49. package/src/components/Notification/Notification.tsx +0 -42
  50. package/src/components/Notification/index.ts +0 -1
  51. package/src/components/OtpInput/OtpInput.module.scss +0 -49
  52. package/src/components/OtpInput/OtpInput.test.tsx +0 -53
  53. package/src/components/OtpInput/OtpInput.tsx +0 -137
  54. package/src/components/OtpInput/index.ts +0 -1
  55. package/src/components/PdfView/PdfView.module.scss +0 -69
  56. package/src/components/PdfView/PdfView.test.tsx +0 -52
  57. package/src/components/PdfView/PdfView.tsx +0 -116
  58. package/src/components/PdfView/index.ts +0 -1
  59. package/src/components/Progress/Progress.test.tsx +0 -43
  60. package/src/components/Progress/Progress.tsx +0 -35
  61. package/src/components/Progress/index.ts +0 -1
  62. package/src/components/RadioButton/RadioButton.test.tsx +0 -56
  63. package/src/components/RadioButton/RadioButton.tsx +0 -43
  64. package/src/components/RadioButton/index.ts +0 -1
  65. package/src/components/Switch/Switch.test.tsx +0 -83
  66. package/src/components/Switch/Switch.tsx +0 -38
  67. package/src/components/Switch/index.ts +0 -1
  68. package/src/components/Tag/Tag.css +0 -14
  69. package/src/components/Tag/Tag.test.tsx +0 -61
  70. package/src/components/Tag/Tag.tsx +0 -19
  71. package/src/components/Tag/index.ts +0 -1
  72. package/src/components/Tooltip/Tooltip.module.scss +0 -37
  73. package/src/components/Tooltip/Tooltip.test.tsx +0 -68
  74. package/src/components/Tooltip/Tooltip.tsx +0 -38
  75. package/src/components/Tooltip/index.ts +0 -1
  76. package/src/components/index.ts +0 -15
  77. package/src/index.ts +0 -1
  78. package/src/theme/Typography/typography.scss +0 -117
  79. package/src/theme/colors/colors.scss +0 -22
  80. package/src/theme/colors.ts +0 -3
  81. package/src/typings.d.ts +0 -1
  82. package/tsconfig.json +0 -16
@@ -1,14 +0,0 @@
1
- .customTagClass {
2
- display: inline-block;
3
- padding: 5px 10px;
4
- background-color: #f0f0f0;
5
- color: #333;
6
- border-radius: 12px;
7
- font-size: 14px;
8
- cursor: pointer;
9
- margin-right: 8px;
10
-
11
- &:hover {
12
- background-color: #e0e0e0;
13
- }
14
- }
@@ -1,61 +0,0 @@
1
- import React from 'react';
2
- import { render, screen, fireEvent } from '@testing-library/react';
3
- import '@testing-library/jest-dom';
4
- import Tag, { TagProps } from './Tag';
5
-
6
- describe('Tag Component', () => {
7
- let handleClick: jest.Mock;
8
-
9
- beforeEach(() => {
10
- handleClick = jest.fn(); // Reset the mock function before each test
11
- });
12
-
13
- // Function to generate default props for each test
14
- const getDefaultProps = (): TagProps => ({
15
- content: 'Sample Tag',
16
- tagClassName: 'tag-class',
17
- handleClick,
18
- });
19
-
20
- it('renders the tag with the correct content', () => {
21
- render(<Tag {...getDefaultProps()} />);
22
-
23
- const tagElement = screen.getByText('Sample Tag');
24
-
25
- expect(tagElement).toBeInTheDocument();
26
- });
27
-
28
- it('applies the correct className to the tag', () => {
29
- render(<Tag {...getDefaultProps()} />);
30
-
31
- const tagElement = screen.getByText('Sample Tag');
32
-
33
- expect(tagElement).toHaveClass('tag-class');
34
- });
35
-
36
- it('calls the handleClick function when the tag is clicked', () => {
37
- render(<Tag {...getDefaultProps()} />);
38
-
39
- const tagElement = screen.getByText('Sample Tag');
40
-
41
- fireEvent.click(tagElement);
42
-
43
- expect(handleClick).toHaveBeenCalledTimes(1);
44
- });
45
-
46
- it('does not call handleClick when the tag is not clicked', () => {
47
- render(<Tag {...getDefaultProps()} />);
48
-
49
- expect(handleClick).not.toHaveBeenCalled();
50
- });
51
-
52
- it('renders correctly with different content', () => {
53
- const newContent = 'New Tag Content';
54
- render(<Tag {...getDefaultProps()} content={newContent} />);
55
-
56
- const tagElement = screen.getByText(newContent);
57
-
58
- expect(tagElement).toBeInTheDocument();
59
- expect(tagElement).toHaveTextContent(newContent);
60
- });
61
- });
@@ -1,19 +0,0 @@
1
- import React from "react";
2
- import styles from "./Tag.module.scss";
3
-
4
- export interface TagProps {
5
- content: string | number;
6
- tagClassName?: string; // Optional prop for custom class name
7
- handleClick?: () => void;
8
- style?: React.CSSProperties; // Inline styles as props
9
- }
10
-
11
- const Tag: React.FC<TagProps> = ({ content, tagClassName = styles.customTagClass, handleClick, style }) => {
12
- return (
13
- <button onClick={handleClick} style={style} className={tagClassName}>
14
- {content}
15
- </button>
16
- );
17
- };
18
-
19
- export default Tag;
@@ -1 +0,0 @@
1
- export { default } from "./Tag";
@@ -1,37 +0,0 @@
1
- .tooltipWrapper {
2
- display: inline-block;
3
- position: relative;
4
- margin-right: 20px;
5
- }
6
-
7
- .customTooltipClass {
8
- position: absolute;
9
- bottom: 125%; /* Position above the element */
10
- left: 50%;
11
- transform: translateX(-50%);
12
- background-color: #333;
13
- color: #fff;
14
- padding: 5px 10px;
15
- border-radius: 4px;
16
- font-size: 14px;
17
- white-space: nowrap;
18
- visibility: visible;
19
- opacity: 1;
20
- transition: opacity 0.2s ease-in-out;
21
- }
22
-
23
- .customTooltipClass::after {
24
- content: "";
25
- position: absolute;
26
- top: 100%;
27
- left: 50%;
28
- transform: translateX(-50%);
29
- border-width: 5px;
30
- border-style: solid;
31
- border-color: #333 transparent transparent transparent;
32
- }
33
-
34
- .hoverText {
35
- color: blue;
36
- cursor: pointer;
37
- }
@@ -1,68 +0,0 @@
1
- import React from "react";
2
- import { render, screen, fireEvent } from "@testing-library/react";
3
- import "@testing-library/jest-dom";
4
- import Tooltip, { TooltipProps } from "./Tooltip";
5
-
6
- describe("Tooltip Component", () => {
7
- const defaultProps: TooltipProps = {
8
- content: "Tooltip content",
9
- tooltipClassName: "tooltip-class",
10
- children: <button>Hover me</button>,
11
- };
12
-
13
- it("renders the children correctly", () => {
14
- render(<Tooltip {...defaultProps} />);
15
-
16
- const childElement = screen.getByText("Hover me");
17
-
18
- expect(childElement).toBeInTheDocument();
19
- });
20
-
21
- it("does not show tooltip content by default", () => {
22
- render(<Tooltip {...defaultProps} />);
23
-
24
- const tooltipElement = screen.queryByText(defaultProps.content);
25
-
26
- expect(tooltipElement).not.toBeInTheDocument();
27
- });
28
-
29
- it("shows tooltip content on mouse enter and hides it on mouse leave", () => {
30
- render(<Tooltip {...defaultProps} />);
31
-
32
- const childElement = screen.getByText("Hover me");
33
-
34
- // Trigger mouse enter
35
- fireEvent.mouseEnter(childElement);
36
- let tooltipElement = screen.queryByText(defaultProps.content);
37
- expect(tooltipElement).toBeInTheDocument();
38
- expect(tooltipElement).toHaveClass(defaultProps.tooltipClassName);
39
-
40
- // Trigger mouse leave
41
- fireEvent.mouseLeave(childElement);
42
- tooltipElement = screen.queryByText(defaultProps.content);
43
-
44
- // Ensure tooltipElement is null if it was not found
45
- expect(tooltipElement).toBeNull();
46
- });
47
-
48
- it("applies the correct container className", () => {
49
- const customClassName = "custom-container-class";
50
- render(<Tooltip {...defaultProps} containerClassName={customClassName} />);
51
-
52
- const containerElement = screen.getByText("Hover me").parentElement;
53
-
54
- expect(containerElement).toHaveClass(customClassName);
55
- });
56
-
57
- it("handles tooltip visibility correctly", () => {
58
- render(<Tooltip {...defaultProps} />);
59
-
60
- const childElement = screen.getByText("Hover me");
61
-
62
- fireEvent.mouseEnter(childElement);
63
-
64
- const tooltipElement = screen.queryByText(defaultProps.content);
65
-
66
- expect(tooltipElement).toBeInTheDocument();
67
- });
68
- });
@@ -1,38 +0,0 @@
1
- import React, { useState } from "react";
2
- import styles from './Tooltip.module.scss';
3
-
4
- export interface TooltipProps {
5
- content: string;
6
- tooltipClassName: string;
7
- children: React.ReactNode;
8
- containerClassName?: string;
9
- }
10
-
11
- const Tooltip: React.FC<TooltipProps> = ({
12
- content,
13
- tooltipClassName,
14
- children,
15
- containerClassName = "",
16
- }) => {
17
- const [visible, setVisible] = useState(false);
18
-
19
- const showTooltip = () => setVisible(true);
20
- const hideTooltip = () => setVisible(false);
21
-
22
- return (
23
- <div
24
- className={`${styles.tooltipWrapper} ${containerClassName}`}
25
- onMouseEnter={showTooltip}
26
- onMouseLeave={hideTooltip}
27
- >
28
- {children}
29
- {visible && (
30
- <div className={`${styles.customTooltipClass} ${tooltipClassName}`}>
31
- {content}
32
- </div>
33
- )}
34
- </div>
35
- );
36
- };
37
-
38
- export default Tooltip;
@@ -1 +0,0 @@
1
- export { default } from "./Tooltip";
@@ -1,15 +0,0 @@
1
- export { default as Button } from "./Button";
2
- export { default as Avatar } from "./Avatar";
3
- export { default as Badge } from "./Badge";
4
- export { default as BreadCrumb } from "./BreadCrumb";
5
- export { default as Checkbox } from "./Checkbox";
6
- export { default as CircularProgress } from "./CircularProgress";
7
- export { default as Divider } from "./Divider";
8
- export { default as Link } from "./Link";
9
- export { default as Progress } from "./Progress";
10
- export { default as RadioButton } from "./RadioButton";
11
- export { default as InputTextField } from "./InputTextField";
12
- export { default } from "./PdfView";
13
- export { default as Directions } from "./Map/Directions";
14
- export { default as GoogleMap } from "./Map/GoogleMap";
15
- export { default as OtpInput } from "./OtpInput/OtpInput";
package/src/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from './components';
@@ -1,117 +0,0 @@
1
- $bold-weight: 700;
2
- $semi-bold-weight: 400;
3
- $medium-weight: 300;
4
-
5
-
6
- $font-sizes: (
7
- 'H1': 40px,
8
- 'H2': 36px,
9
- 'H3': 32px,
10
- 'H4': 26px,
11
- 'H5': 24px,
12
- 'H6': 22px,
13
- 'H7': 20px,
14
- 'H8': 18px,
15
- 'B1':20px,
16
- 'B2':18px,
17
- 'B3':16px,
18
- 'B4':14px,
19
- 'L1':14px,
20
- 'L2':12px,
21
- 'L3':10px,
22
- );
23
-
24
- $line-heights: (
25
- 'H1': 56px,
26
- 'H2': 50.4px,
27
- 'H3': 44.8px,
28
- 'H4': 36.4px,
29
- 'H5': 33.6px,
30
- 'H6': 30.8px,
31
- 'H7': 28px,
32
- 'H8': 25.2px,
33
- 'B1': 28px,
34
- 'B2': 25.2px,
35
- 'B3': 22.4px,
36
- 'B4': 22.4px,
37
- 'L1': 19.6px,
38
- 'L2': 16.8px,
39
- 'L3': 14px,
40
- );
41
-
42
- @mixin font-style($type, $weight, $font-size-key) {
43
- $font-size: map-get($font-sizes, $font-size-key);
44
- $line-height: map-get($line-heights, $font-size-key);
45
-
46
- font-weight: $weight;
47
- font-size: $font-size;
48
- line-height: $line-height;
49
- }
50
-
51
- // H1 Styles
52
- .H1_BOLD { @include font-style('heading', $bold-weight, 'H1'); }
53
- .H1_SEMI_BOLD { @include font-style('heading', $semi-bold-weight, 'H1'); }
54
- .H1_MEDIUM { @include font-style('heading', $medium-weight, 'H1'); }
55
-
56
- // H2 Styles
57
- .H2_BOLD { @include font-style('heading', $bold-weight, 'H2'); }
58
- .H2_SEMI_BOLD { @include font-style('heading', $semi-bold-weight, 'H2'); }
59
- .H2_MEDIUM { @include font-style('heading', $medium-weight, 'H2'); }
60
-
61
- // H3 Styles
62
- .H3_BOLD { @include font-style('heading', $bold-weight, 'H3'); }
63
- .H3_SEMI_BOLD { @include font-style('heading', $semi-bold-weight, 'H3'); }
64
- .H3_MEDIUM { @include font-style('heading', $medium-weight, 'H3'); }
65
-
66
- // H4 Styles
67
- .H4_BOLD { @include font-style('heading', $bold-weight, 'H4'); }
68
- .H4_SEMI_BOLD { @include font-style('heading', $semi-bold-weight, 'H4'); }
69
- .H4_MEDIUM { @include font-style('heading', $medium-weight, 'H4'); }
70
-
71
- // H5 Styles
72
- .H5_BOLD { @include font-style('heading', $bold-weight, 'H5'); }
73
- .H5_SEMI_BOLD { @include font-style('heading', $semi-bold-weight, 'H5'); }
74
- .H5_MEDIUM { @include font-style('heading', $medium-weight, 'H5'); }
75
-
76
- // H6 Styles
77
- .H6_BOLD { @include font-style('heading', $bold-weight, 'H6'); }
78
- .H6_SEMI_BOLD { @include font-style('heading', $semi-bold-weight, 'H6'); }
79
- .H6_MEDIUM { @include font-style('heading', $medium-weight, 'H6'); }
80
-
81
- // H7 Styles
82
- .H7_BOLD { @include font-style('heading', $bold-weight, 'H7'); }
83
- .H7_SEMI_BOLD { @include font-style('heading', $semi-bold-weight, 'H7'); }
84
- .H7_MEDIUM { @include font-style('heading', $medium-weight, 'H7'); }
85
-
86
- // H8 Styles
87
- .H8_BOLD { @include font-style('heading', $bold-weight, 'H8'); }
88
- .H8_SEMI_BOLD { @include font-style('heading', $semi-bold-weight, 'H8'); }
89
- .H8_MEDIUM { @include font-style('heading', $medium-weight, 'H8'); }
90
-
91
- // B1 Styles
92
- .B1_BOLD { @include font-style('body', $bold-weight, 'B1'); }
93
- .B1_SEMI_BOLD { @include font-style('body', $semi-bold-weight, 'B1'); }
94
-
95
- // B2 Styles
96
- .B2_BOLD { @include font-style('body', $bold-weight, 'B2'); }
97
- .B2_SEMI_BOLD { @include font-style('body', $semi-bold-weight, 'B2'); }
98
-
99
- // B3 Styles
100
- .B3_BOLD { @include font-style('body', $bold-weight, 'B3'); }
101
- .B3_SEMI_BOLD { @include font-style('body', $semi-bold-weight, 'B3'); }
102
-
103
- // B4 Styles
104
- .B4_BOLD { @include font-style('body', $bold-weight, 'B4'); }
105
- .B4_SEMI_BOLD { @include font-style('body', $semi-bold-weight, 'B4'); }
106
-
107
- // L1 Styles
108
- .L1_BOLD { @include font-style('body', $bold-weight, 'L1'); }
109
- .L1_SEMI_BOLD { @include font-style('body', $semi-bold-weight, 'L1'); }
110
-
111
- // L2 Styles
112
- .L2_BOLD { @include font-style('body', $bold-weight, 'L2'); }
113
- .L2_SEMI_BOLD { @include font-style('body', $semi-bold-weight, 'L2'); }
114
-
115
- // L3 Styles
116
- .L3_BOLD { @include font-style('body', $bold-weight, 'L3'); }
117
- .L3_SEMI_BOLD { @include font-style('body', $semi-bold-weight, 'L3'); }
@@ -1,22 +0,0 @@
1
- $surface-primary: #FFFFFF;
2
- $surface-secondary: #F5F5F5;
3
- $surface-static: #FFFFFF;
4
- $surface-brand-static: #D92D27;
5
- $surface-brand-transparent-static: #D92D3E33;
6
- $surface-disabled: #E1E1E1;
7
- $surface-inverted-transparent: #68686833;
8
-
9
- $content-primary: #000000;
10
- $content-secondary: #686868;
11
- $content-disabled: #A7A7A7;
12
- $content-inverted: #FFFFFF;
13
- $content-static: #FFFFFF;
14
- $content-secondary-static: #CECECE;
15
-
16
- $border-primary: #686868;
17
- $border-secondary: #A7A7A7;
18
- $border-disabled: #CECECE;
19
- $border-inverted: #000000;
20
- $border-brand-static: #D92D27;
21
- $border-static: #FFFFFF;
22
- $border-brand-danger: #EB0542;
@@ -1,3 +0,0 @@
1
- // format: Color name: BRAND_800
2
-
3
- export const COLORS = {};
package/src/typings.d.ts DELETED
@@ -1 +0,0 @@
1
- declare module '*.scss';
package/tsconfig.json DELETED
@@ -1,16 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "module": "ESNext", // Module system to use
4
- "target": "ES5", // Target JavaScript version
5
- "moduleResolution": "node", // Module resolution strategy
6
- "declaration": true, // Generate .d.ts files
7
- "outDir": "./dist", // Output directory for compiled files
8
- "jsx": "react-jsx", // JSX handling for React
9
- "esModuleInterop": true, // Enable interoperability between CommonJS and ESModules
10
- "skipLibCheck": true , // Skip checking type declarations of libraries
11
- "types": ["@testing-library/jest-dom","@types/google.maps", "node"],
12
- "lib": ["ES2015", "DOM"],
13
- },
14
- "include": ["src/**/*"], // Include all source files in the src directory
15
- "exclude": ["node_modules", "dist", "**/*.test.ts"] // Exclude unnecessary files
16
- }