dhre-component-lib 0.1.4 → 0.1.6

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 (126) hide show
  1. package/package.json +3 -7
  2. package/src/components/Badge/Badge.tsx +2 -2
  3. package/dist/components/Avatar/Avatar.d.ts +0 -9
  4. package/dist/components/Avatar/Avatar.js +0 -6
  5. package/dist/components/Avatar/Avatar.test.d.ts +0 -1
  6. package/dist/components/Avatar/Avatar.test.js +0 -50
  7. package/dist/components/Avatar/index.d.ts +0 -1
  8. package/dist/components/Avatar/index.js +0 -1
  9. package/dist/components/Badge/Badge.d.ts +0 -9
  10. package/dist/components/Badge/Badge.js +0 -7
  11. package/dist/components/Badge/Badge.test.d.ts +0 -1
  12. package/dist/components/Badge/Badge.test.js +0 -52
  13. package/dist/components/Badge/index.d.ts +0 -1
  14. package/dist/components/Badge/index.js +0 -1
  15. package/dist/components/BreadCrumb/BreadCrumb.d.ts +0 -14
  16. package/dist/components/BreadCrumb/BreadCrumb.js +0 -8
  17. package/dist/components/BreadCrumb/BreadCrumb.test.d.ts +0 -1
  18. package/dist/components/BreadCrumb/BreadCrumb.test.js +0 -55
  19. package/dist/components/BreadCrumb/index.d.ts +0 -1
  20. package/dist/components/BreadCrumb/index.js +0 -1
  21. package/dist/components/Button/Button.d.ts +0 -10
  22. package/dist/components/Button/Button.js +0 -7
  23. package/dist/components/Button/Button.test.d.ts +0 -1
  24. package/dist/components/Button/Button.test.js +0 -48
  25. package/dist/components/Button/index.d.ts +0 -1
  26. package/dist/components/Button/index.js +0 -1
  27. package/dist/components/Checkbox/Checkbox.d.ts +0 -11
  28. package/dist/components/Checkbox/Checkbox.js +0 -28
  29. package/dist/components/Checkbox/Checkbox.test.d.ts +0 -1
  30. package/dist/components/Checkbox/Checkbox.test.js +0 -70
  31. package/dist/components/Checkbox/index.d.ts +0 -1
  32. package/dist/components/Checkbox/index.js +0 -1
  33. package/dist/components/CircularProgress/CircularProgress.d.ts +0 -10
  34. package/dist/components/CircularProgress/CircularProgress.js +0 -22
  35. package/dist/components/CircularProgress/CircularProgress.test.d.ts +0 -1
  36. package/dist/components/CircularProgress/CircularProgress.test.js +0 -44
  37. package/dist/components/CircularProgress/index.d.ts +0 -1
  38. package/dist/components/CircularProgress/index.js +0 -1
  39. package/dist/components/Divider/Divider.d.ts +0 -8
  40. package/dist/components/Divider/Divider.js +0 -29
  41. package/dist/components/Divider/Divider.test.d.ts +0 -1
  42. package/dist/components/Divider/Divider.test.js +0 -31
  43. package/dist/components/Divider/index.d.ts +0 -1
  44. package/dist/components/Divider/index.js +0 -1
  45. package/dist/components/Enum.d.ts +0 -17
  46. package/dist/components/Enum.js +0 -17
  47. package/dist/components/InputTextField/InputTextField.d.ts +0 -16
  48. package/dist/components/InputTextField/InputTextField.js +0 -29
  49. package/dist/components/InputTextField/InputTextField.test.d.ts +0 -1
  50. package/dist/components/InputTextField/InputTextField.test.js +0 -97
  51. package/dist/components/InputTextField/index.d.ts +0 -1
  52. package/dist/components/InputTextField/index.js +0 -1
  53. package/dist/components/Link/Link.d.ts +0 -10
  54. package/dist/components/Link/Link.js +0 -29
  55. package/dist/components/Link/Link.test.d.ts +0 -1
  56. package/dist/components/Link/Link.test.js +0 -58
  57. package/dist/components/Link/index.d.ts +0 -1
  58. package/dist/components/Link/index.js +0 -1
  59. package/dist/components/Map/Directions.d.ts +0 -13
  60. package/dist/components/Map/Directions.js +0 -6
  61. package/dist/components/Map/GoogleMap.d.ts +0 -12
  62. package/dist/components/Map/GoogleMap.js +0 -100
  63. package/dist/components/Map/GoogleMapsLoader.d.ts +0 -4
  64. package/dist/components/Map/GoogleMapsLoader.js +0 -10
  65. package/dist/components/Map/index.d.ts +0 -2
  66. package/dist/components/Map/index.js +0 -2
  67. package/dist/components/Modal/Modal.d.ts +0 -10
  68. package/dist/components/Modal/Modal.js +0 -14
  69. package/dist/components/Modal/Modal.test.d.ts +0 -1
  70. package/dist/components/Modal/Modal.test.js +0 -51
  71. package/dist/components/Modal/index.d.ts +0 -1
  72. package/dist/components/Modal/index.js +0 -1
  73. package/dist/components/Notification/Notification.d.ts +0 -10
  74. package/dist/components/Notification/Notification.js +0 -21
  75. package/dist/components/Notification/Notification.test.d.ts +0 -1
  76. package/dist/components/Notification/Notification.test.js +0 -97
  77. package/dist/components/Notification/index.d.ts +0 -1
  78. package/dist/components/Notification/index.js +0 -1
  79. package/dist/components/OtpInput/OtpInput.d.ts +0 -14
  80. package/dist/components/OtpInput/OtpInput.js +0 -74
  81. package/dist/components/OtpInput/OtpInput.test.d.ts +0 -1
  82. package/dist/components/OtpInput/OtpInput.test.js +0 -76
  83. package/dist/components/OtpInput/index.d.ts +0 -1
  84. package/dist/components/OtpInput/index.js +0 -1
  85. package/dist/components/PdfView/PdfView.d.ts +0 -18
  86. package/dist/components/PdfView/PdfView.js +0 -92
  87. package/dist/components/PdfView/PdfView.test.d.ts +0 -1
  88. package/dist/components/PdfView/PdfView.test.js +0 -41
  89. package/dist/components/PdfView/index.d.ts +0 -1
  90. package/dist/components/PdfView/index.js +0 -1
  91. package/dist/components/Progress/Progress.d.ts +0 -12
  92. package/dist/components/Progress/Progress.js +0 -29
  93. package/dist/components/Progress/Progress.test.d.ts +0 -1
  94. package/dist/components/Progress/Progress.test.js +0 -34
  95. package/dist/components/Progress/index.d.ts +0 -1
  96. package/dist/components/Progress/index.js +0 -1
  97. package/dist/components/RadioButton/RadioButton.d.ts +0 -14
  98. package/dist/components/RadioButton/RadioButton.js +0 -28
  99. package/dist/components/RadioButton/RadioButton.test.d.ts +0 -1
  100. package/dist/components/RadioButton/RadioButton.test.js +0 -29
  101. package/dist/components/RadioButton/index.d.ts +0 -1
  102. package/dist/components/RadioButton/index.js +0 -1
  103. package/dist/components/Switch/Switch.d.ts +0 -13
  104. package/dist/components/Switch/Switch.js +0 -7
  105. package/dist/components/Switch/Switch.test.d.ts +0 -1
  106. package/dist/components/Switch/Switch.test.js +0 -46
  107. package/dist/components/Switch/index.d.ts +0 -1
  108. package/dist/components/Switch/index.js +0 -1
  109. package/dist/components/Tag/Tag.d.ts +0 -9
  110. package/dist/components/Tag/Tag.js +0 -7
  111. package/dist/components/Tag/Tag.test.d.ts +0 -1
  112. package/dist/components/Tag/Tag.test.js +0 -54
  113. package/dist/components/Tag/index.d.ts +0 -1
  114. package/dist/components/Tag/index.js +0 -1
  115. package/dist/components/Tooltip/Tooltip.d.ts +0 -9
  116. package/dist/components/Tooltip/Tooltip.js +0 -11
  117. package/dist/components/Tooltip/Tooltip.test.d.ts +0 -1
  118. package/dist/components/Tooltip/Tooltip.test.js +0 -59
  119. package/dist/components/Tooltip/index.d.ts +0 -1
  120. package/dist/components/Tooltip/index.js +0 -1
  121. package/dist/components/index.d.ts +0 -15
  122. package/dist/components/index.js +0 -15
  123. package/dist/index.d.ts +0 -1
  124. package/dist/index.js +0 -1
  125. package/dist/theme/colors.d.ts +0 -1
  126. package/dist/theme/colors.js +0 -2
