@jobber/components 4.67.2-JOB-84261.6 → 4.67.2-pre.25
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/dist/AnimatedSwitcher/index.js +2 -2
- package/dist/{AnimatedSwitcher-d1e1ddcf.js → AnimatedSwitcher-879d0d6f.js} +1 -1
- package/dist/Autocomplete/index.js +13 -15
- package/dist/Avatar/index.js +2 -3
- package/dist/{Avatar-76a799fa.js → Avatar-765d6e45.js} +1 -4
- package/dist/Banner/index.js +4 -9
- package/dist/Button/index.js +3 -4
- package/dist/Button-8bde6560.js +54 -0
- package/dist/ButtonDismiss/index.js +4 -5
- package/dist/{ButtonDismiss-2b98d075.js → ButtonDismiss-af17d76d.js} +1 -1
- package/dist/Card/index.js +7 -8
- package/dist/Card-9dfc98d3.js +88 -0
- package/dist/Checkbox/index.js +5 -7
- package/dist/{Checkbox-ad7ec2e7.js → Checkbox-2d7c43d9.js} +5 -8
- package/dist/Chip/index.js +8 -7
- package/dist/Chip-dca6c22b.js +86 -0
- package/dist/Chips/index.js +12 -16
- package/dist/ClientOnly-4f3e136d.js +23 -0
- package/dist/Combobox/index.js +11 -10
- package/dist/{Combobox-eb1e5817.js → Combobox-35a3ea22.js} +43 -24
- package/dist/ConfirmationModal/index.js +14 -13
- package/dist/{ConfirmationModal-0f85d96c.js → ConfirmationModal-f6c0afc7.js} +3 -3
- package/dist/Content/index.js +1 -2
- package/dist/{Content-2ca1ffe1.js → Content-80486307.js} +0 -5
- package/dist/DataDump/index.js +9 -10
- package/dist/DataList/components/DataListHeader/DataListHeaderCheckbox.d.ts +1 -2
- package/dist/DataList/components/DataListHeaderTile/DataListSortingArrows.d.ts +1 -1
- package/dist/DataList/hooks/useMediaQuery.d.ts +3 -1
- package/dist/DataList/index.js +31 -56
- package/dist/DataTable/DataTable.d.ts +1 -1
- package/dist/DataTable/index.js +18 -22
- package/dist/DatePicker/index.js +4 -5
- package/dist/DatePicker-9399cc69.js +131 -0
- package/dist/DescriptionList/index.js +1 -4
- package/dist/Disclosure/index.js +2 -5
- package/dist/Divider/index.js +0 -3
- package/dist/Drawer/index.js +5 -10
- package/dist/Emphasis/index.js +2 -3
- package/dist/{Emphasis-b2d1b3aa.js → Emphasis-7a2893bb.js} +1 -1
- package/dist/FeatureSwitch/index.js +11 -13
- package/dist/Flex/index.js +6 -4
- package/dist/Form/index.js +1 -1
- package/dist/FormField/FormFieldTypes.d.ts +8 -0
- package/dist/FormField/FormFieldWrapper.d.ts +3 -1
- package/dist/FormField/components/ClearAction.d.ts +9 -0
- package/dist/FormField/index.js +9 -10
- package/dist/FormField-18eda132.js +252 -0
- package/dist/FormatDate/index.js +1 -1
- package/dist/FormatEmail/index.js +0 -3
- package/dist/FormatFile/index.js +17 -17
- package/dist/FormatFile-317b158a.js +116 -0
- package/dist/FormatTime/FormatTime.d.ts +1 -2
- package/dist/FormatTime/index.js +11 -6
- package/dist/Gallery/index.js +18 -20
- package/dist/Glimmer/index.js +3 -4
- package/dist/Glimmer-f5c31401.js +68 -0
- package/dist/Grid/index.js +0 -7
- package/dist/Heading/index.js +2 -3
- package/dist/{Heading-0f4ecb0c.js → Heading-f066883a.js} +1 -1
- package/dist/Icon/index.js +1 -1
- package/dist/InlineLabel/index.js +2 -3
- package/dist/InlineLabel-4c2fec47.js +25 -0
- package/dist/InputAvatar/index.js +8 -12
- package/dist/InputDate/InputDate.d.ts +1 -1
- package/dist/InputDate/index.js +10 -11
- package/dist/InputEmail/index.js +9 -10
- package/dist/InputFile/InputFile.d.ts +5 -1
- package/dist/InputFile/index.js +6 -8
- package/dist/{InputFile-540c1657.js → InputFile-5c44f0b4.js} +8 -11
- package/dist/InputGroup/index.js +1 -2
- package/dist/InputGroup-88bec8c9.js +30 -0
- package/dist/InputNumber/index.js +10 -11
- package/dist/{InputNumber-d9ebabaa.js → InputNumber-ed655bae.js} +1 -1
- package/dist/InputPassword/index.js +9 -10
- package/dist/InputPhoneNumber/index.js +9 -12
- package/dist/InputText/InputText.d.ts +2 -0
- package/dist/InputText/index.js +11 -11
- package/dist/InputText/useSafeLayoutEffect.d.ts +2 -0
- package/dist/{InputText-f7c45ee5.js → InputText-c68964ff.js} +3 -2
- package/dist/InputTime/InputTime.d.ts +3 -1
- package/dist/InputTime/InputTime.disabledTest.d.ts +1 -0
- package/dist/InputTime/InputTimeProps.d.ts +1 -1
- package/dist/InputTime/InternalInputTime.d.ts +3 -0
- package/dist/InputTime/SupportsTimePolyfill.d.ts +2 -0
- package/dist/InputTime/TimeInputPolyfill.client.d.ts +2 -0
- package/dist/InputTime/index.js +58 -724
- package/dist/InputValidation/index.js +4 -5
- package/dist/{InputValidation-179f0926.js → InputValidation-fdc891af.js} +2 -5
- package/dist/LightBox/ClientOnly.d.ts +6 -0
- package/dist/LightBox/LightBox.d.ts +2 -2
- package/dist/LightBox/index.js +6 -6
- package/dist/{LightBox-3f4dbc33.js → LightBox-d5aea313.js} +5 -6
- package/dist/List/index.js +9 -15
- package/dist/Markdown/Markdown.d.ts +1 -1
- package/dist/Markdown/index.js +8 -8
- package/dist/Markdown-10fc9d3e.js +90 -0
- package/dist/Menu/Menu.d.ts +4 -4
- package/dist/Menu/index.js +5 -6
- package/dist/{Menu-d7ea093c.js → Menu-7b7aa325.js} +7 -10
- package/dist/Modal/Modal.d.ts +2 -2
- package/dist/Modal/index.js +7 -7
- package/dist/{Modal-70daa0e2.js → Modal-357fd1df.js} +6 -9
- package/dist/MultiSelect/index.js +5 -11
- package/dist/{Option-469029b5.js → Option-c84f28a6.js} +1 -1
- package/dist/Page/index.js +12 -14
- package/dist/Popover/Popover.d.ts +2 -2
- package/dist/Popover/index.js +8 -8
- package/dist/ProgressBar/index.js +1 -2
- package/dist/ProgressBar-5c577dc0.js +38 -0
- package/dist/RadioGroup/index.js +3 -5
- package/dist/RadioGroup-9dded55d.js +44 -0
- package/dist/RecurringSelect/components/DayOfMonthSelect.d.ts +2 -2
- package/dist/RecurringSelect/components/WeeklySelect.d.ts +2 -2
- package/dist/RecurringSelect/index.js +16 -29
- package/dist/Select/index.js +10 -11
- package/dist/Spinner/index.js +1 -2
- package/dist/Spinner-cac356ee.js +21 -0
- package/dist/StatusLabel/index.js +2 -5
- package/dist/SupportsTimePolyfill-466a30f9.js +21 -0
- package/dist/Switch/index.js +2 -3
- package/dist/Switch-588c5e70.js +53 -0
- package/dist/Table/index.js +0 -5
- package/dist/Tabs/index.js +1 -4
- package/dist/Text/index.js +2 -3
- package/dist/{Text-4a2bc89f.js → Text-9f261dde.js} +1 -1
- package/dist/TimeInputPolyfill.client-1dfc8ab1.js +687 -0
- package/dist/Toast/index.js +3 -6
- package/dist/Tooltip/index.js +3 -2
- package/dist/{Tooltip-6b12f1c2.js → Tooltip-99440954.js} +14 -12
- package/dist/Typography/index.js +1 -2
- package/dist/Typography-75f58b60.js +43 -0
- package/dist/styles.css +8107 -0
- package/dist/useSafeLayoutEffect-b63708b1.js +16 -0
- package/package.json +4 -4
- package/rollup.config.js +3 -1
- package/dist/Button-163a0641.js +0 -57
- package/dist/Card-3178033c.js +0 -93
- package/dist/Chip-168acf3e.js +0 -89
- package/dist/DatePicker-c18f1739.js +0 -134
- package/dist/FormField-dfc061ca.js +0 -227
- package/dist/FormatFile-3b650d02.js +0 -121
- package/dist/Glimmer-cfa92a88.js +0 -77
- package/dist/InlineLabel-9a517c19.js +0 -28
- package/dist/InputGroup-8d4fd4eb.js +0 -33
- package/dist/Markdown-96070121.js +0 -62
- package/dist/ProgressBar-b68edc8f.js +0 -43
- package/dist/RadioGroup-ebaa4f87.js +0 -47
- package/dist/Spinner-9d8fc7ff.js +0 -24
- package/dist/Switch-b85272bf.js +0 -56
- package/dist/Typography-973b122e.js +0 -62
- package/dist/style-inject.es-9d2f5f4e.js +0 -30
- /package/dist/{FormatDate-70ea5b43.js → FormatDate-6fc94218.js} +0 -0
- /package/dist/{Icon-405a216c.js → Icon-361343e0.js} +0 -0
- /package/dist/{tslib.es6-5b8768b7.js → tslib.es6-a575af05.js} +0 -0
package/dist/Popover/index.js
CHANGED
|
@@ -5,24 +5,22 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var reactPopper = require('react-popper');
|
|
7
7
|
var useRefocusOnActivator = require('@jobber/hooks/useRefocusOnActivator');
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
require('../Button-
|
|
8
|
+
var ButtonDismiss = require('../ButtonDismiss-af17d76d.js');
|
|
9
|
+
var ClientOnly = require('../ClientOnly-4f3e136d.js');
|
|
10
|
+
require('../Button-8bde6560.js');
|
|
11
11
|
require('classnames');
|
|
12
12
|
require('react-router-dom');
|
|
13
|
-
require('../Icon-
|
|
13
|
+
require('../Icon-361343e0.js');
|
|
14
14
|
require('@jobber/design');
|
|
15
|
-
require('../Typography-
|
|
15
|
+
require('../Typography-75f58b60.js');
|
|
16
16
|
|
|
17
17
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
18
|
|
|
19
19
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
20
20
|
|
|
21
|
-
var css_248z = ":root {\n --card--base-padding: var(--space-base);\n --popover--padding: var(--space-base);\n --popover--width: calc(var(--base-unit) * 21.875);\n --dismiss--button-padding: calc(var(--base-unit) / 4);\n}\n\n.oSlK4rLUvzE- {\n display: -ms-flexbox;\n display: flex;\n position: \"relative\";\n padding: calc(16px * 1);\n padding: var(--popover--padding);\n -ms-flex-pack: justify;\n justify-content: space-between;\n -ms-flex-align: center;\n align-items: center;\n}\n\n.XVPpPb-7e30- {\n float: right;\n padding: calc(16px / 4);\n padding: var(--dismiss--button-padding);\n text-align: right;\n}\n\n.TDuYbqXaLW0- {\n z-index: 1002;\n z-index: var(--elevation-tooltip);\n width: -webkit-max-content;\n width: max-content;\n max-width: calc(16px * 21.875);\n max-width: var(--popover--width);\n box-shadow: 0px calc(16px / 16) calc(16px / 4) 0px\n rgba(0, 0, 0, 0.1),\n 0px calc(16px / 4) 12px 0px rgba(0, 0, 0, 0.05);\n box-shadow: var(--shadow-base);\n border: calc(16px / 16) solid rgb(217, 223, 225);\n border: var(--border-base) solid var(--color-border);\n border-radius: calc(16px / 8);\n border-radius: var(--radius-base);\n font-size: calc((16px * 1) * 0.875);\n font-size: calc(calc(16px * 1) * 0.875);\n font-size: var(--typography--fontSize-base);\n line-height: normal;\n background: rgba(255, 255, 255, 1);\n background: var(--color-surface);\n}\n\n.TDuYbqXaLW0- > * {\n --public-content--padding: var(--card--base-padding);\n}\n\n.LJCpn0zf1e8- {\n visibility: hidden;\n}\n\n.LJCpn0zf1e8-,\n.LJCpn0zf1e8-::before {\n position: absolute;\n width: 16px;\n width: var(--base-unit);\n height: 16px;\n height: var(--base-unit);\n background: inherit;\n}\n\n.LJCpn0zf1e8-::before {\n content: \"\";\n visibility: visible;\n border: calc(16px / 16) solid rgb(217, 223, 225);\n border: var(--border-base) solid var(--color-border);\n -webkit-transform: rotate(45deg);\n transform: rotate(45deg);\n -webkit-transform-origin: center;\n transform-origin: center;\n -webkit-clip-path: polygon(-4px -4px, 15.3px 0, 0 15.3px);\n clip-path: polygon(-4px -4px, 15.3px 0, 0 15.3px);\n}\n\n.TDuYbqXaLW0-[data-popper-placement^=\"top\"] > .LJCpn0zf1e8- {\n bottom: -5px;\n}\n\n.TDuYbqXaLW0-[data-popper-placement^=\"top\"] > .LJCpn0zf1e8-::before {\n -webkit-transform: rotate(-135deg);\n transform: rotate(-135deg);\n}\n\n.TDuYbqXaLW0-[data-popper-placement^=\"bottom\"] > .LJCpn0zf1e8- {\n top: -7px;\n}\n\n.TDuYbqXaLW0-[data-popper-placement^=\"left\"] > .LJCpn0zf1e8- {\n right: -5px;\n}\n\n.TDuYbqXaLW0-[data-popper-placement^=\"left\"] > .LJCpn0zf1e8-::before {\n -webkit-transform: rotate(135deg);\n transform: rotate(135deg);\n}\n\n.TDuYbqXaLW0-[data-popper-placement^=\"right\"] > .LJCpn0zf1e8- {\n left: -7px;\n}\n\n.TDuYbqXaLW0-[data-popper-placement^=\"right\"] > .LJCpn0zf1e8-::before {\n -webkit-transform: rotate(-45deg);\n transform: rotate(-45deg);\n}\n";
|
|
22
21
|
var classes = {"header":"oSlK4rLUvzE-","dismissButton":"XVPpPb-7e30-","popover":"TDuYbqXaLW0-","arrow":"LJCpn0zf1e8-"};
|
|
23
|
-
styleInject_es.styleInject(css_248z);
|
|
24
22
|
|
|
25
|
-
function
|
|
23
|
+
function PopoverInternal({ onRequestClose, children, attachTo, open, preferredPlacement = "auto", }) {
|
|
26
24
|
const [popperElement, setPopperElement] = React.useState();
|
|
27
25
|
const [arrowElement, setArrowElement] = React.useState();
|
|
28
26
|
const { styles: popperStyles, attributes } = reactPopper.usePopper(attachTo instanceof Element ? attachTo : attachTo.current, popperElement, {
|
|
@@ -36,6 +34,8 @@ function Popover({ onRequestClose, children, attachTo, open, preferredPlacement
|
|
|
36
34
|
children,
|
|
37
35
|
React__default["default"].createElement("div", { ref: setArrowElement, className: classes.arrow, style: popperStyles.arrow })))));
|
|
38
36
|
}
|
|
37
|
+
const Popover = (props) => (React__default["default"].createElement(ClientOnly.ClientOnly, null,
|
|
38
|
+
React__default["default"].createElement(PopoverInternal, Object.assign({}, props))));
|
|
39
39
|
function buildModifiers(arrowElement) {
|
|
40
40
|
const modifiers = [
|
|
41
41
|
{
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var ProgressBar = require('../ProgressBar-
|
|
5
|
+
var ProgressBar = require('../ProgressBar-5c577dc0.js');
|
|
6
6
|
require('react');
|
|
7
7
|
require('classnames');
|
|
8
|
-
require('../style-inject.es-9d2f5f4e.js');
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var classnames = require('classnames');
|
|
5
|
+
|
|
6
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
7
|
+
|
|
8
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
9
|
+
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
10
|
+
|
|
11
|
+
var styles = {"ProgressBar":"S1cioqW7loo-","SteppedProgressBar":"nv5fejwjHzo-","wrapper":"dyBDsjWCui4-"};
|
|
12
|
+
|
|
13
|
+
var sizes = {"smaller":"CzIxUWYkrdo-","small":"JNSDqHqKVlE-","base":"nzFMJ2k4zJ0-"};
|
|
14
|
+
|
|
15
|
+
function ProgressBarStepped({ currentStep, totalSteps, percentage, size = "base", }) {
|
|
16
|
+
const steppedProgressBarClassName = classnames__default["default"](styles.ProgressBar, styles.SteppedProgressBar, sizes[size]);
|
|
17
|
+
const ariaLabel = `progress, ${currentStep} out of ${totalSteps}`;
|
|
18
|
+
return (React__default["default"].createElement("div", { role: "progressbar", className: styles.wrapper, "aria-valuenow": percentage, "aria-valuetext": ariaLabel }, Array.from({ length: totalSteps }).map((_, index) => {
|
|
19
|
+
const step = index + 1;
|
|
20
|
+
const value = step <= currentStep ? 100 : 0;
|
|
21
|
+
return (React__default["default"].createElement("progress", { key: step, className: steppedProgressBarClassName, value: value, "data-testid": "progress-step" },
|
|
22
|
+
value,
|
|
23
|
+
"%"));
|
|
24
|
+
})));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function ProgressBar({ currentStep, totalSteps, size = "base", variation = "progress", }) {
|
|
28
|
+
const percentage = (currentStep / totalSteps) * 100;
|
|
29
|
+
const progressBarClassName = classnames__default["default"](styles.ProgressBar, sizes[size]);
|
|
30
|
+
if (variation === "stepped") {
|
|
31
|
+
return (React__default["default"].createElement(ProgressBarStepped, { currentStep: currentStep, totalSteps: totalSteps, percentage: percentage, size: size }));
|
|
32
|
+
}
|
|
33
|
+
return (React__default["default"].createElement("progress", { className: progressBarClassName, max: totalSteps, value: currentStep },
|
|
34
|
+
percentage,
|
|
35
|
+
"%"));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
exports.ProgressBar = ProgressBar;
|
package/dist/RadioGroup/index.js
CHANGED
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var RadioGroup = require('../RadioGroup-
|
|
5
|
+
var RadioGroup = require('../RadioGroup-9dded55d.js');
|
|
6
6
|
require('react');
|
|
7
|
-
require('
|
|
8
|
-
require('../
|
|
9
|
-
require('../Text-4a2bc89f.js');
|
|
10
|
-
require('../Typography-973b122e.js');
|
|
7
|
+
require('../Text-9f261dde.js');
|
|
8
|
+
require('../Typography-75f58b60.js');
|
|
11
9
|
require('classnames');
|
|
12
10
|
|
|
13
11
|
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var Text = require('./Text-9f261dde.js');
|
|
5
|
+
|
|
6
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
7
|
+
|
|
8
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
9
|
+
|
|
10
|
+
var styles = {"radioGroup":"_5P8wEHDUdKY-","input":"_08ZPdlE98Ko-","label":"-PUoLXltVlQ-","description":"_8r6qT-6S9EI-","children":"C5SzbO1epLk-"};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* For rendering props only. To make updates to
|
|
14
|
+
* the real RadioOption, look at InternalRadioOption
|
|
15
|
+
*/
|
|
16
|
+
function RadioOption({ children }) {
|
|
17
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null, children);
|
|
18
|
+
}
|
|
19
|
+
function InternalRadioOption({ value, name, label, description, disabled, checked, children, onChange, }) {
|
|
20
|
+
const id = React.useId();
|
|
21
|
+
const inputId = `${value.toString()}_${id}`;
|
|
22
|
+
const shouldRenderIndependentChildren = label && children;
|
|
23
|
+
return (React__default["default"].createElement("div", null,
|
|
24
|
+
React__default["default"].createElement("input", { onChange: handleChange, type: "radio", name: name, value: value, disabled: disabled, checked: checked, id: inputId, className: styles.input, "aria-describedby": description ? `${inputId}_description` : undefined }),
|
|
25
|
+
React__default["default"].createElement("label", { className: styles.label, htmlFor: inputId }, label ? label : children),
|
|
26
|
+
description && (React__default["default"].createElement("div", { className: styles.description, id: `${inputId}_description` },
|
|
27
|
+
React__default["default"].createElement(Text.Text, { variation: "subdued", size: "small" }, description))),
|
|
28
|
+
shouldRenderIndependentChildren && (React__default["default"].createElement("div", { className: styles.children, id: `${inputId}_children` }, children))));
|
|
29
|
+
function handleChange() {
|
|
30
|
+
onChange(value);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function RadioGroup({ children, value, ariaLabel, onChange, name = React.useId(), }) {
|
|
35
|
+
return (React__default["default"].createElement("div", { role: "radiogroup", "aria-label": ariaLabel, className: styles.radioGroup }, React__default["default"].Children.map(children, option => (React__default["default"].createElement(InternalRadioOption, Object.assign({ checked: value === option.props.value, name: name, onChange: handleChange }, option.props), option.props.children)))));
|
|
36
|
+
function handleChange(newValue) {
|
|
37
|
+
if (newValue !== value) {
|
|
38
|
+
onChange(newValue);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
exports.RadioGroup = RadioGroup;
|
|
44
|
+
exports.RadioOption = RadioOption;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { DayOfMonth } from "../types";
|
|
3
3
|
interface DayOfMonthSelectProps {
|
|
4
|
-
selectedDays: Set<DayOfMonth>;
|
|
5
|
-
disabled: boolean;
|
|
4
|
+
readonly selectedDays: Set<DayOfMonth>;
|
|
5
|
+
readonly disabled: boolean;
|
|
6
6
|
onChange(selectedDays: Set<DayOfMonth>): void;
|
|
7
7
|
}
|
|
8
8
|
export declare function DayOfMonthSelect({ selectedDays, disabled, onChange, }: DayOfMonthSelectProps): JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { WeekDay } from "../types";
|
|
3
3
|
interface WeeklySelectProps {
|
|
4
|
-
disabled: boolean;
|
|
5
|
-
selectedDays: Set<WeekDay>;
|
|
4
|
+
readonly disabled: boolean;
|
|
5
|
+
readonly selectedDays: Set<WeekDay>;
|
|
6
6
|
onChange(selectedDays: Set<WeekDay>): void;
|
|
7
7
|
}
|
|
8
8
|
export declare function WeeklySelect({ onChange, selectedDays, disabled, }: WeeklySelectProps): JSX.Element;
|
|
@@ -3,38 +3,33 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var RadioGroup = require('../RadioGroup-ebaa4f87.js');
|
|
9
|
-
var Text = require('../Text-4a2bc89f.js');
|
|
6
|
+
var RadioGroup = require('../RadioGroup-9dded55d.js');
|
|
7
|
+
var Text = require('../Text-9f261dde.js');
|
|
10
8
|
require('classnames');
|
|
11
|
-
require('../
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
require('../FormField-
|
|
17
|
-
require('../tslib.es6-
|
|
9
|
+
var Option = require('../Option-c84f28a6.js');
|
|
10
|
+
var InputNumber = require('../InputNumber-ed655bae.js');
|
|
11
|
+
var InputGroup = require('../InputGroup-88bec8c9.js');
|
|
12
|
+
var Content = require('../Content-80486307.js');
|
|
13
|
+
require('../Typography-75f58b60.js');
|
|
14
|
+
require('../FormField-18eda132.js');
|
|
15
|
+
require('../tslib.es6-a575af05.js');
|
|
18
16
|
require('react-hook-form');
|
|
19
|
-
require('
|
|
17
|
+
require('@jobber/hooks/useShowClear');
|
|
18
|
+
require('../Button-8bde6560.js');
|
|
20
19
|
require('react-router-dom');
|
|
21
|
-
require('../Icon-
|
|
20
|
+
require('../Icon-361343e0.js');
|
|
22
21
|
require('@jobber/design');
|
|
23
|
-
require('../InputValidation-
|
|
22
|
+
require('../InputValidation-fdc891af.js');
|
|
24
23
|
require('framer-motion');
|
|
25
|
-
require('../Spinner-
|
|
24
|
+
require('../Spinner-cac356ee.js');
|
|
26
25
|
|
|
27
26
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
28
27
|
|
|
29
28
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
30
29
|
|
|
31
|
-
var css_248z$5 = ".NfsRidfuJts- {\n display: grid;\n width: 100%;\n padding: calc(16px / 4);\n padding: var(--space-smaller);\n border: calc(16px / 16) solid rgb(217, 223, 225);\n border: var(--border-base) solid var(--color-border);\n border-radius: calc(16px / 4);\n border-radius: var(--radius-large);\n grid-template-columns: repeat(7, 1fr);\n row-gap: calc(16px / 4);\n grid-row-gap: calc(16px / 4);\n grid-row-gap: var(--space-smaller);\n row-gap: var(--space-smaller);\n -webkit-column-gap: calc(16px / 4);\n -webkit-column-gap: var(--space-smaller);\n -moz-column-gap: calc(16px / 4);\n -moz-column-gap: var(--space-smaller);\n column-gap: calc(16px / 4);\n grid-column-gap: calc(16px / 4);\n grid-column-gap: var(--space-smaller);\n column-gap: var(--space-smaller);\n}\n";
|
|
32
30
|
var styles$4 = {"container":"NfsRidfuJts-"};
|
|
33
|
-
styleInject_es.styleInject(css_248z$5);
|
|
34
31
|
|
|
35
|
-
var css_248z$4 = ".GXNuQVAsUqs- {\n position: relative;\n}\n\n/* kept present but hidden for accessibility */\n\n.PtlN3SI-Atc- {\n clip: rect(1px, 1px, 1px, 1px);\n -webkit-clip-path: inset(50%);\n clip-path: inset(50%);\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n}\n\n.VPZ0Os9TY5k- {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-pack: center;\n justify-content: center;\n -ms-flex-align: center;\n align-items: center;\n padding: calc(16px / 4);\n padding: var(--space-smaller);\n border-radius: calc(16px / 4);\n border-radius: var(--radius-large);\n text-align: center;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n background: rgba(255, 255, 255, 1);\n background: var(--color-surface);\n transition: 200ms;\n transition: var(--timing-base);\n}\n\n@supports (aspect-ratio: 1/1) {\n .VPZ0Os9TY5k- {\n /*\n * disabling property-no-unknown here as this is a real property\n * that stylelint just doesn't know about. We may be able to remove\n * this when we update our stylelint to not care about IE11.\n */\n /* stylelint-disable-next-line property-no-unknown */\n aspect-ratio: 1/1;\n }\n}\n\n.VPZ0Os9TY5k-:hover {\n background: rgb(244, 246, 250);\n background: var(--color-surface--hover);\n}\n\n.PtlN3SI-Atc-:focus + .VPZ0Os9TY5k- {\n box-shadow: 0px 0px 0px calc(16px / 8) rgba(255, 255, 255, 1),\n 0px 0px 0px calc(16px / 4) rgb(147, 161, 169);\n box-shadow: var(--shadow-focus);\n background: rgb(244, 246, 250);\n background: var(--color-surface--hover);\n}\n\n.PtlN3SI-Atc-:checked + .VPZ0Os9TY5k- {\n color: rgba(255, 255, 255, 1);\n color: var(--color-text--reverse);\n background: rgb(125, 176, 14);\n background: var(--color-interactive);\n}\n\n.PtlN3SI-Atc-:disabled + .VPZ0Os9TY5k- {\n color: rgb(181, 181, 181);\n color: var(--color-disabled);\n background: rgb(238, 240, 242);\n background: var(--color-surface--background);\n cursor: default;\n}\n\n.PtlN3SI-Atc-:enabled + .VPZ0Os9TY5k- {\n cursor: pointer;\n}\n\n.PtlN3SI-Atc-:checked:focus + .VPZ0Os9TY5k- {\n background: rgb(81, 114, 9);\n background: var(--color-interactive--hover);\n}\n\n.PtlN3SI-Atc-:checked + .VPZ0Os9TY5k-:hover {\n background: rgb(81, 114, 9);\n background: var(--color-interactive--hover);\n}\n\n.PtlN3SI-Atc-:disabled:checked + .VPZ0Os9TY5k- {\n color: rgb(225, 225, 225);\n color: var(--color-disabled--secondary);\n background: rgb(181, 181, 181);\n background: var(--color-disabled);\n}\n";
|
|
36
32
|
var checkboxStyles = {"checkboxWrapper":"GXNuQVAsUqs-","dayCheckboxInput":"PtlN3SI-Atc-","dayCheckbox":"VPZ0Os9TY5k-"};
|
|
37
|
-
styleInject_es.styleInject(css_248z$4);
|
|
38
33
|
|
|
39
34
|
exports.WeekDay = void 0;
|
|
40
35
|
(function (WeekDay) {
|
|
@@ -98,16 +93,14 @@ function WeeklySelect({ onChange, selectedDays, disabled, }) {
|
|
|
98
93
|
};
|
|
99
94
|
return (React__default["default"].createElement("div", { className: styles$4.container }, weekDays.map(weekDay => {
|
|
100
95
|
const isSelected = selectedDays.has(weekDay);
|
|
101
|
-
const inputId =
|
|
96
|
+
const inputId = React.useId();
|
|
102
97
|
return (React__default["default"].createElement("div", { key: `${weekDay}`, className: checkboxStyles.checkboxWrapper },
|
|
103
98
|
React__default["default"].createElement("input", { className: checkboxStyles.dayCheckboxInput, disabled: disabled, type: "checkbox", onChange: onChangeWeekDays, id: `weekly-select-${weekDay}${inputId}`, "aria-checked": isSelected, checked: isSelected, value: weekDay }),
|
|
104
99
|
React__default["default"].createElement("label", { className: checkboxStyles.dayCheckbox, htmlFor: `weekly-select-${weekDay}${inputId}` }, `${exports.WeekDay[weekDay].substr(0, 1).toUpperCase()}`)));
|
|
105
100
|
})));
|
|
106
101
|
}
|
|
107
102
|
|
|
108
|
-
var css_248z$3 = ".PW6L4PJe5TY- div[role=\"radiogroup\"] {\n -ms-flex-direction: row;\n flex-direction: row;\n}\n\n.PW6L4PJe5TY- label {\n margin-right: calc(16px * 1);\n margin-right: var(--space-base);\n}\n";
|
|
109
103
|
var styles$3 = {"radioContainer":"PW6L4PJe5TY-"};
|
|
110
|
-
styleInject_es.styleInject(css_248z$3);
|
|
111
104
|
|
|
112
105
|
function MonthlySelect({ disabled, onChange, selectedMonthOption, }) {
|
|
113
106
|
return (React__default["default"].createElement("div", { className: styles$3.radioContainer },
|
|
@@ -116,9 +109,7 @@ function MonthlySelect({ disabled, onChange, selectedMonthOption, }) {
|
|
|
116
109
|
React__default["default"].createElement(RadioGroup.RadioOption, { disabled: disabled, value: exports.DurationPeriod.WeekDayOfMonth, label: "Day of week" }))));
|
|
117
110
|
}
|
|
118
111
|
|
|
119
|
-
var css_248z$2 = ".pqYw6oCVwO8- {\n display: grid;\n grid-template-columns: calc(16px * 3) 1fr;\n grid-template-columns: var(--space-largest) 1fr;\n -ms-flex-align: center;\n align-items: center;\n gap: calc(16px / 2);\n grid-gap: calc(16px / 2);\n grid-gap: var(--space-small);\n gap: var(--space-small);\n margin-bottom: calc(-1 * (16px / 16));\n margin-bottom: calc(-1 * calc(16px / 16));\n margin-bottom: calc(-1 * var(--border-base));\n}\n\n.xtCFaHyTmfI- div:nth-of-type(1) :last-child {\n border-top-right-radius: calc(16px / 4);\n border-top-right-radius: var(--radius-large);\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n border-top-left-radius: calc(16px / 4);\n border-top-left-radius: var(--radius-large);\n}\n\n.xtCFaHyTmfI- div:nth-of-type(2) :last-child {\n border-radius: 0;\n}\n\n.xtCFaHyTmfI- div:nth-of-type(3) :last-child {\n border-radius: 0;\n}\n\n.xtCFaHyTmfI- div:nth-of-type(4) :last-child {\n border-top-right-radius: 0;\n border-bottom-right-radius: calc(16px / 4);\n border-bottom-right-radius: var(--radius-large);\n border-bottom-left-radius: calc(16px / 4);\n border-bottom-left-radius: var(--radius-large);\n border-top-left-radius: 0;\n}\n";
|
|
120
112
|
var styles$2 = {"container":"pqYw6oCVwO8-","parentContainer":"xtCFaHyTmfI-"};
|
|
121
|
-
styleInject_es.styleInject(css_248z$2);
|
|
122
113
|
|
|
123
114
|
function MonthlyDayOfWeekSelect({ disabled, selectedWeeks, onChange, }) {
|
|
124
115
|
const orderString = ["1st", "2nd", "3rd", "4th"];
|
|
@@ -135,15 +126,13 @@ function MonthlyDayOfWeekSelect({ disabled, selectedWeeks, onChange, }) {
|
|
|
135
126
|
})));
|
|
136
127
|
}
|
|
137
128
|
|
|
138
|
-
var css_248z$1 = ".dBbFx0Vu16U- {\n display: grid;\n width: 100%;\n padding: calc(16px / 4);\n padding: var(--space-smaller);\n border: calc(16px / 16) solid rgb(217, 223, 225);\n border: var(--border-base) solid var(--color-border);\n border-radius: calc(16px / 4);\n border-radius: var(--radius-large);\n grid-template-areas:\n \". . . . . . .\"\n \". . . . . . .\"\n \". . . . . . .\"\n \". . . . . . .\"\n \". . . lastday lastday lastday lastday\";\n row-gap: calc(16px / 4);\n grid-row-gap: calc(16px / 4);\n grid-row-gap: var(--space-smaller);\n row-gap: var(--space-smaller);\n -webkit-column-gap: calc(16px / 4);\n -webkit-column-gap: var(--space-smaller);\n -moz-column-gap: calc(16px / 4);\n -moz-column-gap: var(--space-smaller);\n column-gap: calc(16px / 4);\n grid-column-gap: calc(16px / 4);\n grid-column-gap: var(--space-smaller);\n column-gap: var(--space-smaller);\n}\n\n.dBbFx0Vu16U- :last-child {\n grid-area: lastday;\n}\n\n.dBbFx0Vu16U- div:nth-child(n + 1):nth-last-child(-n + 1) label {\n height: 100%;\n}\n\n@supports (aspect-ratio: unset) {\n .dBbFx0Vu16U- div:nth-child(n + 1):nth-last-child(-n + 1) label {\n /*\n * disabling property-no-unknown here as this is a real property\n * that stylelint just doesn't know about. We may be able to remove\n * this when we update our stylelint to not care about IE11.\n */\n /* stylelint-disable-next-line property-no-unknown */\n aspect-ratio: unset;\n }\n}\n";
|
|
139
129
|
var styles$1 = {"container":"dBbFx0Vu16U-"};
|
|
140
|
-
styleInject_es.styleInject(css_248z$1);
|
|
141
130
|
|
|
142
131
|
const daysInMonth = [...Array.from({ length: 31 }, (_, i) => i + 1), "LAST"];
|
|
143
132
|
function DayOfMonthSelect({ selectedDays, disabled, onChange, }) {
|
|
144
133
|
return (React__default["default"].createElement("div", { className: styles$1.container }, daysInMonth.map(day => {
|
|
145
134
|
const isSelected = selectedDays.has(day);
|
|
146
|
-
const inputId =
|
|
135
|
+
const inputId = React.useId();
|
|
147
136
|
return (React__default["default"].createElement("div", { key: `${day}`, className: checkboxStyles.checkboxWrapper },
|
|
148
137
|
React__default["default"].createElement("input", { className: checkboxStyles.dayCheckboxInput, disabled: disabled, type: "checkbox", id: `${day}-${inputId}`, onChange: handleChangeDayOfMonth, "aria-checked": isSelected, checked: isSelected, value: day }),
|
|
149
138
|
React__default["default"].createElement("label", { className: checkboxStyles.dayCheckbox, htmlFor: `${day}-${inputId}` }, `${day === "LAST" ? "Last day" : day}`)));
|
|
@@ -188,9 +177,7 @@ function CurrentRecurrenceComponent({ recurrenceRule, disabled = false, onChange
|
|
|
188
177
|
}
|
|
189
178
|
}
|
|
190
179
|
|
|
191
|
-
var css_248z = ".ANBCH37jH0k- {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-align: center;\n align-items: center;\n gap: calc(16px * 1);\n gap: var(--space-base);\n}\n\n.ZV0GgII8eWQ- {\n width: 100%;\n}\n";
|
|
192
180
|
var styles = {"container":"ANBCH37jH0k-","fullWidthWrapper":"ZV0GgII8eWQ-"};
|
|
193
|
-
styleInject_es.styleInject(css_248z);
|
|
194
181
|
|
|
195
182
|
function RecurringSelect({ value, disabled = false, onChange, }) {
|
|
196
183
|
const disabledTextVariation = disabled ? "disabled" : undefined;
|
package/dist/Select/index.js
CHANGED
|
@@ -2,23 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var Option = require('../Option-
|
|
5
|
+
var Option = require('../Option-c84f28a6.js');
|
|
6
6
|
require('react');
|
|
7
|
-
require('../FormField-
|
|
8
|
-
require('../tslib.es6-
|
|
9
|
-
require('uuid');
|
|
7
|
+
require('../FormField-18eda132.js');
|
|
8
|
+
require('../tslib.es6-a575af05.js');
|
|
10
9
|
require('react-hook-form');
|
|
11
|
-
require('../style-inject.es-9d2f5f4e.js');
|
|
12
10
|
require('classnames');
|
|
13
|
-
require('
|
|
11
|
+
require('@jobber/hooks/useShowClear');
|
|
12
|
+
require('../Button-8bde6560.js');
|
|
14
13
|
require('react-router-dom');
|
|
15
|
-
require('../Icon-
|
|
14
|
+
require('../Icon-361343e0.js');
|
|
16
15
|
require('@jobber/design');
|
|
17
|
-
require('../Typography-
|
|
18
|
-
require('../Text-
|
|
19
|
-
require('../InputValidation-
|
|
16
|
+
require('../Typography-75f58b60.js');
|
|
17
|
+
require('../Text-9f261dde.js');
|
|
18
|
+
require('../InputValidation-fdc891af.js');
|
|
20
19
|
require('framer-motion');
|
|
21
|
-
require('../Spinner-
|
|
20
|
+
require('../Spinner-cac356ee.js');
|
|
22
21
|
|
|
23
22
|
|
|
24
23
|
|
package/dist/Spinner/index.js
CHANGED
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var Spinner = require('../Spinner-
|
|
5
|
+
var Spinner = require('../Spinner-cac356ee.js');
|
|
6
6
|
require('react');
|
|
7
7
|
require('classnames');
|
|
8
|
-
require('../style-inject.es-9d2f5f4e.js');
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var classnames = require('classnames');
|
|
5
|
+
|
|
6
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
7
|
+
|
|
8
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
9
|
+
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
10
|
+
|
|
11
|
+
var styles = {"spinner":"uoU-LfjFDv0-","animationSpin":"_1aCKd5q9u34-","small":"cLRQwkSqnhA-","inline":"h6O4vDPCWOQ-"};
|
|
12
|
+
|
|
13
|
+
function Spinner({ size = "base", inline }) {
|
|
14
|
+
const spinnerStyles = classnames__default["default"](styles.spinner, {
|
|
15
|
+
[styles.small]: size === "small",
|
|
16
|
+
[styles.inline]: inline,
|
|
17
|
+
});
|
|
18
|
+
return (React__default["default"].createElement("div", { className: spinnerStyles, role: "alert", "aria-busy": true, "aria-label": "loading" }));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
exports.Spinner = Spinner;
|
|
@@ -4,18 +4,15 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var classnames = require('classnames');
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
require('../Typography-973b122e.js');
|
|
7
|
+
var Text = require('../Text-9f261dde.js');
|
|
8
|
+
require('../Typography-75f58b60.js');
|
|
10
9
|
|
|
11
10
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
11
|
|
|
13
12
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
13
|
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
15
14
|
|
|
16
|
-
var css_248z = ":root {\n --statusLabel-icon-diameter: calc(var(--space-base) - var(--space-smaller));\n}\n\n.MB0ycTR4PHg- {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-direction: row;\n flex-direction: row;\n -ms-flex-wrap: nowrap;\n flex-wrap: nowrap;\n gap: calc(16px / 2);\n gap: var(--space-small);\n width: -webkit-fit-content;\n width: -moz-fit-content;\n width: fit-content;\n}\n\n.fNl6zDhsox0- {\n width: calc((16px * 1) - (16px / 4));\n width: calc(calc(16px * 1) - calc(16px / 4));\n width: var(--statusLabel-icon-diameter);\n height: calc((16px * 1) - (16px / 4));\n height: calc(calc(16px * 1) - calc(16px / 4));\n height: var(--statusLabel-icon-diameter);\n margin-top: calc(16px / 16);\n margin-top: var(--space-minuscule);\n border-radius: calc(16px / 8);\n border-radius: var(--radius-base);\n background-color: rgb(125, 176, 14);\n background-color: var(--color-success);\n -ms-flex-negative: 0;\n flex-shrink: 0;\n}\n\n._0kNfkSPBETw- {\n -ms-flex-direction: row-reverse;\n flex-direction: row-reverse;\n}\n";
|
|
17
15
|
var styles = {"statusLabelRow":"MB0ycTR4PHg-","statusIndicator":"fNl6zDhsox0-","labelTextEndAligned":"_0kNfkSPBETw-"};
|
|
18
|
-
styleInject_es.styleInject(css_248z);
|
|
19
16
|
|
|
20
17
|
function StatusLabel({ label, alignment = "start", status = "inactive", }) {
|
|
21
18
|
const containerClassNames = classnames__default["default"](styles.statusLabelRow, alignment === "end" && styles.labelTextEndAligned);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// https://stackoverflow.com/a/10199306/1611058
|
|
4
|
+
function get_time_support() {
|
|
5
|
+
var input = document.createElement('input');
|
|
6
|
+
input.setAttribute('type', 'time');
|
|
7
|
+
var notValid = 'not-a-time';
|
|
8
|
+
input.setAttribute('value', notValid);
|
|
9
|
+
return input.value !== notValid;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
var timeSupport = get_time_support();
|
|
13
|
+
if (window) window.supportsTime = timeSupport;
|
|
14
|
+
|
|
15
|
+
var supportsTime = timeSupport;
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
var supportsTime$1 = supportsTime;
|
|
20
|
+
|
|
21
|
+
exports.supportsTime = supportsTime$1;
|
package/dist/Switch/index.js
CHANGED
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var Switch = require('../Switch-
|
|
5
|
+
var Switch = require('../Switch-588c5e70.js');
|
|
6
6
|
require('react');
|
|
7
7
|
require('classnames');
|
|
8
|
-
require('../
|
|
9
|
-
require('../Typography-973b122e.js');
|
|
8
|
+
require('../Typography-75f58b60.js');
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var classnames = require('classnames');
|
|
5
|
+
var Typography = require('./Typography-75f58b60.js');
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
10
|
+
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
11
|
+
|
|
12
|
+
var styles = {"track":"NaSI2jsLI0c-","isChecked":"HbAoDMJhkwY-","toggle":"cc259FtdxeE-","label":"YZ-HIehHOBA-","pip":"_2hxova2FHpM-","disabled":"_6hWvJHjyLlk-"};
|
|
13
|
+
|
|
14
|
+
function Switch({ value: providedValue, ariaLabel, name, disabled, onChange, }) {
|
|
15
|
+
const [statefulValue, setValue] = React.useState(false);
|
|
16
|
+
const value = providedValue != undefined ? providedValue : statefulValue;
|
|
17
|
+
const toggleSwitch = () => {
|
|
18
|
+
if (disabled) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const newValue = !value;
|
|
22
|
+
onChange && onChange(newValue);
|
|
23
|
+
if (providedValue == undefined) {
|
|
24
|
+
setValue(newValue);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const className = classnames__default["default"](styles.track, {
|
|
28
|
+
[styles.isChecked]: value,
|
|
29
|
+
[styles.disabled]: disabled,
|
|
30
|
+
});
|
|
31
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
32
|
+
React__default["default"].createElement("button", { id: name, type: "button", role: "switch", "aria-checked": value, "aria-label": ariaLabel, className: className, onClick: toggleSwitch, disabled: disabled },
|
|
33
|
+
React__default["default"].createElement("span", { className: styles.toggle },
|
|
34
|
+
React__default["default"].createElement(Label, { as: "On", disabled: disabled }),
|
|
35
|
+
React__default["default"].createElement("span", { className: styles.pip }),
|
|
36
|
+
React__default["default"].createElement(Label, { as: "Off", disabled: disabled }))),
|
|
37
|
+
React__default["default"].createElement("input", { name: name, type: "hidden", value: String(value) })));
|
|
38
|
+
}
|
|
39
|
+
function Label({ as, disabled }) {
|
|
40
|
+
const getTextColor = () => {
|
|
41
|
+
if (disabled) {
|
|
42
|
+
return "grey";
|
|
43
|
+
}
|
|
44
|
+
else if (as === "On") {
|
|
45
|
+
return "white";
|
|
46
|
+
}
|
|
47
|
+
return "greyBlue";
|
|
48
|
+
};
|
|
49
|
+
return (React__default["default"].createElement("span", { className: styles.label },
|
|
50
|
+
React__default["default"].createElement(Typography.Typography, { element: "span", textColor: getTextColor(), size: "small", fontWeight: "bold", textCase: "uppercase" }, as)));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
exports.Switch = Switch;
|
package/dist/Table/index.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var styleInject_es = require('../style-inject.es-9d2f5f4e.js');
|
|
7
6
|
var classnames = require('classnames');
|
|
8
7
|
var formatters = require('@jobber/formatters');
|
|
9
8
|
|
|
@@ -12,9 +11,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
12
11
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
13
12
|
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
14
13
|
|
|
15
|
-
var css_248z$1 = ".gFY9BLPF808- {\n --border-color: var(--color-border);\n --header-border-color: var(--color-border--section);\n --horizontal-inset: var(--space-base);\n position: relative;\n width: 100%;\n border-collapse: collapse;\n}\n\n.gFY9BLPF808-::after {\n content: \"\";\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n border: solid calc(16px / 16) var(--border-color);\n border: solid var(--border-base) var(--border-color);\n border-radius: calc(16px / 8);\n border-radius: var(--radius-base);\n pointer-events: none;\n}\n\n.NZbmlKVakYo-:not(:last-child) {\n border-bottom: solid calc(16px / 16) var(--border-color);\n border-bottom: solid var(--border-base) var(--border-color);\n}\n\n._72-uJqZ5jGE- .NZbmlKVakYo- {\n border-bottom: solid calc(16px / 16) var(--header-border-color);\n border-bottom: solid var(--border-base) var(--header-border-color);\n font-weight: bold;\n text-transform: uppercase;\n}\n\n.fEVdTCw9eOU- .NZbmlKVakYo- {\n border-top: solid calc(16px / 4) var(--border-color);\n border-top: solid var(--border-thicker) var(--border-color);\n}\n";
|
|
16
14
|
var styles$1 = {"table":"gFY9BLPF808-","row":"NZbmlKVakYo-","header":"_72-uJqZ5jGE-","footer":"fEVdTCw9eOU-"};
|
|
17
|
-
styleInject_es.styleInject(css_248z$1);
|
|
18
15
|
|
|
19
16
|
function Table({ children }) {
|
|
20
17
|
return React__default["default"].createElement("table", { className: styles$1.table }, children);
|
|
@@ -24,9 +21,7 @@ function Row({ children }) {
|
|
|
24
21
|
return React__default["default"].createElement("tr", { className: styles$1.row }, children);
|
|
25
22
|
}
|
|
26
23
|
|
|
27
|
-
var css_248z = ".xibCW9zSMXU- {\n padding: var(--horizontal-inset) calc(var(--horizontal-inset) / 2);\n text-align: left;\n}\n\n.SD8FBgvYMQg- {\n text-align: left;\n}\n\n._5VZpkU0Gu40- {\n text-align: center;\n}\n\n.DNPkTtpA-8g- {\n text-align: right;\n}\n\n._5EfJs7A9kEg- {\n -webkit-font-feature-settings: \"tnum\";\n font-feature-settings: \"tnum\";\n}\n\n.xibCW9zSMXU-:first-child {\n padding-left: var(--horizontal-inset);\n}\n\n.xibCW9zSMXU-:last-child {\n padding-right: var(--horizontal-inset);\n}\n";
|
|
28
24
|
var styles = {"cell":"xibCW9zSMXU-","left":"SD8FBgvYMQg-","center":"_5VZpkU0Gu40-","right":"DNPkTtpA-8g-","numeric":"_5EfJs7A9kEg-"};
|
|
29
|
-
styleInject_es.styleInject(css_248z);
|
|
30
25
|
|
|
31
26
|
function Cell({ children, align = "left" }) {
|
|
32
27
|
const className = classnames__default["default"](styles.cell, styles[align]);
|
package/dist/Tabs/index.js
CHANGED
|
@@ -4,17 +4,14 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var classnames = require('classnames');
|
|
7
|
-
var
|
|
8
|
-
var Typography = require('../Typography-973b122e.js');
|
|
7
|
+
var Typography = require('../Typography-75f58b60.js');
|
|
9
8
|
|
|
10
9
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
10
|
|
|
12
11
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
13
12
|
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
14
13
|
|
|
15
|
-
var css_248z = ":root {\n --tab--height: calc(var(--space-larger) + var(--space-small));\n --tab--inset: var(--space-base);\n --public-tab--inset: var(--tab--inset);\n}\n\n.-kxlqXO5UN0- {\n display: block;\n width: 100%;\n}\n\n.qI4lWMSNH40- {\n position: relative;\n border-bottom: solid calc(16px / 16) rgb(217, 223, 225);\n border-bottom: solid var(--border-base) var(--color-border);\n}\n\n.xohIah5wcoE-:after,\n.qnY4S9sz-8g-:before {\n content: \"\";\n position: absolute;\n top: 0;\n bottom: 0;\n width: 24px;\n}\n\n.xohIah5wcoE-:after {\n right: 0;\n box-shadow: inset -16px 0 16px -16px rgba(0, 0, 0, 0.25);\n box-shadow: inset -16px 0 16px -16px rgba(var(--color-black--rgb), 0.25);\n}\n\n.qnY4S9sz-8g-:before {\n left: 0;\n box-shadow: inset 16px 0 16px -16px rgba(0, 0, 0, 0.25);\n box-shadow: inset 16px 0 16px -16px rgba(var(--color-black--rgb), 0.25);\n}\n\n.wdW31G8Trag- {\n display: -ms-flexbox;\n display: flex;\n margin: 0;\n margin-bottom: calc(-1 * (16px / 16));\n margin-bottom: calc(-1 * calc(16px / 16));\n margin-bottom: calc(-1 * var(--border-base));\n overflow-x: auto;\n -webkit-overflow-scrolling: touch;\n}\n\nul.wdW31G8Trag- {\n -webkit-padding-start: 0;\n padding-left: 0;\n}\n\n.wdW31G8Trag- li {\n display: -ms-flexbox;\n display: flex;\n list-style: none;\n}\n\n.MO7CXQ8xJXo- {\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n height: calc((16px * 2) + (16px / 2));\n height: calc(calc(16px * 2) + calc(16px / 2));\n height: var(--tab--height);\n margin: 0;\n padding-left: calc(16px * 1);\n padding-left: var(--public-tab--inset);\n padding-right: calc(16px * 1);\n padding-right: var(--public-tab--inset);\n border: solid calc(16px / 16) rgb(217, 223, 225);\n border: solid var(--border-base) var(--color-border);\n border-left-width: 0;\n outline: none;\n background: rgba(255, 255, 255, 1);\n background: var(--color-surface);\n cursor: pointer;\n transition: all 200ms;\n transition: all var(--timing-base);\n}\n\n.MO7CXQ8xJXo-:hover,\n.MO7CXQ8xJXo-:focus {\n background-color: rgb(244, 246, 250);\n background-color: var(--color-surface--hover);\n}\n\n.MO7CXQ8xJXo-:focus span {\n box-shadow: 0px 0px 0px calc(16px / 8) rgba(255, 255, 255, 1),\n 0px 0px 0px calc(16px / 4) rgb(147, 161, 169);\n box-shadow: var(--shadow-focus);\n}\n\n.kqof65gyv7g- {\n border-top-color: rgb(125, 176, 14);\n border-top-color: var(--color-interactive);\n border-bottom-color: rgba(255, 255, 255, 1);\n border-bottom-color: var(--color-surface);\n}\n\n.kqof65gyv7g-:focus {\n background-color: transparent;\n}\n\n.AimQioztR1U- {\n padding-top: calc(16px * 1);\n padding-top: var(--tab--inset);\n padding-bottom: calc(16px * 1);\n padding-bottom: var(--tab--inset);\n padding-left: calc(16px * 1);\n padding-left: var(--public-tab--inset);\n padding-right: calc(16px * 1);\n padding-right: var(--public-tab--inset);\n}\n";
|
|
16
14
|
var styles = {"tabs":"-kxlqXO5UN0-","overflow":"qI4lWMSNH40-","overflowRight":"xohIah5wcoE-","overflowLeft":"qnY4S9sz-8g-","tabRow":"wdW31G8Trag-","tab":"MO7CXQ8xJXo-","selected":"kqof65gyv7g-","tabContent":"AimQioztR1U-"};
|
|
17
|
-
styleInject_es.styleInject(css_248z);
|
|
18
15
|
|
|
19
16
|
function Tabs({ children, defaultTab = 0, onTabChange }) {
|
|
20
17
|
const activeTabInitialValue = defaultTab < React__default["default"].Children.count(children) ? defaultTab : 0;
|
package/dist/Text/index.js
CHANGED
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var Text = require('../Text-
|
|
5
|
+
var Text = require('../Text-9f261dde.js');
|
|
6
6
|
require('react');
|
|
7
|
-
require('../Typography-
|
|
7
|
+
require('../Typography-75f58b60.js');
|
|
8
8
|
require('classnames');
|
|
9
|
-
require('../style-inject.es-9d2f5f4e.js');
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
|
|
@@ -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-75f58b60.js');
|
|
5
5
|
|
|
6
6
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
7
7
|
|