@autoguru/overdrive 4.43.9-next.0 → 4.43.10-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Actions/Actions.d.ts +3 -3
- package/dist/components/Actions/Actions.d.ts.map +1 -1
- package/dist/components/Actions/Actions.js +4 -3
- package/dist/components/Alert/Alert.d.ts +3 -3
- package/dist/components/Alert/Alert.d.ts.map +1 -1
- package/dist/components/Alert/Alert.js +11 -11
- package/dist/components/Anchor/Anchor.d.ts +4 -3
- package/dist/components/Anchor/Anchor.d.ts.map +1 -1
- package/dist/components/Anchor/Anchor.js +21 -19
- package/dist/components/AutoSuggest/AutoSuggest.js +52 -34
- package/dist/components/AutoSuggest/useLayoutSuggestionVisible.js +1 -0
- package/dist/components/Badge/Badge.d.ts +13 -2
- package/dist/components/Badge/Badge.d.ts.map +1 -1
- package/dist/components/Badge/Badge.js +7 -1
- package/dist/components/Box/Box.d.ts +7 -0
- package/dist/components/Box/Box.d.ts.map +1 -1
- package/dist/components/Box/Box.js +11 -2
- package/dist/components/Box/newBox/NewBox.d.ts +23 -0
- package/dist/components/Box/newBox/NewBox.d.ts.map +1 -1
- package/dist/components/Box/newBox/NewBox.js +25 -2
- package/dist/components/Box/newBox/useBox.d.ts +24 -0
- package/dist/components/Box/newBox/useBox.d.ts.map +1 -1
- package/dist/components/Box/newBox/useBox.js +38 -1
- package/dist/components/BulletList/Bullet.js +2 -2
- package/dist/components/BulletList/BulletList.js +2 -2
- package/dist/components/BulletList/context.js +1 -1
- package/dist/components/BulletText/BulletText.d.ts.map +1 -1
- package/dist/components/BulletText/BulletText.js +13 -12
- package/dist/components/Button/Button.css.d.ts +9 -0
- package/dist/components/Button/Button.css.d.ts.map +1 -1
- package/dist/components/Button/Button.css.js +12 -2
- package/dist/components/Button/Button.d.ts +11 -2
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +23 -11
- package/dist/components/CheckBox/CheckBox.d.ts +4 -0
- package/dist/components/CheckBox/CheckBox.d.ts.map +1 -1
- package/dist/components/CheckBox/CheckBox.js +4 -4
- package/dist/components/ColourInput/ColourInput.d.ts.map +1 -1
- package/dist/components/ColourInput/ColourInput.js +10 -9
- package/dist/components/Columns/Column.css.js +1 -0
- package/dist/components/Columns/Column.js +3 -3
- package/dist/components/Columns/ColumnGrid.css.js +1 -1
- package/dist/components/Columns/Columns.d.ts +3 -3
- package/dist/components/Columns/Columns.d.ts.map +1 -1
- package/dist/components/Columns/Columns.js +4 -4
- package/dist/components/DateInput/DateInput.js +1 -1
- package/dist/components/DatePicker/DatePicker.js +6 -6
- package/dist/components/DateTimePicker/CalendarButton.js +1 -1
- package/dist/components/DateTimePicker/CalendarGrid.js +10 -10
- package/dist/components/DateTimePicker/DateTimePicker.css.js +9 -1
- package/dist/components/DateTimePicker/DateTimePicker.d.ts +39 -0
- package/dist/components/DateTimePicker/DateTimePicker.d.ts.map +1 -1
- package/dist/components/DateTimePicker/DateTimePicker.js +50 -17
- package/dist/components/DividerLine/DividerLine.js +1 -1
- package/dist/components/DropDown/DropDown.js +5 -5
- package/dist/components/DropDown/DropDownOption.js +4 -4
- package/dist/components/DropDown/DropDownOptionsList.js +4 -4
- package/dist/components/EditableText/EditableText.d.ts +2 -2
- package/dist/components/EditableText/EditableText.d.ts.map +1 -1
- package/dist/components/EditableText/EditableText.js +10 -10
- package/dist/components/FillHeightBox/FillHeightBox.js +2 -1
- package/dist/components/Flyout/Flyout.d.ts +2 -2
- package/dist/components/Flyout/Flyout.d.ts.map +1 -1
- package/dist/components/Flyout/Flyout.js +3 -3
- package/dist/components/Heading/Heading.d.ts +6 -1
- package/dist/components/Heading/Heading.d.ts.map +1 -1
- package/dist/components/Heading/Heading.js +10 -3
- package/dist/components/HorizontalAutoScroller/HorizontalAutoScroller.d.ts +2 -2
- package/dist/components/HorizontalAutoScroller/HorizontalAutoScroller.d.ts.map +1 -1
- package/dist/components/HorizontalAutoScroller/HorizontalAutoScroller.js +19 -18
- package/dist/components/Icon/Icon.js +2 -2
- package/dist/components/Image/Image.d.ts +3 -0
- package/dist/components/Image/Image.d.ts.map +1 -1
- package/dist/components/Image/Image.js +2 -2
- package/dist/components/Image/ImageServerProvider.js +7 -2
- package/dist/components/Image/ResponsiveImage.d.ts +22 -0
- package/dist/components/Image/ResponsiveImage.d.ts.map +1 -1
- package/dist/components/Image/ResponsiveImage.js +2 -1
- package/dist/components/Image/SimpleImage.d.ts +18 -0
- package/dist/components/Image/SimpleImage.d.ts.map +1 -1
- package/dist/components/Image/SimpleImage.js +6 -2
- package/dist/components/Inline/Inline.d.ts +9 -6
- package/dist/components/Inline/Inline.d.ts.map +1 -1
- package/dist/components/Inline/Inline.js +53 -46
- package/dist/components/IntentStripe/IntentStripe.js +1 -1
- package/dist/components/LinearProgressIndicator/LinearProgressIndicator.js +4 -4
- package/dist/components/LoadingBox/LoadingBox.js +1 -1
- package/dist/components/Meta/Meta.js +3 -3
- package/dist/components/MinimalModal/MinimalModal.js +4 -4
- package/dist/components/Modal/Modal.js +7 -6
- package/dist/components/NumberBubble/NumberBubble.js +2 -2
- package/dist/components/NumberInput/NumberInput.js +1 -1
- package/dist/components/NumberInput/useNumberInputBehaviours.js +9 -3
- package/dist/components/OptionGrid/OptionGrid.css.js +7 -1
- package/dist/components/OptionGrid/OptionGrid.d.ts +32 -0
- package/dist/components/OptionGrid/OptionGrid.d.ts.map +1 -1
- package/dist/components/OptionGrid/OptionGrid.js +26 -12
- package/dist/components/OptionList/OptionList.css.js +5 -1
- package/dist/components/OptionList/OptionList.d.ts +25 -0
- package/dist/components/OptionList/OptionList.d.ts.map +1 -1
- package/dist/components/OptionList/OptionList.js +19 -6
- package/dist/components/OptionList/OptionListItem.d.ts +10 -0
- package/dist/components/OptionList/OptionListItem.d.ts.map +1 -1
- package/dist/components/OptionList/OptionListItem.js +16 -9
- package/dist/components/OrderedList/OrderedList.css.d.ts +0 -1
- package/dist/components/OrderedList/OrderedList.css.d.ts.map +1 -1
- package/dist/components/OrderedList/OrderedList.css.js +1 -8
- package/dist/components/OrderedList/OrderedList.d.ts +4 -4
- package/dist/components/OrderedList/OrderedList.d.ts.map +1 -1
- package/dist/components/OrderedList/OrderedList.js +11 -9
- package/dist/components/OutsideClick/OutsideClick.js +4 -1
- package/dist/components/OverdriveProvider/FallbackProvider.d.ts +3 -0
- package/dist/components/OverdriveProvider/FallbackProvider.d.ts.map +1 -1
- package/dist/components/OverdriveProvider/FallbackProvider.js +5 -1
- package/dist/components/OverdriveProvider/OverdriveProvider.d.ts +5 -0
- package/dist/components/OverdriveProvider/OverdriveProvider.d.ts.map +1 -1
- package/dist/components/OverdriveProvider/OverdriveProvider.js +10 -6
- package/dist/components/OverdriveProvider/ThemeOverrideDebugger.js +7 -7
- package/dist/components/OverdriveProvider/index.d.ts +2 -1
- package/dist/components/OverdriveProvider/index.d.ts.map +1 -1
- package/dist/components/OverdriveProvider/index.js +3 -1
- package/dist/components/OverdriveProvider/useColorOverrides.d.ts +1 -0
- package/dist/components/OverdriveProvider/useColorOverrides.d.ts.map +1 -1
- package/dist/components/OverdriveProvider/useColorOverrides.js +9 -0
- package/dist/components/Pagination/Bubble.js +1 -1
- package/dist/components/Pagination/Pagination.js +11 -11
- package/dist/components/Portal/Portal.js +5 -2
- package/dist/components/Positioner/Positioner.js +18 -2
- package/dist/components/Positioner/alignment.js +1 -1
- package/dist/components/ProgressBar/ProgressBar.js +3 -3
- package/dist/components/ProgressBarGroup/ProgressBarGroup.js +5 -5
- package/dist/components/ProgressSpinner/ProgressSpinner.js +3 -3
- package/dist/components/Radio/Radio.js +4 -4
- package/dist/components/Radio/RadioGroup.js +4 -4
- package/dist/components/ScrollPane/ScrollPane.js +2 -2
- package/dist/components/SearchBar/SearchBar.d.ts +17 -0
- package/dist/components/SearchBar/SearchBar.d.ts.map +1 -1
- package/dist/components/SearchBar/SearchBar.js +21 -9
- package/dist/components/Section/Section.d.ts +3 -3
- package/dist/components/Section/Section.d.ts.map +1 -1
- package/dist/components/Section/Section.js +4 -3
- package/dist/components/SelectInput/SelectInput.js +6 -6
- package/dist/components/SimplePagination/SimplePagination.js +6 -6
- package/dist/components/SliderProgress/ProgressStep.js +4 -4
- package/dist/components/SliderProgress/SliderProgress.js +3 -3
- package/dist/components/Stack/Divider.d.ts +3 -0
- package/dist/components/Stack/Divider.d.ts.map +1 -0
- package/dist/components/Stack/Divider.js +13 -0
- package/dist/components/Stack/Stack.d.ts +6 -10
- package/dist/components/Stack/Stack.d.ts.map +1 -1
- package/dist/components/Stack/Stack.js +28 -28
- package/dist/components/StandardModal/StandardModal.d.ts +2 -2
- package/dist/components/StandardModal/StandardModal.d.ts.map +1 -1
- package/dist/components/StandardModal/StandardModal.js +13 -11
- package/dist/components/StarRating/StarRating.js +11 -9
- package/dist/components/Stepper/Stepper.js +10 -10
- package/dist/components/StickyBox/StickyBox.js +4 -3
- package/dist/components/Switch/Switch.d.ts +11 -0
- package/dist/components/Switch/Switch.d.ts.map +1 -1
- package/dist/components/Switch/Switch.js +10 -5
- package/dist/components/Table/Table.css.js +4 -0
- package/dist/components/Table/Table.js +9 -3
- package/dist/components/Table/TableCell.css.js +5 -0
- package/dist/components/Table/TableCell.js +7 -4
- package/dist/components/Table/TableHeadCell.js +7 -7
- package/dist/components/Table/TableRow.js +2 -2
- package/dist/components/Table/TableRowGroup.js +2 -2
- package/dist/components/Table/context.js +2 -2
- package/dist/components/Tabs/Tab.d.ts +3 -3
- package/dist/components/Tabs/Tab.d.ts.map +1 -1
- package/dist/components/Tabs/Tab.js +6 -6
- package/dist/components/Tabs/TabList.js +10 -10
- package/dist/components/Tabs/TabPane.js +1 -1
- package/dist/components/Tabs/TabPanes.d.ts +1 -0
- package/dist/components/Tabs/TabPanes.d.ts.map +1 -1
- package/dist/components/Tabs/TabPanes.js +3 -3
- package/dist/components/Tabs/Tabs.js +2 -2
- package/dist/components/Text/Text.d.ts +3 -5
- package/dist/components/Text/Text.d.ts.map +1 -1
- package/dist/components/Text/Text.js +5 -2
- package/dist/components/Text/textStyles.d.ts +3 -0
- package/dist/components/Text/textStyles.d.ts.map +1 -1
- package/dist/components/Text/textStyles.js +5 -0
- package/dist/components/TextAreaInput/TextAreaInput.js +1 -1
- package/dist/components/TextBubble/TextBubble.d.ts +5 -5
- package/dist/components/TextBubble/TextBubble.d.ts.map +1 -1
- package/dist/components/TextBubble/TextBubble.js +4 -3
- package/dist/components/TextContainer/TextContainer.js +4 -4
- package/dist/components/TextInput/TextInput.js +1 -1
- package/dist/components/TextLink/TextLink.css.d.ts +0 -1
- package/dist/components/TextLink/TextLink.css.d.ts.map +1 -1
- package/dist/components/TextLink/TextLink.css.js +0 -5
- package/dist/components/TextLink/TextLink.d.ts +7 -8
- package/dist/components/TextLink/TextLink.d.ts.map +1 -1
- package/dist/components/TextLink/TextLink.js +19 -19
- package/dist/components/Toaster/Toast.js +20 -10
- package/dist/components/Tooltip/Tooltip.d.ts +25 -5
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.js +61 -82
- package/dist/components/Tooltip/index.d.ts +1 -1
- package/dist/components/Tooltip/index.d.ts.map +1 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +5 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts.map +1 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.js +6 -1
- package/dist/components/private/CheckableBase/CheckableBase.css.js +2 -0
- package/dist/components/private/CheckableBase/CheckableBase.js +6 -6
- package/dist/components/private/CheckableBase/useCheckableStyles.d.ts +3 -0
- package/dist/components/private/CheckableBase/useCheckableStyles.d.ts.map +1 -1
- package/dist/components/private/CheckableBase/useCheckableStyles.js +3 -0
- package/dist/components/private/InputBase/HintText.js +1 -1
- package/dist/components/private/InputBase/NotchedBase.js +7 -7
- package/dist/components/private/InputBase/withEnhancedInput.css.js +1 -0
- package/dist/components/private/InputBase/withEnhancedInput.d.ts +1 -1
- package/dist/components/private/InputBase/withEnhancedInput.d.ts.map +1 -1
- package/dist/components/private/InputBase/withEnhancedInput.js +32 -10
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useAttachedBoxes/useAttachedBoxes.js +2 -1
- package/dist/hooks/useDeepCompareMemo/index.d.ts +4 -0
- package/dist/hooks/useDeepCompareMemo/index.d.ts.map +1 -1
- package/dist/hooks/useDeepCompareMemo/index.js +12 -0
- package/dist/hooks/useMedia/useMedia.js +1 -0
- package/dist/hooks/useResponsiveValue/useResponsiveValue.js +3 -1
- package/dist/hooks/useTooltip/index.d.ts +2 -0
- package/dist/hooks/useTooltip/index.d.ts.map +1 -0
- package/dist/hooks/useTooltip/index.js +3 -0
- package/dist/hooks/useTooltip/useTooltip.d.ts +38 -0
- package/dist/hooks/useTooltip/useTooltip.d.ts.map +1 -0
- package/dist/hooks/useTooltip/useTooltip.js +125 -0
- package/dist/hooks/useWindowHeightFill/useWindowHeightFill.js +1 -0
- package/dist/hooks/useWindowScrollLock/index.js +2 -0
- package/dist/styles/componentStyles.d.ts +14 -1
- package/dist/styles/componentStyles.d.ts.map +1 -1
- package/dist/styles/componentStyles.js +17 -3
- package/dist/styles/componentStyles.spec.d.ts +2 -0
- package/dist/styles/componentStyles.spec.d.ts.map +1 -0
- package/dist/styles/componentStyles.spec.js +251 -0
- package/dist/styles/elementReset.css.d.ts +1 -0
- package/dist/styles/elementReset.css.d.ts.map +1 -1
- package/dist/styles/elementReset.css.js +4 -0
- package/dist/styles/global/reset.css.js +2 -0
- package/dist/styles/layers.css.d.ts +3 -2
- package/dist/styles/layers.css.d.ts.map +1 -1
- package/dist/styles/layers.css.js +6 -2
- package/dist/styles/sprinkles.css.d.ts +11 -11
- package/dist/styles/sprinkles.css.d.ts.map +1 -1
- package/dist/styles/sprinkles.css.js +39 -14
- package/dist/styles/typography.css.d.ts +14 -0
- package/dist/styles/typography.css.d.ts.map +1 -1
- package/dist/styles/typography.css.js +5 -0
- package/dist/styles/vars.css.js +2 -0
- package/dist/themes/base/theme.css.js +3 -1
- package/dist/themes/base/tokens.d.ts +3 -0
- package/dist/themes/base/tokens.d.ts.map +1 -1
- package/dist/themes/base/tokens.js +3 -0
- package/dist/themes/helpers.d.ts +22 -0
- package/dist/themes/helpers.d.ts.map +1 -1
- package/dist/themes/helpers.js +24 -0
- package/dist/themes/makeTheme.d.ts +3 -0
- package/dist/themes/makeTheme.d.ts.map +1 -1
- package/dist/themes/makeTheme.js +7 -1
- package/dist/themes/theme.css.d.ts +4 -0
- package/dist/themes/theme.css.d.ts.map +1 -1
- package/dist/themes/theme.css.js +16 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/css.d.ts +15 -0
- package/dist/utils/css.d.ts.map +1 -1
- package/dist/utils/css.js +18 -0
- package/dist/utils/dataAttrs.d.ts +3 -0
- package/dist/utils/dataAttrs.d.ts.map +1 -1
- package/dist/utils/dataAttrs.js +3 -0
- package/dist/utils/estimateTextWidth.js +3 -2
- package/dist/utils/index.d.ts +21 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +39 -0
- package/dist/utils/number.js +7 -2
- package/dist/utils/propGuards.d.ts +14 -0
- package/dist/utils/propGuards.d.ts.map +1 -1
- package/dist/utils/propGuards.js +14 -0
- package/dist/utils/responsiveProps.css.js +1 -1
- package/dist/utils/sprinkles.d.ts +18 -0
- package/dist/utils/sprinkles.d.ts.map +1 -1
- package/dist/utils/sprinkles.js +21 -1
- package/package.json +19 -19
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
-
const _excluded = ["as", "
|
|
5
|
+
const _excluded = ["as", "colour", "size", "display", "value", "onFocus", "onBlur", "onKeyDown", "onModeChange", "tabIndex", "onChange", "type"];
|
|
6
6
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
8
|
import clsx from 'clsx';
|
|
@@ -14,11 +14,10 @@ import * as inputStyles from "../private/InputBase/withEnhancedInput.css.js";
|
|
|
14
14
|
import * as styles from "./EditableText.css.js";
|
|
15
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
16
|
const numberInputValuePattern = /^\d*\.?\d*$/;
|
|
17
|
-
export const EditableText = forwardRef((_ref, ref) => {
|
|
17
|
+
export const EditableText = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
18
18
|
var _inputRef$current;
|
|
19
19
|
let {
|
|
20
|
-
as,
|
|
21
|
-
color,
|
|
20
|
+
as: is,
|
|
22
21
|
colour = 'muted',
|
|
23
22
|
size,
|
|
24
23
|
display = 'inline-block',
|
|
@@ -44,8 +43,10 @@ export const EditableText = forwardRef((_ref, ref) => {
|
|
|
44
43
|
};
|
|
45
44
|
const onChange = useCallback(e => {
|
|
46
45
|
const changeValue = e.currentTarget.value;
|
|
46
|
+
// eslint-disable-next-line unicorn/prefer-at
|
|
47
47
|
const lastChar = changeValue.charAt(changeValue.length - 1);
|
|
48
48
|
if (type === 'number' && !numberInputValuePattern.test(lastChar)) {
|
|
49
|
+
// If the last entered character is not a digit or '.', don't update the state
|
|
49
50
|
return;
|
|
50
51
|
}
|
|
51
52
|
if (mode === 'INPUT') {
|
|
@@ -54,7 +55,7 @@ export const EditableText = forwardRef((_ref, ref) => {
|
|
|
54
55
|
if (typeof incomingOnChange === 'function') incomingOnChange(e);
|
|
55
56
|
}, [incomingOnChange, type, mode]);
|
|
56
57
|
const baseStyle = textStyles({
|
|
57
|
-
as,
|
|
58
|
+
as: is,
|
|
58
59
|
colour,
|
|
59
60
|
size
|
|
60
61
|
});
|
|
@@ -64,7 +65,7 @@ export const EditableText = forwardRef((_ref, ref) => {
|
|
|
64
65
|
setWidth(textRef.current.clientWidth);
|
|
65
66
|
}
|
|
66
67
|
}, [textRef.current, inputValue]);
|
|
67
|
-
return _jsxs(Box, {
|
|
68
|
+
return /*#__PURE__*/_jsxs(Box, {
|
|
68
69
|
ref: ref,
|
|
69
70
|
display: display,
|
|
70
71
|
tabIndex: tabIndex,
|
|
@@ -87,7 +88,7 @@ export const EditableText = forwardRef((_ref, ref) => {
|
|
|
87
88
|
onRequestModeChange('TEXT');
|
|
88
89
|
}
|
|
89
90
|
},
|
|
90
|
-
children: [mode === 'INPUT' && _jsx(Box, _objectSpread(_objectSpread({
|
|
91
|
+
children: [mode === 'INPUT' && /*#__PURE__*/_jsx(Box, _objectSpread(_objectSpread({
|
|
91
92
|
as: "input"
|
|
92
93
|
}, inputProps), {}, {
|
|
93
94
|
autoFocus: true,
|
|
@@ -99,11 +100,10 @@ export const EditableText = forwardRef((_ref, ref) => {
|
|
|
99
100
|
style: {
|
|
100
101
|
width
|
|
101
102
|
}
|
|
102
|
-
})), _jsx(Text, {
|
|
103
|
+
})), /*#__PURE__*/_jsx(Text, {
|
|
103
104
|
noWrap: true,
|
|
104
105
|
ref: textRef,
|
|
105
|
-
as:
|
|
106
|
-
color: color,
|
|
106
|
+
as: is,
|
|
107
107
|
colour: colour,
|
|
108
108
|
size: size,
|
|
109
109
|
className: clsx(baseStyle, styles.text, {
|
|
@@ -21,6 +21,7 @@ export const FillHeightBox = _ref => {
|
|
|
21
21
|
scrollPaneProps = _objectWithoutProperties(_ref, _excluded);
|
|
22
22
|
const containerRef = React.useRef(null);
|
|
23
23
|
const containerHeight = useWindowHeightFill({
|
|
24
|
+
// @ts-expect-error containerRef can be nul
|
|
24
25
|
containerRef,
|
|
25
26
|
includeMobile,
|
|
26
27
|
observedElementRef,
|
|
@@ -28,7 +29,7 @@ export const FillHeightBox = _ref => {
|
|
|
28
29
|
serverVhFallback,
|
|
29
30
|
maxHeight
|
|
30
31
|
});
|
|
31
|
-
return _jsx(ScrollPane, _objectSpread(_objectSpread({}, scrollPaneProps), {}, {
|
|
32
|
+
return /*#__PURE__*/_jsx(ScrollPane, _objectSpread(_objectSpread({}, scrollPaneProps), {}, {
|
|
32
33
|
ref: containerRef,
|
|
33
34
|
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
34
35
|
maxHeight: containerHeight
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ComponentPropsWithoutRef, FunctionComponent } from 'react';
|
|
2
2
|
import { Positioner } from '../Positioner/Positioner';
|
|
3
|
-
export declare const Flyout:
|
|
3
|
+
export declare const Flyout: FunctionComponent<ComponentPropsWithoutRef<typeof Positioner>>;
|
|
4
4
|
//# sourceMappingURL=Flyout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Flyout.d.ts","sourceRoot":"","sources":["../../../lib/components/Flyout/Flyout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"Flyout.d.ts","sourceRoot":"","sources":["../../../lib/components/Flyout/Flyout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAIzE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,eAAO,MAAM,MAAM,EAAE,iBAAiB,CACrC,wBAAwB,CAAC,OAAO,UAAU,CAAC,CAoB3C,CAAC"}
|
|
@@ -5,7 +5,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
5
5
|
const _excluded = ["children", "triggerRef", "isOpen", "alignment", "triggerOffset"];
|
|
6
6
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
|
-
import React from 'react';
|
|
8
|
+
import * as React from 'react';
|
|
9
9
|
import { Box } from "../Box/Box.js";
|
|
10
10
|
import { Positioner } from "../Positioner/Positioner.js";
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -18,13 +18,13 @@ export const Flyout = _ref => {
|
|
|
18
18
|
triggerOffset
|
|
19
19
|
} = _ref,
|
|
20
20
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
-
return _jsx(Positioner, _objectSpread(_objectSpread({
|
|
21
|
+
return /*#__PURE__*/_jsx(Positioner, _objectSpread(_objectSpread({
|
|
22
22
|
triggerRef: triggerRef,
|
|
23
23
|
isOpen: isOpen,
|
|
24
24
|
alignment: alignment,
|
|
25
25
|
triggerOffset: triggerOffset
|
|
26
26
|
}, rest), {}, {
|
|
27
|
-
children: _jsx(Box, {
|
|
27
|
+
children: /*#__PURE__*/_jsx(Box, {
|
|
28
28
|
overflow: "hidden",
|
|
29
29
|
backgroundColour: "white",
|
|
30
30
|
boxShadow: "4",
|
|
@@ -4,6 +4,11 @@ import { type TextStyleProps } from '../Text/textStyles';
|
|
|
4
4
|
export type HeadingTags = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
5
5
|
export interface HeadingProps extends Omit<BoxProps, keyof TextStyleProps>, Omit<TextStyleProps, 'as'> {
|
|
6
6
|
as?: HeadingTags;
|
|
7
|
+
/** @deprecated Prefer `as` */
|
|
8
|
+
is?: HeadingTags;
|
|
7
9
|
}
|
|
8
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Heading renders an <h1... h6> with default font size and weight
|
|
12
|
+
*/
|
|
13
|
+
export declare const Heading: ({ is, as, align, breakWord, children, className, color, colour, noWrap, size, transform, weight, ...props }: HeadingProps) => React.JSX.Element;
|
|
9
14
|
//# sourceMappingURL=Heading.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.d.ts","sourceRoot":"","sources":["../../../lib/components/Heading/Heading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAErE,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAElE,MAAM,WAAW,YAChB,SAAQ,IAAI,CAAC,QAAQ,EAAE,MAAM,cAAc,CAAC,EAC3C,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC;IAC3B,EAAE,CAAC,EAAE,WAAW,CAAC;CACjB;
|
|
1
|
+
{"version":3,"file":"Heading.d.ts","sourceRoot":"","sources":["../../../lib/components/Heading/Heading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAErE,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAElE,MAAM,WAAW,YAChB,SAAQ,IAAI,CAAC,QAAQ,EAAE,MAAM,cAAc,CAAC,EAC3C,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC;IAC3B,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB,8BAA8B;IAC9B,EAAE,CAAC,EAAE,WAAW,CAAC;CACjB;AAWD;;GAEG;AACH,eAAO,MAAM,OAAO,GAAI,6GAcrB,YAAY,sBAoBd,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
-
const _excluded = ["as", "align", "breakWord", "children", "className", "color", "colour", "noWrap", "size", "transform", "weight"];
|
|
5
|
+
const _excluded = ["is", "as", "align", "breakWord", "children", "className", "color", "colour", "noWrap", "size", "transform", "weight"];
|
|
6
6
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
8
|
import React from 'react';
|
|
@@ -17,22 +17,29 @@ const defaultSizeMap = {
|
|
|
17
17
|
h5: '3',
|
|
18
18
|
h6: '2'
|
|
19
19
|
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Heading renders an <h1... h6> with default font size and weight
|
|
23
|
+
*/
|
|
20
24
|
export const Heading = _ref => {
|
|
21
25
|
let {
|
|
22
|
-
|
|
26
|
+
is = 'h1',
|
|
27
|
+
as = is,
|
|
23
28
|
align,
|
|
24
29
|
breakWord,
|
|
25
30
|
children,
|
|
26
31
|
className,
|
|
27
32
|
color,
|
|
33
|
+
// semantic tokens
|
|
28
34
|
colour = color ? undefined : 'dark',
|
|
35
|
+
// legacy intentional tokens
|
|
29
36
|
noWrap,
|
|
30
37
|
size = defaultSizeMap[as],
|
|
31
38
|
transform,
|
|
32
39
|
weight = 'bold'
|
|
33
40
|
} = _ref,
|
|
34
41
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
35
|
-
return _jsx(Box, _objectSpread(_objectSpread({}, props), {}, {
|
|
42
|
+
return /*#__PURE__*/_jsx(Box, _objectSpread(_objectSpread({}, props), {}, {
|
|
36
43
|
as: as,
|
|
37
44
|
color: color,
|
|
38
45
|
className: [textStyles({
|
|
@@ -3,7 +3,7 @@ import { Column } from '../Columns/Column';
|
|
|
3
3
|
import { Columns } from '../Columns/Columns';
|
|
4
4
|
import { SliderProgress } from '../SliderProgress/SliderProgress';
|
|
5
5
|
import { UseHorizontalAutoScrollerProps } from './useHorizontalAutoScroller';
|
|
6
|
-
export interface
|
|
6
|
+
export interface Props extends Pick<ComponentProps<typeof Columns>, 'space'>, Omit<UseHorizontalAutoScrollerProps, 'itemsRef'> {
|
|
7
7
|
durationSeconds?: number;
|
|
8
8
|
className?: string;
|
|
9
9
|
columnWidth?: ComponentProps<typeof Column>['width'];
|
|
@@ -11,6 +11,6 @@ export interface HorizontalAutoScrollerProps extends Pick<ComponentProps<typeof
|
|
|
11
11
|
noControls?: boolean;
|
|
12
12
|
children: ReactNode | ReactNode[];
|
|
13
13
|
}
|
|
14
|
-
export declare const HorizontalAutoScroller: FunctionComponent<
|
|
14
|
+
export declare const HorizontalAutoScroller: FunctionComponent<Props>;
|
|
15
15
|
export default HorizontalAutoScroller;
|
|
16
16
|
//# sourceMappingURL=HorizontalAutoScroller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HorizontalAutoScroller.d.ts","sourceRoot":"","sources":["../../../lib/components/HorizontalAutoScroller/HorizontalAutoScroller.tsx"],"names":[],"mappings":"AAGA,OAAO,EACN,cAAc,EACd,iBAAiB,EACjB,SAAS,EAGT,MAAM,OAAO,CAAC;AAMf,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAG7C,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAIlE,OAAO,EAEN,8BAA8B,EAC9B,MAAM,6BAA6B,CAAC;AAErC,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"HorizontalAutoScroller.d.ts","sourceRoot":"","sources":["../../../lib/components/HorizontalAutoScroller/HorizontalAutoScroller.tsx"],"names":[],"mappings":"AAGA,OAAO,EACN,cAAc,EACd,iBAAiB,EACjB,SAAS,EAGT,MAAM,OAAO,CAAC;AAMf,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAG7C,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAIlE,OAAO,EAEN,8BAA8B,EAC9B,MAAM,6BAA6B,CAAC;AAErC,MAAM,WAAW,KAChB,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,OAAO,CAAC,EAAE,OAAO,CAAC,EACpD,IAAI,CAAC,8BAA8B,EAAE,UAAU,CAAC;IACjD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC;IACrD,oBAAoB,CAAC,EAAE,cAAc,CACpC,OAAO,cAAc,CACrB,CAAC,kBAAkB,CAAC,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,QAAQ,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;CAClC;AAED,eAAO,MAAM,sBAAsB,EAAE,iBAAiB,CAAC,KAAK,CAkK3D,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
|
@@ -38,7 +38,7 @@ export const HorizontalAutoScroller = _ref => {
|
|
|
38
38
|
const [itemsRef, setItemsRef] = useState();
|
|
39
39
|
const items = useMemo(() => {
|
|
40
40
|
const itemsRef = [];
|
|
41
|
-
const list = incomingItems.map((item, index) => _jsx(Column, {
|
|
41
|
+
const list = incomingItems.map((item, index) => /*#__PURE__*/_jsx(Column, {
|
|
42
42
|
ref: el => {
|
|
43
43
|
if (el) itemsRef.push(el);
|
|
44
44
|
},
|
|
@@ -46,7 +46,7 @@ export const HorizontalAutoScroller = _ref => {
|
|
|
46
46
|
width: columnWidth,
|
|
47
47
|
justifyContent: "stretch",
|
|
48
48
|
alignSelf: "stretch",
|
|
49
|
-
children: _jsx(Box, {
|
|
49
|
+
children: /*#__PURE__*/_jsx(Box, {
|
|
50
50
|
width: "full",
|
|
51
51
|
className: clsx(styles.item, {
|
|
52
52
|
[styles.active]: index === activeIndex
|
|
@@ -76,18 +76,19 @@ export const HorizontalAutoScroller = _ref => {
|
|
|
76
76
|
});
|
|
77
77
|
const handlers = useSwipeable({
|
|
78
78
|
onSwiped: eventData => {
|
|
79
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
79
80
|
eventData.dir === 'Left' ? next() : prev();
|
|
80
81
|
}
|
|
81
82
|
});
|
|
82
83
|
if (items.length < 2) {
|
|
83
|
-
return _jsx(_Fragment, {
|
|
84
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
84
85
|
children: items
|
|
85
86
|
});
|
|
86
87
|
}
|
|
87
|
-
return _jsxs(Stack, {
|
|
88
|
+
return /*#__PURE__*/_jsxs(Stack, {
|
|
88
89
|
className: className,
|
|
89
90
|
space: "5",
|
|
90
|
-
children: [_jsxs(Box, _objectSpread(_objectSpread({
|
|
91
|
+
children: [/*#__PURE__*/_jsxs(Box, _objectSpread(_objectSpread({
|
|
91
92
|
overflow: "hidden",
|
|
92
93
|
position: "relative"
|
|
93
94
|
}, handlers), {}, {
|
|
@@ -98,13 +99,13 @@ export const HorizontalAutoScroller = _ref => {
|
|
|
98
99
|
onTouchStart: pause,
|
|
99
100
|
onTouchEnd: resume,
|
|
100
101
|
onClick: onClick,
|
|
101
|
-
children: [noControls ? null : _jsx(Box, {
|
|
102
|
+
children: [noControls ? null : /*#__PURE__*/_jsx(Box, {
|
|
102
103
|
className: [styles.controllerBtn, styles.prevBtn],
|
|
103
104
|
display: "flex",
|
|
104
105
|
alignItems: "center",
|
|
105
106
|
justifyContent: "start",
|
|
106
107
|
position: "absolute",
|
|
107
|
-
children: _jsx(Button, {
|
|
108
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
108
109
|
rounded: true,
|
|
109
110
|
onClick: event => {
|
|
110
111
|
event.stopPropagation();
|
|
@@ -112,32 +113,32 @@ export const HorizontalAutoScroller = _ref => {
|
|
|
112
113
|
prev();
|
|
113
114
|
},
|
|
114
115
|
variant: "secondary",
|
|
115
|
-
children: _jsx(Icon, {
|
|
116
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
116
117
|
icon: ChevronLeftIcon
|
|
117
118
|
})
|
|
118
119
|
})
|
|
119
|
-
}), _jsxs(Columns, {
|
|
120
|
+
}), /*#__PURE__*/_jsxs(Columns, {
|
|
120
121
|
ref: containerRef,
|
|
121
122
|
overflow: "hidden",
|
|
122
123
|
noWrap: true,
|
|
123
124
|
width: "full",
|
|
124
125
|
space: space,
|
|
125
|
-
children: [noControls ? null : _jsx(Column, {
|
|
126
|
+
children: [noControls ? null : /*#__PURE__*/_jsx(Column, {
|
|
126
127
|
noShrink: true,
|
|
127
128
|
className: styles.controllerCol,
|
|
128
|
-
children: _jsx("span", {})
|
|
129
|
-
}), items, noControls ? null : _jsx(Column, {
|
|
129
|
+
children: /*#__PURE__*/_jsx("span", {})
|
|
130
|
+
}), items, noControls ? null : /*#__PURE__*/_jsx(Column, {
|
|
130
131
|
noShrink: true,
|
|
131
132
|
className: styles.controllerCol,
|
|
132
|
-
children: _jsx("span", {})
|
|
133
|
+
children: /*#__PURE__*/_jsx("span", {})
|
|
133
134
|
})]
|
|
134
|
-
}), noControls ? null : _jsx(Box, {
|
|
135
|
+
}), noControls ? null : /*#__PURE__*/_jsx(Box, {
|
|
135
136
|
className: [styles.controllerBtn, styles.nextBtn],
|
|
136
137
|
display: "flex",
|
|
137
138
|
alignItems: "center",
|
|
138
139
|
justifyContent: "flexEnd",
|
|
139
140
|
position: "absolute",
|
|
140
|
-
children: _jsx(Button, {
|
|
141
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
141
142
|
rounded: true,
|
|
142
143
|
onClick: event => {
|
|
143
144
|
event.stopPropagation();
|
|
@@ -145,14 +146,14 @@ export const HorizontalAutoScroller = _ref => {
|
|
|
145
146
|
next();
|
|
146
147
|
},
|
|
147
148
|
variant: "secondary",
|
|
148
|
-
children: _jsx(Icon, {
|
|
149
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
149
150
|
icon: ChevronRightIcon
|
|
150
151
|
})
|
|
151
152
|
})
|
|
152
153
|
})]
|
|
153
|
-
})), _jsx(Section, {
|
|
154
|
+
})), /*#__PURE__*/_jsx(Section, {
|
|
154
155
|
width: "small",
|
|
155
|
-
children: _jsx(SliderProgress, {
|
|
156
|
+
children: /*#__PURE__*/_jsx(SliderProgress, {
|
|
156
157
|
backgroundColour: sliderProgressColour,
|
|
157
158
|
duration: `${durationSeconds}s`,
|
|
158
159
|
paused: paused,
|
|
@@ -17,7 +17,7 @@ export const Icon = _ref => {
|
|
|
17
17
|
display = 'block'
|
|
18
18
|
} = _ref;
|
|
19
19
|
useNullCheck(icon, 'Icon component received an empty icon prop.');
|
|
20
|
-
const iconElement = cloneElement(icon, {
|
|
20
|
+
const iconElement = /*#__PURE__*/cloneElement(icon, {
|
|
21
21
|
className: componentStyles({
|
|
22
22
|
as: 'svg',
|
|
23
23
|
display: 'block',
|
|
@@ -27,7 +27,7 @@ export const Icon = _ref => {
|
|
|
27
27
|
'aria-label': (_icon$props$ariaLabe = icon.props['aria-label']) !== null && _icon$props$ariaLabe !== void 0 ? _icon$props$ariaLabe : undefined,
|
|
28
28
|
'aria-hidden': icon.props['aria-label'] ? undefined : true
|
|
29
29
|
});
|
|
30
|
-
return _jsx(Box, {
|
|
30
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
31
31
|
as: "span",
|
|
32
32
|
display: display,
|
|
33
33
|
className: [resolveResponsiveStyle(size, styles.size), className],
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { ComponentProps, FunctionComponent } from 'react';
|
|
2
2
|
import { ResponsiveImage } from './ResponsiveImage';
|
|
3
3
|
export interface ImageProps extends ComponentProps<typeof ResponsiveImage> {
|
|
4
|
+
/**
|
|
5
|
+
* If set to true, no size/quality optimisation will be done even when `ImageServerProvider` has been defined upstream.
|
|
6
|
+
**/
|
|
4
7
|
unoptimised?: boolean;
|
|
5
8
|
}
|
|
6
9
|
export declare const Image: FunctionComponent<ImageProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../lib/components/Image/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI/D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,OAAO,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../lib/components/Image/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI/D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,OAAO,eAAe,CAAC;IACzE;;QAEI;IACJ,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,KAAK,EAAE,iBAAiB,CAAC,UAAU,CAS9C,CAAC"}
|
|
@@ -16,7 +16,7 @@ export const Image = _ref => {
|
|
|
16
16
|
imageWidth
|
|
17
17
|
} = _ref,
|
|
18
18
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
19
|
-
return useImageServer() && !unoptimised ? _jsx(ResponsiveImage, _objectSpread({
|
|
19
|
+
return useImageServer() && !unoptimised ? /*#__PURE__*/_jsx(ResponsiveImage, _objectSpread({
|
|
20
20
|
imageWidth: imageWidth
|
|
21
|
-
}, props)) : _jsx(SimpleImage, _objectSpread({}, props));
|
|
21
|
+
}, props)) : /*#__PURE__*/_jsx(SimpleImage, _objectSpread({}, props));
|
|
22
22
|
};
|
|
@@ -24,10 +24,14 @@ export const widthMap = {
|
|
|
24
24
|
const defaultValue = {
|
|
25
25
|
widthMap,
|
|
26
26
|
getWidthValue: width => widthMap[width],
|
|
27
|
+
// @ts-expect-error type does not allow `null`
|
|
27
28
|
srcUrlMapper: null,
|
|
29
|
+
// @ts-expect-error type does not allow `null`
|
|
28
30
|
generateSrcSet: null
|
|
29
31
|
};
|
|
30
|
-
|
|
32
|
+
|
|
33
|
+
// @ts-expect-error type does not allow `null`
|
|
34
|
+
const imageServerCtx = /*#__PURE__*/createContext(null);
|
|
31
35
|
export const useImageServer = () => useContext(imageServerCtx);
|
|
32
36
|
export const ImageServerProvider = _ref => {
|
|
33
37
|
let {
|
|
@@ -43,6 +47,7 @@ export const ImageServerProvider = _ref => {
|
|
|
43
47
|
} = _ref2;
|
|
44
48
|
return Object.keys(widthMap).map(key => {
|
|
45
49
|
const width = getWidthValue === null || getWidthValue === void 0 ? void 0 : getWidthValue(key);
|
|
50
|
+
// @ts-expect-error width could be undefined
|
|
46
51
|
return `${srcUrlMapper({
|
|
47
52
|
quality,
|
|
48
53
|
src,
|
|
@@ -50,7 +55,7 @@ export const ImageServerProvider = _ref => {
|
|
|
50
55
|
})} ${width}w`;
|
|
51
56
|
}).join(', ');
|
|
52
57
|
}, [widthMap, srcUrlMapper, getWidthValue]);
|
|
53
|
-
return _jsx(imageServerCtx.Provider, {
|
|
58
|
+
return /*#__PURE__*/_jsx(imageServerCtx.Provider, {
|
|
54
59
|
value: useMemo(() => ({
|
|
55
60
|
widthMap,
|
|
56
61
|
srcUrlMapper,
|
|
@@ -3,8 +3,30 @@ import { ResponsiveProp } from '../../utils/responsiveProps.css';
|
|
|
3
3
|
import { widthMap } from './ImageServerProvider';
|
|
4
4
|
import { SimpleImage } from './SimpleImage';
|
|
5
5
|
export interface ResponsiveImageProps extends Omit<ComponentProps<typeof SimpleImage>, 'sizes'> {
|
|
6
|
+
/**
|
|
7
|
+
* Only effective if `ImageServerProvider` is defined upstream.
|
|
8
|
+
* Not to be confused with the `width` of the image tag. `imageWidth` is purely to do with the
|
|
9
|
+
* intrinsic size of the image asset coming back from the Image Server and does not change the layout size of the `img` tag
|
|
10
|
+
* If `imageWidth` is provided, it will be exactly used and no automatic `srcSet` will be defined and `sizes` will have no effect.
|
|
11
|
+
* `imageWidth` can be a single value e.g. `4` to be used for all screen sizes or an array to be used for responsive values e.g. `[4, ,6, 8]`
|
|
12
|
+
**/
|
|
6
13
|
imageWidth: ResponsiveProp<keyof typeof widthMap>;
|
|
14
|
+
/**
|
|
15
|
+
* Only effective if `ImageServerProvider` is defined upstream.
|
|
16
|
+
* A vw value e.g. `80vw` or an array of vw values `['100vw', ,'50vw', '30vw']` to be used as responsive.
|
|
17
|
+
* When defined, browser will pick the closest match from srcSet based on viewport width size.
|
|
18
|
+
* Just like `imageWidth` sizes has no effect on the `img` tag layout size and is purely to do with the
|
|
19
|
+
* intrinsic size of the image asset coming back from the Image Server.
|
|
20
|
+
* in `['100vw', ,'50vw', '30vw']` browser will fetch the best image asset to cover
|
|
21
|
+
* the whole width of mobile and tablet devices, 50% of desktop screen width 30% of a large desktop screen width irrespective
|
|
22
|
+
* of the size of img tag on the page. So a `100vh` set for a large desktop might fetch a `3840px` wide
|
|
23
|
+
* asset even if the image only occupies 10px of the page width.
|
|
24
|
+
**/
|
|
7
25
|
sizes: ResponsiveProp<string>;
|
|
26
|
+
/**
|
|
27
|
+
* Only effective if `ImageServerProvider` is defined upstream.
|
|
28
|
+
* A number between 1 and 100 to be used by the image server for the quality of image returned.
|
|
29
|
+
**/
|
|
8
30
|
quality?: number;
|
|
9
31
|
}
|
|
10
32
|
export declare const ResponsiveImage: FunctionComponent<ResponsiveImageProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponsiveImage.d.ts","sourceRoot":"","sources":["../../../lib/components/Image/ResponsiveImage.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAK/D,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,EAAkB,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,WAAW,oBAChB,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,WAAW,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ResponsiveImage.d.ts","sourceRoot":"","sources":["../../../lib/components/Image/ResponsiveImage.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAK/D,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,EAAkB,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,WAAW,oBAChB,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,WAAW,CAAC,EAAE,OAAO,CAAC;IACzD;;;;;;QAMI;IACJ,UAAU,EAAE,cAAc,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAC;IAElD;;;;;;;;;;QAUI;IACJ,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IAE9B;;;QAGI;IACJ,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,eAAe,EAAE,iBAAiB,CAAC,oBAAoB,CA6CnE,CAAC"}
|
|
@@ -30,6 +30,7 @@ export const ResponsiveImage = _ref => {
|
|
|
30
30
|
} = useImageServer();
|
|
31
31
|
const src = useMemo(() => srcUrlMapper({
|
|
32
32
|
src: incomingSrc,
|
|
33
|
+
// @ts-expect-error Cannot invoke an object which is possibly 'undefined'
|
|
33
34
|
width: getWidthValue(imageWidth),
|
|
34
35
|
quality
|
|
35
36
|
}), [incomingSrc, imageWidth, quality, srcUrlMapper, getWidthValue]);
|
|
@@ -37,7 +38,7 @@ export const ResponsiveImage = _ref => {
|
|
|
37
38
|
src: incomingSrc,
|
|
38
39
|
quality
|
|
39
40
|
}), [incomingSrc, quality]);
|
|
40
|
-
return _jsx(SimpleImage, _objectSpread({
|
|
41
|
+
return /*#__PURE__*/_jsx(SimpleImage, _objectSpread({
|
|
41
42
|
sizes: sizes || void 0,
|
|
42
43
|
srcSet: srcset,
|
|
43
44
|
src: src
|
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
import { FunctionComponent, ReactElement } from 'react';
|
|
2
2
|
export interface SimpleImageProps extends Partial<Omit<HTMLImageElement, 'loading' | 'className' | 'width' | 'height'>> {
|
|
3
3
|
src: string;
|
|
4
|
+
/**
|
|
5
|
+
* If set to true, image lazy loading is disabled.
|
|
6
|
+
**/
|
|
4
7
|
eager?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Can be manually defined as a normal `srcset` img tag attribute but will be automatically set for
|
|
10
|
+
* all available sizes when an `ImageServerProvider` is defined upstream.
|
|
11
|
+
**/
|
|
5
12
|
srcSet?: string;
|
|
13
|
+
/**
|
|
14
|
+
* When set to true image async decoding by the browser is disabled.
|
|
15
|
+
* Async decoding of the image reduces delay in presenting other content.
|
|
16
|
+
**/
|
|
6
17
|
syncDecoding?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Only effective if `ImageServerProvider` is defined upstream.
|
|
20
|
+
* Will be set as `width` attribute on the `img` tag
|
|
21
|
+
**/
|
|
7
22
|
width?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Will be set as `height` attribute on the `img` tag
|
|
25
|
+
**/
|
|
8
26
|
height?: string;
|
|
9
27
|
className?: string;
|
|
10
28
|
fallbackComponent?: ReactElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleImage.d.ts","sourceRoot":"","sources":["../../../lib/components/Image/SimpleImage.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAY,MAAM,OAAO,CAAC;AAElE,MAAM,WAAW,gBAChB,SAAQ,OAAO,CACd,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,QAAQ,CAAC,CACpE;IACD,GAAG,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"SimpleImage.d.ts","sourceRoot":"","sources":["../../../lib/components/Image/SimpleImage.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAY,MAAM,OAAO,CAAC;AAElE,MAAM,WAAW,gBAChB,SAAQ,OAAO,CACd,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,QAAQ,CAAC,CACpE;IACD,GAAG,EAAE,MAAM,CAAC;IAEZ;;QAEI;IACJ,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;QAGI;IACJ,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;QAGI;IACJ,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;QAGI;IACJ,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;QAEI;IACJ,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,iBAAiB,CAAC,EAAE,YAAY,CAAC;CACjC;AAED,eAAO,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,CAgC3D,CAAC"}
|
|
@@ -15,7 +15,7 @@ export const SimpleImage = _ref => {
|
|
|
15
15
|
className = '',
|
|
16
16
|
src,
|
|
17
17
|
srcSet,
|
|
18
|
-
fallbackComponent
|
|
18
|
+
fallbackComponent // Add this line
|
|
19
19
|
} = _ref,
|
|
20
20
|
imgProps = _objectWithoutProperties(_ref, _excluded);
|
|
21
21
|
const [hasError, setHasError] = useState(false);
|
|
@@ -23,9 +23,13 @@ export const SimpleImage = _ref => {
|
|
|
23
23
|
setHasError(true);
|
|
24
24
|
};
|
|
25
25
|
if (hasError && fallbackComponent) {
|
|
26
|
+
// Render fallback component
|
|
26
27
|
return fallbackComponent;
|
|
27
28
|
}
|
|
28
|
-
return (
|
|
29
|
+
return (
|
|
30
|
+
/*#__PURE__*/
|
|
31
|
+
// @ts-expect-error cross origin prop type
|
|
32
|
+
_jsx("img", _objectSpread({
|
|
29
33
|
loading: eager ? 'eager' : 'lazy',
|
|
30
34
|
decoding: syncDecoding ? 'sync' : 'async',
|
|
31
35
|
className: className,
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { FunctionComponent } from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import type { ThemeTokens as Tokens } from '../../themes';
|
|
4
|
+
import type { ResponsiveProp } from '../../utils/responsiveProps.css';
|
|
3
5
|
import { type BoxProps } from '../Box/Box';
|
|
4
6
|
export interface InlineProps extends Pick<BoxProps, 'as' | 'width'> {
|
|
5
|
-
|
|
6
|
-
alignY?:
|
|
7
|
+
space?: ResponsiveProp<keyof Tokens['space']>;
|
|
8
|
+
alignY?: BoxProps['alignItems'];
|
|
9
|
+
alignX?: BoxProps['justifyContent'];
|
|
10
|
+
noWrap?: boolean;
|
|
7
11
|
children: ReactNode;
|
|
8
12
|
dividers?: boolean | ReactNode;
|
|
9
|
-
noWrap?: boolean;
|
|
10
|
-
space?: Sprinkles['gap'];
|
|
11
13
|
}
|
|
12
14
|
export declare const Inline: FunctionComponent<InlineProps>;
|
|
15
|
+
export default Inline;
|
|
13
16
|
//# sourceMappingURL=Inline.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Inline.d.ts","sourceRoot":"","sources":["../../../lib/components/Inline/Inline.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"Inline.d.ts","sourceRoot":"","sources":["../../../lib/components/Inline/Inline.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAgB,MAAM,OAAO,CAAC;AAE7D,OAAO,EAA4B,SAAS,EAAE,MAAM,OAAO,CAAC;AAO5D,OAAO,KAAK,EAAE,WAAW,IAAI,MAAM,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGhD,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,QAAQ,EAAE,IAAI,GAAG,OAAO,CAAC;IAClE,KAAK,CAAC,EAAE,cAAc,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9C,MAAM,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAC;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC/B;AAOD,eAAO,MAAM,MAAM,EAAE,iBAAiB,CAAC,WAAW,CA8DjD,CAAC;AAgBF,eAAe,MAAM,CAAC"}
|