orcs-design-system 3.2.4 → 3.2.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 (96) hide show
  1. package/es/GlobalStyles.js +1 -31
  2. package/es/SystemThemeProvider.js +11 -5
  3. package/es/assets/Colour/Colour.stories.js +211 -0
  4. package/es/assets/Colour/index.js +3 -3
  5. package/es/components/ActionsMenu/ActionsMenu.stories.js +260 -233
  6. package/es/components/ActionsMenu/index.js +144 -229
  7. package/es/components/Avatar/Avatar.stories.js +212 -196
  8. package/es/components/Avatar/index.js +280 -307
  9. package/es/components/Badge/Badge.stories.js +71 -46
  10. package/es/components/Badge/index.js +71 -74
  11. package/es/components/Box/Box.stories.js +51 -35
  12. package/es/components/Box/index.js +33 -34
  13. package/es/components/Button/Button.stories.js +161 -145
  14. package/es/components/Button/ButtonLink.stories.js +152 -139
  15. package/es/components/Button/index.js +79 -99
  16. package/es/components/ButtonGroup/ButtonGroup.stories.js +43 -42
  17. package/es/components/ButtonGroup/ButtonGroupItem.stories.js +11 -13
  18. package/es/components/ButtonGroup/index.js +103 -99
  19. package/es/components/Card/Card.stories.js +94 -62
  20. package/es/components/Card/index.js +50 -71
  21. package/es/components/Checkbox/Checkbox.stories.js +37 -43
  22. package/es/components/Checkbox/index.js +61 -76
  23. package/es/components/DatePicker/DatePicker.stories.js +86 -118
  24. package/es/components/DatePicker/index.js +71 -187
  25. package/es/components/Divider/Divider.stories.js +39 -42
  26. package/es/components/Divider/index.js +21 -27
  27. package/es/components/Expandable/Expandable.stories.js +46 -36
  28. package/es/components/Expandable/index.js +55 -82
  29. package/es/components/Flex/Flex.stories.js +19 -5
  30. package/es/components/Flex/FlexItem.stories.js +10 -9
  31. package/es/components/Flex/index.js +34 -27
  32. package/es/components/Grid/Grid.stories.js +129 -55
  33. package/es/components/Grid/index.js +25 -24
  34. package/es/components/Header/Header.stories.js +101 -92
  35. package/es/components/Header/index.js +433 -436
  36. package/es/components/HeaderSimple/HeaderSimple.stories.js +23 -27
  37. package/es/components/HeaderSimple/index.js +73 -68
  38. package/es/components/Icon/Icon.stories.js +58 -57
  39. package/es/components/Icon/index.js +48 -46
  40. package/es/components/Loading/Loading.stories.js +32 -39
  41. package/es/components/Loading/index.js +44 -51
  42. package/es/components/Modal/Modal.stories.js +172 -153
  43. package/es/components/Modal/index.js +126 -134
  44. package/es/components/Notification/Notification.stories.js +59 -58
  45. package/es/components/Notification/index.js +123 -133
  46. package/es/components/Popover/Popover.stories.js +134 -102
  47. package/es/components/Popover/index.js +65 -111
  48. package/es/components/ProgressBar/ProgressBar.stories.js +36 -39
  49. package/es/components/ProgressBar/index.js +29 -34
  50. package/es/components/RadioButton/RadioButton.stories.js +32 -37
  51. package/es/components/RadioButton/index.js +170 -184
  52. package/es/components/Range/Range.stories.js +19 -19
  53. package/es/components/Range/index.js +35 -45
  54. package/es/components/Select/Select.stories.js +107 -128
  55. package/es/components/Select/index.js +324 -336
  56. package/es/components/SideNav/NavItem.js +112 -122
  57. package/es/components/SideNav/SideNav.stories.js +84 -57
  58. package/es/components/SideNav/index.js +161 -185
  59. package/es/components/Sidebar/Sidebar.stories.js +50 -33
  60. package/es/components/Sidebar/index.js +152 -155
  61. package/es/components/Spacer/Spacer.stories.js +35 -32
  62. package/es/components/Spacer/index.js +20 -20
  63. package/es/components/StatusDot/StatusDot.stories.js +103 -90
  64. package/es/components/StatusDot/index.js +36 -38
  65. package/es/components/StyledLink/StyledLink.stories.js +68 -69
  66. package/es/components/StyledLink/index.js +47 -48
  67. package/es/components/Table/Table.stories.js +118 -112
  68. package/es/components/Table/getExpandColumnConfig.js +67 -62
  69. package/es/components/Table/index.js +24 -27
  70. package/es/components/Table/muiStyleOverrides.js +10 -8
  71. package/es/components/Tabs/Tab.stories.js +55 -38
  72. package/es/components/Tabs/TabsContainer.stories.js +30 -22
  73. package/es/components/Tabs/index.js +95 -92
  74. package/es/components/Tag/Tag.stories.js +250 -220
  75. package/es/components/Tag/index.js +118 -190
  76. package/es/components/TextArea/TextArea.stories.js +76 -89
  77. package/es/components/TextArea/index.js +117 -115
  78. package/es/components/TextInput/TextInput.stories.js +41 -61
  79. package/es/components/TextInput/index.js +127 -171
  80. package/es/components/Toggle/Toggle.stories.js +63 -62
  81. package/es/components/Toggle/index.js +43 -77
  82. package/es/components/TreeNav/TreeNav.stories.js +7 -8
  83. package/es/components/TreeNav/index.js +72 -69
  84. package/es/components/Typography/Typography.stories.js +174 -0
  85. package/es/components/Typography/index.js +252 -308
  86. package/es/components.test.js +1 -1
  87. package/es/hooks/isVisible.js +6 -10
  88. package/es/hooks/keepInView.js +27 -32
  89. package/es/hooks/keypress.js +14 -14
  90. package/es/hooks/useInputFocus.js +5 -5
  91. package/es/hooks/usePrevious.js +3 -3
  92. package/es/systemThemeCollapsed.js +53 -53
  93. package/es/systemtheme.js +53 -53
  94. package/es/utils/selectUtil.js +1 -1
  95. package/es/utils/selectUtil.test.js +6 -6
  96. package/package.json +29 -38
