@trackunit/react-components 0.0.156 → 0.0.158
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { CommonProps } from "../../common";
|
|
3
3
|
declare type ActionType = "PHONE_NUMBER" | "WEB_ADDRESS" | "EMAIL";
|
|
4
|
+
declare type FieldSize = "small" | "medium";
|
|
4
5
|
interface ActionButtonProps extends CommonProps {
|
|
5
6
|
/**
|
|
6
7
|
* The type of action performed when clicking the button.
|
|
@@ -14,6 +15,10 @@ interface ActionButtonProps extends CommonProps {
|
|
|
14
15
|
* The onClick event.
|
|
15
16
|
*/
|
|
16
17
|
onClick?: (e: React.MouseEvent) => void;
|
|
18
|
+
/**
|
|
19
|
+
* The size of the icon.
|
|
20
|
+
*/
|
|
21
|
+
iconSize?: FieldSize;
|
|
17
22
|
}
|
|
18
23
|
/**
|
|
19
24
|
* The ActionButton component is a wrapper over IconButton to perform an action when the onClick event is triggered.
|
|
@@ -21,5 +26,5 @@ interface ActionButtonProps extends CommonProps {
|
|
|
21
26
|
* @param {ActionButtonProps} props - The props for the ActionButton component
|
|
22
27
|
* @returns {JSX.Element} ActionButton component
|
|
23
28
|
*/
|
|
24
|
-
export declare const ActionButton: ({ type, value }: ActionButtonProps) => JSX.Element;
|
|
29
|
+
export declare const ActionButton: ({ type, value, dataTestId, iconSize }: ActionButtonProps) => JSX.Element;
|
|
25
30
|
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { CommonProps } from "../../common";
|
|
3
|
+
import { BaseInputProps } from "../BaseInput";
|
|
4
|
+
export interface EmailInputProps extends BaseInputProps, CommonProps {
|
|
5
|
+
/**
|
|
6
|
+
* A flag to disable the email button.
|
|
7
|
+
*/
|
|
8
|
+
disableAction?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A Email Input component is used for input of the type Email.
|
|
12
|
+
*
|
|
13
|
+
* It has an ActionButton which sends an email to the specified address using "mailto:" link.
|
|
14
|
+
*
|
|
15
|
+
* Extends props of BaseInput.
|
|
16
|
+
*
|
|
17
|
+
* A reference to the input element is provided as the `ref` prop.
|
|
18
|
+
* For specific input types make sure to use the corresponding input component.
|
|
19
|
+
*/
|
|
20
|
+
export declare const EmailInput: React.ForwardRefExoticComponent<EmailInputProps & React.RefAttributes<HTMLInputElement>>;
|
package/index.js
CHANGED
|
@@ -501,7 +501,9 @@ const Root$4 = tw.span`
|
|
|
501
501
|
|
|
502
502
|
const ActionButton = ({
|
|
503
503
|
type,
|
|
504
|
-
value
|
|
504
|
+
value,
|
|
505
|
+
dataTestId,
|
|
506
|
+
iconSize
|
|
505
507
|
}) => {
|
|
506
508
|
const getIconName = () => {
|
|
507
509
|
switch (type) {
|
|
@@ -537,7 +539,8 @@ const ActionButton = ({
|
|
|
537
539
|
|
|
538
540
|
return jsx(ActionContainer, {
|
|
539
541
|
children: jsx(StyledIconButton, {
|
|
540
|
-
|
|
542
|
+
"$fieldSize": iconSize,
|
|
543
|
+
dataTestId: dataTestId || "testIconButtonId",
|
|
541
544
|
size: "small",
|
|
542
545
|
color: "tertiary",
|
|
543
546
|
icon: jsx(Icon$1, {
|
|
@@ -553,6 +556,9 @@ const ActionContainer = tw.div`
|
|
|
553
556
|
`;
|
|
554
557
|
const StyledIconButton = twx(IconButton)`
|
|
555
558
|
tu-action-button
|
|
559
|
+
${({
|
|
560
|
+
$fieldSize
|
|
561
|
+
}) => $fieldSize === "small" && tws`tu-action-button--small`}
|
|
556
562
|
`;
|
|
557
563
|
|
|
558
564
|
/**
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.158",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@trackunit/css-core": "0.0.
|
|
8
|
-
"@trackunit/tailwind-styled-components": "0.0.
|
|
7
|
+
"@trackunit/css-core": "0.0.52",
|
|
8
|
+
"@trackunit/tailwind-styled-components": "0.0.46",
|
|
9
9
|
"react": "17.0.2",
|
|
10
|
-
"@trackunit/ui-design-tokens": "0.0.
|
|
10
|
+
"@trackunit/ui-design-tokens": "0.0.44",
|
|
11
11
|
"echarts-for-react": "^3.0.2",
|
|
12
12
|
"echarts": "^5.4.0",
|
|
13
13
|
"uuid": "^8.3.2",
|
|
14
14
|
"react-use": "^17.4.0",
|
|
15
15
|
"date-fns": "^2.29.3",
|
|
16
16
|
"react-day-picker": "^8.3.0",
|
|
17
|
-
"@trackunit/ui-icons": "0.0.
|
|
17
|
+
"@trackunit/ui-icons": "0.0.47",
|
|
18
18
|
"react-useportal": "1.0.16",
|
|
19
19
|
"react-helmet": "^6.1.0",
|
|
20
20
|
"@react-spring/web": "9.5.2",
|