@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
|
@@ -6,6 +6,7 @@ const _excluded = ["field", "eventHandlers", "validation", "isLoading", "suffixe
|
|
|
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 { warning } from '@autoguru/utilities';
|
|
9
|
+
import clsx from 'clsx';
|
|
9
10
|
import * as React from 'react';
|
|
10
11
|
import { sprinkles } from "../../styles/index.js";
|
|
11
12
|
import { Box } from "../Box/Box.js";
|
|
@@ -25,38 +26,38 @@ export const ColourInput = withEnhancedInput(_ref => {
|
|
|
25
26
|
} = _ref,
|
|
26
27
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
27
28
|
process.env.NODE_ENV !== "production" ? warning(field.value !== '', 'Colour Input does not support empty values.') : void 0;
|
|
28
|
-
return _jsxs(Box, {
|
|
29
|
+
return /*#__PURE__*/_jsxs(Box, {
|
|
29
30
|
display: "flex",
|
|
30
31
|
flexWrap: "nowrap",
|
|
31
32
|
alignItems: "center",
|
|
32
33
|
justifyContent: "center",
|
|
33
34
|
position: "relative",
|
|
34
|
-
children: [_jsx(Box, {
|
|
35
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
35
36
|
className: [styles.colouredBoxHolder, styles.colouredBoxHolderSize[size]],
|
|
36
37
|
display: "flex",
|
|
37
38
|
height: "full",
|
|
38
39
|
alignItems: "center",
|
|
39
40
|
justifyContent: "space-around",
|
|
40
|
-
flexShrink:
|
|
41
|
+
flexShrink: 0,
|
|
41
42
|
pointerEvents: "none",
|
|
42
43
|
position: "absolute",
|
|
43
|
-
children: _jsx(Box, {
|
|
44
|
+
children: /*#__PURE__*/_jsx(Box, {
|
|
44
45
|
style: {
|
|
45
46
|
backgroundColor: field.value
|
|
46
47
|
},
|
|
47
48
|
padding: size === 'medium' ? '3' : '2',
|
|
48
49
|
borderRadius: "1"
|
|
49
50
|
})
|
|
50
|
-
}), _jsx(Text, {
|
|
51
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
51
52
|
display: "block",
|
|
52
|
-
className:
|
|
53
|
+
className: clsx(styles.valueText, styles.valueTextSize[size], sprinkles({
|
|
53
54
|
position: 'absolute'
|
|
54
|
-
})
|
|
55
|
+
})),
|
|
55
56
|
children: field.value
|
|
56
|
-
}), _jsx(Box, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
57
|
+
}), /*#__PURE__*/_jsx(Box, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
57
58
|
as: "input",
|
|
58
59
|
type: "color",
|
|
59
|
-
flexGrow:
|
|
60
|
+
flexGrow: 1
|
|
60
61
|
}, eventHandlers), field), rest), {}, {
|
|
61
62
|
className: [styles.input, field.className],
|
|
62
63
|
autoComplete: "off"
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
|
|
4
4
|
__vanilla_filescope__.setFileScope("lib/components/Columns/Column.css.ts", "@autoguru/overdrive");
|
|
5
|
+
// import { styleVariants } from '@vanilla-extract/css';
|
|
5
6
|
import { recipe } from '@vanilla-extract/recipes';
|
|
6
7
|
import { createSprinkles, defineProperties } from '@vanilla-extract/sprinkles';
|
|
7
8
|
import { cssLayerComponent } from "../../styles/layers.css.js";
|
|
@@ -12,7 +12,7 @@ import { Box } from "../Box/Box.js";
|
|
|
12
12
|
import * as styles from "./Column.css.js";
|
|
13
13
|
import { ColumnContext } from "./Columns.js";
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
-
export const Column = forwardRef((_ref, ref) => {
|
|
15
|
+
export const Column = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
16
16
|
let {
|
|
17
17
|
className,
|
|
18
18
|
children,
|
|
@@ -31,7 +31,7 @@ export const Column = forwardRef((_ref, ref) => {
|
|
|
31
31
|
spaceXCls,
|
|
32
32
|
spaceYCls
|
|
33
33
|
} = columnsContext;
|
|
34
|
-
return _jsx(Box, {
|
|
34
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
35
35
|
as: isList ? 'li' : 'div',
|
|
36
36
|
order: order,
|
|
37
37
|
className: [spaceXCls, spaceYCls, styles.sprinklesColumnWidthResponsive({
|
|
@@ -41,7 +41,7 @@ export const Column = forwardRef((_ref, ref) => {
|
|
|
41
41
|
grow,
|
|
42
42
|
noShrink
|
|
43
43
|
})],
|
|
44
|
-
children: _jsx(Box, _objectSpread(_objectSpread({
|
|
44
|
+
children: /*#__PURE__*/_jsx(Box, _objectSpread(_objectSpread({
|
|
45
45
|
ref: ref,
|
|
46
46
|
as: as,
|
|
47
47
|
display: "flex",
|
|
@@ -4,7 +4,7 @@ import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
|
|
|
4
4
|
__vanilla_filescope__.setFileScope("lib/components/Columns/ColumnGrid.css.ts", "@autoguru/overdrive");
|
|
5
5
|
import { recipe } from '@vanilla-extract/recipes';
|
|
6
6
|
import { sprinkles } from "../../styles/sprinkles.css.js";
|
|
7
|
-
export const totalGridColumns = 12;
|
|
7
|
+
export const totalGridColumns = 12; // chosen to be divisible by 2, 3, 4
|
|
8
8
|
export const columnStyle = recipe({
|
|
9
9
|
base: {},
|
|
10
10
|
variants: {
|
|
@@ -4,13 +4,13 @@ import type { ThemeTokens as Tokens } from '../../themes';
|
|
|
4
4
|
import { ResponsiveProp } from '../../utils/responsiveProps.css';
|
|
5
5
|
import { Box } from '../Box/Box';
|
|
6
6
|
import * as styles from './Columns.css';
|
|
7
|
-
export interface
|
|
8
|
-
children?: ReactNode;
|
|
7
|
+
export interface Props extends Omit<ComponentProps<typeof Box>, 'css'>, styles.ColumnsStyle {
|
|
9
8
|
className?: string;
|
|
10
9
|
columns?: number;
|
|
11
10
|
space?: ResponsiveProp<keyof Tokens['space']>;
|
|
12
11
|
spaceX?: ResponsiveProp<keyof typeof styles.space.spaceX>;
|
|
13
12
|
spaceY?: ResponsiveProp<keyof typeof styles.space.spaceY>;
|
|
13
|
+
children?: ReactNode;
|
|
14
14
|
}
|
|
15
15
|
interface ColumnContextValue {
|
|
16
16
|
spaceXCls: any;
|
|
@@ -18,6 +18,6 @@ interface ColumnContextValue {
|
|
|
18
18
|
isList: boolean;
|
|
19
19
|
}
|
|
20
20
|
export declare const ColumnContext: React.Context<ColumnContextValue | null>;
|
|
21
|
-
export declare const Columns: React.ForwardRefExoticComponent<Omit<
|
|
21
|
+
export declare const Columns: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
22
22
|
export {};
|
|
23
23
|
//# sourceMappingURL=Columns.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Columns.d.ts","sourceRoot":"","sources":["../../../lib/components/Columns/Columns.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACN,cAAc,EAGd,SAAS,EAET,MAAM,OAAO,CAAC;AAMf,OAAO,KAAK,EAAE,WAAW,IAAI,MAAM,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"Columns.d.ts","sourceRoot":"","sources":["../../../lib/components/Columns/Columns.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACN,cAAc,EAGd,SAAS,EAET,MAAM,OAAO,CAAC;AAMf,OAAO,KAAK,EAAE,WAAW,IAAI,MAAM,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,MAAM,WAAW,KAChB,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,EAAE,KAAK,CAAC,EAC9C,MAAM,CAAC,YAAY;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,cAAc,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9C,MAAM,CAAC,EAAE,cAAc,CAAC,MAAM,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1D,MAAM,CAAC,EAAE,cAAc,CAAC,MAAM,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAE1D,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,UAAU,kBAAkB;IAC3B,SAAS,MAAC;IACV,SAAS,MAAC;IACV,MAAM,EAAE,OAAO,CAAC;CAChB;AAED,eAAO,MAAM,aAAa,0CAAiD,CAAC;AAE5E,eAAO,MAAM,OAAO,wFAkEnB,CAAC"}
|
|
@@ -13,8 +13,8 @@ import { resolveResponsiveStyle } from "../../utils/resolveResponsiveProps.js";
|
|
|
13
13
|
import { Box } from "../Box/Box.js";
|
|
14
14
|
import * as styles from "./Columns.css.js";
|
|
15
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
-
export const ColumnContext = createContext(null);
|
|
17
|
-
export const Columns = forwardRef((_ref, ref) => {
|
|
16
|
+
export const ColumnContext = /*#__PURE__*/createContext(null);
|
|
17
|
+
export const Columns = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
18
18
|
let {
|
|
19
19
|
className,
|
|
20
20
|
children,
|
|
@@ -31,7 +31,7 @@ export const Columns = forwardRef((_ref, ref) => {
|
|
|
31
31
|
const resolvedSpaceY = useMemo(() => spaceY || space || ['none'], [space, spaceY]);
|
|
32
32
|
const marginLeftFix = useNegativeMarginLeft(resolvedSpaceX);
|
|
33
33
|
const marginTopFix = useNegativeMarginTop(resolvedSpaceY);
|
|
34
|
-
return _jsx(Box, _objectSpread(_objectSpread({
|
|
34
|
+
return /*#__PURE__*/_jsx(Box, _objectSpread(_objectSpread({
|
|
35
35
|
ref: ref,
|
|
36
36
|
as: as,
|
|
37
37
|
display: "flex",
|
|
@@ -43,7 +43,7 @@ export const Columns = forwardRef((_ref, ref) => {
|
|
|
43
43
|
}), className),
|
|
44
44
|
odComponent: "columns"
|
|
45
45
|
}, boxProps), {}, {
|
|
46
|
-
children: _jsx(ColumnContext.Provider, {
|
|
46
|
+
children: /*#__PURE__*/_jsx(ColumnContext.Provider, {
|
|
47
47
|
value: useMemo(() => ({
|
|
48
48
|
spaceXCls: resolveResponsiveStyle(resolvedSpaceX, styles.space.spaceX),
|
|
49
49
|
spaceYCls: resolveResponsiveStyle(resolvedSpaceY, styles.space.spaceY),
|
|
@@ -22,7 +22,7 @@ export const DateInput = withEnhancedInput(_ref => {
|
|
|
22
22
|
} = _ref,
|
|
23
23
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
24
24
|
process.env.NODE_ENV !== "production" ? warning(field.value !== '', 'Date Input does not support empty values.') : void 0;
|
|
25
|
-
return _jsx(Box, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
25
|
+
return /*#__PURE__*/_jsx(Box, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
26
26
|
as: "input"
|
|
27
27
|
}, eventHandlers), field), rest), {}, {
|
|
28
28
|
autoComplete: "off",
|
|
@@ -36,14 +36,14 @@ export const DatePicker = _ref => {
|
|
|
36
36
|
onChange(event.currentTarget.value);
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
|
-
return _jsxs(Box, {
|
|
39
|
+
return /*#__PURE__*/_jsxs(Box, {
|
|
40
40
|
position: "relative",
|
|
41
41
|
overflow: "hidden",
|
|
42
42
|
className: clsx(className, {
|
|
43
43
|
[styles.disabled.default]: disabled,
|
|
44
44
|
[styles.disabled.root]: disabled
|
|
45
45
|
}),
|
|
46
|
-
children: [_jsx(Box, _objectSpread({
|
|
46
|
+
children: [/*#__PURE__*/_jsx(Box, _objectSpread({
|
|
47
47
|
as: "input",
|
|
48
48
|
position: "absolute",
|
|
49
49
|
height: "full",
|
|
@@ -54,19 +54,19 @@ export const DatePicker = _ref => {
|
|
|
54
54
|
[styles.disabled.default]: disabled
|
|
55
55
|
}, styles.input),
|
|
56
56
|
type: "date"
|
|
57
|
-
}, inputProps)), _jsxs(Box, {
|
|
57
|
+
}, inputProps)), /*#__PURE__*/_jsxs(Box, {
|
|
58
58
|
className: clsx(styles.contents.default, {
|
|
59
59
|
[styles.contents.withLabel]: Boolean(valueLabel)
|
|
60
60
|
}),
|
|
61
|
-
children: [isLoading ? _jsx(ProgressSpinner, {
|
|
61
|
+
children: [isLoading ? /*#__PURE__*/_jsx(ProgressSpinner, {
|
|
62
62
|
className: clsx(styles.spinner, sprinkles({
|
|
63
63
|
position: 'absolute'
|
|
64
64
|
})),
|
|
65
65
|
size: size
|
|
66
|
-
}) : _jsx(Icon, {
|
|
66
|
+
}) : /*#__PURE__*/_jsx(Icon, {
|
|
67
67
|
icon: icon,
|
|
68
68
|
size: size
|
|
69
|
-
}), valueLabel && _jsx(Text, {
|
|
69
|
+
}), valueLabel && /*#__PURE__*/_jsx(Text, {
|
|
70
70
|
size: textSizeMap[size],
|
|
71
71
|
children: valueLabel
|
|
72
72
|
})]
|
|
@@ -12,7 +12,7 @@ export const CalendarButton = props => {
|
|
|
12
12
|
const {
|
|
13
13
|
buttonProps
|
|
14
14
|
} = useButton(props, ref);
|
|
15
|
-
return _jsx("button", _objectSpread(_objectSpread({}, buttonProps), {}, {
|
|
15
|
+
return /*#__PURE__*/_jsx("button", _objectSpread(_objectSpread({}, buttonProps), {}, {
|
|
16
16
|
className: styledButton(),
|
|
17
17
|
ref: ref,
|
|
18
18
|
children: props.children
|
|
@@ -29,9 +29,9 @@ const CalendarCell = _ref => {
|
|
|
29
29
|
} = useCalendarCell({
|
|
30
30
|
date
|
|
31
31
|
}, state, ref);
|
|
32
|
-
return _jsx("td", _objectSpread(_objectSpread({}, cellProps), {}, {
|
|
32
|
+
return /*#__PURE__*/_jsx("td", _objectSpread(_objectSpread({}, cellProps), {}, {
|
|
33
33
|
className: tdStyle,
|
|
34
|
-
children: _jsx("div", _objectSpread(_objectSpread(_objectSpread({}, buttonProps), {}, {
|
|
34
|
+
children: /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread(_objectSpread({}, buttonProps), {}, {
|
|
35
35
|
ref: ref,
|
|
36
36
|
hidden: isOutsideVisibleRange,
|
|
37
37
|
className: styledCell()
|
|
@@ -58,23 +58,23 @@ export const CalendarGrid = _ref2 => {
|
|
|
58
58
|
weekDays
|
|
59
59
|
} = useCalendarGrid(props, state);
|
|
60
60
|
const weeksInMonth = getWeeksInMonth(state.visibleRange.start, locale, props.firstDayOfWeek);
|
|
61
|
-
return _jsxs("table", _objectSpread(_objectSpread({}, gridProps), {}, {
|
|
61
|
+
return /*#__PURE__*/_jsxs("table", _objectSpread(_objectSpread({}, gridProps), {}, {
|
|
62
62
|
className: calendarGridStyle,
|
|
63
|
-
children: [_jsx("thead", _objectSpread(_objectSpread({}, headerProps), {}, {
|
|
64
|
-
children: _jsx("tr", {
|
|
65
|
-
children: weekDays.map(day => _jsx("th", {
|
|
63
|
+
children: [/*#__PURE__*/_jsx("thead", _objectSpread(_objectSpread({}, headerProps), {}, {
|
|
64
|
+
children: /*#__PURE__*/_jsx("tr", {
|
|
65
|
+
children: weekDays.map(day => /*#__PURE__*/_jsx("th", {
|
|
66
66
|
className: thStyle,
|
|
67
67
|
children: day
|
|
68
68
|
}, day))
|
|
69
69
|
})
|
|
70
|
-
})), _jsx("tbody", {
|
|
70
|
+
})), /*#__PURE__*/_jsx("tbody", {
|
|
71
71
|
children: _toConsumableArray(Array.from({
|
|
72
72
|
length: weeksInMonth
|
|
73
|
-
}).keys()).map(weekIndex => _jsx("tr", {
|
|
74
|
-
children: state.getDatesInWeek(weekIndex).map((date, idx) => date ? _jsx(CalendarCell, {
|
|
73
|
+
}).keys()).map(weekIndex => /*#__PURE__*/_jsx("tr", {
|
|
74
|
+
children: state.getDatesInWeek(weekIndex).map((date, idx) => date ? /*#__PURE__*/_jsx(CalendarCell, {
|
|
75
75
|
state: state,
|
|
76
76
|
date: date
|
|
77
|
-
}, idx) : _jsx("td", {}, idx))
|
|
77
|
+
}, idx) : /*#__PURE__*/_jsx("td", {}, idx))
|
|
78
78
|
}, weekIndex))
|
|
79
79
|
})]
|
|
80
80
|
}));
|
|
@@ -8,7 +8,7 @@ import { focusOutlineStyle } from "../../styles/focusOutline.css.js";
|
|
|
8
8
|
import { sprinkles } from "../../styles/sprinkles.css.js";
|
|
9
9
|
import { overdriveTokens as tokens } from "../../themes/index.js";
|
|
10
10
|
import { breakpoints } from "../../themes/makeTheme.js";
|
|
11
|
-
import { interactionStyle } from "../../utils/css.js";
|
|
11
|
+
import { interactionStyle } from "../../utils/css.js"; // --- Container styles
|
|
12
12
|
export const queryContainer = createContainer("queryContainer");
|
|
13
13
|
export const queryContainerStyle = style({
|
|
14
14
|
containerName: queryContainer,
|
|
@@ -37,6 +37,9 @@ export const calendarStyle = style({
|
|
|
37
37
|
marginBottom: tokens.space[2],
|
|
38
38
|
padding: `0 ${tokens.space[1]}`
|
|
39
39
|
}, "calendarStyle");
|
|
40
|
+
|
|
41
|
+
// -- Cell styles
|
|
42
|
+
|
|
40
43
|
export const styledCell = recipe({
|
|
41
44
|
base: [{
|
|
42
45
|
alignItems: 'center',
|
|
@@ -64,6 +67,9 @@ export const styledCell = recipe({
|
|
|
64
67
|
size: '7'
|
|
65
68
|
}), focusOutlineStyle]
|
|
66
69
|
}, "styledCell");
|
|
70
|
+
|
|
71
|
+
// -- Button styles
|
|
72
|
+
|
|
67
73
|
export const styledButton = recipe({
|
|
68
74
|
base: [{
|
|
69
75
|
alignItems: 'center',
|
|
@@ -98,6 +104,8 @@ export const tdStyle = style({
|
|
|
98
104
|
padding: tokens.space[1],
|
|
99
105
|
textAlign: 'center'
|
|
100
106
|
}, "tdStyle");
|
|
107
|
+
|
|
108
|
+
// -- Heading styles
|
|
101
109
|
export const titleStyle = style({
|
|
102
110
|
fontWeight: tokens.typography.fontWeight.bold,
|
|
103
111
|
margin: 0
|
|
@@ -14,13 +14,52 @@ export type DateAndOption = {
|
|
|
14
14
|
timeOption: string;
|
|
15
15
|
};
|
|
16
16
|
export interface DateTimePickerProps<D extends DateValue> extends TestId {
|
|
17
|
+
/**
|
|
18
|
+
* A title for the date/time selection
|
|
19
|
+
*/
|
|
17
20
|
title?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Calendar props passed through to the react-aria hook
|
|
23
|
+
* ([docs](https://react-spectrum.adobe.com/react-aria/useCalendar.html))
|
|
24
|
+
*
|
|
25
|
+
* *Defaults*
|
|
26
|
+
* - `defaultValue`: Today's date
|
|
27
|
+
* - `firstDayOfWeek`: Monday
|
|
28
|
+
*/
|
|
18
29
|
calendar?: Exclude<AriaCalendarProps<D>, 'onChange'>;
|
|
30
|
+
/**
|
|
31
|
+
* `OptionGrid` props used to generate the time picker items. Ensure to include a descriptive `label` value (for
|
|
32
|
+
* assistive technology). Currently time options are not tied to the day selection.
|
|
33
|
+
*/
|
|
19
34
|
timeOptions: OptionGridProps<OptionItem>;
|
|
35
|
+
/**
|
|
36
|
+
* Allow date in the past
|
|
37
|
+
*/
|
|
20
38
|
allowPastDate?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Custom event handler return value when a date and time are both selected, return a value
|
|
41
|
+
* `{ date: DateValue, timeOption: string }` where `DateValue` comes from react-aria
|
|
42
|
+
*
|
|
43
|
+
* @returns `{ date: DateValue, timeOption: string }`
|
|
44
|
+
*/
|
|
21
45
|
onChange?: (value: DateAndOption) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Language content override
|
|
48
|
+
*/
|
|
22
49
|
lang?: Partial<Record<LangContent, string>>;
|
|
23
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* DateTimePicker component for selecting a date and time. The primary use case is for selecting a date and time for
|
|
53
|
+
* the vehicle to be left at the place of service, not scheduling the time of the service itself. Some suppliers
|
|
54
|
+
* may need the option to book a specficic time based on their availability which could require enahcement.
|
|
55
|
+
*
|
|
56
|
+
* For all date/time handling `@internationalized/date` is expected by react-aria. Presently only the Gregorian
|
|
57
|
+
* calendar is imported for use in order to minimise bundle size. It is recommended to use the the DateTimePicker
|
|
58
|
+
* uncontrolled.
|
|
59
|
+
*
|
|
60
|
+
* This component implements the react-aria `useCalendar` hook and supports controlled state as well
|
|
61
|
+
* ([docs](https://react-spectrum.adobe.com/react-aria/useCalendar.html))
|
|
62
|
+
*/
|
|
24
63
|
export declare const DateTimePicker: <D extends DateValue>({ allowPastDate, calendar, lang, onChange, timeOptions, title, testId, }: DateTimePickerProps<D>) => React.JSX.Element;
|
|
25
64
|
export {};
|
|
26
65
|
//# sourceMappingURL=DateTimePicker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimePicker.d.ts","sourceRoot":"","sources":["../../../lib/components/DateTimePicker/DateTimePicker.tsx"],"names":[],"mappings":"AAOA,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,EAKN,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,MAAM,YAAY,CAAC;AAIpB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAI1C,OAAO,EAEN,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,MAAM,0BAA0B,CAAC;AAWlC,QAAA,MAAM,cAAc;;;;;CAKV,CAAC;AAEX,KAAK,WAAW,GAAG,MAAM,OAAO,cAAc,CAAC;AAC/C,MAAM,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,SAAS,CAAE,SAAQ,MAAM;
|
|
1
|
+
{"version":3,"file":"DateTimePicker.d.ts","sourceRoot":"","sources":["../../../lib/components/DateTimePicker/DateTimePicker.tsx"],"names":[],"mappings":"AAOA,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,EAKN,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,MAAM,YAAY,CAAC;AAIpB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAI1C,OAAO,EAEN,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,MAAM,0BAA0B,CAAC;AAWlC,QAAA,MAAM,cAAc;;;;;CAKV,CAAC;AAEX,KAAK,WAAW,GAAG,MAAM,OAAO,cAAc,CAAC;AAC/C,MAAM,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,SAAS,CAAE,SAAQ,MAAM;IACvE;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;IACrD;;;OAGG;IACH,WAAW,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC;IACzC;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC1C;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;CAC5C;AAgBD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,SAAS,EAAE,0EAQjD,mBAAmB,CAAC,CAAC,CAAC,sBAwHxB,CAAC"}
|
|
@@ -4,9 +4,13 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
|
4
4
|
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; }
|
|
5
5
|
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; }
|
|
6
6
|
import { ChevronLeftIcon, ChevronRightIcon } from '@autoguru/icons';
|
|
7
|
-
import { getLocalTimeZone,
|
|
7
|
+
import { getLocalTimeZone,
|
|
8
|
+
// currently only supporting western-style Gregorian calendar
|
|
9
|
+
GregorianCalendar, today } from '@internationalized/date';
|
|
8
10
|
import React, { useEffect, useRef } from 'react';
|
|
9
|
-
import { useCalendar,
|
|
11
|
+
import { useCalendar,
|
|
12
|
+
// useDateFormatter,
|
|
13
|
+
useLocale, useId } from 'react-aria';
|
|
10
14
|
import { useCalendarState } from 'react-stately';
|
|
11
15
|
import { sprinkles } from "../../styles/sprinkles.css.js";
|
|
12
16
|
import { dataAttrs } from "../../utils/dataAttrs.js";
|
|
@@ -29,6 +33,25 @@ function createCalendar(identifier) {
|
|
|
29
33
|
}
|
|
30
34
|
throw new Error(`Unsupported calendar configured ${identifier}`);
|
|
31
35
|
}
|
|
36
|
+
|
|
37
|
+
// const dateTextPunctuationEN = (text: string) =>
|
|
38
|
+
// text
|
|
39
|
+
// .split(' ')
|
|
40
|
+
// .map((word, idx) => (idx === 0 ? `${word},` : word))
|
|
41
|
+
// .join(' ');
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* DateTimePicker component for selecting a date and time. The primary use case is for selecting a date and time for
|
|
45
|
+
* the vehicle to be left at the place of service, not scheduling the time of the service itself. Some suppliers
|
|
46
|
+
* may need the option to book a specficic time based on their availability which could require enahcement.
|
|
47
|
+
*
|
|
48
|
+
* For all date/time handling `@internationalized/date` is expected by react-aria. Presently only the Gregorian
|
|
49
|
+
* calendar is imported for use in order to minimise bundle size. It is recommended to use the the DateTimePicker
|
|
50
|
+
* uncontrolled.
|
|
51
|
+
*
|
|
52
|
+
* This component implements the react-aria `useCalendar` hook and supports controlled state as well
|
|
53
|
+
* ([docs](https://react-spectrum.adobe.com/react-aria/useCalendar.html))
|
|
54
|
+
*/
|
|
32
55
|
export const DateTimePicker = _ref => {
|
|
33
56
|
var _lang$dateLabel, _lang$prevLabel, _lang$nextLabel, _lang$timeLabel;
|
|
34
57
|
let {
|
|
@@ -53,6 +76,7 @@ export const DateTimePicker = _ref => {
|
|
|
53
76
|
};
|
|
54
77
|
const handleTimeChange = keys => {
|
|
55
78
|
if (keys === 'all') return;
|
|
79
|
+
// we expect only a single value for time picker
|
|
56
80
|
const time = keys.values().next().value;
|
|
57
81
|
selectedTimeOption.current = time;
|
|
58
82
|
handleChange();
|
|
@@ -91,63 +115,72 @@ export const DateTimePicker = _ref => {
|
|
|
91
115
|
if (state.value) {
|
|
92
116
|
selectedDate.current = state.value;
|
|
93
117
|
}
|
|
118
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- run only once
|
|
94
119
|
}, []);
|
|
95
|
-
|
|
120
|
+
|
|
121
|
+
// const formatter = useDateFormatter({ dateStyle: 'full' });
|
|
122
|
+
// const dateText = state.value
|
|
123
|
+
// ? dateTextPunctuationEN(
|
|
124
|
+
// formatter.format(state?.value?.toDate(getLocalTimeZone())),
|
|
125
|
+
// )
|
|
126
|
+
// : '';
|
|
127
|
+
|
|
128
|
+
return /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
|
|
96
129
|
role: "group",
|
|
97
130
|
"aria-labelledby": titleId,
|
|
98
131
|
className: queryContainerStyle
|
|
99
132
|
}, dataAttrs({
|
|
100
133
|
testid: testId
|
|
101
134
|
})), {}, {
|
|
102
|
-
children: [title && _jsx(Heading, {
|
|
135
|
+
children: [title && /*#__PURE__*/_jsx(Heading, {
|
|
103
136
|
as: "h2",
|
|
104
137
|
id: titleId,
|
|
105
138
|
mb: "6",
|
|
106
139
|
size: "8",
|
|
107
140
|
children: title
|
|
108
|
-
}), _jsxs("div", {
|
|
141
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
109
142
|
className: layoutStyle,
|
|
110
|
-
children: [_jsxs("div", {
|
|
143
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
111
144
|
className: sprinkles({
|
|
112
145
|
flexShrink: '0'
|
|
113
146
|
}),
|
|
114
|
-
children: [_jsx(Heading, {
|
|
147
|
+
children: [/*#__PURE__*/_jsx(Heading, {
|
|
115
148
|
as: "h3",
|
|
116
149
|
mb: "4",
|
|
117
150
|
size: "6",
|
|
118
151
|
children: (_lang$dateLabel = lang === null || lang === void 0 ? void 0 : lang.dateLabel) !== null && _lang$dateLabel !== void 0 ? _lang$dateLabel : defaultEnglish.dateLabel
|
|
119
|
-
}), _jsxs("div", _objectSpread(_objectSpread({}, calendarProps), {}, {
|
|
152
|
+
}), /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({}, calendarProps), {}, {
|
|
120
153
|
className: calendarStyle,
|
|
121
|
-
children: [_jsx(CalendarButton, _objectSpread(_objectSpread({}, prevButtonProps), {}, {
|
|
154
|
+
children: [/*#__PURE__*/_jsx(CalendarButton, _objectSpread(_objectSpread({}, prevButtonProps), {}, {
|
|
122
155
|
"aria-label": (_lang$prevLabel = lang === null || lang === void 0 ? void 0 : lang.prevLabel) !== null && _lang$prevLabel !== void 0 ? _lang$prevLabel : defaultEnglish.prevLabel,
|
|
123
|
-
children: _jsx(Icon, {
|
|
156
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
124
157
|
icon: ChevronLeftIcon,
|
|
125
158
|
size: "medium"
|
|
126
159
|
})
|
|
127
|
-
})), _jsx("h4", {
|
|
160
|
+
})), /*#__PURE__*/_jsx("h4", {
|
|
128
161
|
className: titleStyle,
|
|
129
162
|
children: calendarTitle
|
|
130
|
-
}), _jsx(CalendarButton, _objectSpread(_objectSpread({}, nextButtonProps), {}, {
|
|
163
|
+
}), /*#__PURE__*/_jsx(CalendarButton, _objectSpread(_objectSpread({}, nextButtonProps), {}, {
|
|
131
164
|
"aria-label": (_lang$nextLabel = lang === null || lang === void 0 ? void 0 : lang.nextLabel) !== null && _lang$nextLabel !== void 0 ? _lang$nextLabel : defaultEnglish.nextLabel,
|
|
132
|
-
children: _jsx(Icon, {
|
|
165
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
133
166
|
icon: ChevronRightIcon,
|
|
134
167
|
size: "medium"
|
|
135
168
|
})
|
|
136
169
|
}))]
|
|
137
|
-
})), _jsx(CalendarGrid, {
|
|
170
|
+
})), /*#__PURE__*/_jsx(CalendarGrid, {
|
|
138
171
|
state: state,
|
|
139
172
|
firstDayOfWeek: calendarComponentProps.firstDayOfWeek
|
|
140
173
|
})]
|
|
141
|
-
}), _jsxs("div", {
|
|
174
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
142
175
|
className: sprinkles({
|
|
143
176
|
flexGrow: '1'
|
|
144
177
|
}),
|
|
145
|
-
children: [_jsx(Heading, {
|
|
178
|
+
children: [/*#__PURE__*/_jsx(Heading, {
|
|
146
179
|
as: "h3",
|
|
147
180
|
mb: "4",
|
|
148
181
|
size: "6",
|
|
149
182
|
children: (_lang$timeLabel = lang === null || lang === void 0 ? void 0 : lang.timeLabel) !== null && _lang$timeLabel !== void 0 ? _lang$timeLabel : defaultEnglish.timeLabel
|
|
150
|
-
}), _jsx(OptionGrid, _objectSpread({}, optionGridComponentProps))]
|
|
183
|
+
}), /*#__PURE__*/_jsx(OptionGrid, _objectSpread({}, optionGridComponentProps))]
|
|
151
184
|
})]
|
|
152
185
|
})]
|
|
153
186
|
}));
|
|
@@ -33,19 +33,19 @@ export const DropDown = _ref => {
|
|
|
33
33
|
setIsOpen(!isOpen);
|
|
34
34
|
}, [isOpen, incomingOnClick]);
|
|
35
35
|
useOutsideClick([menuRef], () => setIsOpen(false));
|
|
36
|
-
return _jsxs(_Fragment, {
|
|
37
|
-
children: [_jsxs(Button, _objectSpread(_objectSpread({
|
|
36
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
37
|
+
children: [/*#__PURE__*/_jsxs(Button, _objectSpread(_objectSpread({
|
|
38
38
|
ref: buttonRef,
|
|
39
39
|
onClick: onMenuClick
|
|
40
40
|
}, buttonProps), {}, {
|
|
41
|
-
children: [label, _jsx(Icon, {
|
|
41
|
+
children: [label, /*#__PURE__*/_jsx(Icon, {
|
|
42
42
|
icon: icon
|
|
43
43
|
})]
|
|
44
|
-
})), _jsx(Flyout, {
|
|
44
|
+
})), /*#__PURE__*/_jsx(Flyout, {
|
|
45
45
|
triggerRef: buttonRef,
|
|
46
46
|
isOpen: isOpen,
|
|
47
47
|
alignment: alignment,
|
|
48
|
-
children: _jsx(DropDownOptionsList, {
|
|
48
|
+
children: /*#__PURE__*/_jsx(DropDownOptionsList, {
|
|
49
49
|
ref: menuRef,
|
|
50
50
|
children: options
|
|
51
51
|
})
|
|
@@ -30,7 +30,7 @@ export const DropDownOption = _ref => {
|
|
|
30
30
|
const colourStyles = textStyles({
|
|
31
31
|
colour: iconColour
|
|
32
32
|
});
|
|
33
|
-
return _jsx(Box, _objectSpread(_objectSpread({
|
|
33
|
+
return /*#__PURE__*/_jsx(Box, _objectSpread(_objectSpread({
|
|
34
34
|
as: as,
|
|
35
35
|
className: clsx(styles.root, className, {
|
|
36
36
|
[styles.disabled]: disabled
|
|
@@ -41,17 +41,17 @@ export const DropDownOption = _ref => {
|
|
|
41
41
|
display: display,
|
|
42
42
|
paddingX: "3",
|
|
43
43
|
paddingY: "2",
|
|
44
|
-
children: _jsxs(Inline, {
|
|
44
|
+
children: /*#__PURE__*/_jsxs(Inline, {
|
|
45
45
|
noWrap: true,
|
|
46
46
|
space: "2",
|
|
47
47
|
width: "full",
|
|
48
48
|
alignX: "space-between",
|
|
49
49
|
alignY: "center",
|
|
50
|
-
children: [_jsx(Text, {
|
|
50
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
51
51
|
as: "p",
|
|
52
52
|
size: "3",
|
|
53
53
|
children: label
|
|
54
|
-
}), icon ? _jsx(Icon, {
|
|
54
|
+
}), icon ? /*#__PURE__*/_jsx(Icon, {
|
|
55
55
|
className: colourStyles,
|
|
56
56
|
size: "medium",
|
|
57
57
|
icon: icon
|
|
@@ -6,17 +6,17 @@ import { Box } from "../Box/index.js";
|
|
|
6
6
|
import { Stack } from "../Stack/index.js";
|
|
7
7
|
import * as styles from "./DropDownOptionsList.css.js";
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
export const DropDownOptionsList = forwardRef((_ref, ref) => {
|
|
9
|
+
export const DropDownOptionsList = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
10
10
|
let {
|
|
11
11
|
children
|
|
12
12
|
} = _ref;
|
|
13
|
-
return _jsx(Box, {
|
|
13
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
14
14
|
ref: ref,
|
|
15
15
|
className: styles.root,
|
|
16
|
-
children: _jsx(Box, {
|
|
16
|
+
children: /*#__PURE__*/_jsx(Box, {
|
|
17
17
|
className: styles.list,
|
|
18
18
|
overflow: "auto",
|
|
19
|
-
children: _jsx(Stack, {
|
|
19
|
+
children: /*#__PURE__*/_jsx(Stack, {
|
|
20
20
|
dividers: true,
|
|
21
21
|
width: "full",
|
|
22
22
|
space: "none",
|
|
@@ -2,8 +2,8 @@ import React, { type InputHTMLAttributes } from 'react';
|
|
|
2
2
|
import { type BoxProps } from '../Box/Box';
|
|
3
3
|
import { type TextProps } from '../Text/Text';
|
|
4
4
|
type PickedBoxProps = Pick<BoxProps, 'display' | 'onFocus' | 'onBlur' | 'onKeyDown'>;
|
|
5
|
-
type FilteredTextProps = Pick<TextProps, 'as' | '
|
|
6
|
-
type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, '
|
|
5
|
+
type FilteredTextProps = Pick<TextProps, 'as' | 'colour' | 'size' | 'children' | 'noWrap'>;
|
|
6
|
+
type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'color' | 'style' | 'is' | 'autoFocus' | 'width' | 'height' | 'onFocus' | 'onBlur' | 'onKeyDown' | keyof FilteredTextProps | keyof PickedBoxProps>;
|
|
7
7
|
export interface EditableTextProps extends FilteredTextProps, InputProps, Partial<PickedBoxProps> {
|
|
8
8
|
className?: string;
|
|
9
9
|
onModeChange?: (mode: InputMode) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditableText.d.ts","sourceRoot":"","sources":["../../../lib/components/EditableText/EditableText.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAGb,KAAK,mBAAmB,EAKxB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAMpD,KAAK,cAAc,GAAG,IAAI,CACzB,QAAQ,EACR,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,CAC9C,CAAC;AAEF,KAAK,iBAAiB,GAAG,IAAI,CAC5B,SAAS,EACT,IAAI,GAAG,
|
|
1
|
+
{"version":3,"file":"EditableText.d.ts","sourceRoot":"","sources":["../../../lib/components/EditableText/EditableText.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAGb,KAAK,mBAAmB,EAKxB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAMpD,KAAK,cAAc,GAAG,IAAI,CACzB,QAAQ,EACR,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,CAC9C,CAAC;AAEF,KAAK,iBAAiB,GAAG,IAAI,CAC5B,SAAS,EACT,IAAI,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,GAAG,QAAQ,CAChD,CAAC;AAEF,KAAK,UAAU,GAAG,IAAI,CACrB,mBAAmB,CAAC,gBAAgB,CAAC,EACnC,OAAO,GACP,OAAO,GACP,IAAI,GACJ,WAAW,GACX,OAAO,GACP,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,WAAW,GACX,MAAM,iBAAiB,GACvB,MAAM,cAAc,CACtB,CAAC;AAEF,MAAM,WAAW,iBAChB,SAAQ,iBAAiB,EACxB,UAAU,EACV,OAAO,CAAC,cAAc,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;CACzC;AAED,KAAK,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAClC,eAAO,MAAM,YAAY,0FAuHxB,CAAC"}
|