@@ -1,6 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["selected", "onSelect", "disabled", "showRemove", "onRemove", "theme", "tagType", "showEdit", "onEdit", "showInfo", "onInfo", "showStrikeThrough", "children", "isPending", "small", "highlighted", "personEntity"];
4
1
  import React from "react";
5
2
  import styled, { css, ThemeProvider } from "styled-components";
6
3
  import PropTypes from "prop-types";
@@ -9,118 +6,37 @@ import Avatar from "../Avatar";
9
6
  import Icon from "../Icon";
10
7
  import Loading from "../Loading";
11
8
  import { themeGet } from "@styled-system/theme-get";
12
- var TagWrapper = styled.div.withConfig({
9
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
+ const TagWrapper = styled.div.withConfig({
13
11
  displayName: "Tag__TagWrapper",
14
12
  componentId: "sc-1dh2aa8-0"
15
- })(["", " ", " display:flex;align-items:stretch;height:100%;min-height:", ";justify-content:center;> button{margin:0;}"], space, layout, function (props) {
16
- return props.small ? themeGet("tagScale.tagHeightSmall") : themeGet("tagScale.tagHeightDefault");
17
- });
18
- var TagValue = styled.button.attrs(function (props) {
19
- return {
20
- "aria-pressed": props.selected
21
- };
22
- }).withConfig({
13
+ })(["", " ", " display:flex;align-items:stretch;height:100%;min-height:", ";justify-content:center;> button{margin:0;}"], space, layout, props => props.small ? themeGet("tagScale.tagHeightSmall") : themeGet("tagScale.tagHeightDefault"));
14
+ const TagValue = styled.button.attrs(props => ({
15
+ "aria-pressed": props.selected
16
+ })).withConfig({
23
17
  displayName: "Tag__TagValue",
24
18
  componentId: "sc-1dh2aa8-1"
25
- })(["-moz-appearance:none;-webkit-appearance:none;appearance:none;box-shadow:none;font-family:\"Open Sans\",\"Helvetica Neue\",Helvetica,Arial,sans-serif;line-height:", ";display:flex;align-items:center;flex-wrap:nowrap;font-size:", ";font-weight:", ";white-space:nowrap;position:relative;z-index:1;transition:", ";cursor:", ";border-radius:", ";border:solid 1px ", ";padding:", ";background-color:", ";color:", ";", ""], function (props) {
26
- return themeGet("fontSizes.1")(props);
27
- }, function (props) {
28
- return props.small ? themeGet("fontSizes.0")(props) : themeGet("fontSizes.1")(props);
29
- }, function (props) {
30
- return themeGet("fontWeights.2")(props);
31
- }, function (props) {
32
- return themeGet("transition.transitionDefault")(props);
33
- }, function (props) {
34
- return props.disabled ? "default" : "pointer";
35
- }, function (props) {
36
- return props.showEdit || props.showInfo || props.showRemove ? "15px 0 0 15px" : "15px";
37
- }, function (props) {
38
- return props.disabled ? themeGet("colors.greyLight")(props) : props.selected && props.highlighted ? themeGet("colors.warningLight")(props) : themeGet("colors.primary")(props);
39
- }, function (props) {
40
- return props.small ? themeGet("tagScale.tagPaddingSmall") : themeGet("tagScale.tagPaddingDefault");
41
- }, function (props) {
42
- return props.disabled ? themeGet("colors.greyLighter")(props) : props.selected && props.highlighted ? themeGet("colors.warningLight")(props) : props.selected ? themeGet("colors.primary")(props) : themeGet("colors.white")(props);
43
- }, function (props) {
44
- return props.disabled ? themeGet("colors.greyDarker")(props) : props.selected && props.highlighted ? themeGet("colors.black80")(props) : props.selected ? themeGet("colors.white")(props) : themeGet("colors.primary")(props);
45
- }, function (props) {
46
- return props.disabled ? css([""]) : css(["&:hover,&:focus{outline:0;border:", ";color:", ";background-color:", ";div{color:", ";}div[class*=\"TagType\"]{background-color:", ";}}"], function (props) {
47
- return props.selected && props.highlighted ? "solid 1px ".concat(themeGet("colors.warningLighter")(props)) : "solid 1px ".concat(themeGet("colors.primaryDark")(props));
48
- }, function (props) {
49
- return props.selected && props.highlighted ? themeGet("colors.black70")(props) : props.selected ? themeGet("colors.white")(props) : themeGet("colors.primaryDark")(props);
50
- }, function (props) {
51
- return props.selected && props.highlighted ? themeGet("colors.warningLighter")(props) : props.selected ? themeGet("colors.primaryDark")(props) : themeGet("colors.primaryLightest")(props);
52
- }, function (props) {
53
- return props.selected && props.highlighted ? themeGet("colors.black70")(props) : props.selected ? themeGet("colors.white")(props) : themeGet("colors.primaryDark")(props);
54
- }, function (props) {
55
- return props.selected && props.highlighted ? "rgba(255,255,255,0.3)" : props.selected ? "rgba(0,0,0,0.3)" : themeGet("colors.primary20")(props);
56
- });
57
- });
58
- var TagValueText = styled.div.withConfig({
19
+ })(["-moz-appearance:none;-webkit-appearance:none;appearance:none;box-shadow:none;font-family:\"Open Sans\",\"Helvetica Neue\",Helvetica,Arial,sans-serif;line-height:", ";display:flex;align-items:center;flex-wrap:nowrap;font-size:", ";font-weight:", ";white-space:nowrap;position:relative;z-index:1;transition:", ";cursor:", ";border-radius:", ";border:solid 1px ", ";padding:", ";background-color:", ";color:", ";", ""], props => themeGet("fontSizes.1")(props), props => props.small ? themeGet("fontSizes.0")(props) : themeGet("fontSizes.1")(props), props => themeGet("fontWeights.2")(props), props => themeGet("transition.transitionDefault")(props), props => props.disabled ? "default" : "pointer", props => props.showEdit || props.showInfo || props.showRemove ? "15px 0 0 15px" : "15px", props => props.disabled ? themeGet("colors.greyLight")(props) : props.selected && props.highlighted ? themeGet("colors.warningLight")(props) : themeGet("colors.primary")(props), props => props.small ? themeGet("tagScale.tagPaddingSmall") : themeGet("tagScale.tagPaddingDefault"), props => props.disabled ? themeGet("colors.greyLighter")(props) : props.selected && props.highlighted ? themeGet("colors.warningLight")(props) : props.selected ? themeGet("colors.primary")(props) : themeGet("colors.white")(props), props => props.disabled ? themeGet("colors.greyDarker")(props) : props.selected && props.highlighted ? themeGet("colors.black80")(props) : props.selected ? themeGet("colors.white")(props) : themeGet("colors.primary")(props), props => props.disabled ? css([""]) : css(["&:hover,&:focus{outline:0;border:", ";color:", ";background-color:", ";div{color:", ";}div[class*=\"TagType\"]{background-color:", ";}}"], props => props.selected && props.highlighted ? "solid 1px ".concat(themeGet("colors.warningLighter")(props)) : "solid 1px ".concat(themeGet("colors.primaryDark")(props)), props => props.selected && props.highlighted ? themeGet("colors.black70")(props) : props.selected ? themeGet("colors.white")(props) : themeGet("colors.primaryDark")(props), props => props.selected && props.highlighted ? themeGet("colors.warningLighter")(props) : props.selected ? themeGet("colors.primaryDark")(props) : themeGet("colors.primaryLightest")(props), props => props.selected && props.highlighted ? themeGet("colors.black70")(props) : props.selected ? themeGet("colors.white")(props) : themeGet("colors.primaryDark")(props), props => props.selected && props.highlighted ? "rgba(255,255,255,0.3)" : props.selected ? "rgba(0,0,0,0.3)" : themeGet("colors.primary20")(props)));
20
+ const TagValueText = styled.div.withConfig({
59
21
  displayName: "Tag__TagValueText",
60
22
  componentId: "sc-1dh2aa8-2"
61
- })(["text-decoration:", ";text-overflow:ellipsis;white-space:normal;text-align:left;line-height:", ";padding-bottom:1px;"], function (props) {
62
- return props.showStrikeThrough ? "line-through" : "none";
63
- }, function (props) {
64
- return props.small ? themeGet("fontSizes.0")(props) : themeGet("fontSizes.1")(props);
65
- });
66
- var TagActionIconWrapper = styled(TagValue).withConfig({
23
+ })(["text-decoration:", ";text-overflow:ellipsis;white-space:normal;text-align:left;line-height:", ";padding-bottom:1px;"], props => props.showStrikeThrough ? "line-through" : "none", props => props.small ? themeGet("fontSizes.0")(props) : themeGet("fontSizes.1")(props));
24
+ const TagActionIconWrapper = styled(TagValue).withConfig({
67
25
  displayName: "Tag__TagActionIconWrapper",
68
26
  componentId: "sc-1dh2aa8-3"
69
- })(["border-radius:", ";padding:", ";&:focus{z-index:2;}> span{line-height:0;}", ""], function (props) {
70
- return props.showRemove ? "0" : "0 15px 15px 0";
71
- }, function (props) {
72
- return props.showRemove && props.small ? "0 5px 0 6px" : props.showRemove ? "0 7px 0 7px" : props.showInfo && props.small ? "0 10px 0 9px" : props.showInfo ? "0 12px 0 11px" : props.small ? "0 6px 0 6px" : "0 8px 0 8px";
73
- }, function (props) {
74
- return props.selected ? css(["border-left:", ";&:hover{border-left:", ";}"], function (props) {
75
- return props.selected && props.highlighted ? "solid 1px ".concat(themeGet("colors.warningDarker")(props)) : "solid 1px ".concat(themeGet("colors.primaryDark")(props));
76
- }, function (props) {
77
- return props.selected && props.highlighted ? "solid 1px ".concat(themeGet("colors.warningDarker")(props)) : "solid 1px ".concat(themeGet("colors.primaryDark")(props));
78
- }) : css(["border-left:0;&:hover,&:focus{background-color:", ";border-left:0;}"], themeGet("colors.primaryLightest")(props));
79
- });
80
- var TagRemoveIconWrapper = styled(TagValue).withConfig({
27
+ })(["border-radius:", ";padding:", ";&:focus{z-index:2;}> span{line-height:0;}", ""], props => props.showRemove ? "0" : "0 15px 15px 0", props => props.showRemove && props.small ? "0 5px 0 6px" : props.showRemove ? "0 7px 0 7px" : props.showInfo && props.small ? "0 10px 0 9px" : props.showInfo ? "0 12px 0 11px" : props.small ? "0 6px 0 6px" : "0 8px 0 8px", props => props.selected ? css(["border-left:", ";&:hover{border-left:", ";}"], props => props.selected && props.highlighted ? "solid 1px ".concat(themeGet("colors.warningDarker")(props)) : "solid 1px ".concat(themeGet("colors.primaryDark")(props)), props => props.selected && props.highlighted ? "solid 1px ".concat(themeGet("colors.warningDarker")(props)) : "solid 1px ".concat(themeGet("colors.primaryDark")(props))) : css(["border-left:0;&:hover,&:focus{background-color:", ";border-left:0;}"], themeGet("colors.primaryLightest")(props)));
28
+ const TagRemoveIconWrapper = styled(TagValue).withConfig({
81
29
  displayName: "Tag__TagRemoveIconWrapper",
82
30
  componentId: "sc-1dh2aa8-4"
83
- })(["border-radius:0 15px 15px 0;padding:", ";&:focus{z-index:2;}", ""], function (props) {
84
- return props.small ? "0 8px 3px 7px" : "0 10px 3px 9px";
85
- }, function (props) {
86
- return props.selected ? css(["border-left:", ";&:hover{border-left:", ";}"], function (props) {
87
- return props.selected && props.highlighted ? "solid 1px ".concat(themeGet("colors.warningDarker")(props)) : "solid 1px ".concat(themeGet("colors.primaryDark")(props));
88
- }, function (props) {
89
- return props.selected && props.highlighted ? "solid 1px ".concat(themeGet("colors.warningDarker")(props)) : "solid 1px ".concat(themeGet("colors.primaryDark")(props));
90
- }) : css(["border-left:0;&:hover,&:focus{background-color:", ";border-left:0;}"], themeGet("colors.primaryLightest")(props));
91
- });
92
- var TagType = styled.div.withConfig({
31
+ })(["border-radius:0 15px 15px 0;padding:", ";&:focus{z-index:2;}", ""], props => props.small ? "0 8px 3px 7px" : "0 10px 3px 9px", props => props.selected ? css(["border-left:", ";&:hover{border-left:", ";}"], props => props.selected && props.highlighted ? "solid 1px ".concat(themeGet("colors.warningDarker")(props)) : "solid 1px ".concat(themeGet("colors.primaryDark")(props)), props => props.selected && props.highlighted ? "solid 1px ".concat(themeGet("colors.warningDarker")(props)) : "solid 1px ".concat(themeGet("colors.primaryDark")(props))) : css(["border-left:0;&:hover,&:focus{background-color:", ";border-left:0;}"], themeGet("colors.primaryLightest")(props)));
32
+ const TagType = styled.div.withConfig({
93
33
  displayName: "Tag__TagType",
94
34
  componentId: "sc-1dh2aa8-5"
95
- })(["text-transform:uppercase;margin-left:", ";padding:", ";line-height:1;white-space:normal;text-align:left;flex:1 1 auto;border-radius:", ";font-size:", ";background-color:", ";color:", ";"], function (props) {
96
- return props.small ? "6px" : "10px";
97
- }, function (props) {
98
- return props.small ? themeGet("space.2")(props) : themeGet("space.2")(props);
99
- }, function (props) {
100
- return themeGet("radii.1")(props);
101
- }, function (props) {
102
- return props.small ? "1rem" : themeGet("fontSizes.0")(props);
103
- }, function (props) {
104
- return props.disabled ? themeGet("colors.grey")(props) : props.selected && props.highlighted ? themeGet("colors.warningLighter")(props) : props.selected ? "rgba(0,0,0,0.25)" : themeGet("colors.primaryLightest")(props);
105
- }, function (props) {
106
- return props.disabled ? themeGet("colors.white")(props) : props.selected && props.highlighted ? themeGet("colors.black70")(props) : props.selected ? themeGet("colors.white")(props) : themeGet("colors.primaryDark")(props);
107
- });
108
- var TagAvatar = styled(Avatar).withConfig({
35
+ })(["text-transform:uppercase;margin-left:", ";padding:", ";line-height:1;white-space:normal;text-align:left;flex:1 1 auto;border-radius:", ";font-size:", ";background-color:", ";color:", ";"], props => props.small ? "6px" : "10px", props => props.small ? themeGet("space.2")(props) : themeGet("space.2")(props), props => themeGet("radii.1")(props), props => props.small ? "1rem" : themeGet("fontSizes.0")(props), props => props.disabled ? themeGet("colors.grey")(props) : props.selected && props.highlighted ? themeGet("colors.warningLighter")(props) : props.selected ? "rgba(0,0,0,0.25)" : themeGet("colors.primaryLightest")(props), props => props.disabled ? themeGet("colors.white")(props) : props.selected && props.highlighted ? themeGet("colors.black70")(props) : props.selected ? themeGet("colors.white")(props) : themeGet("colors.primaryDark")(props));
36
+ const TagAvatar = styled(Avatar).withConfig({
109
37
  displayName: "Tag__TagAvatar",
110
38
  componentId: "sc-1dh2aa8-6"
111
- })(["img[class*=\"Avatar__Image\"],div[class*=\"Avatar__Shape\"]{width:", ";height:", ";text-transform:uppercase;margin-right:", ";margin-left:", ";font-size:", ";background-color:", ";color:", ";}"], function (props) {
112
- return props.small ? themeGet("tagScale.tagAvatarSizeSmall") : themeGet("tagScale.tagAvatarSizeDefault");
113
- }, function (props) {
114
- return props.small ? themeGet("tagScale.tagAvatarSizeSmall") : themeGet("tagScale.tagAvatarSizeDefault");
115
- }, themeGet("space.xs"), function (props) {
116
- return props.small ? themeGet("tagScale.tagAvatarMarginLeftSmall") : themeGet("tagScale.tagAvatarMarginLeftDefault");
117
- }, function (props) {
118
- return props.small ? themeGet("tagScale.tagAvatarFontSizeSmall") : themeGet("tagScale.tagAvatarFontSizeDefault");
119
- }, function (props) {
120
- return props.disabled ? themeGet("colors.grey")(props) : props.selected && props.highlighted ? themeGet("colors.black70")(props) : props.selected ? "rgba(0,0,0,0.25)" : themeGet("colors.primaryLightest")(props);
121
- }, function (props) {
122
- return props.disabled ? themeGet("colors.white")(props) : props.selected && props.highlighted ? themeGet("colors.white")(props) : props.selected ? themeGet("colors.white")(props) : themeGet("colors.primaryDark")(props);
123
- });
39
+ })(["img[class*=\"Avatar__Image\"],div[class*=\"Avatar__Shape\"]{width:", ";height:", ";text-transform:uppercase;margin-right:", ";margin-left:", ";font-size:", ";background-color:", ";color:", ";}"], props => props.small ? themeGet("tagScale.tagAvatarSizeSmall") : themeGet("tagScale.tagAvatarSizeDefault"), props => props.small ? themeGet("tagScale.tagAvatarSizeSmall") : themeGet("tagScale.tagAvatarSizeDefault"), themeGet("space.xs"), props => props.small ? themeGet("tagScale.tagAvatarMarginLeftSmall") : themeGet("tagScale.tagAvatarMarginLeftDefault"), props => props.small ? themeGet("tagScale.tagAvatarFontSizeSmall") : themeGet("tagScale.tagAvatarFontSizeDefault"), props => props.disabled ? themeGet("colors.grey")(props) : props.selected && props.highlighted ? themeGet("colors.black70")(props) : props.selected ? "rgba(0,0,0,0.25)" : themeGet("colors.primaryLightest")(props), props => props.disabled ? themeGet("colors.white")(props) : props.selected && props.highlighted ? themeGet("colors.white")(props) : props.selected ? themeGet("colors.white")(props) : themeGet("colors.primaryDark")(props));
124
40
 
