@trackunit/react-components 0.0.157 → 0.0.161

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>>;
@@ -0,0 +1,20 @@
1
+ import * as React from "react";
2
+ import { CommonProps } from "../../common";
3
+ import { BaseInputProps } from "../BaseInput";
4
+ export interface PhoneInputProps extends BaseInputProps, CommonProps {
5
+ /**
6
+ * A flag to disable the phone button.
7
+ */
8
+ disableAction?: boolean;
9
+ }
10
+ /**
11
+ * A Phone Input component is used for input of the type tel.
12
+ *
13
+ * It has an ActionButton which sends an phone call to the specified number using "tel:" 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 PhoneInput: React.ForwardRefExoticComponent<PhoneInputProps & 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
- dataTestId: "testIconButtonId",
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
  /**
@@ -5211,7 +5217,7 @@ const GridArea = ({
5211
5217
  const IntrinsicallyResponsiveGrid = ({
5212
5218
  children,
5213
5219
  occupation = "auto-fill",
5214
- minColumnWidth = "normal",
5220
+ minColumnWidth = "md",
5215
5221
  gap = "auto",
5216
5222
  dataTestId,
5217
5223
  className
@@ -5243,18 +5249,21 @@ const Layout$2 = tw.span`
5243
5249
  $minColumnWidth
5244
5250
  }) => {
5245
5251
  switch ($minColumnWidth) {
5246
- case "slim":
5247
- return tws`tu-layout-IntrinsicallyResponsiveGrid--slim`;
5252
+ case "xs":
5253
+ return tws`tu-layout-IntrinsicallyResponsiveGrid--xs`;
5248
5254
 
5249
- case "narrow":
5250
- return tws`tu-layout-IntrinsicallyResponsiveGrid--narrow`;
5255
+ case "sm":
5256
+ return tws`tu-layout-IntrinsicallyResponsiveGrid--sm`;
5251
5257
 
5252
- case "wide":
5253
- return tws`tu-layout-IntrinsicallyResponsiveGrid--wide`;
5258
+ case "lg":
5259
+ return tws`tu-layout-IntrinsicallyResponsiveGrid--lg`;
5254
5260
 
5255
- case "normal":
5261
+ case "xl":
5262
+ return tws`tu-layout-IntrinsicallyResponsiveGrid--xl`;
5263
+
5264
+ case "md":
5256
5265
  default:
5257
- return tws`tu-layout-IntrinsicallyResponsiveGrid--normal`;
5266
+ return tws`tu-layout-IntrinsicallyResponsiveGrid--md`;
5258
5267
  }
5259
5268
  }}
5260
5269
 
@@ -5291,7 +5300,7 @@ const Layout$2 = tw.span`
5291
5300
 
5292
5301
  case "auto":
5293
5302
  default:
5294
- return tws`gap-3 sm:gap-4 md:gap-6`;
5303
+ return tws`tu-gap-responsive`;
5295
5304
  }
5296
5305
  }};
5297
5306
  `;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { CommonProps } from "../../common/CommonProps";
3
- declare type ColumnWidth = "slim" | "narrow" | "normal" | "wide";
3
+ declare type ColumnWidth = "xs" | "sm" | "md" | "lg" | "xl";
4
4
  declare type Space = "inherit" | "auto" | "none" | "tiny" | "mini" | "small" | "medium" | "large" | "giant" | "enormous";
5
5
  declare type Occupation = "auto-fill" | "auto-fit";
6
6
  interface IntrinsicallyResponsiveGridProps extends CommonProps {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-components",
3
- "version": "0.0.157",
3
+ "version": "0.0.161",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "dependencies": {