@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
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
interface InputValidationProps {
|
|
2
|
-
/**
|
|
3
|
-
* Validation message to be displayed
|
|
4
|
-
*/
|
|
5
|
-
message: string;
|
|
6
|
-
}
|
|
7
|
-
export declare function InputValidation({ message }: InputValidationProps): JSX.Element;
|
|
8
|
-
export {};
|
|
1
|
+
interface InputValidationProps {
|
|
2
|
+
/**
|
|
3
|
+
* Validation message to be displayed
|
|
4
|
+
*/
|
|
5
|
+
message: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function InputValidation({ message }: InputValidationProps): JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./InputValidation";
|
|
1
|
+
export * from "./InputValidation";
|
|
@@ -2,31 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
require('
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
var InputValidation = require('../InputValidation-24d3621a.js');
|
|
6
|
+
require('react');
|
|
7
|
+
require('framer-motion');
|
|
8
|
+
require('../style-inject.es-dcee06b6.js');
|
|
9
|
+
require('../Text-9bc093e9.js');
|
|
10
|
+
require('../Typography-7e542a72.js');
|
|
11
|
+
require('../tslib.es6-5b50eb8e.js');
|
|
11
12
|
require('classnames');
|
|
12
|
-
require('../Typography/index.js');
|
|
13
|
-
var index$1 = require('../Text/index.js');
|
|
14
|
-
var framerMotion = require('framer-motion');
|
|
15
13
|
|
|
16
|
-
var css = "._9gFxrZogiKbS3gPLv_I79 {\n margin-top: var(--space-smaller);\n}\n\n._3QUt88pIWZatkYLVYFlRuL {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-align: center;\n align-items: center;\n padding: var(--space-smaller);\n padding-left: 0;\n}\n\n._3QUt88pIWZatkYLVYFlRuL > svg {\n margin-right: var(--space-smaller);\n}\n\n._3QUt88pIWZatkYLVYFlRuL:focus {\n box-shadow: var(--shadow-focus);\n outline: none;\n}\n";
|
|
17
|
-
var styles = {"hasValidationMessage":"_9gFxrZogiKbS3gPLv_I79","message":"_3QUt88pIWZatkYLVYFlRuL"};
|
|
18
|
-
__chunk_2.styleInject(css);
|
|
19
14
|
|
|
20
|
-
function InputValidation(_a) {
|
|
21
|
-
var message = _a.message;
|
|
22
|
-
var messages = [message];
|
|
23
|
-
var variants = {
|
|
24
|
-
slideOut: { y: "5%", height: 0, opacity: 0 },
|
|
25
|
-
slideIn: { y: 0, height: "100%", opacity: 1 },
|
|
26
|
-
};
|
|
27
|
-
return (React__default.createElement(React__default.Fragment, null, messages && messages.length > 0 && (React__default.createElement(framerMotion.AnimatePresence, null, messages.map(function (msg) { return (React__default.createElement(framerMotion.motion.div, { key: "validation-" + msg, variants: variants, initial: "slideOut", animate: "slideIn", exit: "slideOut", transition: { duration: 0.2 } },
|
|
28
|
-
React__default.createElement("div", { className: styles.message, "aria-live": "assertive", role: "alert", tabIndex: 0 },
|
|
29
|
-
React__default.createElement(index$1.Text, { variation: "error" }, msg)))); })))));
|
|
30
|
-
}
|
|
31
15
|
|
|
32
|
-
exports.InputValidation = InputValidation;
|
|
16
|
+
exports.InputValidation = InputValidation.InputValidation;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var framerMotion = require('framer-motion');
|
|
5
|
+
var styleInject_es = require('./style-inject.es-dcee06b6.js');
|
|
6
|
+
var Text = require('./Text-9bc093e9.js');
|
|
7
|
+
|
|
8
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
|
+
|
|
10
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
11
|
+
|
|
12
|
+
var css = "._9gFxrZogiKbS3gPLv_I79 {\n margin-top: var(--space-smaller);\n}\n\n._3QUt88pIWZatkYLVYFlRuL {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-align: center;\n align-items: center;\n padding: var(--space-smaller);\n padding-left: 0;\n}\n\n._3QUt88pIWZatkYLVYFlRuL > svg {\n margin-right: var(--space-smaller);\n}\n\n._3QUt88pIWZatkYLVYFlRuL:focus {\n box-shadow: var(--shadow-focus);\n outline: none;\n}\n";
|
|
13
|
+
var styles = {"hasValidationMessage":"_9gFxrZogiKbS3gPLv_I79","message":"_3QUt88pIWZatkYLVYFlRuL"};
|
|
14
|
+
styleInject_es.styleInject(css);
|
|
15
|
+
|
|
16
|
+
function InputValidation(_a) {
|
|
17
|
+
var message = _a.message;
|
|
18
|
+
var messages = [message];
|
|
19
|
+
var variants = {
|
|
20
|
+
slideOut: { y: "5%", height: 0, opacity: 0 },
|
|
21
|
+
slideIn: { y: 0, height: "100%", opacity: 1 },
|
|
22
|
+
};
|
|
23
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null, messages && messages.length > 0 && (React__default["default"].createElement(framerMotion.AnimatePresence, null, messages.map(function (msg) { return (React__default["default"].createElement(framerMotion.motion.div, { key: "validation-" + msg, variants: variants, initial: "slideOut", animate: "slideIn", exit: "slideOut", transition: { duration: 0.2 } },
|
|
24
|
+
React__default["default"].createElement("div", { className: styles.message, "aria-live": "assertive", role: "alert", tabIndex: 0 },
|
|
25
|
+
React__default["default"].createElement(Text.Text, { variation: "error" }, msg)))); })))));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
exports.InputValidation = InputValidation;
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import "react-image-lightbox/style.css";
|
|
2
|
-
interface PresentedImage {
|
|
3
|
-
title?: string;
|
|
4
|
-
caption?: string;
|
|
5
|
-
url: string;
|
|
6
|
-
}
|
|
7
|
-
interface RequestCloseOptions {
|
|
8
|
-
lastPosition: number;
|
|
9
|
-
}
|
|
10
|
-
interface LightBoxProps {
|
|
11
|
-
/**
|
|
12
|
-
* Specify if the Lightbox is open or closed.
|
|
13
|
-
*/
|
|
14
|
-
readonly open: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Images is an array of objects defining a LightBox image. This object consists of
|
|
17
|
-
* `title`, `caption` and `url`. `title` and `caption` are optional, `url` is
|
|
18
|
-
* required, for each image.
|
|
19
|
-
*/
|
|
20
|
-
readonly images: PresentedImage[];
|
|
21
|
-
/**
|
|
22
|
-
* Use this to specify which image in `images` to initialize the lightbox with.
|
|
23
|
-
* This is useful when you have a collection of thumbnails as you only need one
|
|
24
|
-
* collection of image urls, order doesn't matter.
|
|
25
|
-
*/
|
|
26
|
-
readonly imageIndex?: number;
|
|
27
|
-
/**
|
|
28
|
-
* This function must set open to false in order to close the lightbox. Note there
|
|
29
|
-
* is a 300ms easing animation on lightbox close that occurs before this function
|
|
30
|
-
* is called.
|
|
31
|
-
* This function receives an object as an argument with the key `lastPosition`
|
|
32
|
-
* that has the index of the image the user was on when LightBox was closed.
|
|
33
|
-
*/
|
|
34
|
-
onRequestClose(options: RequestCloseOptions): void;
|
|
35
|
-
}
|
|
36
|
-
export declare function LightBox({ open, images, imageIndex, onRequestClose, }: LightBoxProps): JSX.Element;
|
|
37
|
-
export {};
|
|
1
|
+
import "react-image-lightbox/style.css";
|
|
2
|
+
interface PresentedImage {
|
|
3
|
+
title?: string;
|
|
4
|
+
caption?: string;
|
|
5
|
+
url: string;
|
|
6
|
+
}
|
|
7
|
+
interface RequestCloseOptions {
|
|
8
|
+
lastPosition: number;
|
|
9
|
+
}
|
|
10
|
+
interface LightBoxProps {
|
|
11
|
+
/**
|
|
12
|
+
* Specify if the Lightbox is open or closed.
|
|
13
|
+
*/
|
|
14
|
+
readonly open: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Images is an array of objects defining a LightBox image. This object consists of
|
|
17
|
+
* `title`, `caption` and `url`. `title` and `caption` are optional, `url` is
|
|
18
|
+
* required, for each image.
|
|
19
|
+
*/
|
|
20
|
+
readonly images: PresentedImage[];
|
|
21
|
+
/**
|
|
22
|
+
* Use this to specify which image in `images` to initialize the lightbox with.
|
|
23
|
+
* This is useful when you have a collection of thumbnails as you only need one
|
|
24
|
+
* collection of image urls, order doesn't matter.
|
|
25
|
+
*/
|
|
26
|
+
readonly imageIndex?: number;
|
|
27
|
+
/**
|
|
28
|
+
* This function must set open to false in order to close the lightbox. Note there
|
|
29
|
+
* is a 300ms easing animation on lightbox close that occurs before this function
|
|
30
|
+
* is called.
|
|
31
|
+
* This function receives an object as an argument with the key `lastPosition`
|
|
32
|
+
* that has the index of the image the user was on when LightBox was closed.
|
|
33
|
+
*/
|
|
34
|
+
onRequestClose(options: RequestCloseOptions): void;
|
|
35
|
+
}
|
|
36
|
+
export declare function LightBox({ open, images, imageIndex, onRequestClose, }: LightBoxProps): JSX.Element;
|
|
37
|
+
export {};
|
package/dist/LightBox/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { LightBox } from "./LightBox";
|
|
1
|
+
export { LightBox } from "./LightBox";
|
package/dist/LightBox/index.js
CHANGED
|
@@ -2,41 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var __chunk_2 = require('../chunk-17e02351.js');
|
|
11
|
-
var ExternalLightBox = _interopDefault(require('react-image-lightbox'));
|
|
5
|
+
var LightBox = require('../LightBox-b893b656.js');
|
|
6
|
+
require('../tslib.es6-5b50eb8e.js');
|
|
7
|
+
require('react');
|
|
8
|
+
require('react-image-lightbox');
|
|
9
|
+
require('../style-inject.es-dcee06b6.js');
|
|
12
10
|
require('react-image-lightbox/style.css');
|
|
13
11
|
|
|
14
|
-
var css = "._23H2TI8rNmnv0zlHOHZooa.ril__outer {\n font-family: \"Source Sans Pro\", Helvetica, Arial, sans-serif;\n background-color: transparent;\n}\n\n._23H2TI8rNmnv0zlHOHZooa.ril__outer:before {\n content: \"\";\n display: block;\n width: 100%;\n height: 100%;\n background-color: var(--color-overlay);\n}\n\n._23H2TI8rNmnv0zlHOHZooa.ril__outer .ril__captionContent {\n color: var(--color-greyBlue--lighter);\n}\n\n._23H2TI8rNmnv0zlHOHZooa.ril__outer .ril__toolbarItem {\n color: var(--color-greyBlue--lighter);\n}\n";
|
|
15
|
-
var styles = {"wrapper":"_23H2TI8rNmnv0zlHOHZooa"};
|
|
16
|
-
__chunk_2.styleInject(css);
|
|
17
12
|
|
|
18
|
-
function LightBox(_a) {
|
|
19
|
-
var open = _a.open, images = _a.images, _b = _a.imageIndex, imageIndex = _b === void 0 ? 0 : _b, onRequestClose = _a.onRequestClose;
|
|
20
|
-
var _c = __chunk_1.__read(React.useState(imageIndex), 2), currentImageIndex = _c[0], setCurrentImageIndex = _c[1];
|
|
21
|
-
var nextSrc = undefined;
|
|
22
|
-
var prevSrc = undefined;
|
|
23
|
-
if (images.length > 1) {
|
|
24
|
-
nextSrc = images[(currentImageIndex + 1) % images.length].url;
|
|
25
|
-
prevSrc =
|
|
26
|
-
images[(currentImageIndex + images.length - 1) % images.length].url;
|
|
27
|
-
}
|
|
28
|
-
React.useEffect(function () {
|
|
29
|
-
setCurrentImageIndex(imageIndex);
|
|
30
|
-
}, [imageIndex]);
|
|
31
|
-
return (React__default.createElement(React__default.Fragment, null, open && (React__default.createElement(ExternalLightBox, { wrapperClassName: styles.wrapper, mainSrc: images[currentImageIndex].url, enableZoom: false, nextSrc: nextSrc, prevSrc: prevSrc, imageTitle: images[currentImageIndex].title, imageCaption: images[currentImageIndex].caption, onCloseRequest: function () {
|
|
32
|
-
return onRequestClose({ lastPosition: currentImageIndex });
|
|
33
|
-
}, onMovePrevRequest: handleMovePrevious, onMoveNextRequest: handleMoveNext }))));
|
|
34
|
-
function handleMovePrevious() {
|
|
35
|
-
setCurrentImageIndex((currentImageIndex + images.length - 1) % images.length);
|
|
36
|
-
}
|
|
37
|
-
function handleMoveNext() {
|
|
38
|
-
setCurrentImageIndex((currentImageIndex + 1) % images.length);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
13
|
|
|
42
|
-
exports.LightBox = LightBox;
|
|
14
|
+
exports.LightBox = LightBox.LightBox;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib_es6 = require('./tslib.es6-5b50eb8e.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var ExternalLightBox = require('react-image-lightbox');
|
|
6
|
+
var styleInject_es = require('./style-inject.es-dcee06b6.js');
|
|
7
|
+
require('react-image-lightbox/style.css');
|
|
8
|
+
|
|
9
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
+
|
|
11
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
|
+
var ExternalLightBox__default = /*#__PURE__*/_interopDefaultLegacy(ExternalLightBox);
|
|
13
|
+
|
|
14
|
+
var css = "._23H2TI8rNmnv0zlHOHZooa.ril__outer {\n font-family: \"Source Sans Pro\", Helvetica, Arial, sans-serif;\n background-color: transparent;\n}\n\n._23H2TI8rNmnv0zlHOHZooa.ril__outer:before {\n content: \"\";\n display: block;\n width: 100%;\n height: 100%;\n background-color: var(--color-overlay);\n}\n\n._23H2TI8rNmnv0zlHOHZooa.ril__outer .ril__captionContent {\n color: var(--color-greyBlue--lighter);\n}\n\n._23H2TI8rNmnv0zlHOHZooa.ril__outer .ril__toolbarItem {\n color: var(--color-greyBlue--lighter);\n}\n";
|
|
15
|
+
var styles = {"wrapper":"_23H2TI8rNmnv0zlHOHZooa"};
|
|
16
|
+
styleInject_es.styleInject(css);
|
|
17
|
+
|
|
18
|
+
function LightBox(_a) {
|
|
19
|
+
var open = _a.open, images = _a.images, _b = _a.imageIndex, imageIndex = _b === void 0 ? 0 : _b, onRequestClose = _a.onRequestClose;
|
|
20
|
+
var _c = tslib_es6.__read(React.useState(imageIndex), 2), currentImageIndex = _c[0], setCurrentImageIndex = _c[1];
|
|
21
|
+
var nextSrc = undefined;
|
|
22
|
+
var prevSrc = undefined;
|
|
23
|
+
if (images.length > 1) {
|
|
24
|
+
nextSrc = images[(currentImageIndex + 1) % images.length].url;
|
|
25
|
+
prevSrc =
|
|
26
|
+
images[(currentImageIndex + images.length - 1) % images.length].url;
|
|
27
|
+
}
|
|
28
|
+
React.useEffect(function () {
|
|
29
|
+
setCurrentImageIndex(imageIndex);
|
|
30
|
+
}, [imageIndex]);
|
|
31
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null, open && (React__default["default"].createElement(ExternalLightBox__default["default"], { wrapperClassName: styles.wrapper, mainSrc: images[currentImageIndex].url, enableZoom: false, nextSrc: nextSrc, prevSrc: prevSrc, imageTitle: images[currentImageIndex].title, imageCaption: images[currentImageIndex].caption, onCloseRequest: function () {
|
|
32
|
+
return onRequestClose({ lastPosition: currentImageIndex });
|
|
33
|
+
}, onMovePrevRequest: handleMovePrevious, onMoveNextRequest: handleMoveNext }))));
|
|
34
|
+
function handleMovePrevious() {
|
|
35
|
+
setCurrentImageIndex((currentImageIndex + images.length - 1) % images.length);
|
|
36
|
+
}
|
|
37
|
+
function handleMoveNext() {
|
|
38
|
+
setCurrentImageIndex((currentImageIndex + 1) % images.length);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
exports.LightBox = LightBox;
|
package/dist/List/List.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ListItemProps } from "./ListItem";
|
|
2
|
-
interface ListProps {
|
|
3
|
-
/**
|
|
4
|
-
* Array of the list items.
|
|
5
|
-
*
|
|
6
|
-
* {@link https://atlantis.frend.space/components/list#list-item-props List Item Props}
|
|
7
|
-
*/
|
|
8
|
-
readonly items: ListItemProps[];
|
|
9
|
-
}
|
|
10
|
-
export declare function List({ items }: ListProps): JSX.Element;
|
|
11
|
-
export {};
|
|
1
|
+
import { ListItemProps } from "./ListItem";
|
|
2
|
+
interface ListProps {
|
|
3
|
+
/**
|
|
4
|
+
* Array of the list items.
|
|
5
|
+
*
|
|
6
|
+
* {@link https://atlantis.frend.space/components/list#list-item-props List Item Props}
|
|
7
|
+
*/
|
|
8
|
+
readonly items: ListItemProps[];
|
|
9
|
+
}
|
|
10
|
+
export declare function List({ items }: ListProps): JSX.Element;
|
|
11
|
+
export {};
|
package/dist/List/ListItem.d.ts
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { IconColorNames, IconNames } from "@jobber/design";
|
|
3
|
-
export interface ListItemProps {
|
|
4
|
-
/**
|
|
5
|
-
* Subdued text under the `content` prop.
|
|
6
|
-
*/
|
|
7
|
-
readonly caption?: string;
|
|
8
|
-
/**
|
|
9
|
-
* List item content. This accepts a string for a simple content and an array
|
|
10
|
-
* for a multi line content.
|
|
11
|
-
* This supports basic markdown node types such as `_italic_` and `**bold**`.
|
|
12
|
-
*/
|
|
13
|
-
readonly content: string | string[];
|
|
14
|
-
/**
|
|
15
|
-
* Shows an icon on the left side of the contents.
|
|
16
|
-
*/
|
|
17
|
-
readonly icon?: IconNames;
|
|
18
|
-
/**
|
|
19
|
-
* Changes the color of the icons.
|
|
20
|
-
*/
|
|
21
|
-
readonly iconColor?: IconColorNames;
|
|
22
|
-
/**
|
|
23
|
-
* The ID of the list item. This will be helpful to know the selected list
|
|
24
|
-
* items when a batch action is implemented.
|
|
25
|
-
*/
|
|
26
|
-
readonly id: number | string;
|
|
27
|
-
/**
|
|
28
|
-
* Highlights the list item with the lightest green icon. This communicates
|
|
29
|
-
* that the line item needs attention.
|
|
30
|
-
*/
|
|
31
|
-
readonly isActive?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* This determines how and when to group the list items
|
|
34
|
-
*/
|
|
35
|
-
readonly section?: string;
|
|
36
|
-
/**
|
|
37
|
-
* Adds a heading.
|
|
38
|
-
*/
|
|
39
|
-
readonly title?: string;
|
|
40
|
-
/**
|
|
41
|
-
* This turns the list item into a clickable link.
|
|
42
|
-
*/
|
|
43
|
-
readonly url?: string;
|
|
44
|
-
/**
|
|
45
|
-
* A numeric value of a row. This always shows up in the right side of the row
|
|
46
|
-
* with a text aligned to the right.
|
|
47
|
-
*/
|
|
48
|
-
readonly value?: string;
|
|
49
|
-
/**
|
|
50
|
-
* Callback when a list item gets clicked.
|
|
51
|
-
*/
|
|
52
|
-
onClick?(event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>): void;
|
|
53
|
-
}
|
|
54
|
-
export declare function ListItem({ caption, content, icon, iconColor, id, isActive, onClick, title, url, value, }: ListItemProps): JSX.Element;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IconColorNames, IconNames } from "@jobber/design";
|
|
3
|
+
export interface ListItemProps {
|
|
4
|
+
/**
|
|
5
|
+
* Subdued text under the `content` prop.
|
|
6
|
+
*/
|
|
7
|
+
readonly caption?: string;
|
|
8
|
+
/**
|
|
9
|
+
* List item content. This accepts a string for a simple content and an array
|
|
10
|
+
* for a multi line content.
|
|
11
|
+
* This supports basic markdown node types such as `_italic_` and `**bold**`.
|
|
12
|
+
*/
|
|
13
|
+
readonly content: string | string[];
|
|
14
|
+
/**
|
|
15
|
+
* Shows an icon on the left side of the contents.
|
|
16
|
+
*/
|
|
17
|
+
readonly icon?: IconNames;
|
|
18
|
+
/**
|
|
19
|
+
* Changes the color of the icons.
|
|
20
|
+
*/
|
|
21
|
+
readonly iconColor?: IconColorNames;
|
|
22
|
+
/**
|
|
23
|
+
* The ID of the list item. This will be helpful to know the selected list
|
|
24
|
+
* items when a batch action is implemented.
|
|
25
|
+
*/
|
|
26
|
+
readonly id: number | string;
|
|
27
|
+
/**
|
|
28
|
+
* Highlights the list item with the lightest green icon. This communicates
|
|
29
|
+
* that the line item needs attention.
|
|
30
|
+
*/
|
|
31
|
+
readonly isActive?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* This determines how and when to group the list items
|
|
34
|
+
*/
|
|
35
|
+
readonly section?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Adds a heading.
|
|
38
|
+
*/
|
|
39
|
+
readonly title?: string;
|
|
40
|
+
/**
|
|
41
|
+
* This turns the list item into a clickable link.
|
|
42
|
+
*/
|
|
43
|
+
readonly url?: string;
|
|
44
|
+
/**
|
|
45
|
+
* A numeric value of a row. This always shows up in the right side of the row
|
|
46
|
+
* with a text aligned to the right.
|
|
47
|
+
*/
|
|
48
|
+
readonly value?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Callback when a list item gets clicked.
|
|
51
|
+
*/
|
|
52
|
+
onClick?(event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>): void;
|
|
53
|
+
}
|
|
54
|
+
export declare function ListItem({ caption, content, icon, iconColor, id, isActive, onClick, title, url, value, }: ListItemProps): JSX.Element;
|
package/dist/List/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { List } from "./List";
|
|
1
|
+
export { List } from "./List";
|
package/dist/List/index.js
CHANGED
|
@@ -2,91 +2,93 @@
|
|
|
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 __chunk_2 = require('../chunk-17e02351.js');
|
|
11
|
-
var classnames = _interopDefault(require('classnames'));
|
|
12
|
-
var index = require('../Typography/index.js');
|
|
13
|
-
var index$1 = require('../Text/index.js');
|
|
14
|
-
require('@jobber/design');
|
|
15
|
-
var index$2 = require('../Icon/index.js');
|
|
16
|
-
var index$3 = require('../Heading/index.js');
|
|
7
|
+
var classnames = require('classnames');
|
|
17
8
|
var lodash = require('lodash');
|
|
18
|
-
require('../
|
|
9
|
+
var styleInject_es = require('../style-inject.es-dcee06b6.js');
|
|
10
|
+
var Icon = require('../Icon-d5ad1a6d.js');
|
|
11
|
+
var Text = require('../Text-9bc093e9.js');
|
|
12
|
+
var Heading = require('../Heading-56750113.js');
|
|
13
|
+
var Typography = require('../Typography-7e542a72.js');
|
|
14
|
+
var Markdown = require('../Markdown-69986c49.js');
|
|
15
|
+
var Emphasis = require('../Emphasis-fd845639.js');
|
|
16
|
+
require('@jobber/design');
|
|
19
17
|
require('react-markdown');
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
require('../Content-18de5fbb.js');
|
|
19
|
+
|
|
20
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
22
21
|
|
|
23
|
-
var
|
|
24
|
-
var
|
|
25
|
-
|
|
22
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
23
|
+
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
24
|
+
|
|
25
|
+
var css$2 = "._234cpupwZcQnNH7lwFvu3w {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.-W0NAXIbeNMPrAHa9AjQF:not(:last-child) {\n border-bottom: var(--border-base) solid var(--color-border);\n}\n\n._3gKGIvbWaCDPfDxdX_9dIp {\n position: relative;\n}\n\n._3gKGIvbWaCDPfDxdX_9dIp:not(:last-child) ._234cpupwZcQnNH7lwFvu3w {\n padding-bottom: var(--space-large);\n}\n";
|
|
26
|
+
var styles$1 = {"list":"_234cpupwZcQnNH7lwFvu3w","item":"-W0NAXIbeNMPrAHa9AjQF","section":"_3gKGIvbWaCDPfDxdX_9dIp"};
|
|
27
|
+
styleInject_es.styleInject(css$2);
|
|
26
28
|
|
|
27
29
|
var css$1 = ".LPbjUDShk6cK3GXbzTC55 {\n position: sticky;\n top: 0;\n padding: var(--space-small) var(--space-base);\n border-bottom: 1px solid var(--color-border--section);\n background-color: var(--color-surface);\n}\n\n._20KoAmqdzhCQHgym7QjG7l {\n border-bottom-color: var(--color-greyBlue--light);\n color: var(--color-greyBlue--light);\n}\n\n._1oDR35oSyONUPA0d94_kD- {\n border-bottom-color: var(--color-green);\n color: var(--color-green);\n}\n\n._17GCZtU8iTLoixbxcutdmt,\n._2GunPnEK6S7nxA3WhlBVoi {\n border-bottom-color: var(--color-blue);\n color: var(--color-blue);\n}\n\n._3pKjX8118O_JdihnJByRU7 {\n border-bottom-color: var(--color-orange);\n color: var(--color-orange);\n}\n\n._3Mm3SSqRayToZ4YENnBXTi {\n border-bottom-color: var(--color-red);\n color: var(--color-red);\n}\n\n._1JgWVq-AQjSXSFCthM9I_i {\n border-bottom-color: var(--color-teal);\n color: var(--color-teal);\n}\n";
|
|
28
30
|
var sectionStyles = {"sectionHeader":"LPbjUDShk6cK3GXbzTC55","greyBlue":"_20KoAmqdzhCQHgym7QjG7l","green":"_1oDR35oSyONUPA0d94_kD-","blue":"_17GCZtU8iTLoixbxcutdmt","archived":"_2GunPnEK6S7nxA3WhlBVoi","orange":"_3pKjX8118O_JdihnJByRU7","red":"_3Mm3SSqRayToZ4YENnBXTi","teal":"_1JgWVq-AQjSXSFCthM9I_i"};
|
|
29
|
-
|
|
31
|
+
styleInject_es.styleInject(css$1);
|
|
30
32
|
|
|
31
|
-
var css
|
|
32
|
-
var styles
|
|
33
|
-
|
|
33
|
+
var css = "._2iTo0SHtApSj1Pz0jAi44D {\n display: -ms-flexbox;\n display: flex;\n width: 100%;\n box-sizing: border-box;\n padding: var(--space-small);\n border: none;\n text-align: left;\n text-decoration: none;\n background-color: transparent;\n transition: background-color var(--timing-base);\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n -ms-flex-align: start;\n align-items: flex-start;\n}\n\n._2iTo0SHtApSj1Pz0jAi44D > * {\n padding: var(--space-small);\n}\n\n._3fuo63dN8BYlteQspAWEB {\n cursor: pointer;\n}\n\n._3fuo63dN8BYlteQspAWEB:hover,\n._3fuo63dN8BYlteQspAWEB:focus {\n outline: none;\n background-color: var(--color-surface--hover);\n}\n\n._2Ba10JIy4V4gV8mql4xqHo {\n display: -ms-flexbox;\n display: flex;\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n width: var(--space-large);\n height: var(--space-large);\n box-sizing: content-box;\n}\n\n._1vz3KPZUhpnltJyF8wN7V1 {\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n min-width: 0;\n -ms-flex-item-align: center;\n align-self: center;\n}\n\n._1vkwx_Vuhn930_zHsgEmz3 {\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n text-align: right;\n}\n\n/* States */\n\n._2QvWobst7cPMHu3OkCl2SG {\n background-color: var(--color-surface--active);\n}\n\n/* TODO: Move truncate in typography */\n\n.d36Bq7j0EKz3c5tj7HrWN {\n display: block;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n";
|
|
34
|
+
var styles = {"action":"_2iTo0SHtApSj1Pz0jAi44D","hoverable":"_3fuo63dN8BYlteQspAWEB","icon":"_2Ba10JIy4V4gV8mql4xqHo","info":"_1vz3KPZUhpnltJyF8wN7V1","amount":"_1vkwx_Vuhn930_zHsgEmz3","isActive":"_2QvWobst7cPMHu3OkCl2SG","truncate":"d36Bq7j0EKz3c5tj7HrWN"};
|
|
35
|
+
styleInject_es.styleInject(css);
|
|
34
36
|
|
|
35
|
-
function ListItem(_a) {
|
|
36
|
-
var caption = _a.caption, content = _a.content, icon = _a.icon, iconColor = _a.iconColor, id = _a.id, isActive = _a.isActive, onClick = _a.onClick, title = _a.title, url = _a.url, value = _a.value;
|
|
37
|
-
var actionClasses =
|
|
38
|
-
var Wrapper = url ? "a" : "button";
|
|
39
|
-
var buttonProps =
|
|
40
|
-
return (React__default.createElement(Wrapper,
|
|
41
|
-
icon && (React__default.createElement("div", { className: styles
|
|
42
|
-
React__default.createElement(
|
|
43
|
-
React__default.createElement("div", { className: styles
|
|
44
|
-
title && React__default.createElement(
|
|
45
|
-
React__default.createElement(Description, { content: content }),
|
|
46
|
-
caption && (React__default.createElement(
|
|
47
|
-
React__default.createElement(
|
|
48
|
-
value && (React__default.createElement("div", { className: styles
|
|
49
|
-
React__default.createElement(
|
|
50
|
-
React__default.createElement(
|
|
51
|
-
}
|
|
52
|
-
function Description(_a) {
|
|
53
|
-
var content = _a.content;
|
|
54
|
-
if (content instanceof Array) {
|
|
55
|
-
return (React__default.createElement(React__default.Fragment, null, content.map(function (item, i) { return (React__default.createElement(
|
|
56
|
-
React__default.createElement("span", { className: styles
|
|
57
|
-
React__default.createElement(
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
return (React__default.createElement(
|
|
61
|
-
React__default.createElement("span", { className: styles
|
|
62
|
-
React__default.createElement(
|
|
63
|
-
}
|
|
37
|
+
function ListItem(_a) {
|
|
38
|
+
var caption = _a.caption, content = _a.content, icon = _a.icon, iconColor = _a.iconColor, id = _a.id, isActive = _a.isActive, onClick = _a.onClick, title = _a.title, url = _a.url, value = _a.value;
|
|
39
|
+
var actionClasses = classnames__default["default"](styles.action, isActive && styles.isActive, (onClick || url) && styles.hoverable);
|
|
40
|
+
var Wrapper = url ? "a" : "button";
|
|
41
|
+
var buttonProps = tslib_es6.__assign({}, (Wrapper === "button" && { role: "button", type: "button" }));
|
|
42
|
+
return (React__default["default"].createElement(Wrapper, tslib_es6.__assign({ id: id.toString(), className: actionClasses, href: url, onClick: onClick }, buttonProps),
|
|
43
|
+
icon && (React__default["default"].createElement("div", { className: styles.icon },
|
|
44
|
+
React__default["default"].createElement(Icon.Icon, { name: icon, color: iconColor }))),
|
|
45
|
+
React__default["default"].createElement("div", { className: styles.info },
|
|
46
|
+
title && React__default["default"].createElement(Heading.Heading, { level: 5 }, title),
|
|
47
|
+
React__default["default"].createElement(Description, { content: content }),
|
|
48
|
+
caption && (React__default["default"].createElement(Text.Text, { variation: "subdued" },
|
|
49
|
+
React__default["default"].createElement(Typography.Typography, { element: "span", size: "small", emphasisType: "italic" }, caption)))),
|
|
50
|
+
value && (React__default["default"].createElement("div", { className: styles.amount },
|
|
51
|
+
React__default["default"].createElement(Text.Text, null,
|
|
52
|
+
React__default["default"].createElement(Emphasis.Emphasis, { variation: "bold" }, value))))));
|
|
53
|
+
}
|
|
54
|
+
function Description(_a) {
|
|
55
|
+
var content = _a.content;
|
|
56
|
+
if (content instanceof Array) {
|
|
57
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null, content.map(function (item, i) { return (React__default["default"].createElement(Text.Text, { key: i },
|
|
58
|
+
React__default["default"].createElement("span", { className: styles.truncate },
|
|
59
|
+
React__default["default"].createElement(Markdown.Markdown, { content: item, basicUsage: true })))); })));
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
return (React__default["default"].createElement(Text.Text, null,
|
|
63
|
+
React__default["default"].createElement("span", { className: styles.truncate },
|
|
64
|
+
React__default["default"].createElement(Markdown.Markdown, { content: content, basicUsage: true }))));
|
|
65
|
+
}
|
|
64
66
|
}
|
|
65
67
|
|
|
66
|
-
function List(_a) {
|
|
67
|
-
var items = _a.items;
|
|
68
|
-
var isSectioned = items.some(function (item) { return item.section; });
|
|
69
|
-
if (isSectioned) {
|
|
70
|
-
return React__default.createElement(SectionedList, { items: items });
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
return React__default.createElement(DisplayList, { items: items });
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
function DisplayList(_a) {
|
|
77
|
-
var items = _a.items;
|
|
78
|
-
return (React__default.createElement("ul", { className: styles.list }, items.map(function (item) { return (React__default.createElement("li", { key: item.id, className: styles.item },
|
|
79
|
-
React__default.createElement(ListItem,
|
|
80
|
-
}
|
|
81
|
-
function SectionedList(_a) {
|
|
82
|
-
var items = _a.items;
|
|
83
|
-
var sectionedItems = lodash.groupBy(items, function (item) { return lodash.get(item, "section", "Other"); });
|
|
84
|
-
var sectionHeaderClassNames =
|
|
85
|
-
return (React__default.createElement("ul", { className: styles.list }, Object.keys(sectionedItems).map(function (sectionName) { return (React__default.createElement("li", { key: sectionName, className: styles.section },
|
|
86
|
-
React__default.createElement("div", { className: sectionHeaderClassNames },
|
|
87
|
-
React__default.createElement(
|
|
88
|
-
React__default.createElement("ul", { className: styles.list }, sectionedItems[sectionName].map(function (item) { return (React__default.createElement("li", { key: item.id, className: styles.item },
|
|
89
|
-
React__default.createElement(ListItem,
|
|
68
|
+
function List(_a) {
|
|
69
|
+
var items = _a.items;
|
|
70
|
+
var isSectioned = items.some(function (item) { return item.section; });
|
|
71
|
+
if (isSectioned) {
|
|
72
|
+
return React__default["default"].createElement(SectionedList, { items: items });
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
return React__default["default"].createElement(DisplayList, { items: items });
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function DisplayList(_a) {
|
|
79
|
+
var items = _a.items;
|
|
80
|
+
return (React__default["default"].createElement("ul", { className: styles$1.list }, items.map(function (item) { return (React__default["default"].createElement("li", { key: item.id, className: styles$1.item },
|
|
81
|
+
React__default["default"].createElement(ListItem, tslib_es6.__assign({}, item)))); })));
|
|
82
|
+
}
|
|
83
|
+
function SectionedList(_a) {
|
|
84
|
+
var items = _a.items;
|
|
85
|
+
var sectionedItems = lodash.groupBy(items, function (item) { return lodash.get(item, "section", "Other"); });
|
|
86
|
+
var sectionHeaderClassNames = classnames__default["default"](sectionStyles.sectionHeader);
|
|
87
|
+
return (React__default["default"].createElement("ul", { className: styles$1.list }, Object.keys(sectionedItems).map(function (sectionName) { return (React__default["default"].createElement("li", { key: sectionName, className: styles$1.section },
|
|
88
|
+
React__default["default"].createElement("div", { className: sectionHeaderClassNames },
|
|
89
|
+
React__default["default"].createElement(Typography.Typography, { element: "h4", fontWeight: "bold", size: "large" }, sectionName)),
|
|
90
|
+
React__default["default"].createElement("ul", { className: styles$1.list }, sectionedItems[sectionName].map(function (item) { return (React__default["default"].createElement("li", { key: item.id, className: styles$1.item },
|
|
91
|
+
React__default["default"].createElement(ListItem, tslib_es6.__assign({}, item)))); })))); })));
|
|
90
92
|
}
|
|
91
93
|
|
|
92
94
|
exports.List = List;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
interface MarkdownProps {
|
|
2
|
-
/**
|
|
3
|
-
* Rich text content.
|
|
4
|
-
*/
|
|
5
|
-
readonly content: string;
|
|
6
|
-
/**
|
|
7
|
-
* Open all links in new tab.
|
|
8
|
-
*/
|
|
9
|
-
readonly externalLink?: boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Only allow basic inline elements such as `_italic_`, `**bold**`, and
|
|
12
|
-
* `[link name](url)`
|
|
13
|
-
*/
|
|
14
|
-
readonly basicUsage?: boolean;
|
|
15
|
-
}
|
|
16
|
-
export declare function Markdown({ content, externalLink, basicUsage }: MarkdownProps): JSX.Element;
|
|
17
|
-
export {};
|
|
1
|
+
interface MarkdownProps {
|
|
2
|
+
/**
|
|
3
|
+
* Rich text content.
|
|
4
|
+
*/
|
|
5
|
+
readonly content: string;
|
|
6
|
+
/**
|
|
7
|
+
* Open all links in new tab.
|
|
8
|
+
*/
|
|
9
|
+
readonly externalLink?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Only allow basic inline elements such as `_italic_`, `**bold**`, and
|
|
12
|
+
* `[link name](url)`
|
|
13
|
+
*/
|
|
14
|
+
readonly basicUsage?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function Markdown({ content, externalLink, basicUsage }: MarkdownProps): JSX.Element;
|
|
17
|
+
export {};
|
package/dist/Markdown/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Markdown } from "./Markdown";
|
|
1
|
+
export { Markdown } from "./Markdown";
|