125
41
  /**
126
42
  * The top two rows are an example of how tags should be used when they are selectable/unselectable. There is the option to display the cross icon or not.
@@ -129,96 +45,108 @@ var TagAvatar = styled(Avatar).withConfig({
129
45
  */
130
46
 
131
47
  export default function Tag(_ref) {
132
- var selected = _ref.selected,
133
- onSelect = _ref.onSelect,
134
- disabled = _ref.disabled,
135
- showRemove = _ref.showRemove,
136
- onRemove = _ref.onRemove,
137
- theme = _ref.theme,
138
- tagType = _ref.tagType,
139
- showEdit = _ref.showEdit,
140
- onEdit = _ref.onEdit,
141
- showInfo = _ref.showInfo,
142
- onInfo = _ref.onInfo,
143
- showStrikeThrough = _ref.showStrikeThrough,
144
- children = _ref.children,
145
- isPending = _ref.isPending,
146
- small = _ref.small,
147
- highlighted = _ref.highlighted,
148
- personEntity = _ref.personEntity,
149
- props = _objectWithoutProperties(_ref, _excluded);
150
- var component = /*#__PURE__*/React.createElement(TagWrapper, _extends({
151
- small: small
152
- }, props), /*#__PURE__*/React.createElement(TagValue, {
153
- selected: selected,
154
- highlighted: highlighted,
155
- disabled: disabled,
156
- showEdit: showEdit,
157
- showInfo: showInfo,
158
- showRemove: showRemove,
159
- onClick: onSelect,
160
- small: small,
161
- "aria-label": "Navigate to tag",
162
- title: "Navigate to tag"
163
- }, personEntity && /*#__PURE__*/React.createElement(TagAvatar, {
164
- selected: selected,
165
- highlighted: highlighted,
166
- disabled: disabled,
167
- small: small,
168
- imageAlt: "Avatar for ".concat(children),
169
- image: personEntity.avatarSrc,
170
- initials: personEntity.initials
171
- }), /*#__PURE__*/React.createElement(TagValueText, {
172
- showStrikeThrough: showStrikeThrough,
173
- small: small
174
- }, showStrikeThrough && /*#__PURE__*/React.createElement("span", {
175
- className: "sr-only"
176
- }, "Striked out:"), children), tagType && /*#__PURE__*/React.createElement(TagType, {
177
- selected: selected,
178
- highlighted: highlighted,
179
- disabled: disabled,
180
- small: small
181
- }, tagType), isPending && /*#__PURE__*/React.createElement(Loading, {
182
- ml: "s"
183
- })), showEdit && /*#__PURE__*/React.createElement(TagActionIconWrapper, {
184
- selected: selected,
185
- highlighted: highlighted,
186
- disabled: disabled,
187
- showRemove: showRemove,
188
- onClick: onEdit,
48
+ let {
49
+ selected,
50
+ onSelect,
51
+ disabled,
52
+ showRemove,
53
+ onRemove,
54
+ theme,
55
+ tagType,
56
+ showEdit,
57
+ onEdit,
58
+ showInfo,
59
+ onInfo,
60
+ showStrikeThrough,
61
+ children,
62
+ isPending,
63
+ small,
64
+ highlighted,
65
+ personEntity,
66
+ ...props
67
+ } = _ref;
68
+ const component = /*#__PURE__*/_jsxs(TagWrapper, {
189
69
  small: small,
190
- "aria-label": "Edit tag",
191
- title: "Edit tag"
192
- }, /*#__PURE__*/React.createElement(Icon, {
193
- icon: ["fas", "pen"],
194
- size: "xs"
195
- })), showInfo && /*#__PURE__*/React.createElement(TagActionIconWrapper, {
196
- selected: selected,
197
- highlighted: highlighted,
198
- disabled: disabled,
199
- onClick: onInfo,
200
- showInfo: showInfo,
201
- small: small,
202
- "aria-label": "View tag details",
203
- title: "View tag details"
204
- }, /*#__PURE__*/React.createElement(Icon, {
205
- icon: ["fas", "info"],
206
- size: "xs"
207
- })), showRemove && /*#__PURE__*/React.createElement(TagRemoveIconWrapper, {
208
- selected: selected,
209
- highlighted: highlighted,
210
- disabled: disabled,
211
- onClick: onRemove,
212
- small: small,
213
- "aria-label": "Remove tag",
214
- title: "Remove tag"
215
- }, /*#__PURE__*/React.createElement(Icon, {
216
- icon: ["fas", "times"],
217
- size: "xs"
218
- })));
219
- return theme ? /*#__PURE__*/React.createElement(ThemeProvider, {
220
- theme: theme
221
- }, component) : component;
70
+ ...props,
71
+ children: [/*#__PURE__*/_jsxs(TagValue, {
72
+ selected: selected,
73
+ highlighted: highlighted,
74
+ disabled: disabled,
75
+ showEdit: showEdit,
76
+ showInfo: showInfo,
77
+ showRemove: showRemove,
78
+ onClick: onSelect,
79
+ small: small,
80
+ "aria-label": "Navigate to tag",
81
+ title: "Navigate to tag",
82
+ children: [personEntity && /*#__PURE__*/_jsx(TagAvatar, {
83
+ selected: selected,
84
+ highlighted: highlighted,
85
+ disabled: disabled,
86
+ small: small,
87
+ imageAlt: "Avatar for ".concat(children),
88
+ image: personEntity.avatarSrc,
89
+ initials: personEntity.initials
90
+ }), /*#__PURE__*/_jsxs(TagValueText, {
91
+ showStrikeThrough: showStrikeThrough,
92
+ small: small,
93
+ children: [showStrikeThrough && /*#__PURE__*/_jsx("span", {
94
+ className: "sr-only",
95
+ children: "Striked out:"
96
+ }), children]
97
+ }), tagType && /*#__PURE__*/_jsx(TagType, {
98
+ selected: selected,
99
+ highlighted: highlighted,
100
+ disabled: disabled,
101
+ small: small,
102
+ children: tagType
103
+ }), isPending && /*#__PURE__*/_jsx(Loading, {
104
+ ml: "s"
105
+ })]
106
+ }), showEdit && /*#__PURE__*/_jsx(TagActionIconWrapper, {
107
+ selected: selected,
108
+ highlighted: highlighted,
109
+ disabled: disabled,
110
+ showRemove: showRemove,
111
+ onClick: onEdit,
112
+ small: small,
113
+ "aria-label": "Edit tag",
114
+ title: "Edit tag",
115
+ children: /*#__PURE__*/_jsx(Icon, {
116
+ icon: ["fas", "pen"],
117
+ size: "xs"
118
+ })
119
+ }), showInfo && /*#__PURE__*/_jsx(TagActionIconWrapper, {
120
+ selected: selected,
121
+ highlighted: highlighted,
122
+ disabled: disabled,
123
+ onClick: onInfo,
124
+ showInfo: showInfo,
125
+ small: small,
126
+ "aria-label": "View tag details",
127
+ title: "View tag details",
128
+ children: /*#__PURE__*/_jsx(Icon, {
129
+ icon: ["fas", "info"],
130
+ size: "xs"
131
+ })
132
+ }), showRemove && /*#__PURE__*/_jsx(TagRemoveIconWrapper, {
133
+ selected: selected,
134
+ highlighted: highlighted,
135
+ disabled: disabled,
136
+ onClick: onRemove,
137
+ small: small,
138
+ "aria-label": "Remove tag",
139
+ title: "Remove tag",
140
+ children: /*#__PURE__*/_jsx(Icon, {
141
+ icon: ["fas", "times"],
142
+ size: "xs"
143
+ })
144
+ })]
145
+ });
146
+ return theme ? /*#__PURE__*/_jsx(ThemeProvider, {
147
+ theme: theme,
148
+ children: component
149
+ }) : component;
222
150
  }
