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.
- package/es/GlobalStyles.js +1 -31
- package/es/SystemThemeProvider.js +11 -5
- package/es/assets/Colour/Colour.stories.js +211 -0
- package/es/assets/Colour/index.js +3 -3
- package/es/components/ActionsMenu/ActionsMenu.stories.js +260 -233
- package/es/components/ActionsMenu/index.js +144 -229
- package/es/components/Avatar/Avatar.stories.js +212 -196
- package/es/components/Avatar/index.js +280 -307
- package/es/components/Badge/Badge.stories.js +71 -46
- package/es/components/Badge/index.js +71 -74
- package/es/components/Box/Box.stories.js +51 -35
- package/es/components/Box/index.js +33 -34
- package/es/components/Button/Button.stories.js +161 -145
- package/es/components/Button/ButtonLink.stories.js +152 -139
- package/es/components/Button/index.js +79 -99
- package/es/components/ButtonGroup/ButtonGroup.stories.js +43 -42
- package/es/components/ButtonGroup/ButtonGroupItem.stories.js +11 -13
- package/es/components/ButtonGroup/index.js +103 -99
- package/es/components/Card/Card.stories.js +94 -62
- package/es/components/Card/index.js +50 -71
- package/es/components/Checkbox/Checkbox.stories.js +37 -43
- package/es/components/Checkbox/index.js +61 -76
- package/es/components/DatePicker/DatePicker.stories.js +86 -118
- package/es/components/DatePicker/index.js +71 -187
- package/es/components/Divider/Divider.stories.js +39 -42
- package/es/components/Divider/index.js +21 -27
- package/es/components/Expandable/Expandable.stories.js +46 -36
- package/es/components/Expandable/index.js +55 -82
- package/es/components/Flex/Flex.stories.js +19 -5
- package/es/components/Flex/FlexItem.stories.js +10 -9
- package/es/components/Flex/index.js +34 -27
- package/es/components/Grid/Grid.stories.js +129 -55
- package/es/components/Grid/index.js +25 -24
- package/es/components/Header/Header.stories.js +101 -92
- package/es/components/Header/index.js +433 -436
- package/es/components/HeaderSimple/HeaderSimple.stories.js +23 -27
- package/es/components/HeaderSimple/index.js +73 -68
- package/es/components/Icon/Icon.stories.js +58 -57
- package/es/components/Icon/index.js +48 -46
- package/es/components/Loading/Loading.stories.js +32 -39
- package/es/components/Loading/index.js +44 -51
- package/es/components/Modal/Modal.stories.js +172 -153
- package/es/components/Modal/index.js +126 -134
- package/es/components/Notification/Notification.stories.js +59 -58
- package/es/components/Notification/index.js +123 -133
- package/es/components/Popover/Popover.stories.js +134 -102
- package/es/components/Popover/index.js +65 -111
- package/es/components/ProgressBar/ProgressBar.stories.js +36 -39
- package/es/components/ProgressBar/index.js +29 -34
- package/es/components/RadioButton/RadioButton.stories.js +32 -37
- package/es/components/RadioButton/index.js +170 -184
- package/es/components/Range/Range.stories.js +19 -19
- package/es/components/Range/index.js +35 -45
- package/es/components/Select/Select.stories.js +107 -128
- package/es/components/Select/index.js +324 -336
- package/es/components/SideNav/NavItem.js +112 -122
- package/es/components/SideNav/SideNav.stories.js +84 -57
- package/es/components/SideNav/index.js +161 -185
- package/es/components/Sidebar/Sidebar.stories.js +50 -33
- package/es/components/Sidebar/index.js +152 -155
- package/es/components/Spacer/Spacer.stories.js +35 -32
- package/es/components/Spacer/index.js +20 -20
- package/es/components/StatusDot/StatusDot.stories.js +103 -90
- package/es/components/StatusDot/index.js +36 -38
- package/es/components/StyledLink/StyledLink.stories.js +68 -69
- package/es/components/StyledLink/index.js +47 -48
- package/es/components/Table/Table.stories.js +118 -112
- package/es/components/Table/getExpandColumnConfig.js +67 -62
- package/es/components/Table/index.js +24 -27
- package/es/components/Table/muiStyleOverrides.js +10 -8
- package/es/components/Tabs/Tab.stories.js +55 -38
- package/es/components/Tabs/TabsContainer.stories.js +30 -22
- package/es/components/Tabs/index.js +95 -92
- package/es/components/Tag/Tag.stories.js +250 -220
- package/es/components/Tag/index.js +118 -190
- package/es/components/TextArea/TextArea.stories.js +76 -89
- package/es/components/TextArea/index.js +117 -115
- package/es/components/TextInput/TextInput.stories.js +41 -61
- package/es/components/TextInput/index.js +127 -171
- package/es/components/Toggle/Toggle.stories.js +63 -62
- package/es/components/Toggle/index.js +43 -77
- package/es/components/TreeNav/TreeNav.stories.js +7 -8
- package/es/components/TreeNav/index.js +72 -69
- package/es/components/Typography/Typography.stories.js +174 -0
- package/es/components/Typography/index.js +252 -308
- package/es/components.test.js +1 -1
- package/es/hooks/isVisible.js +6 -10
- package/es/hooks/keepInView.js +27 -32
- package/es/hooks/keypress.js +14 -14
- package/es/hooks/useInputFocus.js +5 -5
- package/es/hooks/usePrevious.js +3 -3
- package/es/systemThemeCollapsed.js +53 -53
- package/es/systemtheme.js +53 -53
- package/es/utils/selectUtil.js +1 -1
- package/es/utils/selectUtil.test.js +6 -6
- 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
|
-
|
|
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,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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:", ";", ""],
|
|
26
|
-
|
|
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;"],
|
|
62
|
-
|
|
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;}", ""],
|
|
70
|
-
|
|
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;}", ""],
|
|
84
|
-
|
|
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:", ";"],
|
|
96
|
-
|
|
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:", ";}"],
|
|
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
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
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: [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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__*/
|
|
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
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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": [],
|