@jobber/components 2.86.0 → 2.86.2
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 +16 -0
- package/dist/Autocomplete/Autocomplete.d.ts +47 -47
- package/dist/Autocomplete/Menu.d.ts +9 -9
- package/dist/Autocomplete/Option.d.ts +15 -15
- package/dist/Autocomplete/index.d.ts +2 -2
- package/dist/Autocomplete/index.js +215 -211
- package/dist/Avatar/Avatar.d.ts +37 -37
- package/dist/Avatar/index.d.ts +1 -1
- package/dist/Avatar/index.js +7 -74
- package/dist/Avatar/utilities.d.ts +1 -1
- package/dist/Avatar-cfd04e86.js +82 -0
- package/dist/Banner/Banner.d.ts +19 -19
- package/dist/Banner/index.d.ts +1 -1
- package/dist/Banner/index.js +67 -65
- package/dist/Button/Button.d.ts +64 -64
- package/dist/Button/index.d.ts +1 -1
- package/dist/Button/index.js +9 -53
- package/dist/Button-5b2f1636.js +60 -0
- package/dist/ButtonDismiss/ButtonDismiss.d.ts +7 -7
- package/dist/ButtonDismiss/index.d.ts +1 -1
- package/dist/ButtonDismiss/index.js +10 -15
- package/dist/ButtonDismiss-4cde8f7c.js +15 -0
- package/dist/Card/Card.d.ts +31 -31
- package/dist/Card/CardClickable.d.ts +12 -12
- package/dist/Card/index.d.ts +1 -1
- package/dist/Card/index.js +7 -61
- package/dist/Card-368e01a3.js +68 -0
- package/dist/Checkbox/Checkbox.d.ts +52 -52
- package/dist/Checkbox/index.d.ts +1 -1
- package/dist/Checkbox/index.js +34 -32
- package/dist/Chips/Chip.d.ts +8 -8
- package/dist/Chips/ChipDismissible.d.ts +7 -7
- package/dist/Chips/ChipTypes.d.ts +59 -59
- package/dist/Chips/Chips.d.ts +2 -2
- package/dist/Chips/ChipsTypes.d.ts +82 -82
- package/dist/Chips/InternalChip.d.ts +2 -2
- package/dist/Chips/InternalChipAffix.d.ts +10 -10
- package/dist/Chips/InternalChipButton.d.ts +10 -10
- package/dist/Chips/InternalChipDismissible/InternalChipDismissible.d.ts +2 -2
- package/dist/Chips/InternalChipDismissible/InternalChipDismissibleInput.d.ts +2 -2
- package/dist/Chips/InternalChipDismissible/InternalChipDismissibleTypes.d.ts +13 -13
- package/dist/Chips/InternalChipDismissible/hooks/index.d.ts +5 -5
- package/dist/Chips/InternalChipDismissible/hooks/useInView.d.ts +5 -5
- package/dist/Chips/InternalChipDismissible/hooks/useInternalChipDismissible.d.ts +15 -15
- package/dist/Chips/InternalChipDismissible/hooks/useInternalChipDismissibleInput.d.ts +28 -28
- package/dist/Chips/InternalChipDismissible/hooks/useRepositionMenu.d.ts +16 -16
- package/dist/Chips/InternalChipDismissible/hooks/useScrollToActive.d.ts +2 -2
- package/dist/Chips/InternalChipDismissible/index.d.ts +1 -1
- package/dist/Chips/InternalChipMultiSelect.d.ts +4 -4
- package/dist/Chips/InternalChipSingleSelect.d.ts +4 -4
- package/dist/Chips/index.d.ts +3 -3
- package/dist/Chips/index.js +493 -491
- package/dist/Chips/utils/mdxUtils.d.ts +9 -9
- package/dist/ConfirmationModal/ConfirmationModal.d.ts +62 -62
- package/dist/ConfirmationModal/index.d.ts +1 -1
- package/dist/ConfirmationModal/index.js +20 -109
- package/dist/ConfirmationModal-b7ef110f.js +103 -0
- package/dist/Content/Content.d.ts +13 -13
- package/dist/Content/index.d.ts +1 -1
- package/dist/Content/index.js +5 -19
- package/dist/Content-18de5fbb.js +26 -0
- package/dist/Countdown/Countdown.d.ts +31 -31
- package/dist/Countdown/computeTimeUnit.d.ts +3 -3
- package/dist/Countdown/index.d.ts +1 -1
- package/dist/Countdown/index.js +63 -61
- package/dist/DataDump/DataDump.d.ts +20 -20
- package/dist/DataDump/index.d.ts +1 -1
- package/dist/DataDump/index.js +18 -17
- package/dist/DatePicker/DatePicker.d.ts +50 -50
- package/dist/DatePicker/DatePickerActivator.d.ts +12 -12
- package/dist/DatePicker/DatePickerCustomHeader.d.ts +2 -2
- package/dist/DatePicker/index.d.ts +1 -1
- package/dist/DatePicker/index.js +13 -97
- package/dist/DatePicker/useFocusOnSelectedDate.d.ts +5 -5
- package/dist/DatePicker-ad6f8630.js +103 -0
- package/dist/DescriptionList/DescriptionList.d.ts +10 -10
- package/dist/DescriptionList/index.d.ts +1 -1
- package/dist/DescriptionList/index.js +16 -15
- package/dist/Disclosure/Disclosure.d.ts +20 -20
- package/dist/Disclosure/index.d.ts +1 -1
- package/dist/Disclosure/index.js +32 -31
- package/dist/Divider/Divider.d.ts +16 -16
- package/dist/Divider/index.d.ts +1 -1
- package/dist/Divider/index.js +19 -17
- package/dist/Drawer/Drawer.d.ts +13 -13
- package/dist/Drawer/DrawerGrid.d.ts +6 -6
- package/dist/Drawer/index.d.ts +2 -2
- package/dist/Drawer/index.js +39 -37
- package/dist/Emphasis/Emphasis.d.ts +11 -11
- package/dist/Emphasis/index.d.ts +1 -1
- package/dist/Emphasis/index.js +7 -17
- package/dist/Emphasis-fd845639.js +21 -0
- package/dist/FeatureSwitch/FeatureSwitch.d.ts +51 -51
- package/dist/FeatureSwitch/index.d.ts +1 -1
- package/dist/FeatureSwitch/index.js +57 -55
- package/dist/Form/Form.d.ts +18 -18
- package/dist/Form/index.d.ts +1 -1
- package/dist/Form/index.js +58 -57
- package/dist/FormField/FormField.d.ts +2 -2
- package/dist/FormField/FormFieldAffix.d.ts +13 -13
- package/dist/FormField/FormFieldDescription.d.ts +6 -6
- package/dist/FormField/FormFieldPostFix.d.ts +5 -5
- package/dist/FormField/FormFieldTypes.d.ts +160 -160
- package/dist/FormField/FormFieldWrapper.d.ts +9 -9
- package/dist/FormField/index.d.ts +2 -2
- package/dist/FormField/index.js +15 -208
- package/dist/FormField-a92c7bac.js +213 -0
- package/dist/FormatDate/FormatDate.d.ts +12 -12
- package/dist/FormatDate/index.d.ts +1 -1
- package/dist/FormatDate/index.js +24 -23
- package/dist/FormatEmail/FormatEmail.d.ts +8 -8
- package/dist/FormatEmail/index.d.ts +1 -1
- package/dist/FormatEmail/index.js +12 -10
- package/dist/FormatFile/FormatFile.d.ts +30 -30
- package/dist/FormatFile/FormatFileDeleteButton.d.ts +6 -6
- package/dist/FormatFile/InternalThumbnail.d.ts +9 -9
- package/dist/FormatFile/index.d.ts +1 -1
- package/dist/FormatFile/index.js +21 -112
- package/dist/FormatFile-5391d4cf.js +112 -0
- package/dist/FormatRelativeDateTime/FormatRelativeDateTime.d.ts +11 -11
- package/dist/FormatRelativeDateTime/index.d.ts +1 -1
- package/dist/FormatRelativeDateTime/index.js +64 -63
- package/dist/FormatTime/FormatTime.d.ts +15 -15
- package/dist/FormatTime/index.d.ts +1 -1
- package/dist/FormatTime/index.js +28 -27
- package/dist/Gallery/Gallery.d.ts +2 -2
- package/dist/Gallery/GalleryTypes.d.ts +31 -31
- package/dist/Gallery/index.d.ts +1 -1
- package/dist/Gallery/index.js +82 -80
- package/dist/Heading/Heading.d.ts +14 -14
- package/dist/Heading/index.d.ts +1 -1
- package/dist/Heading/index.js +7 -53
- package/dist/Heading-56750113.js +57 -0
- package/dist/Icon/Icon.d.ts +22 -22
- package/dist/Icon/index.d.ts +1 -1
- package/dist/Icon/index.js +4 -35
- package/dist/Icon-d5ad1a6d.js +41 -0
- package/dist/InlineLabel/InlineLabel.d.ts +17 -17
- package/dist/InlineLabel/index.d.ts +1 -1
- package/dist/InlineLabel/index.js +20 -18
- package/dist/InputAvatar/InputAvatar.d.ts +22 -22
- package/dist/InputAvatar/index.d.ts +1 -1
- package/dist/InputAvatar/index.js +57 -56
- package/dist/InputDate/InputDate.d.ts +19 -19
- package/dist/InputDate/index.d.ts +1 -1
- package/dist/InputDate/index.js +34 -33
- package/dist/InputEmail/InputEmail.d.ts +5 -5
- package/dist/InputEmail/index.d.ts +1 -1
- package/dist/InputEmail/index.js +29 -28
- package/dist/InputFile/InputFile.d.ts +121 -121
- package/dist/InputFile/index.d.ts +1 -1
- package/dist/InputFile/index.js +15 -168
- package/dist/InputFile-b5cf90c3.js +174 -0
- package/dist/InputGroup/InputGroup.d.ts +11 -11
- package/dist/InputGroup/index.d.ts +1 -1
- package/dist/InputGroup/index.js +24 -22
- package/dist/InputNumber/InputNumber.d.ts +11 -11
- package/dist/InputNumber/index.d.ts +1 -1
- package/dist/InputNumber/index.js +52 -51
- package/dist/InputPassword/InputPassword.d.ts +12 -12
- package/dist/InputPassword/index.d.ts +1 -1
- package/dist/InputPassword/index.js +28 -27
- package/dist/InputText/InputText.d.ts +29 -29
- package/dist/InputText/index.d.ts +1 -1
- package/dist/InputText/index.js +15 -95
- package/dist/InputText-cb3be15c.js +91 -0
- package/dist/InputTime/InputTime.d.ts +2 -2
- package/dist/InputTime/InputTimeProps.d.ts +18 -18
- package/dist/InputTime/InputTimeSafari.d.ts +2 -2
- package/dist/InputTime/civilTimeConversions.d.ts +3 -3
- package/dist/InputTime/index.d.ts +1 -1
- package/dist/InputTime/index.js +402 -257
- package/dist/InputValidation/InputValidation.d.ts +8 -8
- package/dist/InputValidation/index.d.ts +1 -1
- package/dist/InputValidation/index.js +8 -24
- package/dist/InputValidation-24d3621a.js +28 -0
- package/dist/LightBox/LightBox.d.ts +37 -37
- package/dist/LightBox/index.d.ts +1 -1
- package/dist/LightBox/index.js +6 -34
- package/dist/LightBox-b893b656.js +42 -0
- package/dist/List/List.d.ts +11 -11
- package/dist/List/ListItem.d.ts +54 -54
- package/dist/List/index.d.ts +1 -1
- package/dist/List/index.js +76 -74
- package/dist/Markdown/Markdown.d.ts +17 -17
- package/dist/Markdown/index.d.ts +1 -1
- package/dist/Markdown/index.js +12 -64
- package/dist/Markdown-69986c49.js +68 -0
- package/dist/Menu/Menu.d.ts +46 -46
- package/dist/Menu/index.d.ts +1 -1
- package/dist/Menu/index.js +13 -128
- package/dist/Menu-6a392af6.js +134 -0
- package/dist/Modal/Modal.d.ts +22 -22
- package/dist/Modal/index.d.ts +1 -1
- package/dist/Modal/index.js +14 -127
- package/dist/Modal/useFocusTrap.d.ts +10 -10
- package/dist/Modal-aaaaf2df.js +132 -0
- package/dist/Page/Page.d.ts +59 -59
- package/dist/Page/index.d.ts +1 -1
- package/dist/Page/index.js +63 -61
- package/dist/Popover/Popover.d.ts +26 -26
- package/dist/Popover/index.d.ts +1 -1
- package/dist/Popover/index.js +49 -48
- package/dist/ProgressBar/ProgressBar.d.ts +18 -18
- package/dist/ProgressBar/index.d.ts +1 -1
- package/dist/ProgressBar/index.js +5 -22
- package/dist/ProgressBar-e9a49129.js +29 -0
- package/dist/RadioGroup/RadioGroup.d.ts +27 -27
- package/dist/RadioGroup/RadioOption.d.ts +34 -34
- package/dist/RadioGroup/index.d.ts +2 -2
- package/dist/RadioGroup/index.js +38 -37
- package/dist/RecurringSelect/CurrentRecurrenceComponent.d.ts +8 -8
- package/dist/RecurringSelect/RecurringSelect.d.ts +8 -8
- package/dist/RecurringSelect/components/DayOfMonthSelect.d.ts +8 -8
- package/dist/RecurringSelect/components/MonthlyDayOfWeekSelect.d.ts +8 -8
- package/dist/RecurringSelect/components/MonthlySelect.d.ts +8 -8
- package/dist/RecurringSelect/components/WeeklySelect.d.ts +8 -8
- package/dist/RecurringSelect/components/index.d.ts +4 -4
- package/dist/RecurringSelect/index.d.ts +2 -2
- package/dist/RecurringSelect/types.d.ts +65 -65
- package/dist/Select/Option.d.ts +17 -17
- package/dist/Select/Select.d.ts +10 -10
- package/dist/Select/index.d.ts +2 -2
- package/dist/Select/index.js +20 -19
- package/dist/Spinner/Spinner.d.ts +15 -15
- package/dist/Spinner/index.d.ts +1 -1
- package/dist/Spinner/index.js +5 -19
- package/dist/Spinner-18d3dee6.js +26 -0
- package/dist/StatusLabel/StatusLabel.d.ts +25 -25
- package/dist/StatusLabel/index.d.ts +1 -1
- package/dist/StatusLabel/index.js +21 -19
- package/dist/Switch/Switch.d.ts +14 -14
- package/dist/Switch/index.d.ts +1 -1
- package/dist/Switch/index.js +7 -53
- package/dist/Switch-d2bec677.js +60 -0
- package/dist/Table/Body.d.ts +6 -6
- package/dist/Table/Cells/Cell.d.ts +7 -7
- package/dist/Table/Cells/CellCurrency.d.ts +8 -8
- package/dist/Table/Cells/CellNumeric.d.ts +4 -4
- package/dist/Table/Footer.d.ts +6 -6
- package/dist/Table/Header.d.ts +6 -6
- package/dist/Table/Row.d.ts +6 -6
- package/dist/Table/Table.d.ts +6 -6
- package/dist/Table/index.d.ts +8 -8
- package/dist/Table/index.js +41 -39
- package/dist/Tabs/Tabs.d.ts +19 -19
- package/dist/Tabs/index.d.ts +1 -1
- package/dist/Tabs/index.js +69 -67
- package/dist/Text/Text.d.ts +9 -9
- package/dist/Text/index.d.ts +1 -1
- package/dist/Text/index.js +7 -29
- package/dist/Text-9bc093e9.js +32 -0
- package/dist/Toast/Toast.d.ts +17 -17
- package/dist/Toast/index.d.ts +1 -1
- package/dist/Toast/index.js +93 -93
- package/dist/Toast/showToast.d.ts +2 -2
- package/dist/Tooltip/Tooltip.d.ts +10 -10
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/Tooltip/index.js +11 -110
- package/dist/Tooltip/useTooltipPositioning.d.ts +18 -18
- package/dist/Tooltip-4396164d.js +116 -0
- package/dist/Typography/Typography.d.ts +38 -38
- package/dist/Typography/index.d.ts +1 -1
- package/dist/Typography/index.js +6 -57
- package/dist/Typography-7e542a72.js +64 -0
- package/dist/{chunk-17e02351.js → style-inject.es-dcee06b6.js} +0 -0
- package/dist/{chunk-b67af3cb.js → tslib.es6-5b50eb8e.js} +0 -0
- package/package.json +6 -8
- package/rollup.config.js +28 -3
package/dist/Popover/index.js
CHANGED
|
@@ -2,61 +2,62 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var __chunk_1 = require('../chunk-b67af3cb.js');
|
|
5
|
+
var tslib_es6 = require('../tslib.es6-5b50eb8e.js');
|
|
8
6
|
var React = require('react');
|
|
9
|
-
var
|
|
10
|
-
var
|
|
7
|
+
var reactPopper = require('react-popper');
|
|
8
|
+
var hooks = require('@jobber/hooks');
|
|
9
|
+
var styleInject_es = require('../style-inject.es-dcee06b6.js');
|
|
10
|
+
var ButtonDismiss = require('../ButtonDismiss-4cde8f7c.js');
|
|
11
|
+
require('../Button-5b2f1636.js');
|
|
11
12
|
require('classnames');
|
|
12
|
-
require('../Typography/index.js');
|
|
13
|
-
require('@jobber/design');
|
|
14
|
-
require('../Icon/index.js');
|
|
15
13
|
require('react-router-dom');
|
|
16
|
-
require('../
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
require('../Icon-d5ad1a6d.js');
|
|
15
|
+
require('@jobber/design');
|
|
16
|
+
require('../Typography-7e542a72.js');
|
|
17
|
+
|
|
18
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
|
+
|
|
20
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
20
21
|
|
|
21
22
|
var css = ":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.bmcwfoRgxW9uxv0uyXH04 {\n display: -ms-flexbox;\n display: flex;\n position: \"relative\";\n padding: var(--space-base);\n padding: var(--space-base);\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.TjIegPUFwvTBnPHT-hzfN {\n float: right;\n padding: calc(var(--base-unit) / 4);\n padding: calc(var(--base-unit) / 4);\n padding: var(--dismiss--button-padding);\n text-align: right;\n}\n\n._1v-Ekqld7VhWiu8_bFt62z {\n z-index: var(--elevation-tooltip);\n width: -webkit-max-content;\n width: -moz-max-content;\n width: max-content;\n max-width: calc(var(--base-unit) * 21.875);\n max-width: calc(var(--base-unit) * 21.875);\n max-width: var(--popover--width);\n box-shadow: var(--shadow-base);\n border: var(--border-base) solid var(--color-border);\n border-radius: var(--radius-base);\n font-size: var(--base-unit);\n line-height: normal;\n background: var(--color-surface);\n}\n\n._1v-Ekqld7VhWiu8_bFt62z > * {\n --public-content--padding: var(--card--base-padding);\n}\n\n.ZBY5pcUZw7V-86CZwsJcF {\n visibility: hidden;\n}\n\n.ZBY5pcUZw7V-86CZwsJcF,\n.ZBY5pcUZw7V-86CZwsJcF::before {\n position: absolute;\n width: var(--base-unit);\n height: var(--base-unit);\n background: inherit;\n}\n\n.ZBY5pcUZw7V-86CZwsJcF::before {\n content: \"\";\n visibility: visible;\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._1v-Ekqld7VhWiu8_bFt62z[data-popper-placement^=\"top\"] > .ZBY5pcUZw7V-86CZwsJcF {\n bottom: -5px;\n}\n\n._1v-Ekqld7VhWiu8_bFt62z[data-popper-placement^=\"top\"] > .ZBY5pcUZw7V-86CZwsJcF::before {\n -webkit-transform: rotate(-135deg);\n transform: rotate(-135deg);\n}\n\n._1v-Ekqld7VhWiu8_bFt62z[data-popper-placement^=\"bottom\"] > .ZBY5pcUZw7V-86CZwsJcF {\n top: -7px;\n}\n\n._1v-Ekqld7VhWiu8_bFt62z[data-popper-placement^=\"left\"] > .ZBY5pcUZw7V-86CZwsJcF {\n right: -5px;\n}\n\n._1v-Ekqld7VhWiu8_bFt62z[data-popper-placement^=\"left\"] > .ZBY5pcUZw7V-86CZwsJcF::before {\n -webkit-transform: rotate(135deg);\n transform: rotate(135deg);\n}\n\n._1v-Ekqld7VhWiu8_bFt62z[data-popper-placement^=\"right\"] > .ZBY5pcUZw7V-86CZwsJcF {\n left: -7px;\n}\n\n._1v-Ekqld7VhWiu8_bFt62z[data-popper-placement^=\"right\"] > .ZBY5pcUZw7V-86CZwsJcF::before {\n -webkit-transform: rotate(-45deg);\n transform: rotate(-45deg);\n}\n";
|
|
22
23
|
var classes = {"header":"bmcwfoRgxW9uxv0uyXH04","dismissButton":"TjIegPUFwvTBnPHT-hzfN","popover":"_1v-Ekqld7VhWiu8_bFt62z","arrow":"ZBY5pcUZw7V-86CZwsJcF"};
|
|
23
|
-
|
|
24
|
+
styleInject_es.styleInject(css);
|
|
24
25
|
|
|
25
|
-
function Popover(_a) {
|
|
26
|
-
var onRequestClose = _a.onRequestClose, children = _a.children, attachTo = _a.attachTo, open = _a.open, _b = _a.preferredPlacement, preferredPlacement = _b === void 0 ? "auto" : _b;
|
|
27
|
-
var _c =
|
|
28
|
-
var _d =
|
|
29
|
-
var _e = reactPopper.usePopper(attachTo instanceof Element ? attachTo : attachTo.current, popperElement, {
|
|
30
|
-
modifiers: buildModifiers(arrowElement),
|
|
31
|
-
placement: preferredPlacement,
|
|
32
|
-
}), popperStyles = _e.styles, attributes = _e.attributes;
|
|
33
|
-
hooks.useRefocusOnActivator(open);
|
|
34
|
-
return (React__default.createElement(React__default.Fragment, null, open && (React__default.createElement("div",
|
|
35
|
-
React__default.createElement("div", { className: classes.dismissButton },
|
|
36
|
-
React__default.createElement(
|
|
37
|
-
children,
|
|
38
|
-
React__default.createElement("div", { ref: setArrowElement, className: classes.arrow, style: popperStyles.arrow })))));
|
|
39
|
-
}
|
|
40
|
-
function buildModifiers(arrowElement) {
|
|
41
|
-
var modifiers = [
|
|
42
|
-
{
|
|
43
|
-
name: "arrow",
|
|
44
|
-
options: { element: arrowElement, padding: 10 },
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
name: "offset",
|
|
48
|
-
options: {
|
|
49
|
-
offset: [0, 10],
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
name: "flip",
|
|
54
|
-
options: {
|
|
55
|
-
fallbackPlacements: ["auto"],
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
];
|
|
59
|
-
return modifiers;
|
|
26
|
+
function Popover(_a) {
|
|
27
|
+
var onRequestClose = _a.onRequestClose, children = _a.children, attachTo = _a.attachTo, open = _a.open, _b = _a.preferredPlacement, preferredPlacement = _b === void 0 ? "auto" : _b;
|
|
28
|
+
var _c = tslib_es6.__read(React.useState(), 2), popperElement = _c[0], setPopperElement = _c[1];
|
|
29
|
+
var _d = tslib_es6.__read(React.useState(), 2), arrowElement = _d[0], setArrowElement = _d[1];
|
|
30
|
+
var _e = reactPopper.usePopper(attachTo instanceof Element ? attachTo : attachTo.current, popperElement, {
|
|
31
|
+
modifiers: buildModifiers(arrowElement),
|
|
32
|
+
placement: preferredPlacement,
|
|
33
|
+
}), popperStyles = _e.styles, attributes = _e.attributes;
|
|
34
|
+
hooks.useRefocusOnActivator(open);
|
|
35
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null, open && (React__default["default"].createElement("div", tslib_es6.__assign({ role: "dialog", ref: setPopperElement, style: popperStyles.popper, className: classes.popover }, attributes.popper),
|
|
36
|
+
React__default["default"].createElement("div", { className: classes.dismissButton },
|
|
37
|
+
React__default["default"].createElement(ButtonDismiss.ButtonDismiss, { onClick: onRequestClose, ariaLabel: "Close dialog" })),
|
|
38
|
+
children,
|
|
39
|
+
React__default["default"].createElement("div", { ref: setArrowElement, className: classes.arrow, style: popperStyles.arrow })))));
|
|
40
|
+
}
|
|
41
|
+
function buildModifiers(arrowElement) {
|
|
42
|
+
var modifiers = [
|
|
43
|
+
{
|
|
44
|
+
name: "arrow",
|
|
45
|
+
options: { element: arrowElement, padding: 10 },
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: "offset",
|
|
49
|
+
options: {
|
|
50
|
+
offset: [0, 10],
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "flip",
|
|
55
|
+
options: {
|
|
56
|
+
fallbackPlacements: ["auto"],
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
];
|
|
60
|
+
return modifiers;
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
exports.Popover = Popover;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import sizes from "./Sizes.css";
|
|
2
|
-
interface ProgressBarProps {
|
|
3
|
-
/**
|
|
4
|
-
* The current step that the progress bar is on.
|
|
5
|
-
*/
|
|
6
|
-
readonly currentStep: number;
|
|
7
|
-
/**
|
|
8
|
-
* The total steps to use. For percentages you can set this to 100.
|
|
9
|
-
*/
|
|
10
|
-
readonly totalSteps: number;
|
|
11
|
-
/**
|
|
12
|
-
* Set the size of the progress bar
|
|
13
|
-
* @default base
|
|
14
|
-
*/
|
|
15
|
-
readonly size?: keyof typeof sizes;
|
|
16
|
-
}
|
|
17
|
-
export declare function ProgressBar({ currentStep, totalSteps, size, }: ProgressBarProps): JSX.Element;
|
|
18
|
-
export {};
|
|
1
|
+
import sizes from "./Sizes.css";
|
|
2
|
+
interface ProgressBarProps {
|
|
3
|
+
/**
|
|
4
|
+
* The current step that the progress bar is on.
|
|
5
|
+
*/
|
|
6
|
+
readonly currentStep: number;
|
|
7
|
+
/**
|
|
8
|
+
* The total steps to use. For percentages you can set this to 100.
|
|
9
|
+
*/
|
|
10
|
+
readonly totalSteps: number;
|
|
11
|
+
/**
|
|
12
|
+
* Set the size of the progress bar
|
|
13
|
+
* @default base
|
|
14
|
+
*/
|
|
15
|
+
readonly size?: keyof typeof sizes;
|
|
16
|
+
}
|
|
17
|
+
export declare function ProgressBar({ currentStep, totalSteps, size, }: ProgressBarProps): JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ProgressBar } from "./ProgressBar";
|
|
1
|
+
export { ProgressBar } from "./ProgressBar";
|
|
@@ -2,28 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
var ProgressBar = require('../ProgressBar-e9a49129.js');
|
|
6
|
+
require('react');
|
|
7
|
+
require('classnames');
|
|
8
|
+
require('../style-inject.es-dcee06b6.js');
|
|
6
9
|
|
|
7
|
-
var React = require('react');
|
|
8
|
-
var React__default = _interopDefault(React);
|
|
9
|
-
var __chunk_2 = require('../chunk-17e02351.js');
|
|
10
|
-
var classnames = _interopDefault(require('classnames'));
|
|
11
10
|
|
|
12
|
-
var css = ":root {\n --progress-bar--height: var(--space-base);\n}\n\nprogress._1WbkinyEDHI20rCq4zHOe6[value] {\n width: 100%;\n height: var(--space-base);\n height: var(--space-base);\n height: var(--progress-bar--height);\n border: none;\n vertical-align: baseline;\n vertical-align: initial;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n}\n\nprogress._1WbkinyEDHI20rCq4zHOe6[value],\nprogress._1WbkinyEDHI20rCq4zHOe6[value]::-webkit-progress-bar {\n box-shadow: inset 0px 2px 4px rgba(0, 0, 0, 0.05);\n border-radius: calc(var(--space-base) / 2);\n border-radius: calc(var(--space-base) / 2);\n border-radius: calc(var(--progress-bar--height) / 2);\n}\n\nprogress._1WbkinyEDHI20rCq4zHOe6[value]::-webkit-progress-bar {\n background-color: var(--color-surface--background);\n}\n\nprogress._1WbkinyEDHI20rCq4zHOe6[value]::-webkit-progress-value {\n border-radius: calc(var(--space-base) / 2);\n border-radius: calc(var(--space-base) / 2);\n border-radius: calc(var(--progress-bar--height) / 2);\n background-color: var(--color-interactive);\n transition: all var(--timing-slow) ease-out;\n}\n\nprogress._1WbkinyEDHI20rCq4zHOe6[value]::-moz-progress-bar {\n border-radius: calc(var(--space-base) / 2);\n border-radius: calc(var(--space-base) / 2);\n border-radius: calc(var(--progress-bar--height) / 2);\n background-color: var(--color-interactive);\n transition: all var(--timing-slow) ease-out;\n}\n";
|
|
13
|
-
var styles = {"ProgressBar":"_1WbkinyEDHI20rCq4zHOe6"};
|
|
14
|
-
__chunk_2.styleInject(css);
|
|
15
11
|
|
|
16
|
-
|
|
17
|
-
var sizes = {"small":"_3m4bLvy45VVeWhtP3H5dQ3","base":"_2gLOi6dJvWt7HGwcOX4GlO"};
|
|
18
|
-
__chunk_2.styleInject(css$1);
|
|
19
|
-
|
|
20
|
-
function ProgressBar(_a) {
|
|
21
|
-
var currentStep = _a.currentStep, totalSteps = _a.totalSteps, _b = _a.size, size = _b === void 0 ? "base" : _b;
|
|
22
|
-
var percentage = (currentStep / totalSteps) * 100;
|
|
23
|
-
var progressBarClassName = classnames(styles.ProgressBar, sizes[size]);
|
|
24
|
-
return (React__default.createElement("progress", { className: progressBarClassName, max: totalSteps, value: currentStep },
|
|
25
|
-
percentage,
|
|
26
|
-
"%"));
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
exports.ProgressBar = ProgressBar;
|
|
12
|
+
exports.ProgressBar = ProgressBar.ProgressBar;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var classnames = require('classnames');
|
|
5
|
+
var styleInject_es = require('./style-inject.es-dcee06b6.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 css$1 = ":root {\n --progress-bar--height: var(--space-base);\n}\n\nprogress._1WbkinyEDHI20rCq4zHOe6[value] {\n width: 100%;\n height: var(--space-base);\n height: var(--space-base);\n height: var(--progress-bar--height);\n border: none;\n vertical-align: baseline;\n vertical-align: initial;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n}\n\nprogress._1WbkinyEDHI20rCq4zHOe6[value],\nprogress._1WbkinyEDHI20rCq4zHOe6[value]::-webkit-progress-bar {\n box-shadow: inset 0px 2px 4px rgba(0, 0, 0, 0.05);\n border-radius: calc(var(--space-base) / 2);\n border-radius: calc(var(--space-base) / 2);\n border-radius: calc(var(--progress-bar--height) / 2);\n}\n\nprogress._1WbkinyEDHI20rCq4zHOe6[value]::-webkit-progress-bar {\n background-color: var(--color-surface--background);\n}\n\nprogress._1WbkinyEDHI20rCq4zHOe6[value]::-webkit-progress-value {\n border-radius: calc(var(--space-base) / 2);\n border-radius: calc(var(--space-base) / 2);\n border-radius: calc(var(--progress-bar--height) / 2);\n background-color: var(--color-interactive);\n transition: all var(--timing-slow) ease-out;\n}\n\nprogress._1WbkinyEDHI20rCq4zHOe6[value]::-moz-progress-bar {\n border-radius: calc(var(--space-base) / 2);\n border-radius: calc(var(--space-base) / 2);\n border-radius: calc(var(--progress-bar--height) / 2);\n background-color: var(--color-interactive);\n transition: all var(--timing-slow) ease-out;\n}\n";
|
|
13
|
+
var styles = {"ProgressBar":"_1WbkinyEDHI20rCq4zHOe6"};
|
|
14
|
+
styleInject_es.styleInject(css$1);
|
|
15
|
+
|
|
16
|
+
var css = "._3m4bLvy45VVeWhtP3H5dQ3 {\n --progress-bar--height: var(--space-smaller);\n}\n\n._2gLOi6dJvWt7HGwcOX4GlO {\n --progress-bar--height: var(--space-base);\n}\n";
|
|
17
|
+
var sizes = {"small":"_3m4bLvy45VVeWhtP3H5dQ3","base":"_2gLOi6dJvWt7HGwcOX4GlO"};
|
|
18
|
+
styleInject_es.styleInject(css);
|
|
19
|
+
|
|
20
|
+
function ProgressBar(_a) {
|
|
21
|
+
var currentStep = _a.currentStep, totalSteps = _a.totalSteps, _b = _a.size, size = _b === void 0 ? "base" : _b;
|
|
22
|
+
var percentage = (currentStep / totalSteps) * 100;
|
|
23
|
+
var progressBarClassName = classnames__default["default"](styles.ProgressBar, sizes[size]);
|
|
24
|
+
return (React__default["default"].createElement("progress", { className: progressBarClassName, max: totalSteps, value: currentStep },
|
|
25
|
+
percentage,
|
|
26
|
+
"%"));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
exports.ProgressBar = ProgressBar;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { ReactElement } from "react";
|
|
2
|
-
interface RadioGroupProps {
|
|
3
|
-
readonly children: ReactElement | ReactElement[];
|
|
4
|
-
/**
|
|
5
|
-
* Defines the default value that will be pre-selected in the radio group.
|
|
6
|
-
*/
|
|
7
|
-
readonly value: string | number;
|
|
8
|
-
/**
|
|
9
|
-
* Change handler for the RadioGroup.
|
|
10
|
-
*
|
|
11
|
-
* @param {string} newValue
|
|
12
|
-
*/
|
|
13
|
-
onChange(newValue: string | number): void;
|
|
14
|
-
/**
|
|
15
|
-
* Defines the aria label that describes the radio group.
|
|
16
|
-
*/
|
|
17
|
-
readonly ariaLabel: string;
|
|
18
|
-
/**
|
|
19
|
-
* The name of the radio group, that links the radio options back up
|
|
20
|
-
* to the group.
|
|
21
|
-
*
|
|
22
|
-
* @default uuid
|
|
23
|
-
*/
|
|
24
|
-
readonly name?: string;
|
|
25
|
-
}
|
|
26
|
-
export declare function RadioGroup({ children, value, ariaLabel, onChange, name, }: RadioGroupProps): JSX.Element;
|
|
27
|
-
export {};
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
interface RadioGroupProps {
|
|
3
|
+
readonly children: ReactElement | ReactElement[];
|
|
4
|
+
/**
|
|
5
|
+
* Defines the default value that will be pre-selected in the radio group.
|
|
6
|
+
*/
|
|
7
|
+
readonly value: string | number;
|
|
8
|
+
/**
|
|
9
|
+
* Change handler for the RadioGroup.
|
|
10
|
+
*
|
|
11
|
+
* @param {string} newValue
|
|
12
|
+
*/
|
|
13
|
+
onChange(newValue: string | number): void;
|
|
14
|
+
/**
|
|
15
|
+
* Defines the aria label that describes the radio group.
|
|
16
|
+
*/
|
|
17
|
+
readonly ariaLabel: string;
|
|
18
|
+
/**
|
|
19
|
+
* The name of the radio group, that links the radio options back up
|
|
20
|
+
* to the group.
|
|
21
|
+
*
|
|
22
|
+
* @default uuid
|
|
23
|
+
*/
|
|
24
|
+
readonly name?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function RadioGroup({ children, value, ariaLabel, onChange, name, }: RadioGroupProps): JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { PropsWithChildren } from "react";
|
|
2
|
-
import { XOR } from "ts-xor";
|
|
3
|
-
interface BaseRadioOptions {
|
|
4
|
-
readonly value: string | number;
|
|
5
|
-
readonly disabled?: boolean;
|
|
6
|
-
}
|
|
7
|
-
interface RadioOptionsWithDescription extends BaseRadioOptions {
|
|
8
|
-
/**
|
|
9
|
-
* The label to appear beside the radio button.
|
|
10
|
-
*/
|
|
11
|
-
label: string;
|
|
12
|
-
/**
|
|
13
|
-
* Further description of the label.
|
|
14
|
-
*/
|
|
15
|
-
description?: string;
|
|
16
|
-
}
|
|
17
|
-
declare type RadioOptionProps = XOR<RadioOptionsWithDescription, PropsWithChildren<BaseRadioOptions>>;
|
|
18
|
-
/**
|
|
19
|
-
* For rendering props only. To make updates to
|
|
20
|
-
* the real RadioOption, look at InternalRadioOption
|
|
21
|
-
*/
|
|
22
|
-
export declare function RadioOption({ children }: PropsWithChildren<RadioOptionProps>): JSX.Element;
|
|
23
|
-
interface BaseInternalRadioOptions extends BaseRadioOptions {
|
|
24
|
-
readonly name: string;
|
|
25
|
-
readonly checked: boolean;
|
|
26
|
-
onChange(newValue: string | number): void;
|
|
27
|
-
}
|
|
28
|
-
interface InternalRadioOptionsWithDescription extends BaseInternalRadioOptions {
|
|
29
|
-
label: string;
|
|
30
|
-
description?: string;
|
|
31
|
-
}
|
|
32
|
-
declare type InternalRadioOptionProps = XOR<InternalRadioOptionsWithDescription, PropsWithChildren<BaseInternalRadioOptions>>;
|
|
33
|
-
export declare function InternalRadioOption({ value, name, label, description, disabled, checked, children, onChange, }: PropsWithChildren<InternalRadioOptionProps>): JSX.Element;
|
|
34
|
-
export {};
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
|
+
import { XOR } from "ts-xor";
|
|
3
|
+
interface BaseRadioOptions {
|
|
4
|
+
readonly value: string | number;
|
|
5
|
+
readonly disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
interface RadioOptionsWithDescription extends BaseRadioOptions {
|
|
8
|
+
/**
|
|
9
|
+
* The label to appear beside the radio button.
|
|
10
|
+
*/
|
|
11
|
+
label: string;
|
|
12
|
+
/**
|
|
13
|
+
* Further description of the label.
|
|
14
|
+
*/
|
|
15
|
+
description?: string;
|
|
16
|
+
}
|
|
17
|
+
declare type RadioOptionProps = XOR<RadioOptionsWithDescription, PropsWithChildren<BaseRadioOptions>>;
|
|
18
|
+
/**
|
|
19
|
+
* For rendering props only. To make updates to
|
|
20
|
+
* the real RadioOption, look at InternalRadioOption
|
|
21
|
+
*/
|
|
22
|
+
export declare function RadioOption({ children }: PropsWithChildren<RadioOptionProps>): JSX.Element;
|
|
23
|
+
interface BaseInternalRadioOptions extends BaseRadioOptions {
|
|
24
|
+
readonly name: string;
|
|
25
|
+
readonly checked: boolean;
|
|
26
|
+
onChange(newValue: string | number): void;
|
|
27
|
+
}
|
|
28
|
+
interface InternalRadioOptionsWithDescription extends BaseInternalRadioOptions {
|
|
29
|
+
label: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
}
|
|
32
|
+
declare type InternalRadioOptionProps = XOR<InternalRadioOptionsWithDescription, PropsWithChildren<BaseInternalRadioOptions>>;
|
|
33
|
+
export declare function InternalRadioOption({ value, name, label, description, disabled, checked, children, onChange, }: PropsWithChildren<InternalRadioOptionProps>): JSX.Element;
|
|
34
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { RadioGroup } from "./RadioGroup";
|
|
2
|
-
export { RadioOption } from "./RadioOption";
|
|
1
|
+
export { RadioGroup } from "./RadioGroup";
|
|
2
|
+
export { RadioOption } from "./RadioOption";
|
package/dist/RadioGroup/index.js
CHANGED
|
@@ -2,50 +2,51 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var __chunk_1 = require('../chunk-b67af3cb.js');
|
|
5
|
+
var tslib_es6 = require('../tslib.es6-5b50eb8e.js');
|
|
8
6
|
var React = require('react');
|
|
9
|
-
var React__default = _interopDefault(React);
|
|
10
|
-
var __chunk_2 = require('../chunk-17e02351.js');
|
|
11
|
-
require('classnames');
|
|
12
|
-
require('../Typography/index.js');
|
|
13
|
-
var index$1 = require('../Text/index.js');
|
|
14
7
|
var uuid = require('uuid');
|
|
8
|
+
var styleInject_es = require('../style-inject.es-dcee06b6.js');
|
|
9
|
+
var Text = require('../Text-9bc093e9.js');
|
|
10
|
+
require('../Typography-7e542a72.js');
|
|
11
|
+
require('classnames');
|
|
12
|
+
|
|
13
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
|
+
|
|
15
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
15
16
|
|
|
16
17
|
var css = "._21aQKdbfCYC-03CNAUhBXW {\n display: -ms-inline-flexbox;\n display: inline-flex;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n\n._11AeV22s7aou-ZpJgQCiPD {\n /* Hide checkbox on UI but not screen readers and still allow focus state */\n position: absolute;\n left: -999vw;\n}\n\n.IiW-lj1gmbjv30FHatRaU {\n display: -ms-inline-flexbox;\n display: inline-flex;\n font-size: var(--typography--fontSize-base);\n cursor: pointer;\n -ms-flex-align: center;\n align-items: center;\n}\n\n._11AeV22s7aou-ZpJgQCiPD + .IiW-lj1gmbjv30FHatRaU::before {\n content: \"\";\n display: block;\n width: var(--space-base);\n height: var(--space-base);\n box-sizing: border-box;\n margin: 0 var(--space-small) 0 0;\n border: var(--border-thick) solid var(--color-interactive);\n border-radius: 100%;\n background-color: var(--color-surface);\n transition: all var(--timing-base);\n}\n\n._11AeV22s7aou-ZpJgQCiPD:focus + .IiW-lj1gmbjv30FHatRaU:before {\n box-shadow: var(--shadow-focus);\n}\n\n._11AeV22s7aou-ZpJgQCiPD:focus:checked + .IiW-lj1gmbjv30FHatRaU:before {\n box-shadow: 0px 0px 0px var(--space-minuscule) var(--color-interactive--hover),\n var(--shadow-focus);\n}\n\n._11AeV22s7aou-ZpJgQCiPD:checked + .IiW-lj1gmbjv30FHatRaU::before {\n box-shadow: 0px 0px 0px var(--space-minuscule) var(--color-interactive--hover);\n border-color: var(--color-interactive--hover);\n border-width: var(--border-thicker);\n background-color: var(--color-interactive);\n}\n\n._11AeV22s7aou-ZpJgQCiPD[disabled] + .IiW-lj1gmbjv30FHatRaU {\n color: var(--color-disabled);\n cursor: not-allowed;\n}\n\n._11AeV22s7aou-ZpJgQCiPD[disabled] + .IiW-lj1gmbjv30FHatRaU::before {\n border-color: var(--color-disabled--secondary);\n}\n\n._11AeV22s7aou-ZpJgQCiPD[disabled]:checked + .IiW-lj1gmbjv30FHatRaU::before {\n box-shadow: 0px 0px 0px var(--space-minuscule) var(--color-disabled);\n border-color: var(--color-grey);\n background-color: var(--color-disabled--secondary);\n}\n\n._27qk4PxjkMHZzzSu7SOR4s {\n margin-bottom: var(--space-small);\n padding-left: var(--space-large);\n}\n\n._11AeV22s7aou-ZpJgQCiPD[disabled] + .IiW-lj1gmbjv30FHatRaU + ._27qk4PxjkMHZzzSu7SOR4s > p {\n color: var(--color-disabled);\n}\n";
|
|
17
18
|
var styles = {"radioGroup":"_21aQKdbfCYC-03CNAUhBXW","input":"_11AeV22s7aou-ZpJgQCiPD","label":"IiW-lj1gmbjv30FHatRaU","description":"_27qk4PxjkMHZzzSu7SOR4s"};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* For rendering props only. To make updates to
|
|
22
|
-
* the real RadioOption, look at InternalRadioOption
|
|
23
|
-
*/
|
|
24
|
-
function RadioOption(_a) {
|
|
25
|
-
var children = _a.children;
|
|
26
|
-
return React__default.createElement(React__default.Fragment, null, children);
|
|
27
|
-
}
|
|
28
|
-
function InternalRadioOption(_a) {
|
|
29
|
-
var value = _a.value, name = _a.name, label = _a.label, description = _a.description, disabled = _a.disabled, checked = _a.checked, children = _a.children, onChange = _a.onChange;
|
|
30
|
-
var inputId = value.toString() + "_" + uuid.v1();
|
|
31
|
-
return (React__default.createElement("div", null,
|
|
32
|
-
React__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 }),
|
|
33
|
-
React__default.createElement("label", { className: styles.label, htmlFor: inputId }, label ? label : children),
|
|
34
|
-
description && (React__default.createElement("div", { className: styles.description, id: inputId + "_description" },
|
|
35
|
-
React__default.createElement(
|
|
36
|
-
function handleChange() {
|
|
37
|
-
onChange(value);
|
|
38
|
-
}
|
|
19
|
+
styleInject_es.styleInject(css);
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* For rendering props only. To make updates to
|
|
23
|
+
* the real RadioOption, look at InternalRadioOption
|
|
24
|
+
*/
|
|
25
|
+
function RadioOption(_a) {
|
|
26
|
+
var children = _a.children;
|
|
27
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null, children);
|
|
28
|
+
}
|
|
29
|
+
function InternalRadioOption(_a) {
|
|
30
|
+
var value = _a.value, name = _a.name, label = _a.label, description = _a.description, disabled = _a.disabled, checked = _a.checked, children = _a.children, onChange = _a.onChange;
|
|
31
|
+
var inputId = value.toString() + "_" + uuid.v1();
|
|
32
|
+
return (React__default["default"].createElement("div", null,
|
|
33
|
+
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 }),
|
|
34
|
+
React__default["default"].createElement("label", { className: styles.label, htmlFor: inputId }, label ? label : children),
|
|
35
|
+
description && (React__default["default"].createElement("div", { className: styles.description, id: inputId + "_description" },
|
|
36
|
+
React__default["default"].createElement(Text.Text, { variation: "subdued", size: "small" }, description)))));
|
|
37
|
+
function handleChange() {
|
|
38
|
+
onChange(value);
|
|
39
|
+
}
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
function RadioGroup(_a) {
|
|
42
|
-
var children = _a.children, value = _a.value, ariaLabel = _a.ariaLabel, onChange = _a.onChange, _b = _a.name, name = _b === void 0 ? uuid.v1() : _b;
|
|
43
|
-
return (React__default.createElement("div", { role: "radiogroup", "aria-label": ariaLabel, className: styles.radioGroup }, React__default.Children.map(children, function (option) { return (React__default.createElement(InternalRadioOption,
|
|
44
|
-
function handleChange(newValue) {
|
|
45
|
-
if (newValue !== value) {
|
|
46
|
-
onChange(newValue);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
42
|
+
function RadioGroup(_a) {
|
|
43
|
+
var children = _a.children, value = _a.value, ariaLabel = _a.ariaLabel, onChange = _a.onChange, _b = _a.name, name = _b === void 0 ? uuid.v1() : _b;
|
|
44
|
+
return (React__default["default"].createElement("div", { role: "radiogroup", "aria-label": ariaLabel, className: styles.radioGroup }, React__default["default"].Children.map(children, function (option) { return (React__default["default"].createElement(InternalRadioOption, tslib_es6.__assign({ checked: value === option.props.value, name: name, onChange: handleChange }, option.props), option.props.children)); })));
|
|
45
|
+
function handleChange(newValue) {
|
|
46
|
+
if (newValue !== value) {
|
|
47
|
+
onChange(newValue);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
exports.RadioGroup = RadioGroup;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { RecurrenceRule } from "./types";
|
|
2
|
-
interface RecurringSelectProps {
|
|
3
|
-
disabled?: boolean;
|
|
4
|
-
recurrenceRule: RecurrenceRule;
|
|
5
|
-
onChange(newRecurrence: RecurrenceRule): void;
|
|
6
|
-
}
|
|
7
|
-
export declare function CurrentRecurrenceComponent({ recurrenceRule, disabled, onChange, }: RecurringSelectProps): JSX.Element;
|
|
8
|
-
export {};
|
|
1
|
+
import { RecurrenceRule } from "./types";
|
|
2
|
+
interface RecurringSelectProps {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
recurrenceRule: RecurrenceRule;
|
|
5
|
+
onChange(newRecurrence: RecurrenceRule): void;
|
|
6
|
+
}
|
|
7
|
+
export declare function CurrentRecurrenceComponent({ recurrenceRule, disabled, onChange, }: RecurringSelectProps): JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { RecurrenceRule } from "./types";
|
|
2
|
-
interface RecurringSelectProps {
|
|
3
|
-
readonly disabled?: boolean;
|
|
4
|
-
readonly value: RecurrenceRule;
|
|
5
|
-
onChange(value: RecurrenceRule): void;
|
|
6
|
-
}
|
|
7
|
-
export declare function RecurringSelect({ value, disabled, onChange, }: RecurringSelectProps): JSX.Element;
|
|
8
|
-
export {};
|
|
1
|
+
import { RecurrenceRule } from "./types";
|
|
2
|
+
interface RecurringSelectProps {
|
|
3
|
+
readonly disabled?: boolean;
|
|
4
|
+
readonly value: RecurrenceRule;
|
|
5
|
+
onChange(value: RecurrenceRule): void;
|
|
6
|
+
}
|
|
7
|
+
export declare function RecurringSelect({ value, disabled, onChange, }: RecurringSelectProps): JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { DayOfMonth } from "../types";
|
|
2
|
-
interface DayOfMonthSelectProps {
|
|
3
|
-
selectedDays: Set<DayOfMonth>;
|
|
4
|
-
disabled: boolean;
|
|
5
|
-
onChange(selectedDays: Set<DayOfMonth>): void;
|
|
6
|
-
}
|
|
7
|
-
export declare function DayOfMonthSelect({ selectedDays, disabled, onChange, }: DayOfMonthSelectProps): JSX.Element;
|
|
8
|
-
export {};
|
|
1
|
+
import { DayOfMonth } from "../types";
|
|
2
|
+
interface DayOfMonthSelectProps {
|
|
3
|
+
selectedDays: Set<DayOfMonth>;
|
|
4
|
+
disabled: boolean;
|
|
5
|
+
onChange(selectedDays: Set<DayOfMonth>): void;
|
|
6
|
+
}
|
|
7
|
+
export declare function DayOfMonthSelect({ selectedDays, disabled, onChange, }: DayOfMonthSelectProps): JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { WeekDay } from "../types";
|
|
2
|
-
interface MonthlyDayOfWeekSelectProps {
|
|
3
|
-
disabled: boolean;
|
|
4
|
-
selectedWeeks: Set<WeekDay>[];
|
|
5
|
-
onChange(nextSelectedWeeks: Set<WeekDay>[]): void;
|
|
6
|
-
}
|
|
7
|
-
export declare function MonthlyDayOfWeekSelect({ disabled, selectedWeeks, onChange, }: MonthlyDayOfWeekSelectProps): JSX.Element;
|
|
8
|
-
export {};
|
|
1
|
+
import { WeekDay } from "../types";
|
|
2
|
+
interface MonthlyDayOfWeekSelectProps {
|
|
3
|
+
disabled: boolean;
|
|
4
|
+
selectedWeeks: Set<WeekDay>[];
|
|
5
|
+
onChange(nextSelectedWeeks: Set<WeekDay>[]): void;
|
|
6
|
+
}
|
|
7
|
+
export declare function MonthlyDayOfWeekSelect({ disabled, selectedWeeks, onChange, }: MonthlyDayOfWeekSelectProps): JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { DurationPeriod } from "../types";
|
|
2
|
-
interface MonthlySelectProps {
|
|
3
|
-
disabled: boolean;
|
|
4
|
-
selectedMonthOption: DurationPeriod.DayOfMonth | DurationPeriod.WeekDayOfMonth;
|
|
5
|
-
onChange(type: DurationPeriod.DayOfMonth | DurationPeriod.WeekDayOfMonth): void;
|
|
6
|
-
}
|
|
7
|
-
export declare function MonthlySelect({ disabled, onChange, selectedMonthOption, }: MonthlySelectProps): JSX.Element;
|
|
8
|
-
export {};
|
|
1
|
+
import { DurationPeriod } from "../types";
|
|
2
|
+
interface MonthlySelectProps {
|
|
3
|
+
disabled: boolean;
|
|
4
|
+
selectedMonthOption: DurationPeriod.DayOfMonth | DurationPeriod.WeekDayOfMonth;
|
|
5
|
+
onChange(type: DurationPeriod.DayOfMonth | DurationPeriod.WeekDayOfMonth): void;
|
|
6
|
+
}
|
|
7
|
+
export declare function MonthlySelect({ disabled, onChange, selectedMonthOption, }: MonthlySelectProps): JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { WeekDay } from "../types";
|
|
2
|
-
interface WeeklySelectProps {
|
|
3
|
-
disabled: boolean;
|
|
4
|
-
selectedDays: Set<WeekDay>;
|
|
5
|
-
onChange(selectedDays: Set<WeekDay>): void;
|
|
6
|
-
}
|
|
7
|
-
export declare function WeeklySelect({ onChange, selectedDays, disabled, }: WeeklySelectProps): JSX.Element;
|
|
8
|
-
export {};
|
|
1
|
+
import { WeekDay } from "../types";
|
|
2
|
+
interface WeeklySelectProps {
|
|
3
|
+
disabled: boolean;
|
|
4
|
+
selectedDays: Set<WeekDay>;
|
|
5
|
+
onChange(selectedDays: Set<WeekDay>): void;
|
|
6
|
+
}
|
|
7
|
+
export declare function WeeklySelect({ onChange, selectedDays, disabled, }: WeeklySelectProps): JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { WeeklySelect } from "./WeeklySelect";
|
|
2
|
-
export { MonthlySelect } from "./MonthlySelect";
|
|
3
|
-
export { MonthlyDayOfWeekSelect } from "./MonthlyDayOfWeekSelect";
|
|
4
|
-
export { DayOfMonthSelect } from "./DayOfMonthSelect";
|
|
1
|
+
export { WeeklySelect } from "./WeeklySelect";
|
|
2
|
+
export { MonthlySelect } from "./MonthlySelect";
|
|
3
|
+
export { MonthlyDayOfWeekSelect } from "./MonthlyDayOfWeekSelect";
|
|
4
|
+
export { DayOfMonthSelect } from "./DayOfMonthSelect";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { RecurringSelect } from "./RecurringSelect";
|
|
2
|
-
export { DayOfMonth, DurationPeriod, RecurrenceRule, WeekDay } from "./types";
|
|
1
|
+
export { RecurringSelect } from "./RecurringSelect";
|
|
2
|
+
export { DayOfMonth, DurationPeriod, RecurrenceRule, WeekDay } from "./types";
|