223
151
  Tag.propTypes = {
224
152
  children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(PropTypes.node)]),
@@ -2,104 +2,91 @@ import React from "react";
2
2
  import TextArea from ".";
3
3
  import Box from "../Box";
4
4
  import Spacer from "../Spacer";
5
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
6
  export default {
6
7
  title: "Components/TextArea",
7
8
  component: TextArea,
8
- decorators: [function (storyFn) {
9
- return /*#__PURE__*/React.createElement(Box, {
10
- p: "r"
11
- }, storyFn());
12
- }]
13
- };
14
- export var defaultTextArea = function defaultTextArea() {
15
- return /*#__PURE__*/React.createElement(TextArea, {
16
- "data-testid": "Test-id",
17
- id: "TextArea01",
18
- label: "Message",
19
- autoFocus: true
20
- });
21
- };
9
+ decorators: [storyFn => /*#__PURE__*/_jsx(Box, {
10
+ p: "r",
11
+ children: storyFn()
12
+ })]
13
+ };
14
+ export const defaultTextArea = () => /*#__PURE__*/_jsx(TextArea, {
15
+ "data-testid": "Test-id",
16
+ id: "TextArea01",
17
+ label: "Message",
18
+ autoFocus: true
19
+ });
22
20
  defaultTextArea.storyName = "Default";
