@jobber/components 2.86.3-pre.9 → 2.88.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 +11 -0
- package/MultiSelect.d.ts +1 -0
- package/MultiSelect.js +17 -0
- package/dist/Autocomplete/index.js +7 -7
- package/dist/Banner/index.js +5 -5
- package/dist/Button/index.js +2 -2
- package/dist/Button-5b2f1636.js +60 -0
- package/dist/ButtonDismiss/index.js +3 -3
- package/dist/{ButtonDismiss-e7bcefbd.js → ButtonDismiss-4cde8f7c.js} +1 -1
- package/dist/Card/index.js +2 -2
- package/dist/{Card-45037587.js → Card-368e01a3.js} +1 -1
- package/dist/Checkbox/Checkbox.d.ts +2 -1
- package/dist/Checkbox/index.js +8 -38
- package/dist/Checkbox-785a79a5.js +42 -0
- package/dist/Chips/index.js +5 -5
- package/dist/ConfirmationModal/index.js +9 -9
- package/dist/{ConfirmationModal-ccef9b30.js → ConfirmationModal-b7ef110f.js} +2 -2
- package/dist/DataDump/index.js +3 -3
- package/dist/DataTable/index.js +6 -6
- package/dist/DatePicker/index.js +3 -3
- package/dist/{DatePicker-5286c461.js → DatePicker-ad6f8630.js} +2 -2
- package/dist/DescriptionList/index.js +3 -3
- package/dist/Disclosure/index.js +2 -2
- package/dist/Drawer/index.js +3 -3
- package/dist/Emphasis/index.js +2 -2
- package/dist/{Emphasis-bab99882.js → Emphasis-fd845639.js} +1 -1
- package/dist/FeatureSwitch/index.js +7 -7
- package/dist/FormField/index.js +5 -5
- package/dist/{FormField-05b0b30b.js → FormField-a92c7bac.js} +3 -3
- package/dist/FormatFile/index.js +10 -10
- package/dist/{FormatFile-bd1cc3e1.js → FormatFile-5391d4cf.js} +4 -4
- package/dist/Gallery/index.js +10 -10
- package/dist/Heading/index.js +2 -2
- package/dist/{Heading-adeda503.js → Heading-56750113.js} +1 -1
- package/dist/InlineLabel/index.js +1 -1
- package/dist/InputAvatar/index.js +3 -3
- package/dist/InputDate/index.js +6 -6
- package/dist/InputEmail/index.js +5 -5
- package/dist/InputFile/index.js +3 -3
- package/dist/{InputFile-bb2848b9.js → InputFile-b5cf90c3.js} +3 -3
- package/dist/InputNumber/index.js +5 -5
- package/dist/InputPassword/index.js +5 -5
- package/dist/InputText/index.js +6 -6
- package/dist/{InputText-f2607ff5.js → InputText-cb3be15c.js} +1 -1
- package/dist/InputTime/index.js +5 -5
- package/dist/InputValidation/index.js +3 -3
- package/dist/{InputValidation-c7f91798.js → InputValidation-24d3621a.js} +1 -1
- package/dist/List/index.js +5 -5
- package/dist/Markdown/index.js +5 -5
- package/dist/{Markdown-a532e42a.js → Markdown-69986c49.js} +3 -3
- package/dist/Menu/index.js +3 -3
- package/dist/{Menu-90b96506.js → Menu-6a392af6.js} +4 -4
- package/dist/Modal/index.js +4 -4
- package/dist/{Modal-28bf985d.js → Modal-aaaaf2df.js} +3 -3
- package/dist/MultiSelect/DropDownMenu.d.ts +15 -0
- package/dist/MultiSelect/MultiSelect.d.ts +22 -0
- package/dist/MultiSelect/index.d.ts +1 -0
- package/dist/MultiSelect/index.js +197 -0
- package/dist/MultiSelect/types.d.ts +13 -0
- package/dist/MultiSelect/utils.d.ts +3 -0
- package/dist/{Option-076ef1e3.js → Option-201e55a7.js} +1 -1
- package/dist/Page/index.js +7 -7
- package/dist/Popover/index.js +3 -3
- package/dist/RadioGroup/index.js +2 -2
- package/dist/Select/index.js +6 -6
- package/dist/StatusLabel/index.js +2 -2
- package/dist/Switch/index.js +2 -2
- package/dist/{Switch-fd6f2195.js → Switch-d2bec677.js} +1 -1
- package/dist/Tabs/index.js +1 -1
- package/dist/Text/index.js +2 -2
- package/dist/{Text-3bf41a36.js → Text-9bc093e9.js} +1 -1
- package/dist/Toast/index.js +2 -2
- package/dist/Tooltip/index.js +3 -3
- package/dist/{Tooltip-4fcd28d3.js → Tooltip-4396164d.js} +1 -1
- package/dist/Typography/index.js +1 -1
- package/dist/{Typography-b9663407.js → Typography-7e542a72.js} +1 -1
- package/package.json +3 -3
- package/dist/Button-739af4d8.js +0 -60
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, { Dispatch } from "react";
|
|
2
|
+
import { Options } from "./types";
|
|
3
|
+
interface MultiSelectProps {
|
|
4
|
+
/**
|
|
5
|
+
* The label to be displayed by default when no options are selected
|
|
6
|
+
*/
|
|
7
|
+
readonly defaultLabel: string;
|
|
8
|
+
/**
|
|
9
|
+
* The label to be displayed when all options are selected
|
|
10
|
+
*/
|
|
11
|
+
readonly allSelectedLabel: string;
|
|
12
|
+
/**
|
|
13
|
+
* List of options to be checked
|
|
14
|
+
*/
|
|
15
|
+
readonly options: Options;
|
|
16
|
+
/**
|
|
17
|
+
* Change handler
|
|
18
|
+
*/
|
|
19
|
+
onOptionsChange: Dispatch<React.SetStateAction<Options>>;
|
|
20
|
+
}
|
|
21
|
+
export declare function MultiSelect({ defaultLabel, allSelectedLabel, options, onOptionsChange, }: MultiSelectProps): JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MultiSelect } from "./MultiSelect";
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib_es6 = require('../tslib.es6-5b50eb8e.js');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var classnames = require('classnames');
|
|
8
|
+
var hooks = require('@jobber/hooks');
|
|
9
|
+
var styleInject_es = require('../style-inject.es-dcee06b6.js');
|
|
10
|
+
var Checkbox = require('../Checkbox-785a79a5.js');
|
|
11
|
+
var Text = require('../Text-9bc093e9.js');
|
|
12
|
+
var Icon = require('../Icon-d5ad1a6d.js');
|
|
13
|
+
require('../Typography-7e542a72.js');
|
|
14
|
+
require('@jobber/design');
|
|
15
|
+
|
|
16
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
|
+
|
|
18
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
19
|
+
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
20
|
+
|
|
21
|
+
var css$1 = "._5SXg5kHN1rObHmXNp_iaJ {\n position: relative;\n width: 100%;\n}\n\n._3DcjSBXtI1-sptltr_DPIh {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-direction: row;\n flex-direction: row;\n -ms-flex-pack: justify;\n justify-content: space-between;\n -ms-flex-align: center;\n align-items: center;\n padding-top: calc(var(--space-base) - var(--space-smallest));\n padding-bottom: calc(var(--space-base) - var(--space-smallest));\n padding-left: var(--space-base);\n padding-right: var(--space-base);\n border: var(--border-base) solid var(--color-border);\n border-radius: var(--radius-base);\n}\n\n._3DcjSBXtI1-sptltr_DPIh p {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n._5SXg5kHN1rObHmXNp_iaJ:hover,\n._5SXg5kHN1rObHmXNp_iaJ._3DcjSBXtI1-sptltr_DPIh {\n cursor: pointer;\n caret-color: transparent;\n}\n\n._3DcjSBXtI1-sptltr_DPIh:focus,\n._3DcjSBXtI1-sptltr_DPIh.y1fw0Iy-QRJk5kSWc6TU {\n box-shadow: var(--shadow-focus);\n outline: none;\n}\n";
|
|
22
|
+
var styles$1 = {"multiSelectContainer":"_5SXg5kHN1rObHmXNp_iaJ","multiSelect":"_3DcjSBXtI1-sptltr_DPIh","active":"y1fw0Iy-QRJk5kSWc6TU"};
|
|
23
|
+
styleInject_es.styleInject(css$1);
|
|
24
|
+
|
|
25
|
+
var css = "._3fnWzTcXADLV1Cck8AvQXx {\n display: -ms-flexbox;\n display: flex;\n position: absolute;\n z-index: var(--elevation-menu);\n width: 100%;\n max-height: calc(var(--space-extravagant) * 5);\n box-shadow: var(--shadow-base);\n margin: 0;\n padding: 0;\n border: var(--border-base) solid var(--color-border);\n border-radius: var(--radius-large);\n overflow: auto;\n background-color: var(--color-surface);\n -ms-flex-direction: column;\n flex-direction: column;\n scroll-behavior: smooth;\n}\n\n._3fnWzTcXADLV1Cck8AvQXx li {\n list-style: none;\n}\n\n._1ujGx9WtIEWz5g_6vsrhJM {\n display: -ms-flexbox;\n display: flex;\n width: 100%;\n padding: var(--space-small) var(--space-base);\n cursor: pointer;\n transition: all var(--timing-base);\n}\n\n._1ujGx9WtIEWz5g_6vsrhJM:focus,\n._1ujGx9WtIEWz5g_6vsrhJM._3X26eN0ET6mLwNPXpC98so {\n background-color: var(--color-surface--hover);\n outline-color: var(--color-focus);\n}\n";
|
|
26
|
+
var styles = {"dropDownMenuContainer":"_3fnWzTcXADLV1Cck8AvQXx","option":"_1ujGx9WtIEWz5g_6vsrhJM","active":"_3X26eN0ET6mLwNPXpC98so"};
|
|
27
|
+
styleInject_es.styleInject(css);
|
|
28
|
+
|
|
29
|
+
function handleKeyboardShortcut(setupKeyListeners) {
|
|
30
|
+
function callback(event) {
|
|
31
|
+
var metaKey = event.metaKey, ctrlKey = event.ctrlKey, key = event.key, target = event.target;
|
|
32
|
+
var shouldTriggerShortcut = target instanceof HTMLButtonElement ? metaKey || ctrlKey : true;
|
|
33
|
+
if (!shouldTriggerShortcut)
|
|
34
|
+
return;
|
|
35
|
+
event.preventDefault();
|
|
36
|
+
event.stopPropagation();
|
|
37
|
+
setupKeyListeners(key);
|
|
38
|
+
}
|
|
39
|
+
return { callback: callback };
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function DropDownMenu(_a) {
|
|
43
|
+
var options = _a.options, setOptions = _a.setOptions;
|
|
44
|
+
var _b = tslib_es6.__read(React.useState(0), 2), highlightedIndex = _b[0], setHighlightedIndex = _b[1];
|
|
45
|
+
var menuDiv = React.useRef();
|
|
46
|
+
var handleOptionClick = React.useCallback(function (clickedOption) {
|
|
47
|
+
setOptions(function (current) {
|
|
48
|
+
return current.map(function (option) {
|
|
49
|
+
if (option.label == clickedOption.label) {
|
|
50
|
+
return tslib_es6.__assign(tslib_es6.__assign({}, option), { checked: !clickedOption.checked });
|
|
51
|
+
}
|
|
52
|
+
return option;
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
}, []);
|
|
56
|
+
function handleOptionHover(event, index) {
|
|
57
|
+
event.preventDefault();
|
|
58
|
+
setHighlightedIndex(index);
|
|
59
|
+
}
|
|
60
|
+
function handleOptionFocus(index) {
|
|
61
|
+
setHighlightedIndex(index);
|
|
62
|
+
if (menuDiv.current) {
|
|
63
|
+
var option = menuDiv.current.children[index].querySelector("input");
|
|
64
|
+
option === null || option === void 0 ? void 0 : option.focus();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function scrollMenuIfItemNotInView(menuDivElement, direction) {
|
|
68
|
+
var itemDiv = menuDivElement.querySelector(":nth-child(" + (highlightedIndex + 1) + ")");
|
|
69
|
+
if (!itemDiv)
|
|
70
|
+
return;
|
|
71
|
+
var menuTop = menuDivElement.getBoundingClientRect().top;
|
|
72
|
+
var _a = itemDiv.getBoundingClientRect(), itemTop = _a.top, itemHeight = _a.height, itemBottom = _a.bottom;
|
|
73
|
+
var itemTrueBottom = itemBottom + itemHeight;
|
|
74
|
+
var menuBottom = menuDivElement.getBoundingClientRect().bottom;
|
|
75
|
+
if (direction == "up" && itemTop - itemHeight < menuTop) {
|
|
76
|
+
menuDivElement.scrollTop -= itemHeight;
|
|
77
|
+
}
|
|
78
|
+
else if (direction == "down" && itemTrueBottom > menuBottom) {
|
|
79
|
+
menuDivElement.scrollTop += itemHeight;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function setupKeyListeners(key) {
|
|
83
|
+
switch (key) {
|
|
84
|
+
case "Enter":
|
|
85
|
+
case " ": {
|
|
86
|
+
if (highlightedIndex >= 0) {
|
|
87
|
+
handleOptionClick(options[highlightedIndex]);
|
|
88
|
+
}
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
case "ArrowDown": {
|
|
92
|
+
var newIndex = Math.min(options.length - 1, highlightedIndex + 1);
|
|
93
|
+
handleOptionFocus(newIndex);
|
|
94
|
+
scrollMenuIfItemNotInView(menuDiv.current, "down");
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
case "ArrowUp": {
|
|
98
|
+
var newIndex = Math.max(0, highlightedIndex - 1);
|
|
99
|
+
handleOptionFocus(newIndex);
|
|
100
|
+
scrollMenuIfItemNotInView(menuDiv.current, "up");
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
hooks.useOnKeyDown(handleKeyboardShortcut(setupKeyListeners).callback, [
|
|
106
|
+
"Enter",
|
|
107
|
+
" ",
|
|
108
|
+
"ArrowDown",
|
|
109
|
+
"ArrowUp",
|
|
110
|
+
]);
|
|
111
|
+
React.useEffect(function () {
|
|
112
|
+
// focus first option
|
|
113
|
+
handleOptionFocus(0);
|
|
114
|
+
}, [menuDiv]);
|
|
115
|
+
return (React__default["default"].createElement("ul", { "data-testid": "dropdown-menu", className: styles.dropDownMenuContainer, ref: menuDiv }, options.map(function (option, index) {
|
|
116
|
+
var _a;
|
|
117
|
+
var optionClass = classnames__default["default"](styles.option, (_a = {},
|
|
118
|
+
_a[styles.active] = index === highlightedIndex,
|
|
119
|
+
_a));
|
|
120
|
+
return (React__default["default"].createElement("li", { key: index + "-" + option.label, className: optionClass, onClick: function (event) {
|
|
121
|
+
event.stopPropagation();
|
|
122
|
+
event.preventDefault();
|
|
123
|
+
handleOptionClick(option);
|
|
124
|
+
}, onMouseOver: function (e) { return handleOptionHover(e, index); } },
|
|
125
|
+
React__default["default"].createElement(Checkbox.Checkbox, { label: option.label, checked: option.checked, onFocus: function () { return setHighlightedIndex(index); } })));
|
|
126
|
+
})));
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// eslint-disable-next-line max-statements
|
|
130
|
+
function MultiSelect(_a) {
|
|
131
|
+
var _b;
|
|
132
|
+
var defaultLabel = _a.defaultLabel, allSelectedLabel = _a.allSelectedLabel, options = _a.options, onOptionsChange = _a.onOptionsChange;
|
|
133
|
+
var _c = tslib_es6.__read(React.useState(defaultLabel), 2), label = _c[0], setLabel = _c[1];
|
|
134
|
+
var _d = tslib_es6.__read(React.useState(false), 2), menuVisible = _d[0], setMenuVisible = _d[1];
|
|
135
|
+
var _e = tslib_es6.__read(React.useState(false), 2), focused = _e[0], setFocused = _e[1];
|
|
136
|
+
var multiSelectContainer = React.useRef();
|
|
137
|
+
var multiSelectRef = React.useRef();
|
|
138
|
+
var multiSelectClass = classnames__default["default"](styles$1.multiSelect, (_b = {},
|
|
139
|
+
_b[styles$1.active] = menuVisible,
|
|
140
|
+
_b));
|
|
141
|
+
function handleMenuVisibility() {
|
|
142
|
+
multiSelectRef.current.focus();
|
|
143
|
+
setMenuVisible(!menuVisible);
|
|
144
|
+
}
|
|
145
|
+
var handleClickOutside = function (e) {
|
|
146
|
+
var _a;
|
|
147
|
+
if (!((_a = multiSelectContainer === null || multiSelectContainer === void 0 ? void 0 : multiSelectContainer.current) === null || _a === void 0 ? void 0 : _a.contains(e.target))) {
|
|
148
|
+
setMenuVisible(false);
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
function setupKeyListeners(key) {
|
|
152
|
+
switch (key) {
|
|
153
|
+
case "Enter":
|
|
154
|
+
case " ": {
|
|
155
|
+
if (focused) {
|
|
156
|
+
setMenuVisible(!menuVisible);
|
|
157
|
+
}
|
|
158
|
+
break;
|
|
159
|
+
}
|
|
160
|
+
case "Escape": {
|
|
161
|
+
multiSelectRef.current.focus();
|
|
162
|
+
setMenuVisible(false);
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
hooks.useOnKeyDown(handleKeyboardShortcut(setupKeyListeners).callback, [
|
|
168
|
+
"Enter",
|
|
169
|
+
" ",
|
|
170
|
+
"Escape",
|
|
171
|
+
]);
|
|
172
|
+
React.useEffect(function () {
|
|
173
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
174
|
+
return function () { return document.removeEventListener("mousedown", handleClickOutside); };
|
|
175
|
+
});
|
|
176
|
+
React.useEffect(function () {
|
|
177
|
+
var selected = options.filter(function (option) { return option.checked; });
|
|
178
|
+
if (selected.length === 0) {
|
|
179
|
+
setLabel(defaultLabel);
|
|
180
|
+
}
|
|
181
|
+
else if (selected.length == options.length) {
|
|
182
|
+
setLabel(allSelectedLabel);
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
var selectedLabels_1 = [];
|
|
186
|
+
selected.forEach(function (option) { return selectedLabels_1.push(option.label); });
|
|
187
|
+
setLabel(selectedLabels_1.join(", "));
|
|
188
|
+
}
|
|
189
|
+
}, [options]);
|
|
190
|
+
return (React__default["default"].createElement("div", { ref: multiSelectContainer, className: styles$1.multiSelectContainer },
|
|
191
|
+
React__default["default"].createElement("div", { "data-testid": "multi-select", className: multiSelectClass, onClick: handleMenuVisibility, onFocus: function () { return setFocused(true); }, onBlur: function () { return setFocused(false); }, tabIndex: 0, ref: multiSelectRef, role: "button", "aria-label": defaultLabel + ": " + label, "aria-multiselectable": true, "aria-haspopup": true },
|
|
192
|
+
React__default["default"].createElement(Text.Text, null, label),
|
|
193
|
+
React__default["default"].createElement(Icon.Icon, { name: "arrowDown" })),
|
|
194
|
+
menuVisible && (React__default["default"].createElement(DropDownMenu, { options: options, setOptions: onOptionsChange }))));
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
exports.MultiSelect = MultiSelect;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var tslib_es6 = require('./tslib.es6-5b50eb8e.js');
|
|
4
4
|
var React = require('react');
|
|
5
|
-
var FormField = require('./FormField-
|
|
5
|
+
var FormField = require('./FormField-a92c7bac.js');
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
package/dist/Page/index.js
CHANGED
|
@@ -7,14 +7,14 @@ var React = require('react');
|
|
|
7
7
|
var classnames = require('classnames');
|
|
8
8
|
var hooks = require('@jobber/hooks');
|
|
9
9
|
var styleInject_es = require('../style-inject.es-dcee06b6.js');
|
|
10
|
-
var Heading = require('../Heading-
|
|
11
|
-
var Text = require('../Text-
|
|
10
|
+
var Heading = require('../Heading-56750113.js');
|
|
11
|
+
var Text = require('../Text-9bc093e9.js');
|
|
12
12
|
var Content = require('../Content-18de5fbb.js');
|
|
13
|
-
var Markdown = require('../Markdown-
|
|
14
|
-
var Button = require('../Button-
|
|
15
|
-
var Menu = require('../Menu-
|
|
16
|
-
var Emphasis = require('../Emphasis-
|
|
17
|
-
require('../Typography-
|
|
13
|
+
var Markdown = require('../Markdown-69986c49.js');
|
|
14
|
+
var Button = require('../Button-5b2f1636.js');
|
|
15
|
+
var Menu = require('../Menu-6a392af6.js');
|
|
16
|
+
var Emphasis = require('../Emphasis-fd845639.js');
|
|
17
|
+
require('../Typography-7e542a72.js');
|
|
18
18
|
require('react-markdown');
|
|
19
19
|
require('react-router-dom');
|
|
20
20
|
require('../Icon-d5ad1a6d.js');
|
package/dist/Popover/index.js
CHANGED
|
@@ -7,13 +7,13 @@ var React = require('react');
|
|
|
7
7
|
var reactPopper = require('react-popper');
|
|
8
8
|
var hooks = require('@jobber/hooks');
|
|
9
9
|
var styleInject_es = require('../style-inject.es-dcee06b6.js');
|
|
10
|
-
var ButtonDismiss = require('../ButtonDismiss-
|
|
11
|
-
require('../Button-
|
|
10
|
+
var ButtonDismiss = require('../ButtonDismiss-4cde8f7c.js');
|
|
11
|
+
require('../Button-5b2f1636.js');
|
|
12
12
|
require('classnames');
|
|
13
13
|
require('react-router-dom');
|
|
14
14
|
require('../Icon-d5ad1a6d.js');
|
|
15
15
|
require('@jobber/design');
|
|
16
|
-
require('../Typography-
|
|
16
|
+
require('../Typography-7e542a72.js');
|
|
17
17
|
|
|
18
18
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
19
|
|
package/dist/RadioGroup/index.js
CHANGED
|
@@ -6,8 +6,8 @@ var tslib_es6 = require('../tslib.es6-5b50eb8e.js');
|
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var uuid = require('uuid');
|
|
8
8
|
var styleInject_es = require('../style-inject.es-dcee06b6.js');
|
|
9
|
-
var Text = require('../Text-
|
|
10
|
-
require('../Typography-
|
|
9
|
+
var Text = require('../Text-9bc093e9.js');
|
|
10
|
+
require('../Typography-7e542a72.js');
|
|
11
11
|
require('classnames');
|
|
12
12
|
|
|
13
13
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
package/dist/Select/index.js
CHANGED
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var Option = require('../Option-
|
|
5
|
+
var Option = require('../Option-201e55a7.js');
|
|
6
6
|
require('../tslib.es6-5b50eb8e.js');
|
|
7
7
|
require('react');
|
|
8
|
-
require('../FormField-
|
|
8
|
+
require('../FormField-a92c7bac.js');
|
|
9
9
|
require('uuid');
|
|
10
10
|
require('react-hook-form');
|
|
11
11
|
require('../style-inject.es-dcee06b6.js');
|
|
12
12
|
require('classnames');
|
|
13
|
-
require('../Button-
|
|
13
|
+
require('../Button-5b2f1636.js');
|
|
14
14
|
require('react-router-dom');
|
|
15
15
|
require('../Icon-d5ad1a6d.js');
|
|
16
16
|
require('@jobber/design');
|
|
17
|
-
require('../Typography-
|
|
18
|
-
require('../Text-
|
|
19
|
-
require('../InputValidation-
|
|
17
|
+
require('../Typography-7e542a72.js');
|
|
18
|
+
require('../Text-9bc093e9.js');
|
|
19
|
+
require('../InputValidation-24d3621a.js');
|
|
20
20
|
require('framer-motion');
|
|
21
21
|
require('../Spinner-18d3dee6.js');
|
|
22
22
|
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var classnames = require('classnames');
|
|
7
7
|
var styleInject_es = require('../style-inject.es-dcee06b6.js');
|
|
8
|
-
var Text = require('../Text-
|
|
9
|
-
require('../Typography-
|
|
8
|
+
var Text = require('../Text-9bc093e9.js');
|
|
9
|
+
require('../Typography-7e542a72.js');
|
|
10
10
|
require('../tslib.es6-5b50eb8e.js');
|
|
11
11
|
|
|
12
12
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
package/dist/Switch/index.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var Switch = require('../Switch-
|
|
5
|
+
var Switch = require('../Switch-d2bec677.js');
|
|
6
6
|
require('../tslib.es6-5b50eb8e.js');
|
|
7
7
|
require('react');
|
|
8
8
|
require('classnames');
|
|
9
9
|
require('../style-inject.es-dcee06b6.js');
|
|
10
|
-
require('../Typography-
|
|
10
|
+
require('../Typography-7e542a72.js');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -4,7 +4,7 @@ var tslib_es6 = require('./tslib.es6-5b50eb8e.js');
|
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var classnames = require('classnames');
|
|
6
6
|
var styleInject_es = require('./style-inject.es-dcee06b6.js');
|
|
7
|
-
var Typography = require('./Typography-
|
|
7
|
+
var Typography = require('./Typography-7e542a72.js');
|
|
8
8
|
|
|
9
9
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
10
|
|
package/dist/Tabs/index.js
CHANGED
|
@@ -6,7 +6,7 @@ var tslib_es6 = require('../tslib.es6-5b50eb8e.js');
|
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var classnames = require('classnames');
|
|
8
8
|
var styleInject_es = require('../style-inject.es-dcee06b6.js');
|
|
9
|
-
var Typography = require('../Typography-
|
|
9
|
+
var Typography = require('../Typography-7e542a72.js');
|
|
10
10
|
|
|
11
11
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
12
|
|
package/dist/Text/index.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var Text = require('../Text-
|
|
5
|
+
var Text = require('../Text-9bc093e9.js');
|
|
6
6
|
require('react');
|
|
7
|
-
require('../Typography-
|
|
7
|
+
require('../Typography-7e542a72.js');
|
|
8
8
|
require('../tslib.es6-5b50eb8e.js');
|
|
9
9
|
require('classnames');
|
|
10
10
|
require('../style-inject.es-dcee06b6.js');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
|
-
var Typography = require('./Typography-
|
|
4
|
+
var Typography = require('./Typography-7e542a72.js');
|
|
5
5
|
|
|
6
6
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
7
7
|
|
package/dist/Toast/index.js
CHANGED
|
@@ -8,8 +8,8 @@ var ReactDOM = require('react-dom');
|
|
|
8
8
|
var framerMotion = require('framer-motion');
|
|
9
9
|
var styleInject_es = require('../style-inject.es-dcee06b6.js');
|
|
10
10
|
var Icon = require('../Icon-d5ad1a6d.js');
|
|
11
|
-
var Button = require('../Button-
|
|
12
|
-
var Typography = require('../Typography-
|
|
11
|
+
var Button = require('../Button-5b2f1636.js');
|
|
12
|
+
var Typography = require('../Typography-7e542a72.js');
|
|
13
13
|
require('@jobber/design');
|
|
14
14
|
require('classnames');
|
|
15
15
|
require('react-router-dom');
|
package/dist/Tooltip/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var Tooltip = require('../Tooltip-
|
|
5
|
+
var Tooltip = require('../Tooltip-4396164d.js');
|
|
6
6
|
require('../tslib.es6-5b50eb8e.js');
|
|
7
7
|
require('react');
|
|
8
8
|
require('classnames');
|
|
@@ -10,8 +10,8 @@ require('react-dom');
|
|
|
10
10
|
require('framer-motion');
|
|
11
11
|
require('../style-inject.es-dcee06b6.js');
|
|
12
12
|
require('react-popper');
|
|
13
|
-
require('../Text-
|
|
14
|
-
require('../Typography-
|
|
13
|
+
require('../Text-9bc093e9.js');
|
|
14
|
+
require('../Typography-7e542a72.js');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
@@ -7,7 +7,7 @@ var ReactDOM = require('react-dom');
|
|
|
7
7
|
var framerMotion = require('framer-motion');
|
|
8
8
|
var styleInject_es = require('./style-inject.es-dcee06b6.js');
|
|
9
9
|
var reactPopper = require('react-popper');
|
|
10
|
-
var Text = require('./Text-
|
|
10
|
+
var Text = require('./Text-9bc093e9.js');
|
|
11
11
|
|
|
12
12
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
13
|
|
package/dist/Typography/index.js
CHANGED
|
@@ -10,7 +10,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
10
10
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
11
11
|
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
12
12
|
|
|
13
|
-
var css$8 = ":root {\n --typography--fontFamily-normal: \"Source Sans Pro\", Helvetica, Arial,\n sans-serif;\n --typography--fontFamily-display: \"Poppins\", Helvetica, Arial, sans-serif;\n\n --typography--fontSize-extravagant: calc(var(--base-unit) * 3); /* 48 */\n --typography--fontSize-jumbo: calc(var(--base-unit) * 2.25); /* 36 */\n --typography--fontSize-largest: calc(var(--base-unit) * 1.5); /* 24 */\n --typography--fontSize-larger: calc(var(--base-unit) * 1.25); /* 20 */\n --typography--fontSize-large: calc(var(--base-unit) * 1.125); /* 18 */\n --typography--fontSize-base: calc(var(--base-unit) * 1); /* 16 */\n --typography--fontSize-small: calc(var(--base-unit) * 0.875); /* 14 */\n --typography--fontSize-smaller: calc(var(--base-unit) * 0.75); /* 12 */\n\n --typography--lineHeight-large: 1.34;\n --typography--lineHeight-base: 1.25;\n --typography--lineHeight-tight: 1.2;\n --typography--lineHeight-tighter: 1.143;\n --typography--lineHeight-tightest: 1.12;\n --typography--lineHeight-miniscule: 1.08;\n}\n\n@media (max-width: 639px) {\n :root {\n --typography--fontSize-extravagant: calc(var(--base-unit) * 2.5); /* 40 */\n --typography--fontSize-jumbo: calc(var(--base-unit) * 1.75); /* 28 */\n --typography--fontSize-largest: calc(var(--base-unit) * 1.375); /* 22 */\n }\n}\n\n@media (max-width: 639px) {\n :root {\n --typography--fontSize-extravagant: calc(var(--base-unit) * 2.5); /* 40 */\n --typography--fontSize-jumbo: calc(var(--base-unit) * 1.75); /* 28 */\n --typography--fontSize-largest: calc(var(--base-unit) * 1.375); /* 22 */\n }\n}\n\n@media (--handhelds) {\n :root {\n --typography--fontSize-extravagant: calc(var(--base-unit) * 2.5); /* 40 */\n --typography--fontSize-jumbo: calc(var(--base-unit) * 1.75); /* 28 */\n --typography--fontSize-largest: calc(var(--base-unit) * 1.375); /* 22 */\n }\n}\n\n
|
|
13
|
+
var css$8 = ":root {\n --typography--fontFamily-normal: \"Source Sans Pro\", Helvetica, Arial,\n sans-serif;\n --typography--fontFamily-display: \"Poppins\", Helvetica, Arial, sans-serif;\n\n --typography--fontSize-extravagant: calc(var(--base-unit) * 3); /* 48 */\n --typography--fontSize-jumbo: calc(var(--base-unit) * 2.25); /* 36 */\n --typography--fontSize-largest: calc(var(--base-unit) * 1.5); /* 24 */\n --typography--fontSize-larger: calc(var(--base-unit) * 1.25); /* 20 */\n --typography--fontSize-large: calc(var(--base-unit) * 1.125); /* 18 */\n --typography--fontSize-base: calc(var(--base-unit) * 1); /* 16 */\n --typography--fontSize-small: calc(var(--base-unit) * 0.875); /* 14 */\n --typography--fontSize-smaller: calc(var(--base-unit) * 0.75); /* 12 */\n\n --typography--lineHeight-large: 1.34;\n --typography--lineHeight-base: 1.25;\n --typography--lineHeight-tight: 1.2;\n --typography--lineHeight-tighter: 1.143;\n --typography--lineHeight-tightest: 1.12;\n --typography--lineHeight-miniscule: 1.08;\n}\n\n@media (max-width: 639px) {\n :root {\n --typography--fontSize-extravagant: calc(var(--base-unit) * 2.5); /* 40 */\n --typography--fontSize-jumbo: calc(var(--base-unit) * 1.75); /* 28 */\n --typography--fontSize-largest: calc(var(--base-unit) * 1.375); /* 22 */\n }\n}\n\n@media (max-width: 639px) {\n :root {\n --typography--fontSize-extravagant: calc(var(--base-unit) * 2.5); /* 40 */\n --typography--fontSize-jumbo: calc(var(--base-unit) * 1.75); /* 28 */\n --typography--fontSize-largest: calc(var(--base-unit) * 1.375); /* 22 */\n }\n}\n\n@media (--handhelds) {\n :root {\n --typography--fontSize-extravagant: calc(var(--base-unit) * 2.5); /* 40 */\n --typography--fontSize-jumbo: calc(var(--base-unit) * 1.75); /* 28 */\n --typography--fontSize-largest: calc(var(--base-unit) * 1.375); /* 22 */\n }\n}\n\n._3JZjimh4dusy34C2IGQzQR {\n margin: 0;\n padding: 0;\n font-family: \"Source Sans Pro\", Helvetica, Arial,\n sans-serif;\n font-family: \"Source Sans Pro\", Helvetica, Arial,\n sans-serif;\n font-family: var(--typography--fontFamily-normal);\n /* Wrap really long words or URL's */\n word-wrap: break-word;\n word-wrap: break-word;\n}\n";
|
|
14
14
|
var styles = {"base":"_3JZjimh4dusy34C2IGQzQR"};
|
|
15
15
|
styleInject_es.styleInject(css$8);
|
|
16
16
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.88.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"dist/*"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@jobber/design": "^0.26.
|
|
20
|
+
"@jobber/design": "^0.26.0",
|
|
21
21
|
"@jobber/formatters": "^0.2.0",
|
|
22
22
|
"@jobber/hooks": "^1.12.1",
|
|
23
23
|
"@popperjs/core": "^2.0.6",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"> 1%",
|
|
85
85
|
"IE 10"
|
|
86
86
|
],
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "15a72adbab0696fe4908f2d72bfd5071c7481284"
|
|
88
88
|
}
|
package/dist/Button-739af4d8.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var tslib_es6 = require('./tslib.es6-5b50eb8e.js');
|
|
4
|
-
var React = require('react');
|
|
5
|
-
var classnames = require('classnames');
|
|
6
|
-
var reactRouterDom = require('react-router-dom');
|
|
7
|
-
var styleInject_es = require('./style-inject.es-dcee06b6.js');
|
|
8
|
-
var Icon = require('./Icon-d5ad1a6d.js');
|
|
9
|
-
var Typography = require('./Typography-b9663407.js');
|
|
10
|
-
|
|
11
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
|
-
|
|
13
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
|
-
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
15
|
-
|
|
16
|
-
var css = ":root {\n --button--color-variation: var(--color-interactive);\n --button--color-variation--hover: var(--color-interactive--hover);\n --button--color-surface: var(--color-surface);\n --button--color-surface--hover: var(--color-surface--background);\n --button--color-primaryLabel: var(--color-surface);\n\n --button--duration-loading: 2s;\n}\n\n.mvrsWRM8T3kCECXcDS2gd {\n display: -ms-inline-flexbox;\n display: inline-flex;\n min-height: calc(var(--base-unit) * 2.25);\n box-sizing: border-box;\n margin: 0;\n border: var(--border-base) solid var(--color-interactive);\n border: var(--border-base) solid var(--color-interactive);\n border: var(--border-base) solid var(--button--color-variation);\n border-radius: var(--radius-base);\n color: var(--color-interactive);\n color: var(--color-interactive);\n color: var(--button--color-variation);\n fill: var(--color-interactive);\n fill: var(--color-interactive);\n fill: var(--button--color-variation);\n -webkit-font-smoothing: antialiased;\n text-align: center;\n text-decoration: none;\n vertical-align: middle;\n background-color: var(--color-surface);\n background-color: var(--color-surface);\n background-color: var(--button--color-surface);\n cursor: pointer;\n transition: all var(--timing-base);\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n\n.mvrsWRM8T3kCECXcDS2gd * {\n color: inherit;\n fill: inherit !important; /* required to over-ride very specific fill from <Icon> */\n}\n\n.mvrsWRM8T3kCECXcDS2gd:hover,\na.mvrsWRM8T3kCECXcDS2gd:hover,\n.mvrsWRM8T3kCECXcDS2gd:focus,\na.mvrsWRM8T3kCECXcDS2gd:focus,\n.mvrsWRM8T3kCECXcDS2gd:active,\na.mvrsWRM8T3kCECXcDS2gd:active {\n border-color: var(--color-interactive--hover);\n border-color: var(--color-interactive--hover);\n border-color: var(--button--color-variation--hover);\n color: var(--color-interactive--hover);\n color: var(--color-interactive--hover);\n color: var(--button--color-variation--hover);\n fill: var(--color-interactive--hover);\n fill: var(--color-interactive--hover);\n fill: var(--button--color-variation--hover);\n background-color: var(--color-surface--background);\n background-color: var(--color-surface--background);\n background-color: var(--button--color-surface--hover);\n}\n\n.mvrsWRM8T3kCECXcDS2gd:focus,\na.mvrsWRM8T3kCECXcDS2gd:focus,\n.mvrsWRM8T3kCECXcDS2gd:active,\na.mvrsWRM8T3kCECXcDS2gd:active {\n box-shadow: var(--shadow-focus);\n outline: none;\n}\n\n/* Variation */\n\n._32HTPrDFyNRObzZRUxmhK6 {\n --button--color-variation: var(--color-interactive);\n --button--color-variation--hover: var(--color-interactive--hover);\n}\n\n._2skm9hoZI_lSBKFKHaBFHp {\n --button--color-variation: var(--color-informative);\n --button--color-variation--hover: var(--color-informative--onSurface);\n}\n\n._1XNe0NyiiX5gO7kNceanXE {\n --button--color-variation: var(--color-destructive);\n --button--color-variation--hover: var(--color-destructive--hover);\n}\n\n/* Subtle is special because, by default, it's styled as a secondary button */\n\n._15tUs2IB4Sic31aZYG7h3E {\n --button--color-variation: var(--color-interactive--subtle);\n --button--color-variation--hover: var(--color-interactive--subtle--hover);\n}\n\n/* Type */\n\n._3ReFsKtTKUcgG7PduYChd3:not(._15tUs2IB4Sic31aZYG7h3E):not(._2A9nPQukZwPTOhSExvR0-Z),\n._3ReFsKtTKUcgG7PduYChd3:not(._15tUs2IB4Sic31aZYG7h3E):not(._2A9nPQukZwPTOhSExvR0-Z):hover,\n._3ReFsKtTKUcgG7PduYChd3:not(._15tUs2IB4Sic31aZYG7h3E):not(._2A9nPQukZwPTOhSExvR0-Z):focus {\n color: var(--color-surface);\n color: var(--color-surface);\n color: var(--button--color-primaryLabel);\n background-color: var(--color-interactive);\n background-color: var(--color-interactive);\n background-color: var(--button--color-variation);\n fill: var(--color-surface);\n fill: var(--color-surface);\n fill: var(--button--color-primaryLabel);\n}\n\n._3ReFsKtTKUcgG7PduYChd3:not(._15tUs2IB4Sic31aZYG7h3E):not(._2A9nPQukZwPTOhSExvR0-Z):hover,\n._3ReFsKtTKUcgG7PduYChd3:not(._15tUs2IB4Sic31aZYG7h3E):not(._2A9nPQukZwPTOhSExvR0-Z):focus {\n background-color: var(--color-interactive--hover);\n background-color: var(--color-interactive--hover);\n background-color: var(--button--color-variation--hover);\n}\n\n._15tUs2IB4Sic31aZYG7h3E._3ReFsKtTKUcgG7PduYChd3 {\n color: var(--color-interactive);\n color: var(--color-interactive);\n color: var(--button--color-variation);\n fill: var(--color-interactive);\n fill: var(--color-interactive);\n fill: var(--button--color-variation);\n background-color: var(--color-surface);\n background-color: var(--color-surface);\n background-color: var(--button--color-surface);\n}\n\n._3QATgEdYmR2g9Hx6X6wCF-,\n._15tUs2IB4Sic31aZYG7h3E._3ReFsKtTKUcgG7PduYChd3 {\n border-color: var(--color-interactive);\n border-color: var(--color-interactive);\n border-color: var(--button--color-variation);\n}\n\n._15tUs2IB4Sic31aZYG7h3E._3ReFsKtTKUcgG7PduYChd3:hover,\n._15tUs2IB4Sic31aZYG7h3E._3ReFsKtTKUcgG7PduYChd3:focus {\n color: var(--color-interactive--hover);\n color: var(--color-interactive--hover);\n color: var(--button--color-variation--hover);\n background-color: var(--color-surface--background);\n background-color: var(--color-surface--background);\n background-color: var(--button--color-surface--hover);\n fill: var(--color-interactive--hover);\n fill: var(--color-interactive--hover);\n fill: var(--button--color-variation--hover);\n}\n\n._15tUs2IB4Sic31aZYG7h3E._3QATgEdYmR2g9Hx6X6wCF- {\n background-color: var(--color-surface);\n background-color: var(--color-surface);\n background-color: var(--button--color-surface);\n}\n\n._1IACxHVlJ8fUbaQh9Wo5wR,\n._15tUs2IB4Sic31aZYG7h3E._3QATgEdYmR2g9Hx6X6wCF- {\n border-color: transparent;\n}\n\n._15tUs2IB4Sic31aZYG7h3E._3QATgEdYmR2g9Hx6X6wCF-:hover,\n._15tUs2IB4Sic31aZYG7h3E._3QATgEdYmR2g9Hx6X6wCF-:focus {\n background-color: var(--color-surface--background);\n background-color: var(--color-surface--background);\n background-color: var(--button--color-surface--hover);\n}\n\n._1IACxHVlJ8fUbaQh9Wo5wR:hover,\n._1IACxHVlJ8fUbaQh9Wo5wR:focus,\na._1IACxHVlJ8fUbaQh9Wo5wR:hover,\na._1IACxHVlJ8fUbaQh9Wo5wR:focus,\n._15tUs2IB4Sic31aZYG7h3E._3QATgEdYmR2g9Hx6X6wCF-:hover,\n._15tUs2IB4Sic31aZYG7h3E._3QATgEdYmR2g9Hx6X6wCF-:focus,\na._15tUs2IB4Sic31aZYG7h3E._3QATgEdYmR2g9Hx6X6wCF-:hover,\na._15tUs2IB4Sic31aZYG7h3E._3QATgEdYmR2g9Hx6X6wCF-:focus {\n border-color: transparent;\n}\n\n._15tUs2IB4Sic31aZYG7h3E._1IACxHVlJ8fUbaQh9Wo5wR {\n border-color: transparent;\n background-color: transparent;\n}\n\n._15tUs2IB4Sic31aZYG7h3E._1IACxHVlJ8fUbaQh9Wo5wR:hover,\n._15tUs2IB4Sic31aZYG7h3E._1IACxHVlJ8fUbaQh9Wo5wR:focus,\na._15tUs2IB4Sic31aZYG7h3E._1IACxHVlJ8fUbaQh9Wo5wR:hover,\na._15tUs2IB4Sic31aZYG7h3E._1IACxHVlJ8fUbaQh9Wo5wR:focus {\n border-color: transparent;\n color: var(--color-interactive--subtle--hover);\n fill: var(--color-interactive--subtle--hover);\n}\n\n/* Disabled */\n\n.mvrsWRM8T3kCECXcDS2gd._2A9nPQukZwPTOhSExvR0-Z,\na.mvrsWRM8T3kCECXcDS2gd._2A9nPQukZwPTOhSExvR0-Z,\n.mvrsWRM8T3kCECXcDS2gd._2A9nPQukZwPTOhSExvR0-Z:hover,\na.mvrsWRM8T3kCECXcDS2gd._2A9nPQukZwPTOhSExvR0-Z:hover {\n border-color: var(--color-disabled--secondary);\n color: var(--color-disabled);\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n background-color: var(--color-disabled--secondary);\n fill: var(--color-disabled);\n pointer-events: none;\n cursor: not-allowed;\n}\n\n/* Sizes */\n\n._2bWEvNhV0hrUXGMEL-47ZW {\n min-height: calc(var(--base-unit) * 1.5);\n padding: 0 var(--space-small);\n}\n\n._1RWacHIaSoZ24Qq5QuiwLl {\n min-height: calc(var(--base-unit) * 2.25);\n padding: 0 calc(var(--space-base) - 4px);\n}\n\n._2lIWqvRcZzkk5iJxGXwXOZ {\n min-height: calc(var(--base-unit) * 3);\n padding: 0 var(--space-base);\n}\n\n/* Icon */\n\n.s4L5ovtQ1xiOYCxjZtZzA {\n width: calc(var(--base-unit) * 2.25);\n padding: 0;\n}\n\n.s4L5ovtQ1xiOYCxjZtZzA._2bWEvNhV0hrUXGMEL-47ZW {\n width: calc(var(--space-small) * 3);\n}\n\n.s4L5ovtQ1xiOYCxjZtZzA._1RWacHIaSoZ24Qq5QuiwLl {\n width: calc(var(--space-base) * 2.25);\n}\n\n.s4L5ovtQ1xiOYCxjZtZzA._2lIWqvRcZzkk5iJxGXwXOZ {\n width: calc(var(--space-large) * 2);\n}\n\n._2QzHdqV8dZvAzrDhFuq9VR {\n width: auto;\n}\n\n[dir=\"ltr\"] ._2QzHdqV8dZvAzrDhFuq9VR > * {\n text-align: left;\n}\n\n[dir=\"ltr\"] ._2QzHdqV8dZvAzrDhFuq9VR > * {\n text-align: left;\n}\n\n._2QzHdqV8dZvAzrDhFuq9VR > *:dir(ltr) {\n text-align: left;\n}\n\n[dir=\"rtl\"] ._2QzHdqV8dZvAzrDhFuq9VR > * {\n text-align: right;\n}\n\n[dir=\"rtl\"] ._2QzHdqV8dZvAzrDhFuq9VR > * {\n text-align: right;\n}\n\n._2QzHdqV8dZvAzrDhFuq9VR > *:dir(rtl) {\n text-align: right;\n}\n\n[dir=\"ltr\"] ._2QzHdqV8dZvAzrDhFuq9VR > * {\n text-align: left;\n}\n\n._2QzHdqV8dZvAzrDhFuq9VR > *:dir(ltr) {\n text-align: left;\n}\n\n[dir=\"rtl\"] ._2QzHdqV8dZvAzrDhFuq9VR > * {\n text-align: right;\n}\n\n._2QzHdqV8dZvAzrDhFuq9VR > *:dir(rtl) {\n text-align: right;\n}\n\n._2QzHdqV8dZvAzrDhFuq9VR > * {\n text-align: start;\n}\n\n._2QzHdqV8dZvAzrDhFuq9VR > *:first-child {\n -ms-flex-negative: 0;\n flex-shrink: 0;\n margin-right: var(--space-small);\n}\n\n.ynAOdrWxU2gjfmktgPvCV > *:first-child {\n margin-left: var(--space-small);\n margin-right: 0;\n -ms-flex-order: 1;\n order: 1;\n}\n\n.azjQzmR6DJOHc9VhR8P_8 {\n width: 100%;\n}\n\n._3tkzLKKpGYFY0HgS8OkM_e {\n background-image: linear-gradient(\n 135deg,\n rgba(0, 0, 0, 0.1) 0%,\n rgba(0, 0, 0, 0.1) 25%,\n transparent 25%,\n transparent 50%,\n rgba(0, 0, 0, 0.1) 50%,\n rgba(0, 0, 0, 0.1) 75%,\n transparent 75%,\n transparent 100%\n );\n background-size: var(--space-larger) var(--space-larger);\n pointer-events: none;\n cursor: not-allowed;\n -webkit-animation-duration: 2s;\n -webkit-animation-duration: 2s;\n -webkit-animation-duration: var(--button--duration-loading);\n animation-duration: 2s;\n animation-duration: 2s;\n animation-duration: var(--button--duration-loading);\n -webkit-animation-iteration-count: infinite;\n animation-iteration-count: infinite;\n -webkit-animation-name: _1g5cSkv2FhbaOp_SpZQve_;\n animation-name: _1g5cSkv2FhbaOp_SpZQve_;\n -webkit-animation-timing-function: linear;\n animation-timing-function: linear;\n}\n\n._3ReFsKtTKUcgG7PduYChd3._3tkzLKKpGYFY0HgS8OkM_e:not(._15tUs2IB4Sic31aZYG7h3E) {\n background-image: linear-gradient(\n 135deg,\n rgba(255, 255, 255, 0.25) 0%,\n rgba(255, 255, 255, 0.25) 25%,\n transparent 25%,\n transparent 50%,\n rgba(255, 255, 255, 0.25) 50%,\n rgba(255, 255, 255, 0.25) 75%,\n transparent 75%,\n transparent 100%\n );\n}\n\n@-webkit-keyframes _1g5cSkv2FhbaOp_SpZQve_ {\n 0% {\n background-position: 0 0;\n }\n 100% {\n background-position: var(--space-larger) var(--space-larger);\n }\n}\n\n@keyframes _1g5cSkv2FhbaOp_SpZQve_ {\n 0% {\n background-position: 0 0;\n }\n 100% {\n background-position: var(--space-larger) var(--space-larger);\n }\n}\n";
|
|
17
|
-
var styles = {"button":"mvrsWRM8T3kCECXcDS2gd","work":"_32HTPrDFyNRObzZRUxmhK6","learning":"_2skm9hoZI_lSBKFKHaBFHp","destructive":"_1XNe0NyiiX5gO7kNceanXE","subtle":"_15tUs2IB4Sic31aZYG7h3E","primary":"_3ReFsKtTKUcgG7PduYChd3","disabled":"_2A9nPQukZwPTOhSExvR0-Z","secondary":"_3QATgEdYmR2g9Hx6X6wCF-","tertiary":"_1IACxHVlJ8fUbaQh9Wo5wR","small":"_2bWEvNhV0hrUXGMEL-47ZW","base":"_1RWacHIaSoZ24Qq5QuiwLl","large":"_2lIWqvRcZzkk5iJxGXwXOZ","onlyIcon":"s4L5ovtQ1xiOYCxjZtZzA","hasIconAndLabel":"_2QzHdqV8dZvAzrDhFuq9VR","iconOnRight":"ynAOdrWxU2gjfmktgPvCV","fullWidth":"azjQzmR6DJOHc9VhR8P_8","loading":"_3tkzLKKpGYFY0HgS8OkM_e","animateStripes":"_1g5cSkv2FhbaOp_SpZQve_"};
|
|
18
|
-
styleInject_es.styleInject(css);
|
|
19
|
-
|
|
20
|
-
function Button(props) {
|
|
21
|
-
var _a;
|
|
22
|
-
var ariaControls = props.ariaControls, ariaHaspopup = props.ariaHaspopup, ariaExpanded = props.ariaExpanded, ariaLabel = props.ariaLabel, _b = props.disabled, disabled = _b === void 0 ? false : _b, external = props.external, fullWidth = props.fullWidth, icon = props.icon, label = props.label, iconOnRight = props.iconOnRight, id = props.id, loading = props.loading, onClick = props.onClick, onMouseDown = props.onMouseDown, _c = props.size, size = _c === void 0 ? "base" : _c, _d = props.type, type = _d === void 0 ? "primary" : _d, url = props.url, to = props.to, _e = props.variation, variation = _e === void 0 ? "work" : _e, submit = props.submit;
|
|
23
|
-
var buttonClassNames = classnames__default["default"](styles.button, styles[size], (_a = {},
|
|
24
|
-
_a[styles.onlyIcon] = icon && !label,
|
|
25
|
-
_a[styles.hasIconAndLabel] = icon && label,
|
|
26
|
-
_a[styles.iconOnRight] = iconOnRight,
|
|
27
|
-
_a[styles[variation]] = variation,
|
|
28
|
-
_a[styles[type]] = type,
|
|
29
|
-
_a[styles.disabled] = disabled,
|
|
30
|
-
_a[styles.fullWidth] = fullWidth,
|
|
31
|
-
_a[styles.loading] = loading,
|
|
32
|
-
_a));
|
|
33
|
-
var buttonType = submit ? "submit" : "button";
|
|
34
|
-
var tagProps = tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign({ className: buttonClassNames, disabled: disabled,
|
|
35
|
-
id: id }, (!disabled && { href: url })), (!disabled && { onClick: onClick })), (!disabled && { onMouseDown: onMouseDown })), (external && { target: "_blank" })), (url === undefined && to === undefined && { type: buttonType })), { "aria-controls": ariaControls, "aria-haspopup": ariaHaspopup, "aria-expanded": ariaExpanded, "aria-label": ariaLabel });
|
|
36
|
-
var buttonInternals = React__default["default"].createElement(ButtonInternals, tslib_es6.__assign({}, props));
|
|
37
|
-
if (to) {
|
|
38
|
-
return (React__default["default"].createElement(reactRouterDom.Link, tslib_es6.__assign({}, tagProps, { to: to }), buttonInternals));
|
|
39
|
-
}
|
|
40
|
-
var Tag = url ? "a" : "button";
|
|
41
|
-
return React__default["default"].createElement(Tag, tslib_es6.__assign({}, tagProps), buttonInternals);
|
|
42
|
-
}
|
|
43
|
-
function ButtonInternals(_a) {
|
|
44
|
-
var label = _a.label, icon = _a.icon, _b = _a.size, size = _b === void 0 ? "base" : _b;
|
|
45
|
-
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
46
|
-
icon && React__default["default"].createElement(Icon.Icon, { name: icon, size: size }),
|
|
47
|
-
React__default["default"].createElement(Typography.Typography, { element: "span", textCase: "uppercase", fontWeight: "extraBold", size: getTypeSizes(size) }, label)));
|
|
48
|
-
}
|
|
49
|
-
function getTypeSizes(size) {
|
|
50
|
-
switch (size) {
|
|
51
|
-
case "small":
|
|
52
|
-
return "smaller";
|
|
53
|
-
case "large":
|
|
54
|
-
return "base";
|
|
55
|
-
default:
|
|
56
|
-
return "small";
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
exports.Button = Button;
|