@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
|
@@ -12,12 +12,12 @@ import { Text } from "../Text/Text.js";
|
|
|
12
12
|
import * as styles from "./StarRating.css.js";
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
const totalStars = 5;
|
|
15
|
-
export let EStarRatingSize = function (EStarRatingSize) {
|
|
15
|
+
export let EStarRatingSize = /*#__PURE__*/function (EStarRatingSize) {
|
|
16
16
|
EStarRatingSize["Medium"] = "medium";
|
|
17
17
|
EStarRatingSize["Small"] = "small";
|
|
18
18
|
return EStarRatingSize;
|
|
19
19
|
}({});
|
|
20
|
-
var EStarType = function (EStarType) {
|
|
20
|
+
var EStarType = /*#__PURE__*/function (EStarType) {
|
|
21
21
|
EStarType[EStarType["Full"] = 0] = "Full";
|
|
22
22
|
EStarType[EStarType["Half"] = 1] = "Half";
|
|
23
23
|
EStarType[EStarType["Empty"] = 2] = "Empty";
|
|
@@ -25,30 +25,30 @@ var EStarType = function (EStarType) {
|
|
|
25
25
|
}(EStarType || {});
|
|
26
26
|
const starSizeMap = new Map([[EStarRatingSize.Medium, 'medium'], [EStarRatingSize.Small, 'small']]);
|
|
27
27
|
const labelSizeMap = new Map([[EStarRatingSize.Small, '3'], [EStarRatingSize.Medium, '4']]);
|
|
28
|
-
export const StarRating = memo(_ref => {
|
|
28
|
+
export const StarRating = /*#__PURE__*/memo(_ref => {
|
|
29
29
|
let {
|
|
30
30
|
className = '',
|
|
31
31
|
rating,
|
|
32
32
|
label = rating,
|
|
33
33
|
size = EStarRatingSize.Medium
|
|
34
34
|
} = _ref;
|
|
35
|
-
return _jsx(Box, {
|
|
35
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
36
36
|
className: className,
|
|
37
37
|
odComponent: "star-rating",
|
|
38
|
-
children: _jsxs(Inline, {
|
|
38
|
+
children: /*#__PURE__*/_jsxs(Inline, {
|
|
39
39
|
space: "4",
|
|
40
40
|
alignY: "center",
|
|
41
|
-
children: [_jsx(Inline, {
|
|
41
|
+
children: [/*#__PURE__*/_jsx(Inline, {
|
|
42
42
|
space: "none",
|
|
43
43
|
alignY: "center",
|
|
44
44
|
children: Array.from({
|
|
45
45
|
length: totalStars
|
|
46
|
-
}).fill(0).map((_, index) => _jsx(Star, {
|
|
46
|
+
}).fill(0).map((_, index) => /*#__PURE__*/_jsx(Star, {
|
|
47
47
|
index: index,
|
|
48
48
|
rating: rating,
|
|
49
49
|
size: size
|
|
50
50
|
}, index))
|
|
51
|
-
}), label === null ? null : _jsx(Text, {
|
|
51
|
+
}), label === null ? null : /*#__PURE__*/_jsx(Text, {
|
|
52
52
|
size: labelSizeMap.get(size),
|
|
53
53
|
testId: "star-rating-label",
|
|
54
54
|
children: label
|
|
@@ -59,9 +59,11 @@ export const StarRating = memo(_ref => {
|
|
|
59
59
|
StarRating.displayName = 'StarRating';
|
|
60
60
|
const getStarIconType = (index, rating) => {
|
|
61
61
|
if (index + 1 <= Math.floor(rating)) {
|
|
62
|
+
// Is definitely full star
|
|
62
63
|
return EStarType.Full;
|
|
63
64
|
}
|
|
64
65
|
if (index + 1 > Math.ceil(rating)) {
|
|
66
|
+
// Is definitely empty star
|
|
65
67
|
return EStarType.Empty;
|
|
66
68
|
}
|
|
67
69
|
const decimalPart = Math.round((rating - index) * 1e1);
|
|
@@ -81,7 +83,7 @@ const Star = _ref2 => {
|
|
|
81
83
|
} = _ref2;
|
|
82
84
|
const starType = getStarIconType(index, rating);
|
|
83
85
|
const star = starType === EStarType.Half ? StarHalfIcon : StarIcon;
|
|
84
|
-
return _jsx(Icon, {
|
|
86
|
+
return /*#__PURE__*/_jsx(Icon, {
|
|
85
87
|
icon: star,
|
|
86
88
|
size: starSizeMap.get(size),
|
|
87
89
|
className: clsx(sprinkles({
|
|
@@ -31,7 +31,7 @@ const Handle = _ref2 => {
|
|
|
31
31
|
label,
|
|
32
32
|
onClick
|
|
33
33
|
} = _ref2;
|
|
34
|
-
return _jsx(Box, {
|
|
34
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
35
35
|
as: "button",
|
|
36
36
|
className: [styles.handle.default, {
|
|
37
37
|
[styles.handle.disabled]: disabled
|
|
@@ -48,7 +48,7 @@ const Handle = _ref2 => {
|
|
|
48
48
|
disabled: disabled,
|
|
49
49
|
tabIndex: -1,
|
|
50
50
|
onClick: onClick,
|
|
51
|
-
children: _jsx(Icon, {
|
|
51
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
52
52
|
icon: icon,
|
|
53
53
|
size: "small"
|
|
54
54
|
})
|
|
@@ -109,7 +109,7 @@ export const Stepper = _ref3 => {
|
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
}, [min, max, onDecrement, onIncrement, onChange]);
|
|
112
|
-
return _jsx(Box, {
|
|
112
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
113
113
|
className: clsx(className, styles.root, disabled && styles.disabled),
|
|
114
114
|
userSelect: "none",
|
|
115
115
|
"aria-disabled": disabled,
|
|
@@ -122,18 +122,18 @@ export const Stepper = _ref3 => {
|
|
|
122
122
|
minWidth: "fit-content",
|
|
123
123
|
onKeyDown: keyDownHandler,
|
|
124
124
|
odComponent: "stepper",
|
|
125
|
-
children: _jsxs(Inline, {
|
|
125
|
+
children: /*#__PURE__*/_jsxs(Inline, {
|
|
126
126
|
alignX: "space-between",
|
|
127
127
|
noWrap: true,
|
|
128
|
-
children: [_jsx(Box, {
|
|
129
|
-
children: _jsx(Handle, {
|
|
128
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
129
|
+
children: /*#__PURE__*/_jsx(Handle, {
|
|
130
130
|
icon: MinusIcon,
|
|
131
131
|
label: "step down",
|
|
132
132
|
disabled: disabled,
|
|
133
133
|
onClick: onDecrement
|
|
134
134
|
})
|
|
135
|
-
}), _jsx(Box, {
|
|
136
|
-
children: _jsx(Text, {
|
|
135
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
136
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
137
137
|
as: "span",
|
|
138
138
|
colour: "dark",
|
|
139
139
|
display: "block",
|
|
@@ -141,8 +141,8 @@ export const Stepper = _ref3 => {
|
|
|
141
141
|
size: "4",
|
|
142
142
|
children: Number.isFinite(value) ? format(value) : ''
|
|
143
143
|
})
|
|
144
|
-
}), _jsx(Box, {
|
|
145
|
-
children: _jsx(Handle, {
|
|
144
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
145
|
+
children: /*#__PURE__*/_jsx(Handle, {
|
|
146
146
|
icon: PlusIcon,
|
|
147
147
|
label: "step up",
|
|
148
148
|
disabled: disabled,
|
|
@@ -33,18 +33,19 @@ export const StickyBox = _ref => {
|
|
|
33
33
|
const onScroll = () => {
|
|
34
34
|
setWithShadow(parentElement.scrollTop > 3);
|
|
35
35
|
};
|
|
36
|
+
// clean up code
|
|
36
37
|
parentElement.removeEventListener('scroll', onScroll);
|
|
37
38
|
parentElement.addEventListener('scroll', onScroll, {
|
|
38
39
|
passive: true
|
|
39
40
|
});
|
|
40
41
|
return () => parentElement.removeEventListener('scroll', onScroll);
|
|
41
42
|
}, [(_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.parentElement]);
|
|
42
|
-
return noPopShadow ? _jsx(Box, _objectSpread(_objectSpread({
|
|
43
|
+
return noPopShadow ? /*#__PURE__*/_jsx(Box, _objectSpread(_objectSpread({
|
|
43
44
|
className: [className, styles.simpleRoot, styles.top[top], styles.zIndex[zIndex]],
|
|
44
45
|
odComponent: "sticky-box"
|
|
45
46
|
}, rest), {}, {
|
|
46
47
|
children: children
|
|
47
|
-
})) : _jsx(Box, _objectSpread(_objectSpread({
|
|
48
|
+
})) : /*#__PURE__*/_jsx(Box, _objectSpread(_objectSpread({
|
|
48
49
|
ref: containerRef,
|
|
49
50
|
overflow: "hidden",
|
|
50
51
|
className: clsx(className, styles.root, styles.top[top], styles.zIndex[zIndex]),
|
|
@@ -52,7 +53,7 @@ export const StickyBox = _ref => {
|
|
|
52
53
|
boxShadow: withShadow ? boxShadow || '3' : void 0,
|
|
53
54
|
odComponent: "sticky-box"
|
|
54
55
|
}, rest), {}, {
|
|
55
|
-
children: _jsx(Box, {
|
|
56
|
+
children: /*#__PURE__*/_jsx(Box, {
|
|
56
57
|
className: clsx(className, styles.content, {
|
|
57
58
|
[styles.popped]: withShadow
|
|
58
59
|
}),
|
|
@@ -9,8 +9,19 @@ export interface SwitchProps extends AriaSwitchProps, TestId {
|
|
|
9
9
|
isSelected?: AriaSwitchProps['isSelected'];
|
|
10
10
|
onChange?: AriaSwitchProps['onChange'];
|
|
11
11
|
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated use isDisabled instead
|
|
14
|
+
*/
|
|
12
15
|
disabled?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated use isSelected instead
|
|
18
|
+
*/
|
|
13
19
|
toggled?: boolean;
|
|
14
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* The Switch component should be used with a label. The text that describes the switch can be passed in as children
|
|
23
|
+
* where it will be associated with the switch automatically. If it a more complex layout is and the text label is
|
|
24
|
+
* located outside the component ensure that `<Switch>` has an `id` and the label element has an `htmlFor` with that id.
|
|
25
|
+
*/
|
|
15
26
|
export declare const Switch: ({ className, disabled, toggled, isSelected, isDisabled, testId, ...incomingProps }: SwitchProps) => React.JSX.Element;
|
|
16
27
|
//# sourceMappingURL=Switch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../lib/components/Switch/Switch.tsx"],"names":[],"mappings":"AACA,OAAO,KAAiB,MAAM,OAAO,CAAC;AACtC,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAE3E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAQ1C,MAAM,WAAW,WAAY,SAAQ,eAAe,EAAE,MAAM;IAC3D,iBAAiB,CAAC,EAAE,eAAe,CAAC,iBAAiB,CAAC,CAAC;IACvD,IAAI,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IAC/B,KAAK,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;IACjC,UAAU,CAAC,EAAE,eAAe,CAAC,YAAY,CAAC,CAAC;IAC3C,UAAU,CAAC,EAAE,eAAe,CAAC,YAAY,CAAC,CAAC;IAC3C,QAAQ,CAAC,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../lib/components/Switch/Switch.tsx"],"names":[],"mappings":"AACA,OAAO,KAAiB,MAAM,OAAO,CAAC;AACtC,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAE3E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAQ1C,MAAM,WAAW,WAAY,SAAQ,eAAe,EAAE,MAAM;IAC3D,iBAAiB,CAAC,EAAE,eAAe,CAAC,iBAAiB,CAAC,CAAC;IACvD,IAAI,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IAC/B,KAAK,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;IACjC,UAAU,CAAC,EAAE,eAAe,CAAC,YAAY,CAAC,CAAC;IAC3C,UAAU,CAAC,EAAE,eAAe,CAAC,YAAY,CAAC,CAAC;IAC3C,QAAQ,CAAC,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;GAIG;AACH,eAAO,MAAM,MAAM,GAAI,oFAQpB,WAAW,sBA2Cb,CAAC"}
|
|
@@ -14,6 +14,11 @@ import { textStyles } from "../Text/textStyles.js";
|
|
|
14
14
|
import { VisuallyHidden } from "../VisuallyHidden/index.js";
|
|
15
15
|
import * as styles from "./Switch.css.js";
|
|
16
16
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
+
/**
|
|
18
|
+
* The Switch component should be used with a label. The text that describes the switch can be passed in as children
|
|
19
|
+
* where it will be associated with the switch automatically. If it a more complex layout is and the text label is
|
|
20
|
+
* located outside the component ensure that `<Switch>` has an `id` and the label element has an `htmlFor` with that id.
|
|
21
|
+
*/
|
|
17
22
|
export const Switch = _ref => {
|
|
18
23
|
let {
|
|
19
24
|
className,
|
|
@@ -37,15 +42,15 @@ export const Switch = _ref => {
|
|
|
37
42
|
isFocusVisible,
|
|
38
43
|
focusProps
|
|
39
44
|
} = useFocusRing();
|
|
40
|
-
return _jsxs(Box, {
|
|
45
|
+
return /*#__PURE__*/_jsxs(Box, {
|
|
41
46
|
as: "label",
|
|
42
47
|
className: [styles.base, className],
|
|
43
48
|
testId: testId,
|
|
44
|
-
children: [_jsx(VisuallyHidden, {
|
|
45
|
-
children: _jsx("input", _objectSpread(_objectSpread(_objectSpread({}, inputProps), focusProps), {}, {
|
|
49
|
+
children: [/*#__PURE__*/_jsx(VisuallyHidden, {
|
|
50
|
+
children: /*#__PURE__*/_jsx("input", _objectSpread(_objectSpread(_objectSpread({}, inputProps), focusProps), {}, {
|
|
46
51
|
ref: ref
|
|
47
52
|
}))
|
|
48
|
-
}), _jsx(Box, _objectSpread(_objectSpread({
|
|
53
|
+
}), /*#__PURE__*/_jsx(Box, _objectSpread(_objectSpread({
|
|
49
54
|
className: [styles.toggle, textStyles({
|
|
50
55
|
size: '5'
|
|
51
56
|
}), {
|
|
@@ -57,7 +62,7 @@ export const Switch = _ref => {
|
|
|
57
62
|
active: state.isSelected,
|
|
58
63
|
'focus-visible': isFocusVisible
|
|
59
64
|
})), {}, {
|
|
60
|
-
children: _jsx(Box, {
|
|
65
|
+
children: /*#__PURE__*/_jsx(Box, {
|
|
61
66
|
className: [styles.handle.default, {
|
|
62
67
|
[styles.handle.active]: state.isSelected
|
|
63
68
|
}]
|
|
@@ -7,6 +7,10 @@ export const root = style({
|
|
|
7
7
|
display: 'grid',
|
|
8
8
|
gridGap: '0',
|
|
9
9
|
alignItems: 'stretch',
|
|
10
|
+
/*
|
|
11
|
+
This is here as our header row _could_ be position: sticky. When this is the
|
|
12
|
+
case our table rows's still need their fancy row hover states.
|
|
13
|
+
*/
|
|
10
14
|
clipPath: 'inset(0)',
|
|
11
15
|
clip: 'rect(0px, auto, auto, 0px)'
|
|
12
16
|
}, "root");
|
|
@@ -6,17 +6,23 @@ import { Box } from "../Box/Box.js";
|
|
|
6
6
|
import * as styles from "./Table.css.js";
|
|
7
7
|
import { TableContextProvider } from "./context.js";
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
|
|
9
|
+
/*
|
|
10
|
+
Worth noting we use the aria role grid here instead of table, as we have areas
|
|
11
|
+
of interactivity, ie our potential buttons, or sorter headers.
|
|
12
|
+
|
|
13
|
+
@see https://www.w3.org/TR/wai-aria-1.1/#table
|
|
14
|
+
*/
|
|
15
|
+
export const Table = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
10
16
|
let {
|
|
11
17
|
children,
|
|
12
18
|
padding = '4',
|
|
13
19
|
stickyHead = false,
|
|
14
20
|
columnTemplate
|
|
15
21
|
} = _ref;
|
|
16
|
-
return _jsx(TableContextProvider, {
|
|
22
|
+
return /*#__PURE__*/_jsx(TableContextProvider, {
|
|
17
23
|
padding: padding,
|
|
18
24
|
stickyHead: stickyHead,
|
|
19
|
-
children: _jsx(Box, {
|
|
25
|
+
children: /*#__PURE__*/_jsx(Box, {
|
|
20
26
|
ref: ref,
|
|
21
27
|
role: "grid",
|
|
22
28
|
width: "full",
|
|
@@ -6,6 +6,11 @@ import { style } from '@vanilla-extract/css';
|
|
|
6
6
|
import { overdriveTokens as vars } from "../../themes/theme.css.js";
|
|
7
7
|
export const root = style({
|
|
8
8
|
borderBottomColor: vars.colours.gamut.black100,
|
|
9
|
+
/*
|
|
10
|
+
We do this hack, as our row's have no distinct element. Once subgrid is
|
|
11
|
+
supported across browsers we can revisit this approach.
|
|
12
|
+
@see https://caniuse.com/#feat=css-subgrid
|
|
13
|
+
*/
|
|
9
14
|
':before': {
|
|
10
15
|
display: 'block',
|
|
11
16
|
content: '""',
|
|
@@ -8,7 +8,7 @@ import { Text } from "../Text/Text.js";
|
|
|
8
8
|
import * as styles from "./TableCell.css.js";
|
|
9
9
|
import { useTableContext } from "./context.js";
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
export const TableCell = forwardRef((_ref, ref) => {
|
|
11
|
+
export const TableCell = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
12
12
|
var _ref2;
|
|
13
13
|
let {
|
|
14
14
|
padding: incomingPadding,
|
|
@@ -18,9 +18,12 @@ export const TableCell = forwardRef((_ref, ref) => {
|
|
|
18
18
|
} = _ref;
|
|
19
19
|
const tableContext = useTableContext();
|
|
20
20
|
const padding = (_ref2 = incomingPadding !== null && incomingPadding !== void 0 ? incomingPadding : tableContext === null || tableContext === void 0 ? void 0 : tableContext.padding) !== null && _ref2 !== void 0 ? _ref2 : 'none';
|
|
21
|
-
return _jsx(Box, {
|
|
21
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
22
22
|
ref: ref,
|
|
23
|
-
role: "gridcell"
|
|
23
|
+
role: "gridcell"
|
|
24
|
+
// TODO: look into use of `scope` prop on non table headinging cells
|
|
25
|
+
// scope="row"
|
|
26
|
+
,
|
|
24
27
|
display: "flex",
|
|
25
28
|
alignItems: "center",
|
|
26
29
|
position: "relative",
|
|
@@ -29,7 +32,7 @@ export const TableCell = forwardRef((_ref, ref) => {
|
|
|
29
32
|
borderBottomWidth: "1",
|
|
30
33
|
"aria-label": ariaLabel,
|
|
31
34
|
className: styles.root,
|
|
32
|
-
children: typeof children === 'string' || typeof children === 'number' ? _jsx(Text, {
|
|
35
|
+
children: typeof children === 'string' || typeof children === 'number' ? /*#__PURE__*/_jsx(Text, {
|
|
33
36
|
as: "span",
|
|
34
37
|
colour: "dark",
|
|
35
38
|
display: "block",
|
|
@@ -18,7 +18,7 @@ const sortToAria = sort => {
|
|
|
18
18
|
if (sort === 'desc') return 'descending';
|
|
19
19
|
return 'none';
|
|
20
20
|
};
|
|
21
|
-
export const TableHeadCell = forwardRef((_ref, ref) => {
|
|
21
|
+
export const TableHeadCell = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
22
22
|
var _ref2;
|
|
23
23
|
let {
|
|
24
24
|
align = 'left',
|
|
@@ -36,27 +36,27 @@ export const TableHeadCell = forwardRef((_ref, ref) => {
|
|
|
36
36
|
}
|
|
37
37
|
}, [onSort]);
|
|
38
38
|
const shouldSort = typeof sort === 'string';
|
|
39
|
-
const sorter = _jsx(Icon, {
|
|
39
|
+
const sorter = /*#__PURE__*/_jsx(Icon, {
|
|
40
40
|
icon: ArrowUpIcon,
|
|
41
41
|
size: "small",
|
|
42
42
|
className: clsx([styles.sorter.root, styles.sorter[sort !== null && sort !== void 0 ? sort : 'none']])
|
|
43
43
|
});
|
|
44
|
-
const child = _jsxs(Inline, {
|
|
44
|
+
const child = /*#__PURE__*/_jsxs(Inline, {
|
|
45
45
|
alignY: "center",
|
|
46
46
|
alignX: alignmentToFlexAlignment(align),
|
|
47
47
|
space: "1",
|
|
48
|
-
children: [align === 'right' && shouldSort ? sorter : null, _jsxs(Text, {
|
|
48
|
+
children: [align === 'right' && shouldSort ? sorter : null, /*#__PURE__*/_jsxs(Text, {
|
|
49
49
|
strong: true,
|
|
50
50
|
size: "3",
|
|
51
51
|
as: "span",
|
|
52
52
|
className: styles.text,
|
|
53
|
-
children: [children, shouldSort ? _jsxs(VisuallyHidden, {
|
|
53
|
+
children: [children, shouldSort ? /*#__PURE__*/_jsxs(VisuallyHidden, {
|
|
54
54
|
as: "span",
|
|
55
55
|
children: [' ', "sorted ", sortToAria(sort)]
|
|
56
56
|
}) : null]
|
|
57
57
|
}), (align === 'left' || align === 'center') && shouldSort ? sorter : null]
|
|
58
58
|
});
|
|
59
|
-
return _jsx(Box, {
|
|
59
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
60
60
|
as: "th",
|
|
61
61
|
ref: ref,
|
|
62
62
|
role: "columnheader",
|
|
@@ -71,7 +71,7 @@ export const TableHeadCell = forwardRef((_ref, ref) => {
|
|
|
71
71
|
"aria-label": ariaLabel,
|
|
72
72
|
className: tableContext.stickyHead && styles.sticky,
|
|
73
73
|
onClick: sort ? sortClickHandler : undefined,
|
|
74
|
-
children: sort ? _jsx(Box, {
|
|
74
|
+
children: sort ? /*#__PURE__*/_jsx(Box, {
|
|
75
75
|
as: "button",
|
|
76
76
|
display: "block",
|
|
77
77
|
width: "full",
|
|
@@ -4,12 +4,12 @@ import * as React from 'react';
|
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
5
|
import { Box } from "../Box/Box.js";
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
export const TableRow = forwardRef((_ref, ref) => {
|
|
7
|
+
export const TableRow = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
8
8
|
let {
|
|
9
9
|
children,
|
|
10
10
|
onClick
|
|
11
11
|
} = _ref;
|
|
12
|
-
return _jsx(Box, {
|
|
12
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
13
13
|
ref: ref,
|
|
14
14
|
display: "contents",
|
|
15
15
|
role: "row",
|
|
@@ -4,11 +4,11 @@ import * as React from 'react';
|
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
5
|
import { Box } from "../Box/Box.js";
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
export const TableRowGroup = forwardRef((_ref, ref) => {
|
|
7
|
+
export const TableRowGroup = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
8
8
|
let {
|
|
9
9
|
children
|
|
10
10
|
} = _ref;
|
|
11
|
-
return _jsx(Box, {
|
|
11
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
12
12
|
ref: ref,
|
|
13
13
|
role: "rowgroup",
|
|
14
14
|
display: "contents",
|
|
@@ -4,7 +4,7 @@ import { invariant } from '@autoguru/utilities';
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { createContext, useContext, useMemo } from 'react';
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
const tableContext = createContext(null);
|
|
7
|
+
const tableContext = /*#__PURE__*/createContext(null);
|
|
8
8
|
export const TableContextProvider = _ref => {
|
|
9
9
|
let {
|
|
10
10
|
padding,
|
|
@@ -15,7 +15,7 @@ export const TableContextProvider = _ref => {
|
|
|
15
15
|
padding,
|
|
16
16
|
stickyHead
|
|
17
17
|
}), [padding, stickyHead]);
|
|
18
|
-
return _jsx(tableContext.Provider, {
|
|
18
|
+
return /*#__PURE__*/_jsx(tableContext.Provider, {
|
|
19
19
|
value: value,
|
|
20
20
|
children: children
|
|
21
21
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ElementType, ReactElement, ReactNode } from 'react';
|
|
3
|
-
export interface
|
|
3
|
+
export interface Props {
|
|
4
4
|
children?: ReactNode;
|
|
5
5
|
id?: string;
|
|
6
|
-
|
|
6
|
+
is?: ElementType | ReactElement;
|
|
7
7
|
indication?: number;
|
|
8
8
|
}
|
|
9
|
-
export declare const Tab: React.ForwardRefExoticComponent<
|
|
9
|
+
export declare const Tab: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
|
|
10
10
|
export default Tab;
|
|
11
11
|
//# sourceMappingURL=Tab.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tab.d.ts","sourceRoot":"","sources":["../../../lib/components/Tabs/Tab.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAGN,WAAW,EAGX,YAAY,EACZ,SAAS,EAET,MAAM,OAAO,CAAC;AAWf,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"Tab.d.ts","sourceRoot":"","sources":["../../../lib/components/Tabs/Tab.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAGN,WAAW,EAGX,YAAY,EACZ,SAAS,EAET,MAAM,OAAO,CAAC;AAWf,MAAM,WAAW,KAAK;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,WAAW,GAAG,YAAY,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,GAAG,8EA+Ef,CAAC;AAIF,eAAe,GAAG,CAAC"}
|
|
@@ -12,12 +12,12 @@ import * as styles from "./Tab.css.js";
|
|
|
12
12
|
import { TabListContext } from "./TabList.js";
|
|
13
13
|
import { TabsContext } from "./Tabs.js";
|
|
14
14
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
-
export const Tab = forwardRef((_ref, ref) => {
|
|
15
|
+
export const Tab = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
16
16
|
let {
|
|
17
17
|
children,
|
|
18
18
|
id: incomingId = null,
|
|
19
19
|
indication = null,
|
|
20
|
-
|
|
20
|
+
is: Component = 'button'
|
|
21
21
|
} = _ref;
|
|
22
22
|
const tabsContext = useContext(TabsContext);
|
|
23
23
|
const tabListContext = useContext(TabListContext);
|
|
@@ -52,15 +52,15 @@ export const Tab = forwardRef((_ref, ref) => {
|
|
|
52
52
|
},
|
|
53
53
|
ref
|
|
54
54
|
};
|
|
55
|
-
const child = _jsxs(Inline, {
|
|
55
|
+
const child = /*#__PURE__*/_jsxs(Inline, {
|
|
56
56
|
noWrap: true,
|
|
57
57
|
space: "2",
|
|
58
58
|
alignY: "center",
|
|
59
59
|
alignX: "center",
|
|
60
|
-
children: [_jsx("span", {
|
|
60
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
61
61
|
className: styles.item,
|
|
62
62
|
children: children
|
|
63
|
-
}), typeof indication === 'number' && _jsx(Text, {
|
|
63
|
+
}), typeof indication === 'number' && /*#__PURE__*/_jsx(Text, {
|
|
64
64
|
strong: true,
|
|
65
65
|
as: "span",
|
|
66
66
|
size: "2",
|
|
@@ -74,7 +74,7 @@ export const Tab = forwardRef((_ref, ref) => {
|
|
|
74
74
|
children: indication
|
|
75
75
|
})]
|
|
76
76
|
});
|
|
77
|
-
return isValidElement(Component) ? cloneElement(Component, props, child) : createElement(Component, props, child);
|
|
77
|
+
return /*#__PURE__*/isValidElement(Component) ? /*#__PURE__*/cloneElement(Component, props, child) : /*#__PURE__*/createElement(Component, props, child);
|
|
78
78
|
});
|
|
79
79
|
Tab.displayName = 'Tab';
|
|
80
80
|
export default Tab;
|
|
@@ -16,7 +16,7 @@ const defaultEnglish = {
|
|
|
16
16
|
next: 'scroll tabs right',
|
|
17
17
|
prev: 'scroll tabs left'
|
|
18
18
|
};
|
|
19
|
-
export const TabListContext = createContext(null);
|
|
19
|
+
export const TabListContext = /*#__PURE__*/createContext(null);
|
|
20
20
|
export const TabList = _ref => {
|
|
21
21
|
let {
|
|
22
22
|
children,
|
|
@@ -27,8 +27,8 @@ export const TabList = _ref => {
|
|
|
27
27
|
const wrapperRef = useRef(null);
|
|
28
28
|
const innerRef = useRef(null);
|
|
29
29
|
const tabs = Children.map(flattenChildren(children), (child, index) => {
|
|
30
|
-
if (!isValidElement(child)) return null;
|
|
31
|
-
return _jsx(TabListContext.Provider, {
|
|
30
|
+
if (! /*#__PURE__*/isValidElement(child)) return null;
|
|
31
|
+
return /*#__PURE__*/_jsx(TabListContext.Provider, {
|
|
32
32
|
value: index,
|
|
33
33
|
children: child
|
|
34
34
|
});
|
|
@@ -86,13 +86,13 @@ export const TabList = _ref => {
|
|
|
86
86
|
updateScrollButtonState();
|
|
87
87
|
}, [children, updateScrollButtonState]);
|
|
88
88
|
const shouldShowScrollButtons = scrollable && (displayScroll.start || displayScroll.end);
|
|
89
|
-
return _jsxs(Box, {
|
|
89
|
+
return /*#__PURE__*/_jsxs(Box, {
|
|
90
90
|
alignItems: "center",
|
|
91
91
|
className: styles.styledTabList({
|
|
92
92
|
appearance,
|
|
93
93
|
scroll: scrollable
|
|
94
94
|
}),
|
|
95
|
-
children: [shouldShowScrollButtons ? _jsx(Button, {
|
|
95
|
+
children: [shouldShowScrollButtons ? /*#__PURE__*/_jsx(Button, {
|
|
96
96
|
minimal: true,
|
|
97
97
|
rounded: true,
|
|
98
98
|
withDoubleClicks: true,
|
|
@@ -100,14 +100,14 @@ export const TabList = _ref => {
|
|
|
100
100
|
disabled: !displayScroll.start,
|
|
101
101
|
onClick: handleStartButton,
|
|
102
102
|
"aria-label": defaultEnglish.prev,
|
|
103
|
-
children: _jsx(Icon, {
|
|
103
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
104
104
|
icon: ArrowLeftIcon
|
|
105
105
|
})
|
|
106
|
-
}) : null, _jsx(Box, {
|
|
106
|
+
}) : null, /*#__PURE__*/_jsx(Box, {
|
|
107
107
|
ref: wrapperRef,
|
|
108
108
|
className: [scrollable && styles.listWrapperScroll],
|
|
109
109
|
onScroll: handleOnScroll,
|
|
110
|
-
children: _jsx(Box, {
|
|
110
|
+
children: /*#__PURE__*/_jsx(Box, {
|
|
111
111
|
ref: innerRef,
|
|
112
112
|
display: stretch ? 'flex' : 'block',
|
|
113
113
|
flexWrap: "nowrap",
|
|
@@ -119,7 +119,7 @@ export const TabList = _ref => {
|
|
|
119
119
|
}),
|
|
120
120
|
children: tabs
|
|
121
121
|
})
|
|
122
|
-
}), shouldShowScrollButtons ? _jsx(Button, {
|
|
122
|
+
}), shouldShowScrollButtons ? /*#__PURE__*/_jsx(Button, {
|
|
123
123
|
minimal: true,
|
|
124
124
|
rounded: true,
|
|
125
125
|
withDoubleClicks: true,
|
|
@@ -127,7 +127,7 @@ export const TabList = _ref => {
|
|
|
127
127
|
disabled: !displayScroll.end,
|
|
128
128
|
onClick: handleEndButton,
|
|
129
129
|
"aria-label": defaultEnglish.next,
|
|
130
|
-
children: _jsx(Icon, {
|
|
130
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
131
131
|
icon: ArrowRightIcon
|
|
132
132
|
})
|
|
133
133
|
}) : null]
|
|
@@ -22,7 +22,7 @@ export const TabPane = _ref => {
|
|
|
22
22
|
} = tabPanesContext;
|
|
23
23
|
const myId = typeof incomingId === 'string' ? incomingId : `${tabsContext.id}-${paneIndex}-tab`;
|
|
24
24
|
const isActive = tabsContext.activeIndex === paneIndex;
|
|
25
|
-
return _jsx(Box, {
|
|
25
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
26
26
|
display: isActive ? undefined : 'none',
|
|
27
27
|
"aria-hidden": isActive ? undefined : true,
|
|
28
28
|
className: styles.root,
|
|
@@ -8,6 +8,7 @@ interface TabPanesContextValue {
|
|
|
8
8
|
}
|
|
9
9
|
export declare const TabPanesContext: React.Context<TabPanesContextValue | null>;
|
|
10
10
|
interface TabPanesProps extends Pick<ComponentProps<typeof Box>, 'paddingTop' | 'paddingBottom'> {
|
|
11
|
+
/** Render tab panels even when visually hidden. */
|
|
11
12
|
renderInactivePanes?: boolean;
|
|
12
13
|
children?: ReactNode;
|
|
13
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabPanes.d.ts","sourceRoot":"","sources":["../../../lib/components/Tabs/TabPanes.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAA2B,SAAS,EAAE,MAAM,OAAO,CAAC;AAG3D,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAIjC,UAAU,oBAAoB;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,eAAe,4CAAmD,CAAC;AAEhF,UAAU,aACT,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,EAAE,YAAY,GAAG,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"TabPanes.d.ts","sourceRoot":"","sources":["../../../lib/components/Tabs/TabPanes.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAA2B,SAAS,EAAE,MAAM,OAAO,CAAC;AAG3D,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAIjC,UAAU,oBAAoB;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,eAAe,4CAAmD,CAAC;AAEhF,UAAU,aACT,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,EAAE,YAAY,GAAG,eAAe,CAAC;IACxE,mDAAmD;IACnD,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,eAAO,MAAM,QAAQ,EAAE,iBAAiB,CAAC,aAAa,CAuBrD,CAAC"}
|
|
@@ -6,7 +6,7 @@ import flattenChildren from 'react-keyed-flatten-children';
|
|
|
6
6
|
import { Box } from "../Box/Box.js";
|
|
7
7
|
import * as styles from "./TabPanes.css.js";
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
export const TabPanesContext = createContext(null);
|
|
9
|
+
export const TabPanesContext = /*#__PURE__*/createContext(null);
|
|
10
10
|
export const TabPanes = _ref => {
|
|
11
11
|
let {
|
|
12
12
|
renderInactivePanes = false,
|
|
@@ -14,12 +14,12 @@ export const TabPanes = _ref => {
|
|
|
14
14
|
paddingTop = '6',
|
|
15
15
|
paddingBottom = '6'
|
|
16
16
|
} = _ref;
|
|
17
|
-
return _jsx(Box, {
|
|
17
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
18
18
|
paddingTop: paddingTop,
|
|
19
19
|
paddingBottom: paddingBottom,
|
|
20
20
|
className: styles.root,
|
|
21
21
|
width: "full",
|
|
22
|
-
children: Children.map(flattenChildren(children), (child, index) => _jsx(TabPanesContext.Provider, {
|
|
22
|
+
children: Children.map(flattenChildren(children), (child, index) => /*#__PURE__*/_jsx(TabPanesContext.Provider, {
|
|
23
23
|
value: {
|
|
24
24
|
paneIndex: index,
|
|
25
25
|
renderInactive: renderInactivePanes
|
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
import { createContext, useMemo } from 'react';
|
|
5
5
|
import { useId, useUncontrolledState } from "../../utils/index.js";
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
export const TabsContext = createContext(null);
|
|
7
|
+
export const TabsContext = /*#__PURE__*/createContext(null);
|
|
8
8
|
export const Tabs = _ref => {
|
|
9
9
|
let {
|
|
10
10
|
id: incomingId,
|
|
@@ -15,7 +15,7 @@ export const Tabs = _ref => {
|
|
|
15
15
|
} = _ref;
|
|
16
16
|
const [activeState, setActiveState] = useUncontrolledState(active, onChange);
|
|
17
17
|
const id = useId(incomingId !== null && incomingId !== void 0 ? incomingId : undefined);
|
|
18
|
-
return _jsx(TabsContext.Provider, {
|
|
18
|
+
return /*#__PURE__*/_jsx(TabsContext.Provider, {
|
|
19
19
|
value: useMemo(() => ({
|
|
20
20
|
id,
|
|
21
21
|
activeIndex: activeState,
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React, { type ComponentProps } from 'react';
|
|
1
|
+
import React from 'react';
|
|
3
2
|
import { type Sprinkles } from '../../styles/sprinkles.css';
|
|
4
3
|
import type { TestId } from '../../types';
|
|
5
4
|
import type { TextStyleProps } from './textStyles';
|
|
6
|
-
type ElementAttributes = React.ComponentPropsWithoutRef<'p'> & Pick<ComponentProps<'label'>, 'htmlFor'>;
|
|
5
|
+
type ElementAttributes = React.ComponentPropsWithoutRef<'p'> & Pick<React.ComponentProps<'label'>, 'htmlFor'>;
|
|
7
6
|
type AdditionalStyleProps = Pick<Sprinkles, 'display' | 'm' | 'mb' | 'ml' | 'mr' | 'mt' | 'mx' | 'my' | 'margin' | 'marginBottom' | 'marginLeft' | 'marginRight' | 'marginTop' | 'marginX' | 'marginY' | 'p' | 'pb' | 'pl' | 'pr' | 'pt' | 'px' | 'py' | 'padding' | 'paddingBottom' | 'paddingLeft' | 'paddingRight' | 'paddingTop' | 'paddingX' | 'paddingY'>;
|
|
8
|
-
export interface TextProps extends Omit<ElementAttributes, '
|
|
9
|
-
className?: ClassName;
|
|
7
|
+
export interface TextProps extends Omit<ElementAttributes, 'color' | 'is'>, AdditionalStyleProps, TextStyleProps, TestId {
|
|
10
8
|
}
|
|
11
9
|
export declare const Text: React.ForwardRefExoticComponent<TextProps & React.RefAttributes<HTMLElement>>;
|
|
12
10
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../lib/components/Text/Text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../lib/components/Text/Text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAG1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,KAAK,iBAAiB,GAAG,KAAK,CAAC,wBAAwB,CAAC,GAAG,CAAC,GAC3D,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,CAAC;AAEhD,KAAK,oBAAoB,GAAG,IAAI,CAC/B,SAAS,EACP,SAAS,GACT,GAAG,GACH,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,QAAQ,GACR,cAAc,GACd,YAAY,GACZ,aAAa,GACb,WAAW,GACX,SAAS,GACT,SAAS,GACT,GAAG,GACH,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,SAAS,GACT,eAAe,GACf,aAAa,GACb,cAAc,GACd,YAAY,GACZ,UAAU,GACV,UAAU,CACZ,CAAC;AAEF,MAAM,WAAW,SAChB,SAAQ,IAAI,CAAC,iBAAiB,EAAE,OAAO,GAAG,IAAI,CAAC,EAC9C,oBAAoB,EACpB,cAAc,EACd,MAAM;CAAG;AAEX,eAAO,MAAM,IAAI,+EA+ChB,CAAC"}
|