23
- export var sizeTextArea = function sizeTextArea() {
24
- return /*#__PURE__*/React.createElement(TextArea, {
25
- id: "TextArea02",
26
- label: "Message",
27
- cols: "50",
28
- rows: "5"
29
- });
30
- };
21
+ export const sizeTextArea = () => /*#__PURE__*/_jsx(TextArea, {
22
+ id: "TextArea02",
23
+ label: "Message",
24
+ cols: "50",
25
+ rows: "5"
26
+ });
31
27
  sizeTextArea.storyName = "Size";
32
- export var fullWidthTextArea = function fullWidthTextArea() {
33
- return /*#__PURE__*/React.createElement(TextArea, {
34
- id: "TextArea05",
35
- label: "Message",
36
- fullWidth: true
37
- });
38
- };
28
+ export const fullWidthTextArea = () => /*#__PURE__*/_jsx(TextArea, {
29
+ id: "TextArea05",
30
+ label: "Message",
31
+ fullWidth: true
32
+ });
39
33
  fullWidthTextArea.storyName = "Full-width";
40
- export var statesTextArea = function statesTextArea() {
41
- return /*#__PURE__*/React.createElement(Spacer, {
42
- my: "r"
43
- }, /*#__PURE__*/React.createElement(TextArea, {
34
+ export const boldLabelTextArea = () => /*#__PURE__*/_jsx(TextArea, {
35
+ id: "TextAreaBold",
36
+ label: "Message",
37
+ bold: true,
38
+ "data-testid": "test-input"
39
+ });
40
+ boldLabelTextArea.storyName = "Bold Label";
41
+ export const mandatoryTextArea = () => /*#__PURE__*/_jsx(TextArea, {
42
+ id: "TextAreaMandatory",
43
+ label: "Message",
44
+ mandatory: true
45
+ });
46
+ mandatoryTextArea.storyName = "Mandatory";
47
+ export const statesTextArea = () => /*#__PURE__*/_jsxs(Spacer, {
48
+ my: "r",
49
+ children: [/*#__PURE__*/_jsx(TextArea, {
44
50
  id: "TextArea03",
45
51
  label: "Message - invalid message",
46
52
  invalid: true
47
- }), /*#__PURE__*/React.createElement(TextArea, {
53
+ }), /*#__PURE__*/_jsx(TextArea, {
48
54
  id: "TextArea04",
49
55
  label: "Message",
50
56
  valid: true
51
- }));
52
- };
57
+ })]
58
+ });
53
59
  statesTextArea.storyName = "States";
