@longline/aqua-ui 1.0.339 → 1.0.341
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/containers/Anchor/Anchor.d.ts +5 -0
- package/containers/Anchor/Anchor.js +20 -8
- package/containers/Dock/Dock.d.ts +5 -0
- package/containers/Dock/Dock.js +1 -1
- package/containers/Dock/Dockable.d.ts +5 -0
- package/containers/Dock/Dockable.js +20 -12
- package/containers/DragBar/DragBar.d.ts +5 -0
- package/containers/DragBar/DragBar.js +16 -5
- package/containers/Form/Field.d.ts +0 -3
- package/containers/Form/Field.js +3 -6
- package/containers/Form/Form.js +5 -36
- package/containers/Form/Validation.d.ts +1 -1
- package/containers/Form/Validation.js +6 -6
- package/containers/Form/context/FormContext.d.ts +1 -2
- package/containers/Form/context/useForm.d.ts +1 -1
- package/containers/Form/elements/BoxWrapper.js +2 -0
- package/containers/GlassPane/GlassPane.d.ts +7 -2
- package/containers/GlassPane/GlassPane.js +3 -3
- package/containers/InfoBox/InfoBox.d.ts +5 -0
- package/containers/InfoBox/InfoBox.js +1 -1
- package/containers/List/List.d.ts +5 -0
- package/containers/List/List.js +1 -1
- package/containers/List/ListCell.d.ts +5 -0
- package/containers/List/ListCell.js +1 -1
- package/containers/List/ListRow.d.ts +7 -2
- package/containers/List/ListRow.js +1 -1
- package/containers/Message/Error.d.ts +2 -0
- package/containers/Message/Error.js +1 -1
- package/containers/Message/Message.d.ts +5 -0
- package/containers/Message/Message.js +1 -1
- package/containers/Message/NoData.d.ts +2 -0
- package/containers/Message/NoData.js +1 -1
- package/containers/Message/NoFilteredData.d.ts +2 -0
- package/containers/Message/NoFilteredData.js +1 -1
- package/containers/Openable/Openable.d.ts +5 -0
- package/containers/Openable/Openable.js +8 -8
- package/containers/PublicRoute/PublicRoute.d.ts +9 -1
- package/containers/PublicRoute/PublicRoute.js +3 -7
- package/containers/Tabs/Pane.d.ts +5 -0
- package/containers/Tabs/Pane.js +3 -3
- package/containers/Tabs/Tabs.d.ts +5 -0
- package/containers/Tabs/Tabs.js +3 -3
- package/controls/Chip/Chip.d.ts +15 -3
- package/controls/Chip/Chip.js +7 -6
- package/controls/CircularProgress/CircularProgress.d.ts +11 -0
- package/controls/CircularProgress/CircularProgress.js +19 -11
- package/controls/Dropzone/Dropzone.d.ts +11 -1
- package/controls/Dropzone/Dropzone.js +18 -7
- package/controls/Fab/Fab.d.ts +14 -6
- package/controls/Fab/Fab.js +7 -20
- package/controls/Ghost/Ghost.js +3 -3
- package/controls/Gradient/Gradient.d.ts +6 -1
- package/controls/Gradient/Gradient.js +19 -5
- package/controls/Histogram/Histogram.d.ts +8 -2
- package/controls/Histogram/Histogram.js +9 -9
- package/controls/Histogram/HistogramBar.d.ts +2 -2
- package/controls/Icon/Icon.d.ts +10 -4
- package/controls/Icon/Icon.js +23 -6
- package/controls/Key/Key.d.ts +5 -0
- package/controls/Key/Key.js +2 -5
- package/controls/LinearChart/LinearChart.d.ts +9 -0
- package/controls/LinearChart/LinearChart.js +11 -6
- package/controls/ListButton/ListButton.d.ts +46 -3
- package/controls/ListButton/ListButton.js +70 -9
- package/controls/ListView/ColumnsManager/ColumnDraggable.js +11 -5
- package/controls/ListView/ColumnsManager/SourceColumns.js +1 -1
- package/controls/ListView/IListViewProps.d.ts +9 -2
- package/controls/ListView/ListView.js +17 -16
- package/controls/ListView/defaults.d.ts +3 -0
- package/controls/ListView/defaults.js +6 -0
- package/controls/ListView/elements/Body.d.ts +1 -1
- package/controls/ListView/elements/Body.js +23 -12
- package/controls/ListView/elements/Ghost.js +3 -2
- package/controls/ListView/elements/Header.js +3 -2
- package/controls/ListView/elements/HeaderCell.js +3 -3
- package/controls/ListView/elements/Table.js +16 -10
- package/controls/Mouse/Mouse.d.ts +5 -0
- package/controls/Mouse/Mouse.js +15 -8
- package/controls/PrimaryButton/PrimaryButton.d.ts +9 -3
- package/controls/PrimaryButton/PrimaryButton.js +5 -5
- package/controls/Progress/Progress.d.ts +9 -0
- package/controls/Progress/Progress.js +12 -8
- package/controls/SecondaryButton/SecondaryButton.d.ts +8 -3
- package/controls/SecondaryButton/SecondaryButton.js +1 -1
- package/controls/SpeechRecognizer/EditorRegistry.js +1 -2
- package/controls/SpeechRecognizer/SpeechRecognizer.d.ts +9 -1
- package/controls/SpeechRecognizer/SpeechRecognizer.js +16 -9
- package/controls/TabBar/TabBar.d.ts +5 -0
- package/controls/TabBar/TabBar.js +14 -6
- package/controls/TabBar/Underliner.js +1 -1
- package/controls/TertiaryButton/TertiaryButton.d.ts +9 -3
- package/controls/TertiaryButton/TertiaryButton.js +5 -3
- package/controls/ToggleButton/ToggleButton.d.ts +8 -2
- package/controls/ToggleButton/ToggleButton.js +1 -1
- package/controls/View/View.d.ts +5 -0
- package/controls/View/View.js +1 -1
- package/formatters/CountryFormatter/CountryFormatter.d.ts +3 -2
- package/formatters/CountryFormatter/CountryUtil.d.ts +3 -3
- package/formatters/DateTimeFormatter/DateTimeFormatter.d.ts +11 -10
- package/formatters/DateTimeFormatter/elements/Custom.d.ts +1 -1
- package/formatters/DateTimeFormatter/elements/DistanceDate.d.ts +1 -1
- package/formatters/DateTimeFormatter/elements/LongDate.d.ts +1 -1
- package/formatters/DateTimeFormatter/elements/LongDateTime.d.ts +1 -1
- package/formatters/DateTimeFormatter/elements/LongTime.d.ts +1 -1
- package/formatters/DateTimeFormatter/elements/Month.d.ts +1 -1
- package/formatters/DateTimeFormatter/elements/ShortDate.d.ts +1 -1
- package/formatters/DateTimeFormatter/elements/ShortDateTime.d.ts +1 -1
- package/formatters/DateTimeFormatter/elements/ShortTime.d.ts +1 -1
- package/formatters/DivisionFormatter/DivisionFormatter.d.ts +2 -2
- package/formatters/DivisionFormatter/DivisionFormatter.js +1 -1
- package/formatters/DivisionFormatter/DivisionUtil.d.ts +1 -1
- package/formatters/DivisionFormatter/DivisionUtil.js +5 -3
- package/formatters/FilesizeFormatter/FilesizeFormatter.d.ts +3 -3
- package/formatters/GIS/CoordinateFormatter.d.ts +2 -2
- package/formatters/GIS/LatitudeFormatter.d.ts +2 -2
- package/formatters/GIS/LongitudeFormatter.d.ts +2 -2
- package/formatters/HumanFormatter/HumanFormatter.d.ts +3 -3
- package/formatters/NumberFormatter/NumberFormatter.d.ts +3 -3
- package/formatters/PhoneFormatter/PhoneFormatter.d.ts +3 -3
- package/formatters/StringFormatter/StringFormatter.d.ts +3 -3
- package/formatters/StringFormatter/StringFormatter.js +1 -4
- package/helper/DMS.d.ts +1 -1
- package/helper/DMS.js +2 -2
- package/hooks/useOutsideClose/useOutsideClose.js +20 -11
- package/hooks/useSpeechAIRecorder/useSpeechAIRecorder.js +10 -7
- package/index.js +1 -0
- package/inputs/DateInput/Body.d.ts +2 -2
- package/inputs/DateInput/Body.js +11 -7
- package/inputs/DateInput/Calendar.d.ts +1 -1
- package/inputs/DateInput/Calendar.js +3 -5
- package/inputs/DateInput/DateInput.d.ts +11 -3
- package/inputs/DateInput/DateInput.js +11 -3
- package/inputs/DateInput/Day.d.ts +1 -1
- package/inputs/DateInput/InfiniteList.js +6 -3
- package/inputs/DateInput/Navbar.js +3 -2
- package/inputs/DateInput/NumericInput.js +3 -0
- package/inputs/DateInput/Selector.d.ts +1 -1
- package/inputs/DateInput/Selector.js +9 -6
- package/inputs/Dropdown/Body.d.ts +2 -2
- package/inputs/Dropdown/Column.d.ts +1 -1
- package/inputs/Dropdown/Dropdown.d.ts +5 -0
- package/inputs/Dropdown/Dropdown.js +36 -63
- package/inputs/Dropdown/Pill.js +1 -1
- package/inputs/Dropdown/Selection.js +1 -1
- package/inputs/Editor/Editor.d.ts +5 -0
- package/inputs/Editor/Editor.js +16 -6
- package/inputs/Editor/buttons/SpeechAIButton.js +2 -0
- package/inputs/Editor/buttons/TextAIButton.d.ts +0 -13
- package/inputs/Editor/buttons/TextAIButton.js +30 -14
- package/inputs/Editor/buttons/TextAIMenu.js +1 -1
- package/inputs/Editor/menu/MenuBar.d.ts +1 -1
- package/inputs/Editor/menu/MenuBar.js +1 -1
- package/inputs/Editor/menu/MenuButton.js +1 -1
- package/inputs/Input/Clear.js +1 -1
- package/inputs/Input/Input.d.ts +5 -0
- package/inputs/Input/Input.js +8 -6
- package/inputs/Input/InputWrapper.d.ts +2 -0
- package/inputs/Input/InputWrapper.js +1 -1
- package/inputs/Input/Reveal.js +1 -1
- package/inputs/MonthRange/Body.d.ts +1 -1
- package/inputs/MonthRange/Calendar.d.ts +2 -2
- package/inputs/MonthRange/Calendar.js +6 -9
- package/inputs/MonthRange/MonthRange.d.ts +7 -1
- package/inputs/MonthRange/MonthRange.js +14 -6
- package/inputs/MonthRange/Selector.d.ts +1 -1
- package/inputs/MonthRange/Selector.js +12 -11
- package/inputs/PhoneInput/PhoneInput.d.ts +5 -0
- package/inputs/PhoneInput/PhoneInput.js +2 -2
- package/inputs/Selector/Selector.d.ts +5 -0
- package/inputs/Selector/Selector.js +4 -1
- package/inputs/Slider/Slider.d.ts +75 -22
- package/inputs/Slider/Slider.js +104 -22
- package/inputs/Textarea/Textarea.d.ts +5 -5
- package/inputs/Textarea/Textarea.js +3 -2
- package/map/Map/Map.d.ts +2 -2
- package/map/Map/Map.js +20 -14
- package/map/PositionsManager/PositionBox.js +7 -3
- package/map/PositionsManager/PositionsManager.js +33 -13
- package/map/controls/CompassButton/CompassButton.js +1 -1
- package/map/controls/FullscreenButton/FullscreenButton.js +1 -1
- package/map/controls/Geocoder/Geocoder.js +28 -14
- package/map/controls/Geocoder/GeocoderApi.js +2 -0
- package/map/controls/Geocoder/GeocoderSelector.js +1 -1
- package/map/controls/Graticule/Graticule.js +1 -5
- package/map/controls/MapLoader/MapLoader.js +1 -1
- package/map/controls/ScaleControl/ScaleControl.js +1 -1
- package/map/controls/ZoomInButton/ZoomInButton.js +1 -1
- package/map/controls/ZoomOutButton/ZoomOutButton.d.ts +1 -1
- package/map/controls/ZoomOutButton/ZoomOutButton.js +2 -2
- package/map/controls/base/MapButton/MapButton.d.ts +8 -2
- package/map/controls/base/MapButton/MapButton.js +11 -2
- package/map/controls/base/MapControl/MapControl.d.ts +5 -0
- package/map/controls/base/MapControl/MapControl.js +10 -7
- package/map/layers/ClusterLayer/ClusterLayer.d.ts +1 -1
- package/map/layers/ClusterLayer/ClusterLayer.js +7 -3
- package/map/layers/HtmlMarkerLayer/HtmlMarkerLayer.js +8 -4
- package/map/layers/IdwBlendLayer/IdwBlendLayer.js +9 -4
- package/map/layers/IdwLayer/IdwLayer.d.ts +2 -1
- package/map/layers/IdwLayer/IdwLayer.js +271 -215
- package/map/layers/InterpolationLayer/ContoursFragmentShader.d.ts +1 -1
- package/map/layers/InterpolationLayer/ContoursFragmentShader.js +1 -1
- package/map/layers/InterpolationLayer/InterpolationLayer.d.ts +4 -3
- package/map/layers/InterpolationLayer/InterpolationLayer.js +362 -275
- package/map/layers/ParticlesLayer/ParticlesLayer.d.ts +8 -7
- package/map/layers/ParticlesLayer/ParticlesLayer.js +528 -404
- package/map/markers/ClusterMarker/ClusterMarker.d.ts +6 -1
- package/map/markers/ClusterMarker/ClusterMarker.js +15 -6
- package/map/markers/RiskMarker/RiskMarker.d.ts +5 -1
- package/map/markers/RiskMarker/RiskMarker.js +4 -4
- package/modules/CountryDropdown/CountryDropdown.js +10 -1
- package/modules/Filter/Filter.d.ts +5 -0
- package/modules/Filter/Filter.js +10 -6
- package/modules/Globe/Globe.d.ts +5 -0
- package/modules/Globe/Globe.js +4 -4
- package/modules/MainMenu/Item.d.ts +9 -2
- package/modules/MainMenu/Item.js +8 -5
- package/modules/MainMenu/MainMenu.d.ts +5 -0
- package/modules/MainMenu/MainMenu.js +1 -1
- package/modules/ParticleGlobe/GL.d.ts +1 -1
- package/modules/ParticleGlobe/ParticleGlobe.d.ts +5 -0
- package/modules/ParticleGlobe/ParticleGlobe.js +69 -40
- package/modules/Public/Public.d.ts +5 -0
- package/modules/Public/Public.js +3 -3
- package/package.json +1 -1
- package/services/Auth/Auth.js +13 -7
- package/services/Auth/AuthContext.js +9 -1
- package/services/Dialog/Dialog.d.ts +7 -2
- package/services/Dialog/Dialog.js +7 -6
- package/services/Dialog/DialogWindow.d.ts +3 -1
- package/services/Dialog/DialogWindow.js +1 -1
- package/services/Dialog/XhrDialog.d.ts +1 -1
- package/services/Toast/Toast.js +5 -3
- package/services/Toast/ToastContainer.js +3 -1
- package/services/Toast/ToastContext.d.ts +1 -1
- package/services/Toast/ToastProvider.js +2 -0
- package/map/layers/HtmlMarkerLayer/HtmlMarkerLayer copy.d.ts +0 -35
- package/map/layers/HtmlMarkerLayer/HtmlMarkerLayer copy.js +0 -176
- package/modules/Root/Content.d.ts +0 -16
- package/modules/Root/Content.js +0 -25
- package/modules/Root/Overlay.d.ts +0 -23
- package/modules/Root/Overlay.js +0 -33
- package/modules/Root/Root.d.ts +0 -10
- package/modules/Root/Root.js +0 -46
- package/modules/Root/Shader.d.ts +0 -15
- package/modules/Root/Shader.js +0 -24
- package/modules/Root/Sidebar.d.ts +0 -13
- package/modules/Root/Sidebar.js +0 -24
- package/modules/Root/index.d.ts +0 -1
- package/modules/Root/index.js +0 -1
- package/modules/Root/stories/SampleContent.d.ts +0 -7
- package/modules/Root/stories/SampleContent.js +0 -44
|
@@ -6,6 +6,8 @@ interface IProps {
|
|
|
6
6
|
onRetry?: () => void;
|
|
7
7
|
/** If set, add a margin around the message box. */
|
|
8
8
|
margin?: boolean;
|
|
9
|
+
/** Optional inline styles applied to the outer element. */
|
|
10
|
+
style?: React.CSSProperties;
|
|
9
11
|
}
|
|
10
12
|
declare const Error: {
|
|
11
13
|
(props: IProps): React.JSX.Element;
|
|
@@ -3,7 +3,7 @@ import { Message } from './Message';
|
|
|
3
3
|
import { TertiaryButton } from '../../controls/TertiaryButton';
|
|
4
4
|
var Error = function (props) {
|
|
5
5
|
var _a;
|
|
6
|
-
return React.createElement(Message, { margin: props.margin }, (_a = props.children) !== null && _a !== void 0 ? _a : "An error occurred.",
|
|
6
|
+
return React.createElement(Message, { margin: props.margin, style: props.style }, (_a = props.children) !== null && _a !== void 0 ? _a : "An error occurred.",
|
|
7
7
|
props.onRetry && React.createElement(TertiaryButton, { onClick: props.onRetry }, "RETRY"));
|
|
8
8
|
};
|
|
9
9
|
Error.displayName = "Message.Error";
|
|
@@ -7,6 +7,11 @@ interface IMessageProps extends ITestable {
|
|
|
7
7
|
children?: React.ReactNode;
|
|
8
8
|
/** If set, add a margin around the message box. */
|
|
9
9
|
margin?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Optional inline styles applied to the outer element, for one-off overrides
|
|
12
|
+
* of the default styling.
|
|
13
|
+
*/
|
|
14
|
+
style?: React.CSSProperties;
|
|
10
15
|
}
|
|
11
16
|
/**
|
|
12
17
|
* A `Message` is used to communicate to the user that something unusual
|
|
@@ -19,7 +19,7 @@ import { NoData } from './NoData';
|
|
|
19
19
|
import { NoFilteredData } from './NoFilteredData';
|
|
20
20
|
import { Error } from './Error';
|
|
21
21
|
var MessageBase = function (props) {
|
|
22
|
-
return React.createElement("div", { "data-testid": props['data-testid'] || "Message", className: props.className }, props.children);
|
|
22
|
+
return React.createElement("div", { "data-testid": props['data-testid'] || "Message", className: props.className, style: props.style }, props.children);
|
|
23
23
|
};
|
|
24
24
|
var MessageStyled = styled(MessageBase)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n // Position:\n margin: ", ";\n\n // Content:\n display: flex;\n flex-direction: column;\n justify-content: center;\n text-align: center;\n align-items: center;\n gap: 16px;\n\n // Appearance:\n color: ", ";\n user-select: none;\n padding: 16px 16px 16px 16px;\n border-radius: ", "px;\n background-color: ", "; \n line-height: 22px;\n"], ["\n // Position:\n margin: ", ";\n\n // Content:\n display: flex;\n flex-direction: column;\n justify-content: center;\n text-align: center;\n align-items: center;\n gap: 16px;\n\n // Appearance:\n color: ", ";\n user-select: none;\n padding: 16px 16px 16px 16px;\n border-radius: ", "px;\n background-color: ", "; \n line-height: 22px;\n"
|
|
25
25
|
/**
|
|
@@ -4,6 +4,8 @@ interface IProps {
|
|
|
4
4
|
children?: React.ReactNode;
|
|
5
5
|
/** If set, add a margin around the message box. */
|
|
6
6
|
margin?: boolean;
|
|
7
|
+
/** Optional inline styles applied to the outer element. */
|
|
8
|
+
style?: React.CSSProperties;
|
|
7
9
|
}
|
|
8
10
|
declare const NoData: {
|
|
9
11
|
(props: IProps): React.JSX.Element;
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { Message } from './Message';
|
|
3
3
|
var NoData = function (props) {
|
|
4
4
|
var _a;
|
|
5
|
-
return React.createElement(Message, { margin: props.margin }, (_a = props.children) !== null && _a !== void 0 ? _a : "There are no records yet.");
|
|
5
|
+
return React.createElement(Message, { margin: props.margin, style: props.style }, (_a = props.children) !== null && _a !== void 0 ? _a : "There are no records yet.");
|
|
6
6
|
};
|
|
7
7
|
NoData.displayName = "Message.NoData";
|
|
8
8
|
export { NoData };
|
|
@@ -6,6 +6,8 @@ interface IProps {
|
|
|
6
6
|
onClear?: () => void;
|
|
7
7
|
/** If set, add a margin around the message box. */
|
|
8
8
|
margin?: boolean;
|
|
9
|
+
/** Optional inline styles applied to the outer element. */
|
|
10
|
+
style?: React.CSSProperties;
|
|
9
11
|
}
|
|
10
12
|
declare const NoFilteredData: {
|
|
11
13
|
(props: IProps): React.JSX.Element;
|
|
@@ -3,7 +3,7 @@ import { Message } from './Message';
|
|
|
3
3
|
import { TertiaryButton } from '../../controls/TertiaryButton';
|
|
4
4
|
var NoFilteredData = function (props) {
|
|
5
5
|
var _a;
|
|
6
|
-
return React.createElement(Message, { margin: props.margin }, (_a = props.children) !== null && _a !== void 0 ? _a : "No records found. Your query may be too restrictive.",
|
|
6
|
+
return React.createElement(Message, { margin: props.margin, style: props.style }, (_a = props.children) !== null && _a !== void 0 ? _a : "No records found. Your query may be too restrictive.",
|
|
7
7
|
props.onClear && React.createElement(TertiaryButton, { onClick: props.onClear }, "CLEAR FILTER"));
|
|
8
8
|
};
|
|
9
9
|
NoFilteredData.displayName = "Message.NoFilteredData";
|
|
@@ -22,6 +22,11 @@ interface IOpenableProps extends ITestable {
|
|
|
22
22
|
* Fired when Openable must close.
|
|
23
23
|
*/
|
|
24
24
|
onClose: () => void;
|
|
25
|
+
/**
|
|
26
|
+
* Optional inline styles applied to the outer element, for one-off overrides
|
|
27
|
+
* of the default styling.
|
|
28
|
+
*/
|
|
29
|
+
style?: React.CSSProperties;
|
|
25
30
|
}
|
|
26
31
|
declare const Openable: {
|
|
27
32
|
({ width, ...props }: IOpenableProps): React.JSX.Element;
|
|
@@ -30,18 +30,18 @@ import { createPortal } from 'react-dom';
|
|
|
30
30
|
import { usePopper } from 'react-popper';
|
|
31
31
|
import { useOutsideClose } from '../../hooks/useOutsideClose';
|
|
32
32
|
var Openable = function (_a) {
|
|
33
|
-
var _b;
|
|
34
|
-
var
|
|
33
|
+
var _b, _c, _d;
|
|
34
|
+
var _e = _a.width, width = _e === void 0 ? 250 : _e, props = __rest(_a, ["width"]);
|
|
35
35
|
var toggleRef = React.useRef(null);
|
|
36
36
|
var paneRef = React.useRef(null);
|
|
37
37
|
useOutsideClose({
|
|
38
|
-
open: props.open,
|
|
38
|
+
open: (_b = props.open) !== null && _b !== void 0 ? _b : false,
|
|
39
39
|
refs: [toggleRef, paneRef],
|
|
40
40
|
onClose: props.onClose,
|
|
41
41
|
escapeToClose: true,
|
|
42
42
|
blurToClose: false
|
|
43
43
|
});
|
|
44
|
-
var
|
|
44
|
+
var _f = usePopper(toggleRef.current, paneRef.current, {
|
|
45
45
|
placement: 'bottom-end',
|
|
46
46
|
modifiers: [
|
|
47
47
|
{
|
|
@@ -51,15 +51,15 @@ var Openable = function (_a) {
|
|
|
51
51
|
},
|
|
52
52
|
}
|
|
53
53
|
]
|
|
54
|
-
}), styles =
|
|
54
|
+
}), styles = _f.styles, attributes = _f.attributes, update = _f.update;
|
|
55
55
|
React.useEffect(function () {
|
|
56
56
|
update === null || update === void 0 ? void 0 : update();
|
|
57
57
|
}, [props.open]);
|
|
58
|
-
return (React.createElement("div", { "data-testid": props['data-testid'] || "Openable", ref: toggleRef },
|
|
58
|
+
return (React.createElement("div", { "data-testid": props['data-testid'] || "Openable", style: props.style, ref: toggleRef },
|
|
59
59
|
props.toggle,
|
|
60
|
-
createPortal(React.createElement(Pane, __assign({ "data-testid": "Openable.Pane", "$open": props.open, "$width": width, style: styles.popper }, attributes.popper, { ref: paneRef }), props.open && props.content), // If in fullscreen mode, Openable must portal into fullscreen element,
|
|
60
|
+
createPortal(React.createElement(Pane, __assign({ "data-testid": "Openable.Pane", "$open": (_c = props.open) !== null && _c !== void 0 ? _c : false, "$width": width, style: styles.popper }, attributes.popper, { ref: paneRef }), props.open && props.content), // If in fullscreen mode, Openable must portal into fullscreen element,
|
|
61
61
|
// else content will be hidden.
|
|
62
|
-
(
|
|
62
|
+
(_d = document.fullscreenElement) !== null && _d !== void 0 ? _d : document.body)));
|
|
63
63
|
};
|
|
64
64
|
var Pane = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: ", ";\n width: ", "px;\n z-index: 4000;\n"], ["\n display: ", ";\n width: ", "px;\n z-index: 4000;\n"])), function (p) { return p.$open ? 'block' : 'none'; }, function (p) { return p.$width; });
|
|
65
65
|
Openable.displayName = "Openable";
|
|
@@ -7,6 +7,14 @@ interface IProps extends ITestable {
|
|
|
7
7
|
children?: React.ReactNode;
|
|
8
8
|
logoUrl: string;
|
|
9
9
|
help?: React.ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* Optional inline styles applied to the outer element, for one-off overrides
|
|
12
|
+
* of the default styling.
|
|
13
|
+
*/
|
|
14
|
+
style?: React.CSSProperties;
|
|
10
15
|
}
|
|
11
|
-
declare const PublicRoute:
|
|
16
|
+
declare const PublicRoute: {
|
|
17
|
+
(props: IProps): React.JSX.Element;
|
|
18
|
+
displayName: string;
|
|
19
|
+
};
|
|
12
20
|
export { PublicRoute };
|
|
@@ -22,15 +22,10 @@ import { SVG } from '../../svg';
|
|
|
22
22
|
import { ParticleGlobe } from '../../modules/ParticleGlobe/ParticleGlobe';
|
|
23
23
|
var PublicRouteBase = function (props) {
|
|
24
24
|
var _a = React.useState(false), showHelp = _a[0], setShowHelp = _a[1];
|
|
25
|
-
return (React.createElement("div", { "data-testid": props['data-testid'] || "PublicRoute", className: props.className },
|
|
25
|
+
return (React.createElement("div", { "data-testid": props['data-testid'] || "PublicRoute", className: props.className, style: props.style },
|
|
26
26
|
React.createElement(ParticleGlobe, { landmass: 'day', globe: true, glow: 20, trails: 5, pointSize: 1.0, numParticles: 100000, brightness: 0.9, speedFactor: 750, minLifetime: 1000, maxLifetime: 1000, responsive: true }),
|
|
27
27
|
React.createElement(Content, null,
|
|
28
|
-
React.createElement(Help, { active: showHelp },
|
|
29
|
-
"Help content",
|
|
30
|
-
React.createElement("br", null),
|
|
31
|
-
"Help content",
|
|
32
|
-
React.createElement("br", null),
|
|
33
|
-
"Help content"),
|
|
28
|
+
React.createElement(Help, { active: showHelp }, props.help),
|
|
34
29
|
React.createElement(InfoBox, { width: 400, padded: true, header: React.createElement(Header, null,
|
|
35
30
|
React.createElement(Logo, null,
|
|
36
31
|
React.createElement("use", { xlinkHref: props.logoUrl })),
|
|
@@ -41,5 +36,6 @@ var Header = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateOb
|
|
|
41
36
|
var Content = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: absolute;\n width: 400px;\n max-width: 90vw;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n z-index: 1;\n"], ["\n position: absolute;\n width: 400px;\n max-width: 90vw;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n z-index: 1;\n"])));
|
|
42
37
|
var PublicRouteStyled = styled(PublicRouteBase)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n overflow: hidden; \n background: conic-gradient(from 0deg at 0 0, #071119 0deg, #071119 90deg, #243961 180deg, #243961 -1deg);\n background-blend-mode: multiply; \n"], ["\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n overflow: hidden; \n background: conic-gradient(from 0deg at 0 0, #071119 0deg, #071119 90deg, #243961 180deg, #243961 -1deg);\n background-blend-mode: multiply; \n"])));
|
|
43
38
|
var PublicRoute = function (props) { return React.createElement(PublicRouteStyled, __assign({}, props)); };
|
|
39
|
+
PublicRoute.displayName = "PublicRoute";
|
|
44
40
|
export { PublicRoute };
|
|
45
41
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
@@ -18,6 +18,11 @@ interface IPaneProps extends ITestable {
|
|
|
18
18
|
* @default 0
|
|
19
19
|
*/
|
|
20
20
|
padding?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Optional inline styles applied to the outer element, for one-off overrides
|
|
23
|
+
* of the default styling.
|
|
24
|
+
*/
|
|
25
|
+
style?: React.CSSProperties;
|
|
21
26
|
}
|
|
22
27
|
/**
|
|
23
28
|
* Label and ontent for a single tab pane. The `label` can be JSX.
|
package/containers/Tabs/Pane.js
CHANGED
|
@@ -22,9 +22,9 @@ var PaneBase = function (props) {
|
|
|
22
22
|
// By default, all children are rendered (but hidden when
|
|
23
23
|
// not active). With nohiddenrender enabled, only the active
|
|
24
24
|
// tab is rendered.
|
|
25
|
-
return (React.createElement("div", { "data-testid": props['data-testid'] || "Tabs.Pane", className: props.className }, shouldRender() ? props.children : null));
|
|
25
|
+
return (React.createElement("div", { "data-testid": props['data-testid'] || "Tabs.Pane", className: props.className, style: props.style }, shouldRender() ? props.children : null));
|
|
26
26
|
};
|
|
27
|
-
var PaneStyled = styled(PaneBase)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n display:
|
|
27
|
+
var PaneStyled = styled(PaneBase)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n display: ", ";\n flex-direction: column;\n height: 100%;\n padding-top: ", "px;\n font: ", ";\n"], ["\n position: relative;\n display: ", ";\n flex-direction: column;\n height: 100%;\n padding-top: ", "px;\n font: ", ";\n"
|
|
28
28
|
/**
|
|
29
29
|
* Label and ontent for a single tab pane. The `label` can be JSX.
|
|
30
30
|
*
|
|
@@ -32,7 +32,7 @@ var PaneStyled = styled(PaneBase)(templateObject_1 || (templateObject_1 = __make
|
|
|
32
32
|
* accommodate maps or images that must be rendered right against the tab bar
|
|
33
33
|
* itself. The `padding` prop can be used to add some top padding.
|
|
34
34
|
*/
|
|
35
|
-
])), function (p) { return
|
|
35
|
+
])), function (p) { return p.active ? 'flex' : 'none'; }, function (p) { var _a; return (_a = p.padding) !== null && _a !== void 0 ? _a : 0; }, function (p) { return p.theme.font.bodyMedium; });
|
|
36
36
|
/**
|
|
37
37
|
* Label and ontent for a single tab pane. The `label` can be JSX.
|
|
38
38
|
*
|
|
@@ -23,6 +23,11 @@ interface ITabsProps extends ITestable {
|
|
|
23
23
|
* Event triggered when active tab changes. `idx` is the index of the new active tab.
|
|
24
24
|
*/
|
|
25
25
|
onChange?: (idx: number) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Optional inline styles applied to the outer element, for one-off overrides
|
|
28
|
+
* of the default styling.
|
|
29
|
+
*/
|
|
30
|
+
style?: React.CSSProperties;
|
|
26
31
|
}
|
|
27
32
|
/**
|
|
28
33
|
* Collection of tabs.
|
package/containers/Tabs/Tabs.js
CHANGED
|
@@ -31,8 +31,8 @@ var TabsBase = function (props) {
|
|
|
31
31
|
setIndex(props.active);
|
|
32
32
|
}, [props.active]);
|
|
33
33
|
var tabClicked = function (idx) {
|
|
34
|
-
// Only interesting if active tab changes.
|
|
35
|
-
if (idx
|
|
34
|
+
// Only interesting if active tab changes (ignore clicks on the active tab).
|
|
35
|
+
if (idx == index)
|
|
36
36
|
return;
|
|
37
37
|
setIndex(idx);
|
|
38
38
|
if (props.onChange) {
|
|
@@ -65,7 +65,7 @@ var TabsBase = function (props) {
|
|
|
65
65
|
});
|
|
66
66
|
});
|
|
67
67
|
};
|
|
68
|
-
return (React.createElement("div", { "data-testid": props['data-testid'] || "Tabs", className: props.className },
|
|
68
|
+
return (React.createElement("div", { "data-testid": props['data-testid'] || "Tabs", className: props.className, style: props.style },
|
|
69
69
|
React.createElement(TabBar, { active: index, onChange: tabClicked, tabWidth: props.tabWidth }, getTabs()),
|
|
70
70
|
React.createElement(Panes, null, getPanes())));
|
|
71
71
|
};
|
package/controls/Chip/Chip.d.ts
CHANGED
|
@@ -14,9 +14,21 @@ interface IChipProps extends ITestable {
|
|
|
14
14
|
disabled?: boolean;
|
|
15
15
|
/**
|
|
16
16
|
* Triggered when the X button on the `Chip` is clicked, or when
|
|
17
|
-
* Delete/Backspace is pressed while the `Chip` has focus.
|
|
17
|
+
* Delete/Backspace is pressed while the `Chip` has focus. The originating
|
|
18
|
+
* mouse or keyboard event is always passed; handlers that don't need it can
|
|
19
|
+
* omit the parameter.
|
|
18
20
|
*/
|
|
19
|
-
onClick: (e
|
|
21
|
+
onClick: (e: React.MouseEvent | React.KeyboardEvent) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Accessible label for the remove button.
|
|
24
|
+
* @default "Remove chip"
|
|
25
|
+
*/
|
|
26
|
+
removeLabel?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Optional inline styles applied to the outer element, for one-off overrides
|
|
29
|
+
* of the default styling.
|
|
30
|
+
*/
|
|
31
|
+
style?: React.CSSProperties;
|
|
20
32
|
}
|
|
21
33
|
/**
|
|
22
34
|
* A compact element representing a user input, selection, or filter that can be removed.
|
|
@@ -60,7 +72,7 @@ interface IChipProps extends ITestable {
|
|
|
60
72
|
* No additional margin styling is needed when placing chips side by side.
|
|
61
73
|
*/
|
|
62
74
|
declare const Chip: {
|
|
63
|
-
({ disabled, ...props }: IChipProps): React.JSX.Element;
|
|
75
|
+
({ disabled, removeLabel, ...props }: IChipProps): React.JSX.Element;
|
|
64
76
|
displayName: string;
|
|
65
77
|
};
|
|
66
78
|
export { Chip };
|
package/controls/Chip/Chip.js
CHANGED
|
@@ -34,17 +34,18 @@ var ChipBase = function (props) {
|
|
|
34
34
|
return;
|
|
35
35
|
// Pressing Delete or Backspace fires the onClick event.
|
|
36
36
|
if (e.key === 'Delete' || e.key === 'Backspace') {
|
|
37
|
+
e.preventDefault();
|
|
37
38
|
e.stopPropagation();
|
|
38
39
|
props.onClick(e);
|
|
39
40
|
}
|
|
40
41
|
};
|
|
41
|
-
return (React.createElement("div", { "data-testid": props['data-testid'] || "Chip", className: props.className, tabIndex: 0, onKeyDown: handleKeyDown, "aria-disabled": props.disabled },
|
|
42
|
-
React.createElement("span", { className: "inner"
|
|
43
|
-
React.createElement("button", { type: "button", onClick: props.onClick, "aria-label":
|
|
42
|
+
return (React.createElement("div", { "data-testid": props['data-testid'] || "Chip", className: props.className, style: props.style, tabIndex: 0, onKeyDown: handleKeyDown, "aria-disabled": props.disabled },
|
|
43
|
+
React.createElement("span", { className: "inner" }, props.children),
|
|
44
|
+
React.createElement("button", { type: "button", tabIndex: -1, onClick: props.onClick, "aria-label": props.removeLabel, disabled: props.disabled, "aria-disabled": props.disabled },
|
|
44
45
|
React.createElement("svg", null,
|
|
45
46
|
React.createElement("use", { xlinkHref: SVG.Icons.Cross })))));
|
|
46
47
|
};
|
|
47
|
-
var ChipStyled = styled(ChipBase)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n // Dimensions:\n min-width: 80px;\n max-width: 150px;\n width: auto;\n height: 24px;\n padding: 0 3px 0 12px;\n\n // Appearance:\n background-color: ", ";\n border: none;\n color: ", ";\n border-radius: 12px;\n user-select: none;\n outline: none;\n\n display: inline-flex;\n align-items: center;\n gap: 4px; // Gap between content and \"X\".\n margin-right: 2px; \n\n // Spacing from previous Chip.\n & + & {\n margin-left: 2px;\n }\n\n font: ", ";\n\n span.inner {\n flex: 1;\n overflow-x: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n pointer-events: none;\n }\n\n & > button {\n border: none;\n background: transparent;\n outline: none;\n padding: 0;\n margin: 0;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n
|
|
48
|
+
var ChipStyled = styled(ChipBase)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n // Dimensions:\n min-width: 80px;\n max-width: 150px;\n width: auto;\n height: 24px;\n padding: 0 3px 0 12px;\n\n // Appearance:\n background-color: ", ";\n border: none;\n color: ", ";\n border-radius: 12px;\n user-select: none;\n outline: none;\n\n display: inline-flex;\n align-items: center;\n gap: 4px; // Gap between content and \"X\".\n margin-right: 2px; \n\n // Spacing from previous Chip.\n & + & {\n margin-left: 2px;\n }\n\n font: ", ";\n\n span.inner {\n flex: 1;\n overflow-x: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n pointer-events: none;\n }\n\n & > button {\n border: none;\n background: transparent;\n outline: none;\n padding: 0;\n margin: 0;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n\n svg {\n transition: fill ", "ms ease-in-out,\n background-color ", "ms ease-in-out;\n fill: ", ";\n box-sizing: border-box;\n width: 18px;\n height: 18px;\n padding: 2px;\n border-radius: 50%;\n cursor: pointer;\n }\n }\n\n &:focus {\n outline: solid 2px ", ";\n }\n\n // When Chip is hovered, svg is colored.\n &:hover {\n & button > svg {\n background-color: ", ";\n fill: ", ";\n }\n }\n\n & > button svg:active {\n background-color: ", ";\n fill: ", ";\n }\n\n ", "\n"], ["\n // Dimensions:\n min-width: 80px;\n max-width: 150px;\n width: auto;\n height: 24px;\n padding: 0 3px 0 12px;\n\n // Appearance:\n background-color: ", ";\n border: none;\n color: ", ";\n border-radius: 12px;\n user-select: none;\n outline: none;\n\n display: inline-flex;\n align-items: center;\n gap: 4px; // Gap between content and \"X\".\n margin-right: 2px; \n\n // Spacing from previous Chip.\n & + & {\n margin-left: 2px;\n }\n\n font: ", ";\n\n span.inner {\n flex: 1;\n overflow-x: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n pointer-events: none;\n }\n\n & > button {\n border: none;\n background: transparent;\n outline: none;\n padding: 0;\n margin: 0;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n\n svg {\n transition: fill ", "ms ease-in-out,\n background-color ", "ms ease-in-out;\n fill: ", ";\n box-sizing: border-box;\n width: 18px;\n height: 18px;\n padding: 2px;\n border-radius: 50%;\n cursor: pointer;\n }\n }\n\n &:focus {\n outline: solid 2px ", ";\n }\n\n // When Chip is hovered, svg is colored.\n &:hover {\n & button > svg {\n background-color: ", ";\n fill: ", ";\n }\n }\n\n & > button svg:active {\n background-color: ", ";\n fill: ", ";\n }\n\n ", "\n"
|
|
48
49
|
/**
|
|
49
50
|
* A compact element representing a user input, selection, or filter that can be removed.
|
|
50
51
|
*
|
|
@@ -129,8 +130,8 @@ var ChipStyled = styled(ChipBase)(templateObject_2 || (templateObject_2 = __make
|
|
|
129
130
|
* No additional margin styling is needed when placing chips side by side.
|
|
130
131
|
*/
|
|
131
132
|
var Chip = function (_a) {
|
|
132
|
-
var _b = _a.disabled, disabled = _b === void 0 ? false : _b, props = __rest(_a, ["disabled"]);
|
|
133
|
-
return React.createElement(ChipStyled, __assign({ disabled: disabled }, props));
|
|
133
|
+
var _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.removeLabel, removeLabel = _c === void 0 ? "Remove chip" : _c, props = __rest(_a, ["disabled", "removeLabel"]);
|
|
134
|
+
return React.createElement(ChipStyled, __assign({ disabled: disabled, removeLabel: removeLabel }, props));
|
|
134
135
|
};
|
|
135
136
|
Chip.displayName = "Chip";
|
|
136
137
|
export { Chip };
|
|
@@ -10,6 +10,7 @@ interface ICircularProgressProps extends ITestable {
|
|
|
10
10
|
value: number;
|
|
11
11
|
/**
|
|
12
12
|
* Color of the progress arc.
|
|
13
|
+
* @default theme primary
|
|
13
14
|
*/
|
|
14
15
|
color?: string;
|
|
15
16
|
/**
|
|
@@ -22,6 +23,16 @@ interface ICircularProgressProps extends ITestable {
|
|
|
22
23
|
* @default 2
|
|
23
24
|
*/
|
|
24
25
|
strokeWidth?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Optional accessible label describing what is progressing. Announced by
|
|
28
|
+
* screen readers alongside the percentage value.
|
|
29
|
+
*/
|
|
30
|
+
label?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Optional inline styles applied to the outer element, for one-off overrides
|
|
33
|
+
* of the default styling.
|
|
34
|
+
*/
|
|
35
|
+
style?: React.CSSProperties;
|
|
25
36
|
}
|
|
26
37
|
/**
|
|
27
38
|
* A circular progress indicator that displays a percentage value as an arc.
|
|
@@ -26,22 +26,30 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
26
26
|
};
|
|
27
27
|
import * as React from 'react';
|
|
28
28
|
import styled from 'styled-components';
|
|
29
|
+
// Default prop values, referenced both by the CircularProgressBase fallbacks
|
|
30
|
+
// and the CircularProgress wrapper below.
|
|
31
|
+
var DEFAULT_SIZE = 100;
|
|
32
|
+
var DEFAULT_STROKE_WIDTH = 2;
|
|
33
|
+
/** Text label displayed at the center of the circle. */
|
|
34
|
+
var Text = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n z-index: 1;\n font: ", ";\n"], ["\n position: relative;\n z-index: 1;\n font: ", ";\n"])), function (p) { return p.theme.font.labelSmall; });
|
|
29
35
|
var CircularProgressBase = function (props) {
|
|
30
|
-
|
|
31
|
-
var
|
|
32
|
-
var
|
|
36
|
+
var _a, _b;
|
|
37
|
+
var size = (_a = props.size) !== null && _a !== void 0 ? _a : DEFAULT_SIZE;
|
|
38
|
+
var strokeWidth = (_b = props.strokeWidth) !== null && _b !== void 0 ? _b : DEFAULT_STROKE_WIDTH;
|
|
39
|
+
// Clamp progress value between 0 and 100 (guarding against non-finite input):
|
|
40
|
+
var raw = Number.isFinite(props.value) ? props.value : 0;
|
|
41
|
+
var value = Math.min(Math.max(raw, 0), 100);
|
|
42
|
+
var radius = (size - strokeWidth) / 2;
|
|
33
43
|
var circumference = 2 * Math.PI * radius;
|
|
34
44
|
var offset = circumference * (1 - value / 100);
|
|
35
|
-
return (React.createElement("div", { "data-testid": props['data-testid'] || "CircularProgress", className: props.className, role: "progressbar", "aria-valuenow": value, "aria-valuemin": 0, "aria-valuemax": 100 },
|
|
36
|
-
React.createElement("svg", { width:
|
|
37
|
-
React.createElement("circle", { cx:
|
|
45
|
+
return (React.createElement("div", { "data-testid": props['data-testid'] || "CircularProgress", className: props.className, style: props.style, role: "progressbar", "aria-label": props.label, "aria-valuenow": Math.round(value), "aria-valuemin": 0, "aria-valuemax": 100 },
|
|
46
|
+
React.createElement("svg", { width: size, height: size },
|
|
47
|
+
React.createElement("circle", { cx: size / 2, cy: size / 2, r: radius, fill: "none", strokeDasharray: circumference, strokeDashoffset: offset, strokeLinecap: "round", transform: "rotate(-90 ".concat(size / 2, " ").concat(size / 2, ")") })),
|
|
38
48
|
React.createElement(Text, null,
|
|
39
49
|
Math.round(value),
|
|
40
50
|
"%")));
|
|
41
51
|
};
|
|
42
|
-
|
|
43
|
-
var Text = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n z-index: 1;\n font: ", ";\n"], ["\n position: relative;\n z-index: 1;\n font: ", ";\n"])), function (p) { return p.theme.font.labelSmall; });
|
|
44
|
-
var CircularProgressStyled = styled(CircularProgressBase)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n width: ", "px;\n height: ", "px;\n display: flex;\n justify-content: center;\n align-items: center;\n svg {\n position: absolute;\n inset: 0;\n stroke: ", ";\n stroke-width: ", ";\n }\n"], ["\n position: relative;\n width: ", "px;\n height: ", "px;\n display: flex;\n justify-content: center;\n align-items: center;\n svg {\n position: absolute;\n inset: 0;\n stroke: ", ";\n stroke-width: ", ";\n }\n"
|
|
52
|
+
var CircularProgressStyled = styled(CircularProgressBase)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n width: ", "px;\n height: ", "px;\n display: flex;\n justify-content: center;\n align-items: center;\n svg {\n position: absolute;\n inset: 0;\n stroke: ", ";\n stroke-width: ", ";\n }\n svg circle {\n transition: stroke-dashoffset ", "ms ease;\n }\n"], ["\n position: relative;\n width: ", "px;\n height: ", "px;\n display: flex;\n justify-content: center;\n align-items: center;\n svg {\n position: absolute;\n inset: 0;\n stroke: ", ";\n stroke-width: ", ";\n }\n svg circle {\n transition: stroke-dashoffset ", "ms ease;\n }\n"
|
|
45
53
|
/**
|
|
46
54
|
* A circular progress indicator that displays a percentage value as an arc.
|
|
47
55
|
*
|
|
@@ -77,7 +85,7 @@ var CircularProgressStyled = styled(CircularProgressBase)(templateObject_2 || (t
|
|
|
77
85
|
* | `strokeWidth` | `2` | Arc thickness in pixels |
|
|
78
86
|
* | `color` | theme primary | Arc color (CSS color value) |
|
|
79
87
|
*/
|
|
80
|
-
])), function (p) { return p.size; }, function (p) { return p.size; }, function (p) { var _a; return (_a = p.color) !== null && _a !== void 0 ? _a : p.theme.colors.primary[1]; }, function (p) { return p.strokeWidth; });
|
|
88
|
+
])), function (p) { return p.size; }, function (p) { return p.size; }, function (p) { var _a; return (_a = p.color) !== null && _a !== void 0 ? _a : p.theme.colors.primary[1]; }, function (p) { return p.strokeWidth; }, function (p) { return p.theme.animation.duration; });
|
|
81
89
|
/**
|
|
82
90
|
* A circular progress indicator that displays a percentage value as an arc.
|
|
83
91
|
*
|
|
@@ -114,7 +122,7 @@ var CircularProgressStyled = styled(CircularProgressBase)(templateObject_2 || (t
|
|
|
114
122
|
* | `color` | theme primary | Arc color (CSS color value) |
|
|
115
123
|
*/
|
|
116
124
|
var CircularProgress = function (_a) {
|
|
117
|
-
var _b = _a.size, size = _b === void 0 ?
|
|
125
|
+
var _b = _a.size, size = _b === void 0 ? DEFAULT_SIZE : _b, _c = _a.strokeWidth, strokeWidth = _c === void 0 ? DEFAULT_STROKE_WIDTH : _c, props = __rest(_a, ["size", "strokeWidth"]);
|
|
118
126
|
return React.createElement(CircularProgressStyled, __assign({ size: size, strokeWidth: strokeWidth }, props));
|
|
119
127
|
};
|
|
120
128
|
CircularProgress.displayName = "CircularProgress";
|
|
@@ -22,6 +22,16 @@ interface IDropzoneProps extends ITestable {
|
|
|
22
22
|
* @default false
|
|
23
23
|
*/
|
|
24
24
|
disabled?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Accessible label for the dropzone, read by screen readers.
|
|
27
|
+
* @default "File upload dropzone"
|
|
28
|
+
*/
|
|
29
|
+
ariaLabel?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Optional inline styles applied to the outer element, for one-off overrides
|
|
32
|
+
* of the default styling.
|
|
33
|
+
*/
|
|
34
|
+
style?: React.CSSProperties;
|
|
25
35
|
}
|
|
26
36
|
/**
|
|
27
37
|
* A file upload area that accepts files via drag-and-drop or click-to-select.
|
|
@@ -65,7 +75,7 @@ interface IDropzoneProps extends ITestable {
|
|
|
65
75
|
* - Decorative SVG is hidden from assistive technology
|
|
66
76
|
*/
|
|
67
77
|
declare const Dropzone: {
|
|
68
|
-
({ disabled, ...props }: IDropzoneProps): React.JSX.Element;
|
|
78
|
+
({ disabled, ariaLabel, ...props }: IDropzoneProps): React.JSX.Element;
|
|
69
79
|
displayName: string;
|
|
70
80
|
};
|
|
71
81
|
export { Dropzone };
|
|
@@ -32,33 +32,44 @@ var DropzoneBase = function (props) {
|
|
|
32
32
|
var _b = React.useState(false), hover = _b[0], setHover = _b[1];
|
|
33
33
|
var inputElement = React.useRef(null);
|
|
34
34
|
var handleClick = function () {
|
|
35
|
-
|
|
35
|
+
var _a;
|
|
36
|
+
(_a = inputElement.current) === null || _a === void 0 ? void 0 : _a.click();
|
|
36
37
|
};
|
|
37
38
|
var handleAddFile = function (e) {
|
|
39
|
+
if (!e.target.files)
|
|
40
|
+
return;
|
|
38
41
|
props.onAddFiles(Array.from(e.target.files));
|
|
42
|
+
// Reset the input so selecting the same file again still fires onChange.
|
|
43
|
+
e.target.value = '';
|
|
39
44
|
};
|
|
40
45
|
// DragOver and DragLeave add a hover effect.
|
|
41
46
|
var handleDragOver = function (e) {
|
|
47
|
+
if (props.disabled)
|
|
48
|
+
return;
|
|
42
49
|
// Limit event to files only:
|
|
43
50
|
if (!e.dataTransfer.types.includes("Files"))
|
|
44
51
|
return;
|
|
45
52
|
setHover(true);
|
|
46
53
|
e.preventDefault();
|
|
47
54
|
};
|
|
48
|
-
var handleDragLeave = function (
|
|
55
|
+
var handleDragLeave = function () {
|
|
49
56
|
setHover(false);
|
|
50
57
|
};
|
|
51
58
|
var handleDrop = function (e) {
|
|
59
|
+
if (props.disabled)
|
|
60
|
+
return;
|
|
52
61
|
e.preventDefault();
|
|
53
62
|
setHover(false);
|
|
54
|
-
|
|
63
|
+
var files = Array.from(e.dataTransfer.files);
|
|
64
|
+
if (files.length)
|
|
65
|
+
props.onAddFiles(files);
|
|
55
66
|
};
|
|
56
|
-
return (React.createElement("button", { "data-testid": props['data-testid'] || "Dropzone", type: "button", className: "".concat(props.className, " ").concat(hover ? 'hover' : ''), onClick: handleClick, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, onKeyDown: function (e) {
|
|
67
|
+
return (React.createElement("button", { "data-testid": props['data-testid'] || "Dropzone", type: "button", className: "".concat(props.className, " ").concat(hover ? 'hover' : ''), style: props.style, onClick: handleClick, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, onKeyDown: function (e) {
|
|
57
68
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
58
69
|
e.preventDefault();
|
|
59
70
|
handleClick();
|
|
60
71
|
}
|
|
61
|
-
}, disabled: props.disabled, "aria-label":
|
|
72
|
+
}, disabled: props.disabled, "aria-label": props.ariaLabel },
|
|
62
73
|
React.createElement("div", { className: "message" }, (_a = props.message) !== null && _a !== void 0 ? _a : "Drop a file here to upload, or click to select."),
|
|
63
74
|
React.createElement("svg", { "aria-hidden": "true", focusable: "false" },
|
|
64
75
|
React.createElement("use", { xlinkHref: SVG.Other.CloudUpload })),
|
|
@@ -149,8 +160,8 @@ var DropzoneStyled = styled(DropzoneBase)(templateObject_2 || (templateObject_2
|
|
|
149
160
|
* - Decorative SVG is hidden from assistive technology
|
|
150
161
|
*/
|
|
151
162
|
var Dropzone = function (_a) {
|
|
152
|
-
var _b = _a.disabled, disabled = _b === void 0 ? false : _b, props = __rest(_a, ["disabled"]);
|
|
153
|
-
return React.createElement(DropzoneStyled, __assign({ disabled: disabled }, props));
|
|
163
|
+
var _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.ariaLabel, ariaLabel = _c === void 0 ? "File upload dropzone" : _c, props = __rest(_a, ["disabled", "ariaLabel"]);
|
|
164
|
+
return React.createElement(DropzoneStyled, __assign({ disabled: disabled, ariaLabel: ariaLabel }, props));
|
|
154
165
|
};
|
|
155
166
|
// For React DevTools:
|
|
156
167
|
Dropzone.displayName = "Dropzone";
|
package/controls/Fab/Fab.d.ts
CHANGED
|
@@ -41,8 +41,10 @@ interface IFabProps extends ITestable {
|
|
|
41
41
|
*/
|
|
42
42
|
color?: string;
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
45
|
-
* any color settings
|
|
44
|
+
* Marks the button as a toggle and sets its pressed state. When provided,
|
|
45
|
+
* the button is shown as depressed (overriding any color settings) and
|
|
46
|
+
* exposes `aria-pressed` to assistive technology. Omit it entirely for
|
|
47
|
+
* plain (non-toggle) action buttons.
|
|
46
48
|
* @default false
|
|
47
49
|
*/
|
|
48
50
|
active?: boolean;
|
|
@@ -53,10 +55,16 @@ interface IFabProps extends ITestable {
|
|
|
53
55
|
*/
|
|
54
56
|
nofocus?: boolean;
|
|
55
57
|
/**
|
|
56
|
-
* Fired when the button is clicked. The synthetic React click event
|
|
57
|
-
*
|
|
58
|
+
* Fired when the button is clicked. The synthetic React click event is passed
|
|
59
|
+
* along so callers may inspect it or stop propagation. Handlers that don't
|
|
60
|
+
* need the event can simply omit the parameter.
|
|
58
61
|
*/
|
|
59
|
-
onClick: (e
|
|
62
|
+
onClick: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
63
|
+
/**
|
|
64
|
+
* Optional inline styles applied to the outer element, for one-off overrides
|
|
65
|
+
* of the default styling.
|
|
66
|
+
*/
|
|
67
|
+
style?: React.CSSProperties;
|
|
60
68
|
}
|
|
61
69
|
/**
|
|
62
70
|
* A floating action button (FAB) for primary or prominent actions.
|
|
@@ -102,7 +110,7 @@ interface IFabProps extends ITestable {
|
|
|
102
110
|
* | `nofocus` | Returns focus to previous element after click |
|
|
103
111
|
*/
|
|
104
112
|
declare const Fab: {
|
|
105
|
-
({ disabled, positive, negative,
|
|
113
|
+
({ disabled, positive, negative, nofocus, ...props }: IFabProps): React.JSX.Element;
|
|
106
114
|
displayName: string;
|
|
107
115
|
};
|
|
108
116
|
export { Fab };
|
package/controls/Fab/Fab.js
CHANGED
|
@@ -28,24 +28,11 @@ import * as React from 'react';
|
|
|
28
28
|
import styled, { css } from 'styled-components';
|
|
29
29
|
import { Icon } from '../Icon';
|
|
30
30
|
var FabBase = function (props) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
//
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
var handleClick = function (e) {
|
|
37
|
-
var _a;
|
|
38
|
-
// If "nofocus", restore focus to previously focused element after the
|
|
39
|
-
// button was clicked.
|
|
40
|
-
if (props.nofocus) {
|
|
41
|
-
if (previousFocusedElement.current instanceof HTMLElement) {
|
|
42
|
-
previousFocusedElement.current.focus();
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
// Call user's click handler if provided:
|
|
46
|
-
(_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
47
|
-
};
|
|
48
|
-
return (React.createElement("button", { "data-testid": props['data-testid'] || "Fab", type: "button", className: props.className, onClick: handleClick, onMouseDown: handleMouseDown, title: props.title, disabled: props.disabled, "aria-disabled": props.disabled },
|
|
31
|
+
return (React.createElement("button", { "data-testid": props['data-testid'] || "Fab", type: "button", className: props.className, style: props.style, onClick: props.onClick,
|
|
32
|
+
// When "nofocus", prevent the button from taking focus on click so focus
|
|
33
|
+
// stays on the previously focused element (deliberate keyboard focus is
|
|
34
|
+
// unaffected).
|
|
35
|
+
onMouseDown: props.nofocus ? (function (e) { return e.preventDefault(); }) : undefined, title: props.title, disabled: props.disabled, "aria-disabled": props.disabled, "aria-pressed": props.active, "aria-label": !props.children ? props.title : undefined },
|
|
49
36
|
React.createElement(Icon, __assign({}, (typeof props.icon === 'string' ? { url: props.icon } : props.icon))),
|
|
50
37
|
props.children));
|
|
51
38
|
};
|
|
@@ -153,8 +140,8 @@ var FabStyled = styled(FabBase).attrs(function (p) {
|
|
|
153
140
|
* | `nofocus` | Returns focus to previous element after click |
|
|
154
141
|
*/
|
|
155
142
|
var Fab = function (_a) {
|
|
156
|
-
var _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.positive, positive = _c === void 0 ? false : _c, _d = _a.negative, negative = _d === void 0 ? false : _d, _e = _a.
|
|
157
|
-
return React.createElement(FabStyled, __assign({ disabled: disabled, positive: positive, negative: negative,
|
|
143
|
+
var _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.positive, positive = _c === void 0 ? false : _c, _d = _a.negative, negative = _d === void 0 ? false : _d, _e = _a.nofocus, nofocus = _e === void 0 ? false : _e, props = __rest(_a, ["disabled", "positive", "negative", "nofocus"]);
|
|
144
|
+
return React.createElement(FabStyled, __assign({ disabled: disabled, positive: positive, negative: negative, nofocus: nofocus }, props));
|
|
158
145
|
};
|
|
159
146
|
Fab.displayName = "Fab";
|
|
160
147
|
export { Fab };
|