@trackunit/react-components 0.1.33 → 0.1.36

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.
package/index.js CHANGED
@@ -1258,6 +1258,25 @@ const Overlay = tw.div `
1258
1258
  ${({ $open }) => $open && tws `tu-drawer__overlay--open`}
1259
1259
  `;
1260
1260
 
1261
+ /**
1262
+ * A Email Input component is used for input of the type Email.
1263
+ *
1264
+ * It has an ActionButton which sends an email to the specified address using "mailto:" link.
1265
+ *
1266
+ * Extends props of BaseInput.
1267
+ *
1268
+ * A reference to the input element is provided as the `ref` prop.
1269
+ * For specific input types make sure to use the corresponding input component.
1270
+ */
1271
+ const EmailInput = React.forwardRef((_a, ref) => {
1272
+ var { fieldSize = "medium", disableAction = false, dataTestId } = _a, rest = __rest(_a, ["fieldSize", "disableAction", "dataTestId"]);
1273
+ const [email, setEmail] = React.useState("");
1274
+ const sendEmail = () => {
1275
+ return window.open(`mailto:${email}`);
1276
+ };
1277
+ return (jsx(BaseInput, Object.assign({ dataTestId: dataTestId, fieldSize: fieldSize, ref: ref, type: "email", placeholder: rest.placeholder || "mail@example.com", onChange: e => setEmail(e.target.value) }, rest, { actions: !disableAction && (jsx(ActionButton, { value: email, type: "EMAIL", onClick: sendEmail, dataTestId: dataTestId && `${dataTestId}-emailIcon`, iconSize: fieldSize })) })));
1278
+ });
1279
+
1261
1280
  /**
1262
1281
  * The external link component is used to link to an external page outside the Trackunit Manager.
1263
1282
  *
@@ -1781,6 +1800,25 @@ const PageInput = tw.input `
1781
1800
  [-moz-appearance:textfield]
1782
1801
  `;
1783
1802
 
1803
+ /**
1804
+ * A Phone Input component is used for input of the type tel.
1805
+ *
1806
+ * It has an ActionButton which sends an phone call to the specified number using "tel:" link.
1807
+ *
1808
+ * Extends props of BaseInput.
1809
+ *
1810
+ * A reference to the input element is provided as the `ref` prop.
1811
+ * For specific input types make sure to use the corresponding input component.
1812
+ */
1813
+ const PhoneInput = React.forwardRef((_a, ref) => {
1814
+ var { dataTestId, fieldSize = "medium", disableAction = false } = _a, rest = __rest(_a, ["dataTestId", "fieldSize", "disableAction"]);
1815
+ const [phoneNumber, setPhoneNumber] = React.useState("");
1816
+ const callNumber = () => {
1817
+ return window.open(`tel:${phoneNumber}`);
1818
+ };
1819
+ return (jsx(BaseInput, Object.assign({ ref: ref, dataTestId: dataTestId, fieldSize: fieldSize, type: "tel", onChange: e => setPhoneNumber(e.target.value), actions: !disableAction && (jsx(ActionButton, { value: phoneNumber, type: "PHONE_NUMBER", onClick: callNumber, dataTestId: dataTestId && `${dataTestId}-phoneIcon`, iconSize: fieldSize })) }, rest)));
1820
+ });
1821
+
1784
1822
  /**
1785
1823
  * Create a PieChart with legends based on our current Chart component
1786
1824
  *
@@ -3134,4 +3172,4 @@ const Layout = tw.div `
3134
3172
  tu-layout-TwoColumnLayout
3135
3173
  `;
3136
3174
 
3137
- export { ActionButton, Alert, Badge, BaseInput, Button, Card, CardBody, CardFooter, CardHeader, Chart, Checkbox, Collapse, ContentGridArea, CopyableText, CreatableSelect, DateField, DateInput, DayPicker, DayPickerPopover, DayRangePicker, DensityContainer, Drawer, ExternalLink, FilterListMapLayout, FormGroup, FullWidthRepeatingLayout, GridArea, Heading$1 as Heading, Icon, IconButton, Indicator$1 as Indicator, IntrinsicallyResponsiveGrid, Label$2 as Label, LegendItem, MenuItem, MenuList, MinTopFullContentLayout, Modal, ModalBackdrop, MoreMenu, MultiSelectMenuItem, NavGridArea, NumberField, NumberInput, PageHeader, Pagination, PieChart, Popover, PopoverList, PopoverListItem, PopoverTitle, Prompt, ROLE_CARD, RadioGroup, RadioItem, Search, SectionHeader, Select, SelectPrefix, Sidebar, SingleSelectMenuItem, SkeletonLines, Spacer, Spinner, StarButton, Tag, Text$1 as Text, TextArea, TextAreaField, TextField, TextInput, Timeline, TimelineElement, Tip, TitleGridArea, TitleNavContentLayout, Toggle, Tooltip, TwoColumnLayout, ValueBar, docs, getDevicePixelRatio, getOrderedOptions, getValueBarColorByValue, isMultiValue, useContainerProps, useCustomComponents, useDebounce, useDevicePixelRatio, useLocalStorage, useModal, usePrompt, useTimeout };
3175
+ export { ActionButton, Alert, Badge, BaseInput, Button, Card, CardBody, CardFooter, CardHeader, Chart, Checkbox, Collapse, ContentGridArea, CopyableText, CreatableSelect, DateField, DateInput, DayPicker, DayPickerPopover, DayRangePicker, DensityContainer, Drawer, EmailInput, ExternalLink, FilterListMapLayout, FormGroup, FullWidthRepeatingLayout, GridArea, Heading$1 as Heading, Icon, IconButton, Indicator$1 as Indicator, IntrinsicallyResponsiveGrid, Label$2 as Label, LegendItem, MenuItem, MenuList, MinTopFullContentLayout, Modal, ModalBackdrop, MoreMenu, MultiSelectMenuItem, NavGridArea, NumberField, NumberInput, PageHeader, Pagination, PhoneInput, PieChart, Popover, PopoverList, PopoverListItem, PopoverTitle, Prompt, ROLE_CARD, RadioGroup, RadioItem, Search, SectionHeader, Select, SelectPrefix, Sidebar, SingleSelectMenuItem, SkeletonLines, Spacer, Spinner, StarButton, Tag, Text$1 as Text, TextArea, TextAreaField, TextField, TextInput, Timeline, TimelineElement, Tip, TitleGridArea, TitleNavContentLayout, Toggle, Tooltip, TwoColumnLayout, ValueBar, docs, getDevicePixelRatio, getOrderedOptions, getValueBarColorByValue, isMultiValue, useContainerProps, useCustomComponents, useDebounce, useDevicePixelRatio, useLocalStorage, useModal, usePrompt, useTimeout };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-components",
3
- "version": "0.1.33",
3
+ "version": "0.1.36",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "dependencies": {
@@ -8,7 +8,7 @@
8
8
  "@trackunit/tailwind-styled-components": "0.0.51",
9
9
  "react": "18.2.0",
10
10
  "@trackunit/ui-design-tokens": "0.0.53",
11
- "@trackunit/react-core-contexts-test": "0.1.21",
11
+ "@trackunit/react-core-contexts-test": "0.1.22",
12
12
  "echarts": "5.4.0",
13
13
  "echarts-for-react": "3.0.2",
14
14
  "uuid": "8.3.2",
@@ -0,0 +1 @@
1
+ export * from "./EmailInput";
@@ -0,0 +1 @@
1
+ export * from "./PhoneInput";
@@ -12,6 +12,7 @@ export * from "./DateField/DateField";
12
12
  export * from "./DateInput/DateInput";
13
13
  export * from "./DayPicker";
14
14
  export * from "./Drawer/Drawer";
15
+ export * from "./EmailInput";
15
16
  export * from "./ExternalLink/ExternalLink";
16
17
  export * from "./FormGroup/FormGroup";
17
18
  export * from "./Heading";
@@ -25,6 +26,7 @@ export * from "./NumberField/NumberField";
25
26
  export * from "./NumberInput/NumberInput";
26
27
  export * from "./PageHeader";
27
28
  export * from "./Pagination/Pagination";
29
+ export * from "./PhoneInput";
28
30
  export * from "./PieChart";
29
31
  export * from "./Popover";
30
32
  export * from "./Popover/Popover";