54
- export var boldLabelTextArea = function boldLabelTextArea() {
55
- return /*#__PURE__*/React.createElement(TextArea, {
56
- id: "TextAreaBold",
57
- label: "Message",
58
- bold: true,
59
- "data-testid": "test-input"
60
- });
61
- };
62
- boldLabelTextArea.storyName = "Bold Label";
63
- export var mandatoryTextArea = function mandatoryTextArea() {
64
- return /*#__PURE__*/React.createElement(TextArea, {
65
- id: "TextAreaMandatory",
66
- label: "Message",
67
- mandatory: true
68
- });
69
- };
70
- mandatoryTextArea.storyName = "Mandatory";
71
- export var invertedTextArea = function invertedTextArea() {
72
- return /*#__PURE__*/React.createElement(Box, {
73
- bg: "greyDarker",
74
- p: "r"
75
- }, /*#__PURE__*/React.createElement(Spacer, {
76
- my: "r"
77
- }, /*#__PURE__*/React.createElement(TextArea, {
78
- id: "TextArea06",
79
- label: "Message",
80
- inverted: true
81
- }), /*#__PURE__*/React.createElement(TextArea, {
82
- id: "TextArea07",
83
- label: "Message - invalid message",
84
- inverted: true,
85
- invalid: true
86
- }), /*#__PURE__*/React.createElement(TextArea, {
87
- id: "TextArea08",
88
- label: "Message",
89
- inverted: true,
90
- valid: true
91
- })));
92
- };
60
+ export const invertedTextArea = () => /*#__PURE__*/_jsx(Box, {
61
+ bg: "greyDarker",
62
+ p: "r",
63
+ children: /*#__PURE__*/_jsxs(Spacer, {
64
+ my: "r",
65
+ children: [/*#__PURE__*/_jsx(TextArea, {
66
+ id: "TextArea06",
67
+ label: "Message",
68
+ inverted: true
69
+ }), /*#__PURE__*/_jsx(TextArea, {
70
+ id: "TextArea07",
71
+ label: "Message - invalid message",
72
+ inverted: true,
73
+ invalid: true
74
+ }), /*#__PURE__*/_jsx(TextArea, {
75
+ id: "TextArea08",
76
+ label: "Message",
77
+ inverted: true,
78
+ valid: true
79
+ })]
80
+ })
81
+ });
93
82
  invertedTextArea.storyName = "Inverted";