@@ -1 +0,0 @@
1
- export { default } from "./RadioButton";
@@ -1 +0,0 @@
1
- export { default } from "./RadioButton";
@@ -1,13 +0,0 @@
1
- import React from "react";
2
- import './Switch.css';
3
- export interface SwitchProps {
4
- checked: boolean;
5
- handleChange: () => void;
6
- switchClassName: string;
7
- label?: string;
8
- labelClassName?: string;
9
- containerClassName?: string;
10
- toggleClassName?: string;
11
- }
12
- declare const Switch: React.FC<SwitchProps>;
13
- export default Switch;
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import './Switch.css';
3
- var Switch = function (_a) {
4
- var checked = _a.checked, handleChange = _a.handleChange, switchClassName = _a.switchClassName, label = _a.label, labelClassName = _a.labelClassName, containerClassName = _a.containerClassName, toggleClassName = _a.toggleClassName;
5
- return (_jsxs("div", { className: containerClassName, children: [label && _jsx("span", { className: labelClassName, children: label }), _jsxs("label", { className: toggleClassName, children: [_jsx("input", { type: "checkbox", checked: checked, onChange: handleChange }), _jsx("span", { className: switchClassName })] })] }));
6
- };
7
- export default Switch;
@@ -1 +0,0 @@
1
- import '@testing-library/jest-dom';
@@ -1,46 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useState } from 'react';
3
- import { render, screen, fireEvent } from '@testing-library/react';
4
- import '@testing-library/jest-dom';
5
- import Switch from './Switch';
6
- describe('Switch Component', function () {
7
- it('renders with basic props', function () {
8
- var container = render(_jsx(Switch, { checked: true, handleChange: function () { }, switchClassName: "switch-class" })).container;
9
- var switchInput = screen.getByRole('checkbox');
10
- var switchToggle = container.querySelector('.switch-class');
11
- expect(switchInput).toBeInTheDocument();
12
- expect(switchInput).toBeChecked();
13
- expect(switchToggle).toBeInTheDocument();
14
- });
15
- it('renders with a label', function () {
16
- render(_jsx(Switch, { checked: true, handleChange: function () { }, switchClassName: "switch-class", label: "Toggle Switch", labelClassName: "label-class" }));
17
- var label = screen.getByText('Toggle Switch');
18
- var switchInput = screen.getByRole('checkbox');
19
- expect(label).toBeInTheDocument();
20
- expect(label).toHaveClass('label-class');
21
- expect(switchInput).toBeChecked();
22
- });
23
- it('calls handleChange handler when clicked', function () {
24
- // Simulate a component that manages its own state
25
- var TestComponent = function () {
26
- var _a = useState(false), checked = _a[0], setChecked = _a[1];
27
- return (_jsx(Switch, { checked: checked, handleChange: function () { return setChecked(!checked); }, switchClassName: "switch-class" }));
28
- };
29
- render(_jsx(TestComponent, {}));
30
- var switchInput = screen.getByRole('checkbox');
31
- expect(switchInput).not.toBeChecked();
32
- // Simulate the click event
33
- fireEvent.click(switchInput);
34
- // Check if the switchInput is now checked
35
- expect(switchInput).toBeChecked();
36
- });
37
- it('applies custom classes', function () {
38
- var container = render(_jsx(Switch, { checked: true, handleChange: function () { }, switchClassName: "switch-class", containerClassName: "container-class", toggleClassName: "toggle-class", label: "Toggle Switch", labelClassName: "label-class" })).container;
39
- var containerDiv = container.querySelector('.container-class');
40
- var switchToggle = container.querySelector('.switch-class');
41
- var label = screen.getByText('Toggle Switch');
42
- expect(containerDiv).toHaveClass('container-class');
43
- expect(switchToggle).toHaveClass('switch-class');
44
- expect(label).toHaveClass('label-class');
45
- });
46
- });
@@ -1 +0,0 @@
1
- export { default } from "./Switch";
@@ -1 +0,0 @@
1
- export { default } from "./Switch";
@@ -1,9 +0,0 @@
1
- import React from "react";
2
- export interface TagProps {
3
- content: string | number;
4
- tagClassName?: string;
5
- handleClick?: () => void;
6
- style?: React.CSSProperties;
7
- }
8
- declare const Tag: React.FC<TagProps>;
9
- export default Tag;
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import styles from "./Tag.module.scss";
3
- var Tag = function (_a) {
4
- var content = _a.content, _b = _a.tagClassName, tagClassName = _b === void 0 ? styles.customTagClass : _b, handleClick = _a.handleClick, style = _a.style;
5
- return (_jsx("button", { onClick: handleClick, style: style, className: tagClassName, children: content }));
6
- };
7
- export default Tag;
@@ -1 +0,0 @@
1
- import '@testing-library/jest-dom';
@@ -1,54 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- import { render, screen, fireEvent } from '@testing-library/react';
14
- import '@testing-library/jest-dom';
15
- import Tag from './Tag';
16
- describe('Tag Component', function () {
17
- var handleClick;
18
- beforeEach(function () {
19
- handleClick = jest.fn(); // Reset the mock function before each test
20
- });
21
- // Function to generate default props for each test
22
- var getDefaultProps = function () { return ({
23
- content: 'Sample Tag',
24
- tagClassName: 'tag-class',
25
- handleClick: handleClick,
26
- }); };
27
- it('renders the tag with the correct content', function () {
28
- render(_jsx(Tag, __assign({}, getDefaultProps())));
29
- var tagElement = screen.getByText('Sample Tag');
30
- expect(tagElement).toBeInTheDocument();
31
- });
32
- it('applies the correct className to the tag', function () {
33
- render(_jsx(Tag, __assign({}, getDefaultProps())));
34
- var tagElement = screen.getByText('Sample Tag');
35
- expect(tagElement).toHaveClass('tag-class');
36
- });
37
- it('calls the handleClick function when the tag is clicked', function () {
38
- render(_jsx(Tag, __assign({}, getDefaultProps())));
39
- var tagElement = screen.getByText('Sample Tag');
40
- fireEvent.click(tagElement);
41
- expect(handleClick).toHaveBeenCalledTimes(1);
42
- });
43
- it('does not call handleClick when the tag is not clicked', function () {
44
- render(_jsx(Tag, __assign({}, getDefaultProps())));
45
- expect(handleClick).not.toHaveBeenCalled();
46
- });
47
- it('renders correctly with different content', function () {
48
- var newContent = 'New Tag Content';
49
- render(_jsx(Tag, __assign({}, getDefaultProps(), { content: newContent })));
50
- var tagElement = screen.getByText(newContent);
51
- expect(tagElement).toBeInTheDocument();
52
- expect(tagElement).toHaveTextContent(newContent);
53
- });
54
- });
@@ -1 +0,0 @@
1
- export { default } from "./Tag";
@@ -1 +0,0 @@
1
- export { default } from "./Tag";
@@ -1,9 +0,0 @@
1
- import React from "react";
2
- export interface TooltipProps {
3
- content: string;
4
- tooltipClassName: string;
5
- children: React.ReactNode;
6
- containerClassName?: string;
7
- }
8
- declare const Tooltip: React.FC<TooltipProps>;
9
- export default Tooltip;
@@ -1,11 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState } from "react";
3
- import styles from './Tooltip.module.scss';
4
- var Tooltip = function (_a) {
5
- var content = _a.content, tooltipClassName = _a.tooltipClassName, children = _a.children, _b = _a.containerClassName, containerClassName = _b === void 0 ? "" : _b;
6
- var _c = useState(false), visible = _c[0], setVisible = _c[1];
7
- var showTooltip = function () { return setVisible(true); };
8
- var hideTooltip = function () { return setVisible(false); };
9
- return (_jsxs("div", { className: "".concat(styles.tooltipWrapper, " ").concat(containerClassName), onMouseEnter: showTooltip, onMouseLeave: hideTooltip, children: [children, visible && (_jsx("div", { className: "".concat(styles.customTooltipClass, " ").concat(tooltipClassName), children: content }))] }));
10
- };
11
- export default Tooltip;
@@ -1 +0,0 @@
1
- import "@testing-library/jest-dom";
@@ -1,59 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- import { render, screen, fireEvent } from "@testing-library/react";
14
- import "@testing-library/jest-dom";
15
- import Tooltip from "./Tooltip";
16
- describe("Tooltip Component", function () {
17
- var defaultProps = {
18
- content: "Tooltip content",
19
- tooltipClassName: "tooltip-class",
20
- children: _jsx("button", { children: "Hover me" }),
21
- };
22
- it("renders the children correctly", function () {
23
- render(_jsx(Tooltip, __assign({}, defaultProps)));
24
- var childElement = screen.getByText("Hover me");
25
- expect(childElement).toBeInTheDocument();
26
- });
27
- it("does not show tooltip content by default", function () {
28
- render(_jsx(Tooltip, __assign({}, defaultProps)));
29
- var tooltipElement = screen.queryByText(defaultProps.content);
30
- expect(tooltipElement).not.toBeInTheDocument();
31
- });
32
- it("shows tooltip content on mouse enter and hides it on mouse leave", function () {
33
- render(_jsx(Tooltip, __assign({}, defaultProps)));
34
- var childElement = screen.getByText("Hover me");
35
- // Trigger mouse enter
36
- fireEvent.mouseEnter(childElement);
37
- var tooltipElement = screen.queryByText(defaultProps.content);
38
- expect(tooltipElement).toBeInTheDocument();
39
- expect(tooltipElement).toHaveClass(defaultProps.tooltipClassName);
40
- // Trigger mouse leave
41
- fireEvent.mouseLeave(childElement);
42
- tooltipElement = screen.queryByText(defaultProps.content);
43
- // Ensure tooltipElement is null if it was not found
44
- expect(tooltipElement).toBeNull();
45
- });
46
- it("applies the correct container className", function () {
47
- var customClassName = "custom-container-class";
48
- render(_jsx(Tooltip, __assign({}, defaultProps, { containerClassName: customClassName })));
49
- var containerElement = screen.getByText("Hover me").parentElement;
50
- expect(containerElement).toHaveClass(customClassName);
51
- });
52
- it("handles tooltip visibility correctly", function () {
53
- render(_jsx(Tooltip, __assign({}, defaultProps)));
54
- var childElement = screen.getByText("Hover me");
55
- fireEvent.mouseEnter(childElement);
56
- var tooltipElement = screen.queryByText(defaultProps.content);
57
- expect(tooltipElement).toBeInTheDocument();
58
- });
59
- });
@@ -1 +0,0 @@
1
- export { default } from "./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";
@@ -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/dist/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './components';
package/dist/index.js DELETED
@@ -1 +0,0 @@
1
- export * from './components';
@@ -1 +0,0 @@
1
- export declare const COLORS: {};
@@ -1,2 +0,0 @@
1
- // format: Color name: BRAND_800
2
- export var COLORS = {};