@pingux/astro 1.0.0-alpha.6 → 1.1.0-alpha.0
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/CHANGELOG.md +186 -0
- package/README.md +5 -0
- package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.stories.js +4 -11
- package/lib/cjs/components/AccordionItem/AccordionItem.js +3 -1
- package/lib/cjs/components/Button/Button.js +5 -24
- package/lib/cjs/components/Button/Button.stories.js +5 -11
- package/lib/cjs/components/Button/Button.test.js +0 -24
- package/lib/cjs/components/Chip/Chip.js +26 -10
- package/lib/cjs/components/Chip/Chip.stories.js +44 -5
- package/lib/cjs/components/Chip/Chip.test.js +9 -0
- package/lib/cjs/components/{Panel/index.js → Chip/ChipContext.js} +8 -7
- package/lib/cjs/components/CopyText/CopyText.js +3 -73
- package/lib/cjs/components/IconButton/IconButton.js +17 -7
- package/lib/cjs/components/IconButton/IconButton.test.js +0 -1
- package/lib/cjs/components/ListItem/ListItem.stories.js +0 -2
- package/lib/cjs/components/ListView/ListView.js +4 -3
- package/lib/cjs/components/ListViewItem/ListViewItem.js +3 -6
- package/lib/cjs/components/MultivaluesField/MultivaluesField.js +1 -1
- package/lib/cjs/components/Stepper/Stepper.js +1 -0
- package/lib/cjs/components/Tab/Tab.js +15 -6
- package/lib/cjs/components/Tabs/Tabs.js +7 -1
- package/lib/cjs/components/Tabs/Tabs.stories.js +60 -6
- package/lib/cjs/components/Tabs/Tabs.test.js +78 -15
- package/lib/cjs/components/TextAreaField/TextAreaField.test.js +10 -0
- package/lib/cjs/components/TooltipTrigger/TooltipTrigger.stories.js +45 -2
- package/lib/cjs/{components/DropdownField → hooks/useCopyToClipboard}/index.js +2 -2
- package/lib/cjs/hooks/useCopyToClipboard/useCopyToClipboard.js +83 -0
- package/lib/cjs/hooks/useCopyToClipboard/useCopyToClipboard.test.js +79 -0
- package/lib/cjs/index.js +48 -136
- package/lib/cjs/layouts/ListLayout.stories.js +2 -1
- package/lib/cjs/layouts/SchemaFormLayout.stories.js +2 -21
- package/lib/cjs/recipes/ArrayField.stories.js +3 -3
- package/lib/cjs/recipes/CopyToClipboard.stories.js +45 -0
- package/lib/cjs/recipes/RadioButtonsWithLinks.stories.js +146 -0
- package/lib/cjs/styles/forms/input.js +4 -0
- package/lib/cjs/styles/theme.js +0 -3
- package/lib/cjs/styles/variants/accordion.js +7 -9
- package/lib/cjs/styles/variants/boxes.js +22 -19
- package/lib/cjs/styles/variants/buttons.js +38 -29
- package/lib/cjs/styles/variants/tabs.js +1 -0
- package/lib/cjs/styles/variants/variants.js +0 -3
- package/lib/components/AccordionGridGroup/AccordionGridGroup.stories.js +4 -11
- package/lib/components/AccordionItem/AccordionItem.js +3 -1
- package/lib/components/Button/Button.js +7 -24
- package/lib/components/Button/Button.stories.js +5 -10
- package/lib/components/Button/Button.test.js +0 -20
- package/lib/components/Chip/Chip.js +25 -10
- package/lib/components/Chip/Chip.stories.js +41 -5
- package/lib/components/Chip/Chip.test.js +9 -0
- package/lib/components/Chip/ChipContext.js +3 -0
- package/lib/components/CopyText/CopyText.js +2 -71
- package/lib/components/IconButton/IconButton.js +17 -9
- package/lib/components/IconButton/IconButton.test.js +0 -1
- package/lib/components/ListItem/ListItem.stories.js +0 -2
- package/lib/components/ListView/ListView.js +4 -3
- package/lib/components/ListViewItem/ListViewItem.js +3 -5
- package/lib/components/MultivaluesField/MultivaluesField.js +1 -1
- package/lib/components/Stepper/Stepper.js +1 -0
- package/lib/components/Tab/Tab.js +15 -6
- package/lib/components/Tabs/Tabs.js +7 -1
- package/lib/components/Tabs/Tabs.stories.js +56 -4
- package/lib/components/Tabs/Tabs.test.js +78 -15
- package/lib/components/TextAreaField/TextAreaField.test.js +8 -0
- package/lib/components/TooltipTrigger/TooltipTrigger.stories.js +33 -1
- package/lib/hooks/useCopyToClipboard/index.js +1 -0
- package/lib/hooks/useCopyToClipboard/useCopyToClipboard.js +69 -0
- package/lib/hooks/useCopyToClipboard/useCopyToClipboard.test.js +64 -0
- package/lib/index.js +0 -8
- package/lib/layouts/ListLayout.stories.js +2 -1
- package/lib/layouts/SchemaFormLayout.stories.js +2 -19
- package/lib/recipes/ArrayField.stories.js +3 -3
- package/lib/recipes/CopyToClipboard.stories.js +25 -0
- package/lib/recipes/RadioButtonsWithLinks.stories.js +120 -0
- package/lib/styles/forms/input.js +4 -0
- package/lib/styles/theme.js +0 -3
- package/lib/styles/variants/accordion.js +7 -9
- package/lib/styles/variants/boxes.js +21 -19
- package/lib/styles/variants/buttons.js +37 -29
- package/lib/styles/variants/tabs.js +1 -0
- package/lib/styles/variants/variants.js +0 -2
- package/package.json +2 -2
- package/lib/cjs/components/Dropdown/Dropdown.js +0 -112
- package/lib/cjs/components/Dropdown/Dropdown.test.js +0 -80
- package/lib/cjs/components/Dropdown/index.js +0 -18
- package/lib/cjs/components/DropdownField/DropdownField.js +0 -187
- package/lib/cjs/components/DropdownField/DropdownField.stories.js +0 -278
- package/lib/cjs/components/DropdownField/DropdownField.test.js +0 -80
- package/lib/cjs/components/Panel/Panel.js +0 -101
- package/lib/cjs/components/Panel/Panel.stories.js +0 -57
- package/lib/cjs/components/Panel/Panel.test.js +0 -72
- package/lib/cjs/components/Popover/Popover.js +0 -87
- package/lib/cjs/components/Popover/Popover.stories.js +0 -80
- package/lib/cjs/components/Popover/Popover.test.js +0 -91
- package/lib/cjs/components/Popover/index.js +0 -18
- package/lib/cjs/recipes/InputBoxWithLinkedChip.stories.js +0 -67
- package/lib/cjs/styles/variants/popover.js +0 -86
- package/lib/components/Dropdown/Dropdown.js +0 -90
- package/lib/components/Dropdown/Dropdown.test.js +0 -62
- package/lib/components/Dropdown/index.js +0 -1
- package/lib/components/DropdownField/DropdownField.js +0 -155
- package/lib/components/DropdownField/DropdownField.stories.js +0 -222
- package/lib/components/DropdownField/DropdownField.test.js +0 -60
- package/lib/components/DropdownField/index.js +0 -1
- package/lib/components/Panel/Panel.js +0 -71
- package/lib/components/Panel/Panel.stories.js +0 -35
- package/lib/components/Panel/Panel.test.js +0 -52
- package/lib/components/Panel/index.js +0 -1
- package/lib/components/Popover/Popover.js +0 -65
- package/lib/components/Popover/Popover.stories.js +0 -52
- package/lib/components/Popover/Popover.test.js +0 -75
- package/lib/components/Popover/index.js +0 -2
- package/lib/recipes/InputBoxWithLinkedChip.stories.js +0 -43
- package/lib/styles/variants/popover.js +0 -76
@@ -0,0 +1,45 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
6
|
+
|
7
|
+
_Object$defineProperty(exports, "__esModule", {
|
8
|
+
value: true
|
9
|
+
});
|
10
|
+
|
11
|
+
exports.Default = exports["default"] = void 0;
|
12
|
+
|
13
|
+
var _react = _interopRequireDefault(require("react"));
|
14
|
+
|
15
|
+
var _index = require("../index");
|
16
|
+
|
17
|
+
var _useCopyToClipboard = _interopRequireDefault(require("../hooks/useCopyToClipboard"));
|
18
|
+
|
19
|
+
var _react2 = require("@emotion/react");
|
20
|
+
|
21
|
+
var _default = {
|
22
|
+
title: 'Recipes/CopyToClipboard'
|
23
|
+
};
|
24
|
+
exports["default"] = _default;
|
25
|
+
|
26
|
+
var Default = function Default() {
|
27
|
+
var textToCopy = 'eyJraWQiOiI4YTg5MmY3ZS1iNTk1LTRkYWQtODBlNC0yMzA4ODkyZTczZDQiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiJodHRwczovL2FwaS5waW5nb25lLmNvbSIsImF1dGhVcmwiOiJodHRwczovL2F1dGgucGluZ29uZS5jb20iLCJjb25zb2xlVXJsIjoiaHR0cHM6Ly9jb25zb2xlLnBpbmdvbmUuY29tIiwiZW52aXJvbm1lbnROYW1lIjoiTW9udGFuYSIsImVudmlyb25tZW50SWQiOiJhYzc2NWQ0Ny1kMDM2LTQ1MGUtODFjMS1mYjQ1NDMxMjM1NjYiLCJvcmdhbml6YXRpb25OYW1lIjoiaW50ZXJuYWxfZXJpa2FhbGRlYm9yZ2hfMjUyMDc1MDMxIiwib3JnYW5pemF0aW9uSWQiOiJkMDYzMmYwZi03YjQ2LTQ5ZjUtYjgyYS1kZWU5MWQ3MDY3ODYiLCJnYXRld2F5TmFtZSI6ImRzZHMiLCJnYXRld2F5SWQiOiJiMDVmNGU5Yy1jMzRiLTRlZTMtYTYyNS01ZGFiNjlkYTE1YTEiLCJnYXRld2F5VHlwZSI6IlBJTkdfRkVERVJBVEUiLCJ0YXJnZXRDbHVzdGVyRW52aXJvbm1lbnQiOiJQUk9EIiwidGFyZ2V0R2VvZ3JhcGh5IjoiTkEiLCJyZWdpb24iOiJOb3J0aCBBbWVyaWNhIiwianRpIjoiMTUwYTQ0OTktZjIyYi00YWVhLWIzY2UtYWM2YWY1NjVjNjk5IiwiaXNzIjoid3NzOi8vZ2F0ZXdheXMucGluZ29uZS5jb20iLCJpYXQiOjE2MjYyODEyMTZ9.JJ9wwqTxQWUwz2vmU0yE54xuYff51xbirzZuEUxd8GDzV45bnpbmx460CY8g9ccdmOjvfVF4RPPsawpKuMZH271tDlLZl67iknxDVWBZSih9K6v0RAmsmNriR4OyOFOkGrULCIz3ISyPWeItp1AVuue_8guWR63KzYg32aPC4SgmOrc2myq9N6XNU2H1KybETbG_s5-VU_cUqaXn7GUzhL2_W6CSVrrlE1cYfjC7pxMKFm4vvIw_KcNYVGO1K6oYgzRZ4A8toQHIdlGB8L-wkCt442LdC93OjoQdkLuGzmXnO8BUohWea-Dn35gGHoH-H1BRQTya_H9AKyWMxCw-vg';
|
28
|
+
var copyToClipboard = (0, _useCopyToClipboard["default"])(textToCopy);
|
29
|
+
return (0, _react2.jsx)(_index.Box, {
|
30
|
+
bg: "accent.99",
|
31
|
+
py: "md",
|
32
|
+
px: "xl"
|
33
|
+
}, (0, _react2.jsx)(_index.Text, {
|
34
|
+
sx: {
|
35
|
+
wordBreak: 'break-all'
|
36
|
+
}
|
37
|
+
}, textToCopy), (0, _react2.jsx)(_index.Button, {
|
38
|
+
variant: "inline",
|
39
|
+
my: "lg",
|
40
|
+
onPress: copyToClipboard,
|
41
|
+
"aria-label": "Copy Text To Clipboard"
|
42
|
+
}, "Copy To Clipboard"));
|
43
|
+
};
|
44
|
+
|
45
|
+
exports.Default = Default;
|
@@ -0,0 +1,146 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime-corejs3/helpers/interopRequireWildcard");
|
4
|
+
|
5
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
6
|
+
|
7
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
8
|
+
|
9
|
+
_Object$defineProperty(exports, "__esModule", {
|
10
|
+
value: true
|
11
|
+
});
|
12
|
+
|
13
|
+
exports.Default = exports["default"] = void 0;
|
14
|
+
|
15
|
+
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
16
|
+
|
17
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
18
|
+
|
19
|
+
var _react = _interopRequireWildcard(require("react"));
|
20
|
+
|
21
|
+
var _CloseIcon = _interopRequireDefault(require("mdi-react/CloseIcon"));
|
22
|
+
|
23
|
+
var _index = require("../index");
|
24
|
+
|
25
|
+
var _RadioField = _interopRequireDefault(require("../components/RadioField"));
|
26
|
+
|
27
|
+
var _RadioGroupField = _interopRequireDefault(require("../components/RadioGroupField"));
|
28
|
+
|
29
|
+
var _react2 = require("@emotion/react");
|
30
|
+
|
31
|
+
var _default = {
|
32
|
+
title: 'Recipes/RadioButtonsWithLinks'
|
33
|
+
};
|
34
|
+
exports["default"] = _default;
|
35
|
+
|
36
|
+
var Default = function Default() {
|
37
|
+
var roles = [{
|
38
|
+
name: 'Client Application Developer'
|
39
|
+
}, {
|
40
|
+
name: 'Environment Admin',
|
41
|
+
isDisabled: true
|
42
|
+
}, {
|
43
|
+
name: 'Identity Data Admin',
|
44
|
+
isDisabled: true
|
45
|
+
}, {
|
46
|
+
name: 'Organization Admin'
|
47
|
+
}];
|
48
|
+
var titleSx = {
|
49
|
+
fontSize: 'md',
|
50
|
+
color: 'neutral.20',
|
51
|
+
fontWeight: 2
|
52
|
+
};
|
53
|
+
var subtitleSx = {
|
54
|
+
fontSize: 'md',
|
55
|
+
color: 'neutral.10'
|
56
|
+
};
|
57
|
+
|
58
|
+
var RadioFieldWithButton = function RadioFieldWithButton(_ref) {
|
59
|
+
var fieldName = _ref.fieldName,
|
60
|
+
isDisabled = _ref.isDisabled;
|
61
|
+
|
62
|
+
var _useState = (0, _react.useState)(false),
|
63
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
64
|
+
isOpen = _useState2[0],
|
65
|
+
setIsOpen = _useState2[1];
|
66
|
+
|
67
|
+
return (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Box, {
|
68
|
+
isRow: true,
|
69
|
+
alignItems: "center"
|
70
|
+
}, (0, _react2.jsx)(_RadioField["default"], {
|
71
|
+
value: fieldName,
|
72
|
+
label: fieldName,
|
73
|
+
isDisabled: isDisabled
|
74
|
+
}), (0, _react2.jsx)(_index.Button, {
|
75
|
+
variant: "text",
|
76
|
+
mb: "xs",
|
77
|
+
ml: "md",
|
78
|
+
onPress: function onPress() {
|
79
|
+
return setIsOpen(function (prev) {
|
80
|
+
return !prev;
|
81
|
+
});
|
82
|
+
},
|
83
|
+
isDisabled: isDisabled
|
84
|
+
}, "".concat(isOpen ? 'Hide' : 'Show', " Permissions"))), isOpen && (0, _react2.jsx)(PermissionsList, {
|
85
|
+
onPress: function onPress() {
|
86
|
+
return setIsOpen(false);
|
87
|
+
}
|
88
|
+
}));
|
89
|
+
};
|
90
|
+
|
91
|
+
var PermissionsList = function PermissionsList(_ref2) {
|
92
|
+
var onPress = _ref2.onPress;
|
93
|
+
return (0, _react2.jsx)(_index.Box, {
|
94
|
+
p: "md",
|
95
|
+
bg: "neutral.95"
|
96
|
+
}, (0, _react2.jsx)(_index.Box, {
|
97
|
+
isRow: true,
|
98
|
+
justifyContent: "space-between",
|
99
|
+
mb: "sm"
|
100
|
+
}, (0, _react2.jsx)(_index.Text, {
|
101
|
+
sx: {
|
102
|
+
fontWeight: 2
|
103
|
+
}
|
104
|
+
}, "Permissions"), (0, _react2.jsx)(_index.IconButton, {
|
105
|
+
onPress: onPress
|
106
|
+
}, (0, _react2.jsx)(_index.Icon, {
|
107
|
+
icon: _CloseIcon["default"]
|
108
|
+
}))), (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Text, {
|
109
|
+
sx: titleSx,
|
110
|
+
mb: "xs"
|
111
|
+
}, "Resource"), (0, _react2.jsx)(_index.Text, {
|
112
|
+
sx: subtitleSx,
|
113
|
+
mb: "sm"
|
114
|
+
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), (0, _react2.jsx)(_index.Text, {
|
115
|
+
sx: titleSx,
|
116
|
+
mb: "xs"
|
117
|
+
}, "Push Credentials"), (0, _react2.jsx)(_index.Text, {
|
118
|
+
sx: subtitleSx,
|
119
|
+
mb: "sm"
|
120
|
+
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod"), (0, _react2.jsx)(_index.Text, {
|
121
|
+
sx: titleSx,
|
122
|
+
mb: "xs"
|
123
|
+
}, "Organization"), (0, _react2.jsx)(_index.Text, {
|
124
|
+
sx: subtitleSx,
|
125
|
+
mb: "sm"
|
126
|
+
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco"), (0, _react2.jsx)(_index.Text, {
|
127
|
+
sx: titleSx,
|
128
|
+
mb: "xs"
|
129
|
+
}, "Image"), (0, _react2.jsx)(_index.Text, {
|
130
|
+
sx: subtitleSx,
|
131
|
+
mb: "sm"
|
132
|
+
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod")));
|
133
|
+
};
|
134
|
+
|
135
|
+
return (0, _react2.jsx)(_RadioGroupField["default"], null, (0, _map["default"])(roles).call(roles, function (_ref3) {
|
136
|
+
var name = _ref3.name,
|
137
|
+
isDisabled = _ref3.isDisabled;
|
138
|
+
return (0, _react2.jsx)(RadioFieldWithButton, {
|
139
|
+
fieldName: name,
|
140
|
+
isDisabled: isDisabled,
|
141
|
+
key: name
|
142
|
+
});
|
143
|
+
}));
|
144
|
+
};
|
145
|
+
|
146
|
+
exports.Default = Default;
|
package/lib/cjs/styles/theme.js
CHANGED
@@ -23,12 +23,12 @@ var accordionTitle = {
|
|
23
23
|
var accordion = {
|
24
24
|
display: 'flex',
|
25
25
|
mt: '5px',
|
26
|
-
mb: '
|
26
|
+
mb: '20px',
|
27
27
|
alignItems: 'flex-start'
|
28
28
|
};
|
29
29
|
var accordionBody = {
|
30
30
|
display: 'none !important',
|
31
|
-
|
31
|
+
pt: 'md',
|
32
32
|
width: '100%',
|
33
33
|
'.is-open &': {
|
34
34
|
display: 'flex !important'
|
@@ -37,10 +37,10 @@ var accordionBody = {
|
|
37
37
|
var accordionGridHeader = {
|
38
38
|
cursor: 'pointer',
|
39
39
|
lineHeight: '30px',
|
40
|
-
|
40
|
+
pl: 'sm',
|
41
41
|
outline: 'none',
|
42
42
|
display: 'flex',
|
43
|
-
justifyContent: '
|
43
|
+
justifyContent: 'center',
|
44
44
|
flexShrink: 0,
|
45
45
|
wordBreak: 'inherit',
|
46
46
|
whiteSpace: 'nowrap',
|
@@ -54,12 +54,9 @@ var accordionGridHeader = {
|
|
54
54
|
WebkitBoxShadow: 'focus',
|
55
55
|
MozBoxShadow: 'focus'
|
56
56
|
},
|
57
|
-
|
57
|
+
minHeight: '64px',
|
58
58
|
'&.is-hovered': {
|
59
|
-
|
60
|
-
'& div > div > div > span': {
|
61
|
-
color: 'active'
|
62
|
-
}
|
59
|
+
backgroundColor: 'accent.99'
|
63
60
|
},
|
64
61
|
'&.is-pressed': {
|
65
62
|
color: 'accent.20',
|
@@ -70,6 +67,7 @@ var accordionGridHeader = {
|
|
70
67
|
};
|
71
68
|
var accordionGridBody = {
|
72
69
|
display: 'none !important',
|
70
|
+
pl: 'sm',
|
73
71
|
width: '100%',
|
74
72
|
'&.is-selected': {
|
75
73
|
display: 'flex !important'
|
@@ -8,7 +8,7 @@ _Object$defineProperty2(exports, "__esModule", {
|
|
8
8
|
value: true
|
9
9
|
});
|
10
10
|
|
11
|
-
exports["default"] = void 0;
|
11
|
+
exports["default"] = exports.chip = void 0;
|
12
12
|
|
13
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/define-property"));
|
14
14
|
|
@@ -37,20 +37,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
37
37
|
var base = {
|
38
38
|
display: 'flex'
|
39
39
|
};
|
40
|
-
var panel = {
|
41
|
-
outline: 'none',
|
42
|
-
position: 'relative',
|
43
|
-
bg: 'white',
|
44
|
-
borderLeft: 'separator',
|
45
|
-
transition: 'margin 0.25s ease-in',
|
46
|
-
visibility: 'hidden',
|
47
|
-
'&.is-focused': {
|
48
|
-
boxShadow: 'focus'
|
49
|
-
},
|
50
|
-
'&.is-visible': {
|
51
|
-
visibility: 'visible'
|
52
|
-
}
|
53
|
-
};
|
54
40
|
var card = {
|
55
41
|
boxShadow: 'standard',
|
56
42
|
p: 'lg',
|
@@ -106,6 +92,10 @@ var listViewItem = _objectSpread(_objectSpread({}, base), {}, {
|
|
106
92
|
},
|
107
93
|
'&.is-focused': {
|
108
94
|
boxShadow: 'inset 0 0 5px #5873bdbf'
|
95
|
+
},
|
96
|
+
'&.has-separator': {
|
97
|
+
borderBottom: '1px solid',
|
98
|
+
borderBottomColor: 'line.hairline'
|
109
99
|
}
|
110
100
|
});
|
111
101
|
|
@@ -119,15 +109,29 @@ var listBoxSectionTitle = {
|
|
119
109
|
};
|
120
110
|
var chip = {
|
121
111
|
cursor: 'pointer',
|
122
|
-
|
123
|
-
p: '10px',
|
112
|
+
p: '3px 5px 4px 5px',
|
124
113
|
alignItems: 'center',
|
125
114
|
justifyContent: 'center',
|
126
115
|
minWidth: '50px',
|
127
116
|
alignSelf: 'flex-start',
|
128
117
|
display: 'inline-flex !important',
|
129
|
-
borderRadius: '5px'
|
118
|
+
borderRadius: '5px',
|
119
|
+
fontWeight: 1,
|
120
|
+
'& button': {
|
121
|
+
backgroundColor: 'transparent',
|
122
|
+
marginLeft: 'xs',
|
123
|
+
marginTop: '1px',
|
124
|
+
padding: '0',
|
125
|
+
'&.is-hovered': {
|
126
|
+
backgroundColor: 'white'
|
127
|
+
},
|
128
|
+
'& .mdi-icon': {
|
129
|
+
marginLeft: '0',
|
130
|
+
padding: '2px'
|
131
|
+
}
|
132
|
+
}
|
130
133
|
};
|
134
|
+
exports.chip = chip;
|
131
135
|
var inputInContainerSlot = {
|
132
136
|
position: 'absolute',
|
133
137
|
bg: 'transparent',
|
@@ -284,7 +288,6 @@ var _default = {
|
|
284
288
|
listItem: listItem,
|
285
289
|
listBoxSectionTitle: listBoxSectionTitle,
|
286
290
|
listViewItem: listViewItem,
|
287
|
-
panel: panel,
|
288
291
|
radioCheckedContent: radioCheckedContent,
|
289
292
|
radioContainer: radioContainer,
|
290
293
|
scrollbox: scrollbox,
|
@@ -32,6 +32,8 @@ var _text = require("./text");
|
|
32
32
|
|
33
33
|
var _colors = require("../colors");
|
34
34
|
|
35
|
+
var _boxes = require("./boxes");
|
36
|
+
|
35
37
|
function ownKeys(object, enumerableOnly) { var keys = (0, _keys["default"])(object); if (_getOwnPropertySymbols["default"]) { var symbols = (0, _getOwnPropertySymbols["default"])(object); if (enumerableOnly) symbols = (0, _filter["default"])(symbols).call(symbols, function (sym) { return (0, _getOwnPropertyDescriptor["default"])(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
36
38
|
|
37
39
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; (0, _forEach["default"])(_context = ownKeys(Object(source), true)).call(_context, function (key) { (0, _defineProperty3["default"])(target, key, source[key]); }); } else if (_getOwnPropertyDescriptors["default"]) { (0, _defineProperties["default"])(target, (0, _getOwnPropertyDescriptors["default"])(source)); } else { var _context2; (0, _forEach["default"])(_context2 = ownKeys(Object(source))).call(_context2, function (key) { (0, _defineProperty2["default"])(target, key, (0, _getOwnPropertyDescriptor["default"])(source, key)); }); } } return target; }
|
@@ -179,32 +181,7 @@ var accordionHeader = _objectSpread(_objectSpread({}, base), {}, {
|
|
179
181
|
color: 'accent.20'
|
180
182
|
},
|
181
183
|
'&.is-focused': _objectSpread({}, defaultFocus)
|
182
|
-
});
|
183
|
-
|
184
|
-
|
185
|
-
var icon = {
|
186
|
-
p: '3px',
|
187
|
-
alignSelf: 'flex-start',
|
188
|
-
flexGrow: 0,
|
189
|
-
borderRadius: '100%',
|
190
|
-
cursor: 'pointer',
|
191
|
-
bg: 'transparent',
|
192
|
-
'path': {
|
193
|
-
fill: 'text.secondary'
|
194
|
-
},
|
195
|
-
outline: 'none',
|
196
|
-
color: 'white',
|
197
|
-
'&.is-hovered': {
|
198
|
-
bg: 'accent.90'
|
199
|
-
},
|
200
|
-
'&.is-pressed': {
|
201
|
-
'path': {
|
202
|
-
fill: 'white'
|
203
|
-
},
|
204
|
-
bg: 'active'
|
205
|
-
},
|
206
|
-
'&.is-focused': _objectSpread({}, defaultFocus)
|
207
|
-
};
|
184
|
+
});
|
208
185
|
|
209
186
|
var primary = _objectSpread(_objectSpread({}, base), {}, {
|
210
187
|
display: 'inline-flex',
|
@@ -330,7 +307,7 @@ var inline = _objectSpread(_objectSpread({}, base), {}, {
|
|
330
307
|
bg: 'white',
|
331
308
|
height: '22px',
|
332
309
|
lineHeight: 1,
|
333
|
-
fontSize: '
|
310
|
+
fontSize: 'sm',
|
334
311
|
borderRadius: '15px',
|
335
312
|
border: '1px solid',
|
336
313
|
borderColor: 'active',
|
@@ -492,6 +469,36 @@ var fileInputField = {
|
|
492
469
|
boxShadow: 'focus'
|
493
470
|
}
|
494
471
|
};
|
472
|
+
|
473
|
+
var tooltipChip = _objectSpread(_objectSpread({}, _boxes.chip), {}, {
|
474
|
+
cursor: 'default',
|
475
|
+
'&.is-hovered, &.is-pressed': {
|
476
|
+
cursor: 'default',
|
477
|
+
outline: 'none'
|
478
|
+
}
|
479
|
+
});
|
480
|
+
|
481
|
+
var tooltipIconButton = _objectSpread(_objectSpread({}, iconButton), {}, {
|
482
|
+
cursor: 'default',
|
483
|
+
'&.is-hovered, &.is-pressed': {
|
484
|
+
backgroundColor: 'inherit',
|
485
|
+
cursor: 'default',
|
486
|
+
path: {
|
487
|
+
fill: 'neutral.20'
|
488
|
+
}
|
489
|
+
}
|
490
|
+
});
|
491
|
+
|
492
|
+
var tooltipInline = _objectSpread(_objectSpread({}, text), {}, {
|
493
|
+
cursor: 'default',
|
494
|
+
alignSelf: 'flex-start',
|
495
|
+
'&.is-hovered, &.is-pressed': {
|
496
|
+
backgroundColor: 'inherit',
|
497
|
+
cursor: 'default',
|
498
|
+
textDecoration: 'inherit'
|
499
|
+
}
|
500
|
+
});
|
501
|
+
|
495
502
|
var _default = {
|
496
503
|
accordionHeader: accordionHeader,
|
497
504
|
chipDeleteButton: chipDeleteButton,
|
@@ -512,7 +519,6 @@ var _default = {
|
|
512
519
|
expandableRow: expandableRow,
|
513
520
|
fileInputField: fileInputField,
|
514
521
|
iconButton: iconButton,
|
515
|
-
icon: icon,
|
516
522
|
imageUpload: imageUpload,
|
517
523
|
inline: inline,
|
518
524
|
inverted: inverted,
|
@@ -525,6 +531,9 @@ var _default = {
|
|
525
531
|
helpHint: helpHint,
|
526
532
|
modalCloseButton: modalCloseButton,
|
527
533
|
applicationPortalPinned: applicationPortalPinned,
|
528
|
-
applicationPortal: applicationPortal
|
534
|
+
applicationPortal: applicationPortal,
|
535
|
+
tooltipChip: tooltipChip,
|
536
|
+
tooltipIconButton: tooltipIconButton,
|
537
|
+
tooltipInline: tooltipInline
|
529
538
|
};
|
530
539
|
exports["default"] = _default;
|
@@ -54,8 +54,6 @@ var _messages = _interopRequireDefault(require("./messages"));
|
|
54
54
|
|
55
55
|
var _numberField = _interopRequireDefault(require("./numberField"));
|
56
56
|
|
57
|
-
var _popover = _interopRequireDefault(require("./popover"));
|
58
|
-
|
59
57
|
var _overlayPanel = _interopRequireDefault(require("./overlayPanel"));
|
60
58
|
|
61
59
|
var _popoverMenu = _interopRequireDefault(require("./popoverMenu"));
|
@@ -90,7 +88,6 @@ var _default = _objectSpread(_objectSpread({
|
|
90
88
|
modal: _modal["default"],
|
91
89
|
numberField: _numberField["default"],
|
92
90
|
overlayPanel: _overlayPanel["default"],
|
93
|
-
popover: _popover["default"],
|
94
91
|
popoverMenu: _popoverMenu["default"],
|
95
92
|
rockerbutton: _rockerbutton["default"],
|
96
93
|
separator: _separator["default"],
|
@@ -83,8 +83,6 @@ export var Default = function Default() {
|
|
83
83
|
return ___EmotionJSX(Box, {
|
84
84
|
isRow: true,
|
85
85
|
sx: {
|
86
|
-
pt: '12px',
|
87
|
-
pb: '12px',
|
88
86
|
flexGrow: 1
|
89
87
|
}
|
90
88
|
}, ___EmotionJSX(Box, {
|
@@ -129,20 +127,14 @@ export var Default = function Default() {
|
|
129
127
|
sx: {
|
130
128
|
mr: '4px',
|
131
129
|
height: '26px',
|
132
|
-
width: '26px'
|
133
|
-
'path': {
|
134
|
-
fill: 'active'
|
135
|
-
}
|
130
|
+
width: '26px'
|
136
131
|
}
|
137
132
|
}, ___EmotionJSX(CreateIcon, null)), ___EmotionJSX(IconButton, {
|
138
133
|
"aria-label": "vertical-lines-icon",
|
139
134
|
sx: {
|
140
135
|
mr: '4px',
|
141
136
|
height: '26px',
|
142
|
-
width: '26px'
|
143
|
-
'path': {
|
144
|
-
fill: 'active'
|
145
|
-
}
|
137
|
+
width: '26px'
|
146
138
|
}
|
147
139
|
}, ___EmotionJSX(MoreVertIcon, null)))));
|
148
140
|
};
|
@@ -285,7 +277,8 @@ export var Default = function Default() {
|
|
285
277
|
item: item
|
286
278
|
}), item.key !== 'Organization' ? ___EmotionJSX(Separator, {
|
287
279
|
sx: {
|
288
|
-
m: 0
|
280
|
+
m: 0,
|
281
|
+
bg: 'neutral.90'
|
289
282
|
}
|
290
283
|
}) : null);
|
291
284
|
}))
|
@@ -80,7 +80,9 @@ var AccordionItem = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
80
80
|
"aria-label": ariaLabel || 'Accordion',
|
81
81
|
ref: buttonRef,
|
82
82
|
sx: {
|
83
|
-
display: 'flex'
|
83
|
+
display: 'flex',
|
84
|
+
px: '0',
|
85
|
+
height: 'unset'
|
84
86
|
},
|
85
87
|
variant: "accordionHeader",
|
86
88
|
className: buttonClasses
|
@@ -14,17 +14,15 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (
|
|
14
14
|
|
15
15
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty(_context = ownKeys(Object(source), true)).call(_context, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { var _context2; _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
16
16
|
|
17
|
-
import React, { forwardRef, useRef, useImperativeHandle
|
17
|
+
import React, { forwardRef, useRef, useImperativeHandle } from 'react';
|
18
18
|
import PropTypes from 'prop-types';
|
19
19
|
import { Button as ThemeUIButton } from 'theme-ui';
|
20
20
|
import { useButton } from '@react-aria/button';
|
21
21
|
import { useHover } from '@react-aria/interactions';
|
22
22
|
import { useFocusRing } from '@react-aria/focus';
|
23
23
|
import { mergeProps } from '@react-aria/utils';
|
24
|
-
import {
|
25
|
-
import { useAriaLabelWarning, useStatusClasses, useDeprecationWarning, usePropWarning } from '../../hooks';
|
24
|
+
import { useAriaLabelWarning, useStatusClasses, usePropWarning } from '../../hooks';
|
26
25
|
import Loader from '../Loader';
|
27
|
-
import Box from '../Box';
|
28
26
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
29
27
|
var Button = /*#__PURE__*/forwardRef(function (props, ref) {
|
30
28
|
var className = props.className,
|
@@ -39,8 +37,7 @@ var Button = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
39
37
|
onPressChange = props.onPressChange,
|
40
38
|
onPressUp = props.onPressUp,
|
41
39
|
children = props.children,
|
42
|
-
|
43
|
-
others = _objectWithoutProperties(props, ["className", "isDisabled", "isLoading", "onHoverStart", "onHoverChange", "onHoverEnd", "onPress", "onPressStart", "onPressEnd", "onPressChange", "onPressUp", "children", "mode"]);
|
40
|
+
others = _objectWithoutProperties(props, ["className", "isDisabled", "isLoading", "onHoverStart", "onHoverChange", "onHoverEnd", "onPress", "onPressStart", "onPressEnd", "onPressChange", "onPressUp", "children"]);
|
44
41
|
|
45
42
|
var buttonRef = useRef();
|
46
43
|
usePropWarning(props, 'disabled', 'isDisabled');
|
@@ -49,20 +46,13 @@ var Button = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
49
46
|
useImperativeHandle(ref, function () {
|
50
47
|
return buttonRef.current;
|
51
48
|
});
|
52
|
-
var ButtonBase = useMemo(function () {
|
53
|
-
return mode === modes.ICON ? Box : ThemeUIButton;
|
54
|
-
}, [mode]);
|
55
|
-
var elementType = useMemo(function () {
|
56
|
-
if (mode === modes.ICON) return 'div';
|
57
|
-
return 'button';
|
58
|
-
}, [mode]);
|
59
49
|
|
60
50
|
var _useFocusRing = useFocusRing(),
|
61
51
|
isFocusVisible = _useFocusRing.isFocusVisible,
|
62
52
|
focusProps = _useFocusRing.focusProps;
|
63
53
|
|
64
54
|
var _useButton = useButton(_objectSpread({
|
65
|
-
elementType:
|
55
|
+
elementType: 'button'
|
66
56
|
}, props), buttonRef),
|
67
57
|
buttonProps = _useButton.buttonProps,
|
68
58
|
isPressed = _useButton.isPressed;
|
@@ -79,12 +69,9 @@ var Button = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
79
69
|
}),
|
80
70
|
classNames = _useStatusClasses.classNames;
|
81
71
|
|
82
|
-
useDeprecationWarning('The "icon" variant for `Button` will be deprecated in Astro-UI 1.0.0, use the `IconButton` component instead.', {
|
83
|
-
isActive: props.variant === 'icon'
|
84
|
-
});
|
85
72
|
var ariaLabel = props['aria-label'];
|
86
73
|
useAriaLabelWarning('Button', ariaLabel);
|
87
|
-
return ___EmotionJSX(
|
74
|
+
return ___EmotionJSX(ThemeUIButton, _extends({
|
88
75
|
"aria-label": ariaLabel || 'Button',
|
89
76
|
ref: buttonRef,
|
90
77
|
className: classNames,
|
@@ -167,15 +154,11 @@ Button.propTypes = {
|
|
167
154
|
onPressUp: PropTypes.func,
|
168
155
|
|
169
156
|
/** The styling variation of the button. */
|
170
|
-
variant: PropTypes.string
|
171
|
-
|
172
|
-
/** The behavioral pattern to apply to the button. */
|
173
|
-
mode: PropTypes.oneOf(['default', 'icon'])
|
157
|
+
variant: PropTypes.string
|
174
158
|
};
|
175
159
|
Button.defaultProps = {
|
176
160
|
isDisabled: false,
|
177
|
-
variant: 'default'
|
178
|
-
mode: 'default'
|
161
|
+
variant: 'default'
|
179
162
|
};
|
180
163
|
Button.displayName = 'Button';
|
181
164
|
export default Button;
|
@@ -1,8 +1,3 @@
|
|
1
|
-
import _findInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find";
|
2
|
-
import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values";
|
3
|
-
|
4
|
-
var _context;
|
5
|
-
|
6
1
|
import React from 'react';
|
7
2
|
import AddCircleIcon from 'mdi-react/AddCircleIcon';
|
8
3
|
import Box from '../Box';
|
@@ -15,7 +10,9 @@ import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
15
10
|
var variants = buttonVariants;
|
16
11
|
delete variants.ICON;
|
17
12
|
delete variants.ICON_BUTTON;
|
18
|
-
delete variants.INVERTED;
|
13
|
+
delete variants.INVERTED; // add designer approved variants for devs to use here
|
14
|
+
|
15
|
+
var variantOptions = ['critical', 'danger', 'default', 'inline', 'link', 'primary', 'success', 'text'];
|
19
16
|
export default {
|
20
17
|
title: 'Button',
|
21
18
|
component: Button,
|
@@ -23,11 +20,9 @@ export default {
|
|
23
20
|
variant: {
|
24
21
|
control: {
|
25
22
|
type: 'select',
|
26
|
-
options:
|
23
|
+
options: variantOptions
|
27
24
|
},
|
28
|
-
defaultValue:
|
29
|
-
return value === 'default';
|
30
|
-
})
|
25
|
+
defaultValue: 'default'
|
31
26
|
},
|
32
27
|
children: {
|
33
28
|
description: 'Button text.',
|