94
- export var disabledTextArea = function disabledTextArea() {
95
- return /*#__PURE__*/React.createElement(TextArea, {
96
- "data-testid": "Test-id",
97
- id: "TextArea01",
98
- label: "Message",
99
- value: "This is uneditable",
100
- disabled: true
101
- });
102
- };
83
+ export const disabledTextArea = () => /*#__PURE__*/_jsx(TextArea, {
84
+ "data-testid": "Test-id",
85
+ id: "TextArea01",
86
+ label: "Message",
87
+ value: "This is uneditable",
88
+ disabled: true
89
+ });
103
90
  disabledTextArea.storyName = "Disabled";
104
91
  defaultTextArea.__docgenInfo = {
105
92
  "description": "",
@@ -116,11 +103,6 @@ fullWidthTextArea.__docgenInfo = {
116
103
  "methods": [],
117
104
  "displayName": "fullWidthTextArea"
118
105
  };
119
- statesTextArea.__docgenInfo = {
120
- "description": "",
121
- "methods": [],
122
- "displayName": "statesTextArea"
123
- };
124
106
  boldLabelTextArea.__docgenInfo = {
125
107
  "description": "",
126
108
  "methods": [],
@@ -131,6 +113,11 @@ mandatoryTextArea.__docgenInfo = {
131
113
  "methods": [],
132
114
  "displayName": "mandatoryTextArea"
133
115
  };
116
+ statesTextArea.__docgenInfo = {
117
+ "description": "",
118
+ "methods": [],
119
+ "displayName": "statesTextArea"
120
+ };
134
121
  invertedTextArea.__docgenInfo = {
135
122
  "description": "",
136
123
  "methods": [],