tfy-web-components 0.0.17 → 0.0.19

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 (69) hide show
  1. package/README.md +19 -0
  2. package/dist/Accordion.d.ts +58 -0
  3. package/dist/Badge.d.ts +46 -0
  4. package/dist/Button.d.ts +4 -2
  5. package/dist/CopyField.d.ts +81 -0
  6. package/dist/Dialog.d.ts +18 -0
  7. package/dist/IconProvider.d.ts +4 -2
  8. package/dist/Input.d.ts +27 -0
  9. package/dist/Notification-BT4CZ69U.js +39 -0
  10. package/dist/Notification-BT4CZ69U.js.map +1 -0
  11. package/dist/Notification.d.ts +12 -0
  12. package/dist/Notify.d.ts +4 -0
  13. package/dist/Switch.d.ts +20 -0
  14. package/dist/TabButton.d.ts +20 -0
  15. package/dist/TabPanel.d.ts +14 -0
  16. package/dist/Tooltip.d.ts +9 -5
  17. package/dist/_commonjsHelpers-CcAunmGO.js +34 -0
  18. package/dist/_commonjsHelpers-CcAunmGO.js.map +1 -0
  19. package/dist/components/atoms/Accordion.d.ts +48 -0
  20. package/dist/components/atoms/Accordion.es.js +98 -0
  21. package/dist/components/atoms/Accordion.es.js.map +1 -0
  22. package/dist/components/atoms/Badge.d.ts +35 -0
  23. package/dist/components/atoms/Badge.es.js +50 -0
  24. package/dist/components/atoms/Badge.es.js.map +1 -0
  25. package/dist/components/atoms/Button.d.ts +4 -5
  26. package/dist/components/atoms/Button.es.js +107 -25
  27. package/dist/components/atoms/Button.es.js.map +1 -1
  28. package/dist/components/atoms/IconButton.d.ts +1 -1
  29. package/dist/components/atoms/IconButton.es.js.map +1 -1
  30. package/dist/components/atoms/IconProvider.d.ts +3 -2
  31. package/dist/components/atoms/IconProvider.es.js.map +1 -1
  32. package/dist/components/atoms/Notification.d.ts +9 -0
  33. package/dist/components/atoms/Notification.es.js +6 -0
  34. package/dist/components/atoms/Notification.es.js.map +1 -0
  35. package/dist/components/atoms/Spinner.es.js +1 -1
  36. package/dist/components/atoms/Spinner.es.js.map +1 -1
  37. package/dist/components/atoms/Switch.d.ts +16 -0
  38. package/dist/components/atoms/Switch.es.js +79 -0
  39. package/dist/components/atoms/Switch.es.js.map +1 -0
  40. package/dist/components/atoms/TabButton.d.ts +14 -0
  41. package/dist/components/atoms/TabButton.es.js +34 -0
  42. package/dist/components/atoms/TabButton.es.js.map +1 -0
  43. package/dist/components/atoms/TabPanel.d.ts +10 -0
  44. package/dist/components/atoms/TabPanel.es.js +20 -0
  45. package/dist/components/atoms/TabPanel.es.js.map +1 -0
  46. package/dist/components/atoms/Tooltip.d.ts +8 -5
  47. package/dist/components/atoms/Tooltip.es.js +6 -5
  48. package/dist/components/atoms/Tooltip.es.js.map +1 -1
  49. package/dist/components/molecules/CopyField.d.ts +38 -0
  50. package/dist/components/molecules/CopyField.es.js +74195 -0
  51. package/dist/components/molecules/CopyField.es.js.map +1 -0
  52. package/dist/components/molecules/Dialog.d.ts +14 -0
  53. package/dist/components/molecules/Dialog.es.js +6463 -0
  54. package/dist/components/molecules/Dialog.es.js.map +1 -0
  55. package/dist/components/molecules/Input.d.ts +23 -0
  56. package/dist/components/molecules/Input.es.js +12 -0
  57. package/dist/components/molecules/Input.es.js.map +1 -0
  58. package/dist/components/molecules/Notify.d.ts +1 -0
  59. package/dist/components/molecules/Notify.es.js +1058 -0
  60. package/dist/components/molecules/Notify.es.js.map +1 -0
  61. package/dist/components/theme/index.d.ts +1 -0
  62. package/dist/components/theme/index.es.js +3 -1
  63. package/dist/components/theme/index.es.js.map +1 -1
  64. package/dist/components/theme/utils.es.js +9 -175
  65. package/dist/components/theme/utils.es.js.map +1 -1
  66. package/dist/isTypedArray-CoDTnA8U.js +185 -0
  67. package/dist/isTypedArray-CoDTnA8U.js.map +1 -0
  68. package/dist/style.css +1 -0
  69. package/package.json +1 -1
package/README.md CHANGED
@@ -11,6 +11,25 @@
11
11
  - 🌟 [Typescript](https://www.typescriptlang.org/)
12
12
  - 🐶 [Husky](https://typicode.github.io/husky) & [Lint Staged](https://www.npmjs.com/package/lint-staged) - Pre-commit Hooks
13
13
 
14
+ ## Usage
15
+
16
+ 1. Install the package:
17
+
18
+ ```bash
19
+ yarn add tfy-web-components
20
+ ```
21
+
22
+ 2. Import `tailwindContentPaths` in your `tailwind.config.js` and spread it into the `content` array so Tailwind can detect the classes used by the components:
23
+
24
+ ```js
25
+ const { tailwindContentPaths } = require('tfy-web-components')
26
+
27
+ module.exports = {
28
+ content: ['./src/**/*.{js,ts,jsx,tsx}', ...tailwindContentPaths],
29
+ // ...
30
+ }
31
+ ```
32
+
14
33
  ## Main Scripts
15
34
 
16
35
  Always prepending yarn:
@@ -0,0 +1,58 @@
1
+ import { AccordionClasses } from '@mui/material/Accordion';
2
+ import { AccordionDetailsProps } from '@mui/material/AccordionDetails';
3
+ import { AccordionSlotsAndSlotProps } from '@mui/material/Accordion';
4
+ import { AccordionSummaryProps as AccordionSummaryProps_2 } from '@mui/material/AccordionSummary';
5
+ import { CommonProps } from '@mui/material/OverridableComponent';
6
+ import { JSX as JSX_2 } from 'react/jsx-runtime';
7
+ import { MUIStyledCommonProps } from '@mui/system';
8
+ import { PaperOwnProps } from '@mui/material';
9
+ import { default as React_2 } from 'react';
10
+ import { StyledComponent } from '@emotion/styled';
11
+ import { SxProps } from '@mui/material/styles';
12
+ import { Theme } from '@mui/material/styles';
13
+ import { TransitionProps } from '@mui/material/transitions';
14
+
15
+ export declare const Accordion: StyledComponent<{
16
+ children: NonNullable<React_2.ReactNode>;
17
+ classes?: Partial<AccordionClasses> | undefined;
18
+ defaultExpanded?: boolean | undefined;
19
+ disabled?: boolean | undefined;
20
+ disableGutters?: boolean | undefined;
21
+ expanded?: boolean | undefined;
22
+ onChange?: ((event: React_2.SyntheticEvent<Element, Event>, expanded: boolean) => void) | undefined;
23
+ sx?: SxProps<Theme> | undefined;
24
+ TransitionComponent?: React_2.JSXElementConstructor<TransitionProps & {
25
+ children?: React_2.ReactElement<any, any> | undefined;
26
+ }> | undefined;
27
+ TransitionProps?: TransitionProps | undefined;
28
+ } & AccordionSlotsAndSlotProps & Omit<PaperOwnProps, "classes" | "onChange"> & CommonProps & Omit<Omit<React_2.DetailedHTMLProps<React_2.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
29
+ ref?: ((instance: HTMLDivElement | null) => void) | React_2.RefObject<HTMLDivElement> | null | undefined;
30
+ }, "children" | "sx" | "onChange" | "TransitionComponent" | "TransitionProps" | "square" | "elevation" | "expanded" | "disabled" | keyof CommonProps | "variant" | "defaultExpanded" | "disableGutters" | keyof AccordionSlotsAndSlotProps> & {
31
+ component?: React_2.ElementType<any> | undefined;
32
+ } & {
33
+ background?: string | undefined;
34
+ borderColor?: string | undefined;
35
+ } & MUIStyledCommonProps<Theme>, {}, {}>;
36
+
37
+ export declare const AccordionDetails: StyledComponent<AccordionDetailsProps & MUIStyledCommonProps<Theme>, {}, {}>;
38
+
39
+ export declare const AccordionSummary: StyledComponent<AccordionSummaryProps & MUIStyledCommonProps<Theme>, {}, {}>;
40
+
41
+ export declare interface AccordionSummaryProps extends AccordionSummaryProps_2 {
42
+ hideIcon?: boolean;
43
+ chevronDown?: boolean;
44
+ rightIcon?: boolean;
45
+ iconClasses?: string;
46
+ }
47
+
48
+ declare function CustomizedAccordions({ children, btn, id, discription, sx, tools, }: {
49
+ children: React_2.ReactNode | JSX_2.Element | string;
50
+ btn: React_2.ReactNode | JSX_2.Element | string;
51
+ id: string;
52
+ discription?: string;
53
+ sx?: object;
54
+ tools?: React_2.ReactNode | JSX_2.Element | string;
55
+ }): JSX_2.Element;
56
+ export default CustomizedAccordions;
57
+
58
+ export { }
@@ -0,0 +1,46 @@
1
+ import { IconProp as IconProp_2 } from '@fortawesome/fontawesome-svg-core';
2
+ import { default as React_2 } from 'react';
3
+
4
+ declare type AtleastOne = IconRequired | RightIconRequired | TextRequired;
5
+
6
+ declare const Badge: React_2.ForwardRefExoticComponent<BadgeProps & React_2.RefAttributes<HTMLDivElement>>;
7
+ export default Badge;
8
+
9
+ export declare type BadgeProps = {
10
+ className?: string;
11
+ iconClasses?: string;
12
+ rightIconClasses?: string;
13
+ textClasses?: string;
14
+ type?: BadgeType;
15
+ iconColor?: string;
16
+ rightIconColor?: string;
17
+ customPadding?: string;
18
+ onClick?: () => void;
19
+ iconSize?: number;
20
+ rightIconSize?: number;
21
+ dataTestPrefix?: string;
22
+ } & React_2.AllHTMLAttributes<HTMLDivElement> & AtleastOne;
23
+
24
+ declare type BadgeType = 'default' | 'warning' | 'waiting' | 'primary' | 'danger' | 'success' | 'gray' | 'light-gray' | 'white' | 'none';
25
+
26
+ declare type IconProp = string | IconProp_2;
27
+
28
+ declare interface IconRequired {
29
+ icon: IconProp;
30
+ rightIcon?: IconProp;
31
+ text?: React_2.ReactNode | JSX.Element | string;
32
+ }
33
+
34
+ declare interface RightIconRequired {
35
+ icon?: IconProp;
36
+ rightIcon: IconProp;
37
+ text?: React_2.ReactNode | JSX.Element | string;
38
+ }
39
+
40
+ declare interface TextRequired {
41
+ icon?: IconProp;
42
+ rightIcon?: IconProp;
43
+ text: React_2.ReactNode | JSX.Element | string;
44
+ }
45
+
46
+ export { }
package/dist/Button.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { FontAwesomeIconProps } from '@fortawesome/react-fontawesome';
2
2
  import { default as React_2 } from 'react';
3
- import { ReactNode } from 'react';
3
+ import * as React_3 from 'react';
4
4
  import { TooltipProps as TooltipProps_2 } from '@mui/material/Tooltip';
5
5
 
6
6
  declare const Button: ButtonComponent;
@@ -34,6 +34,8 @@ export declare interface ButtonProps {
34
34
  removeIconContainer?: boolean;
35
35
  isMenuItem?: boolean;
36
36
  useLightTooltip?: boolean;
37
+ className?: string;
38
+ autoFocus?: boolean;
37
39
  }
38
40
 
39
41
  export declare type ButtonSize = 'large' | 'small';
@@ -56,7 +58,7 @@ declare type Sizes = 'large' | 'variable' | 'medium' | 'fit';
56
58
  export declare const TertiaryButton: React_2.ForwardRefExoticComponent<ButtonProps & React_2.RefAttributes<HTMLButtonElement>>;
57
59
 
58
60
  declare type TooltipProps = Partial<Pick<CustomTooltipProps, 'title' | 'placement' | 'size'>> & {
59
- disabledTitle?: ReactNode;
61
+ disabledTitle?: React_3.ReactNode;
60
62
  };
61
63
 
62
64
  export { }
@@ -0,0 +1,81 @@
1
+ import type { FontAwesomeIconProps } from '@fortawesome/react-fontawesome';
2
+ import { IconProp } from '@fortawesome/fontawesome-svg-core';
3
+ import { default as React_2 } from 'react';
4
+ import * as React_3 from 'react';
5
+ import { TooltipProps as TooltipProps_2 } from '@mui/material/Tooltip';
6
+
7
+ declare interface ButtonProps {
8
+ id?: string;
9
+ icon?: FontAwesomeIconProps['icon'] | string;
10
+ text?: React_2.ReactNode | JSX.Element | string;
11
+ block?: boolean;
12
+ disabled?: boolean;
13
+ loading?: boolean;
14
+ dataTestId?: string;
15
+ iconToRight?: boolean;
16
+ variant?: 'primary' | 'secondary' | 'ghost' | 'tertiary' | 'destructive';
17
+ size?: ButtonSize;
18
+ onClick?: (e: React_2.MouseEvent<HTMLButtonElement>) => void;
19
+ iconClasses?: string;
20
+ type?: 'submit' | 'reset' | 'button';
21
+ tooltipProps?: TooltipProps;
22
+ iconSize?: number;
23
+ removeIconContainer?: boolean;
24
+ isMenuItem?: boolean;
25
+ useLightTooltip?: boolean;
26
+ className?: string;
27
+ autoFocus?: boolean;
28
+ }
29
+
30
+ declare type ButtonSize = 'large' | 'small';
31
+
32
+ declare const CopyField: React_2.FC<CopyFieldProps>;
33
+ export default CopyField;
34
+
35
+ export declare const CopyFieldHighlighted: React_2.FC<{
36
+ text: string;
37
+ }>;
38
+
39
+ declare interface CopyFieldProps {
40
+ children?: string | JSX.Element;
41
+ errorMessage?: string;
42
+ rawValue?: string;
43
+ after?: boolean;
44
+ disabled?: boolean;
45
+ className?: string;
46
+ btnClass?: string;
47
+ btnTextClass?: string;
48
+ iconClass?: string;
49
+ initialText?: string | React_2.ReactNode | JSX.Element;
50
+ bgClass?: string;
51
+ tooltipTitle?: string | JSX.Element;
52
+ dataTestPrefix?: string;
53
+ wrapperDataTestId?: string;
54
+ btnProps?: ButtonProps;
55
+ beforeCopy?: () => Promise<string>;
56
+ onCopy?: () => void;
57
+ icon?: null | IconProp;
58
+ buttonSize?: ButtonSize;
59
+ isIconButton?: boolean;
60
+ iconSize?: number;
61
+ isGhostButton?: boolean;
62
+ }
63
+
64
+ export declare const CopyInputField: React_2.FC<{
65
+ copyProps: CopyFieldProps;
66
+ className?: string;
67
+ inputClassName?: string;
68
+ }>;
69
+
70
+ declare type CustomTooltipProps = TooltipProps_2 & {
71
+ size?: Sizes;
72
+ border?: boolean;
73
+ };
74
+
75
+ declare type Sizes = 'large' | 'variable' | 'medium' | 'fit';
76
+
77
+ declare type TooltipProps = Partial<Pick<CustomTooltipProps, 'title' | 'placement' | 'size'>> & {
78
+ disabledTitle?: React_3.ReactNode;
79
+ };
80
+
81
+ export { }
@@ -0,0 +1,18 @@
1
+ import { DialogProps } from '@mui/material';
2
+ import { default as React_2 } from 'react';
3
+
4
+ declare const Dialog: React_2.FC<ModalProps>;
5
+ export default Dialog;
6
+
7
+ declare interface ModalProps {
8
+ setOpen: React_2.Dispatch<React_2.SetStateAction<boolean>>;
9
+ open: boolean;
10
+ title?: React_2.ReactNode | JSX.Element | string;
11
+ content: React_2.ReactNode | JSX.Element | string;
12
+ actions?: React_2.ReactNode | JSX.Element | string;
13
+ maxWidth?: DialogProps['maxWidth'];
14
+ fullScreen?: DialogProps['fullScreen'];
15
+ PaperProps?: object;
16
+ }
17
+
18
+ export { }
@@ -1,5 +1,5 @@
1
1
  import { FontAwesomeIconProps } from '@fortawesome/react-fontawesome';
2
- import { IconProp } from '@fortawesome/fontawesome-svg-core';
2
+ import { IconProp as IconProp_2 } from '@fortawesome/fontawesome-svg-core';
3
3
  import { default as React_2 } from 'react';
4
4
 
5
5
  declare type CustomIcon = React_2.ComponentType<CustomIconProps>;
@@ -17,8 +17,10 @@ declare type CustomIconProps = {
17
17
  declare const _default: React_2.MemoExoticComponent<React_2.ForwardRefExoticComponent<IconProps & React_2.RefAttributes<HTMLElement>>>;
18
18
  export default _default;
19
19
 
20
+ export declare type IconProp = string | IconProp_2;
21
+
20
22
  declare interface IconProps {
21
- icon: string | IconProp;
23
+ icon: IconProp;
22
24
  color?: string;
23
25
  className?: string;
24
26
  onClick?: (e: React_2.MouseEvent) => void;
@@ -0,0 +1,27 @@
1
+ import { default as React_2 } from 'react';
2
+
3
+ declare const Input: React_2.ForwardRefExoticComponent<InputProps & React_2.RefAttributes<HTMLInputElement>>;
4
+ export default Input;
5
+
6
+ export declare interface InputProps extends React_2.InputHTMLAttributes<HTMLInputElement> {
7
+ text?: string | JSX.Element;
8
+ statusSlot?: JSX.Element | string;
9
+ statusAlt?: boolean;
10
+ customErrorMessage?: string;
11
+ status?: 'success' | 'error';
12
+ wrapperClasses?: string;
13
+ statusClasses?: string;
14
+ labelClasses?: string;
15
+ borderRadiusClasses?: string;
16
+ showErrorAsTooltip?: boolean;
17
+ hideErrorMessage?: boolean;
18
+ invalidError?: string;
19
+ prefixSlot?: React_2.ReactNode;
20
+ suffixSlot?: React_2.ReactNode;
21
+ dataTestId?: string;
22
+ onValidation?: (valid: boolean) => void;
23
+ labelContainerClasses?: string;
24
+ prefixSlotClassName?: string;
25
+ }
26
+
27
+ export { }
@@ -0,0 +1,39 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ const toDataTestId = (testId, prefix) => {
3
+ if (!testId || prefix == null) {
4
+ return void 0;
5
+ }
6
+ let id = testId.trim().replaceAll(/\s+/g, "-");
7
+ if (prefix) {
8
+ id = prefix + "-" + id;
9
+ }
10
+ return id.toLowerCase();
11
+ };
12
+ const Toast = ({ title, msg, icon, dataTestPrefix }) => {
13
+ return /* @__PURE__ */ jsxs("div", { className: "flex", children: [
14
+ icon,
15
+ /* @__PURE__ */ jsxs("div", { children: [
16
+ /* @__PURE__ */ jsx(
17
+ "h2",
18
+ {
19
+ className: "font-bold text-gray-850 font-sans text-xl leading-6 mb-2",
20
+ "data-test": toDataTestId("toast-header", dataTestPrefix),
21
+ children: title
22
+ }
23
+ ),
24
+ /* @__PURE__ */ jsx(
25
+ "div",
26
+ {
27
+ className: "text-xs font-normal text-gray-850 font-sans text-base leading-5",
28
+ "data-test": toDataTestId("toast-subheader", dataTestPrefix),
29
+ children: msg
30
+ }
31
+ )
32
+ ] })
33
+ ] });
34
+ };
35
+ export {
36
+ Toast as T,
37
+ toDataTestId as t
38
+ };
39
+ //# sourceMappingURL=Notification-BT4CZ69U.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Notification-BT4CZ69U.js","sources":["../src/utils/conversions.ts","../src/components/atoms/Notification.tsx"],"sourcesContent":["export const toDataTestId = (testId?: string, prefix?: string) => {\n if (!testId || prefix == null) {\n return undefined\n }\n let id = testId.trim().replaceAll(/\\s+/g, '-')\n if (prefix) {\n id = prefix + '-' + id\n }\n return id.toLowerCase()\n}\n","import React from 'react'\n\nimport { toDataTestId } from '@/utils/conversions'\n\ntype ToastProps = {\n title?: string\n msg?: string\n icon?: React.ReactNode | JSX.Element | string\n dataTestPrefix?: string\n}\nexport const Toast: React.FC<ToastProps> = ({ title, msg, icon, dataTestPrefix }) => {\n return (\n <div className=\"flex\">\n {icon}\n <div>\n <h2\n className=\"font-bold text-gray-850 font-sans text-xl leading-6 mb-2\"\n data-test={toDataTestId('toast-header', dataTestPrefix)}\n >\n {title}\n </h2>\n <div\n className=\"text-xs font-normal text-gray-850 font-sans text-base leading-5\"\n data-test={toDataTestId('toast-subheader', dataTestPrefix)}\n >\n {msg}\n </div>\n </div>\n </div>\n )\n}\n"],"names":[],"mappings":";AAAO,MAAM,eAAe,CAAC,QAAiB,WAAoB;AAChE,MAAI,CAAC,UAAU,UAAU,MAAM;AAC7B,WAAO;AAAA,EACT;AACA,MAAI,KAAK,OAAO,KAAA,EAAO,WAAW,QAAQ,GAAG;AAC7C,MAAI,QAAQ;AACV,SAAK,SAAS,MAAM;AAAA,EACtB;AACA,SAAO,GAAG,YAAA;AACZ;ACCO,MAAM,QAA8B,CAAC,EAAE,OAAO,KAAK,MAAM,qBAAqB;AACnF,SACE,qBAAC,OAAA,EAAI,WAAU,QACZ,UAAA;AAAA,IAAA;AAAA,yBACA,OAAA,EACC,UAAA;AAAA,MAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,aAAW,aAAa,gBAAgB,cAAc;AAAA,UAErD,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,MAEH;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,aAAW,aAAa,mBAAmB,cAAc;AAAA,UAExD,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACH,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
@@ -0,0 +1,12 @@
1
+ import { default as React_2 } from 'react';
2
+
3
+ export declare const Toast: React_2.FC<ToastProps>;
4
+
5
+ declare type ToastProps = {
6
+ title?: string;
7
+ msg?: string;
8
+ icon?: React_2.ReactNode | JSX.Element | string;
9
+ dataTestPrefix?: string;
10
+ };
11
+
12
+ export { }
@@ -0,0 +1,4 @@
1
+ declare function notify(type: 'info' | 'success' | 'error', title: string, message?: string, toastId?: string | number, dataTestPrefix?: string): void;
2
+ export default notify;
3
+
4
+ export { }
@@ -0,0 +1,20 @@
1
+ import { MUIStyledCommonProps } from '@mui/system';
2
+ import { StyledComponent } from '@emotion/styled';
3
+ import { SwitchProps } from '@mui/material/Switch';
4
+ import { Theme } from '@mui/material';
5
+
6
+ declare interface InputHTMLAttributesExtended extends React.InputHTMLAttributes<HTMLInputElement> {
7
+ 'data-test'?: string;
8
+ }
9
+
10
+ export declare interface StyledSwitchProps {
11
+ inputProps?: InputHTMLAttributesExtended;
12
+ widthMultiple?: number;
13
+ heightMultiple?: number;
14
+ thumbWidthMultiple?: number;
15
+ }
16
+
17
+ declare const Switch: StyledComponent<SwitchProps & MUIStyledCommonProps<Theme> & StyledSwitchProps, {}, {}>;
18
+ export default Switch;
19
+
20
+ export { }
@@ -0,0 +1,20 @@
1
+ import { IconProp as IconProp_2 } from '@fortawesome/fontawesome-svg-core';
2
+ import { default as React_2 } from 'react';
3
+ import Tab from '@mui/material/Tab';
4
+
5
+ declare type IconProp = string | IconProp_2;
6
+
7
+ declare const TabButton: React_2.FC<TabButtonProps>;
8
+ export default TabButton;
9
+
10
+ export declare type TabButtonProps = React_2.ComponentProps<typeof Tab> & {
11
+ id: string;
12
+ icon?: IconProp;
13
+ text: string | React_2.ReactNode;
14
+ tooltip?: string;
15
+ textClassName?: string;
16
+ iconSize?: number;
17
+ isActive?: boolean;
18
+ };
19
+
20
+ export { }
@@ -0,0 +1,14 @@
1
+ import { default as React_2 } from 'react';
2
+
3
+ declare const TabPanel: React_2.FC<TabPanelProps>;
4
+ export default TabPanel;
5
+
6
+ export declare interface TabPanelProps {
7
+ children: React_2.ReactNode;
8
+ id: string;
9
+ isActive?: boolean;
10
+ className?: string;
11
+ activeClassName?: string;
12
+ }
13
+
14
+ export { }
package/dist/Tooltip.d.ts CHANGED
@@ -1,26 +1,30 @@
1
1
  import { MUIStyledCommonProps } from '@mui/system';
2
2
  import * as React_2 from 'react';
3
3
  import { Theme } from '@mui/material';
4
- import { TooltipProps } from '@mui/material/Tooltip';
4
+ import { TooltipProps as TooltipProps_2 } from '@mui/material/Tooltip';
5
5
 
6
- export declare type CustomTooltipProps = TooltipProps & {
6
+ export declare type CustomTooltipProps = TooltipProps_2 & {
7
7
  size?: Sizes;
8
8
  border?: boolean;
9
9
  };
10
10
 
11
- export declare const DarkTooltip: React_2.NamedExoticComponent<TooltipProps & {
11
+ export declare const DarkTooltip: React_2.NamedExoticComponent<TooltipProps_2 & {
12
12
  size?: Sizes | undefined;
13
13
  border?: boolean | undefined;
14
14
  } & MUIStyledCommonProps<Theme>>;
15
15
 
16
- export declare const LightTooltip: React_2.NamedExoticComponent<TooltipProps & {
16
+ export declare const LightTooltip: React_2.NamedExoticComponent<TooltipProps_2 & {
17
17
  size?: Sizes | undefined;
18
18
  border?: boolean | undefined;
19
19
  } & MUIStyledCommonProps<Theme>>;
20
20
 
21
21
  export declare type Sizes = 'large' | 'variable' | 'medium' | 'fit';
22
22
 
23
- export declare const UnstyledTooltip: React_2.NamedExoticComponent<TooltipProps & {
23
+ export declare type TooltipProps = Partial<Pick<CustomTooltipProps, 'title' | 'placement' | 'size'>> & {
24
+ disabledTitle?: React_2.ReactNode;
25
+ };
26
+
27
+ export declare const UnstyledTooltip: React_2.NamedExoticComponent<TooltipProps_2 & {
24
28
  size?: Sizes | undefined;
25
29
  border?: boolean | undefined;
26
30
  } & MUIStyledCommonProps<Theme>>;
@@ -0,0 +1,34 @@
1
+ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
2
+ function getDefaultExportFromCjs(x) {
3
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
4
+ }
5
+ function getAugmentedNamespace(n) {
6
+ if (n.__esModule) return n;
7
+ var f = n.default;
8
+ if (typeof f == "function") {
9
+ var a = function a2() {
10
+ if (this instanceof a2) {
11
+ return Reflect.construct(f, arguments, this.constructor);
12
+ }
13
+ return f.apply(this, arguments);
14
+ };
15
+ a.prototype = f.prototype;
16
+ } else a = {};
17
+ Object.defineProperty(a, "__esModule", { value: true });
18
+ Object.keys(n).forEach(function(k) {
19
+ var d = Object.getOwnPropertyDescriptor(n, k);
20
+ Object.defineProperty(a, k, d.get ? d : {
21
+ enumerable: true,
22
+ get: function() {
23
+ return n[k];
24
+ }
25
+ });
26
+ });
27
+ return a;
28
+ }
29
+ export {
30
+ getAugmentedNamespace as a,
31
+ commonjsGlobal as c,
32
+ getDefaultExportFromCjs as g
33
+ };
34
+ //# sourceMappingURL=_commonjsHelpers-CcAunmGO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_commonjsHelpers-CcAunmGO.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,48 @@
1
+ import { JSX } from 'react/jsx-runtime';
2
+ import { AccordionDetailsProps } from '@mui/material/AccordionDetails';
3
+ import { MUIStyledCommonProps } from '@mui/system';
4
+ import { CommonProps } from '@mui/material/OverridableComponent';
5
+ import { PaperOwnProps } from '@mui/material';
6
+ import { TransitionProps } from '@mui/material/transitions';
7
+ import { SxProps, Theme } from '@mui/material/styles';
8
+ import { AccordionClasses, AccordionSlotsAndSlotProps } from '@mui/material/Accordion';
9
+ import { StyledComponent } from '@emotion/styled';
10
+ import React from 'react';
11
+ import { AccordionSummaryProps as MuiAccordionSummaryProps } from '@mui/material/AccordionSummary';
12
+ export declare const Accordion: StyledComponent<{
13
+ children: NonNullable<React.ReactNode>;
14
+ classes?: Partial<AccordionClasses> | undefined;
15
+ defaultExpanded?: boolean | undefined;
16
+ disabled?: boolean | undefined;
17
+ disableGutters?: boolean | undefined;
18
+ expanded?: boolean | undefined;
19
+ onChange?: ((event: React.SyntheticEvent<Element, Event>, expanded: boolean) => void) | undefined;
20
+ sx?: SxProps<Theme> | undefined;
21
+ TransitionComponent?: React.JSXElementConstructor<TransitionProps & {
22
+ children?: React.ReactElement<any, any> | undefined;
23
+ }> | undefined;
24
+ TransitionProps?: TransitionProps | undefined;
25
+ } & AccordionSlotsAndSlotProps & Omit<PaperOwnProps, "classes" | "onChange"> & CommonProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
26
+ ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
27
+ }, "children" | "sx" | "onChange" | "TransitionComponent" | "TransitionProps" | "square" | "elevation" | "expanded" | "disabled" | keyof CommonProps | "variant" | "defaultExpanded" | "disableGutters" | keyof AccordionSlotsAndSlotProps> & {
28
+ component?: React.ElementType<any> | undefined;
29
+ } & {
30
+ background?: string | undefined;
31
+ borderColor?: string | undefined;
32
+ } & MUIStyledCommonProps<Theme>, {}, {}>;
33
+ export interface AccordionSummaryProps extends MuiAccordionSummaryProps {
34
+ hideIcon?: boolean;
35
+ chevronDown?: boolean;
36
+ rightIcon?: boolean;
37
+ iconClasses?: string;
38
+ }
39
+ export declare const AccordionSummary: StyledComponent<AccordionSummaryProps & MUIStyledCommonProps<Theme>, {}, {}>;
40
+ export declare const AccordionDetails: StyledComponent<AccordionDetailsProps & MUIStyledCommonProps<Theme>, {}, {}>;
41
+ export default function CustomizedAccordions({ children, btn, id, discription, sx, tools, }: {
42
+ children: React.ReactNode | JSX.Element | string;
43
+ btn: React.ReactNode | JSX.Element | string;
44
+ id: string;
45
+ discription?: string;
46
+ sx?: object;
47
+ tools?: React.ReactNode | JSX.Element | string;
48
+ }): JSX.Element;
@@ -0,0 +1,98 @@
1
+ import { jsx, Fragment, jsxs } from "react/jsx-runtime";
2
+ import React__default from "react";
3
+ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
4
+ import MuiAccordion from "@mui/material/Accordion";
5
+ import MuiAccordionDetails from "@mui/material/AccordionDetails";
6
+ import MuiAccordionSummary from "@mui/material/AccordionSummary";
7
+ import { styled } from "@mui/material/styles";
8
+ import { colors } from "../theme/theme.es.js";
9
+ import { c as classNames } from "../../classNames-CC5emYUV.js";
10
+ const Accordion = styled((props) => {
11
+ const { background, borderColor, ...restProps } = props;
12
+ return /* @__PURE__ */ jsx(MuiAccordion, { disableGutters: true, elevation: 0, square: true, ...restProps });
13
+ })(({ background, borderColor }) => ({
14
+ border: `0.0625rem solid ${borderColor ?? colors.gray[250]}`,
15
+ borderRadius: "0.5rem",
16
+ backgroundColor: background ?? colors.gray[250],
17
+ marginBottom: "0.75rem",
18
+ "&:before": {
19
+ display: "none"
20
+ }
21
+ }));
22
+ const AccordionSummary = styled((props) => {
23
+ const { hideIcon, chevronDown, rightIcon, iconClasses, ...restProps } = props;
24
+ return /* @__PURE__ */ jsx(
25
+ MuiAccordionSummary,
26
+ {
27
+ expandIcon: hideIcon ? /* @__PURE__ */ jsx(Fragment, {}) : /* @__PURE__ */ jsx(
28
+ FontAwesomeIcon,
29
+ {
30
+ icon: chevronDown ? "chevron-down" : "chevron-right",
31
+ className: classNames("text-xs text-gray-400", iconClasses)
32
+ }
33
+ ),
34
+ ...restProps
35
+ }
36
+ );
37
+ })(({ theme, chevronDown, rightIcon }) => ({
38
+ flexDirection: rightIcon ? "row" : "row-reverse",
39
+ "& .MuiAccordionSummary-expandIconWrapper.Mui-expanded": {
40
+ transform: chevronDown ? "rotate(-180deg)" : "rotate(90deg)"
41
+ },
42
+ "& .MuiAccordionSummary-content": {
43
+ marginLeft: theme.spacing(1)
44
+ }
45
+ }));
46
+ const AccordionDetails = styled(MuiAccordionDetails)(({ theme }) => ({
47
+ padding: `0 ${theme.spacing(2)}`
48
+ }));
49
+ function CustomizedAccordions({
50
+ children,
51
+ btn,
52
+ id,
53
+ discription,
54
+ sx,
55
+ tools
56
+ }) {
57
+ const [expanded, setExpanded] = React__default.useState(false);
58
+ const [showTools, setShowTools] = React__default.useState(false);
59
+ const handleChange = () => {
60
+ if (!expanded && tools) {
61
+ setShowTools(true);
62
+ }
63
+ setExpanded(!expanded);
64
+ };
65
+ return /* @__PURE__ */ jsxs(
66
+ Accordion,
67
+ {
68
+ expanded,
69
+ onChange: handleChange,
70
+ sx,
71
+ TransitionProps: tools ? {
72
+ onExited: (node) => {
73
+ if (tools) {
74
+ setShowTools(false);
75
+ }
76
+ }
77
+ } : void 0,
78
+ children: [
79
+ /* @__PURE__ */ jsx(AccordionSummary, { "aria-controls": "panel", id, children: /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
80
+ /* @__PURE__ */ jsxs("div", { className: "flex w-full", children: [
81
+ /* @__PURE__ */ jsx("div", { className: "font-base text-gray-1000 font-medium ml-1", children: btn }),
82
+ /* @__PURE__ */ jsx("div", { className: "flex items-center w-full px-3 pr-4", children: /* @__PURE__ */ jsx("div", { className: "w-full border-y border-gray-200" }) }),
83
+ showTools && tools
84
+ ] }),
85
+ discription && /* @__PURE__ */ jsx("div", { className: "font-sans text-gray-600 text-xs font-medium ml-1.5", children: discription })
86
+ ] }) }),
87
+ /* @__PURE__ */ jsx(AccordionDetails, { children })
88
+ ]
89
+ }
90
+ );
91
+ }
92
+ export {
93
+ Accordion,
94
+ AccordionDetails,
95
+ AccordionSummary,
96
+ CustomizedAccordions as default
97
+ };
98
+ //# sourceMappingURL=Accordion